Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you manage schema upgrades to a production database?

This seems to be an overlooked area that could really use some insight. What are your best practices for:

  • making an upgrade procedure
  • backing out in case of errors
  • syncing code and database changes
  • testing prior to deployment
  • mechanics of modifying the table

etc...

like image 811
Mark Harrison Avatar asked Aug 27 '08 08:08

Mark Harrison


People also ask

What does it mean to update a schema?

What Does Schema Change Mean? A schema change is an alteration made to a collection of logical structures (or schema objects) in a database.

How do you configure databases using schema?

In Object Explorer, expand the Databases folder. Expand the database in which to create the new database schema. Right-click the Security folder, point to New, and select Schema. In the Schema - New dialog box, on the General page, enter a name for the new schema in the Schema name box.


1 Answers

Liquibase

liquibase.org:

  1. it understands hibernate definitions.
  2. it generates better schema update sql than hibernate
  3. it logs which upgrades have been made to a database
  4. it handles two-step changes (i.e. delete a column "foo" and then rename a different column to "foo")
  5. it handles the concept of conditional upgrades
  6. the developer actually listens to the community (with hibernate if you are not in the "in" crowd or a newbie -- you are basically ignored.)

http://www.liquibase.org

like image 64
Pat Avatar answered Oct 12 '22 09:10

Pat