diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-05-16 09:22:36 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-05-16 09:22:36 +0000 |
commit | 3d38b57220a6302f34d31b332c1b680569493ab9 (patch) | |
tree | 7c35a1a4d40bfeec3569d4ca3efbd47e854924b4 /database | |
parent | 2d9eaf01cf87f56f5b159ac25c588097316dd74f (diff) | |
download | brdo-3d38b57220a6302f34d31b332c1b680569493ab9.tar.gz brdo-3d38b57220a6302f34d31b332c1b680569493ab9.tar.bz2 |
- Patch #41481 by Zen, Cvbge, sun et al: bugfix: duplicate key error while editing locale strings.
Diffstat (limited to 'database')
-rw-r--r-- | database/database.pgsql | 4 | ||||
-rw-r--r-- | database/updates.inc | 16 |
2 files changed, 17 insertions, 3 deletions
diff --git a/database/database.pgsql b/database/database.pgsql index c2449b591..4729a99eb 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -378,9 +378,9 @@ CREATE TABLE locales_target ( translation text DEFAULT '' NOT NULL, locale varchar(12) NOT NULL default '', plid int4 NOT NULL default '0', - plural int4 NOT NULL default '0', - UNIQUE (lid) + plural int4 NOT NULL default '0' ); +CREATE INDEX locales_target_lid_idx ON locales_target(lid); CREATE INDEX locales_target_locale_idx ON locales_target(locale); CREATE INDEX locales_target_plid_idx ON locales_target(plid); CREATE INDEX locales_target_plural_idx ON locales_target(plural); diff --git a/database/updates.inc b/database/updates.inc index a854e97ce..e6c1874aa 100644 --- a/database/updates.inc +++ b/database/updates.inc @@ -1218,7 +1218,7 @@ function system_update_159() { case 'mysql': $ret[] = update_sql("UPDATE {sequences} SET id = $vid WHERE name = '{node_revisions}_vid'"); break; - + case 'pgsql': $ret[] = update_sql("SELECT setval('{node_revisions}_vid_seq', $vid)"); break; @@ -1993,3 +1993,17 @@ function system_update_181() { } return $ret; } + +/** + * The lid field in pgSQL should not be UNIQUE, but an INDEX. + */ +function system_update_182() { + $ret = array(); + + if ($GLOBALS['db_type'] == 'pgsql') { + $ret[] = update_sql('ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_lid_idx'); + $ret[] = update_sql('CREATE INDEX {locales_target}_lid_idx ON {locales_target} (lid)'); + } + + return $ret; +} |