summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authoryguo <yguo@gitlab.com>2019-06-17 13:42:00 -0400
committeryguo <yguo@gitlab.com>2019-06-17 13:42:00 -0400
commitcec958f04305036451090a8e76fc490964b1b237 (patch)
treed6850d7e50e973bd475f7b856ab449a662f255fd /db
parente6059b3d8d6277e068633a867f539b281f872938 (diff)
downloadgitlab-ce-cec958f04305036451090a8e76fc490964b1b237.tar.gz
Add index on invite-email to members
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190610142825_add_index_to_members_invite_email.rb21
-rw-r--r--db/schema.rb1
2 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20190610142825_add_index_to_members_invite_email.rb b/db/migrate/20190610142825_add_index_to_members_invite_email.rb
new file mode 100644
index 00000000000..58157cc5313
--- /dev/null
+++ b/db/migrate/20190610142825_add_index_to_members_invite_email.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddIndexToMembersInviteEmail < ActiveRecord::Migration[5.1]
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :members, [:invite_email]
+ end
+
+ def down
+ remove_concurrent_index :members, [:invite_email]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index a50ab02f718..b8274891b43 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1848,6 +1848,7 @@ ActiveRecord::Schema.define(version: 20190611161641) do
t.boolean "ldap", default: false, null: false
t.boolean "override", default: false, null: false
t.index ["access_level"], name: "index_members_on_access_level", using: :btree
+ t.index ["invite_email"], name: "index_members_on_invite_email", using: :btree
t.index ["invite_token"], name: "index_members_on_invite_token", unique: true, using: :btree
t.index ["requested_at"], name: "index_members_on_requested_at", using: :btree
t.index ["source_id", "source_type"], name: "index_members_on_source_id_and_source_type", using: :btree