diff options
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180212121259_index_for_groups_analytic_controller_4899.rb | 18 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/db/migrate/20180212121259_index_for_groups_analytic_controller_4899.rb b/db/migrate/20180212121259_index_for_groups_analytic_controller_4899.rb new file mode 100644 index 00000000000..d57d5a1ce79 --- /dev/null +++ b/db/migrate/20180212121259_index_for_groups_analytic_controller_4899.rb @@ -0,0 +1,18 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class IndexForGroupsAnalyticController4899 < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :events, [:project_id, :created_at] + end + + def down + remove_concurrent_index :events, [:project_id, :created_at] + end +end diff --git a/db/schema.rb b/db/schema.rb index 6b43fc8403c..4b4428d3dd4 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: 20180208183958) do +ActiveRecord::Schema.define(version: 20180212121259) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -694,6 +694,7 @@ ActiveRecord::Schema.define(version: 20180208183958) do add_index "events", ["action"], name: "index_events_on_action", using: :btree add_index "events", ["author_id"], name: "index_events_on_author_id", using: :btree + add_index "events", ["project_id", "created_at"], name: "index_events_on_project_id_and_created_at", 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 |