General clean up #10

Merged
roysc merged 4 commits from roysc/further-cleanup into v5 2024-07-24 07:13:23 +00:00
Showing only changes of commit 60e83a1e2c - Show all commits

View File

@ -1,5 +1,4 @@
#!/bin/sh #!/bin/sh
# Runs the db migrations
set -e set -e
# Default command is "goose up" # Default command is "goose up"
@ -11,14 +10,5 @@ fi
VDB_PG_CONNECT=postgresql://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOSTNAME:$DATABASE_PORT/$DATABASE_NAME?sslmode=disable VDB_PG_CONNECT=postgresql://$DATABASE_USER:$DATABASE_PASSWORD@$DATABASE_HOSTNAME:$DATABASE_PORT/$DATABASE_NAME?sslmode=disable
# Run the DB migrations # Run the DB migrations
echo "Connecting with: $VDB_PG_CONNECT" set -x
echo "Running database migrations" exec ./goose -dir migrations postgres "$VDB_PG_CONNECT" "$@"
./goose -dir migrations postgres "$VDB_PG_CONNECT" "$@"
# If the db migrations ran without err
if [[ $? -eq 0 ]]; then
echo "Migration process ran successfully"
else
echo "Could not run migrations. Are the database details correct?"
exit 1
fi