|
|
|
@ -937,6 +937,7 @@ export class ColumnsService {
|
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case UITypes.Links: |
|
|
|
|
case UITypes.LinkToAnotherRecord: |
|
|
|
|
await this.createLTARColumn({ ...param, base, project }); |
|
|
|
|
T.emit('evt', { evt_type: 'relation:created' }); |
|
|
|
@ -1566,6 +1567,7 @@ export class ColumnsService {
|
|
|
|
|
const sqlMgr = await ProjectMgrv2.getSqlMgr({ |
|
|
|
|
id: param.base.project_id, |
|
|
|
|
}); |
|
|
|
|
const isLinks = param.column.uidt === UITypes.Links; |
|
|
|
|
|
|
|
|
|
// if xcdb base then treat as virtual relation to avoid creating foreign key
|
|
|
|
|
if (param.base.is_meta) { |
|
|
|
@ -1667,6 +1669,8 @@ export class ColumnsService {
|
|
|
|
|
foreignKeyName, |
|
|
|
|
(param.column as LinkToAnotherColumnReqType).virtual, |
|
|
|
|
param.column['meta'], |
|
|
|
|
null, |
|
|
|
|
isLinks, |
|
|
|
|
); |
|
|
|
|
} else if ((param.column as LinkToAnotherColumnReqType).type === 'mm') { |
|
|
|
|
const aTn = `${param.project?.prefix ?? ''}_nc_m2m_${randomID()}`; |
|
|
|
@ -1808,7 +1812,9 @@ export class ColumnsService {
|
|
|
|
|
const col2 = await Column.insert({ |
|
|
|
|
title: getUniqueColumnAliasName( |
|
|
|
|
await parent.getColumns(), |
|
|
|
|
param.column.title ?? `${child.title} List`, |
|
|
|
|
isLinks |
|
|
|
|
? `${param.column.title} List` |
|
|
|
|
: param.column.title ?? `${child.title} List`, |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
uidt: UITypes.LinkToAnotherRecord, |
|
|
|
@ -1833,6 +1839,7 @@ export class ColumnsService {
|
|
|
|
|
await populateRollupForLTAR({ |
|
|
|
|
column: col2, |
|
|
|
|
columnMeta: param.column['meta'], |
|
|
|
|
alias: param.column.title, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// todo: create index for virtual relations as well
|
|
|
|
|