demarches-normaliennes/db/migrate/20170302112312_remove_deposit_datetime_from_dossiers.rb
2017-03-02 12:41:40 +01:00

8 lines
284 B
Ruby

class RemoveDepositDatetimeFromDossiers < ActiveRecord::Migration[5.0]
def change
Dossier.where.not(deposit_datetime: nil).each do |dossier|
dossier.update(initiated_at: dossier.deposit_datetime)
end
remove_column :dossiers, :deposit_datetime, :datetime
end
end