Sha256: 740c74b719b8d41f2b7c8081d4f72daa1e51c3913c6fd7f9c0057ed3dcc79793

Contents?: true

Size: 740 Bytes

Versions: 44

Compression:

Stored size: 740 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

44 entries across 44 versions & 1 rubygems

Version Path
pact_broker-2.112.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.111.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.109.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.109.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.108.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.107.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.107.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.107.0.beta.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.106.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.105.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.104.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.103.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.102.2 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.102.1 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.102.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.101.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.100.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.99.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.98.0 db/ddl_statements/latest_pact_consumer_version_orders.rb
pact_broker-2.97.0 db/ddl_statements/latest_pact_consumer_version_orders.rb