page text NOT NULL DEFAULT 'issue',
link text,
subject text,
- body text,
created timestamptz DEFAULT now(),
closed timestamptz,
updated timestamptz NOT NULL DEFAULT now(),
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
);