mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 06:26:00 +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' };
|
if (!pkColumnName) return { shouldAddUuidPk: true, pkColumnName: 'id' };
|
||||||
|
|
||||||
const columnInfo = getColumnInfo(tableInfo, pkColumnName);
|
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);
|
const shouldAddUuidPk = writable.columnNames.every((i) => i !== columnInfo.columnName);
|
||||||
if (!shouldAddUuidPk) return { shouldAddUuidPk };
|
if (!shouldAddUuidPk) return { shouldAddUuidPk };
|
||||||
|
|||||||
Reference in New Issue
Block a user