29 lines
572 B
Bash
29 lines
572 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
# Start MySQL service
|
||
|
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 /docker-entrypoint-initdb.d
|
||
|
|
||
|
|