Safer data migrations

Specifically, let sqlalchemy handle type casting, escaping special
chars, etc.

Change-Id: I6ffed964b0dc6e140002664675423b83fdeee166
Auto-detect max SQL migration

Change-Id: I56b1d6ded61ad430929d0275ab384ff464faa53c
Merge "Safer data migrations"
Merge "Auto-detect max SQL migration"
downgrade user and tenant
normalized tables downgraded such that sqlite is supported, too

Change-Id: I93ed4589cbe7fd3aee16e42489c322ae903bdac7
Test that you can undo & re-apply all migrations

Change-Id: I72e2b979a8692657c225102f2562e1b1fbb3f67d
Allow running of sql against the live DB.

Reordered the tables in the domain downgrade script to avoid breaking the integrity constraints

To run the test:
./run_tests.sh -N  test_sql_upgrade

This version removed all of the code specific to running against a live DB and merged it into the
standard tests.

Fixed a couple downgrade functions that were failing.  They had not
been tested

Change-Id: Ie1214e5543bd08fde95652af2464cc9c80db449d
Merge "downgrade user and tenant normalized tables downgraded such that sqlite is supported, too"
Merge "Allow running of sql against the live DB."
Merge "Test that you can undo & re-apply all migrations"