Skip to content

Commit

Permalink
doc: Document explicit cast for migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Jul 23, 2023
1 parent 8c584f1 commit f4dd5d7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,23 @@ export async function migrate(
The progress report callback is optional, and will log progress to the console
if ommitted.

> **Note**: when using an extended client, you'll need to do an explicit cast
> to call the `migrate` function, like so:
>
> ```ts
> // Import from your generated client location, not @prisma/client
> import { PrismaClient } from '.prisma/client' // or custom path
> import { migrate } from './where/you/want/your/migrations'
> import { fieldEncryptionExtension } from 'prisma-field-encryption'
>
> const client = new PrismaClient().$extends(fieldEncryptionExtension())
>
> // Explicit cast needed here ↴
> await migrate(client as PrismaClient)
> ```
>
> See issue [prisma/prisma#20326](https://github.com/prisma/prisma/issues/20326).
### Following migrations progress
A progress report is an object with the following fields:
Expand Down

0 comments on commit f4dd5d7

Please sign in to comment.