Difference between Symfony / Doctrine commands make:migration and doctrine:migrations:diff

匆匆过客 提交于 2020-11-29 05:54:34

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!