Commit 88c0cce6 authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'ab/projects-api-indexes' into 'master'

Add index for projects API default param

See merge request gitlab-org/gitlab!19989
parents e0e66d87 f2342c48
---
title: Add index for unauthenticated requests to projects API default endpoint
merge_request: 19989
author:
type: performance
# frozen_string_literal: true
class AddIndexesForProjectsApiDefaultParams < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :projects, %i(visibility_level created_at id)
remove_concurrent_index_by_name :projects, 'index_projects_on_visibility_level'
end
def down
add_concurrent_index :projects, :visibility_level
remove_concurrent_index :projects, %i(visibility_level created_at id)
end
end
......@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2019_11_12_115317) do
ActiveRecord::Schema.define(version: 2019_11_12_214305) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
......@@ -3145,7 +3145,7 @@ ActiveRecord::Schema.define(version: 2019_11_12_115317) do
t.index ["runners_token"], name: "index_projects_on_runners_token"
t.index ["runners_token_encrypted"], name: "index_projects_on_runners_token_encrypted"
t.index ["star_count"], name: "index_projects_on_star_count"
t.index ["visibility_level"], name: "index_projects_on_visibility_level"
t.index ["visibility_level", "created_at", "id"], name: "index_projects_on_visibility_level_and_created_at_and_id"
end
create_table "prometheus_alert_events", 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