diff options
Diffstat (limited to 'db/post_migrate/20200704143633_add_index_on_user_id_and_created_at_where_source_to_ci_pipelines.rb')
-rw-r--r-- | db/post_migrate/20200704143633_add_index_on_user_id_and_created_at_where_source_to_ci_pipelines.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20200704143633_add_index_on_user_id_and_created_at_where_source_to_ci_pipelines.rb b/db/post_migrate/20200704143633_add_index_on_user_id_and_created_at_where_source_to_ci_pipelines.rb new file mode 100644 index 00000000000..d84b2b4cad3 --- /dev/null +++ b/db/post_migrate/20200704143633_add_index_on_user_id_and_created_at_where_source_to_ci_pipelines.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnUserIdAndCreatedAtWhereSourceToCiPipelines < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pipelines, [:user_id, :created_at, :config_source] + end + + def down + remove_concurrent_index :ci_pipelines, [:user_id, :created_at, :config_source] + end +end |