X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/fac6ba761f971deb77a5686ead99ec6534f931d2..d96a8550867531e92b109a0a675cd12ce1ff7843:/widget/comments.sql?ds=inline

diff --git a/widget/comments.sql b/widget/comments.sql
index 2a4993b..fc261f8 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,7 +12,9 @@ CREATE TABLE issues (
 
 CREATE TABLE comments (
 	page       text,
+	raw        text,
 	message    text,
+	announced  boolean     NOT NULL DEFAULT TRUE,
 	created    timestamptz DEFAULT now(),
 	author     text,
 	id         serial      NOT NULL PRIMARY KEY
@@ -27,3 +28,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
+);
