2022-02-12 04:29:20 +03:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
|
2022-12-29 02:41:29 +03:00
|
|
|
touch "$DUMP_DIR/initialization.failed"
|
|
|
|
|
2022-02-12 04:29:20 +03:00
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
2022-02-15 20:00:45 +03:00
|
|
|
CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB;
|
|
|
|
ALTER DATABASE "$POSTGRES_DB" OWNER TO "oc_$POSTGRES_USER";
|
2023-01-17 18:19:48 +03:00
|
|
|
GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER";
|
|
|
|
GRANT ALL PRIVILEGES ON SCHEMA public TO "oc_$POSTGRES_USER";
|
2022-02-12 04:29:20 +03:00
|
|
|
EOSQL
|
|
|
|
|
2022-12-29 02:41:29 +03:00
|
|
|
rm "$DUMP_DIR/initialization.failed"
|
|
|
|
|
2022-02-12 04:29:20 +03:00
|
|
|
set +ex
|