diff --git a/db/migrate/20170302112312_remove_deposit_datetime_from_dossiers.rb b/db/migrate/20170302112312_remove_deposit_datetime_from_dossiers.rb new file mode 100644 index 000000000..600beb4a3 --- /dev/null +++ b/db/migrate/20170302112312_remove_deposit_datetime_from_dossiers.rb @@ -0,0 +1,8 @@ +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 diff --git a/db/schema.rb b/db/schema.rb index c9faf462b..f64bd3888 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20170228150522) do +ActiveRecord::Schema.define(version: 20170302112312) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -126,7 +126,6 @@ ActiveRecord::Schema.define(version: 20170228150522) do t.text "json_latlngs" t.boolean "archived", default: false t.boolean "mandataire_social", default: false - t.datetime "deposit_datetime" t.datetime "initiated_at" t.datetime "received_at" t.datetime "processed_at"