X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/d877282196bdf97f4edc63fd63b4f1a1445bc678..aee71926fef0a65076c0c40b4c3280506dec5aba:/widget/comments.sql?ds=sidebyside

diff --git a/widget/comments.sql b/widget/comments.sql
index 3dc9f07..3a5fcfc 100644
--- a/widget/comments.sql
+++ b/widget/comments.sql
@@ -27,3 +27,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
+);
