2 page text NOT NULL DEFAULT 'issue',
6 created timestamptz DEFAULT now(),
8 updated timestamptz NOT NULL DEFAULT now(),
11 id serial NOT NULL PRIMARY KEY
14 CREATE TABLE comments (
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
35 SELECT concat(page,'/',id), body, created, author, NULL, id FROM issues