I’m writing an app which I want to delete records by setting an is_deleted field in the database to true and is defaulted to false.
This works fine but I’m running into an issue when I index unique another field I can’t insert a field with the same entry although the old one is practically deleted but not from DB point of view.
Do you kno w a solution around that?
Thanks,
Tam
Another option is to change the column to a date field such as deleted_at. Creating your unique constraint on the identity + date should be unique enough.