diff --git a/roles/database/files/upgrade/8.8.9.sql b/roles/database/files/upgrade/8.8.9.sql index 95b7402a2..3c4e8b526 100644 --- a/roles/database/files/upgrade/8.8.9.sql +++ b/roles/database/files/upgrade/8.8.9.sql @@ -44,6 +44,10 @@ alter table owner add column if not exists next_recert_date Timestamp; alter table owner drop constraint if exists owner_last_recertifier_uiuser_uiuser_id_f_key; alter table owner add constraint owner_last_recertifier_uiuser_uiuser_id_f_key foreign key (last_recertifier) references uiuser (uiuser_id) on update restrict; +alter table recertification add column if not exists owner_recert_id bigint; + +alter table recertification drop constraint if exists recertification_owner_recertification_foreign_key; +ALTER TABLE recertification ADD CONSTRAINT recertification_owner_recertification_foreign_key FOREIGN KEY (owner_recert_id) REFERENCES owner_recertification(id) ON UPDATE RESTRICT ON DELETE CASCADE; DO $$ BEGIN diff --git a/roles/database/files/upgrade/8.9.1.sql b/roles/database/files/upgrade/8.9.1.sql index 614c54d9f..bcabadd84 100644 --- a/roles/database/files/upgrade/8.9.1.sql +++ b/roles/database/files/upgrade/8.9.1.sql @@ -9,7 +9,3 @@ ALTER TABLE owner_recertification ADD CONSTRAINT owner_recertification_report_fo alter table owner add column if not exists recert_active boolean default false; -alter table recertification add column if not exists owner_recert_id bigint; - -alter table recertification drop constraint if exists recertification_owner_recertification_foreign_key; -ALTER TABLE recertification ADD CONSTRAINT recertification_owner_recertification_foreign_key FOREIGN KEY (owner_recert_id) REFERENCES owner_recertification(id) ON UPDATE RESTRICT ON DELETE CASCADE;