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

Asked 1 years ago, Updated 1 years ago, 100 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.