doulin9679 2016-07-14 23:01
浏览 88
已采纳

使用doctrine:migrations:diff设置特定版本名称

I'm discovering Symfony and Doctrine. I was able to generate a file containing a class for my migration using

php bin/console doctrine:migrations:diff

It's great but the name of my file (and my class) is : Version20160714233422.

It's not really understable (even though it's the date) and I would like to call it Version1 for example.

I guess it would be possible to change manually the names but is there a way to do it automatically ?

I looked on the help :

php bin/console doctrine:migrations:diff --help

but this feature doesn't seems to be implemented. Am I wrong ?

Is there a reason it's not possible ? Does setting a code like 0.1, 0.2... is a bad idea ?

If someone could explain this to me it would be very much appreciated !

  • 写回答

1条回答 默认 最新

  • douqin231881 2016-07-15 09:33
    关注

    Well I guess you would like to use a subversion repository. Lets see why the version name is generated as a timestamp in format Ymdhis there is a small chance that two developers working on the same project will generate the migration in exact same second. Which would resolve in conflict state.

    On the other hand, sequential naming would resolve in conflict states very often. Two developers have the branch from master and both see last migration version Version20. They both decide to create new migration with name Version21.

    That is why the migrations is generated with the timestamp name. If you want to change it you have to do it manually.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示