database.pgsql 14.4 KB
Newer Older
Dries's avatar
   
Dries committed
1
2
3
-- PostgreSQL include file 31/10/2002
-- Maintainer: James Arthur, j_a_arthurATyahooDOTcom

Dries's avatar
   
Dries committed
4
5
6
--
-- Table structure for access
--
Dries's avatar
   
Dries committed
7

Dries's avatar
   
Dries committed
8
9
10
11
12
13
14
CREATE TABLE access (
  aid SERIAL,
  mask varchar(255) NOT NULL default '',
  type varchar(255) NOT NULL default '',
  status smallint NOT NULL default '0',
  PRIMARY KEY (aid),
  UNIQUE (mask)
Dries's avatar
   
Dries committed
15
16
);

Dries's avatar
   
Dries committed
17
18
19
20
21
22
23
24
25
26
27
--
-- Table structure for accesslog
--

CREATE TABLE accesslog (
  nid integer default '0',
  url varchar(255) default NULL,
  hostname varchar(128) default NULL,
  uid integer default '0',
  timestamp integer NOT NULL default '0'
);
Dries's avatar
   
Dries committed
28
CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp);
Dries's avatar
   
Dries committed
29

Dries's avatar
   
Dries committed
30
31
32
--
-- Table structure for authmap
--
Dries's avatar
   
Dries committed
33

Dries's avatar
   
Dries committed
34
35
36
37
38
39
40
CREATE TABLE authmap (
  aid SERIAL,
  uid integer NOT NULL default '0',
  authname varchar(128) NOT NULL default '',
  module varchar(128) NOT NULL default '',
  PRIMARY KEY (aid),
  UNIQUE (authname)
Dries's avatar
   
Dries committed
41
42
);

Dries's avatar
   
Dries committed
43
44
45
--
-- Table structure for blocks
--
Dries's avatar
   
Dries committed
46

Dries's avatar
   
Dries committed
47
48
CREATE TABLE blocks (
  module varchar(64) NOT NULL default '',
Dries's avatar
   
Dries committed
49
  delta varchar(32) NOT NULL default '0',
Dries's avatar
   
Dries committed
50
51
52
53
  status smallint NOT NULL default '0',
  weight smallint NOT NULL default '0',
  region smallint NOT NULL default '0',
  path varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
54
55
  custom smallint NOT NULL default '0',
  throttle smallint NOT NULL default '0'
Dries's avatar
   
Dries committed
56
57
);

Dries's avatar
   
Dries committed
58
59
60
--
-- Table structure for book
--
Dries's avatar
   
Dries committed
61

Dries's avatar
   
Dries committed
62
63
64
65
66
CREATE TABLE book (
  nid integer NOT NULL default '0',
  parent integer NOT NULL default '0',
  weight smallint NOT NULL default '0',
  format smallint default '0',
Dries's avatar
   
Dries committed
67
  log text default '',
Dries's avatar
   
Dries committed
68
  PRIMARY KEY (nid)
Dries's avatar
   
Dries committed
69
);
Dries's avatar
   
Dries committed
70
CREATE INDEX book_nid_idx ON book(nid);
Dries's avatar
   
Dries committed
71
CREATE INDEX book_parent ON book(parent);
Dries's avatar
   
Dries committed
72

Dries's avatar
   
Dries committed
73
74
75
--
-- Table structure for boxes
--
Dries's avatar
   
Dries committed
76

Dries's avatar
   
Dries committed
77
78
79
CREATE TABLE boxes (
  bid SERIAL,
  title varchar(64) NOT NULL default '',
Dries's avatar
   
Dries committed
80
  body text default '',
Dries's avatar
   
Dries committed
81
82
83
84
85
  info varchar(128) NOT NULL default '',
  type smallint NOT NULL default '0',
  PRIMARY KEY  (bid),
  UNIQUE (info),
  UNIQUE (title)
Dries's avatar
   
Dries committed
86
87
);

Dries's avatar
   
Dries committed
88
89
90
--
-- Table structure for bundle
--
Dries's avatar
   
