简体   繁体   English

用于多个开发人员环境的SVN数据库版本控制

[英]SVN database versioning for multiple developers environment

I'd like to know if there is a scenario for versioning database with SVN which will ensure no conflicts when few developers try to commit changes simultaneously. 我想知道是否存在使用SVN对数据库进行版本控制的方案,当少数开发人员尝试同时提交更改时,该方案将确保没有冲突。

Me and my team have been using changescripts with increasing schema version number (similar to this solution: http://odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-change-scripts.aspx ). 我和我的团队一直在使用变更脚本,该变更脚本的架构版本号不断增加(类似于此解决方案: http : //odetocode.com/blogs/scott/archive/2008/02/02/versioning-databases-change-scripts.aspx )。

It's a pretty good solution, but its main flaw is that conflicts can occur when multiple developers try to commit change script with the same schema number - it's not only a simple SVN conflict, but also requires users with that conflict to manually change database table with schema versions, revert their db changes, change script files' numbers to have all the db updates. 这是一个非常好的解决方案,但是它的主要缺陷是,当多个开发人员尝试提交具有相同架构编号的更改脚本时,可能会发生冲突-这不仅是简单的SVN冲突,而且还要求具有该冲突的用户手动更改具有模式版本,还原其数据库更改,更改脚本文件的编号以具有所有数据库更新。 Is it possible to avoid this obstacles? 有可能避免这种障碍吗? I don't mean technical solutions only, but maybe there is a better way to organize this task? 我不仅指技术解决方案,而且也许有更好的方法来组织这项任务? Any ideas? 有任何想法吗?

Rails solved this exact problem by using a timestamp instead of an incrementing version number. Rails通过使用时间戳而不是递增的版本号解决了这个确切的问题。 The odds of two users creating new schema versions in the same second is pretty low. 两个用户在同一秒内创建新架构版本的几率很低。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM