zulip/scripts/setup/postgres-init-db

20 lines
322 B
Plaintext
Executable File

#/bin/sh -xe
su postgres -c psql <<EOF
CREATE USER zulip;
ALTER USER zulip CREATEDB;
ALTER ROLE zulip SET search_path TO zulip,public;
EOF
su postgres -c psql <<EOF
DROP DATABASE IF EXISTS zulip;
CREATE DATABASE zulip OWNER=zulip;
EOF
su postgres -c psql <<EOF
DROP SCHEMA public CASCADE;
EOF
echo "Database created"