Bug Report
| Q |
A |
| BC Break |
no |
| Version |
3.9.4 |
Summary
I have a column for the last update in a table, for which I have set a column definition. Now it seems like because of that column definition some SQL in the migrations is generated when using the doctrine:migrations:diff command, even if the database schema is already in the correct state.
Current behavior
New migration SQL is created even if there should be no changes. At least that's what's happening when using MySQL 5.7.
How to reproduce
- Create a custom schema with a column definition like the following:
$table->addColumn(
Column::editor()
->setUnquotedName('updated_at')
->setTypeName('datetime')
->setColumnDefinition('DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL')
->create(),
);
- Run the
bin/console doctrine:migrations:diff command
- Update your database schema using
bin/console doctrine:migrations:migrate
- Run the
bin/console doctrine:migrations:diff command again
- You'll end up with two migrations, whereby the second contains a line like the following:
ALTER TABLE table CHANGE updated_at updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
Expected behavior
After the previous steps there should only be one migrations file, because there are no changes to apply.
Bug Report
Summary
I have a column for the last update in a table, for which I have set a column definition. Now it seems like because of that column definition some SQL in the migrations is generated when using the
doctrine:migrations:diffcommand, even if the database schema is already in the correct state.Current behavior
New migration SQL is created even if there should be no changes. At least that's what's happening when using MySQL 5.7.
How to reproduce
bin/console doctrine:migrations:diffcommandbin/console doctrine:migrations:migratebin/console doctrine:migrations:diffcommand againExpected behavior
After the previous steps there should only be one migrations file, because there are no changes to apply.