Sha256: b0e6949a72c595c1b983765200cf36171bb0eeed28b10e09c3fc53610620f48a

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

# The latest verification id for each consumer version tag
# This is not:
#   find latest pacticipant version with given tag
#     -> find the latest pact
#     -> find the latest verification
# because the latest pacticipant version with the tag might not have a pact,
# and the latest pact might not have a verification.

# This is:
# join the tags and the pacticipant versions and the verifications and find the "latest" row

LATEST_VERIFICATION_IDS_FOR_CONSUMER_VERSION_TAGS_V1 = "select
        pv.pacticipant_id as provider_id,
        lpp.consumer_id,
        t.name as consumer_version_tag_name,
        max(v.id) as latest_verification_id
      from verifications v
      join latest_pact_publications_by_consumer_versions lpp
        on v.pact_version_id = lpp.pact_version_id
      join tags t
        on lpp.consumer_version_id = t.version_id
      join versions pv
        on v.provider_version_id = pv.id
      group by pv.pacticipant_id, lpp.consumer_id, t.name"

LATEST_VERIFICATION_IDS_FOR_CONSUMER_VERSION_TAGS_V2 = "select
        pv.pacticipant_id as provider_id,
        lpp.consumer_id,
        t.name as consumer_version_tag_name,
        max(v.id) as latest_verification_id
      from verifications v
      join latest_pact_publication_ids_for_consumer_versions lpp
        on v.pact_version_id = lpp.pact_version_id
      join tags t
        on lpp.consumer_version_id = t.version_id
      join versions pv
        on v.provider_version_id = pv.id
      group by pv.pacticipant_id, lpp.consumer_id, t.name"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact_broker-2.40.0 db/ddl_statements/latest_verification_ids_for_consumer_version_tags.rb