capi_config.go 758 B

123456789101112131415161718192021222324252627282930
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // CAPIConfig represents a ClusterAPI base64 encoded config
  7. type CAPIConfig struct {
  8. gorm.Model
  9. // ID is a UUID for the CAPI Cluster's config
  10. ID uuid.UUID `gorm:"type:uuid;primaryKey"`
  11. // Base64Config is the CAPI config for a cluster, encoded in base64
  12. Base64Config string
  13. // ClusterID is the ID of the cluster that the config created.
  14. // This should be a foreign key, but GORM doesnt play well with FKs.
  15. ClusterID int
  16. // ProjectID is the ID of the project that the config belongs to.
  17. // This should be a foreign key, but GORM doesnt play well with FKs.
  18. ProjectID int
  19. }
  20. // TableName overrides the table name
  21. func (CAPIConfig) TableName() string {
  22. return "capi_configs"
  23. }