title: Syncing PHP Git project's MySQL structure
body: <p>I've recently learned to use git, have a nice editor that supports it, and a nice hook that uploads everything to a live site upon push. So now I have a local version, a dev testing version and a live version, and everything is grand. The only problem which I haven't managed to find is a nice solution on how to efficiently sync the MySQL structure between the databases.</p>
  
  <p>The 2 scenarios I often face on extending my projects are either add extra columns or create new tables. I often do this through phpmyadmin, and although I can copy paste the given change as SQL, I strive for a more efficient solution than having to copy paste in 3+ repositories.</p>
  
  <p>Currently these are my methods I consider, but I'd prefer a more efficient one.</p>
  
  <p><strong>Repositories:</strong></p>
  
  <ul>
  <li>live - live site on server</li>
  <li>dev - dev site on server</li>
  <li>local - local site on computer</li>
  </ul>
  
  <h1>Method #1</h1>
  
  <p>Copy/paste all SQL commands generated by phpmyadmin into every project's database.</p>
  
  <ul>
  <li>Not really an efficient solution in the end</li>
  </ul>
  
  <h1>Method #2</h1>
  
  <p>Somehow (do inspire me) fill a php file with an array full of all generated SQL commands from phpmyadmin, then execute that php file from a hook. I'd do all of my structure changes in one of the server's repositories, and upon pull from local and merge to live, change the MySQL structure.</p>
  
  <ul>
  <li>Would be neat, but not fully sure how to execute it</li>
  <li>Needs to work on both ubuntu server and local wampserver</li>
  </ul>
  
  <h1>Method #3</h1>
  
  <p>Some nice solution through MySQL that works both on server and locally.</p>
  
  <ul>
  <li>No idea how that would work.</li>
  </ul>
  
  <p>Thanks for your time, and if you know some better method do share! I'm looking for an automatic solution that makes sence.</p>