diff options
Diffstat (limited to 'db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb')
-rw-r--r-- | db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb b/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb deleted file mode 100644 index 3c6f2385f1d..00000000000 --- a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiSourcesPipelinesSourceJobIdForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_sources_pipelines, :source_job_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_sources_pipelines', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump([%w[source_job_id], %w[source_job_id_convert_to_bigint]])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end |