fix: fixing realtion struct request_items to request_pickups
This commit is contained in:
parent
acc496ed46
commit
93f99cae35
|
@ -2,10 +2,11 @@ package domain
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
||||||
|
|
||||||
type RequestPickup struct {
|
type RequestPickup struct {
|
||||||
ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"`
|
ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"`
|
||||||
UserID string `gorm:"type:uuid;not null" json:"userId"`
|
UserID string `gorm:"type:uuid;not null" json:"userId"`
|
||||||
Request []RequestItem `gorm:"foreignKey:RequestPickupID" json:"request"`
|
Request []RequestItem `gorm:"foreignKey:RequestPickupID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"request"`
|
||||||
RequestTime string `gorm:"type:text;not null" json:"requestTime"`
|
RequestTime string `gorm:"type:text;not null" json:"requestTime"`
|
||||||
UserAddressID string `gorm:"type:uuid;not null" json:"userAddressId"`
|
UserAddressID string `gorm:"type:uuid;not null" json:"userAddressId"`
|
||||||
UserAddress Address `gorm:"foreignKey:UserAddressID" json:"userAddress"`
|
UserAddress Address `gorm:"foreignKey:UserAddressID" json:"userAddress"`
|
||||||
|
@ -16,8 +17,8 @@ type RequestPickup struct {
|
||||||
|
|
||||||
type RequestItem struct {
|
type RequestItem struct {
|
||||||
ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"`
|
ID string `gorm:"primaryKey;type:uuid;default:uuid_generate_v4()" json:"id"`
|
||||||
RequestPickupID string `gorm:"type:uuid;not null" json:"requestPickupId"`
|
RequestPickupID string `gorm:"type:uuid;not null;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"requestPickupId"`
|
||||||
TrashCategoryID string `gorm:"type:uuid;not null" json:"trashCategoryId"`
|
TrashCategoryID string `gorm:"type:uuid;not null" json:"trashCategoryId"`
|
||||||
TrashCategory TrashCategory `gorm:"foreignKey:TrashCategoryID" json:"trashCategory"`
|
TrashCategory TrashCategory `gorm:"foreignKey:TrashCategoryID" json:"trashCategory"`
|
||||||
EstimatedAmount string `gorm:"type:text;not null" json:"estimatedAmount"`
|
EstimatedAmount string `gorm:"type:text;not null" json:"estimatedAmount"`
|
||||||
}
|
}
|
Loading…
Reference in New Issue