diff --git a/update/database/mysql/5.0/dbupdate-4.7.0-to-5.0.0.sql b/update/database/mysql/5.0/dbupdate-4.7.0-to-5.0.0.sql index 29fe5f0bbc4..f243139231a 100644 --- a/update/database/mysql/5.0/dbupdate-4.7.0-to-5.0.0.sql +++ b/update/database/mysql/5.0/dbupdate-4.7.0-to-5.0.0.sql @@ -15,7 +15,7 @@ UPDATE ezcobj_state_group_language SET real_language_id = language_id & ~1; ALTER TABLE ezgeneral_digest_user_settings ADD COLUMN user_id int(11) NOT NULL default '0'; DELETE FROM ezgeneral_digest_user_settings WHERE address NOT IN (SELECT email FROM ezuser); UPDATE ezgeneral_digest_user_settings SET user_id = (SELECT ezuser.contentobject_id - FROM ezuser WHERE ezuser.email = ezgeneral_digest_user_settings.address); + FROM ezuser WHERE ezuser.email = ezgeneral_digest_user_settings.address LIMIT 1); ALTER TABLE ezgeneral_digest_user_settings ADD UNIQUE INDEX ezgeneral_digest_user_id (user_id); ALTER TABLE ezgeneral_digest_user_settings DROP COLUMN address; ALTER TABLE ezuser ADD INDEX ezuser_login (login); diff --git a/update/database/postgresql/5.0/dbupdate-4.7.0-to-5.0.0.sql b/update/database/postgresql/5.0/dbupdate-4.7.0-to-5.0.0.sql index ba8b1ddf418..d768066b22d 100644 --- a/update/database/postgresql/5.0/dbupdate-4.7.0-to-5.0.0.sql +++ b/update/database/postgresql/5.0/dbupdate-4.7.0-to-5.0.0.sql @@ -14,7 +14,7 @@ UPDATE ezcobj_state_group_language SET real_language_id = language_id & ~1; ALTER TABLE ezgeneral_digest_user_settings ADD user_id integer DEFAULT 0 NOT NULL; DELETE FROM ezgeneral_digest_user_settings WHERE address NOT IN (SELECT email FROM ezuser); UPDATE ezgeneral_digest_user_settings SET user_id = (SELECT ezuser.contentobject_id - FROM ezuser WHERE ezuser.email = ezgeneral_digest_user_settings.address); + FROM ezuser WHERE ezuser.email = ezgeneral_digest_user_settings.address LIMIT 1); CREATE INDEX ezgeneral_digest_user_id ON ezgeneral_digest_user_settings USING btree (user_id); ALTER TABLE ezgeneral_digest_user_settings DROP COLUMN address; CREATE INDEX ezuser_login ON ezuser USING btree (login);