Skip to content

Commit

Permalink
remove index conditionally on up method
Browse files Browse the repository at this point in the history
  • Loading branch information
rbritom committed Jul 11, 2016
1 parent 0ca1f1c commit 9cc580e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/migrate/2_add_missing_unique_indices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class AddMissingUniqueIndices < ActiveRecord::Migration
def self.up
add_index :tags, :name, unique: true

remove_index :taggings, :tag_id
remove_index :taggings, :tag_id if index_exists?(:taggings, :tag_id)
remove_index :taggings, [:taggable_id, :taggable_type, :context]
add_index :taggings,
[:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
Expand Down

0 comments on commit 9cc580e

Please sign in to comment.