X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/c824b14c0f6fb372ca4e72fe244b3aade6c29541..4acdd7f1c3b2b78933d7953e8777df73af3189aa:/widget/comments.sql

diff --git a/widget/comments.sql b/widget/comments.sql
index 924c136..fc261f8 100644
--- a/widget/comments.sql
+++ b/widget/comments.sql
@@ -2,18 +2,33 @@ 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,
 	id         serial      NOT NULL PRIMARY KEY
 );
 
 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
 );
+
+CREATE TABLE journal (
+	comment_id integer     NOT NULL REFERENCES comments (id),
+	property   text        NOT NULL DEFAULT 'attr',
+	col        text        NOT NULL,
+	old_value  text,
+	value      text,
+	id         serial      NOT NULL PRIMARY KEY
+);
+
+CREATE OR REPLACE VIEW messages AS (
+	SELECT *, regexp_replace(page, '.*/', '')::int issue FROM comments
+);
