diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-05 12:08:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-05 12:08:29 +0300 |
commit | dea522994156f9d427b1acc0a22b0e75ffe92c68 (patch) | |
tree | f1496d9c2151bf1096ef8c4234a2698d51eb24c6 /db | |
parent | dfebbcd6b1e2fc7584d9cca1b982f5f12bd648cb (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
3 files changed, 32 insertions, 0 deletions
diff --git a/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml b/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml new file mode 100644 index 00000000000..e029488f5c4 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: BackfillRootStorageStatisticsForkStorageSizes +description: Backfill the public_forks_storage_size, internal_forks_storage_size, and private_forks_storage_size columns on the namespace_root_storage_statistics table +feature_category: consumables_cost_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120916 +milestone: 16.1 diff --git a/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb b/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb new file mode 100644 index 00000000000..6732e33d0a4 --- /dev/null +++ b/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class QueueBackfillRootStorageStatisticsForkStorageSizes < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillRootStorageStatisticsForkStorageSizes" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :namespace_root_storage_statistics, + :namespace_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :namespace_root_storage_statistics, :namespace_id, []) + end +end diff --git a/db/schema_migrations/20230517163300 b/db/schema_migrations/20230517163300 new file mode 100644 index 00000000000..a2baef62fe9 --- /dev/null +++ b/db/schema_migrations/20230517163300 @@ -0,0 +1 @@ +bdda58a5015942f8fe98dedbbab66ff9e39505229da2e6d1726eb73105a89ae1
\ No newline at end of file |