2017-01-19 12:32:10 -05:00
|
|
|
class AddEstimateToIssuablesCe < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2017-01-24 11:12:55 -05:00
|
|
|
def up
|
2017-01-19 12:32:10 -05:00
|
|
|
unless column_exists?(:issues, :time_estimate)
|
|
|
|
add_column :issues, :time_estimate, :integer
|
|
|
|
end
|
|
|
|
|
|
|
|
unless column_exists?(:merge_requests, :time_estimate)
|
|
|
|
add_column :merge_requests, :time_estimate, :integer
|
|
|
|
end
|
|
|
|
end
|
2017-01-24 11:12:55 -05:00
|
|
|
|
|
|
|
def down
|
|
|
|
if column_exists?(:issues, :time_estimate)
|
|
|
|
remove_column :issues, :time_estimate
|
|
|
|
end
|
|
|
|
|
|
|
|
if column_exists?(:merge_requests, :time_estimate)
|
|
|
|
remove_column :merge_requests, :time_estimate
|
|
|
|
end
|
|
|
|
end
|
2017-01-19 12:32:10 -05:00
|
|
|
end
|