Include current and latest known versions in unsupported db error

This commit is contained in:
Tulir Asokan 2022-02-06 20:43:36 +02:00
parent 6d8c71ab36
commit 41272e9dff

View file

@ -96,7 +96,7 @@ func Run(log log.Logger, dialectName string, db *sql.DB) error {
}
if version > NumberOfUpgrades {
return UnsupportedDatabaseVersion
return fmt.Errorf("%w: currently on v%d, latest known: v%d", UnsupportedDatabaseVersion, version, NumberOfUpgrades)
}
log.Infofln("Database currently on v%d, latest: v%d", version, NumberOfUpgrades)