Dries committed
91

Dries's avatar
   
Dries committed
92
93
94
95
96
97
CREATE TABLE bundle (
  bid SERIAL,
  title varchar(255) NOT NULL default '',
  attributes varchar(255) NOT NULL default '',
  PRIMARY KEY  (bid),
  UNIQUE (title)
Dries's avatar
   
Dries committed
98
99
);

Dries's avatar
   
Dries committed
100
101
102
--
-- Table structure for cache
--
Dries's avatar
   
Dries committed
103

Dries's avatar
   
Dries committed
104
105
CREATE TABLE cache (
  cid varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
106
  data text default '',
Dries's avatar
   
Dries committed
107
  expire integer NOT NULL default '0',
Dries's avatar
   
Dries committed
108
  created integer NOT NULL default '0',
Dries's avatar
Dries committed
109
  headers text default '',
Dries's avatar
   
Dries committed
110
  PRIMARY KEY  (cid)
Dries's avatar
   
Dries committed
111
112
);

Dries's avatar
   
Dries committed
113
114
115
--
-- Table structure for comments
--
Dries's avatar
   
Dries committed
116

Dries's avatar
   
Dries committed
117
118
119
120
121
122
CREATE TABLE comments (
  cid SERIAL,
  pid integer NOT NULL default '0',
  nid integer NOT NULL default '0',
  uid integer NOT NULL default '0',
  subject varchar(64) NOT NULL default '',
Dries's avatar
   
Dries committed
123
  comment text NOT NULL default '',
Dries's avatar
   
Dries committed
124
125
  hostname varchar(128) NOT NULL default '',
  timestamp integer NOT NULL default '0',
Dries's avatar
   
Dries committed
126
127
  score integer NOT NULL default '0',
  status smallint  NOT NULL default '0',
Dries's avatar
   
Dries committed
128
  thread varchar(255) default '',
Dries's avatar
   
Dries committed
129
  users text default '',
Dries's avatar
   
Dries committed
130
  PRIMARY KEY  (cid)
Dries's avatar
   
Dries committed
131
);
Dries's avatar
   
Dries committed
132
CREATE INDEX comments_nid_idx ON comments(nid);
Dries's avatar
   
Dries committed
133

Dries's avatar
   
Dries committed
134
135
136
--
-- Table structure for directory
--
Dries's avatar
   
Dries committed
137

Dries's avatar
   
Dries committed
138
139
140
141
CREATE TABLE directory (
  link varchar(255) NOT NULL default '',
  name varchar(128) NOT NULL default '',
  mail varchar(128) NOT NULL default '',
Dries's avatar
   
Dries committed
142
143
  slogan text NOT NULL default '',
  mission text NOT NULL default '',
Dries's avatar
   
Dries committed
144
145
  timestamp integer NOT NULL default '0',
  PRIMARY KEY  (link)
Dries's avatar
   
Dries committed
146
);
Dries's avatar
   
Dries committed
147

Dries's avatar
   
Dries committed
148
149
150
--
-- Table structure for feed
--
Dries's avatar
   
Dries committed
151

Dries's avatar
   
Dries committed
152
153
154
155
CREATE TABLE feed (
  fid SERIAL,
  title varchar(255) NOT NULL default '',
  url varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
156
  refresh integer NOT NULL default '0',
Dries's avatar
   
Dries committed
157
  checked integer NOT NULL default '0',
Dries's avatar
   
Dries committed
158
159
  attributes varchar(255) NOT NULL default '',
  link varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
160
  description text NOT NULL default '',
Dries's avatar
   
Dries committed
161
  image text NOT NULL default '',
Dries's avatar
   
Dries committed
162
163
  etag varchar(255) NOT NULL default '',
  modified integer NOT NULL default '0',
Dries's avatar
   
Dries committed
164
165
166
  PRIMARY KEY  (fid),
  UNIQUE (title),
  UNIQUE (url)
Dries's avatar
   
Dries committed
167
168
);

Dries's avatar
   
