2
0

app_template.go 949 B

123456789101112131415161718192021222324252627
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // AppTemplate represents a partial spec of a porter app that hydrates the first revision of an app
  7. type AppTemplate struct {
  8. gorm.Model
  9. // ID is a UUID for the AppRevision
  10. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  11. // Base64App is the PorterApp as json encoded in base64
  12. Base64App string `json:"base64_app"`
  13. // ProjectID is the ID of the project that the template belongs to.
  14. ProjectID int `json:"project_id"`
  15. // PorterAppID is the ID of the PorterApp that the template belongs to.
  16. PorterAppID int `json:"porter_app_id"`
  17. // BaseDeploymentTargetID is the ID of the deployment target that this template is based on
  18. // This is used to look up the latest app revision in the base, which will hydrate the template on apply.
  19. BaseDeploymentTargetID uuid.UUID `json:"base_deployment_target_id" gorm:"type:uuid;default:00000000-0000-0000-0000-000000000000"`
  20. }