X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/fac6ba761f971deb77a5686ead99ec6534f931d2..05c560470887c86a30c82360d7be5caf0de1baa4:/widget/comments.sql

diff --git a/widget/comments.sql b/widget/comments.sql
index 2a4993b..b805a2a 100644
--- a/widget/comments.sql
+++ b/widget/comments.sql
@@ -2,9 +2,8 @@ CREATE TABLE issues (
 	page       text        NOT NULL DEFAULT 'issue',
 	link       text,
 	subject    text,
-	body       text,
 	created    timestamptz          DEFAULT now(),
-	closed     timestamptz          DEFAULT now(),
+	closed     timestamptz,
 	updated    timestamptz NOT NULL DEFAULT now(),
 	author     text,
 	assign     text,
@@ -13,6 +12,7 @@ CREATE TABLE issues (
 
 CREATE TABLE comments (
 	page       text,
+	raw        text,
 	message    text,
 	created    timestamptz DEFAULT now(),
 	author     text,
@@ -27,3 +27,7 @@ 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
+);
