[open-ils-commits] r15298 - in trunk/Open-ILS: examples src/sql/Pg src/sql/Pg/upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jan 11 11:55:42 EST 2010
Author: scottmk
Date: 2010-01-11 11:55:39 -0500 (Mon, 11 Jan 2010)
New Revision: 15298
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0132.schema.acq.fund-propagable.sql
Modified:
trunk/Open-ILS/examples/fm_IDL.xml
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
Add a boolean "propagate" column to acq.fund, to denote whether
the fund should be propagated from one year to the next.
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/0132.schema.acq.fund-propagable.sql
M Open-ILS/examples/fm_IDL.xml
Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml 2010-01-11 16:37:45 UTC (rev 15297)
+++ trunk/Open-ILS/examples/fm_IDL.xml 2010-01-11 16:55:39 UTC (rev 15298)
@@ -4581,6 +4581,7 @@
<field reporter:label="Currency Type" name="currency_type" reporter:datatype="link" />
<field reporter:label="Code" name="code" reporter:datatype="text" />
<field reporter:label="Rollover" name="rollover" reporter:datatype="bool" />
+ <field reporter:label="Propagate" name="propagate" reporter:datatype="bool" />
<field reporter:label="Summary" name="summary" oils_persist:virtual="true"/>
<field reporter:label="Allocations" name="allocations" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Debits" name="debits" oils_persist:virtual="true" reporter:datatype="link"/>
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-01-11 16:37:45 UTC (rev 15297)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-01-11 16:55:39 UTC (rev 15298)
@@ -51,7 +51,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0131'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0132'); -- Scott McKellar
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-01-11 16:37:45 UTC (rev 15297)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-01-11 16:55:39 UTC (rev 15298)
@@ -169,8 +169,10 @@
currency_type TEXT NOT NULL REFERENCES acq.currency_type (code) DEFERRABLE INITIALLY DEFERRED,
code TEXT,
rollover BOOL NOT NULL DEFAULT FALSE,
+ propagate BOOL NOT NULL DEFAULT TRUE,
CONSTRAINT name_once_per_org_year UNIQUE (org,name,year),
- CONSTRAINT code_once_per_org_year UNIQUE (org, code, year)
+ CONSTRAINT code_once_per_org_year UNIQUE (org, code, year),
+ CONSTRAINT acq_fund_rollover_implies_propagate CHECK ( propagate OR NOT rollover )
);
CREATE TABLE acq.fund_debit (
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0132.schema.acq.fund-propagable.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0132.schema.acq.fund-propagable.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0132.schema.acq.fund-propagable.sql 2010-01-11 16:55:39 UTC (rev 15298)
@@ -0,0 +1,14 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0132'); -- Scott McKellar
+
+ALTER TABLE acq.fund
+ ADD COLUMN propagate BOOLEAN NOT NULL DEFAULT TRUE;
+
+-- A fund can't roll over if it doesn't propagate from one year to the next
+
+ALTER TABLE acq.fund
+ ADD CONSTRAINT acq_fund_rollover_implies_propagate CHECK
+ ( propagate OR NOT rollover );
+
+COMMIT;
More information about the open-ils-commits
mailing list