summaryrefslogtreecommitdiff
path: root/rt/etc/upgrade/3.9.6/schema.SQLite
blob: 2e7b6d307fdfe1b01bfc2ae08eb6dafa0bcbe404 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE Tickets_backup (
  id INTEGER PRIMARY KEY  ,
  EffectiveId integer NULL  ,
  Queue integer NULL  ,
  Type varchar(16) NULL  ,
  IssueStatement integer NULL  ,
  Resolution integer NULL  ,
  Owner integer NULL  ,
  Subject varchar(200) NULL DEFAULT '[no subject]' ,
  InitialPriority integer NULL  ,
  FinalPriority integer NULL  ,
  Priority integer NULL  ,
  TimeEstimated integer NULL  ,
  TimeWorked integer NULL  ,
  Status varchar(64) NULL  ,
  TimeLeft integer NULL  ,
  Told DATETIME NULL  ,
  Starts DATETIME NULL  ,
  Started DATETIME NULL  ,
  Due DATETIME NULL  ,
  Resolved DATETIME NULL  ,
  LastUpdatedBy integer NULL  ,
  LastUpdated DATETIME NULL  ,
  Creator integer NULL  ,
  Created DATETIME NULL  ,
  Disabled int2 NOT NULL DEFAULT 0
);

INSERT INTO Tickets_backup SELECT * FROM Tickets;
DROP TABLE Tickets;

CREATE TABLE Tickets (
  id INTEGER PRIMARY KEY  ,
  EffectiveId integer NULL  ,
  Queue integer NULL  ,
  Type varchar(16) NULL  ,
  IssueStatement integer NULL  ,
  Resolution integer NULL  ,
  Owner integer NULL  ,
  Subject varchar(200) NULL DEFAULT '[no subject]' ,
  InitialPriority integer NULL  ,
  FinalPriority integer NULL  ,
  Priority integer NULL  ,
  TimeEstimated integer NULL  ,
  TimeWorked integer NULL  ,
  Status varchar(64) NULL  ,
  TimeLeft integer NULL  ,
  Told DATETIME NULL  ,
  Starts DATETIME NULL  ,
  Started DATETIME NULL  ,
  Due DATETIME NULL  ,
  Resolved DATETIME NULL  ,
  LastUpdatedBy integer NULL  ,
  LastUpdated DATETIME NULL  ,
  Creator integer NULL  ,
  Created DATETIME NULL  ,
  Disabled int2 NOT NULL DEFAULT 0
);

CREATE INDEX Tickets1 ON Tickets (Queue, Status) ;
CREATE INDEX Tickets2 ON Tickets (Owner) ;
CREATE INDEX Tickets3 ON Tickets (EffectiveId) ;
CREATE INDEX Tickets4 ON Tickets (id, Status) ;
CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ;

INSERT INTO Tickets SELECT * FROM Tickets_backup;
DROP TABLE Tickets_backup;
COMMIT;