blob: 972df41f678559456182e30154b6b586ec67b195 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# frozen_string_literal: true
class BackfillCiBuildsForBigintConversion < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
TABLE = :ci_builds
COLUMNS = %i(id stage_id).freeze
def up
return unless should_run?
backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100
end
def down
return unless should_run?
revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS
end
private
def should_run?
Gitlab.dev_or_test_env? || Gitlab.com?
end
end
|