fix(schema-engine): remove reference to removed --shadow-database-url flag from error message#5803
Conversation
… flag from error message The `--shadow-database-url` CLI flag was removed from the TypeScript CLI in prisma/prisma#28432, but the Rust engine error message still references it. Users who follow this advice get an "unknown flag" error. Update the error message to only suggest the working option: `datasource.shadowDatabaseUrl` in `prisma.config.ts`. Fixes prisma/prisma#29454
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (5)
Summary by CodeRabbit
WalkthroughRemoved the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Merging this PR will not alter performance
Comparing Footnotes
|
…iffParams The `shadow_database_url` field in `DiffParams` was marked as `@deprecated` and had a `TODO: delete the parameter` comment on the internal helper function. Since the `--shadow-database-url` CLI flag was removed in Prisma 7, this field is dead code on the engine side. Shadow database URL is now exclusively configured via `datasource.shadowDatabaseUrl` in `prisma.config.ts`, which populates the `DatasourceUrls` struct. The `DiffParams.shadow_database_url` field is no longer populated by the CLI (always null). This change: - Removes `shadow_database_url` from `DiffParams` (json-rpc-api) - Removes the `shadow_database_url` parameter from `json_rpc_diff_target_to_dialect()` and its dead-code block - Removes the outdated TODO comment - Updates all test fixtures that initialized the field JSON-RPC compatibility: `DiffParams` does not use `#[serde(deny_unknown_fields)]`, so older CLI versions sending the field will have it silently ignored by newer engines. Fixes prisma/prisma#29454
…ffInput Companion to prisma/prisma-engines#5803. The shadow database URL is now exclusively configured via `datasource.shadowDatabaseUrl` in `prisma.config.ts`, and the `DiffParams.shadow_database_url` field has been removed from the schema engine. This removes the matching `shadowDatabaseUrl` field from the TypeScript `MigrateDiffInput` interface and the hardcoded `null` value passed in `MigrateDiff.parse()`. Fixes prisma#29454
|
Thanks for the suggestion! I've pushed a follow-up commit that completely removes
The JSON-RPC compatibility is maintained: Ready for re-review 🙏 |
…iff (#29455) ## Changes **Commit 1** — Remove dead code referencing the removed `--shadow-database-url` CLI flag in `packages/migrate/src/commands/MigrateDiff.ts`. **Before (line 286):** ```ts shadowDatabaseUrl: args['--shadow-database-url'] ?? null, ``` **After (interim):** ```ts shadowDatabaseUrl: null, ``` **Commit 2** — Following reviewer feedback, completely remove the deprecated `shadowDatabaseUrl` field from `MigrateDiffInput`: - Removed `shadowDatabaseUrl: string | null` from `MigrateDiffInput` interface in `types.ts` - Removed the `shadowDatabaseUrl: null` line from the `migrate.engine.migrateDiff()` call The matching `DiffParams.shadow_database_url` field has also been removed from the schema engine in the companion PR: prisma/prisma-engines#5803. ## Context The `--shadow-database-url` flag was removed from the arg spec in #28432 (Prisma 7 breaking changes), but: 1. Line 286 still referenced `args['--shadow-database-url']` which always evaluated to `undefined` → `null` via `??` 2. The `shadowDatabaseUrl` field in `MigrateDiffInput` was still passed to the engine (as `null`) Other removed flags (`--from-url`, `--to-url`, etc.) were properly cleaned up in #28432, but `shadowDatabaseUrl` was missed in both the function body and the type definition. Shadow database URL is now exclusively configured via `datasource.shadowDatabaseUrl` in `prisma.config.ts`. Tests using `ctx.setDatasource({ url, shadowDatabaseUrl })` and `shadowdb.config.ts` fixtures are unaffected — those represent the `datasource` configuration path, which is the correct mechanism. Fixes #29454
Changes
Commit 1 — Update the error message in
schema-engine/core/src/commands/diff_cli.rsto remove the reference to the--shadow-database-urlCLI flag, which was removed from the TypeScript CLI in prisma/prisma#28432 (Prisma 7).Before:
After:
Commit 2 — Following reviewer feedback, completely remove the deprecated
shadow_database_urlfield fromDiffParamson both sides:DiffParams.shadow_database_url(marked@deprecatedin json-rpc-api)shadow_database_urlparameter fromjson_rpc_diff_target_to_dialect()(hadTODO: delete the parametercomment)DatasourceUrlsfrom the paramThe
DatasourceUrls.shadow_database_urlfield is intentionally preserved — it carries the value fromdatasource.shadowDatabaseUrlinprisma.config.ts, which is the new (and only) way to configure shadow DB for migrate diff.JSON-RPC compatibility:
DiffParamsdoes not use#[serde(deny_unknown_fields)], so older CLI versions that still send the field will have it silently ignored by newer engines.Context
The
--shadow-database-urlCLI flag was removed fromprisma migrate diffin Prisma 7, but the Rust engine error message and theDiffParamsfield still referenced it. Users who followed the error message advice got an "unknown flag" error.See prisma/prisma#29454 for the full bug report.
A companion PR for the TypeScript side is at prisma/prisma#29455 (removes the matching
shadowDatabaseUrlfield fromMigrateDiffInput).