cakephp / phinx

PHP Database Migrations for Everyone
https://phinx.org
MIT License
4.45k stars 895 forks source link

RenameColumn generating SQL syntax #2269

Closed AlexanderSchaller closed 3 months ago

AlexanderSchaller commented 5 months ago

Using phinx version 0.16.0. Using the mysql adapter.

Code example:

$table = $this->table('trades');
$table
    ->renameColumn('uid_a', 'initiatorUserId')
    ->update();

The resulting SQL command is:

ALTER TABLE `trades` CHANGE COLUMN `uid_a` `initiatorUserId` int NOT NULLAUTO_INCREMENT COMMENT ''

With the issue of course being (lack of space between NULL and AUTO_INCREMENT)

NOT NULLAUTO_INCREMENT