zulip/scripts/setup/postgres-init-db

20 lines
392 B
Bash
Executable File

#!/bin/sh -xe
# Make sure the current working directory is readable
cd /
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"