1ab33b15d1
remove_column should only be used in the up (or change) step of a migration if it's a post-deployment migration. Otherwise there will be downtime due to the ActiveRecord column cache, which we can avoid by using the IgnorableColumn concern in combination with a post-deployment migration.
18 lines
440 B
Ruby
18 lines
440 B
Ruby
# rubocop:disable Migration/RemoveColumn
|
|
class RemovePriorityFromLabels < ActiveRecord::Migration
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
DOWNTIME = true
|
|
DOWNTIME_REASON = 'This migration removes an existing column'
|
|
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
remove_column :labels, :priority, :integer, index: true
|
|
end
|
|
|
|
def down
|
|
add_column :labels, :priority, :integer
|
|
add_concurrent_index :labels, :priority
|
|
end
|
|
end
|