mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 12:06:00 +00:00
changeset fix - don't update autoincrement column
This commit is contained in:
@@ -369,6 +369,8 @@ function compileSimpleChangeSetCondition(fields: { [column: string]: string }):
|
|||||||
function changeSetUpdateToSql(item: ChangeSetItem, dbinfo: DatabaseInfo = null): Update {
|
function changeSetUpdateToSql(item: ChangeSetItem, dbinfo: DatabaseInfo = null): Update {
|
||||||
const table = dbinfo?.tables?.find(x => x.schemaName == item.schemaName && x.pureName == item.pureName);
|
const table = dbinfo?.tables?.find(x => x.schemaName == item.schemaName && x.pureName == item.pureName);
|
||||||
|
|
||||||
|
const autoIncCol = table?.columns?.find(x => x.autoIncrement);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
from: {
|
from: {
|
||||||
name: {
|
name: {
|
||||||
@@ -380,7 +382,7 @@ function changeSetUpdateToSql(item: ChangeSetItem, dbinfo: DatabaseInfo = null):
|
|||||||
fields: extractFields(
|
fields: extractFields(
|
||||||
item,
|
item,
|
||||||
true,
|
true,
|
||||||
table?.columns?.map(x => x.columnName)
|
table?.columns?.map(x => x.columnName).filter(x => x != autoIncCol?.columnName)
|
||||||
),
|
),
|
||||||
where: extractChangeSetCondition(item),
|
where: extractChangeSetCondition(item),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user