Jerance
Jerance
PPrisma
Created by Jerance on 3/19/2025 in #help-and-questions
implement a multi-schema database architecture with Prisma for a B2B SaaS with multiple organization
I'm trying to implement a database architecture with separate schemas for a B2B SaaS application supporting multiple organizations. My desired setup is: - A public schema for user authentication (tokens, sessions) with next-auth and a global organizations table - An organization_template schema with pre-populated tables (roles, permissions, organization_details) - Dynamic creation of new schemas (organization1, organization2, etc.) by cloning the template when a new organization is created The main issue is that Prisma doesn't natively support multi-schema architecture. The Prisma instance only works with the public schema and doesn't recognize or interact with the dynamically created organization schemas.
10 replies