diff --git a/tools/postgres-init-db b/tools/postgres-init-db new file mode 100755 index 0000000000..8440de36b0 --- /dev/null +++ b/tools/postgres-init-db @@ -0,0 +1,16 @@ +#/bin/sh -xe + +PASSWORD=xxxxxxxxxxxx + +sudo -u postgres psql << EOF +DROP SCHEMA public CASCADE; +CREATE DATABASE humbug; +CREATE USER humbug WITH PASSWORD '$PASSWORD'; +GRANT ALL ON DATABASE humbug TO humbug; +EOF + +echo "Database created" + +umask go-rw +echo "*:*:*:humbug:$PASSWORD" >> ~/.pgpass +chmod go-rw ~/.pgpass