Sha256: b6209dfac32db8c94053cd1b5759889756819a5ca48d40544afb20211cec6e85

Contents?: true

Size: 1.05 KB

Versions: 10

Compression:

Stored size: 1.05 KB

Contents

Sequel.migration do
  change do
    # Removes 'overwritten' pacts and verifications from the matrix
    # (ie. only show latest pact revision for each consumer version and
    # latest verification for each provider version)
    # Must include lines where verification_id is null so that we don't
    # lose the unverified pacts.
    create_view(:latest_matrix,
      "SELECT matrix.* FROM matrix
      INNER JOIN latest_verification_id_for_consumer_version_and_provider_version AS lv
      ON ((matrix.consumer_version_id = lv.consumer_version_id)
      AND (matrix.provider_version_id = lv.provider_version_id)
      AND ((matrix.verification_id = lv.latest_verification_id)))

      UNION

      select matrix.* from matrix
      inner join latest_pact_publication_revision_numbers lr
      on matrix.consumer_id = lr.consumer_id
      and matrix.provider_id = lr.provider_id
      and matrix.consumer_version_order = lr.consumer_version_order
      and matrix.pact_revision_number = lr.latest_revision_number
      where verification_id is null
      "
    )
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pact_broker-2.15.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.14.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.13.1 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.13.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.12.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.11.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.10.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.9.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.9.0.beta.5 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.8.0.beta.5 db/migrations/000050_create_latest_matrix.rb