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 (
17 created timestamptz DEFAULT now(),
19 id serial NOT NULL PRIMARY KEY
22 CREATE TABLE journal (
23 comment_id integer NOT NULL REFERENCES comments (id),
24 property text NOT NULL DEFAULT 'attr',
28 id serial NOT NULL PRIMARY KEY
31 CREATE OR REPLACE VIEW messages AS (
32 SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments
34 SELECT concat(page,'/',id), body, created, author, NULL, id FROM issues