Skip to content

Commit 41418eb

Browse files
fix(target-postgres): RenameIndexCall.toOp uses the structured control-stack-missing error
TML-3091 converted every sibling toOp lowerer guard to postgresError('MIGRATION.POSTGRES_CONTROL_STACK_MISSING', ...); the rename call, added on this branch, follows the same convention. Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
1 parent e008266 commit 41418eb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/3-targets/3-targets/postgres/src/core/migrations/op-factory-call.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,8 +1264,10 @@ export class RenameIndexCall extends PostgresOpFactoryCallNode {
12641264

12651265
async toOp(lowerer?: ExecuteRequestLowerer): Promise<Op> {
12661266
if (lowerer === undefined) {
1267-
throw new Error(
1267+
throw postgresError(
1268+
'MIGRATION.POSTGRES_CONTROL_STACK_MISSING',
12681269
`RenameIndexCall.toOp: a lowerer is required on the Postgres planner path (index "${this.oldIndexName}" on table "${this.tableName}"). Pass the control adapter to createPostgresMigrationPlanner.`,
1270+
{ meta: { factory: 'RenameIndexCall' } },
12691271
);
12701272
}
12711273
return renameIndex(

0 commit comments

Comments
 (0)