Split models by domain
Organize a large data model
Prisma · Const
prismaSchemaFolder enables a Prisma schema to be split across multiple .prisma files. Configure Prisma to use the directory containing those files, including schema.prisma with the generator block.
The prismaSchemaFolder preview feature lets Prisma combine a schema split across multiple .prisma files. Configure the schema location as the folder containing those files, including the schema.prisma file with the generator block, then run Prisma CLI commands against that folder.
prisma migrate dev --schema ./prismaimport { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
async function main() {
const users = await prisma.user.findMany();
console.log(users);
}
main().finally(() => prisma.$disconnect());The client is generated from the combined schema in the configured folder and can then be used normally.
Organize a large data model
Keep schema files manageable in a growing project
Make ownership clearer across teams
It enables a Prisma schema to be divided among multiple .prisma files while Prisma treats the folder as one schema. The folder must include the main schema.prisma file with the generator block.
Follow-up: How is the folder selected? Pass the directory with the CLI --schema option or configure the schema location through Prisma configuration.
Specify the directory containing all schema files, including schema.prisma, rather than a single schema file. For example, use prisma migrate dev --schema ./prisma.
Follow-up: What must remain in the configured directory? The schema.prisma file containing the generator block must be there.
The feature was introduced as a preview capability and multi-file schemas became generally available in Prisma ORM v6.7.0. Therefore, current documentation treats the capability as GA rather than requiring the preview flag.
Follow-up: What compatibility concern matters when reading older examples? Older documentation may show the preview flag, while current Prisma versions do not require it.
schema.prisma--schemaprisma.schemagenerator blockPrisma CLI