Asmit
Asmit

Asmit Nepali

@Asmit

Software Developer @thefireflytech

9 Posts 31 Views

  • No matching results...
  • Searching...

/ 255

Hey Everybody!

I'm using Laravel with SoftDeletes and need a unique constraint on the combination of product_id and type_id. When I soft delete a record and try to insert the same combination again, the database throws a unique constraint error, even though the original record is soft deleted. While soft deletes aren't immediately required, I may need to recover deleted data in the future. How can I structure this to prevent the unique constraint issue while still allowing future data recovery if necessary?
Any suggestions on the best approach please.

2

189