Deposit datetime is renamed to initiated_at

This commit is contained in:
Mathieu Magnin 2017-03-02 12:41:40 +01:00
parent 6fcd35fd4c
commit 292ab74c45
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -126,7 +126,6 @@ ActiveRecord::Schema.define(version: 20170228150522) do
t.text "json_latlngs" t.text "json_latlngs"
t.boolean "archived", default: false t.boolean "archived", default: false
t.boolean "mandataire_social", default: false t.boolean "mandataire_social", default: false
t.datetime "deposit_datetime"
t.datetime "initiated_at" t.datetime "initiated_at"
t.datetime "received_at" t.datetime "received_at"
t.datetime "processed_at" t.datetime "processed_at"