Fix Migrations (#12146)

This commit is contained in:
Ayush Shah 2023-06-26 15:06:45 +05:30 committed by GitHub
parent 33c752d2f5
commit 0894d339ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,20 +5,20 @@ where name = 'OpenMetadata';
-- Rename githubCredentials to gitCredentials
UPDATE dashboard_service_entity
SET json = jsonb_set(json, '{connection,config,gitCredentials}', json#>'{connection,config,githubCredentials}')
SET json = jsonb_set(json::jsonb #- '{connection,config,githubCredentials}', '{connection,config,gitCredentials}', json#>'{connection,config,githubCredentials}')
where serviceType = 'Looker'
and json#>'{connection,config,githubCredentials}' is not null;
-- Rename gcsConfig in BigQuery to gcpConfig
UPDATE dbservice_entity
SET json = jsonb_set(json, '{connection,config,credentials,gcpConfig}',
SET json = jsonb_set(json::jsonb #- '{connection,config,credentials,gcsConfig}', '{connection,config,credentials,gcpConfig}',
json#>'{connection,config,credentials,gcsConfig}')
where serviceType in ('BigQuery')
and json#>'{connection,config,credentials,gcsConfig}' is not null;
-- Rename gcsConfig in Datalake to gcpConfig
UPDATE dbservice_entity
SET json = jsonb_set(json, '{connection,config,configSource,securityConfig,gcpConfig}',
SET json = jsonb_set(json::jsonb #- '{connection,config,configSource,securityConfig,gcsConfig}', '{connection,config,configSource,securityConfig,gcpConfig}',
json#>'{connection,config,configSource,securityConfig,gcsConfig}')
where serviceType in ('Datalake')
and json#>'{connection,config,configSource,securityConfig,gcsConfig}' is not null;