[open-ils-commits] r16046 - trunk/Open-ILS/src/sql/Pg (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Mar 29 16:36:21 EDT 2010
Author: phasefx
Date: 2010-03-29 16:36:16 -0400 (Mon, 29 Mar 2010)
New Revision: 16046
Modified:
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
reorder these so that they work
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-29 20:36:14 UTC (rev 16045)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-03-29 20:36:16 UTC (rev 16046)
@@ -29,6 +29,36 @@
INSERT INTO acq.exchange_rate (from_currency,to_currency,ratio) VALUES ('USD','CAN',1.2);
INSERT INTO acq.exchange_rate (from_currency,to_currency,ratio) VALUES ('USD','EUR',0.5);
+CREATE TABLE acq.claim_policy (
+ id SERIAL PRIMARY KEY,
+ org_unit INT NOT NULL REFERENCES actor.org_unit
+ DEFERRABLE INITIALLY DEFERRED,
+ name TEXT NOT NULL,
+ description TEXT NOT NULL,
+ CONSTRAINT name_once_per_org UNIQUE (org_unit, name)
+);
+
+CREATE TABLE acq.claim_event_type (
+ id SERIAL PRIMARY KEY,
+ org_unit INT NOT NULL REFERENCES actor.org_unit(id)
+ DEFERRABLE INITIALLY DEFERRED,
+ code TEXT NOT NULL,
+ description TEXT NOT NULL,
+ library_initiated BOOL NOT NULL DEFAULT FALSE,
+ CONSTRAINT event_type_once_per_org UNIQUE ( org_unit, code )
+);
+
+CREATE TABLE acq.claim_policy_action (
+ id SERIAL PRIMARY KEY,
+ claim_policy INT NOT NULL REFERENCES acq.claim_policy
+ ON DELETE CASCADE
+ DEFERRABLE INITIALLY DEFERRED,
+ action_interval INTERVAL NOT NULL,
+ action INT NOT NULL REFERENCES acq.claim_event_type
+ DEFERRABLE INITIALLY DEFERRED,
+ CONSTRAINT action_sequence UNIQUE (claim_policy, action_interval)
+);
+
CREATE TABLE acq.provider (
id SERIAL PRIMARY KEY,
name TEXT NOT NULL,
@@ -2494,16 +2524,6 @@
CONSTRAINT claim_type_once_per_org UNIQUE ( org_unit, code )
);
-CREATE TABLE acq.claim_event_type (
- id SERIAL PRIMARY KEY,
- org_unit INT NOT NULL REFERENCES actor.org_unit(id)
- DEFERRABLE INITIALLY DEFERRED,
- code TEXT NOT NULL,
- description TEXT NOT NULL,
- library_initiated BOOL NOT NULL DEFAULT FALSE,
- CONSTRAINT event_type_once_per_org UNIQUE ( org_unit, code )
-);
-
CREATE TABLE acq.claim (
id SERIAL PRIMARY KEY,
type INT NOT NULL REFERENCES acq.claim_type
@@ -2528,24 +2548,4 @@
CREATE INDEX claim_event_claim_date_idx ON acq.claim_event( claim, event_date );
-CREATE TABLE acq.claim_policy (
- id SERIAL PRIMARY KEY,
- org_unit INT NOT NULL REFERENCES actor.org_unit
- DEFERRABLE INITIALLY DEFERRED,
- name TEXT NOT NULL,
- description TEXT NOT NULL,
- CONSTRAINT name_once_per_org UNIQUE (org_unit, name)
-);
-
-CREATE TABLE acq.claim_policy_action (
- id SERIAL PRIMARY KEY,
- claim_policy INT NOT NULL REFERENCES acq.claim_policy
- ON DELETE CASCADE
- DEFERRABLE INITIALLY DEFERRED,
- action_interval INTERVAL NOT NULL,
- action INT NOT NULL REFERENCES acq.claim_event_type
- DEFERRABLE INITIALLY DEFERRED,
- CONSTRAINT action_sequence UNIQUE (claim_policy, action_interval)
-);
-
COMMIT;
More information about the open-ils-commits
mailing list