On occasion, the schema of the MirrorManager database is updated to
add new functionality.  As a mirrormanager administrator, you have
several choices to deal with this:

1) drop all your existing tables and data, and start fresh with the
new schema.  This erases all information in your database.  You've
been warned.  You can:

$ tg-admin sql drop
$ tg-admin sql create

2) upgrade your database's schema without destroying your data.
However, this requires that your database already has a table
sqlobject_db_version, which is created when running:

$ tg-admin sql record --force-db-version=someversion

This gets tricky, as the 'someversion' value isn't automatically
figured out - you have to specify it manually.  If you look in
mirrormanager/sqlobject-history/, you see a bunch of directories
corresponding to the schema as it has changed over time.  For example:

mirrormanager/sqlobject-history/2009-02-23
mirrormanager/sqlobject-history/2009-04-06
mirrormanager/sqlobject-history/2009-10-21

In each directory you will find a file, mirrormanager_version.txt,
which shows the version of MirrorManager which first used this
schema.  You need to force the database version once, like so:

$ tg-admin sql record --force-db-version 2009-10-21

thereafter you can upgrade to the next version by doing:

$ tg-admin sql upgrade


If you must upgrade across several versions, you have to use the
--upgrade-to argument, like so:

# starting from 2009-02-23, 2009-10-21 is latest
$ tg-admin sql upgrade --upgrade-to=2009-04-06
$ tg-admin sql upgrade --upgrade-to=2009-10-21

No, SQLObject doesn't make this easier. SQLAlchemy may.

N.B. python-sqlobject-0.10.2 has a bug that is triggered on upgrade if
you are using a sqlite database.  See the sqlobject-patches/ directory
for a patch to fix this.
