An entity field must be set to null in order to be unset, yet model definitions don't allow it
Open
@ondratra is already working on this.
Since Sep 15, 2021.
estimate-12h
low-prio
- Dominant language
- TypeScript
- Stars
- 50
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Description
It looks like the neither setting a field to undefined nor using delete entity.field actually unsets the value in the database.
See: https://github.com/typeorm/typeorm/issues/2934
This conflicts with the TypeScript definitions of models generated by Hydra (warthog?), since they don't allow null as value even for optional fields.
For example:
export declare class MemberMetadata extends BaseModel {
name?: string;
avatar?: DataObject;
about?: string;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.