make sure dev db timezone is utc
This commit is contained in:
		
							parent
							
								
									d5aeea6dd3
								
							
						
					
					
						commit
						8581088bd4
					
				
							
								
								
									
										15
									
								
								prisma/migrations/20230731135152_timezone_utc/migration.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								prisma/migrations/20230731135152_timezone_utc/migration.sql
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					-- prod is set to utc by default but dev might not be
 | 
				
			||||||
 | 
					CREATE OR REPLACE FUNCTION set_timezone_utc_currentdb()
 | 
				
			||||||
 | 
					RETURNS INTEGER
 | 
				
			||||||
 | 
					LANGUAGE plpgsql
 | 
				
			||||||
 | 
					AS $$
 | 
				
			||||||
 | 
					DECLARE
 | 
				
			||||||
 | 
					BEGIN
 | 
				
			||||||
 | 
					    EXECUTE 'ALTER DATABASE '||current_database()||' SET TIMEZONE TO ''UTC''';
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					EXCEPTION WHEN OTHERS THEN
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					END;
 | 
				
			||||||
 | 
					$$;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SELECT set_timezone_utc_currentdb();
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user