Using table prefixes in drizzle multi-project schema with NextAuth.
I'm using a setup that allows for schemas of different projects in one database, the default drizzle setup with T3.
Using
See: https://orm.drizzle.team/docs/goodies#multi-project-schema
using
const pgTable = pgTableCreator((name) =>
project1_${name});
When I'm attempting to persist to a database now I receive this error:
[31m[auth][cause][0m: error: relation "account" does not exist
It seems somewhere the reference to the account table is hard-coded and doesn't read from the schema.ts - would appreciate any help with this!Drizzle ORM - Goodies
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Solution:Jump to solution
totally my bad, it's covered in https://authjs.dev/getting-started/adapters/drizzle if anyone has this issue in the future. just needed to pass the tables object with the correct assignments.
Auth.js | Drizzle
Authentication for the Web
1 Reply
Solution
totally my bad, it's covered in https://authjs.dev/getting-started/adapters/drizzle if anyone has this issue in the future. just needed to pass the tables object with the correct assignments.
Auth.js | Drizzle
Authentication for the Web