Skip to content

Commit a1d33db

Browse files
committed
Update documentation for prisma extension
1 parent a1bacb8 commit a1d33db

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

docs/config/extensions/prismaExtension.mdx

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ If you are using Prisma, you should use the prisma build extension.
1010
- Generates the Prisma client during the deploy process
1111
- Optionally will migrate the database during the deploy process
1212
- 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))
1514

1615
You can use it for a simple Prisma setup like this:
1716

@@ -141,17 +140,32 @@ These environment variables are only used during the build process and are not e
141140

142141
### Multiple schemas
143142

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`).
145144

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
152150
prismaExtension({
153-
schema: 'prisma/schema/secondary.prisma',
154-
version: '6.2.0',
151+
schema: 'prisma',
152+
version: '6.7.0',
155153
migrate: false,
156154
}),
157155
```
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).
171+
</Note>

0 commit comments

Comments
 (0)