login/pass: error messages below page title
[minimedit.git] / widget / comments.sql
1 CREATE TABLE issues (
2         page       text        NOT NULL DEFAULT 'issue',
3         link       text,
4         subject    text,
5         created    timestamptz          DEFAULT now(),
6         closed     timestamptz,
7         updated    timestamptz NOT NULL DEFAULT now(),
8         author     text,
9         assign     text,
10         id         serial      NOT NULL PRIMARY KEY
11 );
12
13 CREATE TABLE comments (
14         page       text,
15         raw        text,
16         message    text,
17         announced  boolean     NOT NULL DEFAULT TRUE,
18         created    timestamptz DEFAULT now(),
19         author     text,
20         id         serial      NOT NULL PRIMARY KEY
21 );
22
23 CREATE TABLE journal (
24         comment_id integer     NOT NULL REFERENCES comments (id),
25         property   text        NOT NULL DEFAULT 'attr',
26         col        text        NOT NULL,
27         old_value  text,
28         value      text,
29         id         serial      NOT NULL PRIMARY KEY
30 );
31
32 CREATE OR REPLACE VIEW messages AS (
33         SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments
34 );