2020-08-08 15:04:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-09-11 09:19:18 +02:00
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" template1 -c 'CREATE EXTENSION hstore;'
|
|
|
|
|
2020-08-08 15:04:59 +02:00
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
|
|
CREATE USER hydra WITH ENCRYPTED PASSWORD 'hydra';
|
|
|
|
CREATE DATABASE hydra;
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE hydra TO hydra;
|
|
|
|
EOSQL
|
|
|
|
|
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
|
|
CREATE USER guesstimate WITH ENCRYPTED PASSWORD 'guesstimate';
|
|
|
|
CREATE DATABASE guesstimate;
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE guesstimate TO guesstimate;
|
|
|
|
ALTER DATABASE guesstimate OWNER TO guesstimate;
|
|
|
|
EOSQL
|