diff options
author | Joshua Hesketh <josh@nitrotech.org> | 2014-05-06 14:38:13 +1000 |
---|---|---|
committer | Joshua Hesketh <josh@nitrotech.org> | 2014-05-06 14:38:13 +1000 |
commit | 504115edb03438f971958f58c279b68d1aeccc5e (patch) | |
tree | 1318083e38e884f6c99a16e89635ea46bb642249 /turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh | |
parent | 57b415ac02098237f94ba8d071dce0dba76484a2 (diff) | |
download | turbo-hipster-504115edb03438f971958f58c279b68d1aeccc5e.tar.gz |
Add support for upgrading through icehouse
Change-Id: I27f9612cbc008730ef272bab707065f670785293
Diffstat (limited to 'turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh')
-rwxr-xr-x | turbo_hipster/task_plugins/real_db_upgrade/nova_mysql_migrations.sh | 18 |
1 files changed, 16 insertions, 2 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 73ea63c..1876012 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 @@ -134,7 +134,7 @@ stable_release_db_sync() { # Some databases are from Folsom echo "Schema version is $version" - if [ $version == "133" ] # I think this should be [ $version lt "133" ] + if [ $version -le "133" ] then echo "Database is from Folsom! Upgrade via Grizzly" git branch -D stable/grizzly || true @@ -148,7 +148,7 @@ stable_release_db_sync() { version=`mysql -u $3 --password=$4 $5 -e "select * from migrate_version \G" | grep version | sed 's/.*: //'` # Some databases are from Grizzly echo "Schema version is $version" - if [ $version == "161" ] # I think this should be [ $version lt "161" ] + if [ $version -le "161" ] then echo "Database is from Grizzly! Upgrade via Havana" git branch -D stable/havana || true @@ -158,6 +158,20 @@ stable_release_db_sync() { pip_requires db_sync "havana" $1 $2 $3 $4 $5 $6 fi + + version=`mysql -u $3 --password=$4 $5 -e "select * from migrate_version \G" | grep version | sed 's/.*: //'` + # Some databases are from Havana + echo "Schema version is $version" + if [ $version -le "216" ] + then + echo "Database is from Grizzly! Upgrade via Icehouse" + git branch -D stable/icehouse || true + git remote update + git checkout -b stable/icehouse + git reset --hard remotes/origin/stable/icehouse + pip_requires + db_sync "icehouse" $1 $2 $3 $4 $5 $6 + fi } echo "Test running on "`hostname`" as "`whoami`" ("`echo ~`", $HOME)" |