Upgrade to 4.2.2
[usit-rt.git] / etc / upgrade / 4.1.1 / schema.Oracle
CommitLineData
af59614d
MKG
1CREATE SEQUENCE OBJECTSCRIPS_seq;
2CREATE TABLE ObjectScrips (
3 id NUMBER(11,0)
4 CONSTRAINT ObjectScrips_Key PRIMARY KEY,
5 Scrip NUMBER(11,0) NOT NULL,
6 Stage VARCHAR2(32) DEFAULT 'TransactionCreate' NOT NULL,
7 ObjectId NUMBER(11,0) NOT NULL,
8 SortOrder NUMBER(11,0) DEFAULT 0 NOT NULL,
9 Creator NUMBER(11,0) DEFAULT 0 NOT NULL,
10 Created DATE,
11 LastUpdatedBy NUMBER(11,0) DEFAULT 0 NOT NULL,
12 LastUpdated DATE
13);
320f0092 14ALTER TABLE Scrips ADD Disabled NUMBER(11,0) DEFAULT 0 NOT NULL;
af59614d
MKG
15
16INSERT INTO ObjectScrips(
17 id, Scrip, Stage, ObjectId,
18 Creator, Created, LastUpdatedBy, LastUpdated
19)
20(SELECT OBJECTSCRIPS_seq.nextval, id, Stage, Queue, Creator, Created, LastUpdatedBy, LastUpdated
21FROM Scrips)
22;
23
24UPDATE Scrips SET Disabled = 1 WHERE Stage = 'Disabled';
25UPDATE ObjectScrips SET Stage = 'TransactionCreate' WHERE Stage = 'Disabled';
26
27CREATE UNIQUE INDEX ObjectScrips1 ON ObjectScrips (ObjectId, Scrip);
28
29ALTER TABLE Scrips DROP COLUMN Stage;
30ALTER TABLE Scrips DROP COLUMN Queue;