Whoops: forgot this sql upgrade script that belonged with the previous commit.
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Feb 2010 14:50:23 +0000 (14:50 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 9 Feb 2010 14:50:23 +0000 (14:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15481 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/upgrade/0156.schema.acq.distribution_formula_application.sql [new file with mode: 0644]

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 (file)
index 0000000..abb0708
--- /dev/null
@@ -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;