From 1a21215eb559df7e37a7928434b56ec84c9d4632 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 28 Jun 2023 12:31:38 +0530 Subject: [PATCH] fix: do index creation only if relation found Signed-off-by: Pranav C --- .../version-upgrader/ncXcdbLTARUpgrader.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts index 962d8dab64..66f16d4c37 100644 --- a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts @@ -77,17 +77,17 @@ async function upgradeModelRelations({ childTable: relation.tn, foreignKeyName: relation.cstn, }); - } - // skip postgres since we were already creating the index while creating the relation - if (ncMeta.knex.clientType() !== 'pg') { - // create a new index for the column - const indexArgs = { - columns: [relation.cn], - tn: relation.tn, - non_unique: true, - }; - await sqlClient.indexCreate(indexArgs); + // skip postgres since we were already creating the index while creating the relation + if (ncMeta.knex.clientType() !== 'pg') { + // create a new index for the column + const indexArgs = { + columns: [relation.cn], + tn: relation.tn, + non_unique: true, + }; + await sqlClient.indexCreate(indexArgs); + } } } break;