Commit 30678dc1 authored by Giorgenes Gelatti's avatar Giorgenes Gelatti

Adds sorting indexes to package

parent 5f069488
# frozen_string_literal: true
class AddSortingIndexToPackages < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :packages_packages, [:project_id, :created_at]
add_concurrent_index :packages_packages, [:project_id, :version]
add_concurrent_index :packages_packages, [:project_id, :package_type]
end
def down
remove_concurrent_index :packages_packages, [:project_id, :created_at]
remove_concurrent_index :packages_packages, [:project_id, :version]
remove_concurrent_index :packages_packages, [:project_id, :package_type]
end
end
# frozen_string_literal: true
class RemoveProjectIdIndexFromPackages < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
remove_concurrent_index :packages_packages, [:project_id]
end
def down
add_concurrent_index :packages_packages, [:project_id]
end
end
......@@ -2977,8 +2977,10 @@ ActiveRecord::Schema.define(version: 2020_01_30_161817) do
t.string "version"
t.integer "package_type", limit: 2, null: false
t.index ["name"], name: "index_packages_packages_on_name_trigram", opclass: :gin_trgm_ops, using: :gin
t.index ["project_id", "created_at"], name: "index_packages_packages_on_project_id_and_created_at"
t.index ["project_id", "name", "version", "package_type"], name: "idx_packages_packages_on_project_id_name_version_package_type"
t.index ["project_id"], name: "index_packages_packages_on_project_id"
t.index ["project_id", "package_type"], name: "index_packages_packages_on_project_id_and_package_type"
t.index ["project_id", "version"], name: "index_packages_packages_on_project_id_and_version"
end
create_table "packages_tags", force: :cascade do |t|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment