up: makes polymorphic column type smaller
parent
99c1a1fff6
commit
f2f31a5f49
|
@ -12,6 +12,10 @@ class CreateRateTable < ActiveRecord::Migration[5.0]
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
change_column :rating_rates, :author_type, :string, limit: 10
|
||||||
|
change_column :rating_rates, :resource_type, :string, limit: 10
|
||||||
|
change_column :rating_rates, :scopeable_type, :string, limit: 10
|
||||||
|
|
||||||
add_index :rating_rates, %i[author_type author_id resource_type resource_id scopeable_type scopeable_id],
|
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
|
||||||
|
|
|
@ -14,6 +14,9 @@ class CreateRatingTable < ActiveRecord::Migration[5.0]
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
change_column :rating_ratings, :resource_type, :string, limit: 10
|
||||||
|
change_column :rating_ratings, :scopeable_type, :string, limit: 10
|
||||||
|
|
||||||
add_index :rating_ratings, %i[resource_type resource_id scopeable_type scopeable_id],
|
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
|
||||||
|
|
Loading…
Reference in New Issue