-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: deprecate UUID users #86
Conversation
Pull Request Test Coverage Report for Build 11908532132Details
💛 - Coveralls |
internal/store/postgres/migrations/000020_add_constraint_email_unique.up.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what should we do with existing data that has unit id, but doesn't have email?
what you mean is uuid, right? as our ADR discussion before, we'll migrate it first to email as 3rd step https://docs.google.com/document/d/1FZYnbD51m4ZpAoS-ZxQslAgiPaoMOdlbFu4ontx_Jck/edit?tab=t.0 |
have we checked how our clients interact with compass? what happens if they did not send the email key in the header? |
I already checked the clients that use UUID only in headers, and for ODS, it found only 2 users, that are journey team and dex, so will inform them to use email headers instead. |
Currently we have 3 identifiers for compass users, that are: UUID, ID (with UUID type too), and email. The UUID identifier has been used for only validating users for every access Compass API, while the relationship between tables is using ID, even for updated_by column. For validating users flow, it will try to get a user by UUID first. If it is not found, then it will using UpsertByEmail func that run query:
As we can see, the “actual” identifier is an email with ON CONFLICT query but WHERE condition using UUID instead.
Therefore, to avoid unnecessary maintaining more column, we can focus validating on email and relationship key on ID, so only keep these two identifier. We don't need UUID column anymore.
Reference why it has UUID before: raystack#90