diff options
author | Dmitry Chepurovskiy <dm3ch@dm3ch.net> | 2019-05-20 18:03:34 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-05-20 18:03:34 +0300 |
commit | 7017889d0b92dd8bd215770a9d4f823b5dc1f2eb (patch) | |
tree | 0cbce8dda9e38e89632f7d59a0b774873ec8bae5 /db/migrate/20190516011213_add_build_queued_at_index.rb | |
parent | 7115bd811f4bc87c0706fc2b876729878ad8fc5b (diff) |
Added filtering jobs by age to jobs/request API endpoint
Diffstat (limited to 'db/migrate/20190516011213_add_build_queued_at_index.rb')
-rw-r--r-- | db/migrate/20190516011213_add_build_queued_at_index.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20190516011213_add_build_queued_at_index.rb b/db/migrate/20190516011213_add_build_queued_at_index.rb new file mode 100644 index 00000000000..77ffa7cd4e9 --- /dev/null +++ b/db/migrate/20190516011213_add_build_queued_at_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# This migration make queued_at field indexed to speed up builds filtering by job_age + +class AddBuildQueuedAtIndex < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_builds, :queued_at + end + + def down + remove_concurrent_index :ci_builds, :queued_at + end +end |