diff --git a/pkg/sqlite/tag.go b/pkg/sqlite/tag.go index 08337616e..ede1fcc2e 100644 --- a/pkg/sqlite/tag.go +++ b/pkg/sqlite/tag.go @@ -790,6 +790,7 @@ func (qb *TagStore) Merge(ctx context.Context, source []int, destination int) er imagesTagsTable: imageIDColumn, "performers_tags": "performer_id", "studios_tags": "studio_id", + groupsTagsTable: "group_id", } args = append(args, destination) diff --git a/pkg/sqlite/tag_test.go b/pkg/sqlite/tag_test.go index 5359be785..770f39782 100644 --- a/pkg/sqlite/tag_test.go +++ b/pkg/sqlite/tag_test.go @@ -931,6 +931,8 @@ func TestTagMerge(t *testing.T) { tagIdxWithGallery, tagIdx1WithGallery, tagIdx2WithGallery, + tagIdx1WithGroup, + tagIdx2WithGroup, } var srcIDs []int for _, idx := range srcIdxs { @@ -1024,6 +1026,18 @@ func TestTagMerge(t *testing.T) { assert.Contains(studioTagIDs, destID) + // ensure group points to new tag + group, err := db.Group.Find(ctx, groupIDs[groupIdxWithTwoTags]) + if err != nil { + return err + } + if err := group.LoadTagIDs(ctx, db.Group); err != nil { + return err + } + groupTagIDs := group.TagIDs.List() + + assert.Contains(groupTagIDs, destID) + return nil }); err != nil { t.Error(err.Error())