datamodel done without validators
This commit is contained in:
15
wagfarm-api/assets/product/model.go
Normal file
15
wagfarm-api/assets/product/model.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package product
|
||||
|
||||
import (
|
||||
"wagfarm-api/assets/base"
|
||||
"wagfarm-api/database"
|
||||
"wagfarm-api/taxonomy/producttype"
|
||||
)
|
||||
|
||||
type Product struct {
|
||||
base.SoldResource
|
||||
ProductTypeID uint `gorm:"not null"`
|
||||
ProductType producttype.ProductType `gorm:"not null; constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
||||
}
|
||||
|
||||
func RegisterModels() { database.RegisterModel(&Product{}) }
|
||||
Reference in New Issue
Block a user