Matchu
b2a027fbbf
Oh I didn't realize the lowest version Rails had for this is 4.2. I wish running `rake db:migrate` checked this, but I'm running into it on another branch when I try to create a *new* migration which for some reason leads it to inspect the old migrations and notice the issue. Weird!
41 lines
1.3 KiB
Ruby
41 lines
1.3 KiB
Ruby
class IndexAssociations < ActiveRecord::Migration[4.2]
|
|
def self.up
|
|
add_index :closet_hangers, :item_id
|
|
add_index :closet_hangers, :list_id
|
|
add_index :closet_hangers, :user_id
|
|
|
|
add_index :closet_lists, :user_id
|
|
|
|
add_index :contributions, [:contributed_id, :contributed_type]
|
|
add_index :contributions, :user_id
|
|
|
|
add_index :item_outfit_relationships, :item_id
|
|
add_index :item_outfit_relationships, :outfit_id
|
|
|
|
add_index :outfits, :pet_state_id
|
|
add_index :outfits, :user_id
|
|
|
|
remove_index :parents_swf_assets, :name => "parent_swf_assets_parent_id"
|
|
add_index :parents_swf_assets, [:parent_id, :parent_type]
|
|
end
|
|
|
|
def self.down
|
|
remove_index :closet_hangers, :item_id
|
|
remove_index :closet_hangers, :list_id
|
|
remove_index :closet_hangers, :user_id
|
|
|
|
remove_index :closet_lists, :user_id
|
|
|
|
remove_index :contributions, [:contributed_id, :contributed_type]
|
|
remove_index :contributions, :user_id
|
|
|
|
remove_index :item_outfit_relationships, :item_id
|
|
remove_index :item_outfit_relationships, :outfit_id
|
|
|
|
remove_index :outfits, :pet_state_id
|
|
remove_index :outfits, :user_id
|
|
|
|
add_index "parents_swf_assets", :parent_id, :name => "parent_swf_assets_parent_id"
|
|
remove_index :parents_swf_assets, [:parent_id, :parent_type]
|
|
end
|
|
end
|