2015-08-21 07:17:25 +02:00
|
|
|
#!/bin/sh -xe
|
2013-02-25 21:46:36 +01:00
|
|
|
|
2013-11-13 02:32:52 +01:00
|
|
|
su postgres -c psql <<EOF
|
|
|
|
CREATE USER zulip;
|
|
|
|
ALTER ROLE zulip SET search_path TO zulip,public;
|
|
|
|
DROP DATABASE IF EXISTS zulip;
|
2013-11-13 04:29:49 +01:00
|
|
|
CREATE DATABASE zulip OWNER=zulip;
|
2013-02-25 21:46:36 +01:00
|
|
|
EOF
|
|
|
|
|
2015-08-28 19:40:29 +02:00
|
|
|
su postgres -c 'psql zulip' <<EOF
|
2015-08-28 18:37:46 +02:00
|
|
|
CREATE SCHEMA zulip AUTHORIZATION zulip;
|
2015-08-21 07:17:25 +02:00
|
|
|
CREATE EXTENSION tsearch_extras SCHEMA zulip;
|
|
|
|
EOF
|
|
|
|
|
2013-02-25 21:46:36 +01:00
|
|
|
echo "Database created"
|
|
|
|
|