You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/db/migrate/20190514023907_add_column_t...

11 lines
356 B

class AddColumnToZipPacks < ActiveRecord::Migration[5.2]
def change
add_column :zip_packs, :container_id, :integer, default: 0
add_column :zip_packs, :container_type, :string
add_index :zip_packs, [:container_id, :container_type]
ZipPack.all.update_all("container_type='HomeworkCommon', container_id = homework_id")
end
end