summaryrefslogtreecommitdiff
path: root/turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2015-05-01 11:52:00 +1000
committerJoshua Hesketh <josh@nitrotech.org>2015-05-01 11:52:00 +1000
commit8e166e0dc62b15cd48439fadb82b92f9b192782b (patch)
tree908e19a282b8c6972a74be79cc225a58af120d68 /turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh
parent1c00340d88e0e757b3cb85772de4dc92111a486f (diff)
downloadturbo-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
Diffstat (limited to 'turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh')
-rwxr-xr-xturbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh30
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.