Sha256: f1de66c29653cbfa3bd0f9a569a94b1747831e1aa38f3cb5e2bd6502535423d8

Contents?: true

Size: 1.19 KB

Versions: 139

Compression:

Stored size: 1.19 KB

Contents

Sequel.migration do
  up do
    # a row for each of the latest pact publications,
    # and a row for each of the latest tagged pact publications
    create_view(:head_matrix,
      "SELECT matrix.*, hpp.tag_name as consumer_tag_name
      FROM latest_matrix_for_consumer_version_and_provider_version matrix
      INNER JOIN head_pact_publications hpp
      ON matrix.consumer_id = hpp.consumer_id
      AND matrix.provider_id = hpp.provider_id
      AND matrix.consumer_version_order = hpp.consumer_version_order
      INNER JOIN latest_verification_id_for_consumer_version_and_provider AS lv
      ON matrix.consumer_version_id = lv.consumer_version_id
      AND matrix.provider_id = lv.provider_id
      AND matrix.verification_id = lv.latest_verification_id

      UNION

      SELECT matrix.*, hpp.tag_name as consumer_tag_name
      FROM latest_matrix_for_consumer_version_and_provider_version matrix
      INNER JOIN head_pact_publications hpp
      ON matrix.consumer_id = hpp.consumer_id
      AND matrix.provider_id = hpp.provider_id
      AND matrix.consumer_version_order = hpp.consumer_version_order
      where verification_id is null
      "
    )
  end

  down do
    drop_view(:head_matrix)
  end
end

Version data entries

139 entries across 139 versions & 1 rubygems

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