Sha256: 429982cd13e166d5a959a7b0c7fdfcc345e0d18d18d45b5c60aeb3ccfffd8729

Contents?: true

Size: 731 Bytes

Versions: 122

Compression:

Stored size: 731 Bytes

Contents

Sequel.migration do
  up do
    # consumer_id and provider_id are redundant by avoid making extra joins when creating views
    rows = from(:verifications).select_group(
          Sequel[:verifications][:consumer_id],
          Sequel[:verifications][:pact_version_id],
          Sequel[:verifications][:provider_id],
          Sequel[:verifications][:provider_version_id])
        .select_append{ max(verifications[id]).as(verification_id) }

    # The danger with this migration is that a verification created by an old node will be lost
    from(:latest_verification_id_for_pact_version_and_provider_version).insert(rows)
  end

  down do
    from(:latest_verification_id_for_pact_version_and_provider_version).delete
  end
end

Version data entries

122 entries across 122 versions & 1 rubygems

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