Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2017-04-23 14:53:30 +0300
committerblackst0ne <blackst0ne.ru@gmail.com>2017-04-23 14:53:30 +0300
commitc458b293593c9cdf364286fe4971c22c1e33fbf8 (patch)
tree7f7034949681376ef72e6952f42b844f8b95aca6 /db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
parent1005389f70070245092c1ae5f3f9b10b8e7c102e (diff)
Add index on ci_builds.updated_at
Diffstat (limited to 'db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb')
-rw-r--r--db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb b/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
new file mode 100644
index 00000000000..0bbb74ee05e
--- /dev/null
+++ b/db/migrate/20170423064036_add_index_on_ci_builds_updated_at.rb
@@ -0,0 +1,19 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddIndexOnCiBuildsUpdatedAt < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :ci_builds, :updated_at
+ end
+
+ def down
+ remove_concurrent_index :ci_builds, :updated_at if index_exists?(:ci_builds, :updated_at)
+ end
+end