Updating better-auth schema after re-defining Prisma Schema
Hi Guys.
I have a NextJs15 application that uses Prisma as an ORM and used the " bunx @better-auth/cli generate" to generate my Prisma schema and all worked perfectly. I them proceded by creating all my necesarry methods for login on the server side and all this worked flawlessly as well.
The problem I have is now that I updated my Prisma Schema and ran the "bunx prisma migrate dev --name add_user_role_fields " migration it seems that even if I then try and update the Better-Auth Schema it does not want to work. I run this for the update: "bunx @better-auth/cli@latest generate --output lib/generated/prisma/schema.prisma"
No when I try and access my new attribute in the User table (role) through a session.user it is not available?
How do I update my Better-Auth Schema to access the new tables and table attricutes?
I have a NextJs15 application that uses Prisma as an ORM and used the " bunx @better-auth/cli generate" to generate my Prisma schema and all worked perfectly. I them proceded by creating all my necesarry methods for login on the server side and all this worked flawlessly as well.
The problem I have is now that I updated my Prisma Schema and ran the "bunx prisma migrate dev --name add_user_role_fields " migration it seems that even if I then try and update the Better-Auth Schema it does not want to work. I run this for the update: "bunx @better-auth/cli@latest generate --output lib/generated/prisma/schema.prisma"
No when I try and access my new attribute in the User table (role) through a session.user it is not available?
How do I update my Better-Auth Schema to access the new tables and table attricutes?

schema.prisma2.95KB