diff --git a/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql index f54e38990cc..dbbb97ad293 100644 --- a/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql @@ -225,5 +225,9 @@ UPDATE openmetadata_settings SET json = JSON_SET(json, '$.templates', 'openmetadata') WHERE configType = 'emailConfiguration'; -ALTER TABLE thread_entity ADD COLUMN domain VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.domain'); +-- remove dangling owner and service from ingestion pipelines. This info is in entity_relationship +UPDATE ingestion_pipeline_entity +SET json = JSON_REMOVE(json, '$.owner', '$.service'); + +ALTER TABLE thread_entity ADD COLUMN domain VARCHAR(256) GENERATED ALWAYS AS (json ->> '$.domain'); diff --git a/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql index 93058e71869..6483cfc9cc7 100644 --- a/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql @@ -206,5 +206,14 @@ UPDATE openmetadata_settings SET json = jsonb_set(json, '{templates}', '"openmetadata"') WHERE configType = 'emailConfiguration'; -ALTER TABLE thread_entity ADD COLUMN domain VARCHAR(256) GENERATED ALWAYS AS (json ->> 'domain') STORED; +-- remove dangling owner and service from ingestion pipelines. This info is in entity_relationship +UPDATE ingestion_pipeline_entity +SET json = json::jsonb #- '{owner}' +WHERE json #> '{owner}' IS NOT NULL; + +UPDATE ingestion_pipeline_entity +SET json = json::jsonb #- '{service}' +WHERE json #> '{service}' IS NOT NULL; + +ALTER TABLE thread_entity ADD COLUMN domain VARCHAR(256) GENERATED ALWAYS AS (json ->> 'domain') STORED;