From 6e80d3f405ffb214635585464455faeeb0238879 Mon Sep 17 00:00:00 2001 From: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Date: Fri, 9 Aug 2024 20:58:44 +0530 Subject: [PATCH] Fix Migrations (#17364) --- .../native/1.5.0/mysql/schemaChanges.sql | 14 ++++++++++++++ .../native/1.5.0/postgres/schemaChanges.sql | 14 ++++++++++++++ .../connections/testConnectionDefinition.json | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) 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 e8344f674e3..b8e4551c869 100644 --- a/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.5.0/mysql/schemaChanges.sql @@ -276,6 +276,20 @@ update thread_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.ow update topic_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; update type_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; update user_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update test_case set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update installed_apps set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update apps_marketplace set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update classification set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update storage_container_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update data_insight_chart set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update doc_store set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update tag set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update test_connection_definition set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update test_definition set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update test_suite set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update topic_entity set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update web_analytic_event set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; +update automations_workflow set json = JSON_REMOVE(json, '$.owner') where json -> '$.owner' is not null; update table_entity set json = JSON_SET( JSON_REMOVE(json, '$.dataModel.owner'), 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 0a6246b3f2d..ac4dadaae9b 100644 --- a/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql @@ -263,6 +263,20 @@ update thread_entity set json = json#-'{owner}' where json #>> '{owner}' is not update topic_entity set json = json#-'{owner}' where json #>> '{owner}' is not null; update type_entity set json = json#-'{owner}' where json #>> '{owner}' is not null; update user_entity set json = json#-'{owner}' where json #>> '{owner}' is not null; +update test_case set json = json#-'{owner}' where json #>> '{owner}' is not null; +update installed_apps set json = json#-'{owner}' where json #>> '{owner}' is not null; +update apps_marketplace set json = json#-'{owner}' where json #>> '{owner}' is not null; +update classification set json = json#-'{owner}' where json #>> '{owner}' is not null; +update storage_container_entity set json = json#-'{owner}' where json #>> '{owner}' is not null; +update data_insight_chart set json = json#-'{owner}' where json #>> '{owner}' is not null; +update doc_store set json = json#-'{owner}' where json #>> '{owner}' is not null; +update tag set json = json#-'{owner}' where json #>> '{owner}' is not null; +update test_connection_definition set json = json#-'{owner}' where json #>> '{owner}' is not null; +update test_definition set json = json#-'{owner}' where json #>> '{owner}' is not null; +update test_suite set json = json#-'{owner}' where json #>> '{owner}' is not null; +update topic_entity set json = json#-'{owner}' where json #>> '{owner}' is not null; +update web_analytic_event set json = json#-'{owner}' where json #>> '{owner}' is not null; +update automations_workflow set json = json#-'{owner}' where json #>> '{owner}' is not null; update table_entity set json = jsonb_set(json#-'{dataModel,owner}', '{dataModel,owners}', jsonb_build_array(json#>'{dataModel,owner}')) where json #>> '{dataModel,owner}' is not null; diff --git a/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/testConnectionDefinition.json b/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/testConnectionDefinition.json index 6f1847d8023..d36b66bed86 100644 --- a/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/testConnectionDefinition.json +++ b/openmetadata-spec/src/main/resources/json/schema/entity/services/connections/testConnectionDefinition.json @@ -67,7 +67,7 @@ "$ref": "#/definitions/testConnectionStep" } }, - "owner": { + "owners": { "description": "Owner of this TestConnection definition.", "$ref": "../../../type/entityReferenceList.json", "default": null