diff --git a/packages/cli/src/databases/migrations/common/1726218295879-SeparateExecutionCreationFromStart.ts b/packages/cli/src/databases/migrations/common/1726218295879-SeparateExecutionCreationFromStart.ts index 60dff74bb4..2ef3d74d52 100644 --- a/packages/cli/src/databases/migrations/common/1726218295879-SeparateExecutionCreationFromStart.ts +++ b/packages/cli/src/databases/migrations/common/1726218295879-SeparateExecutionCreationFromStart.ts @@ -13,9 +13,11 @@ export class SeparateExecutionCreationFromStart1726218295879 implements Reversib await dropNotNull('execution_entity', 'startedAt'); const executionEntity = escape.tableName('execution_entity'); + const createdAt = escape.columnName('createdAt'); + const startedAt = escape.columnName('startedAt'); // inaccurate for pre-migration rows but prevents `createdAt` from being nullable - await runQuery(`UPDATE ${executionEntity} SET createdAt = startedAt;`); + await runQuery(`UPDATE ${executionEntity} SET ${createdAt} = ${startedAt};`); } async down({ schemaBuilder: { dropColumns, addNotNull } }: MigrationContext) {