Sha256: ef897f51bd65756fa3d8f6fc44df44beb97fbcdb612da739dcf87b66e2e0be63
Contents?: true
Size: 1.13 KB
Versions: 34
Compression:
Stored size: 1.13 KB
Contents
Sequel.migration do change do create_view(:all_pacts, Sequel::Model.db[:pacts].select(:pacts__id, :c__id___consumer_id, :c__name___consumer_name, :cv__number___consumer_version_number, :cv__order___consumer_version_order, :p__id___provider_id, :p__name___provider_name, :pacts__json_content). 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})) create_view(:latest_pact_consumer_version_orders, "select provider_id, consumer_id, max(consumer_version_order) as latest_consumer_version_order from all_pacts group by provider_id, consumer_id" ) create_view(:latest_pacts, "select ap.* from all_pacts ap inner join latest_pact_consumer_version_orders lp on ap.consumer_id = lp.consumer_id and ap.provider_id = lp.provider_id and ap.consumer_version_order = latest_consumer_version_order" ) end end
Version data entries
34 entries across 34 versions & 1 rubygems