You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
580 B
17 lines
580 B
class ChangeClientApplicationDateToString < ActiveRecord::Migration
|
|
def up
|
|
add_column :clients, :application_datetime, :datetime
|
|
Client.all.to_a.each{ |client|
|
|
if client.application_date
|
|
client.update_attribute(:application_datetime, client.application_date)
|
|
end
|
|
}
|
|
rename_column :clients, :application_date, :application_date_bkp
|
|
rename_column :clients, :application_datetime, :application_date
|
|
end
|
|
|
|
def down
|
|
remove_column :clients, :application_date
|
|
rename_column :clients, :application_date_bkp, :application_date
|
|
end
|
|
end
|
|
|