diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-18 21:08:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-18 21:08:05 +0300 |
commit | 6b5d8b17e28741bccf31029633cc5af7ceab1486 (patch) | |
tree | 38732dffc21a5084b5c3d49b56b81aa11b4e657e /db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb | |
parent | a84995f457d775bb73598d4393c3bc99805d9b58 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb')
-rw-r--r-- | db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb b/db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb new file mode 100644 index 00000000000..077a60856cd --- /dev/null +++ b/db/migrate/20220512020500_index_batched_migrations_on_gitlab_schema_and_configuration.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class IndexBatchedMigrationsOnGitlabSchemaAndConfiguration < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :batched_background_migrations + INDEX_NAME = 'index_batched_migrations_on_gl_schema_and_unique_configuration' + + def up + add_concurrent_index TABLE_NAME, + %i[gitlab_schema job_class_name table_name column_name job_arguments], + unique: true, + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end |