Dries committed
169
170
171
172
173
174
--
-- Table structure for table 'forum'
--

CREATE TABLE forum (
  nid integer NOT NULL default '0',
Dries's avatar
   
Dries committed
175
  tid integer NOT NULL default '0',
Dries's avatar
   
Dries committed
176
177
178
  shadow integer NOT NULL default '0',
  PRIMARY KEY  (nid)
);
Dries's avatar
   
Dries committed
179
CREATE INDEX forum_tid_idx ON forum(tid);
Dries's avatar
   
Dries committed
180

Dries's avatar
   
Dries committed
181
182
183
--
-- Table structure for history
--
Dries's avatar
   
Dries committed
184

Dries's avatar
   
Dries committed
185
186
187
188
189
CREATE TABLE history (
  uid integer NOT NULL default '0',
  nid integer NOT NULL default '0',
  timestamp integer NOT NULL default '0',
  PRIMARY KEY  (uid,nid)
Dries's avatar
   
Dries committed
190
191
);

Dries's avatar
   
Dries committed
192
193
194
--
-- Table structure for item
--
Dries's avatar
   
Dries committed
195

Dries's avatar
   
Dries committed
196
197
198
199
200
201
CREATE TABLE item (
  iid SERIAL,
  fid integer NOT NULL default '0',
  title varchar(255) NOT NULL default '',
  link varchar(255) NOT NULL default '',
  author varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
202
  description text NOT NULL default '',
Dries's avatar
   
Dries committed
203
  timestamp integer NOT NULL default '0',
Dries's avatar
   
Dries committed
204
205
  attributes varchar(255) NOT NULL default '',
  PRIMARY KEY  (iid)
Dries's avatar
   
Dries committed
206
207
);

Dries's avatar
   
Dries committed
208
209
210
--
-- Table structure for locales
--
Dries's avatar
   
Dries committed
211

Dries's avatar
   
Dries committed
212
213
214
CREATE TABLE locales (
  lid SERIAL,
  location varchar(128) NOT NULL default '',
Dries's avatar
   
Dries committed
215
216
217
218
219
220
221
222
223
  string text NOT NULL default '',
  da text NOT NULL default '',
  fi text NOT NULL default '',
  fr text NOT NULL default '',
  en text NOT NULL default '',
  es text NOT NULL default '',
  nl text NOT NULL default '',
  no text NOT NULL default '',
  sw text NOT NULL default '',
Dries's avatar
   
Dries committed
224
  PRIMARY KEY  (lid)
Dries's avatar
   
Dries committed
225
226
);

Dries's avatar
   
Dries committed
227
--
Dries's avatar
   
Dries committed
228
-- Table structure for table 'moderation_filters'
Dries's avatar
   
Dries committed
229
--
Dries's avatar
   
Dries committed
230

Dries's avatar
   
Dries committed
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
CREATE TABLE moderation_filters (
  fid SERIAL,
  filter varchar(255) NOT NULL default '',
  minimum smallint NOT NULL default '0',
  PRIMARY KEY  (fid)
);

--
-- Table structure for table 'moderation_roles'
--

CREATE TABLE moderation_roles (
  rid integer NOT NULL default '0',
  mid integer NOT NULL default '0',
  value smallint NOT NULL default '0'
);
CREATE INDEX moderation_roles_rid_idx ON moderation_roles(rid);
CREATE INDEX moderation_roles_mid_idx ON moderation_roles(mid);

--
-- Table structure for table 'moderation_votes'
--

CREATE TABLE moderation_votes (
  mid SERIAL,
  vote varchar(255) default NULL,
  weight smallint NOT NULL default '0',
  PRIMARY KEY  (mid)
Dries's avatar
   
Dries committed
259
260
);

Dries's avatar
   
Dries committed
261
262
263
--
-- Table structure for node
--
Dries's avatar
   
Dries committed
264

Dries's avatar
   
