summaryrefslogtreecommitdiff
path: root/deploy/diaries.sql
blob: f156ff116a4ac6e35ed63036f9a61f0636f18611 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
-- 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,
  date DATE NOT NULL UNIQUE,
  title TEXT NOT NULL,
  entry TEXT NOT NULL,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

COMMIT;