-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
docs(pg-adapter): add unique and foreign key constraints to the PG adapter schema #12381
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@baptiste00001 is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Nice, thanks!
Ah wait, we may need to remove the unique constraint on email. Will that fail if we try to use |
It works fine with 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. |
I approved the test run from fork to ensure the pg schema still works. It ran into a few prettier issues.
EDIT: Neverind, fixed it here |
Add unique and foreign key constraints to the schema
Add unique and foreign key contraints to the schema
user's email may be NULL
user's email may be NULL
Bug fix
Bug fix
For some reason cascade delete does not work without explicitly writing the primary key (id) in the foreign key definition.
For some reason cascade delete does not work without explicitly writing the primary key (id) in the foreign key definition.
Oh OK |
☕️ 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