login/pass: error messages below page title
[minimedit.git] / widget / comments.sql
index 54088778108f5bbe4053b61b977bb838137e1e78..fc261f82ae0c41f7ffd0416610876e5dfdd40cc0 100644 (file)
@@ -1,17 +1,34 @@
 CREATE TABLE issues (
        page       text        NOT NULL DEFAULT 'issue',
+       link       text,
        subject    text,
-       body       text,
        created    timestamptz          DEFAULT now(),
-       closed     timestamptz          DEFAULT now(),
+       closed     timestamptz,
+       updated    timestamptz NOT NULL DEFAULT now(),
        author     text,
+       assign     text,
        id         serial      NOT NULL PRIMARY KEY
 );
 
 CREATE TABLE comments (
        page       text,
+       raw        text,
        message    text,
+       announced  boolean     NOT NULL DEFAULT TRUE,
        created    timestamptz DEFAULT now(),
        author     text,
        id         serial      NOT NULL PRIMARY KEY
 );
+
+CREATE TABLE journal (
+       comment_id integer     NOT NULL REFERENCES comments (id),
+       property   text        NOT NULL DEFAULT 'attr',
+       col        text        NOT NULL,
+       old_value  text,
+       value      text,
+       id         serial      NOT NULL PRIMARY KEY
+);
+
+CREATE OR REPLACE VIEW messages AS (
+       SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments
+);