diff --git a/db/migrate/20170613154149_create_gpg_signatures.rb b/db/migrate/20170613154149_create_gpg_signatures.rb index 775a9463914f5eae11bb7b575ba33a8c382437a6..f6b5e7ebb7b8909a2d56a9f772a7c68066b3f162 100644 --- a/db/migrate/20170613154149_create_gpg_signatures.rb +++ b/db/migrate/20170613154149_create_gpg_signatures.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 2cc8b1624c0862217796f23a2b2f9b2dd0d4f99b..63030350c5dcd962f0c83a3dcb0226a6fe1c2b9f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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