2017-09-13 12:43:02 +00:00
|
|
|
# rubocop:disable all
|
|
|
|
class AddFastForwardOptionToProject < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
# Set this constant to true if this migration requires downtime.
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
2017-10-04 09:10:09 +00:00
|
|
|
def up
|
2017-11-04 12:20:27 +00:00
|
|
|
# We put condition here because of a mistake we made a couple of years ago
|
|
|
|
# see https://gitlab.com/gitlab-org/gitlab-ce/issues/39382#note_45716103
|
|
|
|
unless column_exists?(:projects, :merge_requests_ff_only_enabled)
|
|
|
|
add_column_with_default(:projects, :merge_requests_ff_only_enabled, :boolean, default: false)
|
|
|
|
end
|
2017-09-13 12:43:02 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2017-10-04 09:42:28 +00:00
|
|
|
if column_exists?(:projects, :merge_requests_ff_only_enabled)
|
|
|
|
remove_column(:projects, :merge_requests_ff_only_enabled)
|
|
|
|
end
|
2017-09-13 12:43:02 +00:00
|
|
|
end
|
|
|
|
end
|