diff options
Diffstat (limited to 'deploy/articles.sql')
-rw-r--r-- | deploy/articles.sql | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deploy/articles.sql b/deploy/articles.sql new file mode 100644 index 0000000..8c259d1 --- /dev/null +++ b/deploy/articles.sql @@ -0,0 +1,21 @@ +-- Deploy diary:articles to pg +-- requires: schema + +BEGIN; + +SET search_path to diary; + +CREATE TABLE articles( + id UUID PRIMARY KEY, + timestamp TIMESTAMPTZ NOT NULL, + hash VARCHAR(64) NOT NULL, + title TEXT NOT NULL, + body TEXT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +COMMENT ON COLUMN articles.hash is 'SHA256 of org subtrees'; +COMMENT ON COLUMN articles.body is 'HTML of org entries'; + +COMMIT; |