final move of files
[web.mtrack] / MTrackWeb / DataObjects / schema.sql
1
2 /*
3  * Schema definition - do not modify the create tables, just add alter lines
4  * The Schema parser should do the rest.
5 */
6  
7 DROP TABLE acl;
8 DROP TABLE attachments;
9
10
11 -- Table structure for table `change_audit`
12
13 CREATE TABLE `change_audit` (
14   `cid` int(11) NOT NULL,
15   `fieldname` varchar(128) DEFAULT NULL,
16   `action` varchar(16) DEFAULT NULL,
17   `oldvalue` varchar(128) DEFAULT NULL,
18   `value` varchar(128) DEFAULT NULL
19 ) ;
20
21 -- Table structure for table `changes`
22
23 CREATE TABLE `changes` (
24   `cid` int(11) NOT NULL AUTO_INCREMENT,
25   `who` varchar(128) DEFAULT NULL,
26   `object` varchar(128) DEFAULT NULL,
27   `changedate` datetime NOT NULL,
28   `reason` varchar(128) DEFAULT NULL,
29   PRIMARY KEY (`cid`)
30 ) ;
31
32 -- Table structure for table `classifications`
33
34 DROP TABLE classifications; 
35 -- Table structure for table `clcache`
36
37
38 CREATE TABLE `clcache` (
39   `id` int(11) NOT NULL AUTO_INCREMENT,
40   `repoid` int(11) DEFAULT NULL,
41   `rev` varchar(128) DEFAULT NULL,
42   `sobject` longtext,
43   PRIMARY KEY (`id`)
44 ) ;
45
46
47 -- Table structure for table `components`
48
49 DROP TABLE components; 
50
51 -- Table structure for table `components_by_project`
52
53 CREATE TABLE `components_by_project` (
54   `projid` int(11) NOT NULL DEFAULT '0',
55   `compid` int(11) NOT NULL,
56   PRIMARY KEY (`projid`,`compid`)
57 ) ;
58
59 -- Table structure for table `effort`
60
61 DROP TABLE effort; 
62 DROP TABLE group_membership; 
63 DROP TABLE groups; 
64 -- Table structure for table `keywords`
65
66 DROP TABLE keywords; 
67
68 -- Table structure for table `last_notification`
69
70 CREATE TABLE `last_notification` (
71   `last_run` datetime NOT NULL,
72   PRIMARY KEY (`last_run`)
73 ) ;
74
75 -- Table structure for table `milestones`
76
77 CREATE TABLE `milestones` (
78   `mid` int(11) NOT NULL AUTO_INCREMENT,
79   `name` varchar(128) DEFAULT NULL,
80   `description` varchar(128) DEFAULT NULL,
81   `startdate` datetime DEFAULT NULL,
82   `duedate` datetime DEFAULT NULL,
83   `completed` datetime DEFAULT NULL,
84   `deleted` int(11) NOT NULL DEFAULT '0',
85   `created` int(11) NOT NULL,
86   `updated` int(11) NOT NULL,
87   `pmid` int(11) DEFAULT NULL,
88   PRIMARY KEY (`mid`)
89 ) ;
90
91 -- Table structure for table `mtrack_schema`
92 DROP TABLE mtrack_schema; 
93 DROP TABLE priorities;
94
95 -- Table structure for table `project_repo_link`
96
97 CREATE TABLE `project_repo_link` (
98   `linkid` int(11) NOT NULL AUTO_INCREMENT,
99   `projid` int(11) NOT NULL,
100   `repoid` int(11) NOT NULL,
101   `repopathregex` varchar(128) DEFAULT NULL,
102   `is_scratch_space` int(11) NOT NULL DEFAULT '0',
103   PRIMARY KEY (`linkid`)
104 ) ;
105
106 -- Table structure for table `projects`
107
108 DROP TABLE projects; 
109 -- Table structure for table `reports`
110
111 CREATE TABLE `reports` (
112   `rid` int(11) NOT NULL AUTO_INCREMENT,
113   `summary` varchar(128) NOT NULL,
114   `description` varchar(128) NOT NULL,
115   `query` text,
116   `changed` int(11) NOT NULL,
117   PRIMARY KEY (`rid`)
118 ) ;
119
120 -- Table structure for table `repos`
121
122 CREATE TABLE `repos` (
123   `repoid` int(11) NOT NULL AUTO_INCREMENT,
124   `shortname` varchar(16) NOT NULL,
125   `scmtype` varchar(32) NOT NULL,
126   `repopath` varchar(128) NOT NULL,
127   `browserurl` varchar(128) DEFAULT NULL,
128   `browsertype` varchar(128) DEFAULT NULL,
129   `description` varchar(128) DEFAULT NULL,
130   `serverurl` varchar(128) DEFAULT NULL,
131   `parent` varchar(128) NOT NULL DEFAULT '',
132   `clonedfrom` int(11) DEFAULT NULL,
133   PRIMARY KEY (`repoid`)
134 ) ;
135
136 -- Table structure for table `resolutions`
137 DROP TABLE resolutions; 
138
139 -- Table structure for table `search_engine_state`
140
141 CREATE TABLE `search_engine_state` (
142   `last_run` datetime NOT NULL,
143   PRIMARY KEY (`last_run`)
144 ) ;
145
146 -- Table structure for table `severities`
147 DROP TABLE severities; 
148 -- Table structure for table `snippets`
149
150
151 CREATE TABLE `snippets` (
152   `snid` varchar(128) NOT NULL,
153   `created` int(11) NOT NULL,
154   `updated` int(11) NOT NULL,
155   `description` varchar(128) NOT NULL,
156   `lang` varchar(128) NOT NULL,
157   `snippet` varchar(128) NOT NULL,
158   PRIMARY KEY (`snid`)
159 ) ;
160
161 -- Table structure for table `ticket_changeset_hashes`
162
163 CREATE TABLE `ticket_changeset_hashes` (
164   `tid` char(32) NOT NULL,
165   `hash` varchar(128) NOT NULL DEFAULT '',
166   PRIMARY KEY (`tid`,`hash`)
167 ) ;
168
169 -- Table structure for table `ticket_components`
170
171 CREATE TABLE `ticket_components` (
172   `tid` char(32) NOT NULL,
173   `compid` int(11) NOT NULL
174 ) ;
175
176 -- Table structure for table `ticket_keywords`
177
178 CREATE TABLE `ticket_keywords` (
179   `tid` char(32) NOT NULL,
180   `kid` int(11) NOT NULL
181 ) ;
182
183 -- Table structure for table `ticket_milestones`
184
185 CREATE TABLE `ticket_milestones` (
186   `tid` char(32) NOT NULL,
187   `mid` int(11) NOT NULL
188 ) ;
189
190 -- Table structure for table `tickets`
191
192 CREATE TABLE `tickets` (
193   `tid` char(32) NOT NULL,
194   `nsident` varchar(128) NOT NULL,
195   `summary` varchar(128) NOT NULL,
196   `description` varchar(128) DEFAULT NULL,
197   `changelog` varchar(128) DEFAULT NULL,
198   `created` int(11) NOT NULL,
199   `updated` int(11) NOT NULL,
200   `owner` varchar(128) DEFAULT NULL,
201   `priority` varchar(128) DEFAULT NULL,
202   `severity` varchar(128) DEFAULT NULL,
203   `classification` varchar(128) DEFAULT NULL,
204   `resolution` varchar(128) DEFAULT NULL,
205   `cc` varchar(128) DEFAULT NULL,
206   `status` varchar(128) NOT NULL,
207   `estimated` double DEFAULT NULL,
208   `spent` double DEFAULT NULL,
209   `x_fieldname` text,
210   PRIMARY KEY (`tid`)
211 ) ;
212
213 -- Table structure for table `ticketstates`
214
215 DROP  TABLE `ticketstates` ;
216
217 -- Table structure for table `useraliases`
218
219 CREATE TABLE `useraliases` (
220   `alias` varchar(128) NOT NULL,
221   `userid` varchar(128) DEFAULT NULL,
222   PRIMARY KEY (`alias`)
223 ) ;
224
225 -- Table structure for table `userinfo`
226 DROP TABLE userinfo; 
227
228 -- Table structure for table `watches`
229
230 CREATE TABLE `watches` (
231   `otype` varchar(128) NOT NULL,
232   `oid` varchar(128) NOT NULL,
233   `userid` varchar(128) NOT NULL,
234   `event` varchar(128) NOT NULL,
235   `medium` varchar(128) NOT NULL,
236   `active` int(11) NOT NULL DEFAULT '1',
237   PRIMARY KEY (`otype`,`oid`,`userid`,`event`,`medium`)
238 ) ;
239
240