Set CASCADE delete for ItemPrice from Item deletion

This commit is contained in:
qowevisa 2024-11-20 18:17:45 +02:00
parent b5747c9d9d
commit dbe140ecaf

View File

@ -17,7 +17,7 @@ type Item struct {
Carbs uint64 Carbs uint64
Fats uint64 Fats uint64
// //
Prices []ItemPrice Prices []ItemPrice `gorm:"constraint:OnDelete:CASCADE;"`
CurrentPriceID uint CurrentPriceID uint
CurrentPrice *ItemPrice CurrentPrice *ItemPrice
// //