entc/gen: delete removal edges from mutation (#1654)

* Remove Edge IDs from internal Mutation state

* Update template gen

* Update integration tests

* Update examples
This commit is contained in:
Ivan Vanderbyl
2021-06-24 18:26:22 +10:00
committed by GitHub
parent a29784eb69
commit 4ba56ea901
24 changed files with 87 additions and 2 deletions

View File

@@ -602,6 +602,7 @@ func (m *UserMutation) RemovePetIDs(ids ...int) {
m.removedpets = make(map[int]struct{})
}
for i := range ids {
delete(m.pets, ids[i])
m.removedpets[ids[i]] = struct{}{}
}
}