prisma migrations fail if there are multiple databases

running migrations throws an error if there are multiple databases.

❯ npx prisma migrate diff --from-local-d1 --to-schema-datamodel ./prisma/schema.prisma --script --output migrations/0002_rename_referrer.sql

Error: Multiple Cloudflare D1 databases found in .wrangler/state/v3/d1/miniflare-D1DatabaseObject. Please manually specify the local D1 database with `--from-url file:`, without using the `--from-local-d1` flag.


i figured out by trial and error that useing --from-url and guessing one of the sql files in .wrangler/state/d1 works, but is there a better way to determine which file to use?
Was this page helpful?