add a table to manage vandelay merge profiles
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 14:48:42 +0000 (14:48 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 14:48:42 +0000 (14:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15791 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/012.schema.vandelay.sql
Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql [new file with mode: 0644]

index 8900a68..39b2110 100644 (file)
@@ -130,6 +130,29 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 
 
        <!-- 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"/>
index 7049729..a035d1f 100644 (file)
@@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log (
     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,
index 5a235cb..07051d3 100644 (file)
@@ -129,6 +129,18 @@ CREATE TABLE vandelay.import_bib_trash_fields (
        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;
diff --git a/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql b/Open-ILS/src/sql/Pg/upgrade/0188.schema.vandelay.merge_profile.sql
new file mode 100644 (file)
index 0000000..d0ba80d
--- /dev/null
@@ -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;
+