From: scottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 15 Jan 2010 16:10:49 +0000 (+0000)
Subject: In acq.fund_transfer: make the dest_fund and dest_amount columns nullable.
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fa32483802baceeb1aeb02a3fad4339ed2d02f3d;p=evergreen%2Fmasslnc.git

In acq.fund_transfer: make the dest_fund and dest_amount columns nullable.
That way they can accommodate deallocations, where we move money out of a
fund without moving it into another fund.

A    upgrade/0135.schema.acq.fund_transfer_nulls.sql


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

diff --git a/Open-ILS/src/sql/Pg/upgrade/0135.schema.acq.fund_transfer_nulls.sql b/Open-ILS/src/sql/Pg/upgrade/0135.schema.acq.fund_transfer_nulls.sql
new file mode 100644
index 0000000000..09e0f2ed90
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0135.schema.acq.fund_transfer_nulls.sql
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0135'); -- Scott McKellar
+
+-- Make dest_fund and dest_amount nullable in order to accommodate
+-- deallocations; i.e. when we move money out of a fund without
+-- putting it into some other fund.
+
+ALTER TABLE acq.fund_transfer
+	ALTER COLUMN dest_fund DROP NOT NULL;
+
+ALTER TABLE acq.fund_transfer
+	ALTER COLUMN dest_amount DROP NOT NULL;
+
+COMMIT;