Sha256: 0a31f6abaabb8db9765ea4688599ea27af0e6b7a76a527ef6d9c4202abaa55e2

Contents?: true

Size: 1.07 KB

Versions: 50

Compression:

Stored size: 1.07 KB

Contents

def latest_tagged_pact_consumer_version_orders_v2(connection)
  pp = :pact_publications
  connection.from(pp)
    .select_group(
      Sequel[pp][:provider_id],
      Sequel[:cv][:pacticipant_id].as(:consumer_id),
      Sequel[:t][:name].as(:tag_name))
    .select_append{ max(order).as(latest_consumer_version_order) }
    .join(:versions, { Sequel[pp][:consumer_version_id] => Sequel[:cv][:id] }, { table_alias: :cv} )
    .join(:tags, { Sequel[:t][:version_id] => Sequel[pp][:consumer_version_id] }, { table_alias: :t })
end

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

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
pact_broker-2.76.2 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.76.1 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.76.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.75.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.74.1 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.74.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.73.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.72.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.71.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.70.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.69.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.68.1 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.68.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.67.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.66.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.65.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.64.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.63.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.62.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb
pact_broker-2.61.0 db/ddl_statements/latest_tagged_pact_consumer_version_orders.rb