[open-ils-commits] r16449 - in trunk/Open-ILS/src/sql/Pg: . upgrade (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue May 18 16:12:43 EDT 2010
Author: scottmk
Date: 2010-05-18 16:12:38 -0400 (Tue, 18 May 2010)
New Revision: 16449
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql
Log:
Fix a typo in a previous commit to the acq schema. The upgrade script was
correct, but this upgrade script will fix a database table that was built
from the installation script, which was wrong.
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/0266.schema.acq-fix-edi-message-check.sql
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-18 19:10:07 UTC (rev 16448)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-05-18 20:12:38 UTC (rev 16449)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0264'); -- Scott McKellar
+INSERT INTO config.upgrade_log (version) VALUES ('0266'); -- 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-05-18 19:10:07 UTC (rev 16448)
+++ trunk/Open-ILS/src/sql/Pg/200.schema.acq.sql 2010-05-18 20:12:38 UTC (rev 16449)
@@ -787,7 +787,7 @@
purchase_order INT REFERENCES acq.purchase_order
DEFERRABLE INITIALLY DEFERRED,
message_type TEXT NOT NULL CONSTRAINT valid_type CHECK
- ( status IN (
+ ( message_type IN (
'ORDERS',
'ORDRSP',
'INVOIC',
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql 2010-05-18 20:12:38 UTC (rev 16449)
@@ -0,0 +1,22 @@
+BEGIN;
+
+-- Depending on how your edi_message table was created, one of the constraints
+-- may be wrong. The following will fix it if it's wrong, and have no effect
+-- if it's right.
+
+INSERT INTO config.upgrade_log (version) VALUES ('0266'); -- Scott McKellar
+
+ALTER TABLE acq.edi_message
+ DROP CONSTRAINT valid_message_type;
+
+ALTER TABLE acq.edi_message
+ ADD CONSTRAINT valid_message_type CHECK
+ ( message_type IN (
+ 'ORDERS',
+ 'ORDRSP',
+ 'INVOIC',
+ 'OSTENQ',
+ 'OSTRPT'
+ ));
+
+COMMIT;
More information about the open-ils-commits
mailing list