Finding Drizzle schemas for the better-auth "admin" plugin
I'm working with a Turborepo setup using Bun.js and I've placed my better-auth setup in a @repo/auth package.
I'm running into an issue where I can't get the @better-auth/cli migrate command to run, so I'm trying to figure out how to set up my schemas manually to use the "admin" plugin.
I checked the better-auth repo and found the base schemas here:
better-auth/better-auth/packages/better-auth/src/adapters/drizzle-adapter/test/schema.ts
Use code with caution.
However, I'm pretty sure these aren't enough for the "admin" plugin to work correctly.
Does anyone know where I can find the full schemas that include the admin functionality?
Any help would be greatly appreciated!
Solution:Jump to solution
I think that all you need is to follow the core schema here:
https://better-auth.vercel.app/docs/concepts/database#core-schema
And then add the schema here:
https://better-auth.vercel.app/docs/plugins/admin#schema...
3 Replies
Solution
I think that all you need is to follow the core schema here:
https://better-auth.vercel.app/docs/concepts/database#core-schema
And then add the schema here:
https://better-auth.vercel.app/docs/plugins/admin#schema
If that doesn't work out for you I recommend making a test project just to setup a single auth.ts file with the admin plugin within and then run the CLI to copy over the generated schemas
Thank you so much!