up: uses index in the same order as rails query
This commit is contained in:
parent
c7ce1d256a
commit
c306e39513
@ -12,7 +12,7 @@ class CreateRateTable < ActiveRecord::Migration[5.0]
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :rating_rates, %i[author_id author_type resource_id resource_type scopeable_id scopeable_type],
|
||||
add_index :rating_rates, %i[author_type author_id resource_type resource_id scopeable_type scopeable_id],
|
||||
name: :index_rating_rates_on_author_and_resource_and_scopeable,
|
||||
unique: true
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ class CreateRatingTable < ActiveRecord::Migration[5.0]
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :rating_ratings, %i[resource_id resource_type scopeable_id scopeable_type],
|
||||
add_index :rating_ratings, %i[resource_type resource_id scopeable_type scopeable_id],
|
||||
name: :index_rating_rating_on_resource_and_scopeable,
|
||||
unique: true
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user