Prisma 7: “The datasource property url is no longer supported" – Here's the Fix
Ran prisma migrate dev and got this error?
Prisma 7: “The datasource property url is no longer supported" – Here's the Fix

Ran prisma migrate dev and got this error?
The datasource property url is no longer supported in schema files.
Move connection URLs to prisma.config.ts
What changed?
Prisma 7 moved the database URL from schema.prisma to a new file: prisma.config.ts.
Fix:
- Remove
urlfromschema.prisma:
datasource db {
provider = "postgresql"
}
- Create
prisma.config.tsin your project root:
typescript
import 'dotenv/config'
import { defineConfig } from 'prisma/config'
export default defineConfig({
datasource: {
url: process.env.DATABASE_URL!,
},
})
- Run
npx prisma generate
That’s it. Your database URL now lives in the config file, not the schema.
Why? Cleaner separation: models stay in schema.prisma, config goes to prisma.config.ts.
메타데이터
- post_id
- 39954cccc8b7
- slug
- prisma-7-the-datasource-property-url-is-no-longer-supported-heres-the-fix-39954cccc8b7
- url
- https://medium.com/@joodi/prisma-7-the-datasource-property-url-is-no-longer-supported-heres-the-fix-39954cccc8b7
- canonical_url
- https://medium.com/@joodi/prisma-7-the-datasource-property-url-is-no-longer-supported-heres-the-fix-39954cccc8b7
- author_url
- https://medium.com/@joodi
- status
- ok
- fetched_at
- 2026-06-10 08:17:25