From d90bda3b2765181c266bfeb664e56509edd47fae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:59:08 +0000 Subject: [PATCH 1/2] Initial plan From e7937fee1cb82ef78fad4af0f09e9d92e82d72fa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 22 Jan 2026 17:00:52 +0000 Subject: [PATCH 2/2] Add COALESCE to migrations to prevent null arrays Co-authored-by: joaquimds <12935136+joaquimds@users.noreply.github.com> --- .../1769099632447_boundary_config_add_id.ts | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/migrations/1769099632447_boundary_config_add_id.ts b/migrations/1769099632447_boundary_config_add_id.ts index 8ee71595..706581e5 100644 --- a/migrations/1769099632447_boundary_config_add_id.ts +++ b/migrations/1769099632447_boundary_config_add_id.ts @@ -9,12 +9,15 @@ export async function up(db: Kysely): Promise { inspector_config, '{boundaries}', ( - SELECT jsonb_agg( - jsonb_set( - boundary, - '{id}', - to_jsonb(gen_random_uuid()::text) - ) + SELECT COALESCE( + jsonb_agg( + jsonb_set( + boundary, + '{id}', + to_jsonb(gen_random_uuid()::text) + ) + ), + '[]'::jsonb ) FROM jsonb_array_elements(inspector_config->'boundaries') AS boundary ) @@ -31,7 +34,10 @@ export async function down(db: Kysely): Promise { inspector_config, '{boundaries}', ( - SELECT jsonb_agg(boundary - 'id') + SELECT COALESCE( + jsonb_agg(boundary - 'id'), + '[]'::jsonb + ) FROM jsonb_array_elements(inspector_config->'boundaries') AS boundary ) )