Update queries to include partition_id filter for source_pipeline
Problem
We need to update queries to include partition_id
filter for source_pipelines
:
SELECT p_ci_builds.*
FROM p_ci_builds
INNER JOIN ci_sources_pipelines ON p_ci_builds.id = ci_sources_pipelines.source_job_id
WHERE ci_sources_pipelines.pipeline_id = 561
LIMIT 1
SELECT p_ci_builds.*
FROM p_ci_builds
INNER JOIN ci_sources_pipelines ON p_ci_builds.id = ci_sources_pipelines.source_job_id
WHERE p_ci_builds.type = 'Ci::Bridge'
AND ci_sources_pipelines.pipeline_id = 561
LIMIT 1
Solution
The partition_id
column must be used for filtering the pipelines that are associated with pipeline_id
, not the source jobs/source pipelines.