File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,10 @@ if ! [ -x "$(command -v sqlx)" ]; then
1616 exit 1
1717fi
1818
19- # Check if a custom user has been set, otherwise default to 'postgres'
2019DB_USER=${POSTGRES_USER:= postgres}
21- # Check if a custom password has been set, otherwise default to 'password'
2220DB_PASSWORD=" ${POSTGRES_PASSWORD:= password} "
23- # Check if a custom database name has been set, otherwise default to 'bibimbap'
2421DB_NAME=" ${POSTGRES_DB:= bibimbap} "
25- # Check if a custom port has been set, otherwise default to '5432'
2622DB_PORT=" ${POSTGRES_PORT:= 5432} "
27- # Check if a custom host has been set, otherwise default to 'localhost'
2823DB_HOST=" ${POSTGRES_HOST:= localhost} "
2924
3025# Launch Postgres using Docker
@@ -43,8 +38,11 @@ until psql -h "${DB_HOST}" -U "${DB_USER}" -p "${DB_PORT}" -d "postgres" -c '\q'
4338 sleep 1
4439done
4540
46- >&2 echo " Postgres is up and running on port ${DB_PORT} !"
41+ >&2 echo " Postgres is up and running on port ${DB_PORT} - running migrations now !"
4742
4843DATABASE_URL=postgres://${DB_USER} :${DB_PASSWORD} @${DB_HOST} :${DB_PORT} /${DB_NAME}
4944export DATABASE_URL
5045sqlx database create
46+ sqlx migrate run
47+
48+ >&2 echo " Postgres has been migrated, ready to go!"
You can’t perform that action at this time.
0 commit comments