mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-07-06 04:17:54 +02:00
6a3903523b
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
30 lines
730 B
Go
30 lines
730 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"`
|
|
// Color is an optional #RGB or #RRGGBB used to tint the company view banner and frame
|
|
Color *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
|
|
}
|