From 451d73593e813151c24f2c1d17efb3dcdebb71c8 Mon Sep 17 00:00:00 2001 From: Teddy Date: Wed, 29 May 2024 10:49:27 +0200 Subject: [PATCH] [MINOR] partition migration issue with redshift servics (#16452) * fix: partition migration issue with redshift servics * chore: typo in sql comment --- .../native/1.4.2/mysql/postDataMigrationSQLScript.sql | 5 +++++ .../sql/migrations/native/1.4.2/mysql/schemaChanges.sql | 0 .../native/1.4.2/postgres/postDataMigrationSQLScript.sql | 5 +++++ .../sql/migrations/native/1.4.2/postgres/schemaChanges.sql | 0 4 files changed, 10 insertions(+) create mode 100644 bootstrap/sql/migrations/native/1.4.2/mysql/postDataMigrationSQLScript.sql create mode 100644 bootstrap/sql/migrations/native/1.4.2/mysql/schemaChanges.sql create mode 100644 bootstrap/sql/migrations/native/1.4.2/postgres/postDataMigrationSQLScript.sql create mode 100644 bootstrap/sql/migrations/native/1.4.2/postgres/schemaChanges.sql diff --git a/bootstrap/sql/migrations/native/1.4.2/mysql/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.4.2/mysql/postDataMigrationSQLScript.sql new file mode 100644 index 000000000000..758d4e2cfd95 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.4.2/mysql/postDataMigrationSQLScript.sql @@ -0,0 +1,5 @@ +-- Fix hanging partition migration +-- in 1.4.x `tablePartition.intervalType` should not exists +UPDATE table_entity +SET json = JSON_REMOVE(json, '$.tablePartition') +WHERE JSON_EXTRACT(json, '$.tablePartition.intervalType') IS NOT NULL; \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.4.2/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.4.2/mysql/schemaChanges.sql new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/bootstrap/sql/migrations/native/1.4.2/postgres/postDataMigrationSQLScript.sql b/bootstrap/sql/migrations/native/1.4.2/postgres/postDataMigrationSQLScript.sql new file mode 100644 index 000000000000..10f21b170185 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.4.2/postgres/postDataMigrationSQLScript.sql @@ -0,0 +1,5 @@ +-- Fix hanging partition migration +-- in 1.4.x `tablePartition.intervalType` should not exists +UPDATE table_entity +SET json = json - 'tablePartition' +WHERE json->'tablePartition'->'intervalType' is not null; \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.4.2/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.4.2/postgres/schemaChanges.sql new file mode 100644 index 000000000000..e69de29bb2d1