From 192663c94afc69831cd5b195aa39158691eda9e8 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 1 Jun 2022 09:36:28 +0100 Subject: [PATCH] Revert "primaryKey name fix" This reverts commit 9c408fda9c8f8c02f77b070803cf35350e853667. --- packages/server/src/integrations/snowflake.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index e82b796a59..950c1009ec 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -112,9 +112,15 @@ module SnowflakeModule { const descResp = await this.internalQuery({ sql: `DESCRIBE TABLE ${tableName};`, }) + if (tableName === "CUSTOMER") { + console.log("DESC = ", descResp) + } for (let column of descResp) { - const columnName = column.name - if (column["primary key"] === "Y") { + const columnName = column.Field + if ( + column["primary key"] === "Y" && + primaryKeys.indexOf(column.Key) === -1 + ) { primaryKeys.push(columnName) } const constraints = {