开发者

Symfony+Doctrine migrations problems

I've got a strange problem with Symfony (with sfDoctrineGuardPlugin installed) and Doctrine migrations. What I've done till now:

  • I've dropped database and created new one withou tables
  • I've cleaned all model files
  • I've cleared cache
  • run symfony task "doctrine:generate-migrations-db"

After that, I think that sh开发者_JAVA百科ould be not differences between database and migration's files. Next I've run "doctrine:generate-migrations-diff" and got two new files with:

  1. File one
  2. File two

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