diff --git a/scripts/setup/create-db.sql b/scripts/setup/create-db.sql index 0a714db218..0918864b70 100644 --- a/scripts/setup/create-db.sql +++ b/scripts/setup/create-db.sql @@ -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