15 lines
365 B
Go
15 lines
365 B
Go
package models
|
|
|
|
import (
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
FullName string `gorm:"type:varchar(100);not null"`
|
|
RegionID uint `gorm:"not null;index"`
|
|
Mobile string `gorm:"type:varchar(20);unique;not null"`
|
|
Password string `gorm:"type:varchar(100);not null"`
|
|
Region Region `gorm:"foreignkey:RegionID;association_foreignkey:ID"`
|
|
}
|