]>
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['attachment'] = "
23 CREATE TABLE " . TABLE_PREFIX
. "attachment
25 attachmentid int unsigned NOT NULL AUTO_INCREMENT,
26 bugid int unsigned NOT NULL,
27 filename varchar(255) NOT NULL,
28 mimetype varchar(255) NOT NULL,
29 filesize bigint unsigned NOT NULL,
30 attachment blob NOT NULL,
31 description varchar(255) NOT NULL,
32 dateline bigint unsigned NOT NULL,
33 userid int unsigned NOT NULL,
34 obsolete bool NOT NULL,
35 PRIMARY KEY (attachmentid)
38 $schema['automation'] = "
39 CREATE TABLE " . TABLE_PREFIX
. "automation
41 actionid int unsigned NOT NULL AUTO_INCREMENT,
42 name varchar(255) NOT NULL,
43 description text NOT NULL,
44 fieldchanges text NOT NULL,
45 comment text NOT NULL,
46 PRIMARY KEY (actionid)
50 CREATE TABLE " . TABLE_PREFIX
. "bug
52 bugid int unsigned NOT NULL AUTO_INCREMENT,
53 userid int unsigned NOT NULL,
54 dateline bigint unsigned NOT NULL,
55 product int unsigned NOT NULL,
56 component int unsigned NOT NULL,
57 version int unsigned NOT NULL,
58 summary varchar(255) NOT NULL,
59 priority int unsigned NOT NULL,
60 severity int unsigned NOT NULL,
61 status int unsigned NOT NULL,
62 resolution int unsigned NOT NULL,
63 assignedto int unsigned NOT NULL,
64 duplicateof int unsigned NOT NULL,
65 dependency text NOT NULL,
66 hidden smallint unsigned NOT NULL,
67 initialreport int unsigned NOT NULL,
68 lastposttime bigint unsigned NOT NULL,
69 lastpostby int unsigned NOT NULL,
70 hiddenlastposttime int unsigned NOT NULL,
71 hiddenlastpostby int unsigned NOT NULL,
72 username varchar(255) NOT NULL,
73 lastpostbyname varchar(255) NOT NULL,
74 hiddenlastpostbyname varchar(255) NOT NULL,
76 FULLTEXT KEY summary (summary)
79 $schema['bugfield'] = "
80 CREATE TABLE " . TABLE_PREFIX
. "bugfield
82 fieldid int unsigned NOT NULL AUTO_INCREMENT,
83 name varchar(255) NOT NULL,
84 description text NOT NULL,
85 type varchar(50) NOT NULL,
86 selects text NOT NULL,
87 required smallint NOT NULL,
88 cansearch smallint NOT NULL,
89 regexmatch text NOT NULL,
90 defaultvalue text NOT NULL,
91 usedefault smallint NOT NULL,
92 maxlength smallint unsigned NOT NULL,
96 $schema['bugfieldpermission'] = "
97 CREATE TABLE " . TABLE_PREFIX
. "bugfieldpermission
99 usergroupid int unsigned NOT NULL,
100 fieldid int unsigned NOT NULL,
101 mask smallint unsigned NOT NULL,
102 PRIMARY KEY (usergroupid, fieldid)
105 $schema['bugvaluefill'] = "
106 CREATE TABLE " . TABLE_PREFIX
. "bugvaluefill
108 bugid int unsigned NOT NULL,
112 $schema['comment'] = "
113 CREATE TABLE " . TABLE_PREFIX
. "comment
115 commentid int unsigned NOT NULL AUTO_INCREMENT,
116 bugid int unsigned NOT NULL,
117 userid int unsigned NOT NULL,
118 dateline bigint unsigned NOT NULL,
119 comment text NOT NULL,
120 comment_parsed text NOT NULL,
121 hidden smallint unsigned NOT NULL,
122 PRIMARY KEY (commentid),
123 FULLTEXT KEY comment (comment)
126 $schema['datastore'] = "
127 CREATE TABLE " . TABLE_PREFIX
. "datastore
129 title varchar(255) NOT NULL,
134 $schema['favorite'] = "
135 CREATE TABLE " . TABLE_PREFIX
. "favorite
137 userid int unsigned NOT NULL,
138 bugid int unsigned NOT NULL,
139 PRIMARY KEY (userid, bugid)
142 $schema['fieldhelp'] = "
143 CREATE TABLE " . TABLE_PREFIX
. "fieldhelp
145 keystring varchar(255) NOT NULL,
146 title varchar(255) NOT NULL,
148 PRIMARY KEY (keystring)
151 $schema['history'] = "
152 CREATE TABLE " . TABLE_PREFIX
. "history
154 historyid bigint unsigned NOT NULL AUTO_INCREMENT,
155 bugid int unsigned NOT NULL,
156 attachmentid int unsigned NOT NULL,
157 commentid int unsigned NOT NULL,
158 dateline bigint unsigned NOT NULL,
159 userid int unsigned NOT NULL,
160 field varchar(255) NOT NULL,
161 original text NOT NULL,
162 changed text NOT NULL,
163 PRIMARY KEY (historyid)
166 $schema['language'] = "
167 CREATE TABLE " . TABLE_PREFIX
. "language
169 languageid int unsigned NOT NULL AUTO_INCREMENT,
170 title varchar(255) NOT NULL,
171 langcode varchar(5) NOT NULL,
172 charset varchar(15) NOT NULL,
173 direction char(3) NOT NULL,
174 userselect smallint unsigned NOT NULL,
175 PRIMARY KEY (languageid),
176 UNIQUE KEY languagecode (langcode)
179 $schema['permission'] = "
180 CREATE TABLE " . TABLE_PREFIX
. "permission
182 usergroupid int unsigned NOT NULL,
183 productid int unsigned NOT NULL,
184 mask smallint NOT NULL,
185 PRIMARY KEY (usergroupid, productid)
188 $schema['priority'] = "
189 CREATE TABLE " . TABLE_PREFIX
. "priority
191 priorityid int unsigned NOT NULL AUTO_INCREMENT,
192 priority varchar(255) NOT NULL,
193 displayorder int unsigned NOT NULL,
194 PRIMARY KEY (priorityid)
197 $schema['product'] = "
198 CREATE TABLE " . TABLE_PREFIX
. "product
200 productid int unsigned NOT NULL AUTO_INCREMENT,
201 componentmother int unsigned NOT NULL,
202 displayorder int unsigned NOT NULL,
203 title varchar(255) NOT NULL,
204 description text NOT NULL,
205 PRIMARY KEY (productid)
208 $schema['resolution'] = "
209 CREATE TABLE " . TABLE_PREFIX
. "resolution
211 resolutionid int unsigned NOT NULL AUTO_INCREMENT,
212 resolution varchar(255) NOT NULL,
213 displayorder int unsigned NOT NULL,
214 PRIMARY KEY (resolutionid)
217 $schema['search'] = "
218 CREATE TABLE " . TABLE_PREFIX
. "search
220 userid int unsigned NOT NULL,
221 dateline bigint unsigned NOT NULL,
224 orderby text NOT NULL,
225 hilight varchar(255) NOT NULL,
226 resultcount int NULL,
230 $schema['setting'] = "
231 CREATE TABLE " . TABLE_PREFIX
. "setting
233 varname varchar(255) NOT NULL,
235 PRIMARY KEY (varname)
238 $schema['severity'] = "
239 CREATE TABLE " . TABLE_PREFIX
. "severity
241 severityid int unsigned NOT NULL AUTO_INCREMENT,
242 severity varchar(255) NOT NULL,
243 displayorder int unsigned NOT NULL,
244 PRIMARY KEY (severityid)
247 $schema['status'] = "
248 CREATE TABLE " . TABLE_PREFIX
. "status
250 statusid int unsigned NOT NULL AUTO_INCREMENT,
251 status varchar(255) NOT NULL,
252 displayorder int unsigned NOT NULL,
253 color varchar(10) NOT NULL,
254 PRIMARY KEY (statusid)
258 CREATE TABLE " . TABLE_PREFIX
. "user
260 userid int unsigned NOT NULL AUTO_INCREMENT,
261 email varchar(255) NOT NULL,
262 displayname varchar(255) NOT NULL,
263 usergroupid int unsigned NOT NULL,
264 password varchar(32) NOT NULL,
265 salt varchar(15) NOT NULL,
266 authkey varchar(65) NOT NULL,
267 showemail smallint unsigned NOT NULL,
268 showcolors bool NULL,
269 languageid int unsigned NOT NULL,
270 timezone float NOT NULL,
271 usedst bool NOT NULL,
272 hidestatuses text NOT NULL,
273 defaultsortkey varchar(50) NULL,
274 defaultsortas varchar(10) NULL,
278 $schema['useractivation'] = "
279 CREATE TABLE " . TABLE_PREFIX
. "useractivation
281 activator varchar(25) NOT NULL,
282 userid int unsigned NOT NULL,
283 dateline int unsigned NOT NULL,
284 usergroupid int unsigned NOT NULL,
285 PRIMARY KEY (activator)
288 $schema['useremail'] = "
289 CREATE TABLE " . TABLE_PREFIX
. "useremail
291 userid int unsigned NOT NULL,
292 mask int unsigned NOT NULL,
293 relation int unsigned NOT NULL
296 $schema['usergroup'] = "
297 CREATE TABLE " . TABLE_PREFIX
. "usergroup
299 usergroupid int unsigned NOT NULL AUTO_INCREMENT,
300 title varchar(255) NOT NULL,
301 displaytitle varchar(255) NOT NULL,
302 permissions int unsigned NOT NULL,
303 PRIMARY KEY (usergroupid)
306 $schema['version'] = "
307 CREATE TABLE " . TABLE_PREFIX
. "version
309 versionid int unsigned NOT NULL AUTO_INCREMENT,
310 productid int unsigned NOT NULL,
311 version varchar(255) NOT NULL,
312 displayorder int unsigned NOT NULL,
313 PRIMARY KEY (versionid)
317 CREATE TABLE " . TABLE_PREFIX
. "vote
319 bugid int unsigned NOT NULL,
320 userids text NOT NULL,
321 votefor int unsigned NOT NULL,
322 voteagainst int unsigned NOT NULL,
326 /*=====================================================================*\
327 || ###################################################################
330 || ###################################################################
331 \*=====================================================================*/