From bf51e3375c80ab9cd7e1982dddb4b1aabfb7a5ec Mon Sep 17 00:00:00 2001 From: "me@rodrigorodriguez.com" Date: Thu, 17 Oct 2024 16:33:43 -0300 Subject: [PATCH] new(core.gbapp): LLM alerts for data. --- packages/basic.gblib/services/SystemKeywords.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/basic.gblib/services/SystemKeywords.ts b/packages/basic.gblib/services/SystemKeywords.ts index f7c01248..462e7e94 100644 --- a/packages/basic.gblib/services/SystemKeywords.ts +++ b/packages/basic.gblib/services/SystemKeywords.ts @@ -2952,6 +2952,7 @@ export class SystemKeywords { // Create a schema object for SQLite const schema = {}; + let pkAdded = false; Object.keys(columns).forEach(col => { const columnType = columns[col].type; @@ -2961,8 +2962,9 @@ export class SystemKeywords { }; // If the column is named 'id' or 'Id', set it as the primary key - if (col.toLowerCase() === 'id' || col.toLowerCase() === 'internal_id') { + if (! pkAdded && (col.toLowerCase() === 'id' || col.toLowerCase() === 'internal_id')) { schema[col].primaryKey = true; + pkAdded = true; } });