You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(build/prisma): support custom schema directories and Prisma 6.6+ compatibility
This change makes the Prisma build extension work with any schema directory name
(e.g. "schema", "models", "db", "prisma-schemas") and ensures compatibility with Prisma 6.6+.
Configuration:
Always point the `schema` option to your main schema file, not the folder:
prismaExtension({
version: "6.18.0",
schema: "../../packages/prisma/src/models/schema.prisma", // ← Point to the file
migrate: false,
})
The main schema file can have any name (schema.prisma, main.prisma, etc.) and can live
in any directory. It does NOT have to be called "schema.prisma".
How it works:
- Auto-detects a "schema folder" by checking the parent directory of the schema file
for multiple .prisma files. If 2+ .prisma files exist in that directory, we treat
it as a folder-based schema setup.
- For folder-based schemas (multiple files), all .prisma files in that directory are
copied to ./prisma/schema/ in the build output. For Prisma >= 6.6, we run:
prisma generate --schema=./prisma/schema
For older Prisma versions, we omit the --schema flag for backwards compatibility.
- For single-file schemas (only one .prisma file in the directory), the file is copied
to ./prisma/schema.prisma and we run:
prisma generate --schema=./prisma/schema.prisma
Examples:
# Folder-based (multiple .prisma files):
packages/prisma/src/models/
├── schema.prisma ← Point to this in config
├── user.prisma
└── post.prisma
# Single file:
packages/prisma/
└── schema.prisma ← Point to this in config
Backwards compatibility:
- Older Prisma versions (< 6.6) continue to work without the --schema flag for folder setups
- Single-file setups are unaffected
- No breaking changes
Closes#1926
0 commit comments