Skip to content

Add public_user_uuid field to User model#2385

Merged
tompollard merged 3 commits intodevfrom
tp/public_user_uuid
Apr 15, 2025
Merged

Add public_user_uuid field to User model#2385
tompollard merged 3 commits intodevfrom
tp/public_user_uuid

Conversation

@tompollard
Copy link
Member

@tompollard tompollard commented Apr 11, 2025

It would be helpful to have a unique field to identify user accounts. One use case for this ID is for our project to allow PhysioNet users to login to the NSTRI platform (see: #2383).

The unique ID would allow the NSTRI platform to maintain a persistent link between logins and PhysioNet users (see: #2383).

PhysioNet users can update their email, username, etc, so these fields do not meet this need. It seems weird to be sharing the primary key in our database, so instead we are creating a new public_user_uuid field.

This pull request:

  • Adds a public_user_uuid to the User model
  • Adds a 3-step migration:
    1. create the field, first nullable;
    2. backfill existing user data
    3. add the non-null constraint.

@tompollard tompollard force-pushed the tp/public_user_uuid branch from 9ae996a to 6a3b692 Compare April 11, 2025 16:42
@tompollard tompollard force-pushed the tp/public_user_uuid branch from 6a3b692 to 2a7f049 Compare April 11, 2025 16:47
@tompollard tompollard assigned bemoody and unassigned bemoody Apr 11, 2025
Copy link
Collaborator

@Chrystinne Chrystinne left a comment

Choose a reason for hiding this comment

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

@tompollard The code looks good to me!

@tompollard tompollard added this pull request to the merge queue Apr 15, 2025
Merged via the queue into dev with commit 5290848 Apr 15, 2025
8 checks passed
@tompollard tompollard deleted the tp/public_user_uuid branch April 15, 2025 20:32
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.

3 participants