Sha256: e09a6ddec6c50107b5a9e8310869a8741bb9f7ae75f69f2f4c24415467e67e48

Contents?: true

Size: 823 Bytes

Versions: 48

Compression:

Stored size: 823 Bytes

Contents

require_relative "migration_helper"

Sequel.migration do
  change do
    create_view(:latest_tagged_version_orders,
      PactBroker::MigrationHelper.sqlite_safe("
        select v.pacticipant_id, t.name as tag_name, max(v.order) as latest_version_order, 1 as latest
        from tags t
        inner join versions v
        on v.id = t.version_id
        group by v.pacticipant_id, t.name
      ")
    )

    create_view(:tags_with_latest_flag,
      PactBroker::MigrationHelper.sqlite_safe("
        select t.*, ltvo.latest
        from tags t
        inner join versions v
        on v.id = t.version_id
        left outer join latest_tagged_version_orders ltvo
        on t.name = ltvo.tag_name
        and v.pacticipant_id = ltvo.pacticipant_id
        and v.order = ltvo.latest_version_order
      ")
    )
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
pact_broker-2.114.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.113.2 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.113.1 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.113.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.112.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.111.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.109.1 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.109.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.108.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.107.1 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.107.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.107.0.beta.1 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.106.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.105.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.104.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.103.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.102.2 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.102.1 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.102.0 db/migrations/20180123_create_tags_with_latest_flag.rb
pact_broker-2.101.0 db/migrations/20180123_create_tags_with_latest_flag.rb