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.

20150113213922_remove_users_mail.rb 347B

12345678910111213
  1. class RemoveUsersMail < ActiveRecord::Migration[4.2]
  2. def self.up
  3. remove_column :users, :mail
  4. end
  5. def self.down
  6. add_column :users, :mail, :string, :limit => 60, :default => '', :null => false
  7. EmailAddress.where(:is_default => true).each do |a|
  8. User.where(:id => a.user_id).update_all(:mail => a.address)
  9. end
  10. end
  11. end