Sha256: f3e44e4776c026f8deef6f8c5341adfd20fec0a95110dd3380e71f00d2e98f40

Contents?: true

Size: 1.05 KB

Versions: 44

Compression:

Stored size: 1.05 KB

Contents

require "digest/sha1"
require_relative "migration_helper"

Sequel.migration do
  change do
    create_or_replace_view(:all_pacts,
        Sequel::Model.db[:pacts].select(
        Sequel[:pacts][:id],
        Sequel[:c][:id].as(:consumer_id), Sequel[:c][:name].as(:consumer_name),
        Sequel[:cv][:id].as(:consumer_version_id), Sequel[:cv][:number].as(:consumer_version_number), Sequel[:cv][:order].as(:consumer_version_order),
        Sequel[:p][:id].as(:provider_id), Sequel[:p][:name].as(:provider_name),
        Sequel[:pvc][:sha].as(:pact_version_content_sha), Sequel[:pacts][:created_at], Sequel[:pacts][:updated_at]).
        join(:versions, {:id => :version_id}, {:table_alias => :cv, implicit_qualifier: :pacts}).
        join(:pacticipants, {:id => :pacticipant_id}, {:table_alias => :c, implicit_qualifier: :cv}).
        join(:pacticipants, {:id => :provider_id}, {:table_alias => :p, implicit_qualifier: :pacts}).
        join(:pact_version_contents, {:sha => :pact_version_content_sha}, {:table_alias => :pvc, implicit_qualifier: :pacts})
      )

  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

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