Reputation: 31
I've got a strange problem with Symfony (with sfDoctrineGuardPlugin installed) and Doctrine migrations. What I've done till now:
doctrine:generate-migrations-db
"After that, I think that should be not differences between database and migration's files.
Next I've run "doctrine:generate-migrations-diff
" and got two new files with:
That was strange for me couse I've expected no differences, but I've run "doctrine:migrate --up
" two times for two migrations generated earlier. Migrations passed. And now, what makes me confused is fact that every run of "doctrine:generate-migrations-diff
", generates exactly same differences like in two files that I've linked in this post.
Thanks for any suggestions, Tom
Upvotes: 1
Views: 818
Reputation: 1061
That's because doctrine:generate-migrations-diff
works by comparing what's in your schema.yml file to your model classes.
You always need to run
symfony doctrine:build --all-classes
after you run symfony doctrine:migrate
Upvotes: 1