diff --git a/apps/lsp-playground/package.json b/apps/lsp-playground/package.json index 1629cbbf522f..cd7944a4bc89 100644 --- a/apps/lsp-playground/package.json +++ b/apps/lsp-playground/package.json @@ -35,7 +35,7 @@ "ws": "^8.21.2" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/apps/telemetry-backend/package.json b/apps/telemetry-backend/package.json index 90f6bf09ed84..7917d54d54be 100644 --- a/apps/telemetry-backend/package.json +++ b/apps/telemetry-backend/package.json @@ -27,7 +27,7 @@ "evlog": "^2.24.0" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/compute-sdk": "^0.43.0", "@prisma/management-api-sdk": "^1.76.0", "@repo/prisma-bin": "workspace:8.0.0-rc.24", diff --git a/examples/bundle-size/package.json b/examples/bundle-size/package.json index f207f9721b25..72153c088b9b 100644 --- a/examples/bundle-size/package.json +++ b/examples/bundle-size/package.json @@ -28,7 +28,7 @@ "pg": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/dev": "catalog:", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", diff --git a/examples/mongo-blog-leaderboard/package.json b/examples/mongo-blog-leaderboard/package.json index af40cddbc7b8..c59f88353f1c 100644 --- a/examples/mongo-blog-leaderboard/package.json +++ b/examples/mongo-blog-leaderboard/package.json @@ -19,7 +19,7 @@ "mongodb": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/examples/mongo-demo/package.json b/examples/mongo-demo/package.json index 3f29caaab038..9ec025dc893c 100644 --- a/examples/mongo-demo/package.json +++ b/examples/mongo-demo/package.json @@ -24,7 +24,7 @@ "react-dom": "^19.3.1" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/examples/multi-extension-monorepo/package.json b/examples/multi-extension-monorepo/package.json index c9eb40b29e8b..ca860cd909a6 100644 --- a/examples/multi-extension-monorepo/package.json +++ b/examples/multi-extension-monorepo/package.json @@ -18,7 +18,7 @@ "@prisma/orm-postgres": "workspace:8.0.0-rc.24" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/examples/paradedb-demo/package.json b/examples/paradedb-demo/package.json index 99d35ca821ea..898adf86de85 100644 --- a/examples/paradedb-demo/package.json +++ b/examples/paradedb-demo/package.json @@ -25,7 +25,7 @@ "pg": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/examples/prisma-8-cloudflare-worker/package.json b/examples/prisma-8-cloudflare-worker/package.json index 7a4dc428b1e3..7b755dd6a87b 100644 --- a/examples/prisma-8-cloudflare-worker/package.json +++ b/examples/prisma-8-cloudflare-worker/package.json @@ -29,7 +29,7 @@ "devDependencies": { "@cloudflare/vitest-pool-workers": "0.20.3", "@cloudflare/workers-types": "5.20260804.1", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/examples/prisma-8-demo-mariadb/package.json b/examples/prisma-8-demo-mariadb/package.json index 68a16c2668bd..bbcaaf3f2a70 100644 --- a/examples/prisma-8-demo-mariadb/package.json +++ b/examples/prisma-8-demo-mariadb/package.json @@ -20,7 +20,7 @@ "@prisma/orm-mariadb": "workspace:8.0.0-rc.24" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/examples/prisma-8-demo-mysql/package.json b/examples/prisma-8-demo-mysql/package.json index 81e0f5d05958..04ba5fb1122d 100644 --- a/examples/prisma-8-demo-mysql/package.json +++ b/examples/prisma-8-demo-mysql/package.json @@ -20,7 +20,7 @@ "@prisma/orm-mysql": "workspace:8.0.0-rc.24" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/examples/prisma-8-demo-sqlite/package.json b/examples/prisma-8-demo-sqlite/package.json index d85bd3120070..67896ec06d86 100644 --- a/examples/prisma-8-demo-sqlite/package.json +++ b/examples/prisma-8-demo-sqlite/package.json @@ -21,7 +21,7 @@ "dotenv": "^17.4.2" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@types/node": "catalog:", diff --git a/examples/prisma-8-demo/package.json b/examples/prisma-8-demo/package.json index 7598b1ebcf2a..934b13a8c5fd 100644 --- a/examples/prisma-8-demo/package.json +++ b/examples/prisma-8-demo/package.json @@ -32,7 +32,7 @@ "react-dom": "^19.3.1" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/dev": "catalog:", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", diff --git a/examples/prisma-8-postgis-demo/package.json b/examples/prisma-8-postgis-demo/package.json index 64a1cdd06321..9af72464465a 100644 --- a/examples/prisma-8-postgis-demo/package.json +++ b/examples/prisma-8-postgis-demo/package.json @@ -33,7 +33,7 @@ "react-leaflet": "^5.0.0" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/examples/prisma7-adoption/package.json b/examples/prisma7-adoption/package.json index 9c1bad1bf3ac..12b4d704ae7e 100644 --- a/examples/prisma7-adoption/package.json +++ b/examples/prisma7-adoption/package.json @@ -29,7 +29,7 @@ "pg": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/dev": "catalog:", "@prisma/prisma7": "7.10.0", "@repo/test-utils": "workspace:8.0.0-rc.24", diff --git a/examples/react-router-demo/package.json b/examples/react-router-demo/package.json index b3ee2e554583..9abbfe685068 100644 --- a/examples/react-router-demo/package.json +++ b/examples/react-router-demo/package.json @@ -30,7 +30,7 @@ "react-router": "^8.3.1" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/dev": "catalog:", "@react-router/dev": "^8.3.1", "@repo/prisma-bin": "workspace:8.0.0-rc.24", diff --git a/examples/retail-store/package.json b/examples/retail-store/package.json index 2be4f0f2cd31..90dd6be9b3c6 100644 --- a/examples/retail-store/package.json +++ b/examples/retail-store/package.json @@ -39,7 +39,7 @@ "tailwindcss": "^4.3.5" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/examples/supabase/package.json b/examples/supabase/package.json index 2275cc5d992f..f976fdac977f 100644 --- a/examples/supabase/package.json +++ b/examples/supabase/package.json @@ -18,7 +18,7 @@ "pg": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/prisma-bin": "workspace:8.0.0-rc.24", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", diff --git a/packages/1-framework/3-tooling/cli/package.json b/packages/1-framework/3-tooling/cli/package.json index 3d981b95f517..7d6f9243a532 100644 --- a/packages/1-framework/3-tooling/cli/package.json +++ b/packages/1-framework/3-tooling/cli/package.json @@ -52,7 +52,7 @@ "@internal/sql-contract-ts": "workspace:8.0.0-rc.24", "@internal/sql-operations": "workspace:8.0.0-rc.24", "@internal/sql-runtime": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", @@ -63,7 +63,7 @@ "vitest": "catalog:" }, "peerDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "typescript": ">=5.9" }, "peerDependenciesMeta": { diff --git a/packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts b/packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts index 5b612609e48e..7b33c1d0db91 100644 --- a/packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts +++ b/packages/1-framework/3-tooling/cli/test/orm/plan-question-prompt.test.ts @@ -178,10 +178,13 @@ describe('a namespace answer typed at the prompt', () => { const prompt = { statements: vi.fn(async (questions: readonly { readonly subject: string }[]) => { asked.push(questions.map(({ subject }) => subject)); - throw Object.assign(new Error('needs a statement'), { - code: 'CLI.CONSENT_REQUIRED', - unanswered: questions.map(({ subject }) => subject), - }); + throw Object.assign( + new Error('This command requires explicit consent, but it was not provided.'), + { + code: 'CLI.CONSENT_REQUIRED', + unanswered: questions.map(({ subject }) => subject), + }, + ); }), } as unknown as PromptSurface; @@ -380,13 +383,17 @@ describe('a refusal to answer a question that names ways to keep the data', () = }; const prompt = { statements: vi.fn(async () => { - throw new CliStructuredError('CLI.CONSENT_REQUIRED', '"Status.DONE" needs a statement.', { - why: kept.question, - nextActions: [ - { kind: 'user-choice', label: 'Run the command again with --delete Status.DONE' }, - ], - meta: { unanswered: [{ subject: 'Status.DONE', verbs: ['delete'] }] }, - }); + throw new CliStructuredError( + 'CLI.CONSENT_REQUIRED', + 'This command requires explicit consent, but it was not provided.', + { + why: kept.question, + nextActions: [ + { kind: 'user-choice', label: 'Run the command again with --delete Status.DONE' }, + ], + meta: { unanswered: [{ subject: 'Status.DONE', verbs: ['delete'] }] }, + }, + ); }), } as unknown as PromptSurface; const statements: StatementSurface = { @@ -396,7 +403,7 @@ describe('a refusal to answer a question that names ways to keep the data', () = await expect(promptPlanQuestions(prompt, statements)([kept])).rejects.toMatchObject({ code: 'CLI.CONSENT_REQUIRED', - message: '"Status.DONE" needs a statement.', + message: 'This command requires explicit consent, but it was not provided.', why: 'Remove value "done" would lose enum value "Status.DONE".', nextActions: [ { kind: 'user-choice', label: way }, diff --git a/packages/1-framework/3-tooling/config-loader/package.json b/packages/1-framework/3-tooling/config-loader/package.json index 31df73fd1c76..68d20dd05448 100644 --- a/packages/1-framework/3-tooling/config-loader/package.json +++ b/packages/1-framework/3-tooling/config-loader/package.json @@ -26,7 +26,7 @@ "tinyglobby": "catalog:" }, "devDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", @@ -36,7 +36,7 @@ "vitest": "catalog:" }, "peerDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "typescript": ">=5.9" }, "peerDependenciesMeta": { diff --git a/packages/3-extensions/citext/package.json b/packages/3-extensions/citext/package.json index f4e8a30d2f14..91093a4add57 100644 --- a/packages/3-extensions/citext/package.json +++ b/packages/3-extensions/citext/package.json @@ -32,7 +32,7 @@ "@internal/postgres": "workspace:8.0.0-rc.24", "@internal/postgres-codec-testkit": "workspace:8.0.0-rc.24", "@internal/sql-contract-ts": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-extensions/paradedb/package.json b/packages/3-extensions/paradedb/package.json index fcb4414193e5..0635ba116ef0 100644 --- a/packages/3-extensions/paradedb/package.json +++ b/packages/3-extensions/paradedb/package.json @@ -34,7 +34,7 @@ "@internal/operations": "workspace:8.0.0-rc.24", "@internal/sql-contract-psl": "workspace:8.0.0-rc.24", "@internal/target-postgres": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-extensions/pgvector/package.json b/packages/3-extensions/pgvector/package.json index d1fb64fef54f..902b17d74115 100644 --- a/packages/3-extensions/pgvector/package.json +++ b/packages/3-extensions/pgvector/package.json @@ -39,7 +39,7 @@ "@internal/postgres": "workspace:8.0.0-rc.24", "@internal/postgres-codec-testkit": "workspace:8.0.0-rc.24", "@internal/sql-contract-ts": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-extensions/postgis/package.json b/packages/3-extensions/postgis/package.json index 8c90a03b84c2..6cd777170fae 100644 --- a/packages/3-extensions/postgis/package.json +++ b/packages/3-extensions/postgis/package.json @@ -37,7 +37,7 @@ "@internal/operations": "workspace:8.0.0-rc.24", "@internal/postgres": "workspace:8.0.0-rc.24", "@internal/sql-contract-ts": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-extensions/supabase/package.json b/packages/3-extensions/supabase/package.json index a2c7cefdc3c7..1efe9d553807 100644 --- a/packages/3-extensions/supabase/package.json +++ b/packages/3-extensions/supabase/package.json @@ -47,7 +47,7 @@ "@internal/operations": "workspace:8.0.0-rc.24", "@internal/psl-printer": "workspace:8.0.0-rc.24", "@internal/sql-contract-psl": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-targets/mysql/1-mysql/9-facade/package.json b/packages/3-targets/mysql/1-mysql/9-facade/package.json index 899c9d0872a0..3b4e8dffbdf9 100644 --- a/packages/3-targets/mysql/1-mysql/9-facade/package.json +++ b/packages/3-targets/mysql/1-mysql/9-facade/package.json @@ -45,7 +45,7 @@ "@internal/migration-tools": "workspace:8.0.0-rc.24", "@internal/psl-parser": "workspace:8.0.0-rc.24", "@internal/sql-schema-ir": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-targets/mysql/2-mariadb/9-facade/package.json b/packages/3-targets/mysql/2-mariadb/9-facade/package.json index f5493f974ed8..d18b121f6519 100644 --- a/packages/3-targets/mysql/2-mariadb/9-facade/package.json +++ b/packages/3-targets/mysql/2-mariadb/9-facade/package.json @@ -42,7 +42,7 @@ "@internal/framework-components": "workspace:8.0.0-rc.24", "@internal/migration-tools": "workspace:8.0.0-rc.24", "@internal/sql-schema-ir": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/packages/3-targets/mysql/3-live-tests/package.json b/packages/3-targets/mysql/3-live-tests/package.json index efafa41672a5..047a9388d148 100644 --- a/packages/3-targets/mysql/3-live-tests/package.json +++ b/packages/3-targets/mysql/3-live-tests/package.json @@ -30,7 +30,7 @@ "@internal/sql-runtime": "workspace:8.0.0-rc.24", "@internal/target-mariadb": "workspace:8.0.0-rc.24", "@internal/target-mysql": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "temporal-polyfill": "^1.0.8", diff --git a/packages/9-public/@prisma/orm-toolchain/package.json b/packages/9-public/@prisma/orm-toolchain/package.json index 9df5febaf955..7c751a49340f 100644 --- a/packages/9-public/@prisma/orm-toolchain/package.json +++ b/packages/9-public/@prisma/orm-toolchain/package.json @@ -49,7 +49,7 @@ "typescript": "catalog:" }, "peerDependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "typescript": ">=5.9", "vite": "^7.0.0 || ^8.0.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 431f3266f407..9bad002ab305 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -198,8 +198,8 @@ importers: version: 8.21.3 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -238,8 +238,8 @@ importers: version: 2.24.0(express@5.2.1)(hono@4.11.4)(next@16.4.6(@types/node@26.1.2)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react-router@8.5.2(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(react@19.3.1)(vite@8.1.4(@types/node@26.1.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/compute-sdk': specifier: ^0.43.0 version: 0.43.0(@prisma/management-api-sdk@1.76.0)(encoding@0.1.13)(rollup@4.59.0) @@ -296,8 +296,8 @@ importers: version: 8.22.0 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/dev': specifier: 'catalog:' version: 0.25.2(typescript@5.9.3)(vite@8.1.4(@types/node@26.1.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) @@ -351,8 +351,8 @@ importers: version: 7.5.0(socks@2.8.9) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -397,8 +397,8 @@ importers: version: 19.3.1(react@19.3.1) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -446,8 +446,8 @@ importers: version: link:../../packages/9-public/@prisma/orm-postgres devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -486,8 +486,8 @@ importers: version: 8.22.0 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -535,8 +535,8 @@ importers: specifier: 5.20260804.1 version: 5.20260804.1 '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -590,8 +590,8 @@ importers: version: 19.3.1(react@19.3.1) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/dev': specifier: 'catalog:' version: 0.25.2(typescript@5.9.3)(vite@8.1.4(@types/node@26.1.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) @@ -654,8 +654,8 @@ importers: version: link:../../packages/9-public/@prisma/orm-mariadb devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -679,8 +679,8 @@ importers: version: link:../../packages/9-public/@prisma/orm-mysql devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -710,8 +710,8 @@ importers: version: 17.4.2 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -765,8 +765,8 @@ importers: version: 5.0.0(leaflet@1.9.4)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -823,8 +823,8 @@ importers: version: 8.22.0 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/dev': specifier: 'catalog:' version: 0.25.2(typescript@5.9.3)(vite@8.1.4(@types/node@26.1.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) @@ -887,8 +887,8 @@ importers: version: 8.5.2(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/dev': specifier: 'catalog:' version: 0.25.2(typescript@5.9.3)(vite@8.1.4(@types/node@26.1.2)(esbuild@0.28.2)(jiti@2.7.0)(tsx@4.23.15)(yaml@2.9.1)) @@ -996,8 +996,8 @@ importers: version: 4.3.5 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -1048,8 +1048,8 @@ importers: version: 8.22.0 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/prisma-bin': specifier: workspace:8.0.0-rc.24 version: link:../../test/prisma-bin @@ -1529,8 +1529,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../../2-sql-family/5-runtime '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../../test/utils @@ -1669,8 +1669,8 @@ importers: version: 0.2.17 devDependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../../test/utils @@ -3267,8 +3267,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../2-sql-family/2-authoring/contract-ts '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../test/utils @@ -3368,8 +3368,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../3-targets/postgres/1-target '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../test/utils @@ -3456,8 +3456,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../2-sql-family/2-authoring/contract-ts '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../test/utils @@ -3538,8 +3538,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../2-sql-family/2-authoring/contract-ts '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../test/utils @@ -3723,8 +3723,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../2-sql-family/2-authoring/contract-psl '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../test/utils @@ -4408,8 +4408,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../../../2-sql-family/1-core/schema-ir '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../../../test/utils @@ -4631,8 +4631,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../../../2-sql-family/1-core/schema-ir '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../../../test/utils @@ -4703,8 +4703,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../1-mysql/1-target '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../../../../test/utils @@ -6524,8 +6524,8 @@ importers: packages/9-public/@prisma/orm-toolchain: dependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/orm-framework': specifier: workspace:8.0.0-rc.24 version: link:../orm-framework @@ -6685,8 +6685,8 @@ importers: test/e2e/framework/test/fixtures: dependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/orm-extension-arktype-json': specifier: workspace:8.0.0-rc.24 version: link:../../../../../packages/9-public/@prisma/orm-extension-arktype-json @@ -6703,8 +6703,8 @@ importers: test/e2e/framework/test/sqlite/fixtures: dependencies: '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/orm-sqlite': specifier: workspace:8.0.0-rc.24 version: link:../../../../../../packages/9-public/@prisma/orm-sqlite @@ -6902,8 +6902,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../packages/0-shared/publish-surface '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@repo/test-utils': specifier: workspace:8.0.0-rc.24 version: link:../utils @@ -7034,8 +7034,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../../../../../packages/1-framework/0-foundation/utils '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/orm-extension-pgvector': specifier: workspace:8.0.0-rc.24 version: link:../../../../../../packages/9-public/@prisma/orm-extension-pgvector @@ -7109,8 +7109,8 @@ importers: specifier: workspace:8.0.0-rc.24 version: link:../../../../../../packages/1-framework/0-foundation/utils '@prisma/cli-engine': - specifier: 0.10.0 - version: 0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) + specifier: 0.10.2 + version: 0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4) '@prisma/orm-extension-pgvector': specifier: workspace:8.0.0-rc.24 version: link:../../../../../../packages/9-public/@prisma/orm-extension-pgvector @@ -8834,8 +8834,8 @@ packages: '@prisma/adapter-pg@7.10.1': resolution: {integrity: sha512-EP9ruPYHjKP80WZlb5qVaEXKgZjJieBFjAxcBtQnDAHD6+16UN4keVmBh6L/RUpuDQT2FQRbvKNgq5d4Ix+IkQ==} - '@prisma/cli-engine@0.10.0': - resolution: {integrity: sha512-GdeeXQg5dmlY5aBX+coqtO8AbUwszGL/Sa9z5NcRQkUKIS7hk4EBG8mhwZFN9dKOVwahw7e9dWfpM7skl2MyGg==} + '@prisma/cli-engine@0.10.2': + resolution: {integrity: sha512-P1y+9/nCiOUuCOfs2woMHWgXRqnETFjDQEjgawZvU9W/0kVmIO3E/rKNVMCXwDU+SJYx4m0H+o32qTmRN8blCw==} engines: {node: '>=22.12.0'} peerDependencies: '@prisma/management-api-sdk': ^1.55.0 @@ -12643,10 +12643,6 @@ packages: resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} engines: {node: '>=18'} - string-width@8.2.2: - resolution: {integrity: sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==} - engines: {node: '>=20'} - string-width@8.3.0: resolution: {integrity: sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==} engines: {node: '>=20'} @@ -14685,7 +14681,7 @@ snapshots: transitivePeerDependencies: - pg-native - '@prisma/cli-engine@0.10.0(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4)': + '@prisma/cli-engine@0.10.2(@prisma/management-api-sdk@1.76.0)(magicast@0.5.4)': dependencies: '@clack/prompts': 1.5.0 '@prisma/management-api-sdk': 1.76.0 @@ -14694,7 +14690,7 @@ snapshots: c12: 3.3.4(magicast@0.5.4) colorette: 2.0.20 package-manager-detector: 1.8.0 - string-width: 8.2.2 + string-width: 8.3.0 transitivePeerDependencies: - magicast @@ -18308,11 +18304,6 @@ snapshots: get-east-asian-width: 1.6.0 strip-ansi: 7.2.0 - string-width@8.2.2: - dependencies: - get-east-asian-width: 1.6.0 - strip-ansi: 7.2.0 - string-width@8.3.0: dependencies: get-east-asian-width: 1.6.0 diff --git a/projects/migration-statements/deferred.md b/projects/migration-statements/deferred.md index 748029761a9b..95614f75f7aa 100644 --- a/projects/migration-statements/deferred.md +++ b/projects/migration-statements/deferred.md @@ -60,7 +60,9 @@ Adding a required field to a populated collection, or making an optional field r **Found:** slice 2 manual QA (2026-10-08), F11. Engine side. -`CLI.CONSENT_REQUIRED` lists one `user-choice` next action per flag form ("Run the command again with --delete Legacy", another for the rename form), not grouped by subject and not a complete runnable command, and its summary says "N subjects need a statement", which is project vocabulary. Grouping the forms per subject and printing a full command would need the engine to know the invocation; raise it on prisma/prisma-cli once the statement prompt has shipped. +`CLI.CONSENT_REQUIRED` lists one `user-choice` next action per flag form ("Run the command again with --delete Legacy", another for the rename form), not grouped by subject and not a complete runnable command. Grouping the forms per subject and printing a full command would need the engine to know the invocation; raise it on prisma/prisma-cli once the statement prompt has shipped. + +Manual QA on 2026-11-23 met the cost: with two models removed, the error prints four "Run the command again with …" lines as if any one were enough. The user needs one choice per model, and following one line refuses again for the other model. ## SQL variants stored in their own tables @@ -158,6 +160,7 @@ Everything the prompt adapter (`packages/1-framework/3-tooling/cli/src/orm/plan- - The one-question-at-a-time mode (`askOneAtATime`), used when a question is about a removed namespace, so a typed `delete billing` answers the rest of the namespace and a typed `rename billing:finance` leaves them open for the next round. - `isConsentRequired`, which catches the engine's `CLI.CONSENT_REQUIRED` for one question and asks the engine again with every open question, so its refusal names them all. - The `undefined` answer that `AnswerPlanQuestions` may return beside a `rename` or `convert` answer, and the `InternalError` in `checkAnswers` that guards it. +- `ledByKeepDataWays`, which removes the ways to keep the data from the question text in the refusal's `why`, because it gives them first in the next actions. It goes once the engine's question has its own field for ways to keep the data, which the engine shows in the prompt and turns into next actions when it refuses. ## `SchemaTables` is asked about namespace ids of the origin contract @@ -462,15 +465,15 @@ No pair is made when the control policy is not `managed` on both sides, so the p **Found:** stored-name renames manual QA, 2026-11-18. -PostgreSQL labels a table rename `Rename table "Shop Front" to "Store Front"`, and SQLite labels the same rename `Rename table Shop Front to Store Front`; column renames are `Rename column "users"."x" to "y"` against `Rename column x on users to y`. A name with a space or punctuation is hard to read in the SQLite label, and docs that quote a label have to name the target. The SQLite labels are set in `packages/3-targets/sqlite/1-target/src/core/migrations/op-factory-call.ts` (`RenameTableCall`, `RenameColumnCall` and the other calls) and predate the stored-name renames. Quoting them changes the expected labels in about twenty test and journey files across the SQLite target and adapter packages and `test/integration`, so it was left out of that pull request. Quote every SQLite label as PostgreSQL does, in one pass over all calls. +PostgreSQL labels a table rename `Rename table "Shop Front" to "Store Front"`, and SQLite labels the same rename `Rename table Shop Front to Store Front`; column renames are `Rename column "users"."x" to "y"` against `Rename column x on users to y`. A name with a space or punctuation is hard to read in the SQLite label, and docs that quote a label have to name the target. The same holds inside questions: manual QA on 2026-11-23 met "Recreate table user would lose the values of field "User.name".", while a dropped table is quoted (`Drop table "comment"`). The SQLite labels are set in `packages/3-targets/sqlite/1-target/src/core/migrations/op-factory-call.ts` (`RenameTableCall`, `RenameColumnCall` and the other calls) and predate the stored-name renames. Quoting them changes the expected labels in about twenty test and journey files across the SQLite target and adapter packages and `test/integration`, so it was left out of that pull request. Quote every SQLite label as PostgreSQL does, in one pass over all calls. ## Three texts the stored-name renames QA found outside its scope **Found:** stored-name renames manual QA, 2026-11-18. -- **`CLI.CONSENT_UNUSED` for a statement a stored-name change no longer needs.** `prisma migration plan --name move --from --delete Shop`, where only `@@map` of `Shop` changed, prints `✘ [CLI.CONSENT_UNUSED] --delete Shop was given but nothing in this run asked about Shop.` and `→ Remove the flag, or spell the subject the way the command names it.` The second half points the user at how the subject is written, which is not the cause: the model keeps its name, so the plan renames its table and asks nothing. The text should say that nothing asked about the subject and to remove the flag, and leave out the advice about how it is written when the subject is a model or field of the contract. +- **`CLI.CONSENT_UNUSED` for a statement a stored-name change no longer needs.** `prisma migration plan --name move --from --delete Shop`, where only `@@map` of `Shop` changed, prints `✘ [CLI.CONSENT_UNUSED] --delete Shop was given but nothing in this run asked about Shop.` and `→ Remove the flag, or spell the subject the way the command names it.` The second half points the user at how the subject is written, which is not the cause: the model keeps its name, so the plan renames its table and asks nothing. The text should say that nothing asked about the subject and to remove the flag, and leave out the advice about how it is written when the subject is a model or field of the contract. Manual QA on 2026-11-23 met the same text for a mistyped `--delete Nope.field`, where the advice about how the subject is written does fit; that the typo is reported only after planning is recorded under "A mistyped `--delete` subject is reported only after planning, as a flag that answers no question". - **Model names carry `public.` in refusals.** On PostgreSQL, refusals name models with their namespace, as in `The table of model "public.Cat" changes from "cats" to "dogs", and the schema being planned from already has table "dogs", the table of model "public.Dog"`, while the statements a user types name the model as `Cat`. The namespace prefix of the default namespace should be left out, as statements leave it out. -- **The DDL preview leaves out value rewrites.** `prisma migration plan` for a change of an enum's stored value prints the operations `Drop check constraint "task_level_check_bc15f0e6" on "task"`, `Replace value 1 with 2 in column "level" of "task"` and `Add check constraint "task_level_check_1d419f4a" on "task"`, but its `DDL preview` lists only the two `ALTER TABLE … DROP CONSTRAINT` and `ADD CONSTRAINT` statements, not the `UPDATE` that rewrites the value. The preview should show every statement the migration runs, or say that it shows only DDL. +- **The DDL preview leaves out value rewrites.** `prisma migration plan` for a change of an enum's stored value prints the operations `Drop check constraint "task_level_check_bc15f0e6" on "task"`, `Replace value 1 with 2 in column "level" of "task"` and `Add check constraint "task_level_check_1d419f4a" on "task"`, but its `DDL preview` lists only the two `ALTER TABLE … DROP CONSTRAINT` and `ADD CONSTRAINT` statements, not the `UPDATE` that rewrites the value. Manual QA on 2026-11-23 met the same fault on SQLite: the preview of a table rebuild shows `CREATE TABLE "_prisma_new_user"`, `DROP TABLE "user"` and the rename, but not the `INSERT … SELECT` that copies the rows, so it reads as if every row is dropped, though the data is kept. The preview should show every statement the migration runs, or say that it shows only DDL. ## No planner sets `leaveOut` any more @@ -509,3 +512,105 @@ It needs a decision: reject a column that fields of different enums share when t The origin stores `User` in `users` with primary key `users_pkey`; the destination stores it in `app_users`. The database also has a table the contract lacks, `stale`, with an index named `app_users_pkey`. The plan is: rename table `users` to `app_users`, rename `users_pkey` to `app_users_pkey`, drop table `stale`. The apply fails with `relation "app_users_pkey" already exists`, because the drop that frees the name runs last. Nothing is lost: the migration is rolled back. A `--rename` statement gave the same plan before this slice. The constraint rename is a companion inside the `renameTable` call, and running `migration.ts` again rebuilds the companions inside `this.renameTable(...)`, so it cannot simply move later in the plan. Two fixes: run a drop of a table no rename touches before the renames, or write that companion as its own call after the drop. This is a second case of the limit recorded under "A SQLite column rename followed by a table rebuild builds the replacement index twice": operations carry no dependency information. Until then the user drops the stale table first. + +## A rename and a backfill of the same value object field are rightly refused, with a misleading message + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +A value object field is renamed from `GeoPoint.lat` to `GeoPoint.latitude`, through `migration plan`. The first error offers both flags as alternatives: "If it is a field renamed, add --rename GeoPoint.lat:GeoPoint.latitude. Otherwise add --backfill …". Giving both fails with "The field "GeoPoint.latitude" is already required in the origin contract, so every existing value has it". + +Refusing is right. `resolve-statements.ts` maps `latitude` back to `lat` through the rename, finds `lat` required in the origin contract, and refuses the backfill. After the rename every existing value has `latitude`, carrying the value of `lat`, so there is nothing to backfill. Only the wording is wrong: it names `GeoPoint.latitude` as if the origin contract had it and does not mention the rename. That wording falls short of the spec's requirement that such an error names "what was searched and what was found", because the origin contract has no `GeoPoint.latitude`. It should say that `--rename GeoPoint.lat:GeoPoint.latitude` keeps every value, so `--backfill GeoPoint.latitude` is not needed. Do not make the command accept both flags. "Statement errors say "rows" on MongoDB" quotes the same message, but only for its wording. + +## The first error for a new required value object field differs by command + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +For a value object field renamed from `GeoPoint.lat` to `GeoPoint.latitude`, `migration plan` first fails with "Migration planning failed" about the new required field, while `db update`, and `migration plan` on a model field, ask the question at once. So the same change gives a different first error depending on the command and on whether the field is in a model or a value object. Why `migration plan` needs `--backfill` here is explained under "A value object field has no default, so `--backfill` has none to respect"; the different first error is the new problem. + +## A rename with nothing to rename to is offered with `` + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +A removed model or value object field with nothing in the new contract to rename to is offered `--rename 'Comment:'` or `--rename 'GeoPoint.lng:GeoPoint.'`. The line cannot be run as printed, and run literally it fails with "has no field """. No name the user fills in can work either, because the new contract has nothing new to rename to. + +This breaks requirement 4 of the spec: "When a flag needs a new name that the user must choose, such as the new name of a renamed field, the error says so. The user copies a flag from the error, fills in any new name, and runs the command again." When nothing new exists, no new name the user fills in makes the printed rename run. + +## The error suggests a rename target, while the spec says the command never guesses + +**Found:** second-round review of the move to `@prisma/cli-engine` 0.10.2, 2026-11-23. This is an open question for Will, not a known defect. + +When exactly one new field, enum value or value object field could be the target, the refusal and the question fill it into the rename flag, for example `--rename GeoPoint.lat:GeoPoint.latitude`. For a model this happens only when the removed model is a variant and its base gained exactly one new variant; an ordinary model always gets ``. In every other case they print ``. The code is `renameForm` in `packages/1-framework/3-tooling/cli/src/control-api/statements/plan-questions.ts`; the Migration System subsystem doc describes it too. + +The spec says otherwise in four places. Its purpose says "The command never guesses what the user intended". Requirement 1 says "The planner never infers a rename, never asks whether a drop is one, and never reads intent from the contract." The second decision settled on 2026-10-05 says "There is no prompt that guesses whether a drop is a rename, and no detection of candidate pairs", and that "the rule is that nothing is guessed". The first non-goal says "no rename detection from matching columns or any other heuristic". Picking the only new field is a simple way to find a candidate pair. + +On the other side: nothing is renamed or dropped unless the user gives the flag or answers the question. The suggestion only fills in text the user would otherwise type, and the command acts on it only when the user runs it. + +Whether a suggestion printed in the error counts as guessing is undecided, and it is Will's to decide. If it does not, the spec's decision and non-goal need a dated amendment that says so. If it does, `renameForm` should always print ``. + +## A question the run cannot ask still says "If you answer delete" + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +When the run cannot ask, the question still says "If you answer delete, the existing objects get a temporary value …". There is nothing to answer; it should say "If you choose --delete GeoPoint.lat, …". The text comes from `plan-questions.ts`. + +## Value object locations are written as JSON paths and table names + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +Value object locations are written as JSON paths and table names, such as `at path "$[*]" in column "history" of "site"`, where the user knows `Site.history`; "of "site"" does not even say it is a table. The planning failure lists the same places in a different order from the question. + +## A mistyped `--delete` subject is reported only after planning, as a flag that answers no question + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1, whose first error said "--delete Nope.field does not name User.name."; the text quoted below is what 0.10.2 prints. + +A mistyped `--delete Nope.field` is reported only as "--delete Nope.field answers no question; the questions are about User.name.". After the user adds the right flag and keeps the typo, a second error says "Remove the flag, or spell the subject the way the command names it." A mistyped `--rename` target, by contrast, is rejected at once with a clear reason. The wording of the second error is covered under "Three texts the stored-name renames QA found outside its scope". + +The project's documents disagree about when this should be reported, and which one changes is undecided. + +- Requirement 5 of the spec says a typo like this fails before planning: "A coordinate that does not resolve in the contract it must resolve in, a rename whose new name already exists in the origin, a statement the control policy forbids, or a rename and convert statement with no origin contract: each fails before anything is planned, naming what was searched and what was found." `Nope.field` resolves in neither contract. +- The Migration System subsystem doc (`docs/architecture docs/subsystems/7. Migration System.md`, the paragraphs "The questions." and "Questions before an apply.") and the error reference (`docs/reference/error-reference.md`, `CLI.CONSENT_UNUSED`) describe the current order as the design. The planner asks one question per thing the plan would lose, and "a `--delete` or `--allow` that answers no question fails with `CLI.CONSENT_UNUSED`; both happen before anything is written or applied", that is, after planning. The error reference gives "a mistyped name" as an example. +- The reason for that order: a `--delete` value can name a table no model stores, such as `--delete billing.audit_log`. Such a table is known only once the plan has found it, so `--delete` values cannot all be resolved before planning. Resolving every `--delete` value up front would break those deletes. A second reason is in the doc comment on `resolveStatements`: `--delete` must work when there is no origin contract, which the spec also decides, and then there is nothing to resolve a model or field name against before planning. + +One way to reconcile them is to narrow the requirement so that `--delete` and `--allow` values are matched after planning. Another is to keep it and resolve before planning only `--delete` values written as a model or field name, leaving table names to be matched after planning, and only when an origin contract exists; then the subsystem doc and error reference need changing. Either way the first error should name the typo more clearly. + +## On SQLite a removed field's question names the table rebuild, not the user's change + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +On SQLite a removed field's question starts "Recreate table user would lose the values of field "User.name".". Recreating the table is how SQLite makes the change, not what the user did; the question should name the user's change, the removed field. The missing quotes around `user` are covered under "SQLite operation labels do not quote names". + +## Messages use project terms a user does not know + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +Messages use project terms a user does not know: "origin contract", "destination contract", "destination value object", "statement" (as in `Cannot resolve statement "--rename …"`), "postchecks already held", "contract space(s)", "self-emit", "attest the package". A user thinks of the old schema, the new schema and the `--rename` flag. The pass over the statement errors' wording asked for under "Statement errors say "rows" on MongoDB" should cover these terms too. + +## After a SQLite table rebuild, the applied summary is ungrammatical and counts a step that does nothing + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +After `--delete User.name` on SQLite, both commands say "Applied 1 of 2 operation(s) …; the other 1 had nothing to do, since their postchecks already held". "the other 1 … their" is ungrammatical. The user is also shown a `Drop column "name" from "user"` step that does nothing, because the table recreate already removed the column; the DDL preview shows the same extra `DROP COLUMN "name"`. The text is in `applied-summary.ts`. "A SQLite column rename followed by a table rebuild builds the replacement index twice" is a similar extra step after a rebuild. + +## After `db update`, the temporary-value warning says "instead" and names a hash + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +After `db update --delete User.name`, the warning about the temporary value says "To choose the value, plan a migration with prisma migration plan --from 33a42cee… --backfill User.displayName instead.". The update has already run, so "instead" comes too late, and the user does not know or easily check a 64-character hash. The text is in `migration-blocks.ts`. + +## Whether to keep `--yes` when running the printed line again is not said + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1, whose refusal under `--yes` said "You have to choose what happens, and --yes does not choose for you."; the problem holds with 0.10.2. + +Under `--yes` the 0.10.2 refusal says "This command requires explicit consent, and --yes does not give it.", which is clear. A user may wonder whether to keep `--yes` when running the printed line again; keeping it works. Minor. + +## In a terminal, `db update` prints each progress step twice + +**Found:** manual QA on SQLite, 2026-11-23, run as a user who knows their models and fields. The run used `@prisma/cli-engine` 0.10.1; the problem holds with 0.10.2. + +In a terminal, `db update` prints each progress step twice, as a `▸` line and then a `✔` line, so four lines come before the error. `migration plan` prints none. + +## The engine's refusal for `--confirm` begins with a different sentence + +**Found:** second-round review of the move to `@prisma/cli-engine` 0.10.2, 2026-11-23. + +Engine 0.10.2 changed the first line of the refusal for unanswered questions to "This command requires explicit consent, but it was not provided." The engine's other consent refusal, for a command that takes `--confirm` (`consentUnavailable` in the engine), still begins with the question, as in `"" requires explicit consent, and the session is not interactive.`, or `…, which --yes cannot grant.` under `--yes`. So the two refusals with the same code, `CLI.CONSENT_REQUIRED`, open with different sentences. With engine 0.10.0 both began with the quoted question; the move to 0.10.2 is what made them differ. The text is the engine's, so a change belongs in prisma/prisma-cli. diff --git a/projects/migration-statements/spec.md b/projects/migration-statements/spec.md index 6603c7b15683..a8b67cde6913 100644 --- a/projects/migration-statements/spec.md +++ b/projects/migration-statements/spec.md @@ -6,7 +6,12 @@ The migration planner diffs two states and cannot tell intent from the diff. A renamed model looks exactly like a dropped table plus a created one, and a removed model looks the same as one the user forgot. Today the planner plans the destruction and relies on a blanket consent prompt, or on a hand-written migration, to keep rows safe. Projects that use `db update` and keep no migration history cannot hand-write anything. -This project makes two things true. The planner refuses any operation that loses data unless the user has said what they mean about that operation. And the user says it on the command line, in the vocabulary of their contract, as a statement the planner acts on: a rename, a deletion, a conversion or a backfill. Nothing is inferred, nothing is asked, and nothing is written into the contract source. +This project makes two things true. + +1. **A command that would lose data stops first.** `migration plan` and `db update` stop before any change that would lose data, until the user has told the command what they intend. Dropping a table, dropping a column and changing a type in a way that loses values are examples. Removing an enum value or a value object field loses data too. +2. **The user tells it with a flag that uses the names in their contract.** `--rename Profile:User` means the model was renamed, so keep its rows. `--delete Legacy` means the model is gone, so drop its rows. `--convert User.age` and `--backfill User.email` say the user will write how the values change. The flags use the names in the user's contract: models, fields, enum values, value object fields and namespaces. A flag uses a table, collection or column name only for data that no model stores. + +The command never guesses what the user intended, and nothing about intent is written into the contract source. In a terminal the command asks. In a script it stops with an error that prints the flags. The spec and the code call such a flag a *statement*, and the error calls a missing one *explicit consent*, the term the CLI Style Guide uses for statements and consent tokens alike ([Destructive operation confirmation](../../docs/CLI%20Style%20Guide.md#destructive-operation-confirmation)). This is the second attempt. The first stated intent in the contract source with `@@hint(was:)` and was shelved on 2026-10-05 as unintuitive. Its planner substrate is reused; its contract section is not. @@ -24,15 +29,18 @@ $ prisma migration plan --name tidy-users --rename Profile:User --rename User.na Drop table "Legacy" destructive ``` -`migration.ts` carries `renameTable`, `renameColumn` and `dropTable` calls, the same file a user could write by hand. `prisma db update` with the same statements does the same against a live database. Without `--delete Legacy`, both commands refuse: +`migration.ts` carries `renameTable`, `renameColumn` and `dropTable` calls, the same file a user could write by hand. `prisma db update` with the same statements does the same against a live database. Without `--delete Legacy`, both commands refuse. In a terminal they ask instead; this is what a script sees: ```text -✖ The plan would lose data. State what you mean about each operation: - Table "Legacy" would be dropped and its rows lost. - To rename it: --rename Legacy: - To delete it: --delete Legacy +✘ [CLI.CONSENT_REQUIRED] This command requires explicit consent, but it was not provided. + why: Drop table "Legacy" would lose the data of model "Legacy". +→ Run the command again with --rename 'Legacy:' +→ Run the command again with --delete Legacy + docs: https://docs.prisma.io/docs/orm/v8/reference/error-reference/CLI.CONSENT_REQUIRED ``` +The `--rename 'Legacy:'` line cannot be run as printed: once `Profile:User` is taken, the new contract has no new model to rename `Legacy` to. This is recorded in [`deferred.md`](./deferred.md) under "A rename with nothing to rename to is offered with ``". + A type change gets the same treatment with its own statements: ```text @@ -83,7 +91,7 @@ The reasoning and the alternatives rejected are in [`design-notes.md`](./design- 1. **Statements are the only source of intent.** The planner never infers a rename, never asks whether a drop is one, and never reads intent from the contract. A change with no statement is planned as the diff shows it, and refused if that loses data. 2. **Contract vocabulary only.** A statement names namespaces, models, fields and values as the contract source names them. The framework resolves every coordinate against the origin and destination contracts before any family code runs; the family receives resolved entities, never names to look up. 3. **One statement surface, both commands.** `migration plan` and `db update` accept the same statements with the same meaning, and the plan a statement produces is the same whichever command ran it. `db update` obtains its origin contract from the marker hash through the snapshot store. -4. **Refusal names the way out.** When either command refuses, the error lists every destructive operation with the rename and delete statements that would resolve it, spelled exactly as the user would type them. In a terminal the same list is the consent question, asked per operation. +4. **When a command stops, its error prints the flags that let it continue.** For each thing that would lose data, the error says what would be lost and prints each flag that answers it, written exactly as the user would type it, such as `--delete Legacy`. When a flag needs a new name that the user must choose, such as the new name of a renamed field, the error says so. The user copies a flag from the error, fills in any new name, and runs the command again. In a terminal the command asks the same thing as a question, once for each thing that would lose data. 5. **An unusable statement is an error.** A coordinate that does not resolve in the contract it must resolve in, a rename whose new name already exists in the origin, a statement the control policy forbids, or a rename and convert statement with no origin contract: each fails before anything is planned, naming what was searched and what was found. Running the same statements twice fails the second time. 6. **Statements compose in order.** Each statement is applied to the working copy of the origin before the next is resolved, so `--rename Profile:User --rename User.name:User.fullName` is valid and the second statement uses the new table name. A swap is refused with a message. 7. **Same output as the hand-written route.** A plan produced from statements writes a `migration.ts` whose calls a user could have written by hand, and re-running that file reproduces `ops.json`. Statements are never recorded anywhere; the migration file is the record. diff --git a/test/e2e/framework/test/fixtures/package.json b/test/e2e/framework/test/fixtures/package.json index b187cf904c37..5dcee78a54ef 100644 --- a/test/e2e/framework/test/fixtures/package.json +++ b/test/e2e/framework/test/fixtures/package.json @@ -5,7 +5,7 @@ "version": "8.0.0-rc.24", "description": "The Postgres fixture of the e2e suite. Its own manifest because emission reads the nearest one to decide which package names generated files import, and this suite exercises two databases whose halves must not name each other's facade.", "dependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/orm-extension-arktype-json": "workspace:8.0.0-rc.24", "@prisma/orm-extension-pgvector": "workspace:8.0.0-rc.24", "@prisma/orm-postgres": "workspace:8.0.0-rc.24", diff --git a/test/e2e/framework/test/sqlite/fixtures/package.json b/test/e2e/framework/test/sqlite/fixtures/package.json index fee79cdab274..c5d6baf45993 100644 --- a/test/e2e/framework/test/sqlite/fixtures/package.json +++ b/test/e2e/framework/test/sqlite/fixtures/package.json @@ -5,7 +5,7 @@ "version": "8.0.0-rc.24", "description": "The SQLite fixture of the e2e suite. Its own manifest because emission reads the nearest one to decide which package names generated files import, and this suite exercises two databases whose halves must not name each other's facade.", "dependencies": { - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/orm-sqlite": "workspace:8.0.0-rc.24" } } diff --git a/test/integration/package.json b/test/integration/package.json index 936ada298501..55fa38a26a8a 100644 --- a/test/integration/package.json +++ b/test/integration/package.json @@ -89,7 +89,7 @@ "@internal/middleware-cache": "workspace:8.0.0-rc.24", "@internal/mongo-lowering": "workspace:8.0.0-rc.24", "@internal/publish-surface": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@repo/test-utils": "workspace:8.0.0-rc.24", "@repo/tsconfig": "workspace:8.0.0-rc.24", "@repo/tsdown": "workspace:8.0.0-rc.24", diff --git a/test/integration/test/cli-journeys/db-update-workflows.e2e.test.ts b/test/integration/test/cli-journeys/db-update-workflows.e2e.test.ts index 677ec11c8a7a..c3808e19232f 100644 --- a/test/integration/test/cli-journeys/db-update-workflows.e2e.test.ts +++ b/test/integration/test/cli-journeys/db-update-workflows.e2e.test.ts @@ -119,6 +119,7 @@ withTempDir(({ createTempDir }) => { expect(yesAlone.exitCode, 'E.04: --yes does not grant consent').toBe(2); expect(parseJsonOutput(yesAlone), 'E.04: consent error').toMatchObject({ code: 'CLI.CONSENT_REQUIRED', + summary: 'This command requires explicit consent, and --yes does not give it.', }); // E.05: db update --confirm — answers no question diff --git a/test/integration/test/cli-journeys/stored-name-chains-and-merges.e2e.test.ts b/test/integration/test/cli-journeys/stored-name-chains-and-merges.e2e.test.ts index dd950703ec64..efcb3876b43f 100644 --- a/test/integration/test/cli-journeys/stored-name-chains-and-merges.e2e.test.ts +++ b/test/integration/test/cli-journeys/stored-name-chains-and-merges.e2e.test.ts @@ -221,7 +221,7 @@ withTempDir(({ createTempDir }) => { ).toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'These operations would lose the data of model "Bug":\n- Drop table "bug"\n- Delete the rows of "task" that hold value "bug" in column "type"', nextActions: [ { kind: 'user-choice', label: 'Run the command again with --rename Bug:Defect' }, @@ -271,8 +271,7 @@ withTempDir(({ createTempDir }) => { expect(await refusal(journey, [], 'G2.03'), 'G2.03: the questions').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: - '2 subjects need a statement, and the session is not interactive: "Bug", "Task".', + summary: 'This command requires explicit consent, but it was not provided.', why: `Drop table "bug" would lose the data of model "Bug". ${MERGE_ADVICE}\nDrop table "task" would lose the data of model "Task". ${MERGE_ADVICE}`, nextActions: [ { kind: 'user-choice', label: 'Run the command again with --delete Bug' }, diff --git a/test/integration/test/cli-journeys/stored-name-chains-and-merges.sqlite.e2e.test.ts b/test/integration/test/cli-journeys/stored-name-chains-and-merges.sqlite.e2e.test.ts index 341828b01d72..ef8b49f2fa4c 100644 --- a/test/integration/test/cli-journeys/stored-name-chains-and-merges.sqlite.e2e.test.ts +++ b/test/integration/test/cli-journeys/stored-name-chains-and-merges.sqlite.e2e.test.ts @@ -195,7 +195,7 @@ withTempDir(({ createTempDir }) => { ).toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'These operations would lose the data of model "Bug":\n- Drop table "bug"\n- Delete the rows of "task" that hold value "bug" in column "type"', nextActions: [ { kind: 'user-choice', label: 'Run the command again with --rename Bug:Defect' }, @@ -243,8 +243,7 @@ withTempDir(({ createTempDir }) => { expect(await refusal(journey, [], 'G2.03'), 'G2.03: the questions').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: - '2 subjects need a statement, and the session is not interactive: "Bug", "Task".', + summary: 'This command requires explicit consent, but it was not provided.', why: `Drop table "bug" would lose the data of model "Bug". ${MERGE_ADVICE}\nDrop table "task" would lose the data of model "Task". ${MERGE_ADVICE}`, nextActions: [ { kind: 'user-choice', label: 'Run the command again with --delete Bug' }, diff --git a/test/integration/test/cli-journeys/stored-name-db-update.e2e.test.ts b/test/integration/test/cli-journeys/stored-name-db-update.e2e.test.ts index 12896bfb6bdb..b644592b758c 100644 --- a/test/integration/test/cli-journeys/stored-name-db-update.e2e.test.ts +++ b/test/integration/test/cli-journeys/stored-name-db-update.e2e.test.ts @@ -77,7 +77,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'D1.03: the question names User.nick').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"User.nick" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "nick" from "people" would lose the values of field "User.nick".', nextActions: [ { diff --git a/test/integration/test/cli-journeys/stored-name-db-update.sqlite.e2e.test.ts b/test/integration/test/cli-journeys/stored-name-db-update.sqlite.e2e.test.ts index 45debb22cd39..6f64026f506f 100644 --- a/test/integration/test/cli-journeys/stored-name-db-update.sqlite.e2e.test.ts +++ b/test/integration/test/cli-journeys/stored-name-db-update.sqlite.e2e.test.ts @@ -75,7 +75,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'D1.03: the question names User.nick').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"User.nick" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "nick" from "people" would lose the values of field "User.nick".', nextActions: [ { diff --git a/test/integration/test/cli-journeys/table-map-change.e2e.test.ts b/test/integration/test/cli-journeys/table-map-change.e2e.test.ts index a9ca20553570..ca9bd0b35938 100644 --- a/test/integration/test/cli-journeys/table-map-change.e2e.test.ts +++ b/test/integration/test/cli-journeys/table-map-change.e2e.test.ts @@ -165,7 +165,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'M4.03: the question names User.nick').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"User.nick" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "nick" from "people" would lose the values of field "User.nick".', nextActions: [ { diff --git a/test/integration/test/cli-journeys/table-map-change.sqlite.e2e.test.ts b/test/integration/test/cli-journeys/table-map-change.sqlite.e2e.test.ts index 8c6ca54edf3e..b2c248d35b69 100644 --- a/test/integration/test/cli-journeys/table-map-change.sqlite.e2e.test.ts +++ b/test/integration/test/cli-journeys/table-map-change.sqlite.e2e.test.ts @@ -96,7 +96,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'M2.03: the question names User.score').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"User.score" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: `Recreate table people would change the type of field "User.score" and can change or lose its values.${convert} --delete keeps the field and lets the database cast its values, which can change or lose some.`, nextActions: verbs.map((verb) => ({ kind: 'user-choice', @@ -167,7 +167,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'M4.03: the question names User.nick').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"User.nick" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "nick" from "people" would lose the values of field "User.nick".', nextActions: [ { diff --git a/test/integration/test/cli-journeys/value-object-statements.e2e.test.ts b/test/integration/test/cli-journeys/value-object-statements.e2e.test.ts index 5181b316c722..a9bc0f9b1d8b 100644 --- a/test/integration/test/cli-journeys/value-object-statements.e2e.test.ts +++ b/test/integration/test/cli-journeys/value-object-statements.e2e.test.ts @@ -215,8 +215,11 @@ withTempDir(({ createTempDir }) => { const asked = await refusal(ctx, via, 'O1.04'); if (via === 'db update') { - expect(asked, 'O1.04: one question, the rename offered').toContain( - '\\"GeoPoint.lat\\" needs a statement', + expect(asked, 'O1.04: the consent error').toContain( + '"summary":"This command requires explicit consent, but it was not provided."', + ); + expect(asked, 'O1.04: one question, about GeoPoint.lat').toContain( + '"unanswered":[{"subject":"GeoPoint.lat","verbs":["rename","delete"]}]', ); expect(asked, 'O1.04: what --delete leaves in the new field').toContain( 'the existing objects get a temporary value in the new required field \\"GeoPoint.latitude\\"', diff --git a/test/integration/test/cli-journeys/value-object-statements.mongo.e2e.test.ts b/test/integration/test/cli-journeys/value-object-statements.mongo.e2e.test.ts index 6ef76581bc04..9059a2dffea9 100644 --- a/test/integration/test/cli-journeys/value-object-statements.mongo.e2e.test.ts +++ b/test/integration/test/cli-journeys/value-object-statements.mongo.e2e.test.ts @@ -351,15 +351,17 @@ describe('Journeys (MongoDB): renames and removals inside value objects and embe summary: question?.summary, why: question?.why, answers: question?.nextActions?.map(({ label }) => label), + unanswered: question?.meta?.['unanswered'], }).toEqual({ exitCode: 'failed', code: 'CLI.CONSENT_REQUIRED', - summary: '"Address.zip" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Remove key "zip" at path "$" in field home of collection users would lose the values of value object field "Address.zip".', answers: [ "Run the command again with --rename 'Address.zip:Address.'", 'Run the command again with --delete Address.zip', ], + unanswered: [{ subject: 'Address.zip', verbs: ['rename', 'delete'] }], }); const answered = await runMigrationPlan(ctx, [ diff --git a/test/integration/test/cli-journeys/value-object-statements.sqlite.e2e.test.ts b/test/integration/test/cli-journeys/value-object-statements.sqlite.e2e.test.ts index bbd8226c6d1b..30570eec5176 100644 --- a/test/integration/test/cli-journeys/value-object-statements.sqlite.e2e.test.ts +++ b/test/integration/test/cli-journeys/value-object-statements.sqlite.e2e.test.ts @@ -203,8 +203,11 @@ withTempDir(({ createTempDir }) => { const asked = await refusal(ctx, via, 'O1.04'); if (via === 'db update') { - expect(asked, 'O1.04: one question, the rename offered').toContain( - '\\"GeoPoint.lat\\" needs a statement', + expect(asked, 'O1.04: the consent error').toContain( + '"summary":"This command requires explicit consent, but it was not provided."', + ); + expect(asked, 'O1.04: one question, about GeoPoint.lat').toContain( + '"unanswered":[{"subject":"GeoPoint.lat","verbs":["rename","delete"]}]', ); expect(asked, 'O1.04: what --delete leaves in the new field').toContain( 'the existing objects get a temporary value in the new required field \\"GeoPoint.latitude\\"', diff --git a/test/integration/test/cli-journeys/variant-storage-moves.e2e.test.ts b/test/integration/test/cli-journeys/variant-storage-moves.e2e.test.ts index 91fa639df119..7d5cf11f0abf 100644 --- a/test/integration/test/cli-journeys/variant-storage-moves.e2e.test.ts +++ b/test/integration/test/cli-journeys/variant-storage-moves.e2e.test.ts @@ -117,7 +117,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'J1.03: the question names Bug.severity').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug.severity" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "severity" from "task" would lose the values of field "Bug.severity".', nextActions: [ { @@ -168,7 +168,7 @@ withTempDir(({ createTempDir }) => { expect(askedBack, 'J1.07: the question names Bug').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop table "bug" would lose the data of model "Bug".', nextActions: [ { @@ -235,7 +235,7 @@ withTempDir(({ createTempDir }) => { ).toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'These operations would lose the data of model "Bug":\n- Drop column "severity" from "task"\n- Delete the rows of "task" that hold value "bug" in column "type"', nextActions: [ { diff --git a/test/integration/test/cli-journeys/variant-storage-moves.sqlite.e2e.test.ts b/test/integration/test/cli-journeys/variant-storage-moves.sqlite.e2e.test.ts index 5e94195ff64a..9b02e82cb8cb 100644 --- a/test/integration/test/cli-journeys/variant-storage-moves.sqlite.e2e.test.ts +++ b/test/integration/test/cli-journeys/variant-storage-moves.sqlite.e2e.test.ts @@ -112,7 +112,7 @@ withTempDir(({ createTempDir }) => { expect(asked, 'J1.03: the question names Bug.severity').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug.severity" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop column "severity" from "task" would lose the values of field "Bug.severity".', nextActions: [ { @@ -159,7 +159,7 @@ withTempDir(({ createTempDir }) => { expect(askedBack, 'J1.07: the question names Bug').toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'Drop table "bug" would lose the data of model "Bug".', nextActions: [ { @@ -224,7 +224,7 @@ withTempDir(({ createTempDir }) => { ).toEqual({ code: 'CLI.CONSENT_REQUIRED', severity: 'error', - summary: '"Bug" needs a statement, and the session is not interactive.', + summary: 'This command requires explicit consent, but it was not provided.', why: 'These operations would lose the data of model "Bug":\n- Drop column "severity" from "task"\n- Delete the rows of "task" that hold value "bug" in column "type"\nSQLite migrations run with foreign keys off, so deleting these rows does not delete the rows of "defect" that reference them: the apply then fails at PRAGMA foreign_key_check. Delete or change those rows first.', nextActions: [ { diff --git a/test/integration/test/fixtures/cli/cli-e2e-test-app/package.json b/test/integration/test/fixtures/cli/cli-e2e-test-app/package.json index 36bb94caa49e..5595a11e9e7f 100644 --- a/test/integration/test/fixtures/cli/cli-e2e-test-app/package.json +++ b/test/integration/test/fixtures/cli/cli-e2e-test-app/package.json @@ -19,7 +19,7 @@ "@internal/target-mongo": "workspace:8.0.0-rc.24", "@internal/target-postgres": "workspace:8.0.0-rc.24", "@internal/utils": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/orm-extension-pgvector": "workspace:8.0.0-rc.24", "@prisma/orm-mongo": "workspace:8.0.0-rc.24", "@prisma/orm-postgres": "workspace:8.0.0-rc.24", diff --git a/test/integration/test/fixtures/cli/cli-integration-test-app/package.json b/test/integration/test/fixtures/cli/cli-integration-test-app/package.json index 8f3abdc927dd..8d1399312b0a 100644 --- a/test/integration/test/fixtures/cli/cli-integration-test-app/package.json +++ b/test/integration/test/fixtures/cli/cli-integration-test-app/package.json @@ -20,7 +20,7 @@ "@internal/target-mongo": "workspace:8.0.0-rc.24", "@internal/target-postgres": "workspace:8.0.0-rc.24", "@internal/utils": "workspace:8.0.0-rc.24", - "@prisma/cli-engine": "0.10.0", + "@prisma/cli-engine": "0.10.2", "@prisma/orm-extension-pgvector": "workspace:8.0.0-rc.24", "@prisma/orm-mongo": "workspace:8.0.0-rc.24", "@prisma/orm-postgres": "workspace:8.0.0-rc.24", diff --git a/upgrade-instructions/pending/cli-engine-0-10-2/app/instructions.md b/upgrade-instructions/pending/cli-engine-0-10-2/app/instructions.md new file mode 100644 index 000000000000..3a767b17a62a --- /dev/null +++ b/upgrade-instructions/pending/cli-engine-0-10-2/app/instructions.md @@ -0,0 +1,35 @@ +--- +changes: + - id: engine-pin-moves-to-0-10-2 + summary: | + The toolchain now requires `@prisma/cli-engine@0.10.2` (up from 0.10.0). A project that depends on `@prisma/cli-engine` itself must move to `0.10.2`. + detection: + glob: "**/{package.json,pnpm-workspace.yaml}" + matches: + - '"@prisma/cli-engine":\s*"[^"]*(?]=?\s*)?0\.(?:\d|10\.[01])(?!\d)' + - id: consent-required-summary-names-no-subject + summary: | + When `prisma migration plan` or `prisma db update` cannot ask a statement question, the first line of `CLI.CONSENT_REQUIRED` is now one fixed sentence that names no subject. Code that matched the old first line must check the error's `code` and `meta.unanswered` instead. + detection: + glob: "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,snap,json,sh,bash,yml,yaml}" + matches: + - 'needs? a statement' + - '--yes cannot give' + - 'session is not interactive' +--- + +## `engine-pin-moves-to-0-10-2` + +For every file matched by `detection`, change the `@prisma/cli-engine` version (`0.10.1`, `0.10.0` or any earlier 0.x) to `0.10.2` and reinstall. Projects assembled by the `prisma` CLI resolve the engine automatically. + +## `consent-required-summary-names-no-subject` + +When `prisma migration plan` or `prisma db update` would lose data or change access, and the run cannot ask (it is not interactive, or `--yes` is set), it fails with `CLI.CONSENT_REQUIRED`. Only the first line (the `summary`) changed: + +- Before: `"User.nick" needs a statement, and the session is not interactive.`, or `2 subjects need a statement, and the session is not interactive: "Bug", "Task".` for several questions. Under `--yes`, the end of the line was `which --yes cannot give.` +- After: `This command requires explicit consent, but it was not provided.` Under `--yes`: `This command requires explicit consent, and --yes does not give it.` The sentence is the same for one question and for several. + +`why` (the questions), the next actions, `meta`, the code and the exit code (2) are unchanged. + +For every file matched by `detection`, stop matching the first line of this error. A match on `session is not interactive` needs a change only where it is for this error: the error for a missing `--confirm` still ends with those words. Branch on the error's `code` (`CLI.CONSENT_REQUIRED`) and read the unanswered subjects from `meta.unanswered` (each with its `subject` and `verbs`). diff --git a/upgrade-instructions/pending/cli-engine-0-10-2/extension/instructions.md b/upgrade-instructions/pending/cli-engine-0-10-2/extension/instructions.md new file mode 100644 index 000000000000..28dd15a4f61e --- /dev/null +++ b/upgrade-instructions/pending/cli-engine-0-10-2/extension/instructions.md @@ -0,0 +1,35 @@ +--- +changes: + - id: engine-pin-moves-to-0-10-2 + summary: | + The toolchain now peers `@prisma/cli-engine@0.10.2` (up from 0.10.0). An extension package that depends on `@prisma/cli-engine` for its tests or tooling must move to `0.10.2`. + detection: + glob: "**/{package.json,pnpm-workspace.yaml}" + matches: + - '"@prisma/cli-engine":\s*"[^"]*(?]=?\s*)?0\.(?:\d|10\.[01])(?!\d)' + - id: consent-required-summary-names-no-subject + summary: | + When `prisma migration plan` or `prisma db update` cannot ask a statement question, the first line of `CLI.CONSENT_REQUIRED` is now one fixed sentence that names no subject. Code that matched the old first line must check the error's `code` and `meta.unanswered` instead. + detection: + glob: "**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,snap,json,sh,bash,yml,yaml}" + matches: + - 'needs? a statement' + - '--yes cannot give' + - 'session is not interactive' +--- + +## `engine-pin-moves-to-0-10-2` + +For every file matched by `detection`, change the `@prisma/cli-engine` version (`0.10.1`, `0.10.0` or any earlier 0.x) to `0.10.2` and reinstall. + +## `consent-required-summary-names-no-subject` + +When `prisma migration plan` or `prisma db update` would lose data or change access, and the run cannot ask (it is not interactive, or `--yes` is set), it fails with `CLI.CONSENT_REQUIRED`. Only the first line (the `summary`) changed: + +- Before: `"User.nick" needs a statement, and the session is not interactive.`, or `2 subjects need a statement, and the session is not interactive: "Bug", "Task".` for several questions. Under `--yes`, the end of the line was `which --yes cannot give.` +- After: `This command requires explicit consent, but it was not provided.` Under `--yes`: `This command requires explicit consent, and --yes does not give it.` The sentence is the same for one question and for several. + +`why` (the questions), the next actions, `meta`, the code and the exit code (2) are unchanged. + +For every file matched by `detection`, stop matching the first line of this error. A match on `session is not interactive` needs a change only where it is for this error: the error for a missing `--confirm` still ends with those words. Branch on the error's `code` (`CLI.CONSENT_REQUIRED`) and read the unanswered subjects from `meta.unanswered` (each with its `subject` and `verbs`).