diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 12:06:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-22 12:06:20 +0000 |
commit | b1bcdba89bc241e2cede910f26cf3f5fff8d7901 (patch) | |
tree | 41b45ec9ff1ba56c93b29b00435495e7e5abf02b /db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb | |
parent | 30dc5b50569db30fef06cc7ab66e7341161b3c70 (diff) | |
download | gitlab-ce-b1bcdba89bc241e2cede910f26cf3f5fff8d7901.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb')
-rw-r--r-- | db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb b/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb new file mode 100644 index 00000000000..4a1eda130f9 --- /dev/null +++ b/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +# TODO: remove this migration after execution on gitlab.com https://gitlab.com/gitlab-org/gitlab/issues/34018 +class ScheduleFixGitlabComPagesAccessLevel < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + MIGRATION = 'FixGitlabComPagesAccessLevel' + BATCH_SIZE = 20_000 + BATCH_TIME = 2.minutes + + # Project + class Project < ActiveRecord::Base + include EachBatch + + self.table_name = 'projects' + self.inheritance_column = :_type_disabled + end + + disable_ddl_transaction! + + def up + return unless ::Gitlab.com? + + queue_background_migration_jobs_by_range_at_intervals( + Project, + MIGRATION, + BATCH_TIME, + batch_size: BATCH_SIZE) + end + + def down + end +end |