|
|
@ -1216,6 +1216,7 @@ export class ColumnsService { |
|
|
|
childColumn: mmParentCol, |
|
|
|
childColumn: mmParentCol, |
|
|
|
base, |
|
|
|
base, |
|
|
|
ncMeta, |
|
|
|
ncMeta, |
|
|
|
|
|
|
|
virtual: !!relationColOpt.virtual, |
|
|
|
}, |
|
|
|
}, |
|
|
|
true, |
|
|
|
true, |
|
|
|
); |
|
|
|
); |
|
|
@ -1230,6 +1231,7 @@ export class ColumnsService { |
|
|
|
childColumn: mmChildCol, |
|
|
|
childColumn: mmChildCol, |
|
|
|
base, |
|
|
|
base, |
|
|
|
ncMeta, |
|
|
|
ncMeta, |
|
|
|
|
|
|
|
virtual: !!relationColOpt.virtual, |
|
|
|
}, |
|
|
|
}, |
|
|
|
true, |
|
|
|
true, |
|
|
|
); |
|
|
|
); |
|
|
@ -1387,6 +1389,7 @@ export class ColumnsService { |
|
|
|
parentTable, |
|
|
|
parentTable, |
|
|
|
sqlMgr, |
|
|
|
sqlMgr, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
ncMeta = Noco.ncMeta, |
|
|
|
|
|
|
|
virtual, |
|
|
|
}: { |
|
|
|
}: { |
|
|
|
relationColOpt: LinkToAnotherRecordColumn; |
|
|
|
relationColOpt: LinkToAnotherRecordColumn; |
|
|
|
base: Base; |
|
|
|
base: Base; |
|
|
@ -1396,6 +1399,7 @@ export class ColumnsService { |
|
|
|
parentTable: Model; |
|
|
|
parentTable: Model; |
|
|
|
sqlMgr: SqlMgrv2; |
|
|
|
sqlMgr: SqlMgrv2; |
|
|
|
ncMeta?: MetaService; |
|
|
|
ncMeta?: MetaService; |
|
|
|
|
|
|
|
virtual?: boolean; |
|
|
|
}, |
|
|
|
}, |
|
|
|
ignoreFkDelete = false, |
|
|
|
ignoreFkDelete = false, |
|
|
|
) => { |
|
|
|
) => { |
|
|
@ -1424,7 +1428,7 @@ export class ColumnsService { |
|
|
|
foreignKeyName = relationColOpt.fk_index_name; |
|
|
|
foreignKeyName = relationColOpt.fk_index_name; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!relationColOpt?.virtual) { |
|
|
|
if (!relationColOpt?.virtual && !virtual) { |
|
|
|
// todo: handle relation delete exception
|
|
|
|
// todo: handle relation delete exception
|
|
|
|
try { |
|
|
|
try { |
|
|
|
await sqlMgr.sqlOpPlus(base, 'relationDelete', { |
|
|
|
await sqlMgr.sqlOpPlus(base, 'relationDelete', { |
|
|
@ -1435,7 +1439,7 @@ export class ColumnsService { |
|
|
|
foreignKeyName, |
|
|
|
foreignKeyName, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log(e); |
|
|
|
console.log(e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1481,7 +1485,7 @@ export class ColumnsService { |
|
|
|
if (index.cn !== childColumn.column_name) continue; |
|
|
|
if (index.cn !== childColumn.column_name) continue; |
|
|
|
|
|
|
|
|
|
|
|
await sqlMgr.sqlOpPlus(base, 'indexDelete', { |
|
|
|
await sqlMgr.sqlOpPlus(base, 'indexDelete', { |
|
|
|
...index, |
|
|
|
...index, |
|
|
|
tn: cTable.table_name, |
|
|
|
tn: cTable.table_name, |
|
|
|
columns: [childColumn.column_name], |
|
|
|
columns: [childColumn.column_name], |
|
|
|
indexName: index.index_name, |
|
|
|
indexName: index.index_name, |
|
|
|