Skip to content

Commit

Permalink
migrate: don't error when there are no migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed May 4, 2024
1 parent 40008ce commit c951e86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion postgresql/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit c951e86

Please sign in to comment.