Index: openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.10.0d4-5.10.0d5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.10.0d4-5.10.0d5.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.10.0d4-5.10.0d5.sql 21 Feb 2018 14:00:56 -0000 1.1 +++ openacs-4/packages/acs-content-repository/sql/postgresql/upgrade/upgrade-5.10.0d4-5.10.0d5.sql 21 Feb 2018 19:08:07 -0000 1.2 @@ -9,16 +9,20 @@ -- Cleanup --- delete dead tuples coming from sins of the past (mostly erased portraits) -select acs_object__delete(object_id) from acs_objects o - where object_type = 'cr_item_child_rel' and - not exists (select 1 from cr_child_rels where rel_id = o.object_id); +-- This is not done unless uncommented, because could take a long time on busy sites! +-- -- delete dead tuples coming from sins of the past (mostly erased portraits) +-- select acs_object__delete(object_id) from acs_objects o +-- where object_type = 'cr_item_child_rel' and +-- not exists (select 1 from cr_child_rels where rel_id = o.object_id); -- Data model upgrade alter table images - drop constraint images_image_id_fk, + -- current name of the constraint + drop constraint if exists images_image_id_fk, + -- old name of the same constraint in old databases + drop constraint if exists "$1", add constraint images_image_id_fk foreign key (image_id) references cr_revisions(revision_id) on delete cascade; Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.10.0d3-5.10.0d4.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.10.0d3-5.10.0d4.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.10.0d3-5.10.0d4.sql 21 Feb 2018 14:00:56 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.10.0d3-5.10.0d4.sql 21 Feb 2018 19:08:07 -0000 1.2 @@ -9,12 +9,13 @@ -- Cleanup - select acs_object__delete(object_id) - from acs_objects o - where object_type = 'user_portrait_rel' - and not exists ( - select 1 from acs_rels - where rel_id = o.object_id); +-- This is not done if not uncommented, as could take a long time on busy sites! + -- select acs_object__delete(object_id) + -- from acs_objects o + -- where object_type = 'user_portrait_rel' + -- and not exists ( + -- select 1 from acs_rels + -- where rel_id = o.object_id); -- Data model upgrade