subject text,
body text,
created timestamptz DEFAULT now(),
- closed timestamptz DEFAULT now(),
+ closed timestamptz,
updated timestamptz NOT NULL DEFAULT now(),
author text,
assign text,
value text,
id serial NOT NULL PRIMARY KEY
);
+
+CREATE OR REPLACE VIEW messages AS (
+ SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments
+ UNION ALL
+ SELECT concat(page,'/',id), body, created, author, NULL, id FROM issues
+);