From 93be9a718846b774c26a517026c7e7f5a847934c Mon Sep 17 00:00:00 2001 From: Joao Inacio Date: Fri, 7 Nov 2014 13:35:55 +0000 Subject: [PATCH] Fix EZP-23595: update sql to cleanup extra rows in ezuser_setting table --- update/database/mysql/5.4/dbupdate-5.3.0-to-5.4.0.sql | 3 +++ update/database/postgresql/5.4/dbupdate-5.3.0-to-5.4.0.sql | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/update/database/mysql/5.4/dbupdate-5.3.0-to-5.4.0.sql b/update/database/mysql/5.4/dbupdate-5.3.0-to-5.4.0.sql index ba59b796eb5..0d7beb0537c 100644 --- a/update/database/mysql/5.4/dbupdate-5.3.0-to-5.4.0.sql +++ b/update/database/mysql/5.4/dbupdate-5.3.0-to-5.4.0.sql @@ -16,3 +16,6 @@ WHERE ezcontentclass_attribute.id = ezinfocollection_attribute.contentclass_attribute_id AND ezinfocollection_attribute.data_int = 0 AND ezcontentclass_attribute.data_type_string IN ( 'ezdate', 'ezdatetime' ); + +-- See https://jira.ez.no/browse/EZP-23595 - cleanup extra lines in the ezuser_setting table +DELETE FROM ezuser_setting where user_id not in (SELECT contentobject_id FROM ezuser); diff --git a/update/database/postgresql/5.4/dbupdate-5.3.0-to-5.4.0.sql b/update/database/postgresql/5.4/dbupdate-5.3.0-to-5.4.0.sql index 8ce9f365355..d8af310caac 100644 --- a/update/database/postgresql/5.4/dbupdate-5.3.0-to-5.4.0.sql +++ b/update/database/postgresql/5.4/dbupdate-5.3.0-to-5.4.0.sql @@ -15,4 +15,7 @@ FROM ezcontentclass_attribute WHERE ezcontentclass_attribute.id = ezinfocollection_attribute.contentclass_attribute_id AND ezinfocollection_attribute.data_int = 0 - AND ezcontentclass_attribute.data_type_string IN ( 'ezdate', 'ezdatetime' ); \ No newline at end of file + AND ezcontentclass_attribute.data_type_string IN ( 'ezdate', 'ezdatetime' ); + +-- See https://jira.ez.no/browse/EZP-23595 - cleanup extra lines in the ezuser_setting table +DELETE FROM ezuser_setting where user_id not in (SELECT contentobject_id FROM ezuser);