feat(reporter): add index_definition to H001 invalid indexes report

Summary

  • Add index_definition field to H001 Invalid Indexes report
  • Enables users to build proper DB migrations (DROP and re-CREATE statements) based on report data
  • Follows the same pattern already used in H002 (Unused Indexes) and H004 (Redundant Indexes)

Changes

  • reporter/postgres_reports.py: Fetch index definitions from sink DB in H001 report generation
  • reporter/schemas/H001.schema.json: Add index_definition to required fields and properties
  • tests/reporter/test_generators_unit.py: Update unit test with mock and assertion
  • tests/reporter/test_report_schemas.py: Update schema validation test with mock

Test plan

  • Python syntax validated
  • JSON schema syntax validated
  • CI pipeline passes (reporter:tests: job)

🤖 Generated with Claude Code

https://gitlab.com/postgres-ai/platform/-/issues/346

Edited by Dementii Priadko

Merge request reports

Loading