chris@0: CREATE DATABASE staroffice_news; chris@0: chris@0: CREATE TABLE groups chris@0: ( chris@0: group_id SERIAL, chris@0: name VARCHAR(80) NOT NULL, chris@0: flags INTEGER DEFAULT 0 NOT NULL chris@0: ); chris@0: chris@0: CREATE UNIQUE INDEX name_id_index ON groups (name); chris@0: chris@0: CREATE TABLE articles chris@0: ( chris@0: article_id SERIAL, chris@0: message_id TEXT, chris@0: header TEXT, chris@0: body TEXT chris@0: ); chris@0: chris@0: CREATE UNIQUE INDEX article_message_index ON articles (message_id(255)); chris@0: chris@0: CREATE TABLE postings chris@0: ( chris@0: group_id INTEGER, chris@0: article_id INTEGER, chris@0: article_index INTEGER NOT NULL chris@0: ); chris@0: chris@0: CREATE UNIQUE INDEX posting_article_index ON postings (article_id); chris@0: chris@0: CREATE TABLE subscriptions chris@0: ( chris@0: group_id INTEGER chris@0: ); chris@0: chris@0: CREATE TABLE overview chris@0: ( chris@0: header TEXT chris@0: );