diff --git a/db/compose.yml b/db/compose.yml index 0eb7c97..dfc1e15 100644 --- a/db/compose.yml +++ b/db/compose.yml @@ -8,6 +8,8 @@ services: ports: - 5432:5432 environment: - POSTGRES_PASSWORD: postgres + POSTGRES_USER: alice + POSTGRES_PASSWORD: alice + POSTGRES_DB: alice volumes: - ./_data:/var/lib/postgresql/data diff --git a/db/init.sh b/db/init.sh index 26c519c..2c9cb2b 100755 --- a/db/init.sh +++ b/db/init.sh @@ -24,11 +24,11 @@ if [ -z $PGDATABASE ]; then fi if [ -z $PGUSER ]; then - export PGUSER="postgres" + export PGUSER="alice" fi if [ -z $PGPASSWORD ]; then - export PGPASSWORD="postgres" + export PGPASSWORD="alice" fi ## Commandline opts: @@ -61,7 +61,7 @@ fi if [ $OPT_CLEAR -eq 1 ]; then echo "++ clearing database" - $PSQL template1 -c "DROP DATABASE $PGDATABASE" + $PSQL template1 -c "DROP DATABASE IF EXISTS $PGDATABASE" $PSQL template1 -c "CREATE DATABASE $PGDATABASE" fi ######################################################################