Dashboard: Do not run backend migrations if schemaVersion < min_version migration implemented in the backend (#102088)
This commit is contained in:
@@ -22,6 +22,15 @@ func TestMigrate(t *testing.T) {
|
||||
files, err := os.ReadDir(INPUT_DIR)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Run("minimum version check", func(t *testing.T) {
|
||||
err := migration.Migrate(map[string]interface{}{
|
||||
"schemaVersion": schemaversion.MIN_VERSION - 1,
|
||||
}, schemaversion.MIN_VERSION)
|
||||
|
||||
var minVersionErr = schemaversion.NewMigrationError("schema version is too old", schemaversion.MIN_VERSION-1, schemaversion.MIN_VERSION)
|
||||
require.ErrorAs(t, err, &minVersionErr)
|
||||
})
|
||||
|
||||
for _, f := range files {
|
||||
if f.IsDir() {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user