Rules are not inherited by child tables, so must
add one explicitly.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16910
dcc99617-32d9-48b4-a31d-
7c20da2025e4
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0332'); -- gmc
+INSERT INTO config.upgrade_log (version) VALUES ('0333'); -- gmc
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
ALTER TABLE serial.unit ADD PRIMARY KEY (id);
+-- must create this rule explicitly; it is not inherited from asset.copy
+CREATE RULE protect_serial_unit_delete AS ON DELETE TO serial.unit DO INSTEAD UPDATE serial.unit SET deleted = TRUE WHERE OLD.id = serial.unit.id;
+
CREATE TABLE serial.item (
id SERIAL PRIMARY KEY,
creator INT NOT NULL
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0333'); --gmc
+
+-- must create this rule explicitly; it is not inherited from asset.copy
+CREATE RULE protect_serial_unit_delete AS ON DELETE TO serial.unit DO INSTEAD UPDATE serial.unit SET deleted = TRUE WHERE OLD.id = serial.unit.id;
+
+COMMIT;