From 47a910d64e1ed8339b9efc3bd929f55c85172cba Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Wed, 30 Aug 2023 00:49:46 +0900
Subject: Add table to manage diaries

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

(limited to 'deploy/diaries.sql')

diff --git a/deploy/diaries.sql b/deploy/diaries.sql
new file mode 100644
index 0000000..3188490
--- /dev/null
+++ b/deploy/diaries.sql
@@ -0,0 +1,18 @@
+-- Deploy photos:diaries to pg
+-- requires: schema
+-- requires: photos
+
+BEGIN;
+
+SET search_path to photos;
+
+CREATE TABLE diaries (
+  id UUID PRIMARY KEY,
+  photo_id UUID NOT NULL REFERENCES photos(id) ON DELETE RESTRICT ON UPDATE RESTRICT,
+  title TEXT NOT NULL,
+  entry TEXT NOT NULL,
+  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+
+COMMIT;
-- 
cgit v1.2.3

