rename column works

This commit is contained in:
Jan Prochazka
2021-07-01 10:50:41 +02:00
parent 7a2e86246d
commit 7a10b85b4c
4 changed files with 23 additions and 7 deletions

View File

@@ -255,9 +255,11 @@ function planAlterTable(plan: AlterPlan, oldTable: TableInfo, newTable: TableInf
.filter(x => x[0] && x[1])
.forEach(x => {
if (!testEqualsColumns(x[0], x[1], true, true, opts)) {
if (!testEqualsColumns(x[0], x[1], false, true, opts)) {
if (testEqualsColumns(x[0], x[1], false, true, opts)) {
// console.log('PLAN RENAME COLUMN')
plan.renameColumn(x[0], x[1].columnName);
} else {
// console.log('PLAN CHANGE COLUMN')
plan.changeColumn(x[0], x[1]);
}
}