views:

656

answers:

1

I've been testing the Doctrine migrations in symfony and I finally got them to work, but I noticed that these migrations only update the database. The forms and the model are not updated as I expected...

Is this normal? If it's normal, is there a way to update the model with the changes made to the db?

+3  A: 

This is normal.

To update the model/forms/filters etc, you can run the

./symfony doctrine:build-all

task.

Whilst in development, you are probably loading fixtures into your database, so will load them with doctrine:data-load (or use the build-all-reload task).

But once your app is in production, you obviously won't want to be ditching all the data every time you change the db schema. This is where migrations come in.

My process is:

  • Update schema.yml
  • run doctrine:build-all in dev environment.
  • create a migration
  • carry out any dev/testing on a dev environment.
  • deploy the code to production
  • apply the migration to the production database.
benlumley
Ok, understood. Thank you very much!
miguelSantirso