Ramin-RX7 / CafeMenu

Café management website with custom dashboard panel for staff
MIT License
2 stars 4 forks source link

Set a proper value for models relation when parent is deleted #50

Closed Ramin-RX7 closed 1 year ago

Ramin-RX7 commented 1 year ago

As of some relations in the ERD such as OrderItem and Food where Food may be deleted, we need to set the OrderItem.food field a value. The preferred way to handle these situations in the models is simply just to use the food name.

But there are few challenges: