mysql change column to not null

This commit is contained in:
Jan Prochazka
2024-11-18 14:56:59 +01:00
parent 2ae98d0c2d
commit c0c9c7be20
6 changed files with 20 additions and 5 deletions

View File

@@ -32,6 +32,10 @@ class Dumper extends SqlDumper {
}
changeColumn(oldcol, newcol, constraints) {
this.fillNewNotNullDefaults({
...newcol,
columnName: oldcol.columnName,
});
this.put('^alter ^table %f ^change ^column %i %i ', oldcol, oldcol.columnName, newcol.columnName);
this.columnDefinition(newcol);
this.inlineConstraints(constraints);
@@ -91,7 +95,7 @@ class Dumper extends SqlDumper {
}
selectScopeIdentity() {
this.put('^select ^last_insert_id()')
this.put('^select ^last_insert_id()');
}
}