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