It looks like that in current implementation you are using merge on existing row. Problem is that when the row is nullable and we are trying to pass undefined property (for instance when we don't want to update that property) I would expect that it would return that property in new model as a null, but now it returns undefined.
// Imagine that we have model User with nullable icon property
const newModel = await User.updateOrCreate(
{ id: props.id },
{
name: props.name,
icon: props.icon, // For example this is undefined
}
)
...
newModel.icon === undefined // It should be null but it's not
Temporary fix for me is to use id of the new model and find the same model but it's exhaustive
Package version
^21.1.1
Describe the bug
It looks like that in current implementation you are using merge on existing row. Problem is that when the row is nullable and we are trying to pass undefined property (for instance when we don't want to update that property) I would expect that it would return that property in new model as a null, but now it returns undefined.
Temporary fix for me is to use id of the new model and find the same model but it's exhaustive
Reproduction repo
No response