Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 33487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:55:43+00:00 2026-05-10T13:55:43+00:00

I want to get my databases under version control. I’ll always want to have

  • 0

I want to get my databases under version control.

I’ll always want to have at least some data in there (as alumb mentions: user types and administrators). I’ll also often want a large collection of generated test data for performance measurements.

How would I apply version control to my database?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:55:43+00:00Added an answer on May 10, 2026 at 1:55 pm

    Martin Fowler wrote my favorite article on the subject, http://martinfowler.com/articles/evodb.html. I choose not to put schema dumps in under version control as alumb and others suggest because I want an easy way to upgrade my production database.

    For a web application where I’ll have a single production database instance, I use two techniques:

    Database Upgrade Scripts

    A sequence database upgrade scripts that contain the DDL necessary to move the schema from version N to N+1. (These go in your version control system.) A _version_history_ table, something like

    create table VersionHistory (     Version int primary key,     UpgradeStart datetime not null,     UpgradeEnd datetime     ); 

    gets a new entry every time an upgrade script runs which corresponds to the new version.

    This ensures that it’s easy to see what version of the database schema exists and that database upgrade scripts are run only once. Again, these are not database dumps. Rather, each script represents the changes necessary to move from one version to the next. They’re the script that you apply to your production database to ‘upgrade’ it.

    Developer Sandbox Synchronization

    1. A script to backup, sanitize, and shrink a production database. Run this after each upgrade to the production DB.
    2. A script to restore (and tweak, if necessary) the backup on a developer’s workstation. Each developer runs this script after each upgrade to the production DB.

    A caveat: My automated tests run against a schema-correct but empty database, so this advice will not perfectly suit your needs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multi databases with same structure its name like that Client1234 the different
I have 2 databases, one on local server and one on a remote server.
2 databases QF AND TK QF has the following: Imagine you have a table
When I right click on the database I want to export data from, I
I'm using a custom message that inherits the System.Servicemodel.Channels.Message. My custom message get IEnumerable
I have a user table in postgress. Each user can have from 0 to
I'm working with a lot of databases that are the same so I am
I am starting my first Open Source ASP.NET project in C#. Data that Web
I'm still new to Ruby on Rails and I'm currently having a issue with
While installing an application onto a client's server, I would like to make sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.