Skip to content

apply: Log every migration that is applied - #48

Merged
GeertJohan merged 1 commit into
mainfrom
log-applied-migrations
Aug 14, 2026
Merged

apply: Log every migration that is applied#48
GeertJohan merged 1 commit into
mainfrom
log-applied-migrations

Conversation

@GeertJohan

Copy link
Copy Markdown
Member

Only the reset/fresh-database path logged per-migration; the incremental path calls m.Up() once, so a container running 'trek apply' against an existing database only printed 'Successfully migrated database'.

Attaching a logger to go-migrate makes it report every applied migration on both paths, which also replaces the reset path's own log line.

Only the reset/fresh-database path logged per-migration; the incremental
path calls m.Up() once, so a container running 'trek apply' against an
existing database only printed 'Successfully migrated database'.

Attaching a logger to go-migrate makes it report every applied migration
on both paths, which also replaces the reset path's own log line.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the trek apply command to consistently log each migration that gets applied, including when running incrementally against an existing database (where m.Up() previously only emitted a final success message).

Changes:

  • Adds a small migrateLogger adapter to attach a logger to go-migrate.
  • Sets m.Log so go-migrate reports each applied migration.
  • Removes the reset-path’s manual per-migration log line (now redundant).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@GeertJohan
GeertJohan merged commit 6eb8273 into main Aug 14, 2026
2 of 3 checks passed
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