mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
create-db.sql: Start by dropping the zulip database if needed.
At some point the PostgreSQL Docker image started creating the zulip database for us, which caused our CREATE DATABASE to fail. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
b0ea81fe16
commit
bc752188e7
@@ -1,3 +1,5 @@
|
||||
\connect postgres
|
||||
DROP DATABASE IF EXISTS zulip;
|
||||
DO $$BEGIN
|
||||
CREATE USER zulip;
|
||||
EXCEPTION WHEN duplicate_object THEN
|
||||
|
||||
@@ -44,10 +44,6 @@ source "$(dirname "$0")/terminate-psql-sessions" postgres zulip zulip_base
|
||||
# Make sure the current working directory is readable by postgres
|
||||
cd /
|
||||
|
||||
su "$POSTGRES_USER" -c 'psql -v ON_ERROR_STOP=1 -e' <<EOF
|
||||
DROP DATABASE IF EXISTS zulip;
|
||||
EOF
|
||||
|
||||
su "$POSTGRES_USER" -c 'psql -v ON_ERROR_STOP=1 -e' < "$(dirname "$0")/create-db.sql"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user