Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielCosme committed Feb 21, 2024
1 parent 35c1f7c commit 49b0301
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/init_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ if ! [ -x "$(command -v sqlx)" ]; then
exit 1
fi

DIR=$(dirname "$(readlink -f "$0")")
ROOT_DIR=$(pwd)

source "$ROOT_DIR/env.sh"
[ -z "$DB_USER" ] && DB_USER="postgres"
[ -z "$DB_PASSWORD" ] && DB_PASSWORD="password"
[ -z "$DB_NAME" ] && DB_NAME="ape"
[ -z "$DB_PORT" ] && DB_PORT=5432
[ -z "$DB_HOST" ] && DB_HOST="localhost"

if [[ -z "${SKIP_DOCKER}" ]]
then
Expand All @@ -45,6 +46,7 @@ until psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q'
sleep 1
done

DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
sqlx database create
sqlx migrate run

0 comments on commit 49b0301

Please sign in to comment.