From 4244e397f36d85d2aff3012a8ebd0c394d49b18e Mon Sep 17 00:00:00 2001 From: qowevisa Date: Wed, 20 Nov 2024 18:18:29 +0200 Subject: [PATCH] Set CASCADE deletion for ItemBought from Payment after deletion --- db/payment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/payment.go b/db/payment.go index b3896e0..3256e4a 100644 --- a/db/payment.go +++ b/db/payment.go @@ -18,6 +18,6 @@ type Payment struct { Title string Descr string Note string - Items []ItemBought + Items []ItemBought `gorm:"constraint:OnDelete:CASCADE;"` Date time.Time }