Add enterprise support

This change adds enterprise support throughout garm.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2022-10-13 16:09:28 +00:00
parent f40420bfb6
commit 296333412a
No known key found for this signature in database
GPG key ID: 7D073DCC2C074CB5
34 changed files with 2028 additions and 112 deletions

View file

@ -71,6 +71,9 @@ type Pool struct {
OrgID uuid.UUID `gorm:"index"`
Organization Organization `gorm:"foreignKey:OrgID"`
EnterpriseID uuid.UUID `gorm:"index"`
Enterprise Enterprise `gorm:"foreignKey:EnterpriseID"`
Instances []Instance `gorm:"foreignKey:PoolID"`
}
@ -93,6 +96,15 @@ type Organization struct {
Pools []Pool `gorm:"foreignKey:OrgID"`
}
type Enterprise struct {
Base
CredentialsName string
Name string `gorm:"index:idx_ent_name_nocase,collate:nocase"`
WebhookSecret []byte
Pools []Pool `gorm:"foreignKey:EnterpriseID"`
}
type Address struct {
Base