Browse Source

fix: missing source_id and base_id in bulk column insert

pull/7477/head
Pranav C 10 months ago
parent
commit
e325e69d4b
  1. 16
      packages/nocodb/src/models/Column.ts

16
packages/nocodb/src/models/Column.ts

@ -1347,12 +1347,15 @@ export default class Column<T = any> implements ColumnType {
for (const column of param.columns) { for (const column of param.columns) {
// pre-populate column meta to use while inserting colOptions // pre-populate column meta to use while inserting colOptions
const id = await ncMeta.genNanoid(MetaTable.COLUMNS); const id = await ncMeta.genNanoid(MetaTable.COLUMNS);
columns.push({ const colWithId = {
...column, ...column,
id, id,
}); base_id: param.base_id,
extractedColumnMetas.push({ source_id: param.source_id,
...extractProps(column as any, [ fk_model_id: param.fk_model_id,
};
extractedColumnMetas.push(
extractProps(colWithId as any, [
'id', 'id',
'fk_model_id', 'fk_model_id',
'column_name', 'column_name',
@ -1383,9 +1386,8 @@ export default class Column<T = any> implements ColumnType {
'system', 'system',
'meta', 'meta',
]), ]),
id, );
fk_model_id: param.fk_model_id, columns.push(colWithId);
});
} }
// bulk insert columns // bulk insert columns

Loading…
Cancel
Save