Sha256: a021b7686aae92daeca1c0c44b01c46bb6d055dd12aeb4cf0ad34e3bbb457f8b

Contents?: true

Size: 882 Bytes

Versions: 5

Compression:

Stored size: 882 Bytes

Contents

require_relative 'migration_helper'

include PactBroker::MigrationHelper

Sequel.migration do
  up do
    if postgres?
      run("CREATE INDEX tags_pacticipant_id_name_version_order_desc_index ON tags (pacticipant_id, name, version_order DESC);")
      run("CREATE INDEX versions_pacticipant_id_order_desc_index ON versions (pacticipant_id, \"order\" DESC);")
    else
      alter_table(:tags) do
        add_index([:pacticipant_id, :name, :version_order], name: "tags_pacticipant_id_name_version_order_index")
      end
    end
  end

  down do
    if postgres?
      run("DROP INDEX tags_pacticipant_id_name_version_order_desc_index")
      run("DROP INDEX versions_pacticipant_id_order_desc_index")
    else
      alter_table(:tags) do
        drop_index([:pacticipant_id, :name, :version_order], name: "tags_pacticipant_id_name_version_order_index")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pact_broker-2.79.1 db/migrations/20210206_add_index_to_tags_and_versions.rb
pact_broker-2.79.0 db/migrations/20210206_add_index_to_tags_and_versions.rb
pact_broker-2.78.1 db/migrations/20210206_add_index_to_tags_and_versions.rb
pact_broker-2.78.0 db/migrations/20210206_add_index_to_tags_and_versions.rb
pact_broker-2.77.0 db/migrations/20210206_add_index_to_tags_and_versions.rb