[open-ils-commits] r17716 - in branches/rel_2_0/Open-ILS/src/sql/Pg: . upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 15 20:43:01 EDT 2010
Author: miker
Date: 2010-09-15 20:43:00 -0400 (Wed, 15 Sep 2010)
New Revision: 17716
Added:
branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0403.schema.serials-tweaks.sql
Modified:
branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
branches/rel_2_0/Open-ILS/src/sql/Pg/210.schema.serials.sql
Log:
Backporting r17715 from trunk: Patch from Dan Wells to extend the serial schema a bit in pref for upcoming improvement to existing features
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-16 00:40:50 UTC (rev 17715)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-09-16 00:43:00 UTC (rev 17716)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0399'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0403'); -- dbwells via miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/210.schema.serials.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/210.schema.serials.sql 2010-09-16 00:40:50 UTC (rev 17715)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/210.schema.serials.sql 2010-09-16 00:43:00 UTC (rev 17716)
@@ -68,6 +68,8 @@
CONSTRAINT cap_type CHECK ( type in
( 'basic', 'supplement', 'index' )),
create_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ start_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ end_date TIMESTAMPTZ,
active BOOL NOT NULL DEFAULT FALSE,
pattern_code TEXT NOT NULL, -- must contain JSON
enum_1 TEXT,
@@ -90,6 +92,11 @@
record_entry BIGINT REFERENCES serial.record_entry (id)
ON DELETE SET NULL
DEFERRABLE INITIALLY DEFERRED,
+ summary_method TEXT CONSTRAINT sdist_summary_method_check
+ CHECK (summary_method IS NULL
+ OR summary_method IN ( 'add_to_sre',
+ 'merge_with_sre', 'use_sre_only',
+ 'use_sdist_only')),
subscription INT NOT NULL
REFERENCES serial.subscription (id)
ON DELETE CASCADE
@@ -274,7 +281,8 @@
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_basic_summary_dist_idx ON serial.basic_summary (distribution);
@@ -285,7 +293,8 @@
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_supplement_summary_dist_idx ON serial.supplement_summary (distribution);
@@ -296,7 +305,8 @@
ON DELETE CASCADE
DEFERRABLE INITIALLY DEFERRED,
generated_coverage TEXT NOT NULL,
- textual_holdings TEXT
+ textual_holdings TEXT,
+ show_generated BOOL NOT NULL DEFAULT TRUE
);
CREATE INDEX serial_index_summary_dist_idx ON serial.index_summary (distribution);
Copied: branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0403.schema.serials-tweaks.sql (from rev 17715, trunk/Open-ILS/src/sql/Pg/upgrade/0403.schema.serials-tweaks.sql)
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0403.schema.serials-tweaks.sql (rev 0)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/upgrade/0403.schema.serials-tweaks.sql 2010-09-16 00:43:00 UTC (rev 17716)
@@ -0,0 +1,35 @@
+-- serials schema tweaks
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0403'); -- dbwells via miker
+
+------- caption_and_pattern changes
+ALTER TABLE serial.caption_and_pattern
+ADD COLUMN start_date TIMESTAMP WITH TIME ZONE DEFAULT NOW();
+
+ALTER TABLE serial.caption_and_pattern
+ADD COLUMN end_date TIMESTAMP WITH TIME ZONE;
+
+
+------- *_summary changes
+ALTER TABLE serial.basic_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+ALTER TABLE serial.supplement_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+ALTER TABLE serial.index_summary
+ADD COLUMN show_generated BOOL NOT NULL DEFAULT TRUE;
+
+
+------- distribution changes
+ALTER TABLE serial.distribution
+
+ADD COLUMN summary_method TEXT CONSTRAINT summary_method_check CHECK (
+ summary_method IS NULL
+ OR summary_method IN ( 'add_to_sre',
+ 'merge_with_sre', 'use_sre_only',
+ 'use_sdist_only'));
+
+COMMIT;
More information about the open-ils-commits
mailing list