diff options
Diffstat (limited to 'db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb')
-rw-r--r-- | db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb b/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb new file mode 100644 index 00000000000..cc26db924fe --- /dev/null +++ b/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropIndexOnCiBuildsForToken < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + INDEXNAME = :index_ci_builds_on_token + + def up + remove_concurrent_index_by_name :ci_builds, INDEXNAME + end + + def down + add_concurrent_index :ci_builds, :token, unique: true, name: INDEXNAME + end +end |