class AddDateToPlutusEntries < ActiveRecord::Migration[4.2] def change add_column :plutus_entries, :date, :date add_index :plutus_entries, :date execute <<-SQL UPDATE plutus_entries SET date = created_at WHERE date is null SQL end end