Merge pull request #127 from Garthi/orm_migration_column_change_fix

change MySQL/MariaDB SQL statement for changeColumnType method
This commit is contained in:
Thomas 2024-06-22 11:50:21 +08:00 committed by GitHub
commit ab36e7ccac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -153,7 +153,7 @@ class MariaDbAlterTable extends Table implements MutableTable {
@override @override
void changeColumnType(String name, ColumnType type, {int length = 256}) { void changeColumnType(String name, ColumnType type, {int length = 256}) {
_stack.add( _stack.add(
'ALTER COLUMN $name TYPE ${MariaDbGenerator.columnType(MigrationColumn(type, length: length))}'); 'MODIFY $name ${MariaDbGenerator.columnType(MigrationColumn(type, length: length))}');
} }
@override @override

View file

@ -152,7 +152,7 @@ class MysqlAlterTable extends Table implements MutableTable {
@override @override
void changeColumnType(String name, ColumnType type, {int length = 256}) { void changeColumnType(String name, ColumnType type, {int length = 256}) {
_stack.add( _stack.add(
'ALTER COLUMN $name TYPE ${MySqlGenerator.columnType(MigrationColumn(type, length: length))}'); 'MODIFY $name ${MySqlGenerator.columnType(MigrationColumn(type, length: length))}');
} }
@override @override