Files
zulip/tools/postgres-init-db
Luke Faraone 903fbbe38e Script to automate creating a database for Humbug.
(imported from commit d44cd5ca1ab3383a8c262ed287f075cf21e3b129)
2013-02-28 15:40:21 -05:00

17 lines
311 B
Plaintext
Executable File

#/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