Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
03-02-2009, 08:49 AM #1
- Join Date
- Jul 2005
- Thanked 0 Times in 0 Posts
What is the best way to Version Control a Database?
I am thinking of using either SVN or GIT to do version control on my mysql database. Some people suggest to dump the database into a text file, and version control the text file. Is there a better method? Version control software usually don't detect change of data in the database, so I have to constantly remind myself to do it manually.
03-02-2009, 04:50 PM #2
- Join Date
- Dec 2005
- Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
- Thanked 637 Times in 625 Posts
I would definitely do the schema like that; dump the create queries and store in a text file. At any given point along development you should be able to create the entire database from these create queries and the database should then correspond to the application code.
As for actual data in the tables... during development I usually keep test data in a separate text file (via INSERT queries for easy database rebuild) and once the application goes live, of course, the live data is backed up daily (not through SVN).