From 704385da0a91a5fbfada98ed6d43d81240bed2d0 Mon Sep 17 00:00:00 2001 From: Teddy Date: Tue, 30 Aug 2022 18:43:12 +0200 Subject: [PATCH] Clean up profile and test data when migrating from 0.11 to 0.12 (#7039) * Added SQL to clean up profile and test data when migrating from 0.11 to 0.12 * Added deletion query for ingestion pipeline mysql * Added logic to delete profiler ingestion pipeline from DB * Update v004__create_db_connection_info.sql added semicolon --- .../v004__create_db_connection_info.sql | 6 ++++++ .../v004__create_db_connection_info.sql | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v004__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v004__create_db_connection_info.sql index 27f5f81b476..948eabc1ca0 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v004__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v004__create_db_connection_info.sql @@ -104,3 +104,9 @@ CREATE TABLE IF NOT EXISTS openmetadata_settings ( PRIMARY KEY (id, configType), UNIQUE(configType) ); + +DELETE FROM entity_extension +WHERE jsonSchema IN ('tableProfile', 'columnTest', 'tableTest'); + +DELETE FROM ingestion_pipeline_entity +WHERE LOWER(JSON_EXTRACT(json, '$.pipelineType') = 'profiler'); \ No newline at end of file diff --git a/bootstrap/sql/org.postgresql.Driver/v004__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v004__create_db_connection_info.sql index 14695197bc0..8054ba045f2 100644 --- a/bootstrap/sql/org.postgresql.Driver/v004__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v004__create_db_connection_info.sql @@ -100,3 +100,8 @@ CREATE TABLE IF NOT EXISTS openmetadata_settings ( UNIQUE(configType) ); +DELETE FROM entity_extension +WHERE jsonSchema IN ('tableProfile', 'columnTest', 'tableTest'); + +DELETE FROM ingestion_pipeline_entity +WHERE json_extract_path_text("json", 'pipelineType') = 'profiler';