diff --git a/packages/nocodb/src/helpers/populateMeta.ts b/packages/nocodb/src/helpers/populateMeta.ts index 9e90114430..6e84659c59 100644 --- a/packages/nocodb/src/helpers/populateMeta.ts +++ b/packages/nocodb/src/helpers/populateMeta.ts @@ -1,5 +1,6 @@ import { ModelTypes, UITypes, ViewTypes } from 'nocodb-sdk'; import { isVirtualCol, RelationTypes } from 'nocodb-sdk'; +import { pluralize, singularize } from 'inflection'; import { GridViewColumn } from '../models'; import Column from '../models/Column'; import Model from '../models/Model'; @@ -465,15 +466,19 @@ export async function populateRollupColumnAndHideLTAR( relatedModel.primaryKey?.id || (await relatedModel.getColumns())[0]?.id; await Column.insert({ - uidt: 'Rollup', + uidt: UITypes.Links, title: getUniqueColumnAliasName( await model.getColumns(), - `${relatedModel.title} Count`, + `${relatedModel.title}`, ), fk_rollup_column_id: pkId, fk_model_id: model.id, rollup_function: 'count', fk_relation_column_id: column.id, + meta: { + singular: singularize(relatedModel.title), + plural: pluralize(relatedModel.title), + }, }); const viewCol = await GridViewColumn.list(views[0].id).then((cols) =>