#!/usr/bin/env sh
set -eu

MYSQL_HOST="${MYSQL_HOST:-127.0.0.1}"
MYSQL_USER="${MYSQL_USER:-volley}"
MYSQL_PASSWORD="${MYSQL_PASSWORD:-volley}"
MYSQL_DATABASE="${MYSQL_DATABASE:-volley_tournaments}"

mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" "-p$MYSQL_PASSWORD" "$MYSQL_DATABASE" < database/schema.sql
mysql -h "$MYSQL_HOST" -u "$MYSQL_USER" "-p$MYSQL_PASSWORD" "$MYSQL_DATABASE" < database/seeds.sql
echo "Listo. Usuario: admin@volley.test / password"
