updated collection indexes on system fields validator and normalized v0.23 old collections migration

This commit is contained in:
Gani Georgiev
2024-11-15 09:11:45 +02:00
parent e53c30ca4d
commit 18a7549e50
6 changed files with 140 additions and 24 deletions

View File

@@ -86,6 +86,12 @@ func (app *BaseApp) ImportCollections(toImport []map[string]any, deleteMissing b
continue
}
if imported.Fields.GetById(f.GetId()) == nil {
// replace with the existing id to prevent accidental column deletion
// since otherwise the imported field will be treated as a new one
found := imported.Fields.GetByName(f.GetName())
if found != nil && found.Type() == f.Type() {
found.SetId(f.GetId())
}
imported.Fields.Add(f)
}
}