]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/ZZZZ.schema.issuance_scap_fkey.sql
LP#1708291: web staff client serials module
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / ZZZZ.schema.issuance_scap_fkey.sql
1 BEGIN;
2
3 ALTER TABLE serial.issuance DROP CONSTRAINT IF EXISTS issuance_caption_and_pattern_fkey;
4
5 -- Using NOT VALID and VALIDATE CONSTRAINT limits the impact to concurrent work.
6 -- For details, see: https://www.postgresql.org/docs/current/static/sql-altertable.html
7
8 ALTER TABLE serial.issuance ADD CONSTRAINT issuance_caption_and_pattern_fkey
9     FOREIGN KEY (caption_and_pattern)
10     REFERENCES serial.caption_and_pattern (id)
11     ON DELETE CASCADE
12     DEFERRABLE INITIALLY DEFERRED
13     NOT VALID;
14
15 ALTER TABLE serial.issuance VALIDATE CONSTRAINT issuance_caption_and_pattern_fkey;
16
17 COMMIT;
18