3 INSERT INTO config.upgrade_log (version) VALUES ('0264'); -- Scott McKellar
5 -- Add a message_type column
7 -- WARNING: because the new column is NOT NULL, this upgrade script must
8 -- initialize it with something if the table is not empty. The initial
9 -- value, 'ORDERS', may not always be appropriate. Massage as needed.
11 ALTER TABLE acq.edi_message
12 ADD COLUMN message_type TEXT;
14 UPDATE acq.edi_message
15 SET message_type = 'ORDERS';
17 ALTER TABLE acq.edi_message
18 ALTER COLUMN message_type SET NOT NULL;
20 ALTER TABLE acq.edi_message
21 ADD CONSTRAINT valid_message_type CHECK
30 -- Add a new valid value for status: 'retry'
32 ALTER TABLE acq.edi_message
33 DROP CONSTRAINT status_value;
35 ALTER TABLE acq.edi_message
36 ADD CONSTRAINT status_value CHECK
38 'new', -- needs to be translated
39 'translated', -- needs to be processed
40 'trans_error', -- error in translation step
41 'processed', -- needs to have remote_file deleted
42 'proc_error', -- error in processing step
43 'delete_error', -- error in deletion
44 'retry', -- need to retry