class ConvertFileInfosToBePolymorphic < ActiveRecord::Migration[5.2]
  def change
    remove_foreign_key :file_infos, :acquired_media_releases
    rename_column :file_infos, :acquired_media_release_id, :releasable_id
    add_column :file_infos, :releasable_type, :string, after: :releasable_id
    add_index :file_infos, [:releasable_id, :releasable_type], name: "index_file_infos_on_releasable_id_and_type"
  end
end
