From: berick Date: Thu, 19 May 2011 16:37:52 +0000 (-0400) Subject: Clean up match_set data on delete X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7f913b210b523d68dd4bb7395b37dd5f824e1e22;p=contrib%2FConifer.git Clean up match_set data on delete Delete via cascade match_set_point's and match_set_quality entries for a given match_set on delete --- diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index d6810f6f50..b136e8e035 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -15,7 +15,7 @@ CREATE TABLE vandelay.match_set ( -- Table to define match points, either FF via SVF or tag+subfield CREATE TABLE vandelay.match_set_point ( id SERIAL PRIMARY KEY, - match_set INT REFERENCES vandelay.match_set (id), + match_set INT REFERENCES vandelay.match_set (id) ON DELETE CASCADE, parent INT REFERENCES vandelay.match_set_point (id), bool_op TEXT CHECK (bool_op IS NULL OR (bool_op IN ('AND','OR','NOT'))), svf TEXT REFERENCES config.record_attr_definition (name), @@ -33,7 +33,7 @@ CREATE TABLE vandelay.match_set_point ( CREATE TABLE vandelay.match_set_quality ( id SERIAL PRIMARY KEY, - match_set INT NOT NULL REFERENCES vandelay.match_set (id), + match_set INT NOT NULL REFERENCES vandelay.match_set (id) ON DELETE CASCADE, svf TEXT REFERENCES config.record_attr_definition, tag TEXT, subfield TEXT,