Skip to content

Instrument migration layer with per-migration structured logging #317

Description

@coderabbitai

Summary

Add structured logging to the migration infrastructure so that operators can diagnose schema changes in production. Each applied migration should emit at minimum:

  • Migration name / version
  • Start and end timestamps
  • Affected row counts for backfill steps
  • Any errors, with full context

Logging should use the existing tracing instrumentation already in the codebase. SQL comments identifying individual backfill steps are also recommended as a complementary aid.

Background

This was identified as out of scope during review of PR #306, which added the 00000000000007_align_news_schema migration pair. The current migration infrastructure logs only five generic statements and provides no per-migration observability, making production diagnostics difficult for operators troubleshooting schema changes.

Backlinks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions