LP#1719726: make new FK constraint consistent
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 27 Sep 2017 16:25:16 +0000 (12:25 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 27 Sep 2017 19:50:09 +0000 (15:50 -0400)
The constraint fieldset_fieldset_group_fkey will now
do 'ON DELETE CASCADE' regardless of whether the database
was created from scratch or upgraded.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/sql/Pg/090.schema.action.sql

index 8211b23..7d06aba 100644 (file)
@@ -826,7 +826,7 @@ CREATE TABLE action.fieldset_group (
 CREATE TABLE action.fieldset (
     id              SERIAL          PRIMARY KEY,
     fieldset_group  INT             REFERENCES action.fieldset_group (id)
-                                    DEFERRABLE INITIALLY DEFERRED,
+                                    ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
     owner           INT             NOT NULL REFERENCES actor.usr (id)
                                     DEFERRABLE INITIALLY DEFERRED,
        owning_lib      INT             NOT NULL REFERENCES actor.org_unit (id)