Sha256: 197939b07b32210faf114ecf58867417d0feaf978719556b81d4751a772dba9d

Contents?: true

Size: 739 Bytes

Versions: 55

Compression:

Stored size: 739 Bytes

Contents

# The consumer id, provider id, and consumer version order
# for the latest consumer version that has a pact with that provider.

def latest_pact_consumer_version_orders_v1(connection = nil)
  "select provider_id, consumer_id, max(consumer_version_order) as latest_consumer_version_order
  from all_pact_publications
  group by provider_id, consumer_id"
end

def latest_pact_consumer_version_orders_v2(connection = nil)
  view = Sequel.as(:latest_pact_publication_ids_for_consumer_versions, :lp)
  connection.from(view)
    .select_group(:provider_id, :consumer_id)
    .select_append{ max(order).as(latest_consumer_version_order) }
    .join(:versions, { Sequel[:lp][:consumer_version_id] => Sequel[:cv][:id]}, { table_alias: :cv } )
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
pact_broker-2.79.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.79.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.78.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.78.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.77.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.76.2 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.76.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.76.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.75.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.74.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.74.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.73.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.72.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.71.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.70.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.69.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.68.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.68.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.67.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.66.0 db/ddl_statements/latest_pact_consumer_version_orders.rb