diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-13 00:16:12 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-13 00:16:12 +0000 |
commit | 4dc620034e192cdfb4dab5908a2f406e37e76b68 (patch) | |
tree | 9cd1069bce3d425254639309cb4fc4bda396c9ac /db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb | |
parent | d36c792351474304405b5a1033dc2c4815ebc0e4 (diff) | |
download | gitlab-ce-4dc620034e192cdfb4dab5908a2f406e37e76b68.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb')
-rw-r--r-- | db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb new file mode 100644 index 00000000000..6de0f9424e8 --- /dev/null +++ b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexClusterAgentTokensOnStatus < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_cluster_agent_tokens_on_agent_id_status_last_used_at' + + def up + add_concurrent_index :cluster_agent_tokens, 'agent_id, status, last_used_at DESC NULLS LAST', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME + end +end |