Skip to content
← Back to activity

Public problem

Error: The datasource property is required in your Prisma config file when using prisma migrate dev (Prisma 7)

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

On Prisma 7, running prisma migrate dev fails with "Error: The datasource property is required in your Prisma config file when using prisma migrate dev", even though prisma.config.ts exists with a datasource url. The reporter had the config file inside the prisma/ folder instead of the project root. Prisma 7 moved the database URL from schema.prisma to prisma.config.ts and only looks for that file in the project root by default.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Move prisma.config.ts to the project root (next to package.json). Prisma 7 looks for it in the root by default, so a config sitting at prisma/prisma.config.ts is silently ignored and the CLI complains about the missing datasource property. The reporter confirmed this fixed it immediately. Alternative: keep the file where it is and pass it explicitly with --config, e.g. npx prisma migrate dev --schema ./prisma-schema1/schema.prisma --config ./prisma-schema1/prisma.config.ts, which is the correct route for multi-schema projects. Also check your Dockerfile and pnpm deploy files list include prisma.config.ts so it ships with the image. Source: https://github.com/prisma/prisma/issues/28585