Back

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

ā€¢
In response to @Asmit

In this, I guess you can use a virtual column. For the reference you can watch this video: šŸ‘‡
www.youtube.com/watch?v=YuqFW0lZdkw

1 ā€¢ ā€¢

138

ā€¢
  • No matching results...
  • Searching...

/ 1000