Dries committed
265
266
267
268
269
270
271
272
273
274
275
276
CREATE TABLE node (
  nid SERIAL,
  type varchar(16) NOT NULL default '',
  title varchar(128) NOT NULL default '',
  score integer NOT NULL default '0',
  votes integer NOT NULL default '0',
  uid integer NOT NULL default '0',
  status integer NOT NULL default '1',
  created integer NOT NULL default '0',
  comment integer NOT NULL default '0',
  promote integer NOT NULL default '0',
  moderate integer NOT NULL default '0',
Dries's avatar
   
Dries committed
277
  users text NOT NULL default '',
Dries's avatar
   
Dries committed
278
279
  teaser text NOT NULL default '',
  body text NOT NULL default '',
Dries's avatar
   
Dries committed
280
  changed integer NOT NULL default '0',
Dries's avatar
   
Dries committed
281
  revisions text NOT NULL default '',
Dries's avatar
   
Dries committed
282
283
  static integer NOT NULL default '0',
  PRIMARY KEY  (nid)
Dries's avatar
   
Dries committed
284
);
Dries's avatar
   
Dries committed
285
286
CREATE INDEX node_type_idx ON node(type);
CREATE INDEX node_title_idx ON node(title,type);
Dries's avatar
   
Dries committed
287
288
CREATE INDEX node_status_idx ON node(status);
CREATE INDEX node_uid_idx ON node(uid);
Dries's avatar
   
Dries committed
289
290
CREATE INDEX node_moderate_idx ON node (moderate);
CREATE INDEX node_promote_status_idx ON node (promote, status);
Dries's avatar
   
Dries committed
291

Dries's avatar
   
Dries committed
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
--
-- Table structure for table 'node_counter'
--

CREATE TABLE node_counter (
  nid integer NOT NULL default '0',
  totalcount integer NOT NULL default '0',
  daycount integer NOT NULL default '0',
  timestamp integer NOT NULL default '0',
  PRIMARY KEY  (nid)
);
CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount);
CREATE INDEX node_counter_daycount_idx ON node_counter(daycount);
CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp);

Dries's avatar
   
Dries committed
307
308
309
--
-- Table structure for page
--
Dries's avatar
   
Dries committed
310

Dries's avatar
   
Dries committed
311
312
313
314
CREATE TABLE page (
  nid integer NOT NULL default '0',
  link varchar(128) NOT NULL default '',
  format smallint NOT NULL default '0',
Dries's avatar
   
Dries committed
315
  description varchar(128) NOT NULL default '',
Dries's avatar
   
Dries committed
316
  PRIMARY KEY  (nid)
Dries's avatar
   
Dries committed
317
);
Dries's avatar
   
Dries committed
318
CREATE INDEX page_nid_idx ON page(nid);
Dries's avatar
   
Dries committed
319

Dries's avatar
   
Dries committed
320
--
Dries's avatar
   
Dries committed
321
-- Table structure for table 'url_alias'
Dries's avatar
   
Dries committed
322
323
--

Dries's avatar
   
Dries committed
324
325
CREATE TABLE url_alias (
  pid serial,
Dries's avatar
   
Dries committed
326
327
328
329
  dst varchar(128) NOT NULL default '',
  src varchar(128) NOT NULL default '',
  PRIMARY KEY  (pid)
);
Dries's avatar
   
Dries committed
330
331
CREATE INDEX url_alias_src_idx ON url_alias(src);
CREATE INDEX url_alias_dst_idx ON url_alias(dst);
Dries's avatar
   
Dries committed
332
333
334
--
-- Table structure for permission
--
Dries's avatar
   
Dries committed
335

Dries's avatar
   
Dries committed
336
337
CREATE TABLE permission (
  rid integer NOT NULL default '0',
Dries's avatar
   
Dries committed
338
  perm text default '',
Dries's avatar
   
Dries committed
339
  tid integer NOT NULL default '0'
Dries's avatar
   
Dries committed
340
);
Dries's avatar
   
Dries committed
341
CREATE INDEX permission_rid_idx ON permission(rid);
Dries's avatar
   
Dries committed
342

Dries's avatar
   
