  class AddSignupSurveySentAtToUsers < ActiveRecord::Migration
    def self.up
      execute "ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP"
      User.find_each(batch_size:100) do |user|
        User.where(id:user.id).update_all(signup_survey_sent_at: Time.now)
      end
    end
    def self.down
      execute "ALTER TABLE users DROP COLUMN signup_survey_sent_at"
    end
  end
=begin
   ALTER TABLE users ADD COLUMN signup_survey_sent_at TIMESTAMP;
CREATE INDEX index_users_on_signup_survey_sent_at ON users USING btree (signup_survey_sent_at);

      User.find_each(batch_size:100) do |user|
        User.where(id:user.id).update_all(signup_survey_sent_at: Time.now)
      end
=end