db/migrate/20190304014940_add_confirmable_to_devise.rb
# Note: You can't use change, as User.update_all will fail in the down migration
You can't use change, as User.update_all will fail in the down migration
You can ' t use change as User . update_all will fail in the down migration
def up
    add_column :users, :confirmation_token, :string
    add_column :users, :confirmed_at, :datetime
    add_column :users, :confirmation_sent_at, :datetime
    add_column :users, :unconfirmed_email, :string
    add_index :users, :confirmation_token, unique: true
    User.update_all confirmed_at: DateTime.now
  end
def up add_column :users , :confirmation_token , :string add_column :users , :confirmed_at , :datetime add_column :users , :confirmation_sent_at , :datetime add_column :users , :unconfirmed_email , :string add_index :users , :confirmation_token , unique : true User . update_all confirmed_at : DateTime . now end
Note: You can't use change, as User.update_all will fail in the down migration
Note : You can ' t use change as User . update_all will fail in the down migration
# User.reset_column_information # Need for some types of updates, but not for update_all. # To avoid a short time window between running the migration and updating all existing # users as confirmed, do the following # All existing user accounts should be able to log in after this.