1. New table, acq.lineitem_alert_text.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Feb 2010 20:37:18 +0000 (20:37 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 12 Feb 2010 20:37:18 +0000 (20:37 +0000)
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

Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/200.schema.acq.sql
Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql [new file with mode: 0644]

index e718794..f484908 100644 (file)
@@ -5034,6 +5034,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                </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 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <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>
 
index ace7905..3136273 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 ('0159'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0160'); --Scott McKellar
 
 CREATE TABLE config.bib_source (
        id              SERIAL  PRIMARY KEY,
index fb7a9d4..b75bb37 100644 (file)
@@ -421,6 +421,12 @@ CREATE INDEX li_creator_idx   ON acq.lineitem ( creator );
 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 @@ CREATE TABLE acq.lineitem_note (
        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 );
diff --git a/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql b/Open-ILS/src/sql/Pg/upgrade/0160.schema.acq.line-item-alert-text.sql
new file mode 100644 (file)
index 0000000..090ebe5
--- /dev/null
@@ -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;