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