database.pgsql 13.7 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 28
--
-- 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
29 30 31
--
-- Table structure for authmap
--
Dries's avatar
 
Dries committed
32

Dries's avatar
 
Dries committed
33 34 35 36 37 38 39
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
40 41
);

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

Dries's avatar
 
Dries committed
46 47
CREATE TABLE blocks (
  module varchar(64) NOT NULL default '',
Dries's avatar
 
Dries committed
48
  delta varchar(32) NOT NULL default '0',
Dries's avatar
 
Dries committed
49 50 51 52
  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
53
  custom smallint NOT NULL default '0'
Dries's avatar
 
Dries committed
54 55
);

Dries's avatar
 
Dries committed
56 57 58
--
-- Table structure for book
--
Dries's avatar
 
Dries committed
59

Dries's avatar
 
Dries committed
60 61 62 63 64
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
65
  log text default '',
Dries's avatar
 
Dries committed
66
  PRIMARY KEY (nid)
Dries's avatar
 
Dries committed
67
);
Dries's avatar
 
Dries committed
68
CREATE INDEX book_nid_idx ON book(nid);
Dries's avatar
 
Dries committed
69
CREATE INDEX book_parent ON book(parent);
Dries's avatar
 
Dries committed
70

Dries's avatar
 
Dries committed
71 72 73
--
-- Table structure for boxes
--
Dries's avatar
 
Dries committed
74

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

Dries's avatar
 
Dries committed
86 87 88
--
-- Table structure for bundle
--
Dries's avatar
 
Dries committed
89

Dries's avatar
 
Dries committed
90 91 92 93 94 95
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
96 97
);

Dries's avatar
 
Dries committed
98 99 100
--
-- Table structure for cache
--
Dries's avatar
 
Dries committed
101

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

Dries's avatar
 
Dries committed
110 111 112
--
-- Table structure for comments
--
Dries's avatar
 
Dries committed
113

Dries's avatar
 
Dries committed
114 115 116 117 118 119
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
120
  comment text NOT NULL default '',
Dries's avatar
 
Dries committed
121 122 123
  hostname varchar(128) NOT NULL default '',
  timestamp integer NOT NULL default '0',
  link varchar(16) NOT NULL default '',
Dries's avatar
 
Dries committed
124 125
  score integer NOT NULL default '0',
  status smallint  NOT NULL default '0',
Dries's avatar
 
Dries committed
126
  thread vharchar(255) NOT NULL,
Dries's avatar
 
Dries committed
127
  users text default '',
Dries's avatar
 
Dries committed
128
  PRIMARY KEY  (cid)
Dries's avatar
 
Dries committed
129
);
Dries's avatar
 
Dries committed
130
CREATE INDEX comments_nid_idx ON comments(nid);
Dries's avatar
 
Dries committed
131

Dries's avatar
 
Dries committed
132 133 134
--
-- Table structure for directory
--
Dries's avatar
 
Dries committed
135

Dries's avatar
 
Dries committed
136 137 138 139
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
140 141
  slogan text NOT NULL default '',
  mission text NOT NULL default '',
Dries's avatar
 
Dries committed
142 143
  timestamp integer NOT NULL default '0',
  PRIMARY KEY  (link)
Dries's avatar
 
Dries committed
144
);
Dries's avatar
 
Dries committed
145

Dries's avatar
 
Dries committed
146 147 148
--
-- Table structure for feed
--
Dries's avatar
 
Dries committed
149

Dries's avatar
 
Dries committed
150 151 152 153
CREATE TABLE feed (
  fid SERIAL,
  title varchar(255) NOT NULL default '',
  url varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
154 155
  refresh integer NOT NULL default '0',
  timestamp integer NOT NULL default '0',
Dries's avatar
 
Dries committed
156 157
  attributes varchar(255) NOT NULL default '',
  link varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
158
  description text NOT NULL default '',
Dries's avatar
 
Dries committed
159 160 161
  PRIMARY KEY  (fid),
  UNIQUE (title),
  UNIQUE (url)
Dries's avatar
 
Dries committed
162 163
);

Dries's avatar
 
Dries committed
164 165 166 167 168 169
--
-- Table structure for table 'forum'
--

CREATE TABLE forum (
  nid integer NOT NULL default '0',
Dries's avatar
 
Dries committed
170
  tid integer NOT NULL default '0',
Dries's avatar
 
Dries committed
171 172 173 174
  icon varchar(255) NOT NULL default '',
  shadow integer NOT NULL default '0',
  PRIMARY KEY  (nid)
);
Dries's avatar
 
