views:

28

answers:

1

I have a visual studio 2010 solution that uses a SQL CE fiel (SDF) for storing data in one of the projects. I am wondering, is it a good practice to add this SDF file to the source control so that whenever I make any changes in the database, I commit it to source control?

Sometimes all i do is a name change for example, then I have to commit a 1 MB file to source control. Does it make sense?

What are you experiences about this?

+1  A: 

If you can't build/run your project by taking a fresh check-out due to a file being missing then you need to add it to source control.

Yes, it is a binary file and you can't do diffs on it but as you change column names over time, your code must change to work with that schema. It makes sense to store everything in source control as they need to match up.

If you really can't handle putting it into source control as a binary then consider scripting it and having your application build the database on boot if no db exists. The following tool will intergrate in sql management studio to enable scripting.

http://exportsqlce.codeplex.com/

Neil Trodden