salix/services/db/install/install.sh

27 lines
569 B
Bash
Raw Normal View History

2018-04-26 13:13:56 +00:00
#!/bin/bash
# Start MySQL service
2018-04-30 06:46:41 +00:00
find /var/lib/mysql -type f -exec touch {} \; && service mysql start
2018-04-26 13:13:56 +00:00
# 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"
2018-04-26 13:13:56 +00:00
mysql -u root -proot < $file
done
# Import changes
for file in changes/*/*.sql; do
echo "Imported $file"
2018-04-30 06:46:41 +00:00
mysql -u root -proot < $file
2018-04-26 13:13:56 +00:00
done
# Import fixtures
echo "Imported fixtures.sql"
mysql -u root -proot < dump/fixtures.sql
2018-04-26 13:13:56 +00:00
# Remove installation
rm -rf changes dump install.sh