Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently began working with version control in my web-development using subversion. This works great for managing the files I develop but does nothing for the changes I sometimes need to make to the databases. To my knowledge the server I'm working on doesn't have any DB management systems in place and I likely wouldn't be able to get them to install anything. What options are there for managing DB's in this kind of environment?

share|improve this question

closed as too broad by Ixrec, Snowman, GlenH7 Dec 5 '15 at 1:39

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

@Jeff O This thread you suggested deals more with versioned content rather than the versioning of the database structure which is what I would like to be able to track. Thanks though for the suggestion! – Kenneth Jul 22 '11 at 1:10
up vote 9 down vote accepted

K. Scott Allen has written some excellent blog posts about this a few years ago. They might be "old" in internet terms, but his solution is still very nice.

  1. Three rules for database work
  2. The Baseline
  3. Change Scripts
  4. Views, Stored Procedures and the Like
  5. Branching and Merging
share|improve this answer

Migration frameworks are code libraries that provide a simple API to automate DB changes, with some mechanism for versioning the DB.

I use Migrator.Net for some projects. I create a class for each changeset, and the framework provides a simple way to execute the changes against a DB. I can also run changes forwards and backwards, provided I code the logic for downgrading as well as upgrading.

We then manage the migration code in our VCS like any other code.

share|improve this answer

Nightly backups of course (at least) .. Because its not just the DB structure you care about.

You have several options:

1) Keep your alter scripts in the Source control.

2) After each db change generate the Db scripts.. and Store those in Source control along with a DB backup at the same time. This way you can do a compare on the Generated Script file.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.