Browse Source

refactor: for xcdb make relation virtual

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/reset-fail
Pranav C 1 year ago
parent
commit
d9bd216bae
  1. 7
      packages/nocodb/src/services/columns.service.ts

7
packages/nocodb/src/services/columns.service.ts

@ -1553,6 +1553,11 @@ export class ColumnsService {
childColumn = await Column.get({ colId: id });
// if xcdb base then treat as virtual relation to avoid creating foreign key
if (param.base.is_meta) {
(param.column as LinkToAnotherColumnReqType).virtual = true;
}
// ignore relation creation if virtual
if (!(param.column as LinkToAnotherColumnReqType).virtual) {
foreignKeyName = generateFkName(parent, child);
@ -1570,7 +1575,7 @@ export class ColumnsService {
}
// todo: create index for virtual relations as well
// create index for foreign key in pg
// create index for foreign key in pg
if (
param.base.type === 'pg' ||
(param.column as LinkToAnotherColumnReqType).virtual

Loading…
Cancel
Save