Dashboard: Do not run backend migrations if schemaVersion < min_version migration implemented in the backend (#102088)

This commit is contained in:
Ivan Ortega Alba
2025-03-14 08:55:40 +00:00
committed by GitHub
parent d3a9c04562
commit 0e5c436288
4 changed files with 33 additions and 1 deletions
@@ -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