Add support to upgrade via Juno and Kilo

Rather than stepping through the migrations just in master (which
works fine assuming they are no different to previous releases)
checkout the correct stable branch and walk through that.

Change-Id: Iff79684990cbbaa8c6ed2474aca77a2f73d64b96
This commit is contained in:
Joshua Hesketh 2015-05-01 11:52:00 +10:00
parent 1c00340d88
commit 8e166e0dc6
1 changed files with 29 additions and 1 deletions

View File

@ -194,7 +194,35 @@ stable_release_db_sync() {
db_sync "icehouse"
fi
# TODO(jhesketh): Add in Juno here once released
version=`mysql -u $DB_USER --password=$DB_PASS $DB_NAME -e "select * from migrate_version \G" | grep version | sed 's/.*: //'`
# Some databases are from Icehouse
echo "Schema version is $version"
if [ $version -lt "254" ]
then
echo "Database is from Icehouse! Upgrade via Juno"
git branch -D stable/juno || true
git remote update
git checkout -b stable/juno
git reset --hard remotes/origin/stable/juno
pip_requires
db_sync "juno"
fi
version=`mysql -u $DB_USER --password=$DB_PASS $DB_NAME -e "select * from migrate_version \G" | grep version | sed 's/.*: //'`
# Some databases are from Juno
echo "Schema version is $version"
if [ $version -lt "280" ]
then
echo "Database is from Juno! Upgrade via Kilo"
git branch -D stable/kilo || true
git remote update
git checkout -b stable/kilo
git reset --hard remotes/origin/stable/kilo
pip_requires
db_sync "kilo"
fi
# TODO(jhesketh): Add in Liberty here once released
# TODO(jhesketh): Make this more DRY and/or automatically match migration
# numbers to releases.