From c951e86945dee7613467e9977843f3ed6a23e76b Mon Sep 17 00:00:00 2001 From: Jesse de Wit Date: Sat, 4 May 2024 22:23:02 +0200 Subject: [PATCH] migrate: don't error when there are no migrations --- postgresql/migrate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/postgresql/migrate.go b/postgresql/migrate.go index 06de1cf0..a2d590c0 100644 --- a/postgresql/migrate.go +++ b/postgresql/migrate.go @@ -29,7 +29,9 @@ func Migrate(databaseUrl string) error { } log.Printf("Current database version is %d, dirty = %t", version, dirty) err = m.Up() - if err != nil { + if err == migrate.ErrNoChange { + log.Printf("No migrations to apply.") + } else if err != nil { return fmt.Errorf("failed to apply database migrations: %w", err) }