Skip to content

Commit

Permalink
Add return for reversable migration
Browse files Browse the repository at this point in the history
  • Loading branch information
chevinbrown committed Dec 3, 2018
1 parent e89bd72 commit 7c3412d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/migrate/4_add_unique_index_to_friendships.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7c3412d

Please sign in to comment.