-- Deploy photos:photos to pg
-- requires: schema

BEGIN;

SET client_min_messages = 'warning';
SET search_path to photos;

CREATE TABLE photos(
  id UUID PRIMARY KEY,
  path TEXT NOT NULL,
  is_receipt BOOLEAN NOT NULL DEFAULT FALSE,
  note TEXT CHECK (note <> ''),
  taken_at TIME,
  camera_name TEXT,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
  updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

COMMIT;
