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