Skip to content

feat(app): Support Prisma Next branch database setup#70

Merged
luanvdw merged 1 commit into
mainfrom
feat/prisma-next-branch-db-setup
Jun 4, 2026
Merged

feat(app): Support Prisma Next branch database setup#70
luanvdw merged 1 commit into
mainfrom
feat/prisma-next-branch-db-setup

Conversation

@luanvdw
Copy link
Copy Markdown
Member

@luanvdw luanvdw commented Jun 4, 2026

Overview

This extends branch database setup during app deploy so Prisma Next apps get the same database creation and schema setup path as Prisma ~7 apps. The deploy workflow can now apply schema from local code without adding a separate database command surface.

Changes

  • packages/cli/src/lib/app/branch-database.ts now scans for prisma-next.config.* alongside schema.prisma, classifies supported and unsupported database targets, and prefers Prisma Next configs when both sources exist.
  • Prisma Next setup runs npx --no-install prisma-next contract emit --config <config> followed by npx --no-install prisma-next db init --config <config> --db <database-url>. Prisma ORM keeps migrate deploy when migrations exist and uses db push otherwise.
  • packages/cli/src/lib/app/branch-database-deploy.ts rejects explicit --db for known non-Postgres Prisma sources and suppresses automatic prompting for those unsupported sources. Schema setup errors now return recovery commands for the selected source.
  • packages/cli/src/types/app.ts and packages/cli/src/presenters/app.ts carry and render the schema source/command so deploy output and JSON can distinguish Prisma ORM from Prisma Next.
  • packages/cli/tests/app-branch-database.test.ts covers the new command sequence, Prisma Next deploy setup, source precedence, unsupported targets, and the Prisma 7 db push command shape.
  • docs/product/command-spec.md, docs/product/resource-model.md, and docs/product/error-conventions.md describe the expanded schema-source contract.

Why

Prisma Next does not use schema.prisma as the deploy-time schema artifact, so the existing branch DB setup skipped schema application for those apps. Keeping this inside app deploy --db preserves the current CLI/CI surface while letting the implementation choose the right local schema source. Known non-Postgres targets are rejected before database creation because this workflow creates Prisma Postgres databases and should not silently wire an incompatible branch database.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Warning

Review limit reached

@luanvdw, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 40 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b2b9d485-da99-4742-bba8-90218756e48f

📥 Commits

Reviewing files that changed from the base of the PR and between 3e444d8 and 035f37d.

📒 Files selected for processing (8)
  • docs/product/command-spec.md
  • docs/product/error-conventions.md
  • docs/product/resource-model.md
  • packages/cli/src/lib/app/branch-database-deploy.ts
  • packages/cli/src/lib/app/branch-database.ts
  • packages/cli/src/presenters/app.ts
  • packages/cli/src/types/app.ts
  • packages/cli/tests/app-branch-database.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/prisma-next-branch-db-setup
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/prisma-next-branch-db-setup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@luanvdw luanvdw changed the title Support Prisma Next branch database setup feat(app): Support Prisma Next branch database setup Jun 4, 2026
@luanvdw luanvdw marked this pull request as ready for review June 4, 2026 10:00
@luanvdw luanvdw merged commit 78493ad into main Jun 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant