Changing a database in symfony (doctrine)

I start with symfony (1.4 + Doctrine), but there is a point that scares me. It seems that when someone wants to change the model, the only way - to change the schema for the database ( config/doctrine/schema.yml), and then call symphony doctrine:build, which resets all of the current data in the database .

This does not seem to me in a reasonable way. What if in a year my application is in production, I decide that my users should be able to add their facebook page to their profile? In other frameworks (I'm used to CakePHP) it's just a matter of adding a field to the table usersand changing the model file and profile view. In symfony ... well, I don't know why I'm asking here. I'm sure I missed something, as symfony designers probably thought that you might want to reorganize the application after launch. What is the right way to do this?

+3
source share
3 answers

build-all, db. build-classes build-sql, db, .

0

- . - , - schema.yml, .., :

symfony doctrine:build-model
symfony doctrine:build-forms
symfony doctrine:build-filters
symfony doctrine:build-sql

, /.

0

Source: https://habr.com/ru/post/1765208/


All Articles