Sha256: 4b14280bb658c20a2b5bd186528a4f88e54ad41a18c68991b4e6ef6402839946

Contents?: true

Size: 818 Bytes

Versions: 12

Compression:

Stored size: 818 Bytes

Contents

Sequel.migration do
  up do
    create_or_replace_view(:latest_verification_numbers,
      "SELECT pact_version_id, MAX(number) latest_number
          FROM verifications
          GROUP BY pact_version_id")

    # The most recent verification for each pact version
    # provider_version is DEPRECATED, use provider_version_number
    create_or_replace_view(:latest_verifications,
      "SELECT v.id, v.number, v.success, s.number as provider_version, v.build_url, v.pact_version_id, v.execution_date, v.created_at, v.provider_version_id, s.number as provider_version_number
        FROM verifications v
        INNER JOIN latest_verification_numbers lv
          ON v.pact_version_id = lv.pact_version_id AND v.number = lv.latest_number
        INNER JOIN versions s on v.provider_version_id = s.id"
    )
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.13.1 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.13.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.12.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.11.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.10.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.9.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.9.0.beta.5 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.8.0.beta.5 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.8.0.beta.4 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.7.0.beta.3 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.7.0.beta.2 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.7.0.beta.1 db/migrations/46_recreate_latest_verifications.rb