title: Synchronizing databases between testing and production environment with git
body: <p>I am trying to implement git in our development process for php/mysql applications.</p>
  
  <p>So far I have git repos set up, and we are using our local machines for testing and we are successfully using it for the files, but I don't really know  how to handle the database?</p>
  
  <p>There is a cron script on the server that exports and commits a fresh version of the live database to the repo, and I have set up a post-merge hook on my development machine to update my local database, and that works well for syncing in the direction production->testing.</p>
  
  <p>I don't know how to make the sync the other way around. At the moment I am doing changes on the database on the live server, but I don't think that is a good practice.</p>
  
  <p>So I am open to suggestions.</p>
  
  <p><strong>EDIT</strong>: I asked this question, before I understood how schema migrations work. I am now using django for most of my web development work which has a great migrations module called South (part of django core from version 1.7). So most MVC frameworks should have a migrations module that deals with this issue.</p>