LP#1719726: make new FK constraint consistent
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 27 Sep 2017 16:25:16 +0000 (12:25 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 28 Sep 2017 17:28:58 +0000 (13:28 -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 3c85407..e61abc9 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)