[open-ils-commits] r12101 - branches/rel_1_4/Open-ILS/src/sql/Pg (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Feb 7 15:19:25 EST 2009
Author: dbs
Date: 2009-02-07 15:19:21 -0500 (Sat, 07 Feb 2009)
New Revision: 12101
Modified:
branches/rel_1_4/Open-ILS/src/sql/Pg/002.schema.config.sql
branches/rel_1_4/Open-ILS/src/sql/Pg/012.schema.vandelay.sql
branches/rel_1_4/Open-ILS/src/sql/Pg/040.schema.asset.sql
branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql
branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.2-1.2.2.3-upgrade-db.sql
branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
Log:
Make all FK constraints initially deferred (manual backport of c12100)
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/002.schema.config.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -462,7 +462,7 @@
CREATE TABLE config.z3950_attr (
id SERIAL PRIMARY KEY,
- source TEXT NOT NULL REFERENCES config.z3950_source (name),
+ source TEXT NOT NULL REFERENCES config.z3950_source (name) DEFERRABLE INITIALLY DEFERRED,
name TEXT NOT NULL,
label TEXT NOT NULL,
code INT NOT NULL,
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/012.schema.vandelay.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/012.schema.vandelay.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/012.schema.vandelay.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -99,8 +99,8 @@
-- DROP TABLE vandelay.import_item CASCADE;
CREATE TABLE vandelay.import_item (
id BIGSERIAL PRIMARY KEY,
- record BIGINT NOT NULL REFERENCES vandelay.queued_bib_record (id) ON DELETE CASCADE,
- definition BIGINT NOT NULL REFERENCES vandelay.import_item_attr_definition (id) ON DELETE CASCADE,
+ record BIGINT NOT NULL REFERENCES vandelay.queued_bib_record (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ definition BIGINT NOT NULL REFERENCES vandelay.import_item_attr_definition (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
owning_lib INT,
circ_lib INT,
call_number TEXT,
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/040.schema.asset.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/040.schema.asset.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/040.schema.asset.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -69,8 +69,8 @@
CREATE TABLE asset.copy_transparency (
id SERIAL PRIMARY KEY,
deposit_amount NUMERIC(6,2),
- owner INT NOT NULL REFERENCES actor.org_unit (id),
- circ_lib INT REFERENCES actor.org_unit (id),
+ owner INT NOT NULL REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
+ circ_lib INT REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
loan_duration INT CHECK ( loan_duration IN (1,2,3) ),
fine_level INT CHECK ( fine_level IN (1,2,3) ),
holdable BOOL,
@@ -86,8 +86,8 @@
CREATE TABLE asset.copy_tranparency_map (
id BIGSERIAL PRIMARY KEY,
- tansparency INT NOT NULL REFERENCES asset.copy_transparency (id),
- target_copy INT NOT NULL UNIQUE REFERENCES asset.copy (id)
+ tansparency INT NOT NULL REFERENCES asset.copy_transparency (id) DEFERRABLE INITIALLY DEFERRED,
+ target_copy INT NOT NULL UNIQUE REFERENCES asset.copy (id) DEFERRABLE INITIALLY DEFERRED
);
CREATE INDEX cp_tr_cp_idx ON asset.copy_tranparency_map (tansparency);
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.1-1.2.2.2-upgrade-db.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -19,7 +19,7 @@
CREATE SCHEMA extend_reporter;
CREATE TABLE extend_reporter.legacy_circ_count (
- id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id),
+ id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id) DEFERRABLE INITIALLY DEFERRED,
circ_count INT NOT NULL DEFAULT 0
);
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.2-1.2.2.3-upgrade-db.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.2-1.2.2.3-upgrade-db.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.2.2-1.2.2.3-upgrade-db.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -20,7 +20,7 @@
CREATE SCHEMA extend_reporter;
CREATE TABLE extend_reporter.legacy_circ_count (
- id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id),
+ id BIGSERIAL PRIMARY KEY REFERENCES asset.copy (id) DEFERRABLE INITIALLY DEFERRED,
circ_count INT NOT NULL DEFAULT 0
);
Modified: branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql
===================================================================
--- branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2009-02-07 19:01:44 UTC (rev 12100)
+++ branches/rel_1_4/Open-ILS/src/sql/Pg/1.2.3-1.4-upgrade-db.sql 2009-02-07 20:19:21 UTC (rev 12101)
@@ -153,7 +153,7 @@
CREATE TABLE config.z3950_attr (
id SERIAL PRIMARY KEY,
- source TEXT NOT NULL REFERENCES config.z3950_source (name),
+ source TEXT NOT NULL REFERENCES config.z3950_source (name) DEFERRABLE INITIALLY DEFERRED,
name TEXT NOT NULL,
label TEXT NOT NULL,
code INT NOT NULL,
@@ -1973,8 +1973,8 @@
-- DROP TABLE vandelay.import_item CASCADE;
CREATE TABLE vandelay.import_item (
id BIGSERIAL PRIMARY KEY,
- record BIGINT NOT NULL REFERENCES vandelay.queued_bib_record (id) ON DELETE CASCADE,
- definition BIGINT NOT NULL REFERENCES vandelay.import_item_attr_definition (id) ON DELETE CASCADE,
+ record BIGINT NOT NULL REFERENCES vandelay.queued_bib_record (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ definition BIGINT NOT NULL REFERENCES vandelay.import_item_attr_definition (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
owning_lib INT,
circ_lib INT,
call_number TEXT,
More information about the open-ils-commits
mailing list