mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
28 lines
608 B
Go
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
|
|
}
|