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 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思