1 DROP TABLE IF EXISTS ObjectScrips;
2 CREATE TABLE ObjectScrips (
3 id INTEGER NOT NULL AUTO_INCREMENT,
4 Scrip integer NOT NULL ,
5 Stage varchar(32) CHARACTER SET ascii NOT NULL DEFAULT 'TransactionCreate',
6 ObjectId integer NOT NULL,
7 SortOrder integer NOT NULL DEFAULT 0 ,
9 Creator integer NOT NULL DEFAULT 0 ,
10 Created DATETIME NULL ,
11 LastUpdatedBy integer NOT NULL DEFAULT 0 ,
12 LastUpdated DATETIME NULL ,
14 ) ENGINE=InnoDB CHARACTER SET utf8;
15 ALTER TABLE Scrips ADD COLUMN Disabled int2 NOT NULL DEFAULT 0;
17 INSERT INTO ObjectScrips(
18 Scrip, Stage, ObjectId,
19 Creator, Created, LastUpdatedBy, LastUpdated
21 SELECT id, Stage, Queue, Creator, Created, LastUpdatedBy, LastUpdated
25 UPDATE Scrips SET Disabled = 1 WHERE Stage = 'Disabled';
26 UPDATE ObjectScrips SET Stage = 'TransactionCreate' WHERE Stage = 'Disabled';
28 CREATE UNIQUE INDEX ObjectScrips1 ON ObjectScrips (ObjectId, Scrip);