demarches-normaliennes/db/migrate/20220902151143_backfill_add_avis_email_notification.rb

11 lines
425 B
Ruby
Raw Normal View History

class BackfillAddAvisEmailNotification < ActiveRecord::Migration[6.1]
def up
AssignTo.in_batches do |relation|
relation.update_all instant_expert_avis_email_notifications_enabled: false
sleep(0.01)
end
add_check_constraint :assign_tos, "instant_expert_avis_email_notifications_enabled IS NOT NULL", name: "assign_tos_instant_expert_avis_email_notifications_enabled_null", validate: false
end
end