-
Notifications
You must be signed in to change notification settings - Fork 870
docs: document CLI flag changes for prisma db execute and migrate diff in v7 #7403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: document CLI flag changes for prisma db execute and migrate diff in v7 #7403
Conversation
Dangerous URL checkNo absolute URLs to prisma.io/docs found. |
WalkthroughDocumentation across Prisma migrate and CLI reference was updated to remove Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related issues
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
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. Comment |
Redirect checkThis PR probably requires the following redirects to be added to static/_redirects:
|
🍈 Lychee Link Check Report
📊 Results Overview
Errors per inputErrors in 200-orm/800-more/350-ai-tools/100-cursor.mdx
Errors in 800-guides/380-vercel-app-deployment.mdx
|
Deploying docs with
|
| Latest commit: |
26fe072
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://3d9f7fec.docs-51g.pages.dev |
| Branch Preview URL: | https://dr-6653-cli-prisma-db-execut.docs-51g.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx (2)
126-131: Consider consolidating the production config guidance.The Prisma 7 note about production configuration is helpful. However, this same guidance (along with the Prisma 6 vs Prisma 7 command variants) is repeated at lines 209-214 and lines 248-253, creating potential maintenance challenges.
Consider one of these approaches:
- Place the info block earlier in the document (before the "Example of a failed migration" section) and reference it from both workflow sections
- Create a shared callout that both sections reference
- If the duplication is intentional for workflow completeness, add a comment noting that both sections should be kept in sync
This would reduce the risk of the sections drifting apart during future updates.
209-214: Duplicated command examples increase maintenance burden.The Prisma 6 vs Prisma 7 command variants appear identically in both the "Moving backwards" (lines 209-214) and "Moving forwards" (lines 248-253) sections. While this provides completeness in each workflow, it creates a maintenance concern.
Suggested consolidation approach
Consider extracting the command variants into a reusable admonition block placed once before both workflow sections, then reference it from each section with a brief note like:
:::note See the [Prisma 7 command variants](#prisma-7-commands) for the updated syntax. :::This maintains the information flow while ensuring consistency.
Also applies to: 248-253
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx(1 hunks)content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx(3 hunks)content/200-orm/500-reference/200-prisma-cli-reference.mdx(3 hunks)content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx(1 hunks)content/900-ai/prompts/prisma-7.mdx(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Check internal links
- GitHub Check: Cloudflare Pages
🔇 Additional comments (6)
content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx (1)
143-147: LGTM - Clear documentation of the new behavior.The updated guidance correctly reflects that
db executenow reads the database URL fromprisma.config.ts, and the simplified command syntax (removing--schema) aligns with the Prisma 7 breaking changes.content/900-ai/prompts/prisma-7.mdx (1)
297-325: Well-documented breaking change with clear migration path.The new CLI Flag Changes section provides:
- Clear before/after examples
- Explicit migration actions for scripts/CI
- Accurate technical guidance
This will help AI assistants guide users through the migration effectively.
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx (1)
384-419: Excellent upgrade documentation with practical examples.This breaking change section effectively guides users through:
- Understanding what changed (flags removed)
- The new approach (prisma.config.ts)
- Concrete before/after examples
The inclusion of the TypeScript config snippet is particularly helpful for users migrating their workflows.
content/200-orm/500-reference/200-prisma-cli-reference.mdx (3)
1269-1309: Comprehensive update to db execute documentation.The updated description, prerequisites, and configuration examples accurately reflect the Prisma 7 behavior. The inclusion of both
schema.prismaandprisma.config.tsexamples provides users with the complete context they need.
1312-1326: Clear documentation of breaking changes in the options section.The updated options table effectively communicates:
- The either/or requirement for
--fileor--stdin(with asterisk notation explained)- The removal of
--schemaand--urlvia a prominent breaking change note- The alternative configuration approach
The breaking change note is well-placed within an info block, making it immediately visible to users consulting the reference.
1329-1339: Examples correctly demonstrate the new command syntax.Both the file and stdin examples have been properly updated to:
- Remove the removed
--schemaand--urlflags- Show the simplified command structure
- Accurately reflect the new behavior
🍈 Lychee Link Check Report
📊 Results Overview
Errors per inputErrors in 200-orm/800-more/350-ai-tools/100-cursor.mdx
Errors in 800-guides/380-vercel-app-deployment.mdx
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
content/200-orm/500-reference/200-prisma-cli-reference.mdx (1)
1650-1714: Comprehensive migrate diff documentation updates.The prerequisites section, options tables, and breaking change notes are all accurate and well-structured. The replacement of
--from-url/--to-urlwith--from-config-datasource/--to-config-datasourceis clearly documented. The tables effectively communicate which options are available and their purposes.Optional: Address minor style issue
Static analysis suggests using "whether" instead of "if" in formal documentation on line 1712:
-| `--exit-code` | No | Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1. | +| `--exit-code` | No | Change the exit code behavior to signal whether the diff is empty or not (Empty: 0, Error: 1, Not empty: 2). Default behavior is Success: 0, Error: 1. |Based on learnings, this is a minor stylistic improvement for formal documentation.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx(2 hunks)content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx(3 hunks)content/200-orm/500-reference/200-prisma-cli-reference.mdx(5 hunks)content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx(1 hunks)content/900-ai/prompts/prisma-7.mdx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- content/200-orm/300-prisma-migrate/300-workflows/60-generating-down-migrations.mdx
- content/900-ai/prompts/prisma-7.mdx
🧰 Additional context used
🪛 LanguageTool
content/200-orm/500-reference/200-prisma-cli-reference.mdx
[style] ~1712-~1712: In contexts where ‘if’ is followed by ‘or’, using ‘whether’ may be more appropriate (and formal).
Context: ...Change the exit code behavior to signal if the diff is empty or not (Empty: 0, Err...
(IF_WHETHER)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Check internal links
🔇 Additional comments (10)
content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx (4)
196-209: Excellent before/after comparison for migrate diff.The side-by-side Prisma 6 and Prisma 7 examples clearly demonstrate the migration path. The Prisma 7 example correctly uses
--from-config-datasourcewith--config prisma.config.prod.tsto specify the production database configuration.
216-221: Correct documentation of db execute flag changes.The examples accurately show the removal of
--urlflag in Prisma 7 and its replacement with the--configapproach. This aligns with the documented breaking change.
245-250: Consistent documentation pattern maintained.This example continues the consistent pattern of showing Prisma 6 vs Prisma 7 commands, demonstrating the migration for forward-moving scenarios. The
--from-config-datasourceusage is correct.
257-262: Comprehensive coverage of the migration scenarios.All migration scenarios (backward and forward, for both migrate diff and db execute) are now documented with Prisma 6 and Prisma 7 variants. This thorough approach will help users understand the changes regardless of their use case.
content/200-orm/800-more/300-upgrade-guides/200-upgrading-versions/400-upgrading-to-prisma-7.mdx (2)
384-419: Well-structured breaking change documentation.This section effectively documents the removal of
--schemaand--urlflags fromprisma db execute. The before/after examples are clear, and the TypeScript configuration example is correct and consistent with the new Prisma 7 approach. The explanation clearly guides users on the migration path.
420-451: Comprehensive migrate diff CLI changes documentation.The replacement table clearly maps removed options to their new equivalents, making migration straightforward. The before/after examples demonstrate the practical application of these changes. The note about configuring
shadowDatabaseUrlinprisma.config.tsis an important detail that prevents user confusion.content/200-orm/500-reference/200-prisma-cli-reference.mdx (4)
1269-1309: Good addition of prerequisites section.The updated description clearly states that datasource configuration is read from the Prisma config file. The prerequisites section with schema and config examples helps users ensure proper setup before running the command. The configuration examples are accurate and consistent with the rest of the documentation.
1311-1325: Options table correctly updated for Prisma 7.The options table accurately reflects the available flags, correctly noting that either
--fileor--stdinis required for script input. The info block clearly communicates the Prisma 7 breaking change, directing users to configure database connections inprisma.config.tsinstead.
1327-1339: Examples correctly demonstrate the new command structure.Both examples properly show the simplified Prisma 7 command structure without
--urlor--schemaflags. The stdin piping example is particularly helpful for users who want to chain commands. Both correctly rely on the datasource configured inprisma.config.ts.
1717-1762: Excellent examples covering various migrate diff scenarios.The examples comprehensively cover different use cases:
- Comparing config datasource to schema
- Comparing schema to config datasource
- Comparing migrations directory to config datasource
- Piping to db execute
- Using exit codes for CI/CD
All examples correctly use the new
--from-config-datasourceand--to-config-datasourceoptions. The piping example at line 1751 is particularly valuable as it shows how to chain migrate diff with db execute using--stdin.
content/200-orm/300-prisma-migrate/300-workflows/70-patching-and-hotfixing.mdx
Show resolved
Hide resolved
26fe072
🍈 Lychee Link Check Report
📊 Results Overview
Errors per inputErrors in 200-orm/800-more/350-ai-tools/100-cursor.mdx
Errors in 800-guides/380-vercel-app-deployment.mdx
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.