From df968d1919227949bcbeedb253d66ed0720b3d2a Mon Sep 17 00:00:00 2001 From: JuniorJPDJ Date: Mon, 11 Oct 2021 21:16:56 +0200 Subject: variable postgres username and database name (#2451) --- config/migrate-scripts/migrate-db-6e51189.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config/migrate-scripts/migrate-db-6e51189.sh') diff --git a/config/migrate-scripts/migrate-db-6e51189.sh b/config/migrate-scripts/migrate-db-6e51189.sh index ce728118..9132d3d7 100755 --- a/config/migrate-scripts/migrate-db-6e51189.sh +++ b/config/migrate-scripts/migrate-db-6e51189.sh @@ -1,4 +1,7 @@ #!/bin/sh -psql invidious kemal -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" -psql invidious kemal -c "UPDATE channel_videos SET live_now = false;" +[ -z "$POSTGRES_USER" ] && POSTGRES_USER=kemal +[ -z "$POSTGRES_DB" ] && POSTGRES_DB=invidious + +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "ALTER TABLE channel_videos ADD COLUMN live_now bool;" +psql "$POSTGRES_DB" "$POSTGRES_USER" -c "UPDATE channel_videos SET live_now = false;" -- cgit v1.2.3