database.mysql 10.4 KB
Newer Older
Dries's avatar
   
Dries committed
1
2
3
4
5
6
7
8
CREATE TABLE access (
  id tinyint(10) DEFAULT '0' NOT NULL auto_increment,
  mask varchar(255) DEFAULT '' NOT NULL,
  type varchar(16) DEFAULT '' NOT NULL,
  reason text NOT NULL,
  UNIQUE mask (mask),
  PRIMARY KEY (id)
);
Dries's avatar
   
Dries committed
9

Dries's avatar
   
Dries committed
10
11
12
13
CREATE TABLE blocks (
  name varchar(64) DEFAULT '' NOT NULL,
  module varchar(64) DEFAULT '' NOT NULL,
  offset tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
Dries committed
14
  status tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
15
16
  weight tinyint(1) DEFAULT '0' NOT NULL,
  region tinyint(1) DEFAULT '0' NOT NULL,
17
  remove tinyint(1) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
18
19
20
  PRIMARY KEY (name)
);

Dries's avatar
   
Dries committed
21
22
23
24
25
26
27
CREATE TABLE blog (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  body text NOT NULL,
  PRIMARY KEY (lid)
);

Dries's avatar
   
Dries committed
28
29
30
31
32
33
34
CREATE TABLE book (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  body text NOT NULL,
  section int(10) DEFAULT '0' NOT NULL,
  parent int(10) DEFAULT '0' NOT NULL,
  weight tinyint(3) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
35
36
  pid int(10) DEFAULT '0' NOT NULL,
  log text NOT NULL,
Dries's avatar
   
Dries committed
37
38
39
  PRIMARY KEY (lid)
);

Dries's avatar
   
Dries committed
40
CREATE TABLE boxes (
Dries's avatar
   
Dries committed
41
42
43
  bid tinyint(4) DEFAULT '0' NOT NULL auto_increment,
  title varchar(64) DEFAULT '' NOT NULL,
  body text,
Dries's avatar
   
Dries committed
44
45
46
  info varchar(128) DEFAULT '' NOT NULL,
  link varchar(128) DEFAULT '' NOT NULL,
  type tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
47
  UNIQUE subject (title),
Dries's avatar
   
Dries committed
48
  UNIQUE info (info),
Dries's avatar
   
Dries committed
49
  PRIMARY KEY (bid)
Dries's avatar
   
Dries committed
50
51
);

Dries's avatar
   
Dries committed
52
53
54
55
56
57
58
59
CREATE TABLE bundle (
  bid int(11) DEFAULT '0' NOT NULL auto_increment,
  title varchar(255) DEFAULT '' NOT NULL,
  attributes varchar(255) DEFAULT '' NOT NULL,
  UNIQUE title (title),
  PRIMARY KEY (bid)
);

Dries's avatar
   
Dries committed
60
61
62
63
64
65
66
CREATE TABLE cache (
  url varchar(255) DEFAULT '' NOT NULL,
  data text NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (url)
);

Dries's avatar
   
Dries committed
67
68
69
70
71
72
73
74
75
CREATE TABLE category (
  cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(32) DEFAULT '' NOT NULL,
  type varchar(16) DEFAULT '' NOT NULL,
  post int(3) DEFAULT '0' NOT NULL,
  dump int(3) DEFAULT '0' NOT NULL,
  expire int(3) DEFAULT '0' NOT NULL,
  comment int(2) unsigned DEFAULT '0' NOT NULL,
  submission int(2) unsigned DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
76
  promote int(2) unsigned DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
77
78
79
80
  UNIQUE name (name),
  PRIMARY KEY (cid)
);

Dries's avatar
 
