summaryrefslogtreecommitdiff
path: root/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-21 06:09:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-21 06:09:06 +0000
commit7e6efee3b34f52a62360cb4a50f2e77cb67cf769 (patch)
tree6bfe2f6f8fc8f147269ab5020c42afad06f62785 /db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb
parent22400f4dd0bd5503b3c6e4914d8dd6e1167b6c98 (diff)
downloadgitlab-ce-7e6efee3b34f52a62360cb4a50f2e77cb67cf769.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb')
-rw-r--r--db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb b/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb
new file mode 100644
index 00000000000..aa03310eb0a
--- /dev/null
+++ b/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+# See https://docs.gitlab.com/ee/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class FinalizeFixIncoherentPackagesSizeOnProjectStatistics < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'FixIncoherentPackagesSizeOnProjectStatistics'
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :project_statistics,
+ column_name: :id,
+ job_arguments: [],
+ finalize: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end