开发者

Database Migrations in multiple Mercurial branches

开发者 https://www.devze.com 2023-02-07 06:51 出处:网络
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 开发者_如何学Goin a side branch (not part of the main one). Will th

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 开发者_如何学Goin 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!


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 before 411_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.

0

精彩评论

暂无评论...
验证码 换一张
取 消