2018-11-13 07:27:31 +00:00
|
|
|
class SetMinimalProjectBuildTimeout < ActiveRecord::Migration[4.2]
|
2018-05-07 08:52:57 +00:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
MINIMUM_TIMEOUT = 600
|
|
|
|
|
|
|
|
# Allow this migration to resume if it fails partway through
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
2018-07-25 08:59:23 +00:00
|
|
|
# rubocop:disable Migration/UpdateLargeTable
|
|
|
|
# rubocop:disable Migration/UpdateColumnInBatches
|
2018-05-07 08:52:57 +00:00
|
|
|
update_column_in_batches(:projects, :build_timeout, MINIMUM_TIMEOUT) do |table, query|
|
|
|
|
query.where(table[:build_timeout].lt(MINIMUM_TIMEOUT))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
# no-op
|
|
|
|
end
|
|
|
|
end
|