Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add oneoff script for incrementally migrating users to multi auth #27687

Merged
merged 1 commit into from Mar 26, 2019

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Mar 25, 2019

I plan to run this against production data a slice or two at a time, to verify that users migrate as expected, before running it against all remaining unmigrated users.

def migrate_batches(limit=nil)
limit = limit.to_i if limit
unmigrated_users = User.where.not(provider: User::PROVIDER_MIGRATED)
unmigrated_users_count = 40_000_000 # estimate
Copy link
Contributor Author

Choose a reason for hiding this comment

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

estimated this via an SQL select on the reporting DB.


def migrate_batches(limit=nil)
limit = limit.to_i if limit
unmigrated_users = User.where.not(provider: User::PROVIDER_MIGRATED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to with_deleted include soft-deleted users, or are we officially leaving those behind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My plan is to leave them behind, then wait 30 days after this script finishes to begin tearing out support for nonmigrated users to ensure that they are fully gone.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

Woohoo!

@Hamms Hamms merged commit 1bb20f8 into staging Mar 26, 2019
@Hamms Hamms deleted the add-migrate-to-multi-auth-script branch March 26, 2019 18:29
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.

None yet

2 participants