goipam/db/models.go

22 lines
423 B
Go

// Define all Database Models here
package db
import "gorm.io/gorm"
type User struct {
gorm.Model
Name string `gorm:"unique;index"`
PassHash string
Email string
DisplayName string
Groups []Group `gorm:"many2many:user_groups"`
Admin bool
}
type Group struct {
gorm.Model
Name string `grom:"unique;index"`
DisplayName string
Users []User `gorm:"many2many:user_groups"`
}