commented handle autoincrement change

This commit is contained in:
Jan Prochazka 2024-11-19 10:34:49 +01:00
parent b0012872fa
commit 8035380e7b
2 changed files with 20 additions and 20 deletions

View File

@ -167,13 +167,13 @@ describe('Alter table', () => {
})
);
test.each(engines.map(engine => [engine.label, engine]))(
'Change autoincrement - %s',
testWrapper(async (conn, driver, engine) => {
await testTableDiff(engine, conn, driver, tbl => {
tbl.columns.find(x => x.columnName == 'col_pk').autoIncrement = true;
});
})
);
// test.each(engines.map(engine => [engine.label, engine]))(
// 'Change autoincrement - %s',
// testWrapper(async (conn, driver, engine) => {
// await testTableDiff(engine, conn, driver, tbl => {
// tbl.columns.find(x => x.columnName == 'col_pk').autoIncrement = true;
// });
// })
// );
});

View File

@ -416,12 +416,12 @@ export class AlterPlan {
this._testTableRecreate(op, 'createConstraint', obj => this._canCreateConstraint(obj), 'newObject') ||
this._testTableRecreate(op, 'dropConstraint', obj => this._canDropConstraint(obj), 'oldObject') ||
this._testTableRecreate(op, 'changeColumn', this.dialect.changeColumn, 'newObject') ||
this._testTableRecreate(
op,
'changeColumn',
obj => this._canChangeAutoIncrement(obj, op as AlterOperation_ChangeColumn),
'newObject'
) ||
// this._testTableRecreate(
// op,
// 'changeColumn',
// obj => this._canChangeAutoIncrement(obj, op as AlterOperation_ChangeColumn),
// 'newObject'
// ) ||
this._testTableRecreate(op, 'renameColumn', true, 'object') || [op]
);
});
@ -449,12 +449,12 @@ export class AlterPlan {
return null;
}
_canChangeAutoIncrement(column: ColumnInfo, op: AlterOperation_ChangeColumn) {
if (!!column.autoIncrement != !!op.oldObject.autoIncrement) {
return this.dialect.changeAutoIncrement;
}
return null;
}
// _canChangeAutoIncrement(column: ColumnInfo, op: AlterOperation_ChangeColumn) {
// if (!!column.autoIncrement != !!op.oldObject.autoIncrement) {
// return this.dialect.changeAutoIncrement;
// }
// return null;
// }
_testTableRecreate(
op: AlterOperation,