X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/7718ed271465c8cd292f3b1d916e743db26d4ccd..04a1a7a24edbf8423a48f51609d545a5a7a3eb42:/widget/comments.sql diff --git a/widget/comments.sql b/widget/comments.sql index 3dc9f07..a152079 100644 --- a/widget/comments.sql +++ b/widget/comments.sql @@ -13,6 +13,7 @@ CREATE TABLE issues ( CREATE TABLE comments ( page text, + raw text, message text, created timestamptz DEFAULT now(), author text, @@ -27,3 +28,9 @@ CREATE TABLE journal ( 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 +);