Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006

    Version Control + MySQL (+PHP)


    I'm using Subversion to look after the source code for a website of mine (or I will be, but I'm stuck).

    How on earth do I look after the MySQL database schema / structure in Subversion?

    I'm using PHP but not with a framework.

    I need to of course keep production data intact when deploying to the production server, just altering the structure as needs be. However there will be test data for the testing server and local development.

    I've searched and searched but every solution I've found pretty much blows my mind with confusion. I've tried using versioning in the past but this is what always stops me, it's not a *huge* issue as I'm a sole developer but it would be nice to use Subversion for the various benefits even to a sole developer. In addition to this I'd like to learn how to use Subversion effectively now incase I'm ever looking for employment (for myself) in the future where version control would be the norm.

    I kinda wish that RoR was my language & framework right now since everybody says that RoR handles database migration data itself =(


  2. #2
    One method I've used in the past, is to create scripts for any db changes - new fields, new tables, field changes, indexes, everything.

    Then those scripts become part of the deployment. Then whatever date point your data is at, you always know which set of scripts you need to run to match the code you want to use. (Does that makes sense?)

    It's tempting to just use phpMyAdmin but scripting it keeps things consistent, trackable and versionable - new word ;-)

  3. #3
    Join Date
    Apr 2009
    █▌KVM-based SSD VPS
    ▌Unmetered Dedicated Servers
    ▌Colocation at 100 Delawanna Ave, Clifton, NJ

  4. #4
    Join Date
    Nov 2006
    I agree with MarkHaigh;

    I personally would script the DB creation, and any updates, in PHP as part of the web site.

    This will keep the DB version tied to the code version in SVN, and separate data from the DB structure.

    Alternately, you can do a backup of the DB structure from phpMyAdmin, and check it in along with the code. You'll just have to make a habit of doing this anytime you change the DB structure.

Similar Threads

  1. Best apache/php/mysql version combo?
    By Klentelaris in forum Hosting Security and Technology
    Replies: 6
    Last Post: 06-15-2008, 02:31 PM
  2. Which version of Apache/PHP/MySQL should i use?
    By dotcomUNDERGROUND in forum Dedicated Server
    Replies: 18
    Last Post: 12-12-2006, 12:19 AM
  3. php mysql version
    By HD Fanatic in forum Dedicated Server
    Replies: 1
    Last Post: 06-07-2005, 04:15 PM
  4. Version Control Software -- PHP
    By bdotson in forum Programming Tutorials
    Replies: 9
    Last Post: 01-20-2005, 10:36 PM
  5. PHP version control script?
    By e1ven in forum Employment / Job Offers
    Replies: 4
    Last Post: 07-02-2004, 12:42 AM

Posting Permissions

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