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
Doctrine migrations does not aknowlege changes in entities #688
Comments
I have the same problem. This seems like a bug, a very annoying one. Any ideas for this? |
Yes this is currently an issue with wrongly configured caches on DoctrineBundle. We are working on a fix. |
In the same way, there is a problem when you create a OneToOne relation with cascade persist : it doesn't persist the associated entity. You have to run |
There are new patch releases on DoctrineBundle to address this issue. Please also make sure to sync the latest recipe changes seen here to ensure proper caching in prod: https://github.com/symfony/recipes/pull/695/files |
It seems that since this PR (bf7c5fd ) the
make:migration
command is "bugged".It does not take into accounts changes made to entities and just generate the minimum SQL to create the tables and add an id.
By now, we have to run
doctrine:cache:clear-metadata
each time we change an entity if we wantmake:migration
to take changes into account.To be honest I absolutely don't know what happened and how I can fix it, so please apologize for not being able to create a PR.
Easy to reproduce : create a new Symfony app using
composer create-project symfony/website-skeleton demo
then create a first entity and runmake:migration
then look at the migration file. You will see that it only creates the table. If you want it to take into account all fields metadata, you will had to rundoctrine:cache:clear-metadata
and thenmake:migration
will be fine :)The text was updated successfully, but these errors were encountered: