29 lines
615 B
Bash
29 lines
615 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" >> log.txt
|
|
mysql -u root -proot < $file
|
|
done
|
|
|
|
# Import changes
|
|
for file in changes/*/*.sql; do
|
|
echo "Imported $file" >> log.txt
|
|
mysql -u root -proot < $file
|
|
done
|
|
|
|
# Import fixtures
|
|
echo "Imported fixtures.sql" >> log.txt
|
|
mysql -u root -proot < dump/fixtures.sql >> log.txt
|
|
|
|
# Remove installation
|
|
rm -rf changes dump install.sh
|
|
|
|
|