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