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(drizzle): update schema type & fix issue with default id #10750
Conversation
We would like to have feature parity of Auth.js when hosted either on something like Vercel or in Docker. Moving the docker config to the same example app we host on Vercel and deploying it via Docker will make this easier to verify
…0504) Update README.md fixed .cts to .cjs Co-authored-by: Nico Domino <yo@ndo.dev>
+1 on this, as I'm also not using INT or UUID for PKs in my tables and this would unblock the whole project moving forward. |
Okay nice, looks better to me. Tests all pass as well. @juliusmarminge you want to take one last look over it before I merge it? 🙏 |
@@ -100,7 +99,7 @@ import type { Adapter } from "@auth/core/adapters" | |||
* userId: text("userId") | |||
* .notNull() | |||
* .references(() => users.id, { onDelete: "cascade" }), | |||
* type: text("type").notNull(), | |||
* type: text("type").$type<AdapterAccount["type"]>().notNull(), |
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.
can use the new AdapterAccountType
introduced in #10832 to avoid circular refernce issues
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.
Rest looks good to me :)
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.
One last thing, lets also update the example(s) in the actual doc page at /docs/pages/getting-started/adapters/drizzle.mdx
.
Ideally we wouldn't have two copies of the example setup code. One in the JSDoc in the index.ts
and this docs page, but we just migrated to these new docs recently. We'll probably cleanup the schema stuff from the jsdoc shortly.
Do we still want to use |
Made tables for adapter optional cause not all of them are used for authentication strategies. Also I exlcuded
id
from data coming from Authjs increateUser
function to enable setting default id as defined in Drizzle table.☕️ Reasoning
next-auth
.🧢 Checklist