fix database import

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-02-15 17:44:00 +01:00
parent badd8d02a9
commit 3887275808
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,7 @@
set -ex set -ex
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD "$POSTGRES_PASSWORD"; CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD '$POSTGRES_PASSWORD';
GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER"; GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER";
EOSQL EOSQL

View file

@ -63,7 +63,7 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO
# Restore database # Restore database
echo "Restoring the database from database dump" echo "Restoring the database from database dump"
psql "$POSTGRES_DB" -U "$POSTGRES_USER" < "$DUMP_FILE" psql "$POSTGRES_DB" -U "oc_$POSTGRES_USER" < "$DUMP_FILE"
# Shut down the database to be able to start it again # Shut down the database to be able to start it again
pg_ctl stop -m fast pg_ctl stop -m fast