Prisma · tool · fg-0286

Prisma 7 error P1012: The datasource property `url` is no longer supported in schema files

Error code: P1012

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

Prisma 7 moved url, directUrl, and shadowDatabaseUrl out of schema.prisma into prisma.config.ts, and the runtime connection now comes from a driver adapter. The VS Code extension defaults to the Prisma 7 language server, so it also flags Prisma 6 schemas.

Fix

Remove url from the datasource block, set datasource.url in prisma.config.ts, and pass an adapter to PrismaClient. Projects staying on Prisma 6 should run the extension's 'Pin the current workspace to Prisma 6' command (extension 7.x), which sets prisma.pinToPrisma6.

Apply

// prisma/schema.prisma
datasource db {
  provider = "postgresql"
}
// prisma.config.ts
import 'dotenv/config'
import { defineConfig } from 'prisma/config'
export default defineConfig({
  schema: 'prisma/schema.prisma',
  datasource: { url: process.env.DATABASE_URL },
})

Affects: Prisma ORM 7.0 and later (November 2025), reproduced on 7.10.0

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp