summaryrefslogtreecommitdiff
path: root/deploy/diaries.sql
blob: 31884900d294e33bcbeb1a4b924650d5235f180f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;