add unique index for gpg_signatures#commit_sha

This commit is contained in:
Alexis Reigel 2017-07-26 09:30:33 +02:00
parent fef030c23d
commit 4e53131f7d
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ class CreateGpgSignatures < ActiveRecord::Migration
t.text :gpg_key_user_name
t.text :gpg_key_user_email
t.index :commit_sha, length: Gitlab::Database.mysql? ? 20 : nil
t.index :commit_sha, unique: true, length: Gitlab::Database.mysql? ? 20 : nil
t.index :gpg_key_primary_keyid, length: Gitlab::Database.mysql? ? 20 : nil
end
end

View file

@ -565,7 +565,7 @@ ActiveRecord::Schema.define(version: 20170725145659) do
t.text "gpg_key_user_email"
end
add_index "gpg_signatures", ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", using: :btree
add_index "gpg_signatures", ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true, using: :btree
add_index "gpg_signatures", ["gpg_key_id"], name: "index_gpg_signatures_on_gpg_key_id", using: :btree
add_index "gpg_signatures", ["gpg_key_primary_keyid"], name: "index_gpg_signatures_on_gpg_key_primary_keyid", using: :btree
add_index "gpg_signatures", ["project_id"], name: "index_gpg_signatures_on_project_id", using: :btree