Skip to content
Snippets Groups Projects
Commit 1a522725 authored by ko_oler's avatar ko_oler
Browse files

правки по ПР

parent d725e2e1
No related branches found
No related tags found
No related merge requests found
......@@ -76,14 +76,6 @@ func DeleteCollectionIfRemove() CollectionsOption {
}
func isCollsSchemaMetadataEqual(collection, exist *collections.Collection) bool {
if alwaysSetSchema {
return true
}
if collection.IsView() && exist.IsView() {
return true
}
if collection.Schema.Metadata == nil && exist.Schema.Metadata == nil {
return true
}
......@@ -100,7 +92,7 @@ func isCollsSchemaMetadataEqual(collection, exist *collections.Collection) bool
func DefaultUpdateCollectionStrategy() CollectionsOption {
return func(c *CollectionConfig) {
c.UpdateFn = func(s *Setup, exist, collection *collections.Collection) (*collections.Collection, bool, bool, error) {
if !s.IsForce() && !isCollsSchemaMetadataEqual(collection, exist) {
if !alwaysSetSchema && !s.IsForce() && !collection.IsView() && !exist.IsView() && !isCollsSchemaMetadataEqual(collection, exist) {
return nil, false, false, errors.WithDetailf(collections.ErrAlreadyExists, "Коллекция с идентификатором '%s' "+
"уже существует. Удалите ее или вызовите установку расширения с флагом Force", collection.ID)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment