database.mysql 10 KB
Newer Older
Dries's avatar
   
Dries committed
1

Dries's avatar
   
Dries committed
2
3
4
5
6
7
8
9
10
DROP TABLE IF EXISTS access;
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
11

Dries's avatar
   
Dries committed
12
DROP TABLE IF EXISTS blocks;
Dries's avatar
   
Dries committed
13
14
15
16
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
17
  status tinyint(2) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
18
19
  weight tinyint(1) DEFAULT '0' NOT NULL,
  region tinyint(1) DEFAULT '0' NOT NULL,
20
  remove tinyint(1) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
21
22
23
  PRIMARY KEY (name)
);

Dries's avatar
   
Dries committed
24
25
26
27
28
29
30
31
DROP TABLE IF EXISTS book;
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
32
33
  pid int(10) DEFAULT '0' NOT NULL,
  log text NOT NULL,
Dries's avatar
   
Dries committed
34
35
36
37
  PRIMARY KEY (lid)
);

DROP TABLE IF EXISTS boxes;
Dries's avatar
   
Dries committed
38
39
40
41
42
43
44
45
46
47
48
49
CREATE TABLE boxes (
  id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
  subject varchar(64) DEFAULT '' NOT NULL,
  content text,
  info varchar(128) DEFAULT '' NOT NULL,
  link varchar(128) DEFAULT '' NOT NULL,
  type tinyint(2) DEFAULT '0' NOT NULL,
  UNIQUE subject (subject),
  UNIQUE info (info),
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
50
51
52
53
54
55
56
57
58
DROP TABLE IF EXISTS bundle;
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
59
60
61
62
63
64
65
66
67
68
DROP TABLE IF EXISTS category;
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
69
  promote int(2) unsigned DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
70
71
72
73
  UNIQUE name (name),
  PRIMARY KEY (cid)
);

Dries's avatar
   
Dries committed
74
DROP TABLE IF EXISTS channel;
Dries's avatar
 
Dries committed
75
76
77
78
79
80
81
82
83
84
85
86
87
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
88
89
90
91
92
93
94
95
96
DROP TABLE IF EXISTS collection;
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
97
DROP TABLE IF EXISTS comments;
Dries's avatar
 
Dries committed
98
99
100
CREATE TABLE comments (
  cid int(6) DEFAULT '0' NOT NULL auto_increment,
  pid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
101
  lid int(6) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
102
103
104
105
106
107
108
  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
109
  link varchar(16) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
110
  users text NOT NULL,
Dries's avatar
   
Dries committed
111
112
  PRIMARY KEY (cid),
  KEY lid (lid)
Dries's avatar
 
Dries committed
113
114
);

Dries's avatar
   
Dries committed
115
116
117
118
119
120
121
122
123
DROP TABLE IF EXISTS cvs;
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
124
DROP TABLE IF EXISTS diaries;
Dries's avatar
 
Dries committed
125
126
127
128
129
130
131
132
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
DROP TABLE IF EXISTS diary;
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)
);

DROP TABLE IF EXISTS entry;
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)
);

DROP TABLE IF EXISTS feed;
CREATE TABLE feed (
  fid int(11) DEFAULT '0' NOT NULL auto_increment,
  title varchar(255) DEFAULT '' NOT NULL,
  link varchar(255) DEFAULT '' NOT NULL,
  refresh int(11),
  uncache int(11),
  timestamp int(11),
  attributes varchar(255) DEFAULT '' NOT NULL,
  UNIQUE title (title),
  UNIQUE link (link),
  PRIMARY KEY (fid)
);

DROP TABLE IF EXISTS file;
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
178
179
180
181
182
183
184
185
DROP TABLE IF EXISTS forum;
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
186
187
188
189
DROP TABLE IF EXISTS item;
CREATE TABLE item (
  iid int(11) DEFAULT '0' NOT NULL auto_increment,
  fid int(11) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
190
191
  title varchar(255) DEFAULT '' NOT NULL,
  link varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
192
193
194
195
196
  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
197
198
);

Dries's avatar
   
Dries committed
199
DROP TABLE IF EXISTS layout;
Dries's avatar
   
Dries committed
200
201
CREATE TABLE layout (
  user int(11) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
202
  block varchar(64) DEFAULT '' NOT NULL
Dries's avatar
   
Dries committed
203
204
);

