From 174ba56b0fa410555c5be29517b4056fcb3f7bcc Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 13 Feb 2023 18:21:00 +0530 Subject: [PATCH] fix: use cstn for getting foreign key name Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts b/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts index 3c28af50e5..8e5f9d2928 100644 --- a/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts +++ b/packages/nocodb/src/lib/meta/api/helpers/populateMeta.ts @@ -5,7 +5,9 @@ import NcHelp from '../../../utils/NcHelp'; import Base from '../../../models/Base'; import View from '../../../models/View'; import NcConnectionMgrv2 from '../../../utils/common/NcConnectionMgrv2'; -import getTableNameAlias, { getColumnNameAlias } from '../../helpers/getTableName'; +import getTableNameAlias, { + getColumnNameAlias, +} from '../../helpers/getTableName'; import LinkToAnotherRecordColumn from '../../../models/LinkToAnotherRecordColumn'; import getColumnUiType from '../../helpers/getColumnUiType'; import mapDefaultPrimaryValue from '../../helpers/mapDefaultPrimaryValue'; @@ -179,7 +181,7 @@ export async function populateMeta(base: Base, project: Project): Promise { // column_id, fk_child_column_id: rel_column_id, fk_parent_column_id: ref_rel_column_id, - fk_index_name: rel.fkn, + fk_index_name: rel.cstn, ur: rel.ur, dr: rel.dr, order: colOrder++, @@ -259,7 +261,7 @@ export async function populateMeta(base: Base, project: Project): Promise { const models = await Model.list({ project_id: project.id, base_id: base.id }); for (const model of models) { - const views = await model.getViews() + const views = await model.getViews(); for (const view of views) { if (view.type === ViewTypes.GRID) { await View.fixPVColumnForView(view.id);