From: miker Date: Mon, 22 Mar 2010 17:39:32 +0000 (+0000) Subject: move the rule to /after/ we create the referenced schemas and tables X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d7833ea5472da33af07b48248a7d5fa5c6af482d;p=evergreen%2Fpines.git move the rule to /after/ we create the referenced schemas and tables git-svn-id: svn://svn.open-ils.org/ILS/trunk@15928 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/010.schema.biblio.sql b/Open-ILS/src/sql/Pg/010.schema.biblio.sql index 00c82af9aa..e55cecdca4 100644 --- a/Open-ILS/src/sql/Pg/010.schema.biblio.sql +++ b/Open-ILS/src/sql/Pg/010.schema.biblio.sql @@ -48,9 +48,6 @@ CREATE INDEX biblio_record_entry_edit_date_idx ON biblio.record_entry ( edit_dat CREATE INDEX biblio_record_entry_fp_idx ON biblio.record_entry ( fingerprint ); CREATE UNIQUE INDEX biblio_record_unique_tcn ON biblio.record_entry (tcn_value) WHERE deleted IS FALSE; -CREATE RULE protect_bib_rec_delete AS ON DELETE TO biblio.record_entry DO INSTEAD (UPDATE biblio.record_entry SET deleted = TRUE WHERE OLD.id = biblio.record_entry.id; DELETE FROM metabib.metarecord_source_map WHERE source = OLD.id); - - CREATE TABLE biblio.record_note ( id BIGSERIAL PRIMARY KEY, record BIGINT NOT NULL, diff --git a/Open-ILS/src/sql/Pg/800.fkeys.sql b/Open-ILS/src/sql/Pg/800.fkeys.sql index 0dcee31058..4480a30a41 100644 --- a/Open-ILS/src/sql/Pg/800.fkeys.sql +++ b/Open-ILS/src/sql/Pg/800.fkeys.sql @@ -19,6 +19,8 @@ BEGIN; +CREATE RULE protect_bib_rec_delete AS ON DELETE TO biblio.record_entry DO INSTEAD (UPDATE biblio.record_entry SET deleted = TRUE WHERE OLD.id = biblio.record_entry.id; DELETE FROM metabib.metarecord_source_map WHERE source = OLD.id); + ALTER TABLE actor.usr ADD CONSTRAINT actor_usr_mailing_address_fkey FOREIGN KEY (mailing_address) REFERENCES actor.usr_address (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE actor.usr ADD CONSTRAINT actor_usr_billing_address_fkey FOREIGN KEY (billing_address) REFERENCES actor.usr_address (id) DEFERRABLE INITIALLY DEFERRED; ALTER TABLE actor.usr ADD CONSTRAINT actor_usr_home_ou_fkey FOREIGN KEY (home_ou) REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED;