summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-03-20 21:39:17 +0100
committerAndreas Brandl <abrandl@gitlab.com>2018-03-20 22:50:49 +0100
commit78f26f5f7fd4e66323c3d149a9c70dfd5fc2cd6b (patch)
tree1cafa2cda6d0f49c9b819c177f0a0b153311f6fd
parentd980bc89fa26f9b4734edbe1491c73d60423ee4a (diff)
downloadgitlab-ce-ab-44446-add-indexes-for-user-activity-queries.tar.gz
Flip column order in new index.ab-44446-add-indexes-for-user-activity-queries
-rw-r--r--db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb4
-rw-r--r--db/schema.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb b/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
index ff0607a2f14..9a944bc440f 100644
--- a/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
+++ b/db/migrate/20180320182229_add_indexes_for_user_activity_queries.rb
@@ -6,12 +6,12 @@ class AddIndexesForUserActivityQueries < ActiveRecord::Migration
disable_ddl_transaction!
def up
- add_concurrent_index :events, [:project_id, :author_id]
+ add_concurrent_index :events, [:author_id, :project_id]
add_concurrent_index :user_interacted_projects, :user_id
end
def down
- remove_concurrent_index :events, [:project_id, :author_id]
+ remove_concurrent_index :events, [:author_id, :project_id]
patch_foreign_keys do
remove_concurrent_index :user_interacted_projects, :user_id
diff --git a/db/schema.rb b/db/schema.rb
index 6024fc24b0b..e441ca2a1f0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -727,8 +727,8 @@ ActiveRecord::Schema.define(version: 20180320182229) do
end
add_index "events", ["action"], name: "index_events_on_action", using: :btree
+ add_index "events", ["author_id", "project_id"], name: "index_events_on_author_id_and_project_id", using: :btree
add_index "events", ["author_id"], name: "index_events_on_author_id", using: :btree
- add_index "events", ["project_id", "author_id"], name: "index_events_on_project_id_and_author_id", using: :btree
add_index "events", ["project_id", "id"], name: "index_events_on_project_id_and_id", using: :btree
add_index "events", ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id", using: :btree