blob: a7c23ac35d2b882f2bb80887fa1fd388386ba68b (
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
|
# frozen_string_literal: true
class DropCiStagesPartitionIdDefault < Gitlab::Database::Migration[2.1]
include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
enable_lock_retries!
TABLE_NAME = :ci_stages
COLUMN_NAME = :partition_id
def up
change_column_default(TABLE_NAME, COLUMN_NAME, from: 100, to: nil) if should_run?
end
def down
change_column_default(TABLE_NAME, COLUMN_NAME, from: nil, to: 100) if should_run?
end
private
def should_run?
can_execute_on?(TABLE_NAME)
end
end
|