File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ import (
2323 "path"
2424 "sort"
2525
26+ "go.gearno.de/kit/log"
2627 "go.gearno.de/kit/pg"
2728)
2829
2930type (
3031 Migrator struct {
31- pg * pg.Client
32- disk FS
32+ pg * pg.Client
33+ disk FS
34+ logger * log.Logger
3335 }
3436
3537 Migration struct {
@@ -49,10 +51,11 @@ const (
4951 MigrationAdvisoryLock pg.AdvisoryLock = 0
5052)
5153
52- func NewMigrator (pg * pg.Client , disk FS ) * Migrator {
54+ func NewMigrator (pg * pg.Client , disk FS , l * log. Logger ) * Migrator {
5355 return & Migrator {
54- pg : pg ,
55- disk : disk ,
56+ pg : pg ,
57+ disk : disk ,
58+ logger : l ,
5659 }
5760}
5861
@@ -92,7 +95,7 @@ func (m *Migrator) Run(ctx context.Context, dirname string) error {
9295 continue
9396 }
9497
95- // c .logger.Info("applying migration", zap .String("version", migration.Version))
98+ m .logger .Info ("applying migration" , log .String ("version" , migration .Version ))
9699
97100 err := m .pg .WithTx (
98101 ctx ,
You can’t perform that action at this time.
0 commit comments