]>
src.bluestatic.org Git - bugdar.git/blob - install/schema.php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 $schema['adminsession'] = "
23 CREATE TABLE " . TABLE_PREFIX
. "adminsession
25 sessionid varchar(250) NOT NULL,
26 userid int unsigned NOT NULL,
27 dateline int unsigned NOT NULL,
28 PRIMARY KEY (sessionid)
31 $schema['attachment'] = "
32 CREATE TABLE " . TABLE_PREFIX
. "attachment
34 attachmentid int unsigned NOT NULL AUTO_INCREMENT,
35 bugid int unsigned NOT NULL,
36 filename varchar(255) NOT NULL,
37 mimetype varchar(255) NOT NULL,
38 filesize bigint unsigned NOT NULL,
39 attachment blob NOT NULL,
40 description varchar(255) NOT NULL,
41 dateline bigint unsigned NOT NULL,
42 userid int unsigned NOT NULL,
43 obsolete bool NOT NULL,
44 PRIMARY KEY (attachmentid)
47 $schema['automation'] = "
48 CREATE TABLE " . TABLE_PREFIX
. "automation
50 actionid int unsigned NOT NULL AUTO_INCREMENT,
51 name varchar(255) NOT NULL,
52 description text NOT NULL,
53 fieldchanges text NOT NULL,
54 comment text NOT NULL,
55 PRIMARY KEY (actionid)
59 CREATE TABLE " . TABLE_PREFIX
. "bug
61 bugid int unsigned NOT NULL AUTO_INCREMENT,
62 userid int unsigned NOT NULL,
63 dateline bigint unsigned NOT NULL,
64 product int unsigned NOT NULL,
65 component int unsigned NOT NULL,
66 version int unsigned NOT NULL,
67 summary varchar(255) NOT NULL,
68 priority int unsigned NOT NULL,
69 severity int unsigned NOT NULL,
70 status int unsigned NOT NULL,
71 resolution int unsigned NOT NULL,
72 assignedto int unsigned NOT NULL,
73 duplicateof int unsigned NOT NULL,
74 dependency text NOT NULL,
75 hidden smallint unsigned NOT NULL,
76 initialreport int unsigned NOT NULL,
77 lastposttime bigint unsigned NOT NULL,
78 lastpostby int unsigned NOT NULL,
79 hiddenlastposttime int unsigned NOT NULL,
80 hiddenlastpostby int unsigned NOT NULL,
81 username varchar(255) NOT NULL,
82 lastpostbyname varchar(255) NOT NULL,
83 hiddenlastpostbyname varchar(255) NOT NULL,
85 FULLTEXT KEY summary (summary)
88 $schema['bugfield'] = "
89 CREATE TABLE " . TABLE_PREFIX
. "bugfield
91 fieldid int unsigned NOT NULL AUTO_INCREMENT,
92 name varchar(255) NOT NULL,
93 description text NOT NULL,
94 type varchar(50) NOT NULL,
95 selects text NOT NULL,
96 required smallint NOT NULL,
97 cansearch smallint NOT NULL,
98 regexmatch text NOT NULL,
99 defaultvalue text NOT NULL,
100 usedefault smallint NOT NULL,
101 maxlength smallint unsigned NOT NULL,
102 PRIMARY KEY (fieldid)
105 $schema['bugfieldpermission'] = "
106 CREATE TABLE " . TABLE_PREFIX
. "bugfieldpermission
108 usergroupid int unsigned NOT NULL,
109 fieldid int unsigned NOT NULL,
110 mask smallint unsigned NOT NULL,
111 PRIMARY KEY (usergroupid, fieldid)
114 $schema['comment'] = "
115 CREATE TABLE " . TABLE_PREFIX
. "comment
117 commentid int unsigned NOT NULL AUTO_INCREMENT,
118 bugid int unsigned NOT NULL,
119 userid int unsigned NOT NULL,
120 dateline bigint unsigned NOT NULL,
121 comment text NOT NULL,
122 comment_parsed text NOT NULL,
123 hidden smallint unsigned NOT NULL,
124 parselinks bool NULL,
125 PRIMARY KEY (commentid),
126 FULLTEXT KEY comment (comment)
129 $schema['datastore'] = "
130 CREATE TABLE " . TABLE_PREFIX
. "datastore
132 title varchar(255) NOT NULL,
137 $schema['favorite'] = "
138 CREATE TABLE " . TABLE_PREFIX
. "favorite
140 userid int unsigned NOT NULL,
141 bugid int unsigned NOT NULL,
142 PRIMARY KEY (userid, bugid)
145 $schema['fieldhelp'] = "
146 CREATE TABLE " . TABLE_PREFIX
. "fieldhelp
148 keystring varchar(255) NOT NULL,
149 title varchar(255) NOT NULL,
151 PRIMARY KEY (keystring)
154 $schema['history'] = "
155 CREATE TABLE " . TABLE_PREFIX
. "history
157 historyid bigint unsigned NOT NULL AUTO_INCREMENT,
158 bugid int unsigned NOT NULL,
159 attachmentid int unsigned NOT NULL,
160 commentid int unsigned NOT NULL,
161 dateline bigint unsigned NOT NULL,
162 userid int unsigned NOT NULL,
163 field varchar(255) NOT NULL,
164 original text NOT NULL,
165 changed text NOT NULL,
166 PRIMARY KEY (historyid)
169 $schema['language'] = "
170 CREATE TABLE " . TABLE_PREFIX
. "language
172 languageid int unsigned NOT NULL AUTO_INCREMENT,
173 title varchar(255) NOT NULL,
174 langcode varchar(5) NOT NULL,
175 charset varchar(15) NOT NULL,
176 direction char(3) NOT NULL,
177 userselect smallint unsigned NOT NULL,
178 PRIMARY KEY (languageid),
179 UNIQUE KEY languagecode (langcode)
182 $schema['passwordreset'] = "
183 CREATE TABLE " . TABLE_PREFIX
. "passwordreset
185 activatorid varchar(250) NOT NULL,
187 dateline int NOT NULL,
188 PRIMARY KEY (activatorid)
191 $schema['permission'] = "
192 CREATE TABLE " . TABLE_PREFIX
. "permission
194 usergroupid int unsigned NOT NULL,
195 productid int unsigned NOT NULL,
196 mask smallint NOT NULL,
197 PRIMARY KEY (usergroupid, productid)
200 $schema['priority'] = "
201 CREATE TABLE " . TABLE_PREFIX
. "priority
203 priorityid int unsigned NOT NULL AUTO_INCREMENT,
204 priority varchar(255) NOT NULL,
205 displayorder int unsigned NOT NULL,
206 PRIMARY KEY (priorityid)
209 $schema['product'] = "
210 CREATE TABLE " . TABLE_PREFIX
. "product
212 productid int unsigned NOT NULL AUTO_INCREMENT,
213 parentid int unsigned NULL,
214 displayorder int unsigned NOT NULL,
215 title varchar(255) NOT NULL,
216 description text NOT NULL,
217 PRIMARY KEY (productid)
220 $schema['resolution'] = "
221 CREATE TABLE " . TABLE_PREFIX
. "resolution
223 resolutionid int unsigned NOT NULL AUTO_INCREMENT,
224 resolution varchar(255) NOT NULL,
225 displayorder int unsigned NOT NULL,
226 PRIMARY KEY (resolutionid)
229 $schema['search'] = "
230 CREATE TABLE " . TABLE_PREFIX
. "search
232 searchid int unsigned NOT NULL AUTO_INCREMENT,
233 userid int unsigned NOT NULL,
234 dateline bigint unsigned NOT NULL,
237 orderby text NOT NULL,
238 hilight varchar(255) NOT NULL,
239 resultcount int NULL,
240 name varchar(250) NULL,
241 PRIMARY KEY (searchid)
244 $schema['setting'] = "
245 CREATE TABLE " . TABLE_PREFIX
. "setting
247 varname varchar(255) NOT NULL,
249 PRIMARY KEY (varname)
252 $schema['severity'] = "
253 CREATE TABLE " . TABLE_PREFIX
. "severity
255 severityid int unsigned NOT NULL AUTO_INCREMENT,
256 severity varchar(255) NOT NULL,
257 displayorder int unsigned NOT NULL,
258 PRIMARY KEY (severityid)
261 $schema['status'] = "
262 CREATE TABLE " . TABLE_PREFIX
. "status
264 statusid int unsigned NOT NULL AUTO_INCREMENT,
265 status varchar(255) NOT NULL,
266 displayorder int unsigned NOT NULL,
267 color varchar(10) NOT NULL,
268 PRIMARY KEY (statusid)
271 $schema['template'] = "
272 CREATE TABLE " . TABLE_PREFIX
. "template
274 filename varchar(255) NOT NULL,
275 template text NOT NULL,
276 timestamp int unsigned NOT NULL,
277 PRIMARY KEY (filename)
281 CREATE TABLE " . TABLE_PREFIX
. "user
283 userid int unsigned NOT NULL AUTO_INCREMENT,
284 email varchar(255) NOT NULL,
285 displayname varchar(255) NOT NULL,
286 usergroupid int unsigned NOT NULL,
288 password varchar(32) NOT NULL,
289 salt varchar(15) NOT NULL,
290 authkey varchar(65) NOT NULL,
291 showemail smallint unsigned NOT NULL,
292 showcolors bool NULL,
293 languageid int unsigned NOT NULL,
294 timezone float NOT NULL,
295 usedst bool NOT NULL,
296 hidestatuses text NOT NULL,
297 defaultsortkey varchar(50) NULL,
298 defaultsortas varchar(10) NULL,
299 columnoptions text NULL,
300 authid varchar(255) NULL,
304 $schema['useractivation'] = "
305 CREATE TABLE " . TABLE_PREFIX
. "useractivation
307 activator varchar(25) NOT NULL,
308 userid int unsigned NOT NULL,
309 dateline int unsigned NOT NULL,
310 usergroupid int unsigned NOT NULL,
311 PRIMARY KEY (activator)
314 $schema['useremail'] = "
315 CREATE TABLE " . TABLE_PREFIX
. "useremail
317 userid int unsigned NOT NULL,
318 mask int unsigned NOT NULL,
319 relation int unsigned NOT NULL
322 $schema['usergroup'] = "
323 CREATE TABLE " . TABLE_PREFIX
. "usergroup
325 usergroupid int unsigned NOT NULL AUTO_INCREMENT,
326 title varchar(255) NOT NULL,
327 displaytitle varchar(255) NOT NULL,
328 permissions int unsigned NOT NULL,
329 PRIMARY KEY (usergroupid)
332 $schema['version'] = "
333 CREATE TABLE " . TABLE_PREFIX
. "version
335 versionid int unsigned NOT NULL AUTO_INCREMENT,
336 productid int unsigned NOT NULL,
337 version varchar(255) NOT NULL,
338 displayorder int unsigned NOT NULL,
340 PRIMARY KEY (versionid)
344 CREATE TABLE " . TABLE_PREFIX
. "vote
346 bugid int unsigned NOT NULL,
347 userids text NOT NULL,
348 votefor int unsigned NOT NULL,
349 voteagainst int unsigned NOT NULL,
353 /*=====================================================================*\
354 || ###################################################################
357 || ###################################################################
358 \*=====================================================================*/