From: Mike Rylander Date: Tue, 31 May 2011 03:49:18 +0000 (-0400) Subject: Move RULE down so that the named tables actually exist X-Git-Tag: sprint4-merge-nov22~5398^2~28 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fe16ee4245a7df991ce645967a6ffdd798c13f46;p=working%2FEvergreen.git Move RULE down so that the named tables actually exist Signed-off-by: Mike Rylander --- 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))