diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index d29b9feede..b12bcd423e 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -23698,7 +23698,7 @@ "title": "Normal Column Request Model", "type": "object", "required": [ - "column_name" + "title" ], "x-stoplight": { "id": "fn3gqmojvswv2" diff --git a/packages/nocodb/src/services/columns.service.ts b/packages/nocodb/src/services/columns.service.ts index 923f4eee17..e79f74df63 100644 --- a/packages/nocodb/src/services/columns.service.ts +++ b/packages/nocodb/src/services/columns.service.ts @@ -16,6 +16,7 @@ import { } from 'nocodb-sdk'; import { pluralize, singularize } from 'inflection'; import hash from 'object-hash'; +import { parseMetaProp } from 'src/utils/modelUtils'; import type { ColumnReqType, LinkToAnotherColumnReqType, @@ -65,7 +66,6 @@ import Noco from '~/Noco'; import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; import { MetaTable } from '~/utils/globals'; import { MetaService } from '~/meta/meta.service'; -import { parseMetaProp } from 'src/utils/modelUtils'; // todo: move export enum Altered { @@ -1674,6 +1674,11 @@ export class ColumnsService { param.column.title = param.column.title.trim(); } + // if column_name missing then generate it from title + if (!param.column.column_name) { + param.column.column_name = param.column.title; + } + if (param.column.column_name) { // - 5 is a buffer for suffix let colName = param.column.column_name.slice(0, mxColumnLength - 5);