salix/services/db/install/install.sh

27 lines
569 B
Bash

#!/bin/bash
# Start MySQL service
find /var/lib/mysql -type f -exec touch {} \; && service mysql start
# Disable SQL strict mode
mysql -u root -proot -e "SET GLOBAL sql_mode='NO_ENGINE_SUBSTITUTION';"
# Dump structure
for file in dump/*-*.sql; do
echo "Imported $file"
mysql -u root -proot < $file
done
# Import changes
for file in changes/*/*.sql; do
echo "Imported $file"
mysql -u root -proot < $file
done
# Import fixtures
echo "Imported fixtures.sql"
mysql -u root -proot < dump/fixtures.sql
# Remove installation
rm -rf changes dump install.sh