class AddIsShixunMarkerForUsers < ActiveRecord::Migration[5.2]
  def change
    add_column :users, :is_shixun_marker, :boolean, :default => false

    User.joins(:user_extension)
        .where(users: {professional_certification: 1}, user_extensions: {identity: 0})
        .update_all(is_shixun_marker: 1)
  end
end
