Browse Source

fix: do index creation only if relation found

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5980/head
Pranav C 2 years ago
parent
commit
1a21215eb5
  1. 20
      packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts

20
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;

Loading…
Cancel
Save