LP#1676608: avoid constraint creation that requires a TARDIS
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 28 Feb 2018 16:41:30 +0000 (11:41 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 28 Feb 2018 16:41:30 +0000 (11:41 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/upgrade/1095.schema.copy_alerts.sql

index ceaba70..e5b2ed0 100644 (file)
@@ -83,10 +83,6 @@ BEGIN
 END;
 $f$ LANGUAGE PLPGSQL VOLATILE COST 50;
 
-CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey
-        AFTER UPDATE OR INSERT ON asset.copy_alert
-        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey();
-
 CREATE TABLE actor.copy_alert_suppress (
     id          serial primary key,
     org         int not null references actor.org_unit (id) on delete cascade,
@@ -105,6 +101,10 @@ CREATE TABLE asset.copy_alert (
     ack_staff   bigint references actor.usr (id) on delete set null
 );
 
+CREATE CONSTRAINT TRIGGER inherit_asset_copy_alert_copy_fkey
+        AFTER UPDATE OR INSERT ON asset.copy_alert
+        DEFERRABLE FOR EACH ROW EXECUTE PROCEDURE evergreen.asset_copy_alert_copy_inh_fkey();
+
 CREATE VIEW asset.active_copy_alert AS
     SELECT  *
       FROM  asset.copy_alert