X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/7718ed271465c8cd292f3b1d916e743db26d4ccd..f73f2c6c223577ad3cc6e14c0e6ff1567c910eae:/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
+);
