소스 검색

add app instance id to events table (#3929)

Co-authored-by: David Townley <davidtownley@Davids-MacBook-Air.local>
d-g-town 2 년 전
부모
커밋
0ba4d0ef02
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      internal/models/porter_app_event.go

+ 3 - 1
internal/models/porter_app_event.go

@@ -26,8 +26,10 @@ type PorterAppEvent struct {
 	UpdatedAt time.Time `json:"updated_at"`
 	// PorterAppID is the ID that the given event relates to
 	PorterAppID uint `json:"porter_app_id" gorm:"index:idx_app_deployment_target"`
+	// AppInstanceID is the ID of the app instance that the given event relates to
+	AppInstanceID uuid.UUID `json:"app_instance_id" gorm:"type:uuid;index:idx_app_instance_deployment_target;default:00000000-0000-0000-0000-000000000000"`
 	// DeploymentTargetID is the ID of the deployment target that the event relates to
-	DeploymentTargetID uuid.UUID `json:"deployment_target_id" gorm:"type:uuid;index:idx_app_deployment_target;default:00000000-0000-0000-0000-000000000000"`
+	DeploymentTargetID uuid.UUID `json:"deployment_target_id" gorm:"type:uuid;index:idx_app_deployment_target;index:idx_app_instance_deployment_target;default:00000000-0000-0000-0000-000000000000"`
 	Metadata           JSONB     `json:"metadata" sql:"type:jsonb" gorm:"type:jsonb"`
 }