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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 15:06:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-22 15:06:20 +0300
commitb1bcdba89bc241e2cede910f26cf3f5fff8d7901 (patch)
tree41b45ec9ff1ba56c93b29b00435495e7e5abf02b /db
parent30dc5b50569db30fef06cc7ab66e7341161b3c70 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb38
-rw-r--r--db/schema.rb2
2 files changed, 39 insertions, 1 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
diff --git a/db/schema.rb b/db/schema.rb
index 290c669e467..7c5a54bd1d2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_10_16_220135) do
+ActiveRecord::Schema.define(version: 2019_10_17_045817) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"