OpenMetadata/bootstrap/sql/migrations/native/1.11.11/postgres/postDataMigrationSQLScript.sql

11 lines
550 B
SQL

-- Migrate REST API service connections: move flat openAPISchemaURL into nested openAPISchemaConnection object
UPDATE api_service_entity
SET json = jsonb_set(
json #- '{connection,config,openAPISchemaURL}',
'{connection,config,openAPISchemaConnection}',
jsonb_build_object('openAPISchemaURL', json #> '{connection,config,openAPISchemaURL}'),
true
)
WHERE serviceType = 'Rest'
AND jsonb_exists(json -> 'connection' -> 'config', 'openAPISchemaURL')
AND NOT jsonb_exists(json -> 'connection' -> 'config', 'openAPISchemaConnection');