fix bugged primary key change with auto_increment
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
jusax23 2023-03-24 18:51:09 +01:00
parent 1e396b5934
commit 56fb927c74
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41

View file

@ -223,6 +223,15 @@ export class Handler {
} }
} }
} }
if (changePrimary) for (let j = 0; j < keys.length; j++) {
const a = table.dbLangTableAttributes[keys[j]];
if (a.ops.autoIncrement) {
a.ops.autoIncrement = false;
create.appendEnding(handler.querys.changeColumn(handler, a));
a.ops.autoIncrement = true;
connst.appendEnding(handler.querys.changeColumn(handler, a));
}
}
} }
if (changePrimary) { if (changePrimary) {
create.appendEnding(handler.querys.removePrimaryKey(handler, table.dbLangTableName)); create.appendEnding(handler.querys.removePrimaryKey(handler, table.dbLangTableName));