refactor schema versions to be ints, not strings

This commit is contained in:
Shivaram Lingamneni 2020-10-26 23:29:49 -04:00
parent 70b8bf75c5
commit dc456bd6a4
3 changed files with 117 additions and 115 deletions

View file

@ -71,12 +71,12 @@ func SafeErrorParam(param string) string {
}
type IncompatibleSchemaError struct {
CurrentVersion string
RequiredVersion string
CurrentVersion int
RequiredVersion int
}
func (err *IncompatibleSchemaError) Error() string {
return fmt.Sprintf("Database requires update. Expected schema v%s, got v%s", err.RequiredVersion, err.CurrentVersion)
return fmt.Sprintf("Database requires update. Expected schema v%d, got v%d", err.RequiredVersion, err.CurrentVersion)
}
func NanoToTimestamp(nanotime int64) string {