From ef056edf92b678265a4666e1f9405e3b0ce66a42 Mon Sep 17 00:00:00 2001
From: Nathan Perry <np@nathanperry.dev>
Date: Fri, 16 Aug 2024 21:14:30 -0400
Subject: repo: overhaul for multitenancy

---
 migrations/2024-08-16-111659_multitenant/down.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 migrations/2024-08-16-111659_multitenant/down.sql

(limited to 'migrations/2024-08-16-111659_multitenant/down.sql')

diff --git a/migrations/2024-08-16-111659_multitenant/down.sql b/migrations/2024-08-16-111659_multitenant/down.sql
new file mode 100644
index 0000000..f0cac09
--- /dev/null
+++ b/migrations/2024-08-16-111659_multitenant/down.sql
@@ -0,0 +1,12 @@
+ALTER TABLE memes
+    DROP CONSTRAINT IF EXISTS memes_guild_title_key,
+    DROP CONSTRAINT IF EXISTS memes_guild_content_image_id_audio_id_key,
+    DROP CONSTRAINT IF EXISTS memes_guild_metadata_id_key;
+
+DROP INDEX IF EXISTS memes_guild_title_key,
+    memes_guild_content_image_id_audio_id_key,
+    memes_guild_metadata_id_key;
+
+CREATE UNIQUE INDEX IF NOT EXISTS text_memes_title_key ON memes (title);
+CREATE UNIQUE INDEX IF NOT EXISTS text_memes_content_image_id_audio_id_key ON memes (content, image_id, audio_id);
+CREATE UNIQUE INDEX IF NOT EXISTS text_memes_metadata_id_key ON memes (metadata_id);
-- 
cgit v1.3.1