Dries committed
175
CREATE INDEX forum_tid_idx ON forum(tid);
Dries's avatar
 
Dries committed
176

Dries's avatar
 
Dries committed
177 178 179
--
-- Table structure for history
--
Dries's avatar
 
Dries committed
180

Dries's avatar
 
Dries committed
181 182 183 184 185
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
186 187
);

Dries's avatar
 
Dries committed
188 189 190
--
-- Table structure for item
--
Dries's avatar
 
Dries committed
191

Dries's avatar
 
Dries committed
192 193 194 195 196 197
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
198
  description text NOT NULL default '',
Dries's avatar
 
Dries committed
199
  timestamp integer NOT NULL default '0',
Dries's avatar
 
Dries committed
200 201
  attributes varchar(255) NOT NULL default '',
  PRIMARY KEY  (iid)
Dries's avatar
 
Dries committed
202 203
);

Dries's avatar
 
Dries committed
204 205 206
--
-- Table structure for locales
--
Dries's avatar
 
Dries committed
207

Dries's avatar
 
Dries committed
208 209 210
CREATE TABLE locales (
  lid SERIAL,
  location varchar(128) NOT NULL default '',
Dries's avatar
 
Dries committed
211 212 213 214 215 216 217 218 219
  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
220
  PRIMARY KEY  (lid)
Dries's avatar
 
Dries committed
221 222
);

Dries's avatar
 
Dries committed
223
--
Dries's avatar
 
Dries committed
224
-- Table structure for table 'moderation_filters'
Dries's avatar
 
Dries committed
225
--
Dries's avatar
 
Dries committed
226

Dries's avatar
 
Dries committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
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
255 256
);

Dries's avatar
 
Dries committed
257 258 259
--
-- Table structure for node
--
Dries's avatar
 
Dries committed
260

Dries's avatar
 
Dries committed
261 262 263 264
CREATE TABLE node (
  nid SERIAL,
  type varchar(16) NOT NULL default '',
  title varchar(128) NOT NULL default '',
Dries's avatar
 
Dries committed
265
  path varchar(250) NULL default '',
Dries's avatar
 
Dries committed
266 267 268 269 270 271 272 273
  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
274
  users text NOT NULL default '',
Dries's avatar
 
Dries committed
275
  attributes varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
276 277
  teaser text NOT NULL default '',
  body text NOT NULL default '',
Dries's avatar
 
Dries committed
278
  changed integer NOT NULL default '0',
Dries's avatar
 
Dries committed
279
  revisions text NOT NULL default '',
Dries's avatar
 
Dries committed
280 281
  static integer NOT NULL default '0',
  PRIMARY KEY  (nid)
Dries's avatar
 
Dries committed
282
);
Dries's avatar
 
Dries committed
283 284 285 286 287
CREATE INDEX node_type_idx ON node(type);
CREATE INDEX node_title_idx ON node(title,type);
CREATE INDEX node_promote_idx ON node(promote);
CREATE INDEX node_status_idx ON node(status);
CREATE INDEX node_uid_idx ON node(uid);
Dries's avatar
 
Dries committed
288

Dries's avatar
 
Dries committed
289 290 291
--
-- Table structure for page
--
Dries's avatar
 
Dries committed
292

Dries's avatar
 
Dries committed
293 294 295 296
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
297
  description varchar(128) NOT NULL default '',
Dries's avatar
 
Dries committed
298
  PRIMARY KEY  (nid)
Dries's avatar
 
Dries committed
299
);
Dries's avatar
 
Dries committed
300
CREATE INDEX page_nid_idx ON page(nid);
Dries's avatar
 
Dries committed
301

Dries's avatar
 
Dries committed
302 303 304
--
-- Table structure for permission
--
Dries's avatar
 
Dries committed
305

Dries's avatar
 
Dries committed
306 307
CREATE TABLE permission (
  rid integer NOT NULL default '0',
Dries's avatar
 
Dries committed
308
  perm text default '',
Dries's avatar
 
Dries committed
309
  tid integer NOT NULL default '0'
Dries's avatar
 
Dries committed
310
);
Dries's avatar
 
Dries committed
311
CREATE INDEX permission_rid_idx ON permission(rid);
Dries's avatar
 
Dries committed
312

Dries's avatar
 
Dries committed
313 314 315
--
-- Table structure for poll
--
Dries's avatar
 
Dries committed
316

Dries's avatar
 
Dries committed
317 318 319
CREATE TABLE poll (
  nid integer NOT NULL default '0',
  runtime integer NOT NULL default '0',
Dries's avatar
 
Dries committed
320
  voters text NOT NULL default '',
Dries's avatar
 
Dries committed
321 322
  active integer NOT NULL default '0',
  PRIMARY KEY  (nid)
Dries's avatar
 
Dries committed
323
);
Dries's avatar
 
Dries committed
324

Dries's avatar
 
Dries committed
325 326 327
--
-- Table structure for poll_choices
--
Dries's avatar
 
Dries committed
328

Dries's avatar
 
Dries committed
329 330 331 332 333 334 335
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
336
);
Dries's avatar
 
Dries committed
337
CREATE INDEX poll_choices_nid_idx ON poll_choices(nid);
Dries's avatar
 
Dries committed
338

Dries's avatar
 
Dries committed
339 340 341
--
-- Table structure for role
--
Dries's avatar
 
Dries committed
342

Dries's avatar
 
Dries committed
343 344 345 346 347 348
CREATE TABLE role (
  rid SERIAL,
  name varchar(32) NOT NULL default '',
  PRIMARY KEY  (rid),
  UNIQUE (name)
);
Dries's avatar
 
Dries committed
349

Dries's avatar
 
Dries committed
350 351 352
--
-- Table structure for search_index
--
Dries's avatar
 
Dries committed
353

Dries's avatar
 
Dries committed
354
CREATE TABLE search_index (
Dries's avatar
 
Dries committed
355 356 357 358
  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
359 360 361
);
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
362

Dries's avatar
 
Dries committed
363 364 365 366 367 368 369 370 371 372 373
--
-- 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
374 375 376
--
-- Table structure for site
--
Dries's avatar
 
Dries committed
377

Dries's avatar
 
Dries committed
378 379 380 381
CREATE TABLE site (
  sid SERIAL,
  name varchar(128) NOT NULL default '',
  link varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
382
  size text NOT NULL default '',
Dries's avatar
 
Dries committed
383 384
  changed integer NOT NULL default '0',
  checked integer NOT NULL default '0',
Dries's avatar
 
Dries committed
385 386 387 388 389 390 391
  feed varchar(255) NOT NULL default '',
  refresh integer NOT NULL default '0',
  threshold integer NOT NULL default '0',
  PRIMARY KEY  (sid),
  UNIQUE (name),
  UNIQUE (link)
);
Dries's avatar
 
Dries committed
392

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

CREATE TABLE statistics (
  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 statistics_totalcount_idx ON statistics(totalcount);
CREATE INDEX statistics_daycount_idx ON statistics(daycount);
CREATE INDEX statistics_timestamp_idx ON statistics(timestamp);

Dries's avatar
 
Dries committed
408 409 410
--
-- Table structure for system
--
Dries's avatar
 
Dries committed
411

Dries's avatar
 
Dries committed
412 413 414 415 416 417 418 419
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',
  PRIMARY KEY  (filename)
);
Dries's avatar
 
Dries committed
420

Dries's avatar
 
Dries committed
421

Dries's avatar
 
Dries committed
422

Dries's avatar
 
Dries committed
423 424 425
--
-- Table structure for term_data
--
Dries's avatar
 
Dries committed
426

Dries's avatar
 
Dries committed
427 428 429 430
CREATE TABLE term_data (
  tid SERIAL,
  vid integer NOT NULL default '0',
  name varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
431
  description text default '',
Dries's avatar
 
Dries committed
432 433 434 435
  weight smallint NOT NULL default '0',
  PRIMARY KEY  (tid)
);
CREATE INDEX term_data_vid_idx ON term_data(vid);
Dries's avatar
 
Dries committed
436

Dries's avatar
 
Dries committed
437 438 439
--
-- Table structure for term_hierarchy
--
Dries's avatar
 
Dries committed
440

Dries's avatar
 
Dries committed
441 442 443 444 445 446
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
447

Dries's avatar
 
Dries committed
448 449 450
--
-- Table structure for term_node
--
Dries's avatar
 
Dries committed
451

Dries's avatar
 
Dries committed
452 453 454 455 456 457
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
458

Dries's avatar
 
Dries committed
459 460 461
--
-- Table structure for term_relation
--
Dries's avatar
 
Dries committed
462

Dries's avatar
 
Dries committed
463 464 465 466 467 468
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
469

Dries's avatar
 
