Skip to content

Commit

Permalink
chore: remove duplicate optimisation for latest_pact_consumer_version…
Browse files Browse the repository at this point in the history
…_orders
  • Loading branch information
bethesque committed Oct 27, 2019
1 parent c4febea commit 47f7c15
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def latest_tagged_pact_consumer_version_orders_v3(connection)
connection.from(view)
.select_group(
Sequel[:lp][:provider_id],
Sequel[:cv][:pacticipant_id].as(:consumer_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} )
Expand Down
9 changes: 1 addition & 8 deletions db/migrations/20180722_recreate_views.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@

# Latest consumer version order for consumer/provider
# Recreate latest_pact_publication_ids_for_consumer_versions view
lpp = :latest_pact_publication_ids_for_consumer_versions
latest_pact_consumer_version_orders = from(lpp).select_group(
Sequel[lpp][:provider_id],
Sequel[:cv][:pacticipant_id].as(:consumer_id))
.select_append{ max(order).as(latest_consumer_version_order) }
.join(:versions, { Sequel[lpp][:consumer_version_id] => Sequel[:cv][:id] }, { table_alias: :cv })

create_or_replace_view(:latest_pact_consumer_version_orders, latest_pact_consumer_version_orders)
create_or_replace_view(:latest_pact_consumer_version_orders, latest_pact_consumer_version_orders_v2(self))
end

down do
Expand Down
13 changes: 0 additions & 13 deletions db/migrations/20191029_optimise_latest_pact_cv_orders.rb

This file was deleted.

0 comments on commit 47f7c15

Please sign in to comment.