[open-ils-commits] r16561 - branches/rel_1_6_0/Open-ILS/src/sql/Pg (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jun 2 14:28:30 EDT 2010


Author: dbs
Date: 2010-06-02 14:28:26 -0400 (Wed, 02 Jun 2010)
New Revision: 16561

Modified:
   branches/rel_1_6_0/Open-ILS/src/sql/Pg/010.schema.biblio.sql
   branches/rel_1_6_0/Open-ILS/src/sql/Pg/800.fkeys.sql
Log:
Backport r16558 from rel_1_6: Avoid schema creation failure by ensuring metabib exists before referencing rule is created


Modified: branches/rel_1_6_0/Open-ILS/src/sql/Pg/010.schema.biblio.sql
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/sql/Pg/010.schema.biblio.sql	2010-06-02 18:02:06 UTC (rev 16560)
+++ branches/rel_1_6_0/Open-ILS/src/sql/Pg/010.schema.biblio.sql	2010-06-02 18:28:26 UTC (rev 16561)
@@ -48,9 +48,6 @@
 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,

Modified: branches/rel_1_6_0/Open-ILS/src/sql/Pg/800.fkeys.sql
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/sql/Pg/800.fkeys.sql	2010-06-02 18:02:06 UTC (rev 16560)
+++ branches/rel_1_6_0/Open-ILS/src/sql/Pg/800.fkeys.sql	2010-06-02 18:28:26 UTC (rev 16561)
@@ -97,4 +97,6 @@
 
 ALTER TABLE config.billing_type ADD CONSTRAINT config_billing_type_owner_fkey FOREIGN KEY (owner) REFERENCES actor.org_unit (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED;
 
+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);
+
 COMMIT;



More information about the open-ils-commits mailing list