blob: 00dbc60dbaf1c4e8ea8858690ffafca39f9373f8 [file] [log] [blame]
zesstra7c14de02016-06-26 22:04:45 +02001Tabellen: rtissues, ctissues, userissues, rtnotes, rtstacktraces, ctnotes, usernotes
2Indexes:
3
4PRAGMA foreign_keys = ON;
5
6CREATE TABLE IF NOT EXISTS rtissues(
7 id INTEGER PRIMARY KEY,
8 hashkey TEXT NOT NULL UNIQUE,
9 uid TEXT NOT NULL,
10 type INTEGER NOT NULL DEFAULT 1,
11 mtime INTEGER DEFAULT CURRENT_TIMESTAMP,
12 ctime INTEGER DEFAULT CURRENT_TIMESTAMP,
13 atime INTEGER DEFAULT CURRENT_TIMESTAMP,
14 count INTEGER DEFAULT 1,
15 deleted INTEGER DEFAULT 0,
16 resolved INTEGER DEFAULT 0,
17 locked INTEGER DEFAULT 0,
18 locked_by TEXT,
19 locked_time INTEGER,
20 resolver TEXT,
21 message TEXT,
22 loadname TEXT DEFAULT '<Unbekannt>',
23 obj TEXT DEFAULT '<Unbekannt>',
24 prog TEXT DEFAULT '<Unbekannt>',
25 loc INTEGER,
26 titp TEXT,
27 tienv TEXT,
28 hbobj TEXT,
29 caught INTEGER,
30 command TEXT,
31 verb TEXT);
32
33//create unique index IF NOT EXISTS idx_rt_hashkey on rtissues(hashkey);
34create index IF NOT EXISTS idx_rt_uid on rtissues(uid);
35create index IF NOT EXISTS idx_rt_prog on rtissues(prog);
36create index IF NOT EXISTS idx_rt_loadname on rtissues(loadname);
37create unique index IF NOT EXISTS idx_rt_keys on rtissues(id,hashkey);
38
39CREATE TABLE IF NOT EXISTS rtnotes(
40 issueid INTEGER,
41 hashkey STRING NOT NULL,
42 time INTEGER DEFAULT CURRENT_TIMESTAMP,
43 user STRING NOT NULL,
44 txt STRING,
45 FOREIGN KEY(issueid,hashkey) REFERENCES rtissues(id, hashkey) ON DELETE CASCADE ON UPDATE CASCADE
46 );
47create index IF NOT EXISTS idx_rtnotes_id on rtissues(id);
48
49CREATE TABLE IF NOT EXISTS rtstacktraces(
50 issueid INTEGER,
51 hashkey STRING NOT NULL,
52 type INTEGER,
53 name STRING,
54 prog STRING,
55 obj STRING,
56 loc INTEGER,
57 ticks INTEGER,
58 FOREIGN KEY(issueid,hashkey) REFERENCES rtissues(id, hashkey) ON DELETE CASCADE ON UPDATE CASCADE
59 );
60create index IF NOT EXISTS idx_rtstacktraces_id on rtissues(id);
61
62
63CREATE TABLE IF NOT EXISTS ctissues(
64 id INTEGER PRIMARY KEY,
65 hashkey TEXT NOT NULL UNIQUE,
66 uid TEXT NOT NULL,
67 type INTEGER NOT NULL DEFAULT 1,
68 mtime INTEGER DEFAULT CURRENT_TIMESTAMP,
69 ctime INTEGER DEFAULT CURRENT_TIMESTAMP,
70 atime INTEGER DEFAULT CURRENT_TIMESTAMP,
71 count INTEGER DEFAULT 1,
72 deleted INTEGER DEFAULT 0,
73 resolved INTEGER DEFAULT 0,
74 locked INTEGER DEFAULT 0,
75 locked_by TEXT,
76 locked_time INTEGER,
77 resolver TEXT,
78 message TEXT,
79 loadname TEXT DEFAULT '<Unbekannt>'
80 );
81
82//create unique index IF NOT EXISTS idx_ct_hashkey on ctissues(hashkey);
83create index IF NOT EXISTS idx_ct_uid on ctissues(uid);
84create index IF NOT EXISTS idx_ct_loadname on ctissues(loadname);
85create unique index IF NOT EXISTS idx_ct_keys on ctissues(id,hashkey);
86
87CREATE TABLE IF NOT EXISTS ctnotes(
88 issueid INTEGER,
89 hashkey STRING NOT NULL,
90 time INTEGER DEFAULT CURRENT_TIMESTAMP,
91 user STRING NOT NULL,
92 txt STRING,
93 FOREIGN KEY(issueid,hashkey) REFERENCES ctissues(id, hashkey) ON DELETE CASCADE ON UPDATE CASCADE
94 );
95create index IF NOT EXISTS idx_ctnotes_id on ctissues(id);
96
97
98CREATE TABLE IF NOT EXISTS userissues(
99 id INTEGER PRIMARY KEY,
100 hashkey TEXT NOT NULL UNIQUE,
101 uid TEXT NOT NULL,
102 type INTEGER NOT NULL DEFAULT 1,
103 mtime INTEGER DEFAULT CURRENT_TIMESTAMP,
104 ctime INTEGER DEFAULT CURRENT_TIMESTAMP,
105 atime INTEGER DEFAULT CURRENT_TIMESTAMP,
106 count INTEGER DEFAULT 1,
107 deleted INTEGER DEFAULT 0,
108 resolved INTEGER DEFAULT 0,
109 locked INTEGER DEFAULT 0,
110 locked_by TEXT,
111 locked_time INTEGER,
112 resolver TEXT,
113 message TEXT,
114 loadname TEXT DEFAULT '<Unbekannt>',
115 obj TEXT DEFAULT '<Unbekannt>',
116 prog TEXT DEFAULT '<Unbekannt>',
117 loc INTEGER,
118 titp TEXT,
119 tienv TEXT
120 );
121
122//create unique index IF NOT EXISTS idx_user_hashkey on userissues(hashkey);
123create index IF NOT EXISTS idx_user_uid on userissues(uid);
124create index IF NOT EXISTS idx_user_prog on userissues(prog);
125create index IF NOT EXISTS idx_user_loadname on userissues(loadname);
126create unique index IF NOT EXISTS idx_user_keys on userissues(id,hashkey);
127
128CREATE TABLE IF NOT EXISTS usernotes(
129 issueid INTEGER,
130 hashkey STRING NOT NULL,
131 time INTEGER DEFAULT CURRENT_TIMESTAMP,
132 user STRING NOT NULL,
133 txt STRING,
134 FOREIGN KEY(issueid,hashkey) REFERENCES userissues(id, hashkey) ON DELETE CASCADE ON UPDATE CASCADE
135 );
136create index IF NOT EXISTS idx_usernotes_id on userissues(id);
137