INSERT INTO namespace_descendants
(namespace_id, traversal_ids, self_and_descendant_group_ids, all_project_ids, outdated_at, calculated_at)
VALUES
(
  ?,
  ARRAY[?]::bigint[],
  ARRAY_REMOVE(ARRAY[?]::bigint[], NULL),
  ARRAY_REMOVE(ARRAY[?]::bigint[], NULL),
  NULL,
  ?
)
ON CONFLICT(namespace_id)
DO UPDATE SET
  traversal_ids = EXCLUDED.traversal_ids,
  self_and_descendant_group_ids = EXCLUDED.self_and_descendant_group_ids,
  all_project_ids = EXCLUDED.all_project_ids,
  outdated_at = EXCLUDED.outdated_at,
  calculated_at = EXCLUDED.calculated_at
