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
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-06-20 13:43:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-20 13:43:29 +0300
commit3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch)
tree3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /db
parent9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff)
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'db')
-rw-r--r--db/database_connections/ci.yaml10
-rw-r--r--db/database_connections/main.yaml15
-rw-r--r--db/database_connections/main_clusterwide.yaml10
-rw-r--r--db/docs/abuse_events.yml10
-rw-r--r--db/docs/allowed_email_domains.yml2
-rw-r--r--db/docs/audit_events_streaming_instance_event_type_filters.yml10
-rw-r--r--db/docs/badges.yml2
-rw-r--r--db/docs/batched_background_migrations/backfill_code_suggestions_namespace_settings.yml6
-rw-r--r--db/docs/batched_background_migrations/backfill_resource_link_events.yml6
-rw-r--r--db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml6
-rw-r--r--db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml8
-rw-r--r--db/docs/batched_background_migrations/mark_duplicate_npm_packages_for_destruction.yml6
-rw-r--r--db/docs/batched_background_migrations/remove_invalid_deploy_access_level_groups.yml6
-rw-r--r--db/docs/deleted_tables/project_wiki_repository_states.yml12
-rw-r--r--db/docs/dependency_proxy_packages_settings.yml10
-rw-r--r--db/docs/design_management_repository_states.yml2
-rw-r--r--db/docs/group_custom_attributes.yml2
-rw-r--r--db/docs/group_deletion_schedules.yml2
-rw-r--r--db/docs/instance_audit_events_streaming_headers.yml10
-rw-r--r--db/docs/integrations.yml2
-rw-r--r--db/docs/member_roles.yml3
-rw-r--r--db/docs/members.yml3
-rw-r--r--db/docs/namespace_admin_notes.yml2
-rw-r--r--db/docs/namespace_details.yml2
-rw-r--r--db/docs/namespace_settings.yml2
-rw-r--r--db/docs/namespaces.yml4
-rw-r--r--db/docs/organizations.yml4
-rw-r--r--db/docs/p_ci_builds.yml14
-rw-r--r--db/docs/p_ci_job_annotations.yml9
-rw-r--r--db/docs/project_authorizations.yml2
-rw-r--r--db/docs/project_compliance_standards_adherence.yml10
-rw-r--r--db/docs/project_custom_attributes.yml2
-rw-r--r--db/docs/project_settings.yml2
-rw-r--r--db/docs/project_topics.yml2
-rw-r--r--db/docs/project_wiki_repository_states.yml10
-rw-r--r--db/docs/projects.yml2
-rw-r--r--db/docs/redirect_routes.yml3
-rw-r--r--db/docs/routes.yml3
-rw-r--r--db/docs/subscription_add_on_purchases.yml10
-rw-r--r--db/docs/subscription_add_ons.yml10
-rw-r--r--db/docs/topics.yml2
-rw-r--r--db/docs/uploads.yml2
-rw-r--r--db/docs/user_interacted_projects.yml2
-rw-r--r--db/docs/users.yml2
-rw-r--r--db/docs/users_star_projects.yml2
-rw-r--r--db/fixtures/development/002_default_organization.rb5
-rw-r--r--db/fixtures/development/12_snippets.rb4
-rw-r--r--db/fixtures/development/17_cycle_analytics.rb71
-rw-r--r--db/fixtures/development/24_forks.rb4
-rw-r--r--db/fixtures/development/25_api_personal_access_token.rb1
-rw-r--r--db/fixtures/development/31_error_tracking.rb44
-rw-r--r--db/fixtures/development/36_achievements.rb2
-rw-r--r--db/fixtures/development/99_common_metrics.rb3
-rw-r--r--db/fixtures/production/030_default_organization.rb5
-rw-r--r--db/fixtures/production/999_common_metrics.rb3
-rw-r--r--db/gitlab_schemas/gitlab_ci.yaml7
-rw-r--r--db/gitlab_schemas/gitlab_internal.yaml2
-rw-r--r--db/gitlab_schemas/gitlab_main.yaml7
-rw-r--r--db/gitlab_schemas/gitlab_main_cell.yaml21
-rw-r--r--db/gitlab_schemas/gitlab_main_clusterwide.yaml17
-rw-r--r--db/gitlab_schemas/gitlab_pm.yaml7
-rw-r--r--db/gitlab_schemas/gitlab_shared.yaml8
-rw-r--r--db/init_structure.sql2282
-rw-r--r--db/migrate/20211202041233_init_schema.rb4
-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/migrate/20221014034338_populate_releases_access_level_from_repository.rb2
-rw-r--r--db/migrate/20230222131512_add_wiki_asciidoc_allow_uri_includes.rb8
-rw-r--r--db/migrate/20230328150343_add_retried_at_to_status_check_responses.rb7
-rw-r--r--db/migrate/20230329235300_add_diagramsnet_to_application_settings.rb12
-rw-r--r--db/migrate/20230406115900_add_diagramsnet_text_limit.rb13
-rw-r--r--db/migrate/20230428070443_add_allow_account_deletion_to_application_settings.rb7
-rw-r--r--db/migrate/20230428165514_add_type_to_http_integrations.rb7
-rw-r--r--db/migrate/20230504182314_add_pa_configurator_base_to_project_settings.rb14
-rw-r--r--db/migrate/20230505115558_add_authors_and_description_to_nuget_metadatum.rb22
-rw-r--r--db/migrate/20230508095017_add_project_shortcut_buttons_to_user_preferences.rb9
-rw-r--r--db/migrate/20230509013743_remove_clear_shared_runners_minutes_worker_job_instances.rb14
-rw-r--r--db/migrate/20230510141454_add_user_id_to_import_failures.rb7
-rw-r--r--db/migrate/20230510142316_add_index_on_user_id_to_import_failures.rb15
-rw-r--r--db/migrate/20230510142931_add_foreign_key_for_user_id_to_import_failures.rb15
-rw-r--r--db/migrate/20230512141931_add_group_id_to_dependency_list_exports.rb7
-rw-r--r--db/migrate/20230516044606_add_organization_id_to_namespace.rb7
-rw-r--r--db/migrate/20230516045238_track_organization_record_changes.rb11
-rw-r--r--db/migrate/20230516045442_prepare_index_for_org_id_on_namespaces.rb11
-rw-r--r--db/migrate/20230516072100_add_vertex_project_to_application_settings.rb15
-rw-r--r--db/migrate/20230516080816_replace_vsd_index_with_nulls_first_order.rb25
-rw-r--r--db/migrate/20230516110414_add_ml_model_max_file_size_to_plan_limits.rb7
-rw-r--r--db/migrate/20230516115259_increase_correlation_id_size_limit_in_abuse_trust_scores.rb17
-rw-r--r--db/migrate/20230516125656_create_dependency_proxy_packages_settings.rb53
-rw-r--r--db/migrate/20230516175449_create_instance_audit_events_streaming_headers.rb20
-rw-r--r--db/migrate/20230516183736_add_container_registry_data_repair_worker_max_concurrency_to_application_settings.rb26
-rw-r--r--db/migrate/20230517090826_add_namespace_aggregation_schedule_lease_duration_to_application_settings.rb11
-rw-r--r--db/migrate/20230517151041_add_agent_id_column_to_environments.rb9
-rw-r--r--db/migrate/20230517151141_add_index_to_agent_id_column_environments.rb15
-rw-r--r--db/migrate/20230517151241_add_agent_id_foreign_key_to_environments.rb17
-rw-r--r--db/migrate/20230517182802_add_fields_to_abuse_reports.rb30
-rw-r--r--db/migrate/20230517182958_add_foreign_key_constraints_to_abuse_reports.rb20
-rw-r--r--db/migrate/20230517183403_add_foreign_key_to_abuse_reports_for_assignee.rb20
-rw-r--r--db/migrate/20230519103034_truncate_schema_inconsistencies_table.rb13
-rw-r--r--db/migrate/20230519112106_add_diff_column_to_schema_inconsistencies.rb12
-rw-r--r--db/migrate/20230519135414_add_text_limit_for_diff.rb13
-rw-r--r--db/migrate/20230522103433_remove_git_hub_import_deprecated_workers.rb18
-rw-r--r--db/migrate/20230522132239_add_model_experiments_access_level_to_project_feature.rb15
-rw-r--r--db/migrate/20230522180913_create_abuse_events.rb24
-rw-r--r--db/migrate/20230522181134_add_foreign_key_constraints_to_abuse_events.rb15
-rw-r--r--db/migrate/20230522210320_add_admin_vulnerability_to_member_roles.rb7
-rw-r--r--db/migrate/20230523073455_add_new_async_index_table_name_length_constraint.rb15
-rw-r--r--db/migrate/20230523074248_validate_async_index_table_name_length_constraint.rb13
-rw-r--r--db/migrate/20230523074517_remove_old_async_index_table_name_length_constraint.rb20
-rw-r--r--db/migrate/20230523101514_finalize_user_type_migration.rb15
-rw-r--r--db/migrate/20230523122242_add_encrypted_ai_access_token.rb8
-rw-r--r--db/migrate/20230523125430_add_dismissal_reason_to_vulnerability_read.rb13
-rw-r--r--db/migrate/20230524012641_add_vertex_ai_host_to_application_settings.rb21
-rw-r--r--db/migrate/20230524095108_remove_index_on_name_on_organization.rb15
-rw-r--r--db/migrate/20230524142655_add_enabled_zoekt_to_user_preferences.rb9
-rw-r--r--db/migrate/20230525064706_add_service_desk_enabled_to_service_desk_settings.rb7
-rw-r--r--db/migrate/20230529163335_add_show_in_cli_to_broadcast_message.rb7
-rw-r--r--db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb21
-rw-r--r--db/migrate/20230529182720_recreate_billable_index.rb22
-rw-r--r--db/migrate/20230529184716_recreated_activity_index.rb23
-rw-r--r--db/migrate/20230530003417_rename_tofa_settings.rb21
-rw-r--r--db/migrate/20230530112122_add_path_to_organizations.rb18
-rw-r--r--db/migrate/20230530112602_add_text_limit_on_organization_path.rb13
-rw-r--r--db/migrate/20230530162437_add_instance_code_suggestion_enabled_to_app_settings.rb7
-rw-r--r--db/migrate/20230531054422_add_index_on_packages_id_id_to_package_build_infos.rb15
-rw-r--r--db/migrate/20230531134916_create_subscription_add_ons.rb12
-rw-r--r--db/migrate/20230531135001_create_subscription_add_on_purchases.rb18
-rw-r--r--db/migrate/20230531142032_add_foreign_key_subscription_add_on_id_on_subscription_add_on_purchases.rb18
-rw-r--r--db/migrate/20230531142053_add_foreign_key_namespace_id_on_subscription_add_on_purchases.rb15
-rw-r--r--db/migrate/20230531164258_add_operator_value_interval_to_scan_result_policies.rb21
-rw-r--r--db/migrate/20230601035558_add_unconfirmed_user_deletion_to_application_settings.rb8
-rw-r--r--db/migrate/20230601084041_add_merge_request_diff_llm_summaries_unique_index.rb18
-rw-r--r--db/migrate/20230601085810_create_project_compliance_standards_adherence.rb19
-rw-r--r--db/migrate/20230601085815_add_fk_to_projects_compliance_standards_adherence_on_project_id.rb16
-rw-r--r--db/migrate/20230601085820_add_fk_to_projects_compliance_standards_adherence_on_namespace_id.rb16
-rw-r--r--db/migrate/20230603174306_add_finished_at_column_to_batched_background_migrations_table.rb7
-rw-r--r--db/migrate/20230605043258_add_unconfirmed_created_at_index_to_users.rb17
-rw-r--r--db/migrate/20230605043814_add_trigram_index_for_vulnerability_reads_container_images.rb19
-rw-r--r--db/migrate/20230605095810_ensure_default_organization.rb30
-rw-r--r--db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb7
-rw-r--r--db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb7
-rw-r--r--db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb16
-rw-r--r--db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb16
-rw-r--r--db/migrate/20230606182433_add_enterprise_columns_to_user_details.rb11
-rw-r--r--db/migrate/20230607080200_add_limits_history_to_plan_limits.rb7
-rw-r--r--db/migrate/20230607101334_add_ci_job_annotations_table.rb21
-rw-r--r--db/migrate/20230607102017_add_index_on_ci_job_annotations.rb22
-rw-r--r--db/migrate/20230607102721_add_check_constraints_to_ci_job_annotations.rb17
-rw-r--r--db/migrate/20230607102731_create_ci_job_annotations_partitions.rb19
-rw-r--r--db/migrate/20230608195429_redo_remove_create_learn_gitlab_worker_job_instances.rb15
-rw-r--r--db/migrate/20230609085234_add_gitlab_shell_operation_limit_to_application_settings.rb7
-rw-r--r--db/migrate/20230609115844_create_audit_events_streaming_instance_event_type_filters.rb18
-rw-r--r--db/migrate/20230612072807_add_vacuum_type_to_autovacuum_status.rb47
-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/post_migrate/20221027203951_drop_experiment_users_table.rb2
-rw-r--r--db/post_migrate/20221114142602_drop_experiment_subjects_table.rb2
-rw-r--r--db/post_migrate/20221114142616_drop_experiments_table.rb2
-rw-r--r--db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb4
-rw-r--r--db/post_migrate/20221207135755_finalize_add_namespaces_emails_enabled_column_data.rb22
-rw-r--r--db/post_migrate/20221207135831_finalize_add_projects_emails_enabled_column_data.rb22
-rw-r--r--db/post_migrate/20230104103748_remove_new_amount_used_column.rb4
-rw-r--r--db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb4
-rw-r--r--db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb2
-rw-r--r--db/post_migrate/20230202211434_migrate_redis_slot_keys.rb102
-rw-r--r--db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb82
-rw-r--r--db/post_migrate/20230310020356_swap_merge_request_user_mentions_note_id_to_bigint_2.rb93
-rw-r--r--db/post_migrate/20230316185746_drop_packages_events_table.rb2
-rw-r--r--db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb89
-rw-r--r--db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb2
-rw-r--r--db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb99
-rw-r--r--db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb16
-rw-r--r--db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb6
-rw-r--r--db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb2
-rw-r--r--db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb19
-rw-r--r--db/post_migrate/20230426085615_queue_backfill_resource_link_events.rb43
-rw-r--r--db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb2
-rw-r--r--db/post_migrate/20230502102833_add_index_to_members_on_source_and_type_and_access_level.rb15
-rw-r--r--db/post_migrate/20230502120022_add_index_to_project_authorizations_on_project_user_access_level.rb15
-rw-r--r--db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb2
-rw-r--r--db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb2
-rw-r--r--db/post_migrate/20230502193525_drop_clusters_applications_helm.rb2
-rw-r--r--db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb2
-rw-r--r--db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb2
-rw-r--r--db/post_migrate/20230503152349_drop_clusters_applications_knative.rb2
-rw-r--r--db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb2
-rw-r--r--db/post_migrate/20230503175406_drop_clusters_applications_runners.rb2
-rw-r--r--db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb2
-rw-r--r--db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb25
-rw-r--r--db/post_migrate/20230510013754_cleanup_notes_bigint_preparation.rb51
-rw-r--r--db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb30
-rw-r--r--db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb2
-rw-r--r--db/post_migrate/20230510152153_remove_mr_state_id_temp_index_with_right_column.rb15
-rw-r--r--db/post_migrate/20230511132140_create_component_id_index.rb17
-rw-r--r--db/post_migrate/20230512104238_add_audit_events_group_index.rb19
-rw-r--r--db/post_migrate/20230512143000_remove_dependency_list_exports_project_id_not_null_constraint.rb11
-rw-r--r--db/post_migrate/20230515101208_index_group_id_on_dependency_list_exports.rb15
-rw-r--r--db/post_migrate/20230515102353_add_foreign_key_to_group_id_on_dependency_list_exports.rb17
-rw-r--r--db/post_migrate/20230515142300_add_unique_index_for_ml_model_packages.rb19
-rw-r--r--db/post_migrate/20230515153600_finalize_back_fill_prepared_at_merge_requests.rb25
-rw-r--r--db/post_migrate/20230516032545_add_unique_notes_id_convert_to_bigint_for_gitlab_com.rb34
-rw-r--r--db/post_migrate/20230516033729_add_referencing_bigint_fks_for_notes_on_gitlab_com.rb74
-rw-r--r--db/post_migrate/20230516123202_create_routing_table_for_ci_builds.rb93
-rw-r--r--db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb14
-rw-r--r--db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb15
-rw-r--r--db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb15
-rw-r--r--db/post_migrate/20230517005523_ensure_backfill_bigint_id_is_completed.rb23
-rw-r--r--db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb25
-rw-r--r--db/post_migrate/20230518005523_add_concurrent_index_for_ci_pipeline_variables_bigint_id.rb18
-rw-r--r--db/post_migrate/20230518071251_queue_backfill_code_suggestions_namespace_settings.rb23
-rw-r--r--db/post_migrate/20230518121320_remove_time_format_in_24h_column.rb13
-rw-r--r--db/post_migrate/20230519011151_schedule_to_remove_invalid_deploy_access_level_groups.rb23
-rw-r--r--db/post_migrate/20230519023720_swap_ci_pipeline_variables_pk_with_bigint.rb75
-rw-r--r--db/post_migrate/20230521521419_drop_merge_request_state_id_temp_index.rb16
-rw-r--r--db/post_migrate/20230522073230_add_not_null_constraint_to_personal_access_tokens_expires_at.rb13
-rw-r--r--db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb32
-rw-r--r--db/post_migrate/20230522220709_ensure_incident_work_item_type_backfill_is_finished.rb37
-rw-r--r--db/post_migrate/20230522225610_remove_tmp_index_issues_on_issue_type_and_id_only_incidents.rb16
-rw-r--r--db/post_migrate/20230523125245_remove_project_ci_cd_setting_opt_in_jwt_column.rb13
-rw-r--r--db/post_migrate/20230523131914_recreate_index_on_vulnerability_reads.rb34
-rw-r--r--db/post_migrate/20230523132647_recreate_index_on_vulnerability_reads2.rb34
-rw-r--r--db/post_migrate/20230523210653_remove_file_md5_from_debian_project_component_files.rb9
-rw-r--r--db/post_migrate/20230523210758_remove_file_md5_from_debian_group_component_files.rb9
-rw-r--r--db/post_migrate/20230524093249_add_async_index_to_vsa_issues.rb39
-rw-r--r--db/post_migrate/20230524093355_add_async_index_to_vsa_mrs.rb39
-rw-r--r--db/post_migrate/20230524120241_add_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb23
-rw-r--r--db/post_migrate/20230524135543_replace_ci_build_pending_states_foreign_key.rb23
-rw-r--r--db/post_migrate/20230524135555_replace_ci_build_trace_chunks_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135607_replace_ci_unit_test_failures_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135620_replace_ci_sources_pipelines_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135632_replace_ci_resources_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135645_replace_ci_build_report_results_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135658_replace_ci_build_needs_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135711_replace_ci_builds_runner_session_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135724_replace_ci_pending_builds_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135737_replace_ci_build_trace_metadata_foreign_key.rb24
-rw-r--r--db/post_migrate/20230524135750_replace_ci_job_artifacts_foreign_key.rb13
-rw-r--r--db/post_migrate/20230524135803_replace_ci_running_builds_foreign_key.rb13
-rw-r--r--db/post_migrate/20230524135815_replace_ci_job_variables_foreign_key.rb13
-rw-r--r--db/post_migrate/20230524135828_replace_p_ci_builds_metadata_foreign_key.rb13
-rw-r--r--db/post_migrate/20230524135840_replace_p_ci_runner_machine_builds_foreign_key.rb13
-rw-r--r--db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb19
-rw-r--r--db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb19
-rw-r--r--db/post_migrate/20230524201454_queue_mark_duplicate_npm_packages_for_destruction.rb29
-rw-r--r--db/post_migrate/20230525180605_add_index_work_item_types_on_base_type_id.rb15
-rw-r--r--db/post_migrate/20230529183648_remove_temporary_billable_index.rb18
-rw-r--r--db/post_migrate/20230529185110_cleanup_temporary_activity_index.rb17
-rw-r--r--db/post_migrate/20230530003634_cleanup_tofa_settings.rb23
-rw-r--r--db/post_migrate/20230530015535_swap_notes_id_to_bigint_for_gitlab_dot_com.rb195
-rw-r--r--db/post_migrate/20230530100400_change_user_type_null.rb13
-rw-r--r--db/post_migrate/20230530114845_cleanup_organizations_with_null_path.rb18
-rw-r--r--db/post_migrate/20230530115830_remove_default_on_organization_path.rb11
-rw-r--r--db/post_migrate/20230530140456_validate_fk_ci_build_pending_states_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140509_validate_fk_ci_build_trace_chunks_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140521_validate_fk_ci_unit_test_failures_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140534_validate_fk_ci_sources_pipelines_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140546_validate_fk_ci_resources_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140558_validate_fk_ci_build_report_results_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140611_validate_fk_ci_build_needs_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140623_validate_fk_ci_builds_runner_session_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140634_validate_fk_ci_pending_builds_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230530140646_validate_fk_ci_build_trace_metadata_p_ci_builds.rb11
-rw-r--r--db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb15
-rw-r--r--db/post_migrate/20230601184234_drop_unnecessary_async_index_from_events.rb13
-rw-r--r--db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb17
-rw-r--r--db/post_migrate/20230602112904_change_user_preferences_defaults.rb11
-rw-r--r--db/post_migrate/20230602131429_change_notified_of_own_activity_default.rb9
-rw-r--r--db/post_migrate/20230605085936_add_new_index_to_vsa_issue_stage_events.rb19
-rw-r--r--db/post_migrate/20230605085957_add_new_index_to_vsa_mr_stage_events.rb19
-rw-r--r--db/post_migrate/20230605093005_add_index_for_sbom_occurrences_on_project_id_source_id.rb15
-rw-r--r--db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb18
-rw-r--r--db/post_migrate/20230606183327_add_index_user_details_on_enterprise_group_id.rb21
-rw-r--r--db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb17
-rw-r--r--db/post_migrate/20230607093222_remove_webauthn_registrations_u2f_registration_id_column.rb21
-rw-r--r--db/post_migrate/20230607165632_remove_fk_on_project_id_on_project_wiki_repository_states.rb20
-rw-r--r--db/post_migrate/20230607165718_drop_project_wiki_repository_states.rb57
-rw-r--r--db/post_migrate/20230608071301_requeue_cleanup_personal_access_tokens_with_nil_expires_at.rb25
-rw-r--r--db/post_migrate/20230608081257_delete_index_members_on_source_id_and_source_type.rb15
-rw-r--r--db/post_migrate/20230608081924_delete_index_unique_project_authorizations_on_project_id_user_id.rb15
-rw-r--r--db/post_migrate/20230608101503_add_ci_job_annotations_foreign_key.rb22
-rw-r--r--db/post_migrate/20230608231452_cleanup_bigint_conversion_for_todos_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230608232452_cleanup_bigint_conversion_for_system_note_metadata_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230608233452_cleanup_bigint_conversion_for_epic_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230608234452_cleanup_bigint_conversion_for_suggestions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230608235452_cleanup_bigint_conversion_for_issue_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609000452_cleanup_bigint_conversion_for_note_diff_files_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609001452_cleanup_bigint_conversion_for_snippet_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609002452_cleanup_bigint_conversion_for_design_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609003452_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609004452_cleanup_bigint_conversion_for_commit_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609005452_cleanup_bigint_conversion_for_merge_request_user_mentions_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609010452_cleanup_bigint_conversion_for_timelogs_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230609011452_cleanup_bigint_conversion_for_award_emoji_for_gitlab_com.rb28
-rw-r--r--db/post_migrate/20230612075608_replace_ci_job_artifacts_foreign_key_v2.rb36
-rw-r--r--db/post_migrate/20230612083337_replace_ci_running_builds_foreign_key_v2.rb36
-rw-r--r--db/post_migrate/20230612083655_replace_ci_job_variables_foreign_key_v2.rb36
-rw-r--r--db/post_migrate/20230612083810_replace_p_ci_builds_metadata_foreign_key_v2.rb40
-rw-r--r--db/post_migrate/20230612084013_replace_p_ci_runner_machine_builds_foreign_key_v2.rb40
-rw-r--r--db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb18
-rw-r--r--db/post_migrate/20230614073136_restore_index_for_contribution_analytics_events.rb15
-rw-r--r--db/post_migrate/20230614181637_add_idx_issues_on_work_item_type_project_closed_at_where_closed.rb15
-rw-r--r--db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb45
-rw-r--r--db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb45
-rw-r--r--db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb16
-rw-r--r--db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb16
-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--db/schema_migrations/202212071357551
-rw-r--r--db/schema_migrations/202212071358311
-rw-r--r--db/schema_migrations/202302221315121
-rw-r--r--db/schema_migrations/202303100203561
-rw-r--r--db/schema_migrations/202303281503431
-rw-r--r--db/schema_migrations/202303292353001
-rw-r--r--db/schema_migrations/202304061159001
-rw-r--r--db/schema_migrations/202304260303421
-rw-r--r--db/schema_migrations/202304260856151
-rw-r--r--db/schema_migrations/202304280704431
-rw-r--r--db/schema_migrations/202304281655141
-rw-r--r--db/schema_migrations/202305021028331
-rw-r--r--db/schema_migrations/202305021200221
-rw-r--r--db/schema_migrations/202305041823141
-rw-r--r--db/schema_migrations/202305051155581
-rw-r--r--db/schema_migrations/202305080950171
-rw-r--r--db/schema_migrations/202305090137431
-rw-r--r--db/schema_migrations/202305100137541
-rw-r--r--db/schema_migrations/202305101414541
-rw-r--r--db/schema_migrations/202305101423161
-rw-r--r--db/schema_migrations/202305101429311
-rw-r--r--db/schema_migrations/202305101521531
-rw-r--r--db/schema_migrations/202305111321401
-rw-r--r--db/schema_migrations/202305121042381
-rw-r--r--db/schema_migrations/202305121419311
-rw-r--r--db/schema_migrations/202305121430001
-rw-r--r--db/schema_migrations/202305151012081
-rw-r--r--db/schema_migrations/202305151023531
-rw-r--r--db/schema_migrations/202305151423001
-rw-r--r--db/schema_migrations/202305151536001
-rw-r--r--db/schema_migrations/202305160325451
-rw-r--r--db/schema_migrations/202305160337291
-rw-r--r--db/schema_migrations/202305160446061
-rw-r--r--db/schema_migrations/202305160452381
-rw-r--r--db/schema_migrations/202305160454421
-rw-r--r--db/schema_migrations/202305160721001
-rw-r--r--db/schema_migrations/202305160808161
-rw-r--r--db/schema_migrations/202305161104141
-rw-r--r--db/schema_migrations/202305161152591
-rw-r--r--db/schema_migrations/202305161232021
-rw-r--r--db/schema_migrations/202305161256561
-rw-r--r--db/schema_migrations/202305161724461
-rw-r--r--db/schema_migrations/202305161754491
-rw-r--r--db/schema_migrations/202305161837361
-rw-r--r--db/schema_migrations/202305161925431
-rw-r--r--db/schema_migrations/202305170015351
-rw-r--r--db/schema_migrations/202305170055231
-rw-r--r--db/schema_migrations/202305170908261
-rw-r--r--db/schema_migrations/202305171510411
-rw-r--r--db/schema_migrations/202305171511411
-rw-r--r--db/schema_migrations/202305171512411
-rw-r--r--db/schema_migrations/202305171633001
-rw-r--r--db/schema_migrations/202305171828021
-rw-r--r--db/schema_migrations/202305171829581
-rw-r--r--db/schema_migrations/202305171834031
-rw-r--r--db/schema_migrations/202305180055231
-rw-r--r--db/schema_migrations/202305180712511
-rw-r--r--db/schema_migrations/202305181213201
-rw-r--r--db/schema_migrations/202305190111511
-rw-r--r--db/schema_migrations/202305190237201
-rw-r--r--db/schema_migrations/202305191030341
-rw-r--r--db/schema_migrations/202305191121061
-rw-r--r--db/schema_migrations/202305191354141
-rw-r--r--db/schema_migrations/202305215214191
-rw-r--r--db/schema_migrations/202305220732301
-rw-r--r--db/schema_migrations/202305221034331
-rw-r--r--db/schema_migrations/202305221115341
-rw-r--r--db/schema_migrations/202305221322391
-rw-r--r--db/schema_migrations/202305221809131
-rw-r--r--db/schema_migrations/202305221811341
-rw-r--r--db/schema_migrations/202305222103201
-rw-r--r--db/schema_migrations/202305222207091
-rw-r--r--db/schema_migrations/202305222256101
-rw-r--r--db/schema_migrations/202305230734551
-rw-r--r--db/schema_migrations/202305230742481
-rw-r--r--db/schema_migrations/202305230745171
-rw-r--r--db/schema_migrations/202305231015141
-rw-r--r--db/schema_migrations/202305231222421
-rw-r--r--db/schema_migrations/202305231252451
-rw-r--r--db/schema_migrations/202305231254301
-rw-r--r--db/schema_migrations/202305231319141
-rw-r--r--db/schema_migrations/202305231326471
-rw-r--r--db/schema_migrations/202305232106531
-rw-r--r--db/schema_migrations/202305232107581
-rw-r--r--db/schema_migrations/202305240126411
-rw-r--r--db/schema_migrations/202305240932491
-rw-r--r--db/schema_migrations/202305240933551
-rw-r--r--db/schema_migrations/202305240951081
-rw-r--r--db/schema_migrations/202305241202411
-rw-r--r--db/schema_migrations/202305241355431
-rw-r--r--db/schema_migrations/202305241355551
-rw-r--r--db/schema_migrations/202305241356071
-rw-r--r--db/schema_migrations/202305241356201
-rw-r--r--db/schema_migrations/202305241356321
-rw-r--r--db/schema_migrations/202305241356451
-rw-r--r--db/schema_migrations/202305241356581
-rw-r--r--db/schema_migrations/202305241357111
-rw-r--r--db/schema_migrations/202305241357241
-rw-r--r--db/schema_migrations/202305241357371
-rw-r--r--db/schema_migrations/202305241357501
-rw-r--r--db/schema_migrations/202305241358031
-rw-r--r--db/schema_migrations/202305241358151
-rw-r--r--db/schema_migrations/202305241358281
-rw-r--r--db/schema_migrations/202305241358401
-rw-r--r--db/schema_migrations/202305241426551
-rw-r--r--db/schema_migrations/202305241502321
-rw-r--r--db/schema_migrations/202305241504381
-rw-r--r--db/schema_migrations/202305242014541
-rw-r--r--db/schema_migrations/202305250647061
-rw-r--r--db/schema_migrations/202305251806051
-rw-r--r--db/schema_migrations/202305291633351
-rw-r--r--db/schema_migrations/202305291736071
-rw-r--r--db/schema_migrations/202305291827201
-rw-r--r--db/schema_migrations/202305291836481
-rw-r--r--db/schema_migrations/202305291847161
-rw-r--r--db/schema_migrations/202305291851101
-rw-r--r--db/schema_migrations/202305300034171
-rw-r--r--db/schema_migrations/202305300036341
-rw-r--r--db/schema_migrations/202305300155351
-rw-r--r--db/schema_migrations/202305301004001
-rw-r--r--db/schema_migrations/202305301121221
-rw-r--r--db/schema_migrations/202305301126021
-rw-r--r--db/schema_migrations/202305301148451
-rw-r--r--db/schema_migrations/202305301158301
-rw-r--r--db/schema_migrations/202305301404561
-rw-r--r--db/schema_migrations/202305301405091
-rw-r--r--db/schema_migrations/202305301405211
-rw-r--r--db/schema_migrations/202305301405341
-rw-r--r--db/schema_migrations/202305301405461
-rw-r--r--db/schema_migrations/202305301405581
-rw-r--r--db/schema_migrations/202305301406111
-rw-r--r--db/schema_migrations/202305301406231
-rw-r--r--db/schema_migrations/202305301406341
-rw-r--r--db/schema_migrations/202305301406461
-rw-r--r--db/schema_migrations/202305301624371
-rw-r--r--db/schema_migrations/202305310544221
-rw-r--r--db/schema_migrations/202305311349161
-rw-r--r--db/schema_migrations/202305311350011
-rw-r--r--db/schema_migrations/202305311420321
-rw-r--r--db/schema_migrations/202305311420531
-rw-r--r--db/schema_migrations/202305311642581
-rw-r--r--db/schema_migrations/202305311657311
-rw-r--r--db/schema_migrations/202306010355581
-rw-r--r--db/schema_migrations/202306010840411
-rw-r--r--db/schema_migrations/202306010858101
-rw-r--r--db/schema_migrations/202306010858151
-rw-r--r--db/schema_migrations/202306010858201
-rw-r--r--db/schema_migrations/202306011842341
-rw-r--r--db/schema_migrations/202306020630591
-rw-r--r--db/schema_migrations/202306021129041
-rw-r--r--db/schema_migrations/202306021314291
-rw-r--r--db/schema_migrations/202306031743061
-rw-r--r--db/schema_migrations/202306050432581
-rw-r--r--db/schema_migrations/202306050438141
-rw-r--r--db/schema_migrations/202306050859361
-rw-r--r--db/schema_migrations/202306050859571
-rw-r--r--db/schema_migrations/202306050930051
-rw-r--r--db/schema_migrations/202306050958101
-rw-r--r--db/schema_migrations/202306051920001
-rw-r--r--db/schema_migrations/202306061247541
-rw-r--r--db/schema_migrations/202306061248541
-rw-r--r--db/schema_migrations/202306061248551
-rw-r--r--db/schema_migrations/202306061248561
-rw-r--r--db/schema_migrations/202306061824331
-rw-r--r--db/schema_migrations/202306061833271
-rw-r--r--db/schema_migrations/202306061930371
-rw-r--r--db/schema_migrations/202306070802001
-rw-r--r--db/schema_migrations/202306070932221
-rw-r--r--db/schema_migrations/202306071013341
-rw-r--r--db/schema_migrations/202306071020171
-rw-r--r--db/schema_migrations/202306071027211
-rw-r--r--db/schema_migrations/202306071027311
-rw-r--r--db/schema_migrations/202306071656321
-rw-r--r--db/schema_migrations/202306071657181
-rw-r--r--db/schema_migrations/202306080713011
-rw-r--r--db/schema_migrations/202306080812571
-rw-r--r--db/schema_migrations/202306080819241
-rw-r--r--db/schema_migrations/202306081015031
-rw-r--r--db/schema_migrations/202306081954291
-rw-r--r--db/schema_migrations/202306082314521
-rw-r--r--db/schema_migrations/202306082324521
-rw-r--r--db/schema_migrations/202306082334521
-rw-r--r--db/schema_migrations/202306082344521
-rw-r--r--db/schema_migrations/202306082354521
-rw-r--r--db/schema_migrations/202306090004521
-rw-r--r--db/schema_migrations/202306090014521
-rw-r--r--db/schema_migrations/202306090024521
-rw-r--r--db/schema_migrations/202306090034521
-rw-r--r--db/schema_migrations/202306090044521
-rw-r--r--db/schema_migrations/202306090054521
-rw-r--r--db/schema_migrations/202306090104521
-rw-r--r--db/schema_migrations/202306090114521
-rw-r--r--db/schema_migrations/202306090852341
-rw-r--r--db/schema_migrations/202306091158441
-rw-r--r--db/schema_migrations/202306120728071
-rw-r--r--db/schema_migrations/202306120756081
-rw-r--r--db/schema_migrations/202306120833371
-rw-r--r--db/schema_migrations/202306120836551
-rw-r--r--db/schema_migrations/202306120838101
-rw-r--r--db/schema_migrations/202306120840131
-rw-r--r--db/schema_migrations/202306121626431
-rw-r--r--db/schema_migrations/202306140731361
-rw-r--r--db/schema_migrations/202306141816371
-rw-r--r--db/schema_migrations/202306150837131
-rw-r--r--db/schema_migrations/202306150837151
-rw-r--r--db/schema_migrations/202306150837201
-rw-r--r--db/schema_migrations/202306150837251
-rw-r--r--db/schema_migrations/202306150837301
-rw-r--r--db/schema_migrations/202306150837341
-rw-r--r--db/schema_migrations/202306150837381
-rw-r--r--db/schema_migrations/202306150837411
-rw-r--r--db/schema_migrations/202306150837441
-rw-r--r--db/schema_migrations/202306150837481
-rw-r--r--db/schema_migrations/202306152021251
-rw-r--r--db/schema_migrations/202306152025111
-rw-r--r--db/structure.sql1144
1297 files changed, 7536 insertions, 9289 deletions
diff --git a/db/database_connections/ci.yaml b/db/database_connections/ci.yaml
new file mode 100644
index 00000000000..daa155dcb00
--- /dev/null
+++ b/db/database_connections/ci.yaml
@@ -0,0 +1,10 @@
+name: ci
+description: Cell-local GitLab database holding all CI pipelines, builds, etc.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_ci
+klass: Ci::ApplicationRecord
+# if CI database is not configured, use this database
+fallback_database: main
+uses_load_balancing: true
diff --git a/db/database_connections/main.yaml b/db/database_connections/main.yaml
new file mode 100644
index 00000000000..dfdd50eb085
--- /dev/null
+++ b/db/database_connections/main.yaml
@@ -0,0 +1,15 @@
+name: main
+description: Main GitLab database holding all projects, issues, etc.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_main
+ - gitlab_main_cell
+ - gitlab_pm
+# Note that we use ActiveRecord::Base here and not ApplicationRecord.
+# This is deliberate, as:
+# - the load balancer must be enabled for _all_ models
+# - other models outside of Rails that are using `ActiveRecord::Base`
+# needs to use `main:`
+klass: ActiveRecord::Base
+uses_load_balancing: true
diff --git a/db/database_connections/main_clusterwide.yaml b/db/database_connections/main_clusterwide.yaml
new file mode 100644
index 00000000000..d55b2ddce40
--- /dev/null
+++ b/db/database_connections/main_clusterwide.yaml
@@ -0,0 +1,10 @@
+name: main_clusterwide
+description: Cluster-wide GitLab database holding only data shared globally across Cells.
+gitlab_schemas:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_main_clusterwide
+klass: MainClusterwide::ApplicationRecord
+# if Cluster-wide database is not configured, fallback to using main
+fallback_database: main
+uses_load_balancing: true
diff --git a/db/docs/abuse_events.yml b/db/docs/abuse_events.yml
new file mode 100644
index 00000000000..b399c957316
--- /dev/null
+++ b/db/docs/abuse_events.yml
@@ -0,0 +1,10 @@
+---
+table_name: abuse_events
+classes:
+- Abuse::Event
+feature_categories:
+- insider_threat
+description: Captures events of potential abuse
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115258
+milestone: '16.1'
+gitlab_schema: gitlab_main
diff --git a/db/docs/allowed_email_domains.yml b/db/docs/allowed_email_domains.yml
index 4dd6100e4c4..1ab2f3e1740 100644
--- a/db/docs/allowed_email_domains.yml
+++ b/db/docs/allowed_email_domains.yml
@@ -3,7 +3,7 @@ table_name: allowed_email_domains
classes:
- AllowedEmailDomain
feature_categories:
-- subgroups
+- groups_and_projects
description: Stores email domains for group, only members with email from those domains can be added to the group
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/14800
milestone: '12.2'
diff --git a/db/docs/audit_events_streaming_instance_event_type_filters.yml b/db/docs/audit_events_streaming_instance_event_type_filters.yml
new file mode 100644
index 00000000000..c70b840f25e
--- /dev/null
+++ b/db/docs/audit_events_streaming_instance_event_type_filters.yml
@@ -0,0 +1,10 @@
+---
+table_name: audit_events_streaming_instance_event_type_filters
+classes:
+- AuditEvents::Streaming::InstanceEventTypeFilter
+feature_categories:
+- audit_events
+description: Represents an event type filter for audit event streaming
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123330
+milestone: '16.1'
+gitlab_schema: gitlab_main
diff --git a/db/docs/badges.yml b/db/docs/badges.yml
index af05638152c..6248a7c9987 100644
--- a/db/docs/badges.yml
+++ b/db/docs/badges.yml
@@ -5,7 +5,7 @@ classes:
- GroupBadge
- ProjectBadge
feature_categories:
-- projects
+- groups_and_projects
description: Stores badges records
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17082
milestone: '10.6'
diff --git a/db/docs/batched_background_migrations/backfill_code_suggestions_namespace_settings.yml b/db/docs/batched_background_migrations/backfill_code_suggestions_namespace_settings.yml
new file mode 100644
index 00000000000..d0803735d0b
--- /dev/null
+++ b/db/docs/batched_background_migrations/backfill_code_suggestions_namespace_settings.yml
@@ -0,0 +1,6 @@
+---
+migration_job_name: BackfillCodeSuggestionsNamespaceSettings
+description: Updates default value of code_suggestions on namespace_settings table
+feature_category: code_suggestions
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121126
+milestone: 16.1
diff --git a/db/docs/batched_background_migrations/backfill_resource_link_events.yml b/db/docs/batched_background_migrations/backfill_resource_link_events.yml
new file mode 100644
index 00000000000..224cf5fe06b
--- /dev/null
+++ b/db/docs/batched_background_migrations/backfill_resource_link_events.yml
@@ -0,0 +1,6 @@
+---
+migration_job_name: BackfillResourceLinkEvents
+description: Backfills resource_link_events table based off system_note_metadata and notes
+feature_category: team_planning
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118605
+milestone: 16.1
diff --git a/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml b/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml
new file mode 100644
index 00000000000..e029488f5c4
--- /dev/null
+++ b/db/docs/batched_background_migrations/backfill_root_storage_statistics_fork_storage_sizes.yml
@@ -0,0 +1,6 @@
+---
+migration_job_name: BackfillRootStorageStatisticsForkStorageSizes
+description: Backfill the public_forks_storage_size, internal_forks_storage_size, and private_forks_storage_size columns on the namespace_root_storage_statistics table
+feature_category: consumables_cost_management
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120916
+milestone: 16.1
diff --git a/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml b/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml
index 630aeccd6e1..f89d63ff79f 100644
--- a/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml
+++ b/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml
@@ -1,6 +1,8 @@
---
-migration_job_name: CleanupPersonalAccessTokensWithInvalidExpiresAt
+migration_job_name: CleanupPersonalAccessTokensWithNilExpiresAt
description: Updates value of expires_at column to 365 days from now when it's nil for PersonalAccessTokens
+ Originally introduced via https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120239
+ Re-ran because there was a bypass that enabled some new PATs to be created with nil expires_at. That bypass was patched via https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121370.
feature_category: system_access
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120239
-milestone: 16.0
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123002
+milestone: 16.1
diff --git a/db/docs/batched_background_migrations/mark_duplicate_npm_packages_for_destruction.yml b/db/docs/batched_background_migrations/mark_duplicate_npm_packages_for_destruction.yml
new file mode 100644
index 00000000000..bd059876a25
--- /dev/null
+++ b/db/docs/batched_background_migrations/mark_duplicate_npm_packages_for_destruction.yml
@@ -0,0 +1,6 @@
+---
+migration_job_name: MarkDuplicateNpmPackagesForDestruction
+description: It seeks duplicate npm packages and marks them for destruction.
+feature_category: package_registry
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114695
+milestone: 16.1
diff --git a/db/docs/batched_background_migrations/remove_invalid_deploy_access_level_groups.yml b/db/docs/batched_background_migrations/remove_invalid_deploy_access_level_groups.yml
new file mode 100644
index 00000000000..39d13b58443
--- /dev/null
+++ b/db/docs/batched_background_migrations/remove_invalid_deploy_access_level_groups.yml
@@ -0,0 +1,6 @@
+---
+migration_job_name: RemoveInvalidDeployAccessLevelGroups
+description: This deletes protected_environment_deploy_access_levels rows that have invalid group_id.
+feature_category: continuous_delivery
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121222
+milestone: 16.1
diff --git a/db/docs/deleted_tables/project_wiki_repository_states.yml b/db/docs/deleted_tables/project_wiki_repository_states.yml
new file mode 100644
index 00000000000..9b117e4c4ca
--- /dev/null
+++ b/db/docs/deleted_tables/project_wiki_repository_states.yml
@@ -0,0 +1,12 @@
+---
+table_name: project_wiki_repository_states
+classes:
+- Geo::ProjectWikiRepositoryState
+feature_categories:
+- geo_replication
+description: Separate table for project wikis containing Geo verification metadata.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/99168
+milestone: '15.5'
+gitlab_schema: gitlab_main
+removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122936
+removed_in_milestone: '16.1'
diff --git a/db/docs/dependency_proxy_packages_settings.yml b/db/docs/dependency_proxy_packages_settings.yml
new file mode 100644
index 00000000000..dcb43553f81
--- /dev/null
+++ b/db/docs/dependency_proxy_packages_settings.yml
@@ -0,0 +1,10 @@
+---
+table_name: dependency_proxy_packages_settings
+classes:
+- DependencyProxy::Packages::Setting
+feature_categories:
+- dependency_proxy
+description: Settings for the dependency proxy for packages.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120894
+milestone: '16.1'
+gitlab_schema: gitlab_main
diff --git a/db/docs/design_management_repository_states.yml b/db/docs/design_management_repository_states.yml
index 3a8fa59fb42..82378f692dd 100644
--- a/db/docs/design_management_repository_states.yml
+++ b/db/docs/design_management_repository_states.yml
@@ -1,7 +1,7 @@
---
table_name: design_management_repository_states
classes:
-classes: []
+- Geo::DesignManagementRepositoryState
feature_categories:
- geo_replication
description: Separate table for Design Repository verification states
diff --git a/db/docs/group_custom_attributes.yml b/db/docs/group_custom_attributes.yml
index a6984004149..6fed09909c8 100644
--- a/db/docs/group_custom_attributes.yml
+++ b/db/docs/group_custom_attributes.yml
@@ -3,7 +3,7 @@ table_name: group_custom_attributes
classes:
- GroupCustomAttribute
feature_categories:
-- subgroups
+- groups_and_projects
description: Stores custom attributes per group
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14593
milestone: '10.2'
diff --git a/db/docs/group_deletion_schedules.yml b/db/docs/group_deletion_schedules.yml
index ff271e4b1f0..a2e84582ccd 100644
--- a/db/docs/group_deletion_schedules.yml
+++ b/db/docs/group_deletion_schedules.yml
@@ -3,7 +3,7 @@ table_name: group_deletion_schedules
classes:
- GroupDeletionSchedule
feature_categories:
-- subgroups
+- groups_and_projects
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20276
milestone: '12.6'
diff --git a/db/docs/instance_audit_events_streaming_headers.yml b/db/docs/instance_audit_events_streaming_headers.yml
new file mode 100644
index 00000000000..40db0ead3bf
--- /dev/null
+++ b/db/docs/instance_audit_events_streaming_headers.yml
@@ -0,0 +1,10 @@
+---
+table_name: instance_audit_events_streaming_headers
+classes:
+ - AuditEvents::Streaming::InstanceHeader
+feature_categories:
+ - audit_events
+description: Represents a HTTP header sent with streaming audit events to instance level destinations
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88063
+milestone: '16.1'
+gitlab_schema: gitlab_main
diff --git a/db/docs/integrations.yml b/db/docs/integrations.yml
index 91675f8de35..0619a59556f 100644
--- a/db/docs/integrations.yml
+++ b/db/docs/integrations.yml
@@ -16,6 +16,7 @@ classes:
- Integrations::Bugzilla
- Integrations::Buildkite
- Integrations::Campfire
+- Integrations::Clickup
- Integrations::Confluence
- Integrations::CustomIssueTracker
- Integrations::Datadog
@@ -49,6 +50,7 @@ classes:
- Integrations::SlackSlashCommands
- Integrations::SquashTm
- Integrations::Teamcity
+- Integrations::Telegram
- Integrations::UnifyCircuit
- Integrations::WebexTeams
- Integrations::Youtrack
diff --git a/db/docs/member_roles.yml b/db/docs/member_roles.yml
index 559a85823cc..a11743cf3f4 100644
--- a/db/docs/member_roles.yml
+++ b/db/docs/member_roles.yml
@@ -3,8 +3,7 @@ table_name: member_roles
classes:
- MemberRole
feature_categories:
-- projects
-- subgroups
+- groups_and_projects
description: Stores custom roles with composable permissions
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92152
milestone: '15.2'
diff --git a/db/docs/members.yml b/db/docs/members.yml
index 94306dc5f87..1a617d27a4b 100644
--- a/db/docs/members.yml
+++ b/db/docs/members.yml
@@ -6,8 +6,7 @@ classes:
- ProjectMember
- ProjectNamespaceMember
feature_categories:
-- projects
-- subgroups
+- groups_and_projects
description: Stores members per namespace
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/3503b504eabf95487fc3fb49df953a7d694da4fe
milestone: '7.4'
diff --git a/db/docs/namespace_admin_notes.yml b/db/docs/namespace_admin_notes.yml
index 50ca72b270c..80937cb728e 100644
--- a/db/docs/namespace_admin_notes.yml
+++ b/db/docs/namespace_admin_notes.yml
@@ -4,7 +4,7 @@ classes:
- Namespace::AdminNote
feature_categories:
- system_access
-- subgroups
+- groups_and_projects
description: Contains notes about groups that are visible to server administrators.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47825
milestone: '13.11'
diff --git a/db/docs/namespace_details.yml b/db/docs/namespace_details.yml
index 35e57d7c686..6b91798bc57 100644
--- a/db/docs/namespace_details.yml
+++ b/db/docs/namespace_details.yml
@@ -3,7 +3,7 @@ table_name: namespace_details
classes:
- Namespace::Detail
feature_categories:
-- subgroups
+- groups_and_projects
description: Used to store details for namespaces
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82958
milestone: '15.3'
diff --git a/db/docs/namespace_settings.yml b/db/docs/namespace_settings.yml
index 85df86074dc..48187919e43 100644
--- a/db/docs/namespace_settings.yml
+++ b/db/docs/namespace_settings.yml
@@ -3,7 +3,7 @@ table_name: namespace_settings
classes:
- NamespaceSetting
feature_categories:
-- subgroups
+- groups_and_projects
description: Stores settings per namespace
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/36321
milestone: '13.2'
diff --git a/db/docs/namespaces.yml b/db/docs/namespaces.yml
index e608e996d51..ba3d345d8c7 100644
--- a/db/docs/namespaces.yml
+++ b/db/docs/namespaces.yml
@@ -6,8 +6,8 @@ classes:
- Namespaces::ProjectNamespace
- Namespaces::UserNamespace
feature_categories:
-- subgroups
+- groups_and_projects
description: Storing namespaces records for groups, users and projects
introduced_by_url: https://github.com/gitlabhq/gitlabhq/pull/2051
milestone: "<6.0"
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
diff --git a/db/docs/organizations.yml b/db/docs/organizations.yml
index 68278d0e6e4..ebc7e8b68d1 100644
--- a/db/docs/organizations.yml
+++ b/db/docs/organizations.yml
@@ -1,10 +1,10 @@
---
table_name: organizations
classes:
-- Organization
+- Organizations::Organization
feature_categories:
- cell
description: Define ownership of namespaces, projects, and users by organizations
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119421
-milestone: "16.0"
+milestone: '16.0'
gitlab_schema: gitlab_main
diff --git a/db/docs/p_ci_builds.yml b/db/docs/p_ci_builds.yml
new file mode 100644
index 00000000000..ca01e89de09
--- /dev/null
+++ b/db/docs/p_ci_builds.yml
@@ -0,0 +1,14 @@
+---
+table_name: p_ci_builds
+classes:
+- Ci::Bridge
+- Ci::Build
+- Ci::Processable
+- CommitStatus
+- GenericCommitStatus
+feature_categories:
+- continuous_integration
+description: Routing table for ci_builds
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120873
+milestone: '16.1'
+gitlab_schema: gitlab_ci
diff --git a/db/docs/p_ci_job_annotations.yml b/db/docs/p_ci_job_annotations.yml
new file mode 100644
index 00000000000..62a1b56abad
--- /dev/null
+++ b/db/docs/p_ci_job_annotations.yml
@@ -0,0 +1,9 @@
+---
+table_name: p_ci_job_annotations
+classes:
+- Ci::JobAnnotation
+feature_categories:
+- build_artifacts
+description: Stores user provided annotations for jobs. Currently storing extra information for a given job feed by API.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117319
+gitlab_schema: gitlab_ci
diff --git a/db/docs/project_authorizations.yml b/db/docs/project_authorizations.yml
index b81235d4aac..59e97fc24e2 100644
--- a/db/docs/project_authorizations.yml
+++ b/db/docs/project_authorizations.yml
@@ -3,7 +3,7 @@ table_name: project_authorizations
classes:
- ProjectAuthorization
feature_categories:
-- projects
+- groups_and_projects
- system_access
description: Stores maximal access to the project per user
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/6839
diff --git a/db/docs/project_compliance_standards_adherence.yml b/db/docs/project_compliance_standards_adherence.yml
new file mode 100644
index 00000000000..c2f08e9f82c
--- /dev/null
+++ b/db/docs/project_compliance_standards_adherence.yml
@@ -0,0 +1,10 @@
+---
+table_name: project_compliance_standards_adherence
+classes:
+ - Projects::ComplianceStandards::Adherence
+feature_categories:
+- compliance_management
+description: Stores the details about projects and their adherence to compliance standards
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122293
+milestone: '16.1'
+gitlab_schema: gitlab_main
diff --git a/db/docs/project_custom_attributes.yml b/db/docs/project_custom_attributes.yml
index 3a4b76c5b02..d3a5f0ea0a9 100644
--- a/db/docs/project_custom_attributes.yml
+++ b/db/docs/project_custom_attributes.yml
@@ -3,7 +3,7 @@ table_name: project_custom_attributes
classes:
- ProjectCustomAttribute
feature_categories:
-- projects
+- groups_and_projects
description: Stores custom attributes per project
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14593
milestone: '10.2'
diff --git a/db/docs/project_settings.yml b/db/docs/project_settings.yml
index 7113aedf1f8..63e96e34dc5 100644
--- a/db/docs/project_settings.yml
+++ b/db/docs/project_settings.yml
@@ -3,7 +3,7 @@ table_name: project_settings
classes:
- ProjectSetting
feature_categories:
-- projects
+- groups_and_projects
description: Stores settings per project
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/a2a7ad291f64a5db74c1bc21fb556e6e8862d0f3
milestone: '10.8'
diff --git a/db/docs/project_topics.yml b/db/docs/project_topics.yml
index 3d8ec0c342a..4343b440089 100644
--- a/db/docs/project_topics.yml
+++ b/db/docs/project_topics.yml
@@ -3,7 +3,7 @@ table_name: project_topics
classes:
- Projects::ProjectTopic
feature_categories:
-- projects
+- groups_and_projects
description: Stores topics per project relationship
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67574
milestone: '14.3'
diff --git a/db/docs/project_wiki_repository_states.yml b/db/docs/project_wiki_repository_states.yml
deleted file mode 100644
index e6faeadf8a6..00000000000
--- a/db/docs/project_wiki_repository_states.yml
+++ /dev/null
@@ -1,10 +0,0 @@
----
-table_name: project_wiki_repository_states
-classes:
-- Geo::ProjectWikiRepositoryState
-feature_categories:
-- geo_replication
-description: Separate table for project wikis containing Geo verification metadata.
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/99168
-milestone: '15.5'
-gitlab_schema: gitlab_main
diff --git a/db/docs/projects.yml b/db/docs/projects.yml
index 0b7dbbe2127..44ac68d891d 100644
--- a/db/docs/projects.yml
+++ b/db/docs/projects.yml
@@ -3,7 +3,7 @@ table_name: projects
classes:
- Project
feature_categories:
-- projects
+- groups_and_projects
description: Stores project records
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685
milestone: "<6.0"
diff --git a/db/docs/redirect_routes.yml b/db/docs/redirect_routes.yml
index 7997aae2952..c3a9b0db3d9 100644
--- a/db/docs/redirect_routes.yml
+++ b/db/docs/redirect_routes.yml
@@ -3,8 +3,7 @@ table_name: redirect_routes
classes:
- RedirectRoute
feature_categories:
-- projects
-- subgroups
+- groups_and_projects
description: Stores routes for redirect after changing the path to group or project
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/11136
milestone: '9.2'
diff --git a/db/docs/routes.yml b/db/docs/routes.yml
index 4c078bc8558..c1a75dd873c 100644
--- a/db/docs/routes.yml
+++ b/db/docs/routes.yml
@@ -4,8 +4,7 @@ classes:
- Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::Route
- Route
feature_categories:
-- projects
-- subgroups
+- groups_and_projects
- user_profile
description: Stores routes per namespaces and projects
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7121
diff --git a/db/docs/subscription_add_on_purchases.yml b/db/docs/subscription_add_on_purchases.yml
new file mode 100644
index 00000000000..21915cff545
--- /dev/null
+++ b/db/docs/subscription_add_on_purchases.yml
@@ -0,0 +1,10 @@
+---
+table_name: subscription_add_on_purchases
+description: Stores add-on purchase information
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122662
+milestone: '16.1'
+feature_categories:
+- subscription_management
+classes:
+- GitlabSubscriptions::AddOnPurchase
+gitlab_schema: gitlab_main
diff --git a/db/docs/subscription_add_ons.yml b/db/docs/subscription_add_ons.yml
new file mode 100644
index 00000000000..93730f80a99
--- /dev/null
+++ b/db/docs/subscription_add_ons.yml
@@ -0,0 +1,10 @@
+---
+table_name: subscription_add_ons
+description: Stores available add-ons for which purchases are stored in `subscription_add_on_purchases`.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122662
+milestone: '16.1'
+feature_categories:
+- subscription_management
+classes:
+- GitlabSubscriptions::AddOn
+gitlab_schema: gitlab_main
diff --git a/db/docs/topics.yml b/db/docs/topics.yml
index 4411566e7ec..dcf988c58eb 100644
--- a/db/docs/topics.yml
+++ b/db/docs/topics.yml
@@ -3,7 +3,7 @@ table_name: topics
classes:
- Projects::Topic
feature_categories:
-- projects
+- groups_and_projects
description: Stores topics that can be assigned to projects
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67574
milestone: '14.3'
diff --git a/db/docs/uploads.yml b/db/docs/uploads.yml
index 88f3bd68946..68b2c5648de 100644
--- a/db/docs/uploads.yml
+++ b/db/docs/uploads.yml
@@ -7,7 +7,7 @@ feature_categories:
- design_management
- importers
- portfolio_management
-- projects
+- groups_and_projects
- source_code_management
- team_planning
description: For tracking blob metadata. Single table inheritance is used to relate this table to many other tables.
diff --git a/db/docs/user_interacted_projects.yml b/db/docs/user_interacted_projects.yml
index 206cb76c496..565dcdedf2c 100644
--- a/db/docs/user_interacted_projects.yml
+++ b/db/docs/user_interacted_projects.yml
@@ -3,7 +3,7 @@ table_name: user_interacted_projects
classes:
- UserInteractedProject
feature_categories:
-- projects
+- groups_and_projects
description: Tracks which projects a given user has actively interacted with
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17327
milestone: '10.6'
diff --git a/db/docs/users.yml b/db/docs/users.yml
index 265e1553fa1..1fd16ae9af7 100644
--- a/db/docs/users.yml
+++ b/db/docs/users.yml
@@ -9,4 +9,4 @@ feature_categories:
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685
milestone: "<6.0"
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_clusterwide
diff --git a/db/docs/users_star_projects.yml b/db/docs/users_star_projects.yml
index df03f721d57..fb5eda2d518 100644
--- a/db/docs/users_star_projects.yml
+++ b/db/docs/users_star_projects.yml
@@ -3,7 +3,7 @@ table_name: users_star_projects
classes:
- UsersStarProject
feature_categories:
-- projects
+- groups_and_projects
description: Stores conection between users and project through staring action
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/714f7201d3362793d11f33793e5ef6dc83bdd2f0
milestone: '7.1'
diff --git a/db/fixtures/development/002_default_organization.rb b/db/fixtures/development/002_default_organization.rb
new file mode 100644
index 00000000000..774e3742c8b
--- /dev/null
+++ b/db/fixtures/development/002_default_organization.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+Gitlab::Seeder.quiet do
+ Gitlab::DatabaseImporters::DefaultOrganizationImporter.create_default_organization
+end
diff --git a/db/fixtures/development/12_snippets.rb b/db/fixtures/development/12_snippets.rb
index 24500aa3e7d..4f885f99846 100644
--- a/db/fixtures/development/12_snippets.rb
+++ b/db/fixtures/development/12_snippets.rb
@@ -9,7 +9,7 @@ class Gitlab::Seeder::SnippetRepository
end
def import
- if File.exists?(BUNDLE_PATH)
+ if File.exist?(BUNDLE_PATH)
@snippet.repository.create_from_bundle(BUNDLE_PATH)
else
@snippet.repository.import_repository(SNIPPET_REPO_URL)
@@ -18,7 +18,7 @@ class Gitlab::Seeder::SnippetRepository
end
def self.cleanup
- File.delete(BUNDLE_PATH) if File.exists?(BUNDLE_PATH)
+ File.delete(BUNDLE_PATH) if File.exist?(BUNDLE_PATH)
rescue => e
warn "\nError cleaning up snippet bundle: #{e}"
end
diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb
index 50155668dca..5442c6eb00b 100644
--- a/db/fixtures/development/17_cycle_analytics.rb
+++ b/db/fixtures/development/17_cycle_analytics.rb
@@ -3,6 +3,8 @@
require './spec/support/sidekiq_middleware'
require './spec/support/helpers/test_env'
require 'active_support/testing/time_helpers'
+require './spec/support/helpers/cycle_analytics_helpers'
+require './ee/db/seeds/shared/dora_metrics' if Gitlab.ee?
# Usage:
#
@@ -21,6 +23,7 @@ require 'active_support/testing/time_helpers'
# rubocop:disable Rails/Output
class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChildren
include ActiveSupport::Testing::TimeHelpers
+ include CycleAnalyticsHelpers
attr_reader :project, :issues, :merge_requests, :developers
@@ -67,22 +70,49 @@ class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChild
return
end
- create_developers!
- create_issues!
+ seed_data!
+ end
+
+ private
- seed_lead_time!
- seed_issue_stage!
- seed_plan_stage!
- seed_code_stage!
- seed_test_stage!
- seed_review_stage!
- seed_staging_stage!
+ def seed_data!
+ Sidekiq::Worker.skipping_transaction_check do
+ create_developers!
+ create_issues!
+
+ seed_lead_time!
+ seed_issue_stage!
+ seed_plan_stage!
+ seed_code_stage!
+ seed_test_stage!
+ seed_review_stage!
+ seed_staging_stage!
+
+ if Gitlab.ee?
+ create_vulnerabilities_count_report!
+ seed_dora_metrics!
+ create_custom_value_stream!
+ create_value_stream_aggregation(project.group)
+ end
- puts "Successfully seeded '#{project.full_path}' for Value Stream Management!"
- puts "URL: #{Rails.application.routes.url_helpers.project_url(project)}"
+ puts "Successfully seeded '#{project.full_path}' for Value Stream Management!"
+ puts "URL: #{Rails.application.routes.url_helpers.project_url(project)}"
+ end
end
- private
+ def create_custom_value_stream!
+ [project.project_namespace.reload, project.group].each do |parent|
+ Analytics::CycleAnalytics::ValueStreams::CreateService.new(
+ current_user: admin,
+ namespace: parent,
+ params: { name: "vs #{suffix}", stages: Gitlab::Analytics::CycleAnalytics::DefaultStages.all }
+ ).execute
+ end
+ end
+
+ def seed_dora_metrics!
+ Gitlab::Seeder::DoraMetrics.new(project: project).execute
+ end
def seed_issue_stage!
issues.each do |issue|
@@ -174,6 +204,23 @@ class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChild
end
end
+ def create_vulnerabilities_count_report!
+ 4.times do |i|
+ critical_count = rand(5..10)
+ high_count = rand(5..10)
+
+ [i.months.ago.end_of_month, i.months.ago.beginning_of_month].each do |date|
+ FactoryBot.create(:vulnerability_historical_statistic,
+ date: date,
+ total: critical_count + high_count,
+ critical: critical_count,
+ high: high_count,
+ project: project
+ )
+ end
+ end
+ end
+
def create_developers!
5.times do |i|
user = FactoryBot.create(
diff --git a/db/fixtures/development/24_forks.rb b/db/fixtures/development/24_forks.rb
index 1476681f4d7..d6730ae983a 100644
--- a/db/fixtures/development/24_forks.rb
+++ b/db/fixtures/development/24_forks.rb
@@ -2,13 +2,13 @@ require './spec/support/sidekiq_middleware'
Sidekiq::Testing.inline! do
Gitlab::Seeder.quiet do
- User.humans.not_mass_generated.sample(10).each do |user|
+ User.human.not_mass_generated.sample(10).each do |user|
source_project = Project.not_mass_generated.public_only.sample
##
# 03_project.rb might not have created a public project because
# we use randomized approach (e.g. `Array#sample`).
- return unless source_project
+ next unless source_project
Sidekiq::Worker.skipping_transaction_check do
fork_project = Projects::ForkService.new(
diff --git a/db/fixtures/development/25_api_personal_access_token.rb b/db/fixtures/development/25_api_personal_access_token.rb
index 1413f468be1..10f7d311419 100644
--- a/db/fixtures/development/25_api_personal_access_token.rb
+++ b/db/fixtures/development/25_api_personal_access_token.rb
@@ -12,6 +12,7 @@ Gitlab::Seeder.quiet do
}
user.personal_access_tokens.build(params).tap do |pat|
+ pat.expires_at = 365.days.from_now
pat.set_token(token)
pat.save!
end
diff --git a/db/fixtures/development/31_error_tracking.rb b/db/fixtures/development/31_error_tracking.rb
deleted file mode 100644
index d4d59f4046a..00000000000
--- a/db/fixtures/development/31_error_tracking.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-class Gitlab::Seeder::ErrorTrackingSeeder
- attr_reader :project
-
- def initialize(project)
- @project = project
- end
-
- def seed
- parsed_event = Gitlab::Json.parse(read_fixture_file('parsed_event.json'))
-
- ErrorTracking::CollectErrorService
- .new(project, nil, event: parsed_event)
- .execute
- end
-
- private
-
- def read_fixture_file(file)
- File.read(fixture_path(file))
- end
-
- def fixture_path(file)
- Rails.root.join('spec', 'fixtures', 'error_tracking', file)
- end
-end
-
-
-Gitlab::Seeder.quiet do
- admin_user = User.admins.first
-
- Project.not_mass_generated.visible_to_user(admin_user).sample(1).each do |project|
- puts "\nActivating integrated error tracking for the '#{project.full_path}' project"
-
- puts '- enabling in settings'
- project.error_tracking_setting || project.create_error_tracking_setting
- project.error_tracking_setting.update!(enabled: true, integrated: true)
-
- puts '- seeding an error'
- seeder = Gitlab::Seeder::ErrorTrackingSeeder.new(project)
- seeder.seed
- end
-end
diff --git a/db/fixtures/development/36_achievements.rb b/db/fixtures/development/36_achievements.rb
index 5798fd2d6c7..7a435daf82e 100644
--- a/db/fixtures/development/36_achievements.rb
+++ b/db/fixtures/development/36_achievements.rb
@@ -58,7 +58,7 @@ class Gitlab::Seeder::Achievements
end
Gitlab::Seeder.quiet do
- puts "\nGenerating ahievements"
+ puts "\nGenerating achievements"
group = Group.first
users = User.first(4).pluck(:id)
diff --git a/db/fixtures/development/99_common_metrics.rb b/db/fixtures/development/99_common_metrics.rb
deleted file mode 100644
index d52f78ea536..00000000000
--- a/db/fixtures/development/99_common_metrics.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
diff --git a/db/fixtures/production/030_default_organization.rb b/db/fixtures/production/030_default_organization.rb
new file mode 100644
index 00000000000..774e3742c8b
--- /dev/null
+++ b/db/fixtures/production/030_default_organization.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+Gitlab::Seeder.quiet do
+ Gitlab::DatabaseImporters::DefaultOrganizationImporter.create_default_organization
+end
diff --git a/db/fixtures/production/999_common_metrics.rb b/db/fixtures/production/999_common_metrics.rb
deleted file mode 100644
index d52f78ea536..00000000000
--- a/db/fixtures/production/999_common_metrics.rb
+++ /dev/null
@@ -1,3 +0,0 @@
-# frozen_string_literal: true
-
-::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute
diff --git a/db/gitlab_schemas/gitlab_ci.yaml b/db/gitlab_schemas/gitlab_ci.yaml
new file mode 100644
index 00000000000..a756fa2fdd3
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_ci.yaml
@@ -0,0 +1,7 @@
+name: gitlab_ci
+description: Schema for all Cell-local CI tables, ex. ci_builds, etc.
+allow_cross_joins:
+ - gitlab_shared
+allow_cross_transactions:
+ - gitlab_internal
+ - gitlab_shared
diff --git a/db/gitlab_schemas/gitlab_internal.yaml b/db/gitlab_schemas/gitlab_internal.yaml
new file mode 100644
index 00000000000..7093c980daa
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_internal.yaml
@@ -0,0 +1,2 @@
+name: gitlab_internal
+description: Schema for all internal tables, like `pg_*`
diff --git a/db/gitlab_schemas/gitlab_main.yaml b/db/gitlab_schemas/gitlab_main.yaml
new file mode 100644
index 00000000000..ed918e7c57d
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_main.yaml
@@ -0,0 +1,7 @@
+name: gitlab_main
+description: Legacy schema for all Cell-local tables, ex. projects, issues, etc.
+allow_cross_joins:
+ - gitlab_shared
+allow_cross_transactions:
+ - gitlab_internal
+ - gitlab_shared
diff --git a/db/gitlab_schemas/gitlab_main_cell.yaml b/db/gitlab_schemas/gitlab_main_cell.yaml
new file mode 100644
index 00000000000..0f85cfdf5d3
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_main_cell.yaml
@@ -0,0 +1,21 @@
+name: gitlab_main_cell
+description: Schema for all Cell-local tables, ex. namespaces, projects, etc.
+allow_cross_joins:
+ - gitlab_shared
+ - gitlab_main
+ # Temporarily allow cross-joins between clusterwide and cell schemas
+ # This is to be removed once we annotate all cross-joins between those
+ - gitlab_main_clusterwide
+allow_cross_transactions:
+ - gitlab_internal
+ - gitlab_shared
+ - gitlab_main
+ # Temporarily allow cross-DB transactions between clusterwide and cell schemas
+ # This is to be removed once we annotate all cross-DBs between those
+ - gitlab_main_clusterwide
+allow_cross_foreign_keys:
+ - gitlab_main
+ # Temporarily allow FKs between clusterwide and cell schemas
+ # This is to be removed once we remove all FKs between those
+ - gitlab_main_clusterwide
+
diff --git a/db/gitlab_schemas/gitlab_main_clusterwide.yaml b/db/gitlab_schemas/gitlab_main_clusterwide.yaml
new file mode 100644
index 00000000000..7d1de57b687
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_main_clusterwide.yaml
@@ -0,0 +1,17 @@
+name: gitlab_main_clusterwide
+description: Schema for all Cluster-wide tables, ex. application_settings, etc.
+allow_cross_joins:
+ - gitlab_shared
+ # temporarily allow cross-joins between clusterwide till all tables
+ # are moved to either _clusterwide or _cell
+ - gitlab_main
+allow_cross_transactions:
+ - gitlab_internal
+ - gitlab_shared
+ # temporarily allow cross-transaction between clusterwide till all tables
+ # are moved to either _clusterwide or _cell
+ - gitlab_main
+allow_cross_foreign_keys:
+ # temporarily allow FKs between clusterwide till all tables
+ # are moved to either _clusterwide or _cell
+ - gitlab_main
diff --git a/db/gitlab_schemas/gitlab_pm.yaml b/db/gitlab_schemas/gitlab_pm.yaml
new file mode 100644
index 00000000000..8ea8e49376b
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_pm.yaml
@@ -0,0 +1,7 @@
+name: gitlab_pm
+description: Schema for all Cell-local package management features.
+allow_cross_joins:
+ - gitlab_shared
+allow_cross_transactions:
+ - gitlab_internal
+ - gitlab_shared
diff --git a/db/gitlab_schemas/gitlab_shared.yaml b/db/gitlab_schemas/gitlab_shared.yaml
new file mode 100644
index 00000000000..549797b606b
--- /dev/null
+++ b/db/gitlab_schemas/gitlab_shared.yaml
@@ -0,0 +1,8 @@
+name: gitlab_shared
+description:
+ Schema for all tables implementing shared features,
+ ex. loose foreign keys, re-indexing, etc.
+allow_cross_joins:
+ - gitlab_internal
+allow_cross_transactions:
+ - gitlab_internal
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/20211202041233_init_schema.rb b/db/migrate/20211202041233_init_schema.rb
index 97027f8a9e4..3a1c319320a 100644
--- a/db/migrate/20211202041233_init_schema.rb
+++ b/db/migrate/20211202041233_init_schema.rb
@@ -4,7 +4,9 @@ class InitSchema < Gitlab::Database::Migration[1.0]
DOWNTIME = false
def up
- execute(File.read("db/init_structure.sql"))
+ suppress_messages do
+ execute(File.read("db/init_structure.sql"))
+ end
end
def down
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/migrate/20221014034338_populate_releases_access_level_from_repository.rb b/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb
index 6e61d972bf6..37797aa65f3 100644
--- a/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb
+++ b/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb
@@ -6,7 +6,7 @@ class PopulateReleasesAccessLevelFromRepository < Gitlab::Database::Migration[2.
disable_ddl_transaction!
def up
- update_column_in_batches(
+ update_column_in_batches( # rubocop: disable Migration/UpdateColumnInBatches
:project_features,
:releases_access_level,
Arel.sql('repository_access_level')
diff --git a/db/migrate/20230222131512_add_wiki_asciidoc_allow_uri_includes.rb b/db/migrate/20230222131512_add_wiki_asciidoc_allow_uri_includes.rb
new file mode 100644
index 00000000000..7000171f520
--- /dev/null
+++ b/db/migrate/20230222131512_add_wiki_asciidoc_allow_uri_includes.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddWikiAsciidocAllowUriIncludes < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+ def change
+ add_column :application_settings, :wiki_asciidoc_allow_uri_includes, :boolean, default: false, null: false
+ end
+end
diff --git a/db/migrate/20230328150343_add_retried_at_to_status_check_responses.rb b/db/migrate/20230328150343_add_retried_at_to_status_check_responses.rb
new file mode 100644
index 00000000000..53cc1f0432b
--- /dev/null
+++ b/db/migrate/20230328150343_add_retried_at_to_status_check_responses.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddRetriedAtToStatusCheckResponses < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :status_check_responses, :retried_at, :datetime_with_timezone
+ end
+end
diff --git a/db/migrate/20230329235300_add_diagramsnet_to_application_settings.rb b/db/migrate/20230329235300_add_diagramsnet_to_application_settings.rb
new file mode 100644
index 00000000000..9e351f190f4
--- /dev/null
+++ b/db/migrate/20230329235300_add_diagramsnet_to_application_settings.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddDiagramsnetToApplicationSettings < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20230406115900_add_diagramsnet_text_limit.rb
+ def change
+ add_column :application_settings, :diagramsnet_enabled, :boolean, default: true, null: false
+ add_column :application_settings, :diagramsnet_url, :text, default: 'https://embed.diagrams.net'
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20230406115900_add_diagramsnet_text_limit.rb b/db/migrate/20230406115900_add_diagramsnet_text_limit.rb
new file mode 100644
index 00000000000..27155c70c56
--- /dev/null
+++ b/db/migrate/20230406115900_add_diagramsnet_text_limit.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddDiagramsnetTextLimit < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :application_settings, :diagramsnet_url, 2048
+ end
+
+ def down
+ remove_text_limit :application_settings, :diagramsnet_url
+ end
+end
diff --git a/db/migrate/20230428070443_add_allow_account_deletion_to_application_settings.rb b/db/migrate/20230428070443_add_allow_account_deletion_to_application_settings.rb
new file mode 100644
index 00000000000..1731d91eb5c
--- /dev/null
+++ b/db/migrate/20230428070443_add_allow_account_deletion_to_application_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddAllowAccountDeletionToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :allow_account_deletion, :boolean, default: true, null: false
+ end
+end
diff --git a/db/migrate/20230428165514_add_type_to_http_integrations.rb b/db/migrate/20230428165514_add_type_to_http_integrations.rb
new file mode 100644
index 00000000000..b799b35fbbd
--- /dev/null
+++ b/db/migrate/20230428165514_add_type_to_http_integrations.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddTypeToHttpIntegrations < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :alert_management_http_integrations, :type_identifier, :integer, default: 0, null: false, limit: 2
+ end
+end
diff --git a/db/migrate/20230504182314_add_pa_configurator_base_to_project_settings.rb b/db/migrate/20230504182314_add_pa_configurator_base_to_project_settings.rb
new file mode 100644
index 00000000000..a633f904692
--- /dev/null
+++ b/db/migrate/20230504182314_add_pa_configurator_base_to_project_settings.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddPaConfiguratorBaseToProjectSettings < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+ def up
+ add_column :project_settings, :encrypted_product_analytics_configurator_connection_string, :binary
+ add_column :project_settings, :encrypted_product_analytics_configurator_connection_string_iv, :binary
+ end
+
+ def down
+ remove_column :project_settings, :encrypted_product_analytics_configurator_connection_string
+ remove_column :project_settings, :encrypted_product_analytics_configurator_connection_string_iv
+ end
+end
diff --git a/db/migrate/20230505115558_add_authors_and_description_to_nuget_metadatum.rb b/db/migrate/20230505115558_add_authors_and_description_to_nuget_metadatum.rb
new file mode 100644
index 00000000000..366cd2151fd
--- /dev/null
+++ b/db/migrate/20230505115558_add_authors_and_description_to_nuget_metadatum.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class AddAuthorsAndDescriptionToNugetMetadatum < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ add_column :packages_nuget_metadata, :authors, :text, if_not_exists: true
+ add_column :packages_nuget_metadata, :description, :text, if_not_exists: true
+ end
+
+ add_text_limit :packages_nuget_metadata, :authors, 255
+ add_text_limit :packages_nuget_metadata, :description, 4000
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :packages_nuget_metadata, :authors, if_exists: true
+ remove_column :packages_nuget_metadata, :description, if_exists: true
+ end
+ end
+end
diff --git a/db/migrate/20230508095017_add_project_shortcut_buttons_to_user_preferences.rb b/db/migrate/20230508095017_add_project_shortcut_buttons_to_user_preferences.rb
new file mode 100644
index 00000000000..e68148e17a5
--- /dev/null
+++ b/db/migrate/20230508095017_add_project_shortcut_buttons_to_user_preferences.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddProjectShortcutButtonsToUserPreferences < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :user_preferences, :project_shortcut_buttons, :boolean, default: true, null: false
+ end
+end
diff --git a/db/migrate/20230509013743_remove_clear_shared_runners_minutes_worker_job_instances.rb b/db/migrate/20230509013743_remove_clear_shared_runners_minutes_worker_job_instances.rb
new file mode 100644
index 00000000000..b7202521fce
--- /dev/null
+++ b/db/migrate/20230509013743_remove_clear_shared_runners_minutes_worker_job_instances.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class RemoveClearSharedRunnersMinutesWorkerJobInstances < Gitlab::Database::Migration[2.1]
+ DEPRECATED_JOB_CLASSES = %w[
+ ClearSharedRunnersMinutesWorker
+ Ci::BatchResetMinutesWorker
+ ]
+ disable_ddl_transaction!
+ def up
+ sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
+ end
+
+ def down; end
+end
diff --git a/db/migrate/20230510141454_add_user_id_to_import_failures.rb b/db/migrate/20230510141454_add_user_id_to_import_failures.rb
new file mode 100644
index 00000000000..9268ed045ed
--- /dev/null
+++ b/db/migrate/20230510141454_add_user_id_to_import_failures.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddUserIdToImportFailures < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :import_failures, :user_id, :bigint
+ end
+end
diff --git a/db/migrate/20230510142316_add_index_on_user_id_to_import_failures.rb b/db/migrate/20230510142316_add_index_on_user_id_to_import_failures.rb
new file mode 100644
index 00000000000..6c11f4dda47
--- /dev/null
+++ b/db/migrate/20230510142316_add_index_on_user_id_to_import_failures.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexOnUserIdToImportFailures < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_import_failures_on_user_id_not_null'
+
+ def up
+ add_concurrent_index :import_failures, :user_id, where: 'user_id IS NOT NULL', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :import_failures, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230510142931_add_foreign_key_for_user_id_to_import_failures.rb b/db/migrate/20230510142931_add_foreign_key_for_user_id_to_import_failures.rb
new file mode 100644
index 00000000000..301a23067e1
--- /dev/null
+++ b/db/migrate/20230510142931_add_foreign_key_for_user_id_to_import_failures.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyForUserIdToImportFailures < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :import_failures, :users, column: :user_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :import_failures, column: :user_id
+ end
+ end
+end
diff --git a/db/migrate/20230512141931_add_group_id_to_dependency_list_exports.rb b/db/migrate/20230512141931_add_group_id_to_dependency_list_exports.rb
new file mode 100644
index 00000000000..ed4245694d4
--- /dev/null
+++ b/db/migrate/20230512141931_add_group_id_to_dependency_list_exports.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddGroupIdToDependencyListExports < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :dependency_list_exports, :group_id, :bigint
+ end
+end
diff --git a/db/migrate/20230516044606_add_organization_id_to_namespace.rb b/db/migrate/20230516044606_add_organization_id_to_namespace.rb
new file mode 100644
index 00000000000..e70ddce197b
--- /dev/null
+++ b/db/migrate/20230516044606_add_organization_id_to_namespace.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddOrganizationIdToNamespace < Gitlab::Database::Migration[2.1]
+ def change
+ # no-op
+ end
+end
diff --git a/db/migrate/20230516045238_track_organization_record_changes.rb b/db/migrate/20230516045238_track_organization_record_changes.rb
new file mode 100644
index 00000000000..90290160d05
--- /dev/null
+++ b/db/migrate/20230516045238_track_organization_record_changes.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class TrackOrganizationRecordChanges < Gitlab::Database::Migration[2.1]
+ def up
+ # no-op
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/migrate/20230516045442_prepare_index_for_org_id_on_namespaces.rb b/db/migrate/20230516045442_prepare_index_for_org_id_on_namespaces.rb
new file mode 100644
index 00000000000..629dc86caea
--- /dev/null
+++ b/db/migrate/20230516045442_prepare_index_for_org_id_on_namespaces.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class PrepareIndexForOrgIdOnNamespaces < Gitlab::Database::Migration[2.1]
+ def up
+ # no-op
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/migrate/20230516072100_add_vertex_project_to_application_settings.rb b/db/migrate/20230516072100_add_vertex_project_to_application_settings.rb
new file mode 100644
index 00000000000..153c2c62609
--- /dev/null
+++ b/db/migrate/20230516072100_add_vertex_project_to_application_settings.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddVertexProjectToApplicationSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_column :application_settings, :vertex_project, :text, if_not_exists: true
+ add_text_limit :application_settings, :vertex_project, 255
+ end
+
+ def down
+ remove_text_limit :application_settings, :vertex_project
+ remove_column :application_settings, :vertex_project, if_exists: true
+ end
+end
diff --git a/db/migrate/20230516080816_replace_vsd_index_with_nulls_first_order.rb b/db/migrate/20230516080816_replace_vsd_index_with_nulls_first_order.rb
new file mode 100644
index 00000000000..dcc8bd5972e
--- /dev/null
+++ b/db/migrate/20230516080816_replace_vsd_index_with_nulls_first_order.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class ReplaceVsdIndexWithNullsFirstOrder < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ OLD_INDEX = 'index_on_value_stream_dashboard_aggregations_last_run_at_id'
+ NEW_INDEX = 'index_on_value_stream_dashboard_aggregations_last_run_at_and_id'
+
+ def up
+ add_concurrent_index :value_stream_dashboard_aggregations,
+ [:last_run_at, :namespace_id],
+ where: 'enabled IS TRUE',
+ name: NEW_INDEX,
+ order: { last_run_at: 'ASC NULLS FIRST' }
+ remove_concurrent_index_by_name :value_stream_dashboard_aggregations, OLD_INDEX
+ end
+
+ def down
+ add_concurrent_index :value_stream_dashboard_aggregations,
+ [:last_run_at, :namespace_id],
+ where: 'enabled IS TRUE',
+ name: OLD_INDEX
+ remove_concurrent_index_by_name :value_stream_dashboard_aggregations, NEW_INDEX
+ end
+end
diff --git a/db/migrate/20230516110414_add_ml_model_max_file_size_to_plan_limits.rb b/db/migrate/20230516110414_add_ml_model_max_file_size_to_plan_limits.rb
new file mode 100644
index 00000000000..938536dc4bc
--- /dev/null
+++ b/db/migrate/20230516110414_add_ml_model_max_file_size_to_plan_limits.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddMlModelMaxFileSizeToPlanLimits < Gitlab::Database::Migration[2.1]
+ def change
+ add_column(:plan_limits, :ml_model_max_file_size, :bigint, default: 10.gigabytes, null: false)
+ end
+end
diff --git a/db/migrate/20230516115259_increase_correlation_id_size_limit_in_abuse_trust_scores.rb b/db/migrate/20230516115259_increase_correlation_id_size_limit_in_abuse_trust_scores.rb
new file mode 100644
index 00000000000..03a05ce0d4b
--- /dev/null
+++ b/db/migrate/20230516115259_increase_correlation_id_size_limit_in_abuse_trust_scores.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class IncreaseCorrelationIdSizeLimitInAbuseTrustScores < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ constraint_correlation_id = check_constraint_name('abuse_trust_scores', 'correlation_id_value', 'max_length')
+ remove_check_constraint(:abuse_trust_scores, constraint_correlation_id)
+ add_check_constraint(:abuse_trust_scores, 'char_length(correlation_id_value) <= 255', constraint_correlation_id)
+ end
+
+ def down
+ constraint_correlation_id = check_constraint_name('abuse_trust_scores', 'correlation_id_value', 'max_length')
+ remove_check_constraint(:abuse_trust_scores, constraint_correlation_id)
+ add_check_constraint(:abuse_trust_scores, 'char_length(correlation_id_value) <= 32', constraint_correlation_id)
+ end
+end
diff --git a/db/migrate/20230516125656_create_dependency_proxy_packages_settings.rb b/db/migrate/20230516125656_create_dependency_proxy_packages_settings.rb
new file mode 100644
index 00000000000..19d6066aef5
--- /dev/null
+++ b/db/migrate/20230516125656_create_dependency_proxy_packages_settings.rb
@@ -0,0 +1,53 @@
+# frozen_string_literal: true
+
+class CreateDependencyProxyPackagesSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ TABLE_NAME = :dependency_proxy_packages_settings
+
+ def up
+ with_lock_retries do
+ create_table TABLE_NAME, id: false, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :project,
+ primary_key: true,
+ default: nil,
+ index: false,
+ foreign_key: { to_table: :projects, on_delete: :cascade }
+
+ t.boolean :enabled, default: false
+ t.text :maven_external_registry_url, null: true, limit: 255
+ t.binary :encrypted_maven_external_registry_username, null: true
+ t.binary :encrypted_maven_external_registry_username_iv, null: true
+ t.binary :encrypted_maven_external_registry_password, null: true
+ t.binary :encrypted_maven_external_registry_password_iv, null: true
+ end
+ end
+
+ constraint = check_constraint_name(TABLE_NAME.to_s, 'encrypted_maven_external_registry_username', 'max_length')
+ add_check_constraint(TABLE_NAME, 'octet_length(encrypted_maven_external_registry_username) <= 1020', constraint)
+
+ constraint = check_constraint_name(TABLE_NAME.to_s, 'encrypted_maven_external_registry_username_iv', 'max_length')
+ add_check_constraint(TABLE_NAME, 'octet_length(encrypted_maven_external_registry_username_iv) <= 1020', constraint)
+
+ constraint = check_constraint_name(TABLE_NAME.to_s, 'encrypted_maven_external_registry_password', 'max_length')
+ add_check_constraint(TABLE_NAME, 'octet_length(encrypted_maven_external_registry_password) <= 1020', constraint)
+
+ constraint = check_constraint_name(TABLE_NAME.to_s, 'encrypted_maven_external_registry_password_iv', 'max_length')
+ add_check_constraint(TABLE_NAME, 'octet_length(encrypted_maven_external_registry_password_iv) <= 1020', constraint)
+
+ constraint = check_constraint_name(TABLE_NAME.to_s, 'maven_credentials', 'set_or_empty')
+ add_check_constraint(
+ TABLE_NAME,
+ '(num_nulls(encrypted_maven_external_registry_username, encrypted_maven_external_registry_password) = 0)
+ OR
+ (num_nulls(encrypted_maven_external_registry_username, encrypted_maven_external_registry_password) = 2)',
+ constraint
+ )
+ end
+
+ def down
+ drop_table TABLE_NAME
+ end
+end
diff --git a/db/migrate/20230516175449_create_instance_audit_events_streaming_headers.rb b/db/migrate/20230516175449_create_instance_audit_events_streaming_headers.rb
new file mode 100644
index 00000000000..2fcf583c3ce
--- /dev/null
+++ b/db/migrate/20230516175449_create_instance_audit_events_streaming_headers.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class CreateInstanceAuditEventsStreamingHeaders < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'idx_headers_instance_external_audit_event_destination_id'
+ UNIQ_INDEX_NAME = 'idx_instance_external_audit_event_destination_id_key_uniq'
+
+ def change
+ create_table :instance_audit_events_streaming_headers do |t|
+ t.timestamps_with_timezone null: false
+ t.references :instance_external_audit_event_destination,
+ null: false,
+ index: { name: INDEX_NAME },
+ foreign_key: { to_table: 'audit_events_instance_external_audit_event_destinations', on_delete: :cascade }
+ t.text :key, null: false, limit: 255
+ t.text :value, null: false, limit: 255
+
+ t.index [:instance_external_audit_event_destination_id, :key], unique: true, name: UNIQ_INDEX_NAME
+ end
+ end
+end
diff --git a/db/migrate/20230516183736_add_container_registry_data_repair_worker_max_concurrency_to_application_settings.rb b/db/migrate/20230516183736_add_container_registry_data_repair_worker_max_concurrency_to_application_settings.rb
new file mode 100644
index 00000000000..4f5708d0355
--- /dev/null
+++ b/db/migrate/20230516183736_add_container_registry_data_repair_worker_max_concurrency_to_application_settings.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class AddContainerRegistryDataRepairWorkerMaxConcurrencyToApplicationSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'app_settings_registry_repair_worker_max_concurrency_positive'
+
+ def up
+ unless column_exists?(:application_settings, :container_registry_data_repair_detail_worker_max_concurrency)
+ add_column :application_settings, :container_registry_data_repair_detail_worker_max_concurrency, :integer,
+ default: 2, null: false
+ end
+
+ add_check_constraint :application_settings,
+ 'container_registry_data_repair_detail_worker_max_concurrency >= 0',
+ CONSTRAINT_NAME
+ end
+
+ def down
+ return unless column_exists?(:application_settings, :container_registry_data_repair_detail_worker_max_concurrency)
+
+ remove_check_constraint :application_settings, CONSTRAINT_NAME
+
+ remove_column :application_settings, :container_registry_data_repair_detail_worker_max_concurrency
+ end
+end
diff --git a/db/migrate/20230517090826_add_namespace_aggregation_schedule_lease_duration_to_application_settings.rb b/db/migrate/20230517090826_add_namespace_aggregation_schedule_lease_duration_to_application_settings.rb
new file mode 100644
index 00000000000..da7baeb0141
--- /dev/null
+++ b/db/migrate/20230517090826_add_namespace_aggregation_schedule_lease_duration_to_application_settings.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddNamespaceAggregationScheduleLeaseDurationToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings,
+ :namespace_aggregation_schedule_lease_duration_in_seconds,
+ :integer,
+ default: 5.minutes,
+ null: false
+ end
+end
diff --git a/db/migrate/20230517151041_add_agent_id_column_to_environments.rb b/db/migrate/20230517151041_add_agent_id_column_to_environments.rb
new file mode 100644
index 00000000000..bc042d361bc
--- /dev/null
+++ b/db/migrate/20230517151041_add_agent_id_column_to_environments.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddAgentIdColumnToEnvironments < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :environments, :cluster_agent_id, :bigint, null: true
+ end
+end
diff --git a/db/migrate/20230517151141_add_index_to_agent_id_column_environments.rb b/db/migrate/20230517151141_add_index_to_agent_id_column_environments.rb
new file mode 100644
index 00000000000..7a88ea7cfe6
--- /dev/null
+++ b/db/migrate/20230517151141_add_index_to_agent_id_column_environments.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexToAgentIdColumnEnvironments < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_environments_cluster_agent_id'
+
+ def up
+ add_concurrent_index :environments, :cluster_agent_id, name: INDEX_NAME, where: 'cluster_agent_id IS NOT NULL'
+ end
+
+ def down
+ remove_concurrent_index_by_name :environments, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230517151241_add_agent_id_foreign_key_to_environments.rb b/db/migrate/20230517151241_add_agent_id_foreign_key_to_environments.rb
new file mode 100644
index 00000000000..c12bff0ec4e
--- /dev/null
+++ b/db/migrate/20230517151241_add_agent_id_foreign_key_to_environments.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddAgentIdForeignKeyToEnvironments < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :environments, :cluster_agents,
+ column: :cluster_agent_id,
+ on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :environments, column: :cluster_agent_id
+ end
+ end
+end
diff --git a/db/migrate/20230517182802_add_fields_to_abuse_reports.rb b/db/migrate/20230517182802_add_fields_to_abuse_reports.rb
new file mode 100644
index 00000000000..dc83e4a1879
--- /dev/null
+++ b/db/migrate/20230517182802_add_fields_to_abuse_reports.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class AddFieldsToAbuseReports < Gitlab::Database::Migration[2.1]
+ RESOLVED_BY_INDEX = 'index_abuse_reports_on_resolved_by_id'
+ ASSIGNEE_INDEX = 'index_abuse_reports_on_assignee_id'
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ add_column :abuse_reports, :resolved_by_id, :int, null: true
+ add_column :abuse_reports, :assignee_id, :int, null: true
+ add_column :abuse_reports, :mitigation_steps, :text, null: true
+ add_column :abuse_reports, :evidence, :jsonb, null: true
+ end
+
+ add_text_limit :abuse_reports, :mitigation_steps, 1000
+ add_concurrent_index :abuse_reports, :resolved_by_id, name: RESOLVED_BY_INDEX
+ add_concurrent_index :abuse_reports, :assignee_id, name: ASSIGNEE_INDEX
+ end
+
+ def down
+ change_table :abuse_reports do |t|
+ t.remove :resolved_by_id
+ t.remove :assignee_id
+ t.remove :mitigation_steps
+ t.remove :evidence
+ end
+ end
+end
diff --git a/db/migrate/20230517182958_add_foreign_key_constraints_to_abuse_reports.rb b/db/migrate/20230517182958_add_foreign_key_constraints_to_abuse_reports.rb
new file mode 100644
index 00000000000..17507c3ad46
--- /dev/null
+++ b/db/migrate/20230517182958_add_foreign_key_constraints_to_abuse_reports.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddForeignKeyConstraintsToAbuseReports < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return if foreign_key_exists?(:abuse_reports, column: :resolved_by_id)
+
+ add_concurrent_foreign_key :abuse_reports, :users,
+ column: :resolved_by_id,
+ null: true,
+ on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :abuse_reports, column: :resolved_by_id
+ end
+ end
+end
diff --git a/db/migrate/20230517183403_add_foreign_key_to_abuse_reports_for_assignee.rb b/db/migrate/20230517183403_add_foreign_key_to_abuse_reports_for_assignee.rb
new file mode 100644
index 00000000000..d30133fb3a6
--- /dev/null
+++ b/db/migrate/20230517183403_add_foreign_key_to_abuse_reports_for_assignee.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToAbuseReportsForAssignee < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return if foreign_key_exists?(:abuse_reports, column: :assignee_id)
+
+ add_concurrent_foreign_key :abuse_reports, :users,
+ column: :assignee_id,
+ null: true,
+ on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :abuse_reports, column: :assignee_id
+ end
+ end
+end
diff --git a/db/migrate/20230519103034_truncate_schema_inconsistencies_table.rb b/db/migrate/20230519103034_truncate_schema_inconsistencies_table.rb
new file mode 100644
index 00000000000..ddf165ca991
--- /dev/null
+++ b/db/migrate/20230519103034_truncate_schema_inconsistencies_table.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class TruncateSchemaInconsistenciesTable < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ truncate_tables!('schema_inconsistencies')
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/migrate/20230519112106_add_diff_column_to_schema_inconsistencies.rb b/db/migrate/20230519112106_add_diff_column_to_schema_inconsistencies.rb
new file mode 100644
index 00000000000..7b42fc233ff
--- /dev/null
+++ b/db/migrate/20230519112106_add_diff_column_to_schema_inconsistencies.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddDiffColumnToSchemaInconsistencies < Gitlab::Database::Migration[2.1]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # rubocop:disable Rails/NotNullColumn
+ # limit is added in 20230519135414
+ def change
+ add_column :schema_inconsistencies, :diff, :text, null: false
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+ # rubocop:enable Rails/NotNullColumn
+end
diff --git a/db/migrate/20230519135414_add_text_limit_for_diff.rb b/db/migrate/20230519135414_add_text_limit_for_diff.rb
new file mode 100644
index 00000000000..682e28297db
--- /dev/null
+++ b/db/migrate/20230519135414_add_text_limit_for_diff.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitForDiff < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :schema_inconsistencies, :diff, 6144
+ end
+
+ def down
+ remove_text_limit :schema_inconsistencies, :diff
+ end
+end
diff --git a/db/migrate/20230522103433_remove_git_hub_import_deprecated_workers.rb b/db/migrate/20230522103433_remove_git_hub_import_deprecated_workers.rb
new file mode 100644
index 00000000000..3752836b018
--- /dev/null
+++ b/db/migrate/20230522103433_remove_git_hub_import_deprecated_workers.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveGitHubImportDeprecatedWorkers < Gitlab::Database::Migration[2.1]
+ DEPRECATED_JOB_CLASSES = %w[
+ Gitlab::GithubImport::ImportPullRequestMergedByWorker
+ Gitlab::GithubImport::ImportPullRequestReviewWorker
+ Gitlab::GithubImport::ImportReleaseAttachmentsWorker
+ ]
+
+ disable_ddl_transaction!
+ def up
+ sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
+ end
+
+ def down
+ # This migration removes any instances of deprecated workers and cannot be undone.
+ end
+end
diff --git a/db/migrate/20230522132239_add_model_experiments_access_level_to_project_feature.rb b/db/migrate/20230522132239_add_model_experiments_access_level_to_project_feature.rb
new file mode 100644
index 00000000000..a34b8a15521
--- /dev/null
+++ b/db/migrate/20230522132239_add_model_experiments_access_level_to_project_feature.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddModelExperimentsAccessLevelToProjectFeature < Gitlab::Database::Migration[2.1]
+ OPERATIONS_DEFAULT_VALUE = 20
+
+ enable_lock_retries!
+
+ def change
+ add_column :project_features,
+ :model_experiments_access_level,
+ :integer,
+ null: false,
+ default: OPERATIONS_DEFAULT_VALUE
+ end
+end
diff --git a/db/migrate/20230522180913_create_abuse_events.rb b/db/migrate/20230522180913_create_abuse_events.rb
new file mode 100644
index 00000000000..8bda96bba50
--- /dev/null
+++ b/db/migrate/20230522180913_create_abuse_events.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class CreateAbuseEvents < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_abuse_events_on_category_and_source'
+
+ enable_lock_retries!
+
+ def up
+ create_table :abuse_events do |t|
+ t.bigint :user_id, null: true, index: true
+ t.timestamps_with_timezone null: false
+ t.references :abuse_report, foreign_key: true, on_delete: :nullify, null: true, index: true
+ t.integer :source, null: false, limit: 2
+ t.integer :category, null: true, limit: 2
+ t.jsonb :metadata, null: true
+ end
+
+ add_index :abuse_events, [:category, :source], name: INDEX_NAME
+ end
+
+ def down
+ drop_table :abuse_events
+ end
+end
diff --git a/db/migrate/20230522181134_add_foreign_key_constraints_to_abuse_events.rb b/db/migrate/20230522181134_add_foreign_key_constraints_to_abuse_events.rb
new file mode 100644
index 00000000000..98927ad3ec5
--- /dev/null
+++ b/db/migrate/20230522181134_add_foreign_key_constraints_to_abuse_events.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyConstraintsToAbuseEvents < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :abuse_events, :users, column: :user_id, on_delete: :nullify, null: true
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :abuse_events, column: :user_id
+ end
+ end
+end
diff --git a/db/migrate/20230522210320_add_admin_vulnerability_to_member_roles.rb b/db/migrate/20230522210320_add_admin_vulnerability_to_member_roles.rb
new file mode 100644
index 00000000000..f3f68f007dd
--- /dev/null
+++ b/db/migrate/20230522210320_add_admin_vulnerability_to_member_roles.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddAdminVulnerabilityToMemberRoles < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :member_roles, :admin_vulnerability, :boolean, default: false, null: false
+ end
+end
diff --git a/db/migrate/20230523073455_add_new_async_index_table_name_length_constraint.rb b/db/migrate/20230523073455_add_new_async_index_table_name_length_constraint.rb
new file mode 100644
index 00000000000..96f3cc7372b
--- /dev/null
+++ b/db/migrate/20230523073455_add_new_async_index_table_name_length_constraint.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddNewAsyncIndexTableNameLengthConstraint < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'check_schema_and_name_length'
+
+ def up
+ add_text_limit :postgres_async_indexes, :table_name, 127, constraint_name: CONSTRAINT_NAME, validate: false
+ end
+
+ def down
+ remove_text_limit :postgres_async_indexes, :table_name, constraint_name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20230523074248_validate_async_index_table_name_length_constraint.rb b/db/migrate/20230523074248_validate_async_index_table_name_length_constraint.rb
new file mode 100644
index 00000000000..5b7d74d7db9
--- /dev/null
+++ b/db/migrate/20230523074248_validate_async_index_table_name_length_constraint.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ValidateAsyncIndexTableNameLengthConstraint < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ validate_text_limit :postgres_async_indexes, :table_name, constraint_name: 'check_schema_and_name_length'
+ end
+
+ def down
+ # no-op because we cannot invalidate a constraint
+ end
+end
diff --git a/db/migrate/20230523074517_remove_old_async_index_table_name_length_constraint.rb b/db/migrate/20230523074517_remove_old_async_index_table_name_length_constraint.rb
new file mode 100644
index 00000000000..4d43cbdd032
--- /dev/null
+++ b/db/migrate/20230523074517_remove_old_async_index_table_name_length_constraint.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class RemoveOldAsyncIndexTableNameLengthConstraint < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ OLD_LENGTH_LIMIT = 63
+
+ def up
+ remove_text_limit :postgres_async_indexes, :table_name
+ end
+
+ def down
+ # Remove items that might break the old length validation. (unlikely to happen)
+ define_batchable_model('postgres_async_indexes').each_batch do |indexes|
+ indexes.where('CHAR_LENGTH(table_name) > ?', OLD_LENGTH_LIMIT).delete_all
+ end
+
+ add_text_limit :postgres_async_indexes, :table_name, OLD_LENGTH_LIMIT
+ end
+end
diff --git a/db/migrate/20230523101514_finalize_user_type_migration.rb b/db/migrate/20230523101514_finalize_user_type_migration.rb
new file mode 100644
index 00000000000..f8ae4c7bb2c
--- /dev/null
+++ b/db/migrate/20230523101514_finalize_user_type_migration.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class FinalizeUserTypeMigration < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateHumanUserType'
+
+ disable_ddl_transaction!
+
+ def up
+ finalize_background_migration(MIGRATION)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/migrate/20230523122242_add_encrypted_ai_access_token.rb b/db/migrate/20230523122242_add_encrypted_ai_access_token.rb
new file mode 100644
index 00000000000..66035dc9c02
--- /dev/null
+++ b/db/migrate/20230523122242_add_encrypted_ai_access_token.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddEncryptedAiAccessToken < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :encrypted_ai_access_token, :binary
+ add_column :application_settings, :encrypted_ai_access_token_iv, :binary
+ end
+end
diff --git a/db/migrate/20230523125430_add_dismissal_reason_to_vulnerability_read.rb b/db/migrate/20230523125430_add_dismissal_reason_to_vulnerability_read.rb
new file mode 100644
index 00000000000..b9e437f0169
--- /dev/null
+++ b/db/migrate/20230523125430_add_dismissal_reason_to_vulnerability_read.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddDismissalReasonToVulnerabilityRead < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ add_column :vulnerability_reads, :dismissal_reason, :smallint
+ end
+
+ def down
+ remove_column :vulnerability_reads, :dismissal_reason
+ end
+end
diff --git a/db/migrate/20230524012641_add_vertex_ai_host_to_application_settings.rb b/db/migrate/20230524012641_add_vertex_ai_host_to_application_settings.rb
new file mode 100644
index 00000000000..99f178959ee
--- /dev/null
+++ b/db/migrate/20230524012641_add_vertex_ai_host_to_application_settings.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddVertexAiHostToApplicationSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ add_column :application_settings, :vertex_ai_host, :text, if_not_exists: true
+ end
+
+ add_text_limit :application_settings, :vertex_ai_host, 255
+ end
+
+ def down
+ remove_text_limit :application_settings, :vertex_ai_host
+
+ with_lock_retries do
+ remove_column :application_settings, :vertex_ai_host, if_exists: true
+ end
+ end
+end
diff --git a/db/migrate/20230524095108_remove_index_on_name_on_organization.rb b/db/migrate/20230524095108_remove_index_on_name_on_organization.rb
new file mode 100644
index 00000000000..216dca1efcd
--- /dev/null
+++ b/db/migrate/20230524095108_remove_index_on_name_on_organization.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveIndexOnNameOnOrganization < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'unique_organizations_on_name_lower'
+
+ def up
+ remove_concurrent_index_by_name :organizations, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :organizations, 'lower(name)', name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230524142655_add_enabled_zoekt_to_user_preferences.rb b/db/migrate/20230524142655_add_enabled_zoekt_to_user_preferences.rb
new file mode 100644
index 00000000000..b92f424d5e1
--- /dev/null
+++ b/db/migrate/20230524142655_add_enabled_zoekt_to_user_preferences.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddEnabledZoektToUserPreferences < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :user_preferences, :enabled_zoekt, :boolean, null: false, default: true
+ end
+end
diff --git a/db/migrate/20230525064706_add_service_desk_enabled_to_service_desk_settings.rb b/db/migrate/20230525064706_add_service_desk_enabled_to_service_desk_settings.rb
new file mode 100644
index 00000000000..ed2d679bca5
--- /dev/null
+++ b/db/migrate/20230525064706_add_service_desk_enabled_to_service_desk_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddServiceDeskEnabledToServiceDeskSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :service_desk_settings, :service_desk_enabled, :boolean, null: false, default: true
+ end
+end
diff --git a/db/migrate/20230529163335_add_show_in_cli_to_broadcast_message.rb b/db/migrate/20230529163335_add_show_in_cli_to_broadcast_message.rb
new file mode 100644
index 00000000000..3529b3d84e5
--- /dev/null
+++ b/db/migrate/20230529163335_add_show_in_cli_to_broadcast_message.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddShowInCliToBroadcastMessage < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :broadcast_messages, :show_in_cli, :boolean, default: true, null: false
+ end
+end
diff --git a/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb b/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb
new file mode 100644
index 00000000000..55135211ce8
--- /dev/null
+++ b/db/migrate/20230529173607_add_id_column_to_pm_checkpoints.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddIdColumnToPmCheckpoints < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ add_column(:pm_checkpoints, :id, :bigserial)
+ add_index(:pm_checkpoints, :id, unique: true, name: :pm_checkpoints_unique_index) # rubocop:disable Migration/AddIndex
+ add_index(:pm_checkpoints, [:purl_type, :data_type, :version_format], unique: true, # rubocop:disable Migration/AddIndex
+ name: :pm_checkpoints_path_components)
+ swap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index)
+ end
+
+ def down
+ add_index(:pm_checkpoints, [:purl_type, :data_type, :version_format], unique: true, # rubocop:disable Migration/AddIndex
+ name: :pm_checkpoints_unique_index)
+ remove_index(:pm_checkpoints, name: :pm_checkpoints_path_components) # rubocop:disable Migration/RemoveIndex
+ unswap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index)
+ remove_column(:pm_checkpoints, :id)
+ end
+end
diff --git a/db/migrate/20230529182720_recreate_billable_index.rb b/db/migrate/20230529182720_recreate_billable_index.rb
new file mode 100644
index 00000000000..5e56dd7005a
--- /dev/null
+++ b/db/migrate/20230529182720_recreate_billable_index.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class RecreateBillableIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = "index_users_for_active_billable_users"
+
+ def up
+ remove_concurrent_index_by_name :users, INDEX_NAME
+
+ add_concurrent_index :users, :id, name: INDEX_NAME,
+ where: "state = 'active' AND (user_type IN (0, 6, 4, 13)) AND (user_type IN (0, 4, 5))"
+ end
+
+ def down
+ remove_concurrent_index_by_name :users, INDEX_NAME
+
+ add_concurrent_index :users, :id, name: INDEX_NAME,
+ where: "state = 'active' AND (user_type IS NULL OR user_type IN (6, 4, 13)) " \
+ "AND (user_type IS NULL OR user_type IN (4, 5))"
+ end
+end
diff --git a/db/migrate/20230529184716_recreated_activity_index.rb b/db/migrate/20230529184716_recreated_activity_index.rb
new file mode 100644
index 00000000000..2b949d39de1
--- /dev/null
+++ b/db/migrate/20230529184716_recreated_activity_index.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RecreatedActivityIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_active_human_service'
+
+ def up
+ remove_concurrent_index_by_name :users, INDEX_NAME
+
+ add_concurrent_index :users, [:id, :last_activity_on],
+ name: INDEX_NAME,
+ where: "state = 'active' AND user_type IN (0, 4)"
+ end
+
+ def down
+ remove_concurrent_index_by_name :users, INDEX_NAME
+
+ add_concurrent_index :users, [:id, :last_activity_on],
+ name: INDEX_NAME,
+ where: "state = 'active' AND ((user_type IS NULL) OR (user_type = 4))"
+ end
+end
diff --git a/db/migrate/20230530003417_rename_tofa_settings.rb b/db/migrate/20230530003417_rename_tofa_settings.rb
new file mode 100644
index 00000000000..2ce88fe85f2
--- /dev/null
+++ b/db/migrate/20230530003417_rename_tofa_settings.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RenameTofaSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :application_settings, :encrypted_tofa_credentials, :encrypted_vertex_ai_credentials
+ rename_column_concurrently :application_settings, :encrypted_tofa_credentials_iv,
+ :encrypted_vertex_ai_credentials_iv
+
+ rename_column_concurrently :application_settings, :vertex_project, :vertex_ai_project
+ end
+
+ def down
+ undo_rename_column_concurrently :application_settings, :encrypted_tofa_credentials, :encrypted_vertex_ai_credentials
+ undo_rename_column_concurrently :application_settings, :encrypted_tofa_credentials_iv,
+ :encrypted_vertex_ai_credentials_iv
+
+ undo_rename_column_concurrently :application_settings, :vertex_project, :vertex_ai_project
+ end
+end
diff --git a/db/migrate/20230530112122_add_path_to_organizations.rb b/db/migrate/20230530112122_add_path_to_organizations.rb
new file mode 100644
index 00000000000..fbd037f1251
--- /dev/null
+++ b/db/migrate/20230530112122_add_path_to_organizations.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddPathToOrganizations < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'unique_organizations_on_path'
+
+ def up
+ # text limit is added in 20230530112602_add_text_limit_on_organization_path
+ add_column :organizations, :path, :text, null: false, default: '', if_not_exists: true # rubocop:disable Migration/AddLimitToTextColumns
+
+ add_concurrent_index :organizations, :path, name: INDEX_NAME, unique: true
+ end
+
+ def down
+ remove_column :organizations, :path, if_exists: true
+ end
+end
diff --git a/db/migrate/20230530112602_add_text_limit_on_organization_path.rb b/db/migrate/20230530112602_add_text_limit_on_organization_path.rb
new file mode 100644
index 00000000000..6eb9105cf97
--- /dev/null
+++ b/db/migrate/20230530112602_add_text_limit_on_organization_path.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitOnOrganizationPath < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :organizations, :path, 255
+ end
+
+ def down
+ remove_text_limit :organizations, :path
+ end
+end
diff --git a/db/migrate/20230530162437_add_instance_code_suggestion_enabled_to_app_settings.rb b/db/migrate/20230530162437_add_instance_code_suggestion_enabled_to_app_settings.rb
new file mode 100644
index 00000000000..15964ecd592
--- /dev/null
+++ b/db/migrate/20230530162437_add_instance_code_suggestion_enabled_to_app_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddInstanceCodeSuggestionEnabledToAppSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :instance_level_code_suggestions_enabled, :boolean, null: false, default: false
+ end
+end
diff --git a/db/migrate/20230531054422_add_index_on_packages_id_id_to_package_build_infos.rb b/db/migrate/20230531054422_add_index_on_packages_id_id_to_package_build_infos.rb
new file mode 100644
index 00000000000..15eac952a88
--- /dev/null
+++ b/db/migrate/20230531054422_add_index_on_packages_id_id_to_package_build_infos.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexOnPackagesIdIdToPackageBuildInfos < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_packages_build_infos_package_id_id'
+
+ def up
+ add_concurrent_index :packages_build_infos, [:package_id, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_build_infos, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230531134916_create_subscription_add_ons.rb b/db/migrate/20230531134916_create_subscription_add_ons.rb
new file mode 100644
index 00000000000..5faee049534
--- /dev/null
+++ b/db/migrate/20230531134916_create_subscription_add_ons.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class CreateSubscriptionAddOns < Gitlab::Database::Migration[2.1]
+ def change
+ create_table :subscription_add_ons, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.integer :name, limit: 2, null: false, index: { unique: true }
+ t.text :description, null: false, limit: 512
+ end
+ end
+end
diff --git a/db/migrate/20230531135001_create_subscription_add_on_purchases.rb b/db/migrate/20230531135001_create_subscription_add_on_purchases.rb
new file mode 100644
index 00000000000..6fdf1fdd495
--- /dev/null
+++ b/db/migrate/20230531135001_create_subscription_add_on_purchases.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateSubscriptionAddOnPurchases < Gitlab::Database::Migration[2.1]
+ def change
+ create_table :subscription_add_on_purchases, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.bigint :subscription_add_on_id, null: false
+ t.bigint :namespace_id, null: false
+ t.integer :quantity, null: false
+ t.date :expires_on, null: false
+ t.text :purchase_xid, null: false, limit: 255
+
+ t.index :subscription_add_on_id
+ t.index :namespace_id
+ end
+ end
+end
diff --git a/db/migrate/20230531142032_add_foreign_key_subscription_add_on_id_on_subscription_add_on_purchases.rb b/db/migrate/20230531142032_add_foreign_key_subscription_add_on_id_on_subscription_add_on_purchases.rb
new file mode 100644
index 00000000000..234cd2fa3af
--- /dev/null
+++ b/db/migrate/20230531142032_add_foreign_key_subscription_add_on_id_on_subscription_add_on_purchases.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddForeignKeySubscriptionAddOnIdOnSubscriptionAddOnPurchases < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :subscription_add_on_purchases,
+ :subscription_add_ons,
+ column: :subscription_add_on_id,
+ on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :subscription_add_on_purchases, column: :subscription_add_on_id
+ end
+ end
+end
diff --git a/db/migrate/20230531142053_add_foreign_key_namespace_id_on_subscription_add_on_purchases.rb b/db/migrate/20230531142053_add_foreign_key_namespace_id_on_subscription_add_on_purchases.rb
new file mode 100644
index 00000000000..7f7083a3a9c
--- /dev/null
+++ b/db/migrate/20230531142053_add_foreign_key_namespace_id_on_subscription_add_on_purchases.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddForeignKeyNamespaceIdOnSubscriptionAddOnPurchases < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :subscription_add_on_purchases, :namespaces, column: :namespace_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :subscription_add_on_purchases, column: :namespace_id
+ end
+ end
+end
diff --git a/db/migrate/20230531164258_add_operator_value_interval_to_scan_result_policies.rb b/db/migrate/20230531164258_add_operator_value_interval_to_scan_result_policies.rb
new file mode 100644
index 00000000000..5110a58f2cd
--- /dev/null
+++ b/db/migrate/20230531164258_add_operator_value_interval_to_scan_result_policies.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddOperatorValueIntervalToScanResultPolicies < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ AGE_VALUE_CONSTRAINT = 'age_value_null_or_positive'
+
+ def up
+ add_column(:scan_result_policies, :age_value, :integer)
+ add_column(:scan_result_policies, :age_operator, :integer, limit: 2)
+ add_column(:scan_result_policies, :age_interval, :integer, limit: 2)
+
+ add_check_constraint(:scan_result_policies, 'age_value IS NULL OR age_value >= 0', AGE_VALUE_CONSTRAINT)
+ end
+
+ def down
+ remove_column(:scan_result_policies, :age_value)
+ remove_column(:scan_result_policies, :age_operator)
+ remove_column(:scan_result_policies, :age_interval)
+ end
+end
diff --git a/db/migrate/20230601035558_add_unconfirmed_user_deletion_to_application_settings.rb b/db/migrate/20230601035558_add_unconfirmed_user_deletion_to_application_settings.rb
new file mode 100644
index 00000000000..edb9242feaa
--- /dev/null
+++ b/db/migrate/20230601035558_add_unconfirmed_user_deletion_to_application_settings.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddUnconfirmedUserDeletionToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :delete_unconfirmed_users, :boolean, default: false, null: false
+ add_column :application_settings, :unconfirmed_users_delete_after_days, :integer, default: 7, null: false
+ end
+end
diff --git a/db/migrate/20230601084041_add_merge_request_diff_llm_summaries_unique_index.rb b/db/migrate/20230601084041_add_merge_request_diff_llm_summaries_unique_index.rb
new file mode 100644
index 00000000000..6f8afb561e9
--- /dev/null
+++ b/db/migrate/20230601084041_add_merge_request_diff_llm_summaries_unique_index.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddMergeRequestDiffLlmSummariesUniqueIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'unique_merge_request_diff_llm_summaries_on_mr_diff_id'
+ OLD_INDEX_NAME = 'index_merge_request_diff_llm_summaries_on_mr_diff_id'
+
+ def up
+ add_concurrent_index :merge_request_diff_llm_summaries, :merge_request_diff_id, name: INDEX_NAME, unique: true
+ remove_concurrent_index_by_name :merge_request_diff_llm_summaries, OLD_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :merge_request_diff_llm_summaries, :merge_request_diff_id, name: OLD_INDEX_NAME
+ remove_concurrent_index_by_name :merge_request_diff_llm_summaries, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230601085810_create_project_compliance_standards_adherence.rb b/db/migrate/20230601085810_create_project_compliance_standards_adherence.rb
new file mode 100644
index 00000000000..eee443332fd
--- /dev/null
+++ b/db/migrate/20230601085810_create_project_compliance_standards_adherence.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class CreateProjectComplianceStandardsAdherence < Gitlab::Database::Migration[2.1]
+ def change
+ create_table :project_compliance_standards_adherence do |t|
+ t.timestamps_with_timezone null: false
+ t.bigint :project_id, null: false
+ t.bigint :namespace_id, null: false
+ t.integer :status, null: false, limit: 2
+ t.integer :check_name, null: false, limit: 2
+ t.integer :standard, null: false, limit: 2
+
+ t.index :namespace_id
+ t.index :project_id
+ t.index [:project_id, :check_name, :standard], unique: true,
+ name: 'u_project_compliance_standards_adherence_for_reporting'
+ end
+ end
+end
diff --git a/db/migrate/20230601085815_add_fk_to_projects_compliance_standards_adherence_on_project_id.rb b/db/migrate/20230601085815_add_fk_to_projects_compliance_standards_adherence_on_project_id.rb
new file mode 100644
index 00000000000..76970d2f83e
--- /dev/null
+++ b/db/migrate/20230601085815_add_fk_to_projects_compliance_standards_adherence_on_project_id.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddFkToProjectsComplianceStandardsAdherenceOnProjectId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :project_compliance_standards_adherence, :projects, column: :project_id,
+ on_delete: :cascade, reverse_lock_order: true
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :project_compliance_standards_adherence, column: :project_id
+ end
+ end
+end
diff --git a/db/migrate/20230601085820_add_fk_to_projects_compliance_standards_adherence_on_namespace_id.rb b/db/migrate/20230601085820_add_fk_to_projects_compliance_standards_adherence_on_namespace_id.rb
new file mode 100644
index 00000000000..fab0c47d26d
--- /dev/null
+++ b/db/migrate/20230601085820_add_fk_to_projects_compliance_standards_adherence_on_namespace_id.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddFkToProjectsComplianceStandardsAdherenceOnNamespaceId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :project_compliance_standards_adherence, :namespaces, column: :namespace_id,
+ on_delete: :nullify, reverse_lock_order: true
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :project_compliance_standards_adherence, column: :namespace_id
+ end
+ end
+end
diff --git a/db/migrate/20230603174306_add_finished_at_column_to_batched_background_migrations_table.rb b/db/migrate/20230603174306_add_finished_at_column_to_batched_background_migrations_table.rb
new file mode 100644
index 00000000000..2ed27ab90e6
--- /dev/null
+++ b/db/migrate/20230603174306_add_finished_at_column_to_batched_background_migrations_table.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddFinishedAtColumnToBatchedBackgroundMigrationsTable < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :batched_background_migrations, :finished_at, :datetime_with_timezone
+ end
+end
diff --git a/db/migrate/20230605043258_add_unconfirmed_created_at_index_to_users.rb b/db/migrate/20230605043258_add_unconfirmed_created_at_index_to_users.rb
new file mode 100644
index 00000000000..65bd7a1266b
--- /dev/null
+++ b/db/migrate/20230605043258_add_unconfirmed_created_at_index_to_users.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddUnconfirmedCreatedAtIndexToUsers < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_users_on_unconfirmed_and_created_at_for_active_humans'
+
+ def up
+ add_concurrent_index :users, [:created_at, :id],
+ name: INDEX_NAME,
+ where: "confirmed_at IS NULL AND state = 'active' AND user_type IN (0)"
+ end
+
+ def down
+ remove_concurrent_index_by_name :users, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230605043814_add_trigram_index_for_vulnerability_reads_container_images.rb b/db/migrate/20230605043814_add_trigram_index_for_vulnerability_reads_container_images.rb
new file mode 100644
index 00000000000..f614f16dff2
--- /dev/null
+++ b/db/migrate/20230605043814_add_trigram_index_for_vulnerability_reads_container_images.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTrigramIndexForVulnerabilityReadsContainerImages < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_vulnerability_reads_on_location_image_trigram'
+ REPORT_TYPES = { container_scanning: 2, cluster_image_scanning: 7 }.freeze
+
+ def up
+ add_concurrent_index :vulnerability_reads, :location_image,
+ name: INDEX_NAME,
+ using: :gin, opclass: { location_image: :gin_trgm_ops },
+ where: "report_type = ANY (ARRAY[#{REPORT_TYPES.values.join(', ')}]) AND location_image IS NOT NULL"
+ end
+
+ def down
+ remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230605095810_ensure_default_organization.rb b/db/migrate/20230605095810_ensure_default_organization.rb
new file mode 100644
index 00000000000..526e12077df
--- /dev/null
+++ b/db/migrate/20230605095810_ensure_default_organization.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class EnsureDefaultOrganization < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ disable_ddl_transaction!
+
+ class Organization < MigrationRecord
+ end
+
+ def up
+ return if Organization.exists?(id: 1)
+
+ path = 'default'
+
+ retries = 0
+
+ begin
+ Organization.create(id: 1, name: 'Default', path: path)
+ rescue ActiveRecord::RecordNotUnique
+ retries += 1
+ path = "default-#{SecureRandom.hex(3)}"
+ retry if retries < 10_000
+ end
+ end
+
+ def down
+ Organization.where(id: 1).delete_all
+ end
+end
diff --git a/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb b/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb
new file mode 100644
index 00000000000..573eccd7d12
--- /dev/null
+++ b/db/migrate/20230606124754_add_default_branch_protections_json_to_application_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddDefaultBranchProtectionsJsonToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :default_branch_protection_defaults, :jsonb, null: false, default: {}
+ end
+end
diff --git a/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb b/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb
new file mode 100644
index 00000000000..a35effe0bb7
--- /dev/null
+++ b/db/migrate/20230606124854_add_default_branch_protections_json_to_namespace_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddDefaultBranchProtectionsJsonToNamespaceSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :namespace_settings, :default_branch_protection_defaults, :jsonb, null: false, default: {}
+ end
+end
diff --git a/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb b/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb
new file mode 100644
index 00000000000..80d11c8aacf
--- /dev/null
+++ b/db/migrate/20230606124855_add_size_constraint_to_namespace_settings_json.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddSizeConstraintToNamespaceSettingsJson < Gitlab::Database::Migration[2.1]
+ CONSTRAINT_NAME = 'default_branch_protection_defaults_size_constraint'
+
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint :namespace_settings, 'octet_length(default_branch_protection_defaults::text) <= 1024',
+ CONSTRAINT_NAME, validate: false
+ end
+
+ def down
+ remove_check_constraint :namespace_settings, CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb b/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb
new file mode 100644
index 00000000000..4bc6971edc3
--- /dev/null
+++ b/db/migrate/20230606124856_add_size_constraint_to_application_settings_json.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddSizeConstraintToApplicationSettingsJson < Gitlab::Database::Migration[2.1]
+ CONSTRAINT_NAME = 'default_branch_protection_defaults_size_constraint'
+
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint :application_settings, 'octet_length(default_branch_protection_defaults::text) <= 1024',
+ CONSTRAINT_NAME, validate: false
+ end
+
+ def down
+ remove_check_constraint :application_settings, CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20230606182433_add_enterprise_columns_to_user_details.rb b/db/migrate/20230606182433_add_enterprise_columns_to_user_details.rb
new file mode 100644
index 00000000000..092a304b307
--- /dev/null
+++ b/db/migrate/20230606182433_add_enterprise_columns_to_user_details.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddEnterpriseColumnsToUserDetails < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :user_details, :enterprise_group_id, :bigint
+
+ add_column :user_details, :enterprise_group_associated_at, :datetime_with_timezone
+ end
+end
diff --git a/db/migrate/20230607080200_add_limits_history_to_plan_limits.rb b/db/migrate/20230607080200_add_limits_history_to_plan_limits.rb
new file mode 100644
index 00000000000..56250f598ea
--- /dev/null
+++ b/db/migrate/20230607080200_add_limits_history_to_plan_limits.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddLimitsHistoryToPlanLimits < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :plan_limits, :limits_history, :jsonb, default: {}, null: false
+ end
+end
diff --git a/db/migrate/20230607101334_add_ci_job_annotations_table.rb b/db/migrate/20230607101334_add_ci_job_annotations_table.rb
new file mode 100644
index 00000000000..caf7fb6fb33
--- /dev/null
+++ b/db/migrate/20230607101334_add_ci_job_annotations_table.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddCiJobAnnotationsTable < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ options = {
+ primary_key: [:id, :partition_id],
+ options: 'PARTITION BY LIST (partition_id)',
+ if_not_exists: true
+ }
+
+ create_table(:p_ci_job_annotations, **options) do |t|
+ t.bigserial :id, null: false
+ t.bigint :partition_id, null: false
+ t.bigint :job_id, null: false
+ t.text :name, null: false, limit: 255
+ t.jsonb :data, default: [], null: false
+ end
+ end
+end
diff --git a/db/migrate/20230607102017_add_index_on_ci_job_annotations.rb b/db/migrate/20230607102017_add_index_on_ci_job_annotations.rb
new file mode 100644
index 00000000000..cf38ae85192
--- /dev/null
+++ b/db/migrate/20230607102017_add_index_on_ci_job_annotations.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class AddIndexOnCiJobAnnotations < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_p_ci_job_annotations_on_partition_id_job_id_name'
+
+ def up
+ add_concurrent_partitioned_index(
+ :p_ci_job_annotations,
+ [:partition_id, :job_id, :name],
+ name: INDEX_NAME,
+ unique: true
+ )
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name :p_ci_job_annotations, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230607102721_add_check_constraints_to_ci_job_annotations.rb b/db/migrate/20230607102721_add_check_constraints_to_ci_job_annotations.rb
new file mode 100644
index 00000000000..4f1e0e6e0c0
--- /dev/null
+++ b/db/migrate/20230607102721_add_check_constraints_to_ci_job_annotations.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddCheckConstraintsToCiJobAnnotations < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint(
+ :p_ci_job_annotations,
+ "(jsonb_typeof(data) = 'array')",
+ 'data_is_array'
+ )
+ end
+
+ def down
+ remove_check_constraint :p_ci_job_annotations, 'data_is_array'
+ end
+end
diff --git a/db/migrate/20230607102731_create_ci_job_annotations_partitions.rb b/db/migrate/20230607102731_create_ci_job_annotations_partitions.rb
new file mode 100644
index 00000000000..16a9ee83e25
--- /dev/null
+++ b/db/migrate/20230607102731_create_ci_job_annotations_partitions.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class CreateCiJobAnnotationsPartitions < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ connection.execute(<<~SQL)
+ CREATE TABLE IF NOT EXISTS gitlab_partitions_dynamic.ci_job_annotations_100
+ PARTITION OF p_ci_job_annotations
+ FOR VALUES IN (100);
+ SQL
+ end
+
+ def down
+ connection.execute(<<~SQL)
+ DROP TABLE IF EXISTS gitlab_partitions_dynamic.ci_job_annotations_100;
+ SQL
+ end
+end
diff --git a/db/migrate/20230608195429_redo_remove_create_learn_gitlab_worker_job_instances.rb b/db/migrate/20230608195429_redo_remove_create_learn_gitlab_worker_job_instances.rb
new file mode 100644
index 00000000000..925af31398d
--- /dev/null
+++ b/db/migrate/20230608195429_redo_remove_create_learn_gitlab_worker_job_instances.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RedoRemoveCreateLearnGitlabWorkerJobInstances < Gitlab::Database::Migration[2.1]
+ DEPRECATED_JOB_CLASSES = %w[Onboarding::CreateLearnGitlabWorker]
+
+ disable_ddl_transaction!
+
+ def up
+ sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
+ end
+
+ def down
+ # This migration removes any instances of deprecated workers and cannot be undone.
+ end
+end
diff --git a/db/migrate/20230609085234_add_gitlab_shell_operation_limit_to_application_settings.rb b/db/migrate/20230609085234_add_gitlab_shell_operation_limit_to_application_settings.rb
new file mode 100644
index 00000000000..f9a5a6fcea9
--- /dev/null
+++ b/db/migrate/20230609085234_add_gitlab_shell_operation_limit_to_application_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddGitlabShellOperationLimitToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :gitlab_shell_operation_limit, :integer, default: 600
+ end
+end
diff --git a/db/migrate/20230609115844_create_audit_events_streaming_instance_event_type_filters.rb b/db/migrate/20230609115844_create_audit_events_streaming_instance_event_type_filters.rb
new file mode 100644
index 00000000000..061b504ffb7
--- /dev/null
+++ b/db/migrate/20230609115844_create_audit_events_streaming_instance_event_type_filters.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateAuditEventsStreamingInstanceEventTypeFilters < Gitlab::Database::Migration[2.1]
+ UNIQ_INDEX_NAME = 'unique_streaming_instance_event_type_filters_destination_id'
+
+ def change
+ create_table :audit_events_streaming_instance_event_type_filters do |t|
+ t.timestamps_with_timezone null: false
+ t.references :instance_external_audit_event_destination,
+ null: false,
+ index: false,
+ foreign_key: { to_table: 'audit_events_instance_external_audit_event_destinations', on_delete: :cascade }
+ t.text :audit_event_type, null: false, limit: 255
+
+ t.index [:instance_external_audit_event_destination_id, :audit_event_type], unique: true, name: UNIQ_INDEX_NAME
+ end
+ end
+end
diff --git a/db/migrate/20230612072807_add_vacuum_type_to_autovacuum_status.rb b/db/migrate/20230612072807_add_vacuum_type_to_autovacuum_status.rb
new file mode 100644
index 00000000000..a985b8a9361
--- /dev/null
+++ b/db/migrate/20230612072807_add_vacuum_type_to_autovacuum_status.rb
@@ -0,0 +1,47 @@
+# frozen_string_literal: true
+
+class AddVacuumTypeToAutovacuumStatus < Gitlab::Database::Migration[2.1]
+ def up
+ execute <<~SQL
+ DROP VIEW IF EXISTS postgres_autovacuum_activity;
+
+ CREATE VIEW postgres_autovacuum_activity AS
+ WITH processes as
+ (
+ SELECT query, query_start, (regexp_matches(query, '^autovacuum: VACUUM (\\w+)\\.(\\w+)')) as matches,
+ CASE WHEN (query ~~* '%wraparound)'::text) THEN true ELSE false END as wraparound_prevention
+ FROM postgres_pg_stat_activity_autovacuum()
+ WHERE query ~* '^autovacuum: VACUUM \\w+\\.\\w+'
+ )
+ SELECT matches[1] || '.' || matches[2] as table_identifier,
+ matches[1] as schema,
+ matches[2] as table,
+ query_start as vacuum_start,
+ wraparound_prevention
+ FROM processes;
+
+ COMMENT ON VIEW postgres_autovacuum_activity IS 'Contains information about PostgreSQL backends currently performing autovacuum operations on the tables indicated here.';
+ SQL
+ end
+
+ def down
+ execute <<~SQL
+ DROP VIEW IF EXISTS postgres_autovacuum_activity;
+
+ CREATE VIEW postgres_autovacuum_activity AS
+ WITH processes as
+ (
+ SELECT query, query_start, (regexp_matches(query, '^autovacuum: VACUUM (\\w+)\\.(\\w+)')) as matches
+ FROM postgres_pg_stat_activity_autovacuum()
+ WHERE query ~* '^autovacuum: VACUUM \\w+\\.\\w+'
+ )
+ SELECT matches[1] || '.' || matches[2] as table_identifier,
+ matches[1] as schema,
+ matches[2] as table,
+ query_start as vacuum_start
+ FROM processes;
+
+ COMMENT ON VIEW postgres_autovacuum_activity IS 'Contains information about PostgreSQL backends currently performing autovacuum operations on the tables indicated here.';
+ SQL
+ 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/post_migrate/20221027203951_drop_experiment_users_table.rb b/db/post_migrate/20221027203951_drop_experiment_users_table.rb
index 95455db98e5..838a9605740 100644
--- a/db/post_migrate/20221027203951_drop_experiment_users_table.rb
+++ b/db/post_migrate/20221027203951_drop_experiment_users_table.rb
@@ -6,7 +6,7 @@ class DropExperimentUsersTable < Gitlab::Database::Migration[2.0]
end
def down
- create_table :experiment_users do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ create_table :experiment_users do |t|
t.bigint :experiment_id, null: false
t.bigint :user_id, null: false
t.integer :group_type, limit: 2, null: false, default: 0
diff --git a/db/post_migrate/20221114142602_drop_experiment_subjects_table.rb b/db/post_migrate/20221114142602_drop_experiment_subjects_table.rb
index 371f214de6d..f7c10192afb 100644
--- a/db/post_migrate/20221114142602_drop_experiment_subjects_table.rb
+++ b/db/post_migrate/20221114142602_drop_experiment_subjects_table.rb
@@ -7,7 +7,7 @@ class DropExperimentSubjectsTable < Gitlab::Database::Migration[2.0]
def down
unless table_exists?(:experiment_subjects)
- create_table :experiment_subjects do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ create_table :experiment_subjects do |t|
t.bigint :experiment_id, null: false
t.bigint :user_id
t.bigint :project_id
diff --git a/db/post_migrate/20221114142616_drop_experiments_table.rb b/db/post_migrate/20221114142616_drop_experiments_table.rb
index da6c1122494..a8280eb9f69 100644
--- a/db/post_migrate/20221114142616_drop_experiments_table.rb
+++ b/db/post_migrate/20221114142616_drop_experiments_table.rb
@@ -9,7 +9,7 @@ class DropExperimentsTable < Gitlab::Database::Migration[2.0]
def down
unless table_exists?(:experiments)
- create_table :experiments do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ create_table :experiments do |t|
t.text :name, null: false
t.index :name, unique: true
diff --git a/db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb b/db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb
index 01424f8113f..d044c44e95e 100644
--- a/db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb
+++ b/db/post_migrate/20221115184525_remove_namespaces_tmp_project_id_column.rb
@@ -14,9 +14,9 @@ class RemoveNamespacesTmpProjectIdColumn < Gitlab::Database::Migration[2.0]
def down
unless column_exists?(:namespaces, :tmp_project_id)
with_lock_retries do
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:disable Migration/AddColumnsToWideTables
add_column :namespaces, :tmp_project_id, :integer
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:enable Migration/AddColumnsToWideTables
end
end
diff --git a/db/post_migrate/20221207135755_finalize_add_namespaces_emails_enabled_column_data.rb b/db/post_migrate/20221207135755_finalize_add_namespaces_emails_enabled_column_data.rb
new file mode 100644
index 00000000000..c4fc2aad60b
--- /dev/null
+++ b/db/post_migrate/20221207135755_finalize_add_namespaces_emails_enabled_column_data.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class FinalizeAddNamespacesEmailsEnabledColumnData < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'AddNamespacesEmailsEnabledColumnData'
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :namespaces,
+ column_name: :id,
+ job_arguments: []
+ )
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/post_migrate/20221207135831_finalize_add_projects_emails_enabled_column_data.rb b/db/post_migrate/20221207135831_finalize_add_projects_emails_enabled_column_data.rb
new file mode 100644
index 00000000000..6118be6d4c4
--- /dev/null
+++ b/db/post_migrate/20221207135831_finalize_add_projects_emails_enabled_column_data.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class FinalizeAddProjectsEmailsEnabledColumnData < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'AddProjectsEmailsEnabledColumnData'
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :projects,
+ column_name: :id,
+ job_arguments: []
+ )
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/post_migrate/20230104103748_remove_new_amount_used_column.rb b/db/post_migrate/20230104103748_remove_new_amount_used_column.rb
index 0aaa7c1bd8f..b93879c2b50 100644
--- a/db/post_migrate/20230104103748_remove_new_amount_used_column.rb
+++ b/db/post_migrate/20230104103748_remove_new_amount_used_column.rb
@@ -10,10 +10,10 @@ class RemoveNewAmountUsedColumn < Gitlab::Database::Migration[2.1]
def down
return if column_exists?(:ci_project_monthly_usages, :new_amount_used)
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:disable Migration/AddColumnsToWideTables
add_column :ci_project_monthly_usages, :new_amount_used, :decimal, default: 0.0,
precision: 18, scale: 2, null: false
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:enable Migration/AddColumnsToWideTables
install_rename_triggers :ci_project_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME
end
diff --git a/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb b/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb
index cebda3e353e..11e212a697d 100644
--- a/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb
+++ b/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb
@@ -12,10 +12,10 @@ class RemoveNewAmountUsedColumnOnCiNamespaceMonthlyUsages < Gitlab::Database::Mi
def down
return if column_exists?(:ci_namespace_monthly_usages, :new_amount_used)
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:disable Migration/AddColumnsToWideTables
add_column :ci_namespace_monthly_usages, :new_amount_used, :decimal, default: 0.0,
precision: 18, scale: 2, null: false
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables
+ # rubocop:enable Migration/AddColumnsToWideTables
install_rename_triggers :ci_namespace_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME
end
diff --git a/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
index 7f90b3293d8..76c93be0f42 100644
--- a/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
+++ b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
@@ -14,9 +14,7 @@ class DropWebHookCallsHighColumn < Gitlab::Database::Migration[2.1]
def down
with_lock_retries do
unless column_exists?(:plan_limits, :web_hook_calls_high)
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
add_column :plan_limits, :web_hook_calls_high, :integer, default: 0
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
end
end
diff --git a/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb b/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb
index e1d3787cbb3..126555ae391 100644
--- a/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb
+++ b/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb
@@ -4,110 +4,10 @@ class MigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
- BackupHLLRedisCounter.known_events.each do |event|
- if event[:aggregation].to_sym == :daily
- migrate_daily_aggregated(event)
- else
- migrate_weekly_aggregated(event)
- end
- end
+ # deleted as contained a bug
end
def down
# no-op
end
-
- private
-
- def migrate_daily_aggregated(event)
- days_back = BackupHLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH
- start_date = Date.today - days_back - 1.day
- end_date = Date.today + 1.day
-
- (start_date..end_date).each do |date|
- rename_key(event, date)
- end
- end
-
- def migrate_weekly_aggregated(event)
- weeks_back = BackupHLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH
- start_date = (Date.today - weeks_back).beginning_of_week - 1.day
- end_date = Date.today.end_of_week + 1.day
-
- (start_date..end_date).each { |date| rename_key(event, date) }
- end
-
- def rename_key(event, date)
- old_key = old_redis_key(event, date)
- new_key = BackupHLLRedisCounter.redis_key(event, date)
-
- # cannot simply rename due to different slots
- Gitlab::Redis::SharedState.with do |r|
- break unless r.exists?(old_key)
-
- Gitlab::Redis::HLL.add(
- key: new_key,
- value: r.pfcount(old_key),
- expiry: r.ttl(old_key)
- )
- end
- end
-
- def old_redis_key(event, time)
- name_with_slot = if event[:redis_slot].present?
- event[:name].to_s.gsub(event[:redis_slot], "{#{event[:redis_slot]}}")
- else
- "{#{event[:name]}}"
- end
-
- BackupHLLRedisCounter.apply_time_aggregation(name_with_slot, time, event)
- end
-
- # :nocov: Existing backed up class # rubocop:disable Gitlab/NoCodeCoverageComment
- module BackupHLLRedisCounter
- DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH = 6.weeks
- DEFAULT_DAILY_KEY_EXPIRY_LENGTH = 29.days
- REDIS_SLOT = 'hll_counters'
-
- KNOWN_EVENTS_PATH = File.expand_path('known_events/*.yml', __dir__)
- ALLOWED_AGGREGATIONS = %i[daily weekly].freeze
-
- class << self
- def known_events
- @known_events ||= load_events(KNOWN_EVENTS_PATH)
- end
-
- def load_events(wildcard)
- Dir[wildcard].each_with_object([]) do |path, events|
- events.push(*load_yaml_from_path(path))
- end
- end
-
- def load_yaml_from_path(path)
- YAML.safe_load(File.read(path))&.map(&:with_indifferent_access)
- end
-
- def known_events_names
- known_events.map { |event| event[:name] } # rubocop:disable Rails/Pluck
- end
-
- def redis_key(event, time, context = '')
- key = "{#{REDIS_SLOT}}_#{event[:name]}"
- key = apply_time_aggregation(key, time, event)
- key = "#{context}_#{key}" if context.present?
- key
- end
-
- def apply_time_aggregation(key, time, event)
- if event[:aggregation].to_sym == :daily
- year_day = time.strftime('%G-%j')
- "#{year_day}-#{key}"
- else
- year_week = time.strftime('%G-%V')
- "#{key}-#{year_week}"
- end
- end
- end
- end
- # :nocov: # rubocop:disable Gitlab/NoCodeCoverageComment
end
diff --git a/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb b/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb
index 11468a5844e..6a2aecbda98 100644
--- a/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb
+++ b/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb
@@ -1,83 +1,7 @@
# frozen_string_literal: true
class SwapMergeRequestUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
- include Gitlab::Database::MigrationHelpers::ConvertToBigint
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'merge_request_user_mentions'
-
- def up
- return unless should_run?
-
- swap
- end
-
- def down
- return unless should_run?
-
- swap
-
- add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
- name: 'index_merge_request_user_mentions_note_id_convert_to_bigint',
- where: 'note_id_convert_to_bigint IS NOT NULL'
-
- add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
- name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint',
- on_delete: :cascade,
- validate: false
- end
-
- def swap
- # This will replace the existing index_merge_request_user_mentions_on_note_id
- add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
- name: 'index_merge_request_user_mentions_note_id_convert_to_bigint',
- where: 'note_id_convert_to_bigint IS NOT NULL'
-
- # This will replace the existing merge_request_user_mentions_on_mr_id_and_note_id_index
- add_concurrent_index TABLE_NAME, [:merge_request_id, :note_id_convert_to_bigint], unique: true,
- name: 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index'
-
- # This will replace the existing merge_request_user_mentions_on_mr_id_index
- add_concurrent_index TABLE_NAME, :merge_request_id, unique: true,
- name: 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint',
- where: 'note_id_convert_to_bigint IS NULL'
-
- # This will replace the existing fk_rails_c440b9ea31
- add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
- name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint',
- on_delete: :cascade
-
- with_lock_retries(raise_on_exhaustion: true) do
- execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint"
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger
- .on_table(TABLE_NAME, connection: connection)
- .name(:note_id, :note_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- execute 'DROP INDEX IF EXISTS index_merge_request_user_mentions_on_note_id'
- rename_index TABLE_NAME, 'index_merge_request_user_mentions_note_id_convert_to_bigint',
- 'index_merge_request_user_mentions_on_note_id'
-
- execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_and_note_id_index'
- rename_index TABLE_NAME, 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index',
- 'merge_request_user_mentions_on_mr_id_and_note_id_index'
-
- execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_index'
- rename_index TABLE_NAME, 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint',
- 'merge_request_user_mentions_on_mr_id_index'
-
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_c440b9ea31"
- rename_constraint(TABLE_NAME, 'fk_merge_request_user_mentions_note_id_convert_to_bigint', 'fk_rails_c440b9ea31')
- end
- end
-
- def should_run?
- com_or_dev_or_test_but_not_jh?
- end
+ # No-op, moved to db/post_migrate/20230310020356_swap_merge_request_user_mentions_note_id_to_bigint_2.rb
+ def up; end
+ def down; end
end
diff --git a/db/post_migrate/20230310020356_swap_merge_request_user_mentions_note_id_to_bigint_2.rb b/db/post_migrate/20230310020356_swap_merge_request_user_mentions_note_id_to_bigint_2.rb
new file mode 100644
index 00000000000..c680b129493
--- /dev/null
+++ b/db/post_migrate/20230310020356_swap_merge_request_user_mentions_note_id_to_bigint_2.rb
@@ -0,0 +1,93 @@
+# frozen_string_literal: true
+
+class SwapMergeRequestUserMentionsNoteIdToBigint2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = 'merge_request_user_mentions'
+
+ def up
+ return unless should_run?
+ return if columns_already_swapped?
+
+ swap
+ end
+
+ def down
+ return unless should_run?
+ return unless columns_already_swapped?
+
+ swap
+
+ add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
+ name: 'index_merge_request_user_mentions_note_id_convert_to_bigint',
+ where: 'note_id_convert_to_bigint IS NOT NULL'
+
+ add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
+ name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint',
+ on_delete: :cascade,
+ validate: false
+ end
+
+ def swap
+ # This will replace the existing index_merge_request_user_mentions_on_note_id
+ add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true,
+ name: 'index_merge_request_user_mentions_note_id_convert_to_bigint',
+ where: 'note_id_convert_to_bigint IS NOT NULL'
+
+ # This will replace the existing merge_request_user_mentions_on_mr_id_and_note_id_index
+ add_concurrent_index TABLE_NAME, [:merge_request_id, :note_id_convert_to_bigint], unique: true,
+ name: 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index'
+
+ # This will replace the existing merge_request_user_mentions_on_mr_id_index
+ add_concurrent_index TABLE_NAME, :merge_request_id, unique: true,
+ name: 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint',
+ where: 'note_id_convert_to_bigint IS NULL'
+
+ # This will replace the existing fk_rails_c440b9ea31
+ add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint,
+ name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint',
+ on_delete: :cascade
+
+ with_lock_retries(raise_on_exhaustion: true) do
+ execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
+
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint"
+
+ function_name = Gitlab::Database::UnidirectionalCopyTrigger
+ .on_table(TABLE_NAME, connection: connection)
+ .name(:note_id, :note_id_convert_to_bigint)
+ execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
+
+ execute 'DROP INDEX IF EXISTS index_merge_request_user_mentions_on_note_id'
+ rename_index TABLE_NAME, 'index_merge_request_user_mentions_note_id_convert_to_bigint',
+ 'index_merge_request_user_mentions_on_note_id'
+
+ execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_and_note_id_index'
+ rename_index TABLE_NAME, 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index',
+ 'merge_request_user_mentions_on_mr_id_and_note_id_index'
+
+ execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_index'
+ rename_index TABLE_NAME, 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint',
+ 'merge_request_user_mentions_on_mr_id_index'
+
+ execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_c440b9ea31"
+ rename_constraint(TABLE_NAME, 'fk_merge_request_user_mentions_note_id_convert_to_bigint', 'fk_rails_c440b9ea31')
+ end
+ end
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+
+ def columns_already_swapped?
+ table_columns = columns(TABLE_NAME)
+ note_id = table_columns.find { |c| c.name == 'note_id' }
+ note_id_convert_to_bigint = table_columns.find { |c| c.name == 'note_id_convert_to_bigint' }
+
+ note_id_convert_to_bigint.sql_type == 'integer' && note_id.sql_type == 'bigint'
+ end
+end
diff --git a/db/post_migrate/20230316185746_drop_packages_events_table.rb b/db/post_migrate/20230316185746_drop_packages_events_table.rb
index bb51fc7ae9c..f8b37651249 100644
--- a/db/post_migrate/20230316185746_drop_packages_events_table.rb
+++ b/db/post_migrate/20230316185746_drop_packages_events_table.rb
@@ -8,7 +8,7 @@ class DropPackagesEventsTable < Gitlab::Database::Migration[2.1]
def down
return if table_exists?(:packages_events)
- create_table :packages_events do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ create_table :packages_events do |t|
t.integer :event_type, limit: 2, null: false
t.integer :event_scope, limit: 2, null: false
t.integer :originator_type, limit: 2, null: false
diff --git a/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb b/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb
index b4468c851ae..59bff26f964 100644
--- a/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb
+++ b/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb
@@ -3,6 +3,93 @@
class MigrateDailyRedisHllEventsToWeeklyAggregation < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
+ DAILY_EVENTS =
+ %w[g_edit_by_web_ide
+ g_edit_by_sfe
+ g_edit_by_snippet_ide
+ g_edit_by_live_preview
+ wiki_action
+ design_action
+ project_action
+ git_write_action
+ merge_request_action
+ i_source_code_code_intelligence
+ g_project_management_issue_title_changed
+ g_project_management_issue_description_changed
+ g_project_management_issue_assignee_changed
+ g_project_management_issue_made_confidential
+ g_project_management_issue_made_visible
+ g_project_management_issue_created
+ g_project_management_issue_closed
+ g_project_management_issue_reopened
+ g_project_management_issue_label_changed
+ g_project_management_issue_milestone_changed
+ g_project_management_issue_cross_referenced
+ g_project_management_issue_moved
+ g_project_management_issue_related
+ g_project_management_issue_unrelated
+ g_project_management_issue_marked_as_duplicate
+ g_project_management_issue_locked
+ g_project_management_issue_unlocked
+ g_project_management_issue_designs_added
+ g_project_management_issue_designs_modified
+ g_project_management_issue_designs_removed
+ g_project_management_issue_due_date_changed
+ g_project_management_issue_design_comments_removed
+ g_project_management_issue_time_estimate_changed
+ g_project_management_issue_time_spent_changed
+ g_project_management_issue_comment_added
+ g_project_management_issue_comment_edited
+ g_project_management_issue_comment_removed
+ g_project_management_issue_cloned
+ g_geo_proxied_requests
+ approval_project_rule_created
+ g_project_management_issue_added_to_epic
+ g_project_management_issue_changed_epic
+ g_project_management_issue_health_status_changed
+ g_project_management_issue_iteration_changed
+ g_project_management_issue_removed_from_epic
+ g_project_management_issue_weight_changed
+ g_geo_proxied_requests
+ g_project_management_users_creating_epic_boards
+ g_project_management_users_viewing_epic_boards
+ g_project_management_users_updating_epic_board_names
+ g_project_management_epic_created
+ project_management_users_unchecking_epic_task
+ project_management_users_checking_epic_task
+ g_project_management_users_updating_epic_titles
+ g_project_management_users_updating_epic_descriptions
+ g_project_management_users_creating_epic_notes
+ g_project_management_users_updating_epic_notes
+ g_project_management_users_destroying_epic_notes
+ g_project_management_users_awarding_epic_emoji
+ g_project_management_users_removing_epic_emoji
+ g_project_management_users_setting_epic_start_date_as_fixed
+ g_project_management_users_updating_fixed_epic_start_date
+ g_project_management_users_setting_epic_start_date_as_inherited
+ g_project_management_users_setting_epic_due_date_as_fixed
+ g_project_management_users_updating_fixed_epic_due_date
+ g_project_management_users_setting_epic_due_date_as_inherited
+ g_project_management_epic_issue_added
+ g_project_management_epic_issue_removed
+ g_project_management_epic_issue_moved_from_project
+ g_project_management_users_updating_epic_parent
+ g_project_management_epic_closed
+ g_project_management_epic_reopened
+ g_project_management_issue_promoted_to_epic
+ g_project_management_users_setting_epic_confidential
+ g_project_management_users_setting_epic_visible
+ g_project_management_epic_users_changing_labels
+ g_project_management_epic_destroyed
+ g_project_management_epic_cross_referenced
+ g_project_management_users_epic_issue_added_from_epic
+ g_project_management_epic_related_added
+ g_project_management_epic_related_removed
+ g_project_management_epic_blocking_added
+ g_project_management_epic_blocking_removed
+ g_project_management_epic_blocked_added
+ g_project_management_epic_blocked_removed].freeze
+
def up
days_back = 29.days
start_date = Date.today - days_back - 1.day
@@ -10,7 +97,7 @@ class MigrateDailyRedisHllEventsToWeeklyAggregation < Gitlab::Database::Migratio
keys = {}
Gitlab::UsageDataCounters::HLLRedisCounter.known_events.each do |event|
- next unless event[:aggregation].to_sym == :daily
+ next unless DAILY_EVENTS.include?(event[:name].to_s)
(start_date..end_date).each do |date|
daily_key = redis_key(event, date, :daily)
diff --git a/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb b/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb
index f034bc21847..41d23735807 100644
--- a/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb
+++ b/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb
@@ -14,7 +14,7 @@ class RemoveMachineIdFromBuildsMetadata < Gitlab::Database::Migration[2.1]
end
def down
- add_column :p_ci_builds_metadata, :runner_machine_id, :bigint, if_not_exists: true # rubocop: disable Migration/SchemaAdditionMethodsNoPost
+ add_column :p_ci_builds_metadata, :runner_machine_id, :bigint, if_not_exists: true
add_concurrent_partitioned_index :p_ci_builds_metadata, :runner_machine_id, name: INDEX_NAME,
where: 'runner_machine_id IS NOT NULL'
diff --git a/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb b/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb
index f09888bd821..17776d8e42e 100644
--- a/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb
+++ b/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb
@@ -3,9 +3,98 @@
class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
+ KEY_EXPIRY_LENGTH = 6.weeks
+
+ DAILY_EVENTS =
+ %w[g_edit_by_web_ide
+ g_edit_by_sfe
+ g_edit_by_snippet_ide
+ g_edit_by_live_preview
+ wiki_action
+ design_action
+ project_action
+ git_write_action
+ merge_request_action
+ i_source_code_code_intelligence
+ g_project_management_issue_title_changed
+ g_project_management_issue_description_changed
+ g_project_management_issue_assignee_changed
+ g_project_management_issue_made_confidential
+ g_project_management_issue_made_visible
+ g_project_management_issue_created
+ g_project_management_issue_closed
+ g_project_management_issue_reopened
+ g_project_management_issue_label_changed
+ g_project_management_issue_milestone_changed
+ g_project_management_issue_cross_referenced
+ g_project_management_issue_moved
+ g_project_management_issue_related
+ g_project_management_issue_unrelated
+ g_project_management_issue_marked_as_duplicate
+ g_project_management_issue_locked
+ g_project_management_issue_unlocked
+ g_project_management_issue_designs_added
+ g_project_management_issue_designs_modified
+ g_project_management_issue_designs_removed
+ g_project_management_issue_due_date_changed
+ g_project_management_issue_design_comments_removed
+ g_project_management_issue_time_estimate_changed
+ g_project_management_issue_time_spent_changed
+ g_project_management_issue_comment_added
+ g_project_management_issue_comment_edited
+ g_project_management_issue_comment_removed
+ g_project_management_issue_cloned
+ g_geo_proxied_requests
+ approval_project_rule_created
+ g_project_management_issue_added_to_epic
+ g_project_management_issue_changed_epic
+ g_project_management_issue_health_status_changed
+ g_project_management_issue_iteration_changed
+ g_project_management_issue_removed_from_epic
+ g_project_management_issue_weight_changed
+ g_geo_proxied_requests
+ g_project_management_users_creating_epic_boards
+ g_project_management_users_viewing_epic_boards
+ g_project_management_users_updating_epic_board_names
+ g_project_management_epic_created
+ project_management_users_unchecking_epic_task
+ project_management_users_checking_epic_task
+ g_project_management_users_updating_epic_titles
+ g_project_management_users_updating_epic_descriptions
+ g_project_management_users_creating_epic_notes
+ g_project_management_users_updating_epic_notes
+ g_project_management_users_destroying_epic_notes
+ g_project_management_users_awarding_epic_emoji
+ g_project_management_users_removing_epic_emoji
+ g_project_management_users_setting_epic_start_date_as_fixed
+ g_project_management_users_updating_fixed_epic_start_date
+ g_project_management_users_setting_epic_start_date_as_inherited
+ g_project_management_users_setting_epic_due_date_as_fixed
+ g_project_management_users_updating_fixed_epic_due_date
+ g_project_management_users_setting_epic_due_date_as_inherited
+ g_project_management_epic_issue_added
+ g_project_management_epic_issue_removed
+ g_project_management_epic_issue_moved_from_project
+ g_project_management_users_updating_epic_parent
+ g_project_management_epic_closed
+ g_project_management_epic_reopened
+ g_project_management_issue_promoted_to_epic
+ g_project_management_users_setting_epic_confidential
+ g_project_management_users_setting_epic_visible
+ g_project_management_epic_users_changing_labels
+ g_project_management_epic_destroyed
+ g_project_management_epic_cross_referenced
+ g_project_management_users_epic_issue_added_from_epic
+ g_project_management_epic_related_added
+ g_project_management_epic_related_removed
+ g_project_management_epic_blocking_added
+ g_project_management_epic_blocking_removed
+ g_project_management_epic_blocked_added
+ g_project_management_epic_blocked_removed].freeze
+
def up
Gitlab::UsageDataCounters::HLLRedisCounter.known_events.each do |event|
- if event[:aggregation].to_sym == :daily
+ if DAILY_EVENTS.include?(event[:name].to_s)
migrate_daily_aggregated(event)
else
migrate_weekly_aggregated(event)
@@ -20,7 +109,7 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
private
def migrate_daily_aggregated(event)
- days_back = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH
+ days_back = 29.days
start_date = Date.today - days_back - 1.day
end_date = Date.today + 1.day
@@ -30,7 +119,7 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
end
def migrate_weekly_aggregated(event)
- weeks_back = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH
+ weeks_back = KEY_EXPIRY_LENGTH
start_date = (Date.today - weeks_back).beginning_of_week - 1.day
end_date = Date.today.end_of_week + 1.day
@@ -49,7 +138,7 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
temp_key = new_key + "_#{Time.current.to_i}"
ttl = redis.ttl(old_key)
- ttl = ttl > 0 ? ttl : Gitlab::UsageDataCounters::HLLRedisCounter.send(:expiry, event)
+ ttl = ttl > 0 ? ttl : KEY_EXPIRY_LENGTH
redis.multi do |multi|
multi.set(temp_key, hll_blob, ex: 1.day.to_i)
@@ -77,7 +166,7 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
end
def apply_time_aggregation(key, time, event)
- if event[:aggregation].to_sym == :daily
+ if DAILY_EVENTS.include?(event[:name].to_s)
year_day = time.strftime('%G-%j')
"#{year_day}-#{key}"
else
diff --git a/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
index 9c6213c60ee..8449acb33e1 100644
--- a/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
+++ b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-# rubocop: disable BackgroundMigration/MissingDictionaryFile
-
class RescheduleLinksAvoidingDuplication < Gitlab::Database::Migration[2.1]
MIGRATION = 'MigrateLinksForVulnerabilityFindings'
DELAY_INTERVAL = 2.minutes
@@ -13,20 +11,10 @@ class RescheduleLinksAvoidingDuplication < Gitlab::Database::Migration[2.1]
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
- delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
-
- queue_batched_background_migration(
- MIGRATION,
- :vulnerability_occurrences,
- :id,
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
+ # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
end
def down
- delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+ # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb
end
end
-# rubocop: enable BackgroundMigration/MissingDictionaryFile
diff --git a/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb b/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb
index cb29b47a64d..cf6736fb6c1 100644
--- a/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb
+++ b/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb
@@ -9,14 +9,14 @@ class SwapIssueUserMentionsNoteIdToBigintForGitlabDotCom2 < Gitlab::Database::Mi
def up
return unless should_run?
- return if columns_alredy_swapped?
+ return if columns_already_swapped?
swap
end
def down
return unless should_run?
- return unless columns_alredy_swapped?
+ return unless columns_already_swapped?
swap
@@ -83,7 +83,7 @@ class SwapIssueUserMentionsNoteIdToBigintForGitlabDotCom2 < Gitlab::Database::Mi
com_or_dev_or_test_but_not_jh?
end
- def columns_alredy_swapped?
+ def columns_already_swapped?
table_columns = columns(TABLE_NAME)
note_id = table_columns.find { |c| c.name == 'note_id' }
note_id_convert_to_bigint = table_columns.find { |c| c.name == 'note_id_convert_to_bigint' }
diff --git a/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb b/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb
index d5bdd33a952..3c27c48a7f3 100644
--- a/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb
+++ b/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb
@@ -9,9 +9,7 @@ class RemoveApplicationSettingsClickhouseConnectionString < Gitlab::Database::Mi
def down
unless column_exists?(:application_settings, :clickhouse_connection_string)
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
add_column :application_settings, :clickhouse_connection_string, :text
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
add_text_limit :application_settings, :clickhouse_connection_string, 1024
diff --git a/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb b/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb
new file mode 100644
index 00000000000..2b21a25311f
--- /dev/null
+++ b/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class IndexSystemNoteMetadataOnIdForRelateAndUnrelateActions < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'tmp_index_for_backfilling_resource_link_events'
+ CONDITION = "action='relate_to_parent' OR action='unrelate_from_parent'"
+
+ disable_ddl_transaction!
+
+ def up
+ # Temporary index to be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/408797
+ add_concurrent_index :system_note_metadata, :id,
+ where: CONDITION,
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :system_note_metadata, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230426085615_queue_backfill_resource_link_events.rb b/db/post_migrate/20230426085615_queue_backfill_resource_link_events.rb
new file mode 100644
index 00000000000..fe4ea099d2e
--- /dev/null
+++ b/db/post_migrate/20230426085615_queue_backfill_resource_link_events.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+class QueueBackfillResourceLinkEvents < Gitlab::Database::Migration[2.1]
+ MIGRATION = "BackfillResourceLinkEvents"
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 5000
+ SUB_BATCH_SIZE = 10
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ class SystemNoteMetadata < MigrationRecord
+ self.table_name = 'system_note_metadata'
+
+ def self.batch_start_id
+ SystemNoteMetadata
+ .select(:id)
+ .where("action='relate_to_parent' OR action='unrelate_from_parent'")
+ .order(id: :asc)
+ .limit(1)
+ .first&.id
+ end
+ end
+
+ def up
+ batch_min_value = SystemNoteMetadata.batch_start_id
+
+ return unless batch_min_value
+
+ queue_batched_background_migration(
+ MIGRATION,
+ :system_note_metadata,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE,
+ batch_min_value: batch_min_value
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :system_note_metadata, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb b/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb
index 8949e37dcc3..3eb5fc13a2a 100644
--- a/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb
+++ b/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsCertManagers < Gitlab::Database::Migration[2.1]
# Based on init migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L680-L689
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table "clusters_applications_cert_managers", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
@@ -23,5 +22,4 @@ class DropClustersApplicationsCertManagers < Gitlab::Database::Migration[2.1]
t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230502102833_add_index_to_members_on_source_and_type_and_access_level.rb b/db/post_migrate/20230502102833_add_index_to_members_on_source_and_type_and_access_level.rb
new file mode 100644
index 00000000000..29960856299
--- /dev/null
+++ b/db/post_migrate/20230502102833_add_index_to_members_on_source_and_type_and_access_level.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexToMembersOnSourceAndTypeAndAccessLevel < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_members_on_source_and_type_and_access_level'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :members, %i[source_id source_type type access_level], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :members, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230502120022_add_index_to_project_authorizations_on_project_user_access_level.rb b/db/post_migrate/20230502120022_add_index_to_project_authorizations_on_project_user_access_level.rb
new file mode 100644
index 00000000000..3f8561b2be7
--- /dev/null
+++ b/db/post_migrate/20230502120022_add_index_to_project_authorizations_on_project_user_access_level.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexToProjectAuthorizationsOnProjectUserAccessLevel < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_project_authorizations_on_project_user_access_level'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :project_authorizations, %i[project_id user_id access_level], name: INDEX_NAME, unique: true
+ end
+
+ def down
+ remove_concurrent_index_by_name :project_authorizations, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb
index 8d80bae0a52..2c7b7d89bf5 100644
--- a/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb
+++ b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsCilium < Gitlab::Database::Migration[2.1]
# Based on original migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20200615234047_create_clusters_applications_cilium.rb
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table :clusters_applications_cilium do |t|
t.references :cluster, null: false, index: { unique: true }
@@ -19,5 +18,4 @@ class DropClustersApplicationsCilium < Gitlab::Database::Migration[2.1]
t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb b/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb
index c35cfc8fd96..1eeb7770c82 100644
--- a/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb
+++ b/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsCrossplane < Gitlab::Database::Migration[2.1]
# Based on original migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/8b1637296b286a5c46e0d8fdf6da42a43a7c9986/db/migrate/20191017191341_create_clusters_applications_crossplane.rb
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table :clusters_applications_crossplane, id: :integer do |t|
t.timestamps_with_timezone null: false
@@ -22,5 +21,4 @@ class DropClustersApplicationsCrossplane < Gitlab::Database::Migration[2.1]
t.index :cluster_id, unique: true
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb b/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb
index 21df851229c..c435b356e01 100644
--- a/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb
+++ b/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsHelm < Gitlab::Database::Migration[2.1]
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L691-L702
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
# rubocop:disable Migration/Datetime
def down
create_table "clusters_applications_helm", id: :serial, force: :cascade do |t|
@@ -26,6 +25,5 @@ class DropClustersApplicationsHelm < Gitlab::Database::Migration[2.1]
t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
# rubocop:enable Migration/Datetime
end
diff --git a/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb
index a349346f91b..3ccc536cb7e 100644
--- a/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb
+++ b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsIngress < Gitlab::Database::Migration[2.1]
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L704-L715
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
# rubocop:disable Migration/Datetime
def down
create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t|
@@ -27,6 +26,5 @@ class DropClustersApplicationsIngress < Gitlab::Database::Migration[2.1]
t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
# rubocop:enable Migration/Datetime
end
diff --git a/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb b/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb
index 3c2a0cc3ee8..bd98aa6d19c 100644
--- a/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb
+++ b/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsJupyter < Gitlab::Database::Migration[2.1]
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L717-L728
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table "clusters_applications_jupyter", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
@@ -25,5 +24,4 @@ class DropClustersApplicationsJupyter < Gitlab::Database::Migration[2.1]
t.index ["oauth_application_id"], name: "index_clusters_applications_jupyter_on_oauth_application_id"
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb b/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb
index c94b9bba64b..e8473b74408 100644
--- a/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb
+++ b/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsKnative < Gitlab::Database::Migration[2.1]
# Based on init migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L730-L740
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table "clusters_applications_knative", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
@@ -25,5 +24,4 @@ class DropClustersApplicationsKnative < Gitlab::Database::Migration[2.1]
t.index ["cluster_id"], name: "index_clusters_applications_knative_on_cluster_id", unique: true
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb
index 6391c1ee5ae..b62452f2052 100644
--- a/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb
+++ b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsPrometheus < Gitlab::Database::Migration[2.1]
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L742-L750
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table "clusters_applications_prometheus", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
@@ -26,5 +25,4 @@ class DropClustersApplicationsPrometheus < Gitlab::Database::Migration[2.1]
t.boolean "healthy"
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb b/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb
index 813cb23f56a..a4ab75dbce5 100644
--- a/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb
+++ b/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb
@@ -10,7 +10,6 @@ class DropClustersApplicationsRunners < Gitlab::Database::Migration[2.1]
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L752-L763
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table "clusters_applications_runners", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
@@ -25,5 +24,4 @@ class DropClustersApplicationsRunners < Gitlab::Database::Migration[2.1]
t.index ["runner_id"], name: "index_clusters_applications_runners_on_runner_id"
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb b/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb
index 94d3a2faf3b..003f2d91b54 100644
--- a/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb
+++ b/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb
@@ -10,7 +10,6 @@ class DropServerlessDomainCluster < Gitlab::Database::Migration[2.1]
# Based on original migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/5f7bd5b1455d87e2f1a2d1ae2c1147d51e97aa55/db/migrate/20191127030005_create_serverless_domain_cluster.rb
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table :serverless_domain_cluster, id: false, primary_key: :uuid do |t|
t.string :uuid, null: false, limit: 14, primary_key: true
@@ -29,5 +28,4 @@ class DropServerlessDomainCluster < Gitlab::Database::Migration[2.1]
t.index :creator_id, name: 'index_serverless_domain_cluster_on_creator_id'
end
end
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
diff --git a/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb b/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb
index 9644a555756..d26fabb316b 100644
--- a/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb
+++ b/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb
@@ -1,27 +1,10 @@
# frozen_string_literal: true
class BackfillCorrectedSecureFilesExpirations < Gitlab::Database::Migration[2.1]
- disable_ddl_transaction!
- restrict_gitlab_migration gitlab_schema: :gitlab_ci
-
- BATCH_SIZE = 1000
-
- def up
- each_batch_range('ci_secure_files', of: BATCH_SIZE) do |min, max|
- sql = <<-SQL
- SELECT id
- FROM ci_secure_files
- WHERE name ILIKE any (array['%.cer', '%.p12'])
- AND ci_secure_files.id BETWEEN #{min} AND #{max}
- SQL
-
- rows = execute(sql)
-
- rows.each do |row|
- ::Ci::ParseSecureFileMetadataWorker.perform_async(row["id"])
- end
- end
- end
+ # The contents of this migration have been removed but the structure has been
+ # left in place because this could be promlematic for some customers, but it has
+ # already been run in gitlab.com staging and production environments
+ def up; end
def down; end
end
diff --git a/db/post_migrate/20230510013754_cleanup_notes_bigint_preparation.rb b/db/post_migrate/20230510013754_cleanup_notes_bigint_preparation.rb
new file mode 100644
index 00000000000..b2b898059b8
--- /dev/null
+++ b/db/post_migrate/20230510013754_cleanup_notes_bigint_preparation.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+class CleanupNotesBigintPreparation < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ remove_concurrent_index_by_name(
+ :merge_request_user_mentions,
+ :index_merge_request_user_mentions_note_id_convert_to_bigint,
+ if_exists: true
+ )
+
+ remove_concurrent_index_by_name(
+ :issue_user_mentions,
+ :index_issue_user_mentions_on_note_id_convert_to_bigint,
+ if_exists: true
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ :issue_user_mentions,
+ :notes,
+ name: :fk_issue_user_mentions_note_id_convert_to_bigint,
+ reverse_lock_order: true
+ )
+ end
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ :merge_request_user_mentions,
+ :notes,
+ name: :fk_merge_request_user_mentions_note_id_convert_to_bigint,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ def down
+ # No-op
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb b/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb
index a7dd1bda9db..859bdb8c3e4 100644
--- a/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb
+++ b/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb
@@ -1,23 +1,15 @@
# frozen_string_literal: true
class QueueCleanupPersonalAccessTokensWithNilExpiresAt < Gitlab::Database::Migration[2.1]
- MIGRATION = "CleanupPersonalAccessTokensWithNilExpiresAt"
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 50_000
-
- restrict_gitlab_migration gitlab_schema: :gitlab_main
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :personal_access_tokens,
- :id,
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, [])
- end
+ # per: https://docs.gitlab.com/ee/development/database/batched_background_migrations.html#requeuing-batched-background-migrations
+ # > When you requeue the batched background migration, turn the original queuing
+ # > into a no-op by clearing up the #up and #down methods of the migration
+ # > performing the requeuing. Otherwise, the batched background migration is
+ # > queued multiple times on systems that are upgrading multiple patch releases
+ # > at once.
+ #
+ # being re-run via https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123002
+ def up; end
+
+ def down; end
end
diff --git a/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb b/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb
index fa4fab5b8df..84b69f7bc86 100644
--- a/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb
+++ b/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb
@@ -8,8 +8,6 @@ class RemoveCiTriggersRefColumn < Gitlab::Database::Migration[2.1]
end
def down
- # rubocop:disable Migration/SchemaAdditionMethodsNoPost
add_column :ci_triggers, :ref, :string, if_not_exists: true
- # rubocop:enable Migration/SchemaAdditionMethodsNoPost
end
end
diff --git a/db/post_migrate/20230510152153_remove_mr_state_id_temp_index_with_right_column.rb b/db/post_migrate/20230510152153_remove_mr_state_id_temp_index_with_right_column.rb
new file mode 100644
index 00000000000..57b21bcf4ed
--- /dev/null
+++ b/db/post_migrate/20230510152153_remove_mr_state_id_temp_index_with_right_column.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveMrStateIdTempIndexWithRightColumn < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'merge_requests_state_id_temp_index'
+
+ # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/408766
+
+ def up
+ prepare_async_index_removal :merge_requests, :id, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :merge_requests, :id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230511132140_create_component_id_index.rb b/db/post_migrate/20230511132140_create_component_id_index.rb
new file mode 100644
index 00000000000..3b466010f7c
--- /dev/null
+++ b/db/post_migrate/20230511132140_create_component_id_index.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CreateComponentIdIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_sbom_occurrences_on_project_id_component_id'
+
+ def up
+ return if index_exists_by_name?(:sbom_occurrences, INDEX_NAME)
+
+ add_concurrent_index :sbom_occurrences, [:project_id, :component_id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :sbom_sources, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230512104238_add_audit_events_group_index.rb b/db/post_migrate/20230512104238_add_audit_events_group_index.rb
new file mode 100644
index 00000000000..d1d7e5f26fc
--- /dev/null
+++ b/db/post_migrate/20230512104238_add_audit_events_group_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddAuditEventsGroupIndex < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :audit_events
+ COLUMN_NAMES = [:entity_id, :entity_type, :created_at, :id]
+ INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type_and_created_at'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_index(TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230512143000_remove_dependency_list_exports_project_id_not_null_constraint.rb b/db/post_migrate/20230512143000_remove_dependency_list_exports_project_id_not_null_constraint.rb
new file mode 100644
index 00000000000..d7077e9dfdd
--- /dev/null
+++ b/db/post_migrate/20230512143000_remove_dependency_list_exports_project_id_not_null_constraint.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class RemoveDependencyListExportsProjectIdNotNullConstraint < Gitlab::Database::Migration[2.1]
+ def up
+ change_column_null :dependency_list_exports, :project_id, true
+ end
+
+ def down
+ # no-op as there can be null values after the migration
+ end
+end
diff --git a/db/post_migrate/20230515101208_index_group_id_on_dependency_list_exports.rb b/db/post_migrate/20230515101208_index_group_id_on_dependency_list_exports.rb
new file mode 100644
index 00000000000..6019074b1f7
--- /dev/null
+++ b/db/post_migrate/20230515101208_index_group_id_on_dependency_list_exports.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class IndexGroupIdOnDependencyListExports < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_dependency_list_exports_on_group_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :dependency_list_exports, :group_id, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :dependency_list_exports, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230515102353_add_foreign_key_to_group_id_on_dependency_list_exports.rb b/db/post_migrate/20230515102353_add_foreign_key_to_group_id_on_dependency_list_exports.rb
new file mode 100644
index 00000000000..2780c551b2d
--- /dev/null
+++ b/db/post_migrate/20230515102353_add_foreign_key_to_group_id_on_dependency_list_exports.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToGroupIdOnDependencyListExports < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :dependency_list_exports,
+ :namespaces,
+ column: :group_id,
+ on_delete: :cascade,
+ reverse_lock_order: true
+ end
+
+ def down
+ remove_foreign_key_if_exists :dependency_list_exports, column: :group_id
+ end
+end
diff --git a/db/post_migrate/20230515142300_add_unique_index_for_ml_model_packages.rb b/db/post_migrate/20230515142300_add_unique_index_for_ml_model_packages.rb
new file mode 100644
index 00000000000..a776c227032
--- /dev/null
+++ b/db/post_migrate/20230515142300_add_unique_index_for_ml_model_packages.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddUniqueIndexForMlModelPackages < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'uniq_idx_packages_packages_on_project_id_name_version_ml_model'
+ PACKAGE_TYPE_ML_MODEL = 14
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :packages_packages, [:project_id, :name, :version],
+ unique: true,
+ where: "package_type = #{PACKAGE_TYPE_ML_MODEL}",
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name(:packages_packages, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230515153600_finalize_back_fill_prepared_at_merge_requests.rb b/db/post_migrate/20230515153600_finalize_back_fill_prepared_at_merge_requests.rb
new file mode 100644
index 00000000000..6c0e4e722d2
--- /dev/null
+++ b/db/post_migrate/20230515153600_finalize_back_fill_prepared_at_merge_requests.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+# See https://docs.gitlab.com/ee/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class FinalizeBackFillPreparedAtMergeRequests < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'BackfillPreparedAtMergeRequests'
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :merge_requests,
+ column_name: :id,
+ job_arguments: []
+ )
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/post_migrate/20230516032545_add_unique_notes_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230516032545_add_unique_notes_id_convert_to_bigint_for_gitlab_com.rb
new file mode 100644
index 00000000000..330bf23434d
--- /dev/null
+++ b/db/post_migrate/20230516032545_add_unique_notes_id_convert_to_bigint_for_gitlab_com.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+class AddUniqueNotesIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = :notes
+ INDEX_NAME = :index_notes_on_id_convert_to_bigint
+
+ def up
+ return unless should_run?
+
+ # This was created async for GitLab.com with
+ # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119913
+ # and will replace the existing PK index when we swap the integer and bigint columns in
+ # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119705
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint,
+ unique: true,
+ name: INDEX_NAME
+ end
+
+ def down
+ return unless should_run?
+
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230516033729_add_referencing_bigint_fks_for_notes_on_gitlab_com.rb b/db/post_migrate/20230516033729_add_referencing_bigint_fks_for_notes_on_gitlab_com.rb
new file mode 100644
index 00000000000..0cc77d43625
--- /dev/null
+++ b/db/post_migrate/20230516033729_add_referencing_bigint_fks_for_notes_on_gitlab_com.rb
@@ -0,0 +1,74 @@
+# frozen_string_literal: true
+
+class AddReferencingBigintFksForNotesOnGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ REFERENCING_FOREIGN_KEYS = [
+ [:todos, :fk_91d1f47b13, :note_id, :cascade],
+ [:incident_management_timeline_events, :fk_d606a2a890, :promoted_from_note_id, :nullify],
+ [:system_note_metadata, :fk_d83a918cb1, :note_id, :cascade],
+ [:diff_note_positions, :fk_rails_13c7212859, :note_id, :cascade],
+ [:epic_user_mentions, :fk_rails_1c65976a49, :note_id, :cascade],
+ [:suggestions, :fk_rails_33b03a535c, :note_id, :cascade],
+ [:issue_user_mentions, :fk_rails_3861d9fefa, :note_id, :cascade],
+ [:note_diff_files, :fk_rails_3d66047aeb, :diff_note_id, :cascade],
+ [:snippet_user_mentions, :fk_rails_4d3f96b2cb, :note_id, :cascade],
+ [:design_user_mentions, :fk_rails_8de8c6d632, :note_id, :cascade],
+ [:vulnerability_user_mentions, :fk_rails_a18600f210, :note_id, :cascade],
+ [:commit_user_mentions, :fk_rails_a6760813e0, :note_id, :cascade],
+ [:merge_request_user_mentions, :fk_rails_c440b9ea31, :note_id, :cascade],
+ [:note_metadata, :fk_rails_d853224d37, :note_id, :cascade],
+ [:alert_management_alert_user_mentions, :fk_rails_eb2de0cdef, :note_id, :cascade],
+ [:timelogs, :fk_timelogs_note_id, :note_id, :nullify]
+ ]
+
+ def up
+ return unless should_run?
+
+ REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, on_delete)|
+ temporary_name = "#{name}_tmp"
+
+ # This will replace the existing FKs when
+ # we swap the integer and bigint columns in
+ # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119705
+ add_concurrent_foreign_key(
+ from_table,
+ :notes,
+ column: column,
+ target_column: :id_convert_to_bigint,
+ name: temporary_name,
+ on_delete: on_delete,
+ reverse_lock_order: true,
+ validate: false)
+
+ prepare_async_foreign_key_validation from_table, column, name: temporary_name
+ end
+ end
+
+ def down
+ return unless should_run?
+
+ REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, _)|
+ temporary_name = "#{name}_tmp"
+
+ unprepare_async_foreign_key_validation from_table, column, name: temporary_name
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ from_table,
+ :notes,
+ name: temporary_name,
+ reverse_lock_order: true
+ )
+ end
+ end
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230516123202_create_routing_table_for_ci_builds.rb b/db/post_migrate/20230516123202_create_routing_table_for_ci_builds.rb
new file mode 100644
index 00000000000..b95c1307b1b
--- /dev/null
+++ b/db/post_migrate/20230516123202_create_routing_table_for_ci_builds.rb
@@ -0,0 +1,93 @@
+# frozen_string_literal: true
+
+class CreateRoutingTableForCiBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_builds
+ PARENT_TABLE_NAME = :p_ci_builds
+ FIRST_PARTITION = 100
+ PARTITION_COLUMN = :partition_id
+ FOREIGN_KEYS = {
+ p_ci_builds_metadata: :fk_e20479742e_p,
+ p_ci_runner_machine_builds: :fk_bb490f12fe_p
+ }
+
+ def up
+ return if connection.table_exists?(PARENT_TABLE_NAME) && partition_attached?
+
+ convert_table_to_first_list_partition(
+ table_name: TABLE_NAME,
+ partitioning_column: PARTITION_COLUMN,
+ parent_table_name: PARENT_TABLE_NAME,
+ initial_partitioning_value: FIRST_PARTITION,
+ lock_tables: %w[ci_pipelines ci_stages ci_builds ci_resource_groups]
+ )
+ end
+
+ def down
+ # rubocop:disable Migration/WithLockRetriesDisallowedMethod
+ with_lock_retries(raise_on_exhaustion: true) do
+ drop_foreign_keys
+
+ execute(<<~SQL)
+ ALTER TABLE #{PARENT_TABLE_NAME} DETACH PARTITION #{TABLE_NAME};
+ ALTER SEQUENCE ci_builds_id_seq OWNED BY #{TABLE_NAME}.id;
+ SQL
+
+ drop_table PARENT_TABLE_NAME
+ recreate_partition_foreign_keys
+ end
+ # rubocop:enable Migration/WithLockRetriesDisallowedMethod
+
+ finalize_foreign_keys_creation
+
+ prepare_constraint_for_list_partitioning(
+ table_name: TABLE_NAME,
+ partitioning_column: PARTITION_COLUMN,
+ parent_table_name: PARENT_TABLE_NAME,
+ initial_partitioning_value: FIRST_PARTITION
+ )
+ end
+
+ private
+
+ def partition_attached?
+ connection.select_value(<<~SQL)
+ SELECT true FROM postgres_partitions WHERE name = '#{TABLE_NAME}';
+ SQL
+ end
+
+ def drop_foreign_keys
+ FOREIGN_KEYS.each do |source, name|
+ remove_foreign_key_if_exists source, name: name
+ end
+ end
+
+ def recreate_partition_foreign_keys
+ FOREIGN_KEYS.each do |source, name|
+ Gitlab::Database::PostgresPartitionedTable.each_partition(source) do |partition|
+ execute(<<~SQL)
+ ALTER TABLE #{partition.identifier}
+ ADD CONSTRAINT #{name} FOREIGN KEY (partition_id, build_id)
+ REFERENCES #{TABLE_NAME}(partition_id, id)
+ ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+ SQL
+ end
+ end
+ end
+
+ def finalize_foreign_keys_creation
+ FOREIGN_KEYS.each do |source, name|
+ add_concurrent_partitioned_foreign_key(source, TABLE_NAME,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: name
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb b/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb
new file mode 100644
index 00000000000..45f00e8292d
--- /dev/null
+++ b/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class PrepareIssuesWorkItemTypeIdProjectIdIndex < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_issues_on_work_item_type_id_project_id_created_at_state'
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121297
+ def up
+ prepare_async_index :issues, [:work_item_type_id, :project_id, :created_at, :state_id], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :issues, [:work_item_type_id, :project_id, :created_at, :state_id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb b/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb
new file mode 100644
index 00000000000..2ae226bd85f
--- /dev/null
+++ b/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIssuesWorkItemTypeIdProjectIdIndex < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_issues_on_work_item_type_id_project_id_created_at_state'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :issues, [:work_item_type_id, :project_id, :created_at, :state_id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :issues, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb b/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb
new file mode 100644
index 00000000000..55b46369870
--- /dev/null
+++ b/db/post_migrate/20230517001535_prepare_async_index_for_ci_pipeline_variables_bigint_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class PrepareAsyncIndexForCiPipelineVariablesBigintId < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_pipeline_variables
+ INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint"
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/408936
+ def up
+ prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230517005523_ensure_backfill_bigint_id_is_completed.rb b/db/post_migrate/20230517005523_ensure_backfill_bigint_id_is_completed.rb
new file mode 100644
index 00000000000..850ac7bcf5d
--- /dev/null
+++ b/db/post_migrate/20230517005523_ensure_backfill_bigint_id_is_completed.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class EnsureBackfillBigintIdIsCompleted < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_pipeline_variables
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
+ table_name: TABLE_NAME,
+ column_name: 'id',
+ job_arguments: [['id'], ['id_convert_to_bigint']]
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb b/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb
new file mode 100644
index 00000000000..6732e33d0a4
--- /dev/null
+++ b/db/post_migrate/20230517163300_queue_backfill_root_storage_statistics_fork_storage_sizes.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class QueueBackfillRootStorageStatisticsForkStorageSizes < Gitlab::Database::Migration[2.1]
+ MIGRATION = "BackfillRootStorageStatisticsForkStorageSizes"
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 1000
+ SUB_BATCH_SIZE = 100
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :namespace_root_storage_statistics,
+ :namespace_id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :namespace_root_storage_statistics, :namespace_id, [])
+ end
+end
diff --git a/db/post_migrate/20230518005523_add_concurrent_index_for_ci_pipeline_variables_bigint_id.rb b/db/post_migrate/20230518005523_add_concurrent_index_for_ci_pipeline_variables_bigint_id.rb
new file mode 100644
index 00000000000..19c48f7bf11
--- /dev/null
+++ b/db/post_migrate/20230518005523_add_concurrent_index_for_ci_pipeline_variables_bigint_id.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddConcurrentIndexForCiPipelineVariablesBigintId < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_pipeline_variables
+ INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint"
+
+ def up
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230518071251_queue_backfill_code_suggestions_namespace_settings.rb b/db/post_migrate/20230518071251_queue_backfill_code_suggestions_namespace_settings.rb
new file mode 100644
index 00000000000..bae143ddbb1
--- /dev/null
+++ b/db/post_migrate/20230518071251_queue_backfill_code_suggestions_namespace_settings.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class QueueBackfillCodeSuggestionsNamespaceSettings < Gitlab::Database::Migration[2.1]
+ MIGRATION = "BackfillCodeSuggestionsNamespaceSettings"
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 50_000
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :namespace_settings,
+ :namespace_id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :namespace_settings, :namespace_id, [])
+ end
+end
diff --git a/db/post_migrate/20230518121320_remove_time_format_in_24h_column.rb b/db/post_migrate/20230518121320_remove_time_format_in_24h_column.rb
new file mode 100644
index 00000000000..489c2446fe2
--- /dev/null
+++ b/db/post_migrate/20230518121320_remove_time_format_in_24h_column.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class RemoveTimeFormatIn24hColumn < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ remove_column :user_preferences, :time_format_in_24h
+ end
+
+ def down
+ add_column :user_preferences, :time_format_in_24h, :boolean
+ end
+end
diff --git a/db/post_migrate/20230519011151_schedule_to_remove_invalid_deploy_access_level_groups.rb b/db/post_migrate/20230519011151_schedule_to_remove_invalid_deploy_access_level_groups.rb
new file mode 100644
index 00000000000..c3bd64634ce
--- /dev/null
+++ b/db/post_migrate/20230519011151_schedule_to_remove_invalid_deploy_access_level_groups.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ScheduleToRemoveInvalidDeployAccessLevelGroups < Gitlab::Database::Migration[2.1]
+ MIGRATION = "RemoveInvalidDeployAccessLevelGroups"
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 1000
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :protected_environment_deploy_access_levels,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :protected_environment_deploy_access_levels, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230519023720_swap_ci_pipeline_variables_pk_with_bigint.rb b/db/post_migrate/20230519023720_swap_ci_pipeline_variables_pk_with_bigint.rb
new file mode 100644
index 00000000000..6c088cd12a9
--- /dev/null
+++ b/db/post_migrate/20230519023720_swap_ci_pipeline_variables_pk_with_bigint.rb
@@ -0,0 +1,75 @@
+# frozen_string_literal: true
+
+class SwapCiPipelineVariablesPkWithBigint < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+ disable_ddl_transaction!
+
+ TABLE_NAME = 'ci_pipeline_variables'
+
+ def up
+ swap
+ end
+
+ def down
+ swap(stepping_down: true)
+ end
+
+ private
+
+ def swap(stepping_down: false)
+ # Prepare the names we need below
+ primary_key_constraint_name = "#{TABLE_NAME}_pkey"
+ sequence_name = "#{TABLE_NAME}_id_seq"
+ bigint_primary_key_index_name = "index_#{TABLE_NAME}_on_id_convert_to_bigint"
+ temp_name = quote_column_name(:id_tmp)
+ id_name = quote_column_name(:id)
+ id_convert_to_bigint_name = quote_column_name(:id_convert_to_bigint)
+ function_name = quote_table_name(
+ Gitlab::Database::UnidirectionalCopyTrigger.on_table(
+ TABLE_NAME, connection: Ci::ApplicationRecord.connection
+ ).name(:id, :id_convert_to_bigint)
+ )
+
+ # 2. Create indexes using the bigint columns that match the existing indexes using the integer column
+ # NOTE: this index is already created in:
+ # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120946
+ # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120950
+ # Therefore, this won't have any effect for `up` step, but will be used for `down` step.
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: bigint_primary_key_index_name
+
+ # 4. Inside a transaction, swap the columns
+ # When stepping up, it will swap the bigint column as the primary key and the int column as `bigint`
+ # When stepping down, it will swap the int column as the primary key and the bigint column as `bigint`
+ with_lock_retries(raise_on_exhaustion: true) do
+ # a. Lock the tables involved.
+ execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
+
+ # b. Rename the columns to swap names
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_name} TO #{temp_name}"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_convert_to_bigint_name} TO #{id_name}"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{id_convert_to_bigint_name}"
+
+ # c. Reset the trigger function
+ execute "ALTER FUNCTION #{function_name} RESET ALL"
+
+ # d. Swap the defaults
+ execute "ALTER SEQUENCE #{sequence_name} OWNED BY #{TABLE_NAME}.id"
+ change_column_default TABLE_NAME, :id, -> { "nextval('#{sequence_name}'::regclass)" }
+ change_column_default TABLE_NAME, :id_convert_to_bigint, 0
+
+ # e. Swap the PK constraint
+ execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT #{primary_key_constraint_name} CASCADE"
+ rename_index TABLE_NAME, bigint_primary_key_index_name, primary_key_constraint_name
+ execute <<~SQL
+ ALTER TABLE #{TABLE_NAME}
+ ADD CONSTRAINT #{primary_key_constraint_name} PRIMARY KEY
+ USING INDEX #{primary_key_constraint_name}
+ SQL
+ end
+
+ return unless stepping_down
+
+ # For stepping down, we will need to recreate the index after the swap
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: bigint_primary_key_index_name
+ end
+end
diff --git a/db/post_migrate/20230521521419_drop_merge_request_state_id_temp_index.rb b/db/post_migrate/20230521521419_drop_merge_request_state_id_temp_index.rb
new file mode 100644
index 00000000000..3411b374d7e
--- /dev/null
+++ b/db/post_migrate/20230521521419_drop_merge_request_state_id_temp_index.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class DropMergeRequestStateIdTempIndex < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'merge_requests_state_id_temp_index'
+ INDEX_CONDITION = "state_id IN (2, 3)"
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index(:merge_requests, :id, where: INDEX_CONDITION, name: INDEX_NAME)
+ end
+
+ def down
+ add_concurrent_index(:merge_requests, :id, where: INDEX_CONDITION, name: INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230522073230_add_not_null_constraint_to_personal_access_tokens_expires_at.rb b/db/post_migrate/20230522073230_add_not_null_constraint_to_personal_access_tokens_expires_at.rb
new file mode 100644
index 00000000000..74dddb68d3b
--- /dev/null
+++ b/db/post_migrate/20230522073230_add_not_null_constraint_to_personal_access_tokens_expires_at.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddNotNullConstraintToPersonalAccessTokensExpiresAt < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_not_null_constraint :personal_access_tokens, :expires_at, validate: false
+ end
+
+ def down
+ remove_not_null_constraint :personal_access_tokens, :expires_at
+ end
+end
diff --git a/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb b/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb
new file mode 100644
index 00000000000..d351d795ddf
--- /dev/null
+++ b/db/post_migrate/20230522111534_reschedule_migration_for_links_from_metadata.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+# rubocop: disable BackgroundMigration/MissingDictionaryFile
+
+class RescheduleMigrationForLinksFromMetadata < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateLinksForVulnerabilityFindings'
+ DELAY_INTERVAL = 2.minutes
+ SUB_BATCH_SIZE = 500
+ BATCH_SIZE = 4000
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+
+ queue_batched_background_migration(
+ MIGRATION,
+ :vulnerability_occurrences,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, [])
+ end
+end
+# rubocop: enable BackgroundMigration/MissingDictionaryFile
diff --git a/db/post_migrate/20230522220709_ensure_incident_work_item_type_backfill_is_finished.rb b/db/post_migrate/20230522220709_ensure_incident_work_item_type_backfill_is_finished.rb
new file mode 100644
index 00000000000..a93f5417dd0
--- /dev/null
+++ b/db/post_migrate/20230522220709_ensure_incident_work_item_type_backfill_is_finished.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class EnsureIncidentWorkItemTypeBackfillIsFinished < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'BackfillWorkItemTypeIdForIssues'
+ INCIDENT_ENUM_TYPE = 1
+
+ class MigrationWorkItemType < MigrationRecord
+ self.table_name = 'work_item_types'
+ end
+
+ def up
+ incident_work_item_type = MigrationWorkItemType.find_by(namespace_id: nil, base_type: INCIDENT_ENUM_TYPE)
+
+ if incident_work_item_type.blank?
+ say(
+ 'Incident work item type not found. Make sure the work_item_types table is populated' \
+ 'before running this migration'
+ )
+ return
+ end
+
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :issues,
+ column_name: :id,
+ job_arguments: [INCIDENT_ENUM_TYPE, incident_work_item_type.id]
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230522225610_remove_tmp_index_issues_on_issue_type_and_id_only_incidents.rb b/db/post_migrate/20230522225610_remove_tmp_index_issues_on_issue_type_and_id_only_incidents.rb
new file mode 100644
index 00000000000..f6cbff24755
--- /dev/null
+++ b/db/post_migrate/20230522225610_remove_tmp_index_issues_on_issue_type_and_id_only_incidents.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveTmpIndexIssuesOnIssueTypeAndIdOnlyIncidents < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id_only_incidents'
+ INCIDENT_ENUM_VALUE = 1
+
+ def up
+ remove_concurrent_index_by_name :issues, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :issues, [:issue_type, :id], name: INDEX_NAME, where: "issue_type = #{INCIDENT_ENUM_VALUE}"
+ end
+end
diff --git a/db/post_migrate/20230523125245_remove_project_ci_cd_setting_opt_in_jwt_column.rb b/db/post_migrate/20230523125245_remove_project_ci_cd_setting_opt_in_jwt_column.rb
new file mode 100644
index 00000000000..2826077d6f0
--- /dev/null
+++ b/db/post_migrate/20230523125245_remove_project_ci_cd_setting_opt_in_jwt_column.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class RemoveProjectCiCdSettingOptInJwtColumn < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ remove_column(:project_ci_cd_settings, :opt_in_jwt)
+ end
+
+ def down
+ add_column(:project_ci_cd_settings, :opt_in_jwt, :boolean, default: false, null: false, if_not_exists: true)
+ end
+end
diff --git a/db/post_migrate/20230523131914_recreate_index_on_vulnerability_reads.rb b/db/post_migrate/20230523131914_recreate_index_on_vulnerability_reads.rb
new file mode 100644
index 00000000000..13f30b5ef6e
--- /dev/null
+++ b/db/post_migrate/20230523131914_recreate_index_on_vulnerability_reads.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+class RecreateIndexOnVulnerabilityReads < Gitlab::Database::Migration[2.1]
+ OLD_INDEX_NAME = "index_vulnerability_reads_common_finder_query"
+ NEW_INDEX_NAME = "index_vulnerability_reads_common_finder_query_2"
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(
+ :vulnerability_reads,
+ %i[project_id state report_type severity vulnerability_id dismissal_reason],
+ name: NEW_INDEX_NAME,
+ order: { vulnerability_id: :desc }
+ )
+ remove_concurrent_index_by_name(
+ :vulnerability_reads,
+ OLD_INDEX_NAME
+ )
+ end
+
+ def down
+ add_concurrent_index(
+ :vulnerability_reads,
+ %i[project_id state report_type severity vulnerability_id],
+ name: OLD_INDEX_NAME,
+ order: { vulnerability_id: :desc }
+ )
+ remove_concurrent_index_by_name(
+ :vulnerability_reads,
+ NEW_INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230523132647_recreate_index_on_vulnerability_reads2.rb b/db/post_migrate/20230523132647_recreate_index_on_vulnerability_reads2.rb
new file mode 100644
index 00000000000..0624ad22cf2
--- /dev/null
+++ b/db/post_migrate/20230523132647_recreate_index_on_vulnerability_reads2.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+class RecreateIndexOnVulnerabilityReads2 < Gitlab::Database::Migration[2.1]
+ OLD_INDEX_NAME = "index_vulnerability_reads_common_finder_query_with_namespace_id"
+ NEW_INDEX_NAME = "index_vulnerability_reads_common_finder_query_w_namespace_id"
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(
+ :vulnerability_reads,
+ %i[namespace_id state report_type severity vulnerability_id dismissal_reason],
+ name: NEW_INDEX_NAME,
+ order: { vulnerability_id: :desc }
+ )
+ remove_concurrent_index_by_name(
+ :vulnerability_reads,
+ OLD_INDEX_NAME
+ )
+ end
+
+ def down
+ add_concurrent_index(
+ :vulnerability_reads,
+ %i[namespace_id state report_type severity vulnerability_id],
+ name: OLD_INDEX_NAME,
+ order: { vulnerability_id: :desc }
+ )
+ remove_concurrent_index_by_name(
+ :vulnerability_reads,
+ NEW_INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230523210653_remove_file_md5_from_debian_project_component_files.rb b/db/post_migrate/20230523210653_remove_file_md5_from_debian_project_component_files.rb
new file mode 100644
index 00000000000..9ffba2da108
--- /dev/null
+++ b/db/post_migrate/20230523210653_remove_file_md5_from_debian_project_component_files.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class RemoveFileMd5FromDebianProjectComponentFiles < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ remove_column :packages_debian_project_component_files, :file_md5, :bytea
+ end
+end
diff --git a/db/post_migrate/20230523210758_remove_file_md5_from_debian_group_component_files.rb b/db/post_migrate/20230523210758_remove_file_md5_from_debian_group_component_files.rb
new file mode 100644
index 00000000000..fb9e6da9850
--- /dev/null
+++ b/db/post_migrate/20230523210758_remove_file_md5_from_debian_group_component_files.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class RemoveFileMd5FromDebianGroupComponentFiles < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ remove_column :packages_debian_group_component_files, :file_md5, :bytea
+ end
+end
diff --git a/db/post_migrate/20230524093249_add_async_index_to_vsa_issues.rb b/db/post_migrate/20230524093249_add_async_index_to_vsa_issues.rb
new file mode 100644
index 00000000000..b11dcae4b84
--- /dev/null
+++ b/db/post_migrate/20230524093249_add_async_index_to_vsa_issues.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+class AddAsyncIndexToVsaIssues < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :analytics_cycle_analytics_issue_stage_events
+ COLUMN_NAMES = %I[stage_event_hash_id group_id end_event_timestamp issue_id]
+ INDEX_NAME = 'index_issue_stage_events_for_consistency_check'
+
+ disable_ddl_transaction!
+
+ def up
+ # The table is hash partitioned
+ each_partition(TABLE_NAME) do |partition, partition_index_name|
+ prepare_async_index(
+ partition.identifier,
+ COLUMN_NAMES,
+ name: partition_index_name
+ )
+ end
+ end
+
+ def down
+ each_partition(TABLE_NAME) do |partition, partition_index_name|
+ unprepare_async_index_by_name(partition.identifier, partition_index_name)
+ end
+ end
+
+ private
+
+ def each_partition(table_name)
+ partitioned_table = find_partitioned_table(table_name)
+ partitioned_table.postgres_partitions.order(:name).each do |partition|
+ partition_index_name = generated_index_name(partition.identifier, INDEX_NAME)
+
+ yield partition, partition_index_name
+ end
+ end
+end
diff --git a/db/post_migrate/20230524093355_add_async_index_to_vsa_mrs.rb b/db/post_migrate/20230524093355_add_async_index_to_vsa_mrs.rb
new file mode 100644
index 00000000000..4104493cb36
--- /dev/null
+++ b/db/post_migrate/20230524093355_add_async_index_to_vsa_mrs.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+class AddAsyncIndexToVsaMrs < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :analytics_cycle_analytics_merge_request_stage_events
+ COLUMN_NAMES = %I[stage_event_hash_id group_id end_event_timestamp merge_request_id]
+ INDEX_NAME = 'index_mr_stage_events_for_consistency_check'
+
+ disable_ddl_transaction!
+
+ def up
+ # The table is hash partitioned
+ each_partition(TABLE_NAME) do |partition, partition_index_name|
+ prepare_async_index(
+ partition.identifier,
+ COLUMN_NAMES,
+ name: partition_index_name
+ )
+ end
+ end
+
+ def down
+ each_partition(TABLE_NAME) do |partition, partition_index_name|
+ unprepare_async_index_by_name(partition.identifier, partition_index_name)
+ end
+ end
+
+ private
+
+ def each_partition(table_name)
+ partitioned_table = find_partitioned_table(table_name)
+ partitioned_table.postgres_partitions.order(:name).each do |partition|
+ partition_index_name = generated_index_name(partition.identifier, INDEX_NAME)
+
+ yield partition, partition_index_name
+ end
+ end
+end
diff --git a/db/post_migrate/20230524120241_add_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb b/db/post_migrate/20230524120241_add_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb
new file mode 100644
index 00000000000..58a3a26d2eb
--- /dev/null
+++ b/db/post_migrate/20230524120241_add_temp_index_to_packages_on_project_id_when_npm_and_not_pending_destruction.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddTempIndexToPackagesOnProjectIdWhenNpmAndNotPendingDestruction < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'tmp_idx_packages_on_project_id_when_npm_not_pending_destruction'
+ NPM_PACKAGE_TYPE = 2
+ PENDING_DESTRUCTION_STATUS = 4
+
+ def up
+ # Temporary index to be removed in 16.2 https://gitlab.com/gitlab-org/gitlab/-/issues/414216
+ add_concurrent_index(
+ :packages_packages,
+ :project_id,
+ name: INDEX_NAME,
+ where: "package_type = #{NPM_PACKAGE_TYPE} AND status <> #{PENDING_DESTRUCTION_STATUS}"
+ )
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_packages, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230524135543_replace_ci_build_pending_states_foreign_key.rb b/db/post_migrate/20230524135543_replace_ci_build_pending_states_foreign_key.rb
new file mode 100644
index 00000000000..deceb923a48
--- /dev/null
+++ b/db/post_migrate/20230524135543_replace_ci_build_pending_states_foreign_key.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildPendingStatesForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_build_pending_states, :p_ci_builds,
+ name: 'temp_fk_861cd17da3_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_build_pending_states, name: 'temp_fk_861cd17da3_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_build_pending_states, name: 'temp_fk_861cd17da3_p'
+ remove_foreign_key :ci_build_pending_states, name: 'temp_fk_861cd17da3_p'
+ end
+end
diff --git a/db/post_migrate/20230524135555_replace_ci_build_trace_chunks_foreign_key.rb b/db/post_migrate/20230524135555_replace_ci_build_trace_chunks_foreign_key.rb
new file mode 100644
index 00000000000..d5e4dddd0fc
--- /dev/null
+++ b/db/post_migrate/20230524135555_replace_ci_build_trace_chunks_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildTraceChunksForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_build_trace_chunks, :p_ci_builds,
+ name: 'temp_fk_89e29fa5ee_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_build_trace_chunks,
+ name: 'temp_fk_89e29fa5ee_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_build_trace_chunks, name: 'temp_fk_89e29fa5ee_p'
+ remove_foreign_key :ci_build_trace_chunks, name: 'temp_fk_89e29fa5ee_p'
+ end
+end
diff --git a/db/post_migrate/20230524135607_replace_ci_unit_test_failures_foreign_key.rb b/db/post_migrate/20230524135607_replace_ci_unit_test_failures_foreign_key.rb
new file mode 100644
index 00000000000..5319118b9ef
--- /dev/null
+++ b/db/post_migrate/20230524135607_replace_ci_unit_test_failures_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiUnitTestFailuresForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_unit_test_failures, :p_ci_builds,
+ name: 'temp_fk_9e0fc58930_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_unit_test_failures,
+ name: 'temp_fk_9e0fc58930_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_unit_test_failures, name: 'temp_fk_9e0fc58930_p'
+ remove_foreign_key :ci_unit_test_failures, name: 'temp_fk_9e0fc58930_p'
+ end
+end
diff --git a/db/post_migrate/20230524135620_replace_ci_sources_pipelines_foreign_key.rb b/db/post_migrate/20230524135620_replace_ci_sources_pipelines_foreign_key.rb
new file mode 100644
index 00000000000..b0251de7f00
--- /dev/null
+++ b/db/post_migrate/20230524135620_replace_ci_sources_pipelines_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiSourcesPipelinesForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_sources_pipelines, :p_ci_builds,
+ name: 'temp_fk_be5624bf37_p',
+ column: [:source_partition_id, :source_job_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_sources_pipelines,
+ name: 'temp_fk_be5624bf37_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_sources_pipelines, name: 'temp_fk_be5624bf37_p'
+ remove_foreign_key :ci_sources_pipelines, name: 'temp_fk_be5624bf37_p'
+ end
+end
diff --git a/db/post_migrate/20230524135632_replace_ci_resources_foreign_key.rb b/db/post_migrate/20230524135632_replace_ci_resources_foreign_key.rb
new file mode 100644
index 00000000000..adf99e73fdb
--- /dev/null
+++ b/db/post_migrate/20230524135632_replace_ci_resources_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiResourcesForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_resources, :p_ci_builds,
+ name: 'temp_fk_e169a8e3d5_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :nullify,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_resources,
+ name: 'temp_fk_e169a8e3d5_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_resources, name: 'temp_fk_e169a8e3d5_p'
+ remove_foreign_key :ci_resources, name: 'temp_fk_e169a8e3d5_p'
+ end
+end
diff --git a/db/post_migrate/20230524135645_replace_ci_build_report_results_foreign_key.rb b/db/post_migrate/20230524135645_replace_ci_build_report_results_foreign_key.rb
new file mode 100644
index 00000000000..9e54d1e2885
--- /dev/null
+++ b/db/post_migrate/20230524135645_replace_ci_build_report_results_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildReportResultsForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_build_report_results, :p_ci_builds,
+ name: 'temp_fk_rails_16cb1ff064_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_build_report_results,
+ name: 'temp_fk_rails_16cb1ff064_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_build_report_results, name: 'temp_fk_rails_16cb1ff064_p'
+ remove_foreign_key :ci_build_report_results, name: 'temp_fk_rails_16cb1ff064_p'
+ end
+end
diff --git a/db/post_migrate/20230524135658_replace_ci_build_needs_foreign_key.rb b/db/post_migrate/20230524135658_replace_ci_build_needs_foreign_key.rb
new file mode 100644
index 00000000000..a41bd6d78bf
--- /dev/null
+++ b/db/post_migrate/20230524135658_replace_ci_build_needs_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildNeedsForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_build_needs, :p_ci_builds,
+ name: 'temp_fk_rails_3cf221d4ed_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_build_needs,
+ name: 'temp_fk_rails_3cf221d4ed_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_build_needs, name: 'temp_fk_rails_3cf221d4ed_p'
+ remove_foreign_key :ci_build_needs, name: 'temp_fk_rails_3cf221d4ed_p'
+ end
+end
diff --git a/db/post_migrate/20230524135711_replace_ci_builds_runner_session_foreign_key.rb b/db/post_migrate/20230524135711_replace_ci_builds_runner_session_foreign_key.rb
new file mode 100644
index 00000000000..9ae6a84d28c
--- /dev/null
+++ b/db/post_migrate/20230524135711_replace_ci_builds_runner_session_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildsRunnerSessionForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_builds_runner_session, :p_ci_builds,
+ name: 'temp_fk_rails_70707857d3_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_builds_runner_session,
+ name: 'temp_fk_rails_70707857d3_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_builds_runner_session, name: 'temp_fk_rails_70707857d3_p'
+ remove_foreign_key :ci_builds_runner_session, name: 'temp_fk_rails_70707857d3_p'
+ end
+end
diff --git a/db/post_migrate/20230524135724_replace_ci_pending_builds_foreign_key.rb b/db/post_migrate/20230524135724_replace_ci_pending_builds_foreign_key.rb
new file mode 100644
index 00000000000..6717ea27237
--- /dev/null
+++ b/db/post_migrate/20230524135724_replace_ci_pending_builds_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiPendingBuildsForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_pending_builds, :p_ci_builds,
+ name: 'temp_fk_rails_725a2644a3_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_pending_builds,
+ name: 'temp_fk_rails_725a2644a3_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_pending_builds, name: 'temp_fk_rails_725a2644a3_p'
+ remove_foreign_key :ci_pending_builds, name: 'temp_fk_rails_725a2644a3_p'
+ end
+end
diff --git a/db/post_migrate/20230524135737_replace_ci_build_trace_metadata_foreign_key.rb b/db/post_migrate/20230524135737_replace_ci_build_trace_metadata_foreign_key.rb
new file mode 100644
index 00000000000..abf5700ec98
--- /dev/null
+++ b/db/post_migrate/20230524135737_replace_ci_build_trace_metadata_foreign_key.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ReplaceCiBuildTraceMetadataForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :ci_build_trace_metadata, :p_ci_builds,
+ name: 'temp_fk_rails_aebc78111f_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_build_trace_metadata,
+ name: 'temp_fk_rails_aebc78111f_p'
+ end
+
+ def down
+ unprepare_async_foreign_key_validation :ci_build_trace_metadata, name: 'temp_fk_rails_aebc78111f_p'
+ remove_foreign_key :ci_build_trace_metadata, name: 'temp_fk_rails_aebc78111f_p'
+ end
+end
diff --git a/db/post_migrate/20230524135750_replace_ci_job_artifacts_foreign_key.rb b/db/post_migrate/20230524135750_replace_ci_job_artifacts_foreign_key.rb
new file mode 100644
index 00000000000..48c07bceb6a
--- /dev/null
+++ b/db/post_migrate/20230524135750_replace_ci_job_artifacts_foreign_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ReplaceCiJobArtifactsForeignKey < Gitlab::Database::Migration[2.1]
+ def up
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+
+ def down
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+end
diff --git a/db/post_migrate/20230524135803_replace_ci_running_builds_foreign_key.rb b/db/post_migrate/20230524135803_replace_ci_running_builds_foreign_key.rb
new file mode 100644
index 00000000000..5d3807242ef
--- /dev/null
+++ b/db/post_migrate/20230524135803_replace_ci_running_builds_foreign_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ReplaceCiRunningBuildsForeignKey < Gitlab::Database::Migration[2.1]
+ def up
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+
+ def down
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+end
diff --git a/db/post_migrate/20230524135815_replace_ci_job_variables_foreign_key.rb b/db/post_migrate/20230524135815_replace_ci_job_variables_foreign_key.rb
new file mode 100644
index 00000000000..baac0d495a7
--- /dev/null
+++ b/db/post_migrate/20230524135815_replace_ci_job_variables_foreign_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ReplaceCiJobVariablesForeignKey < Gitlab::Database::Migration[2.1]
+ def up
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+
+ def down
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+end
diff --git a/db/post_migrate/20230524135828_replace_p_ci_builds_metadata_foreign_key.rb b/db/post_migrate/20230524135828_replace_p_ci_builds_metadata_foreign_key.rb
new file mode 100644
index 00000000000..c398b457978
--- /dev/null
+++ b/db/post_migrate/20230524135828_replace_p_ci_builds_metadata_foreign_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ReplacePCiBuildsMetadataForeignKey < Gitlab::Database::Migration[2.1]
+ def up
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+
+ def down
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+end
diff --git a/db/post_migrate/20230524135840_replace_p_ci_runner_machine_builds_foreign_key.rb b/db/post_migrate/20230524135840_replace_p_ci_runner_machine_builds_foreign_key.rb
new file mode 100644
index 00000000000..bc9d534ec1f
--- /dev/null
+++ b/db/post_migrate/20230524135840_replace_p_ci_runner_machine_builds_foreign_key.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ReplacePCiRunnerMachineBuildsForeignKey < Gitlab::Database::Migration[2.1]
+ def up
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+
+ def down
+ # This migration was skipped in the ci database on gitlab.com as part of
+ # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/14888
+ end
+end
diff --git a/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb b/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb
new file mode 100644
index 00000000000..d1c56af1721
--- /dev/null
+++ b/db/post_migrate/20230524150232_remove_index_user_details_on_user_id_for_enterprise_users_without_date.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveIndexUserDetailsOnUserIdForEnterpriseUsersWithoutDate < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_without_date'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :user_details, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :user_details, :user_id,
+ where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NULL',
+ name: INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb b/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb
new file mode 100644
index 00000000000..350c72ce20b
--- /dev/null
+++ b/db/post_migrate/20230524150438_remove_index_user_details_on_user_id_for_enterprise_users_with_date.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveIndexUserDetailsOnUserIdForEnterpriseUsersWithDate < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_with_date'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :user_details, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :user_details, :user_id,
+ where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NOT NULL',
+ name: INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230524201454_queue_mark_duplicate_npm_packages_for_destruction.rb b/db/post_migrate/20230524201454_queue_mark_duplicate_npm_packages_for_destruction.rb
new file mode 100644
index 00000000000..7460d93fd49
--- /dev/null
+++ b/db/post_migrate/20230524201454_queue_mark_duplicate_npm_packages_for_destruction.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class QueueMarkDuplicateNpmPackagesForDestruction < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MarkDuplicateNpmPackagesForDestruction'
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 5000
+ BATCH_CLASS_NAME = 'LooseIndexScanBatchingStrategy'
+ SUB_BATCH_SIZE = 500
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :packages_packages,
+ :project_id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ batch_class_name: BATCH_CLASS_NAME,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :packages_packages, :project_id, [])
+ end
+end
diff --git a/db/post_migrate/20230525180605_add_index_work_item_types_on_base_type_id.rb b/db/post_migrate/20230525180605_add_index_work_item_types_on_base_type_id.rb
new file mode 100644
index 00000000000..620153f2a7b
--- /dev/null
+++ b/db/post_migrate/20230525180605_add_index_work_item_types_on_base_type_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexWorkItemTypesOnBaseTypeId < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_work_item_types_on_base_type_and_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :work_item_types, [:base_type, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :work_item_types, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230529183648_remove_temporary_billable_index.rb b/db/post_migrate/20230529183648_remove_temporary_billable_index.rb
new file mode 100644
index 00000000000..88940aad968
--- /dev/null
+++ b/db/post_migrate/20230529183648_remove_temporary_billable_index.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveTemporaryBillableIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'migrate_index_users_for_active_billable_users'
+ def up
+ remove_concurrent_index_by_name :users, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :users, :id,
+ name: INDEX_NAME,
+ where: "((state)::text = 'active'::text) " \
+ "AND (user_type IS NULL OR user_type = 0 OR user_type = ANY (ARRAY[0, 6, 4, 13])) " \
+ "AND (user_type IS NULL OR user_type = 0 OR user_type = ANY (ARRAY[0, 4, 5]))"
+ end
+end
diff --git a/db/post_migrate/20230529185110_cleanup_temporary_activity_index.rb b/db/post_migrate/20230529185110_cleanup_temporary_activity_index.rb
new file mode 100644
index 00000000000..d3e75aa7975
--- /dev/null
+++ b/db/post_migrate/20230529185110_cleanup_temporary_activity_index.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CleanupTemporaryActivityIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'i_users_on_last_activity_for_active_human_service_migration'
+
+ def up
+ remove_concurrent_index_by_name :users, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :users, [:id, :last_activity_on],
+ name: INDEX_NAME,
+ where: "state = 'active' AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = 4))"
+ end
+end
diff --git a/db/post_migrate/20230530003634_cleanup_tofa_settings.rb b/db/post_migrate/20230530003634_cleanup_tofa_settings.rb
new file mode 100644
index 00000000000..0e580a52bfd
--- /dev/null
+++ b/db/post_migrate/20230530003634_cleanup_tofa_settings.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class CleanupTofaSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ cleanup_concurrent_column_rename :application_settings, :encrypted_tofa_credentials,
+ :encrypted_vertex_ai_credentials
+ cleanup_concurrent_column_rename :application_settings, :encrypted_tofa_credentials_iv,
+ :encrypted_vertex_ai_credentials_iv
+ cleanup_concurrent_column_rename :application_settings, :vertex_project,
+ :vertex_ai_project
+ end
+
+ def down
+ undo_cleanup_concurrent_column_rename :application_settings, :encrypted_tofa_credentials,
+ :encrypted_vertex_ai_credentials
+ undo_cleanup_concurrent_column_rename :application_settings, :encrypted_tofa_credentials_iv,
+ :encrypted_vertex_ai_credentials_iv
+ undo_cleanup_concurrent_column_rename :application_settings, :vertex_project,
+ :vertex_ai_project
+ end
+end
diff --git a/db/post_migrate/20230530015535_swap_notes_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230530015535_swap_notes_id_to_bigint_for_gitlab_dot_com.rb
new file mode 100644
index 00000000000..2dfeb80aba7
--- /dev/null
+++ b/db/post_migrate/20230530015535_swap_notes_id_to_bigint_for_gitlab_dot_com.rb
@@ -0,0 +1,195 @@
+# frozen_string_literal: true
+
+class SwapNotesIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = 'notes'
+ PK_INDEX_NAME = 'index_notes_on_id_convert_to_bigint'
+
+ SECONDARY_INDEXES = [
+ {
+ original_name: :index_notes_on_author_id_and_created_at_and_id,
+ temporary_name: :index_notes_on_author_id_created_at_id_convert_to_bigint,
+ columns: [:author_id, :created_at, :id_convert_to_bigint],
+ options: {}
+ },
+ {
+ original_name: :index_notes_on_id_where_confidential,
+ temporary_name: :index_notes_on_id_convert_to_bigint_where_confidential,
+ columns: [:id_convert_to_bigint],
+ options: { where: 'confidential = true' }
+ },
+ {
+ original_name: :index_notes_on_id_where_internal,
+ temporary_name: :index_notes_on_id_convert_to_bigint_where_internal,
+ columns: [:id_convert_to_bigint],
+ options: { where: 'internal = true' }
+ },
+ {
+ original_name: :index_notes_on_project_id_and_id_and_system_false,
+ temporary_name: :index_notes_on_project_id_id_convert_to_bigint_system_false,
+ columns: [:project_id, :id_convert_to_bigint],
+ options: { where: 'NOT system' }
+ },
+ {
+ original_name: :note_mentions_temp_index,
+ temporary_name: :note_mentions_temp_index_convert_to_bigint,
+ columns: [:id_convert_to_bigint, :noteable_type],
+ options: { where: "note ~~ '%@%'::text" }
+ }
+ ]
+
+ REFERENCING_FOREIGN_KEYS = [
+ [:todos, :fk_91d1f47b13, :note_id, :cascade],
+ [:incident_management_timeline_events, :fk_d606a2a890, :promoted_from_note_id, :nullify],
+ [:system_note_metadata, :fk_d83a918cb1, :note_id, :cascade],
+ [:diff_note_positions, :fk_rails_13c7212859, :note_id, :cascade],
+ [:epic_user_mentions, :fk_rails_1c65976a49, :note_id, :cascade],
+ [:suggestions, :fk_rails_33b03a535c, :note_id, :cascade],
+ [:issue_user_mentions, :fk_rails_3861d9fefa, :note_id, :cascade],
+ [:note_diff_files, :fk_rails_3d66047aeb, :diff_note_id, :cascade],
+ [:snippet_user_mentions, :fk_rails_4d3f96b2cb, :note_id, :cascade],
+ [:design_user_mentions, :fk_rails_8de8c6d632, :note_id, :cascade],
+ [:vulnerability_user_mentions, :fk_rails_a18600f210, :note_id, :cascade],
+ [:commit_user_mentions, :fk_rails_a6760813e0, :note_id, :cascade],
+ [:merge_request_user_mentions, :fk_rails_c440b9ea31, :note_id, :cascade],
+ [:note_metadata, :fk_rails_d853224d37, :note_id, :cascade],
+ [:alert_management_alert_user_mentions, :fk_rails_eb2de0cdef, :note_id, :cascade],
+ [:timelogs, :fk_timelogs_note_id, :note_id, :nullify]
+ ]
+
+ def up
+ return unless should_run?
+
+ swap
+ end
+
+ def down
+ return unless should_run?
+
+ swap
+
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME
+
+ REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, on_delete)|
+ temporary_name = "#{name}_tmp"
+
+ add_concurrent_foreign_key(
+ from_table,
+ TABLE_NAME,
+ column: column,
+ target_column: :id_convert_to_bigint,
+ name: temporary_name,
+ on_delete: on_delete,
+ reverse_lock_order: true,
+ validate: false)
+ end
+ end
+
+ def swap
+ # Copy existing indexes from the original column to the new column
+ create_indexes
+
+ # Copy existing FKs from the original column to the new column
+ create_referencing_foreign_keys
+
+ # Remove existing FKs from the referencing tables, so we don't have to lock on them when we drop the existing PK
+ replace_referencing_foreign_keys
+
+ with_lock_retries(raise_on_exhaustion: true) do
+ # Swap the original and new column names
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_convert_to_bigint TO id"
+ execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_tmp TO id_convert_to_bigint"
+
+ # Reset the function so PG drops the plan cache for the incorrect integer type
+ function_name = Gitlab::Database::UnidirectionalCopyTrigger
+ .on_table(TABLE_NAME, connection: connection)
+ .name(:id, :id_convert_to_bigint)
+ execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
+
+ # Swap defaults of the two columns, and change ownership of the sequence to the new id
+ execute "ALTER SEQUENCE notes_id_seq OWNED BY #{TABLE_NAME}.id"
+ change_column_default TABLE_NAME, :id, -> { "nextval('notes_id_seq'::regclass)" }
+ change_column_default TABLE_NAME, :id_convert_to_bigint, 0
+
+ # Swap the PK constraint from the original column to the new column.
+ # We deliberately don't CASCADE here because the old FKs should be removed already
+ execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT notes_pkey"
+ rename_index TABLE_NAME, PK_INDEX_NAME, 'notes_pkey'
+ execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT notes_pkey PRIMARY KEY USING INDEX notes_pkey"
+
+ # Remove old column indexes and change new column indexes to have the original names
+ rename_secondary_indexes # rubocop:disable Migration/WithLockRetriesDisallowedMethod
+ end
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+
+ def create_indexes
+ add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME
+
+ SECONDARY_INDEXES.each do |index_definition|
+ options = index_definition[:options]
+ options[:name] = index_definition[:temporary_name]
+
+ add_concurrent_index(TABLE_NAME, index_definition[:columns], options)
+ end
+ end
+
+ def rename_secondary_indexes
+ SECONDARY_INDEXES.each do |index_definition|
+ remove_index(TABLE_NAME, name: index_definition[:original_name], if_exists: true) # rubocop:disable Migration/RemoveIndex
+ rename_index(TABLE_NAME, index_definition[:temporary_name], index_definition[:original_name])
+ end
+ end
+
+ def create_referencing_foreign_keys
+ REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, on_delete)|
+ # Don't attempt to create the FK if one already exists from the table to the new column
+ # The check in `add_concurrent_foreign_key` already checks for this, but it looks for the foreign key
+ # with the new name only (containing the `_tmp` suffix).
+ #
+ # Since we might partially rename FKs and re-run the migration, we also have to check and see if a FK exists
+ # on those columns that might not match the `_tmp` name.
+ next if foreign_key_exists?(
+ from_table, TABLE_NAME, column: column,
+ primary_key: :id_convert_to_bigint, name: name)
+
+ temporary_name = "#{name}_tmp"
+
+ add_concurrent_foreign_key(
+ from_table,
+ TABLE_NAME,
+ column: column,
+ target_column: :id_convert_to_bigint,
+ name: temporary_name,
+ on_delete: on_delete,
+ reverse_lock_order: true)
+ end
+ end
+
+ def replace_referencing_foreign_keys
+ REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, _)|
+ # Don't attempt to replace the FK unless it exists and points at the original column.
+ # This could happen if the migration is re-run due to failing midway.
+ next unless foreign_key_exists?(from_table, TABLE_NAME, column: column, primary_key: :id, name: name)
+
+ with_lock_retries(raise_on_exhaustion: true) do
+ temporary_name = "#{name}_tmp"
+
+ # Explicitly lock table in order of parent, child to attempt to avoid deadlocks
+ execute "LOCK TABLE #{TABLE_NAME}, #{from_table} IN ACCESS EXCLUSIVE MODE"
+
+ remove_foreign_key(from_table, TABLE_NAME, column: column, primary_key: :id, name: name)
+ rename_constraint(from_table, temporary_name, name)
+ end
+ end
+ end
+end
diff --git a/db/post_migrate/20230530100400_change_user_type_null.rb b/db/post_migrate/20230530100400_change_user_type_null.rb
new file mode 100644
index 00000000000..a74e8c3a774
--- /dev/null
+++ b/db/post_migrate/20230530100400_change_user_type_null.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ChangeUserTypeNull < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_not_null_constraint :users, :user_type, validate: false
+ end
+
+ def down
+ remove_not_null_constraint :users, :user_type
+ end
+end
diff --git a/db/post_migrate/20230530114845_cleanup_organizations_with_null_path.rb b/db/post_migrate/20230530114845_cleanup_organizations_with_null_path.rb
new file mode 100644
index 00000000000..6d04bf6e4ec
--- /dev/null
+++ b/db/post_migrate/20230530114845_cleanup_organizations_with_null_path.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CleanupOrganizationsWithNullPath < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ module Organizations
+ class Organization < Gitlab::Database::Migration[2.1]::MigrationRecord
+ end
+ end
+
+ def up
+ Organizations::Organization.update_all("path = lower(name)")
+ end
+
+ def down
+ Organizations::Organization.update_all(path: '')
+ end
+end
diff --git a/db/post_migrate/20230530115830_remove_default_on_organization_path.rb b/db/post_migrate/20230530115830_remove_default_on_organization_path.rb
new file mode 100644
index 00000000000..82c71d5fef3
--- /dev/null
+++ b/db/post_migrate/20230530115830_remove_default_on_organization_path.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class RemoveDefaultOnOrganizationPath < Gitlab::Database::Migration[2.1]
+ def up
+ change_column_default :organizations, :path, nil
+ end
+
+ def down
+ change_column_default :organizations, :path, ''
+ end
+end
diff --git a/db/post_migrate/20230530140456_validate_fk_ci_build_pending_states_p_ci_builds.rb b/db/post_migrate/20230530140456_validate_fk_ci_build_pending_states_p_ci_builds.rb
new file mode 100644
index 00000000000..6104731152d
--- /dev/null
+++ b/db/post_migrate/20230530140456_validate_fk_ci_build_pending_states_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildPendingStatesPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_build_pending_states, nil, name: :temp_fk_861cd17da3_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140509_validate_fk_ci_build_trace_chunks_p_ci_builds.rb b/db/post_migrate/20230530140509_validate_fk_ci_build_trace_chunks_p_ci_builds.rb
new file mode 100644
index 00000000000..40cef0428cf
--- /dev/null
+++ b/db/post_migrate/20230530140509_validate_fk_ci_build_trace_chunks_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildTraceChunksPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_build_trace_chunks, nil, name: :temp_fk_89e29fa5ee_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140521_validate_fk_ci_unit_test_failures_p_ci_builds.rb b/db/post_migrate/20230530140521_validate_fk_ci_unit_test_failures_p_ci_builds.rb
new file mode 100644
index 00000000000..948d9a837a5
--- /dev/null
+++ b/db/post_migrate/20230530140521_validate_fk_ci_unit_test_failures_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiUnitTestFailuresPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_unit_test_failures, nil, name: :temp_fk_9e0fc58930_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140534_validate_fk_ci_sources_pipelines_p_ci_builds.rb b/db/post_migrate/20230530140534_validate_fk_ci_sources_pipelines_p_ci_builds.rb
new file mode 100644
index 00000000000..7e92026f21f
--- /dev/null
+++ b/db/post_migrate/20230530140534_validate_fk_ci_sources_pipelines_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiSourcesPipelinesPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_sources_pipelines, nil, name: :temp_fk_be5624bf37_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140546_validate_fk_ci_resources_p_ci_builds.rb b/db/post_migrate/20230530140546_validate_fk_ci_resources_p_ci_builds.rb
new file mode 100644
index 00000000000..7cb58aed2ed
--- /dev/null
+++ b/db/post_migrate/20230530140546_validate_fk_ci_resources_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiResourcesPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_resources, nil, name: :temp_fk_e169a8e3d5_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140558_validate_fk_ci_build_report_results_p_ci_builds.rb b/db/post_migrate/20230530140558_validate_fk_ci_build_report_results_p_ci_builds.rb
new file mode 100644
index 00000000000..f5188ab6bfe
--- /dev/null
+++ b/db/post_migrate/20230530140558_validate_fk_ci_build_report_results_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildReportResultsPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_build_report_results, nil, name: :temp_fk_rails_16cb1ff064_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140611_validate_fk_ci_build_needs_p_ci_builds.rb b/db/post_migrate/20230530140611_validate_fk_ci_build_needs_p_ci_builds.rb
new file mode 100644
index 00000000000..6988e1027e5
--- /dev/null
+++ b/db/post_migrate/20230530140611_validate_fk_ci_build_needs_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildNeedsPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_build_needs, nil, name: :temp_fk_rails_3cf221d4ed_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140623_validate_fk_ci_builds_runner_session_p_ci_builds.rb b/db/post_migrate/20230530140623_validate_fk_ci_builds_runner_session_p_ci_builds.rb
new file mode 100644
index 00000000000..892df3ae00b
--- /dev/null
+++ b/db/post_migrate/20230530140623_validate_fk_ci_builds_runner_session_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildsRunnerSessionPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_builds_runner_session, nil, name: :temp_fk_rails_70707857d3_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140634_validate_fk_ci_pending_builds_p_ci_builds.rb b/db/post_migrate/20230530140634_validate_fk_ci_pending_builds_p_ci_builds.rb
new file mode 100644
index 00000000000..8f6113aea31
--- /dev/null
+++ b/db/post_migrate/20230530140634_validate_fk_ci_pending_builds_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiPendingBuildsPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_pending_builds, nil, name: :temp_fk_rails_725a2644a3_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230530140646_validate_fk_ci_build_trace_metadata_p_ci_builds.rb b/db/post_migrate/20230530140646_validate_fk_ci_build_trace_metadata_p_ci_builds.rb
new file mode 100644
index 00000000000..00c015321ba
--- /dev/null
+++ b/db/post_migrate/20230530140646_validate_fk_ci_build_trace_metadata_p_ci_builds.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ValidateFkCiBuildTraceMetadataPCiBuilds < Gitlab::Database::Migration[2.1]
+ def up
+ validate_foreign_key :ci_build_trace_metadata, nil, name: :temp_fk_rails_aebc78111f_p
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb b/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb
new file mode 100644
index 00000000000..d200aecea65
--- /dev/null
+++ b/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DropIndexIssuesOnWorkItemTypeId < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_issues_on_work_item_type_id'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :issues, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :issues, :work_item_type_id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230601184234_drop_unnecessary_async_index_from_events.rb b/db/post_migrate/20230601184234_drop_unnecessary_async_index_from_events.rb
new file mode 100644
index 00000000000..f3ce879c70e
--- /dev/null
+++ b/db/post_migrate/20230601184234_drop_unnecessary_async_index_from_events.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class DropUnnecessaryAsyncIndexFromEvents < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_on_events_to_improve_contribution_analytics_performance'
+
+ def up
+ prepare_async_index_removal :events, %i[project_id target_type action created_at author_id id], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :events, %i[project_id target_type action created_at author_id id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb b/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb
new file mode 100644
index 00000000000..144b16e4806
--- /dev/null
+++ b/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveBroadcastMessagesNamespaceIdColumn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_broadcast_messages_on_namespace_id'
+
+ def up
+ remove_column :broadcast_messages, :namespace_id
+ end
+
+ def down
+ add_column :broadcast_messages, :namespace_id, :bigint unless column_exists?(:broadcast_messages, :namespace_id)
+
+ add_concurrent_index :broadcast_messages, :namespace_id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230602112904_change_user_preferences_defaults.rb b/db/post_migrate/20230602112904_change_user_preferences_defaults.rb
new file mode 100644
index 00000000000..98d93979039
--- /dev/null
+++ b/db/post_migrate/20230602112904_change_user_preferences_defaults.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ChangeUserPreferencesDefaults < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ change_column_default(:user_preferences, :tab_width, from: nil, to: 8)
+ change_column_default(:user_preferences, :time_display_relative, from: nil, to: true)
+ change_column_default(:user_preferences, :render_whitespace_in_code, from: nil, to: false)
+ end
+end
diff --git a/db/post_migrate/20230602131429_change_notified_of_own_activity_default.rb b/db/post_migrate/20230602131429_change_notified_of_own_activity_default.rb
new file mode 100644
index 00000000000..d564ad9ab4c
--- /dev/null
+++ b/db/post_migrate/20230602131429_change_notified_of_own_activity_default.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class ChangeNotifiedOfOwnActivityDefault < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ change_column_default(:users, :notified_of_own_activity, from: nil, to: false)
+ end
+end
diff --git a/db/post_migrate/20230605085936_add_new_index_to_vsa_issue_stage_events.rb b/db/post_migrate/20230605085936_add_new_index_to_vsa_issue_stage_events.rb
new file mode 100644
index 00000000000..75f28f35fe2
--- /dev/null
+++ b/db/post_migrate/20230605085936_add_new_index_to_vsa_issue_stage_events.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddNewIndexToVsaIssueStageEvents < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :analytics_cycle_analytics_issue_stage_events
+ COLUMN_NAMES = %I[stage_event_hash_id group_id end_event_timestamp issue_id].freeze
+ INDEX_NAME = 'index_issue_stage_events_for_consistency_check'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_index TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name TABLE_NAME, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230605085957_add_new_index_to_vsa_mr_stage_events.rb b/db/post_migrate/20230605085957_add_new_index_to_vsa_mr_stage_events.rb
new file mode 100644
index 00000000000..b4ed38519c5
--- /dev/null
+++ b/db/post_migrate/20230605085957_add_new_index_to_vsa_mr_stage_events.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddNewIndexToVsaMrStageEvents < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ TABLE_NAME = :analytics_cycle_analytics_merge_request_stage_events
+ COLUMN_NAMES = %I[stage_event_hash_id group_id end_event_timestamp merge_request_id]
+ INDEX_NAME = 'index_mr_stage_events_for_consistency_check'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_index TABLE_NAME, COLUMN_NAMES, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name TABLE_NAME, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230605093005_add_index_for_sbom_occurrences_on_project_id_source_id.rb b/db/post_migrate/20230605093005_add_index_for_sbom_occurrences_on_project_id_source_id.rb
new file mode 100644
index 00000000000..868cf276354
--- /dev/null
+++ b/db/post_migrate/20230605093005_add_index_for_sbom_occurrences_on_project_id_source_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexForSbomOccurrencesOnProjectIdSourceId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'idx_sbom_occurrences_on_project_id_and_source_id'
+
+ def up
+ add_concurrent_index :sbom_occurrences, [:project_id, :source_id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :sbom_occurrences, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb b/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb
new file mode 100644
index 00000000000..c74df0a5cdd
--- /dev/null
+++ b/db/post_migrate/20230605192000_drop_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb
@@ -0,0 +1,18 @@
+# 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 DropTmpIndexOauthAccessTokensOnIdWhereExpiresInNull < Gitlab::Database::Migration[2.1]
+ TMP_INDEX = 'tmp_index_oauth_access_tokens_on_id_where_expires_in_null'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :oauth_access_tokens, TMP_INDEX
+ end
+
+ def down
+ add_concurrent_index :oauth_access_tokens, :id, where: "expires_in IS NULL", name: TMP_INDEX
+ end
+end
diff --git a/db/post_migrate/20230606183327_add_index_user_details_on_enterprise_group_id.rb b/db/post_migrate/20230606183327_add_index_user_details_on_enterprise_group_id.rb
new file mode 100644
index 00000000000..d3b53867b4f
--- /dev/null
+++ b/db/post_migrate/20230606183327_add_index_user_details_on_enterprise_group_id.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddIndexUserDetailsOnEnterpriseGroupId < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_user_details_on_enterprise_group_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :user_details, :enterprise_group_id, name: INDEX_NAME
+
+ add_concurrent_foreign_key :user_details, :namespaces, column: :enterprise_group_id, on_delete: :nullify
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :user_details, column: :enterprise_group_id
+ end
+
+ remove_concurrent_index_by_name :user_details, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb b/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb
new file mode 100644
index 00000000000..3038193e949
--- /dev/null
+++ b/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CreateIndexAlertManagementAlertsOnCreatedAtProjectIdWithIssue < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'idx_alert_management_alerts_on_created_at_project_id_with_issue'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :alert_management_alerts, [:created_at, :project_id],
+ where: 'issue_id IS NOT NULL',
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :alert_management_alerts, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230607093222_remove_webauthn_registrations_u2f_registration_id_column.rb b/db/post_migrate/20230607093222_remove_webauthn_registrations_u2f_registration_id_column.rb
new file mode 100644
index 00000000000..6e861fc258a
--- /dev/null
+++ b/db/post_migrate/20230607093222_remove_webauthn_registrations_u2f_registration_id_column.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveWebauthnRegistrationsU2fRegistrationIdColumn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_webauthn_registrations_on_u2f_registration_id'
+
+ def up
+ remove_column :webauthn_registrations, :u2f_registration_id
+ end
+
+ def down
+ add_column :webauthn_registrations, :u2f_registration_id, :integer
+
+ add_concurrent_index(
+ :webauthn_registrations,
+ :u2f_registration_id,
+ name: INDEX_NAME,
+ where: 'u2f_registration_id IS NOT NULL')
+ end
+end
diff --git a/db/post_migrate/20230607165632_remove_fk_on_project_id_on_project_wiki_repository_states.rb b/db/post_migrate/20230607165632_remove_fk_on_project_id_on_project_wiki_repository_states.rb
new file mode 100644
index 00000000000..a70cc3aeab6
--- /dev/null
+++ b/db/post_migrate/20230607165632_remove_fk_on_project_id_on_project_wiki_repository_states.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class RemoveFkOnProjectIdOnProjectWikiRepositoryStates < Gitlab::Database::Migration[2.1]
+ SOURCE_TABLE_NAME = :project_wiki_repository_states
+ TARGET_TABLE_NAME = :projects
+ FK_NAME = :fk_rails_9647227ce1
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, TARGET_TABLE_NAME, name: FK_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(SOURCE_TABLE_NAME, TARGET_TABLE_NAME,
+ column: :project_id, name: FK_NAME, on_delete: :cascade)
+ end
+end
diff --git a/db/post_migrate/20230607165718_drop_project_wiki_repository_states.rb b/db/post_migrate/20230607165718_drop_project_wiki_repository_states.rb
new file mode 100644
index 00000000000..3ae92ca2dc1
--- /dev/null
+++ b/db/post_migrate/20230607165718_drop_project_wiki_repository_states.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+class DropProjectWikiRepositoryStates < Gitlab::Database::Migration[2.1]
+ VERIFICATION_STATE_INDEX_NAME = "index_project_wiki_repository_states_on_verification_state"
+ PENDING_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_pending_verification"
+ FAILED_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_failed_verification"
+ NEEDS_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_needs_verification"
+ PROJECT_WIKI_REPOSITORY_INDEX_NAME = "idx_project_wiki_repository_states_project_wiki_repository_id"
+
+ disable_ddl_transaction!
+
+ def up
+ drop_table :project_wiki_repository_states, if_exists: true
+ end
+
+ def down
+ unless table_exists?(:project_wiki_repository_states)
+ create_table :project_wiki_repository_states, id: false do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ t.datetime_with_timezone :verification_started_at
+ t.datetime_with_timezone :verification_retry_at
+ t.datetime_with_timezone :verified_at
+ t.bigint :project_id, primary_key: true, index: false
+ t.integer :verification_state, default: 0, limit: 2, null: false
+ t.integer :verification_retry_count, limit: 2
+ t.binary :verification_checksum, using: 'verification_checksum::bytea'
+ t.text :verification_failure, limit: 255
+ t.bigint :project_wiki_repository_id
+
+ t.index :verification_state,
+ name: VERIFICATION_STATE_INDEX_NAME
+
+ t.index :verified_at,
+ where: "(verification_state = 0)",
+ order: { verified_at: 'ASC NULLS FIRST' },
+ name: PENDING_VERIFICATION_INDEX_NAME
+
+ t.index :verification_retry_at,
+ where: "(verification_state = 3)",
+ order: { verification_retry_at: 'ASC NULLS FIRST' },
+ name: FAILED_VERIFICATION_INDEX_NAME
+
+ t.index :verification_state,
+ where: "(verification_state = 0 OR verification_state = 3)",
+ name: NEEDS_VERIFICATION_INDEX_NAME
+ end
+ end
+
+ add_concurrent_index :project_wiki_repository_states,
+ :project_wiki_repository_id,
+ name: PROJECT_WIKI_REPOSITORY_INDEX_NAME
+
+ add_concurrent_foreign_key :project_wiki_repository_states,
+ :project_wiki_repositories,
+ column: :project_wiki_repository_id,
+ on_delete: :cascade
+ end
+end
diff --git a/db/post_migrate/20230608071301_requeue_cleanup_personal_access_tokens_with_nil_expires_at.rb b/db/post_migrate/20230608071301_requeue_cleanup_personal_access_tokens_with_nil_expires_at.rb
new file mode 100644
index 00000000000..ec8cacc34ab
--- /dev/null
+++ b/db/post_migrate/20230608071301_requeue_cleanup_personal_access_tokens_with_nil_expires_at.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class RequeueCleanupPersonalAccessTokensWithNilExpiresAt < Gitlab::Database::Migration[2.1]
+ MIGRATION = "CleanupPersonalAccessTokensWithNilExpiresAt"
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 50_000
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, [])
+
+ queue_batched_background_migration(
+ MIGRATION,
+ :personal_access_tokens,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230608081257_delete_index_members_on_source_id_and_source_type.rb b/db/post_migrate/20230608081257_delete_index_members_on_source_id_and_source_type.rb
new file mode 100644
index 00000000000..5018d361841
--- /dev/null
+++ b/db/post_migrate/20230608081257_delete_index_members_on_source_id_and_source_type.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DeleteIndexMembersOnSourceIdAndSourceType < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_members_on_source_id_and_source_type'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :members, name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :members, %i[source_id source_type], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230608081924_delete_index_unique_project_authorizations_on_project_id_user_id.rb b/db/post_migrate/20230608081924_delete_index_unique_project_authorizations_on_project_id_user_id.rb
new file mode 100644
index 00000000000..722f58b836a
--- /dev/null
+++ b/db/post_migrate/20230608081924_delete_index_unique_project_authorizations_on_project_id_user_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DeleteIndexUniqueProjectAuthorizationsOnProjectIdUserId < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_unique_project_authorizations_on_project_id_user_id'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :project_authorizations, name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :project_authorizations, %i[project_id user_id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230608101503_add_ci_job_annotations_foreign_key.rb b/db/post_migrate/20230608101503_add_ci_job_annotations_foreign_key.rb
new file mode 100644
index 00000000000..b4548ed8c28
--- /dev/null
+++ b/db/post_migrate/20230608101503_add_ci_job_annotations_foreign_key.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class AddCiJobAnnotationsForeignKey < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_foreign_key(
+ :p_ci_job_annotations, :p_ci_builds,
+ column: [:partition_id, :job_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ reverse_lock_order: true
+ )
+ end
+
+ def down
+ remove_foreign_key_if_exists :p_ci_job_annotations, :p_ci_builds
+ end
+end
diff --git a/db/post_migrate/20230608231452_cleanup_bigint_conversion_for_todos_for_gitlab_com.rb b/db/post_migrate/20230608231452_cleanup_bigint_conversion_for_todos_for_gitlab_com.rb
new file mode 100644
index 00000000000..281b5f926fa
--- /dev/null
+++ b/db/post_migrate/20230608231452_cleanup_bigint_conversion_for_todos_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForTodosForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :todos
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230608232452_cleanup_bigint_conversion_for_system_note_metadata_for_gitlab_com.rb b/db/post_migrate/20230608232452_cleanup_bigint_conversion_for_system_note_metadata_for_gitlab_com.rb
new file mode 100644
index 00000000000..e52dd3e5da8
--- /dev/null
+++ b/db/post_migrate/20230608232452_cleanup_bigint_conversion_for_system_note_metadata_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForSystemNoteMetadataForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :system_note_metadata
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230608233452_cleanup_bigint_conversion_for_epic_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230608233452_cleanup_bigint_conversion_for_epic_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..733aaa62b31
--- /dev/null
+++ b/db/post_migrate/20230608233452_cleanup_bigint_conversion_for_epic_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForEpicUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :epic_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230608234452_cleanup_bigint_conversion_for_suggestions_for_gitlab_com.rb b/db/post_migrate/20230608234452_cleanup_bigint_conversion_for_suggestions_for_gitlab_com.rb
new file mode 100644
index 00000000000..90f175bd35e
--- /dev/null
+++ b/db/post_migrate/20230608234452_cleanup_bigint_conversion_for_suggestions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForSuggestionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :suggestions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230608235452_cleanup_bigint_conversion_for_issue_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230608235452_cleanup_bigint_conversion_for_issue_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..094a8f43eef
--- /dev/null
+++ b/db/post_migrate/20230608235452_cleanup_bigint_conversion_for_issue_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForIssueUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :issue_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609000452_cleanup_bigint_conversion_for_note_diff_files_for_gitlab_com.rb b/db/post_migrate/20230609000452_cleanup_bigint_conversion_for_note_diff_files_for_gitlab_com.rb
new file mode 100644
index 00000000000..bdb6ef83ea7
--- /dev/null
+++ b/db/post_migrate/20230609000452_cleanup_bigint_conversion_for_note_diff_files_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForNoteDiffFilesForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :note_diff_files
+ COLUMNS = [:diff_note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609001452_cleanup_bigint_conversion_for_snippet_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230609001452_cleanup_bigint_conversion_for_snippet_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..f4b7724567b
--- /dev/null
+++ b/db/post_migrate/20230609001452_cleanup_bigint_conversion_for_snippet_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForSnippetUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :snippet_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609002452_cleanup_bigint_conversion_for_design_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230609002452_cleanup_bigint_conversion_for_design_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..2314cb4ac00
--- /dev/null
+++ b/db/post_migrate/20230609002452_cleanup_bigint_conversion_for_design_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForDesignUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :design_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609003452_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230609003452_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..4722d3d24e8
--- /dev/null
+++ b/db/post_migrate/20230609003452_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForVulnerabilityUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :vulnerability_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609004452_cleanup_bigint_conversion_for_commit_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230609004452_cleanup_bigint_conversion_for_commit_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..b7399f3a6db
--- /dev/null
+++ b/db/post_migrate/20230609004452_cleanup_bigint_conversion_for_commit_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForCommitUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :commit_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609005452_cleanup_bigint_conversion_for_merge_request_user_mentions_for_gitlab_com.rb b/db/post_migrate/20230609005452_cleanup_bigint_conversion_for_merge_request_user_mentions_for_gitlab_com.rb
new file mode 100644
index 00000000000..b4b66d218f0
--- /dev/null
+++ b/db/post_migrate/20230609005452_cleanup_bigint_conversion_for_merge_request_user_mentions_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForMergeRequestUserMentionsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :merge_request_user_mentions
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609010452_cleanup_bigint_conversion_for_timelogs_for_gitlab_com.rb b/db/post_migrate/20230609010452_cleanup_bigint_conversion_for_timelogs_for_gitlab_com.rb
new file mode 100644
index 00000000000..6a9d5532716
--- /dev/null
+++ b/db/post_migrate/20230609010452_cleanup_bigint_conversion_for_timelogs_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForTimelogsForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :timelogs
+ COLUMNS = [:note_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230609011452_cleanup_bigint_conversion_for_award_emoji_for_gitlab_com.rb b/db/post_migrate/20230609011452_cleanup_bigint_conversion_for_award_emoji_for_gitlab_com.rb
new file mode 100644
index 00000000000..5edbd8ed212
--- /dev/null
+++ b/db/post_migrate/20230609011452_cleanup_bigint_conversion_for_award_emoji_for_gitlab_com.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CleanupBigintConversionForAwardEmojiForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ enable_lock_retries!
+
+ TABLE = :award_emoji
+ COLUMNS = [:awardable_id]
+
+ def up
+ return unless should_run?
+
+ cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ return unless should_run?
+
+ restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230612075608_replace_ci_job_artifacts_foreign_key_v2.rb b/db/post_migrate/20230612075608_replace_ci_job_artifacts_foreign_key_v2.rb
new file mode 100644
index 00000000000..34a77316f6b
--- /dev/null
+++ b/db/post_migrate/20230612075608_replace_ci_job_artifacts_foreign_key_v2.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+class ReplaceCiJobArtifactsForeignKeyV2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ add_concurrent_foreign_key :ci_job_artifacts, :p_ci_builds,
+ name: 'temp_fk_rails_c5137cb2c1_p',
+ column: [:partition_id, :job_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_job_artifacts,
+ name: 'temp_fk_rails_c5137cb2c1_p'
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_async_foreign_key_validation :ci_job_artifacts, name: 'temp_fk_rails_c5137cb2c1_p'
+ remove_foreign_key_if_exists :ci_job_artifacts, name: 'temp_fk_rails_c5137cb2c1_p'
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_job_artifacts, :ci_builds)
+ end
+end
diff --git a/db/post_migrate/20230612083337_replace_ci_running_builds_foreign_key_v2.rb b/db/post_migrate/20230612083337_replace_ci_running_builds_foreign_key_v2.rb
new file mode 100644
index 00000000000..f8abe274610
--- /dev/null
+++ b/db/post_migrate/20230612083337_replace_ci_running_builds_foreign_key_v2.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+class ReplaceCiRunningBuildsForeignKeyV2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ add_concurrent_foreign_key :ci_running_builds, :p_ci_builds,
+ name: 'temp_fk_rails_da45cfa165_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_running_builds,
+ name: 'temp_fk_rails_da45cfa165_p'
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_async_foreign_key_validation :ci_running_builds, name: 'temp_fk_rails_da45cfa165_p'
+ remove_foreign_key_if_exists :ci_running_builds, name: 'temp_fk_rails_da45cfa165_p'
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_running_builds, :ci_builds)
+ end
+end
diff --git a/db/post_migrate/20230612083655_replace_ci_job_variables_foreign_key_v2.rb b/db/post_migrate/20230612083655_replace_ci_job_variables_foreign_key_v2.rb
new file mode 100644
index 00000000000..df3593c5304
--- /dev/null
+++ b/db/post_migrate/20230612083655_replace_ci_job_variables_foreign_key_v2.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+class ReplaceCiJobVariablesForeignKeyV2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ add_concurrent_foreign_key :ci_job_variables, :p_ci_builds,
+ name: 'temp_fk_rails_fbf3b34792_p',
+ column: [:partition_id, :job_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_async_foreign_key_validation :ci_job_variables,
+ name: 'temp_fk_rails_fbf3b34792_p'
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_async_foreign_key_validation :ci_job_variables, name: 'temp_fk_rails_fbf3b34792_p'
+ remove_foreign_key_if_exists :ci_job_variables, name: 'temp_fk_rails_fbf3b34792_p'
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_job_variables, :ci_builds)
+ end
+end
diff --git a/db/post_migrate/20230612083810_replace_p_ci_builds_metadata_foreign_key_v2.rb b/db/post_migrate/20230612083810_replace_p_ci_builds_metadata_foreign_key_v2.rb
new file mode 100644
index 00000000000..c97dd22eee1
--- /dev/null
+++ b/db/post_migrate/20230612083810_replace_p_ci_builds_metadata_foreign_key_v2.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+class ReplacePCiBuildsMetadataForeignKeyV2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ add_concurrent_partitioned_foreign_key :p_ci_builds_metadata, :p_ci_builds,
+ name: 'temp_fk_e20479742e_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_partitioned_async_foreign_key_validation :p_ci_builds_metadata,
+ name: 'temp_fk_e20479742e_p'
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_partitioned_async_foreign_key_validation :p_ci_builds_metadata, name: 'temp_fk_e20479742e_p'
+
+ Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_builds_metadata) do |partition|
+ execute "ALTER TABLE #{partition.identifier} DROP CONSTRAINT IF EXISTS temp_fk_e20479742e_p"
+ end
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_builds_metadata, :ci_builds)
+ end
+end
diff --git a/db/post_migrate/20230612084013_replace_p_ci_runner_machine_builds_foreign_key_v2.rb b/db/post_migrate/20230612084013_replace_p_ci_runner_machine_builds_foreign_key_v2.rb
new file mode 100644
index 00000000000..dbbf7263d87
--- /dev/null
+++ b/db/post_migrate/20230612084013_replace_p_ci_runner_machine_builds_foreign_key_v2.rb
@@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+class ReplacePCiRunnerMachineBuildsForeignKeyV2 < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ add_concurrent_partitioned_foreign_key :p_ci_runner_machine_builds, :p_ci_builds,
+ name: 'temp_fk_bb490f12fe_p',
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: false,
+ reverse_lock_order: true
+
+ prepare_partitioned_async_foreign_key_validation :p_ci_runner_machine_builds,
+ name: 'temp_fk_bb490f12fe_p'
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_partitioned_async_foreign_key_validation :p_ci_runner_machine_builds, name: 'temp_fk_bb490f12fe_p'
+
+ Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_runner_machine_builds) do |partition|
+ execute "ALTER TABLE #{partition.identifier} DROP CONSTRAINT IF EXISTS temp_fk_bb490f12fe_p"
+ end
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_builds)
+ end
+end
diff --git a/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb b/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb
new file mode 100644
index 00000000000..370441730b6
--- /dev/null
+++ b/db/post_migrate/20230612162643_pm_checkpoints_remove_advisory_entries.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class PmCheckpointsRemoveAdvisoryEntries < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_pm
+
+ def up
+ execute("DELETE FROM pm_checkpoints
+ WHERE data_type = #{Enums::PackageMetadata::DATA_TYPES[:licenses]} and version_format = 1")
+ execute("UPDATE pm_checkpoints SET data_type = #{Enums::PackageMetadata::DATA_TYPES[:licenses]}
+ WHERE data_type = #{Enums::PackageMetadata::DATA_TYPES[:advisories]} and version_format = 1")
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/post_migrate/20230614073136_restore_index_for_contribution_analytics_events.rb b/db/post_migrate/20230614073136_restore_index_for_contribution_analytics_events.rb
new file mode 100644
index 00000000000..2ac485f8dc0
--- /dev/null
+++ b/db/post_migrate/20230614073136_restore_index_for_contribution_analytics_events.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RestoreIndexForContributionAnalyticsEvents < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_on_events_to_improve_contribution_analytics_performance'
+
+ disable_ddl_transaction!
+
+ def up
+ prepare_async_index :events, %i[project_id target_type action created_at author_id id], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :events, %i[project_id target_type action created_at author_id id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230614181637_add_idx_issues_on_work_item_type_project_closed_at_where_closed.rb b/db/post_migrate/20230614181637_add_idx_issues_on_work_item_type_project_closed_at_where_closed.rb
new file mode 100644
index 00000000000..dd260b868e5
--- /dev/null
+++ b/db/post_migrate/20230614181637_add_idx_issues_on_work_item_type_project_closed_at_where_closed.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIdxIssuesOnWorkItemTypeProjectClosedAtWhereClosed < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'idx_issues_on_project_work_item_type_closed_at_where_closed'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :issues, [:project_id, :work_item_type_id, :closed_at], where: '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/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb b/db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb
new file mode 100644
index 00000000000..82d88888442
--- /dev/null
+++ b/db/post_migrate/20230615083713_replace_old_fk_ci_build_pending_states_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildPendingStatesToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_build_pending_states, :ci_builds,
+ name: :fk_861cd17da3_p, reverse_lock_order: true
+
+ rename_constraint :ci_build_pending_states, :temp_fk_861cd17da3_p, :fk_861cd17da3_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_build_pending_states, :ci_builds,
+ name: :temp_fk_861cd17da3_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_build_pending_states, :fk_861cd17da3_p, :temp_fk_861cd17da3_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_build_pending_states, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_build_pending_states, :p_ci_builds, name: :fk_861cd17da3_p)
+ end
+end
diff --git a/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb b/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb
new file mode 100644
index 00000000000..a5ca73e8124
--- /dev/null
+++ b/db/post_migrate/20230615083715_replace_old_fk_ci_build_trace_chunks_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildTraceChunksToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_build_trace_chunks, :ci_builds,
+ name: :fk_89e29fa5ee_p, reverse_lock_order: true
+
+ rename_constraint :ci_build_trace_chunks, :temp_fk_89e29fa5ee_p, :fk_89e29fa5ee_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_build_trace_chunks, :ci_builds,
+ name: :temp_fk_89e29fa5ee_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_build_trace_chunks, :fk_89e29fa5ee_p, :temp_fk_89e29fa5ee_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_build_trace_chunks, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_build_trace_chunks, :p_ci_builds, name: :fk_89e29fa5ee_p)
+ end
+end
diff --git a/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb b/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb
new file mode 100644
index 00000000000..be527f7ae38
--- /dev/null
+++ b/db/post_migrate/20230615083720_replace_old_fk_ci_unit_test_failures_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiUnitTestFailuresToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_unit_test_failures, :ci_builds,
+ name: :fk_9e0fc58930_p, reverse_lock_order: true
+
+ rename_constraint :ci_unit_test_failures, :temp_fk_9e0fc58930_p, :fk_9e0fc58930_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_unit_test_failures, :ci_builds,
+ name: :temp_fk_9e0fc58930_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_unit_test_failures, :fk_9e0fc58930_p, :temp_fk_9e0fc58930_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_unit_test_failures, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_unit_test_failures, :p_ci_builds, name: :fk_9e0fc58930_p)
+ end
+end
diff --git a/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb b/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb
new file mode 100644
index 00000000000..990a4e2bbe4
--- /dev/null
+++ b/db/post_migrate/20230615083725_replace_old_fk_ci_sources_pipelines_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiSourcesPipelinesToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_sources_pipelines, :ci_builds,
+ name: :fk_be5624bf37_p, reverse_lock_order: true
+
+ rename_constraint :ci_sources_pipelines, :temp_fk_be5624bf37_p, :fk_be5624bf37_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_sources_pipelines, :ci_builds,
+ name: :temp_fk_be5624bf37_p,
+ column: [:source_partition_id, :source_job_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_sources_pipelines, :fk_be5624bf37_p, :temp_fk_be5624bf37_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_sources_pipelines, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_sources_pipelines, :p_ci_builds, name: :fk_be5624bf37_p)
+ end
+end
diff --git a/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb b/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb
new file mode 100644
index 00000000000..498b513c425
--- /dev/null
+++ b/db/post_migrate/20230615083730_replace_old_fk_ci_resources_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiResourcesToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_resources, :ci_builds,
+ name: :fk_e169a8e3d5_p, reverse_lock_order: true
+
+ rename_constraint :ci_resources, :temp_fk_e169a8e3d5_p, :fk_e169a8e3d5_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_resources, :ci_builds,
+ name: :temp_fk_e169a8e3d5_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :nullify,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_resources, :fk_e169a8e3d5_p, :temp_fk_e169a8e3d5_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_resources, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_resources, :p_ci_builds, name: :fk_e169a8e3d5_p)
+ end
+end
diff --git a/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb b/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb
new file mode 100644
index 00000000000..24b51a45613
--- /dev/null
+++ b/db/post_migrate/20230615083734_replace_old_fk_ci_build_report_results_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildReportResultsToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_build_report_results, :ci_builds,
+ name: :fk_rails_16cb1ff064_p, reverse_lock_order: true
+
+ rename_constraint :ci_build_report_results, :temp_fk_rails_16cb1ff064_p, :fk_rails_16cb1ff064_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_build_report_results, :ci_builds,
+ name: :temp_fk_rails_16cb1ff064_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_build_report_results, :fk_rails_16cb1ff064_p, :temp_fk_rails_16cb1ff064_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_build_report_results, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_build_report_results, :p_ci_builds, name: :fk_rails_16cb1ff064_p)
+ end
+end
diff --git a/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb b/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb
new file mode 100644
index 00000000000..4a77ec01551
--- /dev/null
+++ b/db/post_migrate/20230615083738_replace_old_fk_ci_build_needs_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildNeedsToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_build_needs, :ci_builds,
+ name: :fk_rails_3cf221d4ed_p, reverse_lock_order: true
+
+ rename_constraint :ci_build_needs, :temp_fk_rails_3cf221d4ed_p, :fk_rails_3cf221d4ed_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_build_needs, :ci_builds,
+ name: :temp_fk_rails_3cf221d4ed_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_build_needs, :fk_rails_3cf221d4ed_p, :temp_fk_rails_3cf221d4ed_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_build_needs, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_build_needs, :p_ci_builds, name: :fk_rails_3cf221d4ed_p)
+ end
+end
diff --git a/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb b/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb
new file mode 100644
index 00000000000..56a790aef62
--- /dev/null
+++ b/db/post_migrate/20230615083741_replace_old_fk_ci_builds_runner_session_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildsRunnerSessionToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_builds_runner_session, :ci_builds,
+ name: :fk_rails_70707857d3_p, reverse_lock_order: true
+
+ rename_constraint :ci_builds_runner_session, :temp_fk_rails_70707857d3_p, :fk_rails_70707857d3_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_builds_runner_session, :ci_builds,
+ name: :temp_fk_rails_70707857d3_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_builds_runner_session, :fk_rails_70707857d3_p, :temp_fk_rails_70707857d3_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_builds_runner_session, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_builds_runner_session, :p_ci_builds, name: :fk_rails_70707857d3_p)
+ end
+end
diff --git a/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb b/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb
new file mode 100644
index 00000000000..42095da09e2
--- /dev/null
+++ b/db/post_migrate/20230615083744_replace_old_fk_ci_pending_builds_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiPendingBuildsToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_pending_builds, :ci_builds,
+ name: :fk_rails_725a2644a3_p, reverse_lock_order: true
+
+ rename_constraint :ci_pending_builds, :temp_fk_rails_725a2644a3_p, :fk_rails_725a2644a3_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_pending_builds, :ci_builds,
+ name: :temp_fk_rails_725a2644a3_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_pending_builds, :fk_rails_725a2644a3_p, :temp_fk_rails_725a2644a3_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_pending_builds, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_pending_builds, :p_ci_builds, name: :fk_rails_725a2644a3_p)
+ end
+end
diff --git a/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb b/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb
new file mode 100644
index 00000000000..72d598ae0b9
--- /dev/null
+++ b/db/post_migrate/20230615083748_replace_old_fk_ci_build_trace_metadata_to_builds.rb
@@ -0,0 +1,45 @@
+# frozen_string_literal: true
+
+class ReplaceOldFkCiBuildTraceMetadataToBuilds < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum
+
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+ return if new_foreign_key_exists?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :ci_build_trace_metadata, :ci_builds,
+ name: :fk_rails_aebc78111f_p, reverse_lock_order: true
+
+ rename_constraint :ci_build_trace_metadata, :temp_fk_rails_aebc78111f_p, :fk_rails_aebc78111f_p
+ end
+ end
+
+ def down
+ return unless should_run?
+ return unless new_foreign_key_exists?
+
+ add_concurrent_foreign_key :ci_build_trace_metadata, :ci_builds,
+ name: :temp_fk_rails_aebc78111f_p,
+ column: [:partition_id, :build_id],
+ target_column: [:partition_id, :id],
+ on_update: :cascade,
+ on_delete: :cascade,
+ validate: true,
+ reverse_lock_order: true
+
+ switch_constraint_names :ci_build_trace_metadata, :fk_rails_aebc78111f_p, :temp_fk_rails_aebc78111f_p
+ end
+
+ private
+
+ def should_run?
+ can_execute_on?(:ci_build_trace_metadata, :ci_builds)
+ end
+
+ def new_foreign_key_exists?
+ foreign_key_exists?(:ci_build_trace_metadata, :p_ci_builds, name: :fk_rails_aebc78111f_p)
+ end
+end
diff --git a/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb b/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb
new file mode 100644
index 00000000000..ac8b9582fc8
--- /dev/null
+++ b/db/post_migrate/20230615202125_prepare_index_issues_on_project_health_status_asc_work_item_type.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class PrepareIndexIssuesOnProjectHealthStatusAscWorkItemType < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_issues_on_project_health_status_asc_work_item_type'
+
+ def up
+ prepare_async_index :issues,
+ [:project_id, :health_status, :id, :state_id, :work_item_type_id],
+ order: { health_status: 'ASC NULLS LAST', id: :desc },
+ name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :issues, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb b/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb
new file mode 100644
index 00000000000..1c8b6cdd3a3
--- /dev/null
+++ b/db/post_migrate/20230615202511_prepare_index_issues_on_project_health_status_desc_work_item_type.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class PrepareIndexIssuesOnProjectHealthStatusDescWorkItemType < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_issues_on_project_health_status_desc_work_item_type'
+
+ def up
+ prepare_async_index :issues,
+ [:project_id, :health_status, :id, :state_id, :work_item_type_id],
+ order: { health_status: 'DESC NULLS LAST', id: :desc },
+ name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :issues, 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/db/schema_migrations/20221207135755 b/db/schema_migrations/20221207135755
new file mode 100644
index 00000000000..e8a97fc717e
--- /dev/null
+++ b/db/schema_migrations/20221207135755
@@ -0,0 +1 @@
+b08b766dad288ad5d4b6cfa0d92288a38f553f20dbea997d5379ef2dc79f1f0c \ No newline at end of file
diff --git a/db/schema_migrations/20221207135831 b/db/schema_migrations/20221207135831
new file mode 100644
index 00000000000..406e1e88841
--- /dev/null
+++ b/db/schema_migrations/20221207135831
@@ -0,0 +1 @@
+ad6101b9d46b7a7ae1c302c7880979b5a29ced6193dfe95e32495766f01b34d9 \ No newline at end of file
diff --git a/db/schema_migrations/20230222131512 b/db/schema_migrations/20230222131512
new file mode 100644
index 00000000000..180b6a5c922
--- /dev/null
+++ b/db/schema_migrations/20230222131512
@@ -0,0 +1 @@
+676433c9330c304524c444c3d630558c849654173cd78f7e499087569203b7eb \ No newline at end of file
diff --git a/db/schema_migrations/20230310020356 b/db/schema_migrations/20230310020356
new file mode 100644
index 00000000000..ac942e2ec1a
--- /dev/null
+++ b/db/schema_migrations/20230310020356
@@ -0,0 +1 @@
+0b6ca48a68c9695f0035d2dd111707d3abaee7f260549a694250527c1f6f5b9e \ No newline at end of file
diff --git a/db/schema_migrations/20230328150343 b/db/schema_migrations/20230328150343
new file mode 100644
index 00000000000..05054b0490b
--- /dev/null
+++ b/db/schema_migrations/20230328150343
@@ -0,0 +1 @@
+d5cb88bd614c000b9b782e8a827bf4efcf04c57688bd4bde3d01f555b52f43fb \ No newline at end of file
diff --git a/db/schema_migrations/20230329235300 b/db/schema_migrations/20230329235300
new file mode 100644
index 00000000000..0f3d4099553
--- /dev/null
+++ b/db/schema_migrations/20230329235300
@@ -0,0 +1 @@
+44df5e98715af0cf9f8920e8fc35754901d578ae5c1dcc5fa7a3fb9ee49f995b \ No newline at end of file
diff --git a/db/schema_migrations/20230406115900 b/db/schema_migrations/20230406115900
new file mode 100644
index 00000000000..38fa9134dac
--- /dev/null
+++ b/db/schema_migrations/20230406115900
@@ -0,0 +1 @@
+85cf98db148785c25a6ed472a300f5967aea916ef9b937d78bff90e33905886f \ No newline at end of file
diff --git a/db/schema_migrations/20230426030342 b/db/schema_migrations/20230426030342
new file mode 100644
index 00000000000..08f6ed3d81a
--- /dev/null
+++ b/db/schema_migrations/20230426030342
@@ -0,0 +1 @@
+54267e34c6978456efca6c784c4e4ea7541dac98a704095a9766809725021bb8 \ No newline at end of file
diff --git a/db/schema_migrations/20230426085615 b/db/schema_migrations/20230426085615
new file mode 100644
index 00000000000..a0166399442
--- /dev/null
+++ b/db/schema_migrations/20230426085615
@@ -0,0 +1 @@
+e331d6f2d5934cce0ac78862abb3eac5c0567be95b0865f5ac38299ee7e147ca \ No newline at end of file
diff --git a/db/schema_migrations/20230428070443 b/db/schema_migrations/20230428070443
new file mode 100644
index 00000000000..c1798ec1bf4
--- /dev/null
+++ b/db/schema_migrations/20230428070443
@@ -0,0 +1 @@
+8277328b39ff873c549453bbdc8b0ae67e49cc23fd6e8166aea68c1d61fc7116 \ No newline at end of file
diff --git a/db/schema_migrations/20230428165514 b/db/schema_migrations/20230428165514
new file mode 100644
index 00000000000..2cad40833c1
--- /dev/null
+++ b/db/schema_migrations/20230428165514
@@ -0,0 +1 @@
+ad16293967c9751d138690328308944dd0930cd88e1afa16d825fbaf2cc8299c \ No newline at end of file
diff --git a/db/schema_migrations/20230502102833 b/db/schema_migrations/20230502102833
new file mode 100644
index 00000000000..f9629db7788
--- /dev/null
+++ b/db/schema_migrations/20230502102833
@@ -0,0 +1 @@
+d977e336cc71f43157c2d87c529706abe50cb962fcf2e36c2fd315135c881440 \ No newline at end of file
diff --git a/db/schema_migrations/20230502120022 b/db/schema_migrations/20230502120022
new file mode 100644
index 00000000000..abc7f157f88
--- /dev/null
+++ b/db/schema_migrations/20230502120022
@@ -0,0 +1 @@
+576982c8efcf40da159f3f721cf6b2947e61e92637f861c031d3731ddeaf2d05 \ No newline at end of file
diff --git a/db/schema_migrations/20230504182314 b/db/schema_migrations/20230504182314
new file mode 100644
index 00000000000..e460078f4a3
--- /dev/null
+++ b/db/schema_migrations/20230504182314
@@ -0,0 +1 @@
+33a5243e26cdcaa4151aa19e6e1837043303dc75295bc6d6468b7c5b849201d9 \ No newline at end of file
diff --git a/db/schema_migrations/20230505115558 b/db/schema_migrations/20230505115558
new file mode 100644
index 00000000000..7906938db93
--- /dev/null
+++ b/db/schema_migrations/20230505115558
@@ -0,0 +1 @@
+3e5c849215b0bac1a2e68bc815dc19583f4f5dbb7a205eceff6f5b7e80ed3246 \ No newline at end of file
diff --git a/db/schema_migrations/20230508095017 b/db/schema_migrations/20230508095017
new file mode 100644
index 00000000000..00fefae99f6
--- /dev/null
+++ b/db/schema_migrations/20230508095017
@@ -0,0 +1 @@
+02a4bd854b5f2269c917fa15823f423544a165a37a6341f76c6555e4b11659f3 \ No newline at end of file
diff --git a/db/schema_migrations/20230509013743 b/db/schema_migrations/20230509013743
new file mode 100644
index 00000000000..776ec9d19a6
--- /dev/null
+++ b/db/schema_migrations/20230509013743
@@ -0,0 +1 @@
+c312816ffabb9442b57d826a9e8c2214ae7672bf03938a911ddae490309fe87d \ No newline at end of file
diff --git a/db/schema_migrations/20230510013754 b/db/schema_migrations/20230510013754
new file mode 100644
index 00000000000..f59495e6ff6
--- /dev/null
+++ b/db/schema_migrations/20230510013754
@@ -0,0 +1 @@
+ee83bf5d8c283d1d24f4f7300abd0bb96e51ecfef480cab3a74875ebecf5cbcd \ No newline at end of file
diff --git a/db/schema_migrations/20230510141454 b/db/schema_migrations/20230510141454
new file mode 100644
index 00000000000..f54ad6684cc
--- /dev/null
+++ b/db/schema_migrations/20230510141454
@@ -0,0 +1 @@
+cef4d4de7e960091f19f0970ebe0d2f375d9615c0bcce472612383e550e98a74 \ No newline at end of file
diff --git a/db/schema_migrations/20230510142316 b/db/schema_migrations/20230510142316
new file mode 100644
index 00000000000..236be8d6ad3
--- /dev/null
+++ b/db/schema_migrations/20230510142316
@@ -0,0 +1 @@
+63743777cb7580e64c61847990e4e2e00f20584d314729107ae52dcd056ae18a \ No newline at end of file
diff --git a/db/schema_migrations/20230510142931 b/db/schema_migrations/20230510142931
new file mode 100644
index 00000000000..58f213fd932
--- /dev/null
+++ b/db/schema_migrations/20230510142931
@@ -0,0 +1 @@
+ba6f80a4e9dbb316ec52fb707927600581ca48942cec73a3ab971326379388fd \ No newline at end of file
diff --git a/db/schema_migrations/20230510152153 b/db/schema_migrations/20230510152153
new file mode 100644
index 00000000000..c30cf28e6a0
--- /dev/null
+++ b/db/schema_migrations/20230510152153
@@ -0,0 +1 @@
+58b2ebc440992501aacfe7400f43a297f72f16d1faefce307bf71bc3d5755600 \ No newline at end of file
diff --git a/db/schema_migrations/20230511132140 b/db/schema_migrations/20230511132140
new file mode 100644
index 00000000000..e90a58e2e28
--- /dev/null
+++ b/db/schema_migrations/20230511132140
@@ -0,0 +1 @@
+a9fc2734da81d15b8c6bdb3812c22e7c5a24d6729b98bf9118e6c8a9c85a6712 \ No newline at end of file
diff --git a/db/schema_migrations/20230512104238 b/db/schema_migrations/20230512104238
new file mode 100644
index 00000000000..7147448d13e
--- /dev/null
+++ b/db/schema_migrations/20230512104238
@@ -0,0 +1 @@
+db35cec0252dc30e2de62c9d61c0230d603f5714a986412d8a5ebdc2d9c0a1d5 \ No newline at end of file
diff --git a/db/schema_migrations/20230512141931 b/db/schema_migrations/20230512141931
new file mode 100644
index 00000000000..7652e281eb7
--- /dev/null
+++ b/db/schema_migrations/20230512141931
@@ -0,0 +1 @@
+2acead22b097b6873efa3108fedb374eeed793aef1519d9825685d97d844d2fe \ No newline at end of file
diff --git a/db/schema_migrations/20230512143000 b/db/schema_migrations/20230512143000
new file mode 100644
index 00000000000..6534634133d
--- /dev/null
+++ b/db/schema_migrations/20230512143000
@@ -0,0 +1 @@
+3a29402e93ec0239bf6012f29b31613f2ea91def3096673ee0b44bfb8624a532 \ No newline at end of file
diff --git a/db/schema_migrations/20230515101208 b/db/schema_migrations/20230515101208
new file mode 100644
index 00000000000..5cd9727331f
--- /dev/null
+++ b/db/schema_migrations/20230515101208
@@ -0,0 +1 @@
+ddd627c22bc925cb186c54d1df2897cba93027c2919dbe279063ac82a496b812 \ No newline at end of file
diff --git a/db/schema_migrations/20230515102353 b/db/schema_migrations/20230515102353
new file mode 100644
index 00000000000..17eee8f1d9f
--- /dev/null
+++ b/db/schema_migrations/20230515102353
@@ -0,0 +1 @@
+c7cad916d89ef08e0c7c184b2c68a09aa5fa7ea39de11e2bff3aa190e74ca986 \ No newline at end of file
diff --git a/db/schema_migrations/20230515142300 b/db/schema_migrations/20230515142300
new file mode 100644
index 00000000000..362c553959a
--- /dev/null
+++ b/db/schema_migrations/20230515142300
@@ -0,0 +1 @@
+365a9c05c660ba40b1b66256fa696cf8064388b4589b6d0bc507780e081526f2 \ No newline at end of file
diff --git a/db/schema_migrations/20230515153600 b/db/schema_migrations/20230515153600
new file mode 100644
index 00000000000..59cf7492b56
--- /dev/null
+++ b/db/schema_migrations/20230515153600
@@ -0,0 +1 @@
+147c720a8103a14bd96f01618b68f5e46ed44b2b72cca43d17d7abfe0632c980 \ No newline at end of file
diff --git a/db/schema_migrations/20230516032545 b/db/schema_migrations/20230516032545
new file mode 100644
index 00000000000..d9c5caaa3fd
--- /dev/null
+++ b/db/schema_migrations/20230516032545
@@ -0,0 +1 @@
+5f7e7d5b4af1a2e022e64ba2098c9e6be15853b2242334a41b4d53c5454201fe \ No newline at end of file
diff --git a/db/schema_migrations/20230516033729 b/db/schema_migrations/20230516033729
new file mode 100644
index 00000000000..128f8154d29
--- /dev/null
+++ b/db/schema_migrations/20230516033729
@@ -0,0 +1 @@
+ab3a2fa247fa1170aa38ec0471f136b479d715137138929a4d690f7b6022d022 \ No newline at end of file
diff --git a/db/schema_migrations/20230516044606 b/db/schema_migrations/20230516044606
new file mode 100644
index 00000000000..b8ff16b9baa
--- /dev/null
+++ b/db/schema_migrations/20230516044606
@@ -0,0 +1 @@
+2cfada37b139bfc64aab871250f947275fb78cbf6df1a6fd71e4dd424db66e26 \ No newline at end of file
diff --git a/db/schema_migrations/20230516045238 b/db/schema_migrations/20230516045238
new file mode 100644
index 00000000000..7784967128c
--- /dev/null
+++ b/db/schema_migrations/20230516045238
@@ -0,0 +1 @@
+05ea1ebd6dd6547a074b63b8783a9c1088e42d849d787dc1babe1d4f9c950765 \ No newline at end of file
diff --git a/db/schema_migrations/20230516045442 b/db/schema_migrations/20230516045442
new file mode 100644
index 00000000000..968cdc16889
--- /dev/null
+++ b/db/schema_migrations/20230516045442
@@ -0,0 +1 @@
+0449ecd4e28fdc64e73326e6b6d48ecdf9bfa26e3de37dc948ce86ee104c96e0 \ No newline at end of file
diff --git a/db/schema_migrations/20230516072100 b/db/schema_migrations/20230516072100
new file mode 100644
index 00000000000..d135a85db85
--- /dev/null
+++ b/db/schema_migrations/20230516072100
@@ -0,0 +1 @@
+e9b3449d98a151fa834fb8e59ba7cacf7e94ac1357a195a372ff5c515c137ec8 \ No newline at end of file
diff --git a/db/schema_migrations/20230516080816 b/db/schema_migrations/20230516080816
new file mode 100644
index 00000000000..720e9275ea2
--- /dev/null
+++ b/db/schema_migrations/20230516080816
@@ -0,0 +1 @@
+d45ccbc7191760bf61396cf3b50110352149958dfe3696d5e4a172f9e96e204a \ No newline at end of file
diff --git a/db/schema_migrations/20230516110414 b/db/schema_migrations/20230516110414
new file mode 100644
index 00000000000..207e7fe65aa
--- /dev/null
+++ b/db/schema_migrations/20230516110414
@@ -0,0 +1 @@
+8a7d9123c689553d0aed06eea5714e9abd9f52cf6bc07b7349dcc723a3d8552a \ No newline at end of file
diff --git a/db/schema_migrations/20230516115259 b/db/schema_migrations/20230516115259
new file mode 100644
index 00000000000..7e4047fd5ad
--- /dev/null
+++ b/db/schema_migrations/20230516115259
@@ -0,0 +1 @@
+28a6e5cfda097a1dff9b43a082979bda1dd893c85d24db40148cf989450f0d86 \ No newline at end of file
diff --git a/db/schema_migrations/20230516123202 b/db/schema_migrations/20230516123202
new file mode 100644
index 00000000000..8c06f7dee50
--- /dev/null
+++ b/db/schema_migrations/20230516123202
@@ -0,0 +1 @@
+e8ee612d995d72b0c0c955b80a73ac2428b6b7e932723fb8c906bb3729fb2884 \ No newline at end of file
diff --git a/db/schema_migrations/20230516125656 b/db/schema_migrations/20230516125656
new file mode 100644
index 00000000000..779b304284b
--- /dev/null
+++ b/db/schema_migrations/20230516125656
@@ -0,0 +1 @@
+693293c630a849e387820e4b023590595801983a40cfb879205c673a3e2dba3d \ No newline at end of file
diff --git a/db/schema_migrations/20230516172446 b/db/schema_migrations/20230516172446
new file mode 100644
index 00000000000..9acb91b01e3
--- /dev/null
+++ b/db/schema_migrations/20230516172446
@@ -0,0 +1 @@
+dc6c1ae9051671b4684bee64522186cde317bba32bdc4e4e1a6c9267f732f25b \ No newline at end of file
diff --git a/db/schema_migrations/20230516175449 b/db/schema_migrations/20230516175449
new file mode 100644
index 00000000000..d52db116a5e
--- /dev/null
+++ b/db/schema_migrations/20230516175449
@@ -0,0 +1 @@
+7c9152abad40bce13c5a1dd3931c9a81a892f516bc07ec4fa9414b9ae35496a2 \ No newline at end of file
diff --git a/db/schema_migrations/20230516183736 b/db/schema_migrations/20230516183736
new file mode 100644
index 00000000000..1e7ccb7c015
--- /dev/null
+++ b/db/schema_migrations/20230516183736
@@ -0,0 +1 @@
+ccdbefaed7b3e32082ac2c4c49af1fcdf6d9c317739e6e67cc41156ed92404cf \ No newline at end of file
diff --git a/db/schema_migrations/20230516192543 b/db/schema_migrations/20230516192543
new file mode 100644
index 00000000000..e7137fd2448
--- /dev/null
+++ b/db/schema_migrations/20230516192543
@@ -0,0 +1 @@
+0565e50d50fa969c55f276f105e389819830591223aea399340a5288ef4618ee \ No newline at end of file
diff --git a/db/schema_migrations/20230517001535 b/db/schema_migrations/20230517001535
new file mode 100644
index 00000000000..1511ebfbccb
--- /dev/null
+++ b/db/schema_migrations/20230517001535
@@ -0,0 +1 @@
+5d23a9be6e9ba6424208c3e14fc708e45b3a68e14de7be87e294c4e3d926a31f \ No newline at end of file
diff --git a/db/schema_migrations/20230517005523 b/db/schema_migrations/20230517005523
new file mode 100644
index 00000000000..7fdac2b9961
--- /dev/null
+++ b/db/schema_migrations/20230517005523
@@ -0,0 +1 @@
+4d84a87532b45436e64d0c919b361548b4b69b200ec3a91f454af718a51fd22a \ No newline at end of file
diff --git a/db/schema_migrations/20230517090826 b/db/schema_migrations/20230517090826
new file mode 100644
index 00000000000..cf060a2c151
--- /dev/null
+++ b/db/schema_migrations/20230517090826
@@ -0,0 +1 @@
+bfb3fe79af46a042287b1a0e86d79ad61c8ed2ac5e693d06249c52d8152de307 \ No newline at end of file
diff --git a/db/schema_migrations/20230517151041 b/db/schema_migrations/20230517151041
new file mode 100644
index 00000000000..acd95a39933
--- /dev/null
+++ b/db/schema_migrations/20230517151041
@@ -0,0 +1 @@
+ce12aa5cb3f207f2bfa19a27a1765ad027f825b6d75e7029fee5141e3160e5cb \ No newline at end of file
diff --git a/db/schema_migrations/20230517151141 b/db/schema_migrations/20230517151141
new file mode 100644
index 00000000000..658a5798332
--- /dev/null
+++ b/db/schema_migrations/20230517151141
@@ -0,0 +1 @@
+06246b8d7df8d18c3d8e5308f1dcc8375e011f507a969c95678aa8d532a24644 \ No newline at end of file
diff --git a/db/schema_migrations/20230517151241 b/db/schema_migrations/20230517151241
new file mode 100644
index 00000000000..fc08cf92ae8
--- /dev/null
+++ b/db/schema_migrations/20230517151241
@@ -0,0 +1 @@
+f528675db7c4884930b4febc91aca6105189cd040416b92e21364ffe9d9e9bfd \ No newline at end of file
diff --git a/db/schema_migrations/20230517163300 b/db/schema_migrations/20230517163300
new file mode 100644
index 00000000000..a2baef62fe9
--- /dev/null
+++ b/db/schema_migrations/20230517163300
@@ -0,0 +1 @@
+bdda58a5015942f8fe98dedbbab66ff9e39505229da2e6d1726eb73105a89ae1 \ No newline at end of file
diff --git a/db/schema_migrations/20230517182802 b/db/schema_migrations/20230517182802
new file mode 100644
index 00000000000..e9ef71cf8bc
--- /dev/null
+++ b/db/schema_migrations/20230517182802
@@ -0,0 +1 @@
+8cd0b7369ad654e72fb12b9ae0d54cb38ada4b24a20358541dc5ab18ae60605c \ No newline at end of file
diff --git a/db/schema_migrations/20230517182958 b/db/schema_migrations/20230517182958
new file mode 100644
index 00000000000..769fceffb75
--- /dev/null
+++ b/db/schema_migrations/20230517182958
@@ -0,0 +1 @@
+7a34b874349603c65c5ad8d71033a8ec23e7253c51bef20314a5c45d8da9903f \ No newline at end of file
diff --git a/db/schema_migrations/20230517183403 b/db/schema_migrations/20230517183403
new file mode 100644
index 00000000000..1a4eed8c669
--- /dev/null
+++ b/db/schema_migrations/20230517183403
@@ -0,0 +1 @@
+7169d207128db503be38e1106f63a7c2e752ceacbfba93142a731267ce0fa0fe \ No newline at end of file
diff --git a/db/schema_migrations/20230518005523 b/db/schema_migrations/20230518005523
new file mode 100644
index 00000000000..700da3dff74
--- /dev/null
+++ b/db/schema_migrations/20230518005523
@@ -0,0 +1 @@
+7428675eac2c572aa3521df7af7e79f7cf1b6e8f8472e99c842dddf2f3c7ce77 \ No newline at end of file
diff --git a/db/schema_migrations/20230518071251 b/db/schema_migrations/20230518071251
new file mode 100644
index 00000000000..eb84686e802
--- /dev/null
+++ b/db/schema_migrations/20230518071251
@@ -0,0 +1 @@
+eabab8fcee59ed11ddaca9a19d5d16b257b9665f4189843cdd4177e9f5680169 \ No newline at end of file
diff --git a/db/schema_migrations/20230518121320 b/db/schema_migrations/20230518121320
new file mode 100644
index 00000000000..333985c9b5e
--- /dev/null
+++ b/db/schema_migrations/20230518121320
@@ -0,0 +1 @@
+34f1874ef8bab4bee142d12e78c84697e8889e6fc6d5b4dfbcdc6e7ed16861b5 \ No newline at end of file
diff --git a/db/schema_migrations/20230519011151 b/db/schema_migrations/20230519011151
new file mode 100644
index 00000000000..7a9f4dbcee4
--- /dev/null
+++ b/db/schema_migrations/20230519011151
@@ -0,0 +1 @@
+c2340753bf27ef119dd76a49ada76f07ef6f22577ae11651e81bba6bd7502f08 \ No newline at end of file
diff --git a/db/schema_migrations/20230519023720 b/db/schema_migrations/20230519023720
new file mode 100644
index 00000000000..13e5eeaff1e
--- /dev/null
+++ b/db/schema_migrations/20230519023720
@@ -0,0 +1 @@
+fe0db2f640801d6086d5199364bfdf6f868cc53eda46c6e0896b49915775b652 \ No newline at end of file
diff --git a/db/schema_migrations/20230519103034 b/db/schema_migrations/20230519103034
new file mode 100644
index 00000000000..cfefd850e23
--- /dev/null
+++ b/db/schema_migrations/20230519103034
@@ -0,0 +1 @@
+99247380d6a83a3eb0d03270848d7a53276072633073343a5b3bda709b836694 \ No newline at end of file
diff --git a/db/schema_migrations/20230519112106 b/db/schema_migrations/20230519112106
new file mode 100644
index 00000000000..a8eb4476be6
--- /dev/null
+++ b/db/schema_migrations/20230519112106
@@ -0,0 +1 @@
+be307c86a15692e694a276b52274ae400a90f31dfb7fde6ace37683fba1ed4b2 \ No newline at end of file
diff --git a/db/schema_migrations/20230519135414 b/db/schema_migrations/20230519135414
new file mode 100644
index 00000000000..159130e2d44
--- /dev/null
+++ b/db/schema_migrations/20230519135414
@@ -0,0 +1 @@
+e0aaa0eb24b0e2be91593198366d85408ea5b88399c1a2bd4e41fa9acabeb227 \ No newline at end of file
diff --git a/db/schema_migrations/20230521521419 b/db/schema_migrations/20230521521419
new file mode 100644
index 00000000000..9591cbde586
--- /dev/null
+++ b/db/schema_migrations/20230521521419
@@ -0,0 +1 @@
+04dd0a9bdfe5890f8a44aa15bbbc295a25883bb27fbee0015937a1f6c432a231 \ No newline at end of file
diff --git a/db/schema_migrations/20230522073230 b/db/schema_migrations/20230522073230
new file mode 100644
index 00000000000..dee1babf25b
--- /dev/null
+++ b/db/schema_migrations/20230522073230
@@ -0,0 +1 @@
+d630b2bbfbb4ac030da8020745005bf7326b337ea9dbf4a57130e95d1824b780 \ No newline at end of file
diff --git a/db/schema_migrations/20230522103433 b/db/schema_migrations/20230522103433
new file mode 100644
index 00000000000..625410b73a1
--- /dev/null
+++ b/db/schema_migrations/20230522103433
@@ -0,0 +1 @@
+b5c1ad2fe2f4d38b39ac9c621b36f62c0a06b74846f5afdad4d88804bb1d7acf \ No newline at end of file
diff --git a/db/schema_migrations/20230522111534 b/db/schema_migrations/20230522111534
new file mode 100644
index 00000000000..72d0719a93f
--- /dev/null
+++ b/db/schema_migrations/20230522111534
@@ -0,0 +1 @@
+99c1d226ac26e20e8cb1ad43663cad4e9e2cc296d8a76914b2fe402ff3674b24 \ No newline at end of file
diff --git a/db/schema_migrations/20230522132239 b/db/schema_migrations/20230522132239
new file mode 100644
index 00000000000..365eb1606cb
--- /dev/null
+++ b/db/schema_migrations/20230522132239
@@ -0,0 +1 @@
+7cda2cca39c53859e84bb7ecf3a2a9817f598486632a3cdd922dde6057b5c930 \ No newline at end of file
diff --git a/db/schema_migrations/20230522180913 b/db/schema_migrations/20230522180913
new file mode 100644
index 00000000000..efae214ea6b
--- /dev/null
+++ b/db/schema_migrations/20230522180913
@@ -0,0 +1 @@
+a050f273e3582d5e651f691631dae28a3e1c60a3f95d1f6f05b0ea47be609e8b \ No newline at end of file
diff --git a/db/schema_migrations/20230522181134 b/db/schema_migrations/20230522181134
new file mode 100644
index 00000000000..b37e66a370a
--- /dev/null
+++ b/db/schema_migrations/20230522181134
@@ -0,0 +1 @@
+746360d5f65be831e1225d343983ca870464eaa5a84f619d6b28975ecfc4a876 \ No newline at end of file
diff --git a/db/schema_migrations/20230522210320 b/db/schema_migrations/20230522210320
new file mode 100644
index 00000000000..74a32da1d1a
--- /dev/null
+++ b/db/schema_migrations/20230522210320
@@ -0,0 +1 @@
+6c287edd3102743f83a94b3f961074eb2d85c63c7f7789c63cb51a11ef4c04c1 \ No newline at end of file
diff --git a/db/schema_migrations/20230522220709 b/db/schema_migrations/20230522220709
new file mode 100644
index 00000000000..aadbdc7f2cf
--- /dev/null
+++ b/db/schema_migrations/20230522220709
@@ -0,0 +1 @@
+ef28d42bc0e59c42c6764f0859d36307bf4c6594d109fcfaabbb8ae5392ed563 \ No newline at end of file
diff --git a/db/schema_migrations/20230522225610 b/db/schema_migrations/20230522225610
new file mode 100644
index 00000000000..d9e737d11de
--- /dev/null
+++ b/db/schema_migrations/20230522225610
@@ -0,0 +1 @@
+efa846e74dcc14732fe78f8458e1d44bb12f3b97282c14e4a33c87eac561e032 \ No newline at end of file
diff --git a/db/schema_migrations/20230523073455 b/db/schema_migrations/20230523073455
new file mode 100644
index 00000000000..b1f55a3744b
--- /dev/null
+++ b/db/schema_migrations/20230523073455
@@ -0,0 +1 @@
+45f116be064d575bba2acab71458a89dbe5332c3cfb4544eb51638bf86081123 \ No newline at end of file
diff --git a/db/schema_migrations/20230523074248 b/db/schema_migrations/20230523074248
new file mode 100644
index 00000000000..29b21d2fcf7
--- /dev/null
+++ b/db/schema_migrations/20230523074248
@@ -0,0 +1 @@
+a9408102327280918366975b599985f3e382ebd493267fd010ad2dcbe6140eb3 \ No newline at end of file
diff --git a/db/schema_migrations/20230523074517 b/db/schema_migrations/20230523074517
new file mode 100644
index 00000000000..e6017c55df3
--- /dev/null
+++ b/db/schema_migrations/20230523074517
@@ -0,0 +1 @@
+662b78b3f796cec08f325ec71389bdaf9efa0695b6bfe224b18295175f1383bf \ No newline at end of file
diff --git a/db/schema_migrations/20230523101514 b/db/schema_migrations/20230523101514
new file mode 100644
index 00000000000..76c331d425d
--- /dev/null
+++ b/db/schema_migrations/20230523101514
@@ -0,0 +1 @@
+d9efa5185994ecc7d2025d450a1072286674a0a2d94f7f2aa11a6b6b24d4f5da \ No newline at end of file
diff --git a/db/schema_migrations/20230523122242 b/db/schema_migrations/20230523122242
new file mode 100644
index 00000000000..36316e88777
--- /dev/null
+++ b/db/schema_migrations/20230523122242
@@ -0,0 +1 @@
+16c5eed18bf8beb8200fc2eaae9ffe532439e463cdb417f84eabc29992779558 \ No newline at end of file
diff --git a/db/schema_migrations/20230523125245 b/db/schema_migrations/20230523125245
new file mode 100644
index 00000000000..bfb22be77dd
--- /dev/null
+++ b/db/schema_migrations/20230523125245
@@ -0,0 +1 @@
+1379d0f878297bd4815cbb2d58bc0187b9bb3609bdeb87ab20983682f1abfa55 \ No newline at end of file
diff --git a/db/schema_migrations/20230523125430 b/db/schema_migrations/20230523125430
new file mode 100644
index 00000000000..9d0b8e8d289
--- /dev/null
+++ b/db/schema_migrations/20230523125430
@@ -0,0 +1 @@
+75c06f09e255289919d30c3cb9514c9c76f8510c689a23f4341bcd7948b8dae4 \ No newline at end of file
diff --git a/db/schema_migrations/20230523131914 b/db/schema_migrations/20230523131914
new file mode 100644
index 00000000000..1b7c9249f59
--- /dev/null
+++ b/db/schema_migrations/20230523131914
@@ -0,0 +1 @@
+3e5b2d18d3e0b7c573860c256cc3e6badfd79606f6822b9a108777f2d311f108 \ No newline at end of file
diff --git a/db/schema_migrations/20230523132647 b/db/schema_migrations/20230523132647
new file mode 100644
index 00000000000..056ca2315af
--- /dev/null
+++ b/db/schema_migrations/20230523132647
@@ -0,0 +1 @@
+852a190346dc674f5ddb0890c0daa5a3066beba73c638ffa48b8cdde7f1809bc \ No newline at end of file
diff --git a/db/schema_migrations/20230523210653 b/db/schema_migrations/20230523210653
new file mode 100644
index 00000000000..0f72d2ef778
--- /dev/null
+++ b/db/schema_migrations/20230523210653
@@ -0,0 +1 @@
+20696f0e2e6e7bc7df4696fd91e621538f7a2f8f55e2059bc83f0081811bc365 \ No newline at end of file
diff --git a/db/schema_migrations/20230523210758 b/db/schema_migrations/20230523210758
new file mode 100644
index 00000000000..b9e5467643a
--- /dev/null
+++ b/db/schema_migrations/20230523210758
@@ -0,0 +1 @@
+5cae86aed3b05da49cfa963f0c601763ef433839be4360b6280f8f66f60b279d \ No newline at end of file
diff --git a/db/schema_migrations/20230524012641 b/db/schema_migrations/20230524012641
new file mode 100644
index 00000000000..7f01ad8b013
--- /dev/null
+++ b/db/schema_migrations/20230524012641
@@ -0,0 +1 @@
+3fa8bd64992a6c1bf7d9dc1d9fca2173b425df72d9b5e44fcc72ebbca93d3995 \ No newline at end of file
diff --git a/db/schema_migrations/20230524093249 b/db/schema_migrations/20230524093249
new file mode 100644
index 00000000000..1421e0aad4e
--- /dev/null
+++ b/db/schema_migrations/20230524093249
@@ -0,0 +1 @@
+82219f2b9352956f8e9d116d003236603442b9eae70406d814dcc2199ca512f7 \ No newline at end of file
diff --git a/db/schema_migrations/20230524093355 b/db/schema_migrations/20230524093355
new file mode 100644
index 00000000000..399d33043da
--- /dev/null
+++ b/db/schema_migrations/20230524093355
@@ -0,0 +1 @@
+962b8a385dc47c892fc3a55542ec5dcb9426e60084418549dcbca438bc804bdd \ No newline at end of file
diff --git a/db/schema_migrations/20230524095108 b/db/schema_migrations/20230524095108
new file mode 100644
index 00000000000..8b898896b78
--- /dev/null
+++ b/db/schema_migrations/20230524095108
@@ -0,0 +1 @@
+1cafb842d106d59f63dc12d4cdb215af023f8a6d19d80cbd69af3de51f5d4bac \ No newline at end of file
diff --git a/db/schema_migrations/20230524120241 b/db/schema_migrations/20230524120241
new file mode 100644
index 00000000000..ae2b35d899f
--- /dev/null
+++ b/db/schema_migrations/20230524120241
@@ -0,0 +1 @@
+3709d98612eca5bfe996c20770b313322cde010fbf5b1e69c8ef688a456e1ace \ No newline at end of file
diff --git a/db/schema_migrations/20230524135543 b/db/schema_migrations/20230524135543
new file mode 100644
index 00000000000..6f8f62289e8
--- /dev/null
+++ b/db/schema_migrations/20230524135543
@@ -0,0 +1 @@
+95b28bcaa72d53bfdc7430407c89eac7a59016b9317e44214dbb968cc3b41723 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135555 b/db/schema_migrations/20230524135555
new file mode 100644
index 00000000000..70746a5ad83
--- /dev/null
+++ b/db/schema_migrations/20230524135555
@@ -0,0 +1 @@
+ee90ed971ac9b67e539e367621b5bcefdf583ae9e53a1add59a70c3168035e26 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135607 b/db/schema_migrations/20230524135607
new file mode 100644
index 00000000000..f4e535a7736
--- /dev/null
+++ b/db/schema_migrations/20230524135607
@@ -0,0 +1 @@
+88c6b1d18c6c9b74b7be1831cd692f5004d04ca0d1e190eb5e1a2e079cfed50d \ No newline at end of file
diff --git a/db/schema_migrations/20230524135620 b/db/schema_migrations/20230524135620
new file mode 100644
index 00000000000..1d09b6cc98a
--- /dev/null
+++ b/db/schema_migrations/20230524135620
@@ -0,0 +1 @@
+a04c487f7d900c7108fcdd6957ac70ff1f00797bb2d503c50849edaeb500f561 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135632 b/db/schema_migrations/20230524135632
new file mode 100644
index 00000000000..14610334452
--- /dev/null
+++ b/db/schema_migrations/20230524135632
@@ -0,0 +1 @@
+ecd3ca58470c44d3138416b77e9af8ad5583debe55e925d7ada4e9694c2ebc9f \ No newline at end of file
diff --git a/db/schema_migrations/20230524135645 b/db/schema_migrations/20230524135645
new file mode 100644
index 00000000000..97083156370
--- /dev/null
+++ b/db/schema_migrations/20230524135645
@@ -0,0 +1 @@
+47468406daedd3dbfc3dcc7841d8139fa8a6981acd71343ff873d83cd8dc7a66 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135658 b/db/schema_migrations/20230524135658
new file mode 100644
index 00000000000..1167d0d3db3
--- /dev/null
+++ b/db/schema_migrations/20230524135658
@@ -0,0 +1 @@
+4f8cf41b2f65f2033769788fd271ea8b77b998c5ce186cc332942417e2bf9b62 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135711 b/db/schema_migrations/20230524135711
new file mode 100644
index 00000000000..58f892c964a
--- /dev/null
+++ b/db/schema_migrations/20230524135711
@@ -0,0 +1 @@
+157a4ab1510c029cc65e78bd7f41446fb39be4504f39362eda7e2552fd3f3697 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135724 b/db/schema_migrations/20230524135724
new file mode 100644
index 00000000000..bd8039b1547
--- /dev/null
+++ b/db/schema_migrations/20230524135724
@@ -0,0 +1 @@
+89ed7b769afadb76236dd9392cf06656177fa572ffc26c9e4c19035c28bdc445 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135737 b/db/schema_migrations/20230524135737
new file mode 100644
index 00000000000..af46dc6fe38
--- /dev/null
+++ b/db/schema_migrations/20230524135737
@@ -0,0 +1 @@
+463414e049c5e3ddf7eb61e33cd08d66bf0cb244de7e6395feacb4ed4b7885fe \ No newline at end of file
diff --git a/db/schema_migrations/20230524135750 b/db/schema_migrations/20230524135750
new file mode 100644
index 00000000000..ef09aa2412f
--- /dev/null
+++ b/db/schema_migrations/20230524135750
@@ -0,0 +1 @@
+df54efbd38edbea5409cd01d3c82457dfae985ae475db5fa4076ee99eeda320c \ No newline at end of file
diff --git a/db/schema_migrations/20230524135803 b/db/schema_migrations/20230524135803
new file mode 100644
index 00000000000..604664e0291
--- /dev/null
+++ b/db/schema_migrations/20230524135803
@@ -0,0 +1 @@
+f348cf0f6dab2252143f802d85983a660fe21501a17b771bdbc5507e5ff6a5ca \ No newline at end of file
diff --git a/db/schema_migrations/20230524135815 b/db/schema_migrations/20230524135815
new file mode 100644
index 00000000000..85aa04da3a9
--- /dev/null
+++ b/db/schema_migrations/20230524135815
@@ -0,0 +1 @@
+9914afc99657b855caba9e083c66c71863c199c0e0fe3d1331a87a12b327cf7d \ No newline at end of file
diff --git a/db/schema_migrations/20230524135828 b/db/schema_migrations/20230524135828
new file mode 100644
index 00000000000..557404d10bd
--- /dev/null
+++ b/db/schema_migrations/20230524135828
@@ -0,0 +1 @@
+f885a506e2176cec1de13d708dbd68a1ae6912f738079d6f5cce272687c2afb9 \ No newline at end of file
diff --git a/db/schema_migrations/20230524135840 b/db/schema_migrations/20230524135840
new file mode 100644
index 00000000000..2d50808bfd8
--- /dev/null
+++ b/db/schema_migrations/20230524135840
@@ -0,0 +1 @@
+52632ee5e346f88fa1e00c8d99a210e79aa2718da09ebe1c0aa468b872779dd4 \ No newline at end of file
diff --git a/db/schema_migrations/20230524142655 b/db/schema_migrations/20230524142655
new file mode 100644
index 00000000000..35aa474f5dd
--- /dev/null
+++ b/db/schema_migrations/20230524142655
@@ -0,0 +1 @@
+81f0d62ff5c06d5c34984dae613535d7ffbe9f0f3b25d2a694c5607e5e590805 \ No newline at end of file
diff --git a/db/schema_migrations/20230524150232 b/db/schema_migrations/20230524150232
new file mode 100644
index 00000000000..c25f1a6ab47
--- /dev/null
+++ b/db/schema_migrations/20230524150232
@@ -0,0 +1 @@
+073d817772476d9d32fa623547fb711c9e6890f507b974272fe8bca4e5c17a83 \ No newline at end of file
diff --git a/db/schema_migrations/20230524150438 b/db/schema_migrations/20230524150438
new file mode 100644
index 00000000000..0e4efed2240
--- /dev/null
+++ b/db/schema_migrations/20230524150438
@@ -0,0 +1 @@
+093e6faef2171b8d7ab75bc096cfe140d5c595f113a911ca000529cf66f6eb6d \ No newline at end of file
diff --git a/db/schema_migrations/20230524201454 b/db/schema_migrations/20230524201454
new file mode 100644
index 00000000000..1f4d660033c
--- /dev/null
+++ b/db/schema_migrations/20230524201454
@@ -0,0 +1 @@
+65b99cce227ef0a66cc83624170c680cc6edf72bd7e30e7c562104f4dbebabf9 \ No newline at end of file
diff --git a/db/schema_migrations/20230525064706 b/db/schema_migrations/20230525064706
new file mode 100644
index 00000000000..dbd9a6a5425
--- /dev/null
+++ b/db/schema_migrations/20230525064706
@@ -0,0 +1 @@
+e532fbf81ec8ce67616f93945c7ac384ff491410227a388aff7a2a01c43e4f2a \ No newline at end of file
diff --git a/db/schema_migrations/20230525180605 b/db/schema_migrations/20230525180605
new file mode 100644
index 00000000000..19a40a0d20d
--- /dev/null
+++ b/db/schema_migrations/20230525180605
@@ -0,0 +1 @@
+004443f655b7fd50d161cd529839925b446a9aba6f62d58d710379b91ed72f1d \ No newline at end of file
diff --git a/db/schema_migrations/20230529163335 b/db/schema_migrations/20230529163335
new file mode 100644
index 00000000000..5a165b81efa
--- /dev/null
+++ b/db/schema_migrations/20230529163335
@@ -0,0 +1 @@
+91e92552fb6283fd1d796c057418bf1f8346f7834eea324aab0fa82f0277c51b \ No newline at end of file
diff --git a/db/schema_migrations/20230529173607 b/db/schema_migrations/20230529173607
new file mode 100644
index 00000000000..f0f22512414
--- /dev/null
+++ b/db/schema_migrations/20230529173607
@@ -0,0 +1 @@
+5b2b9a7c58ed2153a70e4f32dbd8a4c4c9976afce478d761ced2ae9de43ea377 \ No newline at end of file
diff --git a/db/schema_migrations/20230529182720 b/db/schema_migrations/20230529182720
new file mode 100644
index 00000000000..a232e2ea178
--- /dev/null
+++ b/db/schema_migrations/20230529182720
@@ -0,0 +1 @@
+8d56850b0b02aa7237c5a31c7c98f0db96e20a4d4fb0a0646482bc75bcadf615 \ No newline at end of file
diff --git a/db/schema_migrations/20230529183648 b/db/schema_migrations/20230529183648
new file mode 100644
index 00000000000..c4d08703216
--- /dev/null
+++ b/db/schema_migrations/20230529183648
@@ -0,0 +1 @@
+32991a8e920d92c6f1bff2754d2af44ed816602aa5a29012b5884ee3a017bdee \ No newline at end of file
diff --git a/db/schema_migrations/20230529184716 b/db/schema_migrations/20230529184716
new file mode 100644
index 00000000000..da1f596ea77
--- /dev/null
+++ b/db/schema_migrations/20230529184716
@@ -0,0 +1 @@
+b3f7215cdec2da13bc1ca4f656ec7f7a356155e6e656baac388023a1231fe19d \ No newline at end of file
diff --git a/db/schema_migrations/20230529185110 b/db/schema_migrations/20230529185110
new file mode 100644
index 00000000000..eab98ff6549
--- /dev/null
+++ b/db/schema_migrations/20230529185110
@@ -0,0 +1 @@
+6a3f8302ec88005555e91b6192476b49a1d032ce2c7f414cf9a908df16f93b3f \ No newline at end of file
diff --git a/db/schema_migrations/20230530003417 b/db/schema_migrations/20230530003417
new file mode 100644
index 00000000000..e75305f71a8
--- /dev/null
+++ b/db/schema_migrations/20230530003417
@@ -0,0 +1 @@
+4604d184499892cace131232cdf728745b0e616261bdcfa6acd5ff304056759b \ No newline at end of file
diff --git a/db/schema_migrations/20230530003634 b/db/schema_migrations/20230530003634
new file mode 100644
index 00000000000..28f38a3d676
--- /dev/null
+++ b/db/schema_migrations/20230530003634
@@ -0,0 +1 @@
+0c2334dff5bb442d05e9b4c5cfe03128dfebf8d085625ce9df1b7bdc33ed439c \ No newline at end of file
diff --git a/db/schema_migrations/20230530015535 b/db/schema_migrations/20230530015535
new file mode 100644
index 00000000000..cfc95b4db06
--- /dev/null
+++ b/db/schema_migrations/20230530015535
@@ -0,0 +1 @@
+29516b4b02e3feda356c99c7e0b3a1011de830c38781ad61ce4cb3650559e1ee \ No newline at end of file
diff --git a/db/schema_migrations/20230530100400 b/db/schema_migrations/20230530100400
new file mode 100644
index 00000000000..c27ba5036fb
--- /dev/null
+++ b/db/schema_migrations/20230530100400
@@ -0,0 +1 @@
+b25dec0fa0c5fb952ba29561d9bbc9364e8459f8a381f776b6a2bd99100be239 \ No newline at end of file
diff --git a/db/schema_migrations/20230530112122 b/db/schema_migrations/20230530112122
new file mode 100644
index 00000000000..6c8fc76ba31
--- /dev/null
+++ b/db/schema_migrations/20230530112122
@@ -0,0 +1 @@
+f42b0e96388af93c226418f09c2b81a31677f9ba9fe10aa357f2b88ea1d415d8 \ No newline at end of file
diff --git a/db/schema_migrations/20230530112602 b/db/schema_migrations/20230530112602
new file mode 100644
index 00000000000..4d1e17322d8
--- /dev/null
+++ b/db/schema_migrations/20230530112602
@@ -0,0 +1 @@
+81dca424fac6ac462d15b8bb03bb272de970f6a701b3cbd78e86587bfa2a5733 \ No newline at end of file
diff --git a/db/schema_migrations/20230530114845 b/db/schema_migrations/20230530114845
new file mode 100644
index 00000000000..57327b54419
--- /dev/null
+++ b/db/schema_migrations/20230530114845
@@ -0,0 +1 @@
+442196dbc3b0e8669e697971cf74b1235d35211ea6db1d861eca80dd277e7f9a \ No newline at end of file
diff --git a/db/schema_migrations/20230530115830 b/db/schema_migrations/20230530115830
new file mode 100644
index 00000000000..99371531685
--- /dev/null
+++ b/db/schema_migrations/20230530115830
@@ -0,0 +1 @@
+6e78a4ca76337129033cc9660ac203eb12187665ab5bb404fe6d8e3e5764365b \ No newline at end of file
diff --git a/db/schema_migrations/20230530140456 b/db/schema_migrations/20230530140456
new file mode 100644
index 00000000000..c0655e8c696
--- /dev/null
+++ b/db/schema_migrations/20230530140456
@@ -0,0 +1 @@
+21784b0f64cadd7e042ef1f749734f36a9c75dab191b52b54abdf446ef0165ae \ No newline at end of file
diff --git a/db/schema_migrations/20230530140509 b/db/schema_migrations/20230530140509
new file mode 100644
index 00000000000..f841985a028
--- /dev/null
+++ b/db/schema_migrations/20230530140509
@@ -0,0 +1 @@
+4331529950dc93a211f0e367aa9b24beef89406c55f86d37848cad082d10cc4c \ No newline at end of file
diff --git a/db/schema_migrations/20230530140521 b/db/schema_migrations/20230530140521
new file mode 100644
index 00000000000..3217b3d5f79
--- /dev/null
+++ b/db/schema_migrations/20230530140521
@@ -0,0 +1 @@
+14e7ccf0a930dde1369c7dcd0fc6a8719daccf461efbb2f6abb9ddc33beef670 \ No newline at end of file
diff --git a/db/schema_migrations/20230530140534 b/db/schema_migrations/20230530140534
new file mode 100644
index 00000000000..50232dfe0ca
--- /dev/null
+++ b/db/schema_migrations/20230530140534
@@ -0,0 +1 @@
+2ffca5ebb17dacbea2ec15ba6496db4c1cf02501dcc420a5e2853792c78c1e61 \ No newline at end of file
diff --git a/db/schema_migrations/20230530140546 b/db/schema_migrations/20230530140546
new file mode 100644
index 00000000000..9e7a59023a8
--- /dev/null
+++ b/db/schema_migrations/20230530140546
@@ -0,0 +1 @@
+3be698933e9c19c8723bb02950bda4948fa2ba70782aee59e4103566cb38804f \ No newline at end of file
diff --git a/db/schema_migrations/20230530140558 b/db/schema_migrations/20230530140558
new file mode 100644
index 00000000000..66d3798b6d9
--- /dev/null
+++ b/db/schema_migrations/20230530140558
@@ -0,0 +1 @@
+f8f4a9cc99a61bc5d9ab630e9d240470a7584e755277b73d8b434a1348b6063a \ No newline at end of file
diff --git a/db/schema_migrations/20230530140611 b/db/schema_migrations/20230530140611
new file mode 100644
index 00000000000..a34c2af3643
--- /dev/null
+++ b/db/schema_migrations/20230530140611
@@ -0,0 +1 @@
+8ef2b55c4da3b3c5b975b9cc3e8d71c6db90a7f9288e6edb4fd828f82c545e11 \ No newline at end of file
diff --git a/db/schema_migrations/20230530140623 b/db/schema_migrations/20230530140623
new file mode 100644
index 00000000000..5a98eaf1236
--- /dev/null
+++ b/db/schema_migrations/20230530140623
@@ -0,0 +1 @@
+b0384e0289bb98ffde357520d553484146be9e1a91abc916a1ad5ecf41e57ae8 \ No newline at end of file
diff --git a/db/schema_migrations/20230530140634 b/db/schema_migrations/20230530140634
new file mode 100644
index 00000000000..81d15a8b790
--- /dev/null
+++ b/db/schema_migrations/20230530140634
@@ -0,0 +1 @@
+fe8957b8fa9ecc302f622a6282633f6dc1b93c007f1d66a5bfc88154bbbf9e24 \ No newline at end of file
diff --git a/db/schema_migrations/20230530140646 b/db/schema_migrations/20230530140646
new file mode 100644
index 00000000000..f52e19736b1
--- /dev/null
+++ b/db/schema_migrations/20230530140646
@@ -0,0 +1 @@
+08044e26d8e3d1c721665541179a8d968db6b62d479d0761e66421df9e4c64d9 \ No newline at end of file
diff --git a/db/schema_migrations/20230530162437 b/db/schema_migrations/20230530162437
new file mode 100644
index 00000000000..0669629e95a
--- /dev/null
+++ b/db/schema_migrations/20230530162437
@@ -0,0 +1 @@
+b07828fad996d20f523d7d5b19da2c10e0faa3fe0784a8e314b6db077cbd99c8 \ No newline at end of file
diff --git a/db/schema_migrations/20230531054422 b/db/schema_migrations/20230531054422
new file mode 100644
index 00000000000..f038ca979e0
--- /dev/null
+++ b/db/schema_migrations/20230531054422
@@ -0,0 +1 @@
+5fadce4dbc2280ca1d68f8271f4d44ea3c492769b65ebb1d8f2ae94cfb6d6c75 \ No newline at end of file
diff --git a/db/schema_migrations/20230531134916 b/db/schema_migrations/20230531134916
new file mode 100644
index 00000000000..5cf00727101
--- /dev/null
+++ b/db/schema_migrations/20230531134916
@@ -0,0 +1 @@
+fc2e3d8e6aca7b00569340b0468488a4b0545b39e67857a5b40824f6d0a62a97 \ No newline at end of file
diff --git a/db/schema_migrations/20230531135001 b/db/schema_migrations/20230531135001
new file mode 100644
index 00000000000..32850b297da
--- /dev/null
+++ b/db/schema_migrations/20230531135001
@@ -0,0 +1 @@
+1a672c9412b8ceeec35fd375bf86dde325781c9cb94340995d2cab4bb804e4bf \ No newline at end of file
diff --git a/db/schema_migrations/20230531142032 b/db/schema_migrations/20230531142032
new file mode 100644
index 00000000000..bae2817773a
--- /dev/null
+++ b/db/schema_migrations/20230531142032
@@ -0,0 +1 @@
+3e77f991a4daa9756b541255e3b8da9d8accb52a5a4b625613771982e3dff3b5 \ No newline at end of file
diff --git a/db/schema_migrations/20230531142053 b/db/schema_migrations/20230531142053
new file mode 100644
index 00000000000..55da4601012
--- /dev/null
+++ b/db/schema_migrations/20230531142053
@@ -0,0 +1 @@
+0a4b3b8848f486e34e1f0426bae4e15f67e851447fc3fe397cf2039e03b185b5 \ No newline at end of file
diff --git a/db/schema_migrations/20230531164258 b/db/schema_migrations/20230531164258
new file mode 100644
index 00000000000..d83c75990cf
--- /dev/null
+++ b/db/schema_migrations/20230531164258
@@ -0,0 +1 @@
+e149178598dcfaadb8c56107a0c3f4bff7a8e942968fb879c479c7d1a8cca401 \ No newline at end of file
diff --git a/db/schema_migrations/20230531165731 b/db/schema_migrations/20230531165731
new file mode 100644
index 00000000000..6463d3cf3b3
--- /dev/null
+++ b/db/schema_migrations/20230531165731
@@ -0,0 +1 @@
+83ec5273ae18c7dc8f554373df9c09e5b771912d5f093f455dd1e919a680e6ca \ No newline at end of file
diff --git a/db/schema_migrations/20230601035558 b/db/schema_migrations/20230601035558
new file mode 100644
index 00000000000..ca8db670ce6
--- /dev/null
+++ b/db/schema_migrations/20230601035558
@@ -0,0 +1 @@
+fd3d95427744b03f8bf58a5b172ad05f26ef6d1855440c39524b9e9d92617c3a \ No newline at end of file
diff --git a/db/schema_migrations/20230601084041 b/db/schema_migrations/20230601084041
new file mode 100644
index 00000000000..7eac90f4c33
--- /dev/null
+++ b/db/schema_migrations/20230601084041
@@ -0,0 +1 @@
+c64ff0998a0cd143f98c3b2461f71ddadafac5e3834c6980d658e390d1533dd9 \ No newline at end of file
diff --git a/db/schema_migrations/20230601085810 b/db/schema_migrations/20230601085810
new file mode 100644
index 00000000000..097289312cf
--- /dev/null
+++ b/db/schema_migrations/20230601085810
@@ -0,0 +1 @@
+a4a4414391127d2397a77b71268293b3138e3b8a9339e9b330dd39546c84c20d \ No newline at end of file
diff --git a/db/schema_migrations/20230601085815 b/db/schema_migrations/20230601085815
new file mode 100644
index 00000000000..976aff98227
--- /dev/null
+++ b/db/schema_migrations/20230601085815
@@ -0,0 +1 @@
+6f01da9082c19f595e17fbcb4c07c6c8d87b68fa7b1ce0083bad5f4e77841d4e \ No newline at end of file
diff --git a/db/schema_migrations/20230601085820 b/db/schema_migrations/20230601085820
new file mode 100644
index 00000000000..8a84b934500
--- /dev/null
+++ b/db/schema_migrations/20230601085820
@@ -0,0 +1 @@
+55ced52ffaf54ecf9b2c97b1088bef1210208227a7a46ddfaca1bf6c70873462 \ No newline at end of file
diff --git a/db/schema_migrations/20230601184234 b/db/schema_migrations/20230601184234
new file mode 100644
index 00000000000..1b490eaf30d
--- /dev/null
+++ b/db/schema_migrations/20230601184234
@@ -0,0 +1 @@
+4dcfbb2dc0168ab14a30e27d655910a56c2ad2585a4769ebceb22077dd8dd839 \ No newline at end of file
diff --git a/db/schema_migrations/20230602063059 b/db/schema_migrations/20230602063059
new file mode 100644
index 00000000000..53ae46fb8f5
--- /dev/null
+++ b/db/schema_migrations/20230602063059
@@ -0,0 +1 @@
+915530f0de68a448bb9c88572896dc0979a38b5624dc5006811a4c635e35c71e \ No newline at end of file
diff --git a/db/schema_migrations/20230602112904 b/db/schema_migrations/20230602112904
new file mode 100644
index 00000000000..9384d768b54
--- /dev/null
+++ b/db/schema_migrations/20230602112904
@@ -0,0 +1 @@
+de2fe5c2a2669efb9ed0e17442e11a6e1d85d2eabe5e8a9810251e2bc85d4466 \ No newline at end of file
diff --git a/db/schema_migrations/20230602131429 b/db/schema_migrations/20230602131429
new file mode 100644
index 00000000000..f0b2a856eca
--- /dev/null
+++ b/db/schema_migrations/20230602131429
@@ -0,0 +1 @@
+0e1fe8e6e8367a7b000e622636125db9c43463e789bbb97774407506500bd0cd \ No newline at end of file
diff --git a/db/schema_migrations/20230603174306 b/db/schema_migrations/20230603174306
new file mode 100644
index 00000000000..04cbccbd92d
--- /dev/null
+++ b/db/schema_migrations/20230603174306
@@ -0,0 +1 @@
+454e3d39b12034fc319c528d7bca658b066bf150b9e75f3d51af127fe1f46289 \ No newline at end of file
diff --git a/db/schema_migrations/20230605043258 b/db/schema_migrations/20230605043258
new file mode 100644
index 00000000000..54c14183c51
--- /dev/null
+++ b/db/schema_migrations/20230605043258
@@ -0,0 +1 @@
+c2c3012773050935afbcaaf1ca223e94d8fed23b079e00a95d423f4d3d53cf60 \ No newline at end of file
diff --git a/db/schema_migrations/20230605043814 b/db/schema_migrations/20230605043814
new file mode 100644
index 00000000000..067917a1bd2
--- /dev/null
+++ b/db/schema_migrations/20230605043814
@@ -0,0 +1 @@
+f03ee1653d68dee14261380f8dd270d849133c33403eceb310999bc22cbe4084 \ No newline at end of file
diff --git a/db/schema_migrations/20230605085936 b/db/schema_migrations/20230605085936
new file mode 100644
index 00000000000..f8b9df81c0d
--- /dev/null
+++ b/db/schema_migrations/20230605085936
@@ -0,0 +1 @@
+8e78d4837a56de399861b4ec7ef4052a5df486834f8a97496a9bc51765413379 \ No newline at end of file
diff --git a/db/schema_migrations/20230605085957 b/db/schema_migrations/20230605085957
new file mode 100644
index 00000000000..be5ad58e0f3
--- /dev/null
+++ b/db/schema_migrations/20230605085957
@@ -0,0 +1 @@
+bfe04f7c677a6703fc1476079c8f2f48c860747a73c4d16d58bebee31fff5ec9 \ No newline at end of file
diff --git a/db/schema_migrations/20230605093005 b/db/schema_migrations/20230605093005
new file mode 100644
index 00000000000..273961a1f40
--- /dev/null
+++ b/db/schema_migrations/20230605093005
@@ -0,0 +1 @@
+df354a2edec37d3b09bc9deebe895637f8a86c90ffb2569cefe6d791458a65ba \ No newline at end of file
diff --git a/db/schema_migrations/20230605095810 b/db/schema_migrations/20230605095810
new file mode 100644
index 00000000000..7d8d7bb7fd5
--- /dev/null
+++ b/db/schema_migrations/20230605095810
@@ -0,0 +1 @@
+8703eac92c20c68dc7ff20a94b788e1c5115c2e5b6b665ada428cfa24a5958db \ No newline at end of file
diff --git a/db/schema_migrations/20230605192000 b/db/schema_migrations/20230605192000
new file mode 100644
index 00000000000..503275e177f
--- /dev/null
+++ b/db/schema_migrations/20230605192000
@@ -0,0 +1 @@
+854fe8f8aacba841ee3e7c89624bcde6951e71a936fd48e7fd871dd4232269f3 \ No newline at end of file
diff --git a/db/schema_migrations/20230606124754 b/db/schema_migrations/20230606124754
new file mode 100644
index 00000000000..28485780317
--- /dev/null
+++ b/db/schema_migrations/20230606124754
@@ -0,0 +1 @@
+490dc775459b89701c9531c7d10698734e47bd22a17aca07df12f8ac5a6d38e9 \ No newline at end of file
diff --git a/db/schema_migrations/20230606124854 b/db/schema_migrations/20230606124854
new file mode 100644
index 00000000000..db75e3358c4
--- /dev/null
+++ b/db/schema_migrations/20230606124854
@@ -0,0 +1 @@
+dd1cf7175a283e60af315372d96ea6836aff4e678830ab9b9d8e3367dc351c92 \ No newline at end of file
diff --git a/db/schema_migrations/20230606124855 b/db/schema_migrations/20230606124855
new file mode 100644
index 00000000000..2d919d1a1c4
--- /dev/null
+++ b/db/schema_migrations/20230606124855
@@ -0,0 +1 @@
+afe649b351bee4ec7152d465a73c35e4356d947c25fec727db2b4e38f268da41 \ No newline at end of file
diff --git a/db/schema_migrations/20230606124856 b/db/schema_migrations/20230606124856
new file mode 100644
index 00000000000..1b81ad76033
--- /dev/null
+++ b/db/schema_migrations/20230606124856
@@ -0,0 +1 @@
+df3b650081b827ab465aa0bf35b30a8fcb81a0c3609caecfa30e71d71761c809 \ No newline at end of file
diff --git a/db/schema_migrations/20230606182433 b/db/schema_migrations/20230606182433
new file mode 100644
index 00000000000..e08f3f5fdc1
--- /dev/null
+++ b/db/schema_migrations/20230606182433
@@ -0,0 +1 @@
+987987571003b905a1f05c07fbe4119bdb077c54752a7379499969c6979964a1 \ No newline at end of file
diff --git a/db/schema_migrations/20230606183327 b/db/schema_migrations/20230606183327
new file mode 100644
index 00000000000..d3d4b811eea
--- /dev/null
+++ b/db/schema_migrations/20230606183327
@@ -0,0 +1 @@
+a6fbd8a132215155117646648c8d44af158c2578563fc02d7705b8608b61eee4 \ No newline at end of file
diff --git a/db/schema_migrations/20230606193037 b/db/schema_migrations/20230606193037
new file mode 100644
index 00000000000..181a1a89ef9
--- /dev/null
+++ b/db/schema_migrations/20230606193037
@@ -0,0 +1 @@
+0537c5c23fc1a7e65780157a9bc4ee8db8a5d064779832c699222c5ab2e6e0eb \ No newline at end of file
diff --git a/db/schema_migrations/20230607080200 b/db/schema_migrations/20230607080200
new file mode 100644
index 00000000000..40d108b3590
--- /dev/null
+++ b/db/schema_migrations/20230607080200
@@ -0,0 +1 @@
+056459290c9fdced219b524418237e183540aa1aa97c9e3aeab637a005a04bea \ No newline at end of file
diff --git a/db/schema_migrations/20230607093222 b/db/schema_migrations/20230607093222
new file mode 100644
index 00000000000..94230685b2c
--- /dev/null
+++ b/db/schema_migrations/20230607093222
@@ -0,0 +1 @@
+f2357daf5c6e21e2695987894aec547b44bb792b087dd0a46eee0b51f66285fe \ No newline at end of file
diff --git a/db/schema_migrations/20230607101334 b/db/schema_migrations/20230607101334
new file mode 100644
index 00000000000..b77753aeb92
--- /dev/null
+++ b/db/schema_migrations/20230607101334
@@ -0,0 +1 @@
+b806f1e1cd7aed2400b8cdfae6abaa0a71ea4ac3e3280fb7b188104356b14eef \ No newline at end of file
diff --git a/db/schema_migrations/20230607102017 b/db/schema_migrations/20230607102017
new file mode 100644
index 00000000000..a753dd25d86
--- /dev/null
+++ b/db/schema_migrations/20230607102017
@@ -0,0 +1 @@
+ba5e05f3be87f4e7176eadb1f560fd7da45ab5a44d2928c811316a6ddef2c798 \ No newline at end of file
diff --git a/db/schema_migrations/20230607102721 b/db/schema_migrations/20230607102721
new file mode 100644
index 00000000000..4fd49784c7f
--- /dev/null
+++ b/db/schema_migrations/20230607102721
@@ -0,0 +1 @@
+78c1ea40259ac9f6d4087d24ce5f3b4be13009a93c8fab88594bcd64859c7ec5 \ No newline at end of file
diff --git a/db/schema_migrations/20230607102731 b/db/schema_migrations/20230607102731
new file mode 100644
index 00000000000..be16c7c03a9
--- /dev/null
+++ b/db/schema_migrations/20230607102731
@@ -0,0 +1 @@
+8b9382a9d76f6decebb19a8268c58bd3ee2bb9a83b2d79e541e47987211e41f7 \ No newline at end of file
diff --git a/db/schema_migrations/20230607165632 b/db/schema_migrations/20230607165632
new file mode 100644
index 00000000000..f3bf5f71521
--- /dev/null
+++ b/db/schema_migrations/20230607165632
@@ -0,0 +1 @@
+97cb755e20cebc2517a73aed85491fb6348a49cbf97c4f3e02e6e0d700c7ad27 \ No newline at end of file
diff --git a/db/schema_migrations/20230607165718 b/db/schema_migrations/20230607165718
new file mode 100644
index 00000000000..1e82b3551bb
--- /dev/null
+++ b/db/schema_migrations/20230607165718
@@ -0,0 +1 @@
+5952f90d7d6b6e98d25ff85ac98299bb8b274cdaaacae7d9dff91226733aa32b \ No newline at end of file
diff --git a/db/schema_migrations/20230608071301 b/db/schema_migrations/20230608071301
new file mode 100644
index 00000000000..c990876d029
--- /dev/null
+++ b/db/schema_migrations/20230608071301
@@ -0,0 +1 @@
+1b351251391721ad1663e3a520cdde8520378b1b6a3496339f1cdaaaa04310bc \ No newline at end of file
diff --git a/db/schema_migrations/20230608081257 b/db/schema_migrations/20230608081257
new file mode 100644
index 00000000000..1e637e22e14
--- /dev/null
+++ b/db/schema_migrations/20230608081257
@@ -0,0 +1 @@
+cba57f523bb3d233ce1f7a0447ee25e37dafcd4ae3cd8a02ef052136e36b0938 \ No newline at end of file
diff --git a/db/schema_migrations/20230608081924 b/db/schema_migrations/20230608081924
new file mode 100644
index 00000000000..1db529907a1
--- /dev/null
+++ b/db/schema_migrations/20230608081924
@@ -0,0 +1 @@
+24b2ac86b56c1eb32409d921dfba52dc9f9ba6817c9aa19ae5058d46926e79ce \ No newline at end of file
diff --git a/db/schema_migrations/20230608101503 b/db/schema_migrations/20230608101503
new file mode 100644
index 00000000000..ee470820d86
--- /dev/null
+++ b/db/schema_migrations/20230608101503
@@ -0,0 +1 @@
+28a1bb5c35d928096f8a6165747934f1d76d9ebcc5fa6891ffc66de6f7413bfe \ No newline at end of file
diff --git a/db/schema_migrations/20230608195429 b/db/schema_migrations/20230608195429
new file mode 100644
index 00000000000..98160bb833a
--- /dev/null
+++ b/db/schema_migrations/20230608195429
@@ -0,0 +1 @@
+d197bce429eac614d825a6e4a21d302b426dd17221e5fb0eb09a7bb39f140679 \ No newline at end of file
diff --git a/db/schema_migrations/20230608231452 b/db/schema_migrations/20230608231452
new file mode 100644
index 00000000000..5fabdf1da3b
--- /dev/null
+++ b/db/schema_migrations/20230608231452
@@ -0,0 +1 @@
+23a2b03a241a52dd898d55b4440195dee84d1bf638176a1c56d5ea27ecf895e4 \ No newline at end of file
diff --git a/db/schema_migrations/20230608232452 b/db/schema_migrations/20230608232452
new file mode 100644
index 00000000000..16d8725ff86
--- /dev/null
+++ b/db/schema_migrations/20230608232452
@@ -0,0 +1 @@
+525048a3306c63d37d30d93377e4210c0bf65d680d0191b6981f464829e502bb \ No newline at end of file
diff --git a/db/schema_migrations/20230608233452 b/db/schema_migrations/20230608233452
new file mode 100644
index 00000000000..5a87b7fd027
--- /dev/null
+++ b/db/schema_migrations/20230608233452
@@ -0,0 +1 @@
+d87c28da8a8155060b2913e7e2fea95353c6512bc013a50f6b3360332307c930 \ No newline at end of file
diff --git a/db/schema_migrations/20230608234452 b/db/schema_migrations/20230608234452
new file mode 100644
index 00000000000..5cace1b6335
--- /dev/null
+++ b/db/schema_migrations/20230608234452
@@ -0,0 +1 @@
+2d03e7e6d73f655b164251c7b504d695179a345f88cdea9304dc0efec94b573d \ No newline at end of file
diff --git a/db/schema_migrations/20230608235452 b/db/schema_migrations/20230608235452
new file mode 100644
index 00000000000..34ed071830c
--- /dev/null
+++ b/db/schema_migrations/20230608235452
@@ -0,0 +1 @@
+570b154e7c912e75b7ffb899b809eb5aeead6c6fc8b427db8342a5df25a0734b \ No newline at end of file
diff --git a/db/schema_migrations/20230609000452 b/db/schema_migrations/20230609000452
new file mode 100644
index 00000000000..acd2130c554
--- /dev/null
+++ b/db/schema_migrations/20230609000452
@@ -0,0 +1 @@
+4ebf7479ab3d40be6b8dbcfad034c62ce6cd66a9118da85f8344e68b5bfc08b5 \ No newline at end of file
diff --git a/db/schema_migrations/20230609001452 b/db/schema_migrations/20230609001452
new file mode 100644
index 00000000000..1173e2f9cbe
--- /dev/null
+++ b/db/schema_migrations/20230609001452
@@ -0,0 +1 @@
+ed093ce5b064fbd7f5ac99ae8add45a2ccf1e4a4911086a11517d0f99644299d \ No newline at end of file
diff --git a/db/schema_migrations/20230609002452 b/db/schema_migrations/20230609002452
new file mode 100644
index 00000000000..e9a16c956c7
--- /dev/null
+++ b/db/schema_migrations/20230609002452
@@ -0,0 +1 @@
+d516424bba378d9857c5807b9cef648ee4fe13531207c9aae91ece58894151d8 \ No newline at end of file
diff --git a/db/schema_migrations/20230609003452 b/db/schema_migrations/20230609003452
new file mode 100644
index 00000000000..e920a9ef97c
--- /dev/null
+++ b/db/schema_migrations/20230609003452
@@ -0,0 +1 @@
+a3a08d3d10ca4e0e2a0d382a222ca4438313d4ee9a8998cbe2348a37517ef3ff \ No newline at end of file
diff --git a/db/schema_migrations/20230609004452 b/db/schema_migrations/20230609004452
new file mode 100644
index 00000000000..f79d7a39587
--- /dev/null
+++ b/db/schema_migrations/20230609004452
@@ -0,0 +1 @@
+a5e5bc6b56f1134d94d46b084172961869bb6f7d5d5d828ba5f076dd9cf9a2ad \ No newline at end of file
diff --git a/db/schema_migrations/20230609005452 b/db/schema_migrations/20230609005452
new file mode 100644
index 00000000000..d2f249b31bd
--- /dev/null
+++ b/db/schema_migrations/20230609005452
@@ -0,0 +1 @@
+c66905576a5cdbf1f299fa6af77414ef889b108e0212f7ce9e6e9f132c134af9 \ No newline at end of file
diff --git a/db/schema_migrations/20230609010452 b/db/schema_migrations/20230609010452
new file mode 100644
index 00000000000..2d5e64b037f
--- /dev/null
+++ b/db/schema_migrations/20230609010452
@@ -0,0 +1 @@
+c4f9c35213d69b2285fecf253bd3d50c962c55a3cfc4b50c3905571e6c99e9b6 \ No newline at end of file
diff --git a/db/schema_migrations/20230609011452 b/db/schema_migrations/20230609011452
new file mode 100644
index 00000000000..826750c912f
--- /dev/null
+++ b/db/schema_migrations/20230609011452
@@ -0,0 +1 @@
+32adffeb44d662bb83d3685820bf2d149963b09ff25488586cbb0ad81fe5672f \ No newline at end of file
diff --git a/db/schema_migrations/20230609085234 b/db/schema_migrations/20230609085234
new file mode 100644
index 00000000000..0fbe9b8d207
--- /dev/null
+++ b/db/schema_migrations/20230609085234
@@ -0,0 +1 @@
+8fe12238b9e06a72c43f307f54aa75ef115f2885c8d7a5b42fa5dec7ff2a384a \ No newline at end of file
diff --git a/db/schema_migrations/20230609115844 b/db/schema_migrations/20230609115844
new file mode 100644
index 00000000000..14e4983cb1f
--- /dev/null
+++ b/db/schema_migrations/20230609115844
@@ -0,0 +1 @@
+07d0936d683690e32c1d7843a00e5f6070dcb2bfe0b52f6d1a72ea8d2f9d6b61 \ No newline at end of file
diff --git a/db/schema_migrations/20230612072807 b/db/schema_migrations/20230612072807
new file mode 100644
index 00000000000..1ebfdb2047d
--- /dev/null
+++ b/db/schema_migrations/20230612072807
@@ -0,0 +1 @@
+bad7f2ba1016d7a1c81e4f1ce390cf669f128f9ac368f7b1b091a73f1d1230cc \ No newline at end of file
diff --git a/db/schema_migrations/20230612075608 b/db/schema_migrations/20230612075608
new file mode 100644
index 00000000000..ec86690f7c9
--- /dev/null
+++ b/db/schema_migrations/20230612075608
@@ -0,0 +1 @@
+c1bd88e757c7c08d340066201e3cba4fe23c1d0e78b7a4fbca0e7c9d87df802e \ No newline at end of file
diff --git a/db/schema_migrations/20230612083337 b/db/schema_migrations/20230612083337
new file mode 100644
index 00000000000..928a485a27c
--- /dev/null
+++ b/db/schema_migrations/20230612083337
@@ -0,0 +1 @@
+21ad4cb522f5a7bb8f4d5883be0d195968206af01051bc4288d287dc15e87572 \ No newline at end of file
diff --git a/db/schema_migrations/20230612083655 b/db/schema_migrations/20230612083655
new file mode 100644
index 00000000000..2e9f6e55c2a
--- /dev/null
+++ b/db/schema_migrations/20230612083655
@@ -0,0 +1 @@
+dbe7656846b46a8e4e7c4b4d04ae034d08eb35b7bad1b530e428c2725542fe43 \ No newline at end of file
diff --git a/db/schema_migrations/20230612083810 b/db/schema_migrations/20230612083810
new file mode 100644
index 00000000000..c5bffbc4d26
--- /dev/null
+++ b/db/schema_migrations/20230612083810
@@ -0,0 +1 @@
+fe353050a5b4e9650e5ba4985668958032ac105c9cff86d75c974e567bfe9074 \ No newline at end of file
diff --git a/db/schema_migrations/20230612084013 b/db/schema_migrations/20230612084013
new file mode 100644
index 00000000000..078054b88a3
--- /dev/null
+++ b/db/schema_migrations/20230612084013
@@ -0,0 +1 @@
+3c03bbb4082c8b0e42197a4bc9ad80aa3dcfa09d8e183fdaa503278ec5db79be \ No newline at end of file
diff --git a/db/schema_migrations/20230612162643 b/db/schema_migrations/20230612162643
new file mode 100644
index 00000000000..f6591703cde
--- /dev/null
+++ b/db/schema_migrations/20230612162643
@@ -0,0 +1 @@
+3bddacf1e0535168b890b48528a92847a335db3e71dd70f2d5763488e65db0c9 \ No newline at end of file
diff --git a/db/schema_migrations/20230614073136 b/db/schema_migrations/20230614073136
new file mode 100644
index 00000000000..26a818571a7
--- /dev/null
+++ b/db/schema_migrations/20230614073136
@@ -0,0 +1 @@
+79f18af7750cabcdfe7f7b54c745cce14c1ece44c6cdb5c7d7760784bcb4ee0c \ No newline at end of file
diff --git a/db/schema_migrations/20230614181637 b/db/schema_migrations/20230614181637
new file mode 100644
index 00000000000..0cd4d1d26d3
--- /dev/null
+++ b/db/schema_migrations/20230614181637
@@ -0,0 +1 @@
+a4587f858d87d2a79607a6449201524a62fff8edef613ad4b5d0b46da08742ab \ No newline at end of file
diff --git a/db/schema_migrations/20230615083713 b/db/schema_migrations/20230615083713
new file mode 100644
index 00000000000..bba2480cbf8
--- /dev/null
+++ b/db/schema_migrations/20230615083713
@@ -0,0 +1 @@
+a65e4718899a9339ef47da715f1fe48e20142b634bb95b0db70d2e4b6c5cc103 \ No newline at end of file
diff --git a/db/schema_migrations/20230615083715 b/db/schema_migrations/20230615083715
new file mode 100644
index 00000000000..e4ad899ae83
--- /dev/null
+++ b/db/schema_migrations/20230615083715
@@ -0,0 +1 @@
+e5ba43d180f8761c1892541ab4ca38c178bd3768f5ca0b9cfa977309306d600f \ No newline at end of file
diff --git a/db/schema_migrations/20230615083720 b/db/schema_migrations/20230615083720
new file mode 100644
index 00000000000..f8f60a3dce4
--- /dev/null
+++ b/db/schema_migrations/20230615083720
@@ -0,0 +1 @@
+96ad4cbf0debff7b289fa59b4af6164cd06226972ba55fbe696ad0e4c73eea0e \ No newline at end of file
diff --git a/db/schema_migrations/20230615083725 b/db/schema_migrations/20230615083725
new file mode 100644
index 00000000000..6ac0680cf6a
--- /dev/null
+++ b/db/schema_migrations/20230615083725
@@ -0,0 +1 @@
+c9e40d4c7d14b0914d520a8b425a8805e25e43beaea9b9a21a76e94c77431f79 \ No newline at end of file
diff --git a/db/schema_migrations/20230615083730 b/db/schema_migrations/20230615083730
new file mode 100644
index 00000000000..42e2d42e1f9
--- /dev/null
+++ b/db/schema_migrations/20230615083730
@@ -0,0 +1 @@
+694a5369b0d8536402e0fe1091413bd20f978035fa0f2ba0487d5287ffc6fe19 \ No newline at end of file
diff --git a/db/schema_migrations/20230615083734 b/db/schema_migrations/20230615083734
new file mode 100644
index 00000000000..98b8e15bb8d
--- /dev/null
+++ b/db/schema_migrations/20230615083734
@@ -0,0 +1 @@
+c871540f13d8d0ee7945ff1dd625ace59ec2b1f0907701ba7ff62d411bd51dac \ No newline at end of file
diff --git a/db/schema_migrations/20230615083738 b/db/schema_migrations/20230615083738
new file mode 100644
index 00000000000..e11c8271bf3
--- /dev/null
+++ b/db/schema_migrations/20230615083738
@@ -0,0 +1 @@
+5eb86fcc023323c515964827c44052b5b6d8b6b216b3ccbde8b2e2033fd72180 \ No newline at end of file
diff --git a/db/schema_migrations/20230615083741 b/db/schema_migrations/20230615083741
new file mode 100644
index 00000000000..d283365a057
--- /dev/null
+++ b/db/schema_migrations/20230615083741
@@ -0,0 +1 @@
+86407b35a175581e639e9e7d537e5655a80cf998f7c46e17b011b4f0241ffd5c \ No newline at end of file
diff --git a/db/schema_migrations/20230615083744 b/db/schema_migrations/20230615083744
new file mode 100644
index 00000000000..6a09de1bf8a
--- /dev/null
+++ b/db/schema_migrations/20230615083744
@@ -0,0 +1 @@
+0bfa09f5e8290de7dc2931b1ef6f5259653619cb4a722a04dc58c3c98eb523e4 \ No newline at end of file
diff --git a/db/schema_migrations/20230615083748 b/db/schema_migrations/20230615083748
new file mode 100644
index 00000000000..115ecab5e8a
--- /dev/null
+++ b/db/schema_migrations/20230615083748
@@ -0,0 +1 @@
+c18fe1c9744ebb939972f561f1de88afafedd0bba61b190d5fce4df25bd2d9f7 \ No newline at end of file
diff --git a/db/schema_migrations/20230615202125 b/db/schema_migrations/20230615202125
new file mode 100644
index 00000000000..fc64742291d
--- /dev/null
+++ b/db/schema_migrations/20230615202125
@@ -0,0 +1 @@
+99ecaa37e4b47b15fafb593e9af6bcf37f393dd10ecfdbd11a196c4700ab9571 \ No newline at end of file
diff --git a/db/schema_migrations/20230615202511 b/db/schema_migrations/20230615202511
new file mode 100644
index 00000000000..391fa51d1f9
--- /dev/null
+++ b/db/schema_migrations/20230615202511
@@ -0,0 +1 @@
+eb2627c95cf579d4c8a0eaa239093b0b3badbf666c257425bcb5d5a47cbf7d87 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 8dea1331b6e..a1ca2147c8c 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -255,24 +255,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_0e214b8a14f2() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_17c3a95ee58a() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -282,51 +264,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_3dc62927cae8() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_775287b6d67a() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."diff_note_id_convert_to_bigint" := NEW."diff_note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_909cf0a06094() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."awardable_id_convert_to_bigint" := NEW."awardable_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION trigger_b2d852e1e2cb() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -336,42 +273,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_bfc6e47be8cc() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_bfcbace4260d() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_c2051020aa8b() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_c5a5f48f12b0() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION trigger_cd1aeb22b34a() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -381,24 +282,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_dca935e3a712() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_ee7956d805e6() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."note_id_convert_to_bigint" := NEW."note_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -564,6 +447,17 @@ CREATE TABLE batched_background_migration_job_transition_logs (
)
PARTITION BY RANGE (created_at);
+CREATE TABLE p_ci_job_annotations (
+ id bigint NOT NULL,
+ partition_id bigint NOT NULL,
+ job_id bigint NOT NULL,
+ name text NOT NULL,
+ data jsonb DEFAULT '[]'::jsonb NOT NULL,
+ CONSTRAINT check_bac9224e45 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT data_is_array CHECK ((jsonb_typeof(data) = 'array'::text))
+)
+PARTITION BY LIST (partition_id);
+
CREATE TABLE p_ci_runner_machine_builds (
partition_id bigint NOT NULL,
build_id bigint NOT NULL,
@@ -10758,6 +10652,26 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_63 (
);
ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63 FOR VALUES WITH (modulus 64, remainder 63);
+CREATE TABLE abuse_events (
+ id bigint NOT NULL,
+ user_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ abuse_report_id bigint,
+ source smallint NOT NULL,
+ category smallint,
+ metadata jsonb
+);
+
+CREATE SEQUENCE abuse_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE abuse_events_id_seq OWNED BY abuse_events.id;
+
CREATE TABLE abuse_report_events (
id bigint NOT NULL,
abuse_report_id bigint NOT NULL,
@@ -10793,9 +10707,14 @@ CREATE TABLE abuse_reports (
status smallint DEFAULT 1 NOT NULL,
resolved_at timestamp with time zone,
screenshot text,
+ resolved_by_id integer,
+ assignee_id integer,
+ mitigation_steps text,
+ evidence jsonb,
CONSTRAINT abuse_reports_links_to_spam_length_check CHECK ((cardinality(links_to_spam) <= 20)),
CONSTRAINT check_4b0a5120e0 CHECK ((char_length(screenshot) <= 255)),
- CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512))
+ CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512)),
+ CONSTRAINT check_f3c0947a2d CHECK ((char_length(mitigation_steps) <= 1000))
);
CREATE SEQUENCE abuse_reports_id_seq
@@ -10815,7 +10734,7 @@ CREATE TABLE abuse_trust_scores (
updated_at timestamp with time zone NOT NULL,
source smallint NOT NULL,
correlation_id_value text,
- CONSTRAINT check_77ca9551db CHECK ((char_length(correlation_id_value) <= 32))
+ CONSTRAINT check_77ca9551db CHECK ((char_length(correlation_id_value) <= 255))
);
CREATE SEQUENCE abuse_trust_scores_id_seq
@@ -11042,6 +10961,7 @@ CREATE TABLE alert_management_http_integrations (
name text NOT NULL,
payload_example jsonb DEFAULT '{}'::jsonb NOT NULL,
payload_attribute_mapping jsonb DEFAULT '{}'::jsonb NOT NULL,
+ type_identifier smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_286943b636 CHECK ((char_length(encrypted_token_iv) <= 255)),
CONSTRAINT check_392143ccf4 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_e270820180 CHECK ((char_length(endpoint_identifier) <= 255)),
@@ -11806,8 +11726,6 @@ CREATE TABLE application_settings (
silent_mode_enabled boolean DEFAULT false NOT NULL,
package_metadata_purl_types smallint[] DEFAULT '{}'::smallint[],
ci_max_includes integer DEFAULT 150 NOT NULL,
- encrypted_tofa_credentials bytea,
- encrypted_tofa_credentials_iv bytea,
encrypted_tofa_host bytea,
encrypted_tofa_host_iv bytea,
encrypted_tofa_url bytea,
@@ -11831,6 +11749,23 @@ CREATE TABLE application_settings (
remember_me_enabled boolean DEFAULT true NOT NULL,
encrypted_anthropic_api_key bytea,
encrypted_anthropic_api_key_iv bytea,
+ diagramsnet_enabled boolean DEFAULT true NOT NULL,
+ diagramsnet_url text DEFAULT 'https://embed.diagrams.net'::text,
+ allow_account_deletion boolean DEFAULT true NOT NULL,
+ wiki_asciidoc_allow_uri_includes boolean DEFAULT false NOT NULL,
+ namespace_aggregation_schedule_lease_duration_in_seconds integer DEFAULT 300 NOT NULL,
+ container_registry_data_repair_detail_worker_max_concurrency integer DEFAULT 2 NOT NULL,
+ encrypted_ai_access_token bytea,
+ encrypted_ai_access_token_iv bytea,
+ vertex_ai_host text,
+ encrypted_vertex_ai_credentials bytea,
+ encrypted_vertex_ai_credentials_iv bytea,
+ vertex_ai_project text,
+ instance_level_code_suggestions_enabled boolean DEFAULT false NOT NULL,
+ delete_unconfirmed_users boolean DEFAULT false NOT NULL,
+ unconfirmed_users_delete_after_days integer DEFAULT 7 NOT NULL,
+ default_branch_protection_defaults jsonb DEFAULT '{}'::jsonb NOT NULL,
+ gitlab_shell_operation_limit integer DEFAULT 600,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)),
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),
@@ -11842,8 +11777,11 @@ CREATE TABLE application_settings (
CONSTRAINT app_settings_p_cleanup_package_file_worker_capacity_positive CHECK ((packages_cleanup_package_file_worker_capacity >= 0)),
CONSTRAINT app_settings_pkg_registry_cleanup_pol_worker_capacity_gte_zero CHECK ((package_registry_cleanup_policies_worker_capacity >= 0)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
+ CONSTRAINT app_settings_registry_repair_worker_max_concurrency_positive CHECK ((container_registry_data_repair_detail_worker_max_concurrency >= 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_0542340619 CHECK ((char_length(diagramsnet_url) <= 2048)),
+ CONSTRAINT check_12f01f1dcd CHECK ((char_length(vertex_ai_project) <= 255)),
CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)),
CONSTRAINT check_2b820eaac3 CHECK ((char_length(database_grafana_tag) <= 255)),
CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)),
@@ -11870,6 +11808,7 @@ CREATE TABLE application_settings (
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)),
+ CONSTRAINT check_ae53cf7f82 CHECK ((char_length(vertex_ai_host) <= 255)),
CONSTRAINT check_b8c74ea5b3 CHECK ((char_length(deactivation_email_additional_text) <= 1000)),
CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)),
CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)),
@@ -12284,6 +12223,24 @@ CREATE SEQUENCE audit_events_streaming_headers_id_seq
ALTER SEQUENCE audit_events_streaming_headers_id_seq OWNED BY audit_events_streaming_headers.id;
+CREATE TABLE audit_events_streaming_instance_event_type_filters (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ instance_external_audit_event_destination_id bigint NOT NULL,
+ audit_event_type text NOT NULL,
+ CONSTRAINT check_249c9370cc CHECK ((char_length(audit_event_type) <= 255))
+);
+
+CREATE SEQUENCE audit_events_streaming_instance_event_type_filters_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE audit_events_streaming_instance_event_type_filters_id_seq OWNED BY audit_events_streaming_instance_event_type_filters.id;
+
CREATE TABLE authentication_events (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12332,7 +12289,6 @@ CREATE TABLE award_emoji (
id integer NOT NULL,
name character varying,
user_id integer,
- awardable_id_convert_to_bigint integer,
awardable_type character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@@ -12460,6 +12416,7 @@ CREATE TABLE batched_background_migrations (
started_at timestamp with time zone,
on_hold_until timestamp with time zone,
gitlab_schema text NOT NULL,
+ finished_at timestamp with time zone,
CONSTRAINT check_0406d9776f CHECK ((char_length(gitlab_schema) <= 255)),
CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)),
CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)),
@@ -12739,7 +12696,7 @@ CREATE TABLE broadcast_messages (
dismissable boolean,
target_access_levels integer[] DEFAULT '{}'::integer[] NOT NULL,
theme smallint DEFAULT 0 NOT NULL,
- namespace_id bigint
+ show_in_cli boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE broadcast_messages_id_seq
@@ -13097,7 +13054,7 @@ CREATE TABLE ci_build_trace_metadata (
partition_id bigint DEFAULT 100 NOT NULL
);
-CREATE TABLE ci_builds (
+CREATE TABLE p_ci_builds (
status character varying,
finished_at timestamp without time zone,
created_at timestamp without time zone,
@@ -13142,9 +13099,9 @@ CREATE TABLE ci_builds (
id bigint NOT NULL,
stage_id bigint,
partition_id bigint NOT NULL,
- CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL)),
- CONSTRAINT partitioning_constraint CHECK ((partition_id = 100))
-);
+ CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL))
+)
+PARTITION BY LIST (partition_id);
CREATE SEQUENCE ci_builds_id_seq
START WITH 1
@@ -13153,7 +13110,56 @@ CREATE SEQUENCE ci_builds_id_seq
NO MAXVALUE
CACHE 1;
-ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id;
+ALTER SEQUENCE ci_builds_id_seq OWNED BY p_ci_builds.id;
+
+CREATE TABLE ci_builds (
+ status character varying,
+ finished_at timestamp without time zone,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ started_at timestamp without time zone,
+ runner_id integer,
+ coverage double precision,
+ commit_id integer,
+ name character varying,
+ options text,
+ allow_failure boolean DEFAULT false NOT NULL,
+ stage character varying,
+ trigger_request_id integer,
+ stage_idx integer,
+ tag boolean,
+ ref character varying,
+ user_id integer,
+ type character varying,
+ target_url character varying,
+ description character varying,
+ project_id integer,
+ erased_by_id integer,
+ erased_at timestamp without time zone,
+ artifacts_expire_at timestamp without time zone,
+ environment character varying,
+ "when" character varying,
+ yaml_variables text,
+ queued_at timestamp without time zone,
+ lock_version integer DEFAULT 0,
+ coverage_regex character varying,
+ auto_canceled_by_id integer,
+ retried boolean,
+ protected boolean,
+ failure_reason integer,
+ scheduled_at timestamp with time zone,
+ token_encrypted character varying,
+ upstream_pipeline_id integer,
+ resource_group_id bigint,
+ waiting_for_resource_at timestamp with time zone,
+ processed boolean,
+ scheduling_type smallint,
+ id bigint DEFAULT nextval('ci_builds_id_seq'::regclass) NOT NULL,
+ stage_id bigint,
+ partition_id bigint NOT NULL,
+ CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL))
+);
+ALTER TABLE ONLY p_ci_builds ATTACH PARTITION ci_builds FOR VALUES IN ('100');
CREATE TABLE p_ci_builds_metadata (
project_id integer NOT NULL,
@@ -13658,7 +13664,7 @@ CREATE SEQUENCE ci_pipeline_schedules_id_seq
ALTER SEQUENCE ci_pipeline_schedules_id_seq OWNED BY ci_pipeline_schedules.id;
CREATE TABLE ci_pipeline_variables (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
key character varying NOT NULL,
value text,
encrypted_value text,
@@ -13668,7 +13674,7 @@ CREATE TABLE ci_pipeline_variables (
variable_type smallint DEFAULT 1 NOT NULL,
partition_id bigint DEFAULT 100 NOT NULL,
raw boolean DEFAULT false NOT NULL,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ id bigint NOT NULL
);
CREATE SEQUENCE ci_pipeline_variables_id_seq
@@ -14427,7 +14433,6 @@ ALTER SEQUENCE clusters_kubernetes_namespaces_id_seq OWNED BY clusters_kubernete
CREATE TABLE commit_user_mentions (
id bigint NOT NULL,
- note_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -15020,11 +15025,12 @@ CREATE TABLE dependency_list_exports (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- project_id bigint NOT NULL,
+ project_id bigint,
user_id bigint,
file_store integer,
status smallint DEFAULT 0 NOT NULL,
file text,
+ group_id bigint,
CONSTRAINT check_fff6fc9b2f CHECK ((char_length(file) <= 255))
);
@@ -15138,6 +15144,24 @@ CREATE SEQUENCE dependency_proxy_manifests_id_seq
ALTER SEQUENCE dependency_proxy_manifests_id_seq OWNED BY dependency_proxy_manifests.id;
+CREATE TABLE dependency_proxy_packages_settings (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ project_id bigint NOT NULL,
+ enabled boolean DEFAULT false,
+ maven_external_registry_url text,
+ encrypted_maven_external_registry_username bytea,
+ encrypted_maven_external_registry_username_iv bytea,
+ encrypted_maven_external_registry_password bytea,
+ encrypted_maven_external_registry_password_iv bytea,
+ CONSTRAINT check_14a2818907 CHECK (((num_nulls(encrypted_maven_external_registry_username, encrypted_maven_external_registry_password) = 0) OR (num_nulls(encrypted_maven_external_registry_username, encrypted_maven_external_registry_password) = 2))),
+ CONSTRAINT check_353c7ecafd CHECK ((octet_length(encrypted_maven_external_registry_username) <= 1020)),
+ CONSTRAINT check_ac55c514a5 CHECK ((char_length(maven_external_registry_url) <= 255)),
+ CONSTRAINT check_c6f700648d CHECK ((octet_length(encrypted_maven_external_registry_password) <= 1020)),
+ CONSTRAINT check_cdf5f9a434 CHECK ((octet_length(encrypted_maven_external_registry_password_iv) <= 1020)),
+ CONSTRAINT check_fd5def68ba CHECK ((octet_length(encrypted_maven_external_registry_username_iv) <= 1020))
+);
+
CREATE TABLE deploy_keys_projects (
id integer NOT NULL,
deploy_key_id integer NOT NULL,
@@ -15353,7 +15377,6 @@ ALTER SEQUENCE design_management_versions_id_seq OWNED BY design_management_vers
CREATE TABLE design_user_mentions (
id bigint NOT NULL,
design_id integer NOT NULL,
- note_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -15656,7 +15679,8 @@ CREATE TABLE environments (
auto_stop_at timestamp with time zone,
auto_delete_at timestamp with time zone,
tier smallint,
- merge_request_id bigint
+ merge_request_id bigint,
+ cluster_agent_id bigint
);
CREATE SEQUENCE environments_id_seq
@@ -15703,7 +15727,6 @@ ALTER SEQUENCE epic_metrics_id_seq OWNED BY epic_metrics.id;
CREATE TABLE epic_user_mentions (
id bigint NOT NULL,
epic_id integer NOT NULL,
- note_id_convert_to_bigint integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -16769,7 +16792,8 @@ CREATE TABLE import_failures (
retry_count integer,
group_id integer,
source character varying(128),
- external_identifiers jsonb DEFAULT '{}'::jsonb NOT NULL
+ external_identifiers jsonb DEFAULT '{}'::jsonb NOT NULL,
+ user_id bigint
);
CREATE SEQUENCE import_failures_id_seq
@@ -17060,6 +17084,26 @@ CREATE SEQUENCE insights_id_seq
ALTER SEQUENCE insights_id_seq OWNED BY insights.id;
+CREATE TABLE instance_audit_events_streaming_headers (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ instance_external_audit_event_destination_id bigint NOT NULL,
+ key text NOT NULL,
+ value text NOT NULL,
+ CONSTRAINT check_d52adbbabb CHECK ((char_length(value) <= 255)),
+ CONSTRAINT check_e92010d531 CHECK ((char_length(key) <= 255))
+);
+
+CREATE SEQUENCE instance_audit_events_streaming_headers_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE instance_audit_events_streaming_headers_id_seq OWNED BY instance_audit_events_streaming_headers.id;
+
CREATE TABLE integrations (
id integer NOT NULL,
project_id integer,
@@ -17347,7 +17391,6 @@ ALTER SEQUENCE issue_tracker_data_id_seq OWNED BY issue_tracker_data.id;
CREATE TABLE issue_user_mentions (
id bigint NOT NULL,
issue_id integer NOT NULL,
- note_id_convert_to_bigint integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -17822,7 +17865,8 @@ CREATE TABLE member_roles (
updated_at timestamp with time zone NOT NULL,
base_access_level integer NOT NULL,
read_code boolean DEFAULT false,
- read_vulnerability boolean DEFAULT false NOT NULL
+ read_vulnerability boolean DEFAULT false NOT NULL,
+ admin_vulnerability boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE member_roles_id_seq
@@ -18186,7 +18230,6 @@ ALTER SEQUENCE merge_request_reviewers_id_seq OWNED BY merge_request_reviewers.i
CREATE TABLE merge_request_user_mentions (
id bigint NOT NULL,
merge_request_id integer NOT NULL,
- note_id_convert_to_bigint integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -18689,6 +18732,7 @@ CREATE TABLE namespace_settings (
code_suggestions boolean DEFAULT false NOT NULL,
experiment_features_enabled boolean DEFAULT false NOT NULL,
third_party_ai_features_enabled boolean DEFAULT true NOT NULL,
+ default_branch_protection_defaults jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)),
CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)),
CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100))
@@ -18807,7 +18851,6 @@ ALTER SEQUENCE namespaces_sync_events_id_seq OWNED BY namespaces_sync_events.id;
CREATE TABLE note_diff_files (
id integer NOT NULL,
- diff_note_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
diff text NOT NULL,
new_file boolean NOT NULL,
renamed_file boolean NOT NULL,
@@ -18846,7 +18889,7 @@ CREATE SEQUENCE note_metadata_note_id_seq
ALTER SEQUENCE note_metadata_note_id_seq OWNED BY note_metadata.note_id;
CREATE TABLE notes (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
note text,
noteable_type character varying,
author_id integer,
@@ -18874,7 +18917,7 @@ CREATE TABLE notes (
confidential boolean,
last_edited_at timestamp with time zone,
internal boolean DEFAULT false NOT NULL,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ id bigint NOT NULL
);
CREATE SEQUENCE notes_id_seq
@@ -19193,6 +19236,8 @@ CREATE TABLE organizations (
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
name text DEFAULT ''::text NOT NULL,
+ path text NOT NULL,
+ CONSTRAINT check_0b4296b5ea CHECK ((char_length(path) <= 255)),
CONSTRAINT check_d130d769e0 CHECK ((char_length(name) <= 255))
);
@@ -19205,6 +19250,15 @@ CREATE SEQUENCE organizations_id_seq
ALTER SEQUENCE organizations_id_seq OWNED BY organizations.id;
+CREATE SEQUENCE p_ci_job_annotations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE p_ci_job_annotations_id_seq OWNED BY p_ci_job_annotations.id;
+
CREATE TABLE packages_build_infos (
id bigint NOT NULL,
package_id integer NOT NULL,
@@ -19336,7 +19390,6 @@ CREATE TABLE packages_debian_group_component_files (
compression_type smallint,
file_store smallint DEFAULT 1 NOT NULL,
file text NOT NULL,
- file_md5 bytea,
file_sha256 bytea NOT NULL,
CONSTRAINT check_839e1685bc CHECK ((char_length(file) <= 255))
);
@@ -19461,7 +19514,6 @@ CREATE TABLE packages_debian_project_component_files (
compression_type smallint,
file_store smallint DEFAULT 1 NOT NULL,
file text NOT NULL,
- file_md5 bytea,
file_sha256 bytea NOT NULL,
CONSTRAINT check_e5af03fa2d CHECK ((char_length(file) <= 255))
);
@@ -19673,6 +19725,10 @@ CREATE TABLE packages_nuget_metadata (
license_url text,
project_url text,
icon_url text,
+ authors text,
+ description text,
+ CONSTRAINT check_d39a5fe9ee CHECK ((char_length(description) <= 4000)),
+ CONSTRAINT check_e2fc129ebd CHECK ((char_length(authors) <= 255)),
CONSTRAINT packages_nuget_metadata_icon_url_constraint CHECK ((char_length(icon_url) <= 255)),
CONSTRAINT packages_nuget_metadata_license_url_constraint CHECK ((char_length(license_url) <= 255)),
CONSTRAINT packages_nuget_metadata_project_url_constraint CHECK ((char_length(project_url) <= 255))
@@ -20094,7 +20150,9 @@ CREATE TABLE plan_limits (
dashboard_limit_enabled_at timestamp with time zone,
web_hook_calls integer DEFAULT 0 NOT NULL,
project_access_token_limit integer DEFAULT 0 NOT NULL,
- google_cloud_logging_configurations integer DEFAULT 5 NOT NULL
+ google_cloud_logging_configurations integer DEFAULT 5 NOT NULL,
+ ml_model_max_file_size bigint DEFAULT '10737418240'::bigint NOT NULL,
+ limits_history jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE SEQUENCE plan_limits_id_seq
@@ -20188,9 +20246,19 @@ CREATE TABLE pm_checkpoints (
purl_type smallint NOT NULL,
chunk smallint NOT NULL,
data_type smallint DEFAULT 1 NOT NULL,
- version_format smallint DEFAULT 1 NOT NULL
+ version_format smallint DEFAULT 1 NOT NULL,
+ id bigint NOT NULL
);
+CREATE SEQUENCE pm_checkpoints_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE pm_checkpoints_id_seq OWNED BY pm_checkpoints.id;
+
CREATE TABLE pm_licenses (
id bigint NOT NULL,
spdx_identifier text NOT NULL,
@@ -20314,7 +20382,7 @@ CREATE TABLE postgres_async_indexes (
CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
CONSTRAINT check_45dc23c315 CHECK ((char_length(last_error) <= 10000)),
CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
- CONSTRAINT check_e64ff4359e CHECK ((char_length(table_name) <= 63))
+ CONSTRAINT check_schema_and_name_length CHECK ((char_length(table_name) <= 127))
);
CREATE SEQUENCE postgres_async_indexes_id_seq
@@ -20330,14 +20398,19 @@ CREATE VIEW postgres_autovacuum_activity AS
WITH processes AS (
SELECT postgres_pg_stat_activity_autovacuum.query,
postgres_pg_stat_activity_autovacuum.query_start,
- regexp_matches(postgres_pg_stat_activity_autovacuum.query, '^autovacuum: VACUUM (w+).(w+)'::text) AS matches
+ regexp_matches(postgres_pg_stat_activity_autovacuum.query, '^autovacuum: VACUUM (\w+)\.(\w+)'::text) AS matches,
+ CASE
+ WHEN (postgres_pg_stat_activity_autovacuum.query ~~* '%wraparound)'::text) THEN true
+ ELSE false
+ END AS wraparound_prevention
FROM postgres_pg_stat_activity_autovacuum() postgres_pg_stat_activity_autovacuum(query, query_start)
- WHERE (postgres_pg_stat_activity_autovacuum.query ~* '^autovacuum: VACUUM w+.w+'::text)
+ WHERE (postgres_pg_stat_activity_autovacuum.query ~* '^autovacuum: VACUUM \w+\.\w+'::text)
)
SELECT ((processes.matches[1] || '.'::text) || processes.matches[2]) AS table_identifier,
processes.matches[1] AS schema,
processes.matches[2] AS "table",
- processes.query_start AS vacuum_start
+ processes.query_start AS vacuum_start,
+ processes.wraparound_prevention
FROM processes;
COMMENT ON VIEW postgres_autovacuum_activity IS 'Contains information about PostgreSQL backends currently performing autovacuum operations on the tables indicated here.';
@@ -20707,7 +20780,6 @@ CREATE TABLE project_ci_cd_settings (
job_token_scope_enabled boolean DEFAULT false NOT NULL,
runner_token_expiration_interval integer,
separated_caches boolean DEFAULT true NOT NULL,
- opt_in_jwt boolean DEFAULT false NOT NULL,
allow_fork_pipelines_to_run_in_parent_project boolean DEFAULT true NOT NULL,
inbound_job_token_scope_enabled boolean DEFAULT true NOT NULL
);
@@ -20752,6 +20824,26 @@ CREATE SEQUENCE project_compliance_framework_settings_project_id_seq
ALTER SEQUENCE project_compliance_framework_settings_project_id_seq OWNED BY project_compliance_framework_settings.project_id;
+CREATE TABLE project_compliance_standards_adherence (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ project_id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ status smallint NOT NULL,
+ check_name smallint NOT NULL,
+ standard smallint NOT NULL
+);
+
+CREATE SEQUENCE project_compliance_standards_adherence_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_compliance_standards_adherence_id_seq OWNED BY project_compliance_standards_adherence.id;
+
CREATE TABLE project_custom_attributes (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -20884,7 +20976,8 @@ CREATE TABLE project_features (
infrastructure_access_level integer DEFAULT 20 NOT NULL,
feature_flags_access_level integer DEFAULT 20 NOT NULL,
environments_access_level integer DEFAULT 20 NOT NULL,
- releases_access_level integer DEFAULT 20 NOT NULL
+ releases_access_level integer DEFAULT 20 NOT NULL,
+ model_experiments_access_level integer DEFAULT 20 NOT NULL
);
CREATE SEQUENCE project_features_id_seq
@@ -21163,6 +21256,8 @@ CREATE TABLE project_settings (
cube_api_base_url text,
encrypted_cube_api_key bytea,
encrypted_cube_api_key_iv bytea,
+ encrypted_product_analytics_configurator_connection_string bytea,
+ encrypted_product_analytics_configurator_connection_string_iv bytea,
CONSTRAINT check_1a30456322 CHECK ((char_length(pages_unique_domain) <= 63)),
CONSTRAINT check_2981f15877 CHECK ((char_length(jitsu_key) <= 100)),
CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)),
@@ -21264,19 +21359,6 @@ CREATE SEQUENCE project_wiki_repositories_id_seq
ALTER SEQUENCE project_wiki_repositories_id_seq OWNED BY project_wiki_repositories.id;
-CREATE TABLE project_wiki_repository_states (
- verification_started_at timestamp with time zone,
- verification_retry_at timestamp with time zone,
- verified_at timestamp with time zone,
- project_id bigint NOT NULL,
- verification_state smallint DEFAULT 0 NOT NULL,
- verification_retry_count smallint,
- verification_checksum bytea,
- verification_failure text,
- project_wiki_repository_id bigint,
- CONSTRAINT check_119f134b68 CHECK ((char_length(verification_failure) <= 255))
-);
-
CREATE TABLE projects (
id integer NOT NULL,
name character varying,
@@ -22217,7 +22299,11 @@ CREATE TABLE scan_result_policies (
orchestration_policy_idx smallint NOT NULL,
license_states text[] DEFAULT '{}'::text[],
match_on_inclusion boolean,
- role_approvers integer[] DEFAULT '{}'::integer[]
+ role_approvers integer[] DEFAULT '{}'::integer[],
+ age_value integer,
+ age_operator smallint,
+ age_interval smallint,
+ CONSTRAINT age_value_null_or_positive CHECK (((age_value IS NULL) OR (age_value >= 0)))
);
CREATE SEQUENCE scan_result_policies_id_seq
@@ -22237,6 +22323,8 @@ CREATE TABLE schema_inconsistencies (
object_name text NOT NULL,
table_name text NOT NULL,
valitador_name text NOT NULL,
+ diff text NOT NULL,
+ CONSTRAINT check_001d186ac7 CHECK ((char_length(diff) <= 6144)),
CONSTRAINT check_120b6c86d0 CHECK ((char_length(valitador_name) <= 63)),
CONSTRAINT check_a0411f31fd CHECK ((char_length(object_name) <= 63)),
CONSTRAINT check_d96408dfd2 CHECK ((char_length(table_name) <= 63))
@@ -22552,6 +22640,7 @@ CREATE TABLE service_desk_settings (
custom_email_smtp_username text,
encrypted_custom_email_smtp_password bytea,
encrypted_custom_email_smtp_password_iv bytea,
+ service_desk_enabled boolean DEFAULT true NOT NULL,
CONSTRAINT check_57a79552e1 CHECK ((char_length(custom_email) <= 255)),
CONSTRAINT check_b283637a9e CHECK ((char_length(custom_email_smtp_address) <= 255)),
CONSTRAINT check_e3535d46ee CHECK ((char_length(custom_email_smtp_username) <= 255))
@@ -22687,7 +22776,6 @@ CREATE TABLE snippet_statistics (
CREATE TABLE snippet_user_mentions (
id bigint NOT NULL,
snippet_id integer NOT NULL,
- note_id_convert_to_bigint integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -22847,7 +22935,8 @@ CREATE TABLE status_check_responses (
external_approval_rule_id bigint,
sha bytea NOT NULL,
external_status_check_id bigint NOT NULL,
- status smallint DEFAULT 0 NOT NULL
+ status smallint DEFAULT 0 NOT NULL,
+ retried_at timestamp with time zone
);
CREATE SEQUENCE status_check_responses_id_seq
@@ -22898,6 +22987,45 @@ CREATE SEQUENCE status_page_settings_project_id_seq
ALTER SEQUENCE status_page_settings_project_id_seq OWNED BY status_page_settings.project_id;
+CREATE TABLE subscription_add_on_purchases (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ subscription_add_on_id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ quantity integer NOT NULL,
+ expires_on date NOT NULL,
+ purchase_xid text NOT NULL,
+ CONSTRAINT check_3313c4d200 CHECK ((char_length(purchase_xid) <= 255))
+);
+
+CREATE SEQUENCE subscription_add_on_purchases_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE subscription_add_on_purchases_id_seq OWNED BY subscription_add_on_purchases.id;
+
+CREATE TABLE subscription_add_ons (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name smallint NOT NULL,
+ description text NOT NULL,
+ CONSTRAINT check_4c39d15ada CHECK ((char_length(description) <= 512))
+);
+
+CREATE SEQUENCE subscription_add_ons_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE subscription_add_ons_id_seq OWNED BY subscription_add_ons.id;
+
CREATE TABLE subscriptions (
id integer NOT NULL,
user_id integer,
@@ -22920,7 +23048,6 @@ ALTER SEQUENCE subscriptions_id_seq OWNED BY subscriptions.id;
CREATE TABLE suggestions (
id bigint NOT NULL,
- note_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
relative_order smallint NOT NULL,
applied boolean DEFAULT false NOT NULL,
commit_id character varying,
@@ -22943,7 +23070,6 @@ ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id;
CREATE TABLE system_note_metadata (
id integer NOT NULL,
- note_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
commit_count integer,
action character varying,
created_at timestamp without time zone NOT NULL,
@@ -23103,7 +23229,6 @@ CREATE TABLE timelogs (
issue_id integer,
merge_request_id integer,
spent_at timestamp without time zone DEFAULT now(),
- note_id_convert_to_bigint integer,
project_id integer,
summary text,
note_id bigint,
@@ -23130,7 +23255,6 @@ CREATE TABLE todos (
state character varying NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- note_id_convert_to_bigint integer,
commit_id character varying,
group_id integer,
resolved_by_action smallint,
@@ -23409,6 +23533,8 @@ CREATE TABLE user_details (
onboarding_step_url text,
discord text DEFAULT ''::text NOT NULL,
provisioned_by_group_at timestamp with time zone,
+ enterprise_group_id bigint,
+ enterprise_group_associated_at timestamp with time zone,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)),
CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)),
@@ -23537,14 +23663,13 @@ CREATE TABLE user_preferences (
roadmaps_sort character varying,
first_day_of_week integer,
timezone character varying,
- time_display_relative boolean,
- time_format_in_24h boolean,
+ time_display_relative boolean DEFAULT true,
projects_sort character varying(64),
show_whitespace_in_diffs boolean DEFAULT true NOT NULL,
sourcegraph_enabled boolean,
setup_for_company boolean,
- render_whitespace_in_code boolean,
- tab_width smallint,
+ render_whitespace_in_code boolean DEFAULT false,
+ tab_width smallint DEFAULT 8,
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,
@@ -23558,6 +23683,8 @@ CREATE TABLE user_preferences (
pass_user_identities_to_ci_jwt boolean DEFAULT false NOT NULL,
enabled_following boolean DEFAULT true NOT NULL,
visibility_pipeline_id_type smallint DEFAULT 0 NOT NULL,
+ project_shortcut_buttons boolean DEFAULT true NOT NULL,
+ enabled_zoekt boolean DEFAULT true NOT NULL,
CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)),
CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7))
);
@@ -23682,7 +23809,7 @@ CREATE TABLE users (
require_two_factor_authentication_from_group boolean DEFAULT false NOT NULL,
two_factor_grace_period integer DEFAULT 48 NOT NULL,
last_activity_on date,
- notified_of_own_activity boolean,
+ notified_of_own_activity boolean DEFAULT false,
preferred_language character varying,
email_opted_in boolean,
email_opted_in_ip character varying,
@@ -24219,6 +24346,7 @@ CREATE TABLE vulnerability_reads (
cluster_agent_id text,
casted_cluster_agent_id bigint,
namespace_id bigint,
+ dismissal_reason smallint,
CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)),
CONSTRAINT check_a105eb825a CHECK ((char_length(cluster_agent_id) <= 10))
);
@@ -24326,7 +24454,6 @@ ALTER SEQUENCE vulnerability_statistics_id_seq OWNED BY vulnerability_statistics
CREATE TABLE vulnerability_user_mentions (
id bigint NOT NULL,
vulnerability_id bigint NOT NULL,
- note_id_convert_to_bigint integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
@@ -24407,7 +24534,6 @@ CREATE TABLE webauthn_registrations (
credential_xid text NOT NULL,
name text NOT NULL,
public_key text NOT NULL,
- u2f_registration_id integer,
CONSTRAINT check_2f02e74321 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_f5ab2b551a CHECK ((char_length(credential_xid) <= 1364))
);
@@ -24745,6 +24871,8 @@ CREATE SEQUENCE zoom_meetings_id_seq
ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id;
+ALTER TABLE ONLY abuse_events ALTER COLUMN id SET DEFAULT nextval('abuse_events_id_seq'::regclass);
+
ALTER TABLE ONLY abuse_report_events ALTER COLUMN id SET DEFAULT nextval('abuse_report_events_id_seq'::regclass);
ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass);
@@ -24831,6 +24959,8 @@ ALTER TABLE ONLY audit_events_streaming_event_type_filters ALTER COLUMN id SET D
ALTER TABLE ONLY audit_events_streaming_headers ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_headers_id_seq'::regclass);
+ALTER TABLE ONLY audit_events_streaming_instance_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_instance_event_type_filters_id_seq'::regclass);
+
ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass);
ALTER TABLE ONLY automation_rules ALTER COLUMN id SET DEFAULT nextval('automation_rules_id_seq'::regclass);
@@ -24905,8 +25035,6 @@ ALTER TABLE ONLY ci_build_pending_states ALTER COLUMN id SET DEFAULT nextval('ci
ALTER TABLE ONLY ci_build_trace_chunks ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_chunks_id_seq'::regclass);
-ALTER TABLE ONLY ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass);
-
ALTER TABLE ONLY ci_builds_runner_session ALTER COLUMN id SET DEFAULT nextval('ci_builds_runner_session_id_seq'::regclass);
ALTER TABLE ONLY ci_daily_build_group_report_results ALTER COLUMN id SET DEFAULT nextval('ci_daily_build_group_report_results_id_seq'::regclass);
@@ -25245,6 +25373,8 @@ ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statu
ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass);
+ALTER TABLE ONLY instance_audit_events_streaming_headers ALTER COLUMN id SET DEFAULT nextval('instance_audit_events_streaming_headers_id_seq'::regclass);
+
ALTER TABLE ONLY integrations ALTER COLUMN id SET DEFAULT nextval('integrations_id_seq'::regclass);
ALTER TABLE ONLY internal_ids ALTER COLUMN id SET DEFAULT nextval('internal_ids_id_seq'::regclass);
@@ -25421,8 +25551,12 @@ ALTER TABLE ONLY operations_user_lists ALTER COLUMN id SET DEFAULT nextval('oper
ALTER TABLE ONLY organizations ALTER COLUMN id SET DEFAULT nextval('organizations_id_seq'::regclass);
+ALTER TABLE ONLY p_ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass);
+
ALTER TABLE ONLY p_ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass);
+ALTER TABLE ONLY p_ci_job_annotations ALTER COLUMN id SET DEFAULT nextval('p_ci_job_annotations_id_seq'::regclass);
+
ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass);
ALTER TABLE ONLY packages_composer_cache_files ALTER COLUMN id SET DEFAULT nextval('packages_composer_cache_files_id_seq'::regclass);
@@ -25491,6 +25625,8 @@ ALTER TABLE ONLY pm_advisories ALTER COLUMN id SET DEFAULT nextval('pm_advisorie
ALTER TABLE ONLY pm_affected_packages ALTER COLUMN id SET DEFAULT nextval('pm_affected_packages_id_seq'::regclass);
+ALTER TABLE ONLY pm_checkpoints ALTER COLUMN id SET DEFAULT nextval('pm_checkpoints_id_seq'::regclass);
+
ALTER TABLE ONLY pm_licenses ALTER COLUMN id SET DEFAULT nextval('pm_licenses_id_seq'::regclass);
ALTER TABLE ONLY pm_package_version_licenses ALTER COLUMN id SET DEFAULT nextval('pm_package_version_licenses_id_seq'::regclass);
@@ -25525,6 +25661,8 @@ ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('
ALTER TABLE ONLY project_compliance_framework_settings ALTER COLUMN project_id SET DEFAULT nextval('project_compliance_framework_settings_project_id_seq'::regclass);
+ALTER TABLE ONLY project_compliance_standards_adherence ALTER COLUMN id SET DEFAULT nextval('project_compliance_standards_adherence_id_seq'::regclass);
+
ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('project_custom_attributes_id_seq'::regclass);
ALTER TABLE ONLY project_daily_statistics ALTER COLUMN id SET DEFAULT nextval('project_daily_statistics_id_seq'::regclass);
@@ -25709,6 +25847,10 @@ ALTER TABLE ONLY status_page_published_incidents ALTER COLUMN id SET DEFAULT nex
ALTER TABLE ONLY status_page_settings ALTER COLUMN project_id SET DEFAULT nextval('status_page_settings_project_id_seq'::regclass);
+ALTER TABLE ONLY subscription_add_on_purchases ALTER COLUMN id SET DEFAULT nextval('subscription_add_on_purchases_id_seq'::regclass);
+
+ALTER TABLE ONLY subscription_add_ons ALTER COLUMN id SET DEFAULT nextval('subscription_add_ons_id_seq'::regclass);
+
ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscriptions_id_seq'::regclass);
ALTER TABLE ONLY suggestions ALTER COLUMN id SET DEFAULT nextval('suggestions_id_seq'::regclass);
@@ -26451,6 +26593,9 @@ ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_
ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_63
ADD CONSTRAINT product_analytics_events_experimental_63_pkey PRIMARY KEY (id, project_id);
+ALTER TABLE ONLY abuse_events
+ ADD CONSTRAINT abuse_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY abuse_report_events
ADD CONSTRAINT abuse_report_events_pkey PRIMARY KEY (id);
@@ -26592,6 +26737,9 @@ ALTER TABLE ONLY audit_events_streaming_event_type_filters
ALTER TABLE ONLY audit_events_streaming_headers
ADD CONSTRAINT audit_events_streaming_headers_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY audit_events_streaming_instance_event_type_filters
+ ADD CONSTRAINT audit_events_streaming_instance_event_type_filters_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY authentication_events
ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id);
@@ -26700,9 +26848,15 @@ ALTER TABLE ONLY chat_names
ALTER TABLE ONLY chat_teams
ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id);
+ALTER TABLE users
+ ADD CONSTRAINT check_0dd5948e38 CHECK ((user_type IS NOT NULL)) NOT VALID;
+
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
+ALTER TABLE personal_access_tokens
+ ADD CONSTRAINT check_b8d60815eb CHECK ((expires_at IS NOT NULL)) NOT VALID;
+
ALTER TABLE sprints
ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID;
@@ -26739,6 +26893,9 @@ ALTER TABLE ONLY p_ci_builds_metadata
ALTER TABLE ONLY ci_builds_metadata
ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id, partition_id);
+ALTER TABLE ONLY p_ci_builds
+ ADD CONSTRAINT p_ci_builds_pkey PRIMARY KEY (id, partition_id);
+
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id, partition_id);
@@ -27009,6 +27166,12 @@ ALTER TABLE ONLY dast_site_validations
ALTER TABLE ONLY dast_sites
ADD CONSTRAINT dast_sites_pkey PRIMARY KEY (id);
+ALTER TABLE namespace_settings
+ ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID;
+
+ALTER TABLE application_settings
+ ADD CONSTRAINT default_branch_protection_defaults_size_constraint CHECK ((octet_length((default_branch_protection_defaults)::text) <= 1024)) NOT VALID;
+
ALTER TABLE ONLY dependency_list_exports
ADD CONSTRAINT dependency_list_exports_pkey PRIMARY KEY (id);
@@ -27030,6 +27193,9 @@ ALTER TABLE ONLY dependency_proxy_manifest_states
ALTER TABLE ONLY dependency_proxy_manifests
ADD CONSTRAINT dependency_proxy_manifests_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dependency_proxy_packages_settings
+ ADD CONSTRAINT dependency_proxy_packages_settings_pkey PRIMARY KEY (project_id);
+
ALTER TABLE ONLY deploy_keys_projects
ADD CONSTRAINT deploy_keys_projects_pkey PRIMARY KEY (id);
@@ -27330,6 +27496,9 @@ ALTER TABLE ONLY index_statuses
ALTER TABLE ONLY insights
ADD CONSTRAINT insights_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY instance_audit_events_streaming_headers
+ ADD CONSTRAINT instance_audit_events_streaming_headers_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY integrations
ADD CONSTRAINT integrations_pkey PRIMARY KEY (id);
@@ -27642,6 +27811,9 @@ ALTER TABLE ONLY operations_user_lists
ALTER TABLE ONLY organizations
ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY p_ci_job_annotations
+ ADD CONSTRAINT p_ci_job_annotations_pkey PRIMARY KEY (id, partition_id);
+
ALTER TABLE ONLY p_ci_runner_machine_builds
ADD CONSTRAINT p_ci_runner_machine_builds_pkey PRIMARY KEY (build_id, partition_id);
@@ -27778,7 +27950,7 @@ ALTER TABLE ONLY pm_affected_packages
ADD CONSTRAINT pm_affected_packages_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_checkpoints
- ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (purl_type, data_type, version_format);
+ ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_licenses
ADD CONSTRAINT pm_licenses_pkey PRIMARY KEY (id);
@@ -27837,6 +28009,9 @@ ALTER TABLE ONLY project_ci_feature_usages
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT project_compliance_framework_settings_pkey PRIMARY KEY (project_id);
+ALTER TABLE ONLY project_compliance_standards_adherence
+ ADD CONSTRAINT project_compliance_standards_adherence_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_custom_attributes
ADD CONSTRAINT project_custom_attributes_pkey PRIMARY KEY (id);
@@ -27912,9 +28087,6 @@ ALTER TABLE ONLY project_topics
ALTER TABLE ONLY project_wiki_repositories
ADD CONSTRAINT project_wiki_repositories_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY project_wiki_repository_states
- ADD CONSTRAINT project_wiki_repository_states_pkey PRIMARY KEY (project_id);
-
ALTER TABLE ONLY projects
ADD CONSTRAINT projects_pkey PRIMARY KEY (id);
@@ -28161,6 +28333,12 @@ ALTER TABLE ONLY status_page_published_incidents
ALTER TABLE ONLY status_page_settings
ADD CONSTRAINT status_page_settings_pkey PRIMARY KEY (project_id);
+ALTER TABLE ONLY subscription_add_on_purchases
+ ADD CONSTRAINT subscription_add_on_purchases_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY subscription_add_ons
+ ADD CONSTRAINT subscription_add_ons_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY subscriptions
ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id);
@@ -28427,6 +28605,10 @@ 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_issue_stage_events_for_consistency_check ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_009e6c1133 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
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);
@@ -28459,6 +28641,8 @@ CREATE INDEX index_issue_stage_events_project_in_progress_duration ON ONLY analy
CREATE INDEX index_0d837a5dda ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_0e98daa03c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_0f28a65451 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_10588dbff0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28477,6 +28661,8 @@ CREATE INDEX index_14f3645821 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_16627b455e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_17fa2812c5 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_1a0388713a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_1a349ed064 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28493,8 +28679,14 @@ CREATE INDEX index_201c5ddbe9 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_20353089e0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_mr_stage_events_for_consistency_check ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_203dd694bc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_206349925b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 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_2098118748 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_21db459e34 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 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_21e262390a ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28527,6 +28719,8 @@ CREATE INDEX index_27d7ad78d8 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_281840d2d1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_2945cf4c6d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_296f64df5c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_2ad4b4fdbc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28559,6 +28753,8 @@ CREATE INDEX index_3640194b77 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_372160a706 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_389dd3c9fc ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_38a538234e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 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_39625b8a41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28567,10 +28763,14 @@ CREATE INDEX index_399dc06649 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_3a10b315c0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 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_3a8848c00b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_3c2a3a6ac9 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 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_3e6be332b7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_4137a6fac3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_41a1c3a4c6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_435802dd01 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28581,10 +28781,14 @@ CREATE INDEX index_453a659cb6 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_46b989b294 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_4717e7049b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_47638677a3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 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_4810ac88f5 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_482a09e0ee ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_491b4b749e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_4a243772d7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28611,6 +28815,10 @@ CREATE INDEX index_4f2eb7a06b ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_4f6fc34e57 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 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_50272372ba ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_5034eae5ff ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_50c09f6e04 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_5111e3e7e7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28619,16 +28827,24 @@ CREATE INDEX index_52ea79bf8e ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_541cc045fc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 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_5445e466ee ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_551676e972 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_56281bfb73 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_5660b1b38e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 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_584c1e6fb0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_5913107510 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_59a8209ab6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_59ce40fcc4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_59cfd5bc9a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_5a5f39d824 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_5b613b5fcf ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28637,10 +28853,16 @@ CREATE INDEX index_5b944f308d ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_5bc2f32084 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 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_5bfa62771b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_5c4053b63d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_5db09170d4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_5e46aea379 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_5e78c2eac1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_5ee060202f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_5f24f6ead2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28663,8 +28885,12 @@ CREATE INDEX index_64e3a1dfa1 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_64eb4cf8bd ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 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_6578d04baa ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_6580ecb2db ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_66a736da09 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_682eba05f6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_69bdcf213e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28677,6 +28903,10 @@ CREATE INDEX index_6b1ce61c8f ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_6cfb391b86 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 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_6e560c1a4d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_6e64aa1646 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_6e6c2e6a1d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_6ea423bbd1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28687,6 +28917,8 @@ CREATE INDEX index_6f4e0abe54 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_6fa47e1334 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_708d792ae9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_70c657954b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 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_71c2b26944 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28713,6 +28945,8 @@ CREATE INDEX index_7ead2300ca ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_7ecb5b68b4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_7f543eed8d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_807671c4be ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_807fa83fc0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28723,6 +28957,8 @@ CREATE INDEX index_81b9cf594f ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_82c675952c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_837cc295f1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_83c5049b3e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_83edf231b8 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28739,20 +28975,32 @@ CREATE INDEX index_87d40fb9f9 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_88b40d6740 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_89c49cf697 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_89c79afe5c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_8a0fc3de4f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_8a8eb06b9a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_8b1b6b03b4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_8b9f9a19a4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_8fb48e72ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_918bb2ebbb ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_91d5e4e3df ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_9201b952a0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_92c09e352b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_9490e0e0b7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_9555c2ae92 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_95a353f50b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 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_971af9481e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28761,6 +29009,8 @@ CREATE INDEX index_9955b1dc59 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_9b8e89ae41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 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_9d0e953ab3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_9ee83b068b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_a1a9dc36c1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28769,6 +29019,8 @@ CREATE INDEX index_a2d9f185a5 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_a3feed3097 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_a46b7b7f26 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_a6999c65c9 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_a6c68d16b2 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28777,10 +29029,16 @@ CREATE INDEX index_a8276a450f ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_a88f20fc98 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_a8fe03fe34 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_a9424aa392 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_a99cee1904 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_a9b1763c36 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_a9ba23c88e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_a9deff2159 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_aabc184267 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28789,6 +29047,8 @@ CREATE INDEX index_ab22231a16 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_abbdf80ab1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 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_ad55e8b11c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_adc159c3fe ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_aed7f7b10c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28797,6 +29057,14 @@ CREATE INDEX index_aee84adb5b ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_b1dda405af ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_b24e8538c8 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_b3b64068e7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_b3c4c9a53f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
+CREATE INDEX index_b4b2bba753 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_b607012614 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_b7f21460bb ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28807,10 +29075,18 @@ CREATE INDEX index_bc189e47ab ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_bca83177ef ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_bcaa8dcd34 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_be0a028bcc ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_bedd7e160b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_bee2b94a80 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_bf1809b19e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_c02f569fba ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_c08e669dfa ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_c09bb66559 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28837,46 +29113,70 @@ CREATE INDEX index_c66758baa7 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_c6ea8a0e26 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_c7ac8595d3 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_c8c4219c0a ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_c971e6c5ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_c9b14a3d9f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 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_cb222425ed ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_cbb61ea269 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_cc0ba6343b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_ccb4f5c5a6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_cd2b2939a4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 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_cda41e106e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_ce87cbaf2d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_cfa4237c83 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_d01ea0126a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 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_d03e9cdfae ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_d0d285c264 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_d17b82ddd9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
+CREATE INDEX index_d1c24d8199 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_d27b4c84e7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_d2fe918e83 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_d35c969634 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_d493a5c171 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_d6047ee813 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_d69c2485f4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_d70379e22c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_d8fa9793ad ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
CREATE INDEX index_d9384b768d ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_db2753330c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_dc571ba649 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_de0334da63 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_df62a8c50e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_e1a4f994d8 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_e38489ea98 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_e3d1fd5b19 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_e3d6234929 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
@@ -28895,12 +29195,18 @@ CREATE INDEX index_e8f3a327b2 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_ea0c2d3361 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 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_ea1b583157 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_eb558957f0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_ec25d494e6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+CREATE INDEX index_ece25b5987 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_ed094a4f13 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 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_ed6dbac8c0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id);
+
CREATE INDEX index_ee4c549a2d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 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_ef6a48bd29 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -28929,10 +29235,14 @@ CREATE INDEX index_f76e8a5304 ON gitlab_partitions_static.analytics_cycle_analyt
CREATE INDEX index_f86acdc2ff ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_f86f73056d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_f878aab8e3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_f902c261ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
+CREATE INDEX index_f91599d825 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id);
+
CREATE INDEX index_fbccc855cf ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
CREATE INDEX index_fbf2d3310b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1));
@@ -29359,6 +29669,8 @@ CREATE INDEX ca_aggregations_last_full_run_at ON analytics_cycle_analytics_aggre
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 p_ci_builds_status_created_at_project_id_idx ON ONLY p_ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
+
CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
CREATE UNIQUE INDEX ci_job_token_scope_links_source_and_target_project_direction ON ci_job_token_project_scope_links USING btree (source_project_id, target_project_id, direction);
@@ -29427,7 +29739,7 @@ CREATE UNIQUE INDEX i_pm_package_versions_on_package_id_and_version ON pm_packag
CREATE UNIQUE INDEX i_pm_packages_purl_type_and_name ON pm_packages USING btree (purl_type, name);
-CREATE INDEX i_users_on_last_activity_for_active_human_service_migration ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = 4)));
+CREATE INDEX idx_alert_management_alerts_on_created_at_project_id_with_issue ON alert_management_alerts USING btree (created_at, project_id) WHERE (issue_id IS NOT NULL);
CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id);
@@ -29481,12 +29793,16 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_me
CREATE UNIQUE INDEX idx_external_audit_event_destination_id_key_uniq ON audit_events_streaming_headers USING btree (key, external_audit_event_destination_id);
+CREATE INDEX idx_headers_instance_external_audit_event_destination_id ON instance_audit_events_streaming_headers USING btree (instance_external_audit_event_destination_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));
+CREATE UNIQUE INDEX idx_instance_external_audit_event_destination_id_key_uniq ON instance_audit_events_streaming_headers USING btree (instance_external_audit_event_destination_id, key);
+
CREATE INDEX idx_issues_on_health_status_not_null ON issues USING btree (health_status) WHERE (health_status IS NOT NULL);
CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issues USING btree (project_id, created_at, id, state_id);
@@ -29497,6 +29813,8 @@ CREATE INDEX idx_issues_on_project_id_and_rel_position_and_id_and_state_id ON is
CREATE INDEX idx_issues_on_project_id_and_updated_at_and_id_and_state_id ON issues USING btree (project_id, updated_at, id, state_id);
+CREATE INDEX idx_issues_on_project_work_item_type_closed_at_where_closed ON issues USING btree (project_id, work_item_type_id, closed_at) WHERE (state_id = 2);
+
CREATE INDEX idx_issues_on_state_id ON issues USING btree (state_id);
CREATE INDEX idx_jira_connect_subscriptions_on_installation_id ON jira_connect_subscriptions USING btree (jira_connect_installation_id);
@@ -29569,8 +29887,6 @@ 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_project_wiki_repository_states_project_wiki_repository_id ON project_wiki_repository_states USING btree (project_wiki_repository_id);
-
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));
@@ -29595,6 +29911,8 @@ CREATE INDEX idx_repository_states_on_wiki_failure_partial ON project_repository
CREATE INDEX idx_repository_states_outdated_checksums ON project_repository_states USING btree (project_id) WHERE (((repository_verification_checksum IS NULL) AND (last_repository_verification_failure IS NULL)) OR ((wiki_verification_checksum IS NULL) AND (last_wiki_verification_failure IS NULL)));
+CREATE INDEX idx_sbom_occurrences_on_project_id_and_source_id ON sbom_occurrences USING btree (project_id, source_id);
+
CREATE UNIQUE INDEX idx_security_scans_on_build_and_scan_type ON security_scans USING btree (build_id, scan_type);
CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan_type);
@@ -29629,10 +29947,20 @@ CREATE INDEX idx_vulnerability_reads_project_id_scanner_id_vulnerability_id ON v
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_events_on_abuse_report_id ON abuse_events USING btree (abuse_report_id);
+
+CREATE INDEX index_abuse_events_on_category_and_source ON abuse_events USING btree (category, source);
+
+CREATE INDEX index_abuse_events_on_user_id ON abuse_events USING btree (user_id);
+
CREATE INDEX index_abuse_report_events_on_abuse_report_id ON abuse_report_events USING btree (abuse_report_id);
CREATE INDEX index_abuse_report_events_on_user_id ON abuse_report_events USING btree (user_id);
+CREATE INDEX index_abuse_reports_on_assignee_id ON abuse_reports USING btree (assignee_id);
+
+CREATE INDEX index_abuse_reports_on_resolved_by_id ON abuse_reports USING btree (resolved_by_id);
+
CREATE INDEX index_abuse_reports_on_status_and_created_at ON abuse_reports USING btree (status, created_at);
CREATE INDEX index_abuse_reports_on_status_and_id ON abuse_reports USING btree (status, id);
@@ -29793,6 +30121,8 @@ CREATE UNIQUE INDEX index_atlassian_identities_on_extern_uid ON atlassian_identi
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_audit_events_on_entity_id_and_entity_type_and_created_at ON ONLY audit_events USING btree (entity_id, entity_type, created_at, id);
+
CREATE INDEX index_authentication_events_on_provider ON authentication_events USING btree (provider);
CREATE INDEX index_authentication_events_on_user_and_ip_address_and_result ON authentication_events USING btree (user_id, ip_address, result);
@@ -29903,8 +30233,6 @@ CREATE INDEX index_boards_on_project_id ON boards USING btree (project_id);
CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON broadcast_messages USING btree (ends_at, broadcast_type, id);
-CREATE INDEX index_broadcast_messages_on_namespace_id ON broadcast_messages USING btree (namespace_id);
-
CREATE INDEX index_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids);
CREATE INDEX index_bulk_import_batch_trackers_on_tracker_id ON bulk_import_batch_trackers USING btree (tracker_id);
@@ -29971,40 +30299,76 @@ CREATE INDEX p_ci_builds_metadata_project_id_idx ON ONLY p_ci_builds_metadata US
CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id);
+CREATE INDEX p_ci_builds_auto_canceled_by_id_idx ON ONLY p_ci_builds USING btree (auto_canceled_by_id);
+
CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id);
+CREATE INDEX p_ci_builds_commit_id_stage_idx_created_at_idx ON ONLY p_ci_builds USING btree (commit_id, stage_idx, created_at);
+
CREATE INDEX index_ci_builds_on_commit_id_and_stage_idx_and_created_at ON ci_builds USING btree (commit_id, stage_idx, created_at);
+CREATE INDEX p_ci_builds_commit_id_status_type_idx ON ONLY p_ci_builds USING btree (commit_id, status, type);
+
CREATE INDEX index_ci_builds_on_commit_id_and_status_and_type ON ci_builds USING btree (commit_id, status, type);
+CREATE INDEX p_ci_builds_commit_id_type_name_ref_idx ON ONLY p_ci_builds USING btree (commit_id, type, name, ref);
+
CREATE INDEX index_ci_builds_on_commit_id_and_type_and_name_and_ref ON ci_builds USING btree (commit_id, type, name, ref);
+CREATE INDEX p_ci_builds_commit_id_type_ref_idx ON ONLY p_ci_builds USING btree (commit_id, type, ref);
+
CREATE INDEX index_ci_builds_on_commit_id_and_type_and_ref ON ci_builds USING btree (commit_id, type, ref);
+CREATE INDEX p_ci_builds_commit_id_artifacts_expire_at_id_idx ON ONLY p_ci_builds USING btree (commit_id, artifacts_expire_at, id) WHERE (((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])));
+
CREATE INDEX index_ci_builds_on_commit_id_artifacts_expired_at_and_id ON ci_builds USING btree (commit_id, artifacts_expire_at, id) WHERE (((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])));
+CREATE INDEX p_ci_builds_project_id_id_idx ON ONLY p_ci_builds USING btree (project_id, id);
+
CREATE INDEX index_ci_builds_on_project_id_and_id ON ci_builds USING btree (project_id, id);
+CREATE INDEX p_ci_builds_project_id_name_ref_idx ON ONLY p_ci_builds USING btree (project_id, name, ref) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = 'success'::text) AND ((retried = false) OR (retried IS NULL)));
+
CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING btree (project_id, name, ref) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = 'success'::text) AND ((retried = false) OR (retried IS NULL)));
+CREATE INDEX p_ci_builds_resource_group_id_status_commit_id_idx ON ONLY p_ci_builds USING btree (resource_group_id, status, commit_id) WHERE (resource_group_id IS NOT NULL);
+
CREATE INDEX index_ci_builds_on_resource_group_and_status_and_commit_id ON ci_builds USING btree (resource_group_id, status, commit_id) WHERE (resource_group_id IS NOT NULL);
+CREATE INDEX p_ci_builds_runner_id_id_idx ON ONLY p_ci_builds USING btree (runner_id, id DESC);
+
CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC);
+CREATE INDEX p_ci_builds_stage_id_idx ON ONLY p_ci_builds USING btree (stage_id);
+
CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id);
+CREATE INDEX p_ci_builds_status_type_runner_id_idx ON ONLY p_ci_builds USING btree (status, type, runner_id);
+
CREATE INDEX index_ci_builds_on_status_and_type_and_runner_id ON ci_builds USING btree (status, type, runner_id);
+CREATE INDEX p_ci_builds_updated_at_idx ON ONLY p_ci_builds USING btree (updated_at);
+
CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at);
+CREATE INDEX p_ci_builds_upstream_pipeline_id_idx ON ONLY p_ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);
+
CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);
+CREATE INDEX p_ci_builds_user_id_idx ON ONLY p_ci_builds USING btree (user_id);
+
CREATE INDEX index_ci_builds_on_user_id ON ci_builds USING btree (user_id);
+CREATE INDEX p_ci_builds_user_id_created_at_idx ON ONLY p_ci_builds USING btree (user_id, created_at) WHERE ((type)::text = 'Ci::Build'::text);
+
CREATE INDEX index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build ON ci_builds USING btree (user_id, created_at) WHERE ((type)::text = 'Ci::Build'::text);
+CREATE INDEX p_ci_builds_project_id_status_idx ON ONLY p_ci_builds USING btree (project_id, status) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])));
+
CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_builds USING btree (project_id, status) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])));
+CREATE INDEX p_ci_builds_runner_id_idx ON ONLY p_ci_builds USING btree (runner_id) WHERE (((status)::text = 'running'::text) AND ((type)::text = 'Ci::Build'::text));
+
CREATE INDEX index_ci_builds_runner_id_running ON ci_builds USING btree (runner_id) WHERE (((status)::text = 'running'::text) AND ((type)::text = 'Ci::Build'::text));
CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id);
@@ -30461,6 +30825,8 @@ CREATE UNIQUE INDEX index_dast_sites_on_project_id_and_url ON dast_sites USING b
CREATE UNIQUE INDEX index_dep_prox_manifests_on_group_id_file_name_and_status ON dependency_proxy_manifests USING btree (group_id, file_name, status);
+CREATE INDEX index_dependency_list_exports_on_group_id ON dependency_list_exports USING btree (group_id);
+
CREATE INDEX index_dependency_list_exports_on_project_id ON dependency_list_exports USING btree (project_id);
CREATE INDEX index_dependency_list_exports_on_user_id ON dependency_list_exports USING btree (user_id);
@@ -30627,6 +30993,8 @@ CREATE INDEX index_emails_on_user_id ON emails USING btree (user_id);
CREATE INDEX index_enabled_clusters_on_id ON clusters USING btree (id) WHERE (enabled = true);
+CREATE INDEX index_environments_cluster_agent_id ON environments USING btree (cluster_agent_id) WHERE (cluster_agent_id IS NOT NULL);
+
CREATE INDEX index_environments_for_name_search_within_folder ON environments USING btree (project_id, lower(ltrim((name)::text, ((environment_type)::text || '/'::text))) varchar_pattern_ops, state);
CREATE INDEX index_environments_on_merge_request_id ON environments USING btree (merge_request_id);
@@ -30969,6 +31337,8 @@ CREATE INDEX index_import_failures_on_project_id_and_correlation_id_value ON imp
CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USING btree (project_id) WHERE (project_id IS NOT NULL);
+CREATE INDEX index_import_failures_on_user_id_not_null ON import_failures USING btree (user_id) WHERE (user_id IS NOT NULL);
+
CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL);
CREATE INDEX index_imported_projects_on_import_type_id ON projects USING btree (import_type, id) WHERE (import_type IS NOT NULL);
@@ -31123,7 +31493,7 @@ 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_issues_on_work_item_type_id_project_id_created_at_state ON issues USING btree (work_item_type_id, project_id, created_at, state_id);
CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id);
@@ -31267,7 +31637,7 @@ CREATE INDEX index_members_on_member_role_id ON members USING btree (member_role
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);
+CREATE INDEX index_members_on_source_and_type_and_access_level ON members USING btree (source_id, source_type, type, access_level);
CREATE INDEX index_members_on_source_state_type_access_level_and_user_id ON members USING btree (source_id, source_type, state, type, access_level, user_id) WHERE ((requested_at IS NULL) AND (invite_token IS NULL));
@@ -31303,8 +31673,6 @@ CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_req
CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
-CREATE INDEX index_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id);
-
CREATE INDEX index_merge_request_diff_llm_summaries_on_user_id ON merge_request_diff_llm_summaries USING btree (user_id);
CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL)));
@@ -31659,7 +32027,7 @@ CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username
CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text));
-CREATE INDEX index_on_value_stream_dashboard_aggregations_last_run_at_id ON value_stream_dashboard_aggregations USING btree (last_run_at, namespace_id) WHERE (enabled IS TRUE);
+CREATE INDEX index_on_value_stream_dashboard_aggregations_last_run_at_and_id ON value_stream_dashboard_aggregations USING btree (last_run_at NULLS FIRST, namespace_id) WHERE (enabled IS TRUE);
CREATE INDEX index_onboarding_progresses_for_create_track ON onboarding_progresses USING btree (created_at) WHERE (git_write_at IS NULL);
@@ -31695,10 +32063,14 @@ CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list
CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name), id);
+CREATE UNIQUE INDEX index_p_ci_job_annotations_on_partition_id_job_id_name ON ONLY p_ci_job_annotations USING btree (partition_id, job_id, name);
+
CREATE INDEX index_p_ci_runner_machine_builds_on_runner_machine_id ON ONLY p_ci_runner_machine_builds USING btree (runner_machine_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_id ON packages_build_infos USING btree (package_id, 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);
@@ -31837,6 +32209,8 @@ CREATE INDEX index_pages_domains_on_verified_at_and_enabled_until ON pages_domai
CREATE INDEX index_pages_domains_on_wildcard ON pages_domains USING btree (wildcard);
+CREATE INDEX p_ci_builds_user_id_name_idx ON ONLY p_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 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 INDEX index_pat_on_user_id_and_expires_at ON personal_access_tokens USING btree (user_id, expires_at);
@@ -31891,6 +32265,8 @@ CREATE UNIQUE INDEX index_project_aliases_on_name ON project_aliases USING btree
CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree (project_id);
+CREATE UNIQUE INDEX index_project_authorizations_on_project_user_access_level ON project_authorizations USING btree (project_id, user_id, access_level);
+
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);
@@ -31903,6 +32279,10 @@ CREATE INDEX index_project_compliance_framework_settings_on_framework_id ON proj
CREATE INDEX index_project_compliance_framework_settings_on_project_id ON project_compliance_framework_settings USING btree (project_id);
+CREATE INDEX index_project_compliance_standards_adherence_on_namespace_id ON project_compliance_standards_adherence USING btree (namespace_id);
+
+CREATE INDEX index_project_compliance_standards_adherence_on_project_id ON project_compliance_standards_adherence USING btree (project_id);
+
CREATE INDEX index_project_custom_attributes_on_key_and_value ON project_custom_attributes USING btree (key, value);
CREATE UNIQUE INDEX index_project_custom_attributes_on_project_id_and_key ON project_custom_attributes USING btree (project_id, key);
@@ -32015,14 +32395,6 @@ CREATE UNIQUE INDEX index_project_user_callouts_feature ON user_project_callouts
CREATE UNIQUE INDEX index_project_wiki_repositories_on_project_id ON project_wiki_repositories USING btree (project_id);
-CREATE INDEX index_project_wiki_repository_states_failed_verification ON project_wiki_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
-
-CREATE INDEX index_project_wiki_repository_states_needs_verification ON project_wiki_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
-
-CREATE INDEX index_project_wiki_repository_states_on_verification_state ON project_wiki_repository_states USING btree (verification_state);
-
-CREATE INDEX index_project_wiki_repository_states_pending_verification ON project_wiki_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
-
CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false));
CREATE INDEX index_projects_api_created_at_id_desc ON projects USING btree (created_at, id DESC);
@@ -32339,6 +32711,8 @@ CREATE INDEX index_sbom_occurrences_on_project_id ON sbom_occurrences USING btre
CREATE INDEX index_sbom_occurrences_on_project_id_and_id ON sbom_occurrences USING btree (project_id, id);
+CREATE INDEX index_sbom_occurrences_on_project_id_component_id ON sbom_occurrences USING btree (project_id, component_id);
+
CREATE INDEX index_sbom_occurrences_on_source_id ON sbom_occurrences USING btree (source_id);
CREATE UNIQUE INDEX index_sbom_occurrences_on_uuid ON sbom_occurrences USING btree (uuid);
@@ -32371,8 +32745,12 @@ CREATE UNIQUE INDEX index_search_namespace_index_assignments_uniqueness_index_ty
CREATE UNIQUE INDEX index_search_namespace_index_assignments_uniqueness_on_index_id ON search_namespace_index_assignments USING btree (namespace_id, search_index_id);
+CREATE INDEX p_ci_builds_user_id_name_created_at_idx ON ONLY p_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_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 p_ci_builds_name_id_idx ON ONLY p_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_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_policy_configurations_on_bot_user_id ON security_orchestration_policy_configurations USING btree (bot_user_id) WHERE (bot_user_id IS NOT NULL);
@@ -32519,6 +32897,12 @@ CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_
CREATE INDEX index_status_page_settings_on_project_id ON status_page_settings USING btree (project_id);
+CREATE INDEX index_subscription_add_on_purchases_on_namespace_id ON subscription_add_on_purchases USING btree (namespace_id);
+
+CREATE INDEX index_subscription_add_on_purchases_on_subscription_add_on_id ON subscription_add_on_purchases USING btree (subscription_add_on_id);
+
+CREATE UNIQUE INDEX index_subscription_add_ons_on_name ON subscription_add_ons USING btree (name);
+
CREATE INDEX index_subscriptions_on_project_id ON subscriptions USING btree (project_id);
CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_id ON subscriptions USING btree (subscribable_id, subscribable_type, user_id, project_id);
@@ -32633,8 +33017,6 @@ CREATE UNIQUE INDEX index_unique_ci_runner_projects_on_runner_id_and_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);
-
CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC);
CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id);
@@ -32689,6 +33071,8 @@ CREATE INDEX index_user_custom_attributes_on_key_and_value ON user_custom_attrib
CREATE UNIQUE INDEX index_user_custom_attributes_on_user_id_and_key ON user_custom_attributes USING btree (user_id, key);
+CREATE INDEX index_user_details_on_enterprise_group_id ON user_details USING btree (enterprise_group_id);
+
CREATE INDEX index_user_details_on_password_last_changed_at ON user_details USING btree (password_last_changed_at);
COMMENT ON INDEX index_user_details_on_password_last_changed_at IS 'JiHu-specific index';
@@ -32699,10 +33083,6 @@ COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index';
CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id);
-CREATE INDEX index_user_details_on_user_id_for_enterprise_users_with_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NOT NULL));
-
-CREATE INDEX index_user_details_on_user_id_for_enterprise_users_without_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NULL));
-
CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id);
CREATE INDEX index_user_highest_roles_on_user_id_and_highest_access_level ON user_highest_roles USING btree (user_id, highest_access_level);
@@ -32727,7 +33107,7 @@ CREATE INDEX index_user_statuses_on_user_id ON user_statuses USING btree (user_i
CREATE UNIQUE INDEX index_user_synced_attributes_metadata_on_user_id ON user_synced_attributes_metadata USING btree (user_id);
-CREATE INDEX index_users_for_active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[6, 4, 13]))) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[4, 5]))));
+CREATE INDEX index_users_for_active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND (user_type = ANY (ARRAY[0, 6, 4, 13])) AND (user_type = ANY (ARRAY[0, 4, 5])));
CREATE INDEX index_users_on_accepted_term_id ON users USING btree (accepted_term_id);
@@ -32745,7 +33125,7 @@ CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token);
CREATE INDEX index_users_on_group_view ON users USING btree (group_view);
-CREATE INDEX index_users_on_id_and_last_activity_on_for_active_human_service ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 4)));
+CREATE INDEX index_users_on_id_and_last_activity_on_for_active_human_service ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND (user_type = ANY (ARRAY[0, 4])));
CREATE INDEX index_users_on_incoming_email_token ON users USING btree (incoming_email_token);
@@ -32767,6 +33147,8 @@ CREATE INDEX index_users_on_state_and_user_type ON users USING btree (state, use
CREATE UNIQUE INDEX index_users_on_static_object_token ON users USING btree (static_object_token);
+CREATE INDEX index_users_on_unconfirmed_and_created_at_for_active_humans ON users USING btree (created_at, id) WHERE ((confirmed_at IS NULL) AND ((state)::text = 'active'::text) AND (user_type = 0));
+
CREATE INDEX index_users_on_unconfirmed_email ON users USING btree (unconfirmed_email) WHERE (unconfirmed_email IS NOT NULL);
CREATE UNIQUE INDEX index_users_on_unlock_token ON users USING btree (unlock_token);
@@ -32915,9 +33297,9 @@ CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occ
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_common_finder_query_2 ON vulnerability_reads USING btree (project_id, state, report_type, severity, vulnerability_id DESC, dismissal_reason);
-CREATE INDEX index_vulnerability_reads_common_finder_query_with_namespace_id ON vulnerability_reads USING btree (namespace_id, state, report_type, severity, vulnerability_id DESC);
+CREATE INDEX index_vulnerability_reads_common_finder_query_w_namespace_id ON vulnerability_reads USING btree (namespace_id, state, report_type, severity, vulnerability_id DESC, dismissal_reason);
CREATE INDEX index_vulnerability_reads_on_cluster_agent_id ON vulnerability_reads USING btree (cluster_agent_id) WHERE (report_type = 7);
@@ -32925,6 +33307,8 @@ CREATE INDEX index_vulnerability_reads_on_location_image ON vulnerability_reads
CREATE INDEX index_vulnerability_reads_on_location_image_partial ON vulnerability_reads USING btree (project_id, location_image) WHERE ((report_type = ANY (ARRAY[2, 7])) AND (location_image IS NOT NULL));
+CREATE INDEX index_vulnerability_reads_on_location_image_trigram ON vulnerability_reads USING gin (location_image gin_trgm_ops) WHERE ((report_type = ANY (ARRAY[2, 7])) AND (location_image IS NOT NULL));
+
CREATE INDEX index_vulnerability_reads_on_namespace_type_severity_id ON vulnerability_reads USING btree (namespace_id, report_type, severity, vulnerability_id);
CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USING btree (scanner_id);
@@ -32977,8 +33361,6 @@ CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type);
CREATE UNIQUE INDEX index_webauthn_registrations_on_credential_xid ON webauthn_registrations USING btree (credential_xid);
-CREATE INDEX index_webauthn_registrations_on_u2f_registration_id ON webauthn_registrations USING btree (u2f_registration_id) WHERE (u2f_registration_id IS NOT NULL);
-
CREATE INDEX index_webauthn_registrations_on_user_id ON webauthn_registrations USING btree (user_id);
CREATE INDEX index_wiki_page_meta_on_project_id ON wiki_page_meta USING btree (project_id);
@@ -33007,6 +33389,8 @@ CREATE UNIQUE INDEX index_work_item_parent_links_on_work_item_id ON work_item_pa
CREATE INDEX index_work_item_parent_links_on_work_item_parent_id ON work_item_parent_links USING btree (work_item_parent_id);
+CREATE INDEX index_work_item_types_on_base_type_and_id ON work_item_types USING btree (base_type, id);
+
CREATE UNIQUE INDEX index_work_item_widget_definitions_on_default_witype_and_name ON work_item_widget_definitions USING btree (work_item_type_id, name) WHERE (namespace_id IS NULL);
CREATE UNIQUE INDEX index_work_item_widget_definitions_on_namespace_type_and_name ON work_item_widget_definitions USING btree (namespace_id, work_item_type_id, name);
@@ -33065,14 +33449,14 @@ CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_and_note_id_index ON me
CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_index ON merge_request_user_mentions USING btree (merge_request_id) WHERE (note_id IS NULL);
-CREATE INDEX merge_requests_state_id_temp_index ON merge_requests USING btree (id) WHERE (state_id = ANY (ARRAY[2, 3]));
-
-CREATE INDEX migrate_index_users_for_active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = ANY (ARRAY[0, 6, 4, 13]))) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = ANY (ARRAY[0, 4, 5]))));
-
CREATE INDEX note_mentions_temp_index ON notes USING btree (id, noteable_type) WHERE (note ~~ '%@%'::text);
CREATE UNIQUE INDEX one_canonical_wiki_page_slug_per_metadata ON wiki_page_slugs USING btree (wiki_page_meta_id) WHERE (canonical = true);
+CREATE INDEX p_ci_builds_scheduled_at_idx ON ONLY p_ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text));
+
+CREATE UNIQUE INDEX p_ci_builds_token_encrypted_partition_id_idx ON ONLY p_ci_builds USING btree (token_encrypted, partition_id) WHERE (token_encrypted IS NOT NULL);
+
CREATE INDEX package_name_index ON packages_packages USING btree (name);
CREATE INDEX packages_packages_failed_verification ON packages_package_files USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
@@ -33097,6 +33481,8 @@ CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestr
CREATE INDEX partial_index_user_id_app_id_created_at_token_not_revoked ON oauth_access_tokens USING btree (resource_owner_id, application_id, created_at) WHERE (revoked_at IS NULL);
+CREATE UNIQUE INDEX pm_checkpoints_path_components ON pm_checkpoints USING btree (purl_type, data_type, version_format);
+
CREATE INDEX scan_finding_approval_mr_rule_index_id ON approval_merge_request_rules USING btree (id) WHERE (report_type = 4);
CREATE INDEX scan_finding_approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id) WHERE (report_type = 4);
@@ -33133,6 +33519,8 @@ CREATE INDEX tmp_idx_for_feedback_comment_processing ON vulnerability_feedback U
CREATE INDEX tmp_idx_for_vulnerability_feedback_migration ON vulnerability_feedback USING btree (id) WHERE ((migrated_to_state_transition = false) AND (feedback_type = 0));
+CREATE INDEX tmp_idx_packages_on_project_id_when_npm_not_pending_destruction ON packages_packages USING btree (project_id) WHERE ((package_type = 2) AND (status <> 4));
+
CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99]));
CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL));
@@ -33145,18 +33533,16 @@ CREATE INDEX tmp_index_container_repos_on_non_migrated ON container_repositories
CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state);
+CREATE INDEX tmp_index_for_backfilling_resource_link_events ON system_note_metadata USING btree (id) WHERE (((action)::text = 'relate_to_parent'::text) OR ((action)::text = 'unrelate_from_parent'::text));
+
CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (member_namespace_id) WHERE (member_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_only_incidents ON issues USING btree (issue_type, id) WHERE (issue_type = 1);
-
CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2);
CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone));
-CREATE INDEX tmp_index_oauth_access_tokens_on_id_where_expires_in_null ON oauth_access_tokens USING btree (id) WHERE (expires_in IS NULL);
-
CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0);
@@ -33165,6 +33551,10 @@ CREATE INDEX tmp_index_vulnerability_dismissal_info ON vulnerabilities USING btr
CREATE INDEX tmp_index_vulnerability_overlong_title_html ON vulnerabilities USING btree (id) WHERE (length(title_html) > 800);
+CREATE UNIQUE INDEX u_project_compliance_standards_adherence_for_reporting ON project_compliance_standards_adherence USING btree (project_id, check_name, standard);
+
+CREATE UNIQUE INDEX uniq_idx_packages_packages_on_project_id_name_version_ml_model ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 14);
+
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);
@@ -33193,9 +33583,11 @@ CREATE UNIQUE INDEX unique_index_for_project_pages_unique_domain ON project_sett
CREATE UNIQUE INDEX unique_index_on_system_note_metadata_id ON resource_link_events USING btree (system_note_metadata_id);
+CREATE UNIQUE INDEX unique_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id);
+
CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id);
-CREATE UNIQUE INDEX unique_organizations_on_name_lower ON organizations USING btree (lower(name));
+CREATE UNIQUE INDEX unique_organizations_on_path ON organizations USING btree (path);
CREATE UNIQUE INDEX unique_packages_project_id_and_name_and_version_when_debian ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 9) AND (status <> 4));
@@ -33205,6 +33597,8 @@ CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree
CREATE UNIQUE INDEX unique_streaming_event_type_filters_destination_id ON audit_events_streaming_event_type_filters USING btree (external_audit_event_destination_id, audit_event_type);
+CREATE UNIQUE INDEX unique_streaming_instance_event_type_filters_destination_id ON audit_events_streaming_instance_event_type_filters USING btree (instance_external_audit_event_destination_id, audit_event_type);
+
CREATE UNIQUE INDEX unique_vuln_merge_request_link_vuln_id_and_mr_id ON vulnerability_merge_request_links USING btree (vulnerability_id, merge_request_id);
CREATE INDEX user_follow_users_followee_id_idx ON user_follow_users USING btree (followee_id);
@@ -33347,6 +33741,8 @@ 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_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_009e6c1133;
+
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;
@@ -33369,6 +33765,8 @@ ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0d837a5dda;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_0e98daa03c;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0f28a65451;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_10588dbff0;
@@ -33385,6 +33783,8 @@ ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION git
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_16627b455e;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_17fa2812c5;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_1a0388713a;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1a349ed064;
@@ -33401,8 +33801,12 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_20353089e0;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_203dd694bc;
+
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_206349925b;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_2098118748;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_21db459e34;
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_21e262390a;
@@ -33435,6 +33839,8 @@ ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_281840d2d1;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_2945cf4c6d;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_296f64df5c;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2ad4b4fdbc;
@@ -33467,6 +33873,8 @@ ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_372160a706;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_389dd3c9fc;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_38a538234e;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_39625b8a41;
@@ -33475,10 +33883,14 @@ ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_part
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3a10b315c0;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_3a8848c00b;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3c2a3a6ac9;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3e6be332b7;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_4137a6fac3;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_41a1c3a4c6;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_435802dd01;
@@ -33489,10 +33901,14 @@ ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_46b989b294;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_4717e7049b;
+
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_47638677a3;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4810ac88f5;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_482a09e0ee;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_491b4b749e;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4a243772d7;
@@ -33519,6 +33935,10 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4f6fc34e57;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_50272372ba;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5034eae5ff;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_50c09f6e04;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5111e3e7e7;
@@ -33527,16 +33947,24 @@ ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION g
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_541cc045fc;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5445e466ee;
+
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_551676e972;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_56281bfb73;
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5660b1b38e;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_584c1e6fb0;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5913107510;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_59a8209ab6;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_59ce40fcc4;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_59cfd5bc9a;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5a5f39d824;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5b613b5fcf;
@@ -33545,10 +33973,16 @@ ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION git
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5bc2f32084;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5bfa62771b;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5c4053b63d;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_5db09170d4;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5e46aea379;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_5e78c2eac1;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5ee060202f;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5f24f6ead2;
@@ -33571,8 +34005,12 @@ ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_part
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_64eb4cf8bd;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_6578d04baa;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6580ecb2db;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_66a736da09;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_682eba05f6;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_69bdcf213e;
@@ -33585,6 +34023,10 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_6cfb391b86;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_6e560c1a4d;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_6e64aa1646;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6e6c2e6a1d;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_6ea423bbd1;
@@ -33595,6 +34037,8 @@ ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6fa47e1334;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_708d792ae9;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_70c657954b;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_71c2b26944;
@@ -33621,6 +34065,8 @@ ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_part
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_7ecb5b68b4;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_7f543eed8d;
+
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_807671c4be;
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_807fa83fc0;
@@ -33631,6 +34077,8 @@ ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_82c675952c;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_837cc295f1;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_83c5049b3e;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_83edf231b8;
@@ -33647,20 +34095,32 @@ ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION g
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_88b40d6740;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_89c49cf697;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_89c79afe5c;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8a0fc3de4f;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_8a8eb06b9a;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_8b1b6b03b4;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_8b9f9a19a4;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_8fb48e72ce;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_918bb2ebbb;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_91d5e4e3df;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_9201b952a0;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_92c09e352b;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9490e0e0b7;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_9555c2ae92;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_95a353f50b;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_971af9481e;
@@ -33669,6 +34129,8 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_9b8e89ae41;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_9d0e953ab3;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9ee83b068b;
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a1a9dc36c1;
@@ -33677,6 +34139,8 @@ ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a3feed3097;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_a46b7b7f26;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a6999c65c9;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_a6c68d16b2;
@@ -33685,10 +34149,16 @@ ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION g
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a88f20fc98;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_a8fe03fe34;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a9424aa392;
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a99cee1904;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_a9b1763c36;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_a9ba23c88e;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_a9deff2159;
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_aabc184267;
@@ -33697,6 +34167,8 @@ ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITI
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_abbdf80ab1;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ad55e8b11c;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_adc159c3fe;
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_aed7f7b10c;
@@ -33705,6 +34177,14 @@ ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION git
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b1dda405af;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_b24e8538c8;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_b3b64068e7;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_b3c4c9a53f;
+
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_b4b2bba753;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b607012614;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b7f21460bb;
@@ -33715,10 +34195,18 @@ ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_part
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_bca83177ef;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_bcaa8dcd34;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_be0a028bcc;
+
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bedd7e160b;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bee2b94a80;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_bf1809b19e;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_c02f569fba;
+
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c08e669dfa;
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c09bb66559;
@@ -33745,46 +34233,70 @@ ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c6ea8a0e26;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_c7ac8595d3;
+
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c8c4219c0a;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c971e6c5ce;
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c9b14a3d9f;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_cb222425ed;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cbb61ea269;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_cc0ba6343b;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ccb4f5c5a6;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_cd2b2939a4;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cda41e106e;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ce87cbaf2d;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cfa4237c83;
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_d01ea0126a;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_d03e9cdfae;
+
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d0d285c264;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_d17b82ddd9;
+
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_d1c24d8199;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d27b4c84e7;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d2fe918e83;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d35c969634;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_d493a5c171;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d6047ee813;
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d69c2485f4;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_d70379e22c;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d8fa9793ad;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d9384b768d;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_db2753330c;
+
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_dc571ba649;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_de0334da63;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_df62a8c50e;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e1a4f994d8;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_e38489ea98;
+
ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e3d1fd5b19;
ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e3d6234929;
@@ -33803,12 +34315,18 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ea0c2d3361;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ea1b583157;
+
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_eb558957f0;
ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_ec25d494e6;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ece25b5987;
+
ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ed094a4f13;
+ALTER INDEX index_issue_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_ed6dbac8c0;
+
ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ee4c549a2d;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ef6a48bd29;
@@ -33837,10 +34355,14 @@ ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH P
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f86acdc2ff;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_f86f73056d;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f878aab8e3;
ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f902c261ce;
+ALTER INDEX index_mr_stage_events_for_consistency_check ATTACH PARTITION gitlab_partitions_static.index_f91599d825;
+
ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fbccc855cf;
ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fbf2d3310b;
@@ -34495,8 +35017,12 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p
ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey;
+ALTER INDEX p_ci_builds_status_created_at_project_id_idx ATTACH PARTITION ci_builds_gitlab_monitor_metrics;
+
ALTER INDEX p_ci_builds_metadata_pkey ATTACH PARTITION ci_builds_metadata_pkey;
+ALTER INDEX p_ci_builds_pkey ATTACH PARTITION ci_builds_pkey;
+
ALTER INDEX p_ci_builds_metadata_build_id_idx ATTACH PARTITION index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts;
ALTER INDEX p_ci_builds_metadata_build_id_id_idx ATTACH PARTITION index_ci_builds_metadata_on_build_id_and_id_and_interruptible;
@@ -34505,6 +35031,52 @@ ALTER INDEX p_ci_builds_metadata_build_id_partition_id_idx ATTACH PARTITION inde
ALTER INDEX p_ci_builds_metadata_project_id_idx ATTACH PARTITION index_ci_builds_metadata_on_project_id;
+ALTER INDEX p_ci_builds_auto_canceled_by_id_idx ATTACH PARTITION index_ci_builds_on_auto_canceled_by_id;
+
+ALTER INDEX p_ci_builds_commit_id_stage_idx_created_at_idx ATTACH PARTITION index_ci_builds_on_commit_id_and_stage_idx_and_created_at;
+
+ALTER INDEX p_ci_builds_commit_id_status_type_idx ATTACH PARTITION index_ci_builds_on_commit_id_and_status_and_type;
+
+ALTER INDEX p_ci_builds_commit_id_type_name_ref_idx ATTACH PARTITION index_ci_builds_on_commit_id_and_type_and_name_and_ref;
+
+ALTER INDEX p_ci_builds_commit_id_type_ref_idx ATTACH PARTITION index_ci_builds_on_commit_id_and_type_and_ref;
+
+ALTER INDEX p_ci_builds_commit_id_artifacts_expire_at_id_idx ATTACH PARTITION index_ci_builds_on_commit_id_artifacts_expired_at_and_id;
+
+ALTER INDEX p_ci_builds_project_id_id_idx ATTACH PARTITION index_ci_builds_on_project_id_and_id;
+
+ALTER INDEX p_ci_builds_project_id_name_ref_idx ATTACH PARTITION index_ci_builds_on_project_id_and_name_and_ref;
+
+ALTER INDEX p_ci_builds_resource_group_id_status_commit_id_idx ATTACH PARTITION index_ci_builds_on_resource_group_and_status_and_commit_id;
+
+ALTER INDEX p_ci_builds_runner_id_id_idx ATTACH PARTITION index_ci_builds_on_runner_id_and_id_desc;
+
+ALTER INDEX p_ci_builds_stage_id_idx ATTACH PARTITION index_ci_builds_on_stage_id;
+
+ALTER INDEX p_ci_builds_status_type_runner_id_idx ATTACH PARTITION index_ci_builds_on_status_and_type_and_runner_id;
+
+ALTER INDEX p_ci_builds_updated_at_idx ATTACH PARTITION index_ci_builds_on_updated_at;
+
+ALTER INDEX p_ci_builds_upstream_pipeline_id_idx ATTACH PARTITION index_ci_builds_on_upstream_pipeline_id;
+
+ALTER INDEX p_ci_builds_user_id_idx ATTACH PARTITION index_ci_builds_on_user_id;
+
+ALTER INDEX p_ci_builds_user_id_created_at_idx ATTACH PARTITION index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build;
+
+ALTER INDEX p_ci_builds_project_id_status_idx ATTACH PARTITION index_ci_builds_project_id_and_status_for_live_jobs_partial2;
+
+ALTER INDEX p_ci_builds_runner_id_idx ATTACH PARTITION index_ci_builds_runner_id_running;
+
+ALTER INDEX p_ci_builds_user_id_name_idx ATTACH PARTITION index_partial_ci_builds_on_user_id_name_parser_features;
+
+ALTER INDEX p_ci_builds_user_id_name_created_at_idx ATTACH PARTITION index_secure_ci_builds_on_user_id_name_created_at;
+
+ALTER INDEX p_ci_builds_name_id_idx ATTACH PARTITION index_security_ci_builds_on_name_and_id_parser_features;
+
+ALTER INDEX p_ci_builds_scheduled_at_idx ATTACH PARTITION partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs;
+
+ALTER INDEX p_ci_builds_token_encrypted_partition_id_idx ATTACH PARTITION unique_ci_builds_token_encrypted_and_partition_id;
+
CREATE TRIGGER chat_names_loose_fk_trigger AFTER DELETE ON chat_names REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
CREATE TRIGGER ci_builds_loose_fk_trigger AFTER DELETE ON ci_builds REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
@@ -34523,6 +35095,8 @@ CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCIN
CREATE TRIGGER nullify_merge_request_metrics_build_data_on_update BEFORE UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION nullify_merge_request_metrics_build_data();
+CREATE TRIGGER p_ci_builds_loose_fk_trigger AFTER DELETE ON p_ci_builds 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();
CREATE TRIGGER push_rules_loose_fk_trigger AFTER DELETE ON push_rules REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
@@ -34533,40 +35107,14 @@ CREATE TRIGGER trigger_023e82d8e257 BEFORE INSERT OR UPDATE ON ci_pipeline_varia
CREATE TRIGGER trigger_080e73845bfd BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE FUNCTION trigger_080e73845bfd();
-CREATE TRIGGER trigger_0e214b8a14f2 BEFORE INSERT OR UPDATE ON vulnerability_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_0e214b8a14f2();
-
-CREATE TRIGGER trigger_17c3a95ee58a BEFORE INSERT OR UPDATE ON commit_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_17c3a95ee58a();
-
CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd();
-CREATE TRIGGER trigger_3dc62927cae8 BEFORE INSERT OR UPDATE ON design_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_3dc62927cae8();
-
-CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
-
-CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_482bac5ec48a();
-
-CREATE TRIGGER trigger_775287b6d67a BEFORE INSERT OR UPDATE ON note_diff_files FOR EACH ROW EXECUTE FUNCTION trigger_775287b6d67a();
-
-CREATE TRIGGER trigger_909cf0a06094 BEFORE INSERT OR UPDATE ON award_emoji FOR EACH ROW EXECUTE FUNCTION trigger_909cf0a06094();
-
CREATE TRIGGER trigger_b2d852e1e2cb BEFORE INSERT OR UPDATE ON ci_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_b2d852e1e2cb();
-CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc();
-
-CREATE TRIGGER trigger_bfcbace4260d BEFORE INSERT OR UPDATE ON merge_request_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfcbace4260d();
-
-CREATE TRIGGER trigger_c2051020aa8b BEFORE INSERT OR UPDATE ON issue_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c2051020aa8b();
-
-CREATE TRIGGER trigger_c5a5f48f12b0 BEFORE INSERT OR UPDATE ON epic_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c5a5f48f12b0();
-
CREATE TRIGGER trigger_cd1aeb22b34a BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_cd1aeb22b34a();
-CREATE TRIGGER trigger_dca935e3a712 BEFORE INSERT OR UPDATE ON todos FOR EACH ROW EXECUTE FUNCTION trigger_dca935e3a712();
-
CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace();
-CREATE TRIGGER trigger_ee7956d805e6 BEFORE INSERT OR UPDATE ON suggestions FOR EACH ROW EXECUTE FUNCTION trigger_ee7956d805e6();
-
CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
@@ -34855,7 +35403,7 @@ ALTER TABLE ONLY incident_management_timeline_events
ALTER TABLE ONLY bulk_import_exports
ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds
+ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE;
ALTER TABLE ONLY agent_activity_events
@@ -34876,9 +35424,15 @@ ALTER TABLE ONLY bulk_import_export_uploads
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 abuse_reports
+ ADD CONSTRAINT fk_3fe6467b93 FOREIGN KEY (assignee_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 subscription_add_on_purchases
+ ADD CONSTRAINT fk_410004d68b FOREIGN KEY (subscription_add_on_id) REFERENCES subscription_add_ons(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;
@@ -34921,6 +35475,9 @@ ALTER TABLE ONLY user_achievements
ALTER TABLE ONLY vulnerability_reads
ADD CONSTRAINT fk_4f593f6c62 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_compliance_standards_adherence
+ ADD CONSTRAINT fk_4fd1d9d9b0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY vulnerability_reads
ADD CONSTRAINT fk_5001652292 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -34996,12 +35553,9 @@ ALTER TABLE ONLY vulnerability_reads
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_641731faff FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_builds
+ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL;
-ALTER TABLE ONLY project_wiki_repository_states
- ADD CONSTRAINT fk_6951681c70 FOREIGN KEY (project_wiki_repository_id) REFERENCES project_wiki_repositories(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@@ -35044,6 +35598,9 @@ ALTER TABLE ONLY index_statuses
ALTER TABLE ONLY cluster_agent_tokens
ADD CONSTRAINT fk_75008f3553 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY environments
+ ADD CONSTRAINT fk_75c2098045 FOREIGN KEY (cluster_agent_id) REFERENCES cluster_agents(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_76bc5f5455 FOREIGN KEY (resolved_by_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -35108,7 +35665,7 @@ ALTER TABLE ONLY requirements
ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_pending_states
- ADD CONSTRAINT fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE 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;
@@ -35116,7 +35673,7 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY packages_package_files
ADD CONSTRAINT fk_86f0f182f8 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds
+ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_87f4cefcda FOREIGN KEY (upstream_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerabilities
@@ -35132,7 +35689,7 @@ ALTER TABLE ONLY issues
ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_trace_chunks
- ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY sbom_vulnerable_component_versions
ADD CONSTRAINT fk_8a2a1197f9 FOREIGN KEY (sbom_component_version_id) REFERENCES sbom_component_versions(id) ON DELETE CASCADE;
@@ -35182,6 +35739,9 @@ ALTER TABLE ONLY protected_branch_merge_access_levels
ALTER TABLE ONLY notes
ADD CONSTRAINT fk_99e097b079 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY import_failures
+ ADD CONSTRAINT fk_9a9b9ba21c FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_9b9afb1916 FOREIGN KEY (repository_created_event_id) REFERENCES geo_repository_created_events(id) ON DELETE CASCADE;
@@ -35198,7 +35758,7 @@ ALTER TABLE ONLY user_group_callouts
ADD CONSTRAINT fk_9dc8b9d4b2 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_unit_test_failures
- ADD CONSTRAINT fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY protected_environments
ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -35218,7 +35778,10 @@ ALTER TABLE ONLY issues
ALTER TABLE ONLY ml_candidates
ADD CONSTRAINT fk_a1d5f1bc45 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_builds
+ALTER TABLE ONLY subscription_add_on_purchases
+ ADD CONSTRAINT fk_a1db288990 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_a2141b1522 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
ALTER TABLE ONLY bulk_import_entities
@@ -35323,6 +35886,9 @@ ALTER TABLE ONLY customer_relations_contacts
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_b9a3851b82 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_compliance_standards_adherence
+ ADD CONSTRAINT fk_baf6f6f878 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY routes
ADD CONSTRAINT fk_bb2e5b8968 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -35351,7 +35917,7 @@ ALTER TABLE ONLY snippets
ADD CONSTRAINT fk_be41fd4bb7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_sources_pipelines
- ADD CONSTRAINT fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY packages_maven_metadata
ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
@@ -35377,6 +35943,9 @@ ALTER TABLE ONLY timelogs
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_c4b1c1f66e FOREIGN KEY (repository_deleted_event_id) REFERENCES geo_repository_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY user_details
+ ADD CONSTRAINT fk_c53c794142 FOREIGN KEY (enterprise_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_c63cbf6c25 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -35434,7 +36003,7 @@ ALTER TABLE ONLY project_mirror_data
ALTER TABLE ONLY environments
ADD CONSTRAINT fk_d1c8c1da6a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds
+ALTER TABLE p_ci_builds
ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_sources_pipelines
@@ -35500,11 +36069,14 @@ ALTER TABLE ONLY protected_branches
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
+ALTER TABLE ONLY dependency_list_exports
+ ADD CONSTRAINT fk_e133f6725e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_project_rules
ADD CONSTRAINT fk_e1372c912e FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_resources
- ADD CONSTRAINT fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL;
+ ADD CONSTRAINT fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
@@ -35515,6 +36087,9 @@ ALTER TABLE p_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 abuse_events
+ ADD CONSTRAINT fk_e5ce49c215 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -35572,6 +36147,9 @@ ALTER TABLE ONLY vulnerability_external_issue_links
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_f081aa4489 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY abuse_reports
+ ADD CONSTRAINT fk_f10de8b524 FOREIGN KEY (resolved_by_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY boards
ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -35792,7 +36370,7 @@ ALTER TABLE ONLY users_security_dashboard_projects
ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_report_results
- ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY catalog_resources
ADD CONSTRAINT fk_rails_16f09e5c44 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -36050,7 +36628,7 @@ ALTER TABLE ONLY chat_teams
ADD CONSTRAINT fk_rails_3b543909cb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_needs
- ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY cluster_groups
ADD CONSTRAINT fk_rails_3d28377556 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -36211,6 +36789,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams
ALTER TABLE ONLY geo_node_namespace_links
ADD CONSTRAINT fk_rails_546bf08d3e FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY abuse_events
+ ADD CONSTRAINT fk_rails_55101e588c FOREIGN KEY (abuse_report_id) REFERENCES abuse_reports(id);
+
ALTER TABLE ONLY issuable_metric_images
ADD CONSTRAINT fk_rails_56417a5a7f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -36401,7 +36982,7 @@ ALTER TABLE ONLY analytics_dashboards_pointers
ADD CONSTRAINT fk_rails_7027b7eaa9 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_builds_runner_session
- ADD CONSTRAINT fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_70b2ef5ce2 FOREIGN KEY (list_id) REFERENCES lists(id) ON DELETE CASCADE;
@@ -36410,7 +36991,7 @@ ALTER TABLE ONLY project_custom_attributes
ADD CONSTRAINT fk_rails_719c3dccc5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_pending_builds
- ADD CONSTRAINT fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE security_findings
ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;
@@ -36640,9 +37221,6 @@ ALTER TABLE ONLY packages_debian_project_distributions
ALTER TABLE ONLY packages_rubygems_metadata
ADD CONSTRAINT fk_rails_95a3f5ce78 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
-ALTER TABLE ONLY project_wiki_repository_states
- ADD CONSTRAINT fk_rails_9647227ce1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY packages_pypi_metadata
ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
@@ -36721,6 +37299,9 @@ ALTER TABLE ONLY project_aliases
ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT fk_rails_a18600f210 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dependency_proxy_packages_settings
+ ADD CONSTRAINT fk_rails_a248d0c26f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_rails_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -36812,7 +37393,7 @@ ALTER TABLE ONLY metrics_dashboard_annotations
ADD CONSTRAINT fk_rails_aeb11a7643 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_trace_metadata
- ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY bulk_import_trackers
ADD CONSTRAINT fk_rails_aed566d3f3 FOREIGN KEY (bulk_import_entity_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE;
@@ -37066,6 +37647,9 @@ ALTER TABLE ONLY alert_management_alert_assignees
ALTER TABLE ONLY geo_hashed_storage_attachments_events
ADD CONSTRAINT fk_rails_d496b088e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE p_ci_job_annotations
+ ADD CONSTRAINT fk_rails_d4d0c0fa0f FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE ONLY packages_rpm_repository_files
ADD CONSTRAINT fk_rails_d545cfaed2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -37099,6 +37683,9 @@ ALTER TABLE ONLY board_user_preferences
ALTER TABLE ONLY vulnerability_occurrence_pipelines
ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+ALTER TABLE ONLY instance_audit_events_streaming_headers
+ ADD CONSTRAINT fk_rails_dc933c1f3c FOREIGN KEY (instance_external_audit_event_destination_id) REFERENCES audit_events_instance_external_audit_event_destinations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY deployment_merge_requests
ADD CONSTRAINT fk_rails_dcbce9f4df FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE;
@@ -37192,6 +37779,9 @@ ALTER TABLE ONLY namespace_package_settings
ALTER TABLE ONLY boards_epic_board_recent_visits
ADD CONSTRAINT fk_rails_e77911cf03 FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE;
+ALTER TABLE ONLY audit_events_streaming_instance_event_type_filters
+ ADD CONSTRAINT fk_rails_e7bb18c0e1 FOREIGN KEY (instance_external_audit_event_destination_id) REFERENCES audit_events_instance_external_audit_event_destinations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_site_tokens
ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -37378,6 +37968,18 @@ ALTER TABLE issue_search_data
ALTER TABLE product_analytics_events_experimental
ADD CONSTRAINT product_analytics_events_experimental_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_builds_metadata
+ ADD CONSTRAINT temp_fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
+ALTER TABLE ONLY ci_job_artifacts
+ ADD CONSTRAINT temp_fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
+ALTER TABLE ONLY ci_running_builds
+ ADD CONSTRAINT temp_fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
+ALTER TABLE ONLY ci_job_variables
+ ADD CONSTRAINT temp_fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY user_follow_users
ADD CONSTRAINT user_follow_users_followee_id_fkey FOREIGN KEY (followee_id) REFERENCES users(id) ON DELETE CASCADE;