Only walk back to the start of trunk
Change-Id: I54b326f0dfb7ec82aa6ac4d58863adf3608a42e2
diff --git a/turbo_hipster/task_plugins/gate_real_db_upgrade/nova_mysql_migrations.sh b/turbo_hipster/task_plugins/gate_real_db_upgrade/nova_mysql_migrations.sh
index 047451d..2d686ce 100755
--- a/turbo_hipster/task_plugins/gate_real_db_upgrade/nova_mysql_migrations.sh
+++ b/turbo_hipster/task_plugins/gate_real_db_upgrade/nova_mysql_migrations.sh
@@ -160,15 +160,15 @@
version=`mysql -u $4 --password=$5 $6 -e "select * from migrate_version \G" | grep version | sed 's/.*: //'`
echo "Schema version is $version"
-echo "Now downgrade all the way back to Folsom"
-db_sync "patchset" $2 $3 $4 $5 $6 $8 "--version 133"
+target_version=`ls $3/nova/db/sqlalchemy/migrate_repo/versions | head -1 | cut -f 1 -d "_"`
+echo "Now downgrade all the way back to the start of trunk (v$target_version)"
+db_sync "patchset" $2 $3 $4 $5 $6 $8 "--version $target_version"
# Determine the schema version
version=`mysql -u $4 --password=$5 $6 -e "select * from migrate_version \G" | grep version | sed 's/.*: //'`
echo "Schema version is $version"
-echo "And now back up to head from Folsom"
-stable_release_db_sync $2 $3 $4 $5 $6
+echo "And now back up to head from the start of trunk"
git checkout working
db_sync "patchset" $2 $3 $4 $5 $6 $8