sql-migrate icon indicating copy to clipboard operation
sql-migrate copied to clipboard

implemented optional logger to log details when applying migrations

Open eklatzer opened this issue 1 year ago • 3 comments

Hey, here is a PR for the enhanced logging infos when applying migrations, proposed in https://github.com/rubenv/sql-migrate/issues/266

eklatzer avatar Oct 26 '24 21:10 eklatzer

@rubenv Do you already have an info regarding this PR?

eklatzer avatar Nov 15 '24 11:11 eklatzer

@rubenv Any thoughts on this? We periodically leverage migrations which may run long, and having this log data would really be a quality-of-life improvement when those are applying.

eldondevat avatar Sep 02 '25 17:09 eldondevat

@eldondevat As I did not get a response for a long time, I built a workaround for this topic, by:

  1. Calculating the number of missing migrations using PlanMigration
  2. Running each migraton on its own using ExecMax with a limit of one migration

You can find the implementation in: https://github.com/allaboutapps/go-starter/blob/master/cmd/db/migrate.go#L74

Of course it would be nice, to have some kind of support built into sql-migrate

eklatzer avatar Sep 03 '25 04:09 eklatzer