diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-21 06:09:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-21 06:09:06 +0000 |
commit | 7e6efee3b34f52a62360cb4a50f2e77cb67cf769 (patch) | |
tree | 6bfe2f6f8fc8f147269ab5020c42afad06f62785 /db/post_migrate | |
parent | 22400f4dd0bd5503b3c6e4914d8dd6e1167b6c98 (diff) | |
download | gitlab-ce-7e6efee3b34f52a62360cb4a50f2e77cb67cf769.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db/post_migrate')
-rw-r--r-- | db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb | 25 | ||||
-rw-r--r-- | db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb | 15 |
2 files changed, 40 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 diff --git a/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb b/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb new file mode 100644 index 00000000000..8279cff7afb --- /dev/null +++ b/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropTmpIdxPackageFilesOnNonZeroSize < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_idx_package_files_on_non_zero_size' + + def up + remove_concurrent_index :packages_package_files, %i[package_id size], name: INDEX_NAME + end + + def down + add_concurrent_index :packages_package_files, %i[package_id size], where: 'size IS NOT NULL', name: INDEX_NAME + end +end |