2 id int NOT NULL PRIMARY KEY,
3 name varchar(64) NOT NULL,
9 CREATE TABLE messages (
10 list int NOT NULL REFERENCES lists(id) ON DELETE CASCADE,
14 date timestamptz NOT NULL,
15 subject varchar(128) NOT NULL,
16 author varchar(128) NOT NULL,
20 ALTER TABLE messages ADD CONSTRAINT pk_messages PRIMARY KEY (list,year,month,msgnum);
24 id int NOT NULL PRIMARY KEY,
25 hostname text NOT NULL UNIQUE,
26 description text NOT NULL,
27 https boolean NOT NULL DEFAULT 'f',
28 pagecount int NOT NULL
31 CREATE TABLE webpages (
32 site int NOT NULL REFERENCES sites(id) ON DELETE CASCADE,
33 suburl varchar(512) NOT NULL,
34 title varchar(128) NOT NULL,
35 relprio float NOT NULL DEFAULT 0.5,
36 isinternal boolean NOT NULL DEFAULT 'f',
37 lastscanned timestamptz NULL,
41 ALTER TABLE webpages ADD CONSTRAINT pk_webpages PRIMARY KEY (site, suburl);
43 CREATE TABLE site_excludes (
44 site int NOT NULL REFERENCES sites(id) ON DELETE CASCADE,
45 suburlre varchar(512) NOT NULL
47 ALTER TABLE site_excludes ADD CONSTRAINT pk_site_excludes PRIMARY KEY (site,suburlre);
49 CREATE TABLE lastcrawl (
50 lastcrawl timestamptz NOT NULL
52 INSERT INTO lastcrawl VALUES (CURRENT_TIMESTAMP);