author | chris <chris@marvin> |
Tue, 20 Jan 2009 10:21:03 +0100 | |
changeset 0 | f907866f0e4b |
permissions | -rw-r--r-- |
chris@0 | 1 |
CREATE DATABASE staroffice_news; |
chris@0 | 2 |
|
chris@0 | 3 |
CREATE TABLE groups |
chris@0 | 4 |
( |
chris@0 | 5 |
group_id SERIAL, |
chris@0 | 6 |
name VARCHAR(80) NOT NULL, |
chris@0 | 7 |
flags INTEGER DEFAULT 0 NOT NULL |
chris@0 | 8 |
); |
chris@0 | 9 |
|
chris@0 | 10 |
CREATE UNIQUE INDEX name_id_index ON groups (name); |
chris@0 | 11 |
|
chris@0 | 12 |
CREATE TABLE articles |
chris@0 | 13 |
( |
chris@0 | 14 |
article_id SERIAL, |
chris@0 | 15 |
message_id TEXT, |
chris@0 | 16 |
header TEXT, |
chris@0 | 17 |
body TEXT |
chris@0 | 18 |
); |
chris@0 | 19 |
|
chris@0 | 20 |
CREATE UNIQUE INDEX article_message_index ON articles (message_id(255)); |
chris@0 | 21 |
|
chris@0 | 22 |
CREATE TABLE postings |
chris@0 | 23 |
( |
chris@0 | 24 |
group_id INTEGER, |
chris@0 | 25 |
article_id INTEGER, |
chris@0 | 26 |
article_index INTEGER NOT NULL |
chris@0 | 27 |
); |
chris@0 | 28 |
|
chris@0 | 29 |
CREATE UNIQUE INDEX posting_article_index ON postings (article_id); |
chris@0 | 30 |
|
chris@0 | 31 |
CREATE TABLE subscriptions |
chris@0 | 32 |
( |
chris@0 | 33 |
group_id INTEGER |
chris@0 | 34 |
); |
chris@0 | 35 |
|
chris@0 | 36 |
CREATE TABLE overview |
chris@0 | 37 |
( |
chris@0 | 38 |
header TEXT |
chris@0 | 39 |
); |