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 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