What should I do with logic when the purchase list product is deleted?

Asked 2 years ago, Updated 2 years ago, 109 views

Product ------FK----> Purchase List

If the product on the purchase list is deleted, the purchase list is supposed to be deleted.

Is it the right way not to delete the purchase list?

Or is it right to delete the original purchase list?

django database postgresql mysql redis

2022-09-22 08:23

2 Answers

It depends on the plan rather than the development logic, shouldn't we keep the purchase list? Or I think it's also a way not to delete the product itself.


2022-09-22 08:23

I understand that you don't usually delete it. There are quite a few cases like this, so they rarely use reference constraints.


2022-09-22 08:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.