diff options
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; |