Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-05-07 11:52:57 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2018-05-22 04:40:53 +0300
commit135f012565a963a493d5890da44b4fbb3d9df093 (patch)
tree17741933122a821db64e4ffc0250af1b98f82632 /db
parentb215db37f878bfc4a753705e453f74b8db6546e4 (diff)
Add missing migration for minimal Project build_timeout
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
new file mode 100644
index 00000000000..d9d9e93f5a3
--- /dev/null
+++ b/db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb
@@ -0,0 +1,19 @@
+class SetMinimalProjectBuildTimeout < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ MINIMUM_TIMEOUT = 600
+
+ # Allow this migration to resume if it fails partway through
+ disable_ddl_transaction!
+
+ def up
+ 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