New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Persist doctrine MetadataStorage changes immediately #2333
BUGFIX: Persist doctrine MetadataStorage changes immediately #2333
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sooo weird that it's necessary but well, if that's what is needed....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it helps… 🤔
I am really at a loss here… Why? I tried PHP errors in migrations, invalid SQL in migrations, re-applying already executed migrations – and did not need that (again). But, whatever, if it solves if, do it. 🤷♂️ This doesn't do anything like that, too: https://github.com/doctrine/migrations/blob/3.0.x/lib/Doctrine/Migrations/Tools/Console/Command/MigrateCommand.php |
@kdambekalns Mh, you're right (as usual).. And I can't reproduce this any longer.. UPDATE flow_doctrine_migrationstatus SET version = RIGHT(version, 14);
ALTER TABLE flow_doctrine_migrationstatus DROP executed_at, DROP execution_time; (to revert the metadata table to its old state) DELETE FROM flow_doctrine_migrationstatus WHERE version = '20200908155620'; to remove the migration that was missing in my case. Previously that led to a swallowed error and the half-migrated table.
(as expected) and the table is fully migrated.. Probably I was in some weird state when I tried it last. I'll close this one for now and hope that this heisenbug never returns :) |
🤞 |
Wait, we never merged this… |
I thought that was because the issue that this seemed to solve was no longer reproducible without this change?
|
🤔 well, yeah. If this fixes those cases... PS: Would like to create bugfix releases tomorrow or so, so should we merge this before? |
This basically adds a
EntityManager::flush()
call afterMetadataStorage::ensureInitialized()
invocations in order to apply any metadata migrations immediately.
Without this a
./flow doctrine:migrate
call might leave the metadata storage in a half-migratedstate if it leads to an exception.
Related: #2244
Related: #2357