Commit bfc67bd0 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Index to count projects requiring code owner approval

This will be required for counting projects that are actively
requiring code owner approval.
parent 7af50aff
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190301182457) do ActiveRecord::Schema.define(version: 20190305162221) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -2445,6 +2445,7 @@ ActiveRecord::Schema.define(version: 20190301182457) do ...@@ -2445,6 +2445,7 @@ ActiveRecord::Schema.define(version: 20190301182457) do
t.string "runners_token_encrypted" t.string "runners_token_encrypted"
t.string "bfg_object_map" t.string "bfg_object_map"
t.boolean "merge_requests_require_code_owner_approval" t.boolean "merge_requests_require_code_owner_approval"
t.index ["archived", "pending_delete", "merge_requests_require_code_owner_approval"], name: "projects_requiring_code_owner_approval", where: "((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))", using: :btree
t.index ["ci_id"], name: "index_projects_on_ci_id", using: :btree t.index ["ci_id"], name: "index_projects_on_ci_id", using: :btree
t.index ["created_at"], name: "index_projects_on_created_at", using: :btree t.index ["created_at"], name: "index_projects_on_created_at", using: :btree
t.index ["creator_id"], name: "index_projects_on_creator_id", using: :btree t.index ["creator_id"], name: "index_projects_on_creator_id", using: :btree
......
# frozen_string_literal: true
class AddIndexForCountingProjectsRequiringCodeOwnerApproval < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX = [
:projects, [:archived, :pending_delete, :merge_requests_require_code_owner_approval],
name: 'projects_requiring_code_owner_approval',
where: "pending_delete = 'f' AND archived = 'f' AND merge_requests_require_code_owner_approval = 't' "
]
disable_ddl_transaction!
def up
add_concurrent_index(*INDEX)
end
def down
remove_concurrent_index(*INDEX)
end
end
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