[open-ils-commits] r15527 - 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
Fri Feb 12 15:37:23 EST 2010
Author: scottmk
Date: 2010-02-12 15:37:18 -0500 (Fri, 12 Feb 2010)
New Revision: 15527
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.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/200.schema.acq.sql
Log:
1. New table, acq.lineitem_alert_text.
2. New foreign key in acq.lineitem_note, pointing to the new table.
3. Fixed evident typo in IDL for acq.lineitem_note (changed
"Vote Value" to "Note Value").
M Open-ILS/src/sql/Pg/200.schema.acq.sql
M Open-ILS/src/sql/Pg/002.schema.config.sql
A Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-02-12 20:20:21 UTC (rev 15526)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-02-12 20:37:18 UTC (rev 15527)
@@ -5034,6 +5034,18 @@
</permacrud>
</class>
+ <class id="acqliat" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="acq::lineitem_alert_text" oils_persist:tablename="acq.lineitem_alert_text" reporter:label="Line Item Alert Text">
+ <fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_alert_text_id_seq">
+ <field reporter:label="Alert Text ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Code" name="code" reporter:datatype="text"/>
+ <field reporter:label="Description" name="description" reporter:datatype="text"/>
+ </fields>
+ <links>
+ </links>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ </permacrud>
+ </class>
+
<class id="acqlin" controller="open-ils.cstore open-ils.reporter-store" oils_obj:fieldmapper="acq::lineitem_note" oils_persist:tablename="acq.lineitem_note" reporter:label="Line Item Note">
<fields oils_persist:primary="id" oils_persist:sequence="acq.lineitem_note_id_seq">
<field reporter:label="PO Line Item Note ID" name="id" reporter:datatype="id" />
@@ -5042,12 +5054,14 @@
<field reporter:label="Creation Time" name="create_time" reporter:datatype="timestamp" />
<field reporter:label="Edit Time" name="edit_time" reporter:datatype="timestamp" />
<field reporter:label="Editor" name="editor" reporter:datatype="link" />
- <field reporter:label="Vote Value" name="value" reporter:datatype="text" />
+ <field reporter:label="Note Value" name="value" reporter:datatype="text" />
+ <field reporter:label="Alert Text" name="alert_text" reporter:datatype="link" />
</fields>
<links>
<link field="creator" reltype="has_a" key="id" map="" class="au"/>
<link field="editor" reltype="has_a" key="id" map="" class="au"/>
<link field="lineitem" reltype="has_a" key="id" map="" class="jub"/>
+ <link field="alert_text" reltype="has_a" key="id" map="" class="acqliat"/>
</links>
</class>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-02-12 20:20:21 UTC (rev 15526)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-02-12 20:37:18 UTC (rev 15527)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0159'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0160'); --Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-02-12 20:20:21 UTC (rev 15526)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-02-12 20:37:18 UTC (rev 15527)
@@ -421,6 +421,12 @@
CREATE INDEX li_editor_idx ON acq.lineitem ( editor );
CREATE INDEX li_selector_idx ON acq.lineitem ( selector );
+CREATE TABLE acq.lineitem_alert_text (
+ id SERIAL PRIMARY KEY,
+ code TEXT UNIQUE NOT NULL,
+ description TEXT
+);
+
CREATE TABLE acq.lineitem_note (
id SERIAL PRIMARY KEY,
lineitem INT NOT NULL REFERENCES acq.lineitem (id) DEFERRABLE INITIALLY DEFERRED,
@@ -428,7 +434,9 @@
editor INT NOT NULL REFERENCES actor.usr (id) DEFERRABLE INITIALLY DEFERRED,
create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
edit_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
- value TEXT NOT NULL
+ value TEXT NOT NULL,
+ alert_text INT REFERENCES acq.lineitem_alert_text(id)
+ DEFERRABLE INITIALLY DEFERRED
);
CREATE INDEX li_note_li_idx ON acq.lineitem_note (lineitem);
CREATE INDEX li_note_creator_idx ON acq.lineitem_note ( creator );
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql 2010-02-12 20:37:18 UTC (rev 15527)
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0160'); -- Scott McKellar
+
+CREATE TABLE acq.lineitem_alert_text (
+ id SERIAL PRIMARY KEY,
+ code TEXT UNIQUE NOT NULL,
+ description TEXT
+);
+
+ALTER TABLE acq.lineitem_note
+ ADD COLUMN alert_text INT REFERENCES acq.lineitem_alert_text(id)
+ DEFERRABLE INITIALLY DEFERRED;
+
+COMMIT;
More information about the open-ils-commits
mailing list