Skip to content

Refactoring to disentangle account creation from only one identity provider #10611

Open
@carols10cents

Description

@carols10cents
  • Start writing gh_id, gh_access_token, gh_login, gh_avatar to both the users table and a new table with more generic names that also has a column indicating the OAuth provider that is the source of the values (which will always be set to GitHub for now. Deploy and manually verify values are written/updated as expected, but otherwise don't use the values in the new table.
  • Write a script to backfill the new table with data from all existing records as appropriate. Do an offline test with a production database dump to know how long it will take the script to run and what the load on the database will be like. If necessary, batch updates done by the script to minimize production app impacts.
  • Change all code that uses the users table's gh_id, gh_access_token, gh_login, gh_avatar fields to instead use the new table.
  • In a migration, rename the users table's gh_id, gh_access_token, gh_login, gh_avatar columns to start with deprecated_ to allow for easy rollback; deploy and monitor.
  • When satisfied that nothing is using the deprecated fields, write another migration removing the fields entirely.

Metadata

Metadata

Assignees

Labels

A-backend ⚙️C-internal 🔧Category: Nonessential work that would make the codebase more consistent or clear

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions