From 7418f2bfab7a7a004ae72acc52908e4f73abc959 Mon Sep 17 00:00:00 2001 From: Ashish-devtron Date: Wed, 11 Oct 2023 17:31:04 +0530 Subject: [PATCH] check for active ci_pipeline_material --- internal/sql/repository/pipelineConfig/CiPipelineRepository.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/sql/repository/pipelineConfig/CiPipelineRepository.go b/internal/sql/repository/pipelineConfig/CiPipelineRepository.go index 974d1b7b6e8..fccf0f5166f 100644 --- a/internal/sql/repository/pipelineConfig/CiPipelineRepository.go +++ b/internal/sql/repository/pipelineConfig/CiPipelineRepository.go @@ -285,6 +285,9 @@ func (impl CiPipelineRepositoryImpl) FindById(id int) (pipeline *CiPipeline, err pipeline = &CiPipeline{Id: id} err = impl.dbConnection.Model(pipeline). Column("ci_pipeline.*", "App", "CiPipelineMaterials", "CiTemplate", "CiTemplate.DockerRegistry", "CiPipelineMaterials.GitMaterial"). + Relation("CiPipelineMaterials", func(q *orm.Query) (query *orm.Query, err error) { + return q.Where("(ci_pipeline_material.active=true)"), nil + }). Where("ci_pipeline.id= ?", id). Where("ci_pipeline.deleted =? ", false). Select()