Dashboard: Do not run backend migrations if schemaVersion < min_version migration implemented in the backend (#102088)
This commit is contained in:
@@ -23,3 +23,17 @@ type MigrationError struct {
|
||||
func (e *MigrationError) Error() string {
|
||||
return fmt.Errorf("schema migration from version %d to %d failed: %v", e.currentVersion, e.targetVersion, e.msg).Error()
|
||||
}
|
||||
|
||||
// MinimumVersionError is an error that is returned when the schema version is below the minimum version.
|
||||
func NewMinimumVersionError(inputVersion int) *MinimumVersionError {
|
||||
return &MinimumVersionError{inputVersion: inputVersion}
|
||||
}
|
||||
|
||||
// MinimumVersionError is an error type for minimum version errors.
|
||||
type MinimumVersionError struct {
|
||||
inputVersion int
|
||||
}
|
||||
|
||||
func (e *MinimumVersionError) Error() string {
|
||||
return fmt.Errorf("input schema version is below minimum version. input: %d minimum: %d", e.inputVersion, MIN_VERSION).Error()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import "strconv"
|
||||
|
||||
type SchemaVersionMigrationFunc func(map[string]interface{}) error
|
||||
|
||||
const LATEST_VERSION = 41
|
||||
const (
|
||||
MIN_VERSION = 36
|
||||
LATEST_VERSION = 41
|
||||
)
|
||||
|
||||
var Migrations = map[int]SchemaVersionMigrationFunc{
|
||||
37: V37,
|
||||
|
||||
Reference in New Issue
Block a user