From f8d6175b357c0e47fffeb6215a181abf52c79dc3 Mon Sep 17 00:00:00 2001 From: e11sy Date: Sun, 25 Feb 2024 16:34:34 +0300 Subject: [PATCH 1/2] migrate data editorTools null to '[]' --- migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql diff --git a/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql b/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql new file mode 100644 index 00000000..523af7f2 --- /dev/null +++ b/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql @@ -0,0 +1 @@ +UPDATE public.users SET "editor_tools" = '[]'::jsonb WHERE "editor_tools" = null \ No newline at end of file From 5f7fa44bf081d5c1a574238ed1ad043ae55a1a07 Mon Sep 17 00:00:00 2001 From: e11sy Date: Sun, 25 Feb 2024 17:00:29 +0300 Subject: [PATCH 2/2] updated migration --- .../tenant/0022-user@editor-tools-null-to-empty-array.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql b/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql index 523af7f2..f95acb9c 100644 --- a/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql +++ b/migrations/tenant/0022-user@editor-tools-null-to-empty-array.sql @@ -1 +1 @@ -UPDATE public.users SET "editor_tools" = '[]'::jsonb WHERE "editor_tools" = null \ No newline at end of file +UPDATE public.users SET "editor_tools" = COALESCE(editor_tools, '[]'::jsonb) \ No newline at end of file