tommy_from_breslau
tommy_from_breslau

Reputation: 31

Symfony+Doctrine migrations problems

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

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:

  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

Upvotes: 1

Views: 818

Answers (1)

ybull
ybull

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

Related Questions