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
Copy file name to clipboardExpand all lines: docs/config/extensions/prismaExtension.mdx
+25-11Lines changed: 25 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,7 @@ If you are using Prisma, you should use the prisma build extension.
10
10
- Generates the Prisma client during the deploy process
11
11
- Optionally will migrate the database during the deploy process
12
12
- Support for TypedSQL and multiple schema files
13
-
- You can use `prismaSchemaFolder` to specify just the directory containing your schema file, instead of the full path
14
-
- You can add the extension twice if you have multiple separate schemas in the same project (example below)
13
+
- You can set the schema to be a folder to use Prisma's multi-file schema feature (example [below](#multiple-schemas))
15
14
16
15
You can use it for a simple Prisma setup like this:
17
16
@@ -141,17 +140,32 @@ These environment variables are only used during the build process and are not e
141
140
142
141
### Multiple schemas
143
142
144
-
If you have multiple separate schemas in the same project you can add the extension multiple times:
143
+
Prisma supports splitting your schema into multiple files. To use this, set `schema` to be the folder that contains your root schema (e.g. `schema.prisma`).
145
144
146
-
```ts
147
-
prismaExtension({
148
-
schema: 'prisma/schema/main.prisma',
149
-
version: '6.2.0',
150
-
migrate: false,
151
-
}),
145
+
For example, if your root schema is located at `./prisma/schema.prisma`, you would set the `schema` option to `prisma`:
146
+
147
+
<CodeGroup>
148
+
149
+
```ts trigger.config.ts
152
150
prismaExtension({
153
-
schema: 'prisma/schema/secondary.prisma',
154
-
version: '6.2.0',
151
+
schema: 'prisma',
152
+
version: '6.7.0',
155
153
migrate: false,
156
154
}),
157
155
```
156
+
157
+
```shell Example structure
158
+
./prisma
159
+
├── migrations
160
+
├── models
161
+
│ ├── posts.prisma
162
+
│ ├── users.prisma
163
+
│ └── ... other `.prisma` files
164
+
└── schema.prisma
165
+
```
166
+
167
+
</CodeGroup>
168
+
169
+
<Note>
170
+
To use this feature you must be using `[email protected]` or higher. Their official documentation can be found [here](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema).
// Multi-file schemas can be used by specifying a directory instead of a file. https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema
0 commit comments