From 5b025763c42f9ab43d0cd67c52298b7d6f43e036 Mon Sep 17 00:00:00 2001
From: Nathan Perry <avaglir@gmail.com>
Date: Thu, 5 Apr 2018 15:25:44 -0400
Subject: add image/audio unique indexes

---
 migrations/2018-04-05-190159_add_data_indexes/up.sql | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 migrations/2018-04-05-190159_add_data_indexes/up.sql

(limited to 'migrations/2018-04-05-190159_add_data_indexes/up.sql')

diff --git a/migrations/2018-04-05-190159_add_data_indexes/up.sql b/migrations/2018-04-05-190159_add_data_indexes/up.sql
new file mode 100644
index 0000000..c3bff74
--- /dev/null
+++ b/migrations/2018-04-05-190159_add_data_indexes/up.sql
@@ -0,0 +1,4 @@
+-- note: pgcrypto extension must exist for this database
+
+CREATE UNIQUE INDEX audio_data ON audio     (digest(data, 'sha1'));
+CREATE UNIQUE INDEX image_data ON images    (digest(data, 'sha1'));
-- 
cgit v1.3.1

