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 743bdbe2bf3..1ad08a41a4e 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 @@ -111,3 +111,8 @@ DELETE FROM entity_extension WHERE id IN (SELECT DISTINCT tableId FROM temp_query_migration) AND extension = "table.tableQueries"; DROP Table temp_query_migration; + +-- remove the audience if it was wrongfully sent from the UI after editing the OM service +UPDATE metadata_service_entity +SET json = JSON_REMOVE(json, '$.connection.config.securityConfig.audience') +WHERE name = 'OpenMetadata' AND JSON_EXTRACT(json, '$.connection.config.authProvider') != 'google'; 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 dfaf8f4cb4a..ee83e175537 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 @@ -112,3 +112,10 @@ DELETE FROM entity_extension WHERE id in (SELECT DISTINCT tableId FROM temp_query_migration) AND extension = 'table.tableQueries'; DROP TABLE temp_query_migration; + +-- remove the audience if it was wrongfully sent from the UI after editing the OM service +UPDATE metadata_service_entity +SET json = json::jsonb #- '{connection,config,securityConfig,audience}' +WHERE name = 'OpenMetadata' + AND json#>'{connection,config,authProvider}' IS NOT NULL + AND json -> 'connection' -> 'config' ->> 'authProvider' != 'google'; \ No newline at end of file