You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
271 B
Bash

#!/usr/bin/env bash
for file in $(find /sql -name "*.sql" -exec ls {} \;| grep -v postgres | sort | tr ' ' '|' | tr '\n' ' ')
do
file=$(echo ${file} | tr '|' ' ')
printf "Applying update ${file}\n"
mysql -uroot -p$MYSQL_ROOT_PASSWORD -h mysql < ${file}
done