From 5039f9a506222b3f74312a4586166f5130e53817 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Mon, 11 Mar 2024 00:24:56 +0900
Subject: Add table manage diary articles.

---
 deploy/articles.sql | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 deploy/articles.sql

(limited to 'deploy/articles.sql')

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;
-- 
cgit v1.2.3

