Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2005
    Thanked 0 Times in 0 Posts

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

  • #2
    UE Antagonizer Fumigator's Avatar
    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).


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts