feat: delete constraint for belongs to and has one
This commit is contained in:
@@ -65,8 +65,8 @@ type ShoppingCart struct {
|
||||
// Has one
|
||||
|
||||
type Hotel struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
Office
|
||||
Id uint `gorm:"primaryKey"`
|
||||
Office // want "field Office should have a delete constraint"
|
||||
}
|
||||
|
||||
type Office struct {
|
||||
|
||||
@@ -45,7 +45,7 @@ type Owner struct {
|
||||
Id uint `gorm:"primaryKey"`
|
||||
Name string
|
||||
CompanyId int
|
||||
Company Company
|
||||
Company Company `gorm:"constraint:OnDelete:CASCADE;"`
|
||||
}
|
||||
|
||||
type Company struct {
|
||||
|
||||
Reference in New Issue
Block a user