[open-ils-commits] r15791 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 11 09:48:44 EST 2010
Author: miker
Date: 2010-03-11 09:48:42 -0500 (Thu, 11 Mar 2010)
New Revision: 15791
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.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/012.schema.vandelay.sql
Log:
add a table to manage vandelay merge profiles
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-03-11 14:16:57 UTC (rev 15790)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-03-11 14:48:42 UTC (rev 15791)
@@ -130,6 +130,29 @@
<!-- Actually in the DB -->
+ <class id="vmp" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::merge_profile" oils_persist:tablename="vandelay.merge_profile" reporter:label="Bib Import Merge Profile">
+ <fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
+ <field reporter:label="Field ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Owner" name="owner" reporter:datatype="link"/>
+ <field reporter:label="Name" name="name" reporter:datatype="text"/>
+ <field reporter:label="Add Specification" name="add_spec" reporter:datatype="text"/>
+ <field reporter:label="Replace Specification" name="replace_spec" reporter:datatype="text"/>
+ <field reporter:label="Remove Specification" name="strip_spec" reporter:datatype="text"/>
+ <field reporter:label="Preserve Specification" name="preserve_spec" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="owner" reltype="has_a" key="id" map="" class="aou"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE" context_field="owner"/>
+ <retrieve permission="ADMIN_MERGE_PROFILE CREATE_MERGE_PROFILE UPDATE_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
+ <update permission="ADMIN_MERGE_PROFILE UPDATE_MERGE_PROFILE" context_field="owner"/>
+ <delete permission="ADMIN_MERGE_PROFILE DELETE_MERGE_PROFILE" context_field="owner"/>
+ </actions>
+ </permacrud>
+ </class>
+
<class id="vibtf" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="vandelay::import_bib_trash_fields" oils_persist:tablename="vandelay.import_bib_trash_fields" reporter:label="Import/Overlay Fields for Removal">
<fields oils_persist:primary="id" oils_persist:sequence="vandelay.import_bib_trash_fields_id_seq">
<field reporter:label="Field 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-03-11 14:16:57 UTC (rev 15790)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-03-11 14:48:42 UTC (rev 15791)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0187'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0188'); -- miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/012.schema.vandelay.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/012.schema.vandelay.sql 2010-03-11 14:16:57 UTC (rev 15790)
+++ trunk/Open-ILS/src/sql/Pg/012.schema.vandelay.sql 2010-03-11 14:48:42 UTC (rev 15791)
@@ -129,6 +129,18 @@
CONSTRAINT vand_import_bib_trash_fields_idx UNIQUE (owner,field)
);
+CREATE TABLE vandelay.merge_profile (
+ id BIGSERIAL PRIMARY KEY,
+ owner INT NOT NULL REFERENCES actor.org_unit (id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ add_spec TEXT,
+ replace_spec TEXT,
+ strip_spec TEXT,
+ preserve_spec TEXT,
+ CONSTRAINT vand_merge_prof_owner_name_idx UNIQUE (owner,name),
+ CONSTRAINT add_replace_strip_or_preserve CHECK (preserve_spec IS NULL OR (add_spec IS NULL AND replace_spec IS NULL AND strip_spec IS NULL))
+);
+
CREATE OR REPLACE FUNCTION vandelay.add_field ( incumbent_xml TEXT, incoming_xml TEXT, field TEXT ) RETURNS TEXT AS $_$
use MARC::Record;
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql 2010-03-11 14:48:42 UTC (rev 15791)
@@ -0,0 +1,19 @@
+
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0188'); -- miker
+
+CREATE TABLE vandelay.merge_profile (
+ id BIGSERIAL PRIMARY KEY,
+ owner INT NOT NULL REFERENCES actor.org_unit (id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ add_spec TEXT,
+ replace_spec TEXT,
+ strip_spec TEXT,
+ preserve_spec TEXT,
+ CONSTRAINT vand_merge_prof_owner_name_idx UNIQUE (owner,name),
+ CONSTRAINT add_replace_strip_or_preserve CHECK (preserve_spec IS NULL OR (add_spec IS NULL AND replace_spec IS NULL AND strip_spec IS NULL))
+);
+
+COMMIT;
+
More information about the open-ils-commits
mailing list