diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 15:00:18 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-23 15:00:18 +0000 |
commit | 6ce82deda34e8af9d07cf7dfff0057f33b9e6187 (patch) | |
tree | e88b7ca57376e83556c7a651d61dbe8ba09440b5 /db | |
parent | 3d62fe7ad9b32c2e68d253d0b2bd178215c65fa5 (diff) | |
download | gitlab-ce-6ce82deda34e8af9d07cf7dfff0057f33b9e6187.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-ee
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb | 30 | ||||
-rw-r--r-- | db/schema_migrations/20201110161542 | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb b/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb new file mode 100644 index 00000000000..5e907092e83 --- /dev/null +++ b/db/post_migrate/20201110161542_cleanup_transfered_projects_shared_runners.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class CleanupTransferedProjectsSharedRunners < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + BATCH_SIZE = 25_000 + INTERVAL = 3.minutes + MIGRATION = 'ResetSharedRunnersForTransferredProjects' + + disable_ddl_transaction! + + class Namespace < ActiveRecord::Base + include EachBatch + + self.table_name = 'namespaces' + end + + def up + queue_background_migration_jobs_by_range_at_intervals(Namespace, + MIGRATION, + INTERVAL, + batch_size: BATCH_SIZE) + end + + def down + # This migration fixes an inconsistent database state resulting from https://gitlab.com/gitlab-org/gitlab/-/issues/271728 + # and as such does not require a down migration + end +end diff --git a/db/schema_migrations/20201110161542 b/db/schema_migrations/20201110161542 new file mode 100644 index 00000000000..1d4ca947738 --- /dev/null +++ b/db/schema_migrations/20201110161542 @@ -0,0 +1 @@ +ebc304867bab499da3f9fa69b32373a328948b5068b226df5166042d1c1c7604
\ No newline at end of file |