In acq.fund_transfer: make the dest_fund and dest_amount columns nullable.
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 15 Jan 2010 16:10:49 +0000 (16:10 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 15 Jan 2010 16:10:49 +0000 (16:10 +0000)
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

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

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