views:

1998

answers:

4

Is there a good way to check database structure into a SVN? Perhaps checking in a DDL file when changed?

Any ideas?

A: 

Sure, but unless it's strictly a development database you'll probably also include some data-migration routines between versions. You'll want to be able to have complete freedom to drop columns, which means you'll want to be able to bring everything back later if design requirements require them. For a better illustration of what I mean, check out how Rails handles migrations.

Marcel Levy
+6  A: 

http://stackoverflow.com/questions/1607/mechanisms-for-tracking-db-schema-changes

http://stackoverflow.com/questions/173/how-do-i-version-my-ms-sql-database-in-svn

I've never done it, but one of those might answer your question (not sure, haven't read them thoroughly)

cmcculloh
A: 

Maintaining a DDL script that can create the database from scratch, including default data is working for me right now. It makes it pretty easy to generate smaller upgrade scripts from revision to revision when necessary with a simple diff.