7.0.0: installs last migrated before 6.2.0 lose issue count/status/level/last_seen (IssueIndex backfill removed from 0020)

Summary

An install last migrated by a 6.x release older than 6.2.0 upgrades to 7.0.0 without any error, but every pre-existing issue disappears from the issue list and its detail page fails with a 500.

Cause

  • 6.2.0 introduced IssueIndex. Migration issue_events/0020_backfill_and_drop_search_gin copied count / last_seen / status / level / last_release from issue_events_issue to the new table. Its docstring at tag v6.2.6 calls Phase 1 "MANDATORY and NOT abandonable: once Issue's columns are dropped, the leaf holds the only copy".
  • At tag v7.0.0 the same migration no longer backfills: "every 6.x install has already run it, and 7.0 only upgrades from 6.x". That only holds for installs that ran 6.2.0 or later.
  • 0022_drop_issue_hot_columns then drops the source columns.

On an install coming from an earlier 6.x, IssueIndex is created empty, nothing is copied, and the source columns are dropped.

Observed

Self-hosted Docker image, PostgreSQL 16. Instance created on 2026-03-21 with the latest tag (6.0.11 at the time). The exact version before the upgrade is not known; judging by the result it predates 6.2.0. Upgraded straight to 7.0.0 on 2026-11-11.

  • The issue list (API and UI) only returns issues that received an event after the upgrade, each with count: 1.

  • Opening an older issue shows a blank page; the issue detail endpoint returns 500. Server log:

    response.get_level_display
      Field required [type=missing, input_value=<DjangoGetter: <Issue: ...>>, input_type=DjangoGetter]
    response.get_status_display
      Field required [type=missing, ...]
    response.last_seen
      Field required [type=missing, ...]

    Issue.last_seen, get_level_display() and get_status_display() read self.index, which does not exist for these issues.

  • The events of those issues are still returned by the event list endpoint.

Relation to !2645 (merged)

!2645 (merged) raises the documented minimum to 6.0.9 because of three data migrations removed by the squash. The backfill removed from 0020 is a fourth case. It first shipped in 6.2.0, so 6.0.9 is not enough to keep issue data.

Suggestions

  • Document 6.2.0, or simply the latest 6.x, as the required starting point; or
  • keep Phase 1 of the backfill when issue_events_issue still has the source columns, or make 0022 refuse to drop them while IssueIndex is missing rows.

Question

Is there a supported way to rebuild the missing IssueIndex rows on an install that has already upgraded, for instance from events and aggregates with the status reset?

AI disclosure: the analysis was done with the help of Claude Code; the log lines and the behaviour were observed on our own instance.