2002-11-01 09:37:31 +00:00
|
|
|
-- PostgreSQL include file 31/10/2002
|
|
|
|
-- Maintainer: James Arthur, j_a_arthurATyahooDOTcom
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for access
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-11-01 09:37:31 +00:00
|
|
|
--
|
|
|
|
-- 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'
|
|
|
|
);
|
2003-08-27 05:49:52 +00:00
|
|
|
CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp);
|
2002-11-01 09:37:31 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for authmap
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for blocks
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE blocks (
|
|
|
|
module varchar(64) NOT NULL default '',
|
2003-04-19 16:42:42 +00:00
|
|
|
delta varchar(32) NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
status smallint NOT NULL default '0',
|
|
|
|
weight smallint NOT NULL default '0',
|
|
|
|
region smallint NOT NULL default '0',
|
|
|
|
path varchar(255) NOT NULL default '',
|
2003-11-28 20:03:00 +00:00
|
|
|
custom smallint NOT NULL default '0',
|
|
|
|
throttle smallint NOT NULL default '0'
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for book
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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',
|
2002-11-01 09:37:31 +00:00
|
|
|
log text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (nid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE INDEX book_nid_idx ON book(nid);
|
2003-05-18 16:43:56 +00:00
|
|
|
CREATE INDEX book_parent ON book(parent);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for boxes
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE boxes (
|
|
|
|
bid SERIAL,
|
|
|
|
title varchar(64) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
body text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
info varchar(128) NOT NULL default '',
|
|
|
|
type smallint NOT NULL default '0',
|
|
|
|
PRIMARY KEY (bid),
|
|
|
|
UNIQUE (info),
|
|
|
|
UNIQUE (title)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for bundle
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE bundle (
|
|
|
|
bid SERIAL,
|
|
|
|
title varchar(255) NOT NULL default '',
|
|
|
|
attributes varchar(255) NOT NULL default '',
|
|
|
|
PRIMARY KEY (bid),
|
|
|
|
UNIQUE (title)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for cache
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE cache (
|
|
|
|
cid varchar(255) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
data text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
expire integer NOT NULL default '0',
|
2002-12-11 22:00:04 +00:00
|
|
|
created integer NOT NULL default '0',
|
2004-01-14 22:30:09 +00:00
|
|
|
headers text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (cid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for comments
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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 '',
|
2002-11-01 09:37:31 +00:00
|
|
|
comment text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
hostname varchar(128) NOT NULL default '',
|
|
|
|
timestamp integer NOT NULL default '0',
|
|
|
|
link varchar(16) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
score integer NOT NULL default '0',
|
|
|
|
status smallint NOT NULL default '0',
|
2003-09-30 08:55:03 +00:00
|
|
|
thread varchar(255) default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
users text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (cid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
2002-11-01 09:37:31 +00:00
|
|
|
CREATE INDEX comments_nid_idx ON comments(nid);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for directory
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE directory (
|
|
|
|
link varchar(255) NOT NULL default '',
|
|
|
|
name varchar(128) NOT NULL default '',
|
|
|
|
mail varchar(128) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
slogan text NOT NULL default '',
|
|
|
|
mission text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
timestamp integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (link)
|
2001-11-01 11:00:51 +00:00
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for feed
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE feed (
|
|
|
|
fid SERIAL,
|
|
|
|
title varchar(255) NOT NULL default '',
|
|
|
|
url varchar(255) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
refresh integer NOT NULL default '0',
|
2004-01-07 19:52:10 +00:00
|
|
|
checked integer NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
attributes varchar(255) NOT NULL default '',
|
|
|
|
link varchar(255) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
description text NOT NULL default '',
|
2004-01-11 15:05:21 +00:00
|
|
|
image text NOT NULL default '',
|
2004-01-07 19:52:10 +00:00
|
|
|
etag varchar(255) NOT NULL default '',
|
|
|
|
modified integer NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (fid),
|
|
|
|
UNIQUE (title),
|
|
|
|
UNIQUE (url)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-11-01 09:37:31 +00:00
|
|
|
--
|
|
|
|
-- Table structure for table 'forum'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE forum (
|
|
|
|
nid integer NOT NULL default '0',
|
2003-02-06 19:14:19 +00:00
|
|
|
tid integer NOT NULL default '0',
|
2002-11-01 09:37:31 +00:00
|
|
|
icon varchar(255) NOT NULL default '',
|
|
|
|
shadow integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (nid)
|
|
|
|
);
|
2003-02-06 19:14:19 +00:00
|
|
|
CREATE INDEX forum_tid_idx ON forum(tid);
|
2002-11-01 09:37:31 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for history
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for item
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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 '',
|
2002-11-01 09:37:31 +00:00
|
|
|
description text NOT NULL default '',
|
2003-01-04 11:03:15 +00:00
|
|
|
timestamp integer NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
attributes varchar(255) NOT NULL default '',
|
|
|
|
PRIMARY KEY (iid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for locales
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE locales (
|
|
|
|
lid SERIAL,
|
|
|
|
location varchar(128) NOT NULL default '',
|
2002-09-22 10:01:03 +00:00
|
|
|
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 '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (lid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
2002-11-01 09:37:31 +00:00
|
|
|
-- Table structure for table 'moderation_filters'
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-11-01 09:37:31 +00:00
|
|
|
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)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for node
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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',
|
2002-08-26 18:18:12 +00:00
|
|
|
users text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
attributes varchar(255) NOT NULL default '',
|
2002-09-22 10:01:03 +00:00
|
|
|
teaser text NOT NULL default '',
|
|
|
|
body text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
changed integer NOT NULL default '0',
|
2002-09-22 10:01:03 +00:00
|
|
|
revisions text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
static integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (nid)
|
2001-10-09 21:01:47 +00:00
|
|
|
);
|
2003-10-01 05:18:03 +00:00
|
|
|
CREATE INDEX node_type_idx ON node(type);
|
|
|
|
CREATE INDEX node_title_idx ON node(title,type);
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE INDEX node_status_idx ON node(status);
|
|
|
|
CREATE INDEX node_uid_idx ON node(uid);
|
2003-08-27 05:49:52 +00:00
|
|
|
CREATE INDEX node_moderate_idx ON node (moderate);
|
|
|
|
CREATE INDEX node_promote_status_idx ON node (promote, status);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2003-10-22 20:20:35 +00:00
|
|
|
--
|
|
|
|
-- 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);
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for page
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE page (
|
|
|
|
nid integer NOT NULL default '0',
|
|
|
|
link varchar(128) NOT NULL default '',
|
|
|
|
format smallint NOT NULL default '0',
|
2002-11-30 15:21:36 +00:00
|
|
|
description varchar(128) NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (nid)
|
2001-11-01 11:00:51 +00:00
|
|
|
);
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE INDEX page_nid_idx ON page(nid);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2003-10-01 05:18:03 +00:00
|
|
|
--
|
2003-10-22 20:20:35 +00:00
|
|
|
-- Table structure for table 'url_alias'
|
2003-10-01 05:18:03 +00:00
|
|
|
--
|
|
|
|
|
2003-10-22 20:20:35 +00:00
|
|
|
CREATE TABLE url_alias (
|
|
|
|
pid serial,
|
2003-10-01 05:18:03 +00:00
|
|
|
dst varchar(128) NOT NULL default '',
|
|
|
|
src varchar(128) NOT NULL default '',
|
|
|
|
PRIMARY KEY (pid)
|
|
|
|
);
|
2003-10-22 20:20:35 +00:00
|
|
|
CREATE INDEX url_alias_src_idx ON url_alias(src);
|
|
|
|
CREATE INDEX url_alias_dst_idx ON url_alias(dst);
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for permission
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE permission (
|
|
|
|
rid integer NOT NULL default '0',
|
2002-11-01 09:37:31 +00:00
|
|
|
perm text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
tid integer NOT NULL default '0'
|
2001-11-01 11:00:51 +00:00
|
|
|
);
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE INDEX permission_rid_idx ON permission(rid);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for poll
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE poll (
|
|
|
|
nid integer NOT NULL default '0',
|
|
|
|
runtime integer NOT NULL default '0',
|
2002-11-01 09:37:31 +00:00
|
|
|
voters text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
active integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (nid)
|
2001-11-01 11:00:51 +00:00
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for poll_choices
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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)
|
2001-11-01 11:00:51 +00:00
|
|
|
);
|
2002-11-01 09:37:31 +00:00
|
|
|
CREATE INDEX poll_choices_nid_idx ON poll_choices(nid);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for role
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE role (
|
|
|
|
rid SERIAL,
|
|
|
|
name varchar(32) NOT NULL default '',
|
|
|
|
PRIMARY KEY (rid),
|
|
|
|
UNIQUE (name)
|
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for search_index
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE search_index (
|
2002-11-01 09:37:31 +00:00
|
|
|
word varchar(50) NOT NULL default '',
|
|
|
|
lno integer NOT NULL default '0',
|
|
|
|
type varchar(16) default NULL,
|
|
|
|
count integer default NULL
|
2002-08-16 07:38:36 +00:00
|
|
|
);
|
|
|
|
CREATE INDEX search_index_lno_idx ON search_index(lno);
|
|
|
|
CREATE INDEX search_index_word_idx ON search_index(word);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2003-08-20 19:19:13 +00:00
|
|
|
--
|
|
|
|
-- 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)
|
|
|
|
);
|
|
|
|
|
2002-11-01 09:37:31 +00:00
|
|
|
--
|
|
|
|
-- 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)
|
|
|
|
-- );
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for system
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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',
|
2003-12-07 18:25:09 +00:00
|
|
|
throttle smallint NOT NULL default '0',
|
2003-11-18 19:44:36 +00:00
|
|
|
bootstrap integer NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (filename)
|
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for term_data
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE term_data (
|
|
|
|
tid SERIAL,
|
|
|
|
vid integer NOT NULL default '0',
|
|
|
|
name varchar(255) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
description text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
weight smallint NOT NULL default '0',
|
|
|
|
PRIMARY KEY (tid)
|
|
|
|
);
|
|
|
|
CREATE INDEX term_data_vid_idx ON term_data(vid);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for term_hierarchy
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for term_node
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for term_relation
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for term_synonym
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
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);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for users
|
|
|
|
--
|
2001-11-01 11:00:51 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE users (
|
2003-09-09 18:18:43 +00:00
|
|
|
uid integer NOT NULL default '0',
|
2002-08-16 07:38:36 +00:00
|
|
|
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 '',
|
2002-11-01 09:37:31 +00:00
|
|
|
data text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
rid integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (uid),
|
|
|
|
UNIQUE (name)
|
|
|
|
);
|
2002-11-01 09:37:31 +00:00
|
|
|
CREATE INDEX users_timestamp_idx ON users(timestamp);
|
2001-11-01 11:00:51 +00:00
|
|
|
|
2003-09-30 08:55:03 +00:00
|
|
|
CREATE SEQUENCE users_uid_seq INCREMENT 1 START 1;
|
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for variable
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE variable (
|
2003-10-26 21:39:20 +00:00
|
|
|
name varchar(48) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
value text NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
PRIMARY KEY (name)
|
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for vocabulary
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE vocabulary (
|
|
|
|
vid SERIAL,
|
|
|
|
name varchar(255) NOT NULL default '',
|
2002-11-01 09:37:31 +00:00
|
|
|
description text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
relations smallint NOT NULL default '0',
|
|
|
|
hierarchy smallint NOT NULL default '0',
|
|
|
|
multiple smallint NOT NULL default '0',
|
|
|
|
required smallint NOT NULL default '0',
|
2003-06-04 18:24:39 +00:00
|
|
|
nodes text default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
weight smallint NOT NULL default '0',
|
|
|
|
PRIMARY KEY (vid)
|
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Table structure for watchdog
|
|
|
|
--
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-16 07:38:36 +00:00
|
|
|
CREATE TABLE watchdog (
|
|
|
|
wid SERIAL,
|
|
|
|
uid integer NOT NULL default '0',
|
|
|
|
type varchar(16) NOT NULL default '',
|
2002-08-26 18:18:12 +00:00
|
|
|
message text NOT NULL default '',
|
2003-01-04 11:03:15 +00:00
|
|
|
link varchar(255) NOT NULL default '',
|
2002-08-16 07:38:36 +00:00
|
|
|
location varchar(128) NOT NULL default '',
|
|
|
|
hostname varchar(128) NOT NULL default '',
|
|
|
|
timestamp integer NOT NULL default '0',
|
|
|
|
PRIMARY KEY (wid)
|
|
|
|
);
|
2001-10-09 21:01:47 +00:00
|
|
|
|
2002-08-22 18:21:44 +00:00
|
|
|
--
|
|
|
|
-- Insert some default values
|
|
|
|
--
|
2001-11-01 11:00:51 +00:00
|
|
|
|
2003-12-08 17:57:03 +00:00
|
|
|
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);
|
2002-08-16 07:38:36 +00:00
|
|
|
|
2003-10-31 19:42:08 +00:00
|
|
|
INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2003-10-27";');
|
2003-12-07 18:25:09 +00:00
|
|
|
INSERT INTO variable(name,value) VALUES('theme_default','s:9:"xtemplate";');
|
2003-10-23 15:31:10 +00:00
|
|
|
INSERT INTO users(uid,name,mail,rid) VALUES(0,'','', '1');
|
2004-01-24 16:54:22 +00:00
|
|
|
|
|
|
|
INSERT INTO role (rid, name) VALUES (1, 'anonymous user');
|
2004-01-15 20:20:34 +00:00
|
|
|
INSERT INTO permission VALUES (1,'access content',0);
|
2004-01-24 16:54:22 +00:00
|
|
|
|
|
|
|
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
|
2004-01-15 20:20:34 +00:00
|
|
|
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
|
2002-08-16 07:38:36 +00:00
|
|
|
|
2002-11-30 15:21:36 +00:00
|
|
|
INSERT INTO blocks(module,delta,status) VALUES('user', '0', '1');
|
|
|
|
INSERT INTO blocks(module,delta,status) VALUES('user', '1', '1');
|
2001-11-01 11:00:51 +00:00
|
|
|
|
2002-11-08 13:11:42 +00:00
|
|
|
---
|
|
|
|
--- Functions
|
|
|
|
---
|
|
|
|
|
|
|
|
CREATE FUNCTION "greatest"(integer, integer) RETURNS integer AS '
|
|
|
|
BEGIN
|
|
|
|
IF $1 > $2 THEN
|
|
|
|
RETURN $1;
|
|
|
|
END IF;
|
|
|
|
RETURN $2;
|
|
|
|
END;
|
|
|
|
' LANGUAGE 'plpgsql';
|
|
|
|
|
2003-09-30 08:55:03 +00:00
|
|
|
CREATE FUNCTION "rand"() RETURNS float AS '
|
|
|
|
BEGIN
|
|
|
|
RETURN random();
|
|
|
|
END;
|
|
|
|
' LANGUAGE 'plpgsql';
|