Dries's avatar
   
Dries committed
205
DROP TABLE IF EXISTS locales;
Dries's avatar
   
Dries committed
206
207
CREATE TABLE locales (
  id int(11) DEFAULT '0' NOT NULL auto_increment,
Dries's avatar
Dries committed
208
  location varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
209
210
211
212
213
214
215
216
217
  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
218
219
220
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
221
DROP TABLE IF EXISTS modules;
Dries's avatar
   
Dries committed
222
223
224
225
226
CREATE TABLE modules (
  name varchar(64) DEFAULT '' NOT NULL,
  PRIMARY KEY (name)
);

Dries's avatar
   
Dries committed
227
228
229
DROP TABLE IF EXISTS node;
CREATE TABLE node (
  nid int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
Dries's avatar
   
Dries committed
230
  lid int(10) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
231
232
233
234
235
236
237
  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
238
239
240
241
  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
242
243
244
245
  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
246
247
248
  KEY type (lid,type),
  KEY author (author),
  KEY title (title,type),
Dries's avatar
   
Dries committed
249
250
251
  PRIMARY KEY (nid),
  KEY promote (promote),
  KEY status (status)
Dries's avatar
   
Dries committed
252
253
);

Dries's avatar
   
Dries committed
254
255
256
257
258
259
260
261
262
DROP TABLE IF EXISTS page;
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)
);

Dries's avatar
   
Dries committed
263
DROP TABLE IF EXISTS poll;
264
265
266
267
268
269
270
271
272
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)
);

Dries's avatar
   
Dries committed
273
DROP TABLE IF EXISTS poll_choices;
274
275
276
277
278
279
280
281
282
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
283
284
285
286
287
288
DROP TABLE IF EXISTS rating;
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
289
290
);

Dries's avatar
   
Dries committed
291
292
293
294
DROP TABLE IF EXISTS story;
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
295
  abstract text NOT NULL,
Dries's avatar
   
Dries committed
296
297
  body text NOT NULL,
  PRIMARY KEY (lid)
Dries's avatar
 
Dries committed
298
299
);

Dries's avatar
   
Dries committed
300
301
302
303
304
305
306
307
DROP TABLE IF EXISTS tag;
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
308
309
);

Dries's avatar
   
Dries committed
310
311
312
313
314
DROP TABLE IF EXISTS topic;
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
315
  moderate text NOT NULL,
Dries's avatar
   
Dries committed
316
317
318
319
  UNIQUE name (name),
  PRIMARY KEY (tid)
);

Dries's avatar
   
Dries committed
320
DROP TABLE IF EXISTS users;
Dries's avatar
 
Dries committed
321
322
323
324
325
326
327
328
CREATE TABLE users (
  id int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
  name varchar(60) DEFAULT '' NOT NULL,
  userid varchar(15) DEFAULT '' NOT NULL,
  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
329
330
  nodes tinyint(2) DEFAULT '10',
  mode tinyint(1) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
331
332
333
334
335
336
337
338
339
  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
340
  timezone varchar(8),
Dries's avatar
   
Dries committed
341
  rating decimal(8,2),
Dries's avatar
   
Dries committed
342
343
  language char(2) DEFAULT '' NOT NULL,
  access varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
344
345
346
  PRIMARY KEY (id)
);

Dries's avatar
   
Dries committed
347
348
349
DROP TABLE IF EXISTS variable;
CREATE TABLE variable (
  name varchar(32) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
350
  value text NOT NULL,
Dries's avatar
   
Dries committed
351
352
353
354
  PRIMARY KEY (name)
);

DROP TABLE IF EXISTS watchdog;
Dries's avatar
 
Dries committed
355
356
357
CREATE TABLE watchdog (
  id int(5) DEFAULT '0' NOT NULL auto_increment,
  user int(6) DEFAULT '0' NOT NULL,
Dries's avatar
   
Dries committed
358
  type varchar(16) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
359
  message varchar(255) DEFAULT '' NOT NULL,
Dries's avatar
Dries committed
360
  location varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
 
Dries committed
361
  hostname varchar(128) DEFAULT '' NOT NULL,
Dries's avatar
   
Dries committed
362
  timestamp int(11) DEFAULT '0' NOT NULL,
Dries's avatar
 
Dries committed
363
364
  PRIMARY KEY (id)
);
Dries's avatar
   
Dries committed
365