Browse Source

refactor: for xcdb make relation virtual

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/reset-fail
Pranav C 2 years 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 }); 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 // ignore relation creation if virtual
if (!(param.column as LinkToAnotherColumnReqType).virtual) { if (!(param.column as LinkToAnotherColumnReqType).virtual) {
foreignKeyName = generateFkName(parent, child); foreignKeyName = generateFkName(parent, child);
@ -1570,7 +1575,7 @@ export class ColumnsService {
} }
// todo: create index for virtual relations as well // todo: create index for virtual relations as well
// create index for foreign key in pg // create index for foreign key in pg
if ( if (
param.base.type === 'pg' || param.base.type === 'pg' ||
(param.column as LinkToAnotherColumnReqType).virtual (param.column as LinkToAnotherColumnReqType).virtual

Loading…
Cancel
Save