File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
10
10
11
11
For a steady stream of TILs, [ sign up for my newsletter] ( https://crafty-builder-6996.ck.page/e169c61186 ) .
12
12
13
- _ 1252 TILs and counting..._
13
+ _ 1253 TILs and counting..._
14
14
15
15
---
16
16
@@ -711,6 +711,7 @@ _1252 TILs and counting..._
711
711
712
712
- [ Execute A Raw SQL Query] ( prisma/execute-a-raw-sql-query.md )
713
713
- [ Grab A Limited Set Of Records] ( prisma/grab-a-limited-set-of-records.md )
714
+ - [ Specify Alternate Location For Prisma Schema] ( prisma/specify-alternate-location-for-prisma-schema.md )
714
715
715
716
### Python
716
717
Original file line number Diff line number Diff line change
1
+ # Specify Alternate Location For Prisma Schema
2
+
3
+ By default, Prisma looks for a schema in one of two locations:
4
+
5
+ - ` ./prisma/schema.prisma `
6
+ - ` ./schema.prisma `
7
+
8
+ If it isn't in one of those two spots, then you'll get an error.
9
+
10
+ You can manually specify an alternate location. One way is to use the
11
+ ` --schema ` flag with all ` prisma ` commands. A less tedious approach
12
+ ([ introduced in this PR] ( https://github.com/prisma/prisma/pull/3566 ) ) is to
13
+ specify the location in your ` package.json ` .
14
+
15
+ ``` json
16
+ {
17
+ "prisma" : {
18
+ "schema" : " ../../packages/database/prisma/schema.prisma"
19
+ }
20
+ }
21
+ ```
22
+
23
+ This is handy in situations where your database schema and utils are packaged
24
+ up separately, like in a monorepo. Here is an example of [ a monorepo
25
+ referencing a prisma schema in a separate
26
+ package] ( https://github.com/skillrecordings/products/blob/b10dece7170abcb9076221c0863549e2291541ae/apps/testingaccessibility/package.json#L201-L203 ) .
27
+
28
+ [ source] ( https://www.prisma.io/docs/concepts/components/prisma-schema#prisma-schema-file-location )
You can’t perform that action at this time.
0 commit comments