From: senator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 9 Feb 2010 14:50:23 +0000 (+0000)
Subject: Whoops: forgot this sql upgrade script that belonged with the previous commit.
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b7e53e22707f75c4d4a93b1ed43b52ee0fdce024;p=contrib%2FConifer.git

Whoops: forgot this sql upgrade script that belonged with the previous commit.


git-svn-id: svn://svn.open-ils.org/ILS/trunk@15481 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/sql/Pg/upgrade/0156.schema.acq.distribution_formula_application.sql b/Open-ILS/src/sql/Pg/upgrade/0156.schema.acq.distribution_formula_application.sql
new file mode 100644
index 0000000000..abb07088ff
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0156.schema.acq.distribution_formula_application.sql
@@ -0,0 +1,22 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0156'); -- senator
+
+CREATE TABLE acq.distribution_formula_application (
+    id BIGSERIAL PRIMARY KEY,
+    creator INT NOT NULL REFERENCES actor.usr(id) DEFERRABLE INITIALLY DEFERRED,
+    create_time TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
+    formula INT NOT NULL
+        REFERENCES acq.distribution_formula(id) DEFERRABLE INITIALLY DEFERRED,
+    lineitem INT NOT NULL
+        REFERENCES acq.lineitem(id) DEFERRABLE INITIALLY DEFERRED
+);
+
+CREATE INDEX acqdfa_df_idx
+    ON acq.distribution_formula_application(formula);
+CREATE INDEX acqdfa_li_idx
+    ON acq.distribution_formula_application(lineitem);
+CREATE INDEX acqdfa_creator_idx
+    ON acq.distribution_formula_application(creator);
+
+COMMIT;