|
|
|
@ -228,8 +228,8 @@ export class TablesService {
|
|
|
|
|
} else { |
|
|
|
|
// if table is using in custom relation as junction table then delete all the relation
|
|
|
|
|
const relations = await Noco.ncMeta.metaList2( |
|
|
|
|
null, |
|
|
|
|
null, |
|
|
|
|
table.fk_workspace_id, |
|
|
|
|
table.base_id, |
|
|
|
|
MetaTable.COL_RELATIONS, |
|
|
|
|
{ |
|
|
|
|
condition: { |
|
|
|
@ -239,8 +239,10 @@ export class TablesService {
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (relations.length) { |
|
|
|
|
const relCol = await Column.get(context, { colId: relations[0].fk_column_id }); |
|
|
|
|
const relTable = await Model.get(context,relCol.fk_model_id); |
|
|
|
|
const relCol = await Column.get(context, { |
|
|
|
|
colId: relations[0].fk_column_id, |
|
|
|
|
}); |
|
|
|
|
const relTable = await Model.get(context, relCol.fk_model_id); |
|
|
|
|
NcError.tableAssociatedWithLink(table.id, { |
|
|
|
|
customMessage: `This is a many to many table for '${relTable?.title}' (${relTable?.title}), please delete the column before deleting the table.`, |
|
|
|
|
}); |
|
|
|
|