From 74e5bc5b9f0c363b81d6b22fd3d2f307a421e64d Mon Sep 17 00:00:00 2001 From: Anton Sattarov <dirty.mew@gmail.com> Date: Fri, 6 Oct 2023 15:47:53 +0200 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8=D0=BE=D1=82=D0=B5=D1=87?= =?UTF-8?q?=D0=BD=D0=B0=D1=8F=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20OverwriteCollection=20-=20=D0=BA=D0=BE=D0=BB=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D1=8F=20=D0=B8=20=D1=81=D1=85=D0=B5=D0=BC?= =?UTF-8?q?=D0=B0=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D1=8F=D0=B5=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA=D0=BE=20=D0=B5?= =?UTF-8?q?=D1=81=D0=BB=D0=B8=20=D0=B2=20=D0=BD=D0=B8=D1=85=20=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/setup/collection.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/setup/collection.go b/pkg/setup/collection.go index fcce47d6..494003d2 100644 --- a/pkg/setup/collection.go +++ b/pkg/setup/collection.go @@ -45,7 +45,10 @@ func NewCollectionConfig(collection *collections.Collection, opt ...CollectionsO func OverwriteCollection() CollectionsOption { return func(c *CollectionConfig) { c.UpdateFn = func(s *Setup, old, new *collections.Collection) (*collections.Collection, bool, bool, error) { - return new, true, true, nil + update := new.Name != old.Name || new.IsSingle() != old.IsSingle() || new.IsSystem() != old.IsSystem() || + new.IsNoData() != old.IsNoData() || new.Hidden != old.Hidden || new.IsView() != old.IsView() || !data.ElementsMatch(old.Tags, new.Tags) + + return new, update, !reflect.DeepEqual(old.Schema, new.Schema), nil } } } -- GitLab