You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used "objection-soft-delete" package for soft delete data. I want to handle "objection-unique" with "objection-soft-delete". Currently, it's will also check deleted data.
The text was updated successfully, but these errors were encountered:
Hi @ravipatelopenxcell, that's a common problem when using soft delete strategy.
If you state that an entity is soft-deleted and you re-assign the same "unique" field you may face data integrity issues - for instance, if you "undelete" the entity.
I would say our current approach it's correct one. An entity field that it's unique should always be unique (and it should have that constraint on the database as well). If you want to re-assign a field then I believe that you should handle that field on the soft-delete action.
Hi,
actually if we check more advanced packages like Rails ActiveRecord and the Paranoia gem (for soft deletion) then there is a possibility to validate uniqueness of field with NULL or not NULL value.
I think is a common case and it should be supported.
Cheers.
I have used "objection-soft-delete" package for soft delete data. I want to handle "objection-unique" with "objection-soft-delete". Currently, it's will also check deleted data.
The text was updated successfully, but these errors were encountered: