Sha256: 1fb0b017e9e8f273023623baf688407532ef3fc2239a52c3738f8cb04bfd00c9

Contents?: true

Size: 1.13 KB

Versions: 139

Compression:

Stored size: 1.13 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.
    # In this view there will be one row for each consumer version/provider version
    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

139 entries across 139 versions & 1 rubygems

Version Path
pact_broker-2.83.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.82.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.81.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.80.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.79.1 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.79.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.78.1 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.78.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.77.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.76.2 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.76.1 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.76.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.75.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.74.1 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.74.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.73.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.72.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.71.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.70.0 db/migrations/000050_create_latest_matrix.rb
pact_broker-2.69.0 db/migrations/000050_create_latest_matrix.rb