diff --git a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts index 962d8dab64..1f667a1789 100644 --- a/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts +++ b/packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts @@ -44,6 +44,11 @@ async function upgradeModelRelations({ ncMeta, ); + // if colOptions not found then skip + if (!colOptions) { + continue; + } + switch (colOptions.type) { case RelationTypes.HAS_MANY: { @@ -77,17 +82,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;