← Back to list

Prisma 7: “The datasource property url is no longer supported" – Here's the Fix

Ran prisma migrate dev and got this error?

Joodi · 2026-03-23 09:19 · 0 claps · 0.6 min read
#prisma #prisma-orm #web-development #front-end-development #backend
Open on Medium ↗
Wiki topics: ML · Machine Learning 🌐 · Web Development

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:

  1. Remove url from schema.prisma:
datasource db {
  provider = "postgresql"
}
  1. Create prisma.config.ts in your project root:

typescript

import 'dotenv/config'
import { defineConfig } from 'prisma/config'
export default defineConfig({
  datasource: {
    url: process.env.DATABASE_URL!,
  },
})
  1. 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