From d6bea61fa917d257219a43386c88a4f04cf82408 Mon Sep 17 00:00:00 2001
From: Nathan Perry <avaglir@gmail.com>
Date: Fri, 6 Apr 2018 19:22:55 -0400
Subject: database alteration in-flight

---
 migrations/2018-04-06-223934_add_hash_to_data/down.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 migrations/2018-04-06-223934_add_hash_to_data/down.sql

(limited to 'migrations/2018-04-06-223934_add_hash_to_data/down.sql')

diff --git a/migrations/2018-04-06-223934_add_hash_to_data/down.sql b/migrations/2018-04-06-223934_add_hash_to_data/down.sql
new file mode 100644
index 0000000..faf2150
--- /dev/null
+++ b/migrations/2018-04-06-223934_add_hash_to_data/down.sql
@@ -0,0 +1,11 @@
+CREATE UNIQUE INDEX audio_data on audio     (digest(data, 'sha1'));
+CREATE UNIQUE INDEX image_data on images    (digest(data, 'sha1'));
+
+DROP INDEX audio_hash;
+DROP INDEX image_hash;
+
+ALTER TABLE audio   DROP CONSTRAINT audio_hash_valid;
+ALTER TABLE images  DROP CONSTRAINT image_hash_valid;
+
+ALTER TABLE audio DROP COLUMN data_hash;
+ALTER TABLE images DROP COLUMN data_hash;
-- 
cgit v1.3.1

