Sha256: 52353c4e67966e0c07e99e535e3f1e650b7a2ca882c303f0898fd0c3c0de0475

Contents?: true

Size: 1.63 KB

Versions: 149

Compression:

Stored size: 1.63 KB

Contents

Sequel.migration do
  up do
    # Includes every pact revision (eg. publishing to the same consumer version twice,
    # or using PATCH) and every verification
    # (including 'overwritten' ones. eg. when the same provider build runs twice.)
    p = :all_pact_publications
    create_view(:matrix,
      from(p)
        .select(
          Sequel[p][:consumer_id],
          Sequel[p][:consumer_name],
          Sequel[p][:consumer_version_id],
          Sequel[p][:consumer_version_number],
          Sequel[p][:consumer_version_order],
          Sequel[p][:id].as(:pact_publication_id),
          Sequel[p][:pact_version_id],
          Sequel[p][:pact_version_sha],
          Sequel[p][:revision_number].as(:pact_revision_number),
          Sequel[p][:created_at].as(:pact_created_at),
          Sequel[p][:provider_id],
          Sequel[p][:provider_name],
          Sequel[:versions][:id].as(:provider_version_id),
          Sequel[:versions][:number].as(:provider_version_number),
          Sequel[:versions][:order].as(:provider_version_order),
          Sequel[:verifications][:id].as(:verification_id),
          Sequel[:verifications][:success],
          Sequel[:verifications][:number].as(:verification_number),
          Sequel[:verifications][:execution_date].as(:verification_executed_at),
          Sequel[:verifications][:build_url].as(:verification_build_url)
        )
        .left_outer_join(:verifications, { Sequel[:verifications][:pact_version_id] => Sequel[p][:pact_version_id] })
        .left_outer_join(:versions, {Sequel[:versions][:id] => Sequel[:verifications][:provider_version_id]})
    )
  end

  down do
    drop_view(:matrix)
  end
end

Version data entries

149 entries across 149 versions & 1 rubygems

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