20 lines
296 B
Go
20 lines
296 B
Go
package models
|
|
|
|
import (
|
|
"github.com/jinzhu/gorm"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Name string
|
|
Role string `gorm:"size:255"`
|
|
Groups []Group `gorm:"foreignkey:UserID"`
|
|
}
|
|
|
|
type Profile struct {
|
|
gorm.Model
|
|
UserID int
|
|
User User
|
|
Email string `gorm:"type:varchar(100);unique_index"`
|
|
}
|