How to upsert with required relation?
- Dominant language
- Go
- Stars
- 17.2k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
- [X] The issue is present in the latest release.
- [X] I have searched the [issues](https://github.com/ent/ent/issues) of this repository and believe that this is not a duplicate.
## Current Behavior 😯
Imagine a simple 1o1 connection. One API must have an Orangization. I can't [upsert](https://entgo.io/docs/crud#upsert-one) because the connection already exists and I can't omit the `.AddOrganizationIDs` method because it is required.
## Expected Behavior 🤔
Ent should detect that the relationship isn't affected and upsert the row.
## Steps to Reproduce 🕹
## Your Environment 🌎
| Tech | Version |
| ----------- | ------- |
| Go | 1.17.5 |
| Ent | 0.9.1 |
| Database | Postgres |
| Driver | github.com/jackc/pgx/v4 |
Contributor guide
Assessment
This issue has not been assessed yet.