borders/db/init_databases.sh
Alexey Zakharenkov c31a2caf0a SQL formatting
2020-10-23 01:13:45 +03:00

9 lines
271 B
Bash

#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER borders WITH PASSWORD 'borders';
CREATE DATABASE gis;
CREATE DATABASE borders;
GRANT ALL PRIVILEGES ON DATABASE borders TO borders;
EOSQL