From 1cabfc99ca9c770f286c64a8190bcc08b051bd66 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Mon, 17 Apr 2023 10:53:25 +0200 Subject: [PATCH] Fix migrations (#11083) --- .../v009__create_db_connection_info.sql | 15 +++++++++++++++ .../v009__create_db_connection_info.sql | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v009__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v009__create_db_connection_info.sql index 57e0285dd67..6dde9bdf585 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v009__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v009__create_db_connection_info.sql @@ -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..amazonaws.com/'; diff --git a/bootstrap/sql/org.postgresql.Driver/v009__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v009__create_db_connection_info.sql index d544b061152..7dc87bbd47d 100644 --- a/bootstrap/sql/org.postgresql.Driver/v009__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v009__create_db_connection_info.sql @@ -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..amazonaws.com/';