diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 12:24:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-20 12:24:38 +0300 |
commit | 898e2cc1dfa88b4ac39cb4b35011f61b37f57b51 (patch) | |
tree | c6524edb6c9a43cccf93be05c36883fde1a53ee4 /db/migrate/20191213120427_fix_max_pages_size.rb | |
parent | b5571e6e22cdacc81f78eff5943d68c8ba220fbb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/migrate/20191213120427_fix_max_pages_size.rb')
-rw-r--r-- | db/migrate/20191213120427_fix_max_pages_size.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20191213120427_fix_max_pages_size.rb b/db/migrate/20191213120427_fix_max_pages_size.rb new file mode 100644 index 00000000000..498ea91b773 --- /dev/null +++ b/db/migrate/20191213120427_fix_max_pages_size.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class FixMaxPagesSize < ActiveRecord::Migration[5.2] + DOWNTIME = false + MAX_SIZE = 1.terabyte / 1.megabyte + + class ApplicationSetting < ActiveRecord::Base + self.table_name = 'application_settings' + self.inheritance_column = :_type_disabled + end + + def up + table = ApplicationSetting.arel_table + ApplicationSetting.where(table[:max_pages_size].gt(MAX_SIZE)).update_all(max_pages_size: MAX_SIZE) + end + + def down + # no-op + end +end |