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-28 01:20:44 +0300
committerblackst0ne <blackst0ne.ru@gmail.com>2017-04-28 01:20:44 +0300
commit4aa984fa7980c49ee2a223954fbcd8aa94c0df18 (patch)
treea17ebb535cbc2f9fbbfe886e57f9d78481f6ae5f /db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb
parent479d21d5850d9878ef292016ae7e643fdbb0b796 (diff)
Add index on ci_runners.contacted_at
Diffstat (limited to 'db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb')
-rw-r--r--db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb b/db/migrate/20170426181740_add_index_on_ci_runners_contacted_at.rb
new file mode 100644
index 00000000000..879825a1934
--- /dev/null
+++ b/db/migrate/20170426181740_add_index_on_ci_runners_contacted_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 AddIndexOnCiRunnersContactedAt < 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_runners, :contacted_at
+ end
+
+ def down
+ remove_concurrent_index :ci_runners, :contacted_at if index_exists?(:ci_runners, :contacted_at)
+ end
+end