From 00530d757e1486ff0e0b973734ba419f110d9f1a Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Tue, 30 Jul 2024 12:50:30 -0800 Subject: [PATCH] use default db postgres --- Tiltfile | 2 +- scripts/postgrest-migrations.sh | 4 ++-- services/migrations/index.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tiltfile b/Tiltfile index 374c6ff..008d8c7 100644 --- a/Tiltfile +++ b/Tiltfile @@ -200,7 +200,7 @@ cmd_button('postgrest:restore', ) cmd_button('postgrest:migrate', - argv=[''], + argv=['./scripts/postgrest-migrations.sh'], resource='postgrest', icon_name='directions_run', text='Run migrations', diff --git a/scripts/postgrest-migrations.sh b/scripts/postgrest-migrations.sh index b1c98d2..3edc283 100755 --- a/scripts/postgrest-migrations.sh +++ b/scripts/postgrest-migrations.sh @@ -2,11 +2,11 @@ if [ -z $POSTGRES_PASSWORD ]; then - echo "POSTGRES_PASSWORD was missing in env. Are you executing this script via Tilt? (that is the intended method)" + echo "POSTGRES_PASSWORD was missing in env. In development environment, runing this command via the UI button in Tilt is recommended as it sets the env var for you." exit 5 fi -kubectl -n futureporn run postgrest-migrations --image=https://gitea.futureporn.net/futureporn/migrations:latest --env PGPASSWORD=${POSTGRES_PASSWORD} +kubectl -n futureporn run postgrest-migrations -i --rm=true --image=gitea.futureporn.net/futureporn/migrations:latest --env=DATABASE_PASSWORD=${POSTGRES_PASSWORD} diff --git a/services/migrations/index.js b/services/migrations/index.js index 8f1e7d2..7078e93 100644 --- a/services/migrations/index.js +++ b/services/migrations/index.js @@ -20,7 +20,7 @@ async function main() { // Default: "postgres" // Used when checking/creating "database-name" - defaultDatabase: "postgrest" + defaultDatabase: "postgres" } await migrate(dbConfig, path.join(__dirname, "./migrations/"))