diff --git a/packages/nocodb/src/models/Column.ts b/packages/nocodb/src/models/Column.ts index 852f5eb8d0..ede9becbf2 100644 --- a/packages/nocodb/src/models/Column.ts +++ b/packages/nocodb/src/models/Column.ts @@ -153,6 +153,13 @@ export default class Column implements ColumnType { if (insertObj.meta && typeof insertObj.meta === 'object') { insertObj.meta = JSON.stringify(insertObj.meta); } + + insertObj.order = + column.order ?? + (await ncMeta.metaGetNextOrder(MetaTable.COLUMNS, { + fk_model_id: column.fk_model_id, + })); + if (column.validate) { if (typeof column.validate === 'string') insertObj.validate = column.validate;