add top menu
This commit is contained in:
17
app/model/topMenu.go
Normal file
17
app/model/topMenu.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package model
|
||||
|
||||
type B2BTopMenu struct {
|
||||
MenuID int `gorm:"column:menu_id;primaryKey;autoIncrement"`
|
||||
Label string `gorm:"column:label;type:longtext;not null;default:'{}'"`
|
||||
ParentID *int `gorm:"column:parent_id;index:FK_b2b_top_menu_parent_id"`
|
||||
Params string `gorm:"column:params;type:longtext;not null;default:'{}'"`
|
||||
Active int8 `gorm:"column:active;type:tinyint;not null;default:1"`
|
||||
Position int `gorm:"column:position;not null;default:1"`
|
||||
|
||||
Parent *B2BTopMenu `gorm:"foreignKey:ParentID;references:MenuID;constraint:OnDelete:RESTRICT,OnUpdate:RESTRICT"`
|
||||
Children []B2BTopMenu `gorm:"foreignKey:ParentID"`
|
||||
}
|
||||
|
||||
func (B2BTopMenu) TableName() string {
|
||||
return "b2b_top_menu"
|
||||
}
|
||||
Reference in New Issue
Block a user