Skip to content

Commit

Permalink
create-db.sql: Handle exception if zulip user already exists.
Browse files Browse the repository at this point in the history
Fixes zulip#13530.

Signed-off-by: Anders Kaseorg <[email protected]>
  • Loading branch information
andersk authored and timabbott committed Jan 16, 2020
1 parent 3cc6ff5 commit 298d45b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/setup/create-db.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
CREATE USER zulip;
DO $$BEGIN
CREATE USER zulip;
EXCEPTION WHEN duplicate_object THEN
RAISE NOTICE 'zulip user already exists';
END$$;
ALTER ROLE zulip SET search_path TO zulip,public;
CREATE DATABASE zulip OWNER=zulip;
\connect zulip
Expand Down

0 comments on commit 298d45b

Please sign in to comment.