From c9d52a5091b7313315506d5b647c6f5c6a5113f7 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Wed, 30 Aug 2023 00:33:59 +0900
Subject: Add unique constraint to path column of photos table

---
 deploy/photos.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'deploy/photos.sql')

diff --git a/deploy/photos.sql b/deploy/photos.sql
index c451146..6c796ff 100644
--- a/deploy/photos.sql
+++ b/deploy/photos.sql
@@ -8,7 +8,7 @@ SET search_path to photos;
 
 CREATE TABLE photos(
   id UUID PRIMARY KEY,
-  path TEXT NOT NULL,
+  path TEXT NOT NULL UNIQUE,
   date DATE NOT NULL,
   is_receipt BOOLEAN NOT NULL DEFAULT FALSE,
   note TEXT CHECK (note <> ''),
-- 
cgit v1.2.3

