From fcdc2bf5849e29bcfc8d23055bcb6f75e112d038 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Tue, 31 May 2022 14:47:27 +0100 Subject: [PATCH] primaryKey name fix --- packages/server/src/integrations/snowflake.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/server/src/integrations/snowflake.ts b/packages/server/src/integrations/snowflake.ts index 950c1009ec..e82b796a59 100644 --- a/packages/server/src/integrations/snowflake.ts +++ b/packages/server/src/integrations/snowflake.ts @@ -112,15 +112,9 @@ 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.Field - if ( - column["primary key"] === "Y" && - primaryKeys.indexOf(column.Key) === -1 - ) { + const columnName = column.name + if (column["primary key"] === "Y") { primaryKeys.push(columnName) } const constraints = {