Files
phishingclub/backend/database/company.go
Ronni Skansing a6374bd976 add comment to company
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
2025-10-14 18:19:52 +02:00

28 lines
608 B
Go

package database
import (
"time"
"github.com/google/uuid"
)
const (
COMPANY_TABLE = "companies"
)
type Company struct {
ID uuid.UUID `gorm:"primary_key;not null;unique;type:uuid"`
CreatedAt *time.Time `gorm:"not null;index;"`
UpdatedAt *time.Time `gorm:"not null;index"`
Name string `gorm:"not null;unique;index"`
Comment *string `gorm:"type:text"`
// backref: many-to-one
Users []*User //`gorm:"foreignKey:CompanyID;"`
RecipientGroups []*RecipientGroup //`gorm:"foreignKey:CompanyID;"`
}
func (Company) TableName() string {
return COMPANY_TABLE
}