多个 Mercurial 分支中的数据库迁移
我想将数据库迁移(我正在使用 PHP Ruckusing)添加到我的 Mercurial 存储库的主分支,并且我在侧分支(不是主分支的一部分)中创建了另一个迁移。由于两个迁移具有相同的编号(411_AddSomething.php、411_AddSomethingElse.php),会出现任何问题吗?
我有在生产服务器上自动运行迁移的钩子,目前侧分支的迁移被忽略。我担心当我最终合并分支时,数字会出现问题。
谢谢你!
I want to add a DB migration (I'm using PHP Ruckusing) to the main branch of my Mercurial repo and I have another migration created in a side branch (not part of the main one). Will there be any problems since the two migrations have the same number (411_AddSomething.php, 411_AddSomethingElse.php)?
I have hooks that run the migrations automatically on the production server and currently the side branch's migrations are ignored. I'm worried that when I will eventually merge the branches there will be problems with the numbers.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要完整的文件名不同,Mercurial 就不会介意。
至于 Ruckusing,它 似乎 按文件名按词法顺序考虑迁移,如果您期望
411_AddSomething.php
在411_AddSomethingElse 之前运行,这可能会导致令人惊讶的结果.php
。 Ruckusing 的较新版本使用完整时间戳而不是文件名的序列整数,使得这种碰撞的可能性就小得多。即便如此,两个开发人员仍然有可能编写相互干扰的单独迁移,即使您的源代码控制系统报告了干净的合并。
As long as the full file names are different, Mercurial won't mind.
As for Ruckusing, it appears to consider migrations in lexical order by filename, which may lead to surprising results if you're expecting
411_AddSomething.php
to run before411_AddSomethingElse.php
. Newer versions of Ruckusing use a full timestamp instead of a serial integer for the filename, making this kind of collision much less likely.Even so, it's still possible for two developers to write separate migrations that interfere with each other, even though your source control system reports a clean merge.