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
|
2018-04-30 10:48:29 +00:00
|
|
|
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
|
2018-04-30 10:48:29 +00:00
|
|
|
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
|
2018-04-30 10:48:29 +00:00
|
|
|
echo "Imported fixtures.sql"
|
|
|
|
mysql -u root -proot < dump/fixtures.sql
|
2018-04-26 13:13:56 +00:00
|
|
|
|
|
|
|
|
2018-04-30 10:48:29 +00:00
|
|
|
# Remove installation
|
|
|
|
rm -rf changes dump install.sh
|