feat: one-to-many, belongs-to

This commit is contained in:
2025-03-17 23:47:01 +07:00
parent db9ef0f935
commit 9d14fa7c57
8 changed files with 156 additions and 45 deletions

View File

@@ -30,8 +30,8 @@ type City struct {
Kuzbass Kuzbass
}
type Federation struct {
Lands []Land `gorm:"constraint:OnDelete:CASCADE;"` // want "Expected references `Id` in model `Federation` for 1:M relation with model `Land`"
type Federation struct { // want "Id field should be presented model \"Federation\""
Lands []Land `gorm:"constraint:OnDelete:CASCADE;"`
}
type Land struct {