echo"Missing $DB_CACHE_DIR/bok_choy_schema_$db.sql or $DB_CACHE_DIR/bok_choy_data_$db.json, or $DB_CACHE_DIR/bok_choy_migrations_data_$db.sql rebuilding cache"
REBUILD_CACHE=true
else
load_cache_into_db
fi
done
# If there are cached database schemas/data, load them
if[[-z$REBUILD_CACHE]];then
echo"Found the bok_choy DB cache files. Loading them into the database..."
if[[$REBUILD_CACHE]];then
echo"Cleaning the DB cache directory and building new files."
mkdir-p$DB_CACHE_DIR&&rm-f$DB_CACHE_DIR/bok_choy*
for db in"${database_order[@]}";do
# Load the schema, then the data (including the migration history)
echo"Loading the schema from the filesystem into the $db MySQL DB."
mysql $MYSQL_HOST-u root "${databases["$db"]}" < $DB_CACHE_DIR/bok_choy_schema_$db.sql
echo"Loading the fixture data from the filesystem into the $db MySQL DB."