blob: b3a9bf00418e99ed7b79149cc8887d52bbda0867 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# frozen_string_literal: true
class LowerProjectBuildTimeoutToRespectMaxValidation < Gitlab::Database::Migration[2.1]
restrict_gitlab_migration gitlab_schema: :gitlab_main
class Project < MigrationRecord
self.table_name = 'projects'
include EachBatch
end
def up
Project.where("build_timeout >= #{1.month.to_i}").each_batch(of: 10) do |records|
records.update_all(build_timeout: (1.month - 1.second).to_i)
end
end
def down
# no-op
end
end
|