prisma-v7-env-setup

Configure and migrate Prisma ORM v7 projects with prisma.config.ts and datasource setup.

1|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/tarabakz25/my-skills --skill prisma-v7-env-setup-tarabakz25
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: prisma-v7-env-setup
Source: https://github.com/tarabakz25/my-skills/tree/main/prisma-v7-env-setup
Command: npx skills add https://github.com/tarabakz25/my-skills --skill prisma-v7-env-setup-tarabakz25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Prisma ORM v7 introduces breaking changes—prisma.config.ts is now mandatory, datasource url moves out of schema.prisma, and the CLI no longer auto-loads .env files—which causes setup and migration failures for Node.js and Next.js projects. ## Core Features & Use Cases - New Project Setup: Installs prisma and @prisma/client, generates prisma.config.ts, configures the datasource URL, and runs generate/migrate/studio. - v6 to v7 Migration: Moves datasource url/directUrl into prisma.config.ts, defines a .env loading strategy, and chooses between the legacy prisma-client-js generator and the new prisma-client with driver adapters or Accelerate. - Automated Diagnostics: The prisma7-doctor.mjs script checks Node version, dependencies, config files, schema, and .env, then prints next actions. - Use Case: A Next.js app upgraded to Prisma v7 fails with "datasource property url is no longer supported"—use this Skill to restructure the config and restore migrations. ## Quick Start Set up Prisma v7 in my Next.js project and fix the prisma.config.ts and DATABASE_URL errors blocking prisma migrate dev.

Frequently Asked Questions about prisma-v7-env-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Prisma v7 in a new Node.js project?▼

Install @prisma/client as a dependency and prisma as a devDependency, run npx prisma init, then create prisma.config.ts with the datasource url read from process.env.DATABASE_URL. Finish with npx prisma generate and npx prisma migrate dev.

How do I migrate from Prisma v6 to v7?▼

Upgrade both prisma and @prisma/client to v7 together, add a prisma.config.ts file, and move datasource url/directUrl out of schema.prisma into the config. Also decide how .env is loaded since the v7 CLI no longer loads it automatically.

Why does Prisma v7 say datasource url is no longer supported?▼

Prisma v7 removed the url and directUrl properties from the datasource block in schema.prisma. The connection URL must now be defined in prisma.config.ts under datasource.url, typically as process.env.DATABASE_URL.

Why is DATABASE_URL not found when running Prisma v7 CLI?▼

The Prisma v7 CLI does not auto-load .env files, so process.env.DATABASE_URL is empty. Add import "dotenv/config" to prisma.config.ts, wrap commands with dotenv-cli, or inject the variable in your CI or production environment.

Does Prisma v7 support MongoDB?▼

No, MongoDB support was removed in Prisma ORM v7. Projects using MongoDB should stay on Prisma v6 rather than upgrading.

When do I need a driver adapter with Prisma v7?▼

A driver adapter or Prisma Accelerate is required when using the new prisma-client generator, since new PrismaClient() alone will fail. To keep existing code unchanged, use the legacy prisma-client-js generator instead.