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 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?