mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
fix: do not insert another pk if there is no uuid pk
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user