diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2023-08-30 00:49:46 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2023-10-13 02:13:08 +0900 |
commit | 47a910d64e1ed8339b9efc3bd929f55c85172cba (patch) | |
tree | 4554168b226e0a843a5c5494c5ea1e51fe97113d /deploy | |
parent | 36fe291d3732003d0392d796f6dbdd027d11e367 (diff) |
Add table to manage diaries
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/diaries.sql | 18 |
1 files changed, 18 insertions, 0 deletions
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; |