问题
What are the differences between Symfony console command make:migration and doctrine:migrations:diff?
回答1:
make:migration
will create empty file for you so you can write your custom migration
doctrine:migrations:diff
will compare your current database schema with entities mappings and if there is difference then it will create migration so you can update you database schema to reflect your entities mappings
回答2:
There is no difference between these two commands.
make:migration
is simply a Symfony provided wrapper for the Doctrine command.
You can run either to the exact same effect. But the symfony one requires that you have the Symfony Maker bundle, which otherwise it not required.
来源:https://stackoverflow.com/questions/51699179/difference-between-symfony-doctrine-commands-makemigration-and-doctrinemigra