From: scottmk Date: Tue, 18 May 2010 20:12:38 +0000 (+0000) Subject: Fix a typo in a previous commit to the acq schema. The upgrade script was X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c5783c41366796c901b538f484b4dbab5dcb21e9;p=evergreen%2Fbjwebb.git 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@16449 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 0cba763e6..6192c2272 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -65,7 +65,7 @@ CREATE TABLE config.upgrade_log ( 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, diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index d17c11426..a1a4b8696 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -787,7 +787,7 @@ CREATE TABLE acq.edi_message ( 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', diff --git a/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql b/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql new file mode 100644 index 000000000..52f5ba8ff --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql @@ -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;