~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to twisted/forum/schema.sql

  • Committer: Bazaar Package Importer
  • Author(s): Moshe Zadka
  • Date: 2002-03-08 07:14:16 UTC
  • Revision ID: james.westby@ubuntu.com-20020308071416-oxvuw76tpcpi5v1q
Tags: upstream-0.15.5
ImportĀ upstreamĀ versionĀ 0.15.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE forum_permissions;
 
2
DROP TABLE posts;
 
3
DROP TABLE forums;
 
4
DROP TABLE forum_perspectives;
 
5
DROP SEQUENCE forums_forum_id_seq;
 
6
DROP SEQUENCE posts_post_id_seq;
 
7
 
 
8
CREATE TABLE forum_perspectives
 
9
(
 
10
    identity_name     varchar(64)  PRIMARY KEY,
 
11
    user_name         varchar(64)  UNIQUE,
 
12
    signature         varchar(64)  NOT NULL
 
13
);
 
14
 
 
15
CREATE TABLE forums
 
16
(
 
17
    forum_id       serial        PRIMARY KEY,
 
18
    name           varchar(64)   NOT NULL,
 
19
    description    text          NOT NULL,
 
20
    default_access integer       NOT NULL
 
21
);
 
22
 
 
23
CREATE TABLE posts
 
24
(
 
25
    post_id        serial        PRIMARY KEY,
 
26
    forum_id       int           CONSTRAINT forum_id_posts
 
27
                                 REFERENCES forums (forum_id),
 
28
    parent_id      int           NOT NULL,
 
29
    thread_id      int           NOT NULL,
 
30
    previous_id    int           NOT NULL,
 
31
    subject        varchar(64)   NOT NULL,
 
32
    user_name      varchar(64)   CONSTRAINT user_name_posts
 
33
                                 REFERENCES forum_perspectives (user_name),
 
34
    posted         timestamp     NOT NULL,
 
35
    body           text          NOT NULL
 
36
);
 
37
 
 
38
CREATE TABLE forum_permissions
 
39
(
 
40
    user_name         varchar(64) NOT NULL,
 
41
    forum_id          integer,
 
42
    read_access       integer,
 
43
    post_access       integer,
 
44
    CONSTRAINT perm_key PRIMARY KEY (user_name, forum_id)
 
45
);