mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			12 lines
		
	
	
		
			314 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			314 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
| \connect postgres
 | |
| DROP DATABASE IF EXISTS 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
 | |
| CREATE SCHEMA zulip AUTHORIZATION zulip;
 |