]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0266.schema.acq-fix-edi-message-check.sql
Stamping upgrade scripts for LP#818740
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0266.schema.acq-fix-edi-message-check.sql
1 BEGIN;
2
3 -- Depending on how your edi_message table was created, one of the constraints
4 -- may be wrong.  The following will fix it if it's wrong, and have no effect
5 -- if it's right.
6
7 INSERT INTO config.upgrade_log (version) VALUES ('0266'); -- Scott McKellar
8
9 ALTER TABLE acq.edi_message
10         DROP CONSTRAINT valid_message_type;
11
12 ALTER TABLE acq.edi_message
13         ADD CONSTRAINT valid_message_type CHECK
14                 ( message_type IN (
15                         'ORDERS',
16                         'ORDRSP',
17                         'INVOIC',
18                         'OSTENQ',
19                         'OSTRPT'
20                 ));
21
22 COMMIT;