From a7dc0a6f338986cc6415d157583e143f1b0b2eea Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Wed, 19 Apr 2023 09:11:27 +0200 Subject: [PATCH] Revert Sample Data migrations (#11134) --- bootstrap/bootstrap_storage.sh | 2 +- .../v008__create_db_connection_info.sql | 20 ------------------- .../v008__create_db_connection_info.sql | 17 ---------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/bootstrap/bootstrap_storage.sh b/bootstrap/bootstrap_storage.sh index d451dbf8341..f5b43e3d638 100755 --- a/bootstrap/bootstrap_storage.sh +++ b/bootstrap/bootstrap_storage.sh @@ -97,7 +97,7 @@ drop-create-all ) execute "drop" && execute "create" && execute "es-drop" && execute "es-create" ;; migrate-all ) - execute "migrate" && execute "es-migrate" + execute "repair" && execute "migrate" && execute "es-migrate" ;; rotate ) execute "rotate" diff --git a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v008__create_db_connection_info.sql b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v008__create_db_connection_info.sql index f04d48c4834..0fcf27528c2 100644 --- a/bootstrap/sql/com.mysql.cj.jdbc.Driver/v008__create_db_connection_info.sql +++ b/bootstrap/sql/com.mysql.cj.jdbc.Driver/v008__create_db_connection_info.sql @@ -8,26 +8,6 @@ SET json = JSON_INSERT( JSON_EXTRACT(json, '$.connection.config.tagCategoryName') ) where serviceType in ('BigQuery'); --- Deprecate SampleData db service type --- * Delete ingestion pipelines associated to the services -DELETE ipe -FROM ingestion_pipeline_entity ipe -INNER JOIN entity_relationship er - ON ( - er.toId = ipe.id - AND fromEntity = "databaseService" - AND fromId IN (SELECT id FROM dbservice_entity de WHERE serviceType = 'SampleData') - ); --- * Delete relationships -DELETE er -FROM entity_relationship er -JOIN dbservice_entity db - ON db.id = er.fromId - OR db.id = er.toId -WHERE db.serviceType = 'SampleData'; --- * Delete services -DELETE FROM dbservice_entity where serviceType = 'SampleData'; - -- Delete supportsUsageExtraction from vertica UPDATE dbservice_entity SET json = JSON_REMOVE(json, '$.connection.config.supportsUsageExtraction') diff --git a/bootstrap/sql/org.postgresql.Driver/v008__create_db_connection_info.sql b/bootstrap/sql/org.postgresql.Driver/v008__create_db_connection_info.sql index b49d6c68a65..963e55b48ae 100644 --- a/bootstrap/sql/org.postgresql.Driver/v008__create_db_connection_info.sql +++ b/bootstrap/sql/org.postgresql.Driver/v008__create_db_connection_info.sql @@ -7,23 +7,6 @@ SET json = jsonb_set(json, '{connection,config,classificationName}', json#>'{con where serviceType in ('BigQuery') and json#>'{connection,config,tagCategoryName}' is not null; --- Deprecate SampleData db service type --- * Delete ingestion pipelines associated to the services -DELETE FROM ingestion_pipeline_entity ipe -USING entity_relationship er -WHERE ( - er.toId = ipe.id - AND fromEntity = 'databaseService' - AND fromId IN (SELECT id FROM dbservice_entity de WHERE serviceType = 'SampleData') -); --- * Delete relationships -DELETE FROM entity_relationship er -USING dbservice_entity db -WHERE (db.id = er.fromId OR db.id = er.toId) - AND db.serviceType = 'SampleData'; --- * Delete services -DELETE FROM dbservice_entity WHERE serviceType = 'SampleData'; - -- Delete supportsUsageExtraction from vertica UPDATE dbservice_entity SET json = json::jsonb #- '{connection,config,supportsUsageExtraction}'