From f2abcf581f586197a309d2ef8769ac2cec1f4744 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 26 Jul 2023 12:31:46 +0100 Subject: [PATCH 1/5] Fixing issue with falsey composite keys, if one of the values used for a composite key is say an empty string, or a zero it would not be added to the _id field, stopping the field from being retrievable. --- packages/server/scripts/integrations/postgres/init.sql | 9 +++++++++ .../server/src/api/controllers/row/ExternalRequest.ts | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/server/scripts/integrations/postgres/init.sql b/packages/server/scripts/integrations/postgres/init.sql index 057944101a..5e385c12d7 100644 --- a/packages/server/scripts/integrations/postgres/init.sql +++ b/packages/server/scripts/integrations/postgres/init.sql @@ -43,6 +43,12 @@ CREATE TABLE test.table1 ( id SERIAL PRIMARY KEY, Name varchar(255) ); +CREATE TABLE CompositeTable ( + KeyPartOne varchar(128), + KeyPartTwo varchar(128), + Name varchar(255), + PRIMARY KEY (KeyPartOne, KeyPartTwo) +); INSERT INTO Persons (FirstName, LastName, Address, City, Type) VALUES ('Mike', 'Hughes', '123 Fake Street', 'Belfast', 'qa'); INSERT INTO Persons (FirstName, LastName, Address, City, Type) VALUES ('John', 'Smith', '64 Updown Road', 'Dublin', 'programmer'); INSERT INTO Tasks (ExecutorID, QaID, TaskName, Completed) VALUES (1, 2, 'assembling', TRUE); @@ -55,3 +61,6 @@ INSERT INTO Products_Tasks (ProductID, TaskID) VALUES (2, 1); INSERT INTO Products_Tasks (ProductID, TaskID) VALUES (3, 1); INSERT INTO Products_Tasks (ProductID, TaskID) VALUES (1, 2); INSERT INTO test.table1 (Name) VALUES ('Test'); +INSERT INTO CompositeTable (KeyPartOne, KeyPartTwo, Name) VALUES ('aaa', 'bbb', 'Michael'); +INSERT INTO CompositeTable (KeyPartOne, KeyPartTwo, Name) VALUES ('bbb', 'ccc', 'Andrew'); +INSERT INTO CompositeTable (KeyPartOne, KeyPartTwo, Name) VALUES ('ddd', '', 'OneKey'); diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 0139147e35..71d1a7d382 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -164,7 +164,7 @@ function generateIdForRow( fieldName: field, isLinked, }) - if (fieldValue) { + if (fieldValue != null) { idParts.push(fieldValue) } } From 466c61aca3404a637173c2b677436d843ca54b60 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 26 Jul 2023 11:58:48 +0000 Subject: [PATCH 2/5] Bump version to 2.8.27 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 32da05ae81..b55764ceb9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.26", + "version": "2.8.27", "npmClient": "yarn", "packages": [ "packages/*" From 43457a39f296519ec151715794a028e14f85088d Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 26 Jul 2023 13:42:27 +0000 Subject: [PATCH 3/5] Bump version to 2.8.28-alpha.0 --- lerna.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lerna.json b/lerna.json index c36d346133..4c6e771bce 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.27", + "version": "2.8.28-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" @@ -19,4 +19,4 @@ "loadEnvFiles": false } } -} +} \ No newline at end of file From b152ca0c7a4165b8977a1cc04aca13b9af8a5569 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 26 Jul 2023 16:13:43 +0100 Subject: [PATCH 4/5] pin node version --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 6a678f1bf3..59b5236928 100644 --- a/package.json +++ b/package.json @@ -108,5 +108,8 @@ "@budibase/string-templates": "0.0.0", "@budibase/types": "0.0.0" }, + "engines": { + "node": ">=14.0.0 <15.0.0" + }, "dependencies": {} } From 04bd71635144a28caf0d6ec62f18705e5aeca9a9 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 26 Jul 2023 17:01:23 +0000 Subject: [PATCH 5/5] Bump version to 2.8.28-alpha.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 4c6e771bce..cc8f9d8477 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.28-alpha.0", + "version": "2.8.28-alpha.1", "npmClient": "yarn", "packages": [ "packages/*"