goipam/db/models.go

22 lines
423 B
Go
Raw Normal View History

2024-02-22 10:18:59 +01:00
// 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"`
}