[open-ils-commits] r16618 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jun 7 14:41:26 EDT 2010
Author: scottmk
Date: 2010-06-07 14:41:21 -0400 (Mon, 07 Jun 2010)
New Revision: 16618
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0297.schema.serial-caption-and-pattern.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/210.schema.serials.sql
Log:
1. Add table: serial.caption_and_pattern
2. In serial.record entry: make "marc" row nullable.
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0297.schema.serial-caption-and-pattern.sql
M Open-ILS/src/sql/Pg/210.schema.serials.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-06-07 18:14:46 UTC (rev 16617)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-06-07 18:41:21 UTC (rev 16618)
@@ -3011,6 +3011,33 @@
</permacrud>
</class>
+ <class id="sercap" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="serial::caption_and_pattern" oils_persist:tablename="serial.caption_and_pattern" reporter:label="Caption and Pattern">
+ <fields oils_persist:primary="id" oils_persist:sequence="serial.caption_and_pattern_id_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Record" name="record" reporter:datatype="link"/>
+ <field reporter:label="Type" name="type" reporter:datatype="text"/>
+ <field reporter:label="Create Time" name="create_time" reporter:datatype="timestamp"/>
+ <field reporter:label="Active?" name="active" reporter:datatype="bool"/>
+ <field reporter:label="Pattern Code" name="pattern_code" reporter:datatype="text"/>
+ <field reporter:label="Enum 1" name="enum_1" reporter:datatype="text"/>
+ <field reporter:label="Enum 2" name="enum_2" reporter:datatype="text"/>
+ <field reporter:label="Enum 3" name="enum_3" reporter:datatype="text"/>
+ <field reporter:label="Enum 4" name="enum_4" reporter:datatype="text"/>
+ <field reporter:label="Enum 5" name="enum_5" reporter:datatype="text"/>
+ <field reporter:label="Enum 6" name="enum_6" reporter:datatype="text"/>
+ <field reporter:label="Chron 1" name="chron_1" reporter:datatype="text"/>
+ <field reporter:label="Chron 2" name="chron_2" reporter:datatype="text"/>
+ <field reporter:label="Chron 3" name="chron_3" reporter:datatype="text"/>
+ <field reporter:label="Chron 4" name="chron_4" reporter:datatype="text"/>
+ <field reporter:label="Chron 5" name="chron_5" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="record" reltype="has_a" key="id" map="" class="sre"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
<class id="ssub" controller="open-ils.cstore" oils_obj:fieldmapper="serial::subscription" oils_persist:tablename="serial.subscription" reporter:label="Subscription">
<fields oils_persist:primary="id" oils_persist:sequence="serial.subscription_id_seq">
<field reporter:label="Id" name="id" reporter:datatype="id"/>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-07 18:14:46 UTC (rev 16617)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-07 18:41:21 UTC (rev 16618)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0296'); -- gmcharlt
+INSERT INTO config.upgrade_log (version) VALUES ('0297'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/210.schema.serials.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/210.schema.serials.sql 2010-06-07 18:14:46 UTC (rev 16617)
+++ trunk/Open-ILS/src/sql/Pg/210.schema.serials.sql 2010-06-07 18:41:21 UTC (rev 16618)
@@ -17,7 +17,7 @@
edit_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
active BOOL NOT NULL DEFAULT TRUE,
deleted BOOL NOT NULL DEFAULT FALSE,
- marc TEXT NOT NULL,
+ marc TEXT,
last_xact_id TEXT NOT NULL
);
CREATE INDEX serial_record_entry_creator_idx ON serial.record_entry ( creator );
@@ -26,6 +26,31 @@
CREATE RULE protect_mfhd_delete AS ON DELETE TO serial.record_entry DO INSTEAD UPDATE serial.record_entry SET deleted = true WHERE old.id = serial.record_entry.id;
+CREATE TABLE serial.caption_and_pattern (
+ id SERIAL PRIMARY KEY,
+ record BIGINT NOT NULL
+ REFERENCES serial.record_entry (id)
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ type TEXT NOT NULL
+ CONSTRAINT cap_type CHECK ( type in
+ ( 'basic', 'supplement', 'index' )),
+ create_time TIMESTAMPTZ NOT NULL DEFAULT now(),
+ active BOOL NOT NULL DEFAULT FALSE,
+ pattern_code TEXT NOT NULL, -- must contain JSON
+ enum_1 TEXT,
+ enum_2 TEXT,
+ enum_3 TEXT,
+ enum_4 TEXT,
+ enum_5 TEXT,
+ enum_6 TEXT,
+ chron_1 TEXT,
+ chron_2 TEXT,
+ chron_3 TEXT,
+ chron_4 TEXT,
+ chron_5 TEXT
+);
+
CREATE TABLE serial.subscription (
id SERIAL PRIMARY KEY,
start_date TIMESTAMP WITH TIME ZONE NOT NULL,
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0297.schema.serial-caption-and-pattern.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0297.schema.serial-caption-and-pattern.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0297.schema.serial-caption-and-pattern.sql 2010-06-07 18:41:21 UTC (rev 16618)
@@ -0,0 +1,33 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0297'); -- Scott McKellar
+
+ALTER TABLE serial.record_entry
+ ALTER COLUMN marc DROP NOT NULL;
+
+CREATE TABLE serial.caption_and_pattern (
+ id SERIAL PRIMARY KEY,
+ record BIGINT NOT NULL
+ REFERENCES serial.record_entry (id)
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ type TEXT NOT NULL
+ CONSTRAINT cap_type CHECK ( type in
+ ( 'basic', 'supplement', 'index' )),
+ create_time TIMESTAMPTZ NOT NULL DEFAULT now(),
+ active BOOL NOT NULL DEFAULT FALSE,
+ pattern_code TEXT NOT NULL, -- must contain JSON
+ enum_1 TEXT,
+ enum_2 TEXT,
+ enum_3 TEXT,
+ enum_4 TEXT,
+ enum_5 TEXT,
+ enum_6 TEXT,
+ chron_1 TEXT,
+ chron_2 TEXT,
+ chron_3 TEXT,
+ chron_4 TEXT,
+ chron_5 TEXT
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list