mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
This fixes some issues that we've had where commands will fail is confusing ways after the database is rebuilt because data from before the database was dropped is still in the memcached cache.
22 lines
430 B
Bash
Executable File
22 lines
430 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
|
|
|
|
sh "$(dirname "$0")/flush-memcached"
|
|
|
|
echo "Database created"
|
|
|