diff --git a/bootstrap/sql/migrations/native/1.10.3/mysql/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.10.3/mysql/postDataMigrationSQLScript.sql index 775da1b8189..948c51620cd 100644 --- a/bootstrap/sql/migrations/native/1.10.3/mysql/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.10.3/mysql/postDataMigrationSQLScript.sql @@ -6,15 +6,3 @@ SET json = JSON_ARRAY_INSERT( ) WHERE JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMBER"') AND NOT JSON_CONTAINS(json->'$.supportedDataTypes', '"NUMERIC"'); - -UPDATE test_definition -SET json = JSON_SET( - json, - '$.testPlatforms', - CAST(REPLACE( - JSON_EXTRACT(json, '$.testPlatforms'), - '"DBT"', - '"dbt"' - ) AS JSON) -) -WHERE JSON_CONTAINS(json, '"DBT"', '$.testPlatforms'); \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.10.3/postgres/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.10.3/postgres/postDataMigrationSQLScript.sql index e9fb313d7ad..844856673b1 100644 --- a/bootstrap/sql/migrations/native/1.10.3/postgres/postDataMigrationSQLScript.sql +++ b/bootstrap/sql/migrations/native/1.10.3/postgres/postDataMigrationSQLScript.sql @@ -6,16 +6,4 @@ SET json = jsonb_set( true ) WHERE json->'supportedDataTypes' @> '"NUMBER"'::jsonb - AND NOT (json->'supportedDataTypes' @> '"NUMERIC"'::jsonb); - -UPDATE test_definition -SET json = jsonb_set( - json::jsonb, - '{testPlatforms}', - REPLACE( - (json::jsonb -> 'testPlatforms')::text, - '"DBT"', - '"dbt"' - )::jsonb -)::json -WHERE json::jsonb -> 'testPlatforms' @> '"DBT"'::jsonb; \ No newline at end of file + AND NOT (json->'supportedDataTypes' @> '"NUMERIC"'::jsonb); \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.10.4/mysql/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.10.4/mysql/postDataMigrationSQLScript.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/bootstrap/sql/migrations/native/1.10.4/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.10.4/mysql/schemaChanges.sql new file mode 100644 index 00000000000..133ffee07c2 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.10.4/mysql/schemaChanges.sql @@ -0,0 +1,11 @@ +UPDATE test_definition +SET json = JSON_SET( + json, + '$.testPlatforms', + CAST(REPLACE( + JSON_EXTRACT(json, '$.testPlatforms'), + '"DBT"', + '"dbt"' + ) AS JSON) +) +WHERE JSON_CONTAINS(json, '"DBT"', '$.testPlatforms'); \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.10.4/postgres/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.10.4/postgres/postDataMigrationSQLScript.sql new file mode 100644 index 00000000000..e69de29bb2d diff --git a/bootstrap/sql/migrations/native/1.10.4/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.10.4/postgres/schemaChanges.sql new file mode 100644 index 00000000000..0db3659c34e --- /dev/null +++ b/bootstrap/sql/migrations/native/1.10.4/postgres/schemaChanges.sql @@ -0,0 +1,11 @@ +UPDATE test_definition +SET json = jsonb_set( + json::jsonb, + '{testPlatforms}', + REPLACE( + (json::jsonb -> 'testPlatforms')::text, + '"DBT"', + '"dbt"' + )::jsonb +)::json +WHERE json::jsonb -> 'testPlatforms' @> '"DBT"'::jsonb; \ No newline at end of file diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v157/MigrationUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v157/MigrationUtil.java index ddba4e9d1d7..ee05ae4ed48 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v157/MigrationUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v157/MigrationUtil.java @@ -33,19 +33,24 @@ public class MigrationUtil { } offset += pageSize; for (String json : jsons) { - TestCase testCase = JsonUtils.readValue(json, TestCase.class); - TestDefinition td = getTestDefinition(daoCollection, testCase); - if (Objects.nonNull(td) && Objects.equals(td.getName(), TABLE_DIFF)) { - LOG.debug("Adding caseSensitiveColumns=true table diff test case: {}", testCase.getId()); - if (!hasCaseSensitiveColumnsParam(testCase.getParameterValues())) { - testCase - .getParameterValues() - .add( - new TestCaseParameterValue() - .withName("caseSensitiveColumns") - .withValue("true")); + try { + TestCase testCase = JsonUtils.readValue(json, TestCase.class); + TestDefinition td = getTestDefinition(daoCollection, testCase); + if (Objects.nonNull(td) && Objects.equals(td.getName(), TABLE_DIFF)) { + LOG.debug( + "Adding caseSensitiveColumns=true table diff test case: {}", testCase.getId()); + if (!hasCaseSensitiveColumnsParam(testCase.getParameterValues())) { + testCase + .getParameterValues() + .add( + new TestCaseParameterValue() + .withName("caseSensitiveColumns") + .withValue("true")); + } + daoCollection.testCaseDAO().update(testCase); } - daoCollection.testCaseDAO().update(testCase); + } catch (Exception e) { + LOG.error("Error migrating test definition: ", e); } } } diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataQualityAndProfiler.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataQualityAndProfiler.spec.ts index 852f26615a7..08ca588518b 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataQualityAndProfiler.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataQualityAndProfiler.spec.ts @@ -1185,7 +1185,7 @@ test('TestCase filters', PLAYWRIGHT_INGESTION_TAG_OBJ, async ({ page }) => { // Test case filter by platform const testCasePlatformByDBT = page.waitForResponse( - `/api/v1/dataQuality/testCases/search/list?*testPlatforms=DBT*` + `/api/v1/dataQuality/testCases/search/list?*testPlatforms=dbt*` ); await page.getByTestId('platform-select-filter').click(); await page.getByTitle('DBT').click();