2 page text NOT NULL DEFAULT 'issue',
5 created timestamptz DEFAULT now(),
7 updated timestamptz NOT NULL DEFAULT now(),
10 id serial NOT NULL PRIMARY KEY
13 CREATE TABLE comments (
17 announced boolean NOT NULL DEFAULT TRUE,
18 created timestamptz DEFAULT now(),
20 id serial NOT NULL PRIMARY KEY
23 CREATE TABLE journal (
24 comment_id integer NOT NULL REFERENCES comments (id),
25 property text NOT NULL DEFAULT 'attr',
29 id serial NOT NULL PRIMARY KEY
32 CREATE OR REPLACE VIEW messages AS (
33 SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments