Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Prisma · Const

prismaSchemaFolder

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.

Since
5.15.0

How it works

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.

Syntax

prisma migrate dev --schema ./prisma

Key points

  • Use separate .prisma files when a single schema becomes difficult to organize or maintain.
  • A typical layout places schema.prisma alongside model files in a Prisma directory.
  • The CLI can receive the schema folder directly with the --schema option.
  • The schema folder can also be configured through the prisma.schema package.json field.
  • A conventional single schema.prisma file in the prisma folder is automatically detected.

Common mistakes

  • A multi-file schema is not discovered through the usual single-file configuration; provide the folder explicitly with the CLI --schema option or package configuration.
  • This identifier is no longer needed in current Prisma versions because multi-file schemas became generally available in v6.7.0.

Example: Use a client generated from a multi-file schema

import { 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.

When to use it

Split models by domain

Organize a large data model

Reduce single-file complexity

Keep schema files manageable in a growing project

Separate model areas

Make ownership clearer across teams

Interview questions

QWhat problem does prismaSchemaFolder solve?

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.

QHow do you configure a multi-file schema?

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.

QWhat is the current status of prismaSchemaFolder?

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
  • --schema
  • prisma.schema
  • generator block
  • Prisma CLI

Source: Prisma Schema Location and Configuration (Prisma ORM v6). Checked 2026-10-16.