demarches-normaliennes/db/migrate/20170302112312_remove_deposit_datetime_from_dossiers.rb

9 lines
284 B
Ruby
Raw Normal View History

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