From cba9f19ba50c60576a5961e89c24caefca52d740 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 3 Sep 2023 23:39:05 +0530 Subject: deleting addresses upon customer deletion --- customer/customer.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'customer/customer.go') diff --git a/customer/customer.go b/customer/customer.go index e411ad5..1a5d6f1 100644 --- a/customer/customer.go +++ b/customer/customer.go @@ -39,11 +39,13 @@ type Address struct { } type CustomerBillingAddress struct { + gorm.Model Address CustomerID uint } type CustomerShippingAddress struct { + gorm.Model Address CustomerID uint } @@ -58,6 +60,6 @@ type Customer struct { Phone string Email string Website string - //BillingAddress CustomerBillingAddress - //ShippingAddresses []CustomerShippingAddress + BillingAddress CustomerBillingAddress + ShippingAddresses []CustomerShippingAddress } -- cgit v1.2.3