summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-06-01 11:01:24 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2018-06-01 11:01:24 +0000
commite206e32881e4fbfcbe647d7b2ee713c99ef1bf99 (patch)
treeea25b82debd4804697d26c13d312f0cfb728421b
parent36617d94650fd957da021eb5f0533102bb9535b1 (diff)
parentac5fef676e5392bf5f4157fad1bad17c648706c8 (diff)
downloadgitlab-ce-e206e32881e4fbfcbe647d7b2ee713c99ef1bf99.tar.gz
Merge branch '46019-add-missing-migration' into 'master'
Resolve "ActiveRecord::RecordInvalid: Validation failed: Build timeout needs to be at least 10 minutes" Closes #46019 See merge request gitlab-org/gitlab-ce!18775
-rw-r--r--changelogs/unreleased/46019-add-missing-migration.yml5
-rw-r--r--db/post_migrate/20180507083701_set_minimal_project_build_timeout.rb19
2 files changed, 24 insertions, 0 deletions
diff --git a/changelogs/unreleased/46019-add-missing-migration.yml b/changelogs/unreleased/46019-add-missing-migration.yml
new file mode 100644
index 00000000000..e9c6c317de2
--- /dev/null
+++ b/changelogs/unreleased/46019-add-missing-migration.yml
@@ -0,0 +1,5 @@
+---
+title: Add missing migration for minimal Project build_timeout
+merge_request: 18775
+author:
+type: fixed
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