diff options
author | Joshua Hesketh <josh@nitrotech.org> | 2015-05-01 11:52:00 +1000 |
---|---|---|
committer | Joshua Hesketh <josh@nitrotech.org> | 2015-05-01 11:52:00 +1000 |
commit | 8e166e0dc62b15cd48439fadb82b92f9b192782b (patch) | |
tree | 908e19a282b8c6972a74be79cc225a58af120d68 | |
parent | 1c00340d88e0e757b3cb85772de4dc92111a486f (diff) | |
download | turbo-hipster-8e166e0dc62b15cd48439fadb82b92f9b192782b.tar.gz |
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
-rwxr-xr-x | turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh b/turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh index a346dd2..2a15bda 100755 --- a/turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh +++ b/turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh @@ -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. |