Skip to content

Add temporary Rake task to backfill Profile idv_level#9723

Merged
matthinz merged 2 commits intomainfrom
matthinz/11693-backfill-idv-level
Dec 8, 2023
Merged

Add temporary Rake task to backfill Profile idv_level#9723
matthinz merged 2 commits intomainfrom
matthinz/11693-backfill-idv-level

Conversation

@matthinz
Copy link
Contributor

@matthinz matthinz commented Dec 7, 2023

🎫 Ticket

LG-11693

🛠 Summary of changes

Adds a temporary Rake task, profiles:backfill_idv_level, to support an upcoming roll plan. Will be removed when roll plan is complete.

📜 Testing Plan

Provide a checklist of steps to confirm the changes.

  • bundle exec rake profiles:backfill_idv_level
  • Open a rails console and verify all records in your profiles table have idv_level set:
Profile.where(idv_level: nil).count # should be 0

Temporary task to be used in a roll plan.

[skip changelog]
@matthinz matthinz requested a review from a team December 7, 2023 00:06
Minimize the size of individual updates
(also add some reporting along the way)
update_all(idv_level: :legacy_unsupervised)
count = 0
not_in_person_and_needs_idv_level.
in_batches(of: batch_size) do |batch|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooo TIL AR relations have in_batches, I only knew about find_in_batches before

@matthinz matthinz merged commit b5446aa into main Dec 8, 2023
@matthinz matthinz deleted the matthinz/11693-backfill-idv-level branch December 8, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants