diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-03 21:09:46 +0300 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-05 09:51:18 +0300 |
commit | 16d8251093b80ec544578481f20e0074b392d738 (patch) | |
tree | e9daeecec6b36dba5d807634ef138856f67194d9 /db | |
parent | ba9ef7f3935cfaa42fcdb2317567cc383c7e9c22 (diff) |
Add index on both Award Emoji user and name
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb | 11 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb b/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb new file mode 100644 index 00000000000..0c25f87dfb4 --- /dev/null +++ b/db/migrate/20160703180340_add_index_on_award_emoji_user_and_name.rb @@ -0,0 +1,11 @@ +# rubocop:disable all +# Migration type: online without errors + +class AddIndexOnAwardEmojiUserAndName < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + disable_ddl_transaction! + + def change + add_concurrent_index(:award_emoji, [:user_id, :name]) + end +end diff --git a/db/schema.rb b/db/schema.rb index 0f5f9f243fa..5b9ed985fac 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160628085157) do +ActiveRecord::Schema.define(version: 20160703180340) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -112,6 +112,7 @@ ActiveRecord::Schema.define(version: 20160628085157) do end add_index "award_emoji", ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id", using: :btree + add_index "award_emoji", ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name", using: :btree add_index "award_emoji", ["user_id"], name: "index_award_emoji_on_user_id", using: :btree create_table "broadcast_messages", force: :cascade do |t| |