docs(pg-adapter): add unique and foreign key constraints to the PG adapter schema
☕️ Reasoning
The contraints in the PG adapter schema are non existant while they are defined in all other adapters. I added them to the schema.
🧢 Checklist
- [X] Documentation
- [X] Tests
- [X] Ready to be merged
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| auth-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 22, 2024 9:57am |
1 Skipped Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| next-auth-docs | ⬜️ Ignored (Inspect) | Visit Preview | Dec 22, 2024 9:57am |
@baptiste00001 is attempting to deploy a commit to the authjs Team on Vercel.
A member of the Team first needs to authorize it.
Ah wait, we may need to remove the unique constraint on email. Will that fail if we try to use null for multiple users email?
Ah wait, we may need to remove the unique constraint on email. Will that fail if we try to use
nullfor multiple users
It works fine with null value for multiple users email because there is no NULL NOT DISTINCT after the UNIQUE constraint.
So two null values are considered distinct.
I just tested it.
I think email should probably be unique in most cases, but feel free to remove the unique constraint if you think it fits the broader use cases.
In my use case I need to have email as unique so I added it.
I approved the test run from fork to ensure the pg schema still works. It ran into a few prettier issues. ~I know one isn't from a file in your PR, but would you mind running prettier over these here? :pray:~
~See: https://github.com/nextauthjs/next-auth/actions/runs/12443333045/job/34755721579?pr=12381~
EDIT: Neverind, fixed it here
I approved the test run from fork to ensure the pg schema still works. It ran into a few prettier issues. ~I know one isn't from a file in your PR, but would you mind running prettier over these here? 🙏~
~See: https://github.com/nextauthjs/next-auth/actions/runs/12443333045/job/34755721579?pr=12381~
EDIT: Neverind, fixed it here
Oh OK I actually fixed it as well and commited. It was a bunch of extra spaces that needed to be removed in two files. I hope you can merge the PR now. If you need anything else just ask me.