diff --git a/db/migrations/000029_create_latest_tagged_pact_publications.rb b/db/migrations/000029_create_latest_tagged_pact_publications.rb index a4954e8d5..a5615e6d4 100644 --- a/db/migrations/000029_create_latest_tagged_pact_publications.rb +++ b/db/migrations/000029_create_latest_tagged_pact_publications.rb @@ -1,5 +1,7 @@ Sequel.migration do up do + # The pact for the latest consumer version (ordered by consumer version order) *that has a pact* for each tag + # eg. For each tag, find all the consumer versions that have pacts, order them by consumer version order, then get the pact for the latest consumer version. create_or_replace_view(:latest_tagged_pact_consumer_version_orders, "select provider_id, consumer_id, t.name as tag_name, max(consumer_version_order) as latest_consumer_version_order from latest_pact_publications_by_consumer_versions ap