[SOLVED] Primsa + D1 Migration
I guys, I'm creating a full stack app using only cloudflare services. In this Next.js app I'm using Prisma as ORM and D1 as database but... I'm getting stuck at migrations due to this error:
CMD: npx prisma migrate diff --from-local-d1 script --to-schema-datamodel ./prisma/schema.prisma >> ${migrationPath}
Error:
Passing the --from-local-d1 flag to the prisma migrate diff command is not supported when
defining an adapter in Prisma config file (e.g.,
prisma.config.ts
).
I've checked both Prisma and CF documentation about this integration but nothing, they show the --from-local-d1 flag, but it's not working at all.1 Reply
Edit: Solved by using an edited script you can find here:
https://gist.github.com/alexanderson1993/0852a8162ebac591b62a79883a81e1a8?permalink_comment_id=5785701#gistcomment-5785701
Gist
Prisma D1 Migration CLI
Prisma D1 Migration CLI. GitHub Gist: instantly share code, notes, and snippets.