From b56f1d08a82b79c0832868d0e36dd38f5b295b84 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Fri, 2 Aug 2024 06:49:02 +0200 Subject: [PATCH] MINOR - remove owner and service field from ingestion pipeline (#17270) * MINOR - remove owner and service field from ingestion pipeline * MINOR - remove owner and service field from ingestion pipeline --- .../migrations/native/1.5.0/mysql/schemaChanges.sql | 6 +++++- .../native/1.5.0/postgres/schemaChanges.sql | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) 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;