summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-04-11 12:04:11 +0100
committerSean McGivern <sean@gitlab.com>2019-04-11 12:06:33 +0100
commita409a77d5c5d75b02421e7d4a8a293c3469e7556 (patch)
tree5fe8e66c56c3f6cebfa4001a4e9096c6ff239941 /db
parente00c7016b10892d847335d6a3944f34b717861d9 (diff)
downloadgitlab-ce-a409a77d5c5d75b02421e7d4a8a293c3469e7556.tar.gz
Restore index on services.type
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20190107151020_add_services_type_index.rb20
-rw-r--r--db/schema.rb1
2 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20190107151020_add_services_type_index.rb b/db/migrate/20190107151020_add_services_type_index.rb
new file mode 100644
index 00000000000..26b5bd58750
--- /dev/null
+++ b/db/migrate/20190107151020_add_services_type_index.rb
@@ -0,0 +1,20 @@
+# 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 AddServicesTypeIndex < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :services, :type unless index_exists?(:services, :type)
+ end
+
+ def down
+ remove_concurrent_index :services, :type if index_exists?(:services, :type)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index df47f988901..d1b3672725d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1996,6 +1996,7 @@ ActiveRecord::Schema.define(version: 20190326164045) do
t.boolean "confidential_note_events", default: true
t.index ["project_id"], name: "index_services_on_project_id", using: :btree
t.index ["template"], name: "index_services_on_template", using: :btree
+ t.index ["type"], name: "index_services_on_type", using: :btree
end
create_table "shards", force: :cascade do |t|