Dries committed
470 471 472
--
-- Table structure for term_synonym
--
Dries's avatar
 
Dries committed
473

Dries's avatar
 
Dries committed
474 475 476 477 478 479
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
480

Dries's avatar
 
Dries committed
481 482 483
--
-- Table structure for users
--
Dries's avatar
 
Dries committed
484

Dries's avatar
 
Dries committed
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
CREATE TABLE users (
  uid SERIAL,
  name varchar(60) NOT NULL default '',
  pass varchar(32) NOT NULL default '',
  mail varchar(64) default '',
  homepage varchar(128) NOT NULL 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',
  hostname varchar(128) NOT NULL default '',
  status smallint NOT NULL default '0',
  timezone varchar(8) default NULL,
  rating decimal(8,2) default NULL,
  language char(2) NOT NULL default '',
  sid varchar(32) NOT NULL default '',
  init varchar(64) default '',
Dries's avatar
 
Dries committed
504 505
  session text default '',
  data text default '',
Dries's avatar
 
Dries committed
506 507 508 509
  rid integer NOT NULL default '0',
  PRIMARY KEY  (uid),
  UNIQUE (name)
);
Dries's avatar
 
Dries committed
510 511
CREATE INDEX users_sid_idx ON users(sid);
CREATE INDEX users_timestamp_idx ON users(timestamp);
Dries's avatar
 
Dries committed
512

Dries's avatar
 
Dries committed
513 514 515
--
-- Table structure for variable
--
Dries's avatar
 
Dries committed
516

Dries's avatar
 
Dries committed
517 518
CREATE TABLE variable (
  name varchar(32) NOT NULL default '',
Dries's avatar
 
Dries committed
519
  value text NOT NULL default '',
Dries's avatar
 
Dries committed
520 521
  PRIMARY KEY  (name)
);
Dries's avatar
 
Dries committed
522

Dries's avatar
 
Dries committed
523 524 525
--
-- Table structure for vocabulary
--
Dries's avatar
 
Dries committed
526

Dries's avatar
 
Dries committed
527 528 529
CREATE TABLE vocabulary (
  vid SERIAL,
  name varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
530
  description text default '',
Dries's avatar
 
Dries committed
531 532 533 534
  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
535
  nodes text default '',
Dries's avatar
 
Dries committed
536 537 538
  weight smallint NOT NULL default '0',
  PRIMARY KEY  (vid)
);
Dries's avatar
 
Dries committed
539

Dries's avatar
 
Dries committed
540 541 542
--
-- Table structure for watchdog
--
Dries's avatar
 
Dries committed
543

Dries's avatar
 
Dries committed
544 545 546 547
CREATE TABLE watchdog (
  wid SERIAL,
  uid integer NOT NULL default '0',
  type varchar(16) NOT NULL default '',
Dries's avatar
 
Dries committed
548
  message text NOT NULL default '',
Dries's avatar
 
Dries committed
549
  link varchar(255) NOT NULL default '',
Dries's avatar
 
Dries committed
550 551 552 553 554
  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
555

Dries's avatar
 
Dries committed
556 557 558
--
-- Insert some default values
--
Dries's avatar
 
Dries committed
559

Dries's avatar
 
Dries committed
560
INSERT INTO system VALUES ('modules/admin.module','admin','module','',1);
Dries's avatar
 
Dries committed
561 562 563 564 565 566 567
INSERT INTO system VALUES ('modules/block.module','block','module','',1);
INSERT INTO system VALUES ('modules/comment.module','comment','module','',1);
INSERT INTO system VALUES ('modules/help.module','help','module','',1);
INSERT INTO system VALUES ('modules/node.module','node','module','',1);
INSERT INTO system VALUES ('modules/page.module','page','module','',1);
INSERT INTO system VALUES ('modules/story.module','story','module','',1);
INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1);
Dries's avatar
 
Dries committed
568 569
INSERT INTO system VALUES ('themes/marvin/marvin.theme','marvin','theme','Internet explorer, Netscape, Opera',1);

Dries's avatar
 
Dries committed
570
INSERT INTO variable(name,value) VALUES('update_start', 'S:10:"2003-04-19";');
Dries's avatar
 
Dries committed
571
INSERT INTO variable(name,value) VALUES('theme_default','s:6:"marvin";');
Dries's avatar
 
Dries committed
572

Dries's avatar
 
Dries committed
573 574
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
575

Dries's avatar
 
Dries committed
576 577 578 579 580 581 582 583 584 585 586 587 588
---
--- Functions
---

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