Should I include my SDF file (SQL CE 3.5) as an item when adding solution to source control?
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 i开发者_如何学Ct 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?
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/
精彩评论