From fe16ee4245a7df991ce645967a6ffdd798c13f46 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 30 May 2011 23:49:18 -0400 Subject: [PATCH] Move RULE down so that the named tables actually exist Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/011.schema.authority.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/sql/Pg/011.schema.authority.sql b/Open-ILS/src/sql/Pg/011.schema.authority.sql index 35fd6e33f6..b2b462ec1e 100644 --- a/Open-ILS/src/sql/Pg/011.schema.authority.sql +++ b/Open-ILS/src/sql/Pg/011.schema.authority.sql @@ -83,7 +83,6 @@ CREATE INDEX authority_record_deleted_idx ON authority.record_entry(deleted) WHE CREATE TRIGGER a_marcxml_is_well_formed BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.check_marcxml_well_formed(); CREATE TRIGGER b_maintain_901 BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE evergreen.maintain_901(); CREATE TRIGGER c_maintain_control_numbers BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE maintain_control_numbers(); -CREATE RULE protect_authority_rec_delete AS ON DELETE TO authority.record_entry DO INSTEAD (UPDATE authority.record_entry SET deleted = TRUE WHERE OLD.id = authority.record_entry.id; DELETE FROM authority.full_rec WHERE record = OLD.id); CREATE TABLE authority.bib_linking ( id BIGSERIAL PRIMARY KEY, @@ -139,6 +138,8 @@ CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (value tex /* But we still need this (boooo) for paging using >, <, etc */ CREATE INDEX authority_full_rec_value_index ON authority.full_rec (value); +CREATE RULE protect_authority_rec_delete AS ON DELETE TO authority.record_entry DO INSTEAD (UPDATE authority.record_entry SET deleted = TRUE WHERE OLD.id = authority.record_entry.id; DELETE FROM authority.full_rec WHERE record = OLD.id); + -- Intended to be used in a unique index on authority.record_entry like so: -- CREATE UNIQUE INDEX unique_by_heading_and_thesaurus -- ON authority.record_entry (authority.normalize_heading(marc)) -- 2.11.0