Dries committed
81
82
83
84
85
86
87
88
89
90
91
92
93
CREATE TABLE channel (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  site varchar(255) DEFAULT '' NOT NULL,
  file varchar(255) DEFAULT '' NOT NULL,
  url varchar(255) DEFAULT '' NOT NULL,
  contact varchar(255) DEFAULT '',
  timestamp int(11),
  UNIQUE site (site),
  UNIQUE file (file),
  UNIQUE url (url),
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
94
95
96
97
98
99
100
101
102
103
104
105
106
107
CREATE TABLE chatevents (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  body varchar(255) DEFAULT '' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

CREATE TABLE chatmembers (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
  nick varchar(32) DEFAULT '' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
108
109
110
111
112
113
114
115
CREATE TABLE collection (
  cid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(32) DEFAULT '' NOT NULL,
  types varchar(128) DEFAULT '' NOT NULL,
  UNIQUE name (name),
  PRIMARY KEY (cid)
);

Dries's avatar
 
Dries committed
116
117
118
CREATE TABLE comments (
  cid int(6) DEFAULT '0' NOT NULL auto_increment,
  pid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
119
  lid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
120
121
122
123
124
125
126
  author int(6) DEFAULT '0' NOT NULL,
  subject varchar(64) DEFAULT '' NOT NULL,
  comment text NOT NULL,
  hostname varchar(128) DEFAULT '' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  score int(6) DEFAULT '0' NOT NULL,
  votes int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
127
  link varchar(16) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
128
  users text NOT NULL,
Dries's avatar
   
Dries committed
129
130
  PRIMARY KEY (cid),
  KEY lid (lid)
Dries's avatar
 
Dries committed
131
132
);

Dries's avatar
   
Dries committed
133
134
135
136
137
138
139
140
CREATE TABLE cvs (
  user varchar(32) DEFAULT '' NOT NULL,
  files text,
  status int(2) DEFAULT '0' NOT NULL,
  message text,
  timestamp int(11) DEFAULT '0' NOT NULL
);

Dries's avatar
 
Dries committed
141
142
143
144
145
146
147
148
CREATE TABLE diaries (
  id int(5) DEFAULT '0' NOT NULL auto_increment,
  author int(6) DEFAULT '0' NOT NULL,
  text text,
  timestamp int(11) DEFAULT '0' NOT NULL,
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
CREATE TABLE diary (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  body text NOT NULL,
  PRIMARY KEY (lid)
);

CREATE TABLE entry (
  eid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(32) DEFAULT '' NOT NULL,
  attributes varchar(255) DEFAULT '' NOT NULL,
  collection varchar(32) DEFAULT '' NOT NULL,
  UNIQUE name (name,collection),
  PRIMARY KEY (eid)
);

CREATE TABLE feed (
  fid int(11) DEFAULT '0' NOT NULL auto_increment,
  title varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
168
  url varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
169
170
171
172
  refresh int(11),
  uncache int(11),
  timestamp int(11),
  attributes varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
173
174
  link varchar(255) DEFAULT '' NOT NULL,
  description text NOT NULL,
Dries's avatar
   
Dries committed
175
  UNIQUE title (title),
Dries's avatar
   
Dries committed
176
  UNIQUE link (url),
Dries's avatar
   
Dries committed
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
  PRIMARY KEY (fid)
);

CREATE TABLE file (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  version varchar(10) DEFAULT '' NOT NULL,
  url varchar(255) DEFAULT '' NOT NULL,
  downloads int(10) unsigned DEFAULT '0' NOT NULL,
  abstract text NOT NULL,
  description text NOT NULL,
  homepage varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (lid)
);

Dries's avatar
   
Dries committed
192
193
194
195
196
197
198
CREATE TABLE forum (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  body text NOT NULL,
  PRIMARY KEY (lid)
);

Dries's avatar
   
Dries committed
199
200
201
CREATE TABLE item (
  iid int(11) DEFAULT '0' NOT NULL auto_increment,
  fid int(11) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
202
203
  title varchar(255) DEFAULT '' NOT NULL,
  link varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
204
205
206
207
208
  author varchar(255) DEFAULT '' NOT NULL,
  description text NOT NULL,
  timestamp int(11),
  attributes varchar(255) DEFAULT '' NOT NULL,
  PRIMARY KEY (iid)
Dries's avatar
 
Dries committed
209
210
);

Dries's avatar
   
Dries committed
211
212
CREATE TABLE layout (
  user int(11) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
213
  block varchar(64) DEFAULT '' NOT NULL
Dries's avatar
   
Dries committed
214
215
);

Dries's avatar
   
Dries committed
216
217
CREATE TABLE locales (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
Dries's avatar
Dries committed
218
  location varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
219
220
221
222
223
224
225
226
227
  string text NOT NULL,
  da text NOT NULL,
  fi text NOT NULL,
  fr text NOT NULL,
  en text NOT NULL,
  es text NOT NULL,
  nl text NOT NULL,
  no text NOT NULL,
  sw text NOT NULL,
Dries's avatar
   
Dries committed
228
229
230
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
231
232
233
234
235
CREATE TABLE modules (
  name varchar(64) DEFAULT '' NOT NULL,
  PRIMARY KEY (name)
);

Dries's avatar
   
Dries committed
236
237
CREATE TABLE node (
  nid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
Dries's avatar
   
Dries committed
238
  lid int(10) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
239
240
241
242
243
244
245
  type varchar(16) DEFAULT '' NOT NULL,
  title varchar(128) DEFAULT '' NOT NULL,
  score int(11) DEFAULT '0' NOT NULL,
  votes int(11) DEFAULT '0' NOT NULL,
  author int(6) DEFAULT '0' NOT NULL,
  status int(4) DEFAULT '1' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
246
247
248
249
  comment int(2) DEFAULT '1' NOT NULL,
  promote int(2) DEFAULT '1' NOT NULL,
  moderate text NOT NULL,
  users text NOT NULL,
Dries's avatar
   
Dries committed
250
251
252
253
  timestamp_posted int(11) DEFAULT '0' NOT NULL,
  timestamp_queued int(11) DEFAULT '0' NOT NULL,
  timestamp_hidden int(11) DEFAULT '0' NOT NULL,
  attributes varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
254
255
256
  KEY type (lid,type),
  KEY author (author),
  KEY title (title,type),
Dries's avatar
   
Dries committed
257
258
259
  PRIMARY KEY (nid),
  KEY promote (promote),
  KEY status (status)
Dries's avatar
   
Dries committed
260
261
);

Dries's avatar
   
Dries committed
262
263
264
265
266
267
268
269
CREATE TABLE page (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  body text NOT NULL,
  format tinyint(2) DEFAULT '0' NOT NULL,
  PRIMARY KEY (lid)
);

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
CREATE TABLE poll (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  runtime int(10) DEFAULT '0' NOT NULL,
  voters text NOT NULL,
  active int(2) unsigned DEFAULT '0' NOT NULL,
  PRIMARY KEY (lid)
);

CREATE TABLE poll_choices (
  chid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
  chtext varchar(128) DEFAULT '' NOT NULL,
  chvotes int(6) DEFAULT '0' NOT NULL,
  chorder int(2) DEFAULT '0' NOT NULL,
  PRIMARY KEY (chid)
);

Dries's avatar
   
Dries committed
288
289
290
291
292
CREATE TABLE rating (
  user int(6) DEFAULT '0' NOT NULL,
  new int(6) DEFAULT '0' NOT NULL,
  old int(6) DEFAULT '0' NOT NULL,
  PRIMARY KEY (user)
Dries's avatar
Dries committed
293
294
);

Dries's avatar
   
Dries committed
295
296
297
298
299
CREATE TABLE referer (
  url varchar(255) DEFAULT '' NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL
);

Dries's avatar
   
Dries committed
300
301
302
303
304
305
306
CREATE TABLE role (
  rid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(32) DEFAULT '' NOT NULL,
  perm text NOT NULL,
  UNIQUE name (name),
  PRIMARY KEY (rid)
);
Dries's avatar
   
Dries committed
307
308
309
310
311
312
313
314
315
316
317

CREATE TABLE site (
  sid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  title varchar(128) DEFAULT '' NOT NULL,
  url varchar(255) DEFAULT '' NOT NULL,
  size text NOT NULL,
  timestamp int(11) DEFAULT '0' NOT NULL,
  UNIQUE title (title),
  UNIQUE url (url),
  PRIMARY KEY (sid)
);
Dries's avatar
   
Dries committed
318

Dries's avatar
   
Dries committed
319
320
321
CREATE TABLE story (
  lid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  nid int(10) unsigned DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
322
  abstract text NOT NULL,
Dries's avatar
   
Dries committed
323
324
  body text NOT NULL,
  PRIMARY KEY (lid)
Dries's avatar
 
Dries committed
325
326
);

Dries's avatar
   
Dries committed
327
328
329
330
331
332
333
CREATE TABLE tag (
  tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(32) DEFAULT '' NOT NULL,
  attributes varchar(255) DEFAULT '' NOT NULL,
  collections varchar(32) DEFAULT '' NOT NULL,
  UNIQUE name (name,collections),
  PRIMARY KEY (tid)
Dries's avatar
   
Dries committed
334
335
);

Dries's avatar
   
Dries committed
336
337
338
339
CREATE TABLE topic (
  tid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  pid int(10) unsigned DEFAULT '0' NOT NULL,
  name varchar(32) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
340
  moderate text NOT NULL,
Dries's avatar
   
Dries committed
341
342
343
344
  UNIQUE name (name),
  PRIMARY KEY (tid)
);

Dries's avatar
 
Dries committed
345
346
347
CREATE TABLE users (
  id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(60) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
348
  userid varchar(32) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
349
350
351
352
  passwd varchar(20) DEFAULT '' NOT NULL,
  real_email varchar(60) DEFAULT '' NOT NULL,
  fake_email varchar(60) DEFAULT '' NOT NULL,
  url varchar(100) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
353
354
  nodes tinyint(2) DEFAULT '10',
  mode tinyint(1) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
355
356
357
358
359
360
361
362
363
  sort tinyint(1) DEFAULT '0',
  threshold tinyint(1) DEFAULT '0',
  bio tinytext NOT NULL,
  theme varchar(255) DEFAULT '' NOT NULL,
  signature varchar(255) DEFAULT '' NOT NULL,
  last_access int(10) unsigned,
  last_host varchar(255),
  status tinyint(4) DEFAULT '0' NOT NULL,
  hash varchar(12) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
364
  timezone varchar(8),
Dries's avatar
   
Dries committed
365
  rating decimal(8,2),
Dries's avatar
   
Dries committed
366
  language char(2) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
367
  role varchar(32) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
368
369
370
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
371
372
CREATE TABLE variable (
  name varchar(32) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
373
  value text NOT NULL,
Dries's avatar
   
Dries committed
374
375
376
  PRIMARY KEY (name)
);

Dries's avatar
 
Dries committed
377
378
379
CREATE TABLE watchdog (
  id int(5) DEFAULT '0' NOT NULL auto_increment,
  user int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
380
  type varchar(16) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
381
  message varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
Dries committed
382
  location varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
383
  hostname varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
384
  timestamp int(11) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
385
386
  PRIMARY KEY (id)
);
Dries's avatar
   
Dries committed
387