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
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16618
dcc99617-32d9-48b4-a31d-
7c20da2025e4
</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"/>
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,
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 );
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,
--- /dev/null
+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;