hyperf/.travis/setup.mysql.sh
rookiexxk a37af75d6e
Use anonymous classes to avoid the duplicated class name for database migrations. (#6839)
Co-authored-by: 10470 <xiexuekun@addcn.com>
Co-authored-by: zds <49744633+zds-s@users.noreply.github.com>
2024-08-16 15:52:37 +08:00

15 lines
640 B
Bash
Executable File

#!/usr/bin/env bash
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-$(dirname $(dirname $CURRENT_DIR))}"
echo -e "Create MySQL database..."
mysql -h 127.0.0.1 -u root -e "CREATE DATABASE IF NOT EXISTS hyperf charset=utf8mb4 collate=utf8mb4_unicode_ci;"
mysql -h 127.0.0.1 -u root -e "CREATE DATABASE IF NOT EXISTS hyperf2 charset=utf8mb4 collate=utf8mb4_unicode_ci;"
mysql -h 127.0.0.1 -u root -e "CREATE DATABASE IF NOT EXISTS hyperf3 charset=utf8mb4 collate=utf8mb4_unicode_ci;"
cat "${TRAVIS_BUILD_DIR}/.travis/hyperf.sql" | mysql -h 127.0.0.1 -u root hyperf
echo -e "Done\n"
wait