From be8cd07cdcbf57b0cf971c924b341f32a7ee6a2e 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 fcdc2bf5849e29bcfc8d23055bcb6f75e112d038. --- 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 = {