[open-ils-commits] r17034 - 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 Jul 26 12:18:12 EDT 2010
Author: scottmk
Date: 2010-07-26 12:18:09 -0400 (Mon, 26 Jul 2010)
New Revision: 17034
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0351.schema.usr_saved_search.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/005.schema.actors.sql
Log:
New table: actor.usr_saved_search
M Open-ILS/src/sql/Pg/005.schema.actors.sql
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0351.schema.usr_saved_search.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-07-26 14:09:07 UTC (rev 17033)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-07-26 16:18:09 UTC (rev 17034)
@@ -2385,6 +2385,24 @@
<link field="replaces" reltype="has_a" key="id" map="" class="aua"/>
</links>
</class>
+
+ <class id="auss" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::usr_saved_search" oils_persist:tablename="actor.usr_saved_search" reporter:label="User Saved Search">
+ <fields oils_persist:primary="id" oils_persist:sequence="usr_saved_search_id_seq">
+ <field reporter:label="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="Create Date" name="create_date" reporter:datatype="timestamp"/>
+ <field reporter:label="Query Text" name="query_text" reporter:datatype="text"/>
+ <field reporter:label="Query Type" name="query_type" reporter:datatype="text"/>
+ <field reporter:label="Target" name="target" reporter:datatype="text"/>
+ </fields>
+ <links>
+ <link field="owner" reltype="has_a" key="id" map="" class="au"/>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
<class id="acnn" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="asset::call_number_note" oils_persist:tablename="asset.call_number_note" reporter:label="Call Number Note">
<fields oils_persist:primary="id" oils_persist:sequence="asset.call_number_note_id_seq">
<field name="call_number" />
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-07-26 14:09:07 UTC (rev 17033)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-07-26 16:18:09 UTC (rev 17034)
@@ -68,7 +68,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0350'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0351'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql 2010-07-26 14:09:07 UTC (rev 17033)
+++ trunk/Open-ILS/src/sql/Pg/005.schema.actors.sql 2010-07-26 16:18:09 UTC (rev 17034)
@@ -608,4 +608,22 @@
CREATE INDEX actor_usr_standing_penalty_staff_idx ON actor.usr_standing_penalty ( staff );
+CREATE TABLE actor.usr_saved_search (
+ id SERIAL PRIMARY KEY,
+ owner INT NOT NULL REFERENCES actor.usr (id)
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ create_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ query_text TEXT NOT NULL,
+ query_type TEXT NOT NULL
+ CONSTRAINT valid_query_text CHECK (
+ query_type IN ( 'URL' )) DEFAULT 'URL',
+ -- we may add other types someday
+ target TEXT NOT NULL
+ CONSTRAINT valid_target CHECK (
+ target IN ( 'record', 'metarecord', 'callnumber' )),
+ CONSTRAINT name_once_per_user UNIQUE (owner, name)
+);
+
COMMIT;
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0351.schema.usr_saved_search.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0351.schema.usr_saved_search.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0351.schema.usr_saved_search.sql 2010-07-26 16:18:09 UTC (rev 17034)
@@ -0,0 +1,23 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0351'); -- Scott McKellar
+
+CREATE TABLE actor.usr_saved_search (
+ id SERIAL PRIMARY KEY,
+ owner INT NOT NULL REFERENCES actor.usr (id)
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ create_date TIMESTAMPTZ NOT NULL DEFAULT now(),
+ query_text TEXT NOT NULL,
+ query_type TEXT NOT NULL
+ CONSTRAINT valid_query_text CHECK (
+ query_type IN ( 'URL' )) DEFAULT 'URL',
+ -- we may add other types someday
+ target TEXT NOT NULL
+ CONSTRAINT valid_target CHECK (
+ target IN ( 'record', 'metarecord', 'callnumber' )),
+ CONSTRAINT name_once_per_user UNIQUE (owner, name)
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list