| 
									
										
										
										
											2023-08-18 14:54:43 +02:00
										 |  |  | -- queries to rename params to connectionOptions for trino
 | 
					
						
							| 
									
										
										
										
											2023-08-17 14:39:05 -07:00
										 |  |  | UPDATE dbservice_entity
 | 
					
						
							| 
									
										
										
										
											2023-08-18 14:54:43 +02:00
										 |  |  | SET json = jsonb_set(
 | 
					
						
							|  |  |  |     json,
 | 
					
						
							|  |  |  |     '{connection,config,connectionOptions}',
 | 
					
						
							|  |  |  |     jsonb_extract_path(json, 'connection', 'config', 'params'),
 | 
					
						
							|  |  |  |     true
 | 
					
						
							|  |  |  | )
 | 
					
						
							| 
									
										
										
										
											2023-08-17 14:39:05 -07:00
										 |  |  | WHERE serviceType = 'Trino';
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | UPDATE dbservice_entity
 | 
					
						
							| 
									
										
										
										
											2023-08-18 14:54:43 +02:00
										 |  |  | SET json = json::jsonb #- '{connection,config,params}'
 | 
					
						
							|  |  |  | where json #> '{serviceType}' in ('"Trino"');
 | 
					
						
							| 
									
										
										
										
											2023-08-17 14:39:05 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | -- Modify migrations for service connection of trino to move password under authType
 | 
					
						
							|  |  |  | UPDATE dbservice_entity
 | 
					
						
							| 
									
										
										
										
											2023-08-18 14:54:43 +02:00
										 |  |  | SET json =  jsonb_set(
 | 
					
						
							|  |  |  | json #-'{connection,config,password}',
 | 
					
						
							|  |  |  | '{connection,config,authType}',
 | 
					
						
							|  |  |  | jsonb_build_object('password',json#>'{connection,config,password}')
 | 
					
						
							|  |  |  | )
 | 
					
						
							|  |  |  | WHERE serviceType = 'Trino'
 | 
					
						
							|  |  |  |   and json#>'{connection,config,password}' is not null;
 |