Browse Source

fix: handle if column missing

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5816/head
Pranav C 1 year ago
parent
commit
0da392e450
  1. 15
      packages/nocodb/src/services/tables.service.ts

15
packages/nocodb/src/services/tables.service.ts

@ -182,22 +182,25 @@ export class TablesService {
let result; let result;
try { try {
// delete all relations // delete all relations
await Promise.all( for (const c of relationColumns) {
relationColumns.map((c) => {
// skip if column is hasmany relation to mm table // skip if column is hasmany relation to mm table
if (c.system) { if (c.system) {
return; continue;
} }
return this.columnsService.columnDelete( // verify column exist or not and based on that delete the column
if (!(await Column.get({ colId: c.id }))) {
continue;
}
await this.columnsService.columnDelete(
{ {
req: param.req, req: param.req,
columnId: c.id, columnId: c.id,
}, },
ncMeta, ncMeta,
); );
}), }
);
const sqlMgr = await ProjectMgrv2.getSqlMgr(project, ncMeta); const sqlMgr = await ProjectMgrv2.getSqlMgr(project, ncMeta);
(table as any).tn = table.table_name; (table as any).tn = table.table_name;

Loading…
Cancel
Save