7

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.

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 ).

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. 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?

cand
  • 2,441
  • 2
  • 16
  • 13

2 Answers2

4

Some of these techniques + links could help you.

From SO:

Versioning SQL Server database

Mechanisms for tracking DB schema changes

Techniques:

http://www.jilles.net/perma/2003/10/17/database-versioning-techniques/

http://martinfowler.com/articles/evodb.html

Community
  • 1
  • 1
Rakesh Sankar
  • 9,721
  • 4
  • 38
  • 64
2

Rails solved this exact problem by using a timestamp instead of an incrementing version number. The odds of two users creating new schema versions in the same second is pretty low.

meager
  • 209,754
  • 38
  • 307
  • 315
  • Thanks, maybe it's not a perfect solution, but may be sufficient. I'll try to implement it in my case. – cand Jun 20 '11 at 09:32