zulip/scripts/setup/postgres-init-db

17 lines
332 B
Plaintext
Raw Normal View History

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