Skip to content

Commit 3ee07b2

Browse files
committed
doc: Document explicit cast for migrations
1 parent ce094c8 commit 3ee07b2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,23 @@ export async function migrate(
279279
The progress report callback is optional, and will log progress to the console
280280
if ommitted.
281281

282+
> **Note**: when using an extended client, you'll need to do an explicit cast
283+
> to call the `migrate` function, like so:
284+
>
285+
> ```ts
286+
> // Import from your generated client location, not @prisma/client
287+
> import { PrismaClient } from '.prisma/client' // or custom path
288+
> import { migrate } from './where/you/want/your/migrations'
289+
> import { fieldEncryptionExtension } from 'prisma-field-encryption'
290+
>
291+
> const client = new PrismaClient().$extends(fieldEncryptionExtension())
292+
>
293+
> // Explicit cast needed here ↴
294+
> await migrate(client as PrismaClient)
295+
> ```
296+
>
297+
> See issue [prisma/prisma#20326](https://github.com/prisma/prisma/issues/20326).
298+
282299
### Following migrations progress
283300
284301
A progress report is an object with the following fields:

0 commit comments

Comments
 (0)