Merge "Allow databases to be preloaded"
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 62d9e53..bf27da0 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
@@ -244,11 +244,13 @@
 set +x
 
 # Restore database to known good state
-echo "Restoring test database $DB_NAME"
+echo "Loading test database $DB_NAME"
 set -x
-mysql -u $DB_USER --password=$DB_PASS -e "drop database $DB_NAME"
-mysql -u $DB_USER --password=$DB_PASS -e "create database $DB_NAME"
-mysql -u $DB_USER --password=$DB_PASS $DB_NAME < $DATASET_SEED_SQL
+if ! mysql -u $DB_USER --password=$DB_PASS -e 'use $DB_NAME'
+then
+    mysql -u $DB_USER --password=$DB_PASS -e "create database $DB_NAME"
+    mysql -u $DB_USER --password=$DB_PASS $DB_NAME < $DATASET_SEED_SQL
+fi
 set +x
 
 echo "Build test environment"