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

fix(profile): Make usernames case insensitive #216

Merged
merged 10 commits into from
Apr 20, 2023
Merged

Conversation

ff6347
Copy link
Collaborator

@ff6347 ff6347 commented Apr 19, 2023

This PR

  • fix(profile): Make usernames case insensitive 74034e5

This is done by using the citext extensions.
Once we have imported all the users from auth0 we will remove the
uuid trigger function and only have the DB reject duplicate names

  • fix(schema): Update call to uuid generate 6f69042

The trigger function that adds an uuid to the username if we have duplicates did throw an error when executed by adding a user with the same name as an existing one. This still will be removed when we are migrated.

  • fix(schema): Update outdated types f2c3f3e
  • chore(schema): Remove logging from delete function 28110dd
  • chore: Used extension on this project f0f3e78

Test

  • test(schema): Verify functions in schema c238268

This surfaced some errors we had in the schema. Like you can see in the fixes above

  • test(utils): Update test utils for schema tests be85f2b and e9a3c80
  • test: Boilerplate of schema tests. WIP 0c2096f

This is done by using the citext extensions.
Once we have imported all the users from auth0 we will remove the
uuid trigger function and only have the DB reject duplicate names
@vercel
Copy link

vercel bot commented Apr 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giessdenkiez-de-postgres-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 20, 2023 0:37am

The function was not able to find the uuid_generate_v4 function
These test check some beahaviour in the schema

- adding uuid to username on duplicates (needed 4 migration from auth0)
- cascading removal of users data from the database
- change of username on trees_watered on change of username in profile
@ff6347
Copy link
Collaborator Author

ff6347 commented Apr 19, 2023

@julizet @raphael-arce @dnsos Maybe you see something that I missed?

Copy link
Collaborator

@dnsos dnsos left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍 It's pretty nice that you added these tests, especially.

I don't know the codebase too well, so I don't want to explicitly approve, but at least nothing caught my eye that looks off. Great job!

supabase/tests/database/unique_names.test.sql Outdated Show resolved Hide resolved
__tests__/schema.test.ts Outdated Show resolved Hide resolved
__tests__/schema.test.ts Show resolved Hide resolved
@ff6347 ff6347 temporarily deployed to ci_test April 20, 2023 12:37 — with GitHub Actions Inactive
@ff6347 ff6347 merged commit c2c0a2c into staging Apr 20, 2023
@ff6347 ff6347 deleted the fix/unique-ci-usernames branch April 20, 2023 12:43
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