[open-ils-commits] r16646 - in trunk/Open-ILS/src/sql/Pg: . upgrade (gmc)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 10 09:18:25 EDT 2010
Author: gmc
Date: 2010-06-10 09:18:23 -0400 (Thu, 10 Jun 2010)
New Revision: 16646
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0301.schema.drop_copy_transparency.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
Log:
drop copy transparency tables
These tables were never used.
Signed-of-by: Galen Charlton <gmc at esilibrary.com>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-10 00:58:06 UTC (rev 16645)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-10 13:18:23 UTC (rev 16646)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0300'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0301'); -- gmc
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql 2010-06-10 00:58:06 UTC (rev 16645)
+++ trunk/Open-ILS/src/sql/Pg/040.schema.asset.sql 2010-06-10 13:18:23 UTC (rev 16646)
@@ -101,31 +101,6 @@
BEFORE UPDATE ON asset.copy
FOR EACH ROW EXECUTE PROCEDURE asset.acp_status_changed();
-CREATE TABLE asset.copy_transparency (
- id SERIAL PRIMARY KEY,
- deposit_amount NUMERIC(6,2),
- 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,
- circulate BOOL,
- deposit BOOL,
- ref BOOL,
- opac_visible BOOL,
- circ_modifier TEXT,
- circ_as_type TEXT,
- name TEXT NOT NULL,
- CONSTRAINT scte_name_once_per_lib UNIQUE (owner,name)
-);
-
-CREATE TABLE asset.copy_transparency_map (
- id BIGSERIAL PRIMARY KEY,
- transparency 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_transparency_map (transparency);
-
CREATE TABLE asset.stat_cat_entry_transparency_map (
id BIGSERIAL PRIMARY KEY,
stat_cat INT NOT NULL, -- needs ON DELETE CASCADE
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0301.schema.drop_copy_transparency.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0301.schema.drop_copy_transparency.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0301.schema.drop_copy_transparency.sql 2010-06-10 13:18:23 UTC (rev 16646)
@@ -0,0 +1,17 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0301'); -- gmc
+
+CREATE TEMPORARY TABLE eg_0301_check_if_has_contents (
+ flag INTEGER PRIMARY KEY
+) ON COMMIT DROP;
+INSERT INTO eg_0301_check_if_has_contents VALUES (1);
+
+-- cause failure if either of the tables we want to drop have rows
+INSERT INTO eg_0301_check_if_has_contents SELECT 1 FROM asset.copy_transparency LIMIT 1;
+INSERT INTO eg_0301_check_if_has_contents SELECT 1 FROM asset.copy_transparency_map LIMIT 1;
+
+DROP TABLE asset.copy_transparency_map;
+DROP TABLE asset.copy_transparency;
+
+COMMIT;
More information about the open-ils-commits
mailing list