Update boolean command to update existing null values (#6198)

as per title
This commit is contained in:
Marie
2024-07-10 13:09:44 +02:00
committed by GitHub
parent c182bff3d8
commit ef5657c353

View File

@ -130,6 +130,10 @@ export class UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand extends Co
const fieldName = booleanField.name;
const tableName = computeObjectTargetTable(booleanField.object);
await workspaceQueryRunner.query(
`UPDATE "${dataSourceMetadata.schema}"."${tableName}" SET "${fieldName}" = 'false' WHERE "${fieldName}" IS NULL`,
);
await workspaceQueryRunner.query(
`ALTER TABLE "${dataSourceMetadata.schema}"."${tableName}" ALTER COLUMN "${fieldName}" SET DEFAULT false;`,
);