From d4cbb60b9295f21c285eaf5696cd42e88f2e25e4 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Tue, 14 Feb 2023 11:38:00 +0100 Subject: [PATCH] Migrations: Improve debug log messages Signed-off-by: Michael Mayer --- internal/migrate/migrations.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/migrate/migrations.go b/internal/migrate/migrations.go index 9c994dcc9..bebf3d52d 100644 --- a/internal/migrate/migrations.go +++ b/internal/migrate/migrations.go @@ -1,6 +1,7 @@ package migrate import ( + "fmt" "time" "github.com/photoprism/photoprism/pkg/list" @@ -73,10 +74,10 @@ func (m *Migrations) Start(db *gorm.DB, opt Options) { executed := Existing(db, opt.StageName()) if prev := len(executed); prev == 0 { - log.Debugf("migrate: no previously executed migrations [%s]", opt.StageName()) + log.Debugf("migrate: no previously executed %s stage migrations", opt.StageName()) } else { - log.Debugf("migrate: executing %s migrations", opt.StageName()) - log.Debugf("migrate: found %s", english.Plural(len(executed), "previous migration", "previous migrations")) + stage := fmt.Sprintf("previously executed %s stage", opt.StageName()) + log.Debugf("migrate: found %s", english.Plural(len(executed), stage+" migration", stage+" migrations")) } for _, migration := range *m {