]>
Commit | Line | Data |
---|---|---|
01e3b242 MKG |
1 | BEGIN TRANSACTION; |
2 | CREATE TEMPORARY TABLE Tickets_backup ( | |
3 | id INTEGER PRIMARY KEY , | |
4 | EffectiveId integer NULL , | |
5 | Queue integer NULL , | |
6 | Type varchar(16) NULL , | |
7 | IssueStatement integer NULL , | |
8 | Resolution integer NULL , | |
9 | Owner integer NULL , | |
10 | Subject varchar(200) NULL DEFAULT '[no subject]' , | |
11 | InitialPriority integer NULL , | |
12 | FinalPriority integer NULL , | |
13 | Priority integer NULL , | |
14 | TimeEstimated integer NULL , | |
15 | TimeWorked integer NULL , | |
16 | Status varchar(64) NULL , | |
17 | TimeLeft integer NULL , | |
18 | Told DATETIME NULL , | |
19 | Starts DATETIME NULL , | |
20 | Started DATETIME NULL , | |
21 | Due DATETIME NULL , | |
22 | Resolved DATETIME NULL , | |
23 | LastUpdatedBy integer NULL , | |
24 | LastUpdated DATETIME NULL , | |
25 | Creator integer NULL , | |
26 | Created DATETIME NULL , | |
27 | Disabled int2 NOT NULL DEFAULT 0 | |
28 | ); | |
29 | ||
30 | INSERT INTO Tickets_backup SELECT * FROM Tickets; | |
31 | DROP TABLE Tickets; | |
32 | ||
33 | CREATE TABLE Tickets ( | |
34 | id INTEGER PRIMARY KEY , | |
35 | EffectiveId integer NULL , | |
36 | Queue integer NULL , | |
37 | Type varchar(16) NULL , | |
38 | IssueStatement integer NULL , | |
39 | Resolution integer NULL , | |
40 | Owner integer NULL , | |
41 | Subject varchar(200) NULL DEFAULT '[no subject]' , | |
42 | InitialPriority integer NULL , | |
43 | FinalPriority integer NULL , | |
44 | Priority integer NULL , | |
45 | TimeEstimated integer NULL , | |
46 | TimeWorked integer NULL , | |
47 | Status varchar(64) NULL , | |
48 | TimeLeft integer NULL , | |
49 | Told DATETIME NULL , | |
50 | Starts DATETIME NULL , | |
51 | Started DATETIME NULL , | |
52 | Due DATETIME NULL , | |
53 | Resolved DATETIME NULL , | |
54 | LastUpdatedBy integer NULL , | |
55 | LastUpdated DATETIME NULL , | |
56 | Creator integer NULL , | |
57 | Created DATETIME NULL , | |
58 | Disabled int2 NOT NULL DEFAULT 0 | |
59 | ); | |
60 | ||
61 | CREATE INDEX Tickets1 ON Tickets (Queue, Status) ; | |
62 | CREATE INDEX Tickets2 ON Tickets (Owner) ; | |
63 | CREATE INDEX Tickets3 ON Tickets (EffectiveId) ; | |
64 | CREATE INDEX Tickets4 ON Tickets (id, Status) ; | |
65 | CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ; | |
66 | ||
67 | INSERT INTO Tickets SELECT * FROM Tickets_backup; | |
68 | DROP TABLE Tickets_backup; | |
69 | COMMIT; |