Browse Source

fix: skip index creation for postgres

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5816/head
Pranav C 1 year ago
parent
commit
4707611093
  1. 17
      packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts

17
packages/nocodb/src/version-upgrader/ncXcdbLTARUpgrader.ts

@ -77,13 +77,16 @@ async function upgradeModelRelations({
});
}
// 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