diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-21 09:09:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-21 09:09:06 +0300 |
commit | 7e6efee3b34f52a62360cb4a50f2e77cb67cf769 (patch) | |
tree | 6bfe2f6f8fc8f147269ab5020c42afad06f62785 /db | |
parent | 22400f4dd0bd5503b3c6e4914d8dd6e1167b6c98 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
5 files changed, 42 insertions, 2 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 diff --git a/db/schema_migrations/20230420065656 b/db/schema_migrations/20230420065656 new file mode 100644 index 00000000000..dd89c9e19e3 --- /dev/null +++ b/db/schema_migrations/20230420065656 @@ -0,0 +1 @@ +e29be6311d828a76c594cf350d5212fac9913362dd3e9b96fda6f74c50edfcdb
\ No newline at end of file diff --git a/db/schema_migrations/20230420070009 b/db/schema_migrations/20230420070009 new file mode 100644 index 00000000000..7dfad0f6dee --- /dev/null +++ b/db/schema_migrations/20230420070009 @@ -0,0 +1 @@ +74b9c628c09856c3285452be85a853103e7b7860d1e33df664bdcae927f690d1
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 27f31e09207..84183c6720a 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -32982,8 +32982,6 @@ CREATE INDEX tmp_idx_for_feedback_comment_processing ON vulnerability_feedback U CREATE INDEX tmp_idx_for_vulnerability_feedback_migration ON vulnerability_feedback USING btree (id) WHERE ((migrated_to_state_transition = false) AND (feedback_type = 0)); -CREATE INDEX tmp_idx_package_files_on_non_zero_size ON packages_package_files USING btree (package_id, size) WHERE (size IS NOT NULL); - CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL)); |