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