+
+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
+);