How do I update my symfony module with my changes only?
I have a very big problem with symfony module generation as i always make modification in my database (add tables , add columns, changes names, changes columns data-type .....) and i want a good way to build the symfony module without any effect on the modules that i didn't change it and without drop the data in the database... on brief i need to update my symfony module with my change开发者_如何学Pythons ONLY.
I think you mean "models" instead of "modules" here.
If this is the case, basically once you've got data in the database that you don't want to drop:
1 - Make any needed changes to your schema.yml
2 - Use MySQL ALTER TABLE etc to make changes directly to your database
3 - Use the following commands to regenerate your models:
symfony doctrine:build --model
symfony doctrine:build --sql
symfony doctrine:build --forms
symfony doctrine:clean-model-files // to clean up old stuff
Assuming you haven't made changes to your base classes (which you shouldn't do), the rebuilding of the models shouldn't break anything. You're basically re-building everything but only the changes you introduced in your schema will be introduced.
精彩评论