From 3dc4a4f3d1d67c3e4ea2bb4fd09474ebe8664505 Mon Sep 17 00:00:00 2001 From: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Date: Thu, 11 Apr 2024 15:13:16 +0530 Subject: [PATCH] Fix SQLs (#15859) * Fix SQLs * Update SQls * Update bootstrap/sql/migrations/native/1.3.3/postgres/schemaChanges.sql * Update bootstrap/sql/migrations/native/1.3.3/mysql/schemaChanges.sql --------- Co-authored-by: Pere Miquel Brull --- .../native/1.3.3/mysql/schemaChanges.sql | 1 + .../native/1.3.3/postgres/schemaChanges.sql | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 bootstrap/sql/migrations/native/1.3.3/mysql/schemaChanges.sql create mode 100644 bootstrap/sql/migrations/native/1.3.3/postgres/schemaChanges.sql diff --git a/bootstrap/sql/migrations/native/1.3.3/mysql/schemaChanges.sql b/bootstrap/sql/migrations/native/1.3.3/mysql/schemaChanges.sql new file mode 100644 index 00000000000..19d35f21cc8 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.3.3/mysql/schemaChanges.sql @@ -0,0 +1 @@ +-- Nothing to add here. 1.3.3 migrations only needed for postgres \ No newline at end of file diff --git a/bootstrap/sql/migrations/native/1.3.3/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.3.3/postgres/schemaChanges.sql new file mode 100644 index 00000000000..840557a6173 --- /dev/null +++ b/bootstrap/sql/migrations/native/1.3.3/postgres/schemaChanges.sql @@ -0,0 +1,32 @@ +-- change scheduleType to scheduleTimeline, this was failing earlier in 1.3.2 so updating it here +UPDATE installed_apps +SET json = jsonb_set( + json::jsonb, + '{appSchedule}', + jsonb_set( + json->'appSchedule', + '{scheduleTimeline}', + json->'appSchedule'->'scheduleType' + ) - 'scheduleType', + true + ) +WHERE json->'appSchedule'->>'scheduleType' IS NOT NULL; + +delete from apps_extension_time_series; + +-- Change systemApp to system, this was failing earlier in 1.3.2 so updating it here +UPDATE installed_apps +SET json = jsonb_set( + json::jsonb, + '{system}', + json->'systemApp' + ) - 'systemApp' +WHERE json ? 'systemApp'; + +UPDATE apps_marketplace +SET json = jsonb_set( + json::jsonb, + '{system}', + json->'systemApp' + ) - 'systemApp' +WHERE json ? 'systemApp';