fix: do not insert another pk if there is no uuid pk

This commit is contained in:
Nybkox
2025-02-04 21:01:15 +01:00
parent 808b774ad1
commit 979f2c7dac

View File

@@ -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 };