Fix migrations (#11083)

This commit is contained in:
Pere Miquel Brull 2023-04-17 10:53:25 +02:00 committed by GitHub
parent a3ce1dfa4e
commit 1cabfc99ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -185,3 +185,18 @@ JSON_OBJECT(
WHERE serviceType = 'Tableau'
AND JSON_EXTRACT(json, '$.connection.config.personalAccessTokenName') is not null
AND JSON_EXTRACT(json, '$.connection.config.personalAccessTokenSecret') is not null;
-- Removed property from metadataService.json
UPDATE metadata_service_entity
SET json = JSON_REMOVE(json, '$.allowServiceCreation')
WHERE serviceType in ('Amundsen', 'Atlas', 'MetadataES', 'OpenMetadata');
UPDATE metadata_service_entity
SET json = JSON_INSERT(json, '$.provider', 'system')
WHERE name = 'OpenMetadata';
-- Fix Glue sample data endpoint URL to be a correct URI
UPDATE dbservice_entity
SET json = JSON_REPLACE(json, '$.connection.config.awsConfig.endPointURL', 'https://glue.region_name.amazonaws.com/')
WHERE serviceType = 'Glue'
AND JSON_EXTRACT(json, '$.connection.config.awsConfig.endPointURL') = 'https://glue.<region_name>.amazonaws.com/';

View File

@ -185,3 +185,18 @@ jsonb_build_object('authType',jsonb_build_object(
where servicetype = 'Tableau'
and json#>'{connection,config,personalAccessTokenName}' is not null
and json#>'{connection,config,personalAccessTokenSecret}' is not null;
-- Removed property from metadataService.json
UPDATE metadata_service_entity
SET json = json::jsonb #- '{,allowServiceCreation}'
WHERE serviceType in ('Amundsen', 'Atlas', 'MetadataES', 'OpenMetadata');
UPDATE metadata_service_entity
SET json = JSONB_SET(json::jsonb, '{provider}', 'system')
WHERE name = 'OpenMetadata';
-- Fix Glue sample data endpoint URL to be a correct URI
UPDATE dbservice_entity
SET json = JSONB_SET(json::jsonb, '{connection,config,awsConfig,endPointURL}', 'https://glue.region_name.amazonaws.com/')
WHERE serviceType = 'Glue'
AND json#>'{connection,config,awsConfig,endPointURL}' = 'https://glue.<region_name>.amazonaws.com/';