mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
1021 B
1021 B
Specify Alternate Location For Prisma Schema
By default, Prisma looks for a schema in one of two locations:
./prisma/schema.prisma./schema.prisma
If it isn't in one of those two spots, then you'll get an error.
You can manually specify an alternate location. One way is to use the
--schema flag with all prisma commands. A less tedious approach
(introduced in this PR) is to
specify the location in your package.json.
{
"prisma": {
"schema": "../../packages/database/prisma/schema.prisma"
}
}
This is handy in situations where your database schema and utils are packaged up separately, like in a monorepo. Here is an example of a monorepo referencing a prisma schema in a separate package.