Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

The migration 1769099632447_boundary_config_add_id.ts uses jsonb_agg which returns null when aggregating zero rows, causing empty boundaries arrays to become null.

Changes:

  • Wrapped jsonb_agg calls in both up and down migrations with COALESCE(jsonb_agg(...), '[]'::jsonb) to preserve empty arrays
-- Before
SELECT jsonb_agg(
  jsonb_set(boundary, '{id}', to_jsonb(gen_random_uuid()::text))
)

-- After  
SELECT COALESCE(
  jsonb_agg(
    jsonb_set(boundary, '{id}', to_jsonb(gen_random_uuid()::text))
  ),
  '[]'::jsonb
)

This ensures inspector configs with empty boundaries arrays maintain their structure through migrations.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: joaquimds <12935136+joaquimds@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to change and add data sources for inspector configurations fix: prevent null boundaries in migration when array is empty Jan 22, 2026
Copilot AI requested a review from joaquimds January 22, 2026 17:03
@joaquimds joaquimds marked this pull request as ready for review January 22, 2026 17:07
@joaquimds joaquimds merged commit 5a9dedc into feat/inspector-data Jan 22, 2026
@joaquimds joaquimds deleted the copilot/sub-pr-284 branch January 22, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants