Sha256: ddb829ae8f2ca1992fcfd60ba2f010ebbc730c285d8e5f406275f0d721012f57

Contents?: true

Size: 835 Bytes

Versions: 137

Compression:

Stored size: 835 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 column 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

137 entries across 137 versions & 1 rubygems

Version Path
pact_broker-2.96.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.95.1 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.95.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.94.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.93.4 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.93.3 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.93.2 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.93.1 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.93.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.92.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.91.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.90.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.89.1 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.89.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.88.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.87.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.86.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.85.1 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.85.0 db/migrations/000046_recreate_latest_verifications.rb
pact_broker-2.84.0 db/migrations/000046_recreate_latest_verifications.rb