2021-09-30 12:39:48 +00:00
|
|
|
#!/bin/sh
|
2023-04-18 12:39:22 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# Default command is "goose up"
|
|
|
|
if [[ $# -eq 0 ]]; then
|
|
|
|
set -- "up"
|
|
|
|
fi
|
2021-09-30 12:39:48 +00:00
|
|
|
|
|
|
|
# Construct the connection string for postgres
|
|
|
|
VDB_PG_CONNECT=postgresql://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOSTNAME:$DATABASE_PORT/$DATABASE_NAME?sslmode=disable
|
|
|
|
|
|
|
|
# Run the DB migrations
|
2024-07-08 09:48:16 +00:00
|
|
|
set -x
|
|
|
|
exec ./goose -dir migrations postgres "$VDB_PG_CONNECT" "$@"
|