up: uses index in the same order as rails query
parent
c7ce1d256a
commit
c306e39513
|
@ -12,7 +12,7 @@ class CreateRateTable < ActiveRecord::Migration[5.0]
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
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,
|
name: :index_rating_rates_on_author_and_resource_and_scopeable,
|
||||||
unique: true
|
unique: true
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ class CreateRatingTable < ActiveRecord::Migration[5.0]
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
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,
|
name: :index_rating_rating_on_resource_and_scopeable,
|
||||||
unique: true
|
unique: true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue