diff --git a/apps/nestjs-backend/src/features/field/open-api/field-open-api.service.ts b/apps/nestjs-backend/src/features/field/open-api/field-open-api.service.ts index 7ec0a300c..a712b18dc 100644 --- a/apps/nestjs-backend/src/features/field/open-api/field-open-api.service.ts +++ b/apps/nestjs-backend/src/features/field/open-api/field-open-api.service.ts @@ -241,13 +241,15 @@ export class FieldOpenApiService { await this.fieldCalculationService.calculateFields(tableId, [field.id]); await this.fieldService.resolvePending(tableId, [field.id]); } - // create index after write data - await this.tableIndexService.createSearchFieldSingleIndex(tableId, fieldInstance); } }, { timeout: this.thresholdConfig.bigTransactionTimeout } ); + for (const { tableId, field } of newFields) { + await this.tableIndexService.createSearchFieldSingleIndex(tableId, field); + } + const referenceMap = await this.getFieldReferenceMap([fieldVo.id]); this.eventEmitterService.emitAsync(Events.OPERATION_FIELDS_CREATE, {