How do you manage databases in development, test, and production?

There are a couple of good options. I wouldn’t use the “restore a backup” strategy.

  1. Script all your schema changes, and have your CI server run those scripts on the database. Have a version table to keep track of the current database version, and only execute the scripts if they are for a newer version.

  2. Use a migration solution. These solutions vary by language, but for .NET I use Migrator.NET. This allows you to version your database and move up and down between versions. Your schema is specified in C# code.

Leave a Comment