I was just curious if there was a way to issue the following command, but not have it delete all the records:
php symfony doctrine:build --all
The reason I'm asking is because the symfony project would be using an existing 开发者_运维技巧database, which has a lot of records already. The usage of that command would totally clear it out and recreate the tables, minus the data.
Any ideas?
You can call the separate build commands that you need one by one, instead of using build --all
Build --all is equivalent to running the following tasks:
./symfony doctrine:drop-db
./symfony doctrine:build-db
./symfony doctrine:build-model
./symfony doctrine:build-forms
./symfony doctrine:build-filters
./symfony doctrine:build-sql
./symfony doctrine:insert-sql
Obviously, you don't want to run the first two. If you don't like running all of these commands manually, you can create a batch script to execute what you need.
If you did make changes to your schema, then you will need to create migration classes to generate the differences. Take a look at the following, if you need to do this: Migration Task
精彩评论