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