diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 00:24:56 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 00:24:56 +0900 |
commit | 5039f9a506222b3f74312a4586166f5130e53817 (patch) | |
tree | 1746dbb0dfe6def169ad2b0504eba3da47d572d4 /deploy | |
parent | 516117207bbb3cca9723651b73941a2d1a5dca53 (diff) |
Add table manage diary articles.
Diffstat (limited to 'deploy')
-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; |