Add an ON DELETE CASCADE clause to the foreign key pointing
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Jul 2009 04:43:03 +0000 (04:43 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Jul 2009 04:43:03 +0000 (04:43 +0000)
from action.hold_notification to action.hold_request.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13521 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/090.schema.action.sql

index b0db67d..963906a 100644 (file)
@@ -313,8 +313,10 @@ CREATE INDEX ahrn_hold_idx ON action.hold_request_note (hold);
 
 CREATE TABLE action.hold_notification (
        id              SERIAL                          PRIMARY KEY,
-       hold            INT                             NOT NULL REFERENCES action.hold_request (id) DEFERRABLE INITIALLY DEFERRED,
-       notify_staff    INT                             REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
+       hold            INT                             NOT NULL REFERENCES action.hold_request (id)
+                                                                       ON DELETE CASCADE
+                                                                       DEFERRABLE INITIALLY DEFERRED,
+       notify_staff    INT                     REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
        notify_time     TIMESTAMP WITH TIME ZONE        NOT NULL DEFAULT NOW(),
        method          TEXT                            NOT NULL, -- email address or phone number
        note            TEXT