fix: remove fields entry with instance domain remove (#10406)

# Which Problems Are Solved

Fields table entry is not removed when removing instance domain.

# How the Problems Are Solved

Remove the fields entry, instead of setting it.

# Additional Changes

None

# Additional Context

Needs to be backported to v3.x
This commit is contained in:
Stefan Benz
2025-08-07 16:16:02 +02:00
committed by GitHub
parent 6e8aa9a7d1
commit cc2ef939c5

View File

@@ -148,23 +148,10 @@ func (e *DomainRemovedEvent) UniqueConstraints() []*eventstore.UniqueConstraint
func (e *DomainRemovedEvent) Fields() []*eventstore.FieldOperation {
return []*eventstore.FieldOperation{
eventstore.SetField(
eventstore.RemoveSearchFieldsByAggregateAndObjectAndField(
e.Aggregate(),
domainSearchObject(e.Domain),
InstanceDomainSearchField,
&eventstore.Value{
Value: e.Domain,
MustBeUnique: true,
ShouldIndex: true,
},
eventstore.FieldTypeInstanceID,
eventstore.FieldTypeResourceOwner,
eventstore.FieldTypeAggregateType,
eventstore.FieldTypeAggregateID,
eventstore.FieldTypeObjectType,
eventstore.FieldTypeObjectID,
eventstore.FieldTypeFieldName,
),
}
}