Dries committed
343
344
345
--
-- Table structure for poll
--
Dries's avatar
   
Dries committed
346

Dries's avatar
   
Dries committed
347
348
349
CREATE TABLE poll (
  nid integer NOT NULL default '0',
  runtime integer NOT NULL default '0',
Dries's avatar
   
Dries committed
350
  voters text NOT NULL default '',
Dries's avatar
   
Dries committed
351
352
  active integer NOT NULL default '0',
  PRIMARY KEY  (nid)
Dries's avatar
   
Dries committed
353
);
Dries's avatar
   
Dries committed
354

Dries's avatar
   
Dries committed
355
356
357
--
-- Table structure for poll_choices
--
Dries's avatar
   
Dries committed
358

Dries's avatar
   
Dries committed
359
360
361
362
363
364
365
CREATE TABLE poll_choices (
  chid SERIAL,
  nid integer NOT NULL default '0',
  chtext varchar(128) NOT NULL default '',
  chvotes integer NOT NULL default '0',
  chorder integer NOT NULL default '0',
  PRIMARY KEY  (chid)
Dries's avatar
   
Dries committed
366
);
Dries's avatar
   
Dries committed
367
CREATE INDEX poll_choices_nid_idx ON poll_choices(nid);
Dries's avatar
   
Dries committed
368

Dries's avatar
   
Dries committed
369
370
371
--
-- Table structure for role
--
Dries's avatar
   
Dries committed
372

Dries's avatar
   
Dries committed
373
374
375
376
377
378
CREATE TABLE role (
  rid SERIAL,
  name varchar(32) NOT NULL default '',
  PRIMARY KEY  (rid),
  UNIQUE (name)
);
Dries's avatar
   
Dries committed
379

Dries's avatar
   
Dries committed
380
381
382
--
-- Table structure for search_index
--
Dries's avatar
   
Dries committed
383

Dries's avatar
   
Dries committed
384
CREATE TABLE search_index (
Dries's avatar
   
Dries committed
385
386
387
388
  word varchar(50) NOT NULL default '',
  lno integer NOT NULL default '0',
  type varchar(16) default NULL,
  count integer default NULL
Dries's avatar
   
Dries committed
389
390
391
);
CREATE INDEX search_index_lno_idx ON search_index(lno);
CREATE INDEX search_index_word_idx ON search_index(word);
Dries's avatar
   
Dries committed
392

Dries's avatar
   
Dries committed
393
394
395
396
397
398
399
400
401
402
403
404
405
--
-- Table structure for sessions
--

CREATE TABLE sessions (
  uid integer NOT NULL,
  sid varchar(32) NOT NULL default '',
  hostname varchar(128) NOT NULL default '',
  timestamp integer NOT NULL default '0',
  session text,
  PRIMARY KEY (sid)
);

Dries's avatar
   
Dries committed
406
407
408
409
410
411
412
413
414
415
416
--
-- Table structure for sequences
-- This is only used under MySQL, co commented out
--
--
-- CREATE TABLE sequences (
--   name varchar(255) NOT NULL,
--   id integer NOT NULL,
--   PRIMARY KEY (name)
-- );

Dries's avatar
   
Dries committed
417
418
419
--
-- Table structure for system
--
Dries's avatar
   
Dries committed
420

Dries's avatar
   
Dries committed
421
422
423
424
425
426
CREATE TABLE system (
  filename varchar(255) NOT NULL default '',
  name varchar(255) NOT NULL default '',
  type varchar(255) NOT NULL default '',
  description varchar(255) NOT NULL default '',
  status integer NOT NULL default '0',
Dries's avatar
   
Dries committed
427
  throttle smallint NOT NULL default '0',
Dries's avatar
   
Dries committed
428
  bootstrap integer NOT NULL default '0',
Dries's avatar
   
Dries committed
429
430
  PRIMARY KEY  (filename)
);
Dries's avatar
   
Dries committed
431

Dries's avatar
   
Dries committed
432
433
434
--
-- Table structure for term_data
--
Dries's avatar
   
Dries committed
435

Dries's avatar
   
Dries committed
436
437
438
439
CREATE TABLE term_data (
  tid SERIAL,
  vid integer NOT NULL default '0',
  name varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
440
  description text default '',
Dries's avatar
   
Dries committed
441
442
443
444
  weight smallint NOT NULL default '0',
  PRIMARY KEY  (tid)
);
CREATE INDEX term_data_vid_idx ON term_data(vid);
Dries's avatar
   
Dries committed
445

Dries's avatar
   
Dries committed
446
447
448
--
-- Table structure for term_hierarchy
--
Dries's avatar
   
Dries committed
449

Dries's avatar
   
Dries committed
450
451
452
453
454
455
CREATE TABLE term_hierarchy (
  tid integer NOT NULL default '0',
  parent integer NOT NULL default '0'
);
CREATE INDEX term_hierarchy_tid_idx ON term_hierarchy(tid);
CREATE INDEX term_hierarchy_parent_idx ON term_hierarchy(parent);
Dries's avatar
   
Dries committed
456

Dries's avatar
   
Dries committed
457
458
459
--
-- Table structure for term_node
--
Dries's avatar
   
Dries committed
460

Dries's avatar
   
Dries committed
461
462
463
464
465
466
CREATE TABLE term_node (
  nid integer NOT NULL default '0',
  tid integer NOT NULL default '0'
);
CREATE INDEX term_node_nid_idx ON term_node(nid);
CREATE INDEX term_node_tid_idx ON term_node(tid);
Dries's avatar
   
Dries committed
467

Dries's avatar
   
Dries committed
468
469
470
--
-- Table structure for term_relation
--
Dries's avatar
   
Dries committed
471

Dries's avatar
   
Dries committed
472
473
474
475
476
477
CREATE TABLE term_relation (
  tid1 integer NOT NULL default '0',
  tid2 integer NOT NULL default '0'
);
CREATE INDEX term_relation_tid1_idx ON term_relation(tid1);
CREATE INDEX term_relation_tid2_idx ON term_relation(tid2);
Dries's avatar
   
Dries committed
478

Dries's avatar
   
Dries committed
479
480
481
--
-- Table structure for term_synonym
--
Dries's avatar
   
Dries committed
482

Dries's avatar
   
Dries committed
483
484
485
486
487
488
CREATE TABLE term_synonym (
  tid integer NOT NULL default '0',
  name varchar(255) NOT NULL default ''
);
CREATE INDEX term_synonym_tid_idx ON term_synonym(tid);
CREATE INDEX term_synonym_name_idx ON term_synonym(name);
Dries's avatar
   
Dries committed
489

Dries's avatar
   
Dries committed
490
491
492
--
-- Table structure for users
--
Dries's avatar
   
Dries committed
493

Dries's avatar
   
Dries committed
494
CREATE TABLE users (
Dries's avatar
   
Dries committed
495
  uid integer NOT NULL default '0',
Dries's avatar
   
Dries committed
496
497
498
499
500
501
502
503
504
505
506
507
508
  name varchar(60) NOT NULL default '',
  pass varchar(32) NOT NULL default '',
  mail varchar(64) default '',
  mode smallint NOT NULL default '0',
  sort smallint default '0',
  threshold smallint default '0',
  theme varchar(255) NOT NULL default '',
  signature varchar(255) NOT NULL default '',
  timestamp integer NOT NULL default '0',
  status smallint NOT NULL default '0',
  timezone varchar(8) default NULL,
  language char(2) NOT NULL default '',
  init varchar(64) default '',
Dries's avatar
   
Dries committed
509
  data text default '',
Dries's avatar
   
Dries committed
510
511
512
513
  rid integer NOT NULL default '0',
  PRIMARY KEY  (uid),
  UNIQUE (name)
);
Dries's avatar
   
Dries committed
514
CREATE INDEX users_timestamp_idx ON users(timestamp);
Dries's avatar
   
Dries committed
515

Dries's avatar
   
Dries committed
516
517
CREATE SEQUENCE users_uid_seq INCREMENT 1 START 1;

Dries's avatar
   
Dries committed
518
519
520
--
-- Table structure for variable
--
Dries's avatar
   
Dries committed
521

Dries's avatar
   
Dries committed
522
CREATE TABLE variable (
Dries's avatar
   
Dries committed
523
  name varchar(48) NOT NULL default '',
Dries's avatar
   
Dries committed
524
  value text NOT NULL default '',
Dries's avatar
   
Dries committed
525
526
  PRIMARY KEY  (name)
);
Dries's avatar
   
Dries committed
527

Dries's avatar
   
Dries committed
528
529
530
--
-- Table structure for vocabulary
--
Dries's avatar
   
Dries committed
531

Dries's avatar
   
Dries committed
532
533
534
CREATE TABLE vocabulary (
  vid SERIAL,
  name varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
535
  description text default '',
Dries's avatar
   
Dries committed
536
537
538
539
  relations smallint NOT NULL default '0',
  hierarchy smallint NOT NULL default '0',
  multiple smallint NOT NULL default '0',
  required smallint NOT NULL default '0',
Dries's avatar
   
Dries committed
540
  nodes text default '',
Dries's avatar
   
Dries committed
541
542
543
  weight smallint NOT NULL default '0',
  PRIMARY KEY  (vid)
);
Dries's avatar
   
Dries committed
544

Dries's avatar
   
Dries committed
545
546
547
--
-- Table structure for watchdog
--
Dries's avatar
   
Dries committed
548

Dries's avatar
   
Dries committed
549
550
551
552
CREATE TABLE watchdog (
  wid SERIAL,
  uid integer NOT NULL default '0',
  type varchar(16) NOT NULL default '',
Dries's avatar
   
Dries committed
553
  message text NOT NULL default '',
Dries's avatar
   
Dries committed
554
  link varchar(255) NOT NULL default '',
Dries's avatar
   
Dries committed
555
556
557
558
559
  location varchar(128) NOT NULL default '',
  hostname varchar(128) NOT NULL default '',
  timestamp integer NOT NULL default '0',
  PRIMARY KEY  (wid)
);
Dries's avatar
   
Dries committed
560

Dries's avatar
   
Dries committed
561
562
563
--
-- Insert some default values
--
Dries's avatar
   
Dries committed
564

Dries's avatar
   
Dries committed
565
566
567
568
569
570
571
572
573
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1,0,0);
INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0);
INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0);
INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0);
INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0);
INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0);
INSERT INTO system VALUES ('themes/xtemplate/xtemplate.theme','xtemplate','theme','Internet explorer, Netscape, Opera',1,0,0);
Dries's avatar
   
Dries committed
574

Dries's avatar
   
Dries committed
575
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-10-27";');
Dries's avatar
   
Dries committed
576
INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";');
Dries's avatar
   
Dries committed
577
INSERT INTO users(uid,name,mail,rid) VALUES(0,'','', '1');
Dries's avatar
   
Dries committed
578
579

INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
Dries's avatar
   
Dries committed
580
INSERT INTO permission VALUES (1,'access content',0);
Dries's avatar
   
Dries committed
581
582

INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
Dries's avatar
   
Dries committed
583
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
Dries's avatar
   
Dries committed
584

Dries's avatar
   
Dries committed
585
586
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');
INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
Dries's avatar
   
Dries committed
587

Dries's avatar
   
Dries committed
588
589
590
591
592
593
594
595
596
597
598
599
600
---
--- Functions
---

CREATE FUNCTION "greatest"(integer, integer) RETURNS integer AS '
BEGIN
  IF $1 > $2 THEN
    RETURN $1;
  END IF;
  RETURN $2;
END;
' LANGUAGE 'plpgsql';

Dries's avatar
   
Dries committed
601
602
603
604
605
CREATE FUNCTION "rand"() RETURNS float AS '
BEGIN
  RETURN random();
END;
' LANGUAGE 'plpgsql';