From 7c3412dcc34409a9dec830cd0570c4f1a7145107 Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Mon, 3 Dec 2018 14:37:39 -0600 Subject: [PATCH] Add return for reversable migration --- db/migrate/4_add_unique_index_to_friendships.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/migrate/4_add_unique_index_to_friendships.rb b/db/migrate/4_add_unique_index_to_friendships.rb index a04279d..db36ff4 100644 --- a/db/migrate/4_add_unique_index_to_friendships.rb +++ b/db/migrate/4_add_unique_index_to_friendships.rb @@ -14,6 +14,8 @@ def self.up end def self.down + return unless index_exists?(:friendships, [:friendable_id, :friend_id]) + remove_index :friendships, [:friendable_id, :friend_id] end end