Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/workhorse.gitlab-ci.yml4
-rw-r--r--.rubocop_todo/rspec/missing_feature_category.yml2
-rw-r--r--GITLAB_KAS_VERSION2
-rw-r--r--app/services/ci/job_artifacts/create_service.rb2
-rw-r--r--app/workers/object_storage/delete_stale_direct_uploads_worker.rb2
-rw-r--r--config/events/1676085590_Admin__AuditLogsController_visit_instance_compliance_audit_events.yml4
-rw-r--r--config/events/1676085625_Admin__CredentialsController_visit_compliance_credential_inventory.yml4
-rw-r--r--config/events/1676085737_Groups__AuditEventsController_visit_group_compliance_audit_events.yml6
-rw-r--r--config/events/1676085856_API__AuditEvents_admin_audit_event_request.yml6
-rw-r--r--config/events/1676085891_EE__API__Groups_group_audit_event_request.yml4
-rw-r--r--config/events/1676085919_EE__API__Projects_project_audit_event_request.yml4
-rw-r--r--config/feature_flags/development/ci_artifacts_upload_to_final_location.yml8
-rw-r--r--config/feature_flags/development/disable_all_mention.yml (renamed from config/feature_flags/development/stale_pending_direct_uploads_cleaner.yml)8
-rw-r--r--db/init_structure.sql2282
-rw-r--r--db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb17
-rw-r--r--db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb18
-rw-r--r--db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb12
-rw-r--r--db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb15
-rw-r--r--db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb9
-rw-r--r--db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb15
-rw-r--r--db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb15
-rw-r--r--db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb15
-rw-r--r--db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb15
-rw-r--r--db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb15
-rw-r--r--db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb7
-rw-r--r--db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb7
-rw-r--r--db/migrate/20211210025754_alter_constraint_of_phone.rb17
-rw-r--r--db/migrate/20211210031721_change_user_details_phone_text_limit.rb15
-rw-r--r--db/migrate/20211213130324_update_timelogs_spent_at_default.rb7
-rw-r--r--db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb13
-rw-r--r--db/migrate/20211213154259_add_status_to_packages_package_files.rb7
-rw-r--r--db/migrate/20211213154704_add_status_index_to_packages_package_files.rb15
-rw-r--r--db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb15
-rw-r--r--db/migrate/20211215182006_update_application_settings_protected_paths.rb58
-rw-r--r--db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb10
-rw-r--r--db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb13
-rw-r--r--db/migrate/20211216135651_add_index_to_cluster_agent_id.rb16
-rw-r--r--db/migrate/20211216220939_add_group_crm_settings.rb13
-rw-r--r--db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb19
-rw-r--r--db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb15
-rw-r--r--db/migrate/20211223125921_add_temp_index_to_members_state.rb16
-rw-r--r--db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb13
-rw-r--r--db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb15
-rw-r--r--db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb15
-rw-r--r--db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb13
-rw-r--r--db/migrate/20220105121325_add_route_namespace_reference.rb13
-rw-r--r--db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb15
-rw-r--r--db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb15
-rw-r--r--db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb58
-rw-r--r--db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb40
-rw-r--r--db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb41
-rw-r--r--db/migrate/20220106141756_remove_lock_version_indexes.rb23
-rw-r--r--db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb79
-rw-r--r--db/migrate/20220106230629_add_registry_migration_application_settings.rb15
-rw-r--r--db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb19
-rw-r--r--db/migrate/20220107091629_add_route_namespace_index.rb19
-rw-r--r--db/migrate/20220107165036_remove_note_id_index.rb16
-rw-r--r--db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb17
-rw-r--r--db/migrate/20220110170953_create_ci_secure_files.rb19
-rw-r--r--db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb12
-rw-r--r--db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb13
-rw-r--r--db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb7
-rw-r--r--db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb15
-rw-r--r--db/migrate/20220111200254_remove_index_from_merge_requests.rb15
-rw-r--r--db/migrate/20220112115413_add_requires_verification_to_user_details.rb9
-rw-r--r--db/migrate/20220112205111_create_security_training_providers.rb14
-rw-r--r--db/migrate/20220112232037_add_member_namespace_reference.rb13
-rw-r--r--db/migrate/20220112232605_add_member_namespace_index.rb19
-rw-r--r--db/migrate/20220113125401_create_security_trainings.rb18
-rw-r--r--db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb7
-rw-r--r--db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb15
-rw-r--r--db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb13
-rw-r--r--db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb15
-rw-r--r--db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb15
-rw-r--r--db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb13
-rw-r--r--db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb15
-rw-r--r--db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb10
-rw-r--r--db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb13
-rw-r--r--db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb13
-rw-r--r--db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb9
-rw-r--r--db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb11
-rw-r--r--db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb9
-rw-r--r--db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb15
-rw-r--r--db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb7
-rw-r--r--db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb7
-rw-r--r--db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb20
-rw-r--r--db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb11
-rw-r--r--db/migrate/20220120033115_create_alert_management_alert_metric_images.rb18
-rw-r--r--db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb19
-rw-r--r--db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb15
-rw-r--r--db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb17
-rw-r--r--db/migrate/20220124200927_add_index_to_issues.rb17
-rw-r--r--db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb13
-rw-r--r--db/migrate/20220125122228_add_topics_non_private_projects_count.rb11
-rw-r--r--db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb15
-rw-r--r--db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb15
-rw-r--r--db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb10
-rw-r--r--db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb14
-rw-r--r--db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb7
-rw-r--r--db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb9
-rw-r--r--db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb17
-rw-r--r--db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb16
-rw-r--r--db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb21
-rw-r--r--db/migrate/20220203074916_add_topics_lower_name_index.rb15
-rw-r--r--db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb28
-rw-r--r--db/migrate/20220203123333_add_batched_migration_max_batch.rb7
-rw-r--r--db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb9
-rw-r--r--db/migrate/20220203134942_add_hidden_to_projects.rb11
-rw-r--r--db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb43
-rw-r--r--db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb17
-rw-r--r--db/migrate/20220204193000_add_integrations_encrypted_properties.rb8
-rw-r--r--db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb15
-rw-r--r--db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb15
-rw-r--r--db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb24
-rw-r--r--db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb15
-rw-r--r--db/migrate/20220211125954_create_related_epic_links.rb18
-rw-r--r--db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb36
-rw-r--r--db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb20
-rw-r--r--db/migrate/20220216110023_create_saved_replies.rb20
-rw-r--r--db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb13
-rw-r--r--db/migrate/20220217113058_add_status_to_status_check_responses.rb7
-rw-r--r--db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb11
-rw-r--r--db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb11
-rw-r--r--db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb27
-rw-r--r--db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb14
-rw-r--r--db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb17
-rw-r--r--db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb24
-rw-r--r--db/migrate/20220302110724_add_group_features_table.rb19
-rw-r--r--db/migrate/20220303190555_add_comment_to_deployment_approvals.rb10
-rw-r--r--db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb13
-rw-r--r--db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb17
-rw-r--r--db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb15
-rw-r--r--db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb15
-rw-r--r--db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb11
-rw-r--r--db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb13
-rw-r--r--db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb7
-rw-r--r--db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb13
-rw-r--r--db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb15
-rw-r--r--db/migrate/20220310101118_update_holder_name_limit.rb28
-rw-r--r--db/migrate/20220314184009_create_protected_environment_approval_rules.rb30
-rw-r--r--db/migrate/20220314184109_add_user_fk_to_protected_environment_approval_rules.rb15
-rw-r--r--db/migrate/20220314184209_add_group_fk_to_protected_environment_approval_rules.rb15
-rw-r--r--db/migrate/20220314194009_add_approval_rule_id_to_deployment_approvals.rb7
-rw-r--r--db/migrate/20220314194149_add_project_ci_secure_files_to_plan_limits.rb7
-rw-r--r--db/migrate/20220314204009_add_approval_rule_fk_to_deployment_approvals.rb20
-rw-r--r--db/migrate/20220316095126_add_creator_id_to_deploy_tokens.rb7
-rw-r--r--db/migrate/20220316202200_add_migration_plan_to_container_repositories.rb10
-rw-r--r--db/migrate/20220316202402_add_text_limit_to_container_repositories_migration_plan.rb13
-rw-r--r--db/migrate/20220317170122_add_notification_level_to_namespace_root_storage_statistics.rb13
-rw-r--r--db/migrate/20220318120802_add_target_platforms_to_project_setting.rb7
-rw-r--r--db/migrate/20220318141037_add_pages_onboarding_state.rb11
-rw-r--r--db/migrate/20220321150028_add_started_at_to_batched_background_migrations_table.rb7
-rw-r--r--db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb30
-rw-r--r--db/migrate/20220322143441_add_dora_incidents_count.rb7
-rw-r--r--db/migrate/20220322205004_change_search_rate_limit_default_values.rb8
-rw-r--r--db/migrate/20220324171254_add_public_git_lab_runner_releases_url_to_application_settings.rb10
-rw-r--r--db/migrate/20220324173554_add_text_limit_to_public_git_lab_runner_releases_url_application_settings.rb13
-rw-r--r--db/migrate/20220324175325_add_key_data_to_secure_files.rb17
-rw-r--r--db/migrate/20220329061545_add_repository_size_to_plan_limits.rb11
-rw-r--r--db/migrate/20220329095632_add_theme_to_broadcast_message.rb7
-rw-r--r--db/migrate/20220329110630_add_ci_namespace_mirrors_unnest_index_on_traversal_ids.rb25
-rw-r--r--db/migrate/20220331174026_add_submit_field_to_dast_site_profiles.rb10
-rw-r--r--db/migrate/20220331174459_add_text_limit_to_submit_field_dast_site_profiles.rb13
-rw-r--r--db/migrate/20220401044858_add_user_id_and_state_index_to_merge_request_assignees.rb15
-rw-r--r--db/migrate/20220401045116_add_user_id_and_state_index_to_merge_request_reviewers.rb15
-rw-r--r--db/migrate/20220401110443_add_on_hold_until_column_for_batched_migration.rb8
-rw-r--r--db/migrate/20220401110511_add_runtime_data_columns_to_vsa_aggregations.rb23
-rw-r--r--db/migrate/20220401113123_add_check_constraint_to_vsa_aggregation_runtime_data_columns.rb23
-rw-r--r--db/migrate/20220404114106_add_container_registry_size_to_project_statistics.rb9
-rw-r--r--db/migrate/20220404170446_add_index_for_non_requested_non_invited_awaiting_members.rb18
-rw-r--r--db/migrate/20220405061122_add_license_scanning_action_to_onboarding_progresses.rb7
-rw-r--r--db/migrate/20220405125459_add_non_migrated_index_to_container_repositories.rb20
-rw-r--r--db/migrate/20220405181814_add_arkose_settings_to_application_settings.rb26
-rw-r--r--db/migrate/20220405203843_add_text_limit_to_arkose_verify_url_application_settings.rb13
-rw-r--r--db/migrate/20220406113217_add_inactive_project_deletion_to_application_settings.rb11
-rw-r--r--db/migrate/20220406121831_add_index_on_status_for_batched_background_migrations.rb13
-rw-r--r--db/migrate/20220407135820_add_epics_relative_position.rb18
-rw-r--r--db/migrate/20220408001450_add_work_item_type_name_unique_index_null_namespaces.rb19
-rw-r--r--db/migrate/20220408135815_update_index_on_greated_done_at_on_container_repositories.rb24
-rw-r--r--db/migrate/20220412171810_add_otp_secret_expires_at.rb11
-rw-r--r--db/migrate/20220413075921_update_index_on_packages_build_infos.rb22
-rw-r--r--db/migrate/20220507204024_add_separated_caches_option_to_project_ci_settings.rb9
-rw-r--r--db/migrate/20220520120637_add_installable_conan_packages_index_to_packages.rb25
-rw-r--r--db/migrate/20220525084153_add_sentry_project_id_to_project_error_tracking_settings.rb7
-rw-r--r--db/post_migrate/20211202145237_add_todos_project_and_id_index.rb32
-rw-r--r--db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb15
-rw-r--r--db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb15
-rw-r--r--db/post_migrate/20211206074547_remove_old_calendar_events_index.rb18
-rw-r--r--db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb28
-rw-r--r--db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb15
-rw-r--r--db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb22
-rw-r--r--db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb16
-rw-r--r--db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb28
-rw-r--r--db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb57
-rw-r--r--db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb71
-rw-r--r--db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb11
-rw-r--r--db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb11
-rw-r--r--db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb27
-rw-r--r--db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb15
-rw-r--r--db/post_migrate/20211209093828_track_users_deletes.rb15
-rw-r--r--db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb15
-rw-r--r--db/post_migrate/20211209094222_track_merge_requests_deletes.rb15
-rw-r--r--db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb41
-rw-r--r--db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb16
-rw-r--r--db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb25
-rw-r--r--db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb15
-rw-r--r--db/post_migrate/20211210140629_encrypt_static_object_token.rb22
-rw-r--r--db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb14
-rw-r--r--db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb18
-rw-r--r--db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb15
-rw-r--r--db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb9
-rw-r--r--db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb23
-rw-r--r--db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb41
-rw-r--r--db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb14
-rw-r--r--db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb20
-rw-r--r--db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb28
-rw-r--r--db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb15
-rw-r--r--db/post_migrate/20211220123956_update_invalid_member_states.rb21
-rw-r--r--db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb15
-rw-r--r--db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb17
-rw-r--r--db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb15
-rw-r--r--db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb17
-rw-r--r--db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb17
-rw-r--r--db/post_migrate/20220106185033_remove_finding_evidence_summary.rb15
-rw-r--r--db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb17
-rw-r--r--db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb17
-rw-r--r--db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb17
-rw-r--r--db/post_migrate/20220107064845_populate_vulnerability_reads.rb25
-rw-r--r--db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb17
-rw-r--r--db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb23
-rw-r--r--db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb15
-rw-r--r--db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb17
-rw-r--r--db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb17
-rw-r--r--db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb14
-rw-r--r--db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb15
-rw-r--r--db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb17
-rw-r--r--db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb23
-rw-r--r--db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb16
-rw-r--r--db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb15
-rw-r--r--db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb15
-rw-r--r--db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb20
-rw-r--r--db/post_migrate/20220114105525_add_index_on_projects_path.rb17
-rw-r--r--db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb16
-rw-r--r--db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb15
-rw-r--r--db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb29
-rw-r--r--db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb19
-rw-r--r--db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb17
-rw-r--r--db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb17
-rw-r--r--db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb17
-rw-r--r--db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb19
-rw-r--r--db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb17
-rw-r--r--db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb17
-rw-r--r--db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb17
-rw-r--r--db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb17
-rw-r--r--db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb17
-rw-r--r--db/post_migrate/20220120094340_drop_position_from_security_findings.rb9
-rw-r--r--db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb17
-rw-r--r--db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb27
-rw-r--r--db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb27
-rw-r--r--db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb20
-rw-r--r--db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124130028_dedup_runner_projects.rb71
-rw-r--r--db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb20
-rw-r--r--db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb20
-rw-r--r--db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb19
-rw-r--r--db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb19
-rw-r--r--db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb23
-rw-r--r--db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb20
-rw-r--r--db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb19
-rw-r--r--db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb15
-rw-r--r--db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb15
-rw-r--r--db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb11
-rw-r--r--db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb11
-rw-r--r--db/post_migrate/20220128155251_remove_dangling_running_builds.rb25
-rw-r--r--db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb23
-rw-r--r--db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb16
-rw-r--r--db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb55
-rw-r--r--db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb15
-rw-r--r--db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb15
-rw-r--r--db/post_migrate/20220201173212_add_user_details_provisioning_index.rb18
-rw-r--r--db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb20
-rw-r--r--db/post_migrate/20220202105733_delete_service_template_records.rb16
-rw-r--r--db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb15
-rw-r--r--db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb25
-rw-r--r--db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb33
-rw-r--r--db/post_migrate/20220204194347_encrypt_integration_properties.rb22
-rw-r--r--db/post_migrate/20220207080758_update_api_indexes_for_projects.rb48
-rw-r--r--db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb25
-rw-r--r--db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb24
-rw-r--r--db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb16
-rw-r--r--db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb20
-rw-r--r--db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb60
-rw-r--r--db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb27
-rw-r--r--db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb18
-rw-r--r--db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb13
-rw-r--r--db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb13
-rw-r--r--db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb11
-rw-r--r--db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb13
-rw-r--r--db/post_migrate/20220222192525_remove_null_releases.rb24
-rw-r--r--db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb27
-rw-r--r--db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb23
-rw-r--r--db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb14
-rw-r--r--db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb31
-rw-r--r--db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb15
-rw-r--r--db/post_migrate/20220301093434_backfill_all_project_namespaces.rb29
-rw-r--r--db/post_migrate/20220302114046_backfill_group_features.rb27
-rw-r--r--db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb28
-rw-r--r--db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb19
-rw-r--r--db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb15
-rw-r--r--db/post_migrate/20220305223212_add_security_training_providers.rb40
-rw-r--r--db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb17
-rw-r--r--db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb26
-rw-r--r--db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb17
-rw-r--r--db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb23
-rw-r--r--db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb15
-rw-r--r--db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb26
-rw-r--r--db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb27
-rw-r--r--db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb27
-rw-r--r--db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb15
-rw-r--r--db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb30
-rw-r--r--db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb15
-rw-r--r--db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb16
-rw-r--r--db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb16
-rw-r--r--db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb13
-rw-r--r--db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb15
-rw-r--r--db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb15
-rw-r--r--db/post_migrate/20220315171027_add_tmp_index_to_support_leaky_regex_cleanup.rb19
-rw-r--r--db/post_migrate/20220315171129_cleanup_draft_data_from_faulty_regex.rb42
-rw-r--r--db/post_migrate/20220315181125_remove_issues_work_item_type_id_index.rb15
-rw-r--r--db/post_migrate/20220315181130_add_temporary_issue_type_index_for_work_item_types.rb15
-rw-r--r--db/post_migrate/20220315181136_backfill_work_item_type_id_on_issues.rb13
-rw-r--r--db/post_migrate/20220315211043_add_index_to_vulnerability_reads.rb23
-rw-r--r--db/post_migrate/20220316102900_add_index_to_deploy_tokens_on_creator_id.rb15
-rw-r--r--db/post_migrate/20220316102902_add_user_foreign_key_to_deploy_tokens.rb15
-rw-r--r--db/post_migrate/20220316112118_update_organizations_name_index_add_id.rb20
-rw-r--r--db/post_migrate/20220316112206_add_contacts_index_on_group_email_and_id.rb15
-rw-r--r--db/post_migrate/20220316165539_add_index_to_vulnerabilities.rb22
-rw-r--r--db/post_migrate/20220316202640_populate_container_repositories_migration_plan.rb23
-rw-r--r--db/post_migrate/20220317161914_remove_ci_runners_ci_builds_runner_id_fk.rb19
-rw-r--r--db/post_migrate/20220318111040_add_indexes_for_primary_email_second_cleanup_migration.rb28
-rw-r--r--db/post_migrate/20220318111729_cleanup_after_fixing_issue_when_admin_changed_primary_email.rb55
-rw-r--r--db/post_migrate/20220318111949_drop_temporary_indexes_for_primary_email_migration_second_cleanup.rb28
-rw-r--r--db/post_migrate/20220321025720_alter_constraint_remote_import_url.rb14
-rw-r--r--db/post_migrate/20220321201912_remove_user_email_lookup_limit.rb13
-rw-r--r--db/post_migrate/20220322023800_add_tmp_index_routes_id_for_project_namespaces.rb17
-rw-r--r--db/post_migrate/20220322035654_add_migration_plan_index_to_container_repositories.rb17
-rw-r--r--db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb23
-rw-r--r--db/post_migrate/20220322094410_remove_wiki_notes.rb20
-rw-r--r--db/post_migrate/20220322132242_update_pages_onboarding_state.rb32
-rw-r--r--db/post_migrate/20220322205008_change_search_rate_limit_values.rb18
-rw-r--r--db/post_migrate/20220323023800_backfill_namespace_id_for_project_routes.rb27
-rw-r--r--db/post_migrate/20220323130000_add_temp_index_on_null_project_namespace_ids.rb15
-rw-r--r--db/post_migrate/20220323152202_add_index_on_visible_deployments.rb19
-rw-r--r--db/post_migrate/20220324032250_migrate_shimo_confluence_service_category.rb21
-rw-r--r--db/post_migrate/20220324081709_fix_and_backfill_project_namespaces_for_projects_with_duplicate_name.rb27
-rw-r--r--db/post_migrate/20220324110247_untrack_deletions_on_ci_job_artifacts.rb15
-rw-r--r--db/post_migrate/20220324180717_remove_project_pages_metadata_artifacts_archive_id_column.rb21
-rw-r--r--db/post_migrate/20220325000000_prepare_index_for_ci_job_artifacts_unlocked_with_expire_at.rb15
-rw-r--r--db/post_migrate/20220325000001_finalize_index_for_ci_job_artifacts_unlocked_with_expire_at.rb17
-rw-r--r--db/post_migrate/20220325050642_drop_integrations_template_column.rb9
-rw-r--r--db/post_migrate/20220325155953_steal_background_job_for_fixing_conflicting_project_names_and_paths.rb11
-rw-r--r--db/post_migrate/20220325160153_create_unique_index_on_projects_name_and_namespace_id.rb15
-rw-r--r--db/post_migrate/20220326161803_add_cascade_delete_fk_on_project_namespace_id.rb41
-rw-r--r--db/post_migrate/20220326163653_add_not_null_contraint_to_project_namespace_id.rb13
-rw-r--r--db/post_migrate/20220329175119_remove_leftover_ci_job_artifact_deletions.rb30
-rw-r--r--db/post_migrate/20220331074722_add_notes_null_discussion_id_temp_index_async.rb14
-rw-r--r--db/post_migrate/20220401045621_remove_state_index_on_merge_request_assignees.rb15
-rw-r--r--db/post_migrate/20220401045642_remove_state_index_on_merge_request_reviewers.rb15
-rw-r--r--db/post_migrate/20220404183350_add_forbidden_state_index_to_users.rb17
-rw-r--r--db/post_migrate/20220404184814_drop_broader_expired_artifact_index.rb16
-rw-r--r--db/post_migrate/20220404194649_replace_work_item_type_backfill_next_batch_strategy.rb13
-rw-r--r--db/post_migrate/20220409160628_add_async_index_for_events_followed_users.rb13
-rw-r--r--db/post_migrate/20220412044906_finalize_traversal_ids_background_migrations.rb14
-rw-r--r--db/post_migrate/20220412143551_add_partial_index_on_unencrypted_integrations.rb18
-rw-r--r--db/post_migrate/20220412143552_consume_remaining_encrypt_integration_property_jobs.rb23
-rw-r--r--db/post_migrate/20220413011328_remove_partial_index_on_unencrypted_integrations.rb19
-rw-r--r--db/schema_migrations/202112020949441
-rw-r--r--db/schema_migrations/202112021355081
-rw-r--r--db/schema_migrations/202112021452371
-rw-r--r--db/schema_migrations/202112030916421
-rw-r--r--db/schema_migrations/202112031609521
-rw-r--r--db/schema_migrations/202112031611491
-rw-r--r--db/schema_migrations/202112031618401
-rw-r--r--db/schema_migrations/202112031619421
-rw-r--r--db/schema_migrations/202112040108261
-rw-r--r--db/schema_migrations/202112060738511
-rw-r--r--db/schema_migrations/202112060745471
-rw-r--r--db/schema_migrations/202112061612711
-rw-r--r--db/schema_migrations/202112070817081
-rw-r--r--db/schema_migrations/202112070905031
-rw-r--r--db/schema_migrations/202112071253311
-rw-r--r--db/schema_migrations/202112071353311
-rw-r--r--db/schema_migrations/202112071544131
-rw-r--r--db/schema_migrations/202112071544141
-rw-r--r--db/schema_migrations/202112071655081
-rw-r--r--db/schema_migrations/202112071735101
-rw-r--r--db/schema_migrations/202112071735111
-rw-r--r--db/schema_migrations/202112081114251
-rw-r--r--db/schema_migrations/202112081222001
-rw-r--r--db/schema_migrations/202112081222011
-rw-r--r--db/schema_migrations/202112081714021
-rw-r--r--db/schema_migrations/202112090936361
-rw-r--r--db/schema_migrations/202112090938281
-rw-r--r--db/schema_migrations/202112090939231
-rw-r--r--db/schema_migrations/202112090942221
-rw-r--r--db/schema_migrations/202112091030481
-rw-r--r--db/schema_migrations/202112092038201
-rw-r--r--db/schema_migrations/202112092038211
-rw-r--r--db/schema_migrations/202112092300421
-rw-r--r--db/schema_migrations/202112100257541
-rw-r--r--db/schema_migrations/202112100317211
-rw-r--r--db/schema_migrations/202112101400001
-rw-r--r--db/schema_migrations/202112101406291
-rw-r--r--db/schema_migrations/202112101731371
-rw-r--r--db/schema_migrations/202112130648211
-rw-r--r--db/schema_migrations/202112131021111
-rw-r--r--db/schema_migrations/202112131303241
-rw-r--r--db/schema_migrations/202112131423441
-rw-r--r--db/schema_migrations/202112131542591
-rw-r--r--db/schema_migrations/202112131547041
-rw-r--r--db/schema_migrations/202112140125071
-rw-r--r--db/schema_migrations/202112141103071
-rw-r--r--db/schema_migrations/202112150906201
-rw-r--r--db/schema_migrations/202112151820061
-rw-r--r--db/schema_migrations/202112161331071
-rw-r--r--db/schema_migrations/202112161341341
-rw-r--r--db/schema_migrations/202112161356511
-rw-r--r--db/schema_migrations/202112162209391
-rw-r--r--db/schema_migrations/202112170507531
-rw-r--r--db/schema_migrations/202112171200001
-rw-r--r--db/schema_migrations/202112171459231
-rw-r--r--db/schema_migrations/202112171743311
-rw-r--r--db/schema_migrations/202112200647571
-rw-r--r--db/schema_migrations/202112201204021
-rw-r--r--db/schema_migrations/202112201239561
-rw-r--r--db/schema_migrations/202112201745041
-rw-r--r--db/schema_migrations/202112231259211
-rw-r--r--db/schema_migrations/202112241129371
-rw-r--r--db/schema_migrations/202112241145391
-rw-r--r--db/schema_migrations/202112290236541
-rw-r--r--db/schema_migrations/202112301125171
-rw-r--r--db/schema_migrations/202112301130311
-rw-r--r--db/schema_migrations/202201040600491
-rw-r--r--db/schema_migrations/202201041744451
-rw-r--r--db/schema_migrations/202201050205141
-rw-r--r--db/schema_migrations/202201050822171
-rw-r--r--db/schema_migrations/202201051213251
-rw-r--r--db/schema_migrations/202201051525471
-rw-r--r--db/schema_migrations/202201051531491
-rw-r--r--db/schema_migrations/202201061119581
-rw-r--r--db/schema_migrations/202201061120431
-rw-r--r--db/schema_migrations/202201061120851
-rw-r--r--db/schema_migrations/202201061417561
-rw-r--r--db/schema_migrations/202201061633261
-rw-r--r--db/schema_migrations/202201061850331
-rw-r--r--db/schema_migrations/202201062306291
-rw-r--r--db/schema_migrations/202201062307121
-rw-r--r--db/schema_migrations/202201062315181
-rw-r--r--db/schema_migrations/202201062334591
-rw-r--r--db/schema_migrations/202201062356261
-rw-r--r--db/schema_migrations/202201070648451
-rw-r--r--db/schema_migrations/202201070916291
-rw-r--r--db/schema_migrations/202201071650361
-rw-r--r--db/schema_migrations/202201091330061
-rw-r--r--db/schema_migrations/202201091344551
-rw-r--r--db/schema_migrations/202201101709531
-rw-r--r--db/schema_migrations/202201101710491
-rw-r--r--db/schema_migrations/202201102249131
-rw-r--r--db/schema_migrations/202201102314201
-rw-r--r--db/schema_migrations/202201102331551
-rw-r--r--db/schema_migrations/202201110027561
-rw-r--r--db/schema_migrations/202201110238521
-rw-r--r--db/schema_migrations/202201110935341
-rw-r--r--db/schema_migrations/202201110950061
-rw-r--r--db/schema_migrations/202201110950071
-rw-r--r--db/schema_migrations/202201111014211
-rw-r--r--db/schema_migrations/202201111023141
-rw-r--r--db/schema_migrations/202201111549501
-rw-r--r--db/schema_migrations/202201111549511
-rw-r--r--db/schema_migrations/202201112002541
-rw-r--r--db/schema_migrations/202201112215161
-rw-r--r--db/schema_migrations/202201120159401
-rw-r--r--db/schema_migrations/202201120905561
-rw-r--r--db/schema_migrations/202201121154131
-rw-r--r--db/schema_migrations/202201122051111
-rw-r--r--db/schema_migrations/202201122306421
-rw-r--r--db/schema_migrations/202201122320371
-rw-r--r--db/schema_migrations/202201122326051
-rw-r--r--db/schema_migrations/202201122327231
-rw-r--r--db/schema_migrations/202201130133191
-rw-r--r--db/schema_migrations/202201130144381
-rw-r--r--db/schema_migrations/202201130158301
-rw-r--r--db/schema_migrations/202201130355191
-rw-r--r--db/schema_migrations/202201130404471
-rw-r--r--db/schema_migrations/202201131114401
-rw-r--r--db/schema_migrations/202201131254011
-rw-r--r--db/schema_migrations/202201131354491
-rw-r--r--db/schema_migrations/202201131359241
-rw-r--r--db/schema_migrations/202201131648011
-rw-r--r--db/schema_migrations/202201131649011
-rw-r--r--db/schema_migrations/202201141055251
-rw-r--r--db/schema_migrations/202201141319501
-rw-r--r--db/schema_migrations/202201161758511
-rw-r--r--db/schema_migrations/202201170340561
-rw-r--r--db/schema_migrations/202201170826111
-rw-r--r--db/schema_migrations/202201172259361
-rw-r--r--db/schema_migrations/202201180156331
-rw-r--r--db/schema_migrations/202201180200261
-rw-r--r--db/schema_migrations/202201181419501
-rw-r--r--db/schema_migrations/202201181558461
-rw-r--r--db/schema_migrations/202201181558471
-rw-r--r--db/schema_migrations/202201181558481
-rw-r--r--db/schema_migrations/202201182040391
-rw-r--r--db/schema_migrations/202201190940231
-rw-r--r--db/schema_migrations/202201190945031
-rw-r--r--db/schema_migrations/202201191414071
-rw-r--r--db/schema_migrations/202201191417361
-rw-r--r--db/schema_migrations/202201191431301
-rw-r--r--db/schema_migrations/202201191442531
-rw-r--r--db/schema_migrations/202201191444581
-rw-r--r--db/schema_migrations/202201191512211
-rw-r--r--db/schema_migrations/202201191537061
-rw-r--r--db/schema_migrations/202201191544421
-rw-r--r--db/schema_migrations/202201191704261
-rw-r--r--db/schema_migrations/202201191931301
-rw-r--r--db/schema_migrations/202201192013401
-rw-r--r--db/schema_migrations/202201192031191
-rw-r--r--db/schema_migrations/202201192206201
-rw-r--r--db/schema_migrations/202201200331151
-rw-r--r--db/schema_migrations/202201200856551
-rw-r--r--db/schema_migrations/202201200943401
-rw-r--r--db/schema_migrations/202201201237001
-rw-r--r--db/schema_migrations/202201201238001
-rw-r--r--db/schema_migrations/202201201606251
-rw-r--r--db/schema_migrations/202201202118311
-rw-r--r--db/schema_migrations/202201202118321
-rw-r--r--db/schema_migrations/202201212147521
-rw-r--r--db/schema_migrations/202201212147531
-rw-r--r--db/schema_migrations/202201212216511
-rw-r--r--db/schema_migrations/202201241300281
-rw-r--r--db/schema_migrations/202201241450191
-rw-r--r--db/schema_migrations/202201241514561
-rw-r--r--db/schema_migrations/202201241519491
-rw-r--r--db/schema_migrations/202201241528241
-rw-r--r--db/schema_migrations/202201241532331
-rw-r--r--db/schema_migrations/202201241532341
-rw-r--r--db/schema_migrations/202201241807041
-rw-r--r--db/schema_migrations/202201241807051
-rw-r--r--db/schema_migrations/202201241843381
-rw-r--r--db/schema_migrations/202201242009271
-rw-r--r--db/schema_migrations/202201242040461
-rw-r--r--db/schema_migrations/202201242141311
-rw-r--r--db/schema_migrations/202201242158571
-rw-r--r--db/schema_migrations/202201242215211
-rw-r--r--db/schema_migrations/202201250835201
-rw-r--r--db/schema_migrations/202201250841271
-rw-r--r--db/schema_migrations/202201250843481
-rw-r--r--db/schema_migrations/202201251222281
-rw-r--r--db/schema_migrations/202201251226401
-rw-r--r--db/schema_migrations/202201251227251
-rw-r--r--db/schema_migrations/202201252305381
-rw-r--r--db/schema_migrations/202201262017521
-rw-r--r--db/schema_migrations/202201262026541
-rw-r--r--db/schema_migrations/202201262034211
-rw-r--r--db/schema_migrations/202201262100211
-rw-r--r--db/schema_migrations/202201262100221
-rw-r--r--db/schema_migrations/202201262106571
-rw-r--r--db/schema_migrations/202201271122431
-rw-r--r--db/schema_migrations/202201271124121
-rw-r--r--db/schema_migrations/202201271322001
-rw-r--r--db/schema_migrations/202201271322011
-rw-r--r--db/schema_migrations/202201280937561
-rw-r--r--db/schema_migrations/202201281552511
-rw-r--r--db/schema_migrations/202201281558141
-rw-r--r--db/schema_migrations/202201281947221
-rw-r--r--db/schema_migrations/202201310000001
-rw-r--r--db/schema_migrations/202201310000011
-rw-r--r--db/schema_migrations/202201311357251
-rw-r--r--db/schema_migrations/202201311926431
-rw-r--r--db/schema_migrations/202202010347311
-rw-r--r--db/schema_migrations/202202011417051
-rw-r--r--db/schema_migrations/202202011732121
-rw-r--r--db/schema_migrations/202202011930331
-rw-r--r--db/schema_migrations/202202012053001
-rw-r--r--db/schema_migrations/202202020344091
-rw-r--r--db/schema_migrations/202202021057331
-rw-r--r--db/schema_migrations/202202021153501
-rw-r--r--db/schema_migrations/202202030749161
-rw-r--r--db/schema_migrations/202202030913041
-rw-r--r--db/schema_migrations/202202031233331
-rw-r--r--db/schema_migrations/202202031336521
-rw-r--r--db/schema_migrations/202202031349421
-rw-r--r--db/schema_migrations/202202040536551
-rw-r--r--db/schema_migrations/202202040931201
-rw-r--r--db/schema_migrations/202202040951211
-rw-r--r--db/schema_migrations/202202041107251
-rw-r--r--db/schema_migrations/202202041542201
-rw-r--r--db/schema_migrations/202202041930001
-rw-r--r--db/schema_migrations/202202041943471
-rw-r--r--db/schema_migrations/202202070807581
-rw-r--r--db/schema_migrations/202202070831291
-rw-r--r--db/schema_migrations/202202080809211
-rw-r--r--db/schema_migrations/202202081154391
-rw-r--r--db/schema_migrations/202202081704451
-rw-r--r--db/schema_migrations/202202081718261
-rw-r--r--db/schema_migrations/202202091110071
-rw-r--r--db/schema_migrations/202202110909201
-rw-r--r--db/schema_migrations/202202111259541
-rw-r--r--db/schema_migrations/202202112146051
-rw-r--r--db/schema_migrations/202202121207351
-rw-r--r--db/schema_migrations/202202131045311
-rw-r--r--db/schema_migrations/202202151647091
-rw-r--r--db/schema_migrations/202202151900201
-rw-r--r--db/schema_migrations/202202161100231
-rw-r--r--db/schema_migrations/202202162019491
-rw-r--r--db/schema_migrations/202202171000081
-rw-r--r--db/schema_migrations/202202171130581
-rw-r--r--db/schema_migrations/202202171352291
-rw-r--r--db/schema_migrations/202202212149281
-rw-r--r--db/schema_migrations/202202220725361
-rw-r--r--db/schema_migrations/202202221918451
-rw-r--r--db/schema_migrations/202202221925241
-rw-r--r--db/schema_migrations/202202221925251
-rw-r--r--db/schema_migrations/202202231123041
-rw-r--r--db/schema_migrations/202202231244281
-rw-r--r--db/schema_migrations/202202240000001
-rw-r--r--db/schema_migrations/202202242044151
-rw-r--r--db/schema_migrations/202202251337051
-rw-r--r--db/schema_migrations/202203010021011
-rw-r--r--db/schema_migrations/202203010035021
-rw-r--r--db/schema_migrations/202203010915031
-rw-r--r--db/schema_migrations/202203010934341
-rw-r--r--db/schema_migrations/202203011751041
-rw-r--r--db/schema_migrations/202203011754261
-rw-r--r--db/schema_migrations/202203021107241
-rw-r--r--db/schema_migrations/202203021140461
-rw-r--r--db/schema_migrations/202203022034101
-rw-r--r--db/schema_migrations/202203031905551
-rw-r--r--db/schema_migrations/202203031910471
-rw-r--r--db/schema_migrations/202203040523351
-rw-r--r--db/schema_migrations/202203040616311
-rw-r--r--db/schema_migrations/202203040621071
-rw-r--r--db/schema_migrations/202203041527291
-rw-r--r--db/schema_migrations/202203041651071
-rw-r--r--db/schema_migrations/202203042018471
-rw-r--r--db/schema_migrations/202203052232121
-rw-r--r--db/schema_migrations/202203071925341
-rw-r--r--db/schema_migrations/202203071926101
-rw-r--r--db/schema_migrations/202203071926451
-rw-r--r--db/schema_migrations/202203071927251
-rw-r--r--db/schema_migrations/202203072034581
-rw-r--r--db/schema_migrations/202203072034591
-rw-r--r--db/schema_migrations/202203080002051
-rw-r--r--db/schema_migrations/202203081152191
-rw-r--r--db/schema_migrations/202203081155021
-rw-r--r--db/schema_migrations/202203090848381
-rw-r--r--db/schema_migrations/202203090849541
-rw-r--r--db/schema_migrations/202203091006481
-rw-r--r--db/schema_migrations/202203091548551
-rw-r--r--db/schema_migrations/202203100115301
-rw-r--r--db/schema_migrations/202203100116131
-rw-r--r--db/schema_migrations/202203100953411
-rw-r--r--db/schema_migrations/202203101011181
-rw-r--r--db/schema_migrations/202203101342071
-rw-r--r--db/schema_migrations/202203101413491
-rw-r--r--db/schema_migrations/202203110103521
-rw-r--r--db/schema_migrations/202203141623421
-rw-r--r--db/schema_migrations/202203141840091
-rw-r--r--db/schema_migrations/202203141841091
-rw-r--r--db/schema_migrations/202203141842091
-rw-r--r--db/schema_migrations/202203141940091
-rw-r--r--db/schema_migrations/202203141941491
-rw-r--r--db/schema_migrations/202203142040091
-rw-r--r--db/schema_migrations/202203151710271
-rw-r--r--db/schema_migrations/202203151711291
-rw-r--r--db/schema_migrations/202203151811251
-rw-r--r--db/schema_migrations/202203151811301
-rw-r--r--db/schema_migrations/202203151811361
-rw-r--r--db/schema_migrations/202203152110431
-rw-r--r--db/schema_migrations/202203160951261
-rw-r--r--db/schema_migrations/202203161029001
-rw-r--r--db/schema_migrations/202203161029021
-rw-r--r--db/schema_migrations/202203161121181
-rw-r--r--db/schema_migrations/202203161122061
-rw-r--r--db/schema_migrations/202203161655391
-rw-r--r--db/schema_migrations/202203162022001
-rw-r--r--db/schema_migrations/202203162024021
-rw-r--r--db/schema_migrations/202203162026401
-rw-r--r--db/schema_migrations/202203171619141
-rw-r--r--db/schema_migrations/202203171701221
-rw-r--r--db/schema_migrations/202203181110401
-rw-r--r--db/schema_migrations/202203181117291
-rw-r--r--db/schema_migrations/202203181119491
-rw-r--r--db/schema_migrations/202203181208021
-rw-r--r--db/schema_migrations/202203181410371
-rw-r--r--db/schema_migrations/202203210257201
-rw-r--r--db/schema_migrations/202203211500281
-rw-r--r--db/schema_migrations/202203212019121
-rw-r--r--db/schema_migrations/202203212343171
-rw-r--r--db/schema_migrations/202203220238001
-rw-r--r--db/schema_migrations/202203220356541
-rw-r--r--db/schema_migrations/202203220711271
-rw-r--r--db/schema_migrations/202203220944101
-rw-r--r--db/schema_migrations/202203221322421
-rw-r--r--db/schema_migrations/202203221434411
-rw-r--r--db/schema_migrations/202203222050041
-rw-r--r--db/schema_migrations/202203222050081
-rw-r--r--db/schema_migrations/202203230238001
-rw-r--r--db/schema_migrations/202203231300001
-rw-r--r--db/schema_migrations/202203231522021
-rw-r--r--db/schema_migrations/202203240322501
-rw-r--r--db/schema_migrations/202203240817091
-rw-r--r--db/schema_migrations/202203241102471
-rw-r--r--db/schema_migrations/202203241712541
-rw-r--r--db/schema_migrations/202203241735541
-rw-r--r--db/schema_migrations/202203241753251
-rw-r--r--db/schema_migrations/202203241807171
-rw-r--r--db/schema_migrations/202203250000001
-rw-r--r--db/schema_migrations/202203250000011
-rw-r--r--db/schema_migrations/202203250506421
-rw-r--r--db/schema_migrations/202203251559531
-rw-r--r--db/schema_migrations/202203251601531
-rw-r--r--db/schema_migrations/202203261618031
-rw-r--r--db/schema_migrations/202203261636531
-rw-r--r--db/schema_migrations/202203290615451
-rw-r--r--db/schema_migrations/202203290956321
-rw-r--r--db/schema_migrations/202203291106301
-rw-r--r--db/schema_migrations/202203291751191
-rw-r--r--db/schema_migrations/202203310747221
-rw-r--r--db/schema_migrations/202203311740261
-rw-r--r--db/schema_migrations/202203311744591
-rw-r--r--db/schema_migrations/202204010448581
-rw-r--r--db/schema_migrations/202204010451161
-rw-r--r--db/schema_migrations/202204010456211
-rw-r--r--db/schema_migrations/202204010456421
-rw-r--r--db/schema_migrations/202204011104431
-rw-r--r--db/schema_migrations/202204011105111
-rw-r--r--db/schema_migrations/202204011131231
-rw-r--r--db/schema_migrations/202204041141061
-rw-r--r--db/schema_migrations/202204041704461
-rw-r--r--db/schema_migrations/202204041833501
-rw-r--r--db/schema_migrations/202204041848141
-rw-r--r--db/schema_migrations/202204041946491
-rw-r--r--db/schema_migrations/202204050611221
-rw-r--r--db/schema_migrations/202204051254591
-rw-r--r--db/schema_migrations/202204051818141
-rw-r--r--db/schema_migrations/202204052038431
-rw-r--r--db/schema_migrations/202204061132171
-rw-r--r--db/schema_migrations/202204061218311
-rw-r--r--db/schema_migrations/202204071358201
-rw-r--r--db/schema_migrations/202204080014501
-rw-r--r--db/schema_migrations/202204081358151
-rw-r--r--db/schema_migrations/202204091606281
-rw-r--r--db/schema_migrations/202204120449061
-rw-r--r--db/schema_migrations/202204121435511
-rw-r--r--db/schema_migrations/202204121435521
-rw-r--r--db/schema_migrations/202204121718101
-rw-r--r--db/schema_migrations/202204130113281
-rw-r--r--db/schema_migrations/202204130759211
-rw-r--r--db/schema_migrations/202205072040241
-rw-r--r--db/schema_migrations/202205201206371
-rw-r--r--db/schema_migrations/202205250841531
-rw-r--r--doc/administration/server_hooks.md1
-rw-r--r--doc/development/api_styleguide.md2
-rw-r--r--doc/development/contributing/index.md2
-rw-r--r--doc/development/documentation/styleguide/word_list.md6
-rw-r--r--doc/development/documentation/topic_types/task.md6
-rw-r--r--doc/development/ee_features.md7
-rw-r--r--doc/development/integrations/jenkins.md3
-rw-r--r--doc/development/service_ping/troubleshooting.md10
-rw-r--r--doc/development/snowplow/implementation.md4
-rw-r--r--doc/development/snowplow/index.md9
-rw-r--r--doc/development/value_stream_analytics.md2
-rw-r--r--doc/operations/error_tracking.md4
-rw-r--r--doc/operations/feature_flags.md32
-rw-r--r--doc/operations/incident_management/alerts.md8
-rw-r--r--doc/operations/incident_management/escalation_policies.md12
-rw-r--r--doc/operations/incident_management/incident_timeline_events.md16
-rw-r--r--doc/operations/incident_management/incidents.md4
-rw-r--r--doc/operations/incident_management/integrations.md4
-rw-r--r--doc/operations/incident_management/linked_resources.md12
-rw-r--r--doc/operations/incident_management/manage_incidents.md24
-rw-r--r--doc/operations/incident_management/oncall_schedules.md24
-rw-r--r--doc/operations/incident_management/paging.md4
-rw-r--r--doc/operations/incident_management/status_page.md10
-rw-r--r--doc/user/discussions/index.md24
-rw-r--r--doc/user/markdown.md2
-rw-r--r--lib/api/validations/validators/absence.rb2
-rw-r--r--lib/api/validations/validators/array_none_any.rb2
-rw-r--r--lib/api/validations/validators/bulk_imports.rb6
-rw-r--r--lib/api/validations/validators/check_assignees_count.rb2
-rw-r--r--lib/api/validations/validators/email_or_email_list.rb2
-rw-r--r--lib/api/validations/validators/file_path.rb2
-rw-r--r--lib/api/validations/validators/git_ref.rb2
-rw-r--r--lib/api/validations/validators/git_sha.rb2
-rw-r--r--lib/api/validations/validators/integer_or_custom_value.rb2
-rw-r--r--lib/api/validations/validators/limit.rb2
-rw-r--r--lib/api/validations/validators/project_portable.rb2
-rw-r--r--lib/api/validations/validators/untrusted_regexp.rb2
-rw-r--r--lib/banzai/filter/references/user_reference_filter.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_ci_queuing_tables.rb153
-rw-r--r--lib/gitlab/background_migration/backfill_group_features.rb35
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route.rb38
-rw-r--r--lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex.rb48
-rw-r--r--lib/gitlab/background_migration/encrypt_integration_properties.rb84
-rw-r--r--lib/gitlab/background_migration/encrypt_static_object_token.rb70
-rw-r--r--lib/gitlab/background_migration/fix_duplicate_project_name_and_path.rb82
-rw-r--r--lib/gitlab/background_migration/fix_incorrect_max_seats_used.rb13
-rw-r--r--lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb124
-rw-r--r--lib/gitlab/background_migration/merge_topics_with_same_name.rb76
-rw-r--r--lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner.rb45
-rw-r--r--lib/gitlab/background_migration/migrate_shimo_confluence_integration_category.rb27
-rw-r--r--lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds.rb44
-rw-r--r--lib/gitlab/background_migration/populate_container_repository_migration_plan.rb51
-rw-r--r--lib/gitlab/background_migration/populate_namespace_statistics.rb47
-rw-r--r--lib/gitlab/background_migration/populate_test_reports_issue_id.rb14
-rw-r--r--lib/gitlab/background_migration/populate_topics_non_private_projects_count.rb36
-rw-r--r--lib/gitlab/background_migration/populate_vulnerability_reads.rb84
-rw-r--r--lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid.rb218
-rw-r--r--lib/gitlab/background_migration/recalculate_vulnerability_finding_signatures_for_findings.rb13
-rw-r--r--lib/gitlab/background_migration/remove_all_trace_expiration_dates.rb53
-rw-r--r--lib/gitlab/background_migration/remove_vulnerability_finding_links.rb19
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb40
-rw-r--r--lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects.rb40
-rw-r--r--lib/gitlab/background_migration/update_timelogs_null_spent_at.rb39
-rw-r--r--spec/features/markdown/markdown_spec.rb37
-rw-r--r--spec/fixtures/markdown.md.erb2
-rw-r--r--spec/frontend/fixtures/merge_requests.rb4
-rw-r--r--spec/frontend/user_popovers_spec.js2
-rw-r--r--spec/lib/banzai/filter/references/user_reference_filter_spec.rb23
-rw-r--r--spec/lib/gitlab/background_migration/backfill_ci_queuing_tables_spec.rb245
-rw-r--r--spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_spec.rb68
-rw-r--r--spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex_spec.rb75
-rw-r--r--spec/lib/gitlab/background_migration/backfill_group_features_spec.rb39
-rw-r--r--spec/lib/gitlab/background_migration/backfill_integrations_type_new_spec.rb67
-rw-r--r--spec/lib/gitlab/background_migration/backfill_issue_search_data_spec.rb57
-rw-r--r--spec/lib/gitlab/background_migration/backfill_member_namespace_for_group_members_spec.rb50
-rw-r--r--spec/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route_spec.rb61
-rw-r--r--spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb41
-rw-r--r--spec/lib/gitlab/background_migration/batching_strategies/backfill_project_namespace_per_group_batching_strategy_spec.rb53
-rw-r--r--spec/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex_spec.rb54
-rw-r--r--spec/lib/gitlab/background_migration/encrypt_integration_properties_spec.rb63
-rw-r--r--spec/lib/gitlab/background_migration/encrypt_static_object_token_spec.rb64
-rw-r--r--spec/lib/gitlab/background_migration/fix_duplicate_project_name_and_path_spec.rb65
-rw-r--r--spec/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata_spec.rb232
-rw-r--r--spec/lib/gitlab/background_migration/merge_topics_with_same_name_spec.rb148
-rw-r--r--spec/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner_spec.rb82
-rw-r--r--spec/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category_spec.rb28
-rw-r--r--spec/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds_spec.rb52
-rw-r--r--spec/lib/gitlab/background_migration/populate_container_repository_migration_plan_spec.rb44
-rw-r--r--spec/lib/gitlab/background_migration/populate_namespace_statistics_spec.rb71
-rw-r--r--spec/lib/gitlab/background_migration/populate_topics_non_private_projects_count_spec.rb50
-rw-r--r--spec/lib/gitlab/background_migration/populate_vulnerability_reads_spec.rb93
-rw-r--r--spec/lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces_spec.rb266
-rw-r--r--spec/lib/gitlab/background_migration/remove_all_trace_expiration_dates_spec.rb54
-rw-r--r--spec/lib/gitlab/background_migration/remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb174
-rw-r--r--spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb66
-rw-r--r--spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects_spec.rb52
-rw-r--r--spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects_spec.rb52
-rw-r--r--spec/lib/gitlab/background_migration/update_timelogs_null_spent_at_spec.rb40
-rw-r--r--spec/mailers/emails/service_desk_spec.rb21
-rw-r--r--spec/models/concerns/mentionable_spec.rb14
-rw-r--r--spec/requests/api/ci/runner/jobs_artifacts_spec.rb12
-rw-r--r--spec/serializers/merge_request_widget_entity_spec.rb2
-rw-r--r--spec/services/ci/job_artifacts/create_service_spec.rb8
-rw-r--r--spec/services/notification_service_spec.rb134
-rw-r--r--spec/support/matchers/markdown_matchers.rb12
-rw-r--r--spec/support/shared_examples/models/mentionable_shared_examples.rb195
-rw-r--r--spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb15
-rw-r--r--workhorse/.tool-versions2
-rw-r--r--workhorse/go.mod4
-rw-r--r--workhorse/go.sum8
-rw-r--r--workhorse/internal/httprs/httprs_test.go8
-rw-r--r--workhorse/internal/upload/destination/objectstore/s3_session.go3
-rw-r--r--workhorse/internal/upload/destination/objectstore/s3_session_test.go9
900 files changed, 1716 insertions, 12890 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a5c57b35f08..63068cfee1b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -144,7 +144,7 @@ variables:
DOCKER_VERSION: "23.0.1"
RUBY_VERSION: "2.7"
RUBYGEMS_VERSION: "3.4"
- GO_VERSION: "1.19"
+ GO_VERSION: "1.20"
RUST_VERSION: "1.65"
FLAKY_RSPEC_SUITE_REPORT_PATH: rspec/flaky/report-suite.json
diff --git a/.gitlab/ci/workhorse.gitlab-ci.yml b/.gitlab/ci/workhorse.gitlab-ci.yml
index ae0b15bbdb8..603f67079c2 100644
--- a/.gitlab/ci/workhorse.gitlab-ci.yml
+++ b/.gitlab/ci/workhorse.gitlab-ci.yml
@@ -26,7 +26,7 @@ workhorse:test go:
extends: .workhorse:test
parallel:
matrix:
- - GO_VERSION: ["1.18", "1.19"]
+ - GO_VERSION: ["1.18", "1.19", "1.20"]
script:
- make -C workhorse test-coverage
coverage: '/\d+.\d+%/'
@@ -38,7 +38,7 @@ workhorse:test fips:
extends: .workhorse:test
parallel:
matrix:
- - GO_VERSION: ["1.18", "1.19"]
+ - GO_VERSION: ["1.18", "1.19", "1.20"]
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/ubi-${UBI_VERSION}-ruby-${RUBY_VERSION}-golang-${GO_VERSION}-rust-${RUST_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-2.36-exiftool-12.60
variables:
FIPS_MODE: 1
diff --git a/.rubocop_todo/rspec/missing_feature_category.yml b/.rubocop_todo/rspec/missing_feature_category.yml
index 527d7913311..ddc6cd683db 100644
--- a/.rubocop_todo/rspec/missing_feature_category.yml
+++ b/.rubocop_todo/rspec/missing_feature_category.yml
@@ -1368,7 +1368,6 @@ RSpec/MissingFeatureCategory:
- 'ee/spec/serializers/member_user_entity_spec.rb'
- 'ee/spec/serializers/merge_request_poll_widget_entity_spec.rb'
- 'ee/spec/serializers/merge_request_sidebar_basic_entity_spec.rb'
- - 'ee/spec/serializers/merge_request_widget_entity_spec.rb'
- 'ee/spec/serializers/metrics_report_metric_entity_spec.rb'
- 'ee/spec/serializers/metrics_reports_comparer_entity_spec.rb'
- 'ee/spec/serializers/pipeline_serializer_spec.rb'
@@ -5529,7 +5528,6 @@ RSpec/MissingFeatureCategory:
- 'spec/serializers/merge_request_sidebar_extras_entity_spec.rb'
- 'spec/serializers/merge_request_user_entity_spec.rb'
- 'spec/serializers/merge_request_widget_commit_entity_spec.rb'
- - 'spec/serializers/merge_request_widget_entity_spec.rb'
- 'spec/serializers/merge_requests/pipeline_entity_spec.rb'
- 'spec/serializers/move_to_project_entity_spec.rb'
- 'spec/serializers/move_to_project_serializer_spec.rb'
diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION
index b8737ed01ae..e8233db7991 100644
--- a/GITLAB_KAS_VERSION
+++ b/GITLAB_KAS_VERSION
@@ -1 +1 @@
-v16.1.2
+v16.1.3
diff --git a/app/services/ci/job_artifacts/create_service.rb b/app/services/ci/job_artifacts/create_service.rb
index 1647e921092..3ac0e83232f 100644
--- a/app/services/ci/job_artifacts/create_service.rb
+++ b/app/services/ci/job_artifacts/create_service.rb
@@ -26,7 +26,7 @@ module Ci
headers = JobArtifactUploader.workhorse_authorize(
has_length: false,
maximum_size: max_size(artifact_type),
- use_final_store_path: Feature.enabled?(:ci_artifacts_upload_to_final_location, project),
+ use_final_store_path: true,
final_store_path_root_id: project.id
)
diff --git a/app/workers/object_storage/delete_stale_direct_uploads_worker.rb b/app/workers/object_storage/delete_stale_direct_uploads_worker.rb
index 081b58ca726..0d4c9e12cb9 100644
--- a/app/workers/object_storage/delete_stale_direct_uploads_worker.rb
+++ b/app/workers/object_storage/delete_stale_direct_uploads_worker.rb
@@ -17,8 +17,6 @@ module ObjectStorage
deduplicate :until_executed
def perform
- return unless Feature.enabled?(:stale_pending_direct_uploads_cleaner)
-
result = ObjectStorage::DeleteStaleDirectUploadsService.new.execute
log_extra_metadata_on_done(:total_pending_entries, result[:total_pending_entries])
diff --git a/config/events/1676085590_Admin__AuditLogsController_visit_instance_compliance_audit_events.yml b/config/events/1676085590_Admin__AuditLogsController_visit_instance_compliance_audit_events.yml
index bba3ac4024d..ad28a90c4bc 100644
--- a/config/events/1676085590_Admin__AuditLogsController_visit_instance_compliance_audit_events.yml
+++ b/config/events/1676085590_Admin__AuditLogsController_visit_instance_compliance_audit_events.yml
@@ -10,8 +10,8 @@ identifiers:
#- project
- user
#- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
diff --git a/config/events/1676085625_Admin__CredentialsController_visit_compliance_credential_inventory.yml b/config/events/1676085625_Admin__CredentialsController_visit_compliance_credential_inventory.yml
index 8e103c7acc2..d1c69423515 100644
--- a/config/events/1676085625_Admin__CredentialsController_visit_compliance_credential_inventory.yml
+++ b/config/events/1676085625_Admin__CredentialsController_visit_compliance_credential_inventory.yml
@@ -10,8 +10,8 @@ identifiers:
#- project
- user
#- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
diff --git a/config/events/1676085737_Groups__AuditEventsController_visit_group_compliance_audit_events.yml b/config/events/1676085737_Groups__AuditEventsController_visit_group_compliance_audit_events.yml
index b48e2de6055..240bdee0374 100644
--- a/config/events/1676085737_Groups__AuditEventsController_visit_group_compliance_audit_events.yml
+++ b/config/events/1676085737_Groups__AuditEventsController_visit_group_compliance_audit_events.yml
@@ -10,15 +10,15 @@ identifiers:
#- project
- user
- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
distributions:
#- ce
- ee
-tiers:
+tiers:
#- free
- premium
- ultimate
diff --git a/config/events/1676085856_API__AuditEvents_admin_audit_event_request.yml b/config/events/1676085856_API__AuditEvents_admin_audit_event_request.yml
index 4be2df48fb3..b1a92a54032 100644
--- a/config/events/1676085856_API__AuditEvents_admin_audit_event_request.yml
+++ b/config/events/1676085856_API__AuditEvents_admin_audit_event_request.yml
@@ -10,15 +10,15 @@ identifiers:
#- project
- user
#- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
distributions:
#- ce
- ee
-tiers:
+tiers:
#- free
- premium
- ultimate
diff --git a/config/events/1676085891_EE__API__Groups_group_audit_event_request.yml b/config/events/1676085891_EE__API__Groups_group_audit_event_request.yml
index 31f45f21695..81a97017956 100644
--- a/config/events/1676085891_EE__API__Groups_group_audit_event_request.yml
+++ b/config/events/1676085891_EE__API__Groups_group_audit_event_request.yml
@@ -10,8 +10,8 @@ identifiers:
#- project
- user
- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
diff --git a/config/events/1676085919_EE__API__Projects_project_audit_event_request.yml b/config/events/1676085919_EE__API__Projects_project_audit_event_request.yml
index 062f5363ef1..703887818b6 100644
--- a/config/events/1676085919_EE__API__Projects_project_audit_event_request.yml
+++ b/config/events/1676085919_EE__API__Projects_project_audit_event_request.yml
@@ -10,8 +10,8 @@ identifiers:
- project
- user
- namespace
-product_section: dev
-product_stage: manage
+product_section: sec
+product_stage: govern
product_group: compliance
milestone: "15.9"
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107120
diff --git a/config/feature_flags/development/ci_artifacts_upload_to_final_location.yml b/config/feature_flags/development/ci_artifacts_upload_to_final_location.yml
deleted file mode 100644
index 452c6ed8331..00000000000
--- a/config/feature_flags/development/ci_artifacts_upload_to_final_location.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: ci_artifacts_upload_to_final_location
-introduced_by_url: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106740'
-rollout_issue_url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/385447'
-milestone: '16.0'
-type: development
-group: group::pipeline security
-default_enabled: false
diff --git a/config/feature_flags/development/stale_pending_direct_uploads_cleaner.yml b/config/feature_flags/development/disable_all_mention.yml
index f9bf9833f20..1ce939683f4 100644
--- a/config/feature_flags/development/stale_pending_direct_uploads_cleaner.yml
+++ b/config/feature_flags/development/disable_all_mention.yml
@@ -1,8 +1,8 @@
---
-name: stale_pending_direct_uploads_cleaner
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117746
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/385447
+name: disable_all_mention
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110586
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415280
milestone: '16.1'
type: development
-group: group::pipeline security
+group: group::project management
default_enabled: false
diff --git a/db/init_structure.sql b/db/init_structure.sql
index aee0f767996..bcdaa38c32f 100644
--- a/db/init_structure.sql
+++ b/db/init_structure.sql
@@ -45,6 +45,39 @@ RETURN NULL;
END
$$;
+CREATE FUNCTION insert_or_update_vulnerability_reads() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ severity smallint;
+ state smallint;
+ report_type smallint;
+ resolved_on_default_branch boolean;
+BEGIN
+ IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN
+ RETURN NULL;
+ END IF;
+
+ IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN
+ RETURN NULL;
+ END IF;
+
+ SELECT
+ vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch
+ INTO
+ severity, state, report_type, resolved_on_default_branch
+ FROM
+ vulnerabilities
+ WHERE
+ vulnerabilities.id = NEW.vulnerability_id;
+
+ INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)
+ VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')
+ ON CONFLICT(vulnerability_id) DO NOTHING;
+ RETURN NULL;
+END
+$$;
+
CREATE FUNCTION insert_projects_sync_event() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -60,10 +93,7 @@ CREATE FUNCTION integrations_set_type_new() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
-UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1')
-WHERE integrations.id = NEW.id;
-RETURN NULL;
-
+UPDATE integrations SET type_new = COALESCE(NEW.type_new, regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1')) , type = COALESCE(NEW.type, regexp_replace(NEW.type_new, '\AIntegrations::(.+)\Z', '\1Service')) WHERE integrations.id = NEW.id; RETURN NULL;
END
$$;
@@ -107,6 +137,83 @@ RETURN NULL;
END
$$;
+CREATE FUNCTION set_has_issues_on_vulnerability_reads() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE
+ vulnerability_reads
+SET
+ has_issues = true
+WHERE
+ vulnerability_id = NEW.vulnerability_id AND has_issues IS FALSE;
+RETURN NULL;
+
+END
+$$;
+
+CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+DECLARE
+ has_issue_links integer;
+BEGIN
+ PERFORM 1
+ FROM
+ vulnerability_reads
+ WHERE
+ vulnerability_id = OLD.vulnerability_id
+ FOR UPDATE;
+
+ SELECT 1 INTO has_issue_links FROM vulnerability_issue_links WHERE vulnerability_id = OLD.vulnerability_id LIMIT 1;
+
+ IF (has_issue_links = 1) THEN
+ RETURN NULL;
+ END IF;
+
+ UPDATE
+ vulnerability_reads
+ SET
+ has_issues = false
+ WHERE
+ vulnerability_id = OLD.vulnerability_id;
+
+ RETURN NULL;
+END
+$$;
+
+CREATE FUNCTION update_location_from_vulnerability_occurrences() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE
+ vulnerability_reads
+SET
+ location_image = NEW.location->>'image',
+ cluster_agent_id = NEW.location->'kubernetes_resource'->>'agent_id'
+WHERE
+ vulnerability_id = NEW.vulnerability_id;
+RETURN NULL;
+
+END
+$$;
+
+CREATE FUNCTION update_vulnerability_reads_from_vulnerability() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE
+ vulnerability_reads
+SET
+ severity = NEW.severity,
+ state = NEW.state,
+ resolved_on_default_branch = NEW.resolved_on_default_branch
+WHERE vulnerability_id = NEW.id;
+RETURN NULL;
+
+END
+$$;
+
CREATE TABLE audit_events (
id bigint NOT NULL,
author_id integer NOT NULL,
@@ -120,10 +227,8 @@ CREATE TABLE audit_events (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
)
PARTITION BY RANGE (created_at);
@@ -150,74 +255,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_000000 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
- CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
-);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202212 (
- id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
- author_id integer NOT NULL,
- entity_id integer NOT NULL,
- entity_type character varying NOT NULL,
- details text,
- ip_address inet,
- author_name text,
- target_details text,
- entity_path text,
- created_at timestamp without time zone NOT NULL,
- target_type text,
- target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
- CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
-);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202301 (
- id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
- author_id integer NOT NULL,
- entity_id integer NOT NULL,
- entity_type character varying NOT NULL,
- details text,
- ip_address inet,
- author_name text,
- target_details text,
- entity_path text,
- created_at timestamp without time zone NOT NULL,
- target_type text,
- target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000 FOR VALUES FROM (MINVALUE) TO ('2023-05-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202302 (
- id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
- author_id integer NOT NULL,
- entity_id integer NOT NULL,
- entity_type character varying NOT NULL,
- details text,
- ip_address inet,
- author_name text,
- target_details text,
- entity_path text,
- created_at timestamp without time zone NOT NULL,
- target_type text,
- target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
- CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
-);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202303 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -230,14 +273,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202303 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202304 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -250,14 +291,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202304 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -270,14 +309,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202308 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -290,14 +327,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202309 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -310,14 +345,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202308 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202310 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -330,14 +363,12 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202308 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202310 FOR VALUES FROM ('2023-10-01 00:00:00') TO ('2023-11-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.audit_events_202309 (
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202311 (
id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
author_id integer NOT NULL,
entity_id integer NOT NULL,
@@ -350,12 +381,10 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202309 (
created_at timestamp without time zone NOT NULL,
target_type text,
target_id bigint,
- CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
- CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
);
-ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202311 FOR VALUES FROM ('2023-11-01 00:00:00') TO ('2023-12-01 00:00:00');
CREATE TABLE batched_background_migration_job_transition_logs (
id bigint NOT NULL,
@@ -392,9 +421,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-02-28 18:00:00-06');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-05-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -406,9 +435,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -420,9 +449,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -434,9 +463,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -448,9 +477,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -462,9 +491,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202310 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -476,9 +505,9 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202310 FOR VALUES FROM ('2023-10-01 00:00:00+00') TO ('2023-11-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 (
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202311 (
id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL,
batched_background_migration_job_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -490,7 +519,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti
CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
);
-ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05');
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202311 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00');
CREATE TABLE incident_management_pending_alert_escalations (
id bigint NOT NULL,
@@ -511,16 +540,7 @@ CREATE SEQUENCE incident_management_pending_alert_escalations_id_seq
ALTER SEQUENCE incident_management_pending_alert_escalations_id_seq OWNED BY incident_management_pending_alert_escalations.id;
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 (
- id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- alert_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
-);
-
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -528,28 +548,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000 FOR VALUES FROM (MINVALUE) TO ('2023-05-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 (
- id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- alert_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
-);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
-
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 (
- id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- alert_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
-);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
-
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -557,9 +558,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -567,9 +568,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -577,9 +578,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -587,9 +588,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -597,9 +598,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -607,9 +608,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310 FOR VALUES FROM ('2023-10-01 00:00:00+00') TO ('2023-11-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
@@ -617,7 +618,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00');
CREATE TABLE incident_management_pending_issue_escalations (
id bigint NOT NULL,
@@ -638,7 +639,7 @@ CREATE SEQUENCE incident_management_pending_issue_escalations_id_seq
ALTER SEQUENCE incident_management_pending_issue_escalations_id_seq OWNED BY incident_management_pending_issue_escalations.id;
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -646,8 +647,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000 FOR VALUES FROM (MINVALUE) TO ('2023-05-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -655,8 +657,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -664,9 +667,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -674,9 +677,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -684,9 +687,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -694,9 +697,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -704,9 +707,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310 FOR VALUES FROM ('2023-10-01 00:00:00+00') TO ('2023-11-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 (
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -714,37 +717,42 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 (
- id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- issue_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
-);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+CREATE TABLE loose_foreign_keys_deleted_records (
+ id bigint NOT NULL,
+ partition bigint DEFAULT 1 NOT NULL,
+ primary_key_value bigint NOT NULL,
+ status smallint DEFAULT 1 NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ fully_qualified_table_name text NOT NULL,
+ consume_after timestamp with time zone DEFAULT now(),
+ cleanup_attempts smallint DEFAULT 0,
+ CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150))
+)
+PARTITION BY LIST (partition);
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 (
- id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- issue_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
-);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05');
+CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
-CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 (
- id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
- rule_id bigint NOT NULL,
- issue_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
+ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id;
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 (
+ id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL,
+ partition bigint DEFAULT 1 NOT NULL,
+ primary_key_value bigint NOT NULL,
+ status smallint DEFAULT 1 NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ fully_qualified_table_name text NOT NULL,
+ consume_after timestamp with time zone DEFAULT now(),
+ cleanup_attempts smallint DEFAULT 0,
+ CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150))
);
-ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05');
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1');
CREATE TABLE verification_codes (
created_at timestamp with time zone DEFAULT now() NOT NULL,
@@ -753,7 +761,7 @@ CREATE TABLE verification_codes (
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
)
PARTITION BY RANGE (created_at);
@@ -766,97 +774,97 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_000000 (
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000 FOR VALUES FROM (MINVALUE) TO ('2023-01-31 18:00:00-06');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000 FOR VALUES FROM (MINVALUE) TO ('2023-04-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202302 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202304 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202303 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202304 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202307 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202308 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202307 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202309 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202308 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202310 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202310 FOR VALUES FROM ('2023-10-01 00:00:00+00') TO ('2023-11-01 00:00:00+00');
-CREATE TABLE gitlab_partitions_dynamic.verification_codes_202309 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202311 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
visitor_id_code text NOT NULL,
code text NOT NULL,
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
);
-ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05');
+ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202311 FOR VALUES FROM ('2023-11-01 00:00:00+00') TO ('2023-12-01 00:00:00+00');
CREATE TABLE web_hook_logs (
id bigint NOT NULL,
@@ -900,59 +908,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_000000 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-05-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202212 (
- id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
- web_hook_id integer NOT NULL,
- trigger character varying,
- url character varying,
- request_headers text,
- request_data text,
- response_headers text,
- response_body text,
- response_status character varying,
- execution_duration double precision,
- internal_error_message character varying,
- updated_at timestamp without time zone NOT NULL,
- created_at timestamp without time zone NOT NULL
-);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202301 (
- id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
- web_hook_id integer NOT NULL,
- trigger character varying,
- url character varying,
- request_headers text,
- request_data text,
- response_headers text,
- response_body text,
- response_status character varying,
- execution_duration double precision,
- internal_error_message character varying,
- updated_at timestamp without time zone NOT NULL,
- created_at timestamp without time zone NOT NULL
-);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202302 (
- id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
- web_hook_id integer NOT NULL,
- trigger character varying,
- url character varying,
- request_headers text,
- request_data text,
- response_headers text,
- response_body text,
- response_status character varying,
- execution_duration double precision,
- internal_error_message character varying,
- updated_at timestamp without time zone NOT NULL,
- created_at timestamp without time zone NOT NULL
-);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00');
-
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202303 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -967,9 +925,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202303 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202304 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -984,9 +942,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202304 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -1001,9 +959,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202308 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -1018,9 +976,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202309 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -1035,9 +993,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202308 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202310 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -1052,9 +1010,9 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202308 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202310 FOR VALUES FROM ('2023-10-01 00:00:00') TO ('2023-11-01 00:00:00');
-CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202309 (
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202311 (
id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
web_hook_id integer NOT NULL,
trigger character varying,
@@ -1069,7 +1027,7 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202309 (
updated_at timestamp without time zone NOT NULL,
created_at timestamp without time zone NOT NULL
);
-ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202311 FOR VALUES FROM ('2023-11-01 00:00:00') TO ('2023-12-01 00:00:00');
CREATE TABLE analytics_cycle_analytics_issue_stage_events (
stage_event_hash_id bigint NOT NULL,
@@ -2514,39 +2472,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_63 (
);
ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63);
-CREATE TABLE loose_foreign_keys_deleted_records (
- id bigint NOT NULL,
- partition bigint DEFAULT 1 NOT NULL,
- primary_key_value bigint NOT NULL,
- status smallint DEFAULT 1 NOT NULL,
- created_at timestamp with time zone DEFAULT now() NOT NULL,
- fully_qualified_table_name text NOT NULL,
- consume_after timestamp with time zone DEFAULT now(),
- CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150))
-)
-PARTITION BY LIST (partition);
-
-CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id;
-
-CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 (
- id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL,
- partition bigint DEFAULT 1 NOT NULL,
- primary_key_value bigint NOT NULL,
- status smallint DEFAULT 1 NOT NULL,
- created_at timestamp with time zone DEFAULT now() NOT NULL,
- fully_qualified_table_name text NOT NULL,
- consume_after timestamp with time zone DEFAULT now(),
- CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150))
-);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1');
-
CREATE TABLE product_analytics_events_experimental (
id bigint NOT NULL,
project_id integer NOT NULL,
@@ -11293,6 +11218,29 @@ CREATE SEQUENCE alert_management_alert_assignees_id_seq
ALTER SEQUENCE alert_management_alert_assignees_id_seq OWNED BY alert_management_alert_assignees.id;
+CREATE TABLE alert_management_alert_metric_images (
+ id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ file_store smallint,
+ file text NOT NULL,
+ url text,
+ url_text text,
+ CONSTRAINT check_2587666252 CHECK ((char_length(url_text) <= 128)),
+ CONSTRAINT check_4d811d9007 CHECK ((char_length(url) <= 255)),
+ CONSTRAINT check_70fafae519 CHECK ((char_length(file) <= 255))
+);
+
+CREATE SEQUENCE alert_management_alert_metric_images_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE alert_management_alert_metric_images_id_seq OWNED BY alert_management_alert_metric_images.id;
+
CREATE TABLE alert_management_alert_user_mentions (
id bigint NOT NULL,
alert_management_alert_id bigint NOT NULL,
@@ -11392,6 +11340,38 @@ CREATE SEQUENCE allowed_email_domains_id_seq
ALTER SEQUENCE allowed_email_domains_id_seq OWNED BY allowed_email_domains.id;
+CREATE TABLE analytics_cycle_analytics_aggregations (
+ group_id bigint NOT NULL,
+ incremental_runtimes_in_seconds integer[] DEFAULT '{}'::integer[] NOT NULL,
+ incremental_processed_records integer[] DEFAULT '{}'::integer[] NOT NULL,
+ last_full_run_runtimes_in_seconds integer[] DEFAULT '{}'::integer[] NOT NULL,
+ last_full_run_processed_records integer[] DEFAULT '{}'::integer[] NOT NULL,
+ last_incremental_issues_id integer,
+ last_incremental_merge_requests_id integer,
+ last_full_run_issues_id integer,
+ last_full_run_merge_requests_id integer,
+ last_incremental_run_at timestamp with time zone,
+ last_incremental_issues_updated_at timestamp with time zone,
+ last_incremental_merge_requests_updated_at timestamp with time zone,
+ last_full_run_at timestamp with time zone,
+ last_full_run_issues_updated_at timestamp with time zone,
+ last_full_run_mrs_updated_at timestamp with time zone,
+ last_consistency_check_updated_at timestamp with time zone,
+ enabled boolean DEFAULT true NOT NULL,
+ full_runtimes_in_seconds integer[] DEFAULT '{}'::integer[] NOT NULL,
+ full_processed_records integer[] DEFAULT '{}'::integer[] NOT NULL,
+ last_full_merge_requests_updated_at timestamp with time zone,
+ last_full_issues_updated_at timestamp with time zone,
+ last_full_issues_id integer,
+ last_full_merge_requests_id integer,
+ CONSTRAINT chk_rails_1ef688e577 CHECK ((cardinality(incremental_runtimes_in_seconds) <= 10)),
+ CONSTRAINT chk_rails_7810292ec9 CHECK ((cardinality(last_full_run_processed_records) <= 10)),
+ CONSTRAINT chk_rails_8b9e89687c CHECK ((cardinality(last_full_run_runtimes_in_seconds) <= 10)),
+ CONSTRAINT chk_rails_e16bf3913a CHECK ((cardinality(incremental_processed_records) <= 10)),
+ CONSTRAINT full_processed_records_size CHECK ((cardinality(full_processed_records) <= 10)),
+ CONSTRAINT full_runtimes_in_seconds_size CHECK ((cardinality(full_runtimes_in_seconds) <= 10))
+);
+
CREATE TABLE analytics_cycle_analytics_group_stages (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -11523,7 +11503,7 @@ CREATE TABLE analytics_devops_adoption_snapshots (
runner_configured boolean NOT NULL,
pipeline_succeeded boolean NOT NULL,
deploy_succeeded boolean NOT NULL,
- security_scan_succeeded boolean NOT NULL,
+ security_scan_succeeded boolean,
end_time timestamp with time zone NOT NULL,
total_projects_count integer,
code_owners_used_count integer,
@@ -11799,7 +11779,7 @@ CREATE TABLE application_settings (
throttle_protected_paths_enabled boolean DEFAULT false NOT NULL,
throttle_protected_paths_requests_per_period integer DEFAULT 10 NOT NULL,
throttle_protected_paths_period_in_seconds integer DEFAULT 60 NOT NULL,
- protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session,/oauth/authorize,/oauth/token}'::character varying[],
+ protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session}'::character varying[],
snowplow_collector_hostname character varying,
sourcegraph_enabled boolean DEFAULT false NOT NULL,
sourcegraph_url character varying(255),
@@ -11882,7 +11862,7 @@ CREATE TABLE application_settings (
kroki_url text,
kroki_enabled boolean DEFAULT false NOT NULL,
help_page_documentation_base_url text,
- container_registry_expiration_policies_worker_capacity integer DEFAULT 0 NOT NULL,
+ container_registry_expiration_policies_worker_capacity integer DEFAULT 4 NOT NULL,
require_admin_approval_after_user_signup boolean DEFAULT true NOT NULL,
automatic_purchased_storage_allocation boolean DEFAULT false NOT NULL,
encrypted_ci_jwt_signing_key text,
@@ -11984,15 +11964,50 @@ CREATE TABLE application_settings (
max_ssh_key_lifetime integer,
static_objects_external_storage_auth_token_encrypted text,
future_subscriptions jsonb DEFAULT '[]'::jsonb NOT NULL,
+ packages_cleanup_package_file_worker_capacity smallint DEFAULT 2 NOT NULL,
+ container_registry_import_max_tags_count integer DEFAULT 100 NOT NULL,
+ container_registry_import_max_retries integer DEFAULT 3 NOT NULL,
+ container_registry_import_start_max_retries integer DEFAULT 50 NOT NULL,
+ container_registry_import_max_step_duration integer DEFAULT 300 NOT NULL,
+ container_registry_import_target_plan text DEFAULT 'free'::text NOT NULL,
+ container_registry_import_created_before timestamp with time zone DEFAULT '2022-01-23 00:00:00+00'::timestamp with time zone NOT NULL,
+ runner_token_expiration_interval integer,
+ group_runner_token_expiration_interval integer,
+ project_runner_token_expiration_interval integer,
+ ecdsa_sk_key_restriction integer DEFAULT 0 NOT NULL,
+ ed25519_sk_key_restriction integer DEFAULT 0 NOT NULL,
+ users_get_by_id_limit integer DEFAULT 300 NOT NULL,
+ users_get_by_id_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL,
+ container_registry_expiration_policies_caching boolean DEFAULT true NOT NULL,
+ search_rate_limit integer DEFAULT 300 NOT NULL,
+ search_rate_limit_unauthenticated integer DEFAULT 100 NOT NULL,
+ encrypted_database_grafana_api_key bytea,
+ encrypted_database_grafana_api_key_iv bytea,
+ database_grafana_api_url text,
+ database_grafana_tag text,
+ public_runner_releases_url text DEFAULT 'https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases'::text NOT NULL,
+ encrypted_arkose_labs_public_api_key bytea,
+ encrypted_arkose_labs_public_api_key_iv bytea,
+ encrypted_arkose_labs_private_api_key bytea,
+ encrypted_arkose_labs_private_api_key_iv bytea,
+ arkose_labs_verify_api_url text,
+ delete_inactive_projects boolean DEFAULT false NOT NULL,
+ inactive_projects_delete_after_months integer DEFAULT 2 NOT NULL,
+ inactive_projects_min_size_mb integer DEFAULT 0 NOT NULL,
+ inactive_projects_send_warning_email_after_months integer DEFAULT 1 NOT NULL,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),
CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)),
+ CONSTRAINT app_settings_p_cleanup_package_file_worker_capacity_positive CHECK ((packages_cleanup_package_file_worker_capacity >= 0)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)),
CONSTRAINT app_settings_yaml_max_size_positive CHECK ((max_yaml_size_bytes > 0)),
CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)),
+ CONSTRAINT check_2b820eaac3 CHECK ((char_length(database_grafana_tag) <= 255)),
CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)),
CONSTRAINT check_32710817e9 CHECK ((char_length(static_objects_external_storage_auth_token_encrypted) <= 255)),
+ CONSTRAINT check_3455368420 CHECK ((char_length(database_grafana_api_url) <= 255)),
+ CONSTRAINT check_3559645ae5 CHECK ((char_length(container_registry_import_target_plan) <= 255)),
CONSTRAINT check_3def0f1829 CHECK ((char_length(sentry_clientside_dsn) <= 255)),
CONSTRAINT check_4f8b811780 CHECK ((char_length(sentry_dsn) <= 255)),
CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)),
@@ -12002,6 +12017,7 @@ CREATE TABLE application_settings (
CONSTRAINT check_718b4458ae CHECK ((char_length(personal_access_token_prefix) <= 20)),
CONSTRAINT check_7227fad848 CHECK ((char_length(rate_limiting_response_text) <= 255)),
CONSTRAINT check_85a39b68ff CHECK ((char_length(encrypted_ci_jwt_signing_key_iv) <= 255)),
+ CONSTRAINT check_8dca35398a CHECK ((char_length(public_runner_releases_url) <= 255)),
CONSTRAINT check_9a719834eb CHECK ((char_length(secret_detection_token_revocation_url) <= 255)),
CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)),
CONSTRAINT check_a5704163cc CHECK ((char_length(secret_detection_revocation_token_types_url) <= 255)),
@@ -12010,7 +12026,8 @@ CREATE TABLE application_settings (
CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)),
CONSTRAINT check_e5024c8801 CHECK ((char_length(elasticsearch_username) <= 255)),
CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255)),
- CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255))
+ CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)),
+ CONSTRAINT check_f6563bc000 CHECK ((char_length(arkose_labs_verify_api_url) <= 255))
);
COMMENT ON COLUMN application_settings.content_validation_endpoint_url IS 'JiHu-specific column';
@@ -12263,7 +12280,9 @@ CREATE TABLE audit_events_external_audit_event_destinations (
destination_url text NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255))
+ verification_token text,
+ CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255)),
+ CONSTRAINT check_8ec80a7d06 CHECK ((char_length(verification_token) <= 24))
);
CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq
@@ -12416,6 +12435,9 @@ CREATE TABLE batched_background_migrations (
job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL,
total_tuple_count bigint,
pause_ms integer DEFAULT 100 NOT NULL,
+ max_batch_size integer,
+ started_at timestamp with time zone,
+ on_hold_until timestamp with time zone,
CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)),
CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)),
CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)),
@@ -12426,6 +12448,8 @@ CREATE TABLE batched_background_migrations (
CONSTRAINT check_positive_sub_batch_size CHECK ((sub_batch_size > 0))
);
+COMMENT ON COLUMN batched_background_migrations.on_hold_until IS 'execution of this migration is on hold until this time';
+
CREATE SEQUENCE batched_background_migrations_id_seq
START WITH 1
INCREMENT BY 1
@@ -12685,7 +12709,9 @@ CREATE TABLE broadcast_messages (
cached_markdown_version integer,
dismissable boolean,
target_path character varying(255),
- broadcast_type smallint DEFAULT 1 NOT NULL
+ broadcast_type smallint DEFAULT 1 NOT NULL,
+ target_access_levels integer[] DEFAULT '{}'::integer[] NOT NULL,
+ theme smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE broadcast_messages_id_seq
@@ -13052,6 +13078,7 @@ CREATE TABLE ci_builds_metadata (
secrets jsonb DEFAULT '{}'::jsonb NOT NULL,
build_id bigint NOT NULL,
id bigint NOT NULL,
+ runner_features jsonb DEFAULT '{}'::jsonb NOT NULL,
runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL
);
@@ -13707,7 +13734,11 @@ CREATE TABLE ci_runners (
token_encrypted character varying,
public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL,
private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
- config jsonb DEFAULT '{}'::jsonb NOT NULL
+ config jsonb DEFAULT '{}'::jsonb NOT NULL,
+ executor_type smallint,
+ maintainer_note text,
+ token_expires_at timestamp with time zone,
+ CONSTRAINT check_ce275cee06 CHECK ((char_length(maintainer_note) <= 1024))
);
CREATE SEQUENCE ci_runners_id_seq
@@ -13738,6 +13769,31 @@ CREATE SEQUENCE ci_running_builds_id_seq
ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id;
+CREATE TABLE ci_secure_files (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ file_store smallint DEFAULT 1 NOT NULL,
+ permissions smallint DEFAULT 0 NOT NULL,
+ name text NOT NULL,
+ file text NOT NULL,
+ checksum bytea NOT NULL,
+ key_data text,
+ CONSTRAINT check_320790634d CHECK ((char_length(file) <= 255)),
+ CONSTRAINT check_402c7b4a56 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_7279b4e293 CHECK ((char_length(key_data) <= 128))
+);
+
+CREATE SEQUENCE ci_secure_files_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_secure_files_id_seq OWNED BY ci_secure_files.id;
+
CREATE TABLE ci_sources_pipelines (
id integer NOT NULL,
project_id integer,
@@ -13919,6 +13975,7 @@ CREATE TABLE cluster_agent_tokens (
description text,
name text,
last_used_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)),
CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)),
@@ -14427,7 +14484,21 @@ CREATE TABLE container_repositories (
status smallint,
expiration_policy_started_at timestamp with time zone,
expiration_policy_cleanup_status smallint DEFAULT 0 NOT NULL,
- expiration_policy_completed_at timestamp with time zone
+ expiration_policy_completed_at timestamp with time zone,
+ migration_pre_import_started_at timestamp with time zone,
+ migration_pre_import_done_at timestamp with time zone,
+ migration_import_started_at timestamp with time zone,
+ migration_import_done_at timestamp with time zone,
+ migration_aborted_at timestamp with time zone,
+ migration_skipped_at timestamp with time zone,
+ migration_retries_count integer DEFAULT 0 NOT NULL,
+ migration_skipped_reason smallint,
+ migration_state text DEFAULT 'default'::text NOT NULL,
+ migration_aborted_in_state text,
+ migration_plan text,
+ CONSTRAINT check_05e9012f36 CHECK ((char_length(migration_plan) <= 255)),
+ CONSTRAINT check_13c58fe73a CHECK ((char_length(migration_state) <= 255)),
+ CONSTRAINT check_97f0249439 CHECK ((char_length(migration_aborted_in_state) <= 255))
);
CREATE SEQUENCE container_repositories_id_seq
@@ -14747,8 +14818,11 @@ CREATE TABLE dast_site_profiles (
auth_password_field text,
auth_username text,
target_type smallint DEFAULT 0 NOT NULL,
+ scan_method smallint DEFAULT 0 NOT NULL,
+ auth_submit_field text,
CONSTRAINT check_5203110fee CHECK ((char_length(auth_username_field) <= 255)),
CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_af44f54c96 CHECK ((char_length(auth_submit_field) <= 255)),
CONSTRAINT check_c329dffdba CHECK ((char_length(auth_password_field) <= 255)),
CONSTRAINT check_d446f7047b CHECK ((char_length(auth_url) <= 1024)),
CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255))
@@ -14954,7 +15028,8 @@ CREATE TABLE deploy_tokens (
deploy_token_type smallint DEFAULT 2 NOT NULL,
write_registry boolean DEFAULT false NOT NULL,
read_package_registry boolean DEFAULT false NOT NULL,
- write_package_registry boolean DEFAULT false NOT NULL
+ write_package_registry boolean DEFAULT false NOT NULL,
+ creator_id bigint
);
CREATE SEQUENCE deploy_tokens_id_seq
@@ -14973,7 +15048,10 @@ CREATE TABLE deployment_approvals (
user_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- status smallint NOT NULL
+ status smallint NOT NULL,
+ comment text,
+ approval_rule_id bigint,
+ CONSTRAINT check_e2eb6a17d8 CHECK ((char_length(comment) <= 255))
);
CREATE SEQUENCE deployment_approvals_id_seq
@@ -15167,6 +15245,8 @@ CREATE TABLE dora_daily_metrics (
date date NOT NULL,
deployment_frequency integer,
lead_time_for_changes_in_seconds integer,
+ time_to_restore_service_in_seconds integer,
+ incidents_count integer,
CONSTRAINT dora_daily_metrics_deployment_frequency_positive CHECK ((deployment_frequency >= 0)),
CONSTRAINT dora_daily_metrics_lead_time_for_changes_in_seconds_positive CHECK ((lead_time_for_changes_in_seconds >= 0))
);
@@ -16287,6 +16367,22 @@ CREATE SEQUENCE grafana_integrations_id_seq
ALTER SEQUENCE grafana_integrations_id_seq OWNED BY grafana_integrations.id;
+CREATE TABLE group_crm_settings (
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ enabled boolean DEFAULT false NOT NULL
+);
+
+CREATE SEQUENCE group_crm_settings_group_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE group_crm_settings_group_id_seq OWNED BY group_crm_settings.group_id;
+
CREATE TABLE group_custom_attributes (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -16372,6 +16468,13 @@ CREATE SEQUENCE group_deploy_tokens_id_seq
ALTER SEQUENCE group_deploy_tokens_id_seq OWNED BY group_deploy_tokens.id;
+CREATE TABLE group_features (
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ wiki_access_level smallint DEFAULT 20 NOT NULL
+);
+
CREATE TABLE group_group_links (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -16500,7 +16603,7 @@ CREATE TABLE import_export_uploads (
export_file text,
group_id bigint,
remote_import_url text,
- CONSTRAINT check_58f0d37481 CHECK ((char_length(remote_import_url) <= 512))
+ CONSTRAINT check_58f0d37481 CHECK ((char_length(remote_import_url) <= 2048))
);
CREATE SEQUENCE import_export_uploads_id_seq
@@ -16770,7 +16873,6 @@ CREATE TABLE integrations (
updated_at timestamp without time zone,
active boolean DEFAULT false NOT NULL,
properties text,
- template boolean DEFAULT false,
push_events boolean DEFAULT true,
issues_events boolean DEFAULT true,
merge_requests_events boolean DEFAULT true,
@@ -16793,6 +16895,8 @@ CREATE TABLE integrations (
vulnerability_events boolean DEFAULT false NOT NULL,
type_new text,
archive_trace_events boolean DEFAULT false NOT NULL,
+ encrypted_properties bytea,
+ encrypted_properties_iv bytea,
CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255))
);
@@ -16846,6 +16950,8 @@ CREATE TABLE issuable_metric_images (
file_store smallint,
file text NOT NULL,
url text,
+ url_text text,
+ CONSTRAINT check_3bc6d47661 CHECK ((char_length(url_text) <= 128)),
CONSTRAINT check_5b3011e234 CHECK ((char_length(url) <= 255)),
CONSTRAINT check_7ed527062f CHECK ((char_length(file) <= 255))
);
@@ -17505,7 +17611,8 @@ CREATE TABLE members (
ldap boolean DEFAULT false NOT NULL,
override boolean DEFAULT false NOT NULL,
invite_email_success boolean DEFAULT true NOT NULL,
- state smallint DEFAULT 0
+ state smallint DEFAULT 0,
+ member_namespace_id bigint
);
CREATE SEQUENCE members_id_seq
@@ -17523,7 +17630,8 @@ CREATE TABLE merge_request_assignees (
user_id integer NOT NULL,
merge_request_id integer NOT NULL,
created_at timestamp with time zone,
- state smallint DEFAULT 0 NOT NULL
+ state smallint DEFAULT 0 NOT NULL,
+ updated_state_by_user_id bigint
);
CREATE SEQUENCE merge_request_assignees_id_seq
@@ -17752,7 +17860,8 @@ CREATE TABLE merge_request_reviewers (
user_id bigint NOT NULL,
merge_request_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
- state smallint DEFAULT 0 NOT NULL
+ state smallint DEFAULT 0 NOT NULL,
+ updated_state_by_user_id bigint
);
CREATE SEQUENCE merge_request_reviewers_id_seq
@@ -17849,7 +17958,8 @@ CREATE TABLE merge_requests_compliance_violations (
id bigint NOT NULL,
violating_user_id bigint NOT NULL,
merge_request_id bigint NOT NULL,
- reason smallint NOT NULL
+ reason smallint NOT NULL,
+ severity_level smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE merge_requests_compliance_violations_id_seq
@@ -18025,7 +18135,9 @@ CREATE TABLE namespace_root_storage_statistics (
packages_size bigint DEFAULT 0 NOT NULL,
snippets_size bigint DEFAULT 0 NOT NULL,
pipeline_artifacts_size bigint DEFAULT 0 NOT NULL,
- uploads_size bigint DEFAULT 0 NOT NULL
+ uploads_size bigint DEFAULT 0 NOT NULL,
+ dependency_proxy_size bigint DEFAULT 0 NOT NULL,
+ notification_level smallint DEFAULT 100 NOT NULL
);
CREATE SEQUENCE namespace_root_storage_statistics_namespace_id_seq
@@ -18053,6 +18165,9 @@ CREATE TABLE namespace_settings (
new_user_signups_cap integer,
setup_for_company boolean,
jobs_to_be_done smallint,
+ runner_token_expiration_interval integer,
+ subgroup_runner_token_expiration_interval integer,
+ project_runner_token_expiration_interval integer,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255))
);
@@ -18062,7 +18177,8 @@ CREATE TABLE namespace_statistics (
shared_runners_seconds integer DEFAULT 0 NOT NULL,
shared_runners_seconds_last_reset timestamp without time zone,
storage_size bigint DEFAULT 0 NOT NULL,
- wiki_size bigint DEFAULT 0 NOT NULL
+ wiki_size bigint DEFAULT 0 NOT NULL,
+ dependency_proxy_size bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE namespace_statistics_id_seq
@@ -18364,7 +18480,15 @@ CREATE TABLE onboarding_progresses (
issue_auto_closed_at timestamp with time zone,
repository_imported_at timestamp with time zone,
repository_mirrored_at timestamp with time zone,
- issue_created_at timestamp with time zone
+ issue_created_at timestamp with time zone,
+ secure_dependency_scanning_run_at timestamp with time zone,
+ secure_container_scanning_run_at timestamp with time zone,
+ secure_dast_run_at timestamp with time zone,
+ secure_secret_detection_run_at timestamp with time zone,
+ secure_coverage_fuzzing_run_at timestamp with time zone,
+ secure_cluster_image_scanning_run_at timestamp with time zone,
+ secure_api_fuzzing_run_at timestamp with time zone,
+ license_scanning_run_at timestamp with time zone
);
CREATE SEQUENCE onboarding_progresses_id_seq
@@ -19004,6 +19128,7 @@ CREATE TABLE packages_package_files (
verification_checksum bytea,
verification_state smallint DEFAULT 0 NOT NULL,
verification_started_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_4c5e6bb0b3 CHECK ((file_store IS NOT NULL))
);
@@ -19039,7 +19164,7 @@ ALTER SEQUENCE packages_packages_id_seq OWNED BY packages_packages.id;
CREATE TABLE packages_pypi_metadata (
package_id bigint NOT NULL,
- required_python text,
+ required_python text DEFAULT ''::text,
CONSTRAINT check_0d9aed55b2 CHECK ((required_python IS NOT NULL)),
CONSTRAINT check_379019d5da CHECK ((char_length(required_python) <= 255))
);
@@ -19213,28 +19338,6 @@ CREATE SEQUENCE pages_domains_id_seq
ALTER SEQUENCE pages_domains_id_seq OWNED BY pages_domains.id;
-CREATE TABLE partitioned_foreign_keys (
- id bigint NOT NULL,
- cascade_delete boolean DEFAULT true NOT NULL,
- from_table text NOT NULL,
- from_column text NOT NULL,
- to_table text NOT NULL,
- to_column text NOT NULL,
- CONSTRAINT check_2c2e02a62b CHECK ((char_length(from_column) <= 63)),
- CONSTRAINT check_40738efb57 CHECK ((char_length(to_table) <= 63)),
- CONSTRAINT check_741676d405 CHECK ((char_length(from_table) <= 63)),
- CONSTRAINT check_7e98be694f CHECK ((char_length(to_column) <= 63))
-);
-
-CREATE SEQUENCE partitioned_foreign_keys_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE partitioned_foreign_keys_id_seq OWNED BY partitioned_foreign_keys.id;
-
CREATE TABLE path_locks (
id integer NOT NULL,
path character varying NOT NULL,
@@ -19349,7 +19452,9 @@ CREATE TABLE plan_limits (
external_audit_event_destinations integer DEFAULT 5 NOT NULL,
dotenv_variables integer DEFAULT 20 NOT NULL,
dotenv_size integer DEFAULT 5120 NOT NULL,
- pipeline_triggers integer DEFAULT 25000 NOT NULL
+ pipeline_triggers integer DEFAULT 25000 NOT NULL,
+ project_ci_secure_files integer DEFAULT 100 NOT NULL,
+ repository_size bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE plan_limits_id_seq
@@ -19714,6 +19819,25 @@ CREATE SEQUENCE project_auto_devops_id_seq
ALTER SEQUENCE project_auto_devops_id_seq OWNED BY project_auto_devops.id;
+CREATE TABLE project_build_artifacts_size_refreshes (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ last_job_artifact_id bigint,
+ state smallint DEFAULT 1 NOT NULL,
+ refresh_started_at timestamp with time zone,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE project_build_artifacts_size_refreshes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_build_artifacts_size_refreshes_id_seq OWNED BY project_build_artifacts_size_refreshes.id;
+
CREATE TABLE project_ci_cd_settings (
id integer NOT NULL,
project_id integer NOT NULL,
@@ -19725,7 +19849,9 @@ CREATE TABLE project_ci_cd_settings (
auto_rollback_enabled boolean DEFAULT false NOT NULL,
keep_latest_artifact boolean DEFAULT true NOT NULL,
restrict_user_defined_variables boolean DEFAULT false NOT NULL,
- job_token_scope_enabled boolean DEFAULT false NOT NULL
+ job_token_scope_enabled boolean DEFAULT false NOT NULL,
+ runner_token_expiration_interval integer,
+ separated_caches boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -19829,7 +19955,8 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token_iv character varying,
project_name character varying,
organization_name character varying,
- integrated boolean DEFAULT true NOT NULL
+ integrated boolean DEFAULT true NOT NULL,
+ sentry_project_id bigint
);
CREATE TABLE project_export_jobs (
@@ -19975,8 +20102,8 @@ ALTER SEQUENCE project_mirror_data_id_seq OWNED BY project_mirror_data.id;
CREATE TABLE project_pages_metadata (
project_id bigint NOT NULL,
deployed boolean DEFAULT false NOT NULL,
- artifacts_archive_id bigint,
- pages_deployment_id bigint
+ pages_deployment_id bigint,
+ onboarding_complete boolean DEFAULT false NOT NULL
);
CREATE TABLE project_repositories (
@@ -20078,6 +20205,8 @@ CREATE TABLE project_settings (
merge_commit_template text,
has_shimo boolean DEFAULT false NOT NULL,
squash_commit_template text,
+ legacy_open_source_license_available boolean DEFAULT true NOT NULL,
+ target_platforms character varying[] DEFAULT '{}'::character varying[] NOT NULL,
CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)),
CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)),
CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500))
@@ -20098,7 +20227,8 @@ CREATE TABLE project_statistics (
wiki_size bigint,
snippets_size bigint,
pipeline_artifacts_size bigint DEFAULT 0 NOT NULL,
- uploads_size bigint DEFAULT 0 NOT NULL
+ uploads_size bigint DEFAULT 0 NOT NULL,
+ container_registry_size bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE project_statistics_id_seq
@@ -20227,7 +20357,8 @@ CREATE TABLE projects (
remove_source_branch_after_merge boolean,
suggestion_commit_message character varying(255),
autoclose_referenced_issues boolean,
- project_namespace_id bigint
+ project_namespace_id bigint,
+ hidden boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE projects_id_seq
@@ -20402,6 +20533,28 @@ CREATE SEQUENCE protected_branches_id_seq
ALTER SEQUENCE protected_branches_id_seq OWNED BY protected_branches.id;
+CREATE TABLE protected_environment_approval_rules (
+ id bigint NOT NULL,
+ protected_environment_id bigint NOT NULL,
+ user_id bigint,
+ group_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ access_level smallint,
+ required_approvals smallint NOT NULL,
+ CONSTRAINT chk_rails_bed75249bc CHECK ((((access_level IS NOT NULL) AND (group_id IS NULL) AND (user_id IS NULL)) OR ((user_id IS NOT NULL) AND (access_level IS NULL) AND (group_id IS NULL)) OR ((group_id IS NOT NULL) AND (user_id IS NULL) AND (access_level IS NULL)))),
+ CONSTRAINT chk_rails_cfa90ae3b5 CHECK ((required_approvals > 0))
+);
+
+CREATE SEQUENCE protected_environment_approval_rules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE protected_environment_approval_rules_id_seq OWNED BY protected_environment_approval_rules.id;
+
CREATE TABLE protected_environment_deploy_access_levels (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -20430,7 +20583,8 @@ CREATE TABLE protected_environments (
name character varying NOT NULL,
group_id bigint,
required_approval_count integer DEFAULT 0 NOT NULL,
- CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL)))
+ CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))),
+ CONSTRAINT protected_environments_required_approval_count_positive CHECK ((required_approval_count >= 0))
);
CREATE SEQUENCE protected_environments_id_seq
@@ -20563,6 +20717,24 @@ CREATE SEQUENCE redirect_routes_id_seq
ALTER SEQUENCE redirect_routes_id_seq OWNED BY redirect_routes.id;
+CREATE TABLE related_epic_links (
+ id bigint NOT NULL,
+ source_id bigint NOT NULL,
+ target_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ link_type smallint DEFAULT 0 NOT NULL
+);
+
+CREATE SEQUENCE related_epic_links_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE related_epic_links_id_seq OWNED BY related_epic_links.id;
+
CREATE TABLE release_links (
id bigint NOT NULL,
release_id integer NOT NULL,
@@ -20834,7 +21006,8 @@ CREATE TABLE routes (
path character varying NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- name character varying
+ name character varying,
+ namespace_id bigint
);
CREATE SEQUENCE routes_id_seq
@@ -20889,6 +21062,26 @@ CREATE SEQUENCE saml_providers_id_seq
ALTER SEQUENCE saml_providers_id_seq OWNED BY saml_providers.id;
+CREATE TABLE saved_replies (
+ id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ content text NOT NULL,
+ CONSTRAINT check_0cb57dc22a CHECK ((char_length(content) <= 10000)),
+ CONSTRAINT check_2eb3366d7f CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE saved_replies_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE saved_replies_id_seq OWNED BY saved_replies.id;
+
CREATE TABLE scim_identities (
id bigint NOT NULL,
group_id bigint NOT NULL,
@@ -20934,9 +21127,9 @@ CREATE TABLE security_findings (
confidence smallint NOT NULL,
project_fingerprint text,
deduplicated boolean DEFAULT false NOT NULL,
- "position" integer,
uuid uuid,
overridden_uuid uuid,
+ CONSTRAINT check_6c2851a8c9 CHECK ((uuid IS NOT NULL)),
CONSTRAINT check_b9508c6df8 CHECK ((char_length(project_fingerprint) <= 40))
);
@@ -20951,11 +21144,13 @@ ALTER SEQUENCE security_findings_id_seq OWNED BY security_findings.id;
CREATE TABLE security_orchestration_policy_configurations (
id bigint NOT NULL,
- project_id bigint NOT NULL,
+ project_id bigint,
security_policy_management_project_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- configured_at timestamp with time zone
+ configured_at timestamp with time zone,
+ namespace_id bigint,
+ CONSTRAINT cop_configs_project_or_namespace_existence CHECK (((project_id IS NULL) <> (namespace_id IS NULL)))
);
COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}';
@@ -21015,6 +21210,47 @@ CREATE SEQUENCE security_scans_id_seq
ALTER SEQUENCE security_scans_id_seq OWNED BY security_scans.id;
+CREATE TABLE security_training_providers (
+ id bigint NOT NULL,
+ name text NOT NULL,
+ description text,
+ url text NOT NULL,
+ logo_url text,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_544b3dc935 CHECK ((char_length(url) <= 512)),
+ CONSTRAINT check_6fe222f071 CHECK ((char_length(logo_url) <= 512)),
+ CONSTRAINT check_a8ff21ced5 CHECK ((char_length(description) <= 512)),
+ CONSTRAINT check_dae433eed6 CHECK ((char_length(name) <= 256))
+);
+
+CREATE SEQUENCE security_training_providers_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE security_training_providers_id_seq OWNED BY security_training_providers.id;
+
+CREATE TABLE security_trainings (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ provider_id bigint NOT NULL,
+ is_primary boolean DEFAULT false NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE security_trainings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE security_trainings_id_seq OWNED BY security_trainings.id;
+
CREATE TABLE self_managed_prometheus_alert_events (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -21310,7 +21546,7 @@ CREATE TABLE sprints (
group_id bigint,
iid integer NOT NULL,
cached_markdown_version integer,
- title text NOT NULL,
+ title text,
title_html text,
description text,
description_html text,
@@ -21335,7 +21571,8 @@ CREATE TABLE status_check_responses (
merge_request_id bigint NOT NULL,
external_approval_rule_id bigint,
sha bytea NOT NULL,
- external_status_check_id bigint NOT NULL
+ external_status_check_id bigint NOT NULL,
+ status smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE status_check_responses_id_seq
@@ -21567,7 +21804,7 @@ CREATE TABLE timelogs (
updated_at timestamp without time zone NOT NULL,
issue_id integer,
merge_request_id integer,
- spent_at timestamp with time zone,
+ spent_at timestamp with time zone DEFAULT now(),
note_id integer,
project_id integer,
summary text,
@@ -21635,6 +21872,7 @@ CREATE TABLE topics (
avatar text,
description text,
total_projects_count bigint DEFAULT 0 NOT NULL,
+ non_private_projects_count bigint DEFAULT 0 NOT NULL,
CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)),
CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)),
CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255))
@@ -21814,7 +22052,7 @@ CREATE TABLE user_credit_card_validations (
network text,
CONSTRAINT check_1765e2b30f CHECK ((char_length(network) <= 32)),
CONSTRAINT check_3eea080c91 CHECK (((last_digits >= 0) AND (last_digits <= 9999))),
- CONSTRAINT check_eafe45d88b CHECK ((char_length(holder_name) <= 26))
+ CONSTRAINT check_cc0c8dc0fe CHECK ((char_length(holder_name) <= 50))
);
CREATE TABLE user_custom_attributes (
@@ -21847,8 +22085,9 @@ CREATE TABLE user_details (
pronunciation text,
registration_objective smallint,
phone text,
+ requires_credit_card_verification boolean DEFAULT false NOT NULL,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
- CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)),
+ CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 50)),
CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100)),
CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)),
CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255))
@@ -21944,7 +22183,11 @@ CREATE TABLE user_preferences (
experience_level smallint,
view_diffs_file_by_file boolean DEFAULT false NOT NULL,
gitpod_enabled boolean DEFAULT false NOT NULL,
- markdown_surround_selection boolean DEFAULT true NOT NULL
+ markdown_surround_selection boolean DEFAULT true NOT NULL,
+ diffs_deletion_color text,
+ diffs_addition_color text,
+ CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)),
+ CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7))
);
CREATE SEQUENCE user_preferences_id_seq
@@ -22080,6 +22323,7 @@ CREATE TABLE users (
role smallint,
user_type smallint,
static_object_token_encrypted text,
+ otp_secret_expires_at timestamp with time zone,
CONSTRAINT check_7bde697e8e CHECK ((char_length(static_object_token_encrypted) <= 255))
);
@@ -22279,140 +22523,12 @@ CREATE SEQUENCE vulnerability_feedback_id_seq
ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id;
-CREATE TABLE vulnerability_finding_evidence_assets (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- type text,
- name text,
- url text,
- CONSTRAINT check_5adf5d69de CHECK ((char_length(type) <= 2048)),
- CONSTRAINT check_839f29d7ca CHECK ((char_length(name) <= 2048)),
- CONSTRAINT check_9272d912c0 CHECK ((char_length(url) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_assets_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_assets_id_seq OWNED BY vulnerability_finding_evidence_assets.id;
-
-CREATE TABLE vulnerability_finding_evidence_headers (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_request_id bigint,
- vulnerability_finding_evidence_response_id bigint,
- name text NOT NULL,
- value text NOT NULL,
- CONSTRAINT check_01d21e8d92 CHECK ((char_length(name) <= 255)),
- CONSTRAINT check_3f9011f903 CHECK ((char_length(value) <= 8192))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_headers_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_headers_id_seq OWNED BY vulnerability_finding_evidence_headers.id;
-
-CREATE TABLE vulnerability_finding_evidence_requests (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint,
- method text,
- url text,
- body text,
- vulnerability_finding_evidence_supporting_message_id bigint,
- CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)),
- CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)),
- CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_requests_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_requests_id_seq OWNED BY vulnerability_finding_evidence_requests.id;
-
-CREATE TABLE vulnerability_finding_evidence_responses (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint,
- status_code integer,
- reason_phrase text,
- body text,
- vulnerability_finding_evidence_supporting_message_id bigint,
- CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)),
- CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id;
-
-CREATE TABLE vulnerability_finding_evidence_sources (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- name text,
- url text,
- CONSTRAINT check_0fe01298d6 CHECK ((char_length(url) <= 2048)),
- CONSTRAINT check_86b537ba1a CHECK ((char_length(name) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_sources_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_sources_id_seq OWNED BY vulnerability_finding_evidence_sources.id;
-
-CREATE TABLE vulnerability_finding_evidence_supporting_messages (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- name text,
- CONSTRAINT check_fa33b9ae85 CHECK ((char_length(name) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq OWNED BY vulnerability_finding_evidence_supporting_messages.id;
-
CREATE TABLE vulnerability_finding_evidences (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
vulnerability_occurrence_id bigint NOT NULL,
- summary text,
- data jsonb DEFAULT '{}'::jsonb NOT NULL,
- CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000))
+ data jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE SEQUENCE vulnerability_finding_evidences_id_seq
@@ -22650,7 +22766,9 @@ CREATE TABLE vulnerability_reads (
resolved_on_default_branch boolean DEFAULT false NOT NULL,
uuid uuid NOT NULL,
location_image text,
- CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048))
+ cluster_agent_id text,
+ CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)),
+ CONSTRAINT check_a105eb825a CHECK ((char_length(cluster_agent_id) <= 10))
);
CREATE SEQUENCE vulnerability_reads_id_seq
@@ -22988,6 +23106,8 @@ ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextva
ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass);
+ALTER TABLE ONLY alert_management_alert_metric_images ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_metric_images_id_seq'::regclass);
+
ALTER TABLE ONLY alert_management_alert_user_mentions ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_user_mentions_id_seq'::regclass);
ALTER TABLE ONLY alert_management_alerts ALTER COLUMN id SET DEFAULT nextval('alert_management_alerts_id_seq'::regclass);
@@ -23182,6 +23302,8 @@ ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_s
ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass);
+ALTER TABLE ONLY ci_secure_files ALTER COLUMN id SET DEFAULT nextval('ci_secure_files_id_seq'::regclass);
+
ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass);
ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass);
@@ -23406,6 +23528,8 @@ ALTER TABLE ONLY gpg_signatures ALTER COLUMN id SET DEFAULT nextval('gpg_signatu
ALTER TABLE ONLY grafana_integrations ALTER COLUMN id SET DEFAULT nextval('grafana_integrations_id_seq'::regclass);
+ALTER TABLE ONLY group_crm_settings ALTER COLUMN group_id SET DEFAULT nextval('group_crm_settings_group_id_seq'::regclass);
+
ALTER TABLE ONLY group_custom_attributes ALTER COLUMN id SET DEFAULT nextval('group_custom_attributes_id_seq'::regclass);
ALTER TABLE ONLY group_deploy_keys ALTER COLUMN id SET DEFAULT nextval('group_deploy_keys_id_seq'::regclass);
@@ -23654,8 +23778,6 @@ ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('p
ALTER TABLE ONLY pages_domains ALTER COLUMN id SET DEFAULT nextval('pages_domains_id_seq'::regclass);
-ALTER TABLE ONLY partitioned_foreign_keys ALTER COLUMN id SET DEFAULT nextval('partitioned_foreign_keys_id_seq'::regclass);
-
ALTER TABLE ONLY path_locks ALTER COLUMN id SET DEFAULT nextval('path_locks_id_seq'::regclass);
ALTER TABLE ONLY personal_access_tokens ALTER COLUMN id SET DEFAULT nextval('personal_access_tokens_id_seq'::regclass);
@@ -23680,6 +23802,8 @@ ALTER TABLE ONLY project_aliases ALTER COLUMN id SET DEFAULT nextval('project_al
ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('project_auto_devops_id_seq'::regclass);
+ALTER TABLE ONLY project_build_artifacts_size_refreshes ALTER COLUMN id SET DEFAULT nextval('project_build_artifacts_size_refreshes_id_seq'::regclass);
+
ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass);
ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('project_ci_feature_usages_id_seq'::regclass);
@@ -23734,6 +23858,8 @@ ALTER TABLE ONLY protected_branch_unprotect_access_levels ALTER COLUMN id SET DE
ALTER TABLE ONLY protected_branches ALTER COLUMN id SET DEFAULT nextval('protected_branches_id_seq'::regclass);
+ALTER TABLE ONLY protected_environment_approval_rules ALTER COLUMN id SET DEFAULT nextval('protected_environment_approval_rules_id_seq'::regclass);
+
ALTER TABLE ONLY protected_environment_deploy_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_environment_deploy_access_levels_id_seq'::regclass);
ALTER TABLE ONLY protected_environments ALTER COLUMN id SET DEFAULT nextval('protected_environments_id_seq'::regclass);
@@ -23748,6 +23874,8 @@ ALTER TABLE ONLY raw_usage_data ALTER COLUMN id SET DEFAULT nextval('raw_usage_d
ALTER TABLE ONLY redirect_routes ALTER COLUMN id SET DEFAULT nextval('redirect_routes_id_seq'::regclass);
+ALTER TABLE ONLY related_epic_links ALTER COLUMN id SET DEFAULT nextval('related_epic_links_id_seq'::regclass);
+
ALTER TABLE ONLY release_links ALTER COLUMN id SET DEFAULT nextval('release_links_id_seq'::regclass);
ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass);
@@ -23778,6 +23906,8 @@ ALTER TABLE ONLY saml_group_links ALTER COLUMN id SET DEFAULT nextval('saml_grou
ALTER TABLE ONLY saml_providers ALTER COLUMN id SET DEFAULT nextval('saml_providers_id_seq'::regclass);
+ALTER TABLE ONLY saved_replies ALTER COLUMN id SET DEFAULT nextval('saved_replies_id_seq'::regclass);
+
ALTER TABLE ONLY scim_identities ALTER COLUMN id SET DEFAULT nextval('scim_identities_id_seq'::regclass);
ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_id_seq'::regclass);
@@ -23790,6 +23920,10 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SE
ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass);
+ALTER TABLE ONLY security_training_providers ALTER COLUMN id SET DEFAULT nextval('security_training_providers_id_seq'::regclass);
+
+ALTER TABLE ONLY security_trainings ALTER COLUMN id SET DEFAULT nextval('security_trainings_id_seq'::regclass);
+
ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass);
ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass);
@@ -23892,18 +24026,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT
ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass);
-ALTER TABLE ONLY vulnerability_finding_evidence_assets ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_assets_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_sources ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_sources_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_supporting_messages_id_seq'::regclass);
-
ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass);
@@ -23964,21 +24086,6 @@ ALTER TABLE ONLY audit_events
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_000000
ADD CONSTRAINT audit_events_000000_pkey PRIMARY KEY (id, created_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202212
- ADD CONSTRAINT audit_events_202212_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202301
- ADD CONSTRAINT audit_events_202301_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202302
- ADD CONSTRAINT audit_events_202302_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202303
- ADD CONSTRAINT audit_events_202303_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202304
- ADD CONSTRAINT audit_events_202304_pkey PRIMARY KEY (id, created_at);
-
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305
ADD CONSTRAINT audit_events_202305_pkey PRIMARY KEY (id, created_at);
@@ -23994,18 +24101,18 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202308
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202309
ADD CONSTRAINT audit_events_202309_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202310
+ ADD CONSTRAINT audit_events_202310_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202311
+ ADD CONSTRAINT audit_events_202311_pkey PRIMARY KEY (id, created_at);
+
ALTER TABLE ONLY batched_background_migration_job_transition_logs
ADD CONSTRAINT batched_background_migration_job_transition_logs_pkey PRIMARY KEY (id, created_at);
ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000
ADD CONSTRAINT batched_background_migration_job_transition_logs_000000_pkey PRIMARY KEY (id, created_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303
- ADD CONSTRAINT batched_background_migration_job_transition_logs_202303_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304
- ADD CONSTRAINT batched_background_migration_job_transition_logs_202304_pkey PRIMARY KEY (id, created_at);
-
ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305
ADD CONSTRAINT batched_background_migration_job_transition_logs_202305_pkey PRIMARY KEY (id, created_at);
@@ -24021,26 +24128,17 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_tran
ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309
ADD CONSTRAINT batched_background_migration_job_transition_logs_202309_pkey PRIMARY KEY (id, created_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211
- ADD CONSTRAINT incident_management_pending_alert_escalations_202211_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202310
+ ADD CONSTRAINT batched_background_migration_job_transition_logs_202310_pkey PRIMARY KEY (id, created_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212
- ADD CONSTRAINT incident_management_pending_alert_escalations_202212_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202311
+ ADD CONSTRAINT batched_background_migration_job_transition_logs_202311_pkey PRIMARY KEY (id, created_at);
ALTER TABLE ONLY incident_management_pending_alert_escalations
ADD CONSTRAINT incident_management_pending_alert_escalations_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301
- ADD CONSTRAINT incident_management_pending_alert_escalations_202301_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302
- ADD CONSTRAINT incident_management_pending_alert_escalations_202302_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303
- ADD CONSTRAINT incident_management_pending_alert_escalations_202303_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304
- ADD CONSTRAINT incident_management_pending_alert_escalations_202304_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000
+ ADD CONSTRAINT incident_management_pending_alert_escalations_000000_pkey PRIMARY KEY (id, process_at);
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305
ADD CONSTRAINT incident_management_pending_alert_escalations_202305_pkey PRIMARY KEY (id, process_at);
@@ -24057,26 +24155,17 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_esc
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309
ADD CONSTRAINT incident_management_pending_alert_escalations_202309_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211
- ADD CONSTRAINT incident_management_pending_issue_escalations_202211_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202310_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212
- ADD CONSTRAINT incident_management_pending_issue_escalations_202212_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202311_pkey PRIMARY KEY (id, process_at);
ALTER TABLE ONLY incident_management_pending_issue_escalations
ADD CONSTRAINT incident_management_pending_issue_escalations_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301
- ADD CONSTRAINT incident_management_pending_issue_escalations_202301_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302
- ADD CONSTRAINT incident_management_pending_issue_escalations_202302_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303
- ADD CONSTRAINT incident_management_pending_issue_escalations_202303_pkey PRIMARY KEY (id, process_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304
- ADD CONSTRAINT incident_management_pending_issue_escalations_202304_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000
+ ADD CONSTRAINT incident_management_pending_issue_escalations_000000_pkey PRIMARY KEY (id, process_at);
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305
ADD CONSTRAINT incident_management_pending_issue_escalations_202305_pkey PRIMARY KEY (id, process_at);
@@ -24093,18 +24182,24 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309
ADD CONSTRAINT incident_management_pending_issue_escalations_202309_pkey PRIMARY KEY (id, process_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202310_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202311_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY loose_foreign_keys_deleted_records
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id);
+
ALTER TABLE ONLY verification_codes
ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_000000
ADD CONSTRAINT verification_codes_000000_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
-ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202302
- ADD CONSTRAINT verification_codes_202302_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202303
- ADD CONSTRAINT verification_codes_202303_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
-
ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202304
ADD CONSTRAINT verification_codes_202304_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
@@ -24123,26 +24218,17 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202308
ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202309
ADD CONSTRAINT verification_codes_202309_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000
- ADD CONSTRAINT web_hook_logs_000000_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202310
+ ADD CONSTRAINT verification_codes_202310_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202311
+ ADD CONSTRAINT verification_codes_202311_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
ALTER TABLE ONLY web_hook_logs
ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202212
- ADD CONSTRAINT web_hook_logs_202212_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202301
- ADD CONSTRAINT web_hook_logs_202301_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202302
- ADD CONSTRAINT web_hook_logs_202302_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202303
- ADD CONSTRAINT web_hook_logs_202303_pkey PRIMARY KEY (id, created_at);
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202304
- ADD CONSTRAINT web_hook_logs_202304_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000
+ ADD CONSTRAINT web_hook_logs_000000_pkey PRIMARY KEY (id, created_at);
ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305
ADD CONSTRAINT web_hook_logs_202305_pkey PRIMARY KEY (id, created_at);
@@ -24159,6 +24245,12 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202308
ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202309
ADD CONSTRAINT web_hook_logs_202309_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202310
+ ADD CONSTRAINT web_hook_logs_202310_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202311
+ ADD CONSTRAINT web_hook_logs_202311_pkey PRIMARY KEY (id, created_at);
+
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events
ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
@@ -24552,12 +24644,6 @@ ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62
ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_63
ADD CONSTRAINT issue_search_data_63_pkey PRIMARY KEY (project_id, issue_id);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records
- ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id);
-
-ALTER TABLE ONLY gitlab_partitions_static.loose_foreign_keys_deleted_records_1
- ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id);
-
ALTER TABLE ONLY product_analytics_events_experimental
ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id);
@@ -24768,6 +24854,9 @@ ALTER TABLE ONLY agent_project_authorizations
ALTER TABLE ONLY alert_management_alert_assignees
ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY alert_management_alert_metric_images
+ ADD CONSTRAINT alert_management_alert_metric_images_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY alert_management_alert_user_mentions
ADD CONSTRAINT alert_management_alert_user_mentions_pkey PRIMARY KEY (id);
@@ -24780,6 +24869,9 @@ ALTER TABLE ONLY alert_management_http_integrations
ALTER TABLE ONLY allowed_email_domains
ADD CONSTRAINT allowed_email_domains_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY analytics_cycle_analytics_aggregations
+ ADD CONSTRAINT analytics_cycle_analytics_aggregations_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ADD CONSTRAINT analytics_cycle_analytics_group_stages_pkey PRIMARY KEY (id);
@@ -24954,9 +25046,6 @@ ALTER TABLE ONLY chat_teams
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
-ALTER TABLE security_findings
- ADD CONSTRAINT check_6c2851a8c9 CHECK ((uuid IS NOT NULL)) NOT VALID;
-
ALTER TABLE sprints
ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID;
@@ -24966,6 +25055,9 @@ ALTER TABLE group_import_states
ALTER TABLE sprints
ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID;
+ALTER TABLE projects
+ ADD CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL)) NOT VALID;
+
ALTER TABLE ONLY ci_build_needs
ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id);
@@ -25083,6 +25175,9 @@ ALTER TABLE ONLY ci_runners
ALTER TABLE ONLY ci_running_builds
ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_secure_files
+ ADD CONSTRAINT ci_secure_files_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id);
@@ -25455,6 +25550,9 @@ ALTER TABLE ONLY gpg_signatures
ALTER TABLE ONLY grafana_integrations
ADD CONSTRAINT grafana_integrations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY group_crm_settings
+ ADD CONSTRAINT group_crm_settings_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY group_custom_attributes
ADD CONSTRAINT group_custom_attributes_pkey PRIMARY KEY (id);
@@ -25470,6 +25568,9 @@ ALTER TABLE ONLY group_deploy_keys
ALTER TABLE ONLY group_deploy_tokens
ADD CONSTRAINT group_deploy_tokens_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY group_features
+ ADD CONSTRAINT group_features_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY group_group_links
ADD CONSTRAINT group_group_links_pkey PRIMARY KEY (id);
@@ -25890,9 +25991,6 @@ ALTER TABLE ONLY pages_domain_acme_orders
ALTER TABLE ONLY pages_domains
ADD CONSTRAINT pages_domains_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY partitioned_foreign_keys
- ADD CONSTRAINT partitioned_foreign_keys_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY path_locks
ADD CONSTRAINT path_locks_pkey PRIMARY KEY (id);
@@ -25935,6 +26033,9 @@ ALTER TABLE ONLY project_authorizations
ALTER TABLE ONLY project_auto_devops
ADD CONSTRAINT project_auto_devops_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_build_artifacts_size_refreshes
+ ADD CONSTRAINT project_build_artifacts_size_refreshes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_ci_cd_settings
ADD CONSTRAINT project_ci_cd_settings_pkey PRIMARY KEY (id);
@@ -26034,6 +26135,9 @@ ALTER TABLE ONLY protected_branch_unprotect_access_levels
ALTER TABLE ONLY protected_branches
ADD CONSTRAINT protected_branches_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY protected_environment_approval_rules
+ ADD CONSTRAINT protected_environment_approval_rules_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY protected_environment_deploy_access_levels
ADD CONSTRAINT protected_environment_deploy_access_levels_pkey PRIMARY KEY (id);
@@ -26058,9 +26162,15 @@ ALTER TABLE ONLY raw_usage_data
ALTER TABLE ONLY redirect_routes
ADD CONSTRAINT redirect_routes_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY related_epic_links
+ ADD CONSTRAINT related_epic_links_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY release_links
ADD CONSTRAINT release_links_pkey PRIMARY KEY (id);
+ALTER TABLE releases
+ ADD CONSTRAINT releases_not_null_tag CHECK ((tag IS NOT NULL)) NOT VALID;
+
ALTER TABLE ONLY releases
ADD CONSTRAINT releases_pkey PRIMARY KEY (id);
@@ -26106,6 +26216,9 @@ ALTER TABLE ONLY saml_group_links
ALTER TABLE ONLY saml_providers
ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY saved_replies
+ ADD CONSTRAINT saved_replies_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY scim_identities
ADD CONSTRAINT scim_identities_pkey PRIMARY KEY (id);
@@ -26124,6 +26237,12 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules
ALTER TABLE ONLY security_scans
ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY security_training_providers
+ ADD CONSTRAINT security_training_providers_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT security_trainings_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY self_managed_prometheus_alert_events
ADD CONSTRAINT self_managed_prometheus_alert_events_pkey PRIMARY KEY (id);
@@ -26307,24 +26426,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY vulnerability_finding_evidence_assets
- ADD CONSTRAINT vulnerability_finding_evidence_assets_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT vulnerability_finding_evidence_requests_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_sources
- ADD CONSTRAINT vulnerability_finding_evidence_sources_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
- ADD CONSTRAINT vulnerability_finding_evidence_supporting_messages_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id);
@@ -26411,26 +26512,6 @@ CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONL
CREATE INDEX audit_events_000000_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-CREATE INDEX audit_events_202212_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (created_at, author_id);
-
-CREATE INDEX audit_events_202212_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-
-CREATE INDEX audit_events_202301_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (created_at, author_id);
-
-CREATE INDEX audit_events_202301_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-
-CREATE INDEX audit_events_202302_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (created_at, author_id);
-
-CREATE INDEX audit_events_202302_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-
-CREATE INDEX audit_events_202303_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (created_at, author_id);
-
-CREATE INDEX audit_events_202303_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-
-CREATE INDEX audit_events_202304_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (created_at, author_id);
-
-CREATE INDEX audit_events_202304_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-
CREATE INDEX audit_events_202305_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (created_at, author_id);
CREATE INDEX audit_events_202305_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
@@ -26451,146 +26532,130 @@ CREATE INDEX audit_events_202309_created_at_author_id_idx ON gitlab_partitions_d
CREATE INDEX audit_events_202309_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202309 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id ON ONLY batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id);
+CREATE INDEX audit_events_202310_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202310 USING btree (created_at, author_id);
-CREATE INDEX batched_background_migration__batched_background_migration__idx ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 USING btree (batched_background_migration_job_id);
+CREATE INDEX audit_events_202310_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202310 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
+
+CREATE INDEX audit_events_202311_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202311 USING btree (created_at, author_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx1 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 USING btree (batched_background_migration_job_id);
+CREATE INDEX audit_events_202311_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202311 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-CREATE INDEX batched_background_migration__batched_background_migration_idx2 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 USING btree (batched_background_migration_job_id);
+CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id ON ONLY batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx3 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 USING btree (batched_background_migration_job_id);
+CREATE INDEX batched_background_migration__batched_background_migration__idx ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 USING btree (batched_background_migration_job_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx4 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 USING btree (batched_background_migration_job_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx1 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 USING btree (batched_background_migration_job_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx5 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 USING btree (batched_background_migration_job_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx2 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 USING btree (batched_background_migration_job_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx6 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 USING btree (batched_background_migration_job_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx3 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 USING btree (batched_background_migration_job_id);
-CREATE INDEX batched_background_migration__batched_background_migration_idx7 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 USING btree (batched_background_migration_job_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx4 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 USING btree (batched_background_migration_job_id);
-CREATE INDEX incident_management_pending_alert_escalations_20221_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (rule_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx5 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 USING btree (batched_background_migration_job_id);
-CREATE INDEX incident_management_pending_alert_escalations_2022_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (alert_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx6 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202310 USING btree (batched_background_migration_job_id);
-CREATE INDEX incident_management_pending_alert_escalations_2022_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (rule_id);
+CREATE INDEX batched_background_migration__batched_background_migration_idx7 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202311 USING btree (batched_background_migration_job_id);
CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id ON ONLY incident_management_pending_alert_escalations USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_00000_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000 USING btree (rule_id);
CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id ON ONLY incident_management_pending_alert_escalations USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_0000_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_20231_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311 USING btree (rule_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (alert_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310 USING btree (alert_id);
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (alert_id);
-
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (alert_id);
-
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (alert_id);
-
-CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx9 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 USING btree (alert_id);
-
-CREATE INDEX incident_management_pending_issue_escalations_20221_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 USING btree (rule_id);
-
-CREATE INDEX incident_management_pending_issue_escalations_2022_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 USING btree (issue_id);
-
-CREATE INDEX incident_management_pending_issue_escalations_2022_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 USING btree (rule_id);
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311 USING btree (alert_id);
CREATE INDEX index_incident_management_pending_issue_escalations_on_rule_id ON ONLY incident_management_pending_issue_escalations USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_00000_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000 USING btree (rule_id);
CREATE INDEX index_incident_management_pending_issue_escalations_on_issue_id ON ONLY incident_management_pending_issue_escalations USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_0000_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_20231_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 USING btree (rule_id);
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311 USING btree (rule_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (issue_id);
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311 USING btree (issue_id);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (issue_id);
+CREATE INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ON ONLY loose_foreign_keys_deleted_records USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (issue_id);
+CREATE INDEX index_01e3390fac ON gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1);
-CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx9 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 USING btree (issue_id);
+CREATE INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ON ONLY web_hook_logs USING btree (created_at, web_hook_id);
-CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id);
+CREATE INDEX index_2eb8964745 ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (created_at, web_hook_id);
-CREATE INDEX index_1554dc6f11 ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (web_hook_id);
+CREATE INDEX index_7185e24460 ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (created_at, web_hook_id);
-CREATE INDEX index_719c6187cb ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (web_hook_id);
+CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id);
-CREATE INDEX index_80bf138a51 ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (web_hook_id);
+CREATE INDEX index_7a0f3a9930 ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (web_hook_id);
-CREATE INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ON ONLY web_hook_logs USING btree (created_at, web_hook_id);
+CREATE INDEX index_80bf138a51 ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (web_hook_id);
-CREATE INDEX index_962081978f ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (created_at, web_hook_id);
+CREATE INDEX index_a548862389 ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id);
CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (created_at, web_hook_id);
-CREATE INDEX index_fdb8d5eeea ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (created_at, web_hook_id);
-
CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON ONLY verification_codes USING btree (visitor_id_code, phone, created_at);
COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index';
CREATE UNIQUE INDEX verification_codes_000000_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_000000 USING btree (visitor_id_code, phone, created_at);
-CREATE UNIQUE INDEX verification_codes_202302_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202302 USING btree (visitor_id_code, phone, created_at);
-
-CREATE UNIQUE INDEX verification_codes_202303_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202303 USING btree (visitor_id_code, phone, created_at);
-
CREATE UNIQUE INDEX verification_codes_202304_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202304 USING btree (visitor_id_code, phone, created_at);
CREATE UNIQUE INDEX verification_codes_202305_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202305 USING btree (visitor_id_code, phone, created_at);
@@ -26603,25 +26668,9 @@ CREATE UNIQUE INDEX verification_codes_202308_visitor_id_code_phone_created_at_i
CREATE UNIQUE INDEX verification_codes_202309_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202309 USING btree (visitor_id_code, phone, created_at);
-CREATE INDEX web_hook_logs_202302_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (created_at, web_hook_id);
-
-CREATE INDEX web_hook_logs_202302_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (web_hook_id);
-
-CREATE INDEX web_hook_logs_202303_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (created_at, web_hook_id);
-
-CREATE INDEX web_hook_logs_202303_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (web_hook_id);
-
-CREATE INDEX web_hook_logs_202304_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (created_at, web_hook_id);
-
-CREATE INDEX web_hook_logs_202304_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (web_hook_id);
-
-CREATE INDEX web_hook_logs_202305_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (created_at, web_hook_id);
-
-CREATE INDEX web_hook_logs_202305_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (web_hook_id);
-
-CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (created_at, web_hook_id);
+CREATE UNIQUE INDEX verification_codes_202310_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202310 USING btree (visitor_id_code, phone, created_at);
-CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id);
+CREATE UNIQUE INDEX verification_codes_202311_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202311 USING btree (visitor_id_code, phone, created_at);
CREATE INDEX web_hook_logs_202307_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202307 USING btree (created_at, web_hook_id);
@@ -26635,6 +26684,14 @@ CREATE INDEX web_hook_logs_202309_created_at_web_hook_id_idx ON gitlab_partition
CREATE INDEX web_hook_logs_202309_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202309 USING btree (web_hook_id);
+CREATE INDEX web_hook_logs_202310_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202310 USING btree (created_at, web_hook_id);
+
+CREATE INDEX web_hook_logs_202310_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202310 USING btree (web_hook_id);
+
+CREATE INDEX web_hook_logs_202311_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202311 USING btree (created_at, web_hook_id);
+
+CREATE INDEX web_hook_logs_202311_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202311 USING btree (web_hook_id);
+
CREATE INDEX index_issue_stage_events_project_duration ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_000925dbd7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -26643,10 +26700,6 @@ CREATE INDEX index_merge_request_stage_events_project_duration ON ONLY analytics
CREATE INDEX index_006f943df6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
-CREATE INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ON ONLY loose_foreign_keys_deleted_records USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1);
-
-CREATE INDEX index_01e3390fac ON gitlab_partitions_static.loose_foreign_keys_deleted_records_1 USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1);
-
CREATE INDEX index_02749b504c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_merge_request_stage_events_group_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -27571,12 +27624,16 @@ CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_r
CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation);
+CREATE INDEX ca_aggregations_last_consistency_check_updated_at ON analytics_cycle_analytics_aggregations USING btree (last_consistency_check_updated_at NULLS FIRST) WHERE (enabled IS TRUE);
+
+CREATE INDEX ca_aggregations_last_full_run_at ON analytics_cycle_analytics_aggregations USING btree (last_full_run_at NULLS FIRST) WHERE (enabled IS TRUE);
+
+CREATE INDEX ca_aggregations_last_incremental_run_at ON analytics_cycle_analytics_aggregations USING btree (last_incremental_run_at NULLS FIRST) WHERE (enabled IS TRUE);
+
CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING btree (automatic, duration_in_weeks, date((COALESCE(last_run_date, '1970-01-01'::date) + ((duration_in_weeks)::double precision * '7 days'::interval)))) WHERE (duration_in_weeks IS NOT NULL);
CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
-CREATE INDEX ci_job_artifacts_expire_at_unlocked_idx ON ci_job_artifacts USING btree (expire_at) WHERE (locked = 0);
-
CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true);
CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index ON commit_user_mentions USING btree (commit_id, note_id);
@@ -27595,25 +27652,11 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL);
-CREATE INDEX finding_evidence_assets_on_finding_evidence_id ON vulnerability_finding_evidence_assets USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id);
-
-CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id);
-
-CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_requests_on_supporting_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_supporting_message_id);
-
-CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_responses_on_supporting_evidence_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_supporting_message_id);
-
-CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_finding_evidence_sources USING btree (vulnerability_finding_evidence_id);
+CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
-CREATE INDEX finding_evidence_supporting_messages_on_finding_evidence_id ON vulnerability_finding_evidence_supporting_messages USING btree (vulnerability_finding_evidence_id);
+CREATE UNIQUE INDEX finding_link_name_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, name, url);
-CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
+CREATE UNIQUE INDEX finding_link_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, url) WHERE (name IS NULL);
CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
@@ -27625,6 +27668,8 @@ CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devo
CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id);
+CREATE INDEX idx_build_artifacts_size_refreshes_state_updated_at ON project_build_artifacts_size_refreshes USING btree (state, updated_at);
+
CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1);
CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_expiration_policies USING btree (project_id, next_run_at) WHERE (enabled = true);
@@ -27633,6 +27678,14 @@ CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON con
CREATE INDEX idx_container_repos_on_exp_cleanup_status_project_id_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, project_id, expiration_policy_started_at);
+CREATE INDEX idx_container_repos_on_import_started_at_when_importing ON container_repositories USING btree (migration_import_started_at) WHERE (migration_state = 'importing'::text);
+
+CREATE INDEX idx_container_repos_on_migration_state_migration_plan_created ON container_repositories USING btree (migration_state, migration_plan, created_at);
+
+CREATE INDEX idx_container_repos_on_pre_import_done_at_when_pre_import_done ON container_repositories USING btree (migration_pre_import_done_at) WHERE (migration_state = 'pre_import_done'::text);
+
+CREATE INDEX idx_container_repos_on_pre_import_started_at_when_pre_importing ON container_repositories USING btree (migration_pre_import_started_at) WHERE (migration_state = 'pre_importing'::text);
+
CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace);
CREATE INDEX idx_devops_adoption_segments_namespace_end_time ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time);
@@ -27649,6 +27702,8 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_me
CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id);
+CREATE INDEX idx_installable_conan_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id) WHERE ((package_type = 3) AND (status = ANY (ARRAY[0, 1])));
+
CREATE INDEX idx_installable_helm_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id);
CREATE INDEX idx_installable_npm_pkgs_on_project_id_name_version_id ON packages_packages USING btree (project_id, name, version, id) WHERE ((package_type = 2) AND (status = 0));
@@ -27701,12 +27756,16 @@ CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_external_url ON ext
CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_name ON external_status_checks USING btree (project_id, name);
-CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id);
-
CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id);
CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON packages_debian_project_component_files USING btree (architecture_id);
+CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 7) AND (status <> 4));
+
+CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 8) AND (status <> 4));
+
+CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 11) AND (status <> 4));
+
CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type);
CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id);
@@ -27723,6 +27782,12 @@ CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_eve
CREATE INDEX idx_project_repository_check_partial ON projects USING btree (repository_storage, created_at) WHERE (last_repository_check_at IS NULL);
+CREATE INDEX idx_projects_api_created_at_id_for_archived ON projects USING btree (created_at, id) WHERE ((archived = true) AND (pending_delete = false) AND (hidden = false));
+
+CREATE INDEX idx_projects_api_created_at_id_for_archived_vis20 ON projects USING btree (created_at, id) WHERE ((archived = true) AND (visibility_level = 20) AND (pending_delete = false) AND (hidden = false));
+
+CREATE INDEX idx_projects_api_created_at_id_for_vis10 ON projects USING btree (created_at, id) WHERE ((visibility_level = 10) AND (pending_delete = false) AND (hidden = false));
+
CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_false ON projects USING btree (id, created_at) WHERE ((disable_overriding_approvers_per_merge_request = false) OR (disable_overriding_approvers_per_merge_request IS NULL));
CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_true ON projects USING btree (id, created_at) WHERE (disable_overriding_approvers_per_merge_request = true);
@@ -27747,6 +27812,8 @@ CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan
CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id);
+CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id);
+
CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha);
CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha);
@@ -27761,6 +27828,8 @@ CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_issue_
CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_link_type ON vulnerability_issue_links USING btree (vulnerability_id, link_type) WHERE (link_type = 2);
+CREATE UNIQUE INDEX idx_work_item_types_on_namespace_id_and_name_null_namespace ON work_item_types USING btree (btrim(lower(name)), ((namespace_id IS NULL))) WHERE (namespace_id IS NULL);
+
CREATE INDEX index_abuse_reports_on_user_id ON abuse_reports USING btree (user_id);
CREATE INDEX index_agent_activity_events_on_agent_id_and_recorded_at_and_id ON agent_activity_events USING btree (agent_id, recorded_at, id);
@@ -27785,6 +27854,8 @@ CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assigne
CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id);
+CREATE INDEX index_alert_management_alert_metric_images_on_alert_id ON alert_management_alert_metric_images USING btree (alert_id);
+
CREATE INDEX index_alert_management_alerts_on_domain ON alert_management_alerts USING btree (domain);
CREATE INDEX index_alert_management_alerts_on_environment_id ON alert_management_alerts USING btree (environment_id) WHERE (environment_id IS NOT NULL);
@@ -27885,7 +27956,9 @@ CREATE UNIQUE INDEX index_approval_rule_name_for_code_owners_rule_type ON approv
CREATE UNIQUE INDEX index_approval_rule_name_for_sectional_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, name, section) WHERE (rule_type = 2);
-CREATE INDEX index_approval_rules_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, rule_type) WHERE (rule_type = 2);
+CREATE INDEX index_approval_rule_on_protected_environment_id ON protected_environment_approval_rules USING btree (protected_environment_id);
+
+CREATE INDEX index_approval_rules_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id) WHERE (rule_type = 2);
CREATE INDEX index_approvals_on_merge_request_id ON approvals USING btree (merge_request_id);
@@ -27903,6 +27976,8 @@ CREATE INDEX index_approvers_on_user_id ON approvers USING btree (user_id);
CREATE UNIQUE INDEX index_atlassian_identities_on_extern_uid ON atlassian_identities USING btree (extern_uid);
+CREATE UNIQUE INDEX index_audit_events_external_audit_on_verification_token ON audit_events_external_audit_event_destinations USING btree (verification_token);
+
CREATE INDEX index_authentication_events_on_provider ON authentication_events USING btree (provider);
CREATE INDEX index_authentication_events_on_provider_user_id_created_at ON authentication_events USING btree (provider, user_id, created_at) WHERE (result = 1);
@@ -27925,6 +28000,8 @@ CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id);
CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id);
+CREATE INDEX index_batched_background_migrations_on_status ON batched_background_migrations USING btree (status);
+
CREATE UNIQUE INDEX index_batched_background_migrations_on_unique_configuration ON batched_background_migrations USING btree (job_class_name, table_name, column_name, job_arguments);
CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id);
@@ -28121,10 +28198,16 @@ CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts
CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts USING btree (expire_at, job_id);
+CREATE INDEX index_ci_job_artifacts_on_expire_at_for_removal ON ci_job_artifacts USING btree (expire_at) WHERE ((locked = 0) AND (expire_at IS NOT NULL));
+
CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store);
CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23]));
+CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_created_at ON ci_job_artifacts USING btree (project_id, created_at, id);
+
+CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_file_type ON ci_job_artifacts USING btree (project_id, file_type, id);
+
CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type);
CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id);
@@ -28143,6 +28226,8 @@ CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON c
CREATE UNIQUE INDEX index_ci_namespace_mirrors_on_namespace_id ON ci_namespace_mirrors USING btree (namespace_id);
+CREATE INDEX index_ci_namespace_mirrors_on_traversal_ids_unnest ON ci_namespace_mirrors USING btree ((traversal_ids[1]), (traversal_ids[2]), (traversal_ids[3]), (traversal_ids[4])) INCLUDE (traversal_ids, namespace_id);
+
CREATE UNIQUE INDEX index_ci_namespace_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date);
CREATE INDEX index_ci_pending_builds_id_on_protected_partial ON ci_pending_builds USING btree (id) WHERE (protected = true);
@@ -28231,6 +28316,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipel
CREATE INDEX index_ci_pipelines_on_user_id_and_id_and_cancelable_status ON ci_pipelines USING btree (user_id, id) WHERE ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('waiting_for_resource'::character varying)::text, ('preparing'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text, ('scheduled'::character varying)::text]));
+CREATE INDEX index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified ON ci_pipelines USING btree (user_id, id DESC) WHERE (failure_reason = 3);
+
CREATE INDEX index_ci_project_mirrors_on_namespace_id ON ci_project_mirrors USING btree (namespace_id);
CREATE UNIQUE INDEX index_ci_project_mirrors_on_project_id ON ci_project_mirrors USING btree (project_id);
@@ -28251,14 +28338,18 @@ CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON
CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING btree (project_id);
-CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id);
+CREATE INDEX index_ci_runners_on_active ON ci_runners USING btree (active, id);
CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC);
+CREATE INDEX index_ci_runners_on_contacted_at_and_id_where_inactive ON ci_runners USING btree (contacted_at DESC, id DESC) WHERE (active = false);
+
CREATE INDEX index_ci_runners_on_contacted_at_desc_and_id_desc ON ci_runners USING btree (contacted_at DESC, id DESC);
CREATE INDEX index_ci_runners_on_created_at_and_id_desc ON ci_runners USING btree (created_at, id DESC);
+CREATE INDEX index_ci_runners_on_created_at_and_id_where_inactive ON ci_runners USING btree (created_at DESC, id DESC) WHERE (active = false);
+
CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC);
CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops);
@@ -28271,12 +28362,18 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token);
CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted);
+CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USING btree (token_expires_at, id DESC);
+
+CREATE INDEX index_ci_runners_on_token_expires_at_desc_and_id_desc ON ci_runners USING btree (token_expires_at DESC, id DESC);
+
CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id);
CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id);
CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id);
+CREATE INDEX index_ci_secure_files_on_project_id ON ci_secure_files USING btree (project_id);
+
CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id);
CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id);
@@ -28321,7 +28418,7 @@ CREATE INDEX index_ci_variables_on_key ON ci_variables USING btree (key);
CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_scope ON ci_variables USING btree (project_id, key, environment_scope);
-CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST);
+CREATE INDEX index_cluster_agent_tokens_on_agent_id_status_last_used_at ON cluster_agent_tokens USING btree (agent_id, status, last_used_at DESC NULLS LAST);
CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id);
@@ -28377,8 +28474,6 @@ CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integra
CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id);
-CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_id ON clusters_kubernetes_namespaces USING btree (cluster_id);
-
CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id);
CREATE INDEX index_clusters_kubernetes_namespaces_on_environment_id ON clusters_kubernetes_namespaces USING btree (environment_id);
@@ -28401,6 +28496,10 @@ CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_c
CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled);
+CREATE INDEX index_container_repositories_on_greatest_completed_at ON container_repositories USING btree (GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at, migration_skipped_at)) WHERE (migration_state = ANY (ARRAY['import_done'::text, 'pre_import_done'::text, 'import_aborted'::text, 'import_skipped'::text]));
+
+CREATE INDEX index_container_repositories_on_migration_state_import_done_at ON container_repositories USING btree (migration_state, migration_import_done_at);
+
CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id);
CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repositories USING btree (project_id, id);
@@ -28431,7 +28530,7 @@ CREATE INDEX index_customer_relations_contacts_on_group_id ON customer_relations
CREATE INDEX index_customer_relations_contacts_on_organization_id ON customer_relations_contacts USING btree (organization_id);
-CREATE UNIQUE INDEX index_customer_relations_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name));
+CREATE UNIQUE INDEX index_customer_relations_contacts_on_unique_email_per_group ON customer_relations_contacts USING btree (group_id, lower(email), id);
CREATE UNIQUE INDEX index_cycle_analytics_stage_event_hashes_on_hash_sha_256 ON analytics_cycle_analytics_stage_event_hashes USING btree (hash_sha256);
@@ -28495,12 +28594,16 @@ CREATE INDEX index_deploy_keys_projects_on_deploy_key_id ON deploy_keys_projects
CREATE INDEX index_deploy_keys_projects_on_project_id ON deploy_keys_projects USING btree (project_id);
+CREATE INDEX index_deploy_tokens_on_creator_id ON deploy_tokens USING btree (creator_id);
+
CREATE UNIQUE INDEX index_deploy_tokens_on_token ON deploy_tokens USING btree (token);
CREATE INDEX index_deploy_tokens_on_token_and_expires_at_and_id ON deploy_tokens USING btree (token, expires_at, id) WHERE (revoked IS FALSE);
CREATE UNIQUE INDEX index_deploy_tokens_on_token_encrypted ON deploy_tokens USING btree (token_encrypted);
+CREATE INDEX index_deployment_approvals_on_approval_rule_id ON deployment_approvals USING btree (approval_rule_id);
+
CREATE UNIQUE INDEX index_deployment_approvals_on_deployment_id_and_user_id ON deployment_approvals USING btree (deployment_id, user_id);
CREATE INDEX index_deployment_approvals_on_user_id ON deployment_approvals USING btree (user_id);
@@ -28509,6 +28612,8 @@ CREATE UNIQUE INDEX index_deployment_clusters_on_cluster_id_and_deployment_id ON
CREATE INDEX index_deployment_merge_requests_on_merge_request_id ON deployment_merge_requests USING btree (merge_request_id);
+CREATE INDEX index_deployments_for_visible_scope ON deployments USING btree (environment_id, finished_at DESC) WHERE (status = ANY (ARRAY[1, 2, 3, 4, 6]));
+
CREATE INDEX index_deployments_on_archived_project_id_iid ON deployments USING btree (archived, project_id, iid);
CREATE INDEX index_deployments_on_cluster_id_and_status ON deployments USING btree (cluster_id, status);
@@ -28627,8 +28732,6 @@ CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards
CREATE UNIQUE INDEX index_epic_board_recent_visits_on_user_group_and_board ON boards_epic_board_recent_visits USING btree (user_id, group_id, epic_board_id);
-CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id);
-
CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id);
CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id);
@@ -28661,8 +28764,6 @@ CREATE INDEX index_epics_on_iid ON epics USING btree (iid);
CREATE INDEX index_epics_on_last_edited_by_id ON epics USING btree (last_edited_by_id);
-CREATE INDEX index_epics_on_lock_version ON epics USING btree (lock_version) WHERE (lock_version IS NULL);
-
CREATE INDEX index_epics_on_parent_id ON epics USING btree (parent_id);
CREATE INDEX index_epics_on_start_date ON epics USING btree (start_date);
@@ -28693,13 +28794,15 @@ CREATE INDEX index_et_errors_on_project_id_and_status_first_seen_at_id_desc ON e
CREATE INDEX index_et_errors_on_project_id_and_status_last_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, last_seen_at DESC, id DESC);
+CREATE INDEX index_events_author_id_project_id_action_target_type_created_at ON events USING btree (author_id, project_id, action, target_type, created_at);
+
CREATE INDEX index_events_on_action ON events USING btree (action);
CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at);
CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events USING btree (author_id, created_at) WHERE ((target_type)::text = 'MergeRequest'::text);
-CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_id);
+CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_id, id);
CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone);
@@ -28853,6 +28956,8 @@ CREATE INDEX index_grafana_integrations_on_enabled ON grafana_integrations USING
CREATE INDEX index_grafana_integrations_on_project_id ON grafana_integrations USING btree (project_id);
+CREATE INDEX index_group_crm_settings_on_group_id ON group_crm_settings USING btree (group_id);
+
CREATE UNIQUE INDEX index_group_custom_attributes_on_group_id_and_key ON group_custom_attributes USING btree (group_id, key);
CREATE INDEX index_group_custom_attributes_on_key_and_value ON group_custom_attributes USING btree (key, value);
@@ -28961,22 +29066,30 @@ CREATE INDEX index_insights_on_project_id ON insights USING btree (project_id);
CREATE INDEX index_integrations_on_inherit_from_id ON integrations USING btree (inherit_from_id);
+CREATE INDEX index_integrations_on_project_and_type_new_where_inherit_null ON integrations USING btree (project_id, type_new) WHERE (inherit_from_id IS NULL);
+
CREATE INDEX index_integrations_on_project_and_type_where_inherit_null ON integrations USING btree (project_id, type) WHERE (inherit_from_id IS NULL);
-CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_unique ON integrations USING btree (project_id, type);
+CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_new_unique ON integrations USING btree (project_id, type_new);
-CREATE INDEX index_integrations_on_template ON integrations USING btree (template);
+CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_unique ON integrations USING btree (project_id, type);
CREATE INDEX index_integrations_on_type ON integrations USING btree (type);
CREATE UNIQUE INDEX index_integrations_on_type_and_instance_partial ON integrations USING btree (type, instance) WHERE (instance = true);
-CREATE UNIQUE INDEX index_integrations_on_type_and_template_partial ON integrations USING btree (type, template) WHERE (template = true);
-
CREATE INDEX index_integrations_on_type_id_when_active_and_project_id_not_nu ON integrations USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
+CREATE INDEX index_integrations_on_type_new ON integrations USING btree (type_new);
+
+CREATE INDEX index_integrations_on_type_new_and_instance_partial ON integrations USING btree (type_new, instance) WHERE (instance = true);
+
+CREATE INDEX index_integrations_on_type_new_id_when_active_and_has_project ON integrations USING btree (type_new, id) WHERE ((active = true) AND (project_id IS NOT NULL));
+
CREATE UNIQUE INDEX index_integrations_on_unique_group_id_and_type ON integrations USING btree (group_id, type);
+CREATE INDEX index_integrations_on_unique_group_id_and_type_new ON integrations USING btree (group_id, type_new);
+
CREATE INDEX index_internal_ids_on_namespace_id ON internal_ids USING btree (namespace_id);
CREATE INDEX index_internal_ids_on_project_id ON internal_ids USING btree (project_id);
@@ -29013,8 +29126,6 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links
CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id);
-CREATE INDEX index_issue_metrics_first_mentioned_in_commit ON issue_metrics USING btree (issue_id) WHERE (date_part('year'::text, first_mentioned_in_commit_at) > (2019)::double precision);
-
CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at);
CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count);
@@ -29035,12 +29146,12 @@ CREATE INDEX index_issues_on_description_trigram ON issues USING gin (descriptio
CREATE INDEX index_issues_on_duplicated_to_id ON issues USING btree (duplicated_to_id) WHERE (duplicated_to_id IS NOT NULL);
+CREATE INDEX index_issues_on_id_and_weight ON issues USING btree (id, weight);
+
CREATE INDEX index_issues_on_incident_issue_type ON issues USING btree (issue_type) WHERE (issue_type = 1);
CREATE INDEX index_issues_on_last_edited_by_id ON issues USING btree (last_edited_by_id);
-CREATE INDEX index_issues_on_lock_version ON issues USING btree (lock_version) WHERE (lock_version IS NULL);
-
CREATE INDEX index_issues_on_milestone_id ON issues USING btree (milestone_id);
CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHERE (moved_to_id IS NOT NULL);
@@ -29067,8 +29178,6 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at);
CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL);
-CREATE INDEX index_issues_on_work_item_type_id ON issues USING btree (work_item_type_id);
-
CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id);
CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key);
@@ -29183,6 +29292,10 @@ CREATE INDEX index_members_on_invite_email ON members USING btree (invite_email)
CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite_token);
+CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member_namespace_id);
+
+CREATE INDEX index_members_on_non_requested_non_invited_and_state_awaiting ON members USING btree (source_id) WHERE ((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1));
+
CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at);
CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type);
@@ -29205,8 +29318,6 @@ CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON
CREATE INDEX index_merge_request_cleanup_schedules_on_status ON merge_request_cleanup_schedules USING btree (status);
-CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id);
-
CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email);
CREATE INDEX index_merge_request_diff_commits_on_sha ON merge_request_diff_commits USING btree (sha);
@@ -29271,8 +29382,6 @@ CREATE INDEX index_merge_requests_on_head_pipeline_id ON merge_requests USING bt
CREATE INDEX index_merge_requests_on_latest_merge_request_diff_id ON merge_requests USING btree (latest_merge_request_diff_id);
-CREATE INDEX index_merge_requests_on_lock_version ON merge_requests USING btree (lock_version) WHERE (lock_version IS NULL);
-
CREATE INDEX index_merge_requests_on_merge_user_id ON merge_requests USING btree (merge_user_id) WHERE (merge_user_id IS NOT NULL);
CREATE INDEX index_merge_requests_on_milestone_id ON merge_requests USING btree (milestone_id);
@@ -29303,8 +29412,6 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON
CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
-CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title);
-
CREATE INDEX index_merge_requests_on_title_trigram ON merge_requests USING gin (title gin_trgm_ops);
CREATE INDEX index_merge_requests_on_tp_id_and_merge_commit_sha_and_id ON merge_requests USING btree (target_project_id, merge_commit_sha, id);
@@ -29463,8 +29570,18 @@ CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USI
CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at);
+CREATE INDEX index_on_issues_closed_incidents_by_project_id_and_closed_at ON issues USING btree (project_id, closed_at) WHERE ((issue_type = 1) AND (state_id = 2));
+
CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type);
+CREATE INDEX index_on_merge_request_assignees_updated_state_by_user_id ON merge_request_assignees USING btree (updated_state_by_user_id);
+
+CREATE INDEX index_on_merge_request_assignees_user_id_and_state ON merge_request_assignees USING btree (user_id, state) WHERE (state = 2);
+
+CREATE INDEX index_on_merge_request_reviewers_updated_state_by_user_id ON merge_request_reviewers USING btree (updated_state_by_user_id);
+
+CREATE INDEX index_on_merge_request_reviewers_user_id_and_state ON merge_request_reviewers USING btree (user_id, state) WHERE (state = 2);
+
CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id);
COMMENT ON INDEX index_on_merge_requests_for_latest_diffs IS 'Index used to efficiently obtain the oldest merge request for a commit SHA';
@@ -29481,6 +29598,8 @@ CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON inciden
CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text));
+CREATE INDEX index_on_projects_path ON projects USING btree (path);
+
CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text));
CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text));
@@ -29521,8 +29640,12 @@ CREATE UNIQUE INDEX index_ops_feature_flags_issues_on_feature_flag_id_and_issue_
CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list_id ON operations_strategies_user_lists USING btree (strategy_id, user_list_id);
+CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name), id);
+
CREATE INDEX index_packages_build_infos_on_pipeline_id ON packages_build_infos USING btree (pipeline_id);
+CREATE INDEX index_packages_build_infos_package_id_pipeline_id_id ON packages_build_infos USING btree (package_id, pipeline_id, id);
+
CREATE UNIQUE INDEX index_packages_composer_cache_namespace_and_sha ON packages_composer_cache_files USING btree (namespace_id, file_sha256);
CREATE UNIQUE INDEX index_packages_composer_metadata_on_package_id_and_target_sha ON packages_composer_metadata USING btree (package_id, target_sha);
@@ -29563,12 +29686,6 @@ CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata US
CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_nuget_dependency_link_metadata USING btree (dependency_link_id);
-CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 7);
-
-CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 8);
-
-CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 11);
-
CREATE INDEX index_packages_package_file_build_infos_on_package_file_id ON packages_package_file_build_infos USING btree (package_file_id);
CREATE INDEX index_packages_package_file_build_infos_on_pipeline_id ON packages_package_file_build_infos USING btree (pipeline_id);
@@ -29579,6 +29696,10 @@ CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON package
CREATE INDEX index_packages_package_files_on_package_id_id ON packages_package_files USING btree (package_id, id);
+CREATE INDEX index_packages_package_files_on_package_id_status_and_id ON packages_package_files USING btree (package_id, status, id);
+
+CREATE INDEX index_packages_package_files_on_status ON packages_package_files USING btree (status);
+
CREATE INDEX index_packages_package_files_on_verification_state ON packages_package_files USING btree (verification_state);
CREATE INDEX index_packages_packages_on_creator_id ON packages_packages USING btree (creator_id);
@@ -29649,8 +29770,6 @@ CREATE UNIQUE INDEX index_partial_am_alerts_on_project_id_and_fingerprint ON ale
CREATE INDEX index_partial_ci_builds_on_user_id_name_parser_features ON ci_builds USING btree (user_id, name) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('secret_detection'::character varying)::text])));
-CREATE UNIQUE INDEX index_partitioned_foreign_keys_unique_index ON partitioned_foreign_keys USING btree (to_table, from_table, from_column);
-
CREATE INDEX index_pat_on_user_id_and_expires_at ON personal_access_tokens USING btree (user_id, expires_at);
CREATE INDEX index_path_locks_on_path ON path_locks USING btree (path);
@@ -29689,6 +29808,8 @@ CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree
CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id);
+CREATE UNIQUE INDEX index_project_build_artifacts_size_refreshes_on_project_id ON project_build_artifacts_size_refreshes USING btree (project_id);
+
CREATE UNIQUE INDEX index_project_ci_cd_settings_on_project_id ON project_ci_cd_settings USING btree (project_id);
CREATE UNIQUE INDEX index_project_ci_feature_usages_unique_columns ON project_ci_feature_usages USING btree (project_id, feature, default_branch);
@@ -29741,8 +29862,6 @@ CREATE UNIQUE INDEX index_project_mirror_data_on_project_id ON project_mirror_da
CREATE INDEX index_project_mirror_data_on_status ON project_mirror_data USING btree (status);
-CREATE INDEX index_project_pages_metadata_on_artifacts_archive_id ON project_pages_metadata USING btree (artifacts_archive_id);
-
CREATE INDEX index_project_pages_metadata_on_pages_deployment_id ON project_pages_metadata USING btree (pages_deployment_id);
CREATE INDEX index_project_pages_metadata_on_project_id_and_deployed_is_true ON project_pages_metadata USING btree (project_id) WHERE (deployed = true);
@@ -29789,12 +29908,6 @@ CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_f
CREATE INDEX index_projects_api_created_at_id_desc ON projects USING btree (created_at, id DESC);
-CREATE INDEX index_projects_api_created_at_id_for_archived ON projects USING btree (created_at, id) WHERE ((archived = true) AND (pending_delete = false));
-
-CREATE INDEX index_projects_api_created_at_id_for_archived_vis20 ON projects USING btree (created_at, id) WHERE ((archived = true) AND (visibility_level = 20) AND (pending_delete = false));
-
-CREATE INDEX index_projects_api_created_at_id_for_vis10 ON projects USING btree (created_at, id) WHERE ((visibility_level = 10) AND (pending_delete = false));
-
CREATE INDEX index_projects_api_last_activity_at_id_desc ON projects USING btree (last_activity_at, id DESC);
CREATE INDEX index_projects_api_name_id_desc ON projects USING btree (name, id DESC);
@@ -29813,6 +29926,8 @@ CREATE INDEX index_projects_api_vis20_path ON projects USING btree (path, id) WH
CREATE INDEX index_projects_api_vis20_updated_at ON projects USING btree (updated_at, id) WHERE (visibility_level = 20);
+CREATE INDEX index_projects_not_aimed_for_deletion ON projects USING btree (id) WHERE (marked_for_deletion_at IS NULL);
+
CREATE INDEX index_projects_on_created_at_and_id ON projects USING btree (created_at, id);
CREATE INDEX index_projects_on_creator_id_and_created_at_and_id ON projects USING btree (creator_id, created_at, id);
@@ -29917,6 +30032,10 @@ CREATE INDEX index_protected_branch_unprotect_access_levels_on_user_id ON protec
CREATE INDEX index_protected_branches_on_project_id ON protected_branches USING btree (project_id);
+CREATE INDEX index_protected_environment_approval_rules_on_group_id ON protected_environment_approval_rules USING btree (group_id);
+
+CREATE INDEX index_protected_environment_approval_rules_on_user_id ON protected_environment_approval_rules USING btree (user_id);
+
CREATE INDEX index_protected_environment_deploy_access ON protected_environment_deploy_access_levels USING btree (protected_environment_id);
CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON protected_environment_deploy_access_levels USING btree (group_id);
@@ -29951,13 +30070,21 @@ CREATE UNIQUE INDEX index_redirect_routes_on_path_unique_text_pattern_ops ON red
CREATE INDEX index_redirect_routes_on_source_type_and_source_id ON redirect_routes USING btree (source_type, source_id);
+CREATE INDEX index_related_epic_links_on_source_id ON related_epic_links USING btree (source_id);
+
+CREATE UNIQUE INDEX index_related_epic_links_on_source_id_and_target_id ON related_epic_links USING btree (source_id, target_id);
+
+CREATE INDEX index_related_epic_links_on_target_id ON related_epic_links USING btree (target_id);
+
CREATE UNIQUE INDEX index_release_links_on_release_id_and_name ON release_links USING btree (release_id, name);
CREATE UNIQUE INDEX index_release_links_on_release_id_and_url ON release_links USING btree (release_id, url);
CREATE INDEX index_releases_on_author_id_id_created_at ON releases USING btree (author_id, id, created_at);
-CREATE INDEX index_releases_on_project_id_and_tag ON releases USING btree (project_id, tag);
+CREATE INDEX index_releases_on_project_id_and_released_at_and_id ON releases USING btree (project_id, released_at, id);
+
+CREATE UNIQUE INDEX index_releases_on_project_tag_unique ON releases USING btree (project_id, tag);
CREATE INDEX index_releases_on_released_at ON releases USING btree (released_at);
@@ -30047,6 +30174,8 @@ CREATE INDEX index_reviews_on_project_id ON reviews USING btree (project_id);
CREATE INDEX index_route_on_name_trigram ON routes USING gin (name gin_trgm_ops);
+CREATE UNIQUE INDEX index_routes_on_namespace_id ON routes USING btree (namespace_id);
+
CREATE UNIQUE INDEX index_routes_on_path ON routes USING btree (path);
CREATE INDEX index_routes_on_path_text_pattern_ops ON routes USING btree (path varchar_pattern_ops);
@@ -30059,6 +30188,8 @@ CREATE UNIQUE INDEX index_saml_group_links_on_group_id_and_saml_group_name ON sa
CREATE INDEX index_saml_providers_on_group_id ON saml_providers USING btree (group_id);
+CREATE UNIQUE INDEX index_saved_replies_on_name_text_pattern_ops ON saved_replies USING btree (user_id, name text_pattern_ops);
+
CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id);
CREATE UNIQUE INDEX index_scim_identities_on_lower_extern_uid_and_group_id ON scim_identities USING btree (lower((extern_uid)::text), group_id);
@@ -30069,7 +30200,7 @@ CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypt
CREATE INDEX index_secure_ci_builds_on_user_id_name_created_at ON ci_builds USING btree (user_id, name, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text, ('secret_detection'::character varying)::text])));
-CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text));
+CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text));
CREATE INDEX index_security_findings_on_confidence ON security_findings USING btree (confidence);
@@ -30077,7 +30208,7 @@ CREATE INDEX index_security_findings_on_project_fingerprint ON security_findings
CREATE INDEX index_security_findings_on_scan_id_and_deduplicated ON security_findings USING btree (scan_id, deduplicated);
-CREATE UNIQUE INDEX index_security_findings_on_scan_id_and_position ON security_findings USING btree (scan_id, "position");
+CREATE INDEX index_security_findings_on_scan_id_and_id ON security_findings USING btree (scan_id, id);
CREATE INDEX index_security_findings_on_scanner_id ON security_findings USING btree (scanner_id);
@@ -30093,6 +30224,14 @@ CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree (
CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id);
+CREATE UNIQUE INDEX index_security_training_providers_on_unique_name ON security_training_providers USING btree (name);
+
+CREATE INDEX index_security_trainings_on_project_id ON security_trainings USING btree (project_id);
+
+CREATE INDEX index_security_trainings_on_provider_id ON security_trainings USING btree (provider_id);
+
+CREATE UNIQUE INDEX index_security_trainings_on_unique_project_id ON security_trainings USING btree (project_id) WHERE (is_primary IS TRUE);
+
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@@ -30155,6 +30294,8 @@ CREATE INDEX index_snippets_on_id_and_created_at ON snippets USING btree (id, cr
CREATE INDEX index_snippets_on_id_and_type ON snippets USING btree (id, type);
+CREATE INDEX index_snippets_on_project_id_and_title ON snippets USING btree (project_id, title);
+
CREATE INDEX index_snippets_on_project_id_and_visibility_level ON snippets USING btree (project_id, visibility_level);
CREATE INDEX index_snippets_on_title_trigram ON snippets USING gin (title gin_trgm_ops);
@@ -30171,8 +30312,6 @@ CREATE INDEX index_software_licenses_on_spdx_identifier ON software_licenses USI
CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses USING btree (name);
-CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id);
-
CREATE INDEX index_sop_configurations_project_id_policy_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id, project_id);
CREATE INDEX index_sop_schedules_on_sop_configuration_id ON security_orchestration_policy_rule_schedules USING btree (security_orchestration_policy_configuration_id);
@@ -30189,12 +30328,8 @@ CREATE INDEX index_sprints_on_due_date ON sprints USING btree (due_date);
CREATE INDEX index_sprints_on_group_id ON sprints USING btree (group_id);
-CREATE UNIQUE INDEX index_sprints_on_iterations_cadence_id_and_title ON sprints USING btree (iterations_cadence_id, title);
-
CREATE UNIQUE INDEX index_sprints_on_project_id_and_iid ON sprints USING btree (project_id, iid);
-CREATE UNIQUE INDEX index_sprints_on_project_id_and_title ON sprints USING btree (project_id, title) WHERE (project_id IS NOT NULL);
-
CREATE INDEX index_sprints_on_title ON sprints USING btree (title);
CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm_ops);
@@ -30215,8 +30350,6 @@ CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_
CREATE INDEX index_successful_deployments_on_cluster_id_and_environment_id ON deployments USING btree (cluster_id, environment_id) WHERE (status = 2);
-CREATE INDEX index_suggestions_on_note_id ON suggestions USING btree (note_id);
-
CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON suggestions USING btree (note_id, relative_order);
CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL);
@@ -30279,7 +30412,7 @@ CREATE INDEX index_todos_on_group_id ON todos USING btree (group_id);
CREATE INDEX index_todos_on_note_id ON todos USING btree (note_id);
-CREATE INDEX index_todos_on_project_id ON todos USING btree (project_id);
+CREATE INDEX index_todos_on_project_id_and_id ON todos USING btree (project_id, id);
CREATE INDEX index_todos_on_project_id_and_user_id_and_id ON todos USING btree (project_id, user_id, id);
@@ -30295,6 +30428,10 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_plaintext_token ON token_with
CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING btree (hashed_token);
+CREATE INDEX index_topics_non_private_projects_count ON topics USING btree (non_private_projects_count DESC, id);
+
+CREATE INDEX index_topics_on_lower_name ON topics USING btree (lower(name));
+
CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name);
CREATE INDEX index_topics_on_name_trigram ON topics USING gin (name gin_trgm_ops);
@@ -30309,6 +30446,8 @@ CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree
CREATE UNIQUE INDEX index_uniq_im_issuable_escalation_statuses_on_issue_id ON incident_management_issuable_escalation_statuses USING btree (issue_id);
+CREATE UNIQUE INDEX index_unique_ci_runner_projects_on_runner_id_and_project_id ON ci_runner_projects USING btree (runner_id, project_id);
+
CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id);
CREATE UNIQUE INDEX index_unique_project_authorizations_on_project_id_user_id ON project_authorizations USING btree (project_id, user_id);
@@ -30361,8 +30500,6 @@ CREATE UNIQUE INDEX index_user_details_on_phone ON user_details USING btree (pho
COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index';
-CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING btree (provisioned_by_group_id);
-
CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id);
CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id);
@@ -30443,10 +30580,14 @@ CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USIN
CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users_star_projects USING btree (user_id, project_id);
+CREATE INDEX index_users_with_static_object_token ON users USING btree (id) WHERE ((static_object_token IS NOT NULL) AND (static_object_token_encrypted IS NULL));
+
CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date);
CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC);
+CREATE INDEX index_vulnerabilites_common_finder_query ON vulnerabilities USING btree (project_id, state, report_type, severity, id);
+
CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id);
CREATE INDEX index_vulnerabilities_on_confirmed_by_id ON vulnerabilities USING btree (confirmed_by_id);
@@ -30461,6 +30602,10 @@ CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING
CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id);
+CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id);
+
+CREATE INDEX index_vulnerabilities_on_project_id_and_id_active_cis ON vulnerabilities USING btree (project_id, id) WHERE ((report_type = 7) AND (state = ANY (ARRAY[1, 4])));
+
CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity);
CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id);
@@ -30525,10 +30670,12 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu
CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text));
-CREATE INDEX index_vulnerability_occurrences_on_location_cluster_id ON vulnerability_occurrences USING gin (((location -> 'cluster_id'::text))) WHERE (report_type = 7);
-
CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7]));
+CREATE INDEX index_vulnerability_occurrences_on_location_k8s_agent_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'agent_id'::text))) WHERE (report_type = 7);
+
+CREATE INDEX index_vulnerability_occurrences_on_location_k8s_cluster_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'cluster_id'::text))) WHERE (report_type = 7);
+
CREATE INDEX index_vulnerability_occurrences_on_migrated_to_new_structure ON vulnerability_occurrences USING btree (migrated_to_new_structure, id);
CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id);
@@ -30537,12 +30684,14 @@ CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerabi
CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON vulnerability_occurrences USING btree (scanner_id);
-CREATE UNIQUE INDEX index_vulnerability_occurrences_on_unique_keys ON vulnerability_occurrences USING btree (project_id, primary_identifier_id, location_fingerprint, scanner_id);
-
CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occurrences USING btree (uuid);
CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id);
+CREATE INDEX index_vulnerability_reads_common_finder_query ON vulnerability_reads USING btree (project_id, state, report_type, severity, vulnerability_id DESC);
+
+CREATE INDEX index_vulnerability_reads_on_cluster_agent_id ON vulnerability_reads USING btree (cluster_agent_id) WHERE (report_type = 7);
+
CREATE INDEX index_vulnerability_reads_on_location_image ON vulnerability_reads USING btree (location_image) WHERE (report_type = ANY (ARRAY[2, 7]));
CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USING btree (scanner_id);
@@ -30651,6 +30800,10 @@ CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON depl
CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments USING btree (project_id) WHERE (tag IS TRUE);
+CREATE UNIQUE INDEX partial_index_sop_configs_on_namespace_id ON security_orchestration_policy_configurations USING btree (namespace_id) WHERE (namespace_id IS NOT NULL);
+
+CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id) WHERE (project_id IS NOT NULL);
+
CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_and_note_id_index ON snippet_user_mentions USING btree (snippet_id, note_id);
CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_mentions USING btree (snippet_id) WHERE (note_id IS NULL);
@@ -30659,9 +30812,29 @@ CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, t
CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id);
-CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id);
+CREATE INDEX tmp_gitlab_subscriptions_max_seats_used_migration ON gitlab_subscriptions USING btree (id) WHERE ((start_date >= '2021-08-02'::date) AND (start_date <= '2021-11-20'::date) AND (max_seats_used <> 0) AND (max_seats_used > seats_in_use) AND (max_seats_used > seats));
-CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL);
+CREATE INDEX tmp_gitlab_subscriptions_max_seats_used_migration_2 ON gitlab_subscriptions USING btree (id) WHERE ((start_date < '2021-08-02'::date) AND (max_seats_used <> 0) AND (max_seats_used > seats_in_use) AND (max_seats_used > seats));
+
+CREATE INDEX tmp_idx_container_repos_on_non_migrated ON container_repositories USING btree (project_id, id) WHERE ((migration_state <> 'import_done'::text) AND (created_at < '2022-01-23 00:00:00'::timestamp without time zone));
+
+CREATE INDEX tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at ON ci_job_artifacts USING btree (id) WHERE ((file_type = 3) AND (expire_at = ANY (ARRAY['2021-04-22 00:00:00+00'::timestamp with time zone, '2021-05-22 00:00:00+00'::timestamp with time zone, '2021-06-22 00:00:00+00'::timestamp with time zone, '2022-01-22 00:00:00+00'::timestamp with time zone, '2022-02-22 00:00:00+00'::timestamp with time zone, '2022-03-22 00:00:00+00'::timestamp with time zone, '2022-04-22 00:00:00+00'::timestamp with time zone])));
+
+CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state);
+
+CREATE INDEX tmp_index_for_namespace_id_migration_on_group_members ON members USING btree (id) WHERE ((member_namespace_id IS NULL) AND ((type)::text = 'GroupMember'::text));
+
+CREATE INDEX tmp_index_for_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Namespace'::text));
+
+CREATE INDEX tmp_index_for_null_project_namespace_id ON projects USING btree (id) WHERE (project_namespace_id IS NULL);
+
+CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text));
+
+CREATE INDEX tmp_index_issues_on_issue_type_and_id ON issues USING btree (issue_type, id);
+
+CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2);
+
+CREATE INDEX tmp_index_merge_requests_draft_and_status_leaky_regex ON merge_requests USING btree (id) WHERE ((draft = true) AND (state_id = 1) AND ((title)::text ~* '^\[draft\]|\(draft\)|draft:|draft|\[WIP\]|WIP:|WIP'::text) AND ((title)::text !~* '^(\[draft\]|\(draft\)|draft:|draft|\[WIP\]|WIP:|WIP)'::text));
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[]));
@@ -30671,6 +30844,10 @@ CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USIN
CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
+CREATE INDEX tmp_index_projects_on_id_and_runners_token ON projects USING btree (id, runners_token) WHERE (runners_token IS NOT NULL);
+
+CREATE INDEX tmp_index_projects_on_id_and_runners_token_encrypted ON projects USING btree (id, runners_token_encrypted) WHERE (runners_token_encrypted IS NOT NULL);
+
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name);
@@ -30689,14 +30866,16 @@ CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_suite
CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id);
+CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id);
+
CREATE INDEX user_follow_users_followee_id_idx ON user_follow_users USING btree (followee_id);
+CREATE INDEX users_forbidden_state_idx ON users USING btree (id) WHERE ((confirmed_at IS NOT NULL) AND ((state)::text <> ALL (ARRAY['blocked'::text, 'banned'::text, 'ldap_blocked'::text])));
+
CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback USING btree (project_id, category, feedback_type, project_fingerprint);
CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id);
-CREATE INDEX vulnerability_occurrences_location_temp_index ON vulnerability_occurrences USING btree (id) WHERE (location IS NULL);
-
CREATE UNIQUE INDEX work_item_types_namespace_id_and_name_unique ON work_item_types USING btree (namespace_id, btrim(lower(name)));
ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_created_at_author_id_idx;
@@ -30705,36 +30884,6 @@ ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH
ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_pkey;
-ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_created_at_author_id_idx;
-
-ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_entity_id_entity_type_id_author_id_crea_idx;
-
-ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_pkey;
-
-ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_created_at_author_id_idx;
-
-ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_entity_id_entity_type_id_author_id_crea_idx;
-
-ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_pkey;
-
-ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_created_at_author_id_idx;
-
-ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_entity_id_entity_type_id_author_id_crea_idx;
-
-ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_pkey;
-
-ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_created_at_author_id_idx;
-
-ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_entity_id_entity_type_id_author_id_crea_idx;
-
-ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_pkey;
-
-ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_created_at_author_id_idx;
-
-ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_entity_id_entity_type_id_author_id_crea_idx;
-
-ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_pkey;
-
ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_created_at_author_id_idx;
ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_entity_id_entity_type_id_author_id_crea_idx;
@@ -30765,6 +30914,18 @@ ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH
ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309_pkey;
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202310_created_at_author_id_idx;
+
+ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202310_entity_id_entity_type_id_author_id_crea_idx;
+
+ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202310_pkey;
+
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202311_created_at_author_id_idx;
+
+ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202311_entity_id_entity_type_id_author_id_crea_idx;
+
+ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202311_pkey;
+
ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration__idx;
ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx1;
@@ -30783,10 +30944,6 @@ ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH
ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000_pkey;
-ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303_pkey;
-
-ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304_pkey;
-
ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305_pkey;
ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306_pkey;
@@ -30797,13 +30954,15 @@ ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITI
ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309_pkey;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301_pkey;
+ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202310_pkey;
+
+ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202311_pkey;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302_pkey;
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_000000_pkey;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303_pkey;
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_00000_rule_id_idx;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304_pkey;
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_0000_alert_id_idx;
ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305_pkey;
@@ -30817,6 +30976,12 @@ ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION
ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_20230_rule_id_idx;
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202310_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202311_pkey;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_20231_rule_id_idx;
+
ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_alert_id_idx;
ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx1;
@@ -30829,11 +30994,7 @@ ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTAC
ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx5;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx6;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx7;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx8;
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx1;
ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx2;
@@ -30845,19 +31006,11 @@ ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTA
ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx6;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx7;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx8;
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_000000_pkey;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx9;
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_00000_rule_id_idx;
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301_pkey;
-
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302_pkey;
-
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303_pkey;
-
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304_pkey;
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_0000_issue_id_idx;
ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305_pkey;
@@ -30871,6 +31024,12 @@ ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION
ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_20230_rule_id_idx;
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202310_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202311_pkey;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_20231_rule_id_idx;
+
ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_issue_id_idx;
ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx1;
@@ -30883,11 +31042,7 @@ ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTAC
ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx5;
-ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx6;
-
-ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx7;
-
-ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx8;
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx1;
ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx2;
@@ -30899,32 +31054,26 @@ ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTA
ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx6;
-ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx7;
+ALTER INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ATTACH PARTITION gitlab_partitions_dynamic.index_01e3390fac;
-ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx8;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_2eb8964745;
-ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx9;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_7185e24460;
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_1554dc6f11;
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_7a0f3a9930;
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_719c6187cb;
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_80bf138a51;
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_962081978f;
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_a548862389;
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_eecfac613f;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1_pkey;
ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_pkey;
ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_visitor_id_code_phone_created_at_idx;
-ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302_pkey;
-
-ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302_visitor_id_code_phone_created_at_idx;
-
-ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303_pkey;
-
-ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303_visitor_id_code_phone_created_at_idx;
-
ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304_pkey;
ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304_visitor_id_code_phone_created_at_idx;
@@ -30949,40 +31098,20 @@ ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.v
ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309_visitor_id_code_phone_created_at_idx;
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey;
-
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301_pkey;
-
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_created_at_web_hook_id_idx;
-
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_pkey;
-
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_web_hook_id_idx;
-
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_created_at_web_hook_id_idx;
-
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_pkey;
-
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_web_hook_id_idx;
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202310_pkey;
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_created_at_web_hook_id_idx;
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202310_visitor_id_code_phone_created_at_idx;
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_pkey;
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202311_pkey;
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_web_hook_id_idx;
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202311_visitor_id_code_phone_created_at_idx;
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_created_at_web_hook_id_idx;
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey;
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_pkey;
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_web_hook_id_idx;
-
-ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_created_at_web_hook_id_idx;
-
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_pkey;
-ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_web_hook_id_idx;
-
ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_created_at_web_hook_id_idx;
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_pkey;
@@ -31001,6 +31130,18 @@ ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_ho
ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309_web_hook_id_idx;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202310_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202310_pkey;
+
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202310_web_hook_id_idx;
+
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202311_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202311_pkey;
+
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202311_web_hook_id_idx;
+
ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00_pkey;
ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01_pkey;
@@ -31133,8 +31274,6 @@ ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_pa
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_006f943df6;
-ALTER INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ATTACH PARTITION gitlab_partitions_static.index_01e3390fac;
-
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_02749b504c;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_0287f5ba09;
@@ -32027,8 +32166,6 @@ ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.iss
ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_search_vector_idx;
-ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1_pkey;
-
ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10;
ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11;
@@ -32293,6 +32430,8 @@ CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERE
CREATE TRIGGER ci_runners_loose_fk_trigger AFTER DELETE ON ci_runners REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+CREATE TRIGGER merge_requests_loose_fk_trigger AFTER DELETE ON merge_requests REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+
CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
@@ -32313,6 +32452,8 @@ CREATE TRIGGER trigger_has_external_wiki_on_type_new_updated AFTER UPDATE OF typ
CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON integrations FOR EACH ROW WHEN (((new.type_new = 'Integrations::ExternalWiki'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences AFTER INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION insert_or_update_vulnerability_reads();
+
CREATE TRIGGER trigger_namespaces_parent_id_on_insert AFTER INSERT ON namespaces FOR EACH ROW EXECUTE FUNCTION insert_namespaces_sync_event();
CREATE TRIGGER trigger_namespaces_parent_id_on_update AFTER UPDATE ON namespaces FOR EACH ROW WHEN ((old.parent_id IS DISTINCT FROM new.parent_id)) EXECUTE FUNCTION insert_namespaces_sync_event();
@@ -32323,32 +32464,15 @@ CREATE TRIGGER trigger_projects_parent_id_on_update AFTER UPDATE ON projects FOR
CREATE TRIGGER trigger_type_new_on_insert AFTER INSERT ON integrations FOR EACH ROW EXECUTE FUNCTION integrations_set_type_new();
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211
- ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212
- ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211
- ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212
- ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211
- ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
+CREATE TRIGGER trigger_update_has_issues_on_vulnerability_issue_links_delete AFTER DELETE ON vulnerability_issue_links FOR EACH ROW EXECUTE FUNCTION unset_has_issues_on_vulnerability_reads();
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212
- ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
+CREATE TRIGGER trigger_update_has_issues_on_vulnerability_issue_links_update AFTER INSERT ON vulnerability_issue_links FOR EACH ROW EXECUTE FUNCTION set_has_issues_on_vulnerability_reads();
-ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000
- ADD CONSTRAINT fk_rails_bb3355782d FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
+CREATE TRIGGER trigger_update_location_on_vulnerability_occurrences_update AFTER UPDATE ON vulnerability_occurrences FOR EACH ROW WHEN (((new.report_type = ANY (ARRAY[2, 7])) AND (((old.location ->> 'image'::text) IS DISTINCT FROM (new.location ->> 'image'::text)) OR (((old.location -> 'kubernetes_resource'::text) ->> 'agent_id'::text) IS DISTINCT FROM ((new.location -> 'kubernetes_resource'::text) ->> 'agent_id'::text))))) EXECUTE FUNCTION update_location_from_vulnerability_occurrences();
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211
- ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+CREATE TRIGGER trigger_update_vulnerability_reads_on_vulnerability_update AFTER UPDATE ON vulnerabilities FOR EACH ROW WHEN (((old.severity IS DISTINCT FROM new.severity) OR (old.state IS DISTINCT FROM new.state) OR (old.resolved_on_default_branch IS DISTINCT FROM new.resolved_on_default_branch))) EXECUTE FUNCTION update_vulnerability_reads_from_vulnerability();
-ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212
- ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+CREATE TRIGGER users_loose_fk_trigger AFTER DELETE ON users REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
ALTER TABLE ONLY chat_names
ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -32449,9 +32573,6 @@ ALTER TABLE ONLY agent_project_authorizations
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_sources_pipelines
- ADD CONSTRAINT fk_1e53c97c0a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@@ -32470,9 +32591,6 @@ ALTER TABLE ONLY users_star_projects
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_2358b75436 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_stages
- ADD CONSTRAINT fk_2360681d1d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY import_failures
ADD CONSTRAINT fk_24b824da43 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -32506,9 +32624,6 @@ ALTER TABLE ONLY agent_group_authorizations
ALTER TABLE ONLY deployment_approvals
ADD CONSTRAINT fk_2d060dfc73 FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_freeze_periods
- ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY notes
ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL;
@@ -32530,9 +32645,6 @@ ALTER TABLE ONLY approvals
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_group_variables
- ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
@@ -32572,6 +32684,12 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_3d34ab2e06 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE SET NULL;
+ALTER TABLE ONLY merge_request_reviewers
+ ADD CONSTRAINT fk_3d674b9f23 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
+ALTER TABLE ONLY protected_environment_approval_rules
+ ADD CONSTRAINT fk_405568b491 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_pipeline_schedule_variables
ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE;
@@ -32581,9 +32699,6 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY incident_management_timeline_events
ADD CONSTRAINT fk_4432fc4d78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_runner_projects
- ADD CONSTRAINT fk_4478a6f1e4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_45054f9c45 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -32602,9 +32717,6 @@ ALTER TABLE ONLY alert_management_alerts
ALTER TABLE ONLY path_locks
ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dast_site_profiles_pipelines
- ADD CONSTRAINT fk_53849b0ad5 FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY terraform_states
ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -32638,6 +32750,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY dependency_proxy_group_settings
ADD CONSTRAINT fk_616ddd680a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY deployment_approvals
+ ADD CONSTRAINT fk_61cdbdc5b9 FOREIGN KEY (approval_rule_id) REFERENCES protected_environment_approval_rules(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY dast_profile_schedules
ADD CONSTRAINT fk_61d52aa0e7 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
@@ -32653,8 +32768,8 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL;
-ALTER TABLE ONLY project_pages_metadata
- ADD CONSTRAINT fk_69366a119e FOREIGN KEY (artifacts_archive_id) REFERENCES ci_job_artifacts(id) ON DELETE SET NULL;
+ALTER TABLE ONLY routes
+ ADD CONSTRAINT fk_679ff8213d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_693b8795e4 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
@@ -32668,6 +32783,9 @@ ALTER TABLE ONLY namespaces
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY projects
+ ADD CONSTRAINT fk_6ca23af0a3 FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_profile_schedules
ADD CONSTRAINT fk_6cca0d8800 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -32677,12 +32795,15 @@ ALTER TABLE ONLY projects
ALTER TABLE ONLY terraform_state_versions
ADD CONSTRAINT fk_6e81384d7f FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY protected_environment_approval_rules
+ ADD CONSTRAINT fk_6ee8249821 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY deploy_tokens
+ ADD CONSTRAINT fk_7082f8a288 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY projects
- ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -32701,9 +32822,6 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY oauth_openid_requests
ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_resource_groups
- ADD CONSTRAINT fk_774722d144 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY users
ADD CONSTRAINT fk_789cd90b35 FOREIGN KEY (accepted_term_id) REFERENCES application_setting_terms(id) ON DELETE CASCADE;
@@ -32716,9 +32834,6 @@ ALTER TABLE ONLY analytics_devops_adoption_snapshots
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_unit_tests
- ADD CONSTRAINT fk_7a8fabf0a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY protected_branches
ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -32761,9 +32876,6 @@ ALTER TABLE ONLY merge_request_diffs
ALTER TABLE ONLY requirements
ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipelines
- ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_86c84214ec FOREIGN KEY (repository_renamed_event_id) REFERENCES geo_repository_renamed_events(id) ON DELETE CASCADE;
@@ -32797,9 +32909,6 @@ ALTER TABLE ONLY releases
ALTER TABLE ONLY protected_tags
ADD CONSTRAINT fk_8e4af87648 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_schedules
- ADD CONSTRAINT fk_8ead60fcc4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
@@ -32854,9 +32963,6 @@ ALTER TABLE ONLY protected_environments
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_schedules
- ADD CONSTRAINT fk_9ea99f58d2 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_9ffc86a3d9 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
@@ -32869,15 +32975,9 @@ ALTER TABLE ONLY issues
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_a2141b1522 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_pipelines
- ADD CONSTRAINT fk_a23be95014 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dast_site_profiles_builds
- ADD CONSTRAINT fk_a325505e99 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY jira_connect_subscriptions
ADD CONSTRAINT fk_a3c10bcf7d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -32887,12 +32987,12 @@ ALTER TABLE ONLY bulk_import_entities
ALTER TABLE ONLY users
ADD CONSTRAINT fk_a4b8fefe3e FOREIGN KEY (managing_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+ALTER TABLE ONLY security_orchestration_policy_configurations
+ ADD CONSTRAINT fk_a50430b375 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY lfs_objects_projects
ADD CONSTRAINT fk_a56e02279c FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE RESTRICT NOT VALID;
-ALTER TABLE ONLY dast_profiles_pipelines
- ADD CONSTRAINT fk_a60cad829d FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -32902,6 +33002,9 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT fk_aa76ef30e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY members
+ ADD CONSTRAINT fk_aa82dcc1c6 FOREIGN KEY (member_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_aad61aedca FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL;
@@ -32914,21 +33017,18 @@ ALTER TABLE ONLY boards
ALTER TABLE ONLY member_tasks
ADD CONSTRAINT fk_ab636303dd FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_sources_pipelines
- ADD CONSTRAINT fk_acd9737679 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_ad525e1f87 FOREIGN KEY (merge_user_id) REFERENCES users(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_variables
- ADD CONSTRAINT fk_ada5eb64b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY dast_profile_schedules
ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY merge_request_assignees
+ ADD CONSTRAINT fk_af036e3261 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE;
@@ -32992,9 +33092,6 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY packages_maven_metadata
ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds
- ADD CONSTRAINT fk_befce0568a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY design_management_versions
ADD CONSTRAINT fk_c1440b4896 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -33127,12 +33224,6 @@ ALTER TABLE ONLY ci_builds_metadata
ALTER TABLE ONLY gitlab_subscriptions
ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_triggers
- ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY dast_scanner_profiles_builds
- ADD CONSTRAINT fk_e4c49200f8 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -33154,12 +33245,6 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
-ALTER TABLE ONLY vulnerability_statistics
- ADD CONSTRAINT fk_e8b13c928f FOREIGN KEY (latest_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
-ALTER TABLE ONLY ci_triggers
- ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -33232,15 +33317,6 @@ ALTER TABLE ONLY system_note_metadata
ALTER TABLE ONLY vulnerability_remediations
ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_daily_build_group_report_results
- ADD CONSTRAINT fk_fd1858fefd FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY merge_requests
- ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
-ALTER TABLE ONLY ci_pending_builds
- ADD CONSTRAINT fk_fdc0137e4a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_import_data
ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -33295,15 +33371,6 @@ ALTER TABLE ONLY ip_restrictions
ALTER TABLE ONLY terraform_state_versions
ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_report_results
- ADD CONSTRAINT fk_rails_056d298d48 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_daily_build_group_report_results
- ADD CONSTRAINT fk_rails_0667f7608c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_subscriptions_projects
- ADD CONSTRAINT fk_rails_0818751483 FOREIGN KEY (downstream_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY user_interacted_projects
ADD CONSTRAINT fk_rails_0894651f08 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -33322,6 +33389,9 @@ ALTER TABLE ONLY packages_debian_group_distributions
ALTER TABLE ONLY packages_conan_file_metadata
ADD CONSTRAINT fk_rails_0afabd9328 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE;
+ALTER TABLE ONLY related_epic_links
+ ADD CONSTRAINT fk_rails_0b72027748 FOREIGN KEY (target_id) REFERENCES epics(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_build_pending_states
ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
@@ -33388,6 +33458,9 @@ ALTER TABLE ONLY bulk_imports
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT fk_rails_13c7212859 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY analytics_cycle_analytics_aggregations
+ ADD CONSTRAINT fk_rails_13c8374c7a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY users_security_dashboard_projects
ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -33469,9 +33542,6 @@ ALTER TABLE ONLY boards_epic_lists
ALTER TABLE ONLY approval_merge_request_rules_groups
ADD CONSTRAINT fk_rails_2020a7124a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_feedback
- ADD CONSTRAINT fk_rails_20976e6fd9 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY work_item_types
ADD CONSTRAINT fk_rails_20f694a960 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -33490,9 +33560,6 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY saml_group_links
ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT fk_rails_2390a09723 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
@@ -33592,8 +33659,8 @@ ALTER TABLE ONLY container_repositories
ALTER TABLE ONLY clusters_applications_jupyter
ADD CONSTRAINT fk_rails_331f0aff78 FOREIGN KEY (oauth_application_id) REFERENCES oauth_applications(id) ON DELETE SET NULL;
-ALTER TABLE ONLY merge_request_metrics
- ADD CONSTRAINT fk_rails_33ae169d48 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY alert_management_alert_metric_images
+ ADD CONSTRAINT fk_rails_338e55b408 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
ALTER TABLE ONLY suggestions
ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
@@ -33604,12 +33671,12 @@ ALTER TABLE ONLY requirements
ALTER TABLE ONLY metrics_dashboard_annotations
ADD CONSTRAINT fk_rails_345ab51043 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
+ALTER TABLE ONLY group_features
+ ADD CONSTRAINT fk_rails_356514082b FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY wiki_page_slugs
ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_job_token_project_scope_links
- ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY board_labels
ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
@@ -33685,9 +33752,6 @@ ALTER TABLE ONLY geo_node_namespace_links
ALTER TABLE ONLY epic_issues
ADD CONSTRAINT fk_rails_4209981af6 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_refs
- ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY ci_resources
ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE;
@@ -33733,18 +33797,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY user_custom_attributes
ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pending_builds
- ADD CONSTRAINT fk_rails_480669c3b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY upcoming_reconciliations
ADD CONSTRAINT fk_rails_497b4938ac FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_artifacts
- ADD CONSTRAINT fk_rails_4a70390ca6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_job_token_project_scope_links
- ADD CONSTRAINT fk_rails_4b2ee3290b FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY group_deletion_schedules
ADD CONSTRAINT fk_rails_4b8c694a6c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -33769,6 +33824,9 @@ ALTER TABLE ONLY scim_identities
ALTER TABLE ONLY snippet_user_mentions
ADD CONSTRAINT fk_rails_4d3f96b2cb FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY protected_environment_approval_rules
+ ADD CONSTRAINT fk_rails_4e554f96f5 FOREIGN KEY (protected_environment_id) REFERENCES protected_environments(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY deployment_clusters
ADD CONSTRAINT fk_rails_4e6243e120 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
@@ -33778,9 +33836,6 @@ ALTER TABLE ONLY geo_repository_renamed_events
ALTER TABLE ONLY aws_roles
ADD CONSTRAINT fk_rails_4ed56f4720 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY security_scans
- ADD CONSTRAINT fk_rails_4ef1e6b4c6 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY packages_debian_publications
ADD CONSTRAINT fk_rails_4fc8ebd03e FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE;
@@ -33793,9 +33848,6 @@ ALTER TABLE ONLY resource_iteration_events
ALTER TABLE ONLY status_page_settings
ADD CONSTRAINT fk_rails_506e5ba391 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_project_monthly_usages
- ADD CONSTRAINT fk_rails_508bcd4aa6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_repository_storage_moves
ADD CONSTRAINT fk_rails_5106dbd44a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -33907,9 +33959,6 @@ ALTER TABLE ONLY evidences
ALTER TABLE ONLY jira_imports
ADD CONSTRAINT fk_rails_63cbe52ada FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_occurrence_pipelines
- ADD CONSTRAINT fk_rails_6421e35d7d FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY group_deploy_tokens
ADD CONSTRAINT fk_rails_6477b01f6b FOREIGN KEY (deploy_token_id) REFERENCES deploy_tokens(id) ON DELETE CASCADE;
@@ -33919,9 +33968,6 @@ ALTER TABLE ONLY reviews
ALTER TABLE ONLY operations_feature_flags
ADD CONSTRAINT fk_rails_648e241be7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_sources_projects
- ADD CONSTRAINT fk_rails_64b6855cbc FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY board_group_recent_visits
ADD CONSTRAINT fk_rails_64bfc19bc5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -33958,15 +34004,9 @@ ALTER TABLE ONLY vulnerability_findings_remediations
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_6830c13ac1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT fk_rails_683b8e000c FOREIGN KEY (vulnerability_finding_evidence_response_id) REFERENCES vulnerability_finding_evidence_responses(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY geo_hashed_storage_migrated_events
ADD CONSTRAINT fk_rails_687ed7d7c5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_job_token_project_scope_links
- ADD CONSTRAINT fk_rails_6904b38465 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY plan_limits
ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE;
@@ -33982,9 +34022,6 @@ ALTER TABLE ONLY prometheus_alerts
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_assets
- ADD CONSTRAINT fk_rails_6edbbecba4 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT fk_rails_6f5294f16c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -34018,9 +34055,6 @@ ALTER TABLE ONLY dast_scanner_profiles
ALTER TABLE ONLY vulnerability_historical_statistics
ADD CONSTRAINT fk_rails_72b73ed023 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY slack_integrations
ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -34036,6 +34070,9 @@ ALTER TABLE ONLY dast_site_profiles
ALTER TABLE ONLY merge_request_context_commit_diff_files
ADD CONSTRAINT fk_rails_74a00a1787 FOREIGN KEY (merge_request_context_commit_id) REFERENCES merge_request_context_commits(id) ON DELETE CASCADE;
+ALTER TABLE ONLY group_crm_settings
+ ADD CONSTRAINT fk_rails_74fdf2f13d FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY clusters_applications_ingress
ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
@@ -34066,18 +34103,12 @@ ALTER TABLE ONLY boards_epic_user_preferences
ALTER TABLE ONLY packages_debian_group_distribution_keys
ADD CONSTRAINT fk_rails_779438f163 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_subscriptions_projects
- ADD CONSTRAINT fk_rails_7871f9a97b FOREIGN KEY (upstream_project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY terraform_states
ADD CONSTRAINT fk_rails_78f54ca485 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
- ADD CONSTRAINT fk_rails_79e77f6c5c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY software_license_policies
ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE;
@@ -34111,6 +34142,9 @@ ALTER TABLE ONLY required_code_owners_sections
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT fk_rails_84c7951d72 FOREIGN KEY (provider_id) REFERENCES security_training_providers(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY zentao_tracker_data
ADD CONSTRAINT fk_rails_84efda7be0 FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -34207,12 +34241,12 @@ ALTER TABLE ONLY project_error_tracking_settings
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT fk_rails_929041a499 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_request_cleanup_schedules
ADD CONSTRAINT fk_rails_92dd0e705c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_build_artifacts_size_refreshes
+ ADD CONSTRAINT fk_rails_936db5fc44 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY board_labels
ADD CONSTRAINT fk_rails_9374a16edd FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
@@ -34243,9 +34277,6 @@ ALTER TABLE ONLY group_repository_storage_moves
ALTER TABLE ONLY resource_label_events
ADD CONSTRAINT fk_rails_9851a00031 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_job_artifacts
- ADD CONSTRAINT fk_rails_9862d392f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY board_project_recent_visits
ADD CONSTRAINT fk_rails_98f8843922 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -34351,6 +34382,9 @@ ALTER TABLE ONLY resource_milestone_events
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_a88721bcdf FOREIGN KEY (term_id) REFERENCES application_setting_terms(id);
+ALTER TABLE ONLY saved_replies
+ ADD CONSTRAINT fk_rails_a8bf5bf111 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_pipeline_artifacts
ADD CONSTRAINT fk_rails_a9e811a466 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
@@ -34456,9 +34490,6 @@ ALTER TABLE ONLY projects_sync_events
ALTER TABLE ONLY approval_merge_request_rules_users
ADD CONSTRAINT fk_rails_bc8972fa55 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY external_pull_requests
- ADD CONSTRAINT fk_rails_bcae9b5c7b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY elasticsearch_indexed_projects
ADD CONSTRAINT fk_rails_bd13bbdc3d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -34510,6 +34541,9 @@ ALTER TABLE ONLY group_deploy_keys_groups
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY related_epic_links
+ ADD CONSTRAINT fk_rails_c464534def FOREIGN KEY (source_id) REFERENCES epics(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards_epic_board_recent_visits
ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -34567,18 +34601,12 @@ ALTER TABLE ONLY operations_strategies_user_lists
ALTER TABLE ONLY issue_tracker_data
ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY resource_milestone_events
ADD CONSTRAINT fk_rails_cedf8cce4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_cee126f66c FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY upload_states
ADD CONSTRAINT fk_rails_d00f153613 FOREIGN KEY (upload_id) REFERENCES uploads(id) ON DELETE CASCADE;
@@ -34633,9 +34661,6 @@ ALTER TABLE ONLY issues_prometheus_alert_events
ALTER TABLE ONLY board_user_preferences
ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_running_builds
- ADD CONSTRAINT fk_rails_dc1d0801e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY vulnerability_occurrence_pipelines
ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
@@ -34663,9 +34688,6 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ALTER TABLE ONLY bulk_import_export_uploads
ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_minutes_additional_packs
- ADD CONSTRAINT fk_rails_e0e0c4e4b1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY label_priorities
ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
@@ -34705,9 +34727,6 @@ ALTER TABLE ONLY approval_merge_request_rule_sources
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id) ON DELETE CASCADE;
-ALTER TABLE ONLY requirements_management_test_reports
- ADD CONSTRAINT fk_rails_e67d085910 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_rails_e6d7c24d1b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -34735,9 +34754,6 @@ ALTER TABLE ONLY vulnerability_issue_links
ALTER TABLE ONLY merge_request_blocks
ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_sources
- ADD CONSTRAINT fk_rails_e9761bed4c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
@@ -34825,15 +34841,12 @@ ALTER TABLE ONLY internal_ids
ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id) REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT fk_rails_f80240fae0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests_closing_issues
ADD CONSTRAINT fk_rails_f8540692be FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-ALTER TABLE ONLY merge_trains
- ADD CONSTRAINT fk_rails_f90820cb08 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
-ALTER TABLE ONLY ci_runner_namespaces
- ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY banned_users
ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -34876,9 +34889,6 @@ ALTER TABLE ONLY resource_label_events
ALTER TABLE ONLY pages_deployment_states
ADD CONSTRAINT fk_rails_ff6ca551a4 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds_metadata
- ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY security_orchestration_policy_configurations
ADD CONSTRAINT fk_security_policy_configurations_management_project_id FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE CASCADE;
diff --git a/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb b/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb
deleted file mode 100644
index 84bc551d2b5..00000000000
--- a/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class MoveLooseFkDeletedRecordsToDynamicSchema < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- if table_exists?('gitlab_partitions_static.loose_foreign_keys_deleted_records_1')
- execute 'ALTER TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 SET SCHEMA gitlab_partitions_dynamic'
- end
- end
-
- def down
- if table_exists?('gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1')
- execute 'ALTER TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 SET SCHEMA gitlab_partitions_static'
- end
- end
-end
diff --git a/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb b/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb
deleted file mode 100644
index 47a155d40fa..00000000000
--- a/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnPackagesBuildInfosPackageIdPipelineId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_build_infos_package_id_pipeline_id'
- OLD_INDEX_NAME = 'idx_packages_build_infos_on_package_id'
-
- def up
- add_concurrent_index :packages_build_infos, [:package_id, :pipeline_id], name: INDEX_NAME
- remove_concurrent_index_by_name :packages_build_infos, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :packages_build_infos, :package_id, name: OLD_INDEX_NAME
- remove_concurrent_index :packages_build_infos, [:package_id, :pipeline_id], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb b/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb
deleted file mode 100644
index dafd2108b43..00000000000
--- a/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# 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 AddUpdatedStateByUserIdToMergeRequestReviewers < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :merge_request_reviewers, :updated_state_by_user_id, :bigint
- end
-end
diff --git a/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb b/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb
deleted file mode 100644
index 6f4ee079015..00000000000
--- a/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToMergeRequestReviewersUpdatedStateByUserId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_reviewers_updated_state_by_user_id'
-
- def up
- add_concurrent_index :merge_request_reviewers, :updated_state_by_user_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb b/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb
deleted file mode 100644
index 1c9e7193630..00000000000
--- a/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdatedStateByUserIdToMergeRequestAssignees < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :merge_request_assignees, :updated_state_by_user_id, :bigint
- end
-end
diff --git a/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb b/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb
deleted file mode 100644
index d052ffdf4d6..00000000000
--- a/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToMergeRequestAssigneesUpdatedStateByUserId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_assignees_updated_state_by_user_id'
-
- def up
- add_concurrent_index :merge_request_assignees, :updated_state_by_user_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb b/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb
deleted file mode 100644
index 35a3a98030a..00000000000
--- a/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexSnippetsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_snippets_on_project_id_and_title'
-
- def up
- add_concurrent_index :snippets, [:project_id, :title], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :snippets, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb b/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb
deleted file mode 100644
index da391da33ec..00000000000
--- a/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiRunnersIndexOnCreatedAtWhereActiveIsFalse < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_runners_on_created_at_and_id_where_inactive'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_runners, [:created_at, :id], where: 'active = FALSE', order: { created_at: :desc, id: :desc }, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_runners, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb b/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb
deleted file mode 100644
index e25d3c0dffa..00000000000
--- a/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiRunnersIndexOnContactedAtWhereActiveIsFalse < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_runners_on_contacted_at_and_id_where_inactive'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_runners, [:contacted_at, :id], where: 'active = FALSE', order: { contacted_at: :desc, id: :desc }, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_runners, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb b/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb
deleted file mode 100644
index fb1339cecfa..00000000000
--- a/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddProtectedEnvironmentsRequiredApprovalCountCheckConstraint < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'protected_environments_required_approval_count_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :protected_environments, 'required_approval_count >= 0', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :protected_environments, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb b/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb
deleted file mode 100644
index 1e1fdbdb122..00000000000
--- a/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddExecutorTypeColumnToCiRunners < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_runners, :executor_type, :smallint, null: true
- end
-end
diff --git a/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb b/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb
deleted file mode 100644
index 596c82eb209..00000000000
--- a/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToClusterAgentTokens < Gitlab::Database::Migration[1.0]
- def change
- add_column :cluster_agent_tokens, :status, :smallint, null: false, default: 0
- end
-end
diff --git a/db/migrate/20211210025754_alter_constraint_of_phone.rb b/db/migrate/20211210025754_alter_constraint_of_phone.rb
deleted file mode 100644
index 1644fbe9000..00000000000
--- a/db/migrate/20211210025754_alter_constraint_of_phone.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AlterConstraintOfPhone < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length')
- remove_check_constraint(:verification_codes, constraint_phone)
- add_check_constraint(:verification_codes, 'char_length(phone) <= 50', constraint_phone)
- end
-
- def down
- constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length')
- remove_check_constraint(:verification_codes, constraint_phone)
- add_check_constraint(:verification_codes, 'char_length(phone) <= 32', constraint_phone)
- end
-end
diff --git a/db/migrate/20211210031721_change_user_details_phone_text_limit.rb b/db/migrate/20211210031721_change_user_details_phone_text_limit.rb
deleted file mode 100644
index 5432f6d3d24..00000000000
--- a/db/migrate/20211210031721_change_user_details_phone_text_limit.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeUserDetailsPhoneTextLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_text_limit :user_details, :phone
- add_text_limit :user_details, :phone, 50
- end
-
- def down
- remove_text_limit :user_details, :phone
- add_text_limit :user_details, :phone, 32
- end
-end
diff --git a/db/migrate/20211213130324_update_timelogs_spent_at_default.rb b/db/migrate/20211213130324_update_timelogs_spent_at_default.rb
deleted file mode 100644
index f90b19b5f68..00000000000
--- a/db/migrate/20211213130324_update_timelogs_spent_at_default.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateTimelogsSpentAtDefault < Gitlab::Database::Migration[1.0]
- def change
- change_column_default(:timelogs, :spent_at, from: nil, to: -> { 'NOW()' })
- end
-end
diff --git a/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb b/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb
deleted file mode 100644
index ac7027bf082..00000000000
--- a/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSettingsUserEmailLookupLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_column :application_settings, :user_email_lookup_limit, :integer, null: false, default: 60
- end
-
- def down
- remove_column :application_settings, :user_email_lookup_limit
- end
-end
diff --git a/db/migrate/20211213154259_add_status_to_packages_package_files.rb b/db/migrate/20211213154259_add_status_to_packages_package_files.rb
deleted file mode 100644
index 38ea069a30b..00000000000
--- a/db/migrate/20211213154259_add_status_to_packages_package_files.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
- def change
- add_column :packages_package_files, :status, :smallint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb b/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb
deleted file mode 100644
index 7067e3efa6c..00000000000
--- a/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_package_files_on_package_id_status_and_id'
-
- def up
- add_concurrent_index :packages_package_files, [:package_id, :status, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb b/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb
deleted file mode 100644
index 99f985d528c..00000000000
--- a/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTempIndexFromVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'vulnerability_occurrences_location_temp_index'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :vulnerability_occurrences, :id, where: 'location IS NULL', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211215182006_update_application_settings_protected_paths.rb b/db/migrate/20211215182006_update_application_settings_protected_paths.rb
deleted file mode 100644
index f1c1dde55e0..00000000000
--- a/db/migrate/20211215182006_update_application_settings_protected_paths.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateApplicationSettingsProtectedPaths < Gitlab::Database::Migration[1.0]
- REMOVE_PROTECTED_PATHS = [
- '/oauth/authorize',
- '/oauth/token'
- ].freeze
-
- NEW_DEFAULT_PROTECTED_PATHS = [
- '/users/password',
- '/users/sign_in',
- '/api/v3/session.json',
- '/api/v3/session',
- '/api/v4/session.json',
- '/api/v4/session',
- '/users',
- '/users/confirmation',
- '/unsubscribes/',
- '/import/github/personal_access_token',
- '/admin/session'
- ].freeze
-
- OLD_DEFAULT_PROTECTED_PATHS = (NEW_DEFAULT_PROTECTED_PATHS + REMOVE_PROTECTED_PATHS).freeze
-
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = 'application_settings'
- end
-
- def up
- change_column_default(:application_settings, :protected_paths, NEW_DEFAULT_PROTECTED_PATHS)
-
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.where.not(protected_paths: nil).each do |application_setting|
- paths_to_remove = application_setting.protected_paths & REMOVE_PROTECTED_PATHS
-
- next if paths_to_remove.empty?
-
- updated_protected_paths = application_setting.protected_paths - paths_to_remove
- application_setting.update!(protected_paths: updated_protected_paths)
- end
- end
-
- def down
- change_column_default(:application_settings, :protected_paths, OLD_DEFAULT_PROTECTED_PATHS)
-
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.where.not(protected_paths: nil).each do |application_setting|
- paths_to_add = REMOVE_PROTECTED_PATHS - application_setting.protected_paths
-
- next if paths_to_add.empty?
-
- updated_protected_paths = application_setting.protected_paths + paths_to_add
- application_setting.update!(protected_paths: updated_protected_paths)
- end
- end
-end
diff --git a/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb b/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb
deleted file mode 100644
index 0bbd5c25df4..00000000000
--- a/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddClusterAgentIdToVulnerabilityReads < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
- def change
- add_column :vulnerability_reads, :cluster_agent_id, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb b/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
deleted file mode 100644
index f4776ff10a4..00000000000
--- a/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToVulnerabilityReadsClusterAgentId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :vulnerability_reads, :cluster_agent_id, 10
- end
-
- def down
- remove_text_limit :vulnerability_reads, :cluster_agent_id
- end
-end
diff --git a/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb b/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb
deleted file mode 100644
index 05928083823..00000000000
--- a/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToClusterAgentId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = "index_vulnerability_reads_on_cluster_agent_id"
- CLUSTER_IMAGE_SCANNING_REPORT_TYPE = 7
-
- def up
- add_concurrent_index :vulnerability_reads, :cluster_agent_id, where: "report_type = #{CLUSTER_IMAGE_SCANNING_REPORT_TYPE}", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211216220939_add_group_crm_settings.rb b/db/migrate/20211216220939_add_group_crm_settings.rb
deleted file mode 100644
index e931aa3709b..00000000000
--- a/db/migrate/20211216220939_add_group_crm_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupCrmSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- create_table :group_crm_settings, id: false do |t|
- t.references :group, primary_key: true, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.timestamps_with_timezone
- t.boolean :enabled, null: false, default: false
- end
- end
-end
diff --git a/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb b/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb
deleted file mode 100644
index fa81fa512ae..00000000000
--- a/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveArtifactsArchiveIdForeignKeyFromProjectPagesMetadata < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'fk_69366a119e'
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('lock table ci_job_artifacts, project_pages_metadata in access exclusive mode')
-
- remove_foreign_key :project_pages_metadata, to_table: :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME
- end
- end
-
- def down
- add_concurrent_foreign_key :project_pages_metadata, :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb b/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb
deleted file mode 100644
index cf9f2511176..00000000000
--- a/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecureScanningActionsToOnboardingProgresses < Gitlab::Database::Migration[1.0]
- def change
- change_table(:onboarding_progresses, bulk: true) do |t|
- t.column :secure_dependency_scanning_run_at, :datetime_with_timezone
- t.column :secure_container_scanning_run_at, :datetime_with_timezone
- t.column :secure_dast_run_at, :datetime_with_timezone
- t.column :secure_secret_detection_run_at, :datetime_with_timezone
- t.column :secure_coverage_fuzzing_run_at, :datetime_with_timezone
- t.column :secure_cluster_image_scanning_run_at, :datetime_with_timezone
- t.column :secure_api_fuzzing_run_at, :datetime_with_timezone
- end
- end
-end
diff --git a/db/migrate/20211223125921_add_temp_index_to_members_state.rb b/db/migrate/20211223125921_add_temp_index_to_members_state.rb
deleted file mode 100644
index 7dd2ec1a8aa..00000000000
--- a/db/migrate/20211223125921_add_temp_index_to_members_state.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddTempIndexToMembersState < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_members_on_state'
-
- def up
- # Temporary index to be removed in 14.9 https://gitlab.com/gitlab-org/gitlab/-/issues/349960
- add_concurrent_index :members, :state, name: INDEX_NAME, where: 'state = 2'
- end
-
- def down
- remove_concurrent_index_by_name :members, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb b/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb
deleted file mode 100644
index cb58033361f..00000000000
--- a/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddPackagesCleanupPackageFileWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :application_settings,
- :packages_cleanup_package_file_worker_capacity,
- :smallint,
- default: 2,
- null: false
- end
-end
diff --git a/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb b/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb
deleted file mode 100644
index 3a40540a1e1..00000000000
--- a/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddPackagesCleanupPackageFileWorkerCapacityCheckConstraintToAppSettings < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'app_settings_p_cleanup_package_file_worker_capacity_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :application_settings, 'packages_cleanup_package_file_worker_capacity >= 0', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :application_settings, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
deleted file mode 100644
index 2cef570966b..00000000000
--- a/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiRunnersIndexOnActiveState < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_runners_on_active'
-
- def up
- add_concurrent_index :ci_runners, [:active, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_runners, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb b/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb
deleted file mode 100644
index 046a628b8ae..00000000000
--- a/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddVerificationTokenToExternalAeDestinations < Gitlab::Database::Migration[1.0]
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- add_column :audit_events_external_audit_event_destinations, :verification_token, :text
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- remove_column :audit_events_external_audit_event_destinations, :verification_token
- end
-end
diff --git a/db/migrate/20220105121325_add_route_namespace_reference.rb b/db/migrate/20220105121325_add_route_namespace_reference.rb
deleted file mode 100644
index 77bd0530b8a..00000000000
--- a/db/migrate/20220105121325_add_route_namespace_reference.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddRouteNamespaceReference < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :routes, :namespace_id, :bigint unless column_exists?(:routes, :namespace_id)
- end
-
- def down
- remove_column :routes, :namespace_id if column_exists?(:routes, :namespace_id)
- end
-end
diff --git a/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb b/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb
deleted file mode 100644
index 58411c1dc0f..00000000000
--- a/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToUpdatedStateByUserIdToMergeRequestAssignees < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :merge_request_assignees, :users, column: :updated_state_by_user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :merge_request_assignees, column: :updated_state_by_user_id
- end
- end
-end
diff --git a/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb b/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb
deleted file mode 100644
index 13e375a5b97..00000000000
--- a/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToUpdatedStateByUserIdToMergeRequestReviewers < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :merge_request_reviewers, :users, column: :updated_state_by_user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :merge_request_reviewers, column: :updated_state_by_user_id
- end
- end
-end
diff --git a/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb b/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb
deleted file mode 100644
index 0049f4e00a2..00000000000
--- a/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-class AddInsertOrUpdateVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'insert_or_update_vulnerability_reads'
- TRIGGER_NAME = 'trigger_insert_or_update_vulnerability_reads_from_occurrences'
-
- def up
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{FUNCTION_NAME}()
- RETURNS TRIGGER
- LANGUAGE plpgsql
- AS $$
- DECLARE
- severity smallint;
- state smallint;
- report_type smallint;
- resolved_on_default_branch boolean;
- BEGIN
- IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN
- RETURN NULL;
- END IF;
-
- IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN
- RETURN NULL;
- END IF;
-
- SELECT
- vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch
- INTO
- severity, state, report_type, resolved_on_default_branch
- FROM
- vulnerabilities
- WHERE
- vulnerabilities.id = NEW.vulnerability_id;
-
- INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id)
- VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id')
- ON CONFLICT(vulnerability_id) DO NOTHING;
- RETURN NULL;
- END
- $$;
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_NAME}
- AFTER INSERT OR UPDATE ON vulnerability_occurrences
- FOR EACH ROW
- EXECUTE PROCEDURE #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:vulnerability_occurrences, TRIGGER_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb b/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb
deleted file mode 100644
index 940ec638924..00000000000
--- a/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdateVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- TRIGGER_NAME = 'trigger_update_vulnerability_reads_on_vulnerability_update'
- FUNCTION_NAME = 'update_vulnerability_reads_from_vulnerability'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE
- vulnerability_reads
- SET
- severity = NEW.severity,
- state = NEW.state,
- resolved_on_default_branch = NEW.resolved_on_default_branch
- WHERE vulnerability_id = NEW.id;
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_NAME}
- AFTER UPDATE ON vulnerabilities
- FOR EACH ROW
- WHEN (
- OLD.severity IS DISTINCT FROM NEW.severity OR
- OLD.state IS DISTINCT FROM NEW.state OR
- OLD.resolved_on_default_branch IS DISTINCT FROM NEW.resolved_on_default_branch
- )
- EXECUTE PROCEDURE #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:vulnerabilities, TRIGGER_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb b/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb
deleted file mode 100644
index a863fe8b7b8..00000000000
--- a/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdateVulnerabilityReadsLocationTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- TRIGGER_NAME = 'trigger_update_location_on_vulnerability_occurrences_update'
- FUNCTION_NAME = 'update_location_from_vulnerability_occurrences'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE
- vulnerability_reads
- SET
- location_image = NEW.location->>'image',
- cluster_agent_id = NEW.location->'kubernetes_resource'->>'agent_id'
- WHERE
- vulnerability_id = NEW.vulnerability_id;
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_NAME}
- AFTER UPDATE ON vulnerability_occurrences
- FOR EACH ROW
- WHEN (
- NEW.report_type IN (2, 7) AND (
- OLD.location->>'image' IS DISTINCT FROM NEW.location->>'image' OR
- OLD.location->'kubernetes_resource'->>'agent_id' IS DISTINCT FROM NEW.location->'kubernetes_resource'->>'agent_id'
- )
- )
- EXECUTE PROCEDURE #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:vulnerability_occurrences, TRIGGER_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20220106141756_remove_lock_version_indexes.rb b/db/migrate/20220106141756_remove_lock_version_indexes.rb
deleted file mode 100644
index 382f20dfc73..00000000000
--- a/db/migrate/20220106141756_remove_lock_version_indexes.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveLockVersionIndexes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEXES = {
- issues: 'index_issues_on_lock_version',
- merge_requests: 'index_merge_requests_on_lock_version',
- epics: 'index_epics_on_lock_version'
- }
-
- def up
- INDEXES.each do |table, index_name|
- remove_concurrent_index_by_name table, index_name
- end
- end
-
- def down
- INDEXES.each do |table, index_name|
- add_concurrent_index table, :lock_version, where: "lock_version IS NULL", name: index_name
- end
- end
-end
diff --git a/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb b/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb
deleted file mode 100644
index b3023a1f915..00000000000
--- a/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class AddHasIssuesOnVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- TRIGGER_ON_INSERT = 'trigger_update_has_issues_on_vulnerability_issue_links_update'
- INSERT_FUNCTION_NAME = 'set_has_issues_on_vulnerability_reads'
-
- TRIGGER_ON_DELETE = 'trigger_update_has_issues_on_vulnerability_issue_links_delete'
- DELETE_FUNCTION_NAME = 'unset_has_issues_on_vulnerability_reads'
-
- def up
- create_trigger_function(INSERT_FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE
- vulnerability_reads
- SET
- has_issues = true
- WHERE
- vulnerability_id = NEW.vulnerability_id AND has_issues IS FALSE;
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETE_FUNCTION_NAME}()
- RETURNS TRIGGER
- LANGUAGE plpgsql
- AS $$
- DECLARE
- has_issue_links integer;
- BEGIN
- PERFORM 1
- FROM
- vulnerability_reads
- WHERE
- vulnerability_id = OLD.vulnerability_id
- FOR UPDATE;
-
- SELECT 1 INTO has_issue_links FROM vulnerability_issue_links WHERE vulnerability_id = OLD.vulnerability_id LIMIT 1;
-
- IF (has_issue_links = 1) THEN
- RETURN NULL;
- END IF;
-
- UPDATE
- vulnerability_reads
- SET
- has_issues = false
- WHERE
- vulnerability_id = OLD.vulnerability_id;
-
- RETURN NULL;
- END
- $$;
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_INSERT}
- AFTER INSERT ON vulnerability_issue_links
- FOR EACH ROW
- EXECUTE FUNCTION #{INSERT_FUNCTION_NAME}();
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_DELETE}
- AFTER DELETE ON vulnerability_issue_links
- FOR EACH ROW
- EXECUTE FUNCTION #{DELETE_FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:vulnerability_issue_links, TRIGGER_ON_INSERT)
- drop_function(INSERT_FUNCTION_NAME)
- drop_trigger(:vulnerability_issue_links, TRIGGER_ON_DELETE)
- drop_function(DELETE_FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20220106230629_add_registry_migration_application_settings.rb b/db/migrate/20220106230629_add_registry_migration_application_settings.rb
deleted file mode 100644
index 191443de6eb..00000000000
--- a/db/migrate/20220106230629_add_registry_migration_application_settings.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddRegistryMigrationApplicationSettings < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
- def change
- add_column :application_settings, :container_registry_import_max_tags_count, :integer, default: 100, null: false
- add_column :application_settings, :container_registry_import_max_retries, :integer, default: 3, null: false
- add_column :application_settings, :container_registry_import_start_max_retries, :integer, default: 50, null: false
- add_column :application_settings, :container_registry_import_max_step_duration, :integer, default: 5.minutes, null: false
- add_column :application_settings, :container_registry_import_target_plan, :text, default: 'free', null: false
- add_column :application_settings, :container_registry_import_created_before, :datetime_with_timezone, default: '2022-01-23 00:00:00', null: false
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb b/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb
deleted file mode 100644
index 76dccbe785f..00000000000
--- a/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddMigrationColumnsToContainerRepositories < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
- def change
- add_column :container_repositories, :migration_pre_import_started_at, :datetime_with_timezone
- add_column :container_repositories, :migration_pre_import_done_at, :datetime_with_timezone
- add_column :container_repositories, :migration_import_started_at, :datetime_with_timezone
- add_column :container_repositories, :migration_import_done_at, :datetime_with_timezone
- add_column :container_repositories, :migration_aborted_at, :datetime_with_timezone
- add_column :container_repositories, :migration_skipped_at, :datetime_with_timezone
- add_column :container_repositories, :migration_retries_count, :integer, default: 0, null: false
- add_column :container_repositories, :migration_skipped_reason, :smallint
- add_column :container_repositories, :migration_state, :text, default: 'default', null: false
- add_column :container_repositories, :migration_aborted_in_state, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220107091629_add_route_namespace_index.rb b/db/migrate/20220107091629_add_route_namespace_index.rb
deleted file mode 100644
index bc1044a24da..00000000000
--- a/db/migrate/20220107091629_add_route_namespace_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddRouteNamespaceIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- INDEX_NAME = 'index_routes_on_namespace_id'
-
- def up
- add_concurrent_index :routes, :namespace_id, unique: true, name: INDEX_NAME
- add_concurrent_foreign_key :routes, :namespaces, column: :namespace_id, on_delete: :nullify, reverse_lock_order: true
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :routes, column: :namespace_id
- end
-
- remove_concurrent_index_by_name :routes, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220107165036_remove_note_id_index.rb b/db/migrate/20220107165036_remove_note_id_index.rb
deleted file mode 100644
index 15b4a3caf78..00000000000
--- a/db/migrate/20220107165036_remove_note_id_index.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNoteIdIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = :suggestions
- INDEX_NAME = 'index_suggestions_on_note_id'
-
- def up
- remove_concurrent_index_by_name TABLE, INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE, :note_id, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb b/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb
deleted file mode 100644
index abbd54ff19b..00000000000
--- a/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesLockVersionIndex < Gitlab::Database::Migration[1.0]
- TABLE = :ci_pipelines
- INDEX_NAME = 'tmp_index_ci_pipelines_lock_version'
- COLUMN = :id
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220110170953_create_ci_secure_files.rb b/db/migrate/20220110170953_create_ci_secure_files.rb
deleted file mode 100644
index 1498a2d0212..00000000000
--- a/db/migrate/20220110170953_create_ci_secure_files.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiSecureFiles < Gitlab::Database::Migration[1.0]
- def up
- create_table :ci_secure_files do |t|
- t.bigint :project_id, index: true, null: false
- t.timestamps_with_timezone null: false
- t.integer :file_store, limit: 2, null: false, default: 1
- t.integer :permissions, null: false, default: 0, limit: 2
- t.text :name, null: false, limit: 255
- t.text :file, null: false, limit: 255
- t.binary :checksum, null: false
- end
- end
-
- def down
- drop_table :ci_secure_files, if_exists: true
- end
-end
diff --git a/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb
deleted file mode 100644
index 969774983c4..00000000000
--- a/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class AddMaintainerNoteToCiRunners < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
- add_column :ci_runners, :maintainer_note, :text
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-end
diff --git a/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
deleted file mode 100644
index 0a0a4171306..00000000000
--- a/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToCiRunnersMaintainerNote < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :ci_runners, :maintainer_note, 255
- end
-
- def down
- remove_text_limit :ci_runners, :maintainer_note
- end
-end
diff --git a/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb b/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb
deleted file mode 100644
index b4d7c63d24b..00000000000
--- a/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddTokenExpiresAtToCiRunners < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_runners, :token_expires_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb b/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb
deleted file mode 100644
index 53623198f51..00000000000
--- a/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToCiRunnersTokenExpiresAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :asc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_and_id_desc'
- add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :desc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_desc_and_id_desc'
- end
-
- def down
- remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_desc_and_id_desc'
- remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_and_id_desc'
- end
-end
diff --git a/db/migrate/20220111200254_remove_index_from_merge_requests.rb b/db/migrate/20220111200254_remove_index_from_merge_requests.rb
deleted file mode 100644
index 0ac6019ad5e..00000000000
--- a/db/migrate/20220111200254_remove_index_from_merge_requests.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexFromMergeRequests < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_merge_requests_on_title'
-
- def up
- remove_concurrent_index :merge_requests, :title, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :merge_requests, :title, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220112115413_add_requires_verification_to_user_details.rb b/db/migrate/20220112115413_add_requires_verification_to_user_details.rb
deleted file mode 100644
index 01fe4f1d5cf..00000000000
--- a/db/migrate/20220112115413_add_requires_verification_to_user_details.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequiresVerificationToUserDetails < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :user_details, :requires_credit_card_verification, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20220112205111_create_security_training_providers.rb b/db/migrate/20220112205111_create_security_training_providers.rb
deleted file mode 100644
index afddec6a134..00000000000
--- a/db/migrate/20220112205111_create_security_training_providers.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class CreateSecurityTrainingProviders < Gitlab::Database::Migration[1.0]
- def change
- create_table :security_training_providers do |t|
- t.text :name, limit: 256, null: false
- t.text :description, limit: 512
- t.text :url, limit: 512, null: false
- t.text :logo_url, limit: 512
-
- t.timestamps_with_timezone null: false
- end
- end
-end
diff --git a/db/migrate/20220112232037_add_member_namespace_reference.rb b/db/migrate/20220112232037_add_member_namespace_reference.rb
deleted file mode 100644
index d67ea09a78c..00000000000
--- a/db/migrate/20220112232037_add_member_namespace_reference.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddMemberNamespaceReference < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :members, :member_namespace_id, :bigint unless column_exists?(:members, :member_namespace_id)
- end
-
- def down
- remove_column :members, :member_namespace_id if column_exists?(:members, :member_namespace_id)
- end
-end
diff --git a/db/migrate/20220112232605_add_member_namespace_index.rb b/db/migrate/20220112232605_add_member_namespace_index.rb
deleted file mode 100644
index ba32df53ae7..00000000000
--- a/db/migrate/20220112232605_add_member_namespace_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddMemberNamespaceIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- INDEX_NAME = 'index_members_on_member_namespace_id'
-
- def up
- add_concurrent_index :members, :member_namespace_id, unique: false, name: INDEX_NAME
- add_concurrent_foreign_key :members, :namespaces, column: :member_namespace_id, on_delete: :nullify, reverse_lock_order: true
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :members, column: :member_namespace_id
- end
-
- remove_concurrent_index_by_name :members, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220113125401_create_security_trainings.rb b/db/migrate/20220113125401_create_security_trainings.rb
deleted file mode 100644
index 6924c7bd189..00000000000
--- a/db/migrate/20220113125401_create_security_trainings.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateSecurityTrainings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- create_table :security_trainings do |t|
- t.references :project, null: false, foreign_key: { on_delete: :cascade }
- t.references :provider, null: false, foreign_key: { to_table: :security_training_providers, on_delete: :cascade }
- t.boolean :is_primary, default: false, null: false
-
- t.timestamps_with_timezone null: false
-
- # Guarantee that there will be only one primary per project
- t.index :project_id, name: 'index_security_trainings_on_unique_project_id', unique: true, where: 'is_primary IS TRUE'
- end
- end
-end
diff --git a/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb b/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb
deleted file mode 100644
index 6d3deacdda3..00000000000
--- a/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddPackageFilesLimitToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :max_package_files_for_package_destruction, :smallint, default: 100, null: false
- end
-end
diff --git a/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb b/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb
deleted file mode 100644
index 65fbccbd1ae..00000000000
--- a/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddApplicationSettingsPackageFilesLimitConstraints < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'app_settings_max_package_files_for_package_destruction_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :application_settings, 'max_package_files_for_package_destruction > 0', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :application_settings, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb b/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb
deleted file mode 100644
index 00e8e574722..00000000000
--- a/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddDiffsColorsToUserPreferences < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb
- def change
- add_column :user_preferences, :diffs_deletion_color, :text
- add_column :user_preferences, :diffs_addition_color, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb b/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb
deleted file mode 100644
index 9ae1c875194..00000000000
--- a/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserPreferencesDiffsColors < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_preferences, :diffs_deletion_color, 7
- add_text_limit :user_preferences, :diffs_addition_color, 7
- end
-
- def down
- remove_text_limit :user_preferences, :diffs_addition_color
- remove_text_limit :user_preferences, :diffs_deletion_color
- end
-end
diff --git a/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb b/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb
deleted file mode 100644
index 948edea1138..00000000000
--- a/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusOnlyIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_package_files_on_status'
-
- def up
- add_concurrent_index :packages_package_files, :status, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb b/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb
deleted file mode 100644
index 9978e87a1e3..00000000000
--- a/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToExadVerificationTokens < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :audit_events_external_audit_event_destinations, :verification_token, 24
- end
-
- def down
- remove_text_limit :audit_events_external_audit_event_destinations, :verification_token
- end
-end
diff --git a/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb b/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
deleted file mode 100644
index 91c0612716b..00000000000
--- a/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitsToContainerRepositoriesMigrationColumns < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :container_repositories, :migration_state, 255
- add_text_limit :container_repositories, :migration_aborted_in_state, 255
- end
-
- def down
- remove_text_limit :container_repositories, :migration_state
- remove_text_limit :container_repositories, :migration_aborted_in_state
- end
-end
diff --git a/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb b/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb
deleted file mode 100644
index 55d820c1256..00000000000
--- a/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddUrlTextToIssuableMetricImages < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220118020026_add_url_text_limit_to_issuable_metric_images
- def change
- add_column :issuable_metric_images, :url_text, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb b/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb
deleted file mode 100644
index 2f0f27681cd..00000000000
--- a/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddUrlTextLimitToIssuableMetricImages < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :issuable_metric_images, :url_text, 128
- end
-
- def down
- remove_text_limit :issuable_metric_images, :url_text
- end
-end
diff --git a/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb b/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
deleted file mode 100644
index c7247d03423..00000000000
--- a/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToContainerRegistryImportTargetPlan < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :container_registry_import_target_plan, 255
- end
-
- def down
- remove_text_limit :application_settings, :container_registry_import_target_plan
- end
-end
diff --git a/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb b/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb
deleted file mode 100644
index 32ca8a5fb12..00000000000
--- a/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunnerTokenExpirationIntervalSettingsToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- [:runner_token_expiration_interval, :group_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field|
- add_column :application_settings, field, :integer
- end
- end
-end
diff --git a/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb b/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb
deleted file mode 100644
index 7b83cb2dd55..00000000000
--- a/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunnerTokenExpirationIntervalSettingsToNamespaceSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- [:runner_token_expiration_interval, :subgroup_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field|
- add_column :namespace_settings, field, :integer
- end
- end
-end
diff --git a/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb b/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb
deleted file mode 100644
index ef959171828..00000000000
--- a/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunnerTokenExpirationIntervalSettingsToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_ci_cd_settings, :runner_token_expiration_interval, :integer
- end
-end
diff --git a/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb b/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb
deleted file mode 100644
index bd40fe2203e..00000000000
--- a/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToAedVerificationToken < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_audit_events_external_audit_on_verification_token'
-
- def up
- add_concurrent_index :audit_events_external_audit_event_destinations, :verification_token, unique: true, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :audit_events_external_audit_event_destinations, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb b/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb
deleted file mode 100644
index d8107ad8e21..00000000000
--- a/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDependencyProxySizeToNamespaceStatistics < Gitlab::Database::Migration[1.0]
- def change
- add_column :namespace_statistics, :dependency_proxy_size, :bigint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb b/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb
deleted file mode 100644
index 8218f869ce6..00000000000
--- a/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDependencyProxySizeToNamespaceRootStorageStatistics < Gitlab::Database::Migration[1.0]
- def change
- add_column :namespace_root_storage_statistics, :dependency_proxy_size, :bigint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb b/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb
deleted file mode 100644
index 26859beb671..00000000000
--- a/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTemporaryVulnerabilityOccurrencesDeduplicationIndex < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
- INDEX_NAME = 'tmp_idx_deduplicate_vulnerability_occurrences'
-
- disable_ddl_transaction!
-
- def up
- finalize_background_migration(MIGRATION)
-
- remove_concurrent_index_by_name(:vulnerability_occurrences, INDEX_NAME)
- end
-
- def down
- add_concurrent_index :vulnerability_occurrences,
- %i[project_id report_type location_fingerprint primary_identifier_id id],
- name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb b/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb
deleted file mode 100644
index f7b7580d673..00000000000
--- a/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddScanMethodToDastSiteProfile < Gitlab::Database::Migration[1.0]
- def up
- add_column :dast_site_profiles, :scan_method, :integer, limit: 2, default: 0, null: false
- end
-
- def down
- remove_column :dast_site_profiles, :scan_method
- end
-end
diff --git a/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb b/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb
deleted file mode 100644
index e98392190f4..00000000000
--- a/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAlertManagementAlertMetricImages < Gitlab::Database::Migration[1.0]
- def up
- create_table :alert_management_alert_metric_images do |t|
- t.references :alert, null: false, index: true, foreign_key: { to_table: :alert_management_alerts, on_delete: :cascade }
- t.timestamps_with_timezone
- t.integer :file_store, limit: 2
- t.text :file, limit: 255, null: false
- t.text :url, limit: 255
- t.text :url_text, limit: 128
- end
- end
-
- def down
- drop_table :alert_management_alert_metric_images, if_exists: true
- end
-end
diff --git a/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb b/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb
deleted file mode 100644
index bcf32d2abd0..00000000000
--- a/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiRunnerProjectIndexToRunnerIdAndProjectId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- OLD_INDEX_NAME = 'index_ci_runner_projects_on_runner_id'
- NEW_INDEX_NAME = 'index_ci_runner_projects_on_runner_id_and_project_id'
- TABLE_NAME = :ci_runner_projects
-
- def up
- add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], name: NEW_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(TABLE_NAME, :runner_id, name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, NEW_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb b/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb
deleted file mode 100644
index 747cabcd865..00000000000
--- a/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTempIndexOnIdFromVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb b/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb
deleted file mode 100644
index 527d8783a0f..00000000000
--- a/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class TempIndexForGroupNamespaceMemberBackfill < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_index_for_namespace_id_migration_on_group_members'
-
- disable_ddl_transaction!
-
- def up
- # Temporary index to be removed in 14.10
- # https://gitlab.com/gitlab-org/gitlab/-/issues/353538
- add_concurrent_index :members, :id, where: "members.member_namespace_id IS NULL and members.type = 'GroupMember'", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :members, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220124200927_add_index_to_issues.rb b/db/migrate/20220124200927_add_index_to_issues.rb
deleted file mode 100644
index 03cdc3ade2c..00000000000
--- a/db/migrate/20220124200927_add_index_to_issues.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToIssues < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issues_on_id_and_weight'
-
- def up
- add_concurrent_index :issues, [:id, :weight], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issues, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb b/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb
deleted file mode 100644
index e0c80ad79e5..00000000000
--- a/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddCleanupAttemptsToLooseForeignKeysDeletedRecords < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :loose_foreign_keys_deleted_records, :cleanup_attempts, :smallint, default: 0
- end
-
- def down
- remove_column :loose_foreign_keys_deleted_records, :cleanup_attempts
- end
-end
diff --git a/db/migrate/20220125122228_add_topics_non_private_projects_count.rb b/db/migrate/20220125122228_add_topics_non_private_projects_count.rb
deleted file mode 100644
index 8c7b750d5ff..00000000000
--- a/db/migrate/20220125122228_add_topics_non_private_projects_count.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0]
- def up
- add_column :topics, :non_private_projects_count, :bigint, null: false, default: 0
- end
-
- def down
- remove_column :topics, :non_private_projects_count
- end
-end
diff --git a/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb b/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb
deleted file mode 100644
index 46b4d298a2e..00000000000
--- a/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsNonPrivateProjectsCountIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_topics_non_private_projects_count'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :topics, [:non_private_projects_count, :id], order: { non_private_projects_count: :desc }, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :topics, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb b/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb
deleted file mode 100644
index c745fa51328..00000000000
--- a/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddCompoundIndexOnProjectIdAndIdForVulnerabilities < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb b/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb
deleted file mode 100644
index 1acd9599da4..00000000000
--- a/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddEcdsaSkAndEd25519SkKeyRestrictionsToApplicationSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :application_settings, :ecdsa_sk_key_restriction, :integer, default: 0, null: false
- add_column :application_settings, :ed25519_sk_key_restriction, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb b/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb
deleted file mode 100644
index 6c9fb20bbbd..00000000000
--- a/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnMigrationStateAndImportDoneAtToContainerRepositories < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_container_repositories_on_migration_state_import_done_at'
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :container_repositories, [:migration_state, :migration_import_done_at], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb b/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb
deleted file mode 100644
index 50aa0121055..00000000000
--- a/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddSeverityLevelToMergeRequestsComplianceViolations < Gitlab::Database::Migration[1.0]
- def change
- add_column :merge_requests_compliance_violations, :severity_level, :integer, limit: 2, null: false, default: 0
- end
-end
diff --git a/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb b/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb
deleted file mode 100644
index 1811bf04ee4..00000000000
--- a/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddShowDiffPreviewInEmailToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_settings, :show_diff_preview_in_email, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb b/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb
deleted file mode 100644
index 89591d14aae..00000000000
--- a/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexForVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerability_occurrences_on_unique_keys'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
- end
-
- def down
- # no-op
-
- # The index is UNIQUE so we cannot add it back again
- end
-end
diff --git a/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb b/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb
deleted file mode 100644
index b999c871a3e..00000000000
--- a/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddTmpIndexOnIdAndMigrationStateToContainerRepositories < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_index_container_repositories_on_id_migration_state'
-
- disable_ddl_transaction!
-
- # Temporary index to be removed https://gitlab.com/gitlab-org/gitlab/-/issues/351783
- def up
- add_concurrent_index :container_repositories, [:id, :migration_state], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb b/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb
deleted file mode 100644
index 673d066e3c0..00000000000
--- a/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddMigrationIndexesToContainerRepositories < Gitlab::Database::Migration[1.0]
- PRE_IMPORTING_INDEX = 'idx_container_repos_on_pre_import_started_at_when_pre_importing'
- PRE_IMPORT_DONE_INDEX = 'idx_container_repos_on_pre_import_done_at_when_pre_import_done'
- IMPORTING_INDEX = 'idx_container_repos_on_import_started_at_when_importing'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :container_repositories, :migration_pre_import_started_at, name: PRE_IMPORTING_INDEX, where: "migration_state = 'pre_importing'"
- add_concurrent_index :container_repositories, :migration_pre_import_done_at, name: PRE_IMPORT_DONE_INDEX, where: "migration_state = 'pre_import_done'"
- add_concurrent_index :container_repositories, :migration_import_started_at, name: IMPORTING_INDEX, where: "migration_state = 'importing'"
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, IMPORTING_INDEX
- remove_concurrent_index_by_name :container_repositories, PRE_IMPORT_DONE_INDEX
- remove_concurrent_index_by_name :container_repositories, PRE_IMPORTING_INDEX
- end
-end
diff --git a/db/migrate/20220203074916_add_topics_lower_name_index.rb b/db/migrate/20220203074916_add_topics_lower_name_index.rb
deleted file mode 100644
index 721abf66c67..00000000000
--- a/db/migrate/20220203074916_add_topics_lower_name_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsLowerNameIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_topics_on_lower_name'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :topics, 'lower(name)', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :topics, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb b/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb
deleted file mode 100644
index c30d8de23db..00000000000
--- a/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class FixUniquePackagesIndexExcludingPendingDestructionStatus < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- GO_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_golang'
- GENERIC_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_generic'
- HELM_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_helm'
-
- NEW_GO_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_golang'
- NEW_GENERIC_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_generic'
- NEW_HELM_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_helm'
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_GO_UNIQUE_INDEX_NAME, where: 'package_type = 8 AND status != 4'
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_GENERIC_UNIQUE_INDEX_NAME, where: 'package_type = 7 AND status != 4'
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_HELM_UNIQUE_INDEX_NAME, where: 'package_type = 11 AND status != 4'
-
- remove_concurrent_index_by_name :packages_packages, GO_UNIQUE_INDEX_NAME
- remove_concurrent_index_by_name :packages_packages, GENERIC_UNIQUE_INDEX_NAME
- remove_concurrent_index_by_name :packages_packages, HELM_UNIQUE_INDEX_NAME
- end
-
- def down
- # no-op
- # We can't guarantee that the old index can be recreated since it targets a set larger that the new index.
- end
-end
diff --git a/db/migrate/20220203123333_add_batched_migration_max_batch.rb b/db/migrate/20220203123333_add_batched_migration_max_batch.rb
deleted file mode 100644
index d16c6dd4110..00000000000
--- a/db/migrate/20220203123333_add_batched_migration_max_batch.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddBatchedMigrationMaxBatch < Gitlab::Database::Migration[1.0]
- def change
- add_column :batched_background_migrations, :max_batch_size, :integer
- end
-end
diff --git a/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb b/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb
deleted file mode 100644
index 47f92fae496..00000000000
--- a/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddLegacyOpenSourceLicenseAvailableToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_settings, :legacy_open_source_license_available, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20220203134942_add_hidden_to_projects.rb b/db/migrate/20220203134942_add_hidden_to_projects.rb
deleted file mode 100644
index 7046d641289..00000000000
--- a/db/migrate/20220203134942_add_hidden_to_projects.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddHiddenToProjects < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
-
- enable_lock_retries!
-
- def change
- add_column :projects, :hidden, :boolean, default: false, null: false # rubocop: disable Migration/AddColumnsToWideTables
- end
-end
diff --git a/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb b/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb
deleted file mode 100644
index 0339e16a85b..00000000000
--- a/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-class CreateAnalyticsCycleAnalyticsAggregations < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- create_table :analytics_cycle_analytics_aggregations, id: false do |t|
- t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.integer :incremental_runtimes_in_seconds, array: true, default: [], null: false
- t.integer :incremental_processed_records, array: true, default: [], null: false
- t.integer :last_full_run_runtimes_in_seconds, array: true, default: [], null: false
- t.integer :last_full_run_processed_records, array: true, default: [], null: false
- t.integer :last_incremental_issues_id
- t.integer :last_incremental_merge_requests_id
- t.integer :last_full_run_issues_id
- t.integer :last_full_run_merge_requests_id
-
- t.datetime_with_timezone :last_incremental_run_at
- t.datetime_with_timezone :last_incremental_issues_updated_at
- t.datetime_with_timezone :last_incremental_merge_requests_updated_at
- t.datetime_with_timezone :last_full_run_at
- t.datetime_with_timezone :last_full_run_issues_updated_at
- t.datetime_with_timezone :last_full_run_mrs_updated_at
- t.datetime_with_timezone :last_consistency_check_updated_at
-
- t.boolean :enabled, default: true, null: false
-
- t.index :last_incremental_run_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_incremental_run_at', order: { last_incremental_run_at: 'ASC NULLS FIRST' }
- t.index :last_full_run_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_full_run_at', order: { last_full_run_at: 'ASC NULLS FIRST' }
- t.index :last_consistency_check_updated_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_consistency_check_updated_at', order: { last_consistency_check_updated_at: 'ASC NULLS FIRST' }
-
- t.check_constraint 'CARDINALITY(incremental_runtimes_in_seconds) <= 10'
- t.check_constraint 'CARDINALITY(incremental_processed_records) <= 10'
- t.check_constraint 'CARDINALITY(last_full_run_runtimes_in_seconds) <= 10'
- t.check_constraint 'CARDINALITY(last_full_run_processed_records) <= 10'
- end
-
- execute("ALTER TABLE analytics_cycle_analytics_aggregations ADD PRIMARY KEY (group_id)")
- end
-
- def down
- drop_table :analytics_cycle_analytics_aggregations
- end
-end
diff --git a/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb b/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb
deleted file mode 100644
index 455a8478cc4..00000000000
--- a/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnGreatestDoneAtToContainerRepositories < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_container_repositories_on_greatest_done_at'
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :container_repositories,
- 'GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at)',
- where: "migration_state IN ('import_done', 'pre_import_done', 'import_aborted')",
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220204193000_add_integrations_encrypted_properties.rb b/db/migrate/20220204193000_add_integrations_encrypted_properties.rb
deleted file mode 100644
index 7df88b68657..00000000000
--- a/db/migrate/20220204193000_add_integrations_encrypted_properties.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddIntegrationsEncryptedProperties < Gitlab::Database::Migration[1.0]
- def change
- add_column :integrations, :encrypted_properties, :binary
- add_column :integrations, :encrypted_properties_iv, :binary
- end
-end
diff --git a/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb b/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb
deleted file mode 100644
index cdf2aced213..00000000000
--- a/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUsersGetByIdLimitToApplicationSetting < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :application_settings, :users_get_by_id_limit, :integer, null: false, default: 300
- add_column :application_settings, :users_get_by_id_limit_allowlist, :text, array: true, limit: 255, null: false, default: []
- end
-
- def down
- remove_column :application_settings, :users_get_by_id_limit
- remove_column :application_settings, :users_get_by_id_limit_allowlist
- end
-end
diff --git a/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb b/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb
deleted file mode 100644
index 9b2ba17e068..00000000000
--- a/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotValidForeignKeyToCiBuildsRunnerId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :ci_builds, :ci_runners, column: :runner_id, on_delete: :nullify, validate: false
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :ci_builds, column: :runner_id
- end
- end
-end
diff --git a/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb b/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb
deleted file mode 100644
index b01dbe642e2..00000000000
--- a/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# 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 UpdateDefaultScanMethodOfDastSiteProfile < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 500
-
- disable_ddl_transaction!
-
- def up
- each_batch_range('dast_site_profiles', scope: ->(table) { table.where(target_type: 1) }, of: BATCH_SIZE) do |min, max|
- execute <<~SQL
- UPDATE dast_site_profiles
- SET scan_method = 1
- WHERE id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # noop
- end
-end
diff --git a/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb b/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb
deleted file mode 100644
index 5ab8feb2195..00000000000
--- a/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupPopulateTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0]
- MIGRATION = 'PopulateTopicsNonPrivateProjectsCount'
-
- disable_ddl_transaction!
-
- def up
- finalize_background_migration(MIGRATION)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20220211125954_create_related_epic_links.rb b/db/migrate/20220211125954_create_related_epic_links.rb
deleted file mode 100644
index c06a68a9dd2..00000000000
--- a/db/migrate/20220211125954_create_related_epic_links.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateRelatedEpicLinks < Gitlab::Database::Migration[1.0]
- def up
- create_table :related_epic_links do |t|
- t.references :source, index: true, foreign_key: { to_table: :epics, on_delete: :cascade }, null: false
- t.references :target, index: true, foreign_key: { to_table: :epics, on_delete: :cascade }, null: false
- t.timestamps_with_timezone null: false
- t.integer :link_type, null: false, default: 0, limit: 2
-
- t.index [:source_id, :target_id], unique: true
- end
- end
-
- def down
- drop_table :related_epic_links
- end
-end
diff --git a/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb b/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb
deleted file mode 100644
index 7a60ea48f40..00000000000
--- a/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIntegrationsTriggerTypeNewOnInsertNullSafe < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'integrations_set_type_new'
-
- def up
- # Update `type_new` dynamically based on `type`, if `type_new` is null
- # and `type` dynamically based on `type_new`, if `type` is null.
- #
- # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL.squish
- UPDATE integrations
- SET type_new = COALESCE(NEW.type_new, regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1'))
- , type = COALESCE(NEW.type, regexp_replace(NEW.type_new, '\\AIntegrations::(.+)\\Z', '\\1Service'))
- WHERE integrations.id = NEW.id;
- RETURN NULL;
- SQL
- end
- end
-
- def down
- # Update `type_new` dynamically based on `type`.
- #
- # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE integrations SET type_new = regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1')
- WHERE integrations.id = NEW.id;
- RETURN NULL;
- SQL
- end
- end
-end
diff --git a/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb b/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb
deleted file mode 100644
index 4b743f84c4d..00000000000
--- a/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-class UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault < Gitlab::Database::Migration[1.0]
- class Settings < ActiveRecord::Base
- self.table_name = 'application_settings'
- end
-
- def up
- change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, from: 0, to: 4)
-
- current_settings = Settings.first
-
- if current_settings&.container_registry_expiration_policies_worker_capacity == 0
- current_settings.update!(container_registry_expiration_policies_worker_capacity: 4)
- end
- end
-
- def down
- change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, from: 4, to: 0)
- end
-end
diff --git a/db/migrate/20220216110023_create_saved_replies.rb b/db/migrate/20220216110023_create_saved_replies.rb
deleted file mode 100644
index e4b6c039dee..00000000000
--- a/db/migrate/20220216110023_create_saved_replies.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateSavedReplies < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- create_table :saved_replies do |t|
- t.references :user, index: false, null: false, foreign_key: { on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.text :name, null: false, limit: 255
- t.text :content, null: false, limit: 10000
-
- t.index [:user_id, :name], name: 'index_saved_replies_on_name_text_pattern_ops', unique: true, opclass: { name: :text_pattern_ops }
- end
- end
-
- def down
- drop_table :saved_replies, if_exists: true
- end
-end
diff --git a/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb b/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb
deleted file mode 100644
index bd5b13ffa1c..00000000000
--- a/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddContainerRegistryExpirationPoliciesCachingToApplicationSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :application_settings, :container_registry_expiration_policies_caching, :boolean, null: false, default: true
- end
-
- def down
- remove_column :application_settings, :container_registry_expiration_policies_caching
- end
-end
diff --git a/db/migrate/20220217113058_add_status_to_status_check_responses.rb b/db/migrate/20220217113058_add_status_to_status_check_responses.rb
deleted file mode 100644
index 2f118677883..00000000000
--- a/db/migrate/20220217113058_add_status_to_status_check_responses.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToStatusCheckResponses < Gitlab::Database::Migration[1.0]
- def change
- add_column :status_check_responses, :status, :integer, default: 0, null: false, limit: 2
- end
-end
diff --git a/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb b/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb
deleted file mode 100644
index fd353843878..00000000000
--- a/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddTargetAccessLevelsToBroadcastMessages < Gitlab::Database::Migration[1.0]
- def up
- add_column :broadcast_messages, :target_access_levels, :integer, if_not_exists: true, array: true, null: false, default: []
- end
-
- def down
- remove_column :broadcast_messages, :target_access_levels, if_exists: true
- end
-end
diff --git a/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb b/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb
deleted file mode 100644
index 42828086310..00000000000
--- a/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityOrchestrationPolicyConfigurationNamespaceReference < Gitlab::Database::Migration[1.0]
- def up
- add_column :security_orchestration_policy_configurations, :namespace_id, :bigint
- end
-
- def down
- remove_column :security_orchestration_policy_configurations, :namespace_id
- end
-end
diff --git a/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb b/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb
deleted file mode 100644
index de6b36faa65..00000000000
--- a/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityOrchestrationPolicyConfigurationNamespaceIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- INDEX_NAME = 'partial_index_sop_configs_on_namespace_id'
-
- def up
- add_concurrent_index :security_orchestration_policy_configurations, :namespace_id, unique: true, name: INDEX_NAME, where: 'namespace_id IS NOT NULL'
- add_concurrent_foreign_key :security_orchestration_policy_configurations, :namespaces, column: :namespace_id, on_delete: :cascade, reverse_lock_order: true
-
- add_check_constraint :security_orchestration_policy_configurations,
- "((project_id IS NULL) != (namespace_id IS NULL))",
- :cop_configs_project_or_namespace_existence
- end
-
- def down
- exec_query 'DELETE FROM security_orchestration_policy_configurations WHERE namespace_id IS NOT NULL'
-
- remove_check_constraint :security_orchestration_policy_configurations, :cop_configs_project_or_namespace_existence
-
- with_lock_retries do
- remove_foreign_key_if_exists :security_orchestration_policy_configurations, column: :namespace_id
- end
-
- remove_concurrent_index_by_name :security_orchestration_policy_configurations, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb b/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb
deleted file mode 100644
index 79ffcb2cbb3..00000000000
--- a/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotNullConstraintToSecurityPolicyConfigurations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- change_column_null :security_orchestration_policy_configurations, :project_id, true
- end
-
- def down
- exec_query 'DELETE FROM security_orchestration_policy_configurations WHERE project_id IS NULL'
- change_column_null :security_orchestration_policy_configurations, :project_id, false
- end
-end
diff --git a/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb b/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb
deleted file mode 100644
index 53706d46979..00000000000
--- a/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeSecurityOrchestrationPolicyConfigurationProjectIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- OLD_INDEX_NAME = 'index_sop_configs_on_project_id'
- NEW_INDEX_NAME = 'partial_index_sop_configs_on_project_id'
-
- def up
- add_concurrent_index :security_orchestration_policy_configurations, :project_id, unique: true, name: NEW_INDEX_NAME, where: 'project_id IS NOT NULL'
- remove_concurrent_index_by_name :security_orchestration_policy_configurations, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :security_orchestration_policy_configurations, :project_id, unique: true, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :security_orchestration_policy_configurations, NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb b/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb
deleted file mode 100644
index fd01437d045..00000000000
--- a/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectBuildArtifactsSizeRefresh < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- CREATED_STATE = 1
-
- def change
- create_table :project_build_artifacts_size_refreshes do |t|
- t.references :project, index: { unique: true }, foreign_key: { on_delete: :cascade }, null: false
- t.bigint :last_job_artifact_id, null: true
- t.integer :state, null: false, default: CREATED_STATE, limit: 1
- t.datetime_with_timezone :refresh_started_at, null: true
- t.timestamps_with_timezone null: false
-
- # We will use this index for 2 purposes:
- # - for finding rows with state = :waiting
- # - for finding rows with state = :running and updated_at < x.days.ago
- # which we can use to find jobs that were not able to complete and considered
- # stale so we can retry
- t.index [:state, :updated_at], name: 'idx_build_artifacts_size_refreshes_state_updated_at'
- end
- end
-end
diff --git a/db/migrate/20220302110724_add_group_features_table.rb b/db/migrate/20220302110724_add_group_features_table.rb
deleted file mode 100644
index 9d9204afec2..00000000000
--- a/db/migrate/20220302110724_add_group_features_table.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupFeaturesTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- create_table :group_features, id: false do |t|
- t.references :group, index: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false
- t.timestamps_with_timezone null: false
- t.integer :wiki_access_level, default: Featurable::ENABLED, null: false, limit: 2
- end
-
- execute('ALTER TABLE group_features ADD PRIMARY KEY (group_id)')
- end
-
- def down
- drop_table :group_features
- end
-end
diff --git a/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb b/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb
deleted file mode 100644
index 56b873c009a..00000000000
--- a/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddCommentToDeploymentApprovals < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220303191047_add_text_limit_to_deployment_approvals_comment
- def change
- add_column :deployment_approvals, :comment, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb b/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb
deleted file mode 100644
index 70c7f5f3a7b..00000000000
--- a/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToDeploymentApprovalsComment < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :deployment_approvals, :comment, 255
- end
-
- def down
- remove_text_limit :deployment_approvals, :comment
- end
-end
diff --git a/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb b/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb
deleted file mode 100644
index f429303ab83..00000000000
--- a/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotNullContraintOnTitleFromSprints < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- change_column_null :sprints, :title, true
- end
-
- def down
- execute <<~SQL
- UPDATE sprints SET title = id WHERE title IS NULL
- SQL
-
- change_column_null :sprints, :title, false
- end
-end
diff --git a/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb b/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb
deleted file mode 100644
index 8c223bbce01..00000000000
--- a/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUniqueIndexForSprintsOnIterationsCadenceIdAndTitle < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_sprints_on_iterations_cadence_id_and_title'
-
- def up
- remove_concurrent_index_by_name :sprints, INDEX_NAME
- end
-
- def down
- add_concurrent_index :sprints, [:iterations_cadence_id, :title], name: INDEX_NAME, unique: true
- end
-end
diff --git a/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb b/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb
deleted file mode 100644
index 34a357bdc5c..00000000000
--- a/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUniqueIndexForSprintsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_sprints_on_project_id_and_title'
-
- def up
- remove_concurrent_index_by_name :sprints, INDEX_NAME
- end
-
- def down
- add_concurrent_index :sprints, [:project_id, :title], where: "project_id IS NOT NULL", name: INDEX_NAME, unique: true
- end
-end
diff --git a/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb b/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb
deleted file mode 100644
index 56297565cb4..00000000000
--- a/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddDefaultToRequiredPythonOnPackagesPypiMetadata < Gitlab::Database::Migration[1.0]
- def up
- change_column_default(:packages_pypi_metadata, :required_python, '')
- end
-
- def down
- change_column_default(:packages_pypi_metadata, :required_python, nil)
- end
-end
diff --git a/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb b/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb
deleted file mode 100644
index 62fe55b22f2..00000000000
--- a/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RenameUserEmailLookupLimitSettingToSearchSettings < Gitlab::Database::Migration[1.0]
- def up
- add_column :application_settings, :search_rate_limit, :integer, null: false, default: 30
- add_column :application_settings, :search_rate_limit_unauthenticated, :integer, null: false, default: 10
- end
-
- def down
- remove_column :application_settings, :search_rate_limit
- remove_column :application_settings, :search_rate_limit_unauthenticated
- end
-end
diff --git a/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb b/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb
deleted file mode 100644
index 5cb49a9899a..00000000000
--- a/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimeToRestoreServiceDoraMetric < Gitlab::Database::Migration[1.0]
- def change
- add_column :dora_daily_metrics, :time_to_restore_service_in_seconds, :integer
- end
-end
diff --git a/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb b/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb
deleted file mode 100644
index 7752fbba12f..00000000000
--- a/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddDatabaseGrafanaConfigToApplicationSettings < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220307002607_add_text_limit_to_db_reindexing_grafana_application_settings
- def change
- add_column :application_settings, :encrypted_database_grafana_api_key, :binary
- add_column :application_settings, :encrypted_database_grafana_api_key_iv, :binary
- add_column :application_settings, :database_grafana_api_url, :text
- add_column :application_settings, :database_grafana_tag, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb b/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb
deleted file mode 100644
index 72bcf493d6e..00000000000
--- a/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToDatabaseGrafanaApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :database_grafana_api_url, 255
- add_text_limit :application_settings, :database_grafana_tag, 255
- end
-
- def down
- remove_text_limit :application_settings, :database_grafana_tag
- remove_text_limit :application_settings, :database_grafana_api_url
- end
-end
diff --git a/db/migrate/20220310101118_update_holder_name_limit.rb b/db/migrate/20220310101118_update_holder_name_limit.rb
deleted file mode 100644
index 55eb8f75d70..00000000000
--- a/db/migrate/20220310101118_update_holder_name_limit.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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 UpdateHolderNameLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_credit_card_validations, :holder_name, 50, constraint_name: new_constraint_name
- remove_text_limit :user_credit_card_validations, :holder_name, constraint_name: old_constraint_name
- end
-
- def down
- add_text_limit :user_credit_card_validations, :holder_name, 26, validate: false, constraint_name: old_constraint_name
- remove_text_limit :user_credit_card_validations, :holder_name, constraint_name: new_constraint_name
- end
-
- private
-
- def old_constraint_name
- check_constraint_name(:user_credit_card_validations, :holder_name, 'max_length')
- end
-
- def new_constraint_name
- check_constraint_name(:user_credit_card_validations, :holder_name, 'max_length_50')
- end
-end
diff --git a/db/migrate/20220314184009_create_protected_environment_approval_rules.rb b/db/migrate/20220314184009_create_protected_environment_approval_rules.rb
deleted file mode 100644
index f0db2c004ed..00000000000
--- a/db/migrate/20220314184009_create_protected_environment_approval_rules.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProtectedEnvironmentApprovalRules < Gitlab::Database::Migration[1.0]
- def up
- create_table :protected_environment_approval_rules do |t|
- t.references :protected_environment,
- index: { name: :index_approval_rule_on_protected_environment_id },
- foreign_key: { to_table: :protected_environments, on_delete: :cascade },
- null: false
-
- t.bigint :user_id
- t.bigint :group_id
- t.timestamps_with_timezone null: false
- t.integer :access_level, limit: 2
- t.integer :required_approvals, null: false, limit: 2
-
- t.index :user_id
- t.index :group_id
-
- t.check_constraint "((access_level IS NOT NULL) AND (group_id IS NULL) AND (user_id IS NULL)) OR " \
- "((user_id IS NOT NULL) AND (access_level IS NULL) AND (group_id IS NULL)) OR " \
- "((group_id IS NOT NULL) AND (user_id IS NULL) AND (access_level IS NULL))"
- t.check_constraint "required_approvals > 0"
- end
- end
-
- def down
- drop_table :protected_environment_approval_rules
- end
-end
diff --git a/db/migrate/20220314184109_add_user_fk_to_protected_environment_approval_rules.rb b/db/migrate/20220314184109_add_user_fk_to_protected_environment_approval_rules.rb
deleted file mode 100644
index c339f465da5..00000000000
--- a/db/migrate/20220314184109_add_user_fk_to_protected_environment_approval_rules.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserFkToProtectedEnvironmentApprovalRules < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :protected_environment_approval_rules, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :protected_environment_approval_rules, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20220314184209_add_group_fk_to_protected_environment_approval_rules.rb b/db/migrate/20220314184209_add_group_fk_to_protected_environment_approval_rules.rb
deleted file mode 100644
index 57c4f7dea33..00000000000
--- a/db/migrate/20220314184209_add_group_fk_to_protected_environment_approval_rules.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupFkToProtectedEnvironmentApprovalRules < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :protected_environment_approval_rules, :namespaces, column: :group_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :protected_environment_approval_rules, column: :group_id
- end
- end
-end
diff --git a/db/migrate/20220314194009_add_approval_rule_id_to_deployment_approvals.rb b/db/migrate/20220314194009_add_approval_rule_id_to_deployment_approvals.rb
deleted file mode 100644
index 6e12f568f6e..00000000000
--- a/db/migrate/20220314194009_add_approval_rule_id_to_deployment_approvals.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddApprovalRuleIdToDeploymentApprovals < Gitlab::Database::Migration[1.0]
- def change
- add_column :deployment_approvals, :approval_rule_id, :bigint
- end
-end
diff --git a/db/migrate/20220314194149_add_project_ci_secure_files_to_plan_limits.rb b/db/migrate/20220314194149_add_project_ci_secure_files_to_plan_limits.rb
deleted file mode 100644
index fcb7d322ce8..00000000000
--- a/db/migrate/20220314194149_add_project_ci_secure_files_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectCiSecureFilesToPlanLimits < Gitlab::Database::Migration[1.0]
- def change
- add_column(:plan_limits, :project_ci_secure_files, :integer, default: 100, null: false)
- end
-end
diff --git a/db/migrate/20220314204009_add_approval_rule_fk_to_deployment_approvals.rb b/db/migrate/20220314204009_add_approval_rule_fk_to_deployment_approvals.rb
deleted file mode 100644
index ba49103b4d3..00000000000
--- a/db/migrate/20220314204009_add_approval_rule_fk_to_deployment_approvals.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddApprovalRuleFkToDeploymentApprovals < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_deployment_approvals_on_approval_rule_id'
-
- def up
- add_concurrent_index :deployment_approvals, :approval_rule_id, name: INDEX_NAME
- add_concurrent_foreign_key :deployment_approvals, :protected_environment_approval_rules, column: :approval_rule_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :deployment_approvals, column: :approval_rule_id
- end
-
- remove_concurrent_index_by_name :deployment_approvals, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220316095126_add_creator_id_to_deploy_tokens.rb b/db/migrate/20220316095126_add_creator_id_to_deploy_tokens.rb
deleted file mode 100644
index 22a92081b37..00000000000
--- a/db/migrate/20220316095126_add_creator_id_to_deploy_tokens.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatorIdToDeployTokens < Gitlab::Database::Migration[1.0]
- def change
- add_column :deploy_tokens, :creator_id, :bigint
- end
-end
diff --git a/db/migrate/20220316202200_add_migration_plan_to_container_repositories.rb b/db/migrate/20220316202200_add_migration_plan_to_container_repositories.rb
deleted file mode 100644
index baeff52542f..00000000000
--- a/db/migrate/20220316202200_add_migration_plan_to_container_repositories.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddMigrationPlanToContainerRepositories < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220316202402_add_text_limit_to_container_repositories_migration_plan
- def change
- add_column(:container_repositories, :migration_plan, :text)
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220316202402_add_text_limit_to_container_repositories_migration_plan.rb b/db/migrate/20220316202402_add_text_limit_to_container_repositories_migration_plan.rb
deleted file mode 100644
index a9f653c742f..00000000000
--- a/db/migrate/20220316202402_add_text_limit_to_container_repositories_migration_plan.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToContainerRepositoriesMigrationPlan < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :container_repositories, :migration_plan, 255
- end
-
- def down
- remove_text_limit :container_repositories, :migration_plan
- end
-end
diff --git a/db/migrate/20220317170122_add_notification_level_to_namespace_root_storage_statistics.rb b/db/migrate/20220317170122_add_notification_level_to_namespace_root_storage_statistics.rb
deleted file mode 100644
index 3c0b41e0b42..00000000000
--- a/db/migrate/20220317170122_add_notification_level_to_namespace_root_storage_statistics.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotificationLevelToNamespaceRootStorageStatistics < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :namespace_root_storage_statistics, :notification_level, :integer, limit: 2, default: 100, null: false
- end
-
- def down
- remove_column :namespace_root_storage_statistics, :notification_level
- end
-end
diff --git a/db/migrate/20220318120802_add_target_platforms_to_project_setting.rb b/db/migrate/20220318120802_add_target_platforms_to_project_setting.rb
deleted file mode 100644
index 0e8f206e56d..00000000000
--- a/db/migrate/20220318120802_add_target_platforms_to_project_setting.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddTargetPlatformsToProjectSetting < Gitlab::Database::Migration[1.0]
- def change
- add_column :project_settings, :target_platforms, :string, array: true, default: [], null: false, if_not_exists: true
- end
-end
diff --git a/db/migrate/20220318141037_add_pages_onboarding_state.rb b/db/migrate/20220318141037_add_pages_onboarding_state.rb
deleted file mode 100644
index e320bee63c4..00000000000
--- a/db/migrate/20220318141037_add_pages_onboarding_state.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddPagesOnboardingState < Gitlab::Database::Migration[1.0]
- def up
- add_column :project_pages_metadata, :onboarding_complete, :boolean, default: false, null: false
- end
-
- def down
- remove_column :project_pages_metadata, :onboarding_complete
- end
-end
diff --git a/db/migrate/20220321150028_add_started_at_to_batched_background_migrations_table.rb b/db/migrate/20220321150028_add_started_at_to_batched_background_migrations_table.rb
deleted file mode 100644
index 38a2c4de2f9..00000000000
--- a/db/migrate/20220321150028_add_started_at_to_batched_background_migrations_table.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStartedAtToBatchedBackgroundMigrationsTable < Gitlab::Database::Migration[1.0]
- def change
- add_column :batched_background_migrations, :started_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb b/db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb
deleted file mode 100644
index a6ea1820160..00000000000
--- a/db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAllIssuableEscalationStatuses < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 5_000
-
- disable_ddl_transaction!
-
- # Removes records from previous backfill. Records for
- # existing incidents will be created entirely as-needed.
- #
- # See db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb,
- # & IncidentManagement::IssuableEscalationStatuses::[BuildService,PrepareUpdateService]
- def up
- each_batch_range('incident_management_issuable_escalation_statuses', of: BATCH_SIZE) do |min, max|
- execute <<~SQL
- DELETE FROM incident_management_issuable_escalation_statuses
- WHERE id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # no-op
- #
- # Potential rollback/re-run should not have impact, as these
- # records are not required to be present in the application.
- # The corresponding feature flag is also disabled,
- # preventing any user-facing access to the records.
- end
-end
diff --git a/db/migrate/20220322143441_add_dora_incidents_count.rb b/db/migrate/20220322143441_add_dora_incidents_count.rb
deleted file mode 100644
index 155bd979171..00000000000
--- a/db/migrate/20220322143441_add_dora_incidents_count.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDoraIncidentsCount < Gitlab::Database::Migration[1.0]
- def change
- add_column :dora_daily_metrics, :incidents_count, :integer
- end
-end
diff --git a/db/migrate/20220322205004_change_search_rate_limit_default_values.rb b/db/migrate/20220322205004_change_search_rate_limit_default_values.rb
deleted file mode 100644
index 34ebdddb8eb..00000000000
--- a/db/migrate/20220322205004_change_search_rate_limit_default_values.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeSearchRateLimitDefaultValues < Gitlab::Database::Migration[1.0]
- def change
- change_column_default :application_settings, :search_rate_limit, from: 30, to: 300
- change_column_default :application_settings, :search_rate_limit_unauthenticated, from: 10, to: 100
- end
-end
diff --git a/db/migrate/20220324171254_add_public_git_lab_runner_releases_url_to_application_settings.rb b/db/migrate/20220324171254_add_public_git_lab_runner_releases_url_to_application_settings.rb
deleted file mode 100644
index af963fa5454..00000000000
--- a/db/migrate/20220324171254_add_public_git_lab_runner_releases_url_to_application_settings.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddPublicGitLabRunnerReleasesUrlToApplicationSettings < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220324173554_add_text_limit_to_public_git_lab_runner_releases_url_application_settings
- def change
- add_column :application_settings, :public_runner_releases_url, :text, null: false, default: 'https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases'
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220324173554_add_text_limit_to_public_git_lab_runner_releases_url_application_settings.rb b/db/migrate/20220324173554_add_text_limit_to_public_git_lab_runner_releases_url_application_settings.rb
deleted file mode 100644
index 26f7447021b..00000000000
--- a/db/migrate/20220324173554_add_text_limit_to_public_git_lab_runner_releases_url_application_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToPublicGitLabRunnerReleasesUrlApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :public_runner_releases_url, 255
- end
-
- def down
- remove_text_limit :application_settings, :public_runner_releases_url
- end
-end
diff --git a/db/migrate/20220324175325_add_key_data_to_secure_files.rb b/db/migrate/20220324175325_add_key_data_to_secure_files.rb
deleted file mode 100644
index 70dfd64be27..00000000000
--- a/db/migrate/20220324175325_add_key_data_to_secure_files.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddKeyDataToSecureFiles < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- unless column_exists? :ci_secure_files, :key_data
- add_column :ci_secure_files, :key_data, :text
- end
-
- add_text_limit :ci_secure_files, :key_data, 128
- end
-
- def down
- remove_column :ci_secure_files, :key_data
- end
-end
diff --git a/db/migrate/20220329061545_add_repository_size_to_plan_limits.rb b/db/migrate/20220329061545_add_repository_size_to_plan_limits.rb
deleted file mode 100644
index 2c84780dc2b..00000000000
--- a/db/migrate/20220329061545_add_repository_size_to_plan_limits.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddRepositorySizeToPlanLimits < Gitlab::Database::Migration[1.0]
- def up
- add_column(:plan_limits, :repository_size, :bigint, default: 0, null: false)
- end
-
- def down
- remove_column(:plan_limits, :repository_size)
- end
-end
diff --git a/db/migrate/20220329095632_add_theme_to_broadcast_message.rb b/db/migrate/20220329095632_add_theme_to_broadcast_message.rb
deleted file mode 100644
index ae5971469f9..00000000000
--- a/db/migrate/20220329095632_add_theme_to_broadcast_message.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddThemeToBroadcastMessage < Gitlab::Database::Migration[1.0]
- def change
- add_column :broadcast_messages, :theme, :smallint, null: false, default: 0
- end
-end
diff --git a/db/migrate/20220329110630_add_ci_namespace_mirrors_unnest_index_on_traversal_ids.rb b/db/migrate/20220329110630_add_ci_namespace_mirrors_unnest_index_on_traversal_ids.rb
deleted file mode 100644
index 6f5d7b4c71e..00000000000
--- a/db/migrate/20220329110630_add_ci_namespace_mirrors_unnest_index_on_traversal_ids.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiNamespaceMirrorsUnnestIndexOnTraversalIds < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_namespace_mirrors_on_traversal_ids_unnest'
-
- def up
- return if index_exists_by_name?(:ci_namespace_mirrors, INDEX_NAME)
-
- # We add only 4-levels since on average it is not expected that namespaces
- # will be so granular beyond this point
- disable_statement_timeout do
- execute <<-SQL
- CREATE INDEX CONCURRENTLY #{INDEX_NAME} ON ci_namespace_mirrors
- USING btree ((traversal_ids[1]), (traversal_ids[2]), (traversal_ids[3]), (traversal_ids[4]))
- INCLUDE (traversal_ids, namespace_id)
- SQL
- end
- end
-
- def down
- remove_concurrent_index_by_name(:ci_namespace_mirrors, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20220331174026_add_submit_field_to_dast_site_profiles.rb b/db/migrate/20220331174026_add_submit_field_to_dast_site_profiles.rb
deleted file mode 100644
index 00c46b59b1c..00000000000
--- a/db/migrate/20220331174026_add_submit_field_to_dast_site_profiles.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddSubmitFieldToDastSiteProfiles < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220331174459_add_text_limit_to_submit_field_dast_site_profiles
- def change
- add_column :dast_site_profiles, :auth_submit_field, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20220331174459_add_text_limit_to_submit_field_dast_site_profiles.rb b/db/migrate/20220331174459_add_text_limit_to_submit_field_dast_site_profiles.rb
deleted file mode 100644
index 291d52a0122..00000000000
--- a/db/migrate/20220331174459_add_text_limit_to_submit_field_dast_site_profiles.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToSubmitFieldDastSiteProfiles < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :dast_site_profiles, :auth_submit_field, 255
- end
-
- def down
- remove_text_limit :dast_site_profiles, :auth_submit_field
- end
-end
diff --git a/db/migrate/20220401044858_add_user_id_and_state_index_to_merge_request_assignees.rb b/db/migrate/20220401044858_add_user_id_and_state_index_to_merge_request_assignees.rb
deleted file mode 100644
index b869b3d9b52..00000000000
--- a/db/migrate/20220401044858_add_user_id_and_state_index_to_merge_request_assignees.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserIdAndStateIndexToMergeRequestAssignees < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_assignees_user_id_and_state'
-
- def up
- add_concurrent_index :merge_request_assignees, [:user_id, :state], where: 'state = 2', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220401045116_add_user_id_and_state_index_to_merge_request_reviewers.rb b/db/migrate/20220401045116_add_user_id_and_state_index_to_merge_request_reviewers.rb
deleted file mode 100644
index 0788dd9583c..00000000000
--- a/db/migrate/20220401045116_add_user_id_and_state_index_to_merge_request_reviewers.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserIdAndStateIndexToMergeRequestReviewers < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_reviewers_user_id_and_state'
-
- def up
- add_concurrent_index :merge_request_reviewers, [:user_id, :state], where: 'state = 2', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220401110443_add_on_hold_until_column_for_batched_migration.rb b/db/migrate/20220401110443_add_on_hold_until_column_for_batched_migration.rb
deleted file mode 100644
index 4771b50d566..00000000000
--- a/db/migrate/20220401110443_add_on_hold_until_column_for_batched_migration.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddOnHoldUntilColumnForBatchedMigration < Gitlab::Database::Migration[1.0]
- def change
- add_column :batched_background_migrations, :on_hold_until, :timestamptz,
- comment: 'execution of this migration is on hold until this time'
- end
-end
diff --git a/db/migrate/20220401110511_add_runtime_data_columns_to_vsa_aggregations.rb b/db/migrate/20220401110511_add_runtime_data_columns_to_vsa_aggregations.rb
deleted file mode 100644
index 09960c7add6..00000000000
--- a/db/migrate/20220401110511_add_runtime_data_columns_to_vsa_aggregations.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddRuntimeDataColumnsToVsaAggregations < Gitlab::Database::Migration[1.0]
- def up
- change_table(:analytics_cycle_analytics_aggregations, bulk: true) do |t|
- t.integer :full_runtimes_in_seconds, array: true, default: [], null: false
- t.integer :full_processed_records, array: true, default: [], null: false
- t.column :last_full_merge_requests_updated_at, :datetime_with_timezone
- t.column :last_full_issues_updated_at, :datetime_with_timezone
- t.integer :last_full_issues_id
- t.integer :last_full_merge_requests_id
- end
- end
-
- def down
- remove_column :analytics_cycle_analytics_aggregations, :full_runtimes_in_seconds
- remove_column :analytics_cycle_analytics_aggregations, :full_processed_records
- remove_column :analytics_cycle_analytics_aggregations, :last_full_merge_requests_updated_at
- remove_column :analytics_cycle_analytics_aggregations, :last_full_issues_updated_at
- remove_column :analytics_cycle_analytics_aggregations, :last_full_issues_id
- remove_column :analytics_cycle_analytics_aggregations, :last_full_merge_requests_id
- end
-end
diff --git a/db/migrate/20220401113123_add_check_constraint_to_vsa_aggregation_runtime_data_columns.rb b/db/migrate/20220401113123_add_check_constraint_to_vsa_aggregation_runtime_data_columns.rb
deleted file mode 100644
index 4863a1f0030..00000000000
--- a/db/migrate/20220401113123_add_check_constraint_to_vsa_aggregation_runtime_data_columns.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddCheckConstraintToVsaAggregationRuntimeDataColumns < Gitlab::Database::Migration[1.0]
- FULL_RUNTIMES_IN_SECONDS_CONSTRAINT = 'full_runtimes_in_seconds_size'
- FULL_PROCESSED_RECORDS_CONSTRAINT = 'full_processed_records_size'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint(:analytics_cycle_analytics_aggregations,
- 'CARDINALITY(full_runtimes_in_seconds) <= 10',
- FULL_RUNTIMES_IN_SECONDS_CONSTRAINT)
-
- add_check_constraint(:analytics_cycle_analytics_aggregations,
- 'CARDINALITY(full_processed_records) <= 10',
- FULL_PROCESSED_RECORDS_CONSTRAINT)
- end
-
- def down
- remove_check_constraint :analytics_cycle_analytics_aggregations, FULL_RUNTIMES_IN_SECONDS_CONSTRAINT
- remove_check_constraint :analytics_cycle_analytics_aggregations, FULL_PROCESSED_RECORDS_CONSTRAINT
- end
-end
diff --git a/db/migrate/20220404114106_add_container_registry_size_to_project_statistics.rb b/db/migrate/20220404114106_add_container_registry_size_to_project_statistics.rb
deleted file mode 100644
index 4f5778bf321..00000000000
--- a/db/migrate/20220404114106_add_container_registry_size_to_project_statistics.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddContainerRegistrySizeToProjectStatistics < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_statistics, :container_registry_size, :bigint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20220404170446_add_index_for_non_requested_non_invited_awaiting_members.rb b/db/migrate/20220404170446_add_index_for_non_requested_non_invited_awaiting_members.rb
deleted file mode 100644
index d1d2dc510cf..00000000000
--- a/db/migrate/20220404170446_add_index_for_non_requested_non_invited_awaiting_members.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexForNonRequestedNonInvitedAwaitingMembers < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_members_on_non_requested_non_invited_and_state_awaiting'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :members,
- :source_id,
- where: '((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1))',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :members, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220405061122_add_license_scanning_action_to_onboarding_progresses.rb b/db/migrate/20220405061122_add_license_scanning_action_to_onboarding_progresses.rb
deleted file mode 100644
index 0c07d1f18ba..00000000000
--- a/db/migrate/20220405061122_add_license_scanning_action_to_onboarding_progresses.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddLicenseScanningActionToOnboardingProgresses < Gitlab::Database::Migration[1.0]
- def change
- add_column :onboarding_progresses, :license_scanning_run_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20220405125459_add_non_migrated_index_to_container_repositories.rb b/db/migrate/20220405125459_add_non_migrated_index_to_container_repositories.rb
deleted file mode 100644
index 7aad10c288b..00000000000
--- a/db/migrate/20220405125459_add_non_migrated_index_to_container_repositories.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddNonMigratedIndexToContainerRepositories < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- # follow up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/358407
- INDEX_NAME = 'tmp_idx_container_repos_on_non_migrated'
- MIGRATION_PHASE_1_ENDED_AT = '2022-01-23'
-
- def up
- add_concurrent_index :container_repositories,
- [:project_id, :id],
- name: INDEX_NAME,
- where: "migration_state != 'import_done' AND created_at < '#{MIGRATION_PHASE_1_ENDED_AT}'"
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220405181814_add_arkose_settings_to_application_settings.rb b/db/migrate/20220405181814_add_arkose_settings_to_application_settings.rb
deleted file mode 100644
index d8c06cd8229..00000000000
--- a/db/migrate/20220405181814_add_arkose_settings_to_application_settings.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class AddArkoseSettingsToApplicationSettings < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20220405203843_add_text_limit_to_arkose_verify_url_application_settings.rb
- def up
- add_column :application_settings, :encrypted_arkose_labs_public_api_key, :binary
- add_column :application_settings, :encrypted_arkose_labs_public_api_key_iv, :binary
-
- add_column :application_settings, :encrypted_arkose_labs_private_api_key, :binary
- add_column :application_settings, :encrypted_arkose_labs_private_api_key_iv, :binary
-
- add_column :application_settings, :arkose_labs_verify_api_url, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- remove_column :application_settings, :encrypted_arkose_labs_public_api_key
- remove_column :application_settings, :encrypted_arkose_labs_public_api_key_iv
-
- remove_column :application_settings, :encrypted_arkose_labs_private_api_key
- remove_column :application_settings, :encrypted_arkose_labs_private_api_key_iv
-
- remove_column :application_settings, :arkose_labs_verify_api_url
- end
-end
diff --git a/db/migrate/20220405203843_add_text_limit_to_arkose_verify_url_application_settings.rb b/db/migrate/20220405203843_add_text_limit_to_arkose_verify_url_application_settings.rb
deleted file mode 100644
index f3c7960b29d..00000000000
--- a/db/migrate/20220405203843_add_text_limit_to_arkose_verify_url_application_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToArkoseVerifyUrlApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :arkose_labs_verify_api_url, 255
- end
-
- def down
- remove_text_limit :application_settings, :arkose_labs_verify_api_url
- end
-end
diff --git a/db/migrate/20220406113217_add_inactive_project_deletion_to_application_settings.rb b/db/migrate/20220406113217_add_inactive_project_deletion_to_application_settings.rb
deleted file mode 100644
index ffb0fe3f5d8..00000000000
--- a/db/migrate/20220406113217_add_inactive_project_deletion_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddInactiveProjectDeletionToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :delete_inactive_projects, :boolean, default: false, null: false
- add_column :application_settings, :inactive_projects_delete_after_months, :integer, default: 2, null: false
- add_column :application_settings, :inactive_projects_min_size_mb, :integer, default: 0, null: false
- add_column :application_settings, :inactive_projects_send_warning_email_after_months,
- :integer, default: 1, null: false
- end
-end
diff --git a/db/migrate/20220406121831_add_index_on_status_for_batched_background_migrations.rb b/db/migrate/20220406121831_add_index_on_status_for_batched_background_migrations.rb
deleted file mode 100644
index bc3b9125b4b..00000000000
--- a/db/migrate/20220406121831_add_index_on_status_for_batched_background_migrations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnStatusForBatchedBackgroundMigrations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :batched_background_migrations, :status
- end
-
- def down
- remove_concurrent_index_by_name :batched_background_migrations, :index_batched_background_migrations_on_status
- end
-end
diff --git a/db/migrate/20220407135820_add_epics_relative_position.rb b/db/migrate/20220407135820_add_epics_relative_position.rb
deleted file mode 100644
index 8ab62667e1e..00000000000
--- a/db/migrate/20220407135820_add_epics_relative_position.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicsRelativePosition < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
-
- def up
- return unless table_exists?(:epics)
- return if column_exists?(:epics, :relative_position)
-
- add_column :epics, :relative_position, :integer
-
- execute('UPDATE epics SET relative_position=id*500')
- end
-
- def down
- # no-op - this column should normally exist if epics table exists too
- end
-end
diff --git a/db/migrate/20220408001450_add_work_item_type_name_unique_index_null_namespaces.rb b/db/migrate/20220408001450_add_work_item_type_name_unique_index_null_namespaces.rb
deleted file mode 100644
index bcb0e32a4e7..00000000000
--- a/db/migrate/20220408001450_add_work_item_type_name_unique_index_null_namespaces.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddWorkItemTypeNameUniqueIndexNullNamespaces < Gitlab::Database::Migration[1.0]
- INDEX_NAME = :idx_work_item_types_on_namespace_id_and_name_null_namespace
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :work_item_types,
- 'TRIM(BOTH FROM LOWER(name)), (namespace_id IS NULL)',
- unique: true,
- name: INDEX_NAME,
- where: 'namespace_id IS NULL'
- end
-
- def down
- remove_concurrent_index_by_name :work_item_types, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220408135815_update_index_on_greated_done_at_on_container_repositories.rb b/db/migrate/20220408135815_update_index_on_greated_done_at_on_container_repositories.rb
deleted file mode 100644
index b906a867895..00000000000
--- a/db/migrate/20220408135815_update_index_on_greated_done_at_on_container_repositories.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIndexOnGreatedDoneAtOnContainerRepositories < Gitlab::Database::Migration[1.0]
- OLD_INDEX_NAME = 'index_container_repositories_on_greatest_done_at'
- NEW_INDEX_NAME = 'index_container_repositories_on_greatest_completed_at'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :container_repositories,
- 'GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at, migration_skipped_at)',
- where: "migration_state IN ('import_done', 'pre_import_done', 'import_aborted', 'import_skipped')",
- name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :container_repositories, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :container_repositories,
- 'GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at)',
- where: "migration_state IN ('import_done', 'pre_import_done', 'import_aborted')",
- name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :container_repositories, NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20220412171810_add_otp_secret_expires_at.rb b/db/migrate/20220412171810_add_otp_secret_expires_at.rb
deleted file mode 100644
index 883293c87f8..00000000000
--- a/db/migrate/20220412171810_add_otp_secret_expires_at.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddOtpSecretExpiresAt < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- # rubocop: disable Migration/AddColumnsToWideTables
- add_column :users, :otp_secret_expires_at, :datetime_with_timezone
- # rubocop: enable Migration/AddColumnsToWideTables
- end
-end
diff --git a/db/migrate/20220413075921_update_index_on_packages_build_infos.rb b/db/migrate/20220413075921_update_index_on_packages_build_infos.rb
deleted file mode 100644
index 96f37fab24e..00000000000
--- a/db/migrate/20220413075921_update_index_on_packages_build_infos.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIndexOnPackagesBuildInfos < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NEW_INDEX_NAME = 'index_packages_build_infos_package_id_pipeline_id_id'
- OLD_INDEX_NAME = 'index_packages_build_infos_package_id_pipeline_id'
-
- def up
- add_concurrent_index :packages_build_infos,
- [:package_id, :pipeline_id, :id],
- name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :packages_build_infos, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :packages_build_infos,
- [:package_id, :pipeline_id],
- name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :packages_build_infos, NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20220507204024_add_separated_caches_option_to_project_ci_settings.rb b/db/migrate/20220507204024_add_separated_caches_option_to_project_ci_settings.rb
deleted file mode 100644
index 39daf9fe296..00000000000
--- a/db/migrate/20220507204024_add_separated_caches_option_to_project_ci_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddSeparatedCachesOptionToProjectCiSettings < Gitlab::Database::Migration[2.0]
- enable_lock_retries!
-
- def change
- add_column :project_ci_cd_settings, :separated_caches, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20220520120637_add_installable_conan_packages_index_to_packages.rb b/db/migrate/20220520120637_add_installable_conan_packages_index_to_packages.rb
deleted file mode 100644
index b26d1f5429a..00000000000
--- a/db/migrate/20220520120637_add_installable_conan_packages_index_to_packages.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddInstallableConanPackagesIndexToPackages < Gitlab::Database::Migration[2.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_installable_conan_pkgs_on_project_id_id'
- # as defined by Packages::Package.package_types
- CONAN_PACKAGE_TYPE = 3
-
- # as defined by Packages::Package::INSTALLABLE_STATUSES
- DEFAULT_STATUS = 0
- HIDDEN_STATUS = 1
-
- def up
- where = "package_type = #{CONAN_PACKAGE_TYPE} AND status IN (#{DEFAULT_STATUS}, #{HIDDEN_STATUS})"
- add_concurrent_index :packages_packages,
- [:project_id, :id],
- where: where,
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_packages, INDEX_NAME
- end
-end
diff --git a/db/migrate/20220525084153_add_sentry_project_id_to_project_error_tracking_settings.rb b/db/migrate/20220525084153_add_sentry_project_id_to_project_error_tracking_settings.rb
deleted file mode 100644
index 248dd128bec..00000000000
--- a/db/migrate/20220525084153_add_sentry_project_id_to_project_error_tracking_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddSentryProjectIdToProjectErrorTrackingSettings < Gitlab::Database::Migration[2.0]
- def change
- add_column :project_error_tracking_settings, :sentry_project_id, :bigint
- end
-end
diff --git a/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb b/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb
deleted file mode 100644
index 69f7822c057..00000000000
--- a/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# 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 AddTodosProjectAndIdIndex < Gitlab::Database::Migration[1.0]
- # When using the methods "add_concurrent_index" or "remove_concurrent_index"
- # you must disable the use of transactions
- # as these methods can not run in an existing transaction.
- # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
- # that either of them is the _only_ method called in the migration,
- # any other changes should go in a separate migration.
- # This ensures that upon failure _only_ the index creation or removing fails
- # and can be retried or reverted easily.
- #
- # To disable transactions uncomment the following line and remove these
- # comments:
- disable_ddl_transaction!
-
- NEW_INDEX_NAME = 'index_todos_on_project_id_and_id'
- OLD_INDEX_NAME = 'index_todos_on_project_id'
-
- def up
- add_concurrent_index :todos, [:project_id, :id], name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :todos, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :todos, :project_id, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :todos, NEW_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb b/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb
deleted file mode 100644
index 56b0df1f393..00000000000
--- a/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToProjectsOnMarkedForDeletionAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_projects_not_aimed_for_deletion'
-
- def up
- add_concurrent_index :projects, :id, where: 'marked_for_deletion_at IS NULL', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :projects, :id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb b/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb
deleted file mode 100644
index 020dceac004..00000000000
--- a/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCalendarEventsIndexSynchronously < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'
-
- def up
- add_concurrent_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :events, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb b/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb
deleted file mode 100644
index 51460a9dc95..00000000000
--- a/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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 RemoveOldCalendarEventsIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- OLD_INDEX_NAME = 'index_events_on_author_id_and_project_id'
-
- def up
- remove_concurrent_index_by_name :events, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :events, [:author_id, :project_id], name: OLD_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb b/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb
deleted file mode 100644
index 0e370dfc5f8..00000000000
--- a/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexesForPrimaryEmailCleanupMigration < Gitlab::Database::Migration[1.0]
- USERS_INDEX = :index_users_on_id_for_primary_email_migration
- EMAIL_INDEX = :index_emails_on_email_user_id
-
- disable_ddl_transaction!
-
- def up
- unless index_exists_by_name?(:users, USERS_INDEX)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{USERS_INDEX}
- ON users (id) INCLUDE (email, confirmed_at)
- WHERE confirmed_at IS NOT NULL
- SQL
- end
- end
-
- add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
- end
-
- def down
- remove_concurrent_index_by_name :users, USERS_INDEX
- remove_concurrent_index_by_name :emails, EMAIL_INDEX
- end
-end
diff --git a/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb
deleted file mode 100644
index 959bf61a6cc..00000000000
--- a/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type'
-
- def up
- add_concurrent_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb b/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb
deleted file mode 100644
index 3788a680fb6..00000000000
--- a/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupFirstMentionedInCommitJobs < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'FixFirstMentionedInCommitAt'
- INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit'
-
- def up
- finalize_background_migration(MIGRATION)
-
- remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME
- end
-
- def down
- # Handles reported schema inconsistencies (column with or without timezone)
- # We did the same in db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb
- condition = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics
- .first_mentioned_in_commit_at_condition
- add_concurrent_index :issue_metrics, :issue_id, where: condition, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
deleted file mode 100644
index cc37f2dc65d..00000000000
--- a/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0]
- MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid'
-
- def up
- delete_job_tracking(
- MIGRATION_NAME,
- status: %w[pending succeeded]
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb b/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
deleted file mode 100644
index 13abf8b5540..00000000000
--- a/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences4 < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 2_500
-
- disable_ddl_transaction!
-
- def up
- # Make sure the migration removing Findings with attributes for which UUID would be identical
- # has finished
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74008
- Gitlab::BackgroundMigration.steal('RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings')
-
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('vulnerability_occurrences'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb b/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
deleted file mode 100644
index eaf07abe29d..00000000000
--- a/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveExtraFindingEvidenceTablesForeignKeys < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences
- remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests
- remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses
- remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences
- remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages
- remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences
- remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages
- remove_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences
- remove_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences
- end
- end
-
- def down
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences, on_delete: :cascade
- end
-
- with_lock_retries do
- add_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences, on_delete: :cascade
- end
- end
-end
diff --git a/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb b/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
deleted file mode 100644
index 9a246a8c707..00000000000
--- a/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveExtraFindingEvidenceTables < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_assets, if_exists: true
- drop_table :vulnerability_finding_evidence_headers, if_exists: true
- drop_table :vulnerability_finding_evidence_requests, if_exists: true
- drop_table :vulnerability_finding_evidence_responses, if_exists: true
- drop_table :vulnerability_finding_evidence_sources, if_exists: true
- drop_table :vulnerability_finding_evidence_supporting_messages, if_exists: true
- end
- end
-
- def down
- create_table :vulnerability_finding_evidence_assets, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_assets_on_finding_evidence_id' }, null: false
- t.text :type, limit: 2048
- t.text :name, limit: 2048
- t.text :url, limit: 2048
- end
-
- create_table :vulnerability_finding_evidence_sources, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_sources_on_finding_evidence_id' }, null: false
- t.text :name, limit: 2048
- t.text :url, limit: 2048
- end
-
- create_table :vulnerability_finding_evidence_supporting_messages, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_supporting_messages_on_finding_evidence_id' }, null: false
- t.text :name, limit: 2048
- end
-
- create_table :vulnerability_finding_evidence_requests, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_requests_on_finding_evidence_id' }, null: true
- t.text :method, limit: 32
- t.text :url, limit: 2048
- t.text :body, limit: 2048
- t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_requests_on_supporting_evidence_id' }, null: true
- end
-
- create_table :vulnerability_finding_evidence_responses, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_responses_on_finding_evidences_id' }, null: true
- t.integer :status_code
- t.text :reason_phrase, limit: 2048
- t.text :body, limit: 2048
- t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_responses_on_supporting_evidence_id' }, null: true
- end
-
- create_table :vulnerability_finding_evidence_headers, if_not_exists: true do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence_request, index: { name: 'finding_evidence_header_on_finding_evidence_request_id' }, null: true
- t.references :vulnerability_finding_evidence_response, index: { name: 'finding_evidence_header_on_finding_evidence_response_id' }, null: true
- t.text :name, null: false, limit: 255
- t.text :value, null: false, limit: 8192
- end
- end
-end
diff --git a/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb b/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb
deleted file mode 100644
index e42b74748d7..00000000000
--- a/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillCiNamespaceMirrors < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb b/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb
deleted file mode 100644
index 2a58eda040e..00000000000
--- a/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillCiProjectMirrors < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb
deleted file mode 100644
index 8eee082809b..00000000000
--- a/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings'
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- # Due to production incident previous migration was orphaned and must be rescheduled,
- # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72919#note_741188600
- def up
- return unless Gitlab.ee?
-
- delete_queued_jobs(MIGRATION)
-
- requeue_background_migration_jobs_by_range_at_intervals(
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb b/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb
deleted file mode 100644
index 8c95c76d1fe..00000000000
--- a/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackCiJobArtifactsDeletes < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:ci_job_artifacts)
- end
-
- def down
- untrack_record_deletions(:ci_job_artifacts)
- end
-end
diff --git a/db/post_migrate/20211209093828_track_users_deletes.rb b/db/post_migrate/20211209093828_track_users_deletes.rb
deleted file mode 100644
index e25a8a36cb2..00000000000
--- a/db/post_migrate/20211209093828_track_users_deletes.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackUsersDeletes < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:users)
- end
-
- def down
- untrack_record_deletions(:users)
- end
-end
diff --git a/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb b/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb
deleted file mode 100644
index cd8a6baf407..00000000000
--- a/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackExternalPullRequestsDeletes < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:external_pull_requests)
- end
-
- def down
- untrack_record_deletions(:external_pull_requests)
- end
-end
diff --git a/db/post_migrate/20211209094222_track_merge_requests_deletes.rb b/db/post_migrate/20211209094222_track_merge_requests_deletes.rb
deleted file mode 100644
index 51007082e9e..00000000000
--- a/db/post_migrate/20211209094222_track_merge_requests_deletes.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackMergeRequestsDeletes < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:merge_requests)
- end
-
- def down
- untrack_record_deletions(:merge_requests)
- end
-end
diff --git a/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb b/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb
deleted file mode 100644
index 44dffc798d3..00000000000
--- a/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillProjectNamespacesForGroup < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces'
- DELAY_INTERVAL = 2.minutes
- GROUP_ID = 9970 # picking gitlab-org group.
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.com? || Gitlab.staging?
-
- projects_table = ::Gitlab::BackgroundMigration::ProjectNamespaces::Models::Project.arel_table
- hierarchy_cte_sql = Arel.sql(::Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces.hierarchy_cte(GROUP_ID))
- group_projects = ::Gitlab::BackgroundMigration::ProjectNamespaces::Models::Project.where(projects_table[:namespace_id].in(hierarchy_cte_sql))
-
- min_id = group_projects.minimum(:id)
- max_id = group_projects.maximum(:id)
-
- return if min_id.blank? || max_id.blank?
-
- queue_batched_background_migration(
- MIGRATION,
- :projects,
- :id,
- GROUP_ID,
- 'up',
- job_interval: DELAY_INTERVAL,
- batch_min_value: min_id,
- batch_max_value: max_id,
- sub_batch_size: 25,
- batch_class_name: 'BackfillProjectNamespacePerGroupBatchingStrategy'
- )
- end
-
- def down
- return unless Gitlab.com? || Gitlab.staging?
-
- delete_batched_background_migration(MIGRATION, :projects, :id, [GROUP_ID, 'up'])
- end
-end
diff --git a/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb b/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb
deleted file mode 100644
index 07a2c079511..00000000000
--- a/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-class AddTmpIndexOnReportType < Gitlab::Database::Migration[1.0]
- # Temporary index to perform migration fixing invalid vulnerability_occurrences.raw_metadata rows
- # Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/349605
- INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb b/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb
deleted file mode 100644
index 757cbf60d4d..00000000000
--- a/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-class ConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0]
- MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata
- MODEL_CLASS = MIGRATION_CLASS::Finding
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 500
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- MODEL_CLASS.by_api_report_types,
- MIGRATION_CLASS,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
-
- # up fixes invalid data by updating columns in-place.
- # It is a backwards-compatible change, and reversing it in a downgrade would not be desirable.
- end
-end
diff --git a/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb b/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb
deleted file mode 100644
index 54997dc4cc4..00000000000
--- a/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTemporaryStaticObjectTokenIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_users_with_static_object_token'
-
- def up
- add_concurrent_index :users, :id, where: "static_object_token IS NOT NULL AND static_object_token_encrypted IS NULL", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :users, :id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211210140629_encrypt_static_object_token.rb b/db/post_migrate/20211210140629_encrypt_static_object_token.rb
deleted file mode 100644
index fe4db9fc14c..00000000000
--- a/db/post_migrate/20211210140629_encrypt_static_object_token.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class EncryptStaticObjectToken < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 10_000
- MIGRATION = 'EncryptStaticObjectToken'
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('users').where.not(static_object_token: nil).where(static_object_token_encrypted: nil),
- MIGRATION,
- 2.minutes,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no ops
- end
-end
diff --git a/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb b/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb
deleted file mode 100644
index ffe8bf0d794..00000000000
--- a/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveVulnerabilityFindingLinksAgain < Gitlab::Database::Migration[1.0]
- # This migration has been moved to a TRUNCATE in db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb
- # Previously, this was causing an bug where there was a conflict between the table cleanup and the index creation.
-
- def up
- # no op
- end
-
- def down
- # no op
- end
-end
diff --git a/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb
deleted file mode 100644
index 92b5a1b085c..00000000000
--- a/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddAgentIdLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id'
-
- def up
- add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')",
- using: 'GIN',
- where: 'report_type = 7',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb b/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb
deleted file mode 100644
index 49f498c911d..00000000000
--- a/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiPipelinesMrMetricsFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:merge_request_metrics, :ci_pipelines, name: "fk_rails_33ae169d48")
- end
- end
-
- def down
- add_concurrent_foreign_key(:merge_request_metrics, :ci_pipelines, name: "fk_rails_33ae169d48", column: :pipeline_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb b/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
deleted file mode 100644
index f8239b6e0cd..00000000000
--- a/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
- # Removed in favor of creating records for existing incidents
- # as-needed. See db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb.
- def change
- # no-op
- end
-end
diff --git a/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb b/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb
deleted file mode 100644
index 5876d3f8a9a..00000000000
--- a/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleUpdateTimelogsNullSpentAt < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
- BATCH_SIZE = 5_000
- DELAY_INTERVAL = 2.minutes
- MIGRATION = 'UpdateTimelogsNullSpentAt'
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('timelogs').where(spent_at: nil),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb
deleted file mode 100644
index 310a49a667e..00000000000
--- a/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class ModifyKubernetesResourceLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- OLD_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_cluster_id'
- OLD_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id'
-
- NEW_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_cluster_id'
- NEW_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_agent_id'
-
- def up
- add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'cluster_id')",
- using: 'GIN',
- where: 'report_type = 7',
- name: NEW_CLUSTER_ID_INDEX_NAME
-
- add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'agent_id')",
- using: 'GIN',
- where: 'report_type = 7',
- name: NEW_AGENT_ID_INDEX_NAME
-
- remove_concurrent_index_by_name :vulnerability_occurrences, OLD_CLUSTER_ID_INDEX_NAME
- remove_concurrent_index_by_name :vulnerability_occurrences, OLD_AGENT_ID_INDEX_NAME
- end
-
- def down
- add_concurrent_index :vulnerability_occurrences, "(location -> 'cluster_id')",
- using: 'GIN',
- where: 'report_type = 7',
- name: OLD_CLUSTER_ID_INDEX_NAME
-
- add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')",
- using: 'GIN',
- where: 'report_type = 7',
- name: OLD_AGENT_ID_INDEX_NAME
-
- remove_concurrent_index_by_name :vulnerability_occurrences, NEW_CLUSTER_ID_INDEX_NAME
- remove_concurrent_index_by_name :vulnerability_occurrences, NEW_AGENT_ID_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb
deleted file mode 100644
index a05d68279c3..00000000000
--- a/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0]
- # no-op
- # see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77436
-
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb b/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb
deleted file mode 100644
index 316209ae1f4..00000000000
--- a/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class MarkRecalculateFindingSignaturesAsCompleted < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
-
- def up
- # Only run migration for Gitlab.com
- return unless ::Gitlab.com?
-
- # In previous migration marking jobs as successful was missed
- Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION)
- .pending
- .update_all(status: :succeeded)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb b/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb
deleted file mode 100644
index 1d61aec401e..00000000000
--- a/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryIndexesForPrimaryEmailMigration < Gitlab::Database::Migration[1.0]
- USERS_INDEX = :index_users_on_id_for_primary_email_migration
- EMAIL_INDEX = :index_emails_on_email_user_id
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :users, USERS_INDEX
- remove_concurrent_index_by_name :emails, EMAIL_INDEX
- end
-
- def down
- unless index_exists_by_name?(:users, USERS_INDEX)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{USERS_INDEX}
- ON users (id) INCLUDE (email, confirmed_at)
- WHERE confirmed_at IS NOT NULL
- SQL
- end
- end
-
- add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
- end
-end
diff --git a/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb b/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb
deleted file mode 100644
index c98d3d05f2f..00000000000
--- a/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnCiPipelinesUserIdIdFailureReason < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified'
-
- def up
- add_concurrent_index :ci_pipelines, [:user_id, :id], order: { id: :desc }, where: 'failure_reason = 3', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211220123956_update_invalid_member_states.rb b/db/post_migrate/20211220123956_update_invalid_member_states.rb
deleted file mode 100644
index 5da100f0ec2..00000000000
--- a/db/post_migrate/20211220123956_update_invalid_member_states.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateInvalidMemberStates < Gitlab::Database::Migration[1.0]
- class Member < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'members'
-
- scope :in_invalid_state, -> { where(state: 2) }
- end
-
- def up
- Member.in_invalid_state.each_batch do |relation|
- relation.update_all(state: 0)
- end
- end
-
- def down
- # no-op as we don't need to revert any changed records
- end
-end
diff --git a/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb
deleted file mode 100644
index 5338cab3871..00000000000
--- a/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddAsyncIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type'
-
- def up
- prepare_async_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb
deleted file mode 100644
index 2215a49e286..00000000000
--- a/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_on_author_id_and_action_and_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :events, name: INDEX_NAME
- end
-
- def down
- # no-op
- # The index had been added in the same milestone.
- # Adding back the index takes a long time and should not be needed.
- end
-end
diff --git a/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb b/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb
deleted file mode 100644
index e4cdc9add39..00000000000
--- a/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToEventsOnAuthorIdAndId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_on_author_id_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :events, [:author_id, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :events, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb b/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb
deleted file mode 100644
index 9be81e00b50..00000000000
--- a/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeyCiGroupVariablesGroupId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_33ae4d58d8'
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_group_variables, :namespaces, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_group_variables, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb b/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb
deleted file mode 100644
index b072d5616f5..00000000000
--- a/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiMinutesAdditionalPacksNamespaceIdForeignKeyConstraint < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_rails_e0e0c4e4b1'
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_minutes_additional_packs, :namespaces, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_minutes_additional_packs, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb b/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb
deleted file mode 100644
index d28e8bb81f6..00000000000
--- a/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveFindingEvidenceSummary < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_column :vulnerability_finding_evidences, :summary, :text
- end
-
- def down
- add_column :vulnerability_finding_evidences, :summary, :text
-
- add_text_limit :vulnerability_finding_evidences, :summary, 8_000_000
- end
-end
diff --git a/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb b/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb
deleted file mode 100644
index ece20f8095d..00000000000
--- a/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_fd1858fefd'
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :namespaces, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_daily_build_group_report_results, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb b/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb
deleted file mode 100644
index 1304f19708e..00000000000
--- a/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeyCiPendingBuildsNamespaceId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_fdc0137e4a'
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_pending_builds, :namespaces, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_pending_builds, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb b/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb
deleted file mode 100644
index 61ca066401e..00000000000
--- a/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeyCiRunnerNamespacesNamespaceId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_rails_f9d9ed3308'
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_runner_namespaces, :namespaces, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_runner_namespaces, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20220107064845_populate_vulnerability_reads.rb b/db/post_migrate/20220107064845_populate_vulnerability_reads.rb
deleted file mode 100644
index 58826c5f929..00000000000
--- a/db/post_migrate/20220107064845_populate_vulnerability_reads.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class PopulateVulnerabilityReads < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
- MIGRATION_NAME = 'PopulateVulnerabilityReads'
- SUB_BATCH_SIZE = 1_000
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('vulnerabilities'),
- MIGRATION_NAME,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true,
- other_job_arguments: [SUB_BATCH_SIZE]
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb b/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb
deleted file mode 100644
index 06be8edd707..00000000000
--- a/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIdxVulnerabilityOccurrencesDedupAgain < Gitlab::Database::Migration[1.0]
- TABLE = :vulnerability_occurrences
- INDEX_NAME = 'index_vulnerability_occurrences_deduplication'
- COLUMNS = %i[project_id report_type project_fingerprint]
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME
- end
-
- def down
- # nothing to do here
- end
-end
diff --git a/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb b/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb
deleted file mode 100644
index dae93e1636d..00000000000
--- a/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class SchedulePopulateTestReportsIssueId < Gitlab::Database::Migration[1.0]
- MIGRATION = 'PopulateTestReportsIssueId'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 30
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('requirements_management_test_reports').where(issue_id: nil),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb
deleted file mode 100644
index d91cd3b43ef..00000000000
--- a/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDastScannerProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_e4c49200f8'
-
- def up
- with_lock_retries do
- execute('LOCK ci_builds, dast_scanner_profiles_builds IN ACCESS EXCLUSIVE MODE')
- remove_foreign_key_if_exists(:dast_scanner_profiles_builds, :ci_builds, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key(:dast_scanner_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
- end
-end
diff --git a/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb b/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb
deleted file mode 100644
index dd8c6de4aaf..00000000000
--- a/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveRequirementsManagementTestReportsBuildIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_rails_e67d085910'
-
- def up
- with_lock_retries do
- execute('LOCK ci_builds, requirements_management_test_reports IN ACCESS EXCLUSIVE MODE')
- remove_foreign_key_if_exists(:requirements_management_test_reports, :ci_builds, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key(:requirements_management_test_reports, :ci_builds, column: :build_id, on_delete: :nullify, name: CONSTRAINT_NAME)
- end
-end
diff --git a/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb
deleted file mode 100644
index 00d8a39216b..00000000000
--- a/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDastSiteProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_a325505e99'
-
- def up
- with_lock_retries do
- execute('LOCK ci_builds, dast_site_profiles_builds IN ACCESS EXCLUSIVE MODE')
- remove_foreign_key_if_exists(:dast_site_profiles_builds, :ci_builds, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key(:dast_site_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
- end
-end
diff --git a/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb b/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb
deleted file mode 100644
index 20782664f63..00000000000
--- a/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSecurityScansBuildIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'fk_rails_4ef1e6b4c6'
-
- def up
- with_lock_retries do
- execute('LOCK ci_builds, security_scans IN ACCESS EXCLUSIVE MODE')
- remove_foreign_key_if_exists(:security_scans, :ci_builds, name: CONSTRAINT_NAME)
- end
- end
-
- def down
- add_concurrent_foreign_key(:security_scans, :ci_builds, column: :build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
- end
-end
diff --git a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
deleted file mode 100644
index 6de0f9424e8..00000000000
--- a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class IndexClusterAgentTokensOnStatus < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_cluster_agent_tokens_on_agent_id_status_last_used_at'
-
- def up
- add_concurrent_index :cluster_agent_tokens, 'agent_id, status, last_used_at DESC NULLS LAST', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb b/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb
deleted file mode 100644
index bcb78b28376..00000000000
--- a/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexOnAutoStopIn < Gitlab::Database::Migration[1.0]
- TABLE = :environments
- INDEX_NAME = 'index_environments_on_auto_stop_at'
- COLUMN = :auto_stop_at
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb b/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb
deleted file mode 100644
index 38cc259312d..00000000000
--- a/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexOnMergeRequestId < Gitlab::Database::Migration[1.0]
- TABLE = :merge_request_context_commits
- INDEX_NAME = 'index_merge_request_context_commits_on_merge_request_id'
- COLUMN = :merge_request_id
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index TABLE, COLUMN, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE, COLUMN, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb b/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb
deleted file mode 100644
index 795ec24f3bd..00000000000
--- a/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class TruncateCiMirrorTables < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- execute('TRUNCATE TABLE ci_namespace_mirrors')
- execute('TRUNCATE TABLE ci_project_mirrors')
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb b/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb
deleted file mode 100644
index bc17c125ba7..00000000000
--- a/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiPendingBuildsFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb b/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb
deleted file mode 100644
index 79d864e2c2a..00000000000
--- a/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiRunningBuildsFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK projects, ci_running_builds IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
deleted file mode 100644
index d786c9d846a..00000000000
--- a/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCascadeDeleteFromProjectNamespaceForeignKey < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TARGET_COLUMN = :project_namespace_id
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
- end
-
- add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :nullify)
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
- end
-
- add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
deleted file mode 100644
index 9ad90a3a7a0..00000000000
--- a/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiUnitTestsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb b/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb
deleted file mode 100644
index ad7cf2a20c9..00000000000
--- a/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK projects, ci_daily_build_group_report_results IN ACCESS EXCLUSIVE MODE')
- remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb b/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb
deleted file mode 100644
index 13cfacdc223..00000000000
--- a/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiFreezePeriodsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb b/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb
deleted file mode 100644
index e86dd015493..00000000000
--- a/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiResourceGroupsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_resource_groups, :projects, name: "fk_774722d144")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_resource_groups, :projects, name: "fk_774722d144", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb b/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb
deleted file mode 100644
index 3d2753bf9bf..00000000000
--- a/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiBuildReportResultsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_build_report_results, :projects, name: "fk_rails_056d298d48")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_build_report_results, :projects, name: "fk_rails_056d298d48", column: :project_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb b/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
deleted file mode 100644
index 966286a6730..00000000000
--- a/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUsersCiJobTokenProjectScopeLinksAddedByIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce", column: :added_by_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb b/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb
deleted file mode 100644
index 2e5d4cfd22e..00000000000
--- a/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUsersCiPipelineSchedulesOwnerIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2", column: :owner_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb b/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb
deleted file mode 100644
index f39b026bd77..00000000000
--- a/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleFixIncorrectMaxSeatsUsed < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
- TMP_IDX_NAME = 'tmp_gitlab_subscriptions_max_seats_used_migration'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :gitlab_subscriptions, :id, where: "start_date >= '2021-08-02' AND start_date <= '2021-11-20' AND max_seats_used != 0 AND max_seats_used > seats_in_use AND max_seats_used > seats", name: TMP_IDX_NAME
-
- return unless Gitlab.com?
-
- migrate_in(1.hour, 'FixIncorrectMaxSeatsUsed')
- end
-
- def down
- remove_concurrent_index_by_name :gitlab_subscriptions, TMP_IDX_NAME
- end
-end
diff --git a/db/post_migrate/20220114105525_add_index_on_projects_path.rb b/db/post_migrate/20220114105525_add_index_on_projects_path.rb
deleted file mode 100644
index cef38f91b21..00000000000
--- a/db/post_migrate/20220114105525_add_index_on_projects_path.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnProjectsPath < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = :projects
- INDEX_NAME = 'index_on_projects_path'
- COLUMN = :path
-
- def up
- add_concurrent_index TABLE, COLUMN, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index TABLE, COLUMN, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb b/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb
deleted file mode 100644
index 1ea89609926..00000000000
--- a/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddAuthorIndexToDesignManagementVersions < Gitlab::Database::Migration[1.0]
- TABLE = :design_management_versions
- INDEX_NAME = 'index_design_management_versions_on_author_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index TABLE, :author_id, where: 'author_id IS NOT NULL', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index TABLE, :author_id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb b/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb
deleted file mode 100644
index 5e306be016a..00000000000
--- a/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexClusterAgentTokensOnAgentIdAndLastUsedAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX = 'index_cluster_agent_tokens_on_agent_id_and_last_used_at'
-
- def up
- remove_concurrent_index_by_name :cluster_agent_tokens, name: INDEX
- end
-
- def down
- add_concurrent_index :cluster_agent_tokens, 'agent_id, last_used_at DESC NULLS LAST', name: INDEX
- end
-end
diff --git a/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb
deleted file mode 100644
index 18f68150e45..00000000000
--- a/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class SelfManagedRescheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings'
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- # Only run migration for self-managed
- return if ::Gitlab.com?
-
- # Vulnerability Finding Signatures is an EE only feature
- return unless Gitlab.ee?
-
- delete_queued_jobs(MIGRATION)
-
- requeue_background_migration_jobs_by_range_at_intervals(
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb b/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb
deleted file mode 100644
index 482f873739a..00000000000
--- a/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class PopulateAuditEventStreamingVerificationToken < Gitlab::Database::Migration[1.0]
- class ExternalAuditEventDestination < ActiveRecord::Base
- self.table_name = 'audit_events_external_audit_event_destinations'
-
- def regenerate_verification_token
- update!(verification_token: SecureRandom.base58(24))
- end
- end
-
- def up
- ExternalAuditEventDestination.all.each { |destination| destination.regenerate_verification_token }
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb b/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb
deleted file mode 100644
index 59a003c8f8d..00000000000
--- a/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiPipelineArtifactsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK projects, ci_pipeline_artifacts IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb b/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb
deleted file mode 100644
index 7fe9f1c856b..00000000000
--- a/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiSourcesPipelinesSourceProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK projects, ci_sources_pipelines IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:ci_sources_pipelines, :projects, name: "fk_acd9737679")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_sources_pipelines, :projects, name: "fk_acd9737679", column: :source_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb b/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb
deleted file mode 100644
index 9acf53a6ea2..00000000000
--- a/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUsersCiTriggersOwnerIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK users, ci_triggers IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:ci_triggers, :users, name: "fk_e8e10d1964")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_triggers, :users, name: "fk_e8e10d1964", column: :owner_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb b/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb
deleted file mode 100644
index c7ced0ae3b7..00000000000
--- a/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveMergeRequestsCiPipelinesMergeRequestIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_pipelines, :merge_requests, name: "fk_a23be95014")
-
- with_lock_retries do
- execute('LOCK merge_requests, ci_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_pipelines, :merge_requests, name: "fk_a23be95014")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pipelines, :merge_requests, name: "fk_a23be95014", column: :merge_request_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb b/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb
deleted file mode 100644
index 92d68ff4fbb..00000000000
--- a/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesMergeTrainsPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK ci_pipelines, merge_trains IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:merge_trains, :ci_pipelines, name: "fk_rails_f90820cb08")
- end
- end
-
- def down
- add_concurrent_foreign_key(:merge_trains, :ci_pipelines, name: "fk_rails_f90820cb08", column: :pipeline_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb b/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb
deleted file mode 100644
index 6a978ce2ab1..00000000000
--- a/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesMergeRequestsHeadPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK ci_pipelines, merge_requests IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:merge_requests, :ci_pipelines, name: "fk_fd82eae0b9")
- end
- end
-
- def down
- add_concurrent_foreign_key(:merge_requests, :ci_pipelines, name: "fk_fd82eae0b9", column: :head_pipeline_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb b/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb
deleted file mode 100644
index f4eedd0fa70..00000000000
--- a/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesDastProfilesPipelinesCiPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK ci_pipelines, dast_profiles_pipelines IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:dast_profiles_pipelines, :ci_pipelines, name: "fk_a60cad829d")
- end
- end
-
- def down
- add_concurrent_foreign_key(:dast_profiles_pipelines, :ci_pipelines, name: "fk_a60cad829d", column: :ci_pipeline_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb b/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb
deleted file mode 100644
index bd80767cf6a..00000000000
--- a/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesVulnerabilityStatisticsLatestPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK ci_pipelines, vulnerability_statistics IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:vulnerability_statistics, :ci_pipelines, name: "fk_e8b13c928f")
- end
- end
-
- def down
- add_concurrent_foreign_key(:vulnerability_statistics, :ci_pipelines, name: "fk_e8b13c928f", column: :latest_pipeline_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb b/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb
deleted file mode 100644
index b6397486dd0..00000000000
--- a/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesVulnerabilityOccurrencePipelinesPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute('LOCK ci_pipelines, vulnerability_occurrence_pipelines IN ACCESS EXCLUSIVE MODE')
-
- remove_foreign_key_if_exists(:vulnerability_occurrence_pipelines, :ci_pipelines, name: "fk_rails_6421e35d7d")
- end
- end
-
- def down
- add_concurrent_foreign_key(:vulnerability_occurrence_pipelines, :ci_pipelines, name: "fk_rails_6421e35d7d", column: :pipeline_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220120094340_drop_position_from_security_findings.rb b/db/post_migrate/20220120094340_drop_position_from_security_findings.rb
deleted file mode 100644
index 56af346ad1b..00000000000
--- a/db/post_migrate/20220120094340_drop_position_from_security_findings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DropPositionFromSecurityFindings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :security_findings, :position, :integer
- end
-end
diff --git a/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb b/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb
deleted file mode 100644
index 2b8cecd0e57..00000000000
--- a/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTmpIndexRoutesIdForNamespaces < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_index_for_namespace_id_migration_on_routes'
-
- disable_ddl_transaction!
-
- def up
- # Temporary index to be removed in 14.9
- # https://gitlab.com/gitlab-org/gitlab/-/issues/352353
- add_concurrent_index :routes, :id, where: "routes.namespace_id is null and routes.source_type = 'Namespace'", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :routes, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb b/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb
deleted file mode 100644
index 68279456ddd..00000000000
--- a/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillNamespaceIdForNamespaceRoutes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillNamespaceIdForNamespaceRoute'
- INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- MAX_BATCH_SIZE = 10_000
- SUB_BATCH_SIZE = 200
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :routes,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :routes, :id, [])
- end
-end
diff --git a/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb b/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb
deleted file mode 100644
index 279084e0fc5..00000000000
--- a/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillMemberNamespaceIdForGroupMembers < Gitlab::Database::Migration[1.0]
- MIGRATION = 'BackfillMemberNamespaceForGroupMembers'
- INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- MAX_BATCH_SIZE = 2_000
- SUB_BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :members,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :members, :id, [])
- end
-end
diff --git a/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb b/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb
deleted file mode 100644
index 93f0b30571a..00000000000
--- a/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiStagesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526
- return unless foreign_key_exists?(:ci_stages, :projects, name: "fk_2360681d1d")
-
- with_lock_retries do
- execute('LOCK projects, ci_stages IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_stages, :projects, name: "fk_2360681d1d")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_stages, :projects, name: "fk_2360681d1d", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb b/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb
deleted file mode 100644
index 45dec15a5a7..00000000000
--- a/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ReRemoveProjectsCiStagesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_stages, :projects, name: "fk_2360681d1d")
-
- with_lock_retries do
- execute('LOCK projects, ci_stages IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_stages, :projects, name: "fk_2360681d1d")
- end
- end
-
- def down
- # no-op, since the FK will be added via rollback by prior-migration
- end
-end
diff --git a/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb b/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb
deleted file mode 100644
index f647d4376ac..00000000000
--- a/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiVariablesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_variables, :projects, name: "fk_ada5eb64b3")
-
- with_lock_retries do
- execute('LOCK projects, ci_variables IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_variables, :projects, name: "fk_ada5eb64b3")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_variables, :projects, name: "fk_ada5eb64b3", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124130028_dedup_runner_projects.rb b/db/post_migrate/20220124130028_dedup_runner_projects.rb
deleted file mode 100644
index 1a4c895f1c4..00000000000
--- a/db/post_migrate/20220124130028_dedup_runner_projects.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-
-class DedupRunnerProjects < Gitlab::Database::Migration[1.0]
- TABLE_NAME = :ci_runner_projects
- TMP_INDEX_NAME = 'tmp_unique_ci_runner_projects_by_runner_id_and_project_id'
- OLD_INDEX_NAME = 'index_ci_runner_projects_on_runner_id_and_project_id'
- INDEX_NAME = 'index_unique_ci_runner_projects_on_runner_id_and_project_id'
- BATCH_SIZE = 5000
-
- disable_ddl_transaction!
-
- module Ci
- class RunnerProject < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'ci_runner_projects'
- end
- end
-
- def up
- last_runner_project_record_id = Ci::RunnerProject.maximum(:id) || 0
-
- # This index will disallow further duplicates while we're deduplicating the data.
- add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], where: "id > #{Integer(last_runner_project_record_id)}", unique: true, name: TMP_INDEX_NAME)
-
- Ci::RunnerProject.each_batch(of: BATCH_SIZE) do |relation|
- duplicated_runner_projects = Ci::RunnerProject
- .select('COUNT(*)', :runner_id, :project_id)
- .where('(runner_id, project_id) IN (?)', relation.select(:runner_id, :project_id))
- .group(:runner_id, :project_id)
- .having('COUNT(*) > 1')
-
- duplicated_runner_projects.each do |runner_project|
- deduplicate_item(runner_project)
- end
- end
-
- add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], unique: true, name: INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, TMP_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, TMP_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
- end
-
- private
-
- def deduplicate_item(runner_project)
- runner_projects_records = Ci::RunnerProject
- .where(project_id: runner_project.project_id, runner_id: runner_project.runner_id)
- .order(updated_at: :asc)
- .to_a
-
- attributes = {}
- runner_projects_records.each do |runner_projects_record|
- params = runner_projects_record.attributes.except('id')
- attributes.merge!(params.compact)
- end
-
- ApplicationRecord.transaction do
- record_to_keep = runner_projects_records.pop
- records_to_delete = runner_projects_records
-
- Ci::RunnerProject.where(id: records_to_delete.map(&:id)).delete_all
- record_to_keep.update!(attributes)
- end
- end
-end
diff --git a/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb b/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb
deleted file mode 100644
index b16234fc812..00000000000
--- a/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsExternalPullRequestsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b")
-
- with_lock_retries do
- execute('LOCK projects, external_pull_requests IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b")
- end
- end
-
- def down
- add_concurrent_foreign_key(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb b/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb
deleted file mode 100644
index 684d363eb96..00000000000
--- a/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiTriggersProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_triggers, :projects, name: "fk_e3e63f966e")
-
- with_lock_retries do
- execute('LOCK projects, ci_triggers IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_triggers, :projects, name: "fk_e3e63f966e")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_triggers, :projects, name: "fk_e3e63f966e", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb b/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb
deleted file mode 100644
index de8feb96a06..00000000000
--- a/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiRunnerProjectsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_runner_projects, :projects, name: "fk_4478a6f1e4")
-
- with_lock_retries do
- execute('LOCK projects, ci_runner_projects IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_runner_projects, :projects, name: "fk_4478a6f1e4")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_runner_projects, :projects, name: "fk_4478a6f1e4", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb b/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb
deleted file mode 100644
index 8596b1f14ba..00000000000
--- a/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiSubscriptionsProjectsDownstreamProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483")
-
- with_lock_retries do
- execute('LOCK projects, ci_subscriptions_projects IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483", column: :downstream_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb b/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb
deleted file mode 100644
index 1948a78916d..00000000000
--- a/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiJobArtifactsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526
- return unless foreign_key_exists?(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
-
- with_lock_retries do
- execute('LOCK projects, ci_job_artifacts IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb b/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb
deleted file mode 100644
index bb59134b927..00000000000
--- a/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ReRemoveProjectsCiJobArtifactsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
-
- with_lock_retries do
- execute('LOCK projects, ci_job_artifacts IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
- end
- end
-
- def down
- # no-op, since the FK will be added via rollback by prior-migration
- end
-end
diff --git a/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb b/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb
deleted file mode 100644
index fc9dc2cc6dc..00000000000
--- a/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiBuildsMetadataProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526
- return unless foreign_key_exists?(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
-
- with_lock_retries do
- execute('LOCK projects, ci_builds_metadata IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb b/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb
deleted file mode 100644
index 6483b8e0643..00000000000
--- a/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ReRemoveProjectsCiBuildsMetadataProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
-
- with_lock_retries do
- execute('LOCK projects, ci_builds_metadata IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
- end
- end
-
- def down
- # no-op, since the FK will be added via rollback by prior-migration
- end
-end
diff --git a/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb b/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb
deleted file mode 100644
index 50448f4a884..00000000000
--- a/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiSubscriptionsProjectsUpstreamProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b")
-
- with_lock_retries do
- execute('LOCK projects, ci_subscriptions_projects IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b", column: :upstream_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb b/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb
deleted file mode 100644
index e15d337045e..00000000000
--- a/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiSourcesPipelinesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a")
-
- with_lock_retries do
- execute('LOCK projects, ci_sources_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb b/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb
deleted file mode 100644
index f90d477673a..00000000000
--- a/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiRefsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_refs, :projects, name: "fk_rails_4249db8cc3")
-
- with_lock_retries do
- execute('LOCK projects, ci_refs IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_refs, :projects, name: "fk_rails_4249db8cc3")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_refs, :projects, name: "fk_rails_4249db8cc3", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb b/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb
deleted file mode 100644
index 8bfe9586a50..00000000000
--- a/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiJobTokenProjectScopeLinksSourceProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b")
-
- with_lock_retries do
- execute('LOCK projects, ci_job_token_project_scope_links IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b", column: :source_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb b/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb
deleted file mode 100644
index cff78342d21..00000000000
--- a/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiProjectMonthlyUsagesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6")
-
- with_lock_retries do
- execute('LOCK projects, ci_project_monthly_usages IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb b/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb
deleted file mode 100644
index b111b95fccf..00000000000
--- a/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesDastSiteProfilesPipelinesCiPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5")
-
- with_lock_retries do
- execute('LOCK ci_pipelines, dast_site_profiles_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5")
- end
- end
-
- def down
- add_concurrent_foreign_key(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5", column: :ci_pipeline_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb b/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb
deleted file mode 100644
index 1b932d084bb..00000000000
--- a/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelinesVulnerabilityFeedbackPipelineIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9")
-
- with_lock_retries do
- execute('LOCK ci_pipelines, vulnerability_feedback IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9")
- end
- end
-
- def down
- add_concurrent_foreign_key(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9", column: :pipeline_id, target_column: :id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb b/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb
deleted file mode 100644
index dee86a70553..00000000000
--- a/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class SchedulePopulateTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0]
- MIGRATION = 'PopulateTopicsNonPrivateProjectsCount'
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('topics'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb b/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb
deleted file mode 100644
index a33e02f2408..00000000000
--- a/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiJobTokenProjectScopeLinksTargetProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465")
-
- with_lock_retries do
- execute('LOCK projects, ci_job_token_project_scope_links IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465", column: :target_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb b/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb
deleted file mode 100644
index a69cd43b921..00000000000
--- a/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiSourcesProjectsSourceProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc")
-
- with_lock_retries do
- execute('LOCK projects, ci_sources_projects IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc", column: :source_project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb b/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb
deleted file mode 100644
index 870127ab168..00000000000
--- a/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiPipelineSchedulesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4")
-
- with_lock_retries do
- execute('LOCK projects, ci_pipeline_schedules IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb b/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb
deleted file mode 100644
index 8caa6db7507..00000000000
--- a/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiBuildsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526
- return unless foreign_key_exists?(:ci_builds, :projects, name: "fk_befce0568a")
-
- with_lock_retries do
- execute('LOCK projects, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_builds, :projects, name: "fk_befce0568a")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_builds, :projects, name: "fk_befce0568a", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb b/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb
deleted file mode 100644
index 2a026388bbf..00000000000
--- a/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ReRemoveProjectsCiBuildsProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_builds, :projects, name: "fk_befce0568a")
-
- with_lock_retries do
- execute('LOCK projects, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_builds, :projects, name: "fk_befce0568a")
- end
- end
-
- def down
- # no-op, since the FK will be added via rollback by prior-migration
- end
-end
diff --git a/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb b/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb
deleted file mode 100644
index 6867cf720f3..00000000000
--- a/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectsCiPipelinesProjectIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_pipelines, :projects, name: "fk_86635dbd80")
-
- with_lock_retries do
- execute('LOCK projects, ci_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_pipelines, :projects, name: "fk_86635dbd80")
- end
- end
-
- def down
- add_concurrent_foreign_key(:ci_pipelines, :projects, name: "fk_86635dbd80", column: :project_id, target_column: :id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb b/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb
deleted file mode 100644
index e6bb43af760..00000000000
--- a/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToMergeRequestAssigneesState < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_assignees_state'
-
- def up
- add_concurrent_index :merge_request_assignees, :state, where: 'state = 2', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb b/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb
deleted file mode 100644
index 13f4e05c15b..00000000000
--- a/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToMergeRequestReviewersState < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_reviewers_state'
-
- def up
- add_concurrent_index :merge_request_reviewers, :state, where: 'state = 2', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb b/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb
deleted file mode 100644
index a6775251d42..00000000000
--- a/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBackfillCiNamespaceMirrors < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb b/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb
deleted file mode 100644
index c0cdb74c595..00000000000
--- a/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBackfillCiProjectMirrors < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220128155251_remove_dangling_running_builds.rb b/db/post_migrate/20220128155251_remove_dangling_running_builds.rb
deleted file mode 100644
index f86a21ced00..00000000000
--- a/db/post_migrate/20220128155251_remove_dangling_running_builds.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDanglingRunningBuilds < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- def up
- each_batch_range('ci_running_builds', of: BATCH_SIZE) do |min, max|
- execute <<~SQL
- DELETE FROM ci_running_builds
- USING ci_builds
- WHERE ci_builds.id = ci_running_builds.build_id
- AND ci_builds.status = 'failed'
- AND ci_builds.type = 'Ci::Build'
- AND ci_running_builds.id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # no-op
- # This migration deletes data and it can not be reversed
- end
-end
diff --git a/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb b/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb
deleted file mode 100644
index eccfab25126..00000000000
--- a/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class FixApprovalRulesCodeOwnersRuleTypeIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_approval_rules_code_owners_rule_type'
- OLD_INDEX_NAME = 'index_approval_rules_code_owners_rule_type_old'
- TABLE = :approval_merge_request_rules
- COLUMN = :merge_request_id
- WHERE_CONDITION = 'rule_type = 2'
-
- disable_ddl_transaction!
-
- def up
- rename_index TABLE, INDEX_NAME, OLD_INDEX_NAME if index_exists_by_name?(TABLE, INDEX_NAME) && !index_exists_by_name?(TABLE, OLD_INDEX_NAME)
-
- add_concurrent_index TABLE, COLUMN, where: WHERE_CONDITION, name: INDEX_NAME
-
- remove_concurrent_index_by_name TABLE, OLD_INDEX_NAME
- end
-
- def down
- # No-op
- end
-end
diff --git a/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb b/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb
deleted file mode 100644
index f47c04dd2ef..00000000000
--- a/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class IndexJobArtifactsOnTraceTypeAndExpireAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at'
- TIMESTAMPS = "'2021-04-22 00:00:00', '2021-05-22 00:00:00', '2021-06-22 00:00:00', '2022-01-22 00:00:00', '2022-02-22 00:00:00', '2022-03-22 00:00:00', '2022-04-22 00:00:00'"
-
- def up
- add_concurrent_index :ci_job_artifacts, :id, where: "file_type = 3 AND expire_at IN (#{TIMESTAMPS})", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb b/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb
deleted file mode 100644
index 8e282a9b8c2..00000000000
--- a/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleTraceExpiryRemoval < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RemoveAllTraceExpirationDates'
- BATCH_SIZE = 100_000
- DELAY_INTERVAL = 4.minutes
-
- disable_ddl_transaction!
-
- # Stubbed class to connect to the CI database
- # connects_to has to be called in abstract classes.
- class MultiDbAdaptableClass < ActiveRecord::Base
- self.abstract_class = true
-
- if Gitlab::Database.has_config?(:ci)
- connects_to database: { writing: :ci, reading: :ci }
- end
- end
-
- # Stubbed class to access the ci_job_artifacts table
- class JobArtifact < MultiDbAdaptableClass
- include EachBatch
-
- self.table_name = 'ci_job_artifacts'
-
- TARGET_TIMESTAMPS = [
- Date.new(2021, 04, 22).midnight.utc,
- Date.new(2021, 05, 22).midnight.utc,
- Date.new(2021, 06, 22).midnight.utc,
- Date.new(2022, 01, 22).midnight.utc,
- Date.new(2022, 02, 22).midnight.utc,
- Date.new(2022, 03, 22).midnight.utc,
- Date.new(2022, 04, 22).midnight.utc
- ].freeze
-
- scope :in_targeted_timestamps, -> { where(expire_at: TARGET_TIMESTAMPS) }
- scope :traces, -> { where(file_type: 3) }
- end
-
- def up
- return unless Gitlab.com?
-
- queue_background_migration_jobs_by_range_at_intervals(
- JobArtifact.traces.in_targeted_timestamps,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb b/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb
deleted file mode 100644
index 0e2ef3b3324..00000000000
--- a/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexClustersKubernetesNamespacesOnClusterId < Gitlab::Database::Migration[1.0]
- INDEX = 'index_clusters_kubernetes_namespaces_on_cluster_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :clusters_kubernetes_namespaces, INDEX
- end
-
- def down
- add_concurrent_index :clusters_kubernetes_namespaces, :cluster_id, name: INDEX
- end
-end
diff --git a/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb b/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb
deleted file mode 100644
index 252b4a01d04..00000000000
--- a/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBackgroundMigrationPopulateTestReportsIssueId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'PopulateTestReportsIssueId'
-
- def up
- finalize_background_migration(MIGRATION)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb b/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb
deleted file mode 100644
index a864ec7e395..00000000000
--- a/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserDetailsProvisioningIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_user_details_on_provisioned_by_group_id_user_id'
- OLD_INDEX_NAME = 'index_user_details_on_provisioned_by_group_id'
-
- def up
- add_concurrent_index :user_details, [:provisioned_by_group_id, :user_id], name: INDEX_NAME
- remove_concurrent_index_by_name :user_details, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :user_details, :provisioned_by_group_id, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :user_details, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb b/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb
deleted file mode 100644
index cc9dabdf624..00000000000
--- a/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToVulnerabilityFindingLinksWithTruncate < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NAME_URL_INDEX_NAME = 'finding_link_name_url_idx'
- URL_INDEX_NAME = 'finding_link_url_idx'
-
- def up
- execute('TRUNCATE TABLE vulnerability_finding_links')
-
- add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], unique: true, name: NAME_URL_INDEX_NAME
- add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], unique: true, where: 'name is null', name: URL_INDEX_NAME
- end
-
- def down
- remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], name: NAME_URL_INDEX_NAME
- remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], name: URL_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220202105733_delete_service_template_records.rb b/db/post_migrate/20220202105733_delete_service_template_records.rb
deleted file mode 100644
index e1697f23588..00000000000
--- a/db/post_migrate/20220202105733_delete_service_template_records.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteServiceTemplateRecords < Gitlab::Database::Migration[1.0]
- class Integration < ActiveRecord::Base
- # Disable single-table inheritance
- self.inheritance_column = :_type_disabled
- end
-
- def up
- Integration.where(template: true).delete_all
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb b/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb
deleted file mode 100644
index 7815829d36a..00000000000
--- a/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexEpicIssuesOnEpicId < Gitlab::Database::Migration[1.0]
- INDEX = 'index_epic_issues_on_epic_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :epic_issues, name: INDEX
- end
-
- def down
- add_concurrent_index :epic_issues, :epic_id, name: INDEX
- end
-end
diff --git a/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb b/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb
deleted file mode 100644
index 49c9efc497c..00000000000
--- a/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillNamespaceStatisticsWithDependencyProxySize < Gitlab::Database::Migration[1.0]
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 500
- MIGRATION = 'PopulateNamespaceStatistics'
-
- disable_ddl_transaction!
-
- def up
- groups = exec_query <<~SQL
- SELECT dependency_proxy_manifests.group_id FROM dependency_proxy_manifests
- UNION
- SELECT dependency_proxy_blobs.group_id from dependency_proxy_blobs
- SQL
-
- groups.rows.flatten.in_groups_of(BATCH_SIZE, false).each_with_index do |group_ids, index|
- migrate_in(index * DELAY_INTERVAL, MIGRATION, [group_ids, [:dependency_proxy_size]])
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb b/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb
deleted file mode 100644
index 933ad747c5c..00000000000
--- a/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCycleAnalyticsAggregations < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 50
-
- def up
- model = define_batchable_model('analytics_cycle_analytics_group_value_streams')
-
- model.each_batch(of: BATCH_SIZE) do |relation|
- execute <<~SQL
- WITH records_to_be_inserted AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- SELECT root_ancestor.id AS group_id
- FROM (#{relation.select(:group_id).to_sql}) as value_streams,
- LATERAL (
- WITH RECURSIVE "base_and_ancestors" AS (
- (SELECT "namespaces"."id", "namespaces"."parent_id" FROM "namespaces" WHERE "namespaces"."id" = value_streams.group_id)
- UNION
- (SELECT "namespaces"."id", "namespaces"."parent_id" FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."id" = "base_and_ancestors"."parent_id")
- )
- SELECT "namespaces"."id" FROM "base_and_ancestors" as "namespaces" WHERE parent_id IS NULL LIMIT 1
- ) as root_ancestor
- )
- INSERT INTO "analytics_cycle_analytics_aggregations"
- SELECT * FROM "records_to_be_inserted"
- ON CONFLICT DO NOTHING
- SQL
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220204194347_encrypt_integration_properties.rb b/db/post_migrate/20220204194347_encrypt_integration_properties.rb
deleted file mode 100644
index 82dd3a05e1d..00000000000
--- a/db/post_migrate/20220204194347_encrypt_integration_properties.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class EncryptIntegrationProperties < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- MIGRATION = 'EncryptIntegrationProperties'
- BATCH_SIZE = 1_000
- INTERVAL = 2.minutes.to_i
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('integrations').all,
- MIGRATION,
- INTERVAL,
- track_jobs: true,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # this migration is not reversible
- end
-end
diff --git a/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb b/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb
deleted file mode 100644
index 3275912b0ab..00000000000
--- a/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateApiIndexesForProjects < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- ARCHIVED_INDEX_NAME = 'idx_projects_api_created_at_id_for_archived'
- OLD_ARCHIVED_INDEX_NAME = 'index_projects_api_created_at_id_for_archived'
- PUBLIC_AND_ARCHIVED_INDEX_NAME = 'idx_projects_api_created_at_id_for_archived_vis20'
- OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME = 'index_projects_api_created_at_id_for_archived_vis20'
- INTERNAL_PROJECTS_INDEX_NAME = 'idx_projects_api_created_at_id_for_vis10'
- OLD_INTERNAL_PROJECTS_INDEX_NAME = 'index_projects_api_created_at_id_for_vis10'
-
- def up
- add_concurrent_index :projects, [:created_at, :id],
- where: "archived = true AND pending_delete = false AND hidden = false",
- name: ARCHIVED_INDEX_NAME
-
- add_concurrent_index :projects, [:created_at, :id],
- where: "archived = true AND visibility_level = 20 AND pending_delete = false AND hidden = false",
- name: PUBLIC_AND_ARCHIVED_INDEX_NAME
-
- add_concurrent_index :projects, [:created_at, :id],
- where: "visibility_level = 10 AND pending_delete = false AND hidden = false",
- name: INTERNAL_PROJECTS_INDEX_NAME
-
- remove_concurrent_index_by_name :projects, OLD_ARCHIVED_INDEX_NAME
- remove_concurrent_index_by_name :projects, OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME
- remove_concurrent_index_by_name :projects, OLD_INTERNAL_PROJECTS_INDEX_NAME
- end
-
- def down
- add_concurrent_index :projects, [:created_at, :id],
- where: "archived = true AND pending_delete = false",
- name: OLD_ARCHIVED_INDEX_NAME
-
- add_concurrent_index :projects, [:created_at, :id],
- where: "archived = true AND visibility_level = 20 AND pending_delete = false",
- name: OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME
-
- add_concurrent_index :projects, [:created_at, :id],
- where: "visibility_level = 10 AND pending_delete = false",
- name: OLD_INTERNAL_PROJECTS_INDEX_NAME
-
- remove_concurrent_index_by_name :projects, ARCHIVED_INDEX_NAME
- remove_concurrent_index_by_name :projects, PUBLIC_AND_ARCHIVED_INDEX_NAME
- remove_concurrent_index_by_name :projects, INTERNAL_PROJECTS_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb b/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb
deleted file mode 100644
index 633570aeaa0..00000000000
--- a/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleMigratePersonalNamespaceProjectMaintainerToOwner < Gitlab::Database::Migration[1.0]
- MIGRATION = 'MigratePersonalNamespaceProjectMaintainerToOwner'
- INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- SUB_BATCH_SIZE = 200
-
- disable_ddl_transaction!
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :members,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb b/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb
deleted file mode 100644
index 82e36174290..00000000000
--- a/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class StartBackfillCiQueuingTables < Gitlab::Database::Migration[1.0]
- MIGRATION = 'BackfillCiQueuingTables'
- BATCH_SIZE = 500
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- return if Gitlab.com?
-
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::BackfillCiQueuingTables::Ci::Build.pending,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb b/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb
deleted file mode 100644
index d38509ed8c2..00000000000
--- a/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddPartialIndexForBatchingActiveClusterImageScanningVulnerabilities < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id_active_cis'
- INDEX_FILTER_CONDITION = 'report_type = 7 AND state = ANY(ARRAY[1, 4])'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerabilities, [:project_id, :id], where: INDEX_FILTER_CONDITION, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb b/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb
deleted file mode 100644
index c8a6bd0a15d..00000000000
--- a/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleFixIncorrectMaxSeatsUsed2 < Gitlab::Database::Migration[1.0]
- MIGRATION = 'FixIncorrectMaxSeatsUsed'
- TMP_IDX_NAME = 'tmp_gitlab_subscriptions_max_seats_used_migration_2'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :gitlab_subscriptions, :id, where: "start_date < '2021-08-02' AND max_seats_used != 0 AND max_seats_used > seats_in_use AND max_seats_used > seats", name: TMP_IDX_NAME
-
- return unless Gitlab.com?
-
- migrate_in(1.hour, MIGRATION, ['batch_2_for_start_date_before_02_aug_2021'])
- end
-
- def down
- remove_concurrent_index_by_name :gitlab_subscriptions, TMP_IDX_NAME
- end
-end
diff --git a/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb b/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb
deleted file mode 100644
index 3a9f48dec44..00000000000
--- a/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# frozen_string_literal: true
-
-# Reproduce the indices on integrations.type on integrations.type_new
-class CreateIndexesOnIntegrationTypeNew < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = :integrations
- COLUMN = :type_new
-
- def indices
- [
- {
- name: "index_integrations_on_project_and_#{COLUMN}_where_inherit_null",
- columns: [:project_id, COLUMN],
- where: 'inherit_from_id IS NULL'
- },
- {
- name: "index_integrations_on_project_id_and_#{COLUMN}_unique",
- columns: [:project_id, COLUMN],
- unique: true
- },
- {
- name: "index_integrations_on_#{COLUMN}",
- columns: [COLUMN]
- },
- {
- name: "index_integrations_on_#{COLUMN}_and_instance_partial",
- columns: [COLUMN, :instance],
- where: 'instance = true'
- },
- {
- name: "index_integrations_on_#{COLUMN}_and_template_partial",
- columns: [COLUMN, :template],
- where: 'template = true'
- },
- {
- # column names are limited to 63 characters, so this one is re-worded for clarity
- name: "index_integrations_on_#{COLUMN}_id_when_active_and_has_project",
- columns: [COLUMN, :id],
- where: '((active = true) AND (project_id IS NOT NULL))'
- },
- {
- name: "index_integrations_on_unique_group_id_and_#{COLUMN}",
- columns: [:group_id, COLUMN]
- }
- ]
- end
-
- def up
- indices.each do |index|
- add_concurrent_index TABLE_NAME, index[:columns], index.except(:columns)
- end
- end
-
- def down
- indices.each do |index|
- remove_concurrent_index_by_name TABLE_NAME, index[:name]
- end
- end
-end
diff --git a/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb b/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb
deleted file mode 100644
index 1f36132c578..00000000000
--- a/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class RerunConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0]
- MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata
- MODEL_CLASS = MIGRATION_CLASS::Finding
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 500
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- MODEL_CLASS.by_api_report_types,
- MIGRATION_CLASS.name.demodulize,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
-
- # up fixes invalid data by updating columns in-place.
- # It is a backwards-compatible change, and reversing it in a downgrade would not be desirable.
- end
-end
diff --git a/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb b/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb
deleted file mode 100644
index 589b75dd918..00000000000
--- a/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemovePackageFilesLimitFromApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless column_exists?(:application_settings, :max_package_files_for_package_destruction)
-
- remove_column :application_settings, :max_package_files_for_package_destruction, :smallint
- end
-
- def down
- add_column :application_settings, :max_package_files_for_package_destruction, :smallint, default: 100, null: false
- add_check_constraint :application_settings,
- 'max_package_files_for_package_destruction > 0',
- 'app_settings_max_package_files_for_package_destruction_positive'
- end
-end
diff --git a/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb b/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb
deleted file mode 100644
index 9cc04cef757..00000000000
--- a/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ValidateNotNullConstraintOnSecurityFindingsUuid < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- validate_not_null_constraint(:security_findings, :uuid)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb b/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb
deleted file mode 100644
index 41cd3446c7a..00000000000
--- a/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveShowDiffPreviewInEmailColumn < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- remove_column :project_settings, :show_diff_preview_in_email, :boolean
- end
-
- def down
- add_column :project_settings, :show_diff_preview_in_email, :boolean, default: true, null: false
- end
-end
diff --git a/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb b/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb
deleted file mode 100644
index 4d4a20b83b3..00000000000
--- a/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotNullConstraintForSecurityScanSucceeded < Gitlab::Database::Migration[1.0]
- def up
- change_column_null :analytics_devops_adoption_snapshots, :security_scan_succeeded, true
- end
-
- def down
- # There may now be nulls in the table, so we cannot re-add the constraint here.
- end
-end
diff --git a/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb b/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb
deleted file mode 100644
index 2bb5ba18743..00000000000
--- a/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class CreateNotNullConstraintReleasesTag < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_not_null_constraint :releases, :tag, constraint_name: 'releases_not_null_tag', validate: false
- end
-
- def down
- remove_not_null_constraint :releases, :tag, constraint_name: 'releases_not_null_tag'
- end
-end
diff --git a/db/post_migrate/20220222192525_remove_null_releases.rb b/db/post_migrate/20220222192525_remove_null_releases.rb
deleted file mode 100644
index 4efd5393122..00000000000
--- a/db/post_migrate/20220222192525_remove_null_releases.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNullReleases < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- class Release < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'releases'
- end
-
- def up
- Release.all.each_batch(of: 25000) do |rel|
- rel.where(tag: nil).delete_all
- end
- end
-
- def down
- # no-op
- #
- # releases with the same tag within a project have been removed
- # and therefore the duplicate release data is no longer available
- end
-end
diff --git a/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb b/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb
deleted file mode 100644
index 10b6ab8204d..00000000000
--- a/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleNullifyOrphanRunnerIdOnCiBuilds < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'NullifyOrphanRunnerIdOnCiBuilds'
- INTERVAL = 2.minutes
- BATCH_SIZE = 50_000
- MAX_BATCH_SIZE = 150_000
- SUB_BATCH_SIZE = 500
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :ci_builds,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :ci_builds, :id, [])
- end
-end
diff --git a/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb b/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb
deleted file mode 100644
index 7e79c89203a..00000000000
--- a/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleMergeTopicsWithSameName < Gitlab::Database::Migration[1.0]
- MIGRATION = 'MergeTopicsWithSameName'
- BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- class Topic < ActiveRecord::Base
- self.table_name = 'topics'
- end
-
- def up
- Topic.select('LOWER(name) as name').group('LOWER(name)').having('COUNT(*) > 1').order('LOWER(name)')
- .in_groups_of(BATCH_SIZE, false).each_with_index do |group, i|
- migrate_in((i + 1) * 2.minutes, MIGRATION, [group.map(&:name)])
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb b/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb
deleted file mode 100644
index b22f3e7996f..00000000000
--- a/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AsyncBuildTraceExpireAtIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at'
- TIMESTAMPS = "'2021-04-22 00:00:00', '2021-05-22 00:00:00', '2021-06-22 00:00:00', '2022-01-22 00:00:00', '2022-02-22 00:00:00', '2022-03-22 00:00:00', '2022-04-22 00:00:00'"
-
- def up
- prepare_async_index :ci_job_artifacts, :id, where: "file_type = 3 AND expire_at IN (#{TIMESTAMPS})", name: INDEX_NAME
- end
-
- def down
- unprepare_async_index :ci_builds, :id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb b/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb
deleted file mode 100644
index feb0f2c83ab..00000000000
--- a/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures < Gitlab::Database::Migration[1.0]
- TABLE = "ci_builds"
- OLD_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features"
- NEW_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_old"
- COLUMNS = %i[name id]
- CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text,
- 'dast'::character varying::text,
- 'dependency_scanning'::character varying::text,
- 'license_management'::character varying::text,
- 'sast'::character varying::text,
- 'secret_detection'::character varying::text,
- 'coverage_fuzzing'::character varying::text,
- 'license_scanning'::character varying::text,
- 'apifuzzer_fuzz'::character varying::text,
- 'apifuzzer_fuzz_dnd'::character varying::text])
- ) AND type::text = 'Ci::Build'::text"
-
- enable_lock_retries!
-
- def up
- rename_index(TABLE, OLD_INDEX_NAME, NEW_INDEX_NAME)
- prepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME, where: CONSTRAINTS
- end
-
- def down
- unprepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME
- rename_index(TABLE, NEW_INDEX_NAME, OLD_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb b/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb
deleted file mode 100644
index 4fcf8a28727..00000000000
--- a/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBackfillCiQueuingTables < Gitlab::Database::Migration[1.0]
- MIGRATION = 'BackfillCiQueuingTables'
-
- disable_ddl_transaction!
-
- def up
- finalize_background_migration(MIGRATION)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb b/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb
deleted file mode 100644
index 607161004cf..00000000000
--- a/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillAllProjectNamespaces < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- MAX_BATCH_SIZE = 5_000
- SUB_BATCH_SIZE = 10
-
- disable_ddl_transaction!
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :projects,
- :id,
- nil,
- 'up',
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :projects, :id, [nil, 'up'])
- end
-end
diff --git a/db/post_migrate/20220302114046_backfill_group_features.rb b/db/post_migrate/20220302114046_backfill_group_features.rb
deleted file mode 100644
index 5e0ff9095a3..00000000000
--- a/db/post_migrate/20220302114046_backfill_group_features.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillGroupFeatures < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillGroupFeatures'
- INTERVAL = 2.minutes
- BATCH_SIZE = 10_000
- SUB_BATCH_SIZE = 1_000
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :namespaces,
- :id,
- BATCH_SIZE,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :namespaces, :id, [BATCH_SIZE])
- end
-end
diff --git a/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb b/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb
deleted file mode 100644
index 5be6bb00269..00000000000
--- a/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures < Gitlab::Database::Migration[1.0]
- TABLE = "ci_builds"
- COLUMNS = %i[name id]
- INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features"
- CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text,
- 'dast'::character varying::text,
- 'dependency_scanning'::character varying::text,
- 'license_management'::character varying::text,
- 'sast'::character varying::text,
- 'secret_detection'::character varying::text,
- 'coverage_fuzzing'::character varying::text,
- 'license_scanning'::character varying::text,
- 'apifuzzer_fuzz'::character varying::text,
- 'apifuzzer_fuzz_dnd'::character varying::text])
- ) AND type::text = 'Ci::Build'::text"
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS)
- end
-
- def down
- remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS)
- end
-end
diff --git a/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb b/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb
deleted file mode 100644
index 43f89b05fa4..00000000000
--- a/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class DropPartitionedForeignKeys < Gitlab::Database::Migration[1.0]
- def up
- drop_table :partitioned_foreign_keys
- end
-
- def down
- create_table :partitioned_foreign_keys do |t|
- t.boolean :cascade_delete, null: false, default: true
- t.text :from_table, null: false, limit: 63
- t.text :from_column, null: false, limit: 63
- t.text :to_table, null: false, limit: 63
- t.text :to_column, null: false, limit: 63
-
- t.index [:to_table, :from_table, :from_column], unique: true, name: :index_partitioned_foreign_keys_unique_index
- end
- end
-end
diff --git a/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb b/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb
deleted file mode 100644
index e78b8fd48ca..00000000000
--- a/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexOnSecurityTrainingProviders < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_security_training_providers_on_unique_name'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :security_training_providers, :name, unique: true, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :security_training_providers, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220305223212_add_security_training_providers.rb b/db/post_migrate/20220305223212_add_security_training_providers.rb
deleted file mode 100644
index fbddee0ae99..00000000000
--- a/db/post_migrate/20220305223212_add_security_training_providers.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityTrainingProviders < Gitlab::Database::Migration[1.0]
- KONTRA_DATA = {
- name: 'Kontra',
- description: "Kontra Application Security provides interactive developer security education that
- enables engineers to quickly learn security best practices
- and fix issues in their code by analysing real-world software security vulnerabilities.",
- url: "https://application.security/api/webhook/gitlab/exercises/search"
- }
-
- SCW_DATA = {
- name: 'Secure Code Warrior',
- description: "Resolve vulnerabilities faster and confidently with highly relevant and bite-sized secure coding learning.",
- url: "https://integration-api.securecodewarrior.com/api/v1/trial"
- }
-
- module Security
- class TrainingProvider < ActiveRecord::Base
- self.table_name = 'security_training_providers'
- end
- end
-
- def up
- current_time = Time.current
- timestamps = { created_at: current_time, updated_at: current_time }
-
- Security::TrainingProvider.reset_column_information
-
- # upsert providers
- Security::TrainingProvider.upsert_all([KONTRA_DATA.merge(timestamps), SCW_DATA.merge(timestamps)])
- end
-
- def down
- Security::TrainingProvider.reset_column_information
-
- Security::TrainingProvider.find_by(name: KONTRA_DATA[:name])&.destroy
- Security::TrainingProvider.find_by(name: SCW_DATA[:name])&.destroy
- end
-end
diff --git a/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb
deleted file mode 100644
index 3e580c013c3..00000000000
--- a/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexForRemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_releases_on_id_project_id_tag'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :releases,
- %i[project_id tag id],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :releases, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb
deleted file mode 100644
index d8b99380825..00000000000
--- a/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- class Release < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'releases'
- end
-
- def up
- Release.each_batch(of: 5000) do |relation|
- relation
- .where('exists (select 1 from releases r2 where r2.project_id = releases.project_id and r2.tag = releases.tag and r2.id > releases.id)')
- .delete_all
- end
- end
-
- def down
- # no-op
- #
- # releases with the same tag within a project have been removed
- # and therefore the duplicate release data is no longer available
- end
-end
diff --git a/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb
deleted file mode 100644
index 8efb24daff9..00000000000
--- a/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexForRemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_releases_on_id_project_id_tag'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :releases, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :releases,
- %i[project_id tag id],
- name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb b/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb
deleted file mode 100644
index 8540f19f079..00000000000
--- a/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class CreateUniqueIndexReleaseTagProject < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_releases_on_project_tag_unique'
- OLD_INDEX_NAME = 'index_releases_on_project_id_and_tag'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :releases,
- %i[project_id tag],
- unique: true,
- name: INDEX_NAME
- remove_concurrent_index_by_name :releases, name: OLD_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :releases, name: INDEX_NAME
- add_concurrent_index :releases,
- %i[project_id tag],
- name: OLD_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb b/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb
deleted file mode 100644
index 2d01374780d..00000000000
--- a/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RenameUserEmailLookupLimitSettingToSearchSettingsCleanup < Gitlab::Database::Migration[1.0]
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = :application_settings
- end
-
- def up
- ApplicationSetting.update_all 'search_rate_limit=user_email_lookup_limit'
- end
-
- def down
- ApplicationSetting.update_all 'user_email_lookup_limit=search_rate_limit'
- end
-end
diff --git a/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb
deleted file mode 100644
index 4b895c291d8..00000000000
--- a/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class DropOldIndexSecurityCiBuildsOnNameAndIdParserFeatures < Gitlab::Database::Migration[1.0]
- TABLE = "ci_builds"
- COLUMNS = %i[name id]
- INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_old"
- CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text,
- 'dast'::character varying::text,
- 'dependency_scanning'::character varying::text,
- 'license_management'::character varying::text,
- 'sast'::character varying::text,
- 'secret_detection'::character varying::text,
- 'coverage_fuzzing'::character varying::text,
- 'license_scanning'::character varying::text])
- ) AND type::text = 'Ci::Build'::text"
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS)
- end
-
- def down
- add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS)
- end
-end
diff --git a/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb b/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb
deleted file mode 100644
index 27e7af9a550..00000000000
--- a/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleResetDuplicateCiRunnersTokenEncryptedValuesOnProjects < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects'
- TOKEN_COLUMN_NAME = :runners_token_encrypted
- TEMP_INDEX_NAME = "tmp_index_projects_on_id_and_#{TOKEN_COLUMN_NAME}"
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :projects, [:id, TOKEN_COLUMN_NAME], where: "#{TOKEN_COLUMN_NAME} IS NOT NULL", unique: false, name: TEMP_INDEX_NAME
-
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects::Project.base_query,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name(:projects, name: TEMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb b/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb
deleted file mode 100644
index f076b0a740e..00000000000
--- a/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleResetDuplicateCiRunnersTokenValuesOnProjects < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ResetDuplicateCiRunnersTokenValuesOnProjects'
- TOKEN_COLUMN_NAME = :runners_token
- TEMP_INDEX_NAME = "tmp_index_projects_on_id_and_#{TOKEN_COLUMN_NAME}"
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :projects, [:id, TOKEN_COLUMN_NAME], where: "#{TOKEN_COLUMN_NAME} IS NOT NULL", unique: false, name: TEMP_INDEX_NAME
-
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenValuesOnProjects::Project.base_query,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name(:projects, name: TEMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb b/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb
deleted file mode 100644
index 6159f9d6822..00000000000
--- a/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveExternalPullRequestTracking < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- untrack_record_deletions(:external_pull_requests)
- end
-
- def down
- track_record_deletions(:external_pull_requests)
- end
-end
diff --git a/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb b/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb
deleted file mode 100644
index ea9fd6b28c2..00000000000
--- a/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveLeftoverExternalPullRequestDeletions < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- # Delete all pending record deletions in the public.external_pull_requests until
- # there are no more rows left.
- loop do
- result = execute <<~SQL
- DELETE FROM "loose_foreign_keys_deleted_records"
- WHERE
- ("loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id") IN (
- SELECT "loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id"
- FROM "loose_foreign_keys_deleted_records"
- WHERE
- "loose_foreign_keys_deleted_records"."fully_qualified_table_name" = 'public.external_pull_requests' AND
- "loose_foreign_keys_deleted_records"."status" = 1
- LIMIT 100
- )
- SQL
-
- break if result.cmd_tuples == 0
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb b/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb
deleted file mode 100644
index e9a2c1c85f2..00000000000
--- a/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnIssuesClosedIncidents < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_issues_closed_incidents_by_project_id_and_closed_at'
-
- def up
- add_concurrent_index :issues, [:project_id, :closed_at], where: "issue_type = 1 AND state_id = 2", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issues, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb b/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb
deleted file mode 100644
index 919e834a783..00000000000
--- a/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# 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 AddAsyncIndexCiJobArtifactsProjectIdCreatedAt < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_created_at'
-
- def up
- prepare_async_index :ci_job_artifacts, [:project_id, :created_at, :id], name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb b/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb
deleted file mode 100644
index da928f3ec8f..00000000000
--- a/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexProjectIdAndReleasedAtAndIdOnReleases < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_releases_on_project_id_and_released_at_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :releases, [:project_id, :released_at, :id],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :releases, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb b/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb
deleted file mode 100644
index 3c1e6714529..00000000000
--- a/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDependencyListUsageDataFromRedis < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- Gitlab::Redis::SharedState.with { |r| r.del("DEPENDENCY_LIST_USAGE_COUNTER") }
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb b/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb
deleted file mode 100644
index 1b72c4b0a78..00000000000
--- a/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateScanIdAndIdIndexOnSecurityFindings < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_security_findings_on_scan_id_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :security_findings, [:scan_id, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :security_findings, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb b/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb
deleted file mode 100644
index 7241fd54cb3..00000000000
--- a/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexCiJobArtifactsProjectIdCreatedAt < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_created_at'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220315171027_add_tmp_index_to_support_leaky_regex_cleanup.rb b/db/post_migrate/20220315171027_add_tmp_index_to_support_leaky_regex_cleanup.rb
deleted file mode 100644
index 6f4bd29337e..00000000000
--- a/db/post_migrate/20220315171027_add_tmp_index_to_support_leaky_regex_cleanup.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddTmpIndexToSupportLeakyRegexCleanup < Gitlab::Database::Migration[1.0]
- INDEX_NAME = "tmp_index_merge_requests_draft_and_status_leaky_regex"
- LEAKY_REGEXP_STR = "^\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP"
- CORRECTED_REGEXP_STR = "^(\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP)"
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :merge_requests, :id,
- where: "draft = true AND state_id = 1 AND ((title)::text ~* '#{LEAKY_REGEXP_STR}'::text) AND ((title)::text !~* '#{CORRECTED_REGEXP_STR}'::text)",
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_requests, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220315171129_cleanup_draft_data_from_faulty_regex.rb b/db/post_migrate/20220315171129_cleanup_draft_data_from_faulty_regex.rb
deleted file mode 100644
index be81bf85f62..00000000000
--- a/db/post_migrate/20220315171129_cleanup_draft_data_from_faulty_regex.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupDraftDataFromFaultyRegex < Gitlab::Database::Migration[1.0]
- MIGRATION = 'CleanupDraftDataFromFaultyRegex'
- DELAY_INTERVAL = 5.minutes
- BATCH_SIZE = 20
-
- disable_ddl_transaction!
-
- class MergeRequest < ActiveRecord::Base
- LEAKY_REGEXP_STR = "^\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP"
- CORRECTED_REGEXP_STR = "^(\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP)"
-
- self.table_name = 'merge_requests'
-
- include ::EachBatch
-
- def self.eligible
- where(state_id: 1)
- .where(draft: true)
- .where("title ~* ?", LEAKY_REGEXP_STR)
- .where("title !~* ?", CORRECTED_REGEXP_STR)
- end
- end
-
- def up
- return unless Gitlab.com?
-
- queue_background_migration_jobs_by_range_at_intervals(
- MergeRequest.eligible,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/post_migrate/20220315181125_remove_issues_work_item_type_id_index.rb b/db/post_migrate/20220315181125_remove_issues_work_item_type_id_index.rb
deleted file mode 100644
index 6650201c063..00000000000
--- a/db/post_migrate/20220315181125_remove_issues_work_item_type_id_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIssuesWorkItemTypeIdIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issues_on_work_item_type_id'
-
- def up
- remove_concurrent_index_by_name :issues, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :issues, :work_item_type_id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220315181130_add_temporary_issue_type_index_for_work_item_types.rb b/db/post_migrate/20220315181130_add_temporary_issue_type_index_for_work_item_types.rb
deleted file mode 100644
index 52c525d81fb..00000000000
--- a/db/post_migrate/20220315181130_add_temporary_issue_type_index_for_work_item_types.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTemporaryIssueTypeIndexForWorkItemTypes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id'
-
- def up
- add_concurrent_index :issues, [:issue_type, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issues, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220315181136_backfill_work_item_type_id_on_issues.rb b/db/post_migrate/20220315181136_backfill_work_item_type_id_on_issues.rb
deleted file mode 100644
index 2249413b1e4..00000000000
--- a/db/post_migrate/20220315181136_backfill_work_item_type_id_on_issues.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillWorkItemTypeIdOnIssues < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- # This migration will be rescheduled as described in
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85212
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220315211043_add_index_to_vulnerability_reads.rb b/db/post_migrate/20220315211043_add_index_to_vulnerability_reads.rb
deleted file mode 100644
index 9fe78fb0a4e..00000000000
--- a/db/post_migrate/20220315211043_add_index_to_vulnerability_reads.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToVulnerabilityReads < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerability_reads_common_finder_query'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(
- :vulnerability_reads,
- %i[project_id state report_type severity vulnerability_id],
- name: INDEX_NAME,
- order: { vulnerability_id: :desc }
- )
- end
-
- def down
- remove_concurrent_index_by_name(
- :vulnerability_reads,
- INDEX_NAME
- )
- end
-end
diff --git a/db/post_migrate/20220316102900_add_index_to_deploy_tokens_on_creator_id.rb b/db/post_migrate/20220316102900_add_index_to_deploy_tokens_on_creator_id.rb
deleted file mode 100644
index 7cc942c813b..00000000000
--- a/db/post_migrate/20220316102900_add_index_to_deploy_tokens_on_creator_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToDeployTokensOnCreatorId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_deploy_tokens_on_creator_id'
-
- def up
- add_concurrent_index :deploy_tokens, :creator_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :deploy_tokens, :creator_id, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220316102902_add_user_foreign_key_to_deploy_tokens.rb b/db/post_migrate/20220316102902_add_user_foreign_key_to_deploy_tokens.rb
deleted file mode 100644
index 57379e4c752..00000000000
--- a/db/post_migrate/20220316102902_add_user_foreign_key_to_deploy_tokens.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserForeignKeyToDeployTokens < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :deploy_tokens, :users, column: :creator_id, on_delete: :nullify, reverse_lock_order: true
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :deploy_tokens, column: :creator_id
- end
- end
-end
diff --git a/db/post_migrate/20220316112118_update_organizations_name_index_add_id.rb b/db/post_migrate/20220316112118_update_organizations_name_index_add_id.rb
deleted file mode 100644
index 4d78e78e9db..00000000000
--- a/db/post_migrate/20220316112118_update_organizations_name_index_add_id.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateOrganizationsNameIndexAddId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- OLD_INDEX = 'index_customer_relations_organizations_on_unique_name_per_group'
- NEW_INDEX = 'index_organizations_on_unique_name_per_group'
-
- def up
- add_concurrent_index :customer_relations_organizations, 'group_id, lower(name), id', name: NEW_INDEX, unique: true
-
- remove_concurrent_index_by_name :customer_relations_organizations, OLD_INDEX
- end
-
- def down
- add_concurrent_index :customer_relations_organizations, 'group_id, lower(name)', name: OLD_INDEX, unique: true
-
- remove_concurrent_index_by_name :customer_relations_organizations, NEW_INDEX
- end
-end
diff --git a/db/post_migrate/20220316112206_add_contacts_index_on_group_email_and_id.rb b/db/post_migrate/20220316112206_add_contacts_index_on_group_email_and_id.rb
deleted file mode 100644
index 21434a80314..00000000000
--- a/db/post_migrate/20220316112206_add_contacts_index_on_group_email_and_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddContactsIndexOnGroupEmailAndId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_customer_relations_contacts_on_unique_email_per_group'
-
- def up
- add_concurrent_index :customer_relations_contacts, 'group_id, lower(email), id', name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :customer_relations_contacts, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220316165539_add_index_to_vulnerabilities.rb b/db/post_migrate/20220316165539_add_index_to_vulnerabilities.rb
deleted file mode 100644
index 1128ccd7b16..00000000000
--- a/db/post_migrate/20220316165539_add_index_to_vulnerabilities.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToVulnerabilities < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerabilites_common_finder_query'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(
- :vulnerabilities,
- %i[project_id state report_type severity id],
- name: INDEX_NAME
- )
- end
-
- def down
- remove_concurrent_index_by_name(
- :vulnerabilities,
- INDEX_NAME
- )
- end
-end
diff --git a/db/post_migrate/20220316202640_populate_container_repositories_migration_plan.rb b/db/post_migrate/20220316202640_populate_container_repositories_migration_plan.rb
deleted file mode 100644
index 7eef227ec3c..00000000000
--- a/db/post_migrate/20220316202640_populate_container_repositories_migration_plan.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class PopulateContainerRepositoriesMigrationPlan < Gitlab::Database::Migration[1.0]
- MIGRATION = 'PopulateContainerRepositoryMigrationPlan'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 1500
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('container_repositories'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220317161914_remove_ci_runners_ci_builds_runner_id_fk.rb b/db/post_migrate/20220317161914_remove_ci_runners_ci_builds_runner_id_fk.rb
deleted file mode 100644
index 3c7c4e73199..00000000000
--- a/db/post_migrate/20220317161914_remove_ci_runners_ci_builds_runner_id_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiRunnersCiBuildsRunnerIdFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- return unless foreign_key_exists?(:ci_builds, :ci_runners, name: "fk_e4ef9c2f27")
-
- with_lock_retries do
- execute('LOCK ci_runners, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open?
-
- remove_foreign_key_if_exists(:ci_builds, :ci_runners, name: "fk_e4ef9c2f27")
- end
- end
-
- def down
- add_concurrent_foreign_key :ci_builds, :ci_runners, name: "fk_e4ef9c2f27", column: :runner_id, target_column: :id, on_delete: :nullify, validate: false
- end
-end
diff --git a/db/post_migrate/20220318111040_add_indexes_for_primary_email_second_cleanup_migration.rb b/db/post_migrate/20220318111040_add_indexes_for_primary_email_second_cleanup_migration.rb
deleted file mode 100644
index 5dcb99b36b6..00000000000
--- a/db/post_migrate/20220318111040_add_indexes_for_primary_email_second_cleanup_migration.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexesForPrimaryEmailSecondCleanupMigration < Gitlab::Database::Migration[1.0]
- USERS_INDEX = :index_users_on_id_for_primary_email_migration
- EMAIL_INDEX = :index_emails_on_email_user_id
-
- disable_ddl_transaction!
-
- def up
- unless index_exists_by_name?(:users, USERS_INDEX)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{USERS_INDEX}
- ON users (id) INCLUDE (email, confirmed_at)
- WHERE confirmed_at IS NOT NULL
- SQL
- end
- end
-
- add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
- end
-
- def down
- remove_concurrent_index_by_name :users, USERS_INDEX
- remove_concurrent_index_by_name :emails, EMAIL_INDEX
- end
-end
diff --git a/db/post_migrate/20220318111729_cleanup_after_fixing_issue_when_admin_changed_primary_email.rb b/db/post_migrate/20220318111729_cleanup_after_fixing_issue_when_admin_changed_primary_email.rb
deleted file mode 100644
index 3d29d78573a..00000000000
--- a/db/post_migrate/20220318111729_cleanup_after_fixing_issue_when_admin_changed_primary_email.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupAfterFixingIssueWhenAdminChangedPrimaryEmail < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- BATCH_SIZE = 10_000
-
- # Stubbed class to access the User table
- class User < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'users'
- self.inheritance_column = :_type_disabled
-
- scope :confirmed, -> { where.not(confirmed_at: nil) }
-
- has_many :emails
- end
-
- # Stubbed class to access the Emails table
- class Email < ActiveRecord::Base
- self.table_name = 'emails'
- self.inheritance_column = :_type_disabled
-
- belongs_to :user
- end
-
- def up
- # Select confirmed users that do not have their primary email in the emails table,
- # and create the email record.
- not_exists_condition = 'NOT EXISTS (SELECT 1 FROM emails WHERE emails.email = users.email AND emails.user_id = users.id)'
-
- User.confirmed.each_batch(of: BATCH_SIZE) do |user_batch|
- user_batch.select(:id, :email, :confirmed_at).where(not_exists_condition).each do |user|
- current_time = Time.now.utc
-
- begin
- Email.create(
- user_id: user.id,
- email: user.email,
- confirmed_at: user.confirmed_at,
- created_at: current_time,
- updated_at: current_time
- )
- rescue StandardError => error
- Gitlab::AppLogger.error("Could not add primary email #{user.email} to emails for user with ID #{user.id} due to #{error}")
- end
- end
- end
- end
-
- def down
- # Intentionally left blank
- end
-end
diff --git a/db/post_migrate/20220318111949_drop_temporary_indexes_for_primary_email_migration_second_cleanup.rb b/db/post_migrate/20220318111949_drop_temporary_indexes_for_primary_email_migration_second_cleanup.rb
deleted file mode 100644
index 755751aaa1a..00000000000
--- a/db/post_migrate/20220318111949_drop_temporary_indexes_for_primary_email_migration_second_cleanup.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryIndexesForPrimaryEmailMigrationSecondCleanup < Gitlab::Database::Migration[1.0]
- USERS_INDEX = :index_users_on_id_for_primary_email_migration
- EMAIL_INDEX = :index_emails_on_email_user_id
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :users, USERS_INDEX
- remove_concurrent_index_by_name :emails, EMAIL_INDEX
- end
-
- def down
- unless index_exists_by_name?(:users, USERS_INDEX)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{USERS_INDEX}
- ON users (id) INCLUDE (email, confirmed_at)
- WHERE confirmed_at IS NOT NULL
- SQL
- end
- end
-
- add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
- end
-end
diff --git a/db/post_migrate/20220321025720_alter_constraint_remote_import_url.rb b/db/post_migrate/20220321025720_alter_constraint_remote_import_url.rb
deleted file mode 100644
index 90cb54cdd44..00000000000
--- a/db/post_migrate/20220321025720_alter_constraint_remote_import_url.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AlterConstraintRemoteImportUrl < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_text_limit :import_export_uploads, :remote_import_url
- add_text_limit :import_export_uploads, :remote_import_url, 2048
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220321201912_remove_user_email_lookup_limit.rb b/db/post_migrate/20220321201912_remove_user_email_lookup_limit.rb
deleted file mode 100644
index a95534b586e..00000000000
--- a/db/post_migrate/20220321201912_remove_user_email_lookup_limit.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUserEmailLookupLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_column :application_settings, :user_email_lookup_limit
- end
-
- def down
- add_column :application_settings, :user_email_lookup_limit, :integer, null: false, default: 60
- end
-end
diff --git a/db/post_migrate/20220322023800_add_tmp_index_routes_id_for_project_namespaces.rb b/db/post_migrate/20220322023800_add_tmp_index_routes_id_for_project_namespaces.rb
deleted file mode 100644
index bc775514b75..00000000000
--- a/db/post_migrate/20220322023800_add_tmp_index_routes_id_for_project_namespaces.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTmpIndexRoutesIdForProjectNamespaces < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'tmp_index_for_project_namespace_id_migration_on_routes'
-
- disable_ddl_transaction!
-
- def up
- # Temporary index to be removed in 15.0
- # https://gitlab.com/gitlab-org/gitlab/-/issues/352353
- add_concurrent_index :routes, :id, where: "namespace_id IS NULL AND source_type = 'Project'", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :routes, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220322035654_add_migration_plan_index_to_container_repositories.rb b/db/post_migrate/20220322035654_add_migration_plan_index_to_container_repositories.rb
deleted file mode 100644
index 78e331a8b63..00000000000
--- a/db/post_migrate/20220322035654_add_migration_plan_index_to_container_repositories.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddMigrationPlanIndexToContainerRepositories < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'idx_container_repos_on_migration_state_migration_plan_created'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :container_repositories,
- [:migration_state, :migration_plan, :created_at],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :container_repositories, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb b/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb
deleted file mode 100644
index 21b8dc78f7d..00000000000
--- a/db/post_migrate/20220322071127_finalize_project_namespaces_backfill.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-# This migration acts as a gate-keeper for other migrations related to project namespace back-filling
-# so that other migrations that depend on project namespace back-filling cannot be run unless project namespace
-# back-filling has finalized successfully.
-class FinalizeProjectNamespacesBackfill < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: MIGRATION,
- table_name: :projects,
- column_name: :id,
- job_arguments: [nil, 'up']
- )
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20220322094410_remove_wiki_notes.rb b/db/post_migrate/20220322094410_remove_wiki_notes.rb
deleted file mode 100644
index c3705e1e20f..00000000000
--- a/db/post_migrate/20220322094410_remove_wiki_notes.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveWikiNotes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- class Note < ApplicationRecord
- self.table_name = 'notes'
- self.inheritance_column = :_type_disabled
- end
-
- def up
- return unless Gitlab.dev_or_test_env? || Gitlab.staging? || Gitlab.com?
-
- Note.where(noteable_type: 'Wiki', id: [97, 98, 110, 242, 272]).delete_all
- end
-
- def down
- # NO-OP
- end
-end
diff --git a/db/post_migrate/20220322132242_update_pages_onboarding_state.rb b/db/post_migrate/20220322132242_update_pages_onboarding_state.rb
deleted file mode 100644
index 896ab78a266..00000000000
--- a/db/post_migrate/20220322132242_update_pages_onboarding_state.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class UpdatePagesOnboardingState < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
- BATCH_SIZE = 75
-
- def up
- define_batchable_model(
- :project_pages_metadata
- ).where(
- deployed: true
- ).each_batch(
- of: BATCH_SIZE,
- column: :project_id
- ) do |batch|
- batch.update_all(onboarding_complete: true)
- end
- end
-
- def down
- define_batchable_model(
- :project_pages_metadata
- ).where(
- onboarding_complete: true
- ).each_batch(
- of: BATCH_SIZE,
- column: :project_id
- ) do |batch|
- batch.update_all(onboarding_complete: false)
- end
- end
-end
diff --git a/db/post_migrate/20220322205008_change_search_rate_limit_values.rb b/db/post_migrate/20220322205008_change_search_rate_limit_values.rb
deleted file mode 100644
index ed4aad72ddf..00000000000
--- a/db/post_migrate/20220322205008_change_search_rate_limit_values.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeSearchRateLimitValues < Gitlab::Database::Migration[1.0]
- def up
- # Change search_rate_limits to a more reasonable value
- # as long as they are still using the default values.
- #
- # The reason why `search_rate_limit` could be either 30 or 60
- # is because its value was ported over from the now deprecated
- # `user_email_lookup_limit` which had a default value of 60.
- execute("update application_settings set search_rate_limit=300 where search_rate_limit IN (30,60)")
- execute("update application_settings set search_rate_limit_unauthenticated=100 where search_rate_limit_unauthenticated = 10")
- end
-
- def down
- # noop. Because this migration is updating values, it is not reversible.
- end
-end
diff --git a/db/post_migrate/20220323023800_backfill_namespace_id_for_project_routes.rb b/db/post_migrate/20220323023800_backfill_namespace_id_for_project_routes.rb
deleted file mode 100644
index 0b2c7318887..00000000000
--- a/db/post_migrate/20220323023800_backfill_namespace_id_for_project_routes.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillNamespaceIdForProjectRoutes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillNamespaceIdForProjectRoute'
- INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- MAX_BATCH_SIZE = 10_000
- SUB_BATCH_SIZE = 200
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :routes,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :routes, :id, [])
- end
-end
diff --git a/db/post_migrate/20220323130000_add_temp_index_on_null_project_namespace_ids.rb b/db/post_migrate/20220323130000_add_temp_index_on_null_project_namespace_ids.rb
deleted file mode 100644
index e73993065b0..00000000000
--- a/db/post_migrate/20220323130000_add_temp_index_on_null_project_namespace_ids.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTempIndexOnNullProjectNamespaceIds < Gitlab::Database::Migration[1.0]
- TMP_INDEX_FOR_NULL_PROJECT_NAMESPACE_ID = 'tmp_index_for_null_project_namespace_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :projects, :id, name: TMP_INDEX_FOR_NULL_PROJECT_NAMESPACE_ID, where: 'project_namespace_id IS NULL'
- end
-
- def down
- remove_concurrent_index_by_name :projects, name: TMP_INDEX_FOR_NULL_PROJECT_NAMESPACE_ID
- end
-end
diff --git a/db/post_migrate/20220323152202_add_index_on_visible_deployments.rb b/db/post_migrate/20220323152202_add_index_on_visible_deployments.rb
deleted file mode 100644
index 57ec2f7013d..00000000000
--- a/db/post_migrate/20220323152202_add_index_on_visible_deployments.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnVisibleDeployments < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_deployments_for_visible_scope'
-
- def up
- add_concurrent_index :deployments,
- [:environment_id, :finished_at],
- order: { finished_at: :desc },
- where: 'status IN (1, 2, 3, 4, 6)',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :deployments, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220324032250_migrate_shimo_confluence_service_category.rb b/db/post_migrate/20220324032250_migrate_shimo_confluence_service_category.rb
deleted file mode 100644
index d341cc50874..00000000000
--- a/db/post_migrate/20220324032250_migrate_shimo_confluence_service_category.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateShimoConfluenceServiceCategory < Gitlab::Database::Migration[1.0]
- MIGRATION = 'MigrateShimoConfluenceIntegrationCategory'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 10_000
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('integrations').where(type_new: %w[Integrations::Confluence Integrations::Shimo]),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true)
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20220324081709_fix_and_backfill_project_namespaces_for_projects_with_duplicate_name.rb b/db/post_migrate/20220324081709_fix_and_backfill_project_namespaces_for_projects_with_duplicate_name.rb
deleted file mode 100644
index f5927a2cc16..00000000000
--- a/db/post_migrate/20220324081709_fix_and_backfill_project_namespaces_for_projects_with_duplicate_name.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class FixAndBackfillProjectNamespacesForProjectsWithDuplicateName < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'FixDuplicateProjectNameAndPath'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 1000
-
- class Project < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'projects'
-
- scope :without_project_namespace, -> { where(project_namespace_id: nil) }
- end
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- Project.without_project_namespace, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE, track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220324110247_untrack_deletions_on_ci_job_artifacts.rb b/db/post_migrate/20220324110247_untrack_deletions_on_ci_job_artifacts.rb
deleted file mode 100644
index d178c235e21..00000000000
--- a/db/post_migrate/20220324110247_untrack_deletions_on_ci_job_artifacts.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class UntrackDeletionsOnCiJobArtifacts < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- untrack_record_deletions(:ci_job_artifacts)
- end
-
- def down
- track_record_deletions(:ci_job_artifacts)
- end
-end
diff --git a/db/post_migrate/20220324180717_remove_project_pages_metadata_artifacts_archive_id_column.rb b/db/post_migrate/20220324180717_remove_project_pages_metadata_artifacts_archive_id_column.rb
deleted file mode 100644
index 287752b6b5c..00000000000
--- a/db/post_migrate/20220324180717_remove_project_pages_metadata_artifacts_archive_id_column.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveProjectPagesMetadataArtifactsArchiveIdColumn < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_column :project_pages_metadata, :artifacts_archive_id
- end
-
- def down
- unless column_exists?(:project_pages_metadata, :artifacts_archive_id)
- add_column :project_pages_metadata, :artifacts_archive_id, :bigint
- end
-
- add_concurrent_index(
- :project_pages_metadata,
- :artifacts_archive_id,
- name: "index_project_pages_metadata_on_artifacts_archive_id"
- )
- end
-end
diff --git a/db/post_migrate/20220325000000_prepare_index_for_ci_job_artifacts_unlocked_with_expire_at.rb b/db/post_migrate/20220325000000_prepare_index_for_ci_job_artifacts_unlocked_with_expire_at.rb
deleted file mode 100644
index fa43f3b7f59..00000000000
--- a/db/post_migrate/20220325000000_prepare_index_for_ci_job_artifacts_unlocked_with_expire_at.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexForCiJobArtifactsUnlockedWithExpireAt < Gitlab::Database::Migration[1.0]
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal'
- CONDITIONS = 'locked = 0 AND expire_at IS NOT NULL'
-
- def up
- prepare_async_index TABLE_NAME, [:expire_at], where: CONDITIONS, name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220325000001_finalize_index_for_ci_job_artifacts_unlocked_with_expire_at.rb b/db/post_migrate/20220325000001_finalize_index_for_ci_job_artifacts_unlocked_with_expire_at.rb
deleted file mode 100644
index d0fe7ceb34f..00000000000
--- a/db/post_migrate/20220325000001_finalize_index_for_ci_job_artifacts_unlocked_with_expire_at.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeIndexForCiJobArtifactsUnlockedWithExpireAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal'
- CONDITIONS = 'locked = 0 AND expire_at IS NOT NULL'
-
- def up
- add_concurrent_index TABLE_NAME, [:expire_at], where: CONDITIONS, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220325050642_drop_integrations_template_column.rb b/db/post_migrate/20220325050642_drop_integrations_template_column.rb
deleted file mode 100644
index e110c307a38..00000000000
--- a/db/post_migrate/20220325050642_drop_integrations_template_column.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DropIntegrationsTemplateColumn < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :integrations, :template, :boolean, default: false
- end
-end
diff --git a/db/post_migrate/20220325155953_steal_background_job_for_fixing_conflicting_project_names_and_paths.rb b/db/post_migrate/20220325155953_steal_background_job_for_fixing_conflicting_project_names_and_paths.rb
deleted file mode 100644
index 4c4c29e2b7c..00000000000
--- a/db/post_migrate/20220325155953_steal_background_job_for_fixing_conflicting_project_names_and_paths.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class StealBackgroundJobForFixingConflictingProjectNamesAndPaths < Gitlab::Database::Migration[1.0]
- def up
- Gitlab::BackgroundMigration.steal('FixDuplicateProjectNameAndPath')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220325160153_create_unique_index_on_projects_name_and_namespace_id.rb b/db/post_migrate/20220325160153_create_unique_index_on_projects_name_and_namespace_id.rb
deleted file mode 100644
index d1cefa76cec..00000000000
--- a/db/post_migrate/20220325160153_create_unique_index_on_projects_name_and_namespace_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateUniqueIndexOnProjectsNameAndNamespaceId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'unique_projects_on_name_namespace_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :projects, [:name, :namespace_id], unique: true, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :projects, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220326161803_add_cascade_delete_fk_on_project_namespace_id.rb b/db/post_migrate/20220326161803_add_cascade_delete_fk_on_project_namespace_id.rb
deleted file mode 100644
index 005532c53d9..00000000000
--- a/db/post_migrate/20220326161803_add_cascade_delete_fk_on_project_namespace_id.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class AddCascadeDeleteFkOnProjectNamespaceId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TARGET_COLUMN = :project_namespace_id
-
- def up
- # add the new FK before removing the old one
- add_concurrent_foreign_key(
- :projects,
- :namespaces,
- column: TARGET_COLUMN,
- name: fk_name("#{TARGET_COLUMN}_new"),
- on_delete: :cascade
- )
-
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN, name: fk_name(TARGET_COLUMN))
- end
- end
-
- def down
- add_concurrent_foreign_key(
- :projects,
- :namespaces,
- column: TARGET_COLUMN,
- name: fk_name(TARGET_COLUMN),
- on_delete: :nullify
- )
-
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN, name: fk_name("#{TARGET_COLUMN}_new"))
- end
- end
-
- def fk_name(column_name)
- # generate a FK name
- concurrent_foreign_key_name(:projects, column_name)
- end
-end
diff --git a/db/post_migrate/20220326163653_add_not_null_contraint_to_project_namespace_id.rb b/db/post_migrate/20220326163653_add_not_null_contraint_to_project_namespace_id.rb
deleted file mode 100644
index 2273b84d003..00000000000
--- a/db/post_migrate/20220326163653_add_not_null_contraint_to_project_namespace_id.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotNullContraintToProjectNamespaceId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_not_null_constraint :projects, :project_namespace_id, validate: false
- end
-
- def down
- remove_not_null_constraint :projects, :project_namespace_id
- end
-end
diff --git a/db/post_migrate/20220329175119_remove_leftover_ci_job_artifact_deletions.rb b/db/post_migrate/20220329175119_remove_leftover_ci_job_artifact_deletions.rb
deleted file mode 100644
index f0c09598bfb..00000000000
--- a/db/post_migrate/20220329175119_remove_leftover_ci_job_artifact_deletions.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveLeftoverCiJobArtifactDeletions < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- # Delete all pending record deletions in the public.ci_job_artifacts until
- # there are no more rows left.
- loop do
- result = execute <<~SQL
- DELETE FROM "loose_foreign_keys_deleted_records"
- WHERE
- ("loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id") IN (
- SELECT "loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id"
- FROM "loose_foreign_keys_deleted_records"
- WHERE
- "loose_foreign_keys_deleted_records"."fully_qualified_table_name" = 'public.ci_job_artifacts' AND
- "loose_foreign_keys_deleted_records"."status" = 1
- LIMIT 100
- )
- SQL
-
- break if result.cmd_tuples == 0
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220331074722_add_notes_null_discussion_id_temp_index_async.rb b/db/post_migrate/20220331074722_add_notes_null_discussion_id_temp_index_async.rb
deleted file mode 100644
index 9f52308935b..00000000000
--- a/db/post_migrate/20220331074722_add_notes_null_discussion_id_temp_index_async.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotesNullDiscussionIdTempIndexAsync < Gitlab::Database::Migration[1.0]
- # Temporary index to be removed in 15.0 https://gitlab.com/gitlab-org/gitlab/-/issues/357581
- INDEX_NAME = 'tmp_index_notes_on_id_where_discussion_id_is_null'
-
- def up
- prepare_async_index :notes, :id, where: 'discussion_id IS NULL', name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name :notes, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220401045621_remove_state_index_on_merge_request_assignees.rb b/db/post_migrate/20220401045621_remove_state_index_on_merge_request_assignees.rb
deleted file mode 100644
index ff62a1c646d..00000000000
--- a/db/post_migrate/20220401045621_remove_state_index_on_merge_request_assignees.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveStateIndexOnMergeRequestAssignees < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_assignees_state'
-
- def up
- remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME
- end
-
- def down
- add_concurrent_index :merge_request_assignees, :state, where: 'state = 2', name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220401045642_remove_state_index_on_merge_request_reviewers.rb b/db/post_migrate/20220401045642_remove_state_index_on_merge_request_reviewers.rb
deleted file mode 100644
index ef59d9fcc25..00000000000
--- a/db/post_migrate/20220401045642_remove_state_index_on_merge_request_reviewers.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveStateIndexOnMergeRequestReviewers < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_merge_request_reviewers_state'
-
- def up
- remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME
- end
-
- def down
- add_concurrent_index :merge_request_reviewers, :state, where: 'state = 2', name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220404183350_add_forbidden_state_index_to_users.rb b/db/post_migrate/20220404183350_add_forbidden_state_index_to_users.rb
deleted file mode 100644
index 7ae61a60b73..00000000000
--- a/db/post_migrate/20220404183350_add_forbidden_state_index_to_users.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForbiddenStateIndexToUsers < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'users_forbidden_state_idx'
-
- def up
- add_concurrent_index :users, :id,
- name: INDEX_NAME,
- where: "confirmed_at IS NOT NULL AND (state <> ALL (ARRAY['blocked', 'banned', 'ldap_blocked']))"
- end
-
- def down
- remove_concurrent_index_by_name :users, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220404184814_drop_broader_expired_artifact_index.rb b/db/post_migrate/20220404184814_drop_broader_expired_artifact_index.rb
deleted file mode 100644
index b6327b89c11..00000000000
--- a/db/post_migrate/20220404184814_drop_broader_expired_artifact_index.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class DropBroaderExpiredArtifactIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx'
-
- def up
- remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220404194649_replace_work_item_type_backfill_next_batch_strategy.rb b/db/post_migrate/20220404194649_replace_work_item_type_backfill_next_batch_strategy.rb
deleted file mode 100644
index 9b74cef144f..00000000000
--- a/db/post_migrate/20220404194649_replace_work_item_type_backfill_next_batch_strategy.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ReplaceWorkItemTypeBackfillNextBatchStrategy < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- # migrations will be rescheduled with the correct batching class
- # no need for this migration
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220409160628_add_async_index_for_events_followed_users.rb b/db/post_migrate/20220409160628_add_async_index_for_events_followed_users.rb
deleted file mode 100644
index fb858248b19..00000000000
--- a/db/post_migrate/20220409160628_add_async_index_for_events_followed_users.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddAsyncIndexForEventsFollowedUsers < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_for_followed_users'
-
- def up
- prepare_async_index :events, %I[author_id target_type action id], name: INDEX_NAME
- end
-
- def down
- unprepare_async_index :events, %I[author_id target_type action id], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220412044906_finalize_traversal_ids_background_migrations.rb b/db/post_migrate/20220412044906_finalize_traversal_ids_background_migrations.rb
deleted file mode 100644
index fb43e13364d..00000000000
--- a/db/post_migrate/20220412044906_finalize_traversal_ids_background_migrations.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeTraversalIdsBackgroundMigrations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- finalize_background_migration('BackfillNamespaceTraversalIdsRoots')
- finalize_background_migration('BackfillNamespaceTraversalIdsChildren')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20220412143551_add_partial_index_on_unencrypted_integrations.rb b/db/post_migrate/20220412143551_add_partial_index_on_unencrypted_integrations.rb
deleted file mode 100644
index 0f5415d6bf5..00000000000
--- a/db/post_migrate/20220412143551_add_partial_index_on_unencrypted_integrations.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-#
-class AddPartialIndexOnUnencryptedIntegrations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_integrations_on_id_where_not_encrypted'
- INDEX_FILTER_CONDITION = 'properties IS NOT NULL AND encrypted_properties IS NULL'
-
- def up
- add_concurrent_index :integrations, [:id],
- where: INDEX_FILTER_CONDITION,
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :integrations, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20220412143552_consume_remaining_encrypt_integration_property_jobs.rb b/db/post_migrate/20220412143552_consume_remaining_encrypt_integration_property_jobs.rb
deleted file mode 100644
index 2213268fa73..00000000000
--- a/db/post_migrate/20220412143552_consume_remaining_encrypt_integration_property_jobs.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class ConsumeRemainingEncryptIntegrationPropertyJobs < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- BATCH_SIZE = 50
-
- def up
- Gitlab::BackgroundMigration.steal('EncryptIntegrationProperties')
-
- model = define_batchable_model('integrations')
- relation = model.where.not(properties: nil).where(encrypted_properties: nil)
-
- relation.each_batch(of: BATCH_SIZE) do |batch|
- range = batch.pick('MIN(id)', 'MAX(id)')
-
- Gitlab::BackgroundMigration::EncryptIntegrationProperties.new.perform(*range)
- end
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20220413011328_remove_partial_index_on_unencrypted_integrations.rb b/db/post_migrate/20220413011328_remove_partial_index_on_unencrypted_integrations.rb
deleted file mode 100644
index 873080144ab..00000000000
--- a/db/post_migrate/20220413011328_remove_partial_index_on_unencrypted_integrations.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-#
-# The inverse of 20220412143551_add_partial_index_on_unencrypted_integrations.rb
-class RemovePartialIndexOnUnencryptedIntegrations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_integrations_on_id_where_not_encrypted'
- INDEX_FILTER_CONDITION = 'properties IS NOT NULL AND encrypted_properties IS NULL'
-
- def down
- add_concurrent_index :integrations, [:id],
- where: INDEX_FILTER_CONDITION,
- name: INDEX_NAME
- end
-
- def up
- remove_concurrent_index_by_name :integrations, INDEX_NAME
- end
-end
diff --git a/db/schema_migrations/20211202094944 b/db/schema_migrations/20211202094944
deleted file mode 100644
index b917cca67fa..00000000000
--- a/db/schema_migrations/20211202094944
+++ /dev/null
@@ -1 +0,0 @@
-2bca61880005c9303b2ff71747cde64d3418b6ef8ad2a9f114d584f4149e386b \ No newline at end of file
diff --git a/db/schema_migrations/20211202135508 b/db/schema_migrations/20211202135508
deleted file mode 100644
index 6ca4701268d..00000000000
--- a/db/schema_migrations/20211202135508
+++ /dev/null
@@ -1 +0,0 @@
-b565abbbb43f04ba4a6b77154ecb24b30328ac6d964f4be9fc5f9d05144606f0 \ No newline at end of file
diff --git a/db/schema_migrations/20211202145237 b/db/schema_migrations/20211202145237
deleted file mode 100644
index f5b91a189c8..00000000000
--- a/db/schema_migrations/20211202145237
+++ /dev/null
@@ -1 +0,0 @@
-d109142aa838faedcd307f6cd235c969ca265813493eef50d63cbc2fe5d203b3 \ No newline at end of file
diff --git a/db/schema_migrations/20211203091642 b/db/schema_migrations/20211203091642
deleted file mode 100644
index ef53b1d2ed9..00000000000
--- a/db/schema_migrations/20211203091642
+++ /dev/null
@@ -1 +0,0 @@
-9954fb041a3f284f53cc9c5c68b1a9dff36513a1851e663c221eccd40736fb16 \ No newline at end of file
diff --git a/db/schema_migrations/20211203160952 b/db/schema_migrations/20211203160952
deleted file mode 100644
index 10d033ef200..00000000000
--- a/db/schema_migrations/20211203160952
+++ /dev/null
@@ -1 +0,0 @@
-f25c65dfcb5b7b4a663cc4c792ffd985f6afd3156036485a5a43a791ee799e7b \ No newline at end of file
diff --git a/db/schema_migrations/20211203161149 b/db/schema_migrations/20211203161149
deleted file mode 100644
index 3f58490a89c..00000000000
--- a/db/schema_migrations/20211203161149
+++ /dev/null
@@ -1 +0,0 @@
-01482a299a7dac9d3f786f0dbe4650c686911bf788467146d3e9a91eafd0fc32 \ No newline at end of file
diff --git a/db/schema_migrations/20211203161840 b/db/schema_migrations/20211203161840
deleted file mode 100644
index 347bd0f7691..00000000000
--- a/db/schema_migrations/20211203161840
+++ /dev/null
@@ -1 +0,0 @@
-1b895e979ba2f1696559179c46c000e349da2d1ab94c968dd95103f188425103 \ No newline at end of file
diff --git a/db/schema_migrations/20211203161942 b/db/schema_migrations/20211203161942
deleted file mode 100644
index f43c3733392..00000000000
--- a/db/schema_migrations/20211203161942
+++ /dev/null
@@ -1 +0,0 @@
-62432b2679cafa381671c9555f503867c254a7b3734e10cf634b34998d5fb5a3 \ No newline at end of file
diff --git a/db/schema_migrations/20211204010826 b/db/schema_migrations/20211204010826
deleted file mode 100644
index 11311e66ad0..00000000000
--- a/db/schema_migrations/20211204010826
+++ /dev/null
@@ -1 +0,0 @@
-6a3591e70ddd6573ad68360c1a8774ef61e7812ce831c75066baec5754e2bd76 \ No newline at end of file
diff --git a/db/schema_migrations/20211206073851 b/db/schema_migrations/20211206073851
deleted file mode 100644
index bfd8140b109..00000000000
--- a/db/schema_migrations/20211206073851
+++ /dev/null
@@ -1 +0,0 @@
-403592fda1d82ed3c3fb8d5315593b67954a4ecbc368d9bcd5eedc75bb3c9821 \ No newline at end of file
diff --git a/db/schema_migrations/20211206074547 b/db/schema_migrations/20211206074547
deleted file mode 100644
index dd84a987827..00000000000
--- a/db/schema_migrations/20211206074547
+++ /dev/null
@@ -1 +0,0 @@
-ba1c0d20e21ef51278109d0eaeb23f1c541eb5eb9aeb9a92583ee6de83c68918 \ No newline at end of file
diff --git a/db/schema_migrations/20211206161271 b/db/schema_migrations/20211206161271
deleted file mode 100644
index 8a2561eec24..00000000000
--- a/db/schema_migrations/20211206161271
+++ /dev/null
@@ -1 +0,0 @@
-fa4a39c3bea70d31e8144f8830ef0353f22a7a663a891d9043e79f362058fbde \ No newline at end of file
diff --git a/db/schema_migrations/20211207081708 b/db/schema_migrations/20211207081708
deleted file mode 100644
index b2fbb704451..00000000000
--- a/db/schema_migrations/20211207081708
+++ /dev/null
@@ -1 +0,0 @@
-e26065e63eca51e4138b6e9f07e9ec1ee45838afa82c5832849e360375beeae2 \ No newline at end of file
diff --git a/db/schema_migrations/20211207090503 b/db/schema_migrations/20211207090503
deleted file mode 100644
index 13daa5c81e6..00000000000
--- a/db/schema_migrations/20211207090503
+++ /dev/null
@@ -1 +0,0 @@
-c30656c3f079e789f386b5b607710a7d4df6d2eb20bd457bab3a2e8d9eeb051b \ No newline at end of file
diff --git a/db/schema_migrations/20211207125331 b/db/schema_migrations/20211207125331
deleted file mode 100644
index 833d5d0a383..00000000000
--- a/db/schema_migrations/20211207125331
+++ /dev/null
@@ -1 +0,0 @@
-5ead867b7609248f702771078849c48c0558f5fe9a3021fbb32e4f9174af653a \ No newline at end of file
diff --git a/db/schema_migrations/20211207135331 b/db/schema_migrations/20211207135331
deleted file mode 100644
index b4085490cc8..00000000000
--- a/db/schema_migrations/20211207135331
+++ /dev/null
@@ -1 +0,0 @@
-3d9dcab49ee409da8c1ab398101041092e566b06a7bb2764db49a9201a0e5f0c \ No newline at end of file
diff --git a/db/schema_migrations/20211207154413 b/db/schema_migrations/20211207154413
deleted file mode 100644
index 26bc9a47632..00000000000
--- a/db/schema_migrations/20211207154413
+++ /dev/null
@@ -1 +0,0 @@
-98098b41864158fc4de3b8fe42603b2c0c5c2fbc664397c431712311bdaa3621 \ No newline at end of file
diff --git a/db/schema_migrations/20211207154414 b/db/schema_migrations/20211207154414
deleted file mode 100644
index c7e1f8de4d1..00000000000
--- a/db/schema_migrations/20211207154414
+++ /dev/null
@@ -1 +0,0 @@
-278907a15d04b455aa852eb9d17000c6b353be6ef78a8dcc2e71a9772a6e43ea \ No newline at end of file
diff --git a/db/schema_migrations/20211207165508 b/db/schema_migrations/20211207165508
deleted file mode 100644
index df0c91bad7d..00000000000
--- a/db/schema_migrations/20211207165508
+++ /dev/null
@@ -1 +0,0 @@
-d1ed3ddf51c0bcebbac2a8dee05aa168daa35129110a463ac296ff2e640b0dbd \ No newline at end of file
diff --git a/db/schema_migrations/20211207173510 b/db/schema_migrations/20211207173510
deleted file mode 100644
index 09474e1c643..00000000000
--- a/db/schema_migrations/20211207173510
+++ /dev/null
@@ -1 +0,0 @@
-0a4ac9de84b8351f39e549904d9e661648b496e6e3183c4ff5eb22b70d5ba7e9 \ No newline at end of file
diff --git a/db/schema_migrations/20211207173511 b/db/schema_migrations/20211207173511
deleted file mode 100644
index 93b44c20390..00000000000
--- a/db/schema_migrations/20211207173511
+++ /dev/null
@@ -1 +0,0 @@
-8f41f45c5ef23eafae2e67951497b5752f4b30ecf73ae3c08f61febfa4fb17be \ No newline at end of file
diff --git a/db/schema_migrations/20211208111425 b/db/schema_migrations/20211208111425
deleted file mode 100644
index 0b1aa9199b6..00000000000
--- a/db/schema_migrations/20211208111425
+++ /dev/null
@@ -1 +0,0 @@
-1e3f29ed1a820588da9fe135fbdd0feaa960038b99397dbd7921d4804dce1e1f \ No newline at end of file
diff --git a/db/schema_migrations/20211208122200 b/db/schema_migrations/20211208122200
deleted file mode 100644
index 1e4910d3a3c..00000000000
--- a/db/schema_migrations/20211208122200
+++ /dev/null
@@ -1 +0,0 @@
-8dec4379f34773e979cf6b33ba608185827c37b1a95c74d6472b7562c16d6110 \ No newline at end of file
diff --git a/db/schema_migrations/20211208122201 b/db/schema_migrations/20211208122201
deleted file mode 100644
index fb770a6d5fd..00000000000
--- a/db/schema_migrations/20211208122201
+++ /dev/null
@@ -1 +0,0 @@
-f58ccb07fa67ede2a50fa5ff6bddbe4bb89a622e84786fc4bfb404c11b9dbab4 \ No newline at end of file
diff --git a/db/schema_migrations/20211208171402 b/db/schema_migrations/20211208171402
deleted file mode 100644
index a563797dea5..00000000000
--- a/db/schema_migrations/20211208171402
+++ /dev/null
@@ -1 +0,0 @@
-09a9e7fc042aab19bf768a79401f33b6e7408acff303fc0ee68360dfd7605101 \ No newline at end of file
diff --git a/db/schema_migrations/20211209093636 b/db/schema_migrations/20211209093636
deleted file mode 100644
index 2d2601ff51c..00000000000
--- a/db/schema_migrations/20211209093636
+++ /dev/null
@@ -1 +0,0 @@
-e544953376948489daf4840d4a6228b18dc6e18d071a1025dab24c3559640489 \ No newline at end of file
diff --git a/db/schema_migrations/20211209093828 b/db/schema_migrations/20211209093828
deleted file mode 100644
index 7f6b5a0c442..00000000000
--- a/db/schema_migrations/20211209093828
+++ /dev/null
@@ -1 +0,0 @@
-583ee4809560fec645e6f0942b332f9ab2630d06b0a422b360c5bb546d0aad93 \ No newline at end of file
diff --git a/db/schema_migrations/20211209093923 b/db/schema_migrations/20211209093923
deleted file mode 100644
index 654d4b3967e..00000000000
--- a/db/schema_migrations/20211209093923
+++ /dev/null
@@ -1 +0,0 @@
-8ec578ddc956b2648bcdd8a2ce1728723e2b0eef1a0a4845f4cb0deb19c417ec \ No newline at end of file
diff --git a/db/schema_migrations/20211209094222 b/db/schema_migrations/20211209094222
deleted file mode 100644
index 29156e38fe9..00000000000
--- a/db/schema_migrations/20211209094222
+++ /dev/null
@@ -1 +0,0 @@
-1b461efe52d55ba9dca05e64efaae411c3de01612cbc55f9525e522e9b181b3d \ No newline at end of file
diff --git a/db/schema_migrations/20211209103048 b/db/schema_migrations/20211209103048
deleted file mode 100644
index 133d5fc1ed4..00000000000
--- a/db/schema_migrations/20211209103048
+++ /dev/null
@@ -1 +0,0 @@
-d2d270a335b3a2441a20673bf19d47553f607533d4503e3a01bc3d6d108bcdb3 \ No newline at end of file
diff --git a/db/schema_migrations/20211209203820 b/db/schema_migrations/20211209203820
deleted file mode 100644
index cdff024b597..00000000000
--- a/db/schema_migrations/20211209203820
+++ /dev/null
@@ -1 +0,0 @@
-c501bc857cef21a8657508e9a286feb3c6f5db873247707e051a8702b1e80e79 \ No newline at end of file
diff --git a/db/schema_migrations/20211209203821 b/db/schema_migrations/20211209203821
deleted file mode 100644
index 890d3db0b3a..00000000000
--- a/db/schema_migrations/20211209203821
+++ /dev/null
@@ -1 +0,0 @@
-4e8e0917bcfcadf288425e82eeb3747d775bb301017a9b320b694cd43ed0d60a \ No newline at end of file
diff --git a/db/schema_migrations/20211209230042 b/db/schema_migrations/20211209230042
deleted file mode 100644
index 818734c1330..00000000000
--- a/db/schema_migrations/20211209230042
+++ /dev/null
@@ -1 +0,0 @@
-907fafc18fa515fff8f716f6464263ccc8a9b6e5ead36f30b05089100fd71b6b \ No newline at end of file
diff --git a/db/schema_migrations/20211210025754 b/db/schema_migrations/20211210025754
deleted file mode 100644
index f2fd6e506b8..00000000000
--- a/db/schema_migrations/20211210025754
+++ /dev/null
@@ -1 +0,0 @@
-d39b46bfd4bdf81cd4969190d08dce2260b4f476564a2e6c3e05d69b87c1c6df \ No newline at end of file
diff --git a/db/schema_migrations/20211210031721 b/db/schema_migrations/20211210031721
deleted file mode 100644
index 57bbcccd347..00000000000
--- a/db/schema_migrations/20211210031721
+++ /dev/null
@@ -1 +0,0 @@
-6d62200480e46b356fe07eeb2c99b0fb441dadd00faf30079722c617facab7cc \ No newline at end of file
diff --git a/db/schema_migrations/20211210140000 b/db/schema_migrations/20211210140000
deleted file mode 100644
index b64d8251d69..00000000000
--- a/db/schema_migrations/20211210140000
+++ /dev/null
@@ -1 +0,0 @@
-f02c1b7412d2bb6d8a20639704ad55cdbcc14bfccf0509b659c3ef9614bcfa2b \ No newline at end of file
diff --git a/db/schema_migrations/20211210140629 b/db/schema_migrations/20211210140629
deleted file mode 100644
index ad631461d87..00000000000
--- a/db/schema_migrations/20211210140629
+++ /dev/null
@@ -1 +0,0 @@
-7940b0f692b62bcabbe98440082e2245fd28caba2c9e052e85e82acea0a98d23 \ No newline at end of file
diff --git a/db/schema_migrations/20211210173137 b/db/schema_migrations/20211210173137
deleted file mode 100644
index 3dfcb177167..00000000000
--- a/db/schema_migrations/20211210173137
+++ /dev/null
@@ -1 +0,0 @@
-9bbd4c3e396e0de130418e705a370ce629ca507c82fa2ff5bbf085cdf01c2ff3 \ No newline at end of file
diff --git a/db/schema_migrations/20211213064821 b/db/schema_migrations/20211213064821
deleted file mode 100644
index 119805a99b7..00000000000
--- a/db/schema_migrations/20211213064821
+++ /dev/null
@@ -1 +0,0 @@
-9d7e85ac7c9ee2b9505c479b878cb07888cf089c04d34bdeb834fbb0c5111931 \ No newline at end of file
diff --git a/db/schema_migrations/20211213102111 b/db/schema_migrations/20211213102111
deleted file mode 100644
index 214d061f265..00000000000
--- a/db/schema_migrations/20211213102111
+++ /dev/null
@@ -1 +0,0 @@
-3d011cc67fc6ac661788f2d0e3766e51d624a4248ac9dbd861a4db810d396091 \ No newline at end of file
diff --git a/db/schema_migrations/20211213130324 b/db/schema_migrations/20211213130324
deleted file mode 100644
index 529fe91ab5f..00000000000
--- a/db/schema_migrations/20211213130324
+++ /dev/null
@@ -1 +0,0 @@
-2267855b2f12747b1f31f392677fac4d4f82ee234d7c54fd209b8bad417c8c75 \ No newline at end of file
diff --git a/db/schema_migrations/20211213142344 b/db/schema_migrations/20211213142344
deleted file mode 100644
index 2bcbb15c218..00000000000
--- a/db/schema_migrations/20211213142344
+++ /dev/null
@@ -1 +0,0 @@
-837539e12be12830d388bc6142622412b40ac061c397504eac03033a08f01e72 \ No newline at end of file
diff --git a/db/schema_migrations/20211213154259 b/db/schema_migrations/20211213154259
deleted file mode 100644
index 0555d0c6600..00000000000
--- a/db/schema_migrations/20211213154259
+++ /dev/null
@@ -1 +0,0 @@
-fccb1d6c7ac4e31cecaf7bc2e23f13f6c8147a3820cbd996a545a5b01cc03865 \ No newline at end of file
diff --git a/db/schema_migrations/20211213154704 b/db/schema_migrations/20211213154704
deleted file mode 100644
index 0d9ba6457ba..00000000000
--- a/db/schema_migrations/20211213154704
+++ /dev/null
@@ -1 +0,0 @@
-deec24bae35829454a09d4e97478c0b57d5f80e3271f96b2554b1ab10dc84d7f \ No newline at end of file
diff --git a/db/schema_migrations/20211214012507 b/db/schema_migrations/20211214012507
deleted file mode 100644
index 7bac6c6d8c5..00000000000
--- a/db/schema_migrations/20211214012507
+++ /dev/null
@@ -1 +0,0 @@
-a7aa1ffccce785d365720309e3773f167075a9d06805eea941e6cd47bc918471 \ No newline at end of file
diff --git a/db/schema_migrations/20211214110307 b/db/schema_migrations/20211214110307
deleted file mode 100644
index 6e3101bbe59..00000000000
--- a/db/schema_migrations/20211214110307
+++ /dev/null
@@ -1 +0,0 @@
-a1a6e3c5b4a8f959c55edbb084b37ba555b3977e450a549925de47605638f66e \ No newline at end of file
diff --git a/db/schema_migrations/20211215090620 b/db/schema_migrations/20211215090620
deleted file mode 100644
index 9393ffee22e..00000000000
--- a/db/schema_migrations/20211215090620
+++ /dev/null
@@ -1 +0,0 @@
-43ae6290e11e3944b23ce2865b5c466a29c9ba3cfd2e0b58bd834568414b5bf2 \ No newline at end of file
diff --git a/db/schema_migrations/20211215182006 b/db/schema_migrations/20211215182006
deleted file mode 100644
index 480a1e2369b..00000000000
--- a/db/schema_migrations/20211215182006
+++ /dev/null
@@ -1 +0,0 @@
-ead2a1b13438514bb97bea3f1656f9bac352a8c733d9f808b2405685bce91e00 \ No newline at end of file
diff --git a/db/schema_migrations/20211216133107 b/db/schema_migrations/20211216133107
deleted file mode 100644
index c841207fffc..00000000000
--- a/db/schema_migrations/20211216133107
+++ /dev/null
@@ -1 +0,0 @@
-a0c3a9746250aa67ffa8d05486fb6997c8d839b8bce7e870c0415c25600c5434 \ No newline at end of file
diff --git a/db/schema_migrations/20211216134134 b/db/schema_migrations/20211216134134
deleted file mode 100644
index 09c3a59cc98..00000000000
--- a/db/schema_migrations/20211216134134
+++ /dev/null
@@ -1 +0,0 @@
-c53a1e4405187620929b8fc6877786cb713d13218f7385d1b9b3daaf6072fa05 \ No newline at end of file
diff --git a/db/schema_migrations/20211216135651 b/db/schema_migrations/20211216135651
deleted file mode 100644
index a94bdb329f1..00000000000
--- a/db/schema_migrations/20211216135651
+++ /dev/null
@@ -1 +0,0 @@
-9b733363587957b4044bc6806dfbb9632ec7f5f6ffc8c82280e025012b8acb5a \ No newline at end of file
diff --git a/db/schema_migrations/20211216220939 b/db/schema_migrations/20211216220939
deleted file mode 100644
index 3fe48da6ca2..00000000000
--- a/db/schema_migrations/20211216220939
+++ /dev/null
@@ -1 +0,0 @@
-649cf0eb794904457b230c1240d2bea8a6e80b00dbf6b2d25b95c66247460aa4 \ No newline at end of file
diff --git a/db/schema_migrations/20211217050753 b/db/schema_migrations/20211217050753
deleted file mode 100644
index bfc571acab1..00000000000
--- a/db/schema_migrations/20211217050753
+++ /dev/null
@@ -1 +0,0 @@
-fe5cbf928d45d506132078678cf70264f01190cfe581628a5038d77f68a52961 \ No newline at end of file
diff --git a/db/schema_migrations/20211217120000 b/db/schema_migrations/20211217120000
deleted file mode 100644
index d4efb66b985..00000000000
--- a/db/schema_migrations/20211217120000
+++ /dev/null
@@ -1 +0,0 @@
-d4360d6057602ec1f5e6e9d11c93cfbb16d878e9ecd4d5bfb1bed1c01e14c7a3 \ No newline at end of file
diff --git a/db/schema_migrations/20211217145923 b/db/schema_migrations/20211217145923
deleted file mode 100644
index 8a94da00fc8..00000000000
--- a/db/schema_migrations/20211217145923
+++ /dev/null
@@ -1 +0,0 @@
-2e35347592530f2a73e1cd75871438e29d277a206f621989e2c897fc587b6f5d \ No newline at end of file
diff --git a/db/schema_migrations/20211217174331 b/db/schema_migrations/20211217174331
deleted file mode 100644
index 32657e28f96..00000000000
--- a/db/schema_migrations/20211217174331
+++ /dev/null
@@ -1 +0,0 @@
-649360f4069aac4784f4d039015f8dda3f4bae28e8132f841e25b48f034a392e \ No newline at end of file
diff --git a/db/schema_migrations/20211220064757 b/db/schema_migrations/20211220064757
deleted file mode 100644
index 675596f1ce6..00000000000
--- a/db/schema_migrations/20211220064757
+++ /dev/null
@@ -1 +0,0 @@
-34bfe07fff59a415540ca2c5c96b33dc9030c15b2ffbb30cb7deedeb939ae132 \ No newline at end of file
diff --git a/db/schema_migrations/20211220120402 b/db/schema_migrations/20211220120402
deleted file mode 100644
index c2bb4f8da7e..00000000000
--- a/db/schema_migrations/20211220120402
+++ /dev/null
@@ -1 +0,0 @@
-157128732c321577b7fa7a1b3d252ff70a2a62b34cd1e6edea59da4e632a1755 \ No newline at end of file
diff --git a/db/schema_migrations/20211220123956 b/db/schema_migrations/20211220123956
deleted file mode 100644
index 291fdc306b5..00000000000
--- a/db/schema_migrations/20211220123956
+++ /dev/null
@@ -1 +0,0 @@
-088d17a1f55522c48e69ec78717b39b8c7538474a9263621bba1fa0280a27ad7 \ No newline at end of file
diff --git a/db/schema_migrations/20211220174504 b/db/schema_migrations/20211220174504
deleted file mode 100644
index ed8f5f35efc..00000000000
--- a/db/schema_migrations/20211220174504
+++ /dev/null
@@ -1 +0,0 @@
-80c1ad5815ef68ab1a7d63566d478683b3f9a5169ed15ecd6f44f7f542d40dc8 \ No newline at end of file
diff --git a/db/schema_migrations/20211223125921 b/db/schema_migrations/20211223125921
deleted file mode 100644
index b4e3a1583df..00000000000
--- a/db/schema_migrations/20211223125921
+++ /dev/null
@@ -1 +0,0 @@
-e08c1634376ed78b78c4a54d874bed66c1ce40c7c509b67cfda00d1a8657f127 \ No newline at end of file
diff --git a/db/schema_migrations/20211224112937 b/db/schema_migrations/20211224112937
deleted file mode 100644
index 98296f9a270..00000000000
--- a/db/schema_migrations/20211224112937
+++ /dev/null
@@ -1 +0,0 @@
-3709c5c229e45ff0f594d6291d0b2b9a167b3bf4f5b29158b9abdac333a638b8 \ No newline at end of file
diff --git a/db/schema_migrations/20211224114539 b/db/schema_migrations/20211224114539
deleted file mode 100644
index 2d7494e4291..00000000000
--- a/db/schema_migrations/20211224114539
+++ /dev/null
@@ -1 +0,0 @@
-f4ac776ec4213d6fcd07ccfa913f51e1386ff212bf47d27817b24b501a78443b \ No newline at end of file
diff --git a/db/schema_migrations/20211229023654 b/db/schema_migrations/20211229023654
deleted file mode 100644
index f34b188c5d3..00000000000
--- a/db/schema_migrations/20211229023654
+++ /dev/null
@@ -1 +0,0 @@
-8019915a00f62c137ee48c860c888e9d43f7253a5ea1a684ba2abe8bbe8016df \ No newline at end of file
diff --git a/db/schema_migrations/20211230112517 b/db/schema_migrations/20211230112517
deleted file mode 100644
index bd22204d82d..00000000000
--- a/db/schema_migrations/20211230112517
+++ /dev/null
@@ -1 +0,0 @@
-32c4b0ad5b52b8990b4c0ab6e832d503be6fc802a30aa2de20c7d3ced7f04c36 \ No newline at end of file
diff --git a/db/schema_migrations/20211230113031 b/db/schema_migrations/20211230113031
deleted file mode 100644
index 2f5b81768c8..00000000000
--- a/db/schema_migrations/20211230113031
+++ /dev/null
@@ -1 +0,0 @@
-54201f4273226ed92ff0ed991fdba09c1108fccb764e6b9903e9f01e6acced1a \ No newline at end of file
diff --git a/db/schema_migrations/20220104060049 b/db/schema_migrations/20220104060049
deleted file mode 100644
index 83c36018d73..00000000000
--- a/db/schema_migrations/20220104060049
+++ /dev/null
@@ -1 +0,0 @@
-fa87b087b576d320f94028444a082b920870a2554209808849f9f3f42ead83c4 \ No newline at end of file
diff --git a/db/schema_migrations/20220104174445 b/db/schema_migrations/20220104174445
deleted file mode 100644
index fffb27113e2..00000000000
--- a/db/schema_migrations/20220104174445
+++ /dev/null
@@ -1 +0,0 @@
-5e5e41ee4c8dc9c3fe791470862d15b8d213fcc931ef8b80937bdb5f5db20aed \ No newline at end of file
diff --git a/db/schema_migrations/20220105020514 b/db/schema_migrations/20220105020514
deleted file mode 100644
index 4ad9266c7c0..00000000000
--- a/db/schema_migrations/20220105020514
+++ /dev/null
@@ -1 +0,0 @@
-301c2f09f48aa3e34c2f679628a9542b4babc589e3d20e9ccf84a9209f5841ee \ No newline at end of file
diff --git a/db/schema_migrations/20220105082217 b/db/schema_migrations/20220105082217
deleted file mode 100644
index a6232406be6..00000000000
--- a/db/schema_migrations/20220105082217
+++ /dev/null
@@ -1 +0,0 @@
-448481ec9f7dd58d267e3660a49161c0e14baca35e640c59b27f2ebc4367b62a \ No newline at end of file
diff --git a/db/schema_migrations/20220105121325 b/db/schema_migrations/20220105121325
deleted file mode 100644
index 384616aba7f..00000000000
--- a/db/schema_migrations/20220105121325
+++ /dev/null
@@ -1 +0,0 @@
-27ca3977a7569e98271eeb2bd224be1cfe5452ab3778665325b89bf966e07942 \ No newline at end of file
diff --git a/db/schema_migrations/20220105152547 b/db/schema_migrations/20220105152547
deleted file mode 100644
index d8c425da736..00000000000
--- a/db/schema_migrations/20220105152547
+++ /dev/null
@@ -1 +0,0 @@
-0f1ea41fae57710e0e05c9b71a14800394c4c57e37a39e92be49c50120d7d2ee \ No newline at end of file
diff --git a/db/schema_migrations/20220105153149 b/db/schema_migrations/20220105153149
deleted file mode 100644
index 11b71946bc8..00000000000
--- a/db/schema_migrations/20220105153149
+++ /dev/null
@@ -1 +0,0 @@
-8194c695a809f2eb29e5033f089c1d20874f61731a4289026f2d550854e7097d \ No newline at end of file
diff --git a/db/schema_migrations/20220106111958 b/db/schema_migrations/20220106111958
deleted file mode 100644
index 954db532950..00000000000
--- a/db/schema_migrations/20220106111958
+++ /dev/null
@@ -1 +0,0 @@
-c1af9546bdfa0f32c3c2faf362062cd300800514e5b1efd1fa8a1770753d00e5 \ No newline at end of file
diff --git a/db/schema_migrations/20220106112043 b/db/schema_migrations/20220106112043
deleted file mode 100644
index 34c8c5152da..00000000000
--- a/db/schema_migrations/20220106112043
+++ /dev/null
@@ -1 +0,0 @@
-8b51ae2b13066a56d2131efb7ea746335513031e751fb231e43121552d6f2b1d \ No newline at end of file
diff --git a/db/schema_migrations/20220106112085 b/db/schema_migrations/20220106112085
deleted file mode 100644
index 171f893a0ab..00000000000
--- a/db/schema_migrations/20220106112085
+++ /dev/null
@@ -1 +0,0 @@
-f385631d0317630661d487011a228501a6cbc71de25ca457d75e6a815c598045 \ No newline at end of file
diff --git a/db/schema_migrations/20220106141756 b/db/schema_migrations/20220106141756
deleted file mode 100644
index 7718a41500b..00000000000
--- a/db/schema_migrations/20220106141756
+++ /dev/null
@@ -1 +0,0 @@
-cedca81a6dc1562cf0ed5f17217c52420a1cb9a74acece8d67eb1bcb948a7181 \ No newline at end of file
diff --git a/db/schema_migrations/20220106163326 b/db/schema_migrations/20220106163326
deleted file mode 100644
index dbfb9079dc1..00000000000
--- a/db/schema_migrations/20220106163326
+++ /dev/null
@@ -1 +0,0 @@
-4726d84ff42e64b1c47c5ba454ff5be05f434a86bb2af4bbe27dd00e5e3da5cb \ No newline at end of file
diff --git a/db/schema_migrations/20220106185033 b/db/schema_migrations/20220106185033
deleted file mode 100644
index be45c8bab6f..00000000000
--- a/db/schema_migrations/20220106185033
+++ /dev/null
@@ -1 +0,0 @@
-5304bc3dada6794c8f6e1082861e12fdfb059effdcd5a17e11af5300e67708bd \ No newline at end of file
diff --git a/db/schema_migrations/20220106230629 b/db/schema_migrations/20220106230629
deleted file mode 100644
index e8751a6616c..00000000000
--- a/db/schema_migrations/20220106230629
+++ /dev/null
@@ -1 +0,0 @@
-675d8f7bf77ddb860e707c25811d4eaaac1173c9fe62ce96c2708f0bbd0f4d48 \ No newline at end of file
diff --git a/db/schema_migrations/20220106230712 b/db/schema_migrations/20220106230712
deleted file mode 100644
index 589b65d423c..00000000000
--- a/db/schema_migrations/20220106230712
+++ /dev/null
@@ -1 +0,0 @@
-672b51ca014d208f971efe698edb8a8b32f541bf9d21a7f555c53f749ee936a4 \ No newline at end of file
diff --git a/db/schema_migrations/20220106231518 b/db/schema_migrations/20220106231518
deleted file mode 100644
index f7deaaa68b6..00000000000
--- a/db/schema_migrations/20220106231518
+++ /dev/null
@@ -1 +0,0 @@
-aafb52337688e8b57712872f6f7e8e67da132406b244df5e11a736b01e23354f \ No newline at end of file
diff --git a/db/schema_migrations/20220106233459 b/db/schema_migrations/20220106233459
deleted file mode 100644
index 2911e79d843..00000000000
--- a/db/schema_migrations/20220106233459
+++ /dev/null
@@ -1 +0,0 @@
-fc44084057c5fd30f0e7918b4f856a60409f08ad1eb5c3fbc2d8ad5bad7f1ffd \ No newline at end of file
diff --git a/db/schema_migrations/20220106235626 b/db/schema_migrations/20220106235626
deleted file mode 100644
index d8d8e3b20d7..00000000000
--- a/db/schema_migrations/20220106235626
+++ /dev/null
@@ -1 +0,0 @@
-34f966723cae63e831f7fc9d965cda90f1fd7bca522fc58e78a0de4b959a47a2 \ No newline at end of file
diff --git a/db/schema_migrations/20220107064845 b/db/schema_migrations/20220107064845
deleted file mode 100644
index bd63da88355..00000000000
--- a/db/schema_migrations/20220107064845
+++ /dev/null
@@ -1 +0,0 @@
-c7c645787aadc95c77df6420f437f78aed4e7e862ea2b66e7824766b1d9f3cb5 \ No newline at end of file
diff --git a/db/schema_migrations/20220107091629 b/db/schema_migrations/20220107091629
deleted file mode 100644
index a14f97d77eb..00000000000
--- a/db/schema_migrations/20220107091629
+++ /dev/null
@@ -1 +0,0 @@
-ef1a7c5f7b10640a0ddc669528dcdb02fd2525d716562f928578e8902a07a832 \ No newline at end of file
diff --git a/db/schema_migrations/20220107165036 b/db/schema_migrations/20220107165036
deleted file mode 100644
index bab28284d04..00000000000
--- a/db/schema_migrations/20220107165036
+++ /dev/null
@@ -1 +0,0 @@
-72639ba84675a6687864ef4cb6f02d0429124d7deb9ce9f3c8e255591e2f0a8d \ No newline at end of file
diff --git a/db/schema_migrations/20220109133006 b/db/schema_migrations/20220109133006
deleted file mode 100644
index e74845e2254..00000000000
--- a/db/schema_migrations/20220109133006
+++ /dev/null
@@ -1 +0,0 @@
-192fc0b934c7d52e431a0ce7524a51beb24fa004a940e6b0675e36b0da143891 \ No newline at end of file
diff --git a/db/schema_migrations/20220109134455 b/db/schema_migrations/20220109134455
deleted file mode 100644
index 7a4762e240e..00000000000
--- a/db/schema_migrations/20220109134455
+++ /dev/null
@@ -1 +0,0 @@
-fee092680e22e579ea51f776d11bbfd6a49b936e4ab776760a153ce613e7a0cd \ No newline at end of file
diff --git a/db/schema_migrations/20220110170953 b/db/schema_migrations/20220110170953
deleted file mode 100644
index d4c2aa5fcf2..00000000000
--- a/db/schema_migrations/20220110170953
+++ /dev/null
@@ -1 +0,0 @@
-da1c6f2db7cee1e4cb8b477d1892fa7206a95157a84864ad3d6022ab6cffbd1f \ No newline at end of file
diff --git a/db/schema_migrations/20220110171049 b/db/schema_migrations/20220110171049
deleted file mode 100644
index ab39a1afb25..00000000000
--- a/db/schema_migrations/20220110171049
+++ /dev/null
@@ -1 +0,0 @@
-55ad00b1cf70f5d1a3f033efccf64c2c273ad03f65823a2281869849571ab35b \ No newline at end of file
diff --git a/db/schema_migrations/20220110224913 b/db/schema_migrations/20220110224913
deleted file mode 100644
index 653324d1060..00000000000
--- a/db/schema_migrations/20220110224913
+++ /dev/null
@@ -1 +0,0 @@
-d8b206e26f6dd7e9d5f2b2d8cc5ce2e2bbe2d8d33317948f8cf110fe41872a5d \ No newline at end of file
diff --git a/db/schema_migrations/20220110231420 b/db/schema_migrations/20220110231420
deleted file mode 100644
index b46bcdfd802..00000000000
--- a/db/schema_migrations/20220110231420
+++ /dev/null
@@ -1 +0,0 @@
-768f97a38c0b741f7de99082ce7c8efb1578ac6600c3af4b30019bc987968bc9 \ No newline at end of file
diff --git a/db/schema_migrations/20220110233155 b/db/schema_migrations/20220110233155
deleted file mode 100644
index 9301c7a2a7a..00000000000
--- a/db/schema_migrations/20220110233155
+++ /dev/null
@@ -1 +0,0 @@
-e7d9d79ffb8989ab39fe719217f22736244df70c2b1461ef5a1a3f1e74e43870 \ No newline at end of file
diff --git a/db/schema_migrations/20220111002756 b/db/schema_migrations/20220111002756
deleted file mode 100644
index ca619e3eaf4..00000000000
--- a/db/schema_migrations/20220111002756
+++ /dev/null
@@ -1 +0,0 @@
-34759cbf09171f6057b87af791f5e9f3045ac5e06558147436ba32e276f40a19 \ No newline at end of file
diff --git a/db/schema_migrations/20220111023852 b/db/schema_migrations/20220111023852
deleted file mode 100644
index 15ab0470662..00000000000
--- a/db/schema_migrations/20220111023852
+++ /dev/null
@@ -1 +0,0 @@
-fdb6e193748f9933aa3ae60fab41960e06d4edf271048fc5f6c9c465d30a8334 \ No newline at end of file
diff --git a/db/schema_migrations/20220111093534 b/db/schema_migrations/20220111093534
deleted file mode 100644
index 5999dbdf49a..00000000000
--- a/db/schema_migrations/20220111093534
+++ /dev/null
@@ -1 +0,0 @@
-ff0127967c3ee6e4f4af528b84024a6a838f8dbeb19cf78d7d913d4fc8e155e7 \ No newline at end of file
diff --git a/db/schema_migrations/20220111095006 b/db/schema_migrations/20220111095006
deleted file mode 100644
index b5fed6279f1..00000000000
--- a/db/schema_migrations/20220111095006
+++ /dev/null
@@ -1 +0,0 @@
-0bc00cc8a5fa7cafa665ec113a4d0d1384c5acde37dfdf53ab1f5a2e1d6acb02 \ No newline at end of file
diff --git a/db/schema_migrations/20220111095007 b/db/schema_migrations/20220111095007
deleted file mode 100644
index 77c70f8bccf..00000000000
--- a/db/schema_migrations/20220111095007
+++ /dev/null
@@ -1 +0,0 @@
-65259b0e71c1883b81c61354325cfeeade0013b55af8901bf707f2a94ee3a46a \ No newline at end of file
diff --git a/db/schema_migrations/20220111101421 b/db/schema_migrations/20220111101421
deleted file mode 100644
index 16d47665734..00000000000
--- a/db/schema_migrations/20220111101421
+++ /dev/null
@@ -1 +0,0 @@
-abbba4ccacebb825c3f9cb5b0463d457fd4a7b4396a2184a995e496aebaf4521 \ No newline at end of file
diff --git a/db/schema_migrations/20220111102314 b/db/schema_migrations/20220111102314
deleted file mode 100644
index 95c172c3587..00000000000
--- a/db/schema_migrations/20220111102314
+++ /dev/null
@@ -1 +0,0 @@
-69c20daf6a23346288e516df3e70120819d76dcb5fe2b1b51af416349311820b \ No newline at end of file
diff --git a/db/schema_migrations/20220111154950 b/db/schema_migrations/20220111154950
deleted file mode 100644
index 6070beb76e9..00000000000
--- a/db/schema_migrations/20220111154950
+++ /dev/null
@@ -1 +0,0 @@
-4719c533acaac3234ac0e131c70be49d0f98642e29e7d2e31519cc6c372056bc \ No newline at end of file
diff --git a/db/schema_migrations/20220111154951 b/db/schema_migrations/20220111154951
deleted file mode 100644
index 9d18e4c4d44..00000000000
--- a/db/schema_migrations/20220111154951
+++ /dev/null
@@ -1 +0,0 @@
-48d6eaa68912f702be2bd38609bea4fa807eab7131f7c5e2261416820df9836a \ No newline at end of file
diff --git a/db/schema_migrations/20220111200254 b/db/schema_migrations/20220111200254
deleted file mode 100644
index 36ce3ad56f0..00000000000
--- a/db/schema_migrations/20220111200254
+++ /dev/null
@@ -1 +0,0 @@
-72c7e04b1a34154c894f93da800c15c717c3340d34729577538d539881d2e8ca \ No newline at end of file
diff --git a/db/schema_migrations/20220111221516 b/db/schema_migrations/20220111221516
deleted file mode 100644
index b0c747f8e8a..00000000000
--- a/db/schema_migrations/20220111221516
+++ /dev/null
@@ -1 +0,0 @@
-0cb120b0036b3f472edb57fcb8a52877d399edf8ff1f416ce76497d6aa8265d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112015940 b/db/schema_migrations/20220112015940
deleted file mode 100644
index 0d012793ba0..00000000000
--- a/db/schema_migrations/20220112015940
+++ /dev/null
@@ -1 +0,0 @@
-e4417c3367115d6adba023e18657d8aecd476b8d1c4227c73e06f97d05af07ad \ No newline at end of file
diff --git a/db/schema_migrations/20220112090556 b/db/schema_migrations/20220112090556
deleted file mode 100644
index 12ffaeffe00..00000000000
--- a/db/schema_migrations/20220112090556
+++ /dev/null
@@ -1 +0,0 @@
-e78e11a47017c67130fe88fa538578553b7015c18cf222b5e7fb7f503254dc6d \ No newline at end of file
diff --git a/db/schema_migrations/20220112115413 b/db/schema_migrations/20220112115413
deleted file mode 100644
index 9c8c653f69b..00000000000
--- a/db/schema_migrations/20220112115413
+++ /dev/null
@@ -1 +0,0 @@
-1199adba4c13e9234eabadefeb55ed3cfb19e9d5a87c07b90d438e4f48a973f7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112205111 b/db/schema_migrations/20220112205111
deleted file mode 100644
index a2d2d42271e..00000000000
--- a/db/schema_migrations/20220112205111
+++ /dev/null
@@ -1 +0,0 @@
-65d9a1d63e90dfc336d0c69503c0899259fda773bc68a330782c206ac0fc48fd \ No newline at end of file
diff --git a/db/schema_migrations/20220112230642 b/db/schema_migrations/20220112230642
deleted file mode 100644
index c2d8e1d0a6e..00000000000
--- a/db/schema_migrations/20220112230642
+++ /dev/null
@@ -1 +0,0 @@
-c528730414c1dcda5d312f03d4e37a0dbb51ebb0b0b87ada786cf686c358daa7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232037 b/db/schema_migrations/20220112232037
deleted file mode 100644
index 83267de0489..00000000000
--- a/db/schema_migrations/20220112232037
+++ /dev/null
@@ -1 +0,0 @@
-775ac42ad194bd0175a6925e1c2e83c11d57a8d4430ad08a70e3d5275ca2e709 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232605 b/db/schema_migrations/20220112232605
deleted file mode 100644
index fb5809b543e..00000000000
--- a/db/schema_migrations/20220112232605
+++ /dev/null
@@ -1 +0,0 @@
-4813b55e933564851f2fec9a2fa5900409eff226fec34ae0be1895307f603904 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232723 b/db/schema_migrations/20220112232723
deleted file mode 100644
index 2dc2a592980..00000000000
--- a/db/schema_migrations/20220112232723
+++ /dev/null
@@ -1 +0,0 @@
-cbea97a0d067939ba9d713489448cb6e0cc45b2bbd2c717ecf521493cc39d568 \ No newline at end of file
diff --git a/db/schema_migrations/20220113013319 b/db/schema_migrations/20220113013319
deleted file mode 100644
index 0dc31b95004..00000000000
--- a/db/schema_migrations/20220113013319
+++ /dev/null
@@ -1 +0,0 @@
-ccfbbbe52b27833453f867c4d7093187d21dbbfebe054b366ff010c54de50974 \ No newline at end of file
diff --git a/db/schema_migrations/20220113014438 b/db/schema_migrations/20220113014438
deleted file mode 100644
index 936c801bafe..00000000000
--- a/db/schema_migrations/20220113014438
+++ /dev/null
@@ -1 +0,0 @@
-08d8a5a605058598a2f033bbd461518c502fb3da8627240c5d66f887b43f3ac3 \ No newline at end of file
diff --git a/db/schema_migrations/20220113015830 b/db/schema_migrations/20220113015830
deleted file mode 100644
index a4897410077..00000000000
--- a/db/schema_migrations/20220113015830
+++ /dev/null
@@ -1 +0,0 @@
-774a5ff616663d6d0e002bd04d33747982de10b02cbb9ad7d8abfe0b26a2b441 \ No newline at end of file
diff --git a/db/schema_migrations/20220113035519 b/db/schema_migrations/20220113035519
deleted file mode 100644
index eb908ae8982..00000000000
--- a/db/schema_migrations/20220113035519
+++ /dev/null
@@ -1 +0,0 @@
-4a90811aace678528b75171868fb178ab885d5aac885048e8eacecaf8b0ee374 \ No newline at end of file
diff --git a/db/schema_migrations/20220113040447 b/db/schema_migrations/20220113040447
deleted file mode 100644
index 465b51678f7..00000000000
--- a/db/schema_migrations/20220113040447
+++ /dev/null
@@ -1 +0,0 @@
-983e5522b2798ca0d17ca3fd848f527b12afdbdd1482a2d420c4c6ce4fa2c9c4 \ No newline at end of file
diff --git a/db/schema_migrations/20220113111440 b/db/schema_migrations/20220113111440
deleted file mode 100644
index e6188a9616f..00000000000
--- a/db/schema_migrations/20220113111440
+++ /dev/null
@@ -1 +0,0 @@
-faf899c1aa99e596eb386935ee6ff17a51b7942ee4f6d4cbd1ad2283dd0d40c0 \ No newline at end of file
diff --git a/db/schema_migrations/20220113125401 b/db/schema_migrations/20220113125401
deleted file mode 100644
index 7241e2e29c7..00000000000
--- a/db/schema_migrations/20220113125401
+++ /dev/null
@@ -1 +0,0 @@
-afe57b6b1b8b10e0e26d7f499b25adc5aef9f7c52af644d6a260f0ed3aab16d5 \ No newline at end of file
diff --git a/db/schema_migrations/20220113135449 b/db/schema_migrations/20220113135449
deleted file mode 100644
index 57e6ede94b5..00000000000
--- a/db/schema_migrations/20220113135449
+++ /dev/null
@@ -1 +0,0 @@
-46796379175ce9343907234d3ae14a417442c7c5ebbfcf6987db1d759eca2c3a \ No newline at end of file
diff --git a/db/schema_migrations/20220113135924 b/db/schema_migrations/20220113135924
deleted file mode 100644
index 41328a43c37..00000000000
--- a/db/schema_migrations/20220113135924
+++ /dev/null
@@ -1 +0,0 @@
-2a230758c13111c9e3738794008c31a3608dda2f0d071fbde0ad3cd782d29162 \ No newline at end of file
diff --git a/db/schema_migrations/20220113164801 b/db/schema_migrations/20220113164801
deleted file mode 100644
index 8354489ac31..00000000000
--- a/db/schema_migrations/20220113164801
+++ /dev/null
@@ -1 +0,0 @@
-71526ea198c64d23a35f06804f30068591e937df22d74c262fdec9ecf04bf7d4 \ No newline at end of file
diff --git a/db/schema_migrations/20220113164901 b/db/schema_migrations/20220113164901
deleted file mode 100644
index 977ec8bb51b..00000000000
--- a/db/schema_migrations/20220113164901
+++ /dev/null
@@ -1 +0,0 @@
-b157cec5eab77665ae57f02647c39dc0fb167d78e1894b395c46f59d791ab3e0 \ No newline at end of file
diff --git a/db/schema_migrations/20220114105525 b/db/schema_migrations/20220114105525
deleted file mode 100644
index 728820cbaf0..00000000000
--- a/db/schema_migrations/20220114105525
+++ /dev/null
@@ -1 +0,0 @@
-c9c7e8ff40fd3863095bb927f1aea27fecd5ca77dfc284a7673310e3501476c8 \ No newline at end of file
diff --git a/db/schema_migrations/20220114131950 b/db/schema_migrations/20220114131950
deleted file mode 100644
index ca1e1033d9b..00000000000
--- a/db/schema_migrations/20220114131950
+++ /dev/null
@@ -1 +0,0 @@
-f427f4c0d75308f7c97685e10e27a735dcf284714acd49659f62a6f7752234ef \ No newline at end of file
diff --git a/db/schema_migrations/20220116175851 b/db/schema_migrations/20220116175851
deleted file mode 100644
index 47c21071440..00000000000
--- a/db/schema_migrations/20220116175851
+++ /dev/null
@@ -1 +0,0 @@
-3fa0d827ab8051d270a13ae5facb1560a87f9f4fef81368b9fbb5d6291948721 \ No newline at end of file
diff --git a/db/schema_migrations/20220117034056 b/db/schema_migrations/20220117034056
deleted file mode 100644
index acf76bfb9d6..00000000000
--- a/db/schema_migrations/20220117034056
+++ /dev/null
@@ -1 +0,0 @@
-afc54500374602edcdc4fce5acf3673b84882da1afbb5598a6684a5ef480a2d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220117082611 b/db/schema_migrations/20220117082611
deleted file mode 100644
index 9dead593ffb..00000000000
--- a/db/schema_migrations/20220117082611
+++ /dev/null
@@ -1 +0,0 @@
-28df9a8b5bf73bc33275cfe47f260788fa3263680a97128e086fd1698ccac1d8 \ No newline at end of file
diff --git a/db/schema_migrations/20220117225936 b/db/schema_migrations/20220117225936
deleted file mode 100644
index 7ced75915e4..00000000000
--- a/db/schema_migrations/20220117225936
+++ /dev/null
@@ -1 +0,0 @@
-484eaf2ce1df1e2915b7ea8a5c9f4e044957c25d1ccf5841f24c75791d1a1a13 \ No newline at end of file
diff --git a/db/schema_migrations/20220118015633 b/db/schema_migrations/20220118015633
deleted file mode 100644
index 8ba4a376bcd..00000000000
--- a/db/schema_migrations/20220118015633
+++ /dev/null
@@ -1 +0,0 @@
-6a73f49306de7c799a39afa3ac1f761840860833a96f1a91cf992c9a3ebfef9b \ No newline at end of file
diff --git a/db/schema_migrations/20220118020026 b/db/schema_migrations/20220118020026
deleted file mode 100644
index fe9dcccbc0c..00000000000
--- a/db/schema_migrations/20220118020026
+++ /dev/null
@@ -1 +0,0 @@
-77374c81456f235d3afeb45cdda14552e1ef8047de5aaa3f5bb0a82e4aebe849 \ No newline at end of file
diff --git a/db/schema_migrations/20220118141950 b/db/schema_migrations/20220118141950
deleted file mode 100644
index 7c6549a1e60..00000000000
--- a/db/schema_migrations/20220118141950
+++ /dev/null
@@ -1 +0,0 @@
-a4131f86bc415f0c1897e3b975494806ffc5a834dca2b39c998c6a406e695e15 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155846 b/db/schema_migrations/20220118155846
deleted file mode 100644
index b5247cb3743..00000000000
--- a/db/schema_migrations/20220118155846
+++ /dev/null
@@ -1 +0,0 @@
-88935eee0781ee1faaf52e3bc89dc5c490c2095d6ccf83e4fd4186641507c173 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155847 b/db/schema_migrations/20220118155847
deleted file mode 100644
index caa0dfc5901..00000000000
--- a/db/schema_migrations/20220118155847
+++ /dev/null
@@ -1 +0,0 @@
-aa73b04aa355111564cdc7adb036a2030a28fbb3b524c3b3dbb8248e27b845d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155848 b/db/schema_migrations/20220118155848
deleted file mode 100644
index bf3205b5dda..00000000000
--- a/db/schema_migrations/20220118155848
+++ /dev/null
@@ -1 +0,0 @@
-4d5adffe1a3e835d6d23f6bd9634993c778fef23d134552d54b003af2a3ff4da \ No newline at end of file
diff --git a/db/schema_migrations/20220118204039 b/db/schema_migrations/20220118204039
deleted file mode 100644
index 209204054ff..00000000000
--- a/db/schema_migrations/20220118204039
+++ /dev/null
@@ -1 +0,0 @@
-9b33f6e0c13acbf1adfc1b70f75418ceabc000a748c9216328ef36f1b8716ded \ No newline at end of file
diff --git a/db/schema_migrations/20220119094023 b/db/schema_migrations/20220119094023
deleted file mode 100644
index c2bf5ce88d6..00000000000
--- a/db/schema_migrations/20220119094023
+++ /dev/null
@@ -1 +0,0 @@
-4eddd356d87ce8fc8168dabe678211239e8d4051804d51d3bdce8cc137fa5a0d \ No newline at end of file
diff --git a/db/schema_migrations/20220119094503 b/db/schema_migrations/20220119094503
deleted file mode 100644
index 840a4d82593..00000000000
--- a/db/schema_migrations/20220119094503
+++ /dev/null
@@ -1 +0,0 @@
-1048b3a9744f212297c0a3aba176556e92e85f199ac861eb3ee4183eff002860 \ No newline at end of file
diff --git a/db/schema_migrations/20220119141407 b/db/schema_migrations/20220119141407
deleted file mode 100644
index 0ff56c63dd6..00000000000
--- a/db/schema_migrations/20220119141407
+++ /dev/null
@@ -1 +0,0 @@
-18b3ef459c3633ebd4b418b4436d3d50b0dc697fa7c4ef4d2e1f62b01d656bce \ No newline at end of file
diff --git a/db/schema_migrations/20220119141736 b/db/schema_migrations/20220119141736
deleted file mode 100644
index 431ed37ea5c..00000000000
--- a/db/schema_migrations/20220119141736
+++ /dev/null
@@ -1 +0,0 @@
-faa30b386af9adf3e9f54a0e8e2880310490e4dc1378eae68b346872d0bb8bfd \ No newline at end of file
diff --git a/db/schema_migrations/20220119143130 b/db/schema_migrations/20220119143130
deleted file mode 100644
index 8c9092fd187..00000000000
--- a/db/schema_migrations/20220119143130
+++ /dev/null
@@ -1 +0,0 @@
-a375f82fe0c1ef87aa6abb2142387b852b135be6e2158fd8456b23dc9bcf2a0e \ No newline at end of file
diff --git a/db/schema_migrations/20220119144253 b/db/schema_migrations/20220119144253
deleted file mode 100644
index ee59402bbcc..00000000000
--- a/db/schema_migrations/20220119144253
+++ /dev/null
@@ -1 +0,0 @@
-723db0d234a4dadfdad68a92c249ec0b42e519297f48bcb843e89c1ad97032c7 \ No newline at end of file
diff --git a/db/schema_migrations/20220119144458 b/db/schema_migrations/20220119144458
deleted file mode 100644
index c5eb43a3730..00000000000
--- a/db/schema_migrations/20220119144458
+++ /dev/null
@@ -1 +0,0 @@
-85227d2aa0e984f12362484b23554a4feb1304d055d54da40e20812f2d8c5b9e \ No newline at end of file
diff --git a/db/schema_migrations/20220119151221 b/db/schema_migrations/20220119151221
deleted file mode 100644
index 377170d9cb1..00000000000
--- a/db/schema_migrations/20220119151221
+++ /dev/null
@@ -1 +0,0 @@
-7865f26c43c79681f37ceb6e4fecf6153282856907ddfd8211d6d1d57d1fb7f3 \ No newline at end of file
diff --git a/db/schema_migrations/20220119153706 b/db/schema_migrations/20220119153706
deleted file mode 100644
index 446fee12b44..00000000000
--- a/db/schema_migrations/20220119153706
+++ /dev/null
@@ -1 +0,0 @@
-f87eec3c61cfc9dc860fe77af1fbe98c1ea2a9b0dc1b2dbdaaee4276b518af73 \ No newline at end of file
diff --git a/db/schema_migrations/20220119154442 b/db/schema_migrations/20220119154442
deleted file mode 100644
index 78880a0164c..00000000000
--- a/db/schema_migrations/20220119154442
+++ /dev/null
@@ -1 +0,0 @@
-7cb06f695c7e8e733ea50f0b2e8fbb115d5ac0d7e7f000228bd5ced58ab362c9 \ No newline at end of file
diff --git a/db/schema_migrations/20220119170426 b/db/schema_migrations/20220119170426
deleted file mode 100644
index 51274ac5979..00000000000
--- a/db/schema_migrations/20220119170426
+++ /dev/null
@@ -1 +0,0 @@
-a488fecd8e6e99b8d32ac27f72c6a3575b0ed29baaf242133e5d1abbd5b64314 \ No newline at end of file
diff --git a/db/schema_migrations/20220119193130 b/db/schema_migrations/20220119193130
deleted file mode 100644
index 5305ff9465e..00000000000
--- a/db/schema_migrations/20220119193130
+++ /dev/null
@@ -1 +0,0 @@
-c991eda1b3a972a7da9bdbd5e1f9957394c52246b78d793b4b35fdec9daf6acd \ No newline at end of file
diff --git a/db/schema_migrations/20220119201340 b/db/schema_migrations/20220119201340
deleted file mode 100644
index 0dc36b2dfba..00000000000
--- a/db/schema_migrations/20220119201340
+++ /dev/null
@@ -1 +0,0 @@
-62b35cc5bd0abc5b7bcf4347346de832bbbed723fee7860ec649185d4d5fb53c \ No newline at end of file
diff --git a/db/schema_migrations/20220119203119 b/db/schema_migrations/20220119203119
deleted file mode 100644
index 43bdb5b0391..00000000000
--- a/db/schema_migrations/20220119203119
+++ /dev/null
@@ -1 +0,0 @@
-c0f29fd7f960ffd92a65a00e8dce123b91a604f4d89b7cf0bc419fa80495e2e5 \ No newline at end of file
diff --git a/db/schema_migrations/20220119220620 b/db/schema_migrations/20220119220620
deleted file mode 100644
index a6a9abb2acc..00000000000
--- a/db/schema_migrations/20220119220620
+++ /dev/null
@@ -1 +0,0 @@
-535f476a358dcb3f3472f1e0ec1afef738f995197b5d1f4fcd61e58a9c9e8e75 \ No newline at end of file
diff --git a/db/schema_migrations/20220120033115 b/db/schema_migrations/20220120033115
deleted file mode 100644
index ef71ca650cd..00000000000
--- a/db/schema_migrations/20220120033115
+++ /dev/null
@@ -1 +0,0 @@
-41b67585574f6309d8e32fe695e65fc43f15f6738db713c1a11e04558a5ec515 \ No newline at end of file
diff --git a/db/schema_migrations/20220120085655 b/db/schema_migrations/20220120085655
deleted file mode 100644
index 534108786ec..00000000000
--- a/db/schema_migrations/20220120085655
+++ /dev/null
@@ -1 +0,0 @@
-966c42749e9d200f2b7295fdbb86e596c33510f0abbf431d40b09629e5e4a6aa \ No newline at end of file
diff --git a/db/schema_migrations/20220120094340 b/db/schema_migrations/20220120094340
deleted file mode 100644
index 423adf5cc94..00000000000
--- a/db/schema_migrations/20220120094340
+++ /dev/null
@@ -1 +0,0 @@
-69d8283501ba6a4946a60e3812fe2cf3031fc4a915d6e7c6fac3bf272423f2f2 \ No newline at end of file
diff --git a/db/schema_migrations/20220120123700 b/db/schema_migrations/20220120123700
deleted file mode 100644
index 263901fff19..00000000000
--- a/db/schema_migrations/20220120123700
+++ /dev/null
@@ -1 +0,0 @@
-9e274eae18520821dd890a11c8c6192da82a6051dce9ec2934b1365e57a10fdb \ No newline at end of file
diff --git a/db/schema_migrations/20220120123800 b/db/schema_migrations/20220120123800
deleted file mode 100644
index 6d271f75c08..00000000000
--- a/db/schema_migrations/20220120123800
+++ /dev/null
@@ -1 +0,0 @@
-9d2f0b0d2cb1a5844bdca5bcb4b82fa5cc6b465fa19177f9f6ca16574128fdc8 \ No newline at end of file
diff --git a/db/schema_migrations/20220120160625 b/db/schema_migrations/20220120160625
deleted file mode 100644
index 287e364d331..00000000000
--- a/db/schema_migrations/20220120160625
+++ /dev/null
@@ -1 +0,0 @@
-92485ceb25d5733efe9a35a5bd64c9f33253bb10f815590518c6fc8d1c9e5f39 \ No newline at end of file
diff --git a/db/schema_migrations/20220120211831 b/db/schema_migrations/20220120211831
deleted file mode 100644
index 7601916df62..00000000000
--- a/db/schema_migrations/20220120211831
+++ /dev/null
@@ -1 +0,0 @@
-68b45f97a2165c934f097ca976fb27ffcb533c57facee95344e3985b5cfd8347 \ No newline at end of file
diff --git a/db/schema_migrations/20220120211832 b/db/schema_migrations/20220120211832
deleted file mode 100644
index ed7679d4573..00000000000
--- a/db/schema_migrations/20220120211832
+++ /dev/null
@@ -1 +0,0 @@
-dd3a4209a72b470a14a3acc5d06db1f5fec67cb4f19b20b2e4d7d94b302fe122 \ No newline at end of file
diff --git a/db/schema_migrations/20220121214752 b/db/schema_migrations/20220121214752
deleted file mode 100644
index 84c03a6ed90..00000000000
--- a/db/schema_migrations/20220121214752
+++ /dev/null
@@ -1 +0,0 @@
-c56983a489b56eb6b4a5cd5ae6947a322fd58b8e96bcdee1e38634d99727c432 \ No newline at end of file
diff --git a/db/schema_migrations/20220121214753 b/db/schema_migrations/20220121214753
deleted file mode 100644
index 5142044be97..00000000000
--- a/db/schema_migrations/20220121214753
+++ /dev/null
@@ -1 +0,0 @@
-b7b9f5e516664e7eb3f7a5307d1871bb4f58a31f4807e0298fbf9414bad567fa \ No newline at end of file
diff --git a/db/schema_migrations/20220121221651 b/db/schema_migrations/20220121221651
deleted file mode 100644
index 562751c6084..00000000000
--- a/db/schema_migrations/20220121221651
+++ /dev/null
@@ -1 +0,0 @@
-a1681c1c619db7f4e7e5a760cee7d06a931aa1f02dccfce46be81d75a03ce8ac \ No newline at end of file
diff --git a/db/schema_migrations/20220124130028 b/db/schema_migrations/20220124130028
deleted file mode 100644
index 5ee8e463a55..00000000000
--- a/db/schema_migrations/20220124130028
+++ /dev/null
@@ -1 +0,0 @@
-7f2b3e70e33273d75f68bd1fa33103f24a4e4cfc3f2e5777dfd258b5a2e7bf4e \ No newline at end of file
diff --git a/db/schema_migrations/20220124145019 b/db/schema_migrations/20220124145019
deleted file mode 100644
index 8de01024798..00000000000
--- a/db/schema_migrations/20220124145019
+++ /dev/null
@@ -1 +0,0 @@
-3b1f7a7b6481a960ac25523e5e1b5abc6c1436332d64d4319d9e4112b0fa765e \ No newline at end of file
diff --git a/db/schema_migrations/20220124151456 b/db/schema_migrations/20220124151456
deleted file mode 100644
index 10a7b978e2f..00000000000
--- a/db/schema_migrations/20220124151456
+++ /dev/null
@@ -1 +0,0 @@
-5ec73b28adb027a4462ec9b268ef9c505e281f1afedce3c592d431cd90808dac \ No newline at end of file
diff --git a/db/schema_migrations/20220124151949 b/db/schema_migrations/20220124151949
deleted file mode 100644
index 2d6305b9789..00000000000
--- a/db/schema_migrations/20220124151949
+++ /dev/null
@@ -1 +0,0 @@
-4eb33deb4c2d5ff587f8af57b8296e46911f24a6ed0b2f7ff1f36243f1a9013d \ No newline at end of file
diff --git a/db/schema_migrations/20220124152824 b/db/schema_migrations/20220124152824
deleted file mode 100644
index 5a0db5859f0..00000000000
--- a/db/schema_migrations/20220124152824
+++ /dev/null
@@ -1 +0,0 @@
-acf680cbf06d6eb2c0da44d416ff947e0460593cad74499acda91eb4bec63894 \ No newline at end of file
diff --git a/db/schema_migrations/20220124153233 b/db/schema_migrations/20220124153233
deleted file mode 100644
index bfb0d6f3c38..00000000000
--- a/db/schema_migrations/20220124153233
+++ /dev/null
@@ -1 +0,0 @@
-f62f3d4cc6f4704e7b4e7d0b6b8e46ed3de4407f0db4282e2ce845aa6c0b3f3f \ No newline at end of file
diff --git a/db/schema_migrations/20220124153234 b/db/schema_migrations/20220124153234
deleted file mode 100644
index dfca9995395..00000000000
--- a/db/schema_migrations/20220124153234
+++ /dev/null
@@ -1 +0,0 @@
-0e8559121504f1a34394b5f613ef2c5554261f6aeaeaaf5a15d018803c4e5452 \ No newline at end of file
diff --git a/db/schema_migrations/20220124180704 b/db/schema_migrations/20220124180704
deleted file mode 100644
index ef59507a2e8..00000000000
--- a/db/schema_migrations/20220124180704
+++ /dev/null
@@ -1 +0,0 @@
-5b5f47f1d7038518fef71dd8c0758b234bb890be9aab57b78918f7b2dc39bdc4 \ No newline at end of file
diff --git a/db/schema_migrations/20220124180705 b/db/schema_migrations/20220124180705
deleted file mode 100644
index c1600192af1..00000000000
--- a/db/schema_migrations/20220124180705
+++ /dev/null
@@ -1 +0,0 @@
-6c147287ba8436bd0231dc22195c95a71d19987d23741c1291a117407f493184 \ No newline at end of file
diff --git a/db/schema_migrations/20220124184338 b/db/schema_migrations/20220124184338
deleted file mode 100644
index 860b47090c2..00000000000
--- a/db/schema_migrations/20220124184338
+++ /dev/null
@@ -1 +0,0 @@
-ae696157794bcbe3ebd0dc41d7b3fe4dc61982ad4a96fa503fd7857e0d3dab16 \ No newline at end of file
diff --git a/db/schema_migrations/20220124200927 b/db/schema_migrations/20220124200927
deleted file mode 100644
index ff29cc59538..00000000000
--- a/db/schema_migrations/20220124200927
+++ /dev/null
@@ -1 +0,0 @@
-688232dde01ea4e8574dca73459094264bde405d799ecaf1a5867adb72576b98 \ No newline at end of file
diff --git a/db/schema_migrations/20220124204046 b/db/schema_migrations/20220124204046
deleted file mode 100644
index f8de3adc215..00000000000
--- a/db/schema_migrations/20220124204046
+++ /dev/null
@@ -1 +0,0 @@
-90115936ede32bbf9a299582409cb0686e8072c204c4f91364dfb13195155929 \ No newline at end of file
diff --git a/db/schema_migrations/20220124214131 b/db/schema_migrations/20220124214131
deleted file mode 100644
index 7454bd8b3d1..00000000000
--- a/db/schema_migrations/20220124214131
+++ /dev/null
@@ -1 +0,0 @@
-af60c6df0fb178a4820ea8cb40b402178da7fb4b6ebeabb8739dc45b96225f89 \ No newline at end of file
diff --git a/db/schema_migrations/20220124215857 b/db/schema_migrations/20220124215857
deleted file mode 100644
index 495e428d2c4..00000000000
--- a/db/schema_migrations/20220124215857
+++ /dev/null
@@ -1 +0,0 @@
-785c2404175faef7d3d6f81ae8652ca0ced0f4b01def8d6364a4450f0db49ecf \ No newline at end of file
diff --git a/db/schema_migrations/20220124221521 b/db/schema_migrations/20220124221521
deleted file mode 100644
index 8400dcbc1e2..00000000000
--- a/db/schema_migrations/20220124221521
+++ /dev/null
@@ -1 +0,0 @@
-4b1dad4fc34717c9b89a770e4e0682b0cee7d421da68223011bb9fde9460d1f8 \ No newline at end of file
diff --git a/db/schema_migrations/20220125083520 b/db/schema_migrations/20220125083520
deleted file mode 100644
index c3fbb6beda5..00000000000
--- a/db/schema_migrations/20220125083520
+++ /dev/null
@@ -1 +0,0 @@
-2c3f7c587b2a20de1d8581584f7392fd81643af4eb7e25ffc8e08514b6ad83ab \ No newline at end of file
diff --git a/db/schema_migrations/20220125084127 b/db/schema_migrations/20220125084127
deleted file mode 100644
index f9ba7a4628b..00000000000
--- a/db/schema_migrations/20220125084127
+++ /dev/null
@@ -1 +0,0 @@
-c50a21430e52fc6ccbe7ab4aba99ae3a48d1c69858f7886da115f54e19fc27ea \ No newline at end of file
diff --git a/db/schema_migrations/20220125084348 b/db/schema_migrations/20220125084348
deleted file mode 100644
index 9d4cbd7c5ed..00000000000
--- a/db/schema_migrations/20220125084348
+++ /dev/null
@@ -1 +0,0 @@
-75eb050fc789eb5775a5d3a88c2573dca5c38e16b63cd342bf46dca55d1adaef \ No newline at end of file
diff --git a/db/schema_migrations/20220125122228 b/db/schema_migrations/20220125122228
deleted file mode 100644
index 2add72978c6..00000000000
--- a/db/schema_migrations/20220125122228
+++ /dev/null
@@ -1 +0,0 @@
-26600e01d8b31a4308d0e23564e4d4c52488ec87ad7990a410b7cc0c031f12e7 \ No newline at end of file
diff --git a/db/schema_migrations/20220125122640 b/db/schema_migrations/20220125122640
deleted file mode 100644
index fdb85bb480a..00000000000
--- a/db/schema_migrations/20220125122640
+++ /dev/null
@@ -1 +0,0 @@
-51c7ab860b952281bd7f65d68e7a539a8eee57cac3bbdaf439ff5593f5b065ed \ No newline at end of file
diff --git a/db/schema_migrations/20220125122725 b/db/schema_migrations/20220125122725
deleted file mode 100644
index 7a6ef38bfbc..00000000000
--- a/db/schema_migrations/20220125122725
+++ /dev/null
@@ -1 +0,0 @@
-7740d1e71571576a709ae5bfd46f60ea3fb4be3f48cddec2cca53f148096cdd7 \ No newline at end of file
diff --git a/db/schema_migrations/20220125230538 b/db/schema_migrations/20220125230538
deleted file mode 100644
index 45bd8bfb04c..00000000000
--- a/db/schema_migrations/20220125230538
+++ /dev/null
@@ -1 +0,0 @@
-6f3a3712288c3316042426d60f087817eb57a3246b750831aa72f95f30269a5d \ No newline at end of file
diff --git a/db/schema_migrations/20220126201752 b/db/schema_migrations/20220126201752
deleted file mode 100644
index e5a1970ec9e..00000000000
--- a/db/schema_migrations/20220126201752
+++ /dev/null
@@ -1 +0,0 @@
-7731772dfac065a60c1626707913ddf6ff632bb69dd5ed6534e8d29e4e03c573 \ No newline at end of file
diff --git a/db/schema_migrations/20220126202654 b/db/schema_migrations/20220126202654
deleted file mode 100644
index 341e2c6b8bf..00000000000
--- a/db/schema_migrations/20220126202654
+++ /dev/null
@@ -1 +0,0 @@
-6067e4e22e49548496454b48171f8168f7d5bf626fedab4351e2a37a3f85731b \ No newline at end of file
diff --git a/db/schema_migrations/20220126203421 b/db/schema_migrations/20220126203421
deleted file mode 100644
index 32469cd40ee..00000000000
--- a/db/schema_migrations/20220126203421
+++ /dev/null
@@ -1 +0,0 @@
-07f837ddde21e36d1ca6a471dd96350d3020bd30204fca0e093983810c94e54d \ No newline at end of file
diff --git a/db/schema_migrations/20220126210021 b/db/schema_migrations/20220126210021
deleted file mode 100644
index edb9d9c779d..00000000000
--- a/db/schema_migrations/20220126210021
+++ /dev/null
@@ -1 +0,0 @@
-fd7940bb6f077c91d7f9928f574443ba4bf33bb90cb702c0a2ecad14398ab1cc \ No newline at end of file
diff --git a/db/schema_migrations/20220126210022 b/db/schema_migrations/20220126210022
deleted file mode 100644
index 32cb73ee3ee..00000000000
--- a/db/schema_migrations/20220126210022
+++ /dev/null
@@ -1 +0,0 @@
-80a75bf72b40ee791bebd9ae97a793ce41fbd352841d83421525b6ad78e1c5e8 \ No newline at end of file
diff --git a/db/schema_migrations/20220126210657 b/db/schema_migrations/20220126210657
deleted file mode 100644
index a3301b46756..00000000000
--- a/db/schema_migrations/20220126210657
+++ /dev/null
@@ -1 +0,0 @@
-853209f3babe2856481591790d9bb67145c4c0c919ed4d8365bb8d498e4f6b8e \ No newline at end of file
diff --git a/db/schema_migrations/20220127112243 b/db/schema_migrations/20220127112243
deleted file mode 100644
index 2c591bdde58..00000000000
--- a/db/schema_migrations/20220127112243
+++ /dev/null
@@ -1 +0,0 @@
-7707b9bcdcd7ec28af31b90355905eb8971c12a90c4334b0ae214e45fac9645a \ No newline at end of file
diff --git a/db/schema_migrations/20220127112412 b/db/schema_migrations/20220127112412
deleted file mode 100644
index af58ff48473..00000000000
--- a/db/schema_migrations/20220127112412
+++ /dev/null
@@ -1 +0,0 @@
-350409be3f491b61a1d757dbd839b48d088339883e8e019d00ad90e6adc350e6 \ No newline at end of file
diff --git a/db/schema_migrations/20220127132200 b/db/schema_migrations/20220127132200
deleted file mode 100644
index 8dc7ac4ddbd..00000000000
--- a/db/schema_migrations/20220127132200
+++ /dev/null
@@ -1 +0,0 @@
-394f1fa34ccf9188f25102ac963829ebee07dddaf02f1d5958ec14d701fb6fe8 \ No newline at end of file
diff --git a/db/schema_migrations/20220127132201 b/db/schema_migrations/20220127132201
deleted file mode 100644
index f2c9cbbe38f..00000000000
--- a/db/schema_migrations/20220127132201
+++ /dev/null
@@ -1 +0,0 @@
-f8ce7c183352ce08585eda83eb1e22c800b1b2044b93bc11858a74a8bd9a99d4 \ No newline at end of file
diff --git a/db/schema_migrations/20220128093756 b/db/schema_migrations/20220128093756
deleted file mode 100644
index fd24b6cd4cd..00000000000
--- a/db/schema_migrations/20220128093756
+++ /dev/null
@@ -1 +0,0 @@
-787b1be4b69ef0eeb049ee6a3d7126dc75094b79fba18f469fffe78b16fce6a3 \ No newline at end of file
diff --git a/db/schema_migrations/20220128155251 b/db/schema_migrations/20220128155251
deleted file mode 100644
index 11fa6807ed5..00000000000
--- a/db/schema_migrations/20220128155251
+++ /dev/null
@@ -1 +0,0 @@
-0d121aeecdd6ace1516c2e9b84fefd47d963c4cbe22a0448728241d83da3742e \ No newline at end of file
diff --git a/db/schema_migrations/20220128155814 b/db/schema_migrations/20220128155814
deleted file mode 100644
index 209b0874a84..00000000000
--- a/db/schema_migrations/20220128155814
+++ /dev/null
@@ -1 +0,0 @@
-77cc8fc86f2c6a5ed017dde40dd4db796821a35e6ce4d8dcbe24b2cdaccbb5d9 \ No newline at end of file
diff --git a/db/schema_migrations/20220128194722 b/db/schema_migrations/20220128194722
deleted file mode 100644
index 9c06f452c1e..00000000000
--- a/db/schema_migrations/20220128194722
+++ /dev/null
@@ -1 +0,0 @@
-087338f0b438d2aa33bc22bd3973d818c5d1f40948525d95181751722158605b \ No newline at end of file
diff --git a/db/schema_migrations/20220131000000 b/db/schema_migrations/20220131000000
deleted file mode 100644
index f80ceb97f1c..00000000000
--- a/db/schema_migrations/20220131000000
+++ /dev/null
@@ -1 +0,0 @@
-08326048e15f368f09bc10ebf5bee3e77e8b43813f66c19d24731497ca6a8485 \ No newline at end of file
diff --git a/db/schema_migrations/20220131000001 b/db/schema_migrations/20220131000001
deleted file mode 100644
index 72dce62bbce..00000000000
--- a/db/schema_migrations/20220131000001
+++ /dev/null
@@ -1 +0,0 @@
-59fe701bcaa102b7e0c1496198fa4aeea6b2e59132c951d1c9d54562c5e3900e \ No newline at end of file
diff --git a/db/schema_migrations/20220131135725 b/db/schema_migrations/20220131135725
deleted file mode 100644
index d63b24d5d6c..00000000000
--- a/db/schema_migrations/20220131135725
+++ /dev/null
@@ -1 +0,0 @@
-a0e9bb92512b9ddb3fd718e086b0fd116ec307be6acc5789a872b1d3004fdebd \ No newline at end of file
diff --git a/db/schema_migrations/20220131192643 b/db/schema_migrations/20220131192643
deleted file mode 100644
index e947bf0cfbe..00000000000
--- a/db/schema_migrations/20220131192643
+++ /dev/null
@@ -1 +0,0 @@
-3b9068f109685dcfa8a0a1fda886cca3909d29cbc280cf70ed9f3d927def12ac \ No newline at end of file
diff --git a/db/schema_migrations/20220201034731 b/db/schema_migrations/20220201034731
deleted file mode 100644
index 59e4fd59720..00000000000
--- a/db/schema_migrations/20220201034731
+++ /dev/null
@@ -1 +0,0 @@
-873ff811d4f70c012785297ee8c07eb496994af69d5ae4b266e8f675c88daca4 \ No newline at end of file
diff --git a/db/schema_migrations/20220201141705 b/db/schema_migrations/20220201141705
deleted file mode 100644
index 92835993156..00000000000
--- a/db/schema_migrations/20220201141705
+++ /dev/null
@@ -1 +0,0 @@
-9eb0c4609fbec79370215d05a9a1faf4208b9dcc2bfeb861feeb7c9f354489ab \ No newline at end of file
diff --git a/db/schema_migrations/20220201173212 b/db/schema_migrations/20220201173212
deleted file mode 100644
index b07c8e371a5..00000000000
--- a/db/schema_migrations/20220201173212
+++ /dev/null
@@ -1 +0,0 @@
-7a48d49d576d183198df370593642419da5707d8b018a23f541c448e2aa7ad65 \ No newline at end of file
diff --git a/db/schema_migrations/20220201193033 b/db/schema_migrations/20220201193033
deleted file mode 100644
index e40840c66fa..00000000000
--- a/db/schema_migrations/20220201193033
+++ /dev/null
@@ -1 +0,0 @@
-92bbe74c6c3627dd26f709acd2a20f442212eab933f719be815701a3bc429539 \ No newline at end of file
diff --git a/db/schema_migrations/20220201205300 b/db/schema_migrations/20220201205300
deleted file mode 100644
index 86f6dd234fd..00000000000
--- a/db/schema_migrations/20220201205300
+++ /dev/null
@@ -1 +0,0 @@
-79a636f33f70327206356abd1793b73a5ef5e920a41662e35cbff5597b03a365 \ No newline at end of file
diff --git a/db/schema_migrations/20220202034409 b/db/schema_migrations/20220202034409
deleted file mode 100644
index 4eb359f45e6..00000000000
--- a/db/schema_migrations/20220202034409
+++ /dev/null
@@ -1 +0,0 @@
-0efe482aa626cf80912feaa1176837253b094fc434f273bee35b5fe3e8ce4243 \ No newline at end of file
diff --git a/db/schema_migrations/20220202105733 b/db/schema_migrations/20220202105733
deleted file mode 100644
index 473b03d6210..00000000000
--- a/db/schema_migrations/20220202105733
+++ /dev/null
@@ -1 +0,0 @@
-6f2919091a6998f2f18f8dbff3c968e68dc218ab0e51341164d1fc5b8abf72ae \ No newline at end of file
diff --git a/db/schema_migrations/20220202115350 b/db/schema_migrations/20220202115350
deleted file mode 100644
index 9b8148ca2d1..00000000000
--- a/db/schema_migrations/20220202115350
+++ /dev/null
@@ -1 +0,0 @@
-3bcc97592e8e329e39917deffae6619e69215930a688bebad2949f69155b53f9 \ No newline at end of file
diff --git a/db/schema_migrations/20220203074916 b/db/schema_migrations/20220203074916
deleted file mode 100644
index fffd0dcc003..00000000000
--- a/db/schema_migrations/20220203074916
+++ /dev/null
@@ -1 +0,0 @@
-5bb52cc70aada72e0e569006fd05de0c0d7629559d78bfd361009c91482f02cf \ No newline at end of file
diff --git a/db/schema_migrations/20220203091304 b/db/schema_migrations/20220203091304
deleted file mode 100644
index 847620db3d2..00000000000
--- a/db/schema_migrations/20220203091304
+++ /dev/null
@@ -1 +0,0 @@
-dac90da1a8c5af69610dd103c8db9cd70a395ad5f9addafb554a853d6acd2a6e \ No newline at end of file
diff --git a/db/schema_migrations/20220203123333 b/db/schema_migrations/20220203123333
deleted file mode 100644
index 9cc146c4ed7..00000000000
--- a/db/schema_migrations/20220203123333
+++ /dev/null
@@ -1 +0,0 @@
-87cccb30bb6f27a1acb0dd0cb905040e2a0291cefc5f26bb9a08c8be18034ca3 \ No newline at end of file
diff --git a/db/schema_migrations/20220203133652 b/db/schema_migrations/20220203133652
deleted file mode 100644
index 7deda2292b4..00000000000
--- a/db/schema_migrations/20220203133652
+++ /dev/null
@@ -1 +0,0 @@
-5642cf604a1aaf8bef6098a9918b582e0e336d79ca3b2a005cf90bb8eab0ca13 \ No newline at end of file
diff --git a/db/schema_migrations/20220203134942 b/db/schema_migrations/20220203134942
deleted file mode 100644
index 7dea7f1f0e7..00000000000
--- a/db/schema_migrations/20220203134942
+++ /dev/null
@@ -1 +0,0 @@
-02f7a38c7bc19b1a266ac1f1d6631f1922fc135518baeb19ee90bebd7c31c6b9 \ No newline at end of file
diff --git a/db/schema_migrations/20220204053655 b/db/schema_migrations/20220204053655
deleted file mode 100644
index e096dae0c07..00000000000
--- a/db/schema_migrations/20220204053655
+++ /dev/null
@@ -1 +0,0 @@
-d6b7fa6e5be83aa67bb479604bf6ddb9d8caae82fc8ea1ab7f34d5c534174ecf \ No newline at end of file
diff --git a/db/schema_migrations/20220204093120 b/db/schema_migrations/20220204093120
deleted file mode 100644
index debd48e3c5f..00000000000
--- a/db/schema_migrations/20220204093120
+++ /dev/null
@@ -1 +0,0 @@
-e147a8281f98ee397d7d9b652ce21b943e4e87c11fca906b72db839e0e2fa360 \ No newline at end of file
diff --git a/db/schema_migrations/20220204095121 b/db/schema_migrations/20220204095121
deleted file mode 100644
index bf12ca08f5a..00000000000
--- a/db/schema_migrations/20220204095121
+++ /dev/null
@@ -1 +0,0 @@
-bce595c1c6587e785bc49d6e5a7181b5cc0164f2201375ad82d4bd19c217cd35 \ No newline at end of file
diff --git a/db/schema_migrations/20220204110725 b/db/schema_migrations/20220204110725
deleted file mode 100644
index 804dc8c6d54..00000000000
--- a/db/schema_migrations/20220204110725
+++ /dev/null
@@ -1 +0,0 @@
-c87ca83f592c6688c31182fcd4cf6fe282c00a3c92ebe245b66455f57b50fc32 \ No newline at end of file
diff --git a/db/schema_migrations/20220204154220 b/db/schema_migrations/20220204154220
deleted file mode 100644
index 42da4e82258..00000000000
--- a/db/schema_migrations/20220204154220
+++ /dev/null
@@ -1 +0,0 @@
-efecc3c6468d8a5036352f5b62e8d70de835d1beb4e45ba6d3906906d0317848 \ No newline at end of file
diff --git a/db/schema_migrations/20220204193000 b/db/schema_migrations/20220204193000
deleted file mode 100644
index f0d16b9671c..00000000000
--- a/db/schema_migrations/20220204193000
+++ /dev/null
@@ -1 +0,0 @@
-9d98618a1e9fd0474c45ac54420fc64a1d90ad77f36be594337e5b117fccdadb \ No newline at end of file
diff --git a/db/schema_migrations/20220204194347 b/db/schema_migrations/20220204194347
deleted file mode 100644
index d506497e036..00000000000
--- a/db/schema_migrations/20220204194347
+++ /dev/null
@@ -1 +0,0 @@
-1593e935601ae1f2ab788109687bb40bad026f3f425339a39c8d13d3e4c7e306 \ No newline at end of file
diff --git a/db/schema_migrations/20220207080758 b/db/schema_migrations/20220207080758
deleted file mode 100644
index d4adf5ad455..00000000000
--- a/db/schema_migrations/20220207080758
+++ /dev/null
@@ -1 +0,0 @@
-f63be8bd42cc1856c92f9073fdb39c58c45806b483d38b91db007a8661c49a97 \ No newline at end of file
diff --git a/db/schema_migrations/20220207083129 b/db/schema_migrations/20220207083129
deleted file mode 100644
index 25dca4578f4..00000000000
--- a/db/schema_migrations/20220207083129
+++ /dev/null
@@ -1 +0,0 @@
-01cc0139097235991fa2caf8b780ccd1c3ce580647197418424ade83ce9be77e \ No newline at end of file
diff --git a/db/schema_migrations/20220208080921 b/db/schema_migrations/20220208080921
deleted file mode 100644
index ecf35389390..00000000000
--- a/db/schema_migrations/20220208080921
+++ /dev/null
@@ -1 +0,0 @@
-84346c2f608792f259ab91dbc2c8aac8397a2997f890f8e077aad809276bb7cd \ No newline at end of file
diff --git a/db/schema_migrations/20220208115439 b/db/schema_migrations/20220208115439
deleted file mode 100644
index 72230321625..00000000000
--- a/db/schema_migrations/20220208115439
+++ /dev/null
@@ -1 +0,0 @@
-dbe6760198b8fa068c30871a439298e56802867044a178baa6b8b009f8da13e6 \ No newline at end of file
diff --git a/db/schema_migrations/20220208170445 b/db/schema_migrations/20220208170445
deleted file mode 100644
index 3a486a586a8..00000000000
--- a/db/schema_migrations/20220208170445
+++ /dev/null
@@ -1 +0,0 @@
-e00dd618ca393596f3ff05b44b1a9a36183729a864a5cf4b8f1a262dfcdb932b \ No newline at end of file
diff --git a/db/schema_migrations/20220208171826 b/db/schema_migrations/20220208171826
deleted file mode 100644
index 75ae0dcef61..00000000000
--- a/db/schema_migrations/20220208171826
+++ /dev/null
@@ -1 +0,0 @@
-e48473172d7561fb7474e16e291e555843c0ec4543300b007f86cd4a5923db85 \ No newline at end of file
diff --git a/db/schema_migrations/20220209111007 b/db/schema_migrations/20220209111007
deleted file mode 100644
index f10e05b8918..00000000000
--- a/db/schema_migrations/20220209111007
+++ /dev/null
@@ -1 +0,0 @@
-9462258bcbe45ab80f7ef5a02f8b8d5c0ed6ac69bf04b8934ae3dee2261ba458 \ No newline at end of file
diff --git a/db/schema_migrations/20220211090920 b/db/schema_migrations/20220211090920
deleted file mode 100644
index 1f08b66e508..00000000000
--- a/db/schema_migrations/20220211090920
+++ /dev/null
@@ -1 +0,0 @@
-644d38e401ac8179777cb9d3c5fefca2fb55e0c409197bb2d222f7e96e5dd42f \ No newline at end of file
diff --git a/db/schema_migrations/20220211125954 b/db/schema_migrations/20220211125954
deleted file mode 100644
index 5f0bb009254..00000000000
--- a/db/schema_migrations/20220211125954
+++ /dev/null
@@ -1 +0,0 @@
-73feefe409b9c0f4ea373d0c3f13690df0086fbc4fc212595e959ad65fcc27b1 \ No newline at end of file
diff --git a/db/schema_migrations/20220211214605 b/db/schema_migrations/20220211214605
deleted file mode 100644
index 89dbee18ee7..00000000000
--- a/db/schema_migrations/20220211214605
+++ /dev/null
@@ -1 +0,0 @@
-add5ee0b8e090ba740ce738f66ea4f741485a0c84728fecfa5b0488564d55536 \ No newline at end of file
diff --git a/db/schema_migrations/20220212120735 b/db/schema_migrations/20220212120735
deleted file mode 100644
index 1ec5f9af681..00000000000
--- a/db/schema_migrations/20220212120735
+++ /dev/null
@@ -1 +0,0 @@
-c075ee9d6efeae4b7a9b6e310f0c3d0bdd0ac6a58dc214427d4de9ae579db50d \ No newline at end of file
diff --git a/db/schema_migrations/20220213104531 b/db/schema_migrations/20220213104531
deleted file mode 100644
index 72656d85fb0..00000000000
--- a/db/schema_migrations/20220213104531
+++ /dev/null
@@ -1 +0,0 @@
-9ce8aa469b9469d25fbba52147e24c95f6242c2ab1e114df8baaf5a45268d2fd \ No newline at end of file
diff --git a/db/schema_migrations/20220215164709 b/db/schema_migrations/20220215164709
deleted file mode 100644
index 60179eaeddd..00000000000
--- a/db/schema_migrations/20220215164709
+++ /dev/null
@@ -1 +0,0 @@
-af6d142b77bc2787a520f8cbc63c287823a7a65a2edb3eb488e4f0f4efde9fa8 \ No newline at end of file
diff --git a/db/schema_migrations/20220215190020 b/db/schema_migrations/20220215190020
deleted file mode 100644
index 1d5be90ca1f..00000000000
--- a/db/schema_migrations/20220215190020
+++ /dev/null
@@ -1 +0,0 @@
-aa92afc5f74f051132aeb73889d7360bbd6258b27c0aedb4fea6a44ccce597b3 \ No newline at end of file
diff --git a/db/schema_migrations/20220216110023 b/db/schema_migrations/20220216110023
deleted file mode 100644
index 30acd6fdaf2..00000000000
--- a/db/schema_migrations/20220216110023
+++ /dev/null
@@ -1 +0,0 @@
-5931c4981c89d65c5aaca05dc8375c2c21bb595e28354d6623986d906ece165d \ No newline at end of file
diff --git a/db/schema_migrations/20220216201949 b/db/schema_migrations/20220216201949
deleted file mode 100644
index 466da69ad0e..00000000000
--- a/db/schema_migrations/20220216201949
+++ /dev/null
@@ -1 +0,0 @@
-481bc7b167ddf46bd11322e4458e48de10483bf34d0e393f7e76a3572c28e09f \ No newline at end of file
diff --git a/db/schema_migrations/20220217100008 b/db/schema_migrations/20220217100008
deleted file mode 100644
index 6347388a5ce..00000000000
--- a/db/schema_migrations/20220217100008
+++ /dev/null
@@ -1 +0,0 @@
-f52d88262879c40d9ac60a74853b7070036f244fd5f7957c59bbfceb343811d1 \ No newline at end of file
diff --git a/db/schema_migrations/20220217113058 b/db/schema_migrations/20220217113058
deleted file mode 100644
index ef801a0e269..00000000000
--- a/db/schema_migrations/20220217113058
+++ /dev/null
@@ -1 +0,0 @@
-d2d236e9ee5fa6e9c1ee97431543e871b78e469b812444bd9386dfecf849947b \ No newline at end of file
diff --git a/db/schema_migrations/20220217135229 b/db/schema_migrations/20220217135229
deleted file mode 100644
index fb80b77347f..00000000000
--- a/db/schema_migrations/20220217135229
+++ /dev/null
@@ -1 +0,0 @@
-3223f741799216ee6afb4daafbcebfa09bd722d461dd4d64fcbda7d8700ae235 \ No newline at end of file
diff --git a/db/schema_migrations/20220221214928 b/db/schema_migrations/20220221214928
deleted file mode 100644
index 5c32b3fbd96..00000000000
--- a/db/schema_migrations/20220221214928
+++ /dev/null
@@ -1 +0,0 @@
-8c9936d1c0f728c2b40dca536f9edb40f4af94a274ccf1dbec984f218710f695 \ No newline at end of file
diff --git a/db/schema_migrations/20220222072536 b/db/schema_migrations/20220222072536
deleted file mode 100644
index 6a4b4f76dda..00000000000
--- a/db/schema_migrations/20220222072536
+++ /dev/null
@@ -1 +0,0 @@
-d7ddc369818f0a2403abefea2ac1da5abd1ca41199d3948166f10dfdf9d2fa9d \ No newline at end of file
diff --git a/db/schema_migrations/20220222191845 b/db/schema_migrations/20220222191845
deleted file mode 100644
index 88c15bc87c0..00000000000
--- a/db/schema_migrations/20220222191845
+++ /dev/null
@@ -1 +0,0 @@
-c528d64cafc072554cd1ef1006a1c359a3135896abae2d5ca20fbbc99ff14f8c \ No newline at end of file
diff --git a/db/schema_migrations/20220222192524 b/db/schema_migrations/20220222192524
deleted file mode 100644
index c49e45f0d61..00000000000
--- a/db/schema_migrations/20220222192524
+++ /dev/null
@@ -1 +0,0 @@
-b876119bb369a9831736cddf5326b72a74003ec2e17fe863654cb69497fcf236 \ No newline at end of file
diff --git a/db/schema_migrations/20220222192525 b/db/schema_migrations/20220222192525
deleted file mode 100644
index 6eeec13bbb5..00000000000
--- a/db/schema_migrations/20220222192525
+++ /dev/null
@@ -1 +0,0 @@
-f512ea4c4a2625c647c3d05765152fee963b56962b674f839180fd77c194ccb0 \ No newline at end of file
diff --git a/db/schema_migrations/20220223112304 b/db/schema_migrations/20220223112304
deleted file mode 100644
index bfcbf9c1225..00000000000
--- a/db/schema_migrations/20220223112304
+++ /dev/null
@@ -1 +0,0 @@
-57dc23bb2a9faddefe20c1e30a8879ebb1f6f32f17e3cc381acc1d06ad3b598a \ No newline at end of file
diff --git a/db/schema_migrations/20220223124428 b/db/schema_migrations/20220223124428
deleted file mode 100644
index b163accc957..00000000000
--- a/db/schema_migrations/20220223124428
+++ /dev/null
@@ -1 +0,0 @@
-8fb72b15bfaa1b58f87cb3f1836df1e8bfa1a5ddec4e480a2cb6a3c9fafe3bda \ No newline at end of file
diff --git a/db/schema_migrations/20220224000000 b/db/schema_migrations/20220224000000
deleted file mode 100644
index e6e9aefbabb..00000000000
--- a/db/schema_migrations/20220224000000
+++ /dev/null
@@ -1 +0,0 @@
-74b4d572118b7f5da0a80722601a4757ce47ccbdae1af1e84b2304343477d634 \ No newline at end of file
diff --git a/db/schema_migrations/20220224204415 b/db/schema_migrations/20220224204415
deleted file mode 100644
index e0faa994b54..00000000000
--- a/db/schema_migrations/20220224204415
+++ /dev/null
@@ -1 +0,0 @@
-1d7105559c8d2da1d86c5625c592edc792d7cd729b8c86c7a2b950c3dd98e975 \ No newline at end of file
diff --git a/db/schema_migrations/20220225133705 b/db/schema_migrations/20220225133705
deleted file mode 100644
index 97f27e748e0..00000000000
--- a/db/schema_migrations/20220225133705
+++ /dev/null
@@ -1 +0,0 @@
-aa9ab05f6991f06c465fbc4878e0cbc648dc09b1b7912dbbf3dd68887a9cdd1d \ No newline at end of file
diff --git a/db/schema_migrations/20220301002101 b/db/schema_migrations/20220301002101
deleted file mode 100644
index ab8f76b3bbb..00000000000
--- a/db/schema_migrations/20220301002101
+++ /dev/null
@@ -1 +0,0 @@
-a19f7f5026fd91cf6f3fcadccd19808920e64005c207b57b46955a0352a68366 \ No newline at end of file
diff --git a/db/schema_migrations/20220301003502 b/db/schema_migrations/20220301003502
deleted file mode 100644
index 5a2a9ee8334..00000000000
--- a/db/schema_migrations/20220301003502
+++ /dev/null
@@ -1 +0,0 @@
-bbca8df8e60c8d027f672dfdee2b0edef35f4fdc3152ae98450df67633f3998f \ No newline at end of file
diff --git a/db/schema_migrations/20220301091503 b/db/schema_migrations/20220301091503
deleted file mode 100644
index 49184ad4262..00000000000
--- a/db/schema_migrations/20220301091503
+++ /dev/null
@@ -1 +0,0 @@
-4a05ddbc3d2a52a719c6fda8d834611be6f663fbce97b42655a00583d0e2042a \ No newline at end of file
diff --git a/db/schema_migrations/20220301093434 b/db/schema_migrations/20220301093434
deleted file mode 100644
index 78886cc9df4..00000000000
--- a/db/schema_migrations/20220301093434
+++ /dev/null
@@ -1 +0,0 @@
-ffdd031395c025ea63ea1adcd63636822e62388a8860c93235f3748918fc30ca \ No newline at end of file
diff --git a/db/schema_migrations/20220301175104 b/db/schema_migrations/20220301175104
deleted file mode 100644
index 2553c957576..00000000000
--- a/db/schema_migrations/20220301175104
+++ /dev/null
@@ -1 +0,0 @@
-52e172b1ca6e21a6864e82597a7aae6e1c4776507a475a88807ec140b8648966 \ No newline at end of file
diff --git a/db/schema_migrations/20220301175426 b/db/schema_migrations/20220301175426
deleted file mode 100644
index 6a11d9b04b8..00000000000
--- a/db/schema_migrations/20220301175426
+++ /dev/null
@@ -1 +0,0 @@
-d0a8daf9fb9892fc92b03f13de4d7e470e5c54f03b09f887cdd45bc5eb9a7e37 \ No newline at end of file
diff --git a/db/schema_migrations/20220302110724 b/db/schema_migrations/20220302110724
deleted file mode 100644
index 700a39b85c5..00000000000
--- a/db/schema_migrations/20220302110724
+++ /dev/null
@@ -1 +0,0 @@
-4f565a313c37d12f24afe26a9e344d4273c54d0f080b3108d56ed98bf7299ecc \ No newline at end of file
diff --git a/db/schema_migrations/20220302114046 b/db/schema_migrations/20220302114046
deleted file mode 100644
index 40488b47eb2..00000000000
--- a/db/schema_migrations/20220302114046
+++ /dev/null
@@ -1 +0,0 @@
-4e2de14559b47a9bf3fa8910fdb84ff62cb18442620f4147e40e8026bf4bcf1b \ No newline at end of file
diff --git a/db/schema_migrations/20220302203410 b/db/schema_migrations/20220302203410
deleted file mode 100644
index 70326d38a97..00000000000
--- a/db/schema_migrations/20220302203410
+++ /dev/null
@@ -1 +0,0 @@
-873aac965684e58cfdb6098b20891cbb73614aff833f235d76bfd379498f6fda \ No newline at end of file
diff --git a/db/schema_migrations/20220303190555 b/db/schema_migrations/20220303190555
deleted file mode 100644
index 08db64ca2a4..00000000000
--- a/db/schema_migrations/20220303190555
+++ /dev/null
@@ -1 +0,0 @@
-f8fa8b83da24bf98c97447a2940c8ca801532c80395b6a65c11f83515f811652 \ No newline at end of file
diff --git a/db/schema_migrations/20220303191047 b/db/schema_migrations/20220303191047
deleted file mode 100644
index 6e933c08f6b..00000000000
--- a/db/schema_migrations/20220303191047
+++ /dev/null
@@ -1 +0,0 @@
-19566152e16a92263dd5dcfd66299e3b9d8b82acd4edb4bba21f6b9b06fc8070 \ No newline at end of file
diff --git a/db/schema_migrations/20220304052335 b/db/schema_migrations/20220304052335
deleted file mode 100644
index 5716ea07f7d..00000000000
--- a/db/schema_migrations/20220304052335
+++ /dev/null
@@ -1 +0,0 @@
-ba2bae8d9561eeab907ecf30664a593bdf93ab1041453f93794bf0be4464e92c \ No newline at end of file
diff --git a/db/schema_migrations/20220304061631 b/db/schema_migrations/20220304061631
deleted file mode 100644
index d7b38b30f9f..00000000000
--- a/db/schema_migrations/20220304061631
+++ /dev/null
@@ -1 +0,0 @@
-7394be90999876473cfe39c38e72f21c7bb36a5038300d6fe1354f15f3d77e21 \ No newline at end of file
diff --git a/db/schema_migrations/20220304062107 b/db/schema_migrations/20220304062107
deleted file mode 100644
index 9ea552c6a9e..00000000000
--- a/db/schema_migrations/20220304062107
+++ /dev/null
@@ -1 +0,0 @@
-a9aace14f847412c2af03cc6de61616a0f48d32d0fd24b25f6b1f85513c87139 \ No newline at end of file
diff --git a/db/schema_migrations/20220304152729 b/db/schema_migrations/20220304152729
deleted file mode 100644
index 021d4e5ad27..00000000000
--- a/db/schema_migrations/20220304152729
+++ /dev/null
@@ -1 +0,0 @@
-483f8299688a6e24fa77867b7dab8a2dad0c2b7ebe43c56c81c02ab1e0dc4674 \ No newline at end of file
diff --git a/db/schema_migrations/20220304165107 b/db/schema_migrations/20220304165107
deleted file mode 100644
index 6db7aee6b0f..00000000000
--- a/db/schema_migrations/20220304165107
+++ /dev/null
@@ -1 +0,0 @@
-b7090327d2638bbee6646e5ca5a8f8597d97631f10f997698b8a1c1b6329c106 \ No newline at end of file
diff --git a/db/schema_migrations/20220304201847 b/db/schema_migrations/20220304201847
deleted file mode 100644
index 1dafb1b821e..00000000000
--- a/db/schema_migrations/20220304201847
+++ /dev/null
@@ -1 +0,0 @@
-d60a313ac68b0edfe1ae219690aacbe74c038b90bc4239f67d14f9ced36d67f6 \ No newline at end of file
diff --git a/db/schema_migrations/20220305223212 b/db/schema_migrations/20220305223212
deleted file mode 100644
index b8adc88a760..00000000000
--- a/db/schema_migrations/20220305223212
+++ /dev/null
@@ -1 +0,0 @@
-8a0e80b6df1d942e5ec23641c935103cddd96c044e2a960b88bb38284cf4d070 \ No newline at end of file
diff --git a/db/schema_migrations/20220307192534 b/db/schema_migrations/20220307192534
deleted file mode 100644
index cf6687d88ea..00000000000
--- a/db/schema_migrations/20220307192534
+++ /dev/null
@@ -1 +0,0 @@
-b8adcc6d7dc76fd18037de9b2b204e7db8803564df19cbd59f928901c8d97b9c \ No newline at end of file
diff --git a/db/schema_migrations/20220307192610 b/db/schema_migrations/20220307192610
deleted file mode 100644
index 17575dc7174..00000000000
--- a/db/schema_migrations/20220307192610
+++ /dev/null
@@ -1 +0,0 @@
-3dd34a92230e36fe1e9761ce39e4edb2a3289c972ce56347e87d8e36818e46d1 \ No newline at end of file
diff --git a/db/schema_migrations/20220307192645 b/db/schema_migrations/20220307192645
deleted file mode 100644
index 913bbbf5c96..00000000000
--- a/db/schema_migrations/20220307192645
+++ /dev/null
@@ -1 +0,0 @@
-c31db54f15cff7b21272cc2e9e962419ba4422582c227c5af4131fe56c1fc9f8 \ No newline at end of file
diff --git a/db/schema_migrations/20220307192725 b/db/schema_migrations/20220307192725
deleted file mode 100644
index 1611c196a57..00000000000
--- a/db/schema_migrations/20220307192725
+++ /dev/null
@@ -1 +0,0 @@
-d1761614c3ac0e8bd33eff58134091ec6c1834ecde3e47290a80da45ab207923 \ No newline at end of file
diff --git a/db/schema_migrations/20220307203458 b/db/schema_migrations/20220307203458
deleted file mode 100644
index 3063be46503..00000000000
--- a/db/schema_migrations/20220307203458
+++ /dev/null
@@ -1 +0,0 @@
-d4bf5f7c695c9833a07722d724b7a6363f0ebcb7f6d8a15bcf8148bdae5e1b32 \ No newline at end of file
diff --git a/db/schema_migrations/20220307203459 b/db/schema_migrations/20220307203459
deleted file mode 100644
index 2220fd3cb61..00000000000
--- a/db/schema_migrations/20220307203459
+++ /dev/null
@@ -1 +0,0 @@
-74f6687c0793a2596467338d8b4904bef712e6ff3ad3561e3ab2546eed5cd24d \ No newline at end of file
diff --git a/db/schema_migrations/20220308000205 b/db/schema_migrations/20220308000205
deleted file mode 100644
index 27caf959eb9..00000000000
--- a/db/schema_migrations/20220308000205
+++ /dev/null
@@ -1 +0,0 @@
-c30b1b36ec83df1b4fdf0c3c28656b158beab4f2188875898182c2dfbd073c80 \ No newline at end of file
diff --git a/db/schema_migrations/20220308115219 b/db/schema_migrations/20220308115219
deleted file mode 100644
index 6e55d2fdabe..00000000000
--- a/db/schema_migrations/20220308115219
+++ /dev/null
@@ -1 +0,0 @@
-e18ed9e6b2a98c77190ff2ce33f4d2b1984710b438e851d6a526ec8bb1f33c80 \ No newline at end of file
diff --git a/db/schema_migrations/20220308115502 b/db/schema_migrations/20220308115502
deleted file mode 100644
index c379b67485c..00000000000
--- a/db/schema_migrations/20220308115502
+++ /dev/null
@@ -1 +0,0 @@
-0aacf46a4a5b430a718336108f52c1c0bed4283846f36c2ab1de80100dcae0b4 \ No newline at end of file
diff --git a/db/schema_migrations/20220309084838 b/db/schema_migrations/20220309084838
deleted file mode 100644
index ba0ae90a3cf..00000000000
--- a/db/schema_migrations/20220309084838
+++ /dev/null
@@ -1 +0,0 @@
-d9d17f94f54840eace48f210e3886423a8dc04109f2ebca8d8edb7d53e0b5688 \ No newline at end of file
diff --git a/db/schema_migrations/20220309084954 b/db/schema_migrations/20220309084954
deleted file mode 100644
index 944a1385fe7..00000000000
--- a/db/schema_migrations/20220309084954
+++ /dev/null
@@ -1 +0,0 @@
-6d9c5454372317955c4e16b5a02dece575221f15af60c33df45fffbca169c08c \ No newline at end of file
diff --git a/db/schema_migrations/20220309100648 b/db/schema_migrations/20220309100648
deleted file mode 100644
index a0697655d9a..00000000000
--- a/db/schema_migrations/20220309100648
+++ /dev/null
@@ -1 +0,0 @@
-3385dc0dc2a3d306e01a719b7a21197ea8468976d37abab932beade4780bb4ff \ No newline at end of file
diff --git a/db/schema_migrations/20220309154855 b/db/schema_migrations/20220309154855
deleted file mode 100644
index 01500ce5863..00000000000
--- a/db/schema_migrations/20220309154855
+++ /dev/null
@@ -1 +0,0 @@
-9e62675366f9c2f0fc159a9748409dbcaea240c813ab19ea26d24c966e5fd6c8 \ No newline at end of file
diff --git a/db/schema_migrations/20220310011530 b/db/schema_migrations/20220310011530
deleted file mode 100644
index 73fa8390231..00000000000
--- a/db/schema_migrations/20220310011530
+++ /dev/null
@@ -1 +0,0 @@
-a4245a3543796b48f16786e9c178f70d236b3ae4636661f021ad4e8f0c678f2c \ No newline at end of file
diff --git a/db/schema_migrations/20220310011613 b/db/schema_migrations/20220310011613
deleted file mode 100644
index fc62a04f551..00000000000
--- a/db/schema_migrations/20220310011613
+++ /dev/null
@@ -1 +0,0 @@
-ef816d9391d67a34121d11e6b6cc37de92768bd21bc301fa10c6652b1a0b66b6 \ No newline at end of file
diff --git a/db/schema_migrations/20220310095341 b/db/schema_migrations/20220310095341
deleted file mode 100644
index d52763cce63..00000000000
--- a/db/schema_migrations/20220310095341
+++ /dev/null
@@ -1 +0,0 @@
-56d906eac31954988bd0659eabbc9f1bad1a47dd616fb99e4b90b56b2bf4c6a0 \ No newline at end of file
diff --git a/db/schema_migrations/20220310101118 b/db/schema_migrations/20220310101118
deleted file mode 100644
index c87f727c8b9..00000000000
--- a/db/schema_migrations/20220310101118
+++ /dev/null
@@ -1 +0,0 @@
-e4d6111f19f05b42b51e8d066e221205460514cef88ecf15ca99aa59788c4153 \ No newline at end of file
diff --git a/db/schema_migrations/20220310134207 b/db/schema_migrations/20220310134207
deleted file mode 100644
index 3ba08608acc..00000000000
--- a/db/schema_migrations/20220310134207
+++ /dev/null
@@ -1 +0,0 @@
-951abe39e4735f0f71ac6ad1701ffa8688dfd82a59b0383d6c55cef8f6de8e7f \ No newline at end of file
diff --git a/db/schema_migrations/20220310141349 b/db/schema_migrations/20220310141349
deleted file mode 100644
index d52b2d997a4..00000000000
--- a/db/schema_migrations/20220310141349
+++ /dev/null
@@ -1 +0,0 @@
-39785d4140c7345ddbe62417576381654ce22d505ee5c92a84425f0a3f8e4935 \ No newline at end of file
diff --git a/db/schema_migrations/20220311010352 b/db/schema_migrations/20220311010352
deleted file mode 100644
index f9f4cf28605..00000000000
--- a/db/schema_migrations/20220311010352
+++ /dev/null
@@ -1 +0,0 @@
-1d1682cb14041f14f691fcf880e6446ae464645a5ccbd36687620c3279f53e25 \ No newline at end of file
diff --git a/db/schema_migrations/20220314162342 b/db/schema_migrations/20220314162342
deleted file mode 100644
index 8ee5a80c256..00000000000
--- a/db/schema_migrations/20220314162342
+++ /dev/null
@@ -1 +0,0 @@
-7992448797888fd69d1e5cd4f2602e5a2b49a57052c50b19522f37d711c9f2f2 \ No newline at end of file
diff --git a/db/schema_migrations/20220314184009 b/db/schema_migrations/20220314184009
deleted file mode 100644
index 1e00cd48937..00000000000
--- a/db/schema_migrations/20220314184009
+++ /dev/null
@@ -1 +0,0 @@
-258c7a3409aea1c713c2ddd6679de586e7548ce4d7c0811db1d4903f2794c660 \ No newline at end of file
diff --git a/db/schema_migrations/20220314184109 b/db/schema_migrations/20220314184109
deleted file mode 100644
index 60fefe61de5..00000000000
--- a/db/schema_migrations/20220314184109
+++ /dev/null
@@ -1 +0,0 @@
-85be80bb8c929d017fedfe66c1f18e4a0dbd7dd8f3b683ded60213e621ec06f4 \ No newline at end of file
diff --git a/db/schema_migrations/20220314184209 b/db/schema_migrations/20220314184209
deleted file mode 100644
index dfe5e7b5888..00000000000
--- a/db/schema_migrations/20220314184209
+++ /dev/null
@@ -1 +0,0 @@
-41e7a36164fe3b1b582149d9cfbefc6ee2ce804ac85207f918c064b0ef738b53 \ No newline at end of file
diff --git a/db/schema_migrations/20220314194009 b/db/schema_migrations/20220314194009
deleted file mode 100644
index e836855b8eb..00000000000
--- a/db/schema_migrations/20220314194009
+++ /dev/null
@@ -1 +0,0 @@
-e58b89906cd09577c1a773768e4cf3f97b870744e4ee6a323e0276895dff0de5 \ No newline at end of file
diff --git a/db/schema_migrations/20220314194149 b/db/schema_migrations/20220314194149
deleted file mode 100644
index ce025684084..00000000000
--- a/db/schema_migrations/20220314194149
+++ /dev/null
@@ -1 +0,0 @@
-2dad53754682d9d4e8338978336807255503746b82795afb812b3b65b7335ca8 \ No newline at end of file
diff --git a/db/schema_migrations/20220314204009 b/db/schema_migrations/20220314204009
deleted file mode 100644
index ac1effdd471..00000000000
--- a/db/schema_migrations/20220314204009
+++ /dev/null
@@ -1 +0,0 @@
-e2fa0265f3c14c8e6f08a4ffc4b682d8805fa634bac66c578684faaee97541cf \ No newline at end of file
diff --git a/db/schema_migrations/20220315171027 b/db/schema_migrations/20220315171027
deleted file mode 100644
index 7a4c65f3b7f..00000000000
--- a/db/schema_migrations/20220315171027
+++ /dev/null
@@ -1 +0,0 @@
-4c329622299c76ca753381f1ccc0686714d07eeee8acfc834e576d5a5addaafc \ No newline at end of file
diff --git a/db/schema_migrations/20220315171129 b/db/schema_migrations/20220315171129
deleted file mode 100644
index 1f558096664..00000000000
--- a/db/schema_migrations/20220315171129
+++ /dev/null
@@ -1 +0,0 @@
-7ca832e710026c0721ecdcd50b477073aeaf7cb795c50acd604897f85707b163 \ No newline at end of file
diff --git a/db/schema_migrations/20220315181125 b/db/schema_migrations/20220315181125
deleted file mode 100644
index 93557df54c1..00000000000
--- a/db/schema_migrations/20220315181125
+++ /dev/null
@@ -1 +0,0 @@
-1276e86db3e2922cd1535e98f17768d1ab0dd653317f918fb8e6819760893a47 \ No newline at end of file
diff --git a/db/schema_migrations/20220315181130 b/db/schema_migrations/20220315181130
deleted file mode 100644
index 17c3ceaba52..00000000000
--- a/db/schema_migrations/20220315181130
+++ /dev/null
@@ -1 +0,0 @@
-8ab13f76037450704a29220ca6af0174b373ce743620952e3bc197c952d00c1d \ No newline at end of file
diff --git a/db/schema_migrations/20220315181136 b/db/schema_migrations/20220315181136
deleted file mode 100644
index 4dfb1b1a63e..00000000000
--- a/db/schema_migrations/20220315181136
+++ /dev/null
@@ -1 +0,0 @@
-7dc3d314e76f26a539c0aa009bd45ea6ccc9c6108f798728909fd4b18e3c31b9 \ No newline at end of file
diff --git a/db/schema_migrations/20220315211043 b/db/schema_migrations/20220315211043
deleted file mode 100644
index 6fd80db768e..00000000000
--- a/db/schema_migrations/20220315211043
+++ /dev/null
@@ -1 +0,0 @@
-ae734a1ae3555a237e427dbcc0ace6c461c50cf98bc1076ca59c90b603b88c29 \ No newline at end of file
diff --git a/db/schema_migrations/20220316095126 b/db/schema_migrations/20220316095126
deleted file mode 100644
index 7530bc25a82..00000000000
--- a/db/schema_migrations/20220316095126
+++ /dev/null
@@ -1 +0,0 @@
-b2da8b0f113470d3836a361b61dc4e71b0031779b8d05af52e488bed076ebb1d \ No newline at end of file
diff --git a/db/schema_migrations/20220316102900 b/db/schema_migrations/20220316102900
deleted file mode 100644
index 877513ccf40..00000000000
--- a/db/schema_migrations/20220316102900
+++ /dev/null
@@ -1 +0,0 @@
-13acd0a862301cb5be7b9faacc02688f15e6253543fa7400c2d5f807bc254a25 \ No newline at end of file
diff --git a/db/schema_migrations/20220316102902 b/db/schema_migrations/20220316102902
deleted file mode 100644
index 56082f978d9..00000000000
--- a/db/schema_migrations/20220316102902
+++ /dev/null
@@ -1 +0,0 @@
-43afb0103ee0069087d6476f5c0f617db5fdb2de3cd583762967e43d5a3a1138 \ No newline at end of file
diff --git a/db/schema_migrations/20220316112118 b/db/schema_migrations/20220316112118
deleted file mode 100644
index da38f5f9fef..00000000000
--- a/db/schema_migrations/20220316112118
+++ /dev/null
@@ -1 +0,0 @@
-659accb8efe0223028a74346ecf3aa5b649cda825ac7941bc932bc1d7e6f8d9a \ No newline at end of file
diff --git a/db/schema_migrations/20220316112206 b/db/schema_migrations/20220316112206
deleted file mode 100644
index 5605ebf34b9..00000000000
--- a/db/schema_migrations/20220316112206
+++ /dev/null
@@ -1 +0,0 @@
-d24c5a5414e44385a132e8f342cb67cc5a7c5fe4bfcc4c15c473397076350bc2 \ No newline at end of file
diff --git a/db/schema_migrations/20220316165539 b/db/schema_migrations/20220316165539
deleted file mode 100644
index a4a94a4c957..00000000000
--- a/db/schema_migrations/20220316165539
+++ /dev/null
@@ -1 +0,0 @@
-beeab3a2197f11a40049e983a5184ab9b80370c9867461239e12a5ce36b8f5e8 \ No newline at end of file
diff --git a/db/schema_migrations/20220316202200 b/db/schema_migrations/20220316202200
deleted file mode 100644
index 62c236a6b67..00000000000
--- a/db/schema_migrations/20220316202200
+++ /dev/null
@@ -1 +0,0 @@
-28722182d4ead079c8c0c36a5c075a29c5da93b4315af277311f561fc945d65f \ No newline at end of file
diff --git a/db/schema_migrations/20220316202402 b/db/schema_migrations/20220316202402
deleted file mode 100644
index b450772ac80..00000000000
--- a/db/schema_migrations/20220316202402
+++ /dev/null
@@ -1 +0,0 @@
-006ef4f0c63e39e3874d39528ca6cfd233c17d6256d07bd2c0e7b2262d0a4825 \ No newline at end of file
diff --git a/db/schema_migrations/20220316202640 b/db/schema_migrations/20220316202640
deleted file mode 100644
index dad19b94335..00000000000
--- a/db/schema_migrations/20220316202640
+++ /dev/null
@@ -1 +0,0 @@
-7ea2288c45d497e2fde56b1d7c1e82360ed40442a2501a24e9795380adf5b911 \ No newline at end of file
diff --git a/db/schema_migrations/20220317161914 b/db/schema_migrations/20220317161914
deleted file mode 100644
index 7cefac33187..00000000000
--- a/db/schema_migrations/20220317161914
+++ /dev/null
@@ -1 +0,0 @@
-94a8bc74fc935ba863d22b59b0ac6808bf5a9714c3759ca75a6dbee50c3c647d \ No newline at end of file
diff --git a/db/schema_migrations/20220317170122 b/db/schema_migrations/20220317170122
deleted file mode 100644
index 9b75fa2042a..00000000000
--- a/db/schema_migrations/20220317170122
+++ /dev/null
@@ -1 +0,0 @@
-0bd78ce207cca13b5c4557ace87c135972ed69cd05ee8c6fcc60a9c060ba8b5f \ No newline at end of file
diff --git a/db/schema_migrations/20220318111040 b/db/schema_migrations/20220318111040
deleted file mode 100644
index ac1207e7f00..00000000000
--- a/db/schema_migrations/20220318111040
+++ /dev/null
@@ -1 +0,0 @@
-5da6020c9e4cca8659b45393812ee4d76f6e9422803acaadd8c1b046be8c647a \ No newline at end of file
diff --git a/db/schema_migrations/20220318111729 b/db/schema_migrations/20220318111729
deleted file mode 100644
index 587a1bb6f19..00000000000
--- a/db/schema_migrations/20220318111729
+++ /dev/null
@@ -1 +0,0 @@
-748ab129352d12d40e5d97dfb8a658ff2d62642e9f5cb1deb19ed871328f9d07 \ No newline at end of file
diff --git a/db/schema_migrations/20220318111949 b/db/schema_migrations/20220318111949
deleted file mode 100644
index 8923f51813e..00000000000
--- a/db/schema_migrations/20220318111949
+++ /dev/null
@@ -1 +0,0 @@
-416ff5e57b2b13ccb55c6f1e88e6b0603dfc086a8a15be810752a9449ed4f3a1 \ No newline at end of file
diff --git a/db/schema_migrations/20220318120802 b/db/schema_migrations/20220318120802
deleted file mode 100644
index a306b3cdcd7..00000000000
--- a/db/schema_migrations/20220318120802
+++ /dev/null
@@ -1 +0,0 @@
-19f25b2f373e7c2799812661baca1902c9c74df67f7a5e88116862fb078a5957 \ No newline at end of file
diff --git a/db/schema_migrations/20220318141037 b/db/schema_migrations/20220318141037
deleted file mode 100644
index e2451a42392..00000000000
--- a/db/schema_migrations/20220318141037
+++ /dev/null
@@ -1 +0,0 @@
-d9a9d143ff553cbad5eb32a908370133549850f10b27b30eb6a1bde686054c45 \ No newline at end of file
diff --git a/db/schema_migrations/20220321025720 b/db/schema_migrations/20220321025720
deleted file mode 100644
index 4180969ecf4..00000000000
--- a/db/schema_migrations/20220321025720
+++ /dev/null
@@ -1 +0,0 @@
-b1d67334e1e52a24b3ea45d1520878dac7ea6dd7fba61d966e4311212993ee77 \ No newline at end of file
diff --git a/db/schema_migrations/20220321150028 b/db/schema_migrations/20220321150028
deleted file mode 100644
index c041b880941..00000000000
--- a/db/schema_migrations/20220321150028
+++ /dev/null
@@ -1 +0,0 @@
-0e8c43f8878152e355a435dc0c72874b9808aba376e6969bec85a33ec5c01b1c \ No newline at end of file
diff --git a/db/schema_migrations/20220321201912 b/db/schema_migrations/20220321201912
deleted file mode 100644
index 78d3857dba8..00000000000
--- a/db/schema_migrations/20220321201912
+++ /dev/null
@@ -1 +0,0 @@
-b9460a2962364ae836237382b84257f30673ffbe682a58776d6aaeab8f28f67d \ No newline at end of file
diff --git a/db/schema_migrations/20220321234317 b/db/schema_migrations/20220321234317
deleted file mode 100644
index 7b24f81ca1c..00000000000
--- a/db/schema_migrations/20220321234317
+++ /dev/null
@@ -1 +0,0 @@
-ba5c1738b7c368ee8e10e390c959538c4d74055b8bc57f652b06ffe3a1c3becf \ No newline at end of file
diff --git a/db/schema_migrations/20220322023800 b/db/schema_migrations/20220322023800
deleted file mode 100644
index 99e5cbfa7c3..00000000000
--- a/db/schema_migrations/20220322023800
+++ /dev/null
@@ -1 +0,0 @@
-1aefb5950063a060de1ec20b0808a5488b238b36d86120c34ac5a128c212984e \ No newline at end of file
diff --git a/db/schema_migrations/20220322035654 b/db/schema_migrations/20220322035654
deleted file mode 100644
index 3a427590546..00000000000
--- a/db/schema_migrations/20220322035654
+++ /dev/null
@@ -1 +0,0 @@
-b37315953ac3cdc6d75f5287a4c264ebdee932f19cfe975f5d2c57b353da35d9 \ No newline at end of file
diff --git a/db/schema_migrations/20220322071127 b/db/schema_migrations/20220322071127
deleted file mode 100644
index 0f7ddb48545..00000000000
--- a/db/schema_migrations/20220322071127
+++ /dev/null
@@ -1 +0,0 @@
-c7d84b6d92566d66f69732071fe7fc6c4e5ce32475e0d2c42413c9f005aed5b0 \ No newline at end of file
diff --git a/db/schema_migrations/20220322094410 b/db/schema_migrations/20220322094410
deleted file mode 100644
index 1ad1682e22c..00000000000
--- a/db/schema_migrations/20220322094410
+++ /dev/null
@@ -1 +0,0 @@
-09722b398f82651c433f6b05962827351e6e7c0841f2a6414feb206bb831e523 \ No newline at end of file
diff --git a/db/schema_migrations/20220322132242 b/db/schema_migrations/20220322132242
deleted file mode 100644
index f21f62874a7..00000000000
--- a/db/schema_migrations/20220322132242
+++ /dev/null
@@ -1 +0,0 @@
-94dbae9bbfb2da49a0d20b674e15f457c613c8ba0612603dd8fe9ac5699160d1 \ No newline at end of file
diff --git a/db/schema_migrations/20220322143441 b/db/schema_migrations/20220322143441
deleted file mode 100644
index 21176059ea3..00000000000
--- a/db/schema_migrations/20220322143441
+++ /dev/null
@@ -1 +0,0 @@
-caf0959c3cefb1a3614867feb2c93115fc2b41890624afa0944dc9cfbfdecd59 \ No newline at end of file
diff --git a/db/schema_migrations/20220322205004 b/db/schema_migrations/20220322205004
deleted file mode 100644
index 3a5e26a69ce..00000000000
--- a/db/schema_migrations/20220322205004
+++ /dev/null
@@ -1 +0,0 @@
-af69da66a3deb250494204fecf4bc91b4fd10f529ab766746ae98072f54bf245 \ No newline at end of file
diff --git a/db/schema_migrations/20220322205008 b/db/schema_migrations/20220322205008
deleted file mode 100644
index bbd0003fbf3..00000000000
--- a/db/schema_migrations/20220322205008
+++ /dev/null
@@ -1 +0,0 @@
-465de916b1c951287a101da37156fb0f59a4bd1cb4ab7076dc48e07e326fa4e4 \ No newline at end of file
diff --git a/db/schema_migrations/20220323023800 b/db/schema_migrations/20220323023800
deleted file mode 100644
index ff735118ede..00000000000
--- a/db/schema_migrations/20220323023800
+++ /dev/null
@@ -1 +0,0 @@
-1681c19d1f41a05c3dfeded70d128989afb4a81a2e04aacc8879c2c1ab766733 \ No newline at end of file
diff --git a/db/schema_migrations/20220323130000 b/db/schema_migrations/20220323130000
deleted file mode 100644
index a370ab82750..00000000000
--- a/db/schema_migrations/20220323130000
+++ /dev/null
@@ -1 +0,0 @@
-6152ff1a3647e1ac26e8f462215a0dec7d96c5552373f4ad99424c7c74e80577 \ No newline at end of file
diff --git a/db/schema_migrations/20220323152202 b/db/schema_migrations/20220323152202
deleted file mode 100644
index 0394218868d..00000000000
--- a/db/schema_migrations/20220323152202
+++ /dev/null
@@ -1 +0,0 @@
-47b87d4ea5d081904d561e461a266fe20dfcc1f771126340cf14c84302d3383d \ No newline at end of file
diff --git a/db/schema_migrations/20220324032250 b/db/schema_migrations/20220324032250
deleted file mode 100644
index ef37a8ff223..00000000000
--- a/db/schema_migrations/20220324032250
+++ /dev/null
@@ -1 +0,0 @@
-fcfead40cfa1d75303bd0d392c09b5b0399ce5163e7ad6f8650360fe3adbe85d \ No newline at end of file
diff --git a/db/schema_migrations/20220324081709 b/db/schema_migrations/20220324081709
deleted file mode 100644
index f34f2b7aaaa..00000000000
--- a/db/schema_migrations/20220324081709
+++ /dev/null
@@ -1 +0,0 @@
-6ce75a41607ed1e60ea4ecdfb36703d9f4192dc26ecaa774f2c30818027dd1d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220324110247 b/db/schema_migrations/20220324110247
deleted file mode 100644
index 0bfc9ff4e4e..00000000000
--- a/db/schema_migrations/20220324110247
+++ /dev/null
@@ -1 +0,0 @@
-35aaf03898795800027c814a6f907af6f011bd5095cae7188234b46f4b2ebb90 \ No newline at end of file
diff --git a/db/schema_migrations/20220324171254 b/db/schema_migrations/20220324171254
deleted file mode 100644
index df966fd5300..00000000000
--- a/db/schema_migrations/20220324171254
+++ /dev/null
@@ -1 +0,0 @@
-610c5ded785f174d195a660062bb74e718bfd5a38b13773215e20e8f95c59da4 \ No newline at end of file
diff --git a/db/schema_migrations/20220324173554 b/db/schema_migrations/20220324173554
deleted file mode 100644
index 8292460972f..00000000000
--- a/db/schema_migrations/20220324173554
+++ /dev/null
@@ -1 +0,0 @@
-9f597a462768531b0c6ad23e6e1a52edb765724518e1cebc0684160b030d6225 \ No newline at end of file
diff --git a/db/schema_migrations/20220324175325 b/db/schema_migrations/20220324175325
deleted file mode 100644
index e68c820a8f8..00000000000
--- a/db/schema_migrations/20220324175325
+++ /dev/null
@@ -1 +0,0 @@
-8f423af68f25fb58374321eb38ff830fc47237005a23a66f61d5b794d519ef58 \ No newline at end of file
diff --git a/db/schema_migrations/20220324180717 b/db/schema_migrations/20220324180717
deleted file mode 100644
index b9bac081bcc..00000000000
--- a/db/schema_migrations/20220324180717
+++ /dev/null
@@ -1 +0,0 @@
-56706c8d4139c63427838d37b7120c57fd39c7be4caee0ebba39a05cd3c453f7 \ No newline at end of file
diff --git a/db/schema_migrations/20220325000000 b/db/schema_migrations/20220325000000
deleted file mode 100644
index 97f93ef57c7..00000000000
--- a/db/schema_migrations/20220325000000
+++ /dev/null
@@ -1 +0,0 @@
-fd738cf8a5642f96dc67a294dcf913d797b580a19f35d5ef76573c63bf2dd920 \ No newline at end of file
diff --git a/db/schema_migrations/20220325000001 b/db/schema_migrations/20220325000001
deleted file mode 100644
index aa258196cb3..00000000000
--- a/db/schema_migrations/20220325000001
+++ /dev/null
@@ -1 +0,0 @@
-d9ad9c043faf278e33707baeccb5b7733aec408446b3dacf685e126309c4808c \ No newline at end of file
diff --git a/db/schema_migrations/20220325050642 b/db/schema_migrations/20220325050642
deleted file mode 100644
index 74a3205e5bf..00000000000
--- a/db/schema_migrations/20220325050642
+++ /dev/null
@@ -1 +0,0 @@
-9ce5b7640c5d0c0e7cab0d12600b8378efb6a68922a361b0bee5617a69c3ee53 \ No newline at end of file
diff --git a/db/schema_migrations/20220325155953 b/db/schema_migrations/20220325155953
deleted file mode 100644
index 408f1230a38..00000000000
--- a/db/schema_migrations/20220325155953
+++ /dev/null
@@ -1 +0,0 @@
-bbcd27340d9d684b6134292772dad6f523ce6e1af9853ce12284a0c138d6b7bd \ No newline at end of file
diff --git a/db/schema_migrations/20220325160153 b/db/schema_migrations/20220325160153
deleted file mode 100644
index f1894bb1cab..00000000000
--- a/db/schema_migrations/20220325160153
+++ /dev/null
@@ -1 +0,0 @@
-7f33fc1c6b47e3ff732caa62d15f0d725c03d993eacb24bc603992fc2579e63c \ No newline at end of file
diff --git a/db/schema_migrations/20220326161803 b/db/schema_migrations/20220326161803
deleted file mode 100644
index 9d4fc7eb173..00000000000
--- a/db/schema_migrations/20220326161803
+++ /dev/null
@@ -1 +0,0 @@
-c051ced08a5879ac1dc35d06509df91bdb0d26026cde127dc5ca4f905cb6a9fa \ No newline at end of file
diff --git a/db/schema_migrations/20220326163653 b/db/schema_migrations/20220326163653
deleted file mode 100644
index 8f3cd7eb9b1..00000000000
--- a/db/schema_migrations/20220326163653
+++ /dev/null
@@ -1 +0,0 @@
-112902ff530b1a4e34362845d9a521d320f4049bbd7992e8b3c2b2418d35100c \ No newline at end of file
diff --git a/db/schema_migrations/20220329061545 b/db/schema_migrations/20220329061545
deleted file mode 100644
index 7d85c06978f..00000000000
--- a/db/schema_migrations/20220329061545
+++ /dev/null
@@ -1 +0,0 @@
-29dfbf020302789f70365a69db5cbc24b9030f0be81666833c0ca8a4a8b1a681 \ No newline at end of file
diff --git a/db/schema_migrations/20220329095632 b/db/schema_migrations/20220329095632
deleted file mode 100644
index ba27739ccf7..00000000000
--- a/db/schema_migrations/20220329095632
+++ /dev/null
@@ -1 +0,0 @@
-19ab6c5663ec07c7f4bdd92bf6d38e36766b27e6d0f0460f929a71b5e20fa396 \ No newline at end of file
diff --git a/db/schema_migrations/20220329110630 b/db/schema_migrations/20220329110630
deleted file mode 100644
index 01087e9bfb2..00000000000
--- a/db/schema_migrations/20220329110630
+++ /dev/null
@@ -1 +0,0 @@
-47664025bee8b3728411bde53aa597cb962d859402b0504a1962a3e4f117782f \ No newline at end of file
diff --git a/db/schema_migrations/20220329175119 b/db/schema_migrations/20220329175119
deleted file mode 100644
index 5e0c0306594..00000000000
--- a/db/schema_migrations/20220329175119
+++ /dev/null
@@ -1 +0,0 @@
-ec5dfe48e13cdbce5fc0c67612cddf1a5b555b3c84e1869ee3a7f047f0f3f1a0 \ No newline at end of file
diff --git a/db/schema_migrations/20220331074722 b/db/schema_migrations/20220331074722
deleted file mode 100644
index e4953322653..00000000000
--- a/db/schema_migrations/20220331074722
+++ /dev/null
@@ -1 +0,0 @@
-507f2d64f0810938aba75f993bb7d6216499a754652b0b4c0ee2d0d44fdc3af3 \ No newline at end of file
diff --git a/db/schema_migrations/20220331174026 b/db/schema_migrations/20220331174026
deleted file mode 100644
index e4bf269e4e7..00000000000
--- a/db/schema_migrations/20220331174026
+++ /dev/null
@@ -1 +0,0 @@
-b4f2c1c90447a41d69f08ca2c5cbb5fb0baf1fe04e43d5dc86323d01be9e28ef \ No newline at end of file
diff --git a/db/schema_migrations/20220331174459 b/db/schema_migrations/20220331174459
deleted file mode 100644
index f2f3dcfd778..00000000000
--- a/db/schema_migrations/20220331174459
+++ /dev/null
@@ -1 +0,0 @@
-cc7da5bba5fd42a0c443290791eeee76491a29ab37a06f0a70806dc09ec1ceab \ No newline at end of file
diff --git a/db/schema_migrations/20220401044858 b/db/schema_migrations/20220401044858
deleted file mode 100644
index dcdbfc57822..00000000000
--- a/db/schema_migrations/20220401044858
+++ /dev/null
@@ -1 +0,0 @@
-7d9341440faaf8782bc47a24091148c40d635cc1c980a57999b47aff3d42806d \ No newline at end of file
diff --git a/db/schema_migrations/20220401045116 b/db/schema_migrations/20220401045116
deleted file mode 100644
index 3d6aa17ac69..00000000000
--- a/db/schema_migrations/20220401045116
+++ /dev/null
@@ -1 +0,0 @@
-1f91d4855c6be0d7baf19f3d63d2efb4ccd8da85a7dcc4ad57fd03891f12fe46 \ No newline at end of file
diff --git a/db/schema_migrations/20220401045621 b/db/schema_migrations/20220401045621
deleted file mode 100644
index 0502ad324da..00000000000
--- a/db/schema_migrations/20220401045621
+++ /dev/null
@@ -1 +0,0 @@
-9a2274c54a0c0393bf0a2ae7985b957364c63952273383c3aa6ff6c5b4655a42 \ No newline at end of file
diff --git a/db/schema_migrations/20220401045642 b/db/schema_migrations/20220401045642
deleted file mode 100644
index cd1a7fee28e..00000000000
--- a/db/schema_migrations/20220401045642
+++ /dev/null
@@ -1 +0,0 @@
-5eabeb19a1b79c21333eb519cf7419c5424cf1270c97637d07bb2a09946ceaf0 \ No newline at end of file
diff --git a/db/schema_migrations/20220401110443 b/db/schema_migrations/20220401110443
deleted file mode 100644
index 30cc8592140..00000000000
--- a/db/schema_migrations/20220401110443
+++ /dev/null
@@ -1 +0,0 @@
-c35e6149ee37321cd446284a2f0405378f3e34e3c9d11b7d128e9afa6c83281d \ No newline at end of file
diff --git a/db/schema_migrations/20220401110511 b/db/schema_migrations/20220401110511
deleted file mode 100644
index f0098be6e8e..00000000000
--- a/db/schema_migrations/20220401110511
+++ /dev/null
@@ -1 +0,0 @@
-f5c934c691b50bff8c4029a975e37e86177cdb24b10bb65be2edd5bda50938b0 \ No newline at end of file
diff --git a/db/schema_migrations/20220401113123 b/db/schema_migrations/20220401113123
deleted file mode 100644
index 58aea29c19c..00000000000
--- a/db/schema_migrations/20220401113123
+++ /dev/null
@@ -1 +0,0 @@
-4ffb630e2949769c0ad64d43c2f8b6ad432358c44b00da99ec8ce538bb245e1a \ No newline at end of file
diff --git a/db/schema_migrations/20220404114106 b/db/schema_migrations/20220404114106
deleted file mode 100644
index a0680df974f..00000000000
--- a/db/schema_migrations/20220404114106
+++ /dev/null
@@ -1 +0,0 @@
-6da0e999ab7bed0f9ee7a7938c9fa9ce4619d554640aa2d387f90e42d880db30 \ No newline at end of file
diff --git a/db/schema_migrations/20220404170446 b/db/schema_migrations/20220404170446
deleted file mode 100644
index e9a11c9e114..00000000000
--- a/db/schema_migrations/20220404170446
+++ /dev/null
@@ -1 +0,0 @@
-f3954f6f741e40abb1ff9595f86f896e653eb14943faccfe2a14520ec583fa9c \ No newline at end of file
diff --git a/db/schema_migrations/20220404183350 b/db/schema_migrations/20220404183350
deleted file mode 100644
index 0d7dffd3e79..00000000000
--- a/db/schema_migrations/20220404183350
+++ /dev/null
@@ -1 +0,0 @@
-fcf7a6569afb7fdb95834179df5632ad14165d27476eb020e9db07e504f75f32 \ No newline at end of file
diff --git a/db/schema_migrations/20220404184814 b/db/schema_migrations/20220404184814
deleted file mode 100644
index 81e413793e1..00000000000
--- a/db/schema_migrations/20220404184814
+++ /dev/null
@@ -1 +0,0 @@
-f8013613d3ef44ea94db805d1900e7796204eefe373d42151cfe8acd4948a608 \ No newline at end of file
diff --git a/db/schema_migrations/20220404194649 b/db/schema_migrations/20220404194649
deleted file mode 100644
index 4b6cc920cd6..00000000000
--- a/db/schema_migrations/20220404194649
+++ /dev/null
@@ -1 +0,0 @@
-7897da66c2a941a6a09db6f62fa9069caef235603663077e5dd342a72ac5c7c3 \ No newline at end of file
diff --git a/db/schema_migrations/20220405061122 b/db/schema_migrations/20220405061122
deleted file mode 100644
index c89ea9d692f..00000000000
--- a/db/schema_migrations/20220405061122
+++ /dev/null
@@ -1 +0,0 @@
-2b20f2c3bb8dd5d3ba27dcb8854108763a40be9393f4799f16e9c10daf9fff75 \ No newline at end of file
diff --git a/db/schema_migrations/20220405125459 b/db/schema_migrations/20220405125459
deleted file mode 100644
index 1ed46eff43e..00000000000
--- a/db/schema_migrations/20220405125459
+++ /dev/null
@@ -1 +0,0 @@
-c4dcb2b2e1262d63c56e171796f1cb6fb76d4b7dc090cf585f17a451c2fa784f \ No newline at end of file
diff --git a/db/schema_migrations/20220405181814 b/db/schema_migrations/20220405181814
deleted file mode 100644
index 296cf6efc8b..00000000000
--- a/db/schema_migrations/20220405181814
+++ /dev/null
@@ -1 +0,0 @@
-0835eaaf3e355f98783a11098a37b894b581176d98c39cdfd3be44e2447fe232 \ No newline at end of file
diff --git a/db/schema_migrations/20220405203843 b/db/schema_migrations/20220405203843
deleted file mode 100644
index 10b831aebb8..00000000000
--- a/db/schema_migrations/20220405203843
+++ /dev/null
@@ -1 +0,0 @@
-ac1892c5f2131e41774cadc8799cb5fb2c7d36fe567850fc1251a23c2d454695 \ No newline at end of file
diff --git a/db/schema_migrations/20220406113217 b/db/schema_migrations/20220406113217
deleted file mode 100644
index 1fb61b081a4..00000000000
--- a/db/schema_migrations/20220406113217
+++ /dev/null
@@ -1 +0,0 @@
-161ba8db7400c12dc0550246af8db86487e811803eaecedcb2761f4a8349920b \ No newline at end of file
diff --git a/db/schema_migrations/20220406121831 b/db/schema_migrations/20220406121831
deleted file mode 100644
index 20f22d3deab..00000000000
--- a/db/schema_migrations/20220406121831
+++ /dev/null
@@ -1 +0,0 @@
-687ba844d775918956f16dee16548f0440506e66e91afd5f52410066ffd5e364 \ No newline at end of file
diff --git a/db/schema_migrations/20220407135820 b/db/schema_migrations/20220407135820
deleted file mode 100644
index c1d1f8a5891..00000000000
--- a/db/schema_migrations/20220407135820
+++ /dev/null
@@ -1 +0,0 @@
-ab7bb319a7099714d9863ec16b7dcf8c1aeab495b8635a01dff4a51fab876b6b \ No newline at end of file
diff --git a/db/schema_migrations/20220408001450 b/db/schema_migrations/20220408001450
deleted file mode 100644
index 4d588db09e8..00000000000
--- a/db/schema_migrations/20220408001450
+++ /dev/null
@@ -1 +0,0 @@
-42d7864cdcec589b7de8bc3a872e2743496d81788a60ddcd213f049fda12474e \ No newline at end of file
diff --git a/db/schema_migrations/20220408135815 b/db/schema_migrations/20220408135815
deleted file mode 100644
index 3a41e4a5420..00000000000
--- a/db/schema_migrations/20220408135815
+++ /dev/null
@@ -1 +0,0 @@
-01d8ab924e8c76b54d316ba94089eabea28999e4ce747e6c51803e1ea97b37df \ No newline at end of file
diff --git a/db/schema_migrations/20220409160628 b/db/schema_migrations/20220409160628
deleted file mode 100644
index 29b46427dd2..00000000000
--- a/db/schema_migrations/20220409160628
+++ /dev/null
@@ -1 +0,0 @@
-7952024a6a8df98842fa23ca9a4c328b83816ded3071e7597dbab431a5561e1a \ No newline at end of file
diff --git a/db/schema_migrations/20220412044906 b/db/schema_migrations/20220412044906
deleted file mode 100644
index a86fcfead61..00000000000
--- a/db/schema_migrations/20220412044906
+++ /dev/null
@@ -1 +0,0 @@
-1d6ed98ad2da7be75e09d853db86905ed1fb1847d387cc6d1980ff5516db06d9 \ No newline at end of file
diff --git a/db/schema_migrations/20220412143551 b/db/schema_migrations/20220412143551
deleted file mode 100644
index 8f9ce590f4c..00000000000
--- a/db/schema_migrations/20220412143551
+++ /dev/null
@@ -1 +0,0 @@
-beff437160d30bc0cb6577e5b88edb751f1325b316534010844e053a567906ff \ No newline at end of file
diff --git a/db/schema_migrations/20220412143552 b/db/schema_migrations/20220412143552
deleted file mode 100644
index 286c6d86cbd..00000000000
--- a/db/schema_migrations/20220412143552
+++ /dev/null
@@ -1 +0,0 @@
-6211f4f1e2708606aa68c139639acdb366cd1f8e4be225800a2e49888f420498 \ No newline at end of file
diff --git a/db/schema_migrations/20220412171810 b/db/schema_migrations/20220412171810
deleted file mode 100644
index 377f268f697..00000000000
--- a/db/schema_migrations/20220412171810
+++ /dev/null
@@ -1 +0,0 @@
-efba00e36821c5ebe92ba39ad40dd165ab46c97b1b18becdec0d192470c2e8ca \ No newline at end of file
diff --git a/db/schema_migrations/20220413011328 b/db/schema_migrations/20220413011328
deleted file mode 100644
index 3cf51735e27..00000000000
--- a/db/schema_migrations/20220413011328
+++ /dev/null
@@ -1 +0,0 @@
-442300bd5c2f05807bdf752a9c3280a11f1cc84b21c2d61d99fb73268f7a495f \ No newline at end of file
diff --git a/db/schema_migrations/20220413075921 b/db/schema_migrations/20220413075921
deleted file mode 100644
index ef26fb07cd6..00000000000
--- a/db/schema_migrations/20220413075921
+++ /dev/null
@@ -1 +0,0 @@
-b3e580387d56847039c4030fbbbda1131016ef6b068ff60f2e4e48563a331051 \ No newline at end of file
diff --git a/db/schema_migrations/20220507204024 b/db/schema_migrations/20220507204024
deleted file mode 100644
index 510badf30ea..00000000000
--- a/db/schema_migrations/20220507204024
+++ /dev/null
@@ -1 +0,0 @@
-8014dcf24ac2f1171240daa349e0552cb313b06f756b84e09a16d76a8810132a \ No newline at end of file
diff --git a/db/schema_migrations/20220520120637 b/db/schema_migrations/20220520120637
deleted file mode 100644
index f379ef0d581..00000000000
--- a/db/schema_migrations/20220520120637
+++ /dev/null
@@ -1 +0,0 @@
-1fdb60b1c72b687aa8bede083ac7038097d538dc815e334d74296b1d39c2acb8 \ No newline at end of file
diff --git a/db/schema_migrations/20220525084153 b/db/schema_migrations/20220525084153
deleted file mode 100644
index dbf7eaa0c93..00000000000
--- a/db/schema_migrations/20220525084153
+++ /dev/null
@@ -1 +0,0 @@
-1f03beba0775e2a4eead512819592f590b02b70096cee250dfcdf426440cb5f5 \ No newline at end of file
diff --git a/doc/administration/server_hooks.md b/doc/administration/server_hooks.md
index a205e5a4a6f..4d262704209 100644
--- a/doc/administration/server_hooks.md
+++ b/doc/administration/server_hooks.md
@@ -34,6 +34,7 @@ alternatives to server hooks include:
:::TabTitle GitLab 15.11 and later
> [Introduced](https://gitlab.com/gitlab-org/gitaly/-/issues/4629) in GitLab 15.11, `hooks set` command replaces direct file system access.
+> [Introduced](https://gitlab.com/gitlab-org/gitaly/-/issues/4629) in GitLab 15.11, `hooks set` command replaces direct file system access. Existing Git hooks don't need migrating for the `hooks set` command.
Prerequisites:
diff --git a/doc/development/api_styleguide.md b/doc/development/api_styleguide.md
index 0652b88617b..566267b97f1 100644
--- a/doc/development/api_styleguide.md
+++ b/doc/development/api_styleguide.md
@@ -303,7 +303,7 @@ from the server to the platform if we identify invalid parameters at the beginni
If you need to add a custom validator, it would be added to
it's own file in the [`validators`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/api/validations/validators) directory.
Since we use [Grape](https://github.com/ruby-grape/grape) to add our API
-we inherit from the `Grape::Validations::Base` class in our validator class.
+we inherit from the `Grape::Validations::Validators::Base` class in our validator class.
Now, all you have to do is define the `validate_param!` method which takes
in two parameters: the `params` hash and the `param` name to validate.
diff --git a/doc/development/contributing/index.md b/doc/development/contributing/index.md
index 17e45f8c96d..eb26ddbd9e9 100644
--- a/doc/development/contributing/index.md
+++ b/doc/development/contributing/index.md
@@ -61,7 +61,7 @@ To write and test your code, you will use the GitLab Development Kit.
- To run a pre-configured GDK instance in the cloud, use [GDK with Gitpod](../../integration/gitpod.md).
From a project repository:
- 1. On the top bar, select **Main menu > Projects** and find your project.
+ 1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
1. In the upper right, select **Edit > Gitpod**.
1. If you want to contribute to the [website](https://about.gitlab.com/) or the [handbook](https://about.gitlab.com/handbook/),
go to the footer of any page and select **Edit in Web IDE** to open the [Web IDE](../../user/project/web_ide/index.md).
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index 49a68a1c105..0bbd679abe5 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -525,8 +525,8 @@ Instead of:
However, you can make an exception when you are writing a task and you need to refer to all
of the fields at once. For example:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > CI/CD**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > CI/CD**.
1. Expand **General pipelines**.
1. Complete the fields.
@@ -1249,7 +1249,7 @@ to the GitLab [reference architectures](../../../administration/reference_archit
## search
-When you search, you type a string in the search box on the top bar.
+When you search, you type a string in the search box on the left sidebar.
The search results are displayed on a search page.
Searching is different from [filtering](#filter).
diff --git a/doc/development/documentation/topic_types/task.md b/doc/development/documentation/topic_types/task.md
index 2ddfd841ec3..87ce4d770f5 100644
--- a/doc/development/documentation/topic_types/task.md
+++ b/doc/development/documentation/topic_types/task.md
@@ -43,13 +43,13 @@ Prerequisites:
To create an issue:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Issues > List**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Plan > Issues**.
1. In the upper-right corner, select **New issue**.
1. Complete the fields. (If you have reference content that lists each field, link to it here.)
1. Select **Create issue**.
-The issue is created. You can view it by going to **Issues > List**.
+The issue is created. You can view it by going to **Plan > Issues**.
```
## Task topic titles
diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md
index f81486d17a8..aeb9739ecb3 100644
--- a/doc/development/ee_features.md
+++ b/doc/development/ee_features.md
@@ -49,13 +49,16 @@ version of the product:
1. Enable **Allow use of licensed EE features** to make licensed EE features available to projects
only if the project namespace's plan includes the feature.
- 1. Visit **Admin > Settings > General**.
+ 1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+ 1. Select **Admin Area**.
+ 1. On the left sidebar, select **Settings > General**.
1. Expand **Account and limit**.
1. Select the **Allow use of licensed EE features** checkbox.
1. Select **Save changes**.
1. Ensure the group you want to test the EE feature for is actually using an EE plan:
- 1. On the top bar, select **Main menu > Admin**.
+ 1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+ 1. Select **Admin Area**.
1. On the left sidebar, select **Overview > Groups**.
1. Identify the group you want to modify, and select **Edit**.
1. Scroll to **Permissions and group features**. For **Plan**, select `Ultimate`.
diff --git a/doc/development/integrations/jenkins.md b/doc/development/integrations/jenkins.md
index 43487486f97..65194a04a62 100644
--- a/doc/development/integrations/jenkins.md
+++ b/doc/development/integrations/jenkins.md
@@ -24,7 +24,8 @@ brew services start jenkins
GitLab does not allow requests to localhost or the local network by default. When running Jenkins on your local machine, you need to enable local access.
1. Log into your GitLab instance as an administrator.
-1. On the top bar, select **Main menu > Admin**.
+1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+1. Select **Admin Area**.
1. On the left sidebar, select **Settings > Network**.
1. Expand **Outbound requests**, and select the following checkboxes:
diff --git a/doc/development/service_ping/troubleshooting.md b/doc/development/service_ping/troubleshooting.md
index 57c4408ca84..2706f570869 100644
--- a/doc/development/service_ping/troubleshooting.md
+++ b/doc/development/service_ping/troubleshooting.md
@@ -56,9 +56,10 @@ checking the configuration file of your GitLab instance:
- Using the Admin Area:
- 1. On the top bar, select **Main menu > Admin**.
+ 1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+ 1. Select **Admin Area**.
1. On the left sidebar, select **Settings > Metrics and profiling**.
- 1. Expand **Usage Statistics**.
+ 1. Expand **Usage statistics**.
1. Are you able to check or uncheck the checkbox to disable Service Ping?
- If _yes_, your GitLab instance is not affected by this bug.
@@ -113,9 +114,10 @@ To work around this bug, you have two options:
sudo gitlab-ctl reconfigure
```
- 1. In GitLab, on the top bar, select **Main menu > Admin**.
+ 1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+ 1. Select **Admin Area**.
1. On the left sidebar, select **Settings > Metrics and profiling**.
- 1. Expand **Usage Statistics**.
+ 1. Expand **Usage statistics**.
1. Clear the **Enable Service Ping** checkbox.
1. Select **Save Changes**.
diff --git a/doc/development/snowplow/implementation.md b/doc/development/snowplow/implementation.md
index 839d96929a1..2661df8afd8 100644
--- a/doc/development/snowplow/implementation.md
+++ b/doc/development/snowplow/implementation.md
@@ -87,7 +87,7 @@ The following example shows `data-track-*` attributes assigned to a button:
| Attribute | Required | Description |
|:----------------------|:---------|:------------|
| `data-track-action` | true | Action the user is taking. Clicks must be prepended with `click` and activations must be prepended with `activate`. For example, focusing a form field is `activate_form_input` and clicking a button is `click_button`. Replaces `data-track-event`, which was [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/290962) in GitLab 13.11. |
-| `data-track-label` | false | The specific element or object to act on. This can be: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list in the top bar; or the name or title attribute of a record being created. |
+| `data-track-label` | false | The specific element or object to act on. This can be: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list; or the name or title attribute of a record being created. |
| `data-track-property` | false | Any additional property of the element, or object being acted on. |
| `data-track-value` | false | Describes a numeric value (decimal) directly related to the event. This could be the value of an input. For example, `10` when clicking `internal` visibility. If omitted, this is the element's `value` property or `undefined`. For checkboxes, the default value is the element's checked attribute or `0` when unchecked. The value is parsed as numeric before sending the event. |
| `data-track-extra` | false | A key-value pair object passed as a valid JSON string. This attribute is added to the `extra` property in our [`gitlab_standard`](schemas.md#gitlab_standard) schema. |
@@ -421,7 +421,7 @@ Use the following arguments:
|------------|---------------------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `category` | String | | Area or aspect of the application. For example, `HealthCheckController` or `Lfs::FileTransformer`. |
| `action` | String | | The action being taken. For example, a controller action such as `create`, or an Active Record callback. |
-| `label` | String | `nil` | The specific element or object to act on. This can be one of the following: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list in the top bar; or the name or title attribute of a record being created. |
+| `label` | String | `nil` | The specific element or object to act on. This can be one of the following: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list; or the name or title attribute of a record being created. |
| `property` | String | `nil` | Any additional property of the element, or object being acted on. |
| `value` | Numeric | `nil` | Describes a numeric value (decimal) directly related to the event. This could be the value of an input. For example, `10` when clicking `internal` visibility. |
| `context` | Array\[SelfDescribingJSON\] | `nil` | An array of custom contexts to send with this event. Most events should not have any custom contexts. |
diff --git a/doc/development/snowplow/index.md b/doc/development/snowplow/index.md
index ca74761dbda..97a60b6f1f9 100644
--- a/doc/development/snowplow/index.md
+++ b/doc/development/snowplow/index.md
@@ -32,11 +32,10 @@ instances do not have a collector configured and do not collect data via Snowplo
You can configure your self-managed GitLab instance to use a custom Snowplow collector.
-1. On the top bar, select **Main menu > Admin**, then select **Settings > General**.
- Alternatively, go to `admin/application_settings/general` in your browser.
-
+1. On the left sidebar, expand the top-most chevron (**{chevron-down}**).
+1. Select **Admin Area**.
+1. On the left sidebar, select **Settings > General**.
1. Expand **Snowplow**.
-
1. Select **Enable Snowplow tracking** and enter your Snowplow configuration information. For example:
| Name | Value |
@@ -92,7 +91,7 @@ Each event provides attributes that describe the event.
| --------- | ------- | -------- | ----------- |
| category | text | true | The page or backend section of the application. Unless infeasible, use the Rails page attribute by default in the frontend, and namespace + class name on the backend, for example, `Notes::CreateService`. |
| action | text | true | The action the user takes, or aspect that's being instrumented. The first word must describe the action or aspect. For example, clicks must be `click`, activations must be `activate`, creations must be `create`. Use underscores to describe what was acted on. For example, activating a form field is `activate_form_input`, an interface action like clicking on a dropdown list is `click_dropdown`, a behavior like creating a project record from the backend is `create_project`. |
-| label | text | false | The specific element or object to act on. This can be one of the following: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list in the top bar; or the name or title attribute of a record being created. For Service Ping metrics adapted to Snowplow events, this should be the full metric [key path](../service_ping/metrics_dictionary.md#metric-key_path) taken from its definition file. |
+| label | text | false | The specific element or object to act on. This can be one of the following: the label of the element, for example, a tab labeled 'Create from template' for `create_from_template`; a unique identifier if no text is available, for example, `groups_dropdown_close` for closing the Groups dropdown list; or the name or title attribute of a record being created. For Service Ping metrics adapted to Snowplow events, this should be the full metric [key path](../service_ping/metrics_dictionary.md#metric-key_path) taken from its definition file. |
| property | text | false | Any additional property of the element, or object being acted on. For Service Ping metrics adapted to Snowplow events, this should be additional information or context that can help analyze the event. For example, in the case of `usage_activity_by_stage_monthly.create.merge_requests_users`, there are four different possible merge request actions: "create", "merge", "comment", and "close". Each of these would be a possible property value. |
| value | decimal | false | Describes a numeric value (decimal) directly related to the event. This could be the value of an input. For example, `10` when clicking `internal` visibility. |
| context | vector | false | Additional data in the form of a [self-describing JSON](https://docs.snowplow.io/docs/pipeline-components-and-applications/iglu/common-architecture/self-describing-json-schemas/) to describe the event if the attributes are not sufficient. Each context must have its schema defined to assure data integrity. Refer to the list of GitLab-defined contexts for more details. |
diff --git a/doc/development/value_stream_analytics.md b/doc/development/value_stream_analytics.md
index afbd1a76a1b..e056ce9b064 100644
--- a/doc/development/value_stream_analytics.md
+++ b/doc/development/value_stream_analytics.md
@@ -365,7 +365,7 @@ Seed issues and merge requests for value stream analytics:
Seed DORA daily metrics for value stream, insights and CI/CD analytics:
-1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
1. On the project's homepage, in the upper-left corner, copy the **Project ID**. You need it in a later step.
1. [Create an environment for your selected project from the UI](../ci/environments/index.md#create-a-static-environment) named `production`.
1. Open the rails console:
diff --git a/doc/operations/error_tracking.md b/doc/operations/error_tracking.md
index 224f04ad24f..a2d50e43a80 100644
--- a/doc/operations/error_tracking.md
+++ b/doc/operations/error_tracking.md
@@ -172,8 +172,8 @@ To enable the Sentry integration:
`event:read`, and
`event:write` (for resolving events).
1. In GitLab, enable and configure Error Tracking:
- 1. On the top bar, select **Main menu > Projects** and find your project.
- 1. On the left sidebar, select **Monitor > Error Tracking**.
+ 1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+ 1. Select **Monitor > Error Tracking**.
1. Under **Enable error tracking**, select the **Active** checkbox.
1. Under **Error tracking backend**, select **Sentry**.
1. Under **Sentry API URL**, enter your Sentry hostname. For example,
diff --git a/doc/operations/feature_flags.md b/doc/operations/feature_flags.md
index a3874b54ccd..edb7176c045 100644
--- a/doc/operations/feature_flags.md
+++ b/doc/operations/feature_flags.md
@@ -37,8 +37,8 @@ with GitLab, so it's up to developers to use a compatible client library and
To create and enable a feature flag:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Select **New feature flag**.
1. Enter a name that starts with a letter and contains only lowercase letters, digits, underscores (`_`),
or dashes (`-`), and does not end with a dash (`-`) or underscore (`_`).
@@ -180,8 +180,8 @@ For example:
To create a user list:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Select **View user lists**
1. Select **New user list**.
1. Enter a name for the list.
@@ -196,8 +196,8 @@ When viewing a list, you can rename it by selecting **Edit** (**{pencil}**).
To add users to a user list:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Select **Edit** (**{pencil}**) next to the list you want to add users to.
1. Select **Add Users**.
1. Enter the user IDs as a comma-separated list of values. For example,
@@ -210,8 +210,8 @@ To add users to a user list:
To remove users from a user list:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Select **Edit** (**{pencil}**) next to the list you want to change.
1. Select **Remove** (**{remove}**) next to the ID you want to remove.
@@ -224,8 +224,8 @@ code so that you can clean it up when it's time to remove the feature flag.
To search for code references of a feature flag:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Edit the feature flag you want to remove.
1. Select **More actions** (**{ellipsis_v}**).
1. Select **Search code references**.
@@ -235,8 +235,8 @@ To search for code references of a feature flag:
In [GitLab 13.0 and earlier](https://gitlab.com/gitlab-org/gitlab/-/issues/8621),
to disable a feature flag for a specific environment:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. For the feature flag you want to disable, select **Edit** (**{pencil}**).
1. To disable the flag:
@@ -250,8 +250,8 @@ to disable a feature flag for a specific environment:
To disable a feature flag for all environments:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. For the feature flag you want to disable, slide the Status toggle to **Disabled**.
The feature flag is displayed on the **Disabled** tab.
@@ -265,8 +265,8 @@ Then prepare your application with a client library.
To get the access credentials that your application needs to communicate with GitLab:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Deployments > Feature flags**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Deploy > Feature flags**.
1. Select **Configure** to view the following:
- **API URL**: URL where the client (application) connects to get a list of feature flags.
- **Instance ID**: Unique token that authorizes the retrieval of the feature flags.
diff --git a/doc/operations/incident_management/alerts.md b/doc/operations/incident_management/alerts.md
index 74e0ed5f06a..e701fb2e5fb 100644
--- a/doc/operations/incident_management/alerts.md
+++ b/doc/operations/incident_management/alerts.md
@@ -179,8 +179,8 @@ To assign an alert:
1. Display the list of current alerts:
- 1. On the top bar, select **Main menu > Projects** and find your project.
- 1. On the left sidebar, select **Monitor > Alerts**.
+ 1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+ 1. Select **Monitor > Alerts**.
1. Select your desired alert to display its details.
@@ -219,8 +219,8 @@ Prerequisites:
To configure the actions:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand the **Alerts** section, then select the **Alert settings** tab.
1. Select the **Create an incident** checkbox.
1. Optional. To customize the incident, from the **Incident template**, select a template to be
diff --git a/doc/operations/incident_management/escalation_policies.md b/doc/operations/incident_management/escalation_policies.md
index 87455906b26..4360fe6243d 100644
--- a/doc/operations/incident_management/escalation_policies.md
+++ b/doc/operations/incident_management/escalation_policies.md
@@ -22,8 +22,8 @@ Prerequisite:
To create an escalation policy:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Escalation Policies**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Escalation Policies**.
1. Select **Add an escalation policy**.
1. Enter the policy's name and description, and
escalation rules to follow when a primary responder misses an alert.
@@ -46,8 +46,8 @@ the paged users is created on the alert.
To update an escalation policy:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Escalation Policies**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Escalation Policies**.
1. Select **Edit escalation policy** (**{pencil}**).
1. Edit the information.
1. Select **Save changes**.
@@ -56,7 +56,7 @@ To update an escalation policy:
To delete an escalation policy:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Escalation Policies**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Escalation Policies**.
1. Select **Delete escalation policy** (**{remove}**).
1. On the confirmation dialog, select **Delete escalation policy**.
diff --git a/doc/operations/incident_management/incident_timeline_events.md b/doc/operations/incident_management/incident_timeline_events.md
index d509061eca0..6a52accbfb2 100644
--- a/doc/operations/incident_management/incident_timeline_events.md
+++ b/doc/operations/incident_management/incident_timeline_events.md
@@ -23,8 +23,8 @@ They are grouped with dates and are listed in ascending order of the time when t
To view the event timeline of an incident:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. Select the **Timeline** tab.
@@ -42,8 +42,8 @@ Prerequisites:
To create a timeline event:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. Select the **Timeline** tab.
1. Select **Add new timeline event**.
@@ -66,8 +66,8 @@ Prerequisites:
To create a timeline event from a comment on the incident:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. Create a comment or choose an existing comment.
1. On the comment you want to add, select **Add comment to incident timeline** (**{clock}**).
@@ -106,8 +106,8 @@ Prerequisites:
To delete a timeline event:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. Select the **Timeline** tab.
1. On the right of a timeline event, select **More actions** (**{ellipsis_v}**) and then select **Delete**.
diff --git a/doc/operations/incident_management/incidents.md b/doc/operations/incident_management/incidents.md
index 5f1a2880c4b..4e2be27e424 100644
--- a/doc/operations/incident_management/incidents.md
+++ b/doc/operations/incident_management/incidents.md
@@ -154,8 +154,8 @@ Prerequisites:
To configure the timer:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand the **Incidents** section, then select the **Incident settings** tab.
1. Select **Activate "time to SLA" countdown timer**.
1. Set a time limit in increments of 15 minutes.
diff --git a/doc/operations/incident_management/integrations.md b/doc/operations/incident_management/integrations.md
index 41fbe8fe83c..5fe7db71fd8 100644
--- a/doc/operations/incident_management/integrations.md
+++ b/doc/operations/incident_management/integrations.md
@@ -144,8 +144,8 @@ Prerequisites:
- You must have at least the Maintainer role for the project.
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand the **Alerts** section, and select **Add new integration**.
1. From the **Select integration type** dropdown list, select **Prometheus**.
1. Turn on the **Active** toggle.
diff --git a/doc/operations/incident_management/linked_resources.md b/doc/operations/incident_management/linked_resources.md
index 642a6972bcf..e43b08dfd78 100644
--- a/doc/operations/incident_management/linked_resources.md
+++ b/doc/operations/incident_management/linked_resources.md
@@ -27,8 +27,8 @@ Linked resources for an incident are listed under the **Summary** tab.
To view the linked resources of an incident:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
## Add a linked resource
@@ -41,8 +41,8 @@ Prerequisites:
To add a linked resource:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select the plus icon (**{plus-square}**).
1. Complete the required fields.
@@ -92,7 +92,7 @@ Prerequisites:
To remove a linked resource:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select an incident.
1. In the **Linked resources** section, select **Remove** (**{close}**).
diff --git a/doc/operations/incident_management/manage_incidents.md b/doc/operations/incident_management/manage_incidents.md
index 187a398b1ee..3d2688daf6a 100644
--- a/doc/operations/incident_management/manage_incidents.md
+++ b/doc/operations/incident_management/manage_incidents.md
@@ -24,8 +24,8 @@ Prerequisites:
To create an incident from the incidents list:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
1. Select **Create incident**.
### From the issues list
@@ -38,8 +38,8 @@ Prerequisites:
To create an incident from the issues list:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Issues > List**, and select **New issue**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Plan > Issues**, and select **New issue**.
1. From the **Type** dropdown list, select **Incident**. Only fields relevant to
incidents are available on the page.
1. Select **Create issue**.
@@ -57,8 +57,8 @@ Prerequisites:
To create an incident from an alert:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Alerts**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Alerts**.
1. Select your desired alert.
1. Select **Create incident**.
@@ -88,8 +88,8 @@ Prerequisites:
To set up a webhook with PagerDuty:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**
1. Expand **Incidents**.
1. Select the **PagerDuty integration** tab.
1. Turn on the **Active** toggle.
@@ -104,8 +104,8 @@ check if a GitLab incident is created from the incident.
To view the [incidents list](incidents.md#incidents-list):
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > Incidents**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > Incidents**.
To view an incident's [details page](incidents.md#incident-details), select it from the list.
@@ -239,8 +239,8 @@ Prerequisites:
To configure the setting:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand the **Incidents** section.
1. Select the **Automatically close associated incident** checkbox.
1. Select **Save changes**.
diff --git a/doc/operations/incident_management/oncall_schedules.md b/doc/operations/incident_management/oncall_schedules.md
index 9dfac56f0ba..8e3318766b4 100644
--- a/doc/operations/incident_management/oncall_schedules.md
+++ b/doc/operations/incident_management/oncall_schedules.md
@@ -28,8 +28,8 @@ Prerequisite:
To create an on-call schedule:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. Select **Add a schedule**.
1. Enter the schedule's name and description and select a time zone.
1. Select **Add schedule**.
@@ -43,8 +43,8 @@ create [rotations](#rotations) for your schedule.
To update a schedule:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. Select **Edit schedule** (**{pencil}**).
1. Edit the information.
1. Select **Save changes**.
@@ -56,8 +56,8 @@ interval (if one is set) to the corresponding times in the new time zone.
To delete a schedule:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. Select **Delete escalation policy** (**{remove}**).
1. On the confirmation dialog, select **Delete schedule**.
@@ -67,8 +67,8 @@ Add rotations to an existing schedule to put your team members on-call.
To create a rotation:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. Select the **Add a rotation** link.
1. Enter the following information:
@@ -85,8 +85,8 @@ To create a rotation:
To edit a rotation:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Edit rotation** (**{pencil}**).
1. Edit the information.
1. Select **Save changes**.
@@ -95,8 +95,8 @@ To edit a rotation:
To delete a rotation:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Monitor > On-call Schedules**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Monitor > On-call Schedules**.
1. In the **Rotations** section, select **Delete rotation** (**{remove}**).
1. On the confirmation dialog, select **Delete rotation**.
diff --git a/doc/operations/incident_management/paging.md b/doc/operations/incident_management/paging.md
index 70c67977b73..be28e94c148 100644
--- a/doc/operations/incident_management/paging.md
+++ b/doc/operations/incident_management/paging.md
@@ -26,8 +26,8 @@ Email notifications are available in projects for triggered alerts. Project
members with the **Owner** or **Maintainer** roles have the option to receive
a single email notification for new alerts.
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand **Alerts**.
1. On the **Alert settings** tab, select the
**Send a single email notification to Owners and Maintainers for new alerts** checkbox.
diff --git a/doc/operations/incident_management/status_page.md b/doc/operations/incident_management/status_page.md
index fd37279806f..a159757842d 100644
--- a/doc/operations/incident_management/status_page.md
+++ b/doc/operations/incident_management/status_page.md
@@ -45,9 +45,9 @@ Prerequisite:
To provide GitLab with the AWS account information needed to push content to your Status Page:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
-1. Expand **Status Page**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
+1. Expand **Status page**.
1. Select the **Active** checkbox.
1. In the **Status Page URL** box, provide the URL for your external status page.
1. In the **S3 Bucket name** box, type the name of your S3 bucket. For more information, see
@@ -96,8 +96,8 @@ the issue can potentially [publish comments to your GitLab Status Page](#publish
After creating the CI/CD variables, configure the Project you want to use for
Incident issues:
-1. On the top bar, select **Main menu > Projects** and find your project.
-1. On the left sidebar, select **Settings > Monitor**.
+1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your project.
+1. Select **Settings > Monitor**.
1. Expand **Status page**.
1. Fill in your cloud provider's credentials and make sure to select the **Active** checkbox.
1. Select **Save changes**.
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index f6033541986..544ce78fd5e 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -51,9 +51,27 @@ You can quickly see which comments involve you, because
mentions for yourself (the user who is signed in) are highlighted
in a different color.
-Avoid mentioning `@all` in issues and merge requests. It sends an email notification
-to all members of that project's parent group, not only the participants of the project.
-It might be interpreted as spam.
+### Mentioning all members
+
+> [Flag](../../administration/feature_flags.md) named `disable_all_mention` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110586) in GitLab 16.1. Disabled by default.
+
+FLAG:
+On self-managed GitLab, by default the feature is available.
+To make it unavailable, ask an administrator to [enable the feature flag](../../administration/feature_flags.md)
+named `disable_all_mention`.
+On GitLab.com, this feature is available.
+Disabling this feature on GitLab.com is tracked in [issue 18442](https://gitlab.com/gitlab-org/gitlab/-/issues/18442).
+
+When this feature flag is enabled, typing `@all` in comments and descriptions
+results in plain text instead of a mention.
+When you disable this feature, existing `@all` mentions in the Markdown texts are not affected
+and remain as links. Only future `@all` mentions appear as plain text.
+
+Avoid mentioning `@all` in comments and descriptions.
+When you do it, you don't only mention the participants of the project, issue, or merge request,
+but to all members of that project's parent group.
+All these users receive an email notification and a to-do item. It might be interpreted as spam.
+
Notifications and mentions can be disabled in
[a group's settings](../group/manage.md#disable-email-notifications).
diff --git a/doc/user/markdown.md b/doc/user/markdown.md
index 2026a033150..401fe0bcb09 100644
--- a/doc/user/markdown.md
+++ b/doc/user/markdown.md
@@ -630,7 +630,7 @@ GitLab Flavored Markdown recognizes the following:
|:----------------------------------------------------------------------------|:------------------------------|:----------------------------------------|:-------------------------------|
| specific user | `@user_name` | | |
| specific group | `@group_name` | | |
-| entire team | `@all` | | |
+| entire team | [`@all`](discussions/index.md#mentioning-all-members) | | |
| project | `namespace/project>` | | |
| issue | ``#123`` | `namespace/project#123` | `project#123` |
| merge request | `!123` | `namespace/project!123` | `project!123` |
diff --git a/lib/api/validations/validators/absence.rb b/lib/api/validations/validators/absence.rb
index 7858ce7140b..49bf7f4a1c2 100644
--- a/lib/api/validations/validators/absence.rb
+++ b/lib/api/validations/validators/absence.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class Absence < Grape::Validations::Base
+ class Absence < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
return if params.respond_to?(:key?) && !params.key?(attr_name)
diff --git a/lib/api/validations/validators/array_none_any.rb b/lib/api/validations/validators/array_none_any.rb
index 8c064eefbf2..cc86bd1a535 100644
--- a/lib/api/validations/validators/array_none_any.rb
+++ b/lib/api/validations/validators/array_none_any.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class ArrayNoneAny < Grape::Validations::Base
+ class ArrayNoneAny < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
value = params[attr_name]
diff --git a/lib/api/validations/validators/bulk_imports.rb b/lib/api/validations/validators/bulk_imports.rb
index bff3424a0ac..f8ad5ed6d14 100644
--- a/lib/api/validations/validators/bulk_imports.rb
+++ b/lib/api/validations/validators/bulk_imports.rb
@@ -4,7 +4,7 @@ module API
module Validations
module Validators
module BulkImports
- class DestinationSlugPath < Grape::Validations::Base
+ class DestinationSlugPath < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
if Feature.disabled?(:restrict_special_characters_in_namespace_path)
return if params[attr_name] =~ Gitlab::Regex.group_path_regex
@@ -29,7 +29,7 @@ module API
end
end
- class DestinationNamespacePath < Grape::Validations::Base
+ class DestinationNamespacePath < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
return if params[attr_name].blank?
@@ -42,7 +42,7 @@ module API
end
end
- class SourceFullPath < Grape::Validations::Base
+ class SourceFullPath < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
return if params[attr_name] =~ Gitlab::Regex.bulk_import_source_full_path_regex
diff --git a/lib/api/validations/validators/check_assignees_count.rb b/lib/api/validations/validators/check_assignees_count.rb
index 15f48c09a4f..7d90f030f1a 100644
--- a/lib/api/validations/validators/check_assignees_count.rb
+++ b/lib/api/validations/validators/check_assignees_count.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class CheckAssigneesCount < Grape::Validations::Base
+ class CheckAssigneesCount < Grape::Validations::Validators::Base
def self.coerce
lambda do |value|
case value
diff --git a/lib/api/validations/validators/email_or_email_list.rb b/lib/api/validations/validators/email_or_email_list.rb
index 715a29c613d..8aa7c3bc32c 100644
--- a/lib/api/validations/validators/email_or_email_list.rb
+++ b/lib/api/validations/validators/email_or_email_list.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class EmailOrEmailList < Grape::Validations::Base
+ class EmailOrEmailList < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
value = params[attr_name]
diff --git a/lib/api/validations/validators/file_path.rb b/lib/api/validations/validators/file_path.rb
index 2440d8890e2..7b32e1d71f8 100644
--- a/lib/api/validations/validators/file_path.rb
+++ b/lib/api/validations/validators/file_path.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class FilePath < Grape::Validations::Base
+ class FilePath < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
options = @option.is_a?(Hash) ? @option : {}
path_allowlist = options.fetch(:allowlist, [])
diff --git a/lib/api/validations/validators/git_ref.rb b/lib/api/validations/validators/git_ref.rb
index dcb1db6ca33..711c272ab4e 100644
--- a/lib/api/validations/validators/git_ref.rb
+++ b/lib/api/validations/validators/git_ref.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class GitRef < Grape::Validations::Base
+ class GitRef < Grape::Validations::Validators::Base
# There are few checks that a Git reference should pass through to be valid reference.
# The link contains some rules that have been added to this validator.
# https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
diff --git a/lib/api/validations/validators/git_sha.rb b/lib/api/validations/validators/git_sha.rb
index 665d1878b4c..830137a0197 100644
--- a/lib/api/validations/validators/git_sha.rb
+++ b/lib/api/validations/validators/git_sha.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class GitSha < Grape::Validations::Base
+ class GitSha < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
sha = params[attr_name]
diff --git a/lib/api/validations/validators/integer_or_custom_value.rb b/lib/api/validations/validators/integer_or_custom_value.rb
index ad7848583fc..ff2df858a36 100644
--- a/lib/api/validations/validators/integer_or_custom_value.rb
+++ b/lib/api/validations/validators/integer_or_custom_value.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class IntegerOrCustomValue < Grape::Validations::Base
+ class IntegerOrCustomValue < Grape::Validations::Validators::Base
def initialize(attrs, options, required, scope, **opts)
@custom_values = extract_custom_values(options)
super
diff --git a/lib/api/validations/validators/limit.rb b/lib/api/validations/validators/limit.rb
index 7e11f1d77cc..781bebac716 100644
--- a/lib/api/validations/validators/limit.rb
+++ b/lib/api/validations/validators/limit.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class Limit < Grape::Validations::Base
+ class Limit < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
value = params[attr_name]
diff --git a/lib/api/validations/validators/project_portable.rb b/lib/api/validations/validators/project_portable.rb
index 3a7ea5ea71e..50ab32b6b7a 100644
--- a/lib/api/validations/validators/project_portable.rb
+++ b/lib/api/validations/validators/project_portable.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class ProjectPortable < Grape::Validations::Base
+ class ProjectPortable < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
portable = params[attr_name]
diff --git a/lib/api/validations/validators/untrusted_regexp.rb b/lib/api/validations/validators/untrusted_regexp.rb
index 3ddea2bd9de..c5560be2e16 100644
--- a/lib/api/validations/validators/untrusted_regexp.rb
+++ b/lib/api/validations/validators/untrusted_regexp.rb
@@ -3,7 +3,7 @@
module API
module Validations
module Validators
- class UntrustedRegexp < Grape::Validations::Base
+ class UntrustedRegexp < Grape::Validations::Validators::Base
def validate_param!(attr_name, params)
value = params[attr_name]
return unless value
diff --git a/lib/banzai/filter/references/user_reference_filter.rb b/lib/banzai/filter/references/user_reference_filter.rb
index 5983036a8e5..d6b6fdb7149 100644
--- a/lib/banzai/filter/references/user_reference_filter.rb
+++ b/lib/banzai/filter/references/user_reference_filter.rb
@@ -45,7 +45,7 @@ module Banzai
# have `gfm` and `gfm-project_member` class names attached for styling.
def object_link_filter(text, pattern, link_content: nil, link_reference: false)
references_in(text, pattern) do |match, username|
- if username == 'all' && !skip_project_check?
+ if Feature.disabled?(:disable_all_mention) && username == 'all' && !skip_project_check?
link_to_all(link_content: link_content)
else
cached_call(:banzai_url_for_object, match, path: [User, username.downcase]) do
diff --git a/lib/gitlab/background_migration/backfill_ci_queuing_tables.rb b/lib/gitlab/background_migration/backfill_ci_queuing_tables.rb
deleted file mode 100644
index 63112b52584..00000000000
--- a/lib/gitlab/background_migration/backfill_ci_queuing_tables.rb
+++ /dev/null
@@ -1,153 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Ensure queuing entries are present even if admins skip upgrades.
- class BackfillCiQueuingTables
- class Namespace < ActiveRecord::Base # rubocop:disable Style/Documentation
- self.table_name = 'namespaces'
- self.inheritance_column = :_type_disabled
- end
-
- class Project < ActiveRecord::Base # rubocop:disable Style/Documentation
- self.table_name = 'projects'
-
- belongs_to :namespace
- has_one :ci_cd_settings, class_name: 'Gitlab::BackgroundMigration::BackfillCiQueuingTables::ProjectCiCdSetting'
-
- def group_runners_enabled?
- return false unless ci_cd_settings
-
- ci_cd_settings.group_runners_enabled?
- end
- end
-
- class ProjectCiCdSetting < ActiveRecord::Base # rubocop:disable Style/Documentation
- self.table_name = 'project_ci_cd_settings'
- end
-
- class Taggings < ActiveRecord::Base # rubocop:disable Style/Documentation
- self.table_name = 'taggings'
- end
-
- module Ci
- class Build < ActiveRecord::Base # rubocop:disable Style/Documentation
- include EachBatch
-
- self.table_name = 'ci_builds'
- self.inheritance_column = :_type_disabled
-
- belongs_to :project
-
- scope :pending, -> do
- where(status: :pending, type: 'Ci::Build', runner_id: nil)
- end
-
- def self.each_batch(of: 1000, column: :id, order: { runner_id: :asc, id: :asc }, order_hint: nil)
- start = except(:select).select(column).reorder(order)
- start = start.take
- return unless start
-
- start_id = start[column]
- arel_table = self.arel_table
-
- 1.step do |index|
- start_cond = arel_table[column].gteq(start_id)
- stop = except(:select).select(column).where(start_cond).reorder(order)
- stop = stop.offset(of).limit(1).take
- relation = where(start_cond)
-
- if stop
- stop_id = stop[column]
- start_id = stop_id
- stop_cond = arel_table[column].lt(stop_id)
- relation = relation.where(stop_cond)
- end
-
- # Any ORDER BYs are useless for this relation and can lead to less
- # efficient UPDATE queries, hence we get rid of it.
- relation = relation.except(:order)
-
- # Using unscoped is necessary to prevent leaking the current scope used by
- # ActiveRecord to chain `each_batch` method.
- unscoped { yield relation, index }
-
- break unless stop
- end
- end
-
- def tags_ids
- BackfillCiQueuingTables::Taggings
- .where(taggable_id: id, taggable_type: 'CommitStatus')
- .pluck(:tag_id)
- end
- end
-
- class PendingBuild < ActiveRecord::Base # rubocop:disable Style/Documentation
- self.table_name = 'ci_pending_builds'
-
- class << self
- def upsert_from_build!(build)
- entry = self.new(args_from_build(build))
-
- self.upsert(
- entry.attributes.compact,
- returning: %w[build_id],
- unique_by: :build_id)
- end
-
- def args_from_build(build)
- project = build.project
-
- {
- build_id: build.id,
- project_id: build.project_id,
- protected: build.protected?,
- namespace_id: project.namespace_id,
- tag_ids: build.tags_ids,
- instance_runners_enabled: project.shared_runners_enabled?,
- namespace_traversal_ids: namespace_traversal_ids(project)
- }
- end
-
- def namespace_traversal_ids(project)
- if project.group_runners_enabled?
- project.namespace.traversal_ids
- else
- []
- end
- end
- end
- end
- end
-
- BATCH_SIZE = 100
-
- def perform(start_id, end_id)
- scope = BackfillCiQueuingTables::Ci::Build.pending.where(id: start_id..end_id)
- pending_builds_query = BackfillCiQueuingTables::Ci::PendingBuild
- .where('ci_builds.id = ci_pending_builds.build_id')
- .select(1)
-
- scope.each_batch(of: BATCH_SIZE) do |builds|
- builds = builds.where('NOT EXISTS (?)', pending_builds_query)
- builds = builds.includes(:project, project: [:namespace, :ci_cd_settings])
-
- builds.each do |build|
- BackfillCiQueuingTables::Ci::PendingBuild.upsert_from_build!(build)
- end
- end
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments)
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/backfill_group_features.rb b/lib/gitlab/background_migration/backfill_group_features.rb
deleted file mode 100644
index c45dcad5b2d..00000000000
--- a/lib/gitlab/background_migration/backfill_group_features.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Backfill group_features for an array of groups
- class BackfillGroupFeatures < ::Gitlab::BackgroundMigration::BatchedMigrationJob
- job_arguments :batch_size
- operation_name :upsert_group_features
- feature_category :database
-
- def perform
- each_sub_batch(
- batching_arguments: { order_hint: :type },
- batching_scope: ->(relation) { relation.where(type: 'Group') }
- ) do |sub_batch|
- upsert_group_features(sub_batch)
- end
- end
-
- private
-
- def upsert_group_features(relation)
- connection.execute(
- <<~SQL
- INSERT INTO group_features (group_id, created_at, updated_at)
- SELECT namespaces.id as group_id, now(), now()
- FROM namespaces
- WHERE namespaces.type = 'Group' AND namespaces.id IN(#{relation.select(:id).limit(batch_size).to_sql})
- ON CONFLICT (group_id) DO NOTHING;
- SQL
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route.rb b/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route.rb
deleted file mode 100644
index 0585924cb7b..00000000000
--- a/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Backfills the `routes.namespace_id` column, by copying source_id value
- # (for groups and user namespaces source_id == namespace_id)
- class BackfillNamespaceIdForNamespaceRoute
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, end_id, batch_table, batch_column, sub_batch_size, pause_ms)
- parent_batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)
-
- parent_batch_relation.each_batch(column: batch_column, of: sub_batch_size) do |sub_batch|
- batch_metrics.time_operation(:update_all) do
- sub_batch.update_all('namespace_id=source_id')
- end
-
- pause_ms = [0, pause_ms].max
- sleep(pause_ms * 0.001)
- end
- end
-
- def batch_metrics
- @batch_metrics ||= Gitlab::Database::BackgroundMigration::BatchMetrics.new
- end
-
- private
-
- def relation_scoped_to_range(source_table, source_key_column, start_id, stop_id)
- define_batchable_model(source_table, connection: ApplicationRecord.connection)
- .joins('inner join namespaces on routes.source_id = namespaces.id')
- .where(source_key_column => start_id..stop_id)
- .where(namespace_id: nil)
- .where(source_type: 'Namespace')
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex.rb b/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex.rb
deleted file mode 100644
index b703faf6a6c..00000000000
--- a/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Cleanup draft column data inserted by a faulty regex
- #
- class CleanupDraftDataFromFaultyRegex
- # Migration only version of MergeRequest table
- ##
- class MergeRequest < ActiveRecord::Base
- LEAKY_REGEXP_STR = "^\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP"
- CORRECTED_REGEXP_STR = "^(\\[draft\\]|\\(draft\\)|draft:|draft|\\[WIP\\]|WIP:|WIP)"
-
- include EachBatch
-
- self.table_name = 'merge_requests'
-
- def self.eligible
- where(state_id: 1)
- .where(draft: true)
- .where("title ~* ?", LEAKY_REGEXP_STR)
- .where("title !~* ?", CORRECTED_REGEXP_STR)
- end
- end
-
- def perform(start_id, end_id)
- eligible_mrs = MergeRequest.eligible.where(id: start_id..end_id).pluck(:id)
-
- return if eligible_mrs.empty?
-
- eligible_mrs.each_slice(10) do |slice|
- MergeRequest.where(id: slice).update_all(draft: false)
- end
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'CleanupDraftDataFromFaultyRegex',
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/encrypt_integration_properties.rb b/lib/gitlab/background_migration/encrypt_integration_properties.rb
deleted file mode 100644
index 28c28ae48eb..00000000000
--- a/lib/gitlab/background_migration/encrypt_integration_properties.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Migrates the integration.properties column from plaintext to encrypted text.
- class EncryptIntegrationProperties
- # The Integration model, with just the relevant bits.
- class Integration < ActiveRecord::Base
- include EachBatch
-
- ALGORITHM = 'aes-256-gcm'
-
- self.table_name = 'integrations'
- self.inheritance_column = :_type_disabled
-
- scope :with_properties, -> { where.not(properties: nil) }
- scope :not_already_encrypted, -> { where(encrypted_properties: nil) }
- scope :for_batch, ->(range) { where(id: range) }
-
- attr_encrypted :encrypted_properties_tmp,
- attribute: :encrypted_properties,
- mode: :per_attribute_iv,
- key: ::Settings.attr_encrypted_db_key_base_32,
- algorithm: ALGORITHM,
- marshal: true,
- marshaler: ::Gitlab::Json,
- encode: false,
- encode_iv: false
-
- # See 'Integration#reencrypt_properties'
- def encrypt_properties
- data = ::Gitlab::Json.parse(properties)
- iv = generate_iv(ALGORITHM)
- ep = self.class.attr_encrypt(:encrypted_properties_tmp, data, { iv: iv })
-
- [ep, iv]
- end
- end
-
- def perform(start_id, stop_id)
- batch_query = Integration.with_properties.not_already_encrypted.for_batch(start_id..stop_id)
- encrypt_batch(batch_query)
- mark_job_as_succeeded(start_id, stop_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
-
- # represent binary string as a PSQL binary literal:
- # https://www.postgresql.org/docs/9.4/datatype-binary.html
- def bytea(value)
- "'\\x#{value.unpack1('H*')}'::bytea"
- end
-
- def encrypt_batch(batch_query)
- values = batch_query.select(:id, :properties).map do |record|
- encrypted_properties, encrypted_properties_iv = record.encrypt_properties
- "(#{record.id}, #{bytea(encrypted_properties)}, #{bytea(encrypted_properties_iv)})"
- end
-
- return if values.empty?
-
- Integration.connection.execute(<<~SQL.squish)
- WITH cte(cte_id, cte_encrypted_properties, cte_encrypted_properties_iv)
- AS #{::Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- SELECT *
- FROM (VALUES #{values.join(',')}) AS t (id, encrypted_properties, encrypted_properties_iv)
- )
- UPDATE #{Integration.table_name}
- SET encrypted_properties = cte_encrypted_properties
- , encrypted_properties_iv = cte_encrypted_properties_iv
- FROM cte
- WHERE cte_id = id
- SQL
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/encrypt_static_object_token.rb b/lib/gitlab/background_migration/encrypt_static_object_token.rb
deleted file mode 100644
index 961dea028c9..00000000000
--- a/lib/gitlab/background_migration/encrypt_static_object_token.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Populates "static_object_token_encrypted" field with encrypted versions
- # of values from "static_object_token" field
- class EncryptStaticObjectToken
- # rubocop:disable Style/Documentation
- class User < ActiveRecord::Base
- include ::EachBatch
- self.table_name = 'users'
- scope :with_static_object_token, -> { where.not(static_object_token: nil) }
- scope :without_static_object_token_encrypted, -> { where(static_object_token_encrypted: nil) }
- end
- # rubocop:enable Style/Documentation
-
- BATCH_SIZE = 100
-
- def perform(start_id, end_id)
- ranged_query = User
- .where(id: start_id..end_id)
- .with_static_object_token
- .without_static_object_token_encrypted
-
- ranged_query.each_batch(of: BATCH_SIZE) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
-
- batch_query = User.unscoped
- .where(id: first..last)
- .with_static_object_token
- .without_static_object_token_encrypted
-
- user_tokens = batch_query.pluck(:id, :static_object_token)
-
- user_encrypted_tokens = user_tokens.map do |(id, plaintext_token)|
- next if plaintext_token.blank?
-
- [id, Gitlab::CryptoHelper.aes256_gcm_encrypt(plaintext_token)]
- end
-
- encrypted_tokens_sql = user_encrypted_tokens.compact.map { |(id, token)| "(#{id}, '#{token}')" }.join(',')
-
- next unless user_encrypted_tokens.present?
-
- User.connection.execute(<<~SQL)
- WITH cte(cte_id, cte_token) AS #{::Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- SELECT *
- FROM (VALUES #{encrypted_tokens_sql}) AS t (id, token)
- )
- UPDATE #{User.table_name}
- SET static_object_token_encrypted = cte_token
- FROM cte
- WHERE cte_id = id
- SQL
- end
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/fix_duplicate_project_name_and_path.rb b/lib/gitlab/background_migration/fix_duplicate_project_name_and_path.rb
deleted file mode 100644
index 3772430d0b7..00000000000
--- a/lib/gitlab/background_migration/fix_duplicate_project_name_and_path.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Fix project name duplicates and backfill missing project namespace ids
- class FixDuplicateProjectNameAndPath
- SUB_BATCH_SIZE = 10
- # isolated project active record
- class Project < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'projects'
-
- scope :without_project_namespace, -> { where(project_namespace_id: nil) }
- scope :id_in, ->(ids) { where(id: ids) }
- end
-
- def perform(start_id, end_id)
- @project_ids = fetch_project_ids(start_id, end_id)
- backfill_project_namespaces_service = init_backfill_service(project_ids)
- backfill_project_namespaces_service.cleanup_gin_index('projects')
-
- project_ids.each_slice(SUB_BATCH_SIZE) do |ids|
- ApplicationRecord.connection.execute(update_projects_name_and_path_sql(ids))
- end
-
- backfill_project_namespaces_service.backfill_project_namespaces
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- attr_accessor :project_ids
-
- def fetch_project_ids(start_id, end_id)
- Project.without_project_namespace.where(id: start_id..end_id)
- end
-
- def init_backfill_service(project_ids)
- service = Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces.new
- service.project_ids = project_ids
- service.sub_batch_size = SUB_BATCH_SIZE
-
- service
- end
-
- def update_projects_name_and_path_sql(project_ids)
- <<~SQL
- WITH cte (project_id, path_from_route ) AS (
- #{path_from_route_sql(project_ids).to_sql}
- )
- UPDATE
- projects
- SET
- name = concat(projects.name, '-', id),
- path = CASE
- WHEN projects.path <> cte.path_from_route THEN path_from_route
- ELSE projects.path
- END
- FROM
- cte
- WHERE
- projects.id = cte.project_id;
- SQL
- end
-
- def path_from_route_sql(project_ids)
- Project.without_project_namespace.id_in(project_ids)
- .joins("INNER JOIN routes ON routes.source_id = projects.id AND routes.source_type = 'Project'")
- .select("projects.id, SUBSTRING(routes.path FROM '[^/]+(?=/$|$)') AS path_from_route")
- end
-
- def mark_job_as_succeeded(*arguments)
- ::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'FixDuplicateProjectNameAndPath',
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/fix_incorrect_max_seats_used.rb b/lib/gitlab/background_migration/fix_incorrect_max_seats_used.rb
deleted file mode 100644
index 2c09b8c0b24..00000000000
--- a/lib/gitlab/background_migration/fix_incorrect_max_seats_used.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop: disable Style/Documentation
- class FixIncorrectMaxSeatsUsed
- def perform(batch = nil)
- end
- end
- end
-end
-
-Gitlab::BackgroundMigration::FixIncorrectMaxSeatsUsed.prepend_mod_with('Gitlab::BackgroundMigration::FixIncorrectMaxSeatsUsed')
diff --git a/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb b/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb
deleted file mode 100644
index db3f98bc2ba..00000000000
--- a/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata.rb
+++ /dev/null
@@ -1,124 +0,0 @@
-# frozen_string_literal: true
-
-require 'parser/ruby27'
-
-module Gitlab
- module BackgroundMigration
- # This migration fixes raw_metadata entries which have incorrectly been passed a Ruby Hash instead of JSON data.
- class FixVulnerabilityOccurrencesWithHashesAsRawMetadata
- CLUSTER_IMAGE_SCANNING_REPORT_TYPE = 7
- GENERIC_REPORT_TYPE = 99
-
- # Type error is used to handle unexpected types when parsing stringified hashes.
- class TypeError < ::StandardError
- attr_reader :message, :type
-
- def initialize(message, type)
- @message = message
- @type = type
- end
- end
-
- # Migration model namespace isolated from application code.
- class Finding < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'vulnerability_occurrences'
-
- scope :by_api_report_types, -> { where(report_type: [CLUSTER_IMAGE_SCANNING_REPORT_TYPE, GENERIC_REPORT_TYPE]) }
- end
-
- def perform(start_id, end_id)
- Finding.by_api_report_types.where(id: start_id..end_id).each do |finding|
- next if valid_json?(finding.raw_metadata)
-
- metadata = hash_from_s(finding.raw_metadata)
-
- finding.update(raw_metadata: metadata.to_json) if metadata
- end
- mark_job_as_succeeded(start_id, end_id)
- end
-
- def hash_from_s(str_hash)
- ast = Parser::Ruby27.parse(str_hash)
-
- unless ast.type == :hash
- ::Gitlab::AppLogger.error(message: "expected raw_metadata to be a hash", type: ast.type)
- return
- end
-
- parse_hash(ast)
- rescue Parser::SyntaxError => e
- ::Gitlab::AppLogger.error(message: "error parsing raw_metadata", error: e.message)
- nil
- rescue TypeError => e
- ::Gitlab::AppLogger.error(message: "error parsing raw_metadata", error: e.message, type: e.type)
- nil
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- ::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'FixVulnerabilityOccurrencesWithHashesAsRawMetadata',
- arguments
- )
- end
-
- def valid_json?(metadata)
- Oj.load(metadata)
- true
- rescue Oj::ParseError, EncodingError, JSON::ParserError, JSON::GeneratorError, Encoding::UndefinedConversionError
- false
- end
-
- def parse_hash(hash)
- out = {}
- hash.children.each do |node|
- unless node.type == :pair
- raise TypeError.new("expected child of hash to be a `pair`", node.type)
- end
-
- key, value = node.children
-
- key = parse_key(key)
- value = parse_value(value)
-
- out[key] = value
- end
-
- out
- end
-
- def parse_key(key)
- case key.type
- when :sym, :str, :int
- key.children.first
- else
- raise TypeError.new("expected key to be either symbol, string, or integer", key.type)
- end
- end
-
- def parse_value(value)
- case value.type
- when :sym, :str, :int
- value.children.first
- # rubocop:disable Lint/BooleanSymbol
- when :true
- true
- when :false
- false
- # rubocop:enable Lint/BooleanSymbol
- when :nil
- nil
- when :array
- value.children.map { |c| parse_value(c) }
- when :hash
- parse_hash(value)
- else
- raise TypeError.new("value of a pair was an unexpected type", value.type)
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/merge_topics_with_same_name.rb b/lib/gitlab/background_migration/merge_topics_with_same_name.rb
deleted file mode 100644
index 07231098a5f..00000000000
--- a/lib/gitlab/background_migration/merge_topics_with_same_name.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to merge project topics with the same case insensitive name
- class MergeTopicsWithSameName
- # Temporary AR model for topics
- class Topic < ActiveRecord::Base
- self.table_name = 'topics'
- end
-
- # Temporary AR model for project topic assignment
- class ProjectTopic < ActiveRecord::Base
- self.table_name = 'project_topics'
- end
-
- def perform(topic_names)
- topic_names.each do |topic_name|
- topics = Topic.where('LOWER(name) = ?', topic_name)
- .order(total_projects_count: :desc, non_private_projects_count: :desc, id: :asc)
- .to_a
- topic_to_keep = topics.shift
- merge_topics(topic_to_keep, topics) if topics.any?
- end
- end
-
- private
-
- def merge_topics(topic_to_keep, topics_to_remove)
- description = topic_to_keep.description
-
- topics_to_remove.each do |topic|
- description ||= topic.description if topic.description.present?
- process_avatar(topic_to_keep, topic) if topic.avatar.present?
-
- ProjectTopic.transaction do
- ProjectTopic.where(topic_id: topic.id)
- .where.not(project_id: ProjectTopic.where(topic_id: topic_to_keep).select(:project_id))
- .update_all(topic_id: topic_to_keep.id)
- ProjectTopic.where(topic_id: topic.id).delete_all
- end
- end
-
- Topic.where(id: topics_to_remove).delete_all
-
- topic_to_keep.update(
- description: description,
- total_projects_count: total_projects_count(topic_to_keep.id),
- non_private_projects_count: non_private_projects_count(topic_to_keep.id)
- )
- end
-
- # We intentionally use application code here because we need to copy/remove avatar files
- def process_avatar(topic_to_keep, topic_to_remove)
- topic_to_remove = ::Projects::Topic.find(topic_to_remove.id)
- topic_to_keep = ::Projects::Topic.find(topic_to_keep.id)
- unless topic_to_keep.avatar.present?
- topic_to_keep.avatar = topic_to_remove.avatar
- topic_to_keep.save!
- end
-
- topic_to_remove.remove_avatar!
- topic_to_remove.save!
- end
-
- def total_projects_count(topic_id)
- ProjectTopic.where(topic_id: topic_id).count
- end
-
- def non_private_projects_count(topic_id)
- ProjectTopic.joins('INNER JOIN projects ON project_topics.project_id = projects.id')
- .where(project_topics: { topic_id: topic_id }).where('projects.visibility_level in (10, 20)').count
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner.rb b/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner.rb
deleted file mode 100644
index 49eff6e2771..00000000000
--- a/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Migrates personal namespace project `maintainer` memberships (for the associated user only) to OWNER
- # Does not create any missing records, simply migrates existing ones
- class MigratePersonalNamespaceProjectMaintainerToOwner
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, end_id, batch_table, batch_column, sub_batch_size, pause_ms)
- parent_batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)
-
- parent_batch_relation.each_batch(column: batch_column, of: sub_batch_size) do |sub_batch|
- batch_metrics.time_operation(:update_all) do
- sub_batch.update_all('access_level = 50')
- end
-
- pause_ms = 0 if pause_ms < 0
- sleep(pause_ms * 0.001)
- end
- end
-
- def batch_metrics
- @batch_metrics ||= Gitlab::Database::BackgroundMigration::BatchMetrics.new
- end
-
- private
-
- def relation_scoped_to_range(source_table, source_key_column, start_id, stop_id)
- # members of projects within their own personal namespace
-
- # rubocop: disable CodeReuse/ActiveRecord
- define_batchable_model(:members, connection: ApplicationRecord.connection)
- .where(source_key_column => start_id..stop_id)
- .joins("INNER JOIN projects ON members.source_id = projects.id")
- .joins("INNER JOIN namespaces ON projects.namespace_id = namespaces.id")
- .where(type: 'ProjectMember')
- .where("namespaces.type = 'User'")
- .where('members.access_level < 50')
- .where('namespaces.owner_id = members.user_id')
- end
- end
- # rubocop: enable CodeReuse/ActiveRecord
- end
-end
diff --git a/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category.rb b/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category.rb
deleted file mode 100644
index d7d24960a41..00000000000
--- a/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to migrate category of integrations to third_party_wiki for confluence and shimo
- class MigrateShimoConfluenceIntegrationCategory
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, end_id)
- define_batchable_model('integrations', connection: ApplicationRecord.connection)
- .where(id: start_id..end_id, type_new: %w[Integrations::Confluence Integrations::Shimo])
- .update_all(category: 'third_party_wiki')
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds.rb b/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds.rb
deleted file mode 100644
index 13b66b2e02e..00000000000
--- a/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A job to nullify orphan runner_id on ci_builds table
- class NullifyOrphanRunnerIdOnCiBuilds
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, end_id, batch_table, batch_column, sub_batch_size, pause_ms)
- pause_ms = 0 if pause_ms < 0
-
- batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)
- batch_relation.each_batch(column: batch_column, of: sub_batch_size) do |sub_batch|
- batch_metrics.time_operation(:update_all) do
- filtered_sub_batch(sub_batch).update_all(runner_id: nil)
- end
-
- sleep(pause_ms * 0.001)
- end
- end
-
- def batch_metrics
- @batch_metrics ||= Gitlab::Database::BackgroundMigration::BatchMetrics.new
- end
-
- private
-
- def connection
- ::Ci::ApplicationRecord.connection
- end
-
- def relation_scoped_to_range(source_table, source_key_column, start_id, stop_id)
- define_batchable_model(source_table, connection: connection)
- .where(source_key_column => start_id..stop_id)
- end
-
- def filtered_sub_batch(sub_batch)
- sub_batch
- .joins('LEFT OUTER JOIN ci_runners ON ci_runners.id = ci_builds.runner_id')
- .where('ci_builds.runner_id IS NOT NULL AND ci_runners.id IS NULL')
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/populate_container_repository_migration_plan.rb b/lib/gitlab/background_migration/populate_container_repository_migration_plan.rb
deleted file mode 100644
index a9611e9814c..00000000000
--- a/lib/gitlab/background_migration/populate_container_repository_migration_plan.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to populates the migration_plan column of container_repositories
- # with the current plan of the namespaces that owns the container_repository
- #
- # The plan can be NULL, in which case no UPDATE
- # will be executed.
- class PopulateContainerRepositoryMigrationPlan
- def perform(start_id, end_id)
- (start_id..end_id).each do |id|
- execute(<<~SQL)
- WITH selected_plan AS (
- SELECT "plans"."name"
- FROM "container_repositories"
- INNER JOIN "projects" ON "projects"."id" = "container_repositories"."project_id"
- INNER JOIN "namespaces" ON "namespaces"."id" = "projects"."namespace_id"
- INNER JOIN "gitlab_subscriptions" ON "gitlab_subscriptions"."namespace_id" = "namespaces"."traversal_ids"[1]
- INNER JOIN "plans" ON "plans"."id" = "gitlab_subscriptions"."hosted_plan_id"
- WHERE "container_repositories"."id" = #{id}
- )
- UPDATE container_repositories
- SET migration_plan = selected_plan.name
- FROM selected_plan
- WHERE container_repositories.id = #{id};
- SQL
- end
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def connection
- @connection ||= ApplicationRecord.connection
- end
-
- def execute(sql)
- connection.execute(sql)
- end
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/populate_namespace_statistics.rb b/lib/gitlab/background_migration/populate_namespace_statistics.rb
deleted file mode 100644
index 97927ef48c2..00000000000
--- a/lib/gitlab/background_migration/populate_namespace_statistics.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # This class creates/updates those namespace statistics
- # that haven't been created nor initialized.
- # It also updates the related namespace statistics
- class PopulateNamespaceStatistics
- def perform(group_ids, statistics)
- # Updating group statistics might involve calling Gitaly.
- # For example, when calculating `wiki_size`, we will need
- # to perform the request to check if the repo exists and
- # also the repository size.
- #
- # The `allow_n_plus_1_calls` method is only intended for
- # dev and test. It won't be raised in prod.
- ::Gitlab::GitalyClient.allow_n_plus_1_calls do
- relation(group_ids).each do |group|
- upsert_namespace_statistics(group, statistics)
- end
- end
- end
-
- private
-
- def upsert_namespace_statistics(group, statistics)
- response = ::Groups::UpdateStatisticsService.new(group, statistics: statistics).execute
-
- error_message("#{response.message} group: #{group.id}") if response.error?
- end
-
- def logger
- @logger ||= ::Gitlab::BackgroundMigration::Logger.build
- end
-
- def error_message(message)
- logger.error(message: "Namespace Statistics Migration: #{message}")
- end
-
- def relation(group_ids)
- Group.includes(:namespace_statistics).where(id: group_ids)
- end
- end
- end
-end
-
-Gitlab::BackgroundMigration::PopulateNamespaceStatistics.prepend_mod_with('Gitlab::BackgroundMigration::PopulateNamespaceStatistics')
diff --git a/lib/gitlab/background_migration/populate_test_reports_issue_id.rb b/lib/gitlab/background_migration/populate_test_reports_issue_id.rb
deleted file mode 100644
index 301efd0c943..00000000000
--- a/lib/gitlab/background_migration/populate_test_reports_issue_id.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-# rubocop: disable Style/Documentation
-
-module Gitlab
- module BackgroundMigration
- class PopulateTestReportsIssueId
- def perform(start_id, stop_id)
- # NO OP
- end
- end
- end
-end
-
-Gitlab::BackgroundMigration::PopulateTestReportsIssueId.prepend_mod
diff --git a/lib/gitlab/background_migration/populate_topics_non_private_projects_count.rb b/lib/gitlab/background_migration/populate_topics_non_private_projects_count.rb
deleted file mode 100644
index 1f2b55004e4..00000000000
--- a/lib/gitlab/background_migration/populate_topics_non_private_projects_count.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to populates the non private projects counter of topics
- class PopulateTopicsNonPrivateProjectsCount
- SUB_BATCH_SIZE = 100
-
- # Temporary AR model for topics
- class Topic < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'topics'
- end
-
- def perform(start_id, stop_id)
- Topic.where(id: start_id..stop_id).each_batch(of: SUB_BATCH_SIZE) do |batch|
- ApplicationRecord.connection.execute(<<~SQL)
- WITH batched_relation AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (#{batch.select(:id).limit(SUB_BATCH_SIZE).to_sql})
- UPDATE topics
- SET non_private_projects_count = (
- SELECT COUNT(*)
- FROM project_topics
- INNER JOIN projects
- ON project_topics.project_id = projects.id
- WHERE project_topics.topic_id = batched_relation.id
- AND projects.visibility_level > 0
- )
- FROM batched_relation
- WHERE topics.id = batched_relation.id
- SQL
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/populate_vulnerability_reads.rb b/lib/gitlab/background_migration/populate_vulnerability_reads.rb
deleted file mode 100644
index 656c62d9ee5..00000000000
--- a/lib/gitlab/background_migration/populate_vulnerability_reads.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop:disable Style/Documentation
- class PopulateVulnerabilityReads
- include Gitlab::Database::DynamicModelHelpers
-
- PAUSE_SECONDS = 0.1
-
- def perform(start_id, end_id, sub_batch_size)
- vulnerability_model.where(id: start_id..end_id).each_batch(of: sub_batch_size) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
- connection.execute(insert_query(first, last))
-
- sleep PAUSE_SECONDS
- end
-
- mark_job_as_succeeded(start_id, end_id, sub_batch_size)
- end
-
- private
-
- def vulnerability_model
- define_batchable_model('vulnerabilities', connection: connection)
- end
-
- def connection
- ApplicationRecord.connection
- end
-
- def insert_query(start_id, end_id)
- <<~SQL
- INSERT INTO vulnerability_reads (
- vulnerability_id,
- project_id,
- scanner_id,
- report_type,
- severity,
- state,
- has_issues,
- resolved_on_default_branch,
- uuid,
- location_image
- )
- SELECT
- vulnerabilities.id,
- vulnerabilities.project_id,
- vulnerability_scanners.id,
- vulnerabilities.report_type,
- vulnerabilities.severity,
- vulnerabilities.state,
- CASE
- WHEN
- vulnerability_issue_links.vulnerability_id IS NOT NULL
- THEN
- true
- ELSE
- false
- END
- has_issues,
- vulnerabilities.resolved_on_default_branch,
- vulnerability_occurrences.uuid::uuid,
- vulnerability_occurrences.location ->> 'image'
- FROM
- vulnerabilities
- INNER JOIN vulnerability_occurrences ON vulnerability_occurrences.vulnerability_id = vulnerabilities.id
- INNER JOIN vulnerability_scanners ON vulnerability_scanners.id = vulnerability_occurrences.scanner_id
- LEFT JOIN vulnerability_issue_links ON vulnerability_issue_links.vulnerability_id = vulnerabilities.id
- WHERE vulnerabilities.id BETWEEN #{start_id} AND #{end_id}
- ON CONFLICT(vulnerability_id) DO NOTHING;
- SQL
- end
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- # rubocop:enable Style/Documentation
- end
-end
diff --git a/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid.rb b/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid.rb
deleted file mode 100644
index 9a42d035285..00000000000
--- a/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid.rb
+++ /dev/null
@@ -1,218 +0,0 @@
-# frozen_string_literal: true
-
-# rubocop: disable Style/Documentation
-class Gitlab::BackgroundMigration::RecalculateVulnerabilitiesOccurrencesUuid # rubocop:disable Metrics/ClassLength
- # rubocop: disable Gitlab/NamespacedClass
- class VulnerabilitiesIdentifier < ActiveRecord::Base
- self.table_name = "vulnerability_identifiers"
- has_many :primary_findings, class_name: 'VulnerabilitiesFinding', inverse_of: :primary_identifier, foreign_key: 'primary_identifier_id'
- end
-
- class VulnerabilitiesFinding < ActiveRecord::Base
- include EachBatch
- include ShaAttribute
-
- self.table_name = "vulnerability_occurrences"
-
- has_many :signatures, foreign_key: 'finding_id', class_name: 'VulnerabilityFindingSignature', inverse_of: :finding
- belongs_to :primary_identifier, class_name: 'VulnerabilitiesIdentifier', inverse_of: :primary_findings, foreign_key: 'primary_identifier_id'
-
- REPORT_TYPES = {
- sast: 0,
- dependency_scanning: 1,
- container_scanning: 2,
- dast: 3,
- secret_detection: 4,
- coverage_fuzzing: 5,
- api_fuzzing: 6,
- cluster_image_scanning: 7,
- generic: 99
- }.with_indifferent_access.freeze
- enum report_type: REPORT_TYPES
-
- sha_attribute :fingerprint
- sha_attribute :location_fingerprint
- end
-
- class VulnerabilityFindingSignature < ActiveRecord::Base
- include ShaAttribute
-
- self.table_name = 'vulnerability_finding_signatures'
- belongs_to :finding, foreign_key: 'finding_id', inverse_of: :signatures, class_name: 'VulnerabilitiesFinding'
-
- sha_attribute :signature_sha
- end
-
- class VulnerabilitiesFindingPipeline < ActiveRecord::Base
- include EachBatch
- self.table_name = "vulnerability_occurrence_pipelines"
- end
-
- class Vulnerability < ActiveRecord::Base
- include EachBatch
- self.table_name = "vulnerabilities"
- end
-
- class CalculateFindingUUID
- FINDING_NAMESPACES_IDS = {
- development: "a143e9e2-41b3-47bc-9a19-081d089229f4",
- test: "a143e9e2-41b3-47bc-9a19-081d089229f4",
- staging: "a6930898-a1b2-4365-ab18-12aa474d9b26",
- production: "58dc0f06-936c-43b3-93bb-71693f1b6570"
- }.freeze
-
- NAMESPACE_REGEX = /(\h{8})-(\h{4})-(\h{4})-(\h{4})-(\h{4})(\h{8})/.freeze
- PACK_PATTERN = "NnnnnN"
-
- def self.call(value)
- Digest::UUID.uuid_v5(namespace_id, value)
- end
-
- def self.namespace_id
- namespace_uuid = FINDING_NAMESPACES_IDS.fetch(Rails.env.to_sym)
- # Digest::UUID is broken when using an UUID in namespace_id
- # https://github.com/rails/rails/issues/37681#issue-520718028
- namespace_uuid.scan(NAMESPACE_REGEX).flatten.map { |s| s.to_i(16) }.pack(PACK_PATTERN)
- end
- end
- # rubocop: enable Gitlab/NamespacedClass
-
- # rubocop: disable Metrics/AbcSize,Metrics/MethodLength,Metrics/BlockLength
- def perform(start_id, end_id)
- log_info('Migration started', start_id: start_id, end_id: end_id)
-
- VulnerabilitiesFinding
- .joins(:primary_identifier)
- .includes(:signatures)
- .select(:id, :report_type, :primary_identifier_id, :fingerprint, :location_fingerprint, :project_id, :created_at, :vulnerability_id, :uuid)
- .where(id: start_id..end_id)
- .each_batch(of: 50) do |relation|
- duplicates = find_duplicates(relation)
- remove_findings(ids: duplicates) if duplicates.present?
-
- to_update = relation.reject { |finding| duplicates.include?(finding.id) }
-
- begin
- known_uuids = Set.new
- to_be_deleted = []
-
- mappings = to_update.each_with_object({}) do |finding, hash|
- uuid = calculate_uuid_v5_for_finding(finding)
-
- if known_uuids.add?(uuid)
- hash[finding] = { uuid: uuid }
- else
- to_be_deleted << finding.id
- end
- end
-
- # It is technically still possible to have duplicate uuids
- # if the data integrity is broken somehow and the primary identifiers of
- # the findings are pointing to different projects with the same fingerprint values.
- if to_be_deleted.present?
- log_info('Conflicting UUIDs found within the batch', finding_ids: to_be_deleted)
-
- remove_findings(ids: to_be_deleted)
- end
-
- ::Gitlab::Database::BulkUpdate.execute(%i[uuid], mappings) if mappings.present?
-
- log_info('Recalculation is done', finding_ids: mappings.keys.pluck(:id))
- rescue ActiveRecord::RecordNotUnique => error
- log_info('RecordNotUnique error received')
-
- match_data = /\(uuid\)=\((?<uuid>\S{36})\)/.match(error.message)
-
- # This exception returns the **correct** UUIDv5 which probably comes from a later record
- # and it's the one we can drop in the easiest way before retrying the UPDATE query
- if match_data
- uuid = match_data[:uuid]
- log_info('Conflicting UUID found', uuid: uuid)
-
- id = VulnerabilitiesFinding.find_by(uuid: uuid)&.id
- remove_findings(ids: id) if id
- retry
- else
- log_error('Couldnt find conflicting uuid')
-
- Gitlab::ErrorTracking.track_and_raise_exception(error)
- end
- end
- end
-
- mark_job_as_succeeded(start_id, end_id)
- rescue StandardError => error
- log_error('An exception happened')
-
- Gitlab::ErrorTracking.track_and_raise_exception(error)
- end
- # rubocop: disable Metrics/AbcSize,Metrics/MethodLength,Metrics/BlockLength
-
- private
-
- def find_duplicates(relation)
- to_exclude = []
- relation.flat_map do |record|
- # Assuming we're scanning id 31 and the duplicate is id 40
- # first we'd process 31 and add 40 to the list of ids to remove
- # then we would process record 40 and add 31 to the list of removals
- # so we would drop both records
- to_exclude << record.id
-
- VulnerabilitiesFinding.where(
- report_type: record.report_type,
- location_fingerprint: record.location_fingerprint,
- primary_identifier_id: record.primary_identifier_id,
- project_id: record.project_id
- ).where.not(id: to_exclude).pluck(:id)
- end
- end
-
- def remove_findings(ids:)
- ids = Array(ids)
- log_info('Removing Findings and associated records', ids: ids)
-
- vulnerability_ids = VulnerabilitiesFinding.where(id: ids).pluck(:vulnerability_id).uniq.compact
-
- VulnerabilitiesFindingPipeline.where(occurrence_id: ids).each_batch { |batch| batch.delete_all }
- Vulnerability.where(id: vulnerability_ids).each_batch { |batch| batch.delete_all }
- VulnerabilitiesFinding.where(id: ids).delete_all
- end
-
- def calculate_uuid_v5_for_finding(vulnerability_finding)
- return unless vulnerability_finding
-
- signatures = vulnerability_finding.signatures.sort_by { |signature| signature.algorithm_type_before_type_cast }
- location_fingerprint = signatures.last&.signature_sha || vulnerability_finding.location_fingerprint
-
- uuid_v5_name_components = {
- report_type: vulnerability_finding.report_type,
- primary_identifier_fingerprint: vulnerability_finding.fingerprint,
- location_fingerprint: location_fingerprint,
- project_id: vulnerability_finding.project_id
- }
-
- name = uuid_v5_name_components.values.join('-')
-
- CalculateFindingUUID.call(name)
- end
-
- def log_info(message, **extra)
- logger.info(migrator: 'RecalculateVulnerabilitiesOccurrencesUuid', message: message, **extra)
- end
-
- def log_error(message, **extra)
- logger.error(migrator: 'RecalculateVulnerabilitiesOccurrencesUuid', message: message, **extra)
- end
-
- def logger
- @logger ||= Gitlab::BackgroundMigration::Logger.build
- end
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'RecalculateVulnerabilitiesOccurrencesUuid',
- arguments
- )
- end
-end
diff --git a/lib/gitlab/background_migration/recalculate_vulnerability_finding_signatures_for_findings.rb b/lib/gitlab/background_migration/recalculate_vulnerability_finding_signatures_for_findings.rb
deleted file mode 100644
index 20200a1d508..00000000000
--- a/lib/gitlab/background_migration/recalculate_vulnerability_finding_signatures_for_findings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop: disable Style/Documentation
- class RecalculateVulnerabilityFindingSignaturesForFindings
- def perform(start_id, stop_id)
- end
- end
- end
-end
-
-Gitlab::BackgroundMigration::RecalculateVulnerabilityFindingSignaturesForFindings.prepend_mod
diff --git a/lib/gitlab/background_migration/remove_all_trace_expiration_dates.rb b/lib/gitlab/background_migration/remove_all_trace_expiration_dates.rb
deleted file mode 100644
index d47aa76f24b..00000000000
--- a/lib/gitlab/background_migration/remove_all_trace_expiration_dates.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Removing expire_at timestamps that shouldn't have
- # been written to traces on gitlab.com.
- class RemoveAllTraceExpirationDates
- include Gitlab::Database::MigrationHelpers
-
- BATCH_SIZE = 1_000
-
- # Stubbed class to connect to the CI database
- # connects_to has to be called in abstract classes.
- class MultiDbAdaptableClass < ActiveRecord::Base
- self.abstract_class = true
-
- if Gitlab::Database.has_config?(:ci)
- connects_to database: { writing: :ci, reading: :ci }
- end
- end
-
- # Stubbed class to access the ci_job_artifacts table
- class JobArtifact < MultiDbAdaptableClass
- include EachBatch
-
- self.table_name = 'ci_job_artifacts'
-
- TARGET_TIMESTAMPS = [
- Date.new(2021, 04, 22).midnight.utc,
- Date.new(2021, 05, 22).midnight.utc,
- Date.new(2021, 06, 22).midnight.utc,
- Date.new(2022, 01, 22).midnight.utc,
- Date.new(2022, 02, 22).midnight.utc,
- Date.new(2022, 03, 22).midnight.utc,
- Date.new(2022, 04, 22).midnight.utc
- ].freeze
-
- scope :traces, -> { where(file_type: 3) }
- scope :between, -> (start_id, end_id) { where(id: start_id..end_id) }
- scope :in_targeted_timestamps, -> { where(expire_at: TARGET_TIMESTAMPS) }
- end
-
- def perform(start_id, end_id)
- return unless Gitlab.com?
-
- JobArtifact.traces
- .between(start_id, end_id)
- .in_targeted_timestamps
- .each_batch(of: BATCH_SIZE) { |batch| batch.update_all(expire_at: nil) }
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/remove_vulnerability_finding_links.rb b/lib/gitlab/background_migration/remove_vulnerability_finding_links.rb
deleted file mode 100644
index 4acef9029f9..00000000000
--- a/lib/gitlab/background_migration/remove_vulnerability_finding_links.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Remove vulnerability finding link records
- # The records will be repopulated from the `raw_metadata`
- # column of `vulnerability_occurrences` once the unique
- # index is in place.
- class RemoveVulnerabilityFindingLinks
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, stop_id)
- define_batchable_model('vulnerability_finding_links', connection: ApplicationRecord.connection)
- .where(id: start_id..stop_id)
- .delete_all
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb
deleted file mode 100644
index 190e2fc22fb..00000000000
--- a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A job to nullify duplicate runners_token_encrypted values in projects table in batches
- class ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects
- class Project < ActiveRecord::Base # rubocop:disable Style/Documentation
- include EachBatch
-
- self.table_name = 'projects'
-
- scope :base_query, -> { where.not(runners_token_encrypted: nil) }
- end
-
- def perform(start_id, end_id)
- # Reset duplicate runner tokens that would prevent creating an unique index.
- batch_records = Project.base_query.where(id: start_id..end_id)
-
- duplicate_tokens = Project.base_query
- .where(runners_token_encrypted: batch_records.select(:runners_token_encrypted).distinct)
- .group(:runners_token_encrypted)
- .having('COUNT(*) > 1')
- .pluck(:runners_token_encrypted)
-
- batch_records.where(runners_token_encrypted: duplicate_tokens).update_all(runners_token_encrypted: nil) if duplicate_tokens.any?
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- ::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects.rb b/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects.rb
deleted file mode 100644
index b58eefa0ab3..00000000000
--- a/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A job to nullify duplicate ci_runners_token values in projects table in batches
- class ResetDuplicateCiRunnersTokenValuesOnProjects
- class Project < ActiveRecord::Base # rubocop:disable Style/Documentation
- include EachBatch
-
- self.table_name = 'projects'
-
- scope :base_query, -> { where.not(runners_token: nil) }
- end
-
- def perform(start_id, end_id)
- # Reset duplicate runner tokens that would prevent creating an unique index.
- batch_records = Project.base_query.where(id: start_id..end_id)
-
- duplicate_tokens = Project.base_query
- .where(runners_token: batch_records.select(:runners_token).distinct)
- .group(:runners_token)
- .having('COUNT(*) > 1')
- .pluck(:runners_token)
-
- batch_records.where(runners_token: duplicate_tokens).update_all(runners_token: nil) if duplicate_tokens.any?
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- ::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/update_timelogs_null_spent_at.rb b/lib/gitlab/background_migration/update_timelogs_null_spent_at.rb
deleted file mode 100644
index b61f2ee7f4c..00000000000
--- a/lib/gitlab/background_migration/update_timelogs_null_spent_at.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Class to populate spent_at for timelogs
- class UpdateTimelogsNullSpentAt
- include Gitlab::Database::DynamicModelHelpers
-
- BATCH_SIZE = 100
-
- def perform(start_id, stop_id)
- define_batchable_model('timelogs', connection: connection)
- .where(spent_at: nil, id: start_id..stop_id)
- .each_batch(of: 100) do |subbatch|
- batch_start, batch_end = subbatch.pick('min(id), max(id)')
-
- update_timelogs(batch_start, batch_end)
- end
- end
-
- def update_timelogs(batch_start, batch_stop)
- execute(<<~SQL)
- UPDATE timelogs
- SET spent_at = created_at
- WHERE spent_at IS NULL
- AND timelogs.id BETWEEN #{batch_start} AND #{batch_stop};
- SQL
- end
-
- def connection
- @connection ||= ApplicationRecord.connection
- end
-
- def execute(sql)
- connection.execute(sql)
- end
- end
- end
-end
diff --git a/spec/features/markdown/markdown_spec.rb b/spec/features/markdown/markdown_spec.rb
index 9bb0220004a..eb86393d59e 100644
--- a/spec/features/markdown/markdown_spec.rb
+++ b/spec/features/markdown/markdown_spec.rb
@@ -221,11 +221,25 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures, feature_category: :team_p
context 'default pipeline' do
before do
+ stub_feature_flags(disable_all_mention: false)
+
@html = markdown(@feat.raw_markdown)
end
it_behaves_like 'all pipelines'
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ @html = markdown(@feat.raw_markdown)
+ end
+
+ it 'includes custom filters' do
+ expect(doc).to reference_users_excluding_all
+ end
+ end
+
it 'includes custom filters' do
aggregate_failures 'UploadLinkFilter' do
expect(doc).to parse_upload_links
@@ -308,6 +322,8 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures, feature_category: :team_p
context 'wiki pipeline' do
before do
+ stub_feature_flags(disable_all_mention: false)
+
@wiki = @feat.wiki
@wiki_page = @feat.wiki_page
@@ -320,6 +336,27 @@ RSpec.describe 'GitLab Markdown', :aggregate_failures, feature_category: :team_p
@html = markdown(@feat.raw_markdown, { pipeline: :wiki, wiki: @wiki, page_slug: @wiki_page.slug })
end
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ @wiki = @feat.wiki
+ @wiki_page = @feat.wiki_page
+
+ name = 'example.jpg'
+ path = "images/#{name}"
+ blob = double(name: name, path: path, mime_type: 'image/jpeg', data: nil)
+ expect(@wiki).to receive(:find_file).with(path, load_content: false).and_return(Gitlab::Git::WikiFile.new(blob))
+ allow(@wiki).to receive(:wiki_base_path) { '/namespace1/gitlabhq/wikis' }
+
+ @html = markdown(@feat.raw_markdown, { pipeline: :wiki, wiki: @wiki, page_slug: @wiki_page.slug })
+ end
+
+ it 'includes custom filters' do
+ expect(doc).to reference_users_excluding_all
+ end
+ end
+
it_behaves_like 'all pipelines'
it 'includes custom filters' do
diff --git a/spec/fixtures/markdown.md.erb b/spec/fixtures/markdown.md.erb
index fa73cd53a66..37376713355 100644
--- a/spec/fixtures/markdown.md.erb
+++ b/spec/fixtures/markdown.md.erb
@@ -173,7 +173,7 @@ References should be parseable even inside _<%= merge_request.to_reference %>_ e
#### UserReferenceFilter
-- All: @all
+- All: @all (ignored when the feature flag `disable_all_mention` is enabled)
- User: <%= user.to_reference %>
- Group: <%= group.to_reference %>
- Ignores invalid: <%= User.reference_prefix %>fake_user
diff --git a/spec/frontend/fixtures/merge_requests.rb b/spec/frontend/fixtures/merge_requests.rb
index b6f6d149756..a1896a6470b 100644
--- a/spec/frontend/fixtures/merge_requests.rb
+++ b/spec/frontend/fixtures/merge_requests.rb
@@ -114,6 +114,10 @@ RSpec.describe Projects::MergeRequestsController, '(JavaScript fixtures)', type:
let(:group) { create(:group) }
let(:description) { "@#{group.full_path} @all @#{user.username}" }
+ before do
+ stub_feature_flags(disable_all_mention: false)
+ end
+
it 'merge_requests/merge_request_with_mentions.html' do
render_merge_request(merge_request)
end
diff --git a/spec/frontend/user_popovers_spec.js b/spec/frontend/user_popovers_spec.js
index 3346735055d..6f39eb9a118 100644
--- a/spec/frontend/user_popovers_spec.js
+++ b/spec/frontend/user_popovers_spec.js
@@ -121,6 +121,8 @@ describe('User Popovers', () => {
expect(findPopovers().length).toBe(0);
});
+ // TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/18442
+ // Remove as @all is deprecated.
it('does not initialize the popovers for @all references', () => {
const [projectLink] = Array.from(document.querySelectorAll('.js-user-link[data-project]'));
diff --git a/spec/lib/banzai/filter/references/user_reference_filter_spec.rb b/spec/lib/banzai/filter/references/user_reference_filter_spec.rb
index e248f2d9b1c..276701a2984 100644
--- a/spec/lib/banzai/filter/references/user_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/references/user_reference_filter_spec.rb
@@ -39,10 +39,30 @@ RSpec.describe Banzai::Filter::References::UserReferenceFilter, feature_category
end
end
- context 'mentioning @all' do
+ context 'when `disable_all_mention` FF is enabled' do
+ let(:reference) { User.reference_prefix + 'all' }
+
+ context 'mentioning @all' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ project.add_developer(project.creator)
+ end
+
+ it 'ignores reference to @all' do
+ doc = reference_filter("Hey #{reference}", author: project.creator)
+
+ expect(doc.css('a').length).to eq 0
+ end
+ end
+ end
+
+ context 'mentioning @all (when `disable_all_mention` FF is disabled)' do
let(:reference) { User.reference_prefix + 'all' }
before do
+ stub_feature_flags(disable_all_mention: false)
+
project.add_developer(project.creator)
end
@@ -161,6 +181,7 @@ RSpec.describe Banzai::Filter::References::UserReferenceFilter, feature_category
let(:context) { { author: group_member, project: nil, group: group } }
it 'supports a special @all mention' do
+ stub_feature_flags(disable_all_mention: false)
reference = User.reference_prefix + 'all'
doc = reference_filter("Hey #{reference}", context)
diff --git a/spec/lib/gitlab/background_migration/backfill_ci_queuing_tables_spec.rb b/spec/lib/gitlab/background_migration/backfill_ci_queuing_tables_spec.rb
deleted file mode 100644
index aaf8c124a83..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_ci_queuing_tables_spec.rb
+++ /dev/null
@@ -1,245 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillCiQueuingTables, :migration,
- :suppress_gitlab_schemas_validate_connection, schema: 20220208115439 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:ci_cd_settings) { table(:project_ci_cd_settings) }
- let(:builds) { table(:ci_builds) }
- let(:queuing_entries) { table(:ci_pending_builds) }
- let(:tags) { table(:tags) }
- let(:taggings) { table(:taggings) }
-
- subject { described_class.new }
-
- describe '#perform' do
- let!(:namespace) do
- namespaces.create!(
- id: 10,
- name: 'namespace10',
- path: 'namespace10',
- traversal_ids: [10])
- end
-
- let!(:other_namespace) do
- namespaces.create!(
- id: 11,
- name: 'namespace11',
- path: 'namespace11',
- traversal_ids: [11])
- end
-
- let!(:project) do
- projects.create!(id: 5, namespace_id: 10, name: 'test1', path: 'test1')
- end
-
- let!(:ci_cd_setting) do
- ci_cd_settings.create!(id: 5, project_id: 5, group_runners_enabled: true)
- end
-
- let!(:other_project) do
- projects.create!(id: 7, namespace_id: 11, name: 'test2', path: 'test2')
- end
-
- let!(:other_ci_cd_setting) do
- ci_cd_settings.create!(id: 7, project_id: 7, group_runners_enabled: false)
- end
-
- let!(:another_project) do
- projects.create!(id: 9, namespace_id: 10, name: 'test3', path: 'test3', shared_runners_enabled: false)
- end
-
- let!(:ruby_tag) do
- tags.create!(id: 22, name: 'ruby')
- end
-
- let!(:postgres_tag) do
- tags.create!(id: 23, name: 'postgres')
- end
-
- it 'creates ci_pending_builds for all pending builds in range' do
- builds.create!(id: 50, status: :pending, name: 'test1', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 51, status: :created, name: 'test2', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 52, status: :pending, name: 'test3', project_id: 5, protected: true, type: 'Ci::Build')
-
- taggings.create!(taggable_id: 52, taggable_type: 'CommitStatus', tag_id: 22)
- taggings.create!(taggable_id: 52, taggable_type: 'CommitStatus', tag_id: 23)
-
- builds.create!(id: 60, status: :pending, name: 'test1', project_id: 7, type: 'Ci::Build')
- builds.create!(id: 61, status: :running, name: 'test2', project_id: 7, protected: true, type: 'Ci::Build')
- builds.create!(id: 62, status: :pending, name: 'test3', project_id: 7, type: 'Ci::Build')
-
- taggings.create!(taggable_id: 60, taggable_type: 'CommitStatus', tag_id: 23)
- taggings.create!(taggable_id: 62, taggable_type: 'CommitStatus', tag_id: 22)
-
- builds.create!(id: 70, status: :pending, name: 'test1', project_id: 9, protected: true, type: 'Ci::Build')
- builds.create!(id: 71, status: :failed, name: 'test2', project_id: 9, type: 'Ci::Build')
- builds.create!(id: 72, status: :pending, name: 'test3', project_id: 9, type: 'Ci::Build')
-
- taggings.create!(taggable_id: 71, taggable_type: 'CommitStatus', tag_id: 22)
-
- subject.perform(1, 100)
-
- expect(queuing_entries.all).to contain_exactly(
- an_object_having_attributes(
- build_id: 50,
- project_id: 5,
- namespace_id: 10,
- protected: false,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: [],
- namespace_traversal_ids: [10]),
- an_object_having_attributes(
- build_id: 52,
- project_id: 5,
- namespace_id: 10,
- protected: true,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: match_array([22, 23]),
- namespace_traversal_ids: [10]),
- an_object_having_attributes(
- build_id: 60,
- project_id: 7,
- namespace_id: 11,
- protected: false,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: [23],
- namespace_traversal_ids: []),
- an_object_having_attributes(
- build_id: 62,
- project_id: 7,
- namespace_id: 11,
- protected: false,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: [22],
- namespace_traversal_ids: []),
- an_object_having_attributes(
- build_id: 70,
- project_id: 9,
- namespace_id: 10,
- protected: true,
- instance_runners_enabled: false,
- minutes_exceeded: false,
- tag_ids: [],
- namespace_traversal_ids: []),
- an_object_having_attributes(
- build_id: 72,
- project_id: 9,
- namespace_id: 10,
- protected: false,
- instance_runners_enabled: false,
- minutes_exceeded: false,
- tag_ids: [],
- namespace_traversal_ids: [])
- )
- end
-
- it 'skips builds that already have ci_pending_builds' do
- builds.create!(id: 50, status: :pending, name: 'test1', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 51, status: :created, name: 'test2', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 52, status: :pending, name: 'test3', project_id: 5, protected: true, type: 'Ci::Build')
-
- taggings.create!(taggable_id: 50, taggable_type: 'CommitStatus', tag_id: 22)
- taggings.create!(taggable_id: 52, taggable_type: 'CommitStatus', tag_id: 23)
-
- queuing_entries.create!(build_id: 50, project_id: 5, namespace_id: 10)
-
- subject.perform(1, 100)
-
- expect(queuing_entries.all).to contain_exactly(
- an_object_having_attributes(
- build_id: 50,
- project_id: 5,
- namespace_id: 10,
- protected: false,
- instance_runners_enabled: false,
- minutes_exceeded: false,
- tag_ids: [],
- namespace_traversal_ids: []),
- an_object_having_attributes(
- build_id: 52,
- project_id: 5,
- namespace_id: 10,
- protected: true,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: [23],
- namespace_traversal_ids: [10])
- )
- end
-
- it 'upserts values in case of conflicts' do
- builds.create!(id: 50, status: :pending, name: 'test1', project_id: 5, type: 'Ci::Build')
- queuing_entries.create!(build_id: 50, project_id: 5, namespace_id: 10)
-
- build = described_class::Ci::Build.find(50)
- described_class::Ci::PendingBuild.upsert_from_build!(build)
-
- expect(queuing_entries.all).to contain_exactly(
- an_object_having_attributes(
- build_id: 50,
- project_id: 5,
- namespace_id: 10,
- protected: false,
- instance_runners_enabled: true,
- minutes_exceeded: false,
- tag_ids: [],
- namespace_traversal_ids: [10])
- )
- end
- end
-
- context 'Ci::Build' do
- describe '.each_batch' do
- let(:model) { described_class::Ci::Build }
-
- before do
- builds.create!(id: 1, status: :pending, name: 'test1', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 2, status: :pending, name: 'test2', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 3, status: :pending, name: 'test3', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 4, status: :pending, name: 'test4', project_id: 5, type: 'Ci::Build')
- builds.create!(id: 5, status: :pending, name: 'test5', project_id: 5, type: 'Ci::Build')
- end
-
- it 'yields an ActiveRecord::Relation when a block is given' do
- model.each_batch do |relation|
- expect(relation).to be_a_kind_of(ActiveRecord::Relation)
- end
- end
-
- it 'yields a batch index as the second argument' do
- model.each_batch do |_, index|
- expect(index).to eq(1)
- end
- end
-
- it 'accepts a custom batch size' do
- amount = 0
-
- model.each_batch(of: 1) { amount += 1 }
-
- expect(amount).to eq(5)
- end
-
- it 'does not include ORDER BYs in the yielded relations' do
- model.each_batch do |relation|
- expect(relation.to_sql).not_to include('ORDER BY')
- end
- end
-
- it 'orders ascending' do
- ids = []
-
- model.each_batch(of: 1) { |rel| ids.concat(rel.ids) }
-
- expect(ids).to eq(ids.sort)
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_spec.rb b/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_spec.rb
deleted file mode 100644
index 84611c88806..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillDraftStatusOnMergeRequests, :migration, schema: 20220326161803 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:merge_requests) { table(:merge_requests) }
-
- let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') }
- let(:project) { projects.create!(namespace_id: group.id) }
-
- let(:draft_prefixes) { ["[Draft]", "(Draft)", "Draft:", "Draft", "[WIP]", "WIP:", "WIP"] }
-
- def create_merge_request(params)
- common_params = {
- target_project_id: project.id,
- target_branch: 'feature1',
- source_branch: 'master'
- }
-
- merge_requests.create!(common_params.merge(params))
- end
-
- context "for MRs with #draft? == true titles but draft attribute false" do
- let(:mr_ids) { merge_requests.all.collect(&:id) }
-
- before do
- draft_prefixes.each do |prefix|
- (1..4).each do |n|
- create_merge_request(
- title: "#{prefix} This is a title",
- draft: false,
- state_id: n
- )
- end
- end
- end
-
- it "updates all eligible draft merge request's draft field to true" do
- mr_count = merge_requests.all.count
-
- expect { subject.perform(mr_ids.first, mr_ids.last) }
- .to change { MergeRequest.where(draft: false).count }
- .from(mr_count).to(mr_count - draft_prefixes.length)
- end
-
- it "marks successful slices as completed" do
- expect(subject).to receive(:mark_job_as_succeeded).with(mr_ids.first, mr_ids.last)
-
- subject.perform(mr_ids.first, mr_ids.last)
- end
-
- it_behaves_like 'marks background migration job records' do
- let!(:non_eligible_mrs) do
- Array.new(2) do
- create_merge_request(
- title: "Not a d-r-a-f-t 1",
- draft: false,
- state_id: 1
- )
- end
- end
-
- let(:arguments) { [non_eligible_mrs.first.id, non_eligible_mrs.last.id] }
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex_spec.rb b/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex_spec.rb
deleted file mode 100644
index e6e10977143..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex_spec.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillDraftStatusOnMergeRequestsWithCorrectedRegex,
- :migration, schema: 20220326161803 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:merge_requests) { table(:merge_requests) }
-
- let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') }
- let(:project) { projects.create!(namespace_id: group.id) }
-
- let(:draft_prefixes) { ["[Draft]", "(Draft)", "Draft:", "Draft", "[WIP]", "WIP:", "WIP"] }
-
- def create_merge_request(params)
- common_params = {
- target_project_id: project.id,
- target_branch: 'feature1',
- source_branch: 'master'
- }
-
- merge_requests.create!(common_params.merge(params))
- end
-
- context "for MRs with #draft? == true titles but draft attribute false" do
- let(:mr_ids) { merge_requests.all.collect(&:id) }
-
- before do
- draft_prefixes.each do |prefix|
- (1..4).each do |n|
- create_merge_request(
- title: "#{prefix} This is a title",
- draft: false,
- state_id: n
- )
-
- create_merge_request(
- title: "This is a title with the #{prefix} in a weird spot",
- draft: false,
- state_id: n
- )
- end
- end
- end
-
- it "updates all eligible draft merge request's draft field to true" do
- mr_count = merge_requests.all.count
-
- expect { subject.perform(mr_ids.first, mr_ids.last) }
- .to change { MergeRequest.where(draft: false).count }
- .from(mr_count).to(mr_count - draft_prefixes.length)
- end
-
- it "marks successful slices as completed" do
- expect(subject).to receive(:mark_job_as_succeeded).with(mr_ids.first, mr_ids.last)
-
- subject.perform(mr_ids.first, mr_ids.last)
- end
-
- it_behaves_like 'marks background migration job records' do
- let!(:non_eligible_mrs) do
- Array.new(2) do
- create_merge_request(
- title: "Not a d-r-a-f-t 1",
- draft: false,
- state_id: 1
- )
- end
- end
-
- let(:arguments) { [non_eligible_mrs.first.id, non_eligible_mrs.last.id] }
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_group_features_spec.rb b/spec/lib/gitlab/background_migration/backfill_group_features_spec.rb
deleted file mode 100644
index 023d4b04e63..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_group_features_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillGroupFeatures, :migration, schema: 20220302114046 do
- let(:group_features) { table(:group_features) }
- let(:namespaces) { table(:namespaces) }
-
- subject do
- described_class.new(
- start_id: 1,
- end_id: 4,
- batch_table: :namespaces,
- batch_column: :id,
- sub_batch_size: 10,
- pause_ms: 0,
- job_arguments: [4],
- connection: ActiveRecord::Base.connection
- )
- end
-
- describe '#perform' do
- it 'creates settings for all group namespaces in range' do
- namespaces.create!(id: 1, name: 'group1', path: 'group1', type: 'Group')
- namespaces.create!(id: 2, name: 'user', path: 'user')
- namespaces.create!(id: 3, name: 'group2', path: 'group2', type: 'Group')
-
- # Checking that no error is raised if the group_feature for a group already exists
- namespaces.create!(id: 4, name: 'group3', path: 'group3', type: 'Group')
- group_features.create!(id: 1, group_id: 4)
- expect(group_features.count).to eq 1
-
- expect { subject.perform }.to change { group_features.count }.by(2)
-
- expect(group_features.count).to eq 3
- expect(group_features.all.pluck(:group_id)).to contain_exactly(1, 3, 4)
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_integrations_type_new_spec.rb b/spec/lib/gitlab/background_migration/backfill_integrations_type_new_spec.rb
deleted file mode 100644
index e6588644b4f..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_integrations_type_new_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillIntegrationsTypeNew, :migration, schema: 20220212120735 do
- let(:migration) { described_class.new }
- let(:integrations) { table(:integrations) }
-
- let(:namespaced_integrations) do
- Set.new(
- %w[
- Asana Assembla Bamboo Bugzilla Buildkite Campfire Confluence CustomIssueTracker Datadog
- Discord DroneCi EmailsOnPush Ewm ExternalWiki Flowdock HangoutsChat Harbor Irker Jenkins Jira Mattermost
- MattermostSlashCommands MicrosoftTeams MockCi MockMonitoring Packagist PipelinesEmail Pivotaltracker
- Prometheus Pushover Redmine Shimo Slack SlackSlashCommands Teamcity UnifyCircuit WebexTeams Youtrack Zentao
- Github GitlabSlackApplication
- ]).freeze
- end
-
- before do
- integrations.connection.execute 'ALTER TABLE integrations DISABLE TRIGGER "trigger_type_new_on_insert"'
-
- namespaced_integrations.each_with_index do |type, i|
- integrations.create!(id: i + 1, type: "#{type}Service")
- end
-
- integrations.create!(id: namespaced_integrations.size + 1, type: 'LegacyService')
- ensure
- integrations.connection.execute 'ALTER TABLE integrations ENABLE TRIGGER "trigger_type_new_on_insert"'
- end
-
- it 'backfills `type_new` for the selected records' do
- # We don't want to mock `Kernel.sleep`, so instead we mock it on the migration
- # class before it gets forwarded.
- expect(migration).to receive(:sleep).with(0.05).exactly(5).times
-
- queries = ActiveRecord::QueryRecorder.new do
- migration.perform(2, 10, :integrations, :id, 2, 50)
- end
-
- expect(queries.count).to be(16)
- expect(queries.log.grep(/^SELECT/).size).to be(11)
- expect(queries.log.grep(/^UPDATE/).size).to be(5)
- expect(queries.log.grep(/^UPDATE/).join.scan(/WHERE .*/)).to eq(
- [
- 'WHERE integrations.id BETWEEN 2 AND 3',
- 'WHERE integrations.id BETWEEN 4 AND 5',
- 'WHERE integrations.id BETWEEN 6 AND 7',
- 'WHERE integrations.id BETWEEN 8 AND 9',
- 'WHERE integrations.id BETWEEN 10 AND 10'
- ])
-
- expect(integrations.where(id: 2..10).pluck(:type, :type_new)).to contain_exactly(
- ['AssemblaService', 'Integrations::Assembla'],
- ['BambooService', 'Integrations::Bamboo'],
- ['BugzillaService', 'Integrations::Bugzilla'],
- ['BuildkiteService', 'Integrations::Buildkite'],
- ['CampfireService', 'Integrations::Campfire'],
- ['ConfluenceService', 'Integrations::Confluence'],
- ['CustomIssueTrackerService', 'Integrations::CustomIssueTracker'],
- ['DatadogService', 'Integrations::Datadog'],
- ['DiscordService', 'Integrations::Discord']
- )
-
- expect(integrations.where.not(id: 2..10)).to all(have_attributes(type_new: nil))
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_issue_search_data_spec.rb b/spec/lib/gitlab/background_migration/backfill_issue_search_data_spec.rb
deleted file mode 100644
index f98aea2dda7..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_issue_search_data_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillIssueSearchData, :migration, schema: 20220326161803 do
- let(:namespaces_table) { table(:namespaces) }
- let(:projects_table) { table(:projects) }
- let(:issue_search_data_table) { table(:issue_search_data) }
-
- let!(:namespace) { namespaces_table.create!(name: 'gitlab-org', path: 'gitlab-org') }
- let!(:project) { projects_table.create!(name: 'gitlab', path: 'gitlab-org/gitlab-ce', namespace_id: namespace.id) }
- let!(:issues) { Array.new(10) { table(:issues).create!(project_id: project.id, title: 'test title', description: 'test description') } }
-
- let(:migration) { described_class.new }
-
- before do
- allow(migration).to receive(:sleep)
- end
-
- it 'backfills search data for the specified records' do
- # sleeps for every sub-batch
- expect(migration).to receive(:sleep).with(0.05).exactly(3).times
-
- migration.perform(issues[0].id, issues[5].id, :issues, :id, 2, 50)
-
- expect(issue_search_data_table.count).to eq(6)
- end
-
- it 'skips issues that already have search data' do
- old_time = Time.new(2019, 1, 1).in_time_zone
- issue_search_data_table.create!(project_id: project.id, issue_id: issues[0].id, updated_at: old_time)
-
- migration.perform(issues[0].id, issues[5].id, :issues, :id, 2, 50)
-
- expect(issue_search_data_table.count).to eq(6)
- expect(issue_search_data_table.find_by_issue_id(issues[0].id).updated_at).to be_like_time(old_time)
- end
-
- it 'rescues batch with bad data and inserts other rows' do
- issues[1].update!(description: Array.new(30_000) { SecureRandom.hex }.join(' '))
-
- expect_next_instance_of(Gitlab::BackgroundMigration::Logger) do |logger|
- expect(logger).to receive(:error).with(a_hash_including(message: /string is too long for tsvector/, model_id: issues[1].id))
- end
-
- expect { migration.perform(issues[0].id, issues[5].id, :issues, :id, 2, 50) }.not_to raise_error
-
- expect(issue_search_data_table.count).to eq(5)
- expect(issue_search_data_table.find_by_issue_id(issues[1].id)).to eq(nil)
- end
-
- it 're-raises other errors' do
- allow(migration).to receive(:update_search_data).and_raise(ActiveRecord::StatementTimeout)
-
- expect { migration.perform(issues[0].id, issues[5].id, :issues, :id, 2, 50) }.to raise_error(ActiveRecord::StatementTimeout)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_member_namespace_for_group_members_spec.rb b/spec/lib/gitlab/background_migration/backfill_member_namespace_for_group_members_spec.rb
deleted file mode 100644
index e1ef12a1479..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_member_namespace_for_group_members_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillMemberNamespaceForGroupMembers, :migration, schema: 20220120211832 do
- let(:migration) { described_class.new }
- let(:members_table) { table(:members) }
- let(:namespaces_table) { table(:namespaces) }
-
- let(:table_name) { 'members' }
- let(:batch_column) { :id }
- let(:sub_batch_size) { 100 }
- let(:pause_ms) { 0 }
-
- subject(:perform_migration) { migration.perform(1, 10, table_name, batch_column, sub_batch_size, pause_ms) }
-
- before do
- namespaces_table.create!(id: 100, name: 'test1', path: 'test1', type: 'Group')
- namespaces_table.create!(id: 101, name: 'test2', path: 'test2', type: 'Group')
- namespaces_table.create!(id: 102, name: 'test3', path: 'test3', type: 'Group')
- namespaces_table.create!(id: 201, name: 'test4', path: 'test4', type: 'Project')
-
- members_table.create!(id: 1, source_id: 100, source_type: 'Namespace', type: 'GroupMember', member_namespace_id: nil, access_level: 10, notification_level: 3)
- members_table.create!(id: 2, source_id: 101, source_type: 'Namespace', type: 'GroupMember', member_namespace_id: nil, access_level: 10, notification_level: 3)
- members_table.create!(id: 3, source_id: 102, source_type: 'Namespace', type: 'GroupMember', member_namespace_id: 102, access_level: 10, notification_level: 3)
- members_table.create!(id: 4, source_id: 103, source_type: 'Project', type: 'ProjectMember', member_namespace_id: nil, access_level: 10, notification_level: 3)
- members_table.create!(id: 5, source_id: 104, source_type: 'Project', type: 'ProjectMember', member_namespace_id: 201, access_level: 10, notification_level: 3)
- end
-
- it 'backfills `member_namespace_id` for the selected records', :aggregate_failures do
- expect(members_table.where(type: 'GroupMember', member_namespace_id: nil).count).to eq 2
- expect(members_table.where(type: 'ProjectMember', member_namespace_id: nil).count).to eq 1
-
- queries = ActiveRecord::QueryRecorder.new do
- perform_migration
- end
-
- expect(queries.count).to eq(3)
- expect(members_table.where(type: 'GroupMember', member_namespace_id: nil).count).to eq 0
- expect(members_table.where(type: 'GroupMember').pluck(:member_namespace_id)).to match_array([100, 101, 102])
- expect(members_table.where(type: 'ProjectMember', member_namespace_id: nil).count).to eq 1
- expect(members_table.where(type: 'ProjectMember').pluck(:member_namespace_id)).to match_array([nil, 201])
- end
-
- it 'tracks timings of queries' do
- expect(migration.batch_metrics.timings).to be_empty
-
- expect { perform_migration }.to change { migration.batch_metrics.timings }
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route_spec.rb
deleted file mode 100644
index 3a8a327550b..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_namespace_id_for_namespace_route_spec.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceIdForNamespaceRoute, :migration, schema: 20220120123800 do
- let(:migration) { described_class.new }
- let(:namespaces_table) { table(:namespaces) }
- let(:projects_table) { table(:projects) }
- let(:routes_table) { table(:routes) }
-
- let(:table_name) { 'routes' }
- let(:batch_column) { :id }
- let(:sub_batch_size) { 200 }
- let(:pause_ms) { 0 }
-
- let(:namespace1) { namespaces_table.create!(name: 'namespace1', path: 'namespace1', type: 'User') }
- let(:namespace2) { namespaces_table.create!(name: 'namespace2', path: 'namespace2', type: 'Group') }
- let(:namespace3) { namespaces_table.create!(name: 'namespace3', path: 'namespace3', type: 'Group') }
- let(:namespace4) { namespaces_table.create!(name: 'namespace4', path: 'namespace4', type: 'Group') }
- let(:project1) { projects_table.create!(name: 'project1', namespace_id: namespace1.id) }
-
- subject(:perform_migration) { migration.perform(1, 10, table_name, batch_column, sub_batch_size, pause_ms) }
-
- before do
- routes_table.create!(
- id: 1, name: 'test1', path: 'test1', source_id: namespace1.id, source_type: namespace1.class.sti_name
- )
-
- routes_table.create!(
- id: 2, name: 'test2', path: 'test2', source_id: namespace2.id, source_type: namespace2.class.sti_name
- )
-
- routes_table.create!(
- id: 5, name: 'test3', path: 'test3', source_id: project1.id, source_type: project1.class.sti_name
- ) # should be ignored - project route
-
- routes_table.create!(
- id: 6, name: 'test4', path: 'test4', source_id: non_existing_record_id, source_type: namespace3.class.sti_name
- ) # should be ignored - invalid source_id
-
- routes_table.create!(
- id: 10, name: 'test5', path: 'test5', source_id: namespace3.id, source_type: namespace3.class.sti_name
- )
-
- routes_table.create!(
- id: 11, name: 'test6', path: 'test6', source_id: namespace4.id, source_type: namespace4.class.sti_name
- ) # should be ignored - outside the scope
- end
-
- it 'backfills `type` for the selected records', :aggregate_failures do
- perform_migration
-
- expect(routes_table.where.not(namespace_id: nil).pluck(:id)).to match_array([1, 2, 10])
- end
-
- it 'tracks timings of queries' do
- expect(migration.batch_metrics.timings).to be_empty
-
- expect { perform_migration }.to change { migration.batch_metrics.timings }
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb
deleted file mode 100644
index 525c236b644..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_project_settings_spec.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillProjectSettings, :migration, schema: 20220324165436 do
- let(:migration) { described_class.new }
- let(:namespaces_table) { table(:namespaces) }
- let(:projects_table) { table(:projects) }
- let(:project_settings_table) { table(:project_settings) }
-
- let(:table_name) { 'projects' }
- let(:batch_column) { :id }
- let(:sub_batch_size) { 2 }
- let(:pause_ms) { 0 }
-
- subject(:perform_migration) { migration.perform(1, 30, table_name, batch_column, sub_batch_size, pause_ms) }
-
- before do
- namespaces_table.create!(id: 1, name: 'namespace', path: 'namespace-path', type: 'Group')
- projects_table.create!(id: 11, name: 'group-project-1', path: 'group-project-path-1', namespace_id: 1)
- projects_table.create!(id: 12, name: 'group-project-2', path: 'group-project-path-2', namespace_id: 1)
- project_settings_table.create!(project_id: 11)
-
- namespaces_table.create!(id: 2, name: 'namespace', path: 'namespace-path', type: 'User')
- projects_table.create!(id: 21, name: 'user-project-1', path: 'user--project-path-1', namespace_id: 2)
- projects_table.create!(id: 22, name: 'user-project-2', path: 'user-project-path-2', namespace_id: 2)
- project_settings_table.create!(project_id: 21)
- end
-
- it 'backfills project settings when it does not exist', :aggregate_failures do
- expect(project_settings_table.count).to eq 2
-
- queries = ActiveRecord::QueryRecorder.new do
- perform_migration
- end
-
- expect(queries.count).to eq(5)
-
- expect(project_settings_table.count).to eq 4
- end
-end
diff --git a/spec/lib/gitlab/background_migration/batching_strategies/backfill_project_namespace_per_group_batching_strategy_spec.rb b/spec/lib/gitlab/background_migration/batching_strategies/backfill_project_namespace_per_group_batching_strategy_spec.rb
deleted file mode 100644
index dc0935efa94..00000000000
--- a/spec/lib/gitlab/background_migration/batching_strategies/backfill_project_namespace_per_group_batching_strategy_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BatchingStrategies::BackfillProjectNamespacePerGroupBatchingStrategy, '#next_batch', :migration, schema: 20220326161803 do
- let!(:namespaces) { table(:namespaces) }
- let!(:projects) { table(:projects) }
- let!(:background_migrations) { table(:batched_background_migrations) }
-
- let!(:namespace1) { namespaces.create!(name: 'batchtest1', type: 'Group', path: 'batch-test1') }
- let!(:namespace2) { namespaces.create!(name: 'batchtest2', type: 'Group', parent_id: namespace1.id, path: 'batch-test2') }
- let!(:namespace3) { namespaces.create!(name: 'batchtest3', type: 'Group', parent_id: namespace2.id, path: 'batch-test3') }
-
- let!(:project1) { projects.create!(name: 'project1', path: 'project1', namespace_id: namespace1.id, visibility_level: 20) }
- let!(:project2) { projects.create!(name: 'project2', path: 'project2', namespace_id: namespace2.id, visibility_level: 20) }
- let!(:project3) { projects.create!(name: 'project3', path: 'project3', namespace_id: namespace3.id, visibility_level: 20) }
- let!(:project4) { projects.create!(name: 'project4', path: 'project4', namespace_id: namespace3.id, visibility_level: 20) }
- let!(:batching_strategy) { described_class.new(connection: ActiveRecord::Base.connection) }
-
- let(:job_arguments) { [namespace1.id, 'up'] }
-
- context 'when starting on the first batch' do
- it 'returns the bounds of the next batch' do
- batch_bounds = batching_strategy.next_batch(:projects, :id, batch_min_value: project1.id, batch_size: 3, job_arguments: job_arguments)
-
- expect(batch_bounds).to match_array([project1.id, project3.id])
- end
- end
-
- context 'when additional batches remain' do
- it 'returns the bounds of the next batch' do
- batch_bounds = batching_strategy.next_batch(:projects, :id, batch_min_value: project2.id, batch_size: 3, job_arguments: job_arguments)
-
- expect(batch_bounds).to match_array([project2.id, project4.id])
- end
- end
-
- context 'when on the final batch' do
- it 'returns the bounds of the next batch' do
- batch_bounds = batching_strategy.next_batch(:projects, :id, batch_min_value: project4.id, batch_size: 3, job_arguments: job_arguments)
-
- expect(batch_bounds).to match_array([project4.id, project4.id])
- end
- end
-
- context 'when no additional batches remain' do
- it 'returns nil' do
- batch_bounds = batching_strategy.next_batch(:projects, :id, batch_min_value: project4.id + 1, batch_size: 1, job_arguments: job_arguments)
-
- expect(batch_bounds).to be_nil
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex_spec.rb b/spec/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex_spec.rb
deleted file mode 100644
index d1ef7ca2188..00000000000
--- a/spec/lib/gitlab/background_migration/cleanup_draft_data_from_faulty_regex_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::CleanupDraftDataFromFaultyRegex, :migration, schema: 20220326161803 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:merge_requests) { table(:merge_requests) }
-
- let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') }
- let(:project) { projects.create!(namespace_id: group.id) }
-
- let(:draft_prefixes) { ["[Draft]", "(Draft)", "Draft:", "Draft", "[WIP]", "WIP:", "WIP"] }
-
- def create_merge_request(params)
- common_params = {
- target_project_id: project.id,
- target_branch: 'feature1',
- source_branch: 'master'
- }
-
- merge_requests.create!(common_params.merge(params))
- end
-
- context "mr.draft == true, and title matches the leaky regex and not the corrected regex" do
- let(:mr_ids) { merge_requests.all.collect(&:id) }
-
- before do
- draft_prefixes.each do |prefix|
- (1..4).each do |n|
- create_merge_request(
- title: "#{prefix} This is a title",
- draft: true,
- state_id: 1
- )
- end
- end
-
- create_merge_request(title: "This has draft in the title", draft: true, state_id: 1)
- end
-
- it "updates all open draft merge request's draft field to true" do
- expect { subject.perform(mr_ids.first, mr_ids.last) }
- .to change { MergeRequest.where(draft: true).count }
- .by(-1)
- end
-
- it "marks successful slices as completed" do
- expect(subject).to receive(:mark_job_as_succeeded).with(mr_ids.first, mr_ids.last)
-
- subject.perform(mr_ids.first, mr_ids.last)
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/encrypt_integration_properties_spec.rb b/spec/lib/gitlab/background_migration/encrypt_integration_properties_spec.rb
deleted file mode 100644
index c788b701d79..00000000000
--- a/spec/lib/gitlab/background_migration/encrypt_integration_properties_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::EncryptIntegrationProperties, schema: 20220415124804 do
- let(:integrations) do
- table(:integrations) do |integrations|
- integrations.send :attr_encrypted, :encrypted_properties_tmp,
- attribute: :encrypted_properties,
- mode: :per_attribute_iv,
- key: ::Settings.attr_encrypted_db_key_base_32,
- algorithm: 'aes-256-gcm',
- marshal: true,
- marshaler: ::Gitlab::Json,
- encode: false,
- encode_iv: false
- end
- end
-
- let!(:no_properties) { integrations.create! }
- let!(:with_plaintext_1) { integrations.create!(properties: json_props(1)) }
- let!(:with_plaintext_2) { integrations.create!(properties: json_props(2)) }
- let!(:with_encrypted) do
- x = integrations.new
- x.properties = nil
- x.encrypted_properties_tmp = some_props(3)
- x.save!
- x
- end
-
- let(:start_id) { integrations.minimum(:id) }
- let(:end_id) { integrations.maximum(:id) }
-
- it 'ensures all properties are encrypted', :aggregate_failures do
- described_class.new.perform(start_id, end_id)
-
- props = integrations.all.to_h do |record|
- [record.id, [Gitlab::Json.parse(record.properties), record.encrypted_properties_tmp]]
- end
-
- expect(integrations.count).to eq(4)
-
- expect(props).to match(
- no_properties.id => both(be_nil),
- with_plaintext_1.id => both(eq some_props(1)),
- with_plaintext_2.id => both(eq some_props(2)),
- with_encrypted.id => match([be_nil, eq(some_props(3))])
- )
- end
-
- private
-
- def both(obj)
- match [obj, obj]
- end
-
- def some_props(id)
- HashWithIndifferentAccess.new({ id: id, foo: 1, bar: true, baz: %w[a string array] })
- end
-
- def json_props(id)
- some_props(id).to_json
- end
-end
diff --git a/spec/lib/gitlab/background_migration/encrypt_static_object_token_spec.rb b/spec/lib/gitlab/background_migration/encrypt_static_object_token_spec.rb
deleted file mode 100644
index 4e7b97d33f6..00000000000
--- a/spec/lib/gitlab/background_migration/encrypt_static_object_token_spec.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::EncryptStaticObjectToken do
- let(:users) { table(:users) }
- let!(:user_without_tokens) { create_user!(name: 'notoken') }
- let!(:user_with_plaintext_token_1) { create_user!(name: 'plaintext_1', token: 'token') }
- let!(:user_with_plaintext_token_2) { create_user!(name: 'plaintext_2', token: 'TOKEN') }
- let!(:user_with_plaintext_empty_token) { create_user!(name: 'plaintext_3', token: '') }
- let!(:user_with_encrypted_token) { create_user!(name: 'encrypted', encrypted_token: 'encrypted') }
- let!(:user_with_both_tokens) { create_user!(name: 'both', token: 'token2', encrypted_token: 'encrypted2') }
-
- before do
- allow(Gitlab::CryptoHelper).to receive(:aes256_gcm_encrypt).and_call_original
- allow(Gitlab::CryptoHelper).to receive(:aes256_gcm_encrypt).with('token') { 'secure_token' }
- allow(Gitlab::CryptoHelper).to receive(:aes256_gcm_encrypt).with('TOKEN') { 'SECURE_TOKEN' }
- end
-
- subject { described_class.new.perform(start_id, end_id) }
-
- let(:start_id) { users.minimum(:id) }
- let(:end_id) { users.maximum(:id) }
-
- it 'backfills encrypted tokens to users with plaintext token only', :aggregate_failures do
- subject
-
- new_state = users.pluck(:id, :static_object_token, :static_object_token_encrypted).to_h do |row|
- [row[0], [row[1], row[2]]]
- end
-
- expect(new_state.count).to eq(6)
-
- expect(new_state[user_with_plaintext_token_1.id]).to match_array(%w[token secure_token])
- expect(new_state[user_with_plaintext_token_2.id]).to match_array(%w[TOKEN SECURE_TOKEN])
-
- expect(new_state[user_with_plaintext_empty_token.id]).to match_array(['', nil])
- expect(new_state[user_without_tokens.id]).to match_array([nil, nil])
- expect(new_state[user_with_both_tokens.id]).to match_array(%w[token2 encrypted2])
- expect(new_state[user_with_encrypted_token.id]).to match_array([nil, 'encrypted'])
- end
-
- context 'when id range does not include existing user ids' do
- let(:arguments) { [non_existing_record_id, non_existing_record_id.succ] }
-
- it_behaves_like 'marks background migration job records' do
- subject { described_class.new }
- end
- end
-
- private
-
- def create_user!(name:, token: nil, encrypted_token: nil)
- email = "#{name}@example.com"
-
- table(:users).create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- static_object_token: token,
- static_object_token_encrypted: encrypted_token
- )
- end
-end
diff --git a/spec/lib/gitlab/background_migration/fix_duplicate_project_name_and_path_spec.rb b/spec/lib/gitlab/background_migration/fix_duplicate_project_name_and_path_spec.rb
deleted file mode 100644
index 65663d26f37..00000000000
--- a/spec/lib/gitlab/background_migration/fix_duplicate_project_name_and_path_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::FixDuplicateProjectNameAndPath, :migration, schema: 20220325155953 do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:routes) { table(:routes) }
-
- let(:namespace1) { namespaces.create!(name: 'batchtest1', type: 'Group', path: 'batch-test1') }
- let(:namespace2) { namespaces.create!(name: 'batchtest2', type: 'Group', parent_id: namespace1.id, path: 'batch-test2') }
- let(:namespace3) { namespaces.create!(name: 'batchtest3', type: 'Group', parent_id: namespace2.id, path: 'batch-test3') }
-
- let(:project_namespace2) { namespaces.create!(name: 'project2', path: 'project2', type: 'Project', parent_id: namespace2.id, visibility_level: 20) }
- let(:project_namespace3) { namespaces.create!(name: 'project3', path: 'project3', type: 'Project', parent_id: namespace3.id, visibility_level: 20) }
-
- let(:project1) { projects.create!(name: 'project1', path: 'project1', namespace_id: namespace1.id, visibility_level: 20) }
- let(:project2) { projects.create!(name: 'project2', path: 'project2', namespace_id: namespace2.id, project_namespace_id: project_namespace2.id, visibility_level: 20) }
- let(:project2_dup) { projects.create!(name: 'project2', path: 'project2', namespace_id: namespace2.id, visibility_level: 20) }
- let(:project3) { projects.create!(name: 'project3', path: 'project3', namespace_id: namespace3.id, project_namespace_id: project_namespace3.id, visibility_level: 20) }
- let(:project3_dup) { projects.create!(name: 'project3', path: 'project3', namespace_id: namespace3.id, visibility_level: 20) }
-
- let!(:namespace_route1) { routes.create!(path: 'batch-test1', source_id: namespace1.id, source_type: 'Namespace') }
- let!(:namespace_route2) { routes.create!(path: 'batch-test1/batch-test2', source_id: namespace2.id, source_type: 'Namespace') }
- let!(:namespace_route3) { routes.create!(path: 'batch-test1/batch-test3', source_id: namespace3.id, source_type: 'Namespace') }
-
- let!(:proj_route1) { routes.create!(path: 'batch-test1/project1', source_id: project1.id, source_type: 'Project') }
- let!(:proj_route2) { routes.create!(path: 'batch-test1/batch-test2/project2', source_id: project2.id, source_type: 'Project') }
- let!(:proj_route2_dup) { routes.create!(path: "batch-test1/batch-test2/project2-route-#{project2_dup.id}", source_id: project2_dup.id, source_type: 'Project') }
- let!(:proj_route3) { routes.create!(path: 'batch-test1/batch-test3/project3', source_id: project3.id, source_type: 'Project') }
- let!(:proj_route3_dup) { routes.create!(path: "batch-test1/batch-test3/project3-route-#{project3_dup.id}", source_id: project3_dup.id, source_type: 'Project') }
-
- subject(:perform_migration) { migration.perform(projects.minimum(:id), projects.maximum(:id)) }
-
- describe '#up' do
- it 'backfills namespace_id for the selected records', :aggregate_failures do
- expect(namespaces.where(type: 'Project').count).to eq(2)
-
- perform_migration
-
- expect(namespaces.where(type: 'Project').count).to eq(5)
-
- expect(project1.reload.name).to eq("project1-#{project1.id}")
- expect(project1.path).to eq('project1')
-
- expect(project2.reload.name).to eq('project2')
- expect(project2.path).to eq('project2')
-
- expect(project2_dup.reload.name).to eq("project2-#{project2_dup.id}")
- expect(project2_dup.path).to eq("project2-route-#{project2_dup.id}")
-
- expect(project3.reload.name).to eq("project3")
- expect(project3.path).to eq("project3")
-
- expect(project3_dup.reload.name).to eq("project3-#{project3_dup.id}")
- expect(project3_dup.path).to eq("project3-route-#{project3_dup.id}")
-
- projects.all.each do |pr|
- project_namespace = namespaces.find(pr.project_namespace_id)
- expect(project_namespace).to be_in_sync_with_project(pr)
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata_spec.rb b/spec/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata_spec.rb
deleted file mode 100644
index af551861d47..00000000000
--- a/spec/lib/gitlab/background_migration/fix_vulnerability_occurrences_with_hashes_as_raw_metadata_spec.rb
+++ /dev/null
@@ -1,232 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata, schema: 20211209203821 do
- let(:users) { table(:users) }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:scanners) { table(:vulnerability_scanners) }
- let(:identifiers) { table(:vulnerability_identifiers) }
- let(:findings) { table(:vulnerability_occurrences) }
-
- let(:user) { users.create!(name: 'Test User', projects_limit: 10, username: 'test-user', email: '1') }
-
- let(:namespace) do
- namespaces.create!(
- owner_id: user.id,
- name: user.name,
- path: user.username
- )
- end
-
- let(:project) do
- projects.create!(namespace_id: namespace.id, name: 'Test Project')
- end
-
- let(:scanner) do
- scanners.create!(
- project_id: project.id,
- external_id: 'test-scanner',
- name: 'Test Scanner',
- vendor: 'GitLab'
- )
- end
-
- let(:primary_identifier) do
- identifiers.create!(
- project_id: project.id,
- external_type: 'cve',
- name: 'CVE-2021-1234',
- external_id: 'CVE-2021-1234',
- fingerprint: '4c0fe491999f94701ee437588554ef56322ae276'
- )
- end
-
- let(:finding) do
- findings.create!(
- raw_metadata: raw_metadata,
- project_id: project.id,
- scanner_id: scanner.id,
- primary_identifier_id: primary_identifier.id,
- uuid: '4deb090a-bedf-5ccc-aa9a-ac8055a1ea81',
- project_fingerprint: '1caa750a6dad769a18ad6f40b413b3b6ab1c8d77',
- location_fingerprint: '6d1f35f53b065238abfcadc01336ce65d112a2bd',
- name: 'name',
- report_type: 7,
- severity: 0,
- confidence: 0,
- detection_method: 'gitlab_security_report',
- metadata_version: 'cluster_image_scanning:1.0',
- created_at: "2021-12-10 14:27:42 -0600",
- updated_at: "2021-12-10 14:27:42 -0600"
- )
- end
-
- subject(:perform) { described_class.new.perform(finding.id, finding.id) }
-
- context 'with stringified hash as raw_metadata' do
- let(:raw_metadata) do
- '{:location=>{"image"=>"index.docker.io/library/nginx:latest", "kubernetes_resource"=>{"namespace"=>"production", "kind"=>"deployment", "name"=>"nginx", "container_name"=>"nginx", "agent_id"=>"2"}, "dependency"=>{"package"=>{"name"=>"libc"}, "version"=>"v1.2.3"}}}'
- end
-
- it 'converts stringified hash to JSON' do
- expect { perform }.not_to raise_error
-
- result = finding.reload.raw_metadata
- metadata = Oj.load(result)
- expect(metadata).to eq(
- {
- 'location' => {
- 'image' => 'index.docker.io/library/nginx:latest',
- 'kubernetes_resource' => {
- 'namespace' => 'production',
- 'kind' => 'deployment',
- 'name' => 'nginx',
- 'container_name' => 'nginx',
- 'agent_id' => '2'
- },
- 'dependency' => {
- 'package' => { 'name' => 'libc' },
- 'version' => 'v1.2.3'
- }
- }
- }
- )
- end
- end
-
- context 'with valid raw_metadata' do
- where(:raw_metadata) do
- [
- '{}',
- '{"location":null}',
- '{"location":{"image":"index.docker.io/library/nginx:latest","kubernetes_resource":{"namespace":"production","kind":"deployment","name":"nginx","container_name":"nginx","agent_id":"2"},"dependency":{"package":{"name":"libc"},"version":"v1.2.3"}}}'
- ]
- end
-
- with_them do
- it 'does not change the raw_metadata' do
- expect { perform }.not_to raise_error
-
- result = finding.reload.raw_metadata
- expect(result).to eq(raw_metadata)
- end
- end
- end
-
- context 'when raw_metadata contains forbidden types' do
- using RSpec::Parameterized::TableSyntax
-
- where(:raw_metadata, :type) do
- 'def foo; "bar"; end' | :def
- '`cat somefile`' | :xstr
- 'exec("cat /etc/passwd")' | :send
- end
-
- with_them do
- it 'does not change the raw_metadata' do
- expect(Gitlab::AppLogger).to receive(:error).with(message: "expected raw_metadata to be a hash", type: type)
-
- expect { perform }.not_to raise_error
-
- result = finding.reload.raw_metadata
- expect(result).to eq(raw_metadata)
- end
- end
- end
-
- context 'when forbidden types are nested inside a hash' do
- using RSpec::Parameterized::TableSyntax
-
- where(:raw_metadata, :type) do
- '{:location=>Env.fetch("SOME_VAR")}' | :send
- '{:location=>{:image=>Env.fetch("SOME_VAR")}}' | :send
- # rubocop:disable Lint/InterpolationCheck
- '{"key"=>"value: #{send}"}' | :dstr
- # rubocop:enable Lint/InterpolationCheck
- end
-
- with_them do
- it 'does not change the raw_metadata' do
- expect(Gitlab::AppLogger).to receive(:error).with(
- message: "error parsing raw_metadata",
- error: "value of a pair was an unexpected type",
- type: type
- )
-
- expect { perform }.not_to raise_error
-
- result = finding.reload.raw_metadata
- expect(result).to eq(raw_metadata)
- end
- end
- end
-
- context 'when key is an unexpected type' do
- let(:raw_metadata) { "{nil=>nil}" }
-
- it 'logs error' do
- expect(Gitlab::AppLogger).to receive(:error).with(
- message: "error parsing raw_metadata",
- error: "expected key to be either symbol, string, or integer",
- type: :nil
- )
-
- expect { perform }.not_to raise_error
- end
- end
-
- context 'when raw_metadata cannot be parsed' do
- let(:raw_metadata) { "{" }
-
- it 'logs error' do
- expect(Gitlab::AppLogger).to receive(:error).with(message: "error parsing raw_metadata", error: "unexpected token $end")
-
- expect { perform }.not_to raise_error
- end
- end
-
- describe '#hash_from_s' do
- subject { described_class.new.hash_from_s(input) }
-
- context 'with valid input' do
- let(:input) { '{:location=>{"image"=>"index.docker.io/library/nginx:latest", "kubernetes_resource"=>{"namespace"=>"production", "kind"=>"deployment", "name"=>"nginx", "container_name"=>"nginx", "agent_id"=>2}, "dependency"=>{"package"=>{"name"=>"libc"}, "version"=>"v1.2.3"}}}' }
-
- it 'converts string to a hash' do
- expect(subject).to eq({
- location: {
- 'image' => 'index.docker.io/library/nginx:latest',
- 'kubernetes_resource' => {
- 'namespace' => 'production',
- 'kind' => 'deployment',
- 'name' => 'nginx',
- 'container_name' => 'nginx',
- 'agent_id' => 2
- },
- 'dependency' => {
- 'package' => { 'name' => 'libc' },
- 'version' => 'v1.2.3'
- }
- }
- })
- end
- end
-
- using RSpec::Parameterized::TableSyntax
-
- where(:input, :expected) do
- '{}' | {}
- '{"bool"=>true}' | { 'bool' => true }
- '{"bool"=>false}' | { 'bool' => false }
- '{"nil"=>nil}' | { 'nil' => nil }
- '{"array"=>[1, "foo", nil]}' | { 'array' => [1, "foo", nil] }
- '{foo: :bar}' | { foo: :bar }
- '{foo: {bar: "bin"}}' | { foo: { bar: "bin" } }
- end
-
- with_them do
- specify { expect(subject).to eq(expected) }
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/merge_topics_with_same_name_spec.rb b/spec/lib/gitlab/background_migration/merge_topics_with_same_name_spec.rb
deleted file mode 100644
index 2c2c048992f..00000000000
--- a/spec/lib/gitlab/background_migration/merge_topics_with_same_name_spec.rb
+++ /dev/null
@@ -1,148 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MergeTopicsWithSameName, schema: 20220331133802 do
- def set_avatar(topic_id, avatar)
- topic = ::Projects::Topic.find(topic_id)
- topic.avatar = avatar
- topic.save!
- topic.avatar.absolute_path
- end
-
- it 'merges project topics with same case insensitive name' do
- namespaces = table(:namespaces)
- projects = table(:projects)
- topics = table(:topics)
- project_topics = table(:project_topics)
-
- group_1 = namespaces.create!(name: 'space1', type: 'Group', path: 'space1')
- group_2 = namespaces.create!(name: 'space2', type: 'Group', path: 'space2')
- group_3 = namespaces.create!(name: 'space3', type: 'Group', path: 'space3')
- proj_space_1 = namespaces.create!(name: 'proj1', path: 'proj1', type: 'Project', parent_id: group_1.id)
- proj_space_2 = namespaces.create!(name: 'proj2', path: 'proj2', type: 'Project', parent_id: group_2.id)
- proj_space_3 = namespaces.create!(name: 'proj3', path: 'proj3', type: 'Project', parent_id: group_3.id)
- project_1 = projects.create!(namespace_id: group_1.id, project_namespace_id: proj_space_1.id, visibility_level: 20)
- project_2 = projects.create!(namespace_id: group_2.id, project_namespace_id: proj_space_2.id, visibility_level: 10)
- project_3 = projects.create!(namespace_id: group_3.id, project_namespace_id: proj_space_3.id, visibility_level: 0)
- topic_1_keep = topics.create!(
- name: 'topic1',
- title: 'Topic 1',
- description: 'description 1 to keep',
- total_projects_count: 2,
- non_private_projects_count: 2
- )
- topic_1_remove = topics.create!(
- name: 'TOPIC1',
- title: 'Topic 1',
- description: 'description 1 to remove',
- total_projects_count: 2,
- non_private_projects_count: 1
- )
- topic_2_remove = topics.create!(
- name: 'topic2',
- title: 'Topic 2',
- total_projects_count: 0
- )
- topic_2_keep = topics.create!(
- name: 'TOPIC2',
- title: 'Topic 2',
- description: 'description 2 to keep',
- total_projects_count: 1
- )
- topic_3_remove_1 = topics.create!(
- name: 'topic3',
- title: 'Topic 3',
- total_projects_count: 2,
- non_private_projects_count: 1
- )
- topic_3_keep = topics.create!(
- name: 'Topic3',
- title: 'Topic 3',
- total_projects_count: 2,
- non_private_projects_count: 2
- )
- topic_3_remove_2 = topics.create!(
- name: 'TOPIC3',
- title: 'Topic 3',
- description: 'description 3 to keep',
- total_projects_count: 2,
- non_private_projects_count: 1
- )
- topic_4_keep = topics.create!(
- name: 'topic4',
- title: 'Topic 4'
- )
-
- project_topics_1 = []
- project_topics_3 = []
- project_topics_removed = []
-
- project_topics_1 << project_topics.create!(topic_id: topic_1_keep.id, project_id: project_1.id)
- project_topics_1 << project_topics.create!(topic_id: topic_1_keep.id, project_id: project_2.id)
- project_topics_removed << project_topics.create!(topic_id: topic_1_remove.id, project_id: project_2.id)
- project_topics_1 << project_topics.create!(topic_id: topic_1_remove.id, project_id: project_3.id)
-
- project_topics_3 << project_topics.create!(topic_id: topic_3_keep.id, project_id: project_1.id)
- project_topics_3 << project_topics.create!(topic_id: topic_3_keep.id, project_id: project_2.id)
- project_topics_removed << project_topics.create!(topic_id: topic_3_remove_1.id, project_id: project_1.id)
- project_topics_3 << project_topics.create!(topic_id: topic_3_remove_1.id, project_id: project_3.id)
- project_topics_removed << project_topics.create!(topic_id: topic_3_remove_2.id, project_id: project_1.id)
- project_topics_removed << project_topics.create!(topic_id: topic_3_remove_2.id, project_id: project_3.id)
-
- avatar_paths = {
- topic_1_keep: set_avatar(topic_1_keep.id, fixture_file_upload('spec/fixtures/avatars/avatar1.png')),
- topic_1_remove: set_avatar(topic_1_remove.id, fixture_file_upload('spec/fixtures/avatars/avatar2.png')),
- topic_2_remove: set_avatar(topic_2_remove.id, fixture_file_upload('spec/fixtures/avatars/avatar3.png')),
- topic_3_remove_1: set_avatar(topic_3_remove_1.id, fixture_file_upload('spec/fixtures/avatars/avatar4.png')),
- topic_3_remove_2: set_avatar(topic_3_remove_2.id, fixture_file_upload('spec/fixtures/avatars/avatar5.png'))
- }
-
- subject.perform(%w[topic1 topic2 topic3 topic4])
-
- # Topics
- [topic_1_keep, topic_2_keep, topic_3_keep, topic_4_keep].each(&:reload)
- expect(topic_1_keep.name).to eq('topic1')
- expect(topic_1_keep.description).to eq('description 1 to keep')
- expect(topic_1_keep.total_projects_count).to eq(3)
- expect(topic_1_keep.non_private_projects_count).to eq(2)
- expect(topic_2_keep.name).to eq('TOPIC2')
- expect(topic_2_keep.description).to eq('description 2 to keep')
- expect(topic_2_keep.total_projects_count).to eq(0)
- expect(topic_2_keep.non_private_projects_count).to eq(0)
- expect(topic_3_keep.name).to eq('Topic3')
- expect(topic_3_keep.description).to eq('description 3 to keep')
- expect(topic_3_keep.total_projects_count).to eq(3)
- expect(topic_3_keep.non_private_projects_count).to eq(2)
- expect(topic_4_keep.reload.name).to eq('topic4')
-
- [topic_1_remove, topic_2_remove, topic_3_remove_1, topic_3_remove_2].each do |topic|
- expect { topic.reload }.to raise_error(ActiveRecord::RecordNotFound)
- end
-
- # Topic avatars
- expect(topic_1_keep.avatar).to eq('avatar1.png')
- expect(File.exist?(::Projects::Topic.find(topic_1_keep.id).avatar.absolute_path)).to be_truthy
- expect(topic_2_keep.avatar).to eq('avatar3.png')
- expect(File.exist?(::Projects::Topic.find(topic_2_keep.id).avatar.absolute_path)).to be_truthy
- expect(topic_3_keep.avatar).to eq('avatar4.png')
- expect(File.exist?(::Projects::Topic.find(topic_3_keep.id).avatar.absolute_path)).to be_truthy
-
- [:topic_1_remove, :topic_2_remove, :topic_3_remove_1, :topic_3_remove_2].each do |topic|
- expect(File.exist?(avatar_paths[topic])).to be_falsey
- end
-
- # Project Topic assignments
- project_topics_1.each do |project_topic|
- expect(project_topic.reload.topic_id).to eq(topic_1_keep.id)
- end
-
- project_topics_3.each do |project_topic|
- expect(project_topic.reload.topic_id).to eq(topic_3_keep.id)
- end
-
- project_topics_removed.each do |project_topic|
- expect { project_topic.reload }.to raise_error(ActiveRecord::RecordNotFound)
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner_spec.rb b/spec/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner_spec.rb
deleted file mode 100644
index 07e77bdbc13..00000000000
--- a/spec/lib/gitlab/background_migration/migrate_personal_namespace_project_maintainer_to_owner_spec.rb
+++ /dev/null
@@ -1,82 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MigratePersonalNamespaceProjectMaintainerToOwner, :migration, schema: 20220208080921 do
- let(:migration) { described_class.new }
- let(:users_table) { table(:users) }
- let(:members_table) { table(:members) }
- let(:namespaces_table) { table(:namespaces) }
- let(:projects_table) { table(:projects) }
-
- let(:table_name) { 'members' }
- let(:batch_column) { :id }
- let(:sub_batch_size) { 10 }
- let(:pause_ms) { 0 }
-
- let(:owner_access) { 50 }
- let(:maintainer_access) { 40 }
- let(:developer_access) { 30 }
-
- subject(:perform_migration) { migration.perform(1, 10, table_name, batch_column, sub_batch_size, pause_ms) }
-
- before do
- users_table.create!(id: 101, name: "user1", email: "user1@example.com", projects_limit: 5)
- users_table.create!(id: 102, name: "user2", email: "user2@example.com", projects_limit: 5)
-
- namespaces_table.create!(id: 201, name: 'user1s-namespace', path: 'user1s-namespace-path', type: 'User', owner_id: 101)
- namespaces_table.create!(id: 202, name: 'user2s-namespace', path: 'user2s-namespace-path', type: 'User', owner_id: 102)
- namespaces_table.create!(id: 203, name: 'group', path: 'group', type: 'Group')
- namespaces_table.create!(id: 204, name: 'project-namespace', path: 'project-namespace-path', type: 'Project')
-
- projects_table.create!(id: 301, name: 'user1-namespace-project', path: 'project-path-1', namespace_id: 201)
- projects_table.create!(id: 302, name: 'user2-namespace-project', path: 'project-path-2', namespace_id: 202)
- projects_table.create!(id: 303, name: 'user2s-namespace-project2', path: 'project-path-3', namespace_id: 202)
- projects_table.create!(id: 304, name: 'group-project3', path: 'group-project-path-3', namespace_id: 203)
-
- # user1 member of their own namespace project, maintainer access (change)
- create_project_member(id: 1, user_id: 101, project_id: 301, level: maintainer_access)
-
- # user2 member of their own namespace project, owner access (no change)
- create_project_member(id: 2, user_id: 102, project_id: 302, level: owner_access)
-
- # user1 member of user2's personal namespace project, maintainer access (no change)
- create_project_member(id: 3, user_id: 101, project_id: 302, level: maintainer_access)
-
- # user1 member of group project, maintainer access (no change)
- create_project_member(id: 4, user_id: 101, project_id: 304, level: maintainer_access)
-
- # user1 member of group, Maintainer role (no change)
- create_group_member(id: 5, user_id: 101, group_id: 203, level: maintainer_access)
-
- # user2 member of their own namespace project, maintainer access, but out of batch range (no change)
- create_project_member(id: 601, user_id: 102, project_id: 303, level: maintainer_access)
- end
-
- it 'migrates MAINTAINER membership records for personal namespaces to OWNER', :aggregate_failures do
- expect(members_table.where(access_level: owner_access).count).to eq 1
- expect(members_table.where(access_level: maintainer_access).count).to eq 5
-
- queries = ActiveRecord::QueryRecorder.new do
- perform_migration
- end
-
- expect(queries.count).to eq(3)
- expect(members_table.where(access_level: owner_access).pluck(:id)).to match_array([1, 2])
- expect(members_table.where(access_level: maintainer_access).pluck(:id)).to match_array([3, 4, 5, 601])
- end
-
- it 'tracks timings of queries' do
- expect(migration.batch_metrics.timings).to be_empty
-
- expect { perform_migration }.to change { migration.batch_metrics.timings }
- end
-
- def create_group_member(id:, user_id:, group_id:, level:)
- members_table.create!(id: id, user_id: user_id, source_id: group_id, access_level: level, source_type: "Namespace", type: "GroupMember", notification_level: 3)
- end
-
- def create_project_member(id:, user_id:, project_id:, level:)
- members_table.create!(id: id, user_id: user_id, source_id: project_id, access_level: level, source_type: "Namespace", type: "ProjectMember", notification_level: 3)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category_spec.rb b/spec/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category_spec.rb
deleted file mode 100644
index 8bc6bb8ae0a..00000000000
--- a/spec/lib/gitlab/background_migration/migrate_shimo_confluence_integration_category_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MigrateShimoConfluenceIntegrationCategory, schema: 20220326161803 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:integrations) { table(:integrations) }
- let(:perform) { described_class.new.perform(1, 5) }
-
- before do
- namespace = namespaces.create!(name: 'test', path: 'test')
- projects.create!(id: 1, namespace_id: namespace.id, name: 'gitlab', path: 'gitlab')
- integrations.create!(id: 1, active: true, type_new: "Integrations::SlackSlashCommands",
- category: 'chat', project_id: 1)
- integrations.create!(id: 3, active: true, type_new: "Integrations::Confluence", category: 'common', project_id: 1)
- integrations.create!(id: 5, active: true, type_new: "Integrations::Shimo", category: 'common', project_id: 1)
- end
-
- describe '#up' do
- it 'updates category to third_party_wiki for Shimo and Confluence' do
- perform
-
- expect(integrations.where(category: 'third_party_wiki').count).to eq(2)
- expect(integrations.where(category: 'chat').count).to eq(1)
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds_spec.rb b/spec/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds_spec.rb
deleted file mode 100644
index 5b234679e22..00000000000
--- a/spec/lib/gitlab/background_migration/nullify_orphan_runner_id_on_ci_builds_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::NullifyOrphanRunnerIdOnCiBuilds,
- :suppress_gitlab_schemas_validate_connection, migration: :gitlab_ci, schema: 20220223112304 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:ci_runners) { table(:ci_runners) }
- let(:ci_pipelines) { table(:ci_pipelines) }
- let(:ci_builds) { table(:ci_builds) }
-
- subject { described_class.new }
-
- let(:helpers) do
- ActiveRecord::Migration.new.extend(Gitlab::Database::MigrationHelpers)
- end
-
- before do
- helpers.remove_foreign_key_if_exists(:ci_builds, column: :runner_id)
- end
-
- after do
- helpers.add_concurrent_foreign_key(
- :ci_builds, :ci_runners, column: :runner_id, on_delete: :nullify, validate: false
- )
- end
-
- describe '#perform' do
- let(:namespace) { namespaces.create!(name: 'test', path: 'test', type: 'Group') }
- let(:project) { projects.create!(namespace_id: namespace.id, name: 'test') }
-
- it 'nullifies runner_id for orphan ci_builds in range' do
- pipeline = ci_pipelines.create!(project_id: project.id, ref: 'master', sha: 'adf43c3a', status: 'success')
- ci_runners.create!(id: 2, runner_type: 'project_type')
-
- ci_builds.create!(id: 5, type: 'Ci::Build', commit_id: pipeline.id, runner_id: 2)
- ci_builds.create!(id: 7, type: 'Ci::Build', commit_id: pipeline.id, runner_id: 4)
- ci_builds.create!(id: 8, type: 'Ci::Build', commit_id: pipeline.id, runner_id: 5)
- ci_builds.create!(id: 9, type: 'Ci::Build', commit_id: pipeline.id, runner_id: 6)
-
- subject.perform(4, 8, :ci_builds, :id, 10, 0)
-
- expect(ci_builds.all).to contain_exactly(
- an_object_having_attributes(id: 5, runner_id: 2),
- an_object_having_attributes(id: 7, runner_id: nil),
- an_object_having_attributes(id: 8, runner_id: nil),
- an_object_having_attributes(id: 9, runner_id: 6)
- )
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/populate_container_repository_migration_plan_spec.rb b/spec/lib/gitlab/background_migration/populate_container_repository_migration_plan_spec.rb
deleted file mode 100644
index 477167c9074..00000000000
--- a/spec/lib/gitlab/background_migration/populate_container_repository_migration_plan_spec.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::PopulateContainerRepositoryMigrationPlan, schema: 20220316202640 do
- let!(:container_repositories) { table(:container_repositories) }
- let!(:projects) { table(:projects) }
- let!(:namespaces) { table(:namespaces) }
- let!(:gitlab_subscriptions) { table(:gitlab_subscriptions) }
- let!(:plans) { table(:plans) }
- let!(:namespace_statistics) { table(:namespace_statistics) }
-
- let!(:namepace1) { namespaces.create!(id: 1, type: 'Group', name: 'group1', path: 'group1', traversal_ids: [1]) }
- let!(:namepace2) { namespaces.create!(id: 2, type: 'Group', name: 'group2', path: 'group2', traversal_ids: [2]) }
- let!(:namepace3) { namespaces.create!(id: 3, type: 'Group', name: 'group3', path: 'group3', traversal_ids: [3]) }
- let!(:sub_namespace) { namespaces.create!(id: 4, type: 'Group', name: 'group3', path: 'group3', parent_id: 1, traversal_ids: [1, 4]) }
- let!(:plan1) { plans.create!(id: 1, name: 'plan1') }
- let!(:plan2) { plans.create!(id: 2, name: 'plan2') }
- let!(:gitlab_subscription1) { gitlab_subscriptions.create!(id: 1, namespace_id: 1, hosted_plan_id: 1) }
- let!(:gitlab_subscription2) { gitlab_subscriptions.create!(id: 2, namespace_id: 2, hosted_plan_id: 2) }
- let!(:project1) { projects.create!(id: 1, name: 'project1', path: 'project1', namespace_id: 4) }
- let!(:project2) { projects.create!(id: 2, name: 'project2', path: 'project2', namespace_id: 2) }
- let!(:project3) { projects.create!(id: 3, name: 'project3', path: 'project3', namespace_id: 3) }
- let!(:container_repository1) { container_repositories.create!(id: 1, name: 'cr1', project_id: 1) }
- let!(:container_repository2) { container_repositories.create!(id: 2, name: 'cr2', project_id: 2) }
- let!(:container_repository3) { container_repositories.create!(id: 3, name: 'cr3', project_id: 3) }
-
- let(:migration) { described_class.new }
-
- subject do
- migration.perform(1, 4)
- end
-
- it 'updates the migration_plan to match the actual plan', :aggregate_failures do
- expect(Gitlab::Database::BackgroundMigrationJob).to receive(:mark_all_as_succeeded)
- .with('PopulateContainerRepositoryMigrationPlan', [1, 4]).and_return(true)
-
- subject
-
- expect(container_repository1.reload.migration_plan).to eq('plan1')
- expect(container_repository2.reload.migration_plan).to eq('plan2')
- expect(container_repository3.reload.migration_plan).to eq(nil)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/populate_namespace_statistics_spec.rb b/spec/lib/gitlab/background_migration/populate_namespace_statistics_spec.rb
deleted file mode 100644
index 4a7d52ee784..00000000000
--- a/spec/lib/gitlab/background_migration/populate_namespace_statistics_spec.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::PopulateNamespaceStatistics do
- let!(:namespaces) { table(:namespaces) }
- let!(:namespace_statistics) { table(:namespace_statistics) }
- let!(:dependency_proxy_manifests) { table(:dependency_proxy_manifests) }
- let!(:dependency_proxy_blobs) { table(:dependency_proxy_blobs) }
-
- let!(:group1) { namespaces.create!(id: 10, type: 'Group', name: 'group1', path: 'group1') }
- let!(:group2) { namespaces.create!(id: 20, type: 'Group', name: 'group2', path: 'group2') }
-
- let!(:group1_manifest) do
- dependency_proxy_manifests.create!(group_id: 10, size: 20, file_name: 'test-file', file: 'test', digest: 'abc123')
- end
-
- let!(:group2_manifest) do
- dependency_proxy_manifests.create!(group_id: 20, size: 20, file_name: 'test-file', file: 'test', digest: 'abc123')
- end
-
- let!(:group1_stats) { namespace_statistics.create!(id: 10, namespace_id: 10) }
-
- let(:ids) { namespaces.pluck(:id) }
- let(:statistics) { [] }
-
- subject(:perform) { described_class.new.perform(ids, statistics) }
-
- it 'creates/updates all namespace_statistics and updates root storage statistics', :aggregate_failures do
- expect(Namespaces::ScheduleAggregationWorker).to receive(:perform_async).with(group1.id)
- expect(Namespaces::ScheduleAggregationWorker).to receive(:perform_async).with(group2.id)
-
- expect { perform }.to change(namespace_statistics, :count).from(1).to(2)
-
- namespace_statistics.all.each do |stat|
- expect(stat.dependency_proxy_size).to eq 20
- expect(stat.storage_size).to eq 20
- end
- end
-
- context 'when just a stat is passed' do
- let(:statistics) { [:dependency_proxy_size] }
-
- it 'calls the statistics update service with just that stat' do
- expect(Groups::UpdateStatisticsService)
- .to receive(:new)
- .with(anything, statistics: [:dependency_proxy_size])
- .twice.and_call_original
-
- perform
- end
- end
-
- context 'when a statistics update fails' do
- before do
- error_response = instance_double(ServiceResponse, message: 'an error', error?: true)
-
- allow_next_instance_of(Groups::UpdateStatisticsService) do |instance|
- allow(instance).to receive(:execute).and_return(error_response)
- end
- end
-
- it 'logs an error' do
- expect_next_instance_of(Gitlab::BackgroundMigration::Logger) do |instance|
- expect(instance).to receive(:error).twice
- end
-
- perform
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/populate_topics_non_private_projects_count_spec.rb b/spec/lib/gitlab/background_migration/populate_topics_non_private_projects_count_spec.rb
deleted file mode 100644
index e72e3392210..00000000000
--- a/spec/lib/gitlab/background_migration/populate_topics_non_private_projects_count_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::PopulateTopicsNonPrivateProjectsCount, schema: 20220125122640 do
- it 'correctly populates the non private projects counters' do
- namespaces = table(:namespaces)
- projects = table(:projects)
- topics = table(:topics)
- project_topics = table(:project_topics)
-
- group = namespaces.create!(name: 'group', path: 'group')
- project_public = projects.create!(namespace_id: group.id, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- project_internal = projects.create!(namespace_id: group.id, visibility_level: Gitlab::VisibilityLevel::INTERNAL)
- project_private = projects.create!(namespace_id: group.id, visibility_level: Gitlab::VisibilityLevel::PRIVATE)
- topic_1 = topics.create!(name: 'Topic1')
- topic_2 = topics.create!(name: 'Topic2')
- topic_3 = topics.create!(name: 'Topic3')
- topic_4 = topics.create!(name: 'Topic4')
- topic_5 = topics.create!(name: 'Topic5')
- topic_6 = topics.create!(name: 'Topic6')
- topic_7 = topics.create!(name: 'Topic7')
- topic_8 = topics.create!(name: 'Topic8')
-
- project_topics.create!(topic_id: topic_1.id, project_id: project_public.id)
- project_topics.create!(topic_id: topic_2.id, project_id: project_internal.id)
- project_topics.create!(topic_id: topic_3.id, project_id: project_private.id)
- project_topics.create!(topic_id: topic_4.id, project_id: project_public.id)
- project_topics.create!(topic_id: topic_4.id, project_id: project_internal.id)
- project_topics.create!(topic_id: topic_5.id, project_id: project_public.id)
- project_topics.create!(topic_id: topic_5.id, project_id: project_private.id)
- project_topics.create!(topic_id: topic_6.id, project_id: project_internal.id)
- project_topics.create!(topic_id: topic_6.id, project_id: project_private.id)
- project_topics.create!(topic_id: topic_7.id, project_id: project_public.id)
- project_topics.create!(topic_id: topic_7.id, project_id: project_internal.id)
- project_topics.create!(topic_id: topic_7.id, project_id: project_private.id)
- project_topics.create!(topic_id: topic_8.id, project_id: project_public.id)
-
- subject.perform(topic_1.id, topic_7.id)
-
- expect(topic_1.reload.non_private_projects_count).to eq(1)
- expect(topic_2.reload.non_private_projects_count).to eq(1)
- expect(topic_3.reload.non_private_projects_count).to eq(0)
- expect(topic_4.reload.non_private_projects_count).to eq(2)
- expect(topic_5.reload.non_private_projects_count).to eq(1)
- expect(topic_6.reload.non_private_projects_count).to eq(1)
- expect(topic_7.reload.non_private_projects_count).to eq(2)
- expect(topic_8.reload.non_private_projects_count).to eq(0)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/populate_vulnerability_reads_spec.rb b/spec/lib/gitlab/background_migration/populate_vulnerability_reads_spec.rb
deleted file mode 100644
index c0470f26d9e..00000000000
--- a/spec/lib/gitlab/background_migration/populate_vulnerability_reads_spec.rb
+++ /dev/null
@@ -1,93 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::PopulateVulnerabilityReads, :migration, schema: 20220326161803 do
- let(:vulnerabilities) { table(:vulnerabilities) }
- let(:vulnerability_reads) { table(:vulnerability_reads) }
- let(:vulnerabilities_findings) { table(:vulnerability_occurrences) }
- let(:vulnerability_issue_links) { table(:vulnerability_issue_links) }
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let(:user) { table(:users).create!(email: 'author@example.com', username: 'author', projects_limit: 10) }
- let(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let(:scanner) { table(:vulnerability_scanners).create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let(:sub_batch_size) { 1000 }
-
- before do
- vulnerabilities_findings.connection.execute 'ALTER TABLE vulnerability_occurrences DISABLE TRIGGER "trigger_insert_or_update_vulnerability_reads_from_occurrences"'
- vulnerabilities.connection.execute 'ALTER TABLE vulnerabilities DISABLE TRIGGER "trigger_update_vulnerability_reads_on_vulnerability_update"'
- vulnerability_issue_links.connection.execute 'ALTER TABLE vulnerability_issue_links DISABLE TRIGGER "trigger_update_has_issues_on_vulnerability_issue_links_update"'
-
- 10.times.each do |x|
- vulnerability = create_vulnerability!(
- project_id: project.id,
- report_type: 7,
- author_id: user.id
- )
- identifier = table(:vulnerability_identifiers).create!(
- project_id: project.id,
- external_type: 'uuid-v5',
- external_id: 'uuid-v5',
- fingerprint: Digest::SHA1.hexdigest(vulnerability.id.to_s),
- name: 'Identifier for UUIDv5')
-
- create_finding!(
- vulnerability_id: vulnerability.id,
- project_id: project.id,
- scanner_id: scanner.id,
- primary_identifier_id: identifier.id
- )
- end
- end
-
- it 'creates vulnerability_reads for the given records' do
- described_class.new.perform(vulnerabilities.first.id, vulnerabilities.last.id, sub_batch_size)
-
- expect(vulnerability_reads.count).to eq(10)
- end
-
- it 'does not create new records when records already exists' do
- described_class.new.perform(vulnerabilities.first.id, vulnerabilities.last.id, sub_batch_size)
- described_class.new.perform(vulnerabilities.first.id, vulnerabilities.last.id, sub_batch_size)
-
- expect(vulnerability_reads.count).to eq(10)
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- project_id:, scanner_id:, primary_identifier_id:, vulnerability_id: nil,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location: { "image" => "alpine:3.4" }, location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- vulnerabilities_findings.create!(
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: primary_identifier_id,
- location: location,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- )
- end
- # rubocop:enable Metrics/ParameterLists
-end
diff --git a/spec/lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces_spec.rb b/spec/lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces_spec.rb
deleted file mode 100644
index bff803e2035..00000000000
--- a/spec/lib/gitlab/background_migration/project_namespaces/backfill_project_namespaces_spec.rb
+++ /dev/null
@@ -1,266 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces, :migration, schema: 20220326161803 do
- include MigrationsHelpers
-
- RSpec.shared_examples 'backfills project namespaces' do
- context 'when migrating data', :aggregate_failures do
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
-
- let(:parent_group1) { namespaces.create!(name: 'parent_group1', path: 'parent_group1', visibility_level: 20, type: 'Group') }
- let(:parent_group2) { namespaces.create!(name: 'test1', path: 'test1', runners_token: 'my-token1', project_creation_level: 1, visibility_level: 20, type: 'Group') }
-
- let(:parent_group1_project) { projects.create!(name: 'parent_group1_project', path: 'parent_group1_project', namespace_id: parent_group1.id, visibility_level: 20) }
- let(:parent_group2_project) { projects.create!(name: 'parent_group2_project', path: 'parent_group2_project', namespace_id: parent_group2.id, visibility_level: 20) }
-
- let(:child_nodes_count) { 2 }
- let(:tree_depth) { 3 }
-
- let(:backfilled_namespace) { nil }
-
- before do
- BackfillProjectNamespaces::TreeGenerator.new(namespaces, projects, [parent_group1, parent_group2], child_nodes_count, tree_depth).build_tree
- end
-
- describe '#up' do
- shared_examples 'back-fill project namespaces' do
- it 'back-fills all project namespaces' do
- start_id = ::Project.minimum(:id)
- end_id = ::Project.maximum(:id)
- projects_count = ::Project.count
- batches_count = (projects_count / described_class::SUB_BATCH_SIZE.to_f).ceil
- project_namespaces_count = ::Namespace.where(type: 'Project').count
- migration = described_class.new
-
- expect(projects_count).not_to eq(project_namespaces_count)
- expect(migration).to receive(:batch_insert_namespaces).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_projects).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_project_namespaces_traversal_ids).exactly(batches_count).and_call_original
-
- expect { migration.perform(start_id, end_id, nil, nil, nil, nil, nil, 'up') }.to change(Namespace.where(type: 'Project'), :count)
-
- expect(projects_count).to eq(::Namespace.where(type: 'Project').count)
- check_projects_in_sync_with(Namespace.where(type: 'Project'))
- end
-
- context 'when passing specific group as parameter' do
- let(:backfilled_namespace) { parent_group1 }
-
- it 'back-fills project namespaces for the specified group hierarchy' do
- backfilled_namespace_projects = base_ancestor(backfilled_namespace).first.all_projects
- start_id = backfilled_namespace_projects.minimum(:id)
- end_id = backfilled_namespace_projects.maximum(:id)
- group_projects_count = backfilled_namespace_projects.count
- batches_count = (group_projects_count / described_class::SUB_BATCH_SIZE.to_f).ceil
- project_namespaces_in_hierarchy = project_namespaces_in_hierarchy(base_ancestor(backfilled_namespace))
-
- migration = described_class.new
-
- expect(project_namespaces_in_hierarchy.count).to eq(0)
- expect(migration).to receive(:batch_insert_namespaces).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_projects).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_project_namespaces_traversal_ids).exactly(batches_count).and_call_original
-
- expect(group_projects_count).to eq(14)
- expect(project_namespaces_in_hierarchy.count).to eq(0)
-
- migration.perform(start_id, end_id, nil, nil, nil, nil, backfilled_namespace.id, 'up')
-
- expect(project_namespaces_in_hierarchy.count).to eq(14)
- check_projects_in_sync_with(project_namespaces_in_hierarchy)
- end
- end
-
- context 'when projects already have project namespaces' do
- before do
- hierarchy1_projects = base_ancestor(parent_group1).first.all_projects
- start_id = hierarchy1_projects.minimum(:id)
- end_id = hierarchy1_projects.maximum(:id)
-
- described_class.new.perform(start_id, end_id, nil, nil, nil, nil, parent_group1.id, 'up')
- end
-
- it 'does not duplicate project namespaces' do
- # check there are already some project namespaces but not for all
- projects_count = ::Project.count
- start_id = ::Project.minimum(:id)
- end_id = ::Project.maximum(:id)
- batches_count = (projects_count / described_class::SUB_BATCH_SIZE.to_f).ceil
- project_namespaces = ::Namespace.where(type: 'Project')
- migration = described_class.new
-
- expect(project_namespaces_in_hierarchy(base_ancestor(parent_group1)).count).to be >= 14
- expect(project_namespaces_in_hierarchy(base_ancestor(parent_group2)).count).to eq(0)
- expect(projects_count).not_to eq(project_namespaces.count)
-
- # run migration again to test we do not generate extra project namespaces
- expect(migration).to receive(:batch_insert_namespaces).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_projects).exactly(batches_count).and_call_original
- expect(migration).to receive(:batch_update_project_namespaces_traversal_ids).exactly(batches_count).and_call_original
-
- expect { migration.perform(start_id, end_id, nil, nil, nil, nil, nil, 'up') }.to change(project_namespaces, :count).by(14)
-
- expect(projects_count).to eq(project_namespaces.count)
- end
- end
- end
-
- it 'checks no project namespaces exist in the defined hierarchies' do
- hierarchy1_project_namespaces = project_namespaces_in_hierarchy(base_ancestor(parent_group1))
- hierarchy2_project_namespaces = project_namespaces_in_hierarchy(base_ancestor(parent_group2))
- hierarchy1_projects_count = base_ancestor(parent_group1).first.all_projects.count
- hierarchy2_projects_count = base_ancestor(parent_group2).first.all_projects.count
-
- expect(hierarchy1_project_namespaces).to be_empty
- expect(hierarchy2_project_namespaces).to be_empty
- expect(hierarchy1_projects_count).to eq(14)
- expect(hierarchy2_projects_count).to eq(14)
- end
-
- context 'back-fill project namespaces in a single batch' do
- it_behaves_like 'back-fill project namespaces'
- end
-
- context 'back-fill project namespaces in batches' do
- before do
- stub_const("#{described_class.name}::SUB_BATCH_SIZE", 2)
- end
-
- it_behaves_like 'back-fill project namespaces'
- end
- end
-
- describe '#down' do
- before do
- start_id = ::Project.minimum(:id)
- end_id = ::Project.maximum(:id)
- # back-fill first
- described_class.new.perform(start_id, end_id, nil, nil, nil, nil, nil, 'up')
- end
-
- shared_examples 'cleanup project namespaces' do
- it 'removes project namespaces' do
- projects_count = ::Project.count
- start_id = ::Project.minimum(:id)
- end_id = ::Project.maximum(:id)
- migration = described_class.new
- batches_count = (projects_count / described_class::SUB_BATCH_SIZE.to_f).ceil
-
- expect(projects_count).to be > 0
- expect(projects_count).to eq(::Namespace.where(type: 'Project').count)
-
- expect(migration).to receive(:nullify_project_namespaces_in_projects).exactly(batches_count).and_call_original
- expect(migration).to receive(:delete_project_namespace_records).exactly(batches_count).and_call_original
-
- migration.perform(start_id, end_id, nil, nil, nil, nil, nil, 'down')
-
- expect(::Project.count).to be > 0
- expect(::Namespace.where(type: 'Project').count).to eq(0)
- end
-
- context 'when passing specific group as parameter' do
- let(:backfilled_namespace) { parent_group1 }
-
- it 'removes project namespaces only for the specific group hierarchy' do
- backfilled_namespace_projects = base_ancestor(backfilled_namespace).first.all_projects
- start_id = backfilled_namespace_projects.minimum(:id)
- end_id = backfilled_namespace_projects.maximum(:id)
- group_projects_count = backfilled_namespace_projects.count
- batches_count = (group_projects_count / described_class::SUB_BATCH_SIZE.to_f).ceil
- project_namespaces_in_hierarchy = project_namespaces_in_hierarchy(base_ancestor(backfilled_namespace))
- migration = described_class.new
-
- expect(project_namespaces_in_hierarchy.count).to eq(14)
- expect(migration).to receive(:nullify_project_namespaces_in_projects).exactly(batches_count).and_call_original
- expect(migration).to receive(:delete_project_namespace_records).exactly(batches_count).and_call_original
-
- migration.perform(start_id, end_id, nil, nil, nil, nil, backfilled_namespace.id, 'down')
-
- expect(::Namespace.where(type: 'Project').count).to be > 0
- expect(project_namespaces_in_hierarchy.count).to eq(0)
- end
- end
- end
-
- context 'cleanup project namespaces in a single batch' do
- it_behaves_like 'cleanup project namespaces'
- end
-
- context 'cleanup project namespaces in batches' do
- before do
- stub_const("#{described_class.name}::SUB_BATCH_SIZE", 2)
- end
-
- it_behaves_like 'cleanup project namespaces'
- end
- end
- end
- end
-
- it_behaves_like 'backfills project namespaces'
-
- context 'when namespaces.id is bigint' do
- before do
- namespaces.connection.execute("ALTER TABLE namespaces ALTER COLUMN id TYPE bigint")
- end
-
- it_behaves_like 'backfills project namespaces'
- end
-
- def base_ancestor(ancestor)
- ::Namespace.where(id: ancestor.id)
- end
-
- def project_namespaces_in_hierarchy(base_node)
- Gitlab::ObjectHierarchy.new(base_node).base_and_descendants.where(type: 'Project')
- end
-
- def check_projects_in_sync_with(namespaces)
- project_namespaces_attrs = namespaces.order(:id).pluck(:id, :name, :path, :parent_id, :visibility_level, :shared_runners_enabled)
- corresponding_projects_attrs = Project.where(project_namespace_id: project_namespaces_attrs.map(&:first))
- .order(:project_namespace_id).pluck(:project_namespace_id, :name, :path, :namespace_id, :visibility_level, :shared_runners_enabled)
-
- expect(project_namespaces_attrs).to eq(corresponding_projects_attrs)
- end
-end
-
-module BackfillProjectNamespaces
- class TreeGenerator
- def initialize(namespaces, projects, parent_nodes, child_nodes_count, tree_depth)
- parent_nodes_ids = parent_nodes.map(&:id)
-
- @namespaces = namespaces
- @projects = projects
- @subgroups_depth = tree_depth
- @resource_count = child_nodes_count
- @all_groups = [parent_nodes_ids]
- end
-
- def build_tree
- (1..@subgroups_depth).each do |level|
- parent_level = level - 1
- current_level = level
- parent_groups = @all_groups[parent_level]
-
- parent_groups.each do |parent_id|
- @resource_count.times do |i|
- group_path = "child#{i}_level#{level}"
- project_path = "project#{i}_level#{level}"
- sub_group = @namespaces.create!(name: group_path, path: group_path, parent_id: parent_id, visibility_level: 20, type: 'Group')
- @projects.create!(name: project_path, path: project_path, namespace_id: sub_group.id, visibility_level: 20)
-
- track_group_id(current_level, sub_group.id)
- end
- end
- end
- end
-
- def track_group_id(depth_level, group_id)
- @all_groups[depth_level] ||= []
- @all_groups[depth_level] << group_id
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/remove_all_trace_expiration_dates_spec.rb b/spec/lib/gitlab/background_migration/remove_all_trace_expiration_dates_spec.rb
deleted file mode 100644
index eabc012f98b..00000000000
--- a/spec/lib/gitlab/background_migration/remove_all_trace_expiration_dates_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::RemoveAllTraceExpirationDates, :migration,
- :suppress_gitlab_schemas_validate_connection, schema: 20220131000001 do
- subject(:perform) { migration.perform(1, 99) }
-
- let(:migration) { described_class.new }
-
- let(:trace_in_range) { create_trace!(id: 10, created_at: Date.new(2020, 06, 20), expire_at: Date.new(2021, 01, 22)) }
- let(:trace_outside_range) { create_trace!(id: 40, created_at: Date.new(2020, 06, 22), expire_at: Date.new(2021, 01, 22)) }
- let(:trace_without_expiry) { create_trace!(id: 30, created_at: Date.new(2020, 06, 21), expire_at: nil) }
- let(:archive_in_range) { create_archive!(id: 10, created_at: Date.new(2020, 06, 20), expire_at: Date.new(2021, 01, 22)) }
- let(:trace_outside_id_range) { create_trace!(id: 100, created_at: Date.new(2020, 06, 20), expire_at: Date.new(2021, 01, 22)) }
-
- before do
- table(:namespaces).create!(id: 1, name: 'the-namespace', path: 'the-path')
- table(:projects).create!(id: 1, name: 'the-project', namespace_id: 1)
- table(:ci_builds).create!(id: 1, allow_failure: false)
- end
-
- context 'for self-hosted instances' do
- it 'sets expire_at for artifacts in range to nil' do
- expect { perform }.not_to change { trace_in_range.reload.expire_at }
- end
-
- it 'does not change expire_at timestamps that are not set to midnight' do
- expect { perform }.not_to change { trace_outside_range.reload.expire_at }
- end
-
- it 'does not change expire_at timestamps that are set to midnight on a day other than the 22nd' do
- expect { perform }.not_to change { trace_without_expiry.reload.expire_at }
- end
-
- it 'does not touch artifacts outside id range' do
- expect { perform }.not_to change { archive_in_range.reload.expire_at }
- end
-
- it 'does not touch artifacts outside date range' do
- expect { perform }.not_to change { trace_outside_id_range.reload.expire_at }
- end
- end
-
- private
-
- def create_trace!(**args)
- table(:ci_job_artifacts).create!(**args, project_id: 1, job_id: 1, file_type: 3)
- end
-
- def create_archive!(**args)
- table(:ci_job_artifacts).create!(**args, project_id: 1, job_id: 1, file_type: 1)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb b/spec/lib/gitlab/background_migration/remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb
deleted file mode 100644
index 60ee61cf50a..00000000000
--- a/spec/lib/gitlab/background_migration/remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings, :migration,
- :suppress_gitlab_schemas_validate_connection, schema: 20220326161803 do
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let(:users) { table(:users) }
- let(:user) { create_user! }
- let(:project) { table(:projects).create!(id: 14219619, namespace_id: namespace.id) }
- let(:scanners) { table(:vulnerability_scanners) }
- let!(:scanner1) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let!(:scanner2) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') }
- let!(:scanner3) { scanners.create!(project_id: project.id, external_id: 'test 3', name: 'test scanner 3') }
- let!(:unrelated_scanner) { scanners.create!(project_id: project.id, external_id: 'unreleated_scanner', name: 'unrelated scanner') }
- let(:vulnerabilities) { table(:vulnerabilities) }
- let(:vulnerability_findings) { table(:vulnerability_occurrences) }
- let(:vulnerability_finding_pipelines) { table(:vulnerability_occurrence_pipelines) }
- let(:vulnerability_identifiers) { table(:vulnerability_identifiers) }
- let(:vulnerability_identifier) do
- vulnerability_identifiers.create!(
- id: 1244459,
- project_id: project.id,
- external_type: 'vulnerability-identifier',
- external_id: 'vulnerability-identifier',
- fingerprint: '0a203e8cd5260a1948edbedc76c7cb91ad6a2e45',
- name: 'vulnerability identifier')
- end
-
- let!(:vulnerability_for_first_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:first_finding_duplicate) do
- create_finding!(
- id: 5606961,
- uuid: "bd95c085-71aa-51d7-9bb6-08ae669c262e",
- vulnerability_id: vulnerability_for_first_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner1.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_second_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:second_finding_duplicate) do
- create_finding!(
- id: 8765432,
- uuid: "5b714f58-1176-5b26-8fd5-e11dfcb031b5",
- vulnerability_id: vulnerability_for_second_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner2.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_third_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:third_finding_duplicate) do
- create_finding!(
- id: 8832995,
- uuid: "cfe435fa-b25b-5199-a56d-7b007cc9e2d4",
- vulnerability_id: vulnerability_for_third_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner3.id,
- project_id: project.id
- )
- end
-
- let!(:unrelated_finding) do
- create_finding!(
- id: 9999999,
- vulnerability_id: nil,
- report_type: 1,
- location_fingerprint: 'random_location_fingerprint',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: unrelated_scanner.id,
- project_id: project.id
- )
- end
-
- subject { described_class.new.perform(first_finding_duplicate.id, unrelated_finding.id) }
-
- before do
- 4.times do
- create_finding_pipeline!(project_id: project.id, finding_id: first_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: second_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: third_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: unrelated_finding.id)
- end
- end
-
- it 'removes Vulnerabilities::OccurrencePipelines for matching Vulnerabilities::Finding' do
- expect(vulnerability_findings.count).to eq(4)
- expect(vulnerability_finding_pipelines.count).to eq(16)
-
- expect { subject }.to change(vulnerability_finding_pipelines, :count).from(16).to(8)
- .and change(vulnerability_findings, :count).from(4).to(2)
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, id: nil,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- params = {
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: vulnerability_identifier.id,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- }
- params[:id] = id unless id.nil?
- vulnerability_findings.create!(params)
- end
- # rubocop:enable Metrics/ParameterLists
-
- def create_user!(name: "Example User", email: "user@example.com", user_type: nil, created_at: Time.zone.now, confirmed_at: Time.zone.now)
- table(:users).create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- user_type: user_type,
- confirmed_at: confirmed_at
- )
- end
-
- def create_finding_pipeline!(project_id:, finding_id:)
- pipeline = table(:ci_pipelines).create!(project_id: project_id)
- vulnerability_finding_pipelines.create!(pipeline_id: pipeline.id, occurrence_id: finding_id)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb b/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb
deleted file mode 100644
index 32134b99e37..00000000000
--- a/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::RemoveVulnerabilityFindingLinks, :migration, schema: 20211202041233 do
- let(:vulnerability_findings) { table(:vulnerability_occurrences) }
- let(:finding_links) { table(:vulnerability_finding_links) }
-
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user', type: Namespaces::UserNamespace.sti_name) }
- let(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let(:scanner) { table(:vulnerability_scanners).create!(project_id: project.id, external_id: 'scanner', name: 'scanner') }
- let(:vulnerability_identifier) do
- table(:vulnerability_identifiers).create!(
- project_id: project.id,
- external_type: 'vulnerability-identifier',
- external_id: 'vulnerability-identifier',
- fingerprint: '7e394d1b1eb461a7406d7b1e08f057a1cf11287a',
- name: 'vulnerability identifier')
- end
-
- # vulnerability findings
- let!(:findings) do
- Array.new(2) do |id|
- vulnerability_findings.create!(
- project_id: project.id,
- name: 'Vulnerability Name',
- severity: 7,
- confidence: 7,
- report_type: 0,
- project_fingerprint: '123qweasdzxc',
- scanner_id: scanner.id,
- primary_identifier_id: vulnerability_identifier.id,
- location_fingerprint: "location_fingerprint_#{id}",
- metadata_version: 'metadata_version',
- raw_metadata: 'raw_metadata',
- uuid: SecureRandom.uuid
- )
- end
- end
-
- # vulnerability finding links
- let!(:links) do
- {
- findings.first => Array.new(5) { |id| finding_links.create!(vulnerability_occurrence_id: findings.first.id, name: "Link Name 1", url: "link_url1_#{id}.example") },
- findings.second => Array.new(5) { |id| finding_links.create!(vulnerability_occurrence_id: findings.second.id, name: "Link Name 2", url: "link_url2_#{id}.example") }
- }
- end
-
- it 'removes vulnerability links' do
- expect do
- subject.perform(links[findings.first].first.id, links[findings.second].last.id)
- end.to change { finding_links.count }.from(10).to(0)
-
- expect(finding_links.all).to be_empty
- end
-
- it 'only deletes vulnerability links for the current batch' do
- expected_links = [finding_links.where(vulnerability_occurrence_id: findings.second.id)].flatten
-
- expect do
- subject.perform(links[findings.first].first.id, links[findings.first].last.id)
- end.to change { finding_links.count }.from(10).to(5)
-
- expect(finding_links.all).to match_array(expected_links)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects_spec.rb b/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects_spec.rb
deleted file mode 100644
index 71020746fa7..00000000000
--- a/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_encrypted_values_on_projects_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects, :migration, schema: 20220326161803 do # rubocop:disable Layout/LineLength
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
-
- subject(:background_migration) { described_class.new }
-
- before do
- namespaces.create!(id: 123, name: 'sample', path: 'sample')
-
- projects.create!(id: 1, namespace_id: 123, runners_token_encrypted: 'duplicate')
- projects.create!(id: 2, namespace_id: 123, runners_token_encrypted: 'a-runners-token')
- projects.create!(id: 3, namespace_id: 123, runners_token_encrypted: 'duplicate-2')
- projects.create!(id: 4, namespace_id: 123, runners_token_encrypted: nil)
- projects.create!(id: 5, namespace_id: 123, runners_token_encrypted: 'duplicate-2')
- projects.create!(id: 6, namespace_id: 123, runners_token_encrypted: 'duplicate')
- projects.create!(id: 7, namespace_id: 123, runners_token_encrypted: 'another-runners-token')
- projects.create!(id: 8, namespace_id: 123, runners_token_encrypted: 'another-runners-token')
- end
-
- describe '#up' do
- it 'nullifies duplicate tokens', :aggregate_failures do
- background_migration.perform(1, 2)
- background_migration.perform(3, 4)
-
- expect(projects.count).to eq(8)
- expect(projects.all.pluck(:id, :runners_token_encrypted).to_h).to eq(
- {
- 1 => nil,
- 2 => 'a-runners-token',
- 3 => nil,
- 4 => nil,
- 5 => 'duplicate-2',
- 6 => 'duplicate',
- 7 => 'another-runners-token',
- 8 => 'another-runners-token'
- })
- expect(projects.pluck(:runners_token_encrypted).uniq).to match_array [
- nil, 'a-runners-token', 'duplicate', 'duplicate-2', 'another-runners-token'
- ]
- end
-
- it 'does not touch projects outside id range' do
- expect do
- background_migration.perform(1, 2)
- end.not_to change { projects.where(id: [3..8]).each(&:reload).map(&:updated_at) }
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects_spec.rb b/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects_spec.rb
deleted file mode 100644
index 7d3df69bee2..00000000000
--- a/spec/lib/gitlab/background_migration/reset_duplicate_ci_runners_token_values_on_projects_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenValuesOnProjects, :migration, schema: 20220326161803 do # rubocop:disable Layout/LineLength
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
-
- subject(:background_migration) { described_class.new }
-
- before do
- namespaces.create!(id: 123, name: 'sample', path: 'sample')
-
- projects.create!(id: 1, namespace_id: 123, runners_token: 'duplicate')
- projects.create!(id: 2, namespace_id: 123, runners_token: 'a-runners-token')
- projects.create!(id: 3, namespace_id: 123, runners_token: 'duplicate-2')
- projects.create!(id: 4, namespace_id: 123, runners_token: nil)
- projects.create!(id: 5, namespace_id: 123, runners_token: 'duplicate-2')
- projects.create!(id: 6, namespace_id: 123, runners_token: 'duplicate')
- projects.create!(id: 7, namespace_id: 123, runners_token: 'another-runners-token')
- projects.create!(id: 8, namespace_id: 123, runners_token: 'another-runners-token')
- end
-
- describe '#up' do
- it 'nullifies duplicate tokens', :aggregate_failures do
- background_migration.perform(1, 2)
- background_migration.perform(3, 4)
-
- expect(projects.count).to eq(8)
- expect(projects.all.pluck(:id, :runners_token).to_h).to eq(
- {
- 1 => nil,
- 2 => 'a-runners-token',
- 3 => nil,
- 4 => nil,
- 5 => 'duplicate-2',
- 6 => 'duplicate',
- 7 => 'another-runners-token',
- 8 => 'another-runners-token'
- })
- expect(projects.pluck(:runners_token).uniq).to match_array [
- nil, 'a-runners-token', 'duplicate', 'duplicate-2', 'another-runners-token'
- ]
- end
-
- it 'does not touch projects outside id range' do
- expect do
- background_migration.perform(1, 2)
- end.not_to change { projects.where(id: [3..8]).each(&:reload).map(&:updated_at) }
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/update_timelogs_null_spent_at_spec.rb b/spec/lib/gitlab/background_migration/update_timelogs_null_spent_at_spec.rb
deleted file mode 100644
index 908f11aabc3..00000000000
--- a/spec/lib/gitlab/background_migration/update_timelogs_null_spent_at_spec.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::UpdateTimelogsNullSpentAt, schema: 20211215090620 do
- let!(:previous_time) { 10.days.ago }
- let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') }
- let!(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:issue) { table(:issues).create!(project_id: project.id) }
- let!(:merge_request) { table(:merge_requests).create!(target_project_id: project.id, source_branch: 'master', target_branch: 'feature') }
- let!(:timelog1) { create_timelog!(issue_id: issue.id) }
- let!(:timelog2) { create_timelog!(merge_request_id: merge_request.id) }
- let!(:timelog3) { create_timelog!(issue_id: issue.id, spent_at: previous_time) }
- let!(:timelog4) { create_timelog!(merge_request_id: merge_request.id, spent_at: previous_time) }
-
- subject(:background_migration) { described_class.new }
-
- before do
- table(:timelogs).where.not(id: [timelog3.id, timelog4.id]).update_all(spent_at: nil)
- end
-
- describe '#perform' do
- it 'sets correct spent_at' do
- background_migration.perform(timelog1.id, timelog4.id)
-
- expect(timelog1.reload.spent_at).to be_like_time(timelog1.created_at)
- expect(timelog2.reload.spent_at).to be_like_time(timelog2.created_at)
- expect(timelog3.reload.spent_at).to be_like_time(previous_time)
- expect(timelog4.reload.spent_at).to be_like_time(previous_time)
- expect(timelog3.reload.spent_at).not_to be_like_time(timelog3.created_at)
- expect(timelog4.reload.spent_at).not_to be_like_time(timelog4.created_at)
- end
- end
-
- private
-
- def create_timelog!(**args)
- table(:timelogs).create!(**args, time_spent: 1)
- end
-end
diff --git a/spec/mailers/emails/service_desk_spec.rb b/spec/mailers/emails/service_desk_spec.rb
index f8ed26b3241..22b910b3dae 100644
--- a/spec/mailers/emails/service_desk_spec.rb
+++ b/spec/mailers/emails/service_desk_spec.rb
@@ -298,9 +298,26 @@ RSpec.describe Emails::ServiceDesk, feature_category: :service_desk do
let_it_be(:note) { create(:note_on_issue, noteable: issue, project: project, note: "Hey @all, just a ping", author: User.support_bot) }
let(:template_content) { 'some text %{ NOTE_TEXT }' }
- let(:expected_template_html) { 'Hey , just a ping' }
- it_behaves_like 'a service desk notification email with template content', 'new_note'
+ context 'when `disable_all_mention` is disabled' do
+ let(:expected_template_html) { 'Hey , just a ping' }
+
+ before do
+ stub_feature_flags(disable_all_mention: false)
+ end
+
+ it_behaves_like 'a service desk notification email with template content', 'new_note'
+ end
+
+ context 'when `disable_all_mention` is enabled' do
+ let(:expected_template_html) { 'Hey @all, just a ping' }
+
+ before do
+ stub_feature_flags(disable_all_mention: true)
+ end
+
+ it_behaves_like 'a service desk notification email with template content', 'new_note'
+ end
end
end
diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb
index d9e53fb7e9a..ad639a7503a 100644
--- a/spec/models/concerns/mentionable_spec.rb
+++ b/spec/models/concerns/mentionable_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Mentionable do
+RSpec.describe Mentionable, feature_category: :shared do
before do
stub_const('Example', Class.new)
Example.class_eval do
@@ -32,7 +32,7 @@ RSpec.describe Mentionable do
end
end
-RSpec.describe Issue, "Mentionable" do
+RSpec.describe Issue, "Mentionable", feature_category: :team_planning do
describe '#mentioned_users' do
let!(:user) { create(:user, username: 'stranger') }
let!(:user2) { create(:user, username: 'john') }
@@ -187,7 +187,7 @@ RSpec.describe Issue, "Mentionable" do
end
end
-RSpec.describe Commit, 'Mentionable' do
+RSpec.describe Commit, 'Mentionable', feature_category: :source_code_management do
let(:project) { create(:project, :public, :repository) }
let(:commit) { project.commit }
@@ -256,7 +256,7 @@ RSpec.describe Commit, 'Mentionable' do
end
end
-RSpec.describe MergeRequest, 'Mentionable' do
+RSpec.describe MergeRequest, 'Mentionable', feature_category: :code_review_workflow do
describe '#store_mentions!' do
it_behaves_like 'mentions in description', :merge_request
it_behaves_like 'mentions in notes', :merge_request do
@@ -277,7 +277,7 @@ RSpec.describe MergeRequest, 'Mentionable' do
end
end
-RSpec.describe Snippet, 'Mentionable' do
+RSpec.describe Snippet, 'Mentionable', feature_category: :source_code_management do
describe '#store_mentions!' do
it_behaves_like 'mentions in description', :project_snippet
it_behaves_like 'mentions in notes', :project_snippet do
@@ -294,7 +294,7 @@ RSpec.describe Snippet, 'Mentionable' do
end
end
-RSpec.describe PersonalSnippet, 'Mentionable' do
+RSpec.describe PersonalSnippet, 'Mentionable', feature_category: :source_code_management do
describe '#store_mentions!' do
it_behaves_like 'mentions in description', :personal_snippet
it_behaves_like 'mentions in notes', :personal_snippet do
@@ -311,7 +311,7 @@ RSpec.describe PersonalSnippet, 'Mentionable' do
end
end
-RSpec.describe DesignManagement::Design do
+RSpec.describe DesignManagement::Design, feature_category: :team_planning do
describe '#store_mentions!' do
it_behaves_like 'mentions in notes', :design do
let(:note) { create(:diff_note_on_design) }
diff --git a/spec/requests/api/ci/runner/jobs_artifacts_spec.rb b/spec/requests/api/ci/runner/jobs_artifacts_spec.rb
index 3b1b68d00bb..2e0be23ba90 100644
--- a/spec/requests/api/ci/runner/jobs_artifacts_spec.rb
+++ b/spec/requests/api/ci/runner/jobs_artifacts_spec.rb
@@ -181,18 +181,6 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state, feature_catego
expect(json_response['RemoteObject']['SkipDelete']).to eq(true)
expect(json_response['MaximumSize']).not_to be_nil
end
-
- context 'when ci_artifacts_upload_to_final_location flag is disabled' do
- before do
- stub_feature_flags(ci_artifacts_upload_to_final_location: false)
- end
-
- it 'does not skip delete' do
- subject
-
- expect(json_response['RemoteObject']['SkipDelete']).to eq(false)
- end
- end
end
context 'when direct upload is disabled' do
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb
index 292f1c395f5..8a0a2d38187 100644
--- a/spec/serializers/merge_request_widget_entity_spec.rb
+++ b/spec/serializers/merge_request_widget_entity_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe MergeRequestWidgetEntity do
+RSpec.describe MergeRequestWidgetEntity, feature_category: :code_review_workflow do
include ProjectForksHelper
include Gitlab::Routing.url_helpers
diff --git a/spec/services/ci/job_artifacts/create_service_spec.rb b/spec/services/ci/job_artifacts/create_service_spec.rb
index 73cb791f145..7e471bf39a1 100644
--- a/spec/services/ci/job_artifacts/create_service_spec.rb
+++ b/spec/services/ci/job_artifacts/create_service_spec.rb
@@ -107,14 +107,6 @@ RSpec.describe Ci::JobArtifacts::CreateService, :clean_gitlab_redis_shared_state
it_behaves_like 'handling lsif artifact'
it_behaves_like 'validating requirements'
-
- context 'with ci_artifacts_upload_to_final_location feature flag disabled' do
- before do
- stub_feature_flags(ci_artifacts_upload_to_final_location: false)
- end
-
- it_behaves_like 'uploading to temp location', :object_storage
- end
end
context 'and direct upload is disabled' do
diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb
index 0e1afaa8378..99f3134f06f 100644
--- a/spec/services/notification_service_spec.rb
+++ b/spec/services/notification_service_spec.rb
@@ -798,6 +798,7 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do
context 'issue note mention', :deliver_mails_inline do
let_it_be(:issue) { create(:issue, project: project, assignees: [assignee]) }
let_it_be(:mentioned_issue) { create(:issue, assignees: issue.assignees) }
+ let_it_be(:user_to_exclude) { create(:user) }
let_it_be(:author) { create(:user) }
let(:user_mentions) do
@@ -892,18 +893,56 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do
end
end
- context 'when `@all` mention is used' do
- let(:note_content) { "@all mentioned" }
+ context 'when `disable_all_mention` FF is disabled' do
+ before do
+ stub_feature_flags(disable_all_mention: false)
+ end
+
+ context 'when `@all` mention is used' do
+ let(:note_content) { "@all mentioned" }
+
+ it_behaves_like 'correct team members are notified'
+ end
+
+ context 'when users are individually mentioned' do
+ # `user_mentions` is concatenanting individual user mentions
+ # so that the end result is the same as `@all`.
+ let(:note_content) { "#{user_mentions} mentioned" }
- it_behaves_like 'correct team members are notified'
+ it_behaves_like 'correct team members are notified'
+ end
end
- context 'when users are individually mentioned' do
- # `user_mentions` is concatenanting individual user mentions
- # so that the end result is the same as `@all`.
- let(:note_content) { "#{user_mentions} mentioned" }
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+ end
+
+ context 'when `@all` mention is used' do
+ before_all do
+ # user_to_exclude is in the note's project but is neither mentioned nor participating.
+ project.add_maintainer(user_to_exclude)
+ end
+
+ let(:note_content) { "@all mentioned" }
- it_behaves_like 'correct team members are notified'
+ it "does not notify users who are not participating or mentioned" do
+ reset_delivered_emails!
+
+ notification.new_note(note)
+
+ should_email(note.noteable.author)
+ should_not_email(user_to_exclude)
+ end
+ end
+
+ context 'when users are individually mentioned' do
+ # `user_mentions` is concatenanting individual user mentions
+ # so that the end result is the same as `@all`.
+ let(:note_content) { "#{user_mentions} mentioned" }
+
+ it_behaves_like 'correct team members are notified'
+ end
end
end
end
@@ -927,20 +966,20 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do
let(:author) { create(:user) }
let(:note) { create(:note_on_project_snippet, author: author, noteable: snippet, project_id: project.id, note: note_content) }
- before do
- build_team(project)
- build_group(project)
- project.add_maintainer(author)
-
- # make sure these users can read the project snippet!
- project.add_guest(@u_guest_watcher)
- project.add_guest(@u_guest_custom)
- add_member_for_parent_group(@pg_watcher, project)
- reset_delivered_emails!
- end
-
describe '#new_note' do
shared_examples 'correct team members are notified' do
+ before do
+ build_team(project)
+ build_group(project)
+ project.add_maintainer(author)
+
+ # make sure these users can read the project snippet!
+ project.add_guest(@u_guest_watcher)
+ project.add_guest(@u_guest_custom)
+ add_member_for_parent_group(@pg_watcher, project)
+ reset_delivered_emails!
+ end
+
it 'notifies the team members' do
notification.new_note(note)
# Notify all team members
@@ -965,18 +1004,57 @@ RSpec.describe NotificationService, :mailer, feature_category: :team_planning do
end
end
- context 'when `@all` mention is used' do
- let(:note_content) { "@all mentioned" }
+ context 'when `disable_all_mention` FF is disabled' do
+ before do
+ stub_feature_flags(disable_all_mention: false)
+ end
+
+ context 'when `@all` mention is used' do
+ let(:note_content) { "@all mentioned" }
+
+ it_behaves_like 'correct team members are notified'
+ end
+
+ context 'when users are individually mentioned' do
+ # `user_mentions` is concatenanting individual user mentions
+ # so that the end result is the same as `@all`.
+ let(:note_content) { "#{user_mentions} mentioned" }
- it_behaves_like 'correct team members are notified'
+ it_behaves_like 'correct team members are notified'
+ end
end
- context 'when users are individually mentioned' do
- # `user_mentions` is concatenanting individual user mentions
- # so that the end result is the same as `@all`.
- let(:note_content) { "#{user_mentions} mentioned" }
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+ end
+
+ context 'when `@all` mention is used' do
+ let(:user_to_exclude) { create(:user) }
+ let(:note_content) { "@all mentioned" }
+
+ before do
+ project.add_maintainer(author)
+ project.add_maintainer(user_to_exclude)
+
+ reset_delivered_emails!
+ end
+
+ it "does not notify users who are not participating or mentioned" do
+ notification.new_note(note)
- it_behaves_like 'correct team members are notified'
+ should_email(note.noteable.author)
+ should_not_email(user_to_exclude)
+ end
+ end
+
+ context 'when users are individually mentioned' do
+ # `user_mentions` is concatenanting individual user mentions
+ # so that the end result is the same as `@all`.
+ let(:note_content) { "#{user_mentions} mentioned" }
+
+ it_behaves_like 'correct team members are notified'
+ end
end
end
end
diff --git a/spec/support/matchers/markdown_matchers.rb b/spec/support/matchers/markdown_matchers.rb
index 8fdece7b26d..7a82d7674d9 100644
--- a/spec/support/matchers/markdown_matchers.rb
+++ b/spec/support/matchers/markdown_matchers.rb
@@ -110,6 +110,18 @@ module MarkdownMatchers
end
end
+ # UserReferenceFilter
+ # TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/18442
+ # When `@all` is completely deprecated, this matcher should be renamed to
+ # `reference_users` and remove the original matcher `reference_users`
+ matcher :reference_users_excluding_all do
+ set_default_markdown_messages
+
+ match do |actual|
+ expect(actual).to have_selector('a.gfm.gfm-project_member', count: 3)
+ end
+ end
+
# IssueReferenceFilter
matcher :reference_issues do
set_default_markdown_messages
diff --git a/spec/support/shared_examples/models/mentionable_shared_examples.rb b/spec/support/shared_examples/models/mentionable_shared_examples.rb
index f9612dd61be..9874db8dbd7 100644
--- a/spec/support/shared_examples/models/mentionable_shared_examples.rb
+++ b/spec/support/shared_examples/models/mentionable_shared_examples.rb
@@ -208,13 +208,13 @@ end
RSpec.shared_examples 'mentions in description' do |mentionable_type|
context 'when storing user mentions' do
- before do
- mentionable.store_mentions!
- end
-
context 'when mentionable description has no mentions' do
let(:mentionable) { create(mentionable_type, description: "just some description") }
+ before do
+ mentionable.store_mentions!
+ end
+
it 'stores no mentions' do
expect(mentionable.user_mentions.count).to eq 0
end
@@ -228,13 +228,49 @@ RSpec.shared_examples 'mentions in description' do |mentionable_type|
let(:mentionable_desc) { "#{user.to_reference} #{user2.to_reference} #{user.to_reference} some description #{group.to_reference(full: true)} and #{user2.to_reference} @all" }
let(:mentionable) { create(mentionable_type, description: mentionable_desc) }
- it 'stores mentions' do
- add_member(user)
+ context 'when `disable_all_mention` FF is disabled' do
+ before do
+ stub_feature_flags(disable_all_mention: false)
- expect(mentionable.user_mentions.count).to eq 1
- expect(mentionable.referenced_users).to match_array([user, user2])
- expect(mentionable.referenced_projects(user)).to match_array([mentionable.project].compact) # epic.project is nil, and we want empty []
- expect(mentionable.referenced_groups(user)).to match_array([group])
+ mentionable.store_mentions!
+ end
+
+ it 'stores mentions' do
+ add_member(user)
+
+ expect(mentionable.user_mentions.count).to eq 1
+ expect(mentionable.referenced_users).to match_array([user, user2])
+ expect(mentionable.referenced_groups(user)).to match_array([group])
+
+ # NOTE: https://gitlab.com/gitlab-org/gitlab/-/issues/18442
+ #
+ # We created `Mentions` concern to track every note in which usernames are mentioned
+ # However, we never got to the point of utilizing the concern and its DB tables.
+ # See: https://gitlab.com/gitlab-org/gitlab/-/issues/21801
+ #
+ # The following test is checking `@all`, a type of user mention, is recording
+ # the id of the project for the mentionable that has the `@all` mention.
+ # It's _surmised_ that the original intent was
+ # the project id would be useful to store so everyone (@all) in the project -
+ # could be notified using its mention record only.
+ expect(mentionable.referenced_projects(user)).to match_array([mentionable.project].compact) # epic.project is nil, and we want empty []
+ end
+ end
+
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ mentionable.store_mentions!
+ end
+
+ it 'stores mentions' do
+ add_member(user)
+
+ expect(mentionable.user_mentions.count).to eq 1
+ expect(mentionable.referenced_users).to match_array([user, user2])
+ expect(mentionable.referenced_groups(user)).to match_array([group])
+ end
end
end
end
@@ -248,17 +284,37 @@ RSpec.shared_examples 'mentions in notes' do |mentionable_type|
let(:note_desc) { "#{user.to_reference} #{user2.to_reference} #{user.to_reference} and #{group.to_reference(full: true)} and #{user2.to_reference} @all" }
let!(:mentionable) { note.noteable }
- before do
- note.update!(note: note_desc)
- note.store_mentions!
- add_member(user)
+ context 'when `disable_all_mention` FF is enabled' do
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ note.update!(note: note_desc)
+ note.store_mentions!
+ add_member(user)
+ end
+
+ it 'returns all mentionable mentions' do
+ expect(mentionable.user_mentions.count).to eq 1
+ expect(mentionable.referenced_users).to match_array([user, user2])
+ expect(mentionable.referenced_groups(user)).to eq [group]
+ end
end
- it 'returns all mentionable mentions' do
- expect(mentionable.user_mentions.count).to eq 1
- expect(mentionable.referenced_users).to match_array([user, user2])
- expect(mentionable.referenced_projects(user)).to eq [mentionable.project].compact # epic.project is nil, and we want empty []
- expect(mentionable.referenced_groups(user)).to eq [group]
+ context 'when `disable_all_mention` FF is disabled' do
+ before do
+ stub_feature_flags(disable_all_mention: false)
+
+ note.update!(note: note_desc)
+ note.store_mentions!
+ add_member(user)
+ end
+
+ it 'returns all mentionable mentions' do
+ expect(mentionable.user_mentions.count).to eq 1
+ expect(mentionable.referenced_users).to match_array([user, user2])
+ expect(mentionable.referenced_groups(user)).to eq [group]
+ expect(mentionable.referenced_projects(user)).to eq [mentionable.project].compact # epic.project is nil, and we want empty []
+ end
end
if [:epic, :issue].include?(mentionable_type)
@@ -268,6 +324,9 @@ RSpec.shared_examples 'mentions in notes' do |mentionable_type|
let(:note_desc) { "#{guest.to_reference} and #{user2.to_reference} and #{user.to_reference}" }
before do
+ note.update!(note: note_desc)
+ note.store_mentions!
+ add_member(user)
note.resource_parent.add_reporter(user2)
note.resource_parent.add_guest(guest)
# Bypass :confidential update model validation for testing purposes
@@ -283,13 +342,15 @@ RSpec.shared_examples 'mentions in notes' do |mentionable_type|
end
RSpec.shared_examples 'load mentions from DB' do |mentionable_type|
- context 'load stored mentions' do
+ context 'load stored mentions (when `disable_all_mention` is disabled)' do
let_it_be(:user) { create(:user) }
let_it_be(:mentioned_user) { create(:user) }
let_it_be(:group) { create(:group) }
let_it_be(:note_desc) { "#{mentioned_user.to_reference} and #{group.to_reference(full: true)} and @all" }
before do
+ stub_feature_flags(disable_all_mention: false)
+
note.update!(note: note_desc)
note.store_mentions!
add_member(user)
@@ -341,6 +402,7 @@ RSpec.shared_examples 'load mentions from DB' do |mentionable_type|
let(:group_member) { create(:group_member, user: create(:user), group: private_group) }
before do
+ stub_feature_flags(disable_all_mention: false)
user_mention = note.user_mentions.first
mention_ids = {
mentioned_projects_ids: user_mention.mentioned_projects_ids.to_a << private_project.id,
@@ -368,6 +430,99 @@ RSpec.shared_examples 'load mentions from DB' do |mentionable_type|
end
end
end
+
+ context 'when `disable_all_mention` is enabled' do
+ context 'load stored mentions' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:mentioned_user) { create(:user) }
+ let_it_be(:group) { create(:group) }
+ let_it_be(:note_desc) { "#{mentioned_user.to_reference} and #{group.to_reference(full: true)} and @all" }
+
+ before do
+ stub_feature_flags(disable_all_mention: true)
+
+ note.update!(note: note_desc)
+ note.store_mentions!
+ add_member(user)
+ end
+
+ context 'when stored user mention contains ids of inexistent records' do
+ before do
+ user_mention = note.user_mentions.first
+ mention_ids = {
+ mentioned_users_ids: user_mention.mentioned_users_ids.to_a << non_existing_record_id,
+ mentioned_groups_ids: user_mention.mentioned_groups_ids.to_a << non_existing_record_id
+ }
+ user_mention.update!(mention_ids)
+ end
+
+ it 'filters out inexistent mentions' do
+ expect(mentionable.referenced_users).to match_array([mentioned_user])
+ expect(mentionable.referenced_projects(user)).to be_empty
+ expect(mentionable.referenced_groups(user)).to match_array([group])
+ end
+ end
+
+ if [:epic, :issue].include?(mentionable_type)
+ context 'and note is confidential' do
+ let_it_be(:guest) { create(:user) }
+
+ let(:note_desc) { "#{guest.to_reference} and #{mentioned_user.to_reference}" }
+
+ before do
+ note.resource_parent.add_reporter(mentioned_user)
+ note.resource_parent.add_guest(guest)
+ # Bypass :confidential update model validation for testing purposes
+ note.update_attribute(:confidential, true)
+ note.store_mentions!
+ end
+
+ it 'stores only mentioned users that has permissions' do
+ expect(mentionable.referenced_users).to contain_exactly(mentioned_user)
+ end
+ end
+ end
+
+ context 'when private projects and groups are mentioned' do
+ let(:mega_user) { create(:user) }
+ let(:private_project) { create(:project, :private) }
+ let(:project_member) { create(:project_member, user: create(:user), project: private_project) }
+ let(:private_group) { create(:group, :private) }
+ let(:group_member) { create(:group_member, user: create(:user), group: private_group) }
+
+ before do
+ user_mention = note.user_mentions.first
+ mention_ids = {
+ mentioned_projects_ids: user_mention.mentioned_projects_ids.to_a << private_project.id,
+ mentioned_groups_ids: user_mention.mentioned_groups_ids.to_a << private_group.id
+ }
+ user_mention.update!(mention_ids)
+ end
+
+ context 'when user has no access to some mentions' do
+ it 'filters out inaccessible mentions' do
+ expect(mentionable.referenced_projects(user)).to be_empty
+ expect(mentionable.referenced_groups(user)).to match_array([group])
+ end
+ end
+
+ context 'when user has access to the private project and group mentions' do
+ let(:user) { mega_user }
+
+ before do
+ add_member(user)
+ private_project.add_developer(user)
+ private_group.add_developer(user)
+ end
+
+ it 'returns all mentions' do
+ expect(mentionable.referenced_projects(user)).to match_array([private_project])
+ expect(mentionable.referenced_groups(user)).to match_array([group, private_group])
+ end
+ end
+ end
+ end
+ end
end
def add_member(user)
diff --git a/spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb b/spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb
index a93f9adc0ee..e1f089a5b36 100644
--- a/spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb
+++ b/spec/workers/object_storage/delete_stale_direct_uploads_worker_spec.rb
@@ -53,20 +53,5 @@ RSpec.describe ObjectStorage::DeleteStaleDirectUploadsWorker, :direct_uploads, :
expect_to_have_pending_direct_upload(non_stale_remote_path)
expect_pending_uploaded_object_to_exist(non_stale_remote_path)
end
-
- context 'when stale_pending_direct_uploads_cleaner feature flag is disabled' do
- before do
- stub_feature_flags(stale_pending_direct_uploads_cleaner: false)
- end
-
- it 'does nothing' do
- prepare_pending_direct_upload(stale_remote_path, 4.hours.ago)
-
- subject
-
- expect_to_have_pending_direct_upload(stale_remote_path)
- expect_pending_uploaded_object_to_exist(stale_remote_path)
- end
- end
end
end
diff --git a/workhorse/.tool-versions b/workhorse/.tool-versions
index 32603da96a7..e8249f49e4f 100644
--- a/workhorse/.tool-versions
+++ b/workhorse/.tool-versions
@@ -1 +1 @@
-golang 1.19.9
+golang 1.20.5
diff --git a/workhorse/go.mod b/workhorse/go.mod
index dac34f6e910..475e9e3d222 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -36,7 +36,7 @@ require (
golang.org/x/tools v0.8.0
google.golang.org/grpc v1.54.0
google.golang.org/protobuf v1.30.0
- honnef.co/go/tools v0.3.3
+ honnef.co/go/tools v0.4.3
)
require (
@@ -110,7 +110,7 @@ require (
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
- golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e // indirect
+ golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/sync v0.2.0 // indirect
golang.org/x/sys v0.8.0 // indirect
diff --git a/workhorse/go.sum b/workhorse/go.sum
index ab412543887..d05d259bfe4 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -2102,8 +2102,8 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230124195608-d38c7dcee874/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o=
-golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM=
-golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
+golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE=
+golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
@@ -2929,8 +2929,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
-honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
+honnef.co/go/tools v0.4.3 h1:o/n5/K5gXqk8Gozvs2cnL0F2S1/g1vcGCAx2vETjITw=
+honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA=
k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo=
k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ=
k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8=
diff --git a/workhorse/internal/httprs/httprs_test.go b/workhorse/internal/httprs/httprs_test.go
index 9dcfe75219b..8def6de09d9 100644
--- a/workhorse/internal/httprs/httprs_test.go
+++ b/workhorse/internal/httprs/httprs_test.go
@@ -197,7 +197,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) {
defer r.Close()
buf := make([]byte, 4)
io.ReadFull(r, buf)
- s, err := r.Seek(4*64, os.SEEK_CUR)
+ s, err := r.Seek(4*64, io.SeekCurrent)
So(s, ShouldEqual, 4*64+4)
So(err, ShouldBeNil)
n, err := io.ReadFull(r, buf)
@@ -212,7 +212,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) {
defer r.Close()
buf := make([]byte, 4)
io.ReadFull(r, buf)
- s, err := r.Seek(4, os.SEEK_END)
+ s, err := r.Seek(4, io.SeekEnd)
So(s, ShouldEqual, SZ*4-4)
So(err, ShouldBeNil)
n, err := io.ReadFull(r, buf)
@@ -229,7 +229,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) {
So(r.Requests, ShouldEqual, 0)
io.ReadFull(r, buf)
So(r.Requests, ShouldEqual, 1)
- s, err := r.Seek(shortSeekBytes, os.SEEK_CUR)
+ s, err := r.Seek(shortSeekBytes, io.SeekCurrent)
So(r.Requests, ShouldEqual, 1)
So(s, ShouldEqual, shortSeekBytes+4)
So(err, ShouldBeNil)
@@ -248,7 +248,7 @@ func testHttpReaderSeeker(t *testing.T, newRS RSFactory) {
So(r.Requests, ShouldEqual, 0)
io.ReadFull(r, buf)
So(r.Requests, ShouldEqual, 1)
- s, err := r.Seek(shortSeekBytes+1, os.SEEK_CUR)
+ s, err := r.Seek(shortSeekBytes+1, io.SeekCurrent)
So(r.Requests, ShouldEqual, 1)
So(s, ShouldEqual, shortSeekBytes+4+1)
So(err, ShouldBeNil)
diff --git a/workhorse/internal/upload/destination/objectstore/s3_session.go b/workhorse/internal/upload/destination/objectstore/s3_session.go
index e1fe6fbbdc9..168a80845bb 100644
--- a/workhorse/internal/upload/destination/objectstore/s3_session.go
+++ b/workhorse/internal/upload/destination/objectstore/s3_session.go
@@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/endpoints"
"github.com/aws/aws-sdk-go/aws/session"
+ "github.com/aws/aws-sdk-go/service/s3"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/config"
@@ -76,7 +77,7 @@ func setupS3Session(s3Credentials config.S3Credentials, s3Config config.S3Config
// the custom endpoint is only used for S3 API calls, and not
// for STS API calls.
s3CustomResolver := func(service, region string, optFns ...func(*endpoints.Options)) (endpoints.ResolvedEndpoint, error) {
- if service == endpoints.S3ServiceID {
+ if service == s3.EndpointsID {
return endpoints.ResolvedEndpoint{
URL: s3Config.Endpoint,
SigningRegion: region,
diff --git a/workhorse/internal/upload/destination/objectstore/s3_session_test.go b/workhorse/internal/upload/destination/objectstore/s3_session_test.go
index b7bbee0ef69..2329569b774 100644
--- a/workhorse/internal/upload/destination/objectstore/s3_session_test.go
+++ b/workhorse/internal/upload/destination/objectstore/s3_session_test.go
@@ -5,7 +5,8 @@ import (
"time"
"github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/endpoints"
+ "github.com/aws/aws-sdk-go/service/s3"
+ "github.com/aws/aws-sdk-go/service/sts"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab/workhorse/internal/config"
@@ -20,7 +21,7 @@ func TestS3SessionSetup(t *testing.T) {
sess, err := setupS3Session(credentials, cfg)
require.NoError(t, err)
- s3Config := sess.ClientConfig(endpoints.S3ServiceID)
+ s3Config := sess.ClientConfig(s3.EndpointsID)
require.Equal(t, "https://s3.us-west-1.amazonaws.com", s3Config.Endpoint)
require.Equal(t, "us-west-1", s3Config.SigningRegion)
require.True(t, aws.BoolValue(sess.Config.S3ForcePathStyle))
@@ -44,11 +45,11 @@ func TestS3SessionEndpointSetup(t *testing.T) {
require.NoError(t, err)
// ClientConfig is what is ultimately used by an S3 client
- s3Config := sess.ClientConfig(endpoints.S3ServiceID)
+ s3Config := sess.ClientConfig(s3.EndpointsID)
require.Equal(t, customS3Endpoint, s3Config.Endpoint)
require.Equal(t, region, s3Config.SigningRegion)
- stsConfig := sess.ClientConfig(endpoints.StsServiceID)
+ stsConfig := sess.ClientConfig(sts.EndpointsID)
require.Equal(t, "https://sts.amazonaws.com", stsConfig.Endpoint, "STS should use default endpoint")
}