From 979f2c7dac2b97de52b3cefdce18423d5458b64f Mon Sep 17 00:00:00 2001 From: Nybkox Date: Tue, 4 Feb 2025 21:01:15 +0100 Subject: [PATCH] fix: do not insert another pk if there is no uuid pk --- .../src/backend/createBulkInsertStream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dbgate-plugin-cassandra/src/backend/createBulkInsertStream.js b/plugins/dbgate-plugin-cassandra/src/backend/createBulkInsertStream.js index 51de12ad0..a0bb81d0d 100644 --- a/plugins/dbgate-plugin-cassandra/src/backend/createBulkInsertStream.js +++ b/plugins/dbgate-plugin-cassandra/src/backend/createBulkInsertStream.js @@ -31,7 +31,7 @@ function getShouldAddUuidPkInfo(tableInfo) { if (!pkColumnName) return { shouldAddUuidPk: true, pkColumnName: 'id' }; const columnInfo = getColumnInfo(tableInfo, pkColumnName); - if (!columnInfo || columnInfo.dataType.toLowerCase() !== 'uuid') return { shouldAddUuidPk: false }; + if (!columnInfo) return { shouldAddUuidPk: false }; const shouldAddUuidPk = writable.columnNames.every((i) => i !== columnInfo.columnName); if (!shouldAddUuidPk) return { shouldAddUuidPk };