Sha256: c3a5e60993d0ad51610058c2f2093563edb0b89931b9dc64821289baf50a83b8

Contents?: true

Size: 1.31 KB

Versions: 122

Compression:

Stored size: 1.31 KB

Contents

Sequel.migration do
  up do
    # joining with latest_pact_publication_revision_numbers gets rid of the overwritten
    # pact revisions, and the max(verification_id) gets rid of the overwritten
    # verifications
    create_or_replace_view(:latest_verification_id_for_consumer_version_and_provider_version,
      "select pp.consumer_version_id, lv.provider_version_id, lv.verification_id as latest_verification_id
      from latest_pact_publication_ids_for_consumer_versions lpp
      inner join pact_publications pp
        on pp.id = lpp.pact_publication_id
      left outer join latest_verification_id_for_pact_version_and_provider_version lv
          on lv.pact_version_id = pp.pact_version_id"
    )
  end

  down do
    create_or_replace_view(:latest_verification_id_for_consumer_version_and_provider_version,
          "select consumer_version_id, provider_version_id, max(verification_id) as latest_verification_id
          from matrix
          inner join latest_pact_publication_revision_numbers lr
            on matrix.consumer_id = lr.consumer_id
            and matrix.provider_id = lr.provider_id
            and matrix.consumer_version_order = lr.consumer_version_order
            and matrix.pact_revision_number = lr.latest_revision_number
            group by consumer_version_id, provider_version_id"
        )

  end
end

Version data entries

122 entries across 122 versions & 1 rubygems

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