Commit 3f51e059 authored by Mark Chao's avatar Mark Chao

Index on code_owner

Code owner rules are queries on its own.
parent 66d97a47
......@@ -233,7 +233,7 @@ ActiveRecord::Schema.define(version: 20190103140724) do
t.integer "approvals_required", limit: 2, default: 0, null: false
t.boolean "code_owner", default: false, null: false
t.string "name", null: false
t.index ["merge_request_id"], name: "index_approval_merge_request_rules_on_merge_request_id", using: :btree
t.index ["merge_request_id", "code_owner"], name: "index_approval_merge_request_rules_1", using: :btree
end
create_table "approval_merge_request_rules_approvals", id: :bigserial, force: :cascade do |t|
......
......@@ -15,10 +15,12 @@ class CreateApprovalRules < ActiveRecord::Migration[5.0]
create_table :approval_merge_request_rules, id: :bigserial do |t|
t.timestamps_with_timezone
t.references :merge_request, index: true, foreign_key: { on_delete: :cascade }, null: false
t.references :merge_request, index: false, foreign_key: { on_delete: :cascade }, null: false
t.integer :approvals_required, limit: 2, default: 0, null: false
t.boolean :code_owner, default: false, null: false
t.string :name, null: false
t.index [:merge_request_id, :code_owner], name: 'index_approval_merge_request_rules_1'
end
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