diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-17 12:07:48 +0300 |
commit | 5bd24a54ef4ce3a38a860eb53b66d062c2382971 (patch) | |
tree | 5f5e65571dfcb2c62c27600ee7655dec4b44c923 /db/migrate/20191205060723_add_index_to_keys.rb | |
parent | 74673d04d25ffed35cbcf17cd42969bed0a4e705 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20191205060723_add_index_to_keys.rb')
-rw-r--r-- | db/migrate/20191205060723_add_index_to_keys.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20191205060723_add_index_to_keys.rb b/db/migrate/20191205060723_add_index_to_keys.rb new file mode 100644 index 00000000000..8e8c725f62e --- /dev/null +++ b/db/migrate/20191205060723_add_index_to_keys.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToKeys < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :keys, :last_used_at, order: { last_used_at: 'DESC NULLS LAST' } + end + + def down + remove_concurrent_index :keys, :last_used_at + end +end |