1 DROP TABLE IF EXISTS ObjectScrips;
2 DROP SEQUENCE IF EXISTS objectscrips_id_seq;
4 CREATE SEQUENCE objectscrips_id_seq;
5 CREATE TABLE ObjectScrips (
6 id INTEGER DEFAULT nextval('objectscrips_id_seq'),
7 Scrip integer NOT NULL,
8 Stage varchar(32) NOT NULL DEFAULT 'TransactionCreate' ,
9 ObjectId integer NOT NULL,
10 SortOrder integer NOT NULL DEFAULT 0 ,
12 Creator integer NOT NULL DEFAULT 0 ,
13 Created TIMESTAMP NULL ,
14 LastUpdatedBy integer NOT NULL DEFAULT 0 ,
15 LastUpdated TIMESTAMP NULL ,
19 ALTER TABLE Scrips ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
21 INSERT INTO ObjectScrips(
22 Scrip, Stage, ObjectId,
23 Creator, Created, LastUpdatedBy, LastUpdated
25 SELECT id, Stage, Queue, Creator, Created, LastUpdatedBy, LastUpdated
29 UPDATE Scrips SET Disabled = 1 WHERE Stage = 'Disabled';
30 UPDATE ObjectScrips SET Stage = 'TransactionCreate' WHERE Stage = 'Disabled';
32 CREATE UNIQUE INDEX ObjectScrips1 ON ObjectScrips (ObjectId, Scrip);