final project structure
This commit is contained in:
18
wagfarm-api/asset/plant/model.go
Normal file
18
wagfarm-api/asset/plant/model.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package plant
|
||||
|
||||
import (
|
||||
"wagfarm-api/asset/base"
|
||||
"wagfarm-api/asset/land"
|
||||
)
|
||||
|
||||
type Plant struct {
|
||||
base.Asset
|
||||
LandId uint `gorm:"not null"`
|
||||
Land land.Land `gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
||||
CropID uint `gorm:"not null"`
|
||||
Crop crop.Crop `gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
||||
CoverCropID uint `gorm:"not null"`
|
||||
CoverCrop crop.Crop `gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
||||
Year uint `gorm:"not null"`
|
||||
AreaPercentage float64 `gorm:"not null"`
|
||||
}
|
||||
Reference in New Issue
Block a user