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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-28 21:15:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-28 21:15:00 +0300
commit14059114eb35b29cf83aa1b715158c96c55ab388 (patch)
treeb9b96e6bb66e3b1caf900bdce664a234087a4848
parentee7db70e1185876e97eca97ce8efabfc64c360b9 (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/ci-templates.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/dev-fixtures.gitlab-ci.yml4
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/glfm.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/global.gitlab-ci.yml91
-rw-r--r--.gitlab/ci/memory.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/preflight.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml639
-rw-r--r--.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb2
-rw-r--r--.gitlab/ci/rails/shared.gitlab-ci.yml54
-rw-r--r--.gitlab/ci/rules.gitlab-ci.yml9
-rw-r--r--.gitlab/ci/setup.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/static-analysis.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/test-metadata.gitlab-ci.yml20
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/packages_and_registries/settings/group/components/packages_forwarding_settings.vue17
-rw-r--r--app/assets/javascripts/packages_and_registries/settings/group/constants.js7
-rw-r--r--app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue6
-rw-r--r--app/assets/javascripts/users_select/index.js2
-rw-r--r--app/controllers/projects/pipelines_controller.rb5
-rw-r--r--app/controllers/projects/project_members_controller.rb10
-rw-r--r--app/controllers/projects/work_items_controller.rb56
-rw-r--r--app/finders/access_requests_finder.rb6
-rw-r--r--app/finders/members_finder.rb6
-rw-r--r--app/mailers/emails/service_desk.rb3
-rw-r--r--app/models/project.rb1
-rw-r--r--app/models/service_desk/custom_email_credential.rb66
-rw-r--r--app/models/service_desk_setting.rb69
-rw-r--r--app/services/import_csv/base_service.rb1
-rw-r--r--app/services/work_items/prepare_import_csv_service.rb19
-rw-r--r--app/views/projects/pipelines/_info.html.haml5
-rw-r--r--app/workers/all_queues.yml9
-rw-r--r--app/workers/work_items/import_work_items_csv_worker.rb29
-rw-r--r--config/events/20230321151607_github_create.yml30
-rw-r--r--config/feature_flags/development/project_members_index_by_project_namespace.yml8
-rw-r--r--config/feature_flags/development/refactor_ci_minutes_consumption.yml8
-rw-r--r--config/routes/project.rb7
-rw-r--r--config/sidekiq_queues.yml2
-rw-r--r--db/docs/service_desk_custom_email_credentials.yml11
-rw-r--r--db/init_structure.sql5301
-rw-r--r--db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb23
-rw-r--r--db/migrate/20210830140524_add_state_to_member.rb21
-rw-r--r--db/migrate/20210830154358_add_yaml_limit_constraints.rb25
-rw-r--r--db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb17
-rw-r--r--db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb17
-rw-r--r--db/migrate/20210831203408_upsert_base_work_item_types.rb31
-rw-r--r--db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb18
-rw-r--r--db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb13
-rw-r--r--db/migrate/20210902171808_set_default_job_token_scope_false.rb17
-rw-r--r--db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb7
-rw-r--r--db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb45
-rw-r--r--db/migrate/20210906100021_delete_project_namespace_trigger.rb31
-rw-r--r--db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb15
-rw-r--r--db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb15
-rw-r--r--db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb7
-rw-r--r--db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb27
-rw-r--r--db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb7
-rw-r--r--db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb21
-rw-r--r--db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb7
-rw-r--r--db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb7
-rw-r--r--db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb7
-rw-r--r--db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb17
-rw-r--r--db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb11
-rw-r--r--db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb15
-rw-r--r--db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb15
-rw-r--r--db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb9
-rw-r--r--db/migrate/20210913010411_create_agent_project_authorizations.rb14
-rw-r--r--db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb20
-rw-r--r--db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb9
-rw-r--r--db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb18
-rw-r--r--db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb13
-rw-r--r--db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb18
-rw-r--r--db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb15
-rw-r--r--db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb15
-rw-r--r--db/migrate/20210915070423_add_avatar_and_description_to_topic.rb15
-rw-r--r--db/migrate/20210916132547_add_process_mode_to_resource_groups.rb15
-rw-r--r--db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb20
-rw-r--r--db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb15
-rw-r--r--db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb15
-rw-r--r--db/migrate/20210917224419_add_registration_objective_to_user_detail.rb7
-rw-r--r--db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb15
-rw-r--r--db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb7
-rw-r--r--db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb39
-rw-r--r--db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb15
-rw-r--r--db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb15
-rw-r--r--db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb15
-rw-r--r--db/migrate/20210922215740_create_issue_customer_relations_contacts.rb14
-rw-r--r--db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb20
-rw-r--r--db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb13
-rw-r--r--db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb23
-rw-r--r--db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb19
-rw-r--r--db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb11
-rw-r--r--db/migrate/20210928155022_improve_index_for_error_tracking.rb33
-rw-r--r--db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb18
-rw-r--r--db/migrate/20210929025600_add_phone_to_user_details.rb15
-rw-r--r--db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb13
-rw-r--r--db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb15
-rw-r--r--db/migrate/20210929032555_create_verification_codes.rb36
-rw-r--r--db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb18
-rw-r--r--db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb14
-rw-r--r--db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb16
-rw-r--r--db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb8
-rw-r--r--db/migrate/20211001001222_add_source_version_to_bulk_imports.rb7
-rw-r--r--db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb18
-rw-r--r--db/migrate/20211004075629_add_topics_name_gin_index.rb15
-rw-r--r--db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb7
-rw-r--r--db/migrate/20211004122540_create_member_tasks.rb13
-rw-r--r--db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb15
-rw-r--r--db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb15
-rw-r--r--db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb15
-rw-r--r--db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb27
-rw-r--r--db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb29
-rw-r--r--db/migrate/20211005100112_recreate_loose_fk_insert_function.rb40
-rw-r--r--db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb15
-rw-r--r--db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb15
-rw-r--r--db/migrate/20211006060254_add_topics_total_projects_count_cache.rb11
-rw-r--r--db/migrate/20211006103122_change_helm_channel_length.rb14
-rw-r--r--db/migrate/20211006122010_add_topics_total_projects_count_index.rb15
-rw-r--r--db/migrate/20211007090229_create_issue_search_table.rb29
-rw-r--r--db/migrate/20211007113136_add_status_column_to_security_scans_table.rb7
-rw-r--r--db/migrate/20211008043855_remove_notes_trigram_index.rb15
-rw-r--r--db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb9
-rw-r--r--db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb9
-rw-r--r--db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb8
-rw-r--r--db/migrate/20211011004242_create_content_blocked_states.rb15
-rw-r--r--db/migrate/20211011140930_create_ci_namespace_mirrors.rb15
-rw-r--r--db/migrate/20211011140931_create_ci_project_mirrors.rb12
-rw-r--r--db/migrate/20211011140932_create_namespaces_sync_events.rb9
-rw-r--r--db/migrate/20211011141239_create_projects_sync_events.rb9
-rw-r--r--db/migrate/20211011141242_create_namespaces_sync_trigger.rb37
-rw-r--r--db/migrate/20211011141243_create_projects_sync_trigger.rb37
-rw-r--r--db/migrate/20211012015903_next_traversal_ids_sibling_function.rb30
-rw-r--r--db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb13
-rw-r--r--db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb35
-rw-r--r--db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb20
-rw-r--r--db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb9
-rw-r--r--db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb13
-rw-r--r--db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb17
-rw-r--r--db/migrate/20211013192749_add_states_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb9
-rw-r--r--db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb13
-rw-r--r--db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb11
-rw-r--r--db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb59
-rw-r--r--db/migrate/20211019153615_add_state_to_merge_request_assignees.rb8
-rw-r--r--db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb9
-rw-r--r--db/migrate/20211020095357_add_group_traversal_id_index.rb15
-rw-r--r--db/migrate/20211021115409_add_color_to_epics.rb10
-rw-r--r--db/migrate/20211021124715_add_text_limit_to_epics_color.rb13
-rw-r--r--db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb12
-rw-r--r--db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb17
-rw-r--r--db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb7
-rw-r--r--db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb7
-rw-r--r--db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb7
-rw-r--r--db/migrate/20211026143238_remove_index_releases_on_author_id.rb15
-rw-r--r--db/migrate/20211027203950_add_updated_index_for_dormant_users.rb17
-rw-r--r--db/migrate/20211028132247_create_packages_npm_metadata.rb22
-rw-r--r--db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb7
-rw-r--r--db/migrate/20211101132310_add_reindexing_queue.rb16
-rw-r--r--db/migrate/20211101165656_create_upload_states.rb32
-rw-r--r--db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb7
-rw-r--r--db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb13
-rw-r--r--db/migrate/20211105010101_add_archived_column_to_deployments.rb9
-rw-r--r--db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb7
-rw-r--r--db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb7
-rw-r--r--db/migrate/20211105160316_create_dotenv_application_limits.rb8
-rw-r--r--db/migrate/20211105161404_insert_dotenv_application_limits.rb27
-rw-r--r--db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb7
-rw-r--r--db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb23
-rw-r--r--db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb27
-rw-r--r--db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb9
-rw-r--r--db/migrate/20211108211434_remove_index_for_resource_group.rb17
-rw-r--r--db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb13
-rw-r--r--db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb20
-rw-r--r--db/migrate/20211110010101_add_index_on_unarchived_deployments.rb15
-rw-r--r--db/migrate/20211110014701_create_agent_activity_events.rb22
-rw-r--r--db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb35
-rw-r--r--db/migrate/20211110092710_create_issue_emails.rb21
-rw-r--r--db/migrate/20211110100050_add_has_shimo_to_project_settings.rb9
-rw-r--r--db/migrate/20211111112425_create_merge_requests_compliance_violations.rb13
-rw-r--r--db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb18
-rw-r--r--db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb18
-rw-r--r--db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb9
-rw-r--r--db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb13
-rw-r--r--db/migrate/20211112073413_change_package_index_on_corpus.rb19
-rw-r--r--db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb20
-rw-r--r--db/migrate/20211115132613_create_incident_management_timeline_events.rb30
-rw-r--r--db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb15
-rw-r--r--db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb15
-rw-r--r--db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb15
-rw-r--r--db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb17
-rw-r--r--db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb17
-rw-r--r--db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb15
-rw-r--r--db/migrate/20211117174209_create_vulnerability_reads.rb24
-rw-r--r--db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb9
-rw-r--r--db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb40
-rw-r--r--db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb7
-rw-r--r--db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb15
-rw-r--r--db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb15
-rw-r--r--db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb15
-rw-r--r--db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb16
-rw-r--r--db/migrate/20211119111006_create_job_artifact_states.rb32
-rw-r--r--db/migrate/20211119154221_create_pages_deployment_states.rb38
-rw-r--r--db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb16
-rw-r--r--db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb7
-rw-r--r--db/migrate/20211119195201_create_deployment_approvals.rb13
-rw-r--r--db/migrate/20211122103051_add_line_code_to_draft_notes.rb10
-rw-r--r--db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb9
-rw-r--r--db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb38
-rw-r--r--db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb15
-rw-r--r--db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb7
-rw-r--r--db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb13
-rw-r--r--db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb14
-rw-r--r--db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb14
-rw-r--r--db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb12
-rw-r--r--db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb31
-rw-r--r--db/migrate/20211126142200_add_encrypted_static_object_token.rb16
-rw-r--r--db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb13
-rw-r--r--db/migrate/20211126204445_add_task_to_work_item_types.rb31
-rw-r--r--db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb7
-rw-r--r--db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb15
-rw-r--r--db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb15
-rw-r--r--db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb18
-rw-r--r--db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb7
-rw-r--r--db/migrate/20211201143042_create_lfs_object_states.rb32
-rw-r--r--db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb15
-rw-r--r--db/migrate/20211202041233_init_schema.rb (renamed from db/migrate/20210826171758_init_schema.rb)2
-rw-r--r--db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb22
-rw-r--r--db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb19
-rw-r--r--db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb18
-rw-r--r--db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb28
-rw-r--r--db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb28
-rw-r--r--db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb26
-rw-r--r--db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb59
-rw-r--r--db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb80
-rw-r--r--db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb26
-rw-r--r--db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb20
-rw-r--r--db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb18
-rw-r--r--db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb17
-rw-r--r--db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb19
-rw-r--r--db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb19
-rw-r--r--db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb19
-rw-r--r--db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb223
-rw-r--r--db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb11
-rw-r--r--db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb16
-rw-r--r--db/post_migrate/20210909152027_remove_container_registry_enabled.rb17
-rw-r--r--db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb39
-rw-r--r--db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb15
-rw-r--r--db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb54
-rw-r--r--db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb16
-rw-r--r--db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb15
-rw-r--r--db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb18
-rw-r--r--db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb12
-rw-r--r--db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb15
-rw-r--r--db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb18
-rw-r--r--db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb10
-rw-r--r--db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb9
-rw-r--r--db/post_migrate/20210922082019_drop_int4_column_for_events.rb9
-rw-r--r--db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb22
-rw-r--r--db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb9
-rw-r--r--db/post_migrate/20210923133143_remove_redundant_taggings_index.rb15
-rw-r--r--db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb19
-rw-r--r--db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb17
-rw-r--r--db/post_migrate/20210923192649_remove_open_project_data_table.rb22
-rw-r--r--db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb24
-rw-r--r--db/post_migrate/20210930211936_backfill_user_namespace.rb26
-rw-r--r--db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb17
-rw-r--r--db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb27
-rw-r--r--db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb10
-rw-r--r--db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb23
-rw-r--r--db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb29
-rw-r--r--db/post_migrate/20211005194425_schedule_requirements_migration.rb35
-rw-r--r--db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb23
-rw-r--r--db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb16
-rw-r--r--db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb20
-rw-r--r--db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb17
-rw-r--r--db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb11
-rw-r--r--db/post_migrate/20211011104843_add_new_loose_fk_index.rb20
-rw-r--r--db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb15
-rw-r--r--db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb15
-rw-r--r--db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb13
-rw-r--r--db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb29
-rw-r--r--db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb26
-rw-r--r--db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb15
-rw-r--r--db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb13
-rw-r--r--db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb15
-rw-r--r--db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb15
-rw-r--r--db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb22
-rw-r--r--db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb15
-rw-r--r--db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb27
-rw-r--r--db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb17
-rw-r--r--db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb18
-rw-r--r--db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb26
-rw-r--r--db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb12
-rw-r--r--db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb17
-rw-r--r--db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb14
-rw-r--r--db/post_migrate/20211026070408_backfill_issue_search_data.rb22
-rw-r--r--db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb15
-rw-r--r--db/post_migrate/20211027043229_track_ci_build_deletions.rb15
-rw-r--r--db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb15
-rw-r--r--db/post_migrate/20211027064156_track_deletions_in_chat_names.rb15
-rw-r--r--db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb17
-rw-r--r--db/post_migrate/20211027204011_remove_index_for_dormant_users.rb17
-rw-r--r--db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb23
-rw-r--r--db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb16
-rw-r--r--db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb23
-rw-r--r--db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb16
-rw-r--r--db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb55
-rw-r--r--db/post_migrate/20211029102822_add_open_source_plan.rb39
-rw-r--r--db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb41
-rw-r--r--db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb41
-rw-r--r--db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb26
-rw-r--r--db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb15
-rw-r--r--db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb24
-rw-r--r--db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb11
-rw-r--r--db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb17
-rw-r--r--db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb13
-rw-r--r--db/post_migrate/20211104044453_remove_redundant_events_index.rb13
-rw-r--r--db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb14
-rw-r--r--db/post_migrate/20211105135157_drop_ci_build_trace_sections.rb99
-rw-r--r--db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb20
-rw-r--r--db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb20
-rw-r--r--db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb23
-rw-r--r--db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb25
-rw-r--r--db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb22
-rw-r--r--db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb15
-rw-r--r--db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb17
-rw-r--r--db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb23
-rw-r--r--db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb26
-rw-r--r--db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb22
-rw-r--r--db/post_migrate/20211118194239_drop_invalid_remediations.rb25
-rw-r--r--db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb13
-rw-r--r--db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb13
-rw-r--r--db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb17
-rw-r--r--db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb26
-rw-r--r--db/post_migrate/20211124132705_change_index_users_on_public_email.rb22
-rw-r--r--db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb15
-rw-r--r--db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb24
-rw-r--r--db/post_migrate/20211130201100_track_deletions_in_namespaces.rb15
-rw-r--r--db/post_migrate/20211130201101_track_deletions_in_projects.rb15
-rw-r--r--db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb15
-rw-r--r--db/schema_migrations/202108261717581
-rw-r--r--db/schema_migrations/202108261939071
-rw-r--r--db/schema_migrations/202108300858371
-rw-r--r--db/schema_migrations/202108301048001
-rw-r--r--db/schema_migrations/202108301405241
-rw-r--r--db/schema_migrations/202108301543581
-rw-r--r--db/schema_migrations/202108311230081
-rw-r--r--db/schema_migrations/202108311348401
-rw-r--r--db/schema_migrations/202108311352491
-rw-r--r--db/schema_migrations/202108312034081
-rw-r--r--db/schema_migrations/202109010442021
-rw-r--r--db/schema_migrations/202109010442371
-rw-r--r--db/schema_migrations/202109010655041
-rw-r--r--db/schema_migrations/202109011533241
-rw-r--r--db/schema_migrations/202109011845111
-rw-r--r--db/schema_migrations/202109021441441
-rw-r--r--db/schema_migrations/202109021714061
-rw-r--r--db/schema_migrations/202109021718081
-rw-r--r--db/schema_migrations/202109021843341
-rw-r--r--db/schema_migrations/202109030541581
-rw-r--r--db/schema_migrations/202109061000211
-rw-r--r--db/schema_migrations/202109061003161
-rw-r--r--db/schema_migrations/202109061306431
-rw-r--r--db/schema_migrations/202109070139441
-rw-r--r--db/schema_migrations/202109070219401
-rw-r--r--db/schema_migrations/202109070337451
-rw-r--r--db/schema_migrations/202109070410001
-rw-r--r--db/schema_migrations/202109071823371
-rw-r--r--db/schema_migrations/202109071823591
-rw-r--r--db/schema_migrations/202109072115571
-rw-r--r--db/schema_migrations/202109080609511
-rw-r--r--db/schema_migrations/202109080611321
-rw-r--r--db/schema_migrations/202109081008101
-rw-r--r--db/schema_migrations/202109081323351
-rw-r--r--db/schema_migrations/202109081404371
-rw-r--r--db/schema_migrations/202109081857361
-rw-r--r--db/schema_migrations/202109081857541
-rw-r--r--db/schema_migrations/202109081955061
-rw-r--r--db/schema_migrations/202109091048001
-rw-r--r--db/schema_migrations/202109091520271
-rw-r--r--db/schema_migrations/202109091843491
-rw-r--r--db/schema_migrations/202109100147411
-rw-r--r--db/schema_migrations/202109100150471
-rw-r--r--db/schema_migrations/202109101410431
-rw-r--r--db/schema_migrations/202109101929211
-rw-r--r--db/schema_migrations/202109101949521
-rw-r--r--db/schema_migrations/202109120349031
-rw-r--r--db/schema_migrations/202109130104111
-rw-r--r--db/schema_migrations/202109130104321
-rw-r--r--db/schema_migrations/202109131224571
-rw-r--r--db/schema_migrations/202109132245581
-rw-r--r--db/schema_migrations/202109140948401
-rw-r--r--db/schema_migrations/202109140953101
-rw-r--r--db/schema_migrations/202109141458101
-rw-r--r--db/schema_migrations/202109141722021
-rw-r--r--db/schema_migrations/202109150004531
-rw-r--r--db/schema_migrations/202109150012421
-rw-r--r--db/schema_migrations/202109150224151
-rw-r--r--db/schema_migrations/202109150704231
-rw-r--r--db/schema_migrations/202109152029001
-rw-r--r--db/schema_migrations/202109161325471
-rw-r--r--db/schema_migrations/202109171343211
-rw-r--r--db/schema_migrations/202109171536451
-rw-r--r--db/schema_migrations/202109171539051
-rw-r--r--db/schema_migrations/202109172244191
-rw-r--r--db/schema_migrations/202109182010501
-rw-r--r--db/schema_migrations/202109182028551
-rw-r--r--db/schema_migrations/202109201044461
-rw-r--r--db/schema_migrations/202109202320251
-rw-r--r--db/schema_migrations/202109210320081
-rw-r--r--db/schema_migrations/202109210628201
-rw-r--r--db/schema_migrations/202109210639241
-rw-r--r--db/schema_migrations/202109211910101
-rw-r--r--db/schema_migrations/202109220218161
-rw-r--r--db/schema_migrations/202109220256311
-rw-r--r--db/schema_migrations/202109220820191
-rw-r--r--db/schema_migrations/202109220841151
-rw-r--r--db/schema_migrations/202109220914021
-rw-r--r--db/schema_migrations/202109221720561
-rw-r--r--db/schema_migrations/202109221721561
-rw-r--r--db/schema_migrations/202109222157401
-rw-r--r--db/schema_migrations/202109222201041
-rw-r--r--db/schema_migrations/202109230423231
-rw-r--r--db/schema_migrations/202109230423241
-rw-r--r--db/schema_migrations/202109230423251
-rw-r--r--db/schema_migrations/202109231331431
-rw-r--r--db/schema_migrations/202109231359091
-rw-r--r--db/schema_migrations/202109231516411
-rw-r--r--db/schema_migrations/202109231926481
-rw-r--r--db/schema_migrations/202109231926491
-rw-r--r--db/schema_migrations/202109271538071
-rw-r--r--db/schema_migrations/202109281550221
-rw-r--r--db/schema_migrations/202109281711221
-rw-r--r--db/schema_migrations/202109290256001
-rw-r--r--db/schema_migrations/202109290308341
-rw-r--r--db/schema_migrations/202109290310491
-rw-r--r--db/schema_migrations/202109290325551
-rw-r--r--db/schema_migrations/202109291153401
-rw-r--r--db/schema_migrations/202109291215161
-rw-r--r--db/schema_migrations/202109291444531
-rw-r--r--db/schema_migrations/202109300812081
-rw-r--r--db/schema_migrations/202109302119361
-rw-r--r--db/schema_migrations/202110010012221
-rw-r--r--db/schema_migrations/202110040629421
-rw-r--r--db/schema_migrations/202110040756291
-rw-r--r--db/schema_migrations/202110040819111
-rw-r--r--db/schema_migrations/202110041105001
-rw-r--r--db/schema_migrations/202110041109271
-rw-r--r--db/schema_migrations/202110041225401
-rw-r--r--db/schema_migrations/202110041512021
-rw-r--r--db/schema_migrations/202110050101011
-rw-r--r--db/schema_migrations/202110050635191
-rw-r--r--db/schema_migrations/202110050636161
-rw-r--r--db/schema_migrations/202110050637231
-rw-r--r--db/schema_migrations/202110050830151
-rw-r--r--db/schema_migrations/202110050924281
-rw-r--r--db/schema_migrations/202110050935581
-rw-r--r--db/schema_migrations/202110051001121
-rw-r--r--db/schema_migrations/202110051124041
-rw-r--r--db/schema_migrations/202110051126451
-rw-r--r--db/schema_migrations/202110051944251
-rw-r--r--db/schema_migrations/202110060602541
-rw-r--r--db/schema_migrations/202110060604361
-rw-r--r--db/schema_migrations/202110061031221
-rw-r--r--db/schema_migrations/202110061220101
-rw-r--r--db/schema_migrations/202110061450041
-rw-r--r--db/schema_migrations/202110061741141
-rw-r--r--db/schema_migrations/202110070902291
-rw-r--r--db/schema_migrations/202110070933401
-rw-r--r--db/schema_migrations/202110071131361
-rw-r--r--db/schema_migrations/202110071552211
-rw-r--r--db/schema_migrations/202110080438551
-rw-r--r--db/schema_migrations/202110081814511
-rw-r--r--db/schema_migrations/202110081829541
-rw-r--r--db/schema_migrations/202110081931371
-rw-r--r--db/schema_migrations/202110110042421
-rw-r--r--db/schema_migrations/202110111048431
-rw-r--r--db/schema_migrations/202110111409301
-rw-r--r--db/schema_migrations/202110111409311
-rw-r--r--db/schema_migrations/202110111409321
-rw-r--r--db/schema_migrations/202110111412391
-rw-r--r--db/schema_migrations/202110111412421
-rw-r--r--db/schema_migrations/202110111412431
-rw-r--r--db/schema_migrations/202110111527011
-rw-r--r--db/schema_migrations/202110120159031
-rw-r--r--db/schema_migrations/202110120512211
-rw-r--r--db/schema_migrations/202110120918221
-rw-r--r--db/schema_migrations/202110121343161
-rw-r--r--db/schema_migrations/202110121438151
-rw-r--r--db/schema_migrations/202110121559311
-rw-r--r--db/schema_migrations/202110130142281
-rw-r--r--db/schema_migrations/202110130807141
-rw-r--r--db/schema_migrations/202110130807151
-rw-r--r--db/schema_migrations/202110130807161
-rw-r--r--db/schema_migrations/202110131253411
-rw-r--r--db/schema_migrations/202110131927491
-rw-r--r--db/schema_migrations/202110150211141
-rw-r--r--db/schema_migrations/202110150241351
-rw-r--r--db/schema_migrations/202110181010341
-rw-r--r--db/schema_migrations/202110181015521
-rw-r--r--db/schema_migrations/202110181018521
-rw-r--r--db/schema_migrations/202110181022521
-rw-r--r--db/schema_migrations/202110181233161
-rw-r--r--db/schema_migrations/202110181526541
-rw-r--r--db/schema_migrations/202110181614471
-rw-r--r--db/schema_migrations/202110191536151
-rw-r--r--db/schema_migrations/202110200309481
-rw-r--r--db/schema_migrations/202110200953571
-rw-r--r--db/schema_migrations/202110211154091
-rw-r--r--db/schema_migrations/202110211247151
-rw-r--r--db/schema_migrations/202110211259081
-rw-r--r--db/schema_migrations/202110211312171
-rw-r--r--db/schema_migrations/202110211344581
-rw-r--r--db/schema_migrations/202110211404261
-rw-r--r--db/schema_migrations/202110211419301
-rw-r--r--db/schema_migrations/202110221122021
-rw-r--r--db/schema_migrations/202110221130001
-rw-r--r--db/schema_migrations/202110221601541
-rw-r--r--db/schema_migrations/202110222145231
-rw-r--r--db/schema_migrations/202110231022431
-rw-r--r--db/schema_migrations/202110251037441
-rw-r--r--db/schema_migrations/202110251037581
-rw-r--r--db/schema_migrations/202110260704081
-rw-r--r--db/schema_migrations/202110261243361
-rw-r--r--db/schema_migrations/202110261432381
-rw-r--r--db/schema_migrations/202110270432061
-rw-r--r--db/schema_migrations/202110270432291
-rw-r--r--db/schema_migrations/202110270640211
-rw-r--r--db/schema_migrations/202110270641561
-rw-r--r--db/schema_migrations/202110271129011
-rw-r--r--db/schema_migrations/202110272039501
-rw-r--r--db/schema_migrations/202110272040111
-rw-r--r--db/schema_migrations/202110280859261
-rw-r--r--db/schema_migrations/202110281003031
-rw-r--r--db/schema_migrations/202110281008431
-rw-r--r--db/schema_migrations/202110281234121
-rw-r--r--db/schema_migrations/202110281322471
-rw-r--r--db/schema_migrations/202110281554491
-rw-r--r--db/schema_migrations/202110282122591
-rw-r--r--db/schema_migrations/202110291028221
-rw-r--r--db/schema_migrations/202110311524171
-rw-r--r--db/schema_migrations/202110311549191
-rw-r--r--db/schema_migrations/202111011323101
-rw-r--r--db/schema_migrations/202111011656561
-rw-r--r--db/schema_migrations/202111012226141
-rw-r--r--db/schema_migrations/202111021031271
-rw-r--r--db/schema_migrations/202111021148021
-rw-r--r--db/schema_migrations/202111030627281
-rw-r--r--db/schema_migrations/202111031414031
-rw-r--r--db/schema_migrations/202111031620251
-rw-r--r--db/schema_migrations/202111031843031
-rw-r--r--db/schema_migrations/202111040122091
-rw-r--r--db/schema_migrations/202111040444531
-rw-r--r--db/schema_migrations/202111041652201
-rw-r--r--db/schema_migrations/202111050101011
-rw-r--r--db/schema_migrations/202111051257561
-rw-r--r--db/schema_migrations/202111051258131
-rw-r--r--db/schema_migrations/202111051351571
-rw-r--r--db/schema_migrations/202111051603161
-rw-r--r--db/schema_migrations/202111051614041
-rw-r--r--db/schema_migrations/202111081545101
-rw-r--r--db/schema_migrations/202111081548411
-rw-r--r--db/schema_migrations/202111082032481
-rw-r--r--db/schema_migrations/202111082047361
-rw-r--r--db/schema_migrations/202111082114341
-rw-r--r--db/schema_migrations/202111091000501
-rw-r--r--db/schema_migrations/202111091010101
-rw-r--r--db/schema_migrations/202111091124541
-rw-r--r--db/schema_migrations/202111100101011
-rw-r--r--db/schema_migrations/202111100147011
-rw-r--r--db/schema_migrations/202111100152521
-rw-r--r--db/schema_migrations/202111100927101
-rw-r--r--db/schema_migrations/202111101000501
-rw-r--r--db/schema_migrations/202111101433061
-rw-r--r--db/schema_migrations/202111101513201
-rw-r--r--db/schema_migrations/202111101513501
-rw-r--r--db/schema_migrations/202111111124251
-rw-r--r--db/schema_migrations/202111111126391
-rw-r--r--db/schema_migrations/202111111127131
-rw-r--r--db/schema_migrations/202111111640251
-rw-r--r--db/schema_migrations/202111111640471
-rw-r--r--db/schema_migrations/202111120734131
-rw-r--r--db/schema_migrations/202111121133001
-rw-r--r--db/schema_migrations/202111121554161
-rw-r--r--db/schema_migrations/202111151326131
-rw-r--r--db/schema_migrations/202111151428031
-rw-r--r--db/schema_migrations/202111151428471
-rw-r--r--db/schema_migrations/202111151429111
-rw-r--r--db/schema_migrations/202111151451071
-rw-r--r--db/schema_migrations/202111151517041
-rw-r--r--db/schema_migrations/202111151541031
-rw-r--r--db/schema_migrations/202111160917511
-rw-r--r--db/schema_migrations/202111160937391
-rw-r--r--db/schema_migrations/202111161116441
-rw-r--r--db/schema_migrations/202111170848141
-rw-r--r--db/schema_migrations/202111171742091
-rw-r--r--db/schema_migrations/202111181009591
-rw-r--r--db/schema_migrations/202111181034391
-rw-r--r--db/schema_migrations/202111181142281
-rw-r--r--db/schema_migrations/202111181245371
-rw-r--r--db/schema_migrations/202111181246281
-rw-r--r--db/schema_migrations/202111181246501
-rw-r--r--db/schema_migrations/202111181308361
-rw-r--r--db/schema_migrations/202111181942391
-rw-r--r--db/schema_migrations/202111190850151
-rw-r--r--db/schema_migrations/202111190850361
-rw-r--r--db/schema_migrations/202111191110061
-rw-r--r--db/schema_migrations/202111191542211
-rw-r--r--db/schema_migrations/202111191708051
-rw-r--r--db/schema_migrations/202111191940241
-rw-r--r--db/schema_migrations/202111191952011
-rw-r--r--db/schema_migrations/202111220335011
-rw-r--r--db/schema_migrations/202111221030511
-rw-r--r--db/schema_migrations/202111221939481
-rw-r--r--db/schema_migrations/202111222150011
-rw-r--r--db/schema_migrations/202111231352551
-rw-r--r--db/schema_migrations/202111231619061
-rw-r--r--db/schema_migrations/202111231812361
-rw-r--r--db/schema_migrations/202111231826141
-rw-r--r--db/schema_migrations/202111240957041
-rw-r--r--db/schema_migrations/202111241323191
-rw-r--r--db/schema_migrations/202111241327051
-rw-r--r--db/schema_migrations/202111251204441
-rw-r--r--db/schema_migrations/202111260422351
-rw-r--r--db/schema_migrations/202111261130291
-rw-r--r--db/schema_migrations/202111261154491
-rw-r--r--db/schema_migrations/202111261422001
-rw-r--r--db/schema_migrations/202111261423541
-rw-r--r--db/schema_migrations/202111262044451
-rw-r--r--db/schema_migrations/202111291511551
-rw-r--r--db/schema_migrations/202111291518321
-rw-r--r--db/schema_migrations/202111301517241
-rw-r--r--db/schema_migrations/202111301650431
-rw-r--r--db/schema_migrations/202111302011001
-rw-r--r--db/schema_migrations/202111302011011
-rw-r--r--db/schema_migrations/202111302057191
-rw-r--r--db/schema_migrations/202112010617331
-rw-r--r--db/schema_migrations/202112011015411
-rw-r--r--db/schema_migrations/202112011430421
-rw-r--r--db/schema_migrations/202303160959481
-rw-r--r--db/structure.sql19
-rw-r--r--doc/development/pipelines/index.md39
-rw-r--r--doc/development/pipelines/internals.md4
-rw-r--r--doc/development/project_templates.md164
-rw-r--r--doc/development/sec/security_report_ingestion_overview.md7
-rw-r--r--doc/development/testing_guide/end_to_end/running_tests_that_require_special_setup.md2
-rw-r--r--doc/development/testing_guide/flaky_tests.md9
-rw-r--r--doc/integration/saml.md2
-rw-r--r--doc/user/application_security/sast/index.md16
-rw-r--r--doc/user/group/saml_sso/index.md62
-rw-r--r--doc/user/project/merge_requests/approvals/rules.md3
-rw-r--r--lib/api/helpers/members_helpers.rb3
-rw-r--r--lib/gitlab/analytics/cycle_analytics/aggregated/stage_query_helpers.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_traversal_ids_children.rb76
-rw-r--r--lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots.rb51
-rw-r--r--lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb40
-rw-r--r--lib/gitlab/background_migration/backfill_user_namespace.rb38
-rw-r--r--lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects.rb78
-rw-r--r--lib/gitlab/background_migration/delete_orphaned_deployments.rb32
-rw-r--r--lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images.rb41
-rw-r--r--lib/gitlab/background_migration/drop_invalid_remediations.rb14
-rw-r--r--lib/gitlab/background_migration/drop_invalid_security_findings.rb47
-rw-r--r--lib/gitlab/background_migration/drop_invalid_vulnerabilities.rb37
-rw-r--r--lib/gitlab/background_migration/extract_project_topics_into_separate_table.rb63
-rw-r--r--lib/gitlab/background_migration/fix_merge_request_diff_commit_users.rb21
-rw-r--r--lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb296
-rw-r--r--lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb21
-rw-r--r--lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb52
-rw-r--r--lib/gitlab/background_migration/populate_topics_total_projects_count_cache.rb29
-rw-r--r--lib/gitlab/background_migration/populate_uuids_for_security_findings.rb18
-rw-r--r--lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings.rb64
-rw-r--r--lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users.rb33
-rw-r--r--lib/gitlab/background_migration/update_timelogs_project_id.rb44
-rw-r--r--lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group.rb129
-rw-r--r--lib/gitlab/background_migration/update_vulnerability_occurrences_location.rb14
-rw-r--r--lib/gitlab/ci/reports/security/finding.rb4
-rw-r--r--lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml2
-rw-r--r--lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml2
-rw-r--r--lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml2
-rw-r--r--lib/gitlab/import/metrics.rb13
-rw-r--r--locale/gitlab.pot19
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb6
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb5
-rwxr-xr-xscripts/failed_tests.rb4
-rw-r--r--scripts/rspec_helpers.sh4
-rwxr-xr-xscripts/verify-tff-mapping8
-rw-r--r--spec/controllers/projects/project_members_controller_spec.rb8
-rw-r--r--spec/controllers/projects/work_items_controller_spec.rb156
-rw-r--r--spec/factories/ci/reports/security/findings.rb1
-rw-r--r--spec/factories/service_desk/custom_email_credential.rb11
-rw-r--r--spec/features/groups/settings/packages_and_registries_spec.rb3
-rw-r--r--spec/features/issues/issue_sidebar_spec.rb4
-rw-r--r--spec/features/projects/pipelines/pipeline_spec.rb11
-rw-r--r--spec/finders/access_requests_finder_spec.rb9
-rw-r--r--spec/finders/members_finder_spec.rb8
-rw-r--r--spec/fixtures/scripts/test_report.json2
-rw-r--r--spec/frontend/packages_and_registries/settings/group/components/packages_forwarding_settings_spec.js21
-rw-r--r--spec/lib/api/helpers/members_helpers_spec.rb18
-rw-r--r--spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb21
-rw-r--r--spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb21
-rw-r--r--spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/backfill_upvotes_count_on_issues_spec.rb46
-rw-r--r--spec/lib/gitlab/background_migration/backfill_user_namespace_spec.rb39
-rw-r--r--spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb85
-rw-r--r--spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb54
-rw-r--r--spec/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images_spec.rb142
-rw-r--r--spec/lib/gitlab/background_migration/drop_invalid_security_findings_spec.rb57
-rw-r--r--spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb126
-rw-r--r--spec/lib/gitlab/background_migration/extract_project_topics_into_separate_table_spec.rb46
-rw-r--r--spec/lib/gitlab/background_migration/fix_first_mentioned_in_commit_at_spec.rb166
-rw-r--r--spec/lib/gitlab/background_migration/fix_merge_request_diff_commit_users_spec.rb25
-rw-r--r--spec/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users_spec.rb413
-rw-r--r--spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb30
-rw-r--r--spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb98
-rw-r--r--spec/lib/gitlab/background_migration/populate_topics_total_projects_count_cache_spec.rb35
-rw-r--r--spec/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings_spec.rb171
-rw-r--r--spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users_spec.rb50
-rw-r--r--spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb52
-rw-r--r--spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb84
-rw-r--r--spec/lib/gitlab/import/metrics_spec.rb28
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml1
-rw-r--r--spec/mailers/notify_spec.rb47
-rw-r--r--spec/migrations/20210831203408_upsert_base_work_item_types_spec.rb69
-rw-r--r--spec/migrations/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs_spec.rb21
-rw-r--r--spec/migrations/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks_spec.rb21
-rw-r--r--spec/migrations/20210906130643_drop_temporary_columns_and_triggers_for_taggings_spec.rb23
-rw-r--r--spec/migrations/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata_spec.rb23
-rw-r--r--spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb18
-rw-r--r--spec/migrations/20210910194952_update_report_type_for_existing_approval_project_rules_spec.rb48
-rw-r--r--spec/migrations/20210914095310_cleanup_orphan_project_access_tokens_spec.rb47
-rw-r--r--spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb23
-rw-r--r--spec/migrations/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid_spec.rb47
-rw-r--r--spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb23
-rw-r--r--spec/migrations/20210922025631_drop_int4_column_for_ci_sources_pipelines_spec.rb21
-rw-r--r--spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb21
-rw-r--r--spec/migrations/20210922091402_drop_int4_column_for_push_event_payloads_spec.rb21
-rw-r--r--spec/migrations/20211006060436_schedule_populate_topics_total_projects_count_cache_spec.rb29
-rw-r--r--spec/migrations/20211012134316_clean_up_migrate_merge_request_diff_commit_users_spec.rb48
-rw-r--r--spec/migrations/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3_spec.rb166
-rw-r--r--spec/migrations/20211028155449_schedule_fix_merge_request_diff_commit_users_migration_spec.rb63
-rw-r--r--spec/migrations/20211101222614_consume_remaining_user_namespace_jobs_spec.rb21
-rw-r--r--spec/migrations/20211110143306_add_not_null_constraint_to_security_findings_uuid_spec.rb23
-rw-r--r--spec/migrations/20211110151350_schedule_drop_invalid_security_findings_spec.rb72
-rw-r--r--spec/migrations/20211116091751_change_namespace_type_default_to_user_spec.rb5
-rw-r--r--spec/migrations/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb190
-rw-r--r--spec/migrations/20211117084814_migrate_remaining_u2f_registrations_spec.rb43
-rw-r--r--spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb78
-rw-r--r--spec/migrations/20211126204445_add_task_to_work_item_types_spec.rb54
-rw-r--r--spec/migrations/20211130165043_backfill_sequence_column_for_sprints_table_spec.rb42
-rw-r--r--spec/migrations/add_open_source_plan_spec.rb86
-rw-r--r--spec/migrations/backfill_user_namespace_spec.rb29
-rw-r--r--spec/migrations/disable_job_token_scope_when_unused_spec.rb10
-rw-r--r--spec/migrations/finalize_traversal_ids_background_migrations_spec.rb60
-rw-r--r--spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb28
-rw-r--r--spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb37
-rw-r--r--spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb92
-rw-r--r--spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb70
-rw-r--r--spec/models/service_desk/custom_email_credential_spec.rb67
-rw-r--r--spec/models/service_desk_setting_spec.rb52
-rw-r--r--spec/requests/projects/work_items_spec.rb176
-rw-r--r--spec/scripts/failed_tests_spec.rb6
-rw-r--r--spec/services/work_items/prepare_import_csv_service_spec.rb52
-rw-r--r--spec/support/helpers/email_helpers.rb21
-rw-r--r--spec/support/helpers/migrations_helpers.rb2
-rw-r--r--spec/support_specs/helpers/migrations_helpers_spec.rb38
-rw-r--r--spec/workers/every_sidekiq_worker_spec.rb1
-rw-r--r--spec/workers/work_items/import_work_items_csv_worker_spec.rb44
-rw-r--r--workhorse/internal/upstream/routes.go3
-rw-r--r--workhorse/upload_test.go2
774 files changed, 6171 insertions, 12282 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e39fa9c4d76..b9442c00e59 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -130,7 +130,7 @@ workflow:
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline'
variables:
- PG_VERSION: "12"
+ PG_VERSION: "13"
DEFAULT_CI_IMAGE: "${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}.patched-golang-${GO_VERSION}-rust-${RUST_VERSION}-node-16.14-postgresql-${PG_VERSION}:rubygems-${RUBYGEMS_VERSION}-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-yarn-1.22-graphicsmagick-1.3.36"
# We set $GITLAB_DEPENDENCY_PROXY to another variable (since it's set at the group level and has higher precedence than .gitlab-ci.yml)
# so that we can override $GITLAB_DEPENDENCY_PROXY_ADDRESS in workflow rules.
diff --git a/.gitlab/ci/ci-templates.gitlab-ci.yml b/.gitlab/ci/ci-templates.gitlab-ci.yml
index d6e2fdf2fbe..c6681db9685 100644
--- a/.gitlab/ci/ci-templates.gitlab-ci.yml
+++ b/.gitlab/ci/ci-templates.gitlab-ci.yml
@@ -4,7 +4,7 @@ templates-shellcheck:
- .default-before_script
- .default-retry
- .ruby-cache
- - .use-pg13
+ - .use-pg14
stage: test
needs:
- setup-test-env
diff --git a/.gitlab/ci/dev-fixtures.gitlab-ci.yml b/.gitlab/ci/dev-fixtures.gitlab-ci.yml
index 0ff469d7114..f89456a18fb 100644
--- a/.gitlab/ci/dev-fixtures.gitlab-ci.yml
+++ b/.gitlab/ci/dev-fixtures.gitlab-ci.yml
@@ -3,7 +3,7 @@
- .default-retry
- .rails-cache
- .default-before_script
- - .use-pg12
+ - .use-pg13
stage: test
needs: ["setup-test-env"]
variables:
@@ -29,7 +29,7 @@ run-dev-fixtures-ee:
extends:
- .run-dev-fixtures
- .dev-fixtures:rules:ee-only
- - .use-pg12-es7-ee
+ - .use-pg13-es7-ee
script:
- cp ee/db/fixtures/development/* $FIXTURE_PATH
- *run-dev-fixtures-script
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index 88dbd1649b0..76fae2f00cd 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -122,7 +122,7 @@ retrieve-frontend-fixtures:
- .default-retry
- .default-before_script
- .rails-cache
- - .use-pg12
+ - .use-pg13
stage: fixtures
needs: ["setup-test-env", "retrieve-tests-metadata"]
variables:
diff --git a/.gitlab/ci/glfm.gitlab-ci.yml b/.gitlab/ci/glfm.gitlab-ci.yml
index 6ff60f24730..008bb03de25 100644
--- a/.gitlab/ci/glfm.gitlab-ci.yml
+++ b/.gitlab/ci/glfm.gitlab-ci.yml
@@ -2,7 +2,7 @@ glfm-verify:
extends:
- .rails-job-base
- .glfm:rules:glfm-verify
- - .use-pg12
+ - .use-pg13
stage: test
needs: ["setup-test-env"]
script:
diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml
index 24dfec40f6b..87daccf2c8a 100644
--- a/.gitlab/ci/global.gitlab-ci.yml
+++ b/.gitlab/ci/global.gitlab-ci.yml
@@ -231,7 +231,6 @@
- *node-modules-cache # We don't push this cache as it's already rebuilt by `update-assets-compile-*-cache`
- *storybook-node-modules-cache-push
-
.use-pg12:
services:
- name: postgres:12
@@ -250,6 +249,15 @@
POSTGRES_HOST_AUTH_METHOD: trust
PG_VERSION: "13"
+.use-pg14:
+ services:
+ - name: postgres:14
+ command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+ - name: redis:6.2-alpine
+ variables:
+ POSTGRES_HOST_AUTH_METHOD: trust
+ PG_VERSION: "14"
+
.use-pg12-es7-ee:
services:
- name: postgres:12
@@ -280,9 +288,24 @@
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
-.use-pg12-es8-ee:
+.use-pg14-es7-ee:
services:
- - name: postgres:12
+ - name: postgres:14
+ command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+ - name: redis:6.2-alpine
+ - name: elasticsearch:7.17.6
+ command: ["elasticsearch", "-E", "discovery.type=single-node", "-E", "xpack.security.enabled=false"]
+ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
+ alias: zoekt-ci-image
+ variables:
+ POSTGRES_HOST_AUTH_METHOD: trust
+ PG_VERSION: "14"
+ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
+ ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
+
+.use-pg13-es8-ee:
+ services:
+ - name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
- name: elasticsearch:8.6.2
@@ -290,15 +313,31 @@
alias: zoekt-ci-image
variables:
POSTGRES_HOST_AUTH_METHOD: trust
- PG_VERSION: "12"
+ PG_VERSION: "13"
ES_SETTING_DISCOVERY_TYPE: "single-node"
ES_SETTING_XPACK_SECURITY_ENABLED: "false"
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
-.use-pg12-opensearch1-ee:
+.use-pg14-es8-ee:
services:
- - name: postgres:12
+ - name: postgres:14
+ command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+ - name: redis:6.0-alpine
+ - name: elasticsearch:8.6.2
+ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
+ alias: zoekt-ci-image
+ variables:
+ POSTGRES_HOST_AUTH_METHOD: trust
+ PG_VERSION: "14"
+ ES_SETTING_DISCOVERY_TYPE: "single-node"
+ ES_SETTING_XPACK_SECURITY_ENABLED: "false"
+ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
+ ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
+
+.use-pg13-opensearch1-ee:
+ services:
+ - name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
- name: opensearchproject/opensearch:1.3.5
@@ -308,13 +347,13 @@
alias: zoekt-ci-image
variables:
POSTGRES_HOST_AUTH_METHOD: trust
- PG_VERSION: "12"
+ PG_VERSION: "13"
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
-.use-pg12-opensearch2-ee:
+.use-pg13-opensearch2-ee:
services:
- - name: postgres:12
+ - name: postgres:13
command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
- name: redis:6.0-alpine
- name: opensearchproject/opensearch:2.2.1
@@ -324,7 +363,39 @@
alias: zoekt-ci-image
variables:
POSTGRES_HOST_AUTH_METHOD: trust
- PG_VERSION: "12"
+ PG_VERSION: "13"
+ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
+ ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
+
+.use-pg14-opensearch1-ee:
+ services:
+ - name: postgres:14
+ command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+ - name: redis:6.0-alpine
+ - name: opensearchproject/opensearch:1.3.5
+ alias: elasticsearch
+ command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"]
+ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
+ alias: zoekt-ci-image
+ variables:
+ POSTGRES_HOST_AUTH_METHOD: trust
+ PG_VERSION: "14"
+ ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
+ ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
+
+.use-pg14-opensearch2-ee:
+ services:
+ - name: postgres:14
+ command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
+ - name: redis:6.0-alpine
+ - name: opensearchproject/opensearch:2.2.1
+ alias: elasticsearch
+ command: ["bin/opensearch", "-E", "discovery.type=single-node", "-E", "plugins.security.disabled=true"]
+ - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.0
+ alias: zoekt-ci-image
+ variables:
+ POSTGRES_HOST_AUTH_METHOD: trust
+ PG_VERSION: "14"
ZOEKT_INDEX_BASE_URL: http://zoekt-ci-image:6060
ZOEKT_SEARCH_BASE_URL: http://zoekt-ci-image:6070
diff --git a/.gitlab/ci/memory.gitlab-ci.yml b/.gitlab/ci/memory.gitlab-ci.yml
index 5d6b90d107d..afef2b11ee7 100644
--- a/.gitlab/ci/memory.gitlab-ci.yml
+++ b/.gitlab/ci/memory.gitlab-ci.yml
@@ -20,7 +20,7 @@ memory-on-boot:
extends:
- .only-code-memory-job-base
- .production
- - .use-pg12
+ - .use-pg13
stage: test
needs: ["setup-test-env", "compile-test-assets"]
variables:
diff --git a/.gitlab/ci/preflight.gitlab-ci.yml b/.gitlab/ci/preflight.gitlab-ci.yml
index 8c1cb44807a..526492a75c7 100644
--- a/.gitlab/ci/preflight.gitlab-ci.yml
+++ b/.gitlab/ci/preflight.gitlab-ci.yml
@@ -23,7 +23,7 @@ rails-production-server-boot:
- .production
- .ruby-cache
- .setup:rules:rails-production-server-boot
- - .use-pg12
+ - .use-pg13
variables:
BUNDLE_WITHOUT: "development:test"
BUNDLE_WITH: "production"
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index 0049917ce81..393f7c2f6a7 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -67,163 +67,173 @@ update-gitaly-binaries-cache:
- export BUNDLE_WITHOUT="${BUNDLE_WITHOUT}:default:test:puma:kerberos:metrics:omnibus:ed25519"
- bundle_install_script
-rspec migration pg12:
+rspec migration pg13:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg13
- .rspec-base-migration
- .rails:rules:ee-and-foss-migration
- .rspec-migration-parallel
-rspec migration pg12 predictive:
+rspec migration pg13 predictive:
extends:
- - rspec migration pg12
+ - rspec migration pg13
- .predictive-rspec-tests
- .rails:rules:ee-and-foss-migration:predictive
-rspec background_migration pg12:
+rspec background_migration pg13:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg13
- .rspec-base-migration
- .rails:rules:ee-and-foss-background-migration
- .rspec-background-migration-parallel
-rspec background_migration pg12 predictive:
+rspec background_migration pg13 predictive:
extends:
- - rspec background_migration pg12
+ - rspec background_migration pg13
- .predictive-rspec-tests
- .rails:rules:ee-and-foss-background-migration:predictive
-rspec migration pg12 single-db:
+rspec migration pg13 single-db:
extends:
- - rspec migration pg12
+ - rspec migration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec background_migration pg12 single-db:
+rspec background_migration pg13 single-db:
extends:
- - rspec background_migration pg12
+ - rspec background_migration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec migration pg12 single-db-ci-connection:
+rspec migration pg13 single-db-ci-connection:
extends:
- - rspec migration pg12
+ - rspec migration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec background_migration pg12 single-db-ci-connection:
+rspec background_migration pg13 single-db-ci-connection:
extends:
- - rspec background_migration pg12
+ - rspec background_migration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec migration pg12 praefect:
+rspec migration pg13 praefect:
extends:
- - rspec migration pg12
+ - rspec migration pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec background_migration pg12 praefect:
+rspec background_migration pg13 praefect:
extends:
- - rspec background_migration pg12
+ - rspec background_migration pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec unit pg12:
+rspec unit pg13:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg13
- .rails:rules:ee-and-foss-unit
- .rspec-unit-parallel
-rspec unit pg12 predictive:
+rspec unit pg13 predictive:
extends:
- - rspec unit pg12
+ - rspec unit pg13
- .predictive-rspec-tests
- .rails:rules:ee-and-foss-unit:predictive
-rspec unit pg12 single-db:
+rspec unit pg13 single-db:
extends:
- - rspec unit pg12
+ - rspec unit pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec unit pg12 single-db-ci-connection:
+rspec unit pg13 single-db-ci-connection:
extends:
- - rspec unit pg12
+ - rspec unit pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec unit pg12 praefect:
+rspec unit pg13 praefect:
extends:
- - rspec unit pg12
+ - rspec unit pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec integration pg12:
+rspec integration pg13:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg13
- .rails:rules:ee-and-foss-integration
- .rspec-integration-parallel
-rspec integration pg12 predictive:
+rspec integration pg13 predictive:
extends:
- - rspec integration pg12
+ - rspec integration pg13
- .predictive-rspec-tests
- .rails:rules:ee-and-foss-integration:predictive
-rspec integration pg12 single-db:
+rspec integration pg13 single-db:
extends:
- - rspec integration pg12
+ - rspec integration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec integration pg12 single-db-ci-connection:
+rspec integration pg13 single-db-ci-connection:
extends:
- - rspec integration pg12
+ - rspec integration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec integration pg12 praefect:
+rspec integration pg13 praefect:
extends:
- - rspec integration pg12
+ - rspec integration pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec system pg12:
+rspec system pg13:
extends:
- - .rspec-base-pg12
+ - .rspec-base-pg13
- .rails:rules:ee-and-foss-system
- .rspec-system-parallel
variables:
DEBUG_GITLAB_TRANSACTION_STACK: "true"
-rspec system pg12 predictive:
+rspec system pg13 predictive:
extends:
- - rspec system pg12
+ - rspec system pg13
- .predictive-rspec-tests
- .rails:rules:ee-and-foss-system:predictive
-rspec system pg12 single-db:
+rspec system pg13 single-db:
extends:
- - rspec system pg12
+ - rspec system pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec system pg12 single-db-ci-connection:
+rspec system pg13 single-db-ci-connection:
extends:
- - rspec system pg12
+ - rspec system pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec system pg12 praefect:
+rspec system pg13 praefect:
extends:
- - rspec system pg12
+ - rspec system pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec fast_spec_helper:
+# Dedicated job to test DB library code against PG12.
+# Note that these are already tested against PG12 in the `rspec unit pg12` / `rspec-ee unit pg12` jobs.
+rspec db-library-code pg12:
extends:
- .rspec-base-pg12
+ - .rails:rules:ee-and-foss-db-library-code
+ script:
+ - !reference [.base-script, script]
+ - rspec_db_library_code
+
+rspec fast_spec_helper:
+ extends:
+ - .rspec-base-pg13
- .rails:rules:ee-and-foss-fast_spec_helper
script:
- fast_spec_helper_specs=$(git grep -l -E '^require.*fast_spec_helper')
@@ -258,16 +268,16 @@ rspec:deprecations:
# We cannot use needs since it would mean needing 84 jobs (since most are parallelized)
# so we use `dependencies` here.
dependencies:
- - rspec migration pg12
- - rspec background_migration pg12
- - rspec unit pg12
- - rspec integration pg12
- - rspec system pg12
- - rspec-ee migration pg12
- - rspec-ee background_migration pg12
- - rspec-ee unit pg12
- - rspec-ee integration pg12
- - rspec-ee system pg12
+ - rspec migration pg13
+ - rspec background_migration pg13
+ - rspec unit pg13
+ - rspec integration pg13
+ - rspec system pg13
+ - rspec-ee migration pg13
+ - rspec-ee background_migration pg13
+ - rspec-ee unit pg13
+ - rspec-ee integration pg13
+ - rspec-ee system pg13
variables:
SETUP_DB: "false"
script:
@@ -290,76 +300,76 @@ rspec:coverage:
dependencies:
- setup-test-env
# FOSS/EE jobs
- - rspec migration pg12
- - rspec background_migration pg12
- - rspec unit pg12
- - rspec integration pg12
- - rspec system pg12
+ - rspec migration pg13
+ - rspec background_migration pg13
+ - rspec unit pg13
+ - rspec integration pg13
+ - rspec system pg13
# FOSS/EE predictive jobs
- - rspec migration pg12 predictive
- - rspec background_migration pg12 predictive
- - rspec unit pg12 predictive
- - rspec integration pg12 predictive
- - rspec system pg12 predictive
+ - rspec migration pg13 predictive
+ - rspec background_migration pg13 predictive
+ - rspec unit pg13 predictive
+ - rspec integration pg13 predictive
+ - rspec system pg13 predictive
# FOSS/EE single-db jobs
- - rspec migration pg12 single-db
- - rspec background_migration pg12 single-db
- - rspec unit pg12 single-db
- - rspec integration pg12 single-db
- - rspec system pg12 single-db
+ - rspec migration pg13 single-db
+ - rspec background_migration pg13 single-db
+ - rspec unit pg13 single-db
+ - rspec integration pg13 single-db
+ - rspec system pg13 single-db
# FOSS/EE single-db-ci-connection jobs
- - rspec migration pg12 single-db-ci-connection
- - rspec background_migration pg12 single-db-ci-connection
- - rspec unit pg12 single-db-ci-connection
- - rspec integration pg12 single-db-ci-connection
- - rspec system pg12 single-db-ci-connection
+ - rspec migration pg13 single-db-ci-connection
+ - rspec background_migration pg13 single-db-ci-connection
+ - rspec unit pg13 single-db-ci-connection
+ - rspec integration pg13 single-db-ci-connection
+ - rspec system pg13 single-db-ci-connection
# EE jobs
- - rspec-ee migration pg12
- - rspec-ee background_migration pg12
- - rspec-ee unit pg12
- - rspec-ee integration pg12
- - rspec-ee system pg12
+ - rspec-ee migration pg13
+ - rspec-ee background_migration pg13
+ - rspec-ee unit pg13
+ - rspec-ee integration pg13
+ - rspec-ee system pg13
# EE predictive jobs
- - rspec-ee migration pg12 predictive
- - rspec-ee background_migration pg12 predictive
- - rspec-ee unit pg12 predictive
- - rspec-ee integration pg12 predictive
- - rspec-ee system pg12 predictive
+ - rspec-ee migration pg13 predictive
+ - rspec-ee background_migration pg13 predictive
+ - rspec-ee unit pg13 predictive
+ - rspec-ee integration pg13 predictive
+ - rspec-ee system pg13 predictive
# EE single-db jobs
- - rspec-ee migration pg12 single-db
- - rspec-ee background_migration pg12 single-db
- - rspec-ee unit pg12 single-db
- - rspec-ee integration pg12 single-db
- - rspec-ee system pg12 single-db
+ - rspec-ee migration pg13 single-db
+ - rspec-ee background_migration pg13 single-db
+ - rspec-ee unit pg13 single-db
+ - rspec-ee integration pg13 single-db
+ - rspec-ee system pg13 single-db
# EE single-db-ci-connection jobs
- - rspec-ee migration pg12 single-db-ci-connection
- - rspec-ee background_migration pg12 single-db-ci-connection
- - rspec-ee unit pg12 single-db-ci-connection
- - rspec-ee integration pg12 single-db-ci-connection
- - rspec-ee system pg12 single-db-ci-connection
+ - rspec-ee migration pg13 single-db-ci-connection
+ - rspec-ee background_migration pg13 single-db-ci-connection
+ - rspec-ee unit pg13 single-db-ci-connection
+ - rspec-ee integration pg13 single-db-ci-connection
+ - rspec-ee system pg13 single-db-ci-connection
# Memory jobs
- memory-on-boot
# As-if-FOSS jobs
- - rspec migration pg12-as-if-foss
- - rspec migration pg12-as-if-foss predictive
- - rspec migration pg12-as-if-foss single-db
- - rspec migration pg12-as-if-foss single-db-ci-connection
- - rspec background_migration pg12-as-if-foss
- - rspec background_migration pg12-as-if-foss predictive
- - rspec background_migration pg12-as-if-foss single-db
- - rspec background_migration pg12-as-if-foss single-db-ci-connection
- - rspec unit pg12-as-if-foss
- - rspec unit pg12-as-if-foss predictive
- - rspec unit pg12-as-if-foss single-db
- - rspec unit pg12-as-if-foss single-db-ci-connection
- - rspec integration pg12-as-if-foss
- - rspec integration pg12-as-if-foss predictive
- - rspec integration pg12-as-if-foss single-db
- - rspec integration pg12-as-if-foss single-db-ci-connection
- - rspec system pg12-as-if-foss
- - rspec system pg12-as-if-foss predictive
- - rspec system pg12-as-if-foss single-db
- - rspec system pg12-as-if-foss single-db-ci-connection
+ - rspec migration pg13-as-if-foss
+ - rspec migration pg13-as-if-foss predictive
+ - rspec migration pg13-as-if-foss single-db
+ - rspec migration pg13-as-if-foss single-db-ci-connection
+ - rspec background_migration pg13-as-if-foss
+ - rspec background_migration pg13-as-if-foss predictive
+ - rspec background_migration pg13-as-if-foss single-db
+ - rspec background_migration pg13-as-if-foss single-db-ci-connection
+ - rspec unit pg13-as-if-foss
+ - rspec unit pg13-as-if-foss predictive
+ - rspec unit pg13-as-if-foss single-db
+ - rspec unit pg13-as-if-foss single-db-ci-connection
+ - rspec integration pg13-as-if-foss
+ - rspec integration pg13-as-if-foss predictive
+ - rspec integration pg13-as-if-foss single-db
+ - rspec integration pg13-as-if-foss single-db-ci-connection
+ - rspec system pg13-as-if-foss
+ - rspec system pg13-as-if-foss predictive
+ - rspec system pg13-as-if-foss single-db
+ - rspec system pg13-as-if-foss single-db-ci-connection
script:
- run_timed_command "bundle exec scripts/merge-simplecov"
coverage: '/LOC \((\d+\.\d+%)\) covered.$/'
@@ -437,274 +447,274 @@ rspec:flaky-tests-report:
##################################################
# EE: default refs (MRs, default branch, schedules) jobs #
-rspec migration pg12-as-if-foss:
+rspec migration pg13-as-if-foss:
extends:
- - .rspec-base-pg12-as-if-foss
+ - .rspec-base-pg13-as-if-foss
- .rspec-base-migration
- .rails:rules:as-if-foss-migration
- .rspec-migration-parallel
-rspec migration pg12-as-if-foss predictive:
+rspec migration pg13-as-if-foss predictive:
extends:
- - rspec migration pg12-as-if-foss
+ - rspec migration pg13-as-if-foss
- .predictive-rspec-tests
- .rails:rules:as-if-foss-migration:predictive
-rspec background_migration pg12-as-if-foss:
+rspec background_migration pg13-as-if-foss:
extends:
- - .rspec-base-pg12-as-if-foss
+ - .rspec-base-pg13-as-if-foss
- .rspec-base-migration
- .rails:rules:as-if-foss-background-migration
- .rspec-background-migration-parallel
-rspec background_migration pg12-as-if-foss predictive:
+rspec background_migration pg13-as-if-foss predictive:
extends:
- - rspec background_migration pg12-as-if-foss
+ - rspec background_migration pg13-as-if-foss
- .predictive-rspec-tests
- .rails:rules:as-if-foss-background-migration:predictive
-rspec migration pg12-as-if-foss single-db:
+rspec migration pg13-as-if-foss single-db:
extends:
- - rspec migration pg12-as-if-foss
+ - rspec migration pg13-as-if-foss
- .single-db-rspec
- .rails:rules:single-db
-rspec background_migration pg12-as-if-foss single-db:
+rspec background_migration pg13-as-if-foss single-db:
extends:
- - rspec background_migration pg12-as-if-foss
+ - rspec background_migration pg13-as-if-foss
- .single-db-rspec
- .rails:rules:single-db
-rspec migration pg12-as-if-foss single-db-ci-connection:
+rspec migration pg13-as-if-foss single-db-ci-connection:
extends:
- - rspec migration pg12-as-if-foss
+ - rspec migration pg13-as-if-foss
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec background_migration pg12-as-if-foss single-db-ci-connection:
+rspec background_migration pg13-as-if-foss single-db-ci-connection:
extends:
- - rspec background_migration pg12-as-if-foss
+ - rspec background_migration pg13-as-if-foss
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec unit pg12-as-if-foss:
+rspec unit pg13-as-if-foss:
extends:
- - .rspec-base-pg12-as-if-foss
+ - .rspec-base-pg13-as-if-foss
- .rails:rules:as-if-foss-unit
- .rspec-unit-parallel
-rspec unit pg12-as-if-foss predictive:
+rspec unit pg13-as-if-foss predictive:
extends:
- - rspec unit pg12-as-if-foss
+ - rspec unit pg13-as-if-foss
- .predictive-rspec-tests
- .rails:rules:as-if-foss-unit:predictive
-rspec unit pg12-as-if-foss single-db:
+rspec unit pg13-as-if-foss single-db:
extends:
- - rspec unit pg12-as-if-foss
+ - rspec unit pg13-as-if-foss
- .single-db-rspec
- .rails:rules:single-db
-rspec unit pg12-as-if-foss single-db-ci-connection:
+rspec unit pg13-as-if-foss single-db-ci-connection:
extends:
- - rspec unit pg12-as-if-foss
+ - rspec unit pg13-as-if-foss
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec integration pg12-as-if-foss:
+rspec integration pg13-as-if-foss:
extends:
- - .rspec-base-pg12-as-if-foss
+ - .rspec-base-pg13-as-if-foss
- .rails:rules:as-if-foss-integration
- .rspec-integration-parallel
-rspec integration pg12-as-if-foss predictive:
+rspec integration pg13-as-if-foss predictive:
extends:
- - rspec integration pg12-as-if-foss
+ - rspec integration pg13-as-if-foss
- .predictive-rspec-tests
- .rails:rules:as-if-foss-integration:predictive
-rspec integration pg12-as-if-foss single-db:
+rspec integration pg13-as-if-foss single-db:
extends:
- - rspec integration pg12-as-if-foss
+ - rspec integration pg13-as-if-foss
- .single-db-rspec
- .rails:rules:single-db
-rspec integration pg12-as-if-foss single-db-ci-connection:
+rspec integration pg13-as-if-foss single-db-ci-connection:
extends:
- - rspec integration pg12-as-if-foss
+ - rspec integration pg13-as-if-foss
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec system pg12-as-if-foss:
+rspec system pg13-as-if-foss:
extends:
- - .rspec-base-pg12-as-if-foss
+ - .rspec-base-pg13-as-if-foss
- .rails:rules:as-if-foss-system
- .rspec-system-parallel
-rspec system pg12-as-if-foss predictive:
+rspec system pg13-as-if-foss predictive:
extends:
- - rspec system pg12-as-if-foss
+ - rspec system pg13-as-if-foss
- .predictive-rspec-tests
- .rails:rules:as-if-foss-system:predictive
-rspec system pg12-as-if-foss single-db:
+rspec system pg13-as-if-foss single-db:
extends:
- - rspec system pg12-as-if-foss
+ - rspec system pg13-as-if-foss
- .single-db-rspec
- .rails:rules:single-db
-rspec system pg12-as-if-foss single-db-ci-connection:
+rspec system pg13-as-if-foss single-db-ci-connection:
extends:
- - rspec system pg12-as-if-foss
+ - rspec system pg13-as-if-foss
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec-ee migration pg12:
+rspec-ee migration pg13:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
- .rspec-base-migration
- .rails:rules:ee-only-migration
- .rspec-ee-migration-parallel
-rspec-ee migration pg12 predictive:
+rspec-ee migration pg13 predictive:
extends:
- - rspec-ee migration pg12
+ - rspec-ee migration pg13
- .predictive-rspec-tests
- .rails:rules:ee-only-migration:predictive
-rspec-ee background_migration pg12:
+rspec-ee background_migration pg13:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
- .rspec-base-migration
- .rails:rules:ee-only-background-migration
- .rspec-ee-background-migration-parallel
-rspec-ee background_migration pg12 predictive:
+rspec-ee background_migration pg13 predictive:
extends:
- - rspec-ee background_migration pg12
+ - rspec-ee background_migration pg13
- .predictive-rspec-tests
- .rails:rules:ee-only-background-migration:predictive
-rspec-ee migration pg12 single-db:
+rspec-ee migration pg13 single-db:
extends:
- - rspec-ee migration pg12
+ - rspec-ee migration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec-ee background_migration pg12 single-db:
+rspec-ee background_migration pg13 single-db:
extends:
- - rspec-ee background_migration pg12
+ - rspec-ee background_migration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec-ee migration pg12 single-db-ci-connection:
+rspec-ee migration pg13 single-db-ci-connection:
extends:
- - rspec-ee migration pg12
+ - rspec-ee migration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec-ee background_migration pg12 single-db-ci-connection:
+rspec-ee background_migration pg13 single-db-ci-connection:
extends:
- - rspec-ee background_migration pg12
+ - rspec-ee background_migration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec-ee migration pg12 praefect:
+rspec-ee migration pg13 praefect:
extends:
- - rspec migration pg12
+ - rspec migration pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec-ee background_migration pg12 praefect:
+rspec-ee background_migration pg13 praefect:
extends:
- - rspec background_migration pg12
+ - rspec background_migration pg13
- .praefect-with-db
- .rails:rules:praefect-with-db
-rspec-ee unit pg12:
+rspec-ee unit pg13:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
- .rails:rules:ee-only-unit
- .rspec-ee-unit-parallel
-rspec-ee unit pg12 es8:
+rspec-ee unit pg13 es8:
extends:
- - .rspec-ee-base-pg12-es8
+ - .rspec-ee-base-pg13-es8
- .rspec-ee-unit-parallel
-rspec-ee unit pg12 predictive:
+rspec-ee unit pg13 predictive:
extends:
- - rspec-ee unit pg12
+ - rspec-ee unit pg13
- .predictive-rspec-tests
- .rails:rules:ee-only-unit:predictive
-rspec-ee unit pg12 single-db:
+rspec-ee unit pg13 single-db:
extends:
- - rspec-ee unit pg12
+ - rspec-ee unit pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec-ee unit pg12 single-db-ci-connection:
+rspec-ee unit pg13 single-db-ci-connection:
extends:
- - rspec-ee unit pg12
+ - rspec-ee unit pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec-ee integration pg12:
+rspec-ee integration pg13:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
- .rails:rules:ee-only-integration
- .rspec-ee-integration-parallel
-rspec-ee integration pg12 es8:
+rspec-ee integration pg13 es8:
extends:
- - .rspec-ee-base-pg12-es8
+ - .rspec-ee-base-pg13-es8
- .rspec-ee-integration-parallel
-rspec-ee integration pg12 predictive:
+rspec-ee integration pg13 predictive:
extends:
- - rspec-ee integration pg12
+ - rspec-ee integration pg13
- .predictive-rspec-tests
- .rails:rules:ee-only-integration:predictive
-rspec-ee integration pg12 single-db:
+rspec-ee integration pg13 single-db:
extends:
- - rspec-ee integration pg12
+ - rspec-ee integration pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec-ee integration pg12 single-db-ci-connection:
+rspec-ee integration pg13 single-db-ci-connection:
extends:
- - rspec-ee integration pg12
+ - rspec-ee integration pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
-rspec-ee system pg12:
+rspec-ee system pg13:
extends:
- - .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
- .rails:rules:ee-only-system
- .rspec-ee-system-parallel
-rspec-ee system pg12 es8:
+rspec-ee system pg13 es8:
extends:
- - .rspec-ee-base-pg12-es8
+ - .rspec-ee-base-pg13-es8
- .rspec-ee-system-parallel
-rspec-ee system pg12 predictive:
+rspec-ee system pg13 predictive:
extends:
- - rspec-ee system pg12
+ - rspec-ee system pg13
- .predictive-rspec-tests
- .rails:rules:ee-only-system:predictive
-rspec-ee system pg12 single-db:
+rspec-ee system pg13 single-db:
extends:
- - rspec-ee system pg12
+ - rspec-ee system pg13
- .single-db-rspec
- .rails:rules:single-db
-rspec-ee system pg12 single-db-ci-connection:
+rspec-ee system pg13 single-db-ci-connection:
extends:
- - rspec-ee system pg12
+ - rspec-ee system pg13
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection
# EE: default refs (MRs, default branch, schedules) jobs #
@@ -713,36 +723,69 @@ rspec-ee system pg12 single-db-ci-connection:
##########################################
# EE/FOSS: default branch nightly scheduled jobs #
-# PG13
-rspec migration pg13:
+# PG12
+rspec migration pg12:
extends:
- - .rspec-base-pg13
+ - .rspec-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:rspec-on-pg12
+ - .rspec-migration-parallel
+
+rspec background_migration pg12:
+ extends:
+ - .rspec-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:rspec-on-pg12
+ - .rspec-background-migration-parallel
+
+rspec unit pg12:
+ extends:
+ - .rspec-base-pg12
+ - .rails:rules:rspec-on-pg12
+ - .rspec-unit-parallel
+
+rspec integration pg12:
+ extends:
+ - .rspec-base-pg12
+ - .rails:rules:rspec-on-pg12
+ - .rspec-integration-parallel
+
+rspec system pg12:
+ extends:
+ - .rspec-base-pg12
+ - .rails:rules:rspec-on-pg12
+ - .rspec-system-parallel
+
+# PG14
+rspec migration pg14:
+ extends:
+ - .rspec-base-pg14
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-migration-parallel
-rspec background_migration pg13:
+rspec background_migration pg14:
extends:
- - .rspec-base-pg13
+ - .rspec-base-pg14
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-background-migration-parallel
-rspec unit pg13:
+rspec unit pg14:
extends:
- - .rspec-base-pg13
+ - .rspec-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-unit-parallel
-rspec integration pg13:
+rspec integration pg14:
extends:
- - .rspec-base-pg13
+ - .rspec-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-integration-parallel
-rspec system pg13:
+rspec system pg14:
extends:
- - .rspec-base-pg13
+ - .rspec-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage
- .rspec-system-parallel
# EE/FOSS: default branch nightly scheduled jobs #
@@ -752,68 +795,152 @@ rspec system pg13:
# EE: default branch nightly scheduled jobs #
# PG12
-rspec-ee unit pg12 opensearch1:
+rspec-ee migration pg12:
+ extends:
+ - .rspec-ee-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-migration-parallel
+
+rspec-ee background_migration pg12:
+ extends:
+ - .rspec-ee-base-pg12
+ - .rspec-base-migration
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-background-migration-parallel
+
+rspec-ee unit pg12:
extends:
- - .rspec-ee-base-pg12-opensearch1
+ - .rspec-ee-base-pg12
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-parallel
-rspec-ee unit pg12 opensearch2:
+rspec-ee integration pg12:
extends:
- - .rspec-ee-base-pg12-opensearch2
+ - .rspec-ee-base-pg12
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-integration-parallel
+
+rspec-ee system pg12:
+ extends:
+ - .rspec-ee-base-pg12
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+ - .rspec-ee-system-parallel
+
+# PG13
+rspec-ee unit pg13 opensearch1:
+ extends:
+ - .rspec-ee-base-pg13-opensearch1
+ - .rspec-ee-unit-parallel
+
+rspec-ee unit pg13 opensearch2:
+ extends:
+ - .rspec-ee-base-pg13-opensearch2
- .rspec-ee-unit-parallel
-rspec-ee integration pg12 opensearch1:
+rspec-ee integration pg13 opensearch1:
extends:
- - .rspec-ee-base-pg12-opensearch1
+ - .rspec-ee-base-pg13-opensearch1
- .rspec-ee-integration-parallel
-rspec-ee integration pg12 opensearch2:
+rspec-ee integration pg13 opensearch2:
extends:
- - .rspec-ee-base-pg12-opensearch2
+ - .rspec-ee-base-pg13-opensearch2
- .rspec-ee-integration-parallel
-rspec-ee system pg12 opensearch1:
+rspec-ee system pg13 opensearch1:
extends:
- - .rspec-ee-base-pg12-opensearch1
+ - .rspec-ee-base-pg13-opensearch1
- .rspec-ee-system-parallel
-rspec-ee system pg12 opensearch2:
+rspec-ee system pg13 opensearch2:
extends:
- - .rspec-ee-base-pg12-opensearch2
+ - .rspec-ee-base-pg13-opensearch2
- .rspec-ee-system-parallel
-# PG13
-rspec-ee migration pg13:
+# PG14
+rspec-ee unit pg14 opensearch1:
extends:
- - .rspec-ee-base-pg13
+ - .rspec-ee-base-pg14-opensearch1
+ - .rspec-ee-unit-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee unit pg14 opensearch2:
+ extends:
+ - .rspec-ee-base-pg14-opensearch2
+ - .rspec-ee-unit-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee integration pg14 opensearch1:
+ extends:
+ - .rspec-ee-base-pg14-opensearch1
+ - .rspec-ee-integration-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee integration pg14 opensearch2:
+ extends:
+ - .rspec-ee-base-pg14-opensearch2
+ - .rspec-ee-integration-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee system pg14 opensearch1:
+ extends:
+ - .rspec-ee-base-pg14-opensearch1
+ - .rspec-ee-system-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee system pg14 opensearch2:
+ extends:
+ - .rspec-ee-base-pg14-opensearch2
+ - .rspec-ee-system-parallel
+ - .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
+
+rspec-ee migration pg14:
+ extends:
+ - .rspec-ee-base-pg14
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-migration-parallel
-rspec-ee background_migration pg13:
+rspec-ee background_migration pg14:
extends:
- - .rspec-ee-base-pg13
+ - .rspec-ee-base-pg14
- .rspec-base-migration
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-background-migration-parallel
-rspec-ee unit pg13:
+rspec-ee unit pg14:
extends:
- - .rspec-ee-base-pg13
+ - .rspec-ee-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-unit-parallel
-rspec-ee integration pg13:
+rspec-ee unit pg14 es8:
extends:
- - .rspec-ee-base-pg13
+ - .rspec-ee-base-pg14-es8
+ - .rspec-ee-unit-parallel
+
+rspec-ee integration pg14:
+ extends:
+ - .rspec-ee-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-integration-parallel
-rspec-ee system pg13:
+rspec-ee integration pg14 es8:
extends:
- - .rspec-ee-base-pg13
+ - .rspec-ee-base-pg14-es8
+ - .rspec-ee-integration-parallel
+
+rspec-ee system pg14:
+ extends:
+ - .rspec-ee-base-pg14
- .rails:rules:default-branch-schedule-nightly--code-backstage-ee-only
- .rspec-ee-system-parallel
+
+rspec-ee system pg14 es8:
+ extends:
+ - .rspec-ee-base-pg14-es8
+ - .rspec-ee-system-parallel
# EE: default branch nightly scheduled jobs #
#####################################
@@ -830,15 +957,15 @@ rspec-ee system pg13:
rspec fail-fast:
extends:
- - .rspec-base-pg12
- - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-base-pg12
+ - .rspec-base-pg13
+ - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-base-pg13
variables:
MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_FOSS_PATH}"
rspec-ee fail-fast:
extends:
- - .rspec-ee-base-pg12
- - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-ee-base-pg12
+ - .rspec-ee-base-pg13
+ - .rspec-fail-fast # extends from .rspec-fail-fast last to override script from .rspec-ee-base-pg13
variables:
MATCHING_TESTS_PATH: "${RSPEC_MATCHING_TESTS_EE_PATH}"
@@ -894,7 +1021,7 @@ fail-pipeline-early:
script:
- fail_pipeline_early
-.base-rspec-pg12-rerun-previous-failed-tests:
+.base-rspec-pg13-rerun-previous-failed-tests:
extends:
- .rails:rules:rerun-previous-failed-tests
stage: test
@@ -903,17 +1030,17 @@ fail-pipeline-early:
- !reference [.base-script, script]
- rspec_rerun_previous_failed_tests "${PREVIOUS_FAILED_TESTS_FILE}"
-rspec rspec-pg12-rerun-previous-failed-tests:
+rspec rspec-pg13-rerun-previous-failed-tests:
extends:
- - .rspec-base-pg12
- - .base-rspec-pg12-rerun-previous-failed-tests
+ - .rspec-base-pg13
+ - .base-rspec-pg13-rerun-previous-failed-tests
variables:
PREVIOUS_FAILED_TESTS_FILE: tmp/previous_failed_tests/rspec_failed_tests.txt
-rspec rspec-ee-pg12-rerun-previous-failed-tests:
+rspec rspec-ee-pg13-rerun-previous-failed-tests:
extends:
- - .rspec-ee-base-pg12
- - .base-rspec-pg12-rerun-previous-failed-tests
+ - .rspec-ee-base-pg13
+ - .base-rspec-pg13-rerun-previous-failed-tests
variables:
PREVIOUS_FAILED_TESTS_FILE: tmp/previous_failed_tests/rspec_ee_failed_files.txt
# EE: Canonical MR pipelines
diff --git a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb
index 02b7d61a4fa..38d964af62a 100644
--- a/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb
+++ b/.gitlab/ci/rails/rspec-foss-impact.gitlab-ci.yml.erb
@@ -22,7 +22,7 @@ dont-interrupt-me:
- echo "This jobs makes sure this pipeline won't be interrupted! See https://docs.gitlab.com/ee/ci/yaml/#interruptible."
.base-rspec-foss-impact:
- extends: .rspec-base-pg12-as-if-foss
+ extends: .rspec-base-pg13-as-if-foss
needs:
- pipeline: $PARENT_PIPELINE_ID
job: detect-tests
diff --git a/.gitlab/ci/rails/shared.gitlab-ci.yml b/.gitlab/ci/rails/shared.gitlab-ci.yml
index 0fa65b0be90..62e8547fa5a 100644
--- a/.gitlab/ci/rails/shared.gitlab-ci.yml
+++ b/.gitlab/ci/rails/shared.gitlab-ci.yml
@@ -105,11 +105,16 @@ include:
- .rspec-base
- .use-pg12
-.rspec-base-pg12-as-if-foss:
+.rspec-base-pg13:
+ extends:
+ - .rspec-base
+ - .use-pg13
+
+.rspec-base-pg13-as-if-foss:
extends:
- .rspec-base
- .as-if-foss
- - .use-pg12
+ - .use-pg13
needs:
- job: "setup-test-env"
- job: "retrieve-tests-metadata"
@@ -117,44 +122,67 @@ include:
- job: "detect-tests"
optional: true
-.rspec-base-pg13:
+.rspec-base-pg14:
extends:
- .rspec-base
- - .use-pg13
+ - .use-pg14
.rspec-ee-base-pg12:
extends:
- .rspec-base
- .use-pg12-es7-ee
-.rspec-ee-base-pg12-es8:
+.rspec-ee-base-pg13:
extends:
- .rspec-base
- - .use-pg12-es8-ee
+ - .use-pg13-es7-ee
+
+.rspec-ee-base-pg13-es8:
+ extends:
+ - .rspec-base
+ - .use-pg13-es8-ee
- .rails:rules:run-search-tests
-.rspec-ee-base-pg12-opensearch1:
+.rspec-ee-base-pg13-opensearch1:
extends:
- .rspec-base
- - .use-pg12-opensearch1-ee
+ - .use-pg13-opensearch1-ee
- .rails:rules:run-search-tests
-.rspec-ee-base-pg12-opensearch2:
+.rspec-ee-base-pg13-opensearch2:
extends:
- .rspec-base
- - .use-pg12-opensearch2-ee
+ - .use-pg13-opensearch2-ee
- .rails:rules:run-search-tests
-.rspec-ee-base-pg13:
+.rspec-ee-base-pg14:
extends:
- .rspec-base
- - .use-pg13-es7-ee
+ - .use-pg14-es7-ee
+
+.rspec-ee-base-pg14-es8:
+ extends:
+ - .rspec-base
+ - .use-pg14-es8-ee
+ - .rails:rules:run-search-tests
+
+.rspec-ee-base-pg14-opensearch1:
+ extends:
+ - .rspec-base
+ - .use-pg14-opensearch1-ee
+ - .rails:rules:run-search-tests
+
+.rspec-ee-base-pg14-opensearch2:
+ extends:
+ - .rspec-base
+ - .use-pg14-opensearch2-ee
+ - .rails:rules:run-search-tests
.db-job-base:
extends:
- .rails-job-base
- .rails:rules:ee-and-foss-migration
- - .use-pg12
+ - .use-pg13
stage: test
needs: ["setup-test-env"]
# rspec job base specs
diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml
index 7fdb2ad41ec..6eab6472ed1 100644
--- a/.gitlab/ci/rules.gitlab-ci.yml
+++ b/.gitlab/ci/rules.gitlab-ci.yml
@@ -85,6 +85,9 @@
.if-merge-request-labels-run-review-app: &if-merge-request-labels-run-review-app
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-review-app/'
+.if-merge-request-labels-run-on-pg12: &if-merge-request-labels-run-on-pg12
+ if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-on-pg12/'
+
.if-merge-request-labels-skip-undercoverage: &if-merge-request-labels-skip-undercoverage
if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:skip-undercoverage/'
@@ -1668,6 +1671,7 @@
- <<: *if-default-refs
changes: *db-library-patterns
- <<: *if-merge-request-labels-run-all-rspec
+ - <<: *if-merge-request-labels-run-on-pg12
.rails:rules:ee-mr-and-default-branch-only:
rules:
@@ -1757,6 +1761,11 @@
- <<: *if-merge-request
changes: *backend-patterns
+.rails:rules:rspec-on-pg12:
+ rules:
+ - <<: *if-merge-request-labels-run-on-pg12
+ - !reference [".rails:rules:default-branch-schedule-nightly--code-backstage-default-rules", rules]
+
.rails:rules:default-branch-schedule-nightly--code-backstage-default-rules:
rules:
- <<: *if-default-branch-schedule-nightly
diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml
index 9620f0b87bd..35172faa6df 100644
--- a/.gitlab/ci/setup.gitlab-ci.yml
+++ b/.gitlab/ci/setup.gitlab-ci.yml
@@ -83,7 +83,7 @@ verify-approvals:
generate-frontend-fixtures-mapping:
extends:
- .setup:rules:generate-frontend-fixtures-mapping
- - .use-pg12
+ - .use-pg13
- .rails-cache
needs: ["setup-test-env"]
stage: prepare
diff --git a/.gitlab/ci/static-analysis.gitlab-ci.yml b/.gitlab/ci/static-analysis.gitlab-ci.yml
index d546c79aab9..b9c9200d78b 100644
--- a/.gitlab/ci/static-analysis.gitlab-ci.yml
+++ b/.gitlab/ci/static-analysis.gitlab-ci.yml
@@ -45,7 +45,7 @@ static-verification-with-database:
- .static-analysis-base
- .rubocop-job-cache
- .static-analysis:rules:static-verification-with-database
- - .use-pg12
+ - .use-pg13
script:
- bundle exec rake lint:static_verification_with_database
variables:
diff --git a/.gitlab/ci/test-metadata.gitlab-ci.yml b/.gitlab/ci/test-metadata.gitlab-ci.yml
index 176a0b67d66..20d768c9e90 100644
--- a/.gitlab/ci/test-metadata.gitlab-ci.yml
+++ b/.gitlab/ci/test-metadata.gitlab-ci.yml
@@ -32,17 +32,17 @@ update-tests-metadata:
- retrieve-tests-metadata
- generate-frontend-fixtures-mapping
- setup-test-env
- - rspec migration pg12
+ - rspec migration pg13
- rspec-all frontend_fixture
- - rspec unit pg12
- - rspec integration pg12
- - rspec system pg12
- - rspec background_migration pg12
- - rspec-ee migration pg12
- - rspec-ee unit pg12
- - rspec-ee integration pg12
- - rspec-ee system pg12
- - rspec-ee background_migration pg12
+ - rspec unit pg13
+ - rspec integration pg13
+ - rspec system pg13
+ - rspec background_migration pg13
+ - rspec-ee migration pg13
+ - rspec-ee unit pg13
+ - rspec-ee integration pg13
+ - rspec-ee system pg13
+ - rspec-ee background_migration pg13
script:
- run_timed_command "retry gem install fog-aws mime-types activesupport rspec_profiling postgres-copy --no-document"
- source ./scripts/rspec_helpers.sh
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index e62ab1ff6c7..799039087c5 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-24dee50e284ca88136984dd4ea18f5d4694feb94
+28a95b4b97a1f2b2187cccfa05feebf073d0696b
diff --git a/app/assets/javascripts/packages_and_registries/settings/group/components/packages_forwarding_settings.vue b/app/assets/javascripts/packages_and_registries/settings/group/components/packages_forwarding_settings.vue
index b7d7f0aaca7..ab88d9e8936 100644
--- a/app/assets/javascripts/packages_and_registries/settings/group/components/packages_forwarding_settings.vue
+++ b/app/assets/javascripts/packages_and_registries/settings/group/components/packages_forwarding_settings.vue
@@ -1,12 +1,14 @@
<script>
-import { GlButton } from '@gitlab/ui';
+import { GlButton, GlLink, GlSprintf } from '@gitlab/ui';
import { isEqual } from 'lodash';
import {
+ PACKAGE_FORWARDING_SECURITY_DESCRIPTION,
PACKAGE_FORWARDING_SETTINGS_HEADER,
PACKAGE_FORWARDING_SETTINGS_DESCRIPTION,
PACKAGE_FORWARDING_FORM_BUTTON,
PACKAGE_FORWARDING_FIELDS,
MAVEN_FORWARDING_FIELDS,
+ REQUEST_FORWARDING_HELP_PAGE_PATH,
} from '~/packages_and_registries/settings/group/constants';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import updateNamespacePackageSettings from '~/packages_and_registries/settings/group/graphql/mutations/update_group_packages_settings.mutation.graphql';
@@ -20,12 +22,15 @@ export default {
name: 'PackageForwardingSettings',
i18n: {
PACKAGE_FORWARDING_FORM_BUTTON,
+ PACKAGE_FORWARDING_SECURITY_DESCRIPTION,
PACKAGE_FORWARDING_SETTINGS_HEADER,
PACKAGE_FORWARDING_SETTINGS_DESCRIPTION,
},
components: {
ForwardingSettings,
GlButton,
+ GlLink,
+ GlSprintf,
SettingsBlock,
},
mixins: [glFeatureFlagsMixin()],
@@ -150,6 +155,9 @@ export default {
this.$set(this.workingCopy, type, value);
},
},
+ links: {
+ REQUEST_FORWARDING_HELP_PAGE_PATH,
+ },
};
</script>
@@ -157,9 +165,14 @@ export default {
<settings-block>
<template #title> {{ $options.i18n.PACKAGE_FORWARDING_SETTINGS_HEADER }}</template>
<template #description>
- <span data-testid="description">
+ <span class="gl-display-block gl-mb-2" data-testid="description">
{{ $options.i18n.PACKAGE_FORWARDING_SETTINGS_DESCRIPTION }}
</span>
+ <gl-sprintf :message="$options.i18n.PACKAGE_FORWARDING_SECURITY_DESCRIPTION">
+ <template #docLink="{ content }">
+ <gl-link :href="$options.links.REQUEST_FORWARDING_HELP_PAGE_PATH">{{ content }}</gl-link>
+ </template>
+ </gl-sprintf>
</template>
<template #default>
<form @submit.prevent="submit">
diff --git a/app/assets/javascripts/packages_and_registries/settings/group/constants.js b/app/assets/javascripts/packages_and_registries/settings/group/constants.js
index b47759df35f..fa73c01c5c4 100644
--- a/app/assets/javascripts/packages_and_registries/settings/group/constants.js
+++ b/app/assets/javascripts/packages_and_registries/settings/group/constants.js
@@ -17,6 +17,9 @@ export const DUPLICATES_SETTINGS_EXCEPTION_LEGEND = s__(
'PackageRegistry|Publish packages if their name or version matches this regex.',
);
+export const PACKAGE_FORWARDING_SECURITY_DESCRIPTION = s__(
+ 'PackageRegistry|There are security risks if packages are deleted while request forwarding is enabled. %{docLinkStart}What are the risks?%{docLinkEnd}',
+);
export const PACKAGE_FORWARDING_SETTINGS_HEADER = s__('PackageRegistry|Package forwarding');
export const PACKAGE_FORWARDING_SETTINGS_DESCRIPTION = s__(
'PackageRegistry|Forward package requests to a public registry if the packages are not found in the GitLab package registry.',
@@ -79,3 +82,7 @@ export const MAVEN_FORWARDING_FIELDS = {
// Parameters
export const DEPENDENCY_PROXY_DOCS_PATH = helpPagePath('user/packages/dependency_proxy/index');
+export const REQUEST_FORWARDING_HELP_PAGE_PATH = helpPagePath(
+ 'user/packages/package_registry/supported_functionality',
+ { anchor: 'deleting-packages' },
+);
diff --git a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
index dfae43bf19c..4721c6fee61 100644
--- a/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
+++ b/app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue
@@ -191,11 +191,7 @@ export default {
: false;
},
shouldSkipRealTimeEpicLinkUpdates() {
- return (
- !this.issuableId ||
- this.issuableAttribute !== IssuableAttributeType.Epic ||
- !this.glFeatures?.realTimeIssueEpicLinks
- );
+ return !this.issuableId || this.issuableAttribute !== IssuableAttributeType.Epic;
},
},
methods: {
diff --git a/app/assets/javascripts/users_select/index.js b/app/assets/javascripts/users_select/index.js
index a401a9bbf2f..694f5a7fe16 100644
--- a/app/assets/javascripts/users_select/index.js
+++ b/app/assets/javascripts/users_select/index.js
@@ -467,6 +467,8 @@ function UsersSelect(currentUser, els, options = {}) {
// display:block overrides the hide-collapse rule
$value.css('display', '');
}
+
+ $('.dropdown-input-field', $block).val('');
},
multiSelect: $dropdown.hasClass('js-multiselect'),
inputMeta: $dropdown.data('inputMeta'),
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 6fdd4906613..c3c90f00ade 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -22,7 +22,6 @@ class Projects::PipelinesController < Projects::ApplicationController
before_action :authorize_update_pipeline!, only: [:retry, :cancel]
before_action :ensure_pipeline, only: [:show, :downloadable_artifacts]
before_action :reject_if_build_artifacts_size_refreshing!, only: [:destroy]
- before_action :push_frontend_feature_flags, only: [:show]
# Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596
before_action :redirect_for_legacy_scope_filter, only: [:index], if: -> { request.format.html? }
@@ -370,10 +369,6 @@ class Projects::PipelinesController < Projects::ApplicationController
def tracking_project_source
project
end
-
- def push_frontend_feature_flags
- push_frontend_feature_flag(:refactor_ci_minutes_consumption, @project)
- end
end
Projects::PipelinesController.prepend_mod_with('Projects::PipelinesController')
diff --git a/app/controllers/projects/project_members_controller.rb b/app/controllers/projects/project_members_controller.rb
index 543ffa637e1..f4b96177b0f 100644
--- a/app/controllers/projects/project_members_controller.rb
+++ b/app/controllers/projects/project_members_controller.rb
@@ -47,7 +47,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
def membershipable_members
- query_members_via_project_namespace_enabled? ? project.namespace_members : project.members
+ project.namespace_members
end
def plain_source_type
@@ -67,15 +67,11 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
def members_and_requesters
- query_members_via_project_namespace_enabled? ? project.namespace_members_and_requesters : super
+ project.namespace_members_and_requesters
end
def requesters
- query_members_via_project_namespace_enabled? ? project.namespace_requesters : super
- end
-
- def query_members_via_project_namespace_enabled?
- Feature.enabled?(:project_members_index_by_project_namespace, project)
+ project.namespace_requesters
end
end
diff --git a/app/controllers/projects/work_items_controller.rb b/app/controllers/projects/work_items_controller.rb
index 34a71dbbb91..7da31c199a1 100644
--- a/app/controllers/projects/work_items_controller.rb
+++ b/app/controllers/projects/work_items_controller.rb
@@ -1,6 +1,12 @@
# frozen_string_literal: true
class Projects::WorkItemsController < Projects::ApplicationController
+ include WorkhorseAuthorization
+ extend Gitlab::Utils::Override
+
+ EXTENSION_ALLOWLIST = %w[csv].map(&:downcase).freeze
+
+ before_action :authorize_import_access!, only: [:import_csv, :authorize] # rubocop:disable Rails/LexicallyScopedActionFilter
before_action do
push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?)
push_force_frontend_feature_flag(:work_items_mvc, project&.work_items_mvc_feature_flag_enabled?)
@@ -9,7 +15,57 @@ class Projects::WorkItemsController < Projects::ApplicationController
end
feature_category :team_planning
+ urgency :high, [:authorize]
urgency :low
+
+ def import_csv
+ file = import_params[:file]
+ return render json: { errors: invalid_file_message }, status: :bad_request unless file_is_valid?(file)
+
+ result = WorkItems::PrepareImportCsvService.new(project, current_user, file: file).execute
+
+ if result.status == :error
+ render json: { errors: result.message }, status: :bad_request
+ else
+ render json: { message: result.message }, status: :ok
+ end
+ end
+
+ private
+
+ def import_params
+ params.permit(:file)
+ end
+
+ def authorize_import_access!
+ can_import = can?(current_user, :import_work_items, project)
+ import_csv_feature_available = Feature.enabled?(:import_export_work_items_csv, project)
+ return if can_import && import_csv_feature_available
+
+ if current_user || action_name == 'authorize'
+ render_404
+ else
+ authenticate_user!
+ end
+ end
+
+ def invalid_file_message
+ supported_file_extensions = ".#{EXTENSION_ALLOWLIST.join(', .')}"
+ format(_("The uploaded file was invalid. Supported file extensions are %{extensions}."),
+ { extensions: supported_file_extensions })
+ end
+
+ def uploader_class
+ FileUploader
+ end
+
+ def maximum_size
+ Gitlab::CurrentSettings.max_attachment_size.megabytes
+ end
+
+ def file_extension_allowlist
+ EXTENSION_ALLOWLIST
+ end
end
Projects::WorkItemsController.prepend_mod
diff --git a/app/finders/access_requests_finder.rb b/app/finders/access_requests_finder.rb
index 7b98df68f29..140d68cfe91 100644
--- a/app/finders/access_requests_finder.rb
+++ b/app/finders/access_requests_finder.rb
@@ -18,11 +18,7 @@ class AccessRequestsFinder
def execute!(current_user)
raise Gitlab::Access::AccessDeniedError unless can_see_access_requests?(current_user)
- if Feature.enabled?(:project_members_index_by_project_namespace, source)
- source.namespace_requesters
- else
- source.requesters
- end
+ source.namespace_requesters
end
private
diff --git a/app/finders/members_finder.rb b/app/finders/members_finder.rb
index 1641219a14c..d2122eccab1 100644
--- a/app/finders/members_finder.rb
+++ b/app/finders/members_finder.rb
@@ -31,11 +31,7 @@ class MembersFinder
attr_reader :project, :current_user, :group
def find_members(include_relations)
- project_members = if Feature.enabled?(:project_members_index_by_project_namespace, project)
- project.namespace_members
- else
- project.project_members
- end
+ project_members = project.namespace_members
if params[:active_without_invites_and_requests].present?
project_members = project_members.active_without_invites_and_requests
diff --git a/app/mailers/emails/service_desk.rb b/app/mailers/emails/service_desk.rb
index 1295f978049..f343121e071 100644
--- a/app/mailers/emails/service_desk.rb
+++ b/app/mailers/emails/service_desk.rb
@@ -69,8 +69,9 @@ module Emails
def inject_service_desk_custom_email(mail)
return mail unless service_desk_custom_email_enabled?
+ return mail unless @service_desk_setting.custom_email_credential.present?
- mail.delivery_method(::Mail::SMTP, @service_desk_setting.custom_email_delivery_options)
+ mail.delivery_method(::Mail::SMTP, @service_desk_setting.custom_email_credential.delivery_options)
end
def service_desk_custom_email_enabled?
diff --git a/app/models/project.rb b/app/models/project.rb
index 538689b6efc..d0c89edf407 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -278,6 +278,7 @@ class Project < ApplicationRecord
has_one :alerting_setting, inverse_of: :project, class_name: 'Alerting::ProjectAlertingSetting'
has_one :service_desk_setting, class_name: 'ServiceDeskSetting'
has_one :service_desk_custom_email_verification, class_name: 'ServiceDesk::CustomEmailVerification'
+ has_one :service_desk_custom_email_credential, class_name: 'ServiceDesk::CustomEmailCredential'
# Merge requests for target project should be removed with it
has_many :merge_requests, foreign_key: 'target_project_id', inverse_of: :target_project, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
diff --git a/app/models/service_desk/custom_email_credential.rb b/app/models/service_desk/custom_email_credential.rb
new file mode 100644
index 00000000000..8ccdd6f2261
--- /dev/null
+++ b/app/models/service_desk/custom_email_credential.rb
@@ -0,0 +1,66 @@
+# frozen_string_literal: true
+
+module ServiceDesk
+ class CustomEmailCredential < ApplicationRecord
+ attr_encrypted :smtp_username,
+ mode: :per_attribute_iv,
+ algorithm: 'aes-256-gcm',
+ key: Settings.attr_encrypted_db_key_base_32,
+ encode: false,
+ encode_iv: false
+ attr_encrypted :smtp_password,
+ mode: :per_attribute_iv,
+ algorithm: 'aes-256-gcm',
+ key: Settings.attr_encrypted_db_key_base_32,
+ encode: false,
+ encode_iv: false
+
+ belongs_to :project
+
+ validates :project, presence: true
+
+ validates :smtp_address,
+ presence: true,
+ length: { maximum: 255 },
+ hostname: { allow_numeric_hostname: true }
+ validate :validate_smtp_address
+
+ validates :smtp_port,
+ presence: true,
+ numericality: { only_integer: true, greater_than: 0 }
+
+ validates :smtp_username,
+ presence: true,
+ length: { maximum: 255 }
+ validates :smtp_password,
+ presence: true,
+ length: { minimum: 8, maximum: 128 }
+
+ delegate :service_desk_setting, to: :project
+
+ def delivery_options
+ {
+ user_name: smtp_username,
+ password: smtp_password,
+ address: smtp_address,
+ domain: Mail::Address.new(service_desk_setting.custom_email).domain,
+ port: smtp_port || 587
+ }
+ end
+
+ private
+
+ def validate_smtp_address
+ # Addressable::URI always needs a scheme otherwise it interprets the host as the path
+ Gitlab::UrlBlocker.validate!("smtp://#{smtp_address}",
+ schemes: %w[smtp],
+ ascii_only: true,
+ enforce_sanitization: true,
+ allow_localhost: false,
+ allow_local_network: false
+ )
+ rescue Gitlab::UrlBlocker::BlockedUrlError => e
+ errors.add(:smtp_address, e)
+ end
+ end
+end
diff --git a/app/models/service_desk_setting.rb b/app/models/service_desk_setting.rb
index 69afb445734..4216ad7e70f 100644
--- a/app/models/service_desk_setting.rb
+++ b/app/models/service_desk_setting.rb
@@ -2,16 +2,19 @@
class ServiceDeskSetting < ApplicationRecord
include Gitlab::Utils::StrongMemoize
+ include IgnorableColumns
CUSTOM_EMAIL_VERIFICATION_SUBADDRESS = '+verify'
+ ignore_columns %i[
+ custom_email_smtp_address
+ custom_email_smtp_port
+ custom_email_smtp_username
+ encrypted_custom_email_smtp_password
+ encrypted_custom_email_smtp_password_iv
+ ], remove_with: '16.1', remove_after: '2023-05-22'
+
attribute :custom_email_enabled, default: false
- attr_encrypted :custom_email_smtp_password,
- mode: :per_attribute_iv,
- algorithm: 'aes-256-gcm',
- key: Settings.attr_encrypted_db_key_base_32,
- encode: false,
- encode_iv: false
belongs_to :project
@@ -20,48 +23,32 @@ class ServiceDeskSetting < ApplicationRecord
validate :valid_project_key
validates :outgoing_name, length: { maximum: 255 }, allow_blank: true
validates :project_key,
- length: { maximum: 255 },
- allow_blank: true,
- format: { with: /\A[a-z0-9_]+\z/, message: -> (setting, data) { _("can contain only lowercase letters, digits, and '_'.") } }
+ length: { maximum: 255 },
+ allow_blank: true,
+ format: { with: /\A[a-z0-9_]+\z/, message: -> (setting, data) { _("can contain only lowercase letters, digits, and '_'.") } }
validates :custom_email,
- length: { maximum: 255 },
- uniqueness: true,
- allow_nil: true,
- format: /\A[\w\-._]+@[\w\-.]+\.{1}[a-zA-Z]{2,}\z/
- validates :custom_email_smtp_address, length: { maximum: 255 }
- validates :custom_email_smtp_username, length: { maximum: 255 }
-
+ length: { maximum: 255 },
+ uniqueness: true,
+ allow_nil: true,
+ format: /\A[\w\-._]+@[\w\-.]+\.{1}[a-zA-Z]{2,}\z/
+
+ validates :custom_email_credential,
+ presence: true,
+ if: :needs_custom_email_credentials?
validates :custom_email,
- presence: true,
- devise_email: true,
- if: :needs_custom_email_smtp_credentials?
- validates :custom_email_smtp_address,
- presence: true,
- hostname: { allow_numeric_hostname: true, require_valid_tld: true },
- if: :needs_custom_email_smtp_credentials?
- validates :custom_email_smtp_username,
- presence: true,
- if: :needs_custom_email_smtp_credentials?
- validates :custom_email_smtp_port,
- presence: true,
- numericality: { only_integer: true, greater_than: 0 },
- if: :needs_custom_email_smtp_credentials?
+ presence: true,
+ devise_email: true,
+ if: :needs_custom_email_credentials?
scope :with_project_key, ->(key) { where(project_key: key) }
- def custom_email_verification
- project&.service_desk_custom_email_verification
+ def custom_email_credential
+ project&.service_desk_custom_email_credential
end
- def custom_email_delivery_options
- {
- user_name: custom_email_smtp_username,
- password: custom_email_smtp_password,
- address: custom_email_smtp_address,
- domain: Mail::Address.new(custom_email).domain,
- port: custom_email_smtp_port || 587
- }
+ def custom_email_verification
+ project&.service_desk_custom_email_verification
end
def custom_email_address_for_verification
@@ -116,7 +103,7 @@ class ServiceDeskSetting < ApplicationRecord
end
end
- def needs_custom_email_smtp_credentials?
+ def needs_custom_email_credentials?
custom_email_enabled? || custom_email_verification.present?
end
end
diff --git a/app/services/import_csv/base_service.rb b/app/services/import_csv/base_service.rb
index 1d27a5811c7..70834b8a85a 100644
--- a/app/services/import_csv/base_service.rb
+++ b/app/services/import_csv/base_service.rb
@@ -42,6 +42,7 @@ module ImportCsv
def validate_structure!
header_line = csv_data.lines.first
+ raise CSV::MalformedCSVError.new('File is empty, no headers found', 1) if header_line.blank?
validate_headers_presence!(header_line)
detect_col_sep
diff --git a/app/services/work_items/prepare_import_csv_service.rb b/app/services/work_items/prepare_import_csv_service.rb
new file mode 100644
index 00000000000..a331b2870f4
--- /dev/null
+++ b/app/services/work_items/prepare_import_csv_service.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module WorkItems
+ class PrepareImportCsvService < Import::PrepareService
+ extend ::Gitlab::Utils::Override
+
+ private
+
+ override :worker
+ def worker
+ ImportWorkItemsCsvWorker
+ end
+
+ override :success_message
+ def success_message
+ _("Your work items are being imported. Once finished, you'll receive a confirmation email.")
+ end
+ end
+end
diff --git a/app/views/projects/pipelines/_info.html.haml b/app/views/projects/pipelines/_info.html.haml
index 7a889570f56..3ff370dfaa4 100644
--- a/app/views/projects/pipelines/_info.html.haml
+++ b/app/views/projects/pipelines/_info.html.haml
@@ -21,10 +21,7 @@
- duration = time_interval_in_words(@pipeline.duration)
- queued_duration = time_interval_in_words(@pipeline.queued_duration)
%span.gl-pl-7{ 'data-testid': 'pipeline-stats-text' }
- - if Feature.enabled?(:refactor_ci_minutes_consumption, @project)
- = render_if_exists 'projects/pipelines/pipeline_stats_text', duration: duration, pipeline: @pipeline, queued_duration: queued_duration
- - else
- = s_("in %{duration} and was queued for %{queued_duration}").html_safe % { duration: duration, queued_duration: queued_duration }
+ = render_if_exists 'projects/pipelines/pipeline_stats_text', duration: duration, pipeline: @pipeline, queued_duration: queued_duration
- if has_pipeline_badges?(@pipeline)
.well-segment
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index a5dc5e9cc0e..6f86c3b939e 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -3513,6 +3513,15 @@
:weight: 1
:idempotent: false
:tags: []
+- :name: work_items_import_work_items_csv
+ :worker_name: WorkItems::ImportWorkItemsCsvWorker
+ :feature_category: :team_planning
+ :has_external_dependencies: false
+ :urgency: :low
+ :resource_boundary: :unknown
+ :weight: 1
+ :idempotent: true
+ :tags: []
- :name: x509_certificate_revoke
:worker_name: X509CertificateRevokeWorker
:feature_category: :source_code_management
diff --git a/app/workers/work_items/import_work_items_csv_worker.rb b/app/workers/work_items/import_work_items_csv_worker.rb
new file mode 100644
index 00000000000..be7294866df
--- /dev/null
+++ b/app/workers/work_items/import_work_items_csv_worker.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+module WorkItems
+ class ImportWorkItemsCsvWorker
+ include ApplicationWorker
+
+ data_consistency :always
+
+ sidekiq_options retry: 3
+
+ idempotent!
+ feature_category :team_planning
+
+ sidekiq_retries_exhausted do |job|
+ Upload.find(job['args'][2]).destroy
+ end
+
+ def perform(current_user_id, project_id, upload_id)
+ upload = Upload.find(upload_id)
+ user = User.find(current_user_id)
+ project = Project.find(project_id)
+
+ WorkItems::ImportCsvService.new(user, project, upload.retrieve_uploader).execute
+ upload.destroy!
+ rescue ActiveRecord::RecordNotFound
+ # Resources have been removed, job should not be retried
+ end
+ end
+end
diff --git a/config/events/20230321151607_github_create.yml b/config/events/20230321151607_github_create.yml
new file mode 100644
index 00000000000..8099fe03a07
--- /dev/null
+++ b/config/events/20230321151607_github_create.yml
@@ -0,0 +1,30 @@
+---
+description: State of projects imported from GitHub
+category: Import::GithubService
+action: create
+label_description: github_import_project_state
+property_description:
+value_description:
+extra_properties:
+ import_type:
+ type: string
+ description: Type of project import
+ state:
+ type: string
+ description: Import state
+identifiers:
+- project
+product_section: dev
+product_stage: manage
+product_group: import
+product_category: importers
+milestone: "15.10"
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112062
+distributions:
+- ce
+- ee
+tiers:
+- free
+- premium
+- ultimate
+
diff --git a/config/feature_flags/development/project_members_index_by_project_namespace.yml b/config/feature_flags/development/project_members_index_by_project_namespace.yml
deleted file mode 100644
index 54735275869..00000000000
--- a/config/feature_flags/development/project_members_index_by_project_namespace.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: project_members_index_by_project_namespace
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105781
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/384521
-milestone: '15.7'
-type: development
-group: group::tenant scale
-default_enabled: true
diff --git a/config/feature_flags/development/refactor_ci_minutes_consumption.yml b/config/feature_flags/development/refactor_ci_minutes_consumption.yml
deleted file mode 100644
index b24cf3d30b2..00000000000
--- a/config/feature_flags/development/refactor_ci_minutes_consumption.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: refactor_ci_minutes_consumption
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112352
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/392949
-milestone: '15.10'
-type: development
-group: group::pipeline execution
-default_enabled: false
diff --git a/config/routes/project.rb b/config/routes/project.rb
index 4091ae1890c..92659dc1515 100644
--- a/config/routes/project.rb
+++ b/config/routes/project.rb
@@ -360,6 +360,13 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
get 'work_items/*work_items_path' => 'work_items#index', as: :work_items
get 'work_items/*work_items_path' => 'work_items#index', as: :work_item
+ resources :work_items, only: [] do
+ collection do
+ post :import_csv
+ post 'import_csv/authorize', to: 'work_items#authorize'
+ end
+ end
+
post 'incidents/integrations/pagerduty', to: 'incident_management/pager_duty_incidents#create'
resources :incidents, only: [:index]
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index 2c0b4feef91..344e779714a 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -561,6 +561,8 @@
- 1
- - wikis_git_garbage_collect
- 1
+- - work_items_import_work_items_csv
+ - 1
- - work_items_update_parent_objectives_progress
- 1
- - x509_certificate_revoke
diff --git a/db/docs/service_desk_custom_email_credentials.yml b/db/docs/service_desk_custom_email_credentials.yml
new file mode 100644
index 00000000000..fdfdce8fc21
--- /dev/null
+++ b/db/docs/service_desk_custom_email_credentials.yml
@@ -0,0 +1,11 @@
+---
+table_name: service_desk_custom_email_credentials
+classes:
+- ServiceDesk::CustomEmailCredential
+feature_categories:
+- service_desk
+description: Holds all the credentials for custom email
+ addresses for Service Desk
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114917
+milestone: '15.11'
+gitlab_schema: gitlab_main
diff --git a/db/init_structure.sql b/db/init_structure.sql
index 2b952381952..aee0f767996 100644
--- a/db/init_structure.sql
+++ b/db/init_structure.sql
@@ -10,178 +10,101 @@ CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
-CREATE FUNCTION insert_into_loose_foreign_keys_deleted_records() RETURNS trigger
+CREATE FUNCTION delete_associated_project_namespace() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (deleted_table_name, deleted_table_primary_key_value)
- SELECT TG_TABLE_NAME, old_table.id FROM old_table
- ON CONFLICT DO NOTHING;
+DELETE FROM namespaces
+WHERE namespaces.id = OLD.project_namespace_id AND
+namespaces.type = 'Project';
+RETURN NULL;
- RETURN NULL;
END
$$;
-CREATE FUNCTION integrations_set_type_new() RETURNS trigger
+CREATE FUNCTION insert_into_loose_foreign_keys_deleted_records() 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;
+ INSERT INTO loose_foreign_keys_deleted_records
+ (fully_qualified_table_name, primary_key_value)
+ SELECT TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table;
+ RETURN NULL;
END
$$;
-CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger
+CREATE FUNCTION insert_namespaces_sync_event() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
-UPDATE projects SET has_external_issue_tracker = (
- EXISTS
- (
- SELECT 1
- FROM integrations
- WHERE project_id = COALESCE(NEW.project_id, OLD.project_id)
- AND active = TRUE
- AND category = 'issue_tracker'
- )
-)
-WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
+INSERT INTO namespaces_sync_events (namespace_id)
+VALUES(COALESCE(NEW.id, OLD.id));
RETURN NULL;
END
$$;
-CREATE FUNCTION set_has_external_wiki() RETURNS trigger
+CREATE FUNCTION insert_projects_sync_event() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
-UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE)
-WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
+INSERT INTO projects_sync_events (project_id)
+VALUES(COALESCE(NEW.id, OLD.id));
RETURN NULL;
END
$$;
-CREATE FUNCTION trigger_07c94931164e() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."event_id_convert_to_bigint" := NEW."event_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_21e7a2602957() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- NEW."stage_id_convert_to_bigint" := NEW."stage_id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_490d204c00b3() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_542d6c2ad72e() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_69523443cc10() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- RETURN NEW;
-END;
-$$;
-
-CREATE FUNCTION trigger_77f5e1d20482() RETURNS trigger
+CREATE FUNCTION integrations_set_type_new() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- NEW."deployable_id_convert_to_bigint" := NEW."deployable_id";
- RETURN NEW;
-END;
-$$;
+UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1')
+WHERE integrations.id = NEW.id;
+RETURN NULL;
-CREATE FUNCTION trigger_8485e97c00e3() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."source_job_id_convert_to_bigint" := NEW."source_job_id";
- RETURN NEW;
-END;
+END
$$;
-CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger
- LANGUAGE plpgsql
+CREATE FUNCTION next_traversal_ids_sibling(traversal_ids integer[]) RETURNS integer[]
+ LANGUAGE plpgsql IMMUTABLE STRICT
AS $$
BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
- RETURN NEW;
+ return traversal_ids[1:array_length(traversal_ids, 1)-1] ||
+ ARRAY[traversal_ids[array_length(traversal_ids, 1)]+1];
END;
$$;
-CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger
+CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
- RETURN NEW;
-END;
-$$;
+UPDATE projects SET has_external_issue_tracker = (
+ EXISTS
+ (
+ SELECT 1
+ FROM integrations
+ WHERE project_id = COALESCE(NEW.project_id, OLD.project_id)
+ AND active = TRUE
+ AND category = 'issue_tracker'
+ )
+)
+WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
+RETURN NULL;
-CREATE FUNCTION trigger_aebe8b822ad3() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- NEW."taggable_id_convert_to_bigint" := NEW."taggable_id";
- RETURN NEW;
-END;
+END
$$;
-CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger
+CREATE FUNCTION set_has_external_wiki() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
- RETURN NEW;
-END;
-$$;
+UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE)
+WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
+RETURN NULL;
-CREATE FUNCTION trigger_f1ca8ec18d78() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."job_artifact_id_convert_to_bigint" := NEW."job_artifact_id";
- RETURN NEW;
-END;
+END
$$;
CREATE TABLE audit_events (
@@ -394,15 +317,188 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
);
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_202308 (
+ 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_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00');
+
+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,
+ 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_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
+
+CREATE TABLE batched_background_migration_job_transition_logs (
+ id bigint NOT NULL,
+ batched_background_migration_job_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
+ CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100))
+)
+PARTITION BY RANGE (created_at);
+
+CREATE SEQUENCE batched_background_migration_job_transition_logs_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE batched_background_migration_job_transition_logs_id_seq OWNED BY batched_background_migration_job_transition_logs.id;
+
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 (
+ 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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 (
+ 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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 (
+ 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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
+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,
+ updated_at timestamp with time zone NOT NULL,
+ previous_status smallint NOT NULL,
+ next_status smallint NOT NULL,
+ exception_class text,
+ exception_message text,
+ 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');
+
CREATE TABLE incident_management_pending_alert_escalations (
id bigint NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ updated_at timestamp with time zone NOT NULL
)
PARTITION BY RANGE (process_at);
@@ -419,35 +515,27 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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_202211 FOR VALUES FROM ('2022-10-31 19:00:00-05') TO ('2022-11-30 18:00:00-06');
CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 (
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
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,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -455,11 +543,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -467,11 +553,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -479,11 +563,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -491,11 +573,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -503,11 +583,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
@@ -515,14 +593,32 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat
id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
rule_id bigint NOT NULL,
alert_id bigint NOT NULL,
- schedule_id bigint,
process_at timestamp with time zone NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint
+ 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');
+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,
+ 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_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05');
+
+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,
+ 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_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05');
+
CREATE TABLE incident_management_pending_issue_escalations (
id bigint NOT NULL,
rule_id bigint NOT NULL,
@@ -550,7 +646,6 @@ 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_202211 FOR VALUES FROM ('2022-10-31 19:00:00-05') TO ('2022-11-30 18:00:00-06');
CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
@@ -560,7 +655,6 @@ 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_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 (
id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
@@ -632,61 +726,137 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat
);
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 (
+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 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 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');
+
+CREATE TABLE verification_codes (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
)
PARTITION BY RANGE (created_at);
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000 (
+COMMENT ON TABLE verification_codes IS 'JiHu-specific table';
+
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_000000 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000 FOR VALUES FROM (MINVALUE) TO ('2022-11-30 18:00:00-06');
+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');
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202302 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
+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');
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202303 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+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');
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202304 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
-CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304 (
+CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 (
created_at timestamp with time zone DEFAULT now() NOT NULL,
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+ 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))
);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+
+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))
+);
+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');
+
+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))
+);
+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');
+
+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))
+);
+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');
CREATE TABLE web_hook_logs (
id bigint NOT NULL,
@@ -730,7 +900,6 @@ 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 ('2022-12-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,
@@ -868,399 +1037,466 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
);
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_202308 (
+ 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_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_202309 (
+ 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_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00');
+
CREATE TABLE analytics_cycle_analytics_issue_stage_events (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
)
PARTITION BY HASH (stage_event_hash_id);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);
CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
+ stage_event_hash_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);
@@ -1272,7 +1508,8 @@ CREATE TABLE analytics_cycle_analytics_merge_request_stage_events (
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
)
PARTITION BY HASH (stage_event_hash_id);
@@ -1284,7 +1521,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);
@@ -1296,7 +1534,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);
@@ -1308,7 +1547,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);
@@ -1320,7 +1560,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);
@@ -1332,7 +1573,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);
@@ -1344,7 +1586,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);
@@ -1356,7 +1599,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);
@@ -1368,7 +1612,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);
@@ -1380,7 +1625,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);
@@ -1392,7 +1638,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);
@@ -1404,7 +1651,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);
@@ -1416,7 +1664,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);
@@ -1428,7 +1677,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);
@@ -1440,7 +1690,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);
@@ -1452,7 +1703,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);
@@ -1464,7 +1716,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);
@@ -1476,7 +1729,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);
@@ -1488,7 +1742,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);
@@ -1500,7 +1755,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);
@@ -1512,7 +1768,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);
@@ -1524,7 +1781,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);
@@ -1536,7 +1794,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);
@@ -1548,7 +1807,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);
@@ -1560,7 +1820,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);
@@ -1572,7 +1833,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);
@@ -1584,7 +1846,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);
@@ -1596,7 +1859,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);
@@ -1608,7 +1872,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);
@@ -1620,7 +1885,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);
@@ -1632,7 +1898,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);
@@ -1644,7 +1911,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);
@@ -1656,10 +1924,629 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st
milestone_id bigint,
author_id bigint,
start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone
+ end_event_timestamp timestamp with time zone,
+ state_id smallint DEFAULT 1 NOT NULL
);
ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);
+CREATE TABLE issue_search_data (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+)
+PARTITION BY HASH (project_id);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_00 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_00 FOR VALUES WITH (modulus 64, remainder 0);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_01 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_01 FOR VALUES WITH (modulus 64, remainder 1);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_02 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_02 FOR VALUES WITH (modulus 64, remainder 2);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_03 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_03 FOR VALUES WITH (modulus 64, remainder 3);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_04 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_04 FOR VALUES WITH (modulus 64, remainder 4);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_05 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_05 FOR VALUES WITH (modulus 64, remainder 5);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_06 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_06 FOR VALUES WITH (modulus 64, remainder 6);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_07 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_07 FOR VALUES WITH (modulus 64, remainder 7);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_08 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_08 FOR VALUES WITH (modulus 64, remainder 8);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_09 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_09 FOR VALUES WITH (modulus 64, remainder 9);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_10 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_10 FOR VALUES WITH (modulus 64, remainder 10);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_11 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_11 FOR VALUES WITH (modulus 64, remainder 11);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_12 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_12 FOR VALUES WITH (modulus 64, remainder 12);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_13 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_13 FOR VALUES WITH (modulus 64, remainder 13);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_14 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_14 FOR VALUES WITH (modulus 64, remainder 14);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_15 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_15 FOR VALUES WITH (modulus 64, remainder 15);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_16 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_16 FOR VALUES WITH (modulus 64, remainder 16);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_17 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_17 FOR VALUES WITH (modulus 64, remainder 17);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_18 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_18 FOR VALUES WITH (modulus 64, remainder 18);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_19 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_19 FOR VALUES WITH (modulus 64, remainder 19);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_20 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_20 FOR VALUES WITH (modulus 64, remainder 20);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_21 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_21 FOR VALUES WITH (modulus 64, remainder 21);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_22 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_22 FOR VALUES WITH (modulus 64, remainder 22);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_23 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_23 FOR VALUES WITH (modulus 64, remainder 23);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_24 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_24 FOR VALUES WITH (modulus 64, remainder 24);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_25 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_25 FOR VALUES WITH (modulus 64, remainder 25);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_26 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_26 FOR VALUES WITH (modulus 64, remainder 26);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_27 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_27 FOR VALUES WITH (modulus 64, remainder 27);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_28 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_28 FOR VALUES WITH (modulus 64, remainder 28);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_29 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_29 FOR VALUES WITH (modulus 64, remainder 29);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_30 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_30 FOR VALUES WITH (modulus 64, remainder 30);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_31 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_31 FOR VALUES WITH (modulus 64, remainder 31);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_32 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_32 FOR VALUES WITH (modulus 64, remainder 32);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_33 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_33 FOR VALUES WITH (modulus 64, remainder 33);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_34 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_34 FOR VALUES WITH (modulus 64, remainder 34);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_35 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_35 FOR VALUES WITH (modulus 64, remainder 35);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_36 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_36 FOR VALUES WITH (modulus 64, remainder 36);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_37 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_37 FOR VALUES WITH (modulus 64, remainder 37);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_38 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_38 FOR VALUES WITH (modulus 64, remainder 38);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_39 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_39 FOR VALUES WITH (modulus 64, remainder 39);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_40 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_40 FOR VALUES WITH (modulus 64, remainder 40);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_41 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_41 FOR VALUES WITH (modulus 64, remainder 41);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_42 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_42 FOR VALUES WITH (modulus 64, remainder 42);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_43 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_43 FOR VALUES WITH (modulus 64, remainder 43);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_44 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_44 FOR VALUES WITH (modulus 64, remainder 44);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_45 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_45 FOR VALUES WITH (modulus 64, remainder 45);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_46 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_46 FOR VALUES WITH (modulus 64, remainder 46);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_47 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_47 FOR VALUES WITH (modulus 64, remainder 47);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_48 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_48 FOR VALUES WITH (modulus 64, remainder 48);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_49 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_49 FOR VALUES WITH (modulus 64, remainder 49);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_50 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_50 FOR VALUES WITH (modulus 64, remainder 50);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_51 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_51 FOR VALUES WITH (modulus 64, remainder 51);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_52 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_52 FOR VALUES WITH (modulus 64, remainder 52);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_53 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_53 FOR VALUES WITH (modulus 64, remainder 53);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_54 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_54 FOR VALUES WITH (modulus 64, remainder 54);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_55 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_55 FOR VALUES WITH (modulus 64, remainder 55);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_56 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_56 FOR VALUES WITH (modulus 64, remainder 56);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_57 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_57 FOR VALUES WITH (modulus 64, remainder 57);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_58 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_58 FOR VALUES WITH (modulus 64, remainder 58);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_59 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_59 FOR VALUES WITH (modulus 64, remainder 59);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_60 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_60 FOR VALUES WITH (modulus 64, remainder 60);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_61 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_61 FOR VALUES WITH (modulus 64, remainder 61);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_62 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_62 FOR VALUES WITH (modulus 64, remainder 62);
+
+CREATE TABLE gitlab_partitions_static.issue_search_data_63 (
+ project_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ search_vector tsvector
+);
+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,
@@ -10335,6 +11222,30 @@ CREATE SEQUENCE abuse_reports_id_seq
ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id;
+CREATE TABLE agent_activity_events (
+ id bigint NOT NULL,
+ agent_id bigint NOT NULL,
+ user_id bigint,
+ project_id bigint,
+ merge_request_id bigint,
+ agent_token_id bigint,
+ recorded_at timestamp with time zone NOT NULL,
+ kind smallint NOT NULL,
+ level smallint NOT NULL,
+ sha bytea,
+ detail text,
+ CONSTRAINT check_068205e735 CHECK ((char_length(detail) <= 255))
+);
+
+CREATE SEQUENCE agent_activity_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE agent_activity_events_id_seq OWNED BY agent_activity_events.id;
+
CREATE TABLE agent_group_authorizations (
id bigint NOT NULL,
group_id bigint NOT NULL,
@@ -10351,6 +11262,22 @@ CREATE SEQUENCE agent_group_authorizations_id_seq
ALTER SEQUENCE agent_group_authorizations_id_seq OWNED BY agent_group_authorizations.id;
+CREATE TABLE agent_project_authorizations (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ agent_id bigint NOT NULL,
+ config jsonb NOT NULL
+);
+
+CREATE SEQUENCE agent_project_authorizations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE agent_project_authorizations_id_seq OWNED BY agent_project_authorizations.id;
+
CREATE TABLE alert_management_alert_assignees (
id bigint NOT NULL,
user_id bigint NOT NULL,
@@ -10589,7 +11516,6 @@ ALTER SEQUENCE analytics_devops_adoption_segments_id_seq OWNED BY analytics_devo
CREATE TABLE analytics_devops_adoption_snapshots (
id bigint NOT NULL,
- segment_id bigint,
recorded_at timestamp with time zone NOT NULL,
issue_opened boolean NOT NULL,
merge_request_opened boolean NOT NULL,
@@ -10976,7 +11902,7 @@ CREATE TABLE application_settings (
secret_detection_revocation_token_types_url text,
encrypted_cloud_license_auth_token text,
encrypted_cloud_license_auth_token_iv text,
- personal_access_token_prefix text,
+ personal_access_token_prefix text DEFAULT 'glpat-'::text,
kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL,
disable_feed_token boolean DEFAULT false NOT NULL,
container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 NOT NULL,
@@ -11032,13 +11958,47 @@ CREATE TABLE application_settings (
throttle_unauthenticated_api_enabled boolean DEFAULT false NOT NULL,
throttle_unauthenticated_api_requests_per_period integer DEFAULT 3600 NOT NULL,
throttle_unauthenticated_api_period_in_seconds integer DEFAULT 3600 NOT NULL,
+ throttle_authenticated_git_lfs_requests_per_period integer DEFAULT 1000 NOT NULL,
+ throttle_authenticated_git_lfs_period_in_seconds integer DEFAULT 60 NOT NULL,
+ throttle_authenticated_git_lfs_enabled boolean DEFAULT false NOT NULL,
+ jobs_per_stage_page_size integer DEFAULT 200 NOT NULL,
+ sidekiq_job_limiter_mode smallint DEFAULT 1 NOT NULL,
+ sidekiq_job_limiter_compression_threshold_bytes integer DEFAULT 100000 NOT NULL,
+ sidekiq_job_limiter_limit_bytes integer DEFAULT 0 NOT NULL,
+ dependency_proxy_ttl_group_policy_worker_capacity smallint DEFAULT 2 NOT NULL,
+ throttle_unauthenticated_deprecated_api_requests_per_period integer DEFAULT 1800 NOT NULL,
+ throttle_unauthenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL,
+ throttle_unauthenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL,
+ throttle_authenticated_deprecated_api_requests_per_period integer DEFAULT 3600 NOT NULL,
+ throttle_authenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL,
+ throttle_authenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL,
+ suggest_pipeline_enabled boolean DEFAULT true NOT NULL,
+ content_validation_endpoint_url text,
+ encrypted_content_validation_api_key bytea,
+ encrypted_content_validation_api_key_iv bytea,
+ content_validation_endpoint_enabled boolean DEFAULT false NOT NULL,
+ sentry_enabled boolean DEFAULT false NOT NULL,
+ sentry_dsn text,
+ sentry_clientside_dsn text,
+ sentry_environment text,
+ max_ssh_key_lifetime integer,
+ static_objects_external_storage_auth_token_encrypted text,
+ future_subscriptions jsonb DEFAULT '[]'::jsonb 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_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_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)),
+ CONSTRAINT check_32710817e9 CHECK ((char_length(static_objects_external_storage_auth_token_encrypted) <= 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)),
CONSTRAINT check_57123c9593 CHECK ((char_length(help_page_documentation_base_url) <= 255)),
+ CONSTRAINT check_5a84c3ffdc CHECK ((char_length(content_validation_endpoint_url) <= 255)),
+ CONSTRAINT check_5bcba483c4 CHECK ((char_length(sentry_environment) <= 255)),
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)),
@@ -11053,6 +12013,14 @@ CREATE TABLE application_settings (
CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255))
);
+COMMENT ON COLUMN application_settings.content_validation_endpoint_url IS 'JiHu-specific column';
+
+COMMENT ON COLUMN application_settings.encrypted_content_validation_api_key IS 'JiHu-specific column';
+
+COMMENT ON COLUMN application_settings.encrypted_content_validation_api_key_iv IS 'JiHu-specific column';
+
+COMMENT ON COLUMN application_settings.content_validation_endpoint_enabled IS 'JiHu-specific column';
+
CREATE SEQUENCE application_settings_id_seq
AS integer
START WITH 1
@@ -11089,6 +12057,7 @@ CREATE TABLE approval_merge_request_rules (
report_type smallint,
section text,
modified_from_project_rule boolean DEFAULT false NOT NULL,
+ orchestration_policy_idx smallint,
CONSTRAINT check_6fca5928b2 CHECK ((char_length(section) <= 255))
);
@@ -11156,7 +12125,10 @@ CREATE TABLE approval_project_rules (
rule_type smallint DEFAULT 0 NOT NULL,
scanners text[],
vulnerabilities_allowed smallint DEFAULT 0 NOT NULL,
- severity_levels text[] DEFAULT '{}'::text[] NOT NULL
+ severity_levels text[] DEFAULT '{}'::text[] NOT NULL,
+ report_type smallint,
+ vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL,
+ orchestration_policy_idx smallint
);
CREATE TABLE approval_project_rules_groups (
@@ -11871,7 +12843,9 @@ CREATE TABLE bulk_imports (
source_type smallint NOT NULL,
status smallint NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
+ updated_at timestamp with time zone NOT NULL,
+ source_version text,
+ CONSTRAINT check_ea4e58775a CHECK ((char_length(source_version) <= 63))
);
CREATE SEQUENCE bulk_imports_id_seq
@@ -11927,7 +12901,6 @@ ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id;
CREATE TABLE ci_build_needs (
id integer NOT NULL,
- build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
name text NOT NULL,
artifacts boolean DEFAULT true NOT NULL,
optional boolean DEFAULT false NOT NULL,
@@ -11981,7 +12954,6 @@ ALTER SEQUENCE ci_build_report_results_build_id_seq OWNED BY ci_build_report_res
CREATE TABLE ci_build_trace_chunks (
id bigint NOT NULL,
- build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
chunk_index integer NOT NULL,
data_store integer NOT NULL,
raw_data bytea,
@@ -12010,7 +12982,6 @@ CREATE TABLE ci_build_trace_metadata (
);
CREATE TABLE ci_builds (
- id integer NOT NULL,
status character varying,
finished_at timestamp without time zone,
trace text,
@@ -12045,7 +13016,6 @@ CREATE TABLE ci_builds (
coverage_regex character varying,
auto_canceled_by_id integer,
retried boolean,
- stage_id_convert_to_bigint integer,
protected boolean,
failure_reason integer,
scheduled_at timestamp with time zone,
@@ -12055,7 +13025,7 @@ CREATE TABLE ci_builds (
resource_group_id bigint,
waiting_for_resource_at timestamp with time zone,
scheduling_type smallint,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ id bigint NOT NULL,
stage_id bigint
);
@@ -12070,8 +13040,6 @@ CREATE SEQUENCE ci_builds_id_seq
ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id;
CREATE TABLE ci_builds_metadata (
- id_convert_to_bigint integer DEFAULT 0 NOT NULL,
- build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
timeout integer,
timeout_source integer DEFAULT 1 NOT NULL,
@@ -12083,7 +13051,8 @@ CREATE TABLE ci_builds_metadata (
expanded_environment_name character varying(255),
secrets jsonb DEFAULT '{}'::jsonb NOT NULL,
build_id bigint NOT NULL,
- id bigint NOT NULL
+ id bigint NOT NULL,
+ runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE SEQUENCE ci_builds_metadata_id_seq
@@ -12223,10 +13192,29 @@ CREATE SEQUENCE ci_instance_variables_id_seq
ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id;
+CREATE TABLE ci_job_artifact_states (
+ verification_started_at timestamp with time zone,
+ verification_retry_at timestamp with time zone,
+ verified_at timestamp with time zone,
+ job_artifact_id bigint NOT NULL,
+ verification_state smallint DEFAULT 0 NOT NULL,
+ verification_retry_count smallint,
+ verification_checksum bytea,
+ verification_failure text,
+ CONSTRAINT check_df832b66ea CHECK ((char_length(verification_failure) <= 255))
+);
+
+CREATE SEQUENCE ci_job_artifact_states_job_artifact_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_job_artifact_states_job_artifact_id_seq OWNED BY ci_job_artifact_states.job_artifact_id;
+
CREATE TABLE ci_job_artifacts (
- id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
- job_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_type integer NOT NULL,
size bigint,
created_at timestamp with time zone NOT NULL,
@@ -12240,7 +13228,9 @@ CREATE TABLE ci_job_artifacts (
id bigint NOT NULL,
job_id bigint NOT NULL,
locked smallint DEFAULT 2,
- CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL))
+ original_filename text,
+ CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)),
+ CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512))
);
CREATE SEQUENCE ci_job_artifacts_id_seq
@@ -12297,7 +13287,7 @@ CREATE TABLE ci_minutes_additional_packs (
expires_at date,
number_of_minutes integer NOT NULL,
purchase_xid text,
- CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32))
+ CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 50))
);
CREATE SEQUENCE ci_minutes_additional_packs_id_seq
@@ -12309,6 +13299,21 @@ CREATE SEQUENCE ci_minutes_additional_packs_id_seq
ALTER SEQUENCE ci_minutes_additional_packs_id_seq OWNED BY ci_minutes_additional_packs.id;
+CREATE TABLE ci_namespace_mirrors (
+ id bigint NOT NULL,
+ namespace_id integer NOT NULL,
+ traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL
+);
+
+CREATE SEQUENCE ci_namespace_mirrors_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_namespace_mirrors_id_seq OWNED BY ci_namespace_mirrors.id;
+
CREATE TABLE ci_namespace_monthly_usages (
id bigint NOT NULL,
namespace_id bigint NOT NULL,
@@ -12316,6 +13321,8 @@ CREATE TABLE ci_namespace_monthly_usages (
additional_amount_available integer DEFAULT 0 NOT NULL,
amount_used numeric(18,2) DEFAULT 0.0 NOT NULL,
notification_level smallint DEFAULT 100 NOT NULL,
+ shared_runners_duration integer DEFAULT 0 NOT NULL,
+ created_at timestamp with time zone,
CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
);
@@ -12337,7 +13344,8 @@ CREATE TABLE ci_pending_builds (
instance_runners_enabled boolean DEFAULT false NOT NULL,
namespace_id bigint,
minutes_exceeded boolean DEFAULT false NOT NULL,
- tag_ids integer[] DEFAULT '{}'::integer[]
+ tag_ids integer[] DEFAULT '{}'::integer[],
+ namespace_traversal_ids integer[] DEFAULT '{}'::integer[]
);
CREATE SEQUENCE ci_pending_builds_id_seq
@@ -12557,11 +13565,28 @@ CREATE SEQUENCE ci_platform_metrics_id_seq
ALTER SEQUENCE ci_platform_metrics_id_seq OWNED BY ci_platform_metrics.id;
+CREATE TABLE ci_project_mirrors (
+ id bigint NOT NULL,
+ project_id integer NOT NULL,
+ namespace_id integer NOT NULL
+);
+
+CREATE SEQUENCE ci_project_mirrors_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_project_mirrors_id_seq OWNED BY ci_project_mirrors.id;
+
CREATE TABLE ci_project_monthly_usages (
id bigint NOT NULL,
project_id bigint NOT NULL,
date date NOT NULL,
amount_used numeric(18,2) DEFAULT 0.0 NOT NULL,
+ shared_runners_duration integer DEFAULT 0 NOT NULL,
+ created_at timestamp with time zone,
CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
);
@@ -12596,7 +13621,8 @@ CREATE TABLE ci_resource_groups (
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
project_id bigint NOT NULL,
- key character varying(255) NOT NULL
+ key character varying(255) NOT NULL,
+ process_mode smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE ci_resource_groups_id_seq
@@ -12717,7 +13743,6 @@ CREATE TABLE ci_sources_pipelines (
project_id integer,
pipeline_id integer,
source_project_id integer,
- source_job_id_convert_to_bigint integer,
source_pipeline_id integer,
source_job_id bigint
);
@@ -12748,7 +13773,6 @@ CREATE SEQUENCE ci_sources_projects_id_seq
ALTER SEQUENCE ci_sources_projects_id_seq OWNED BY ci_sources_projects.id;
CREATE TABLE ci_stages (
- id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
pipeline_id integer,
created_at timestamp without time zone,
@@ -13311,7 +14335,8 @@ CREATE TABLE clusters_integration_prometheus (
cluster_id bigint NOT NULL,
enabled boolean DEFAULT false NOT NULL,
encrypted_alert_manager_token text,
- encrypted_alert_manager_token_iv text
+ encrypted_alert_manager_token_iv text,
+ health_status smallint DEFAULT 0 NOT NULL
);
CREATE TABLE clusters_kubernetes_namespaces (
@@ -13415,6 +14440,29 @@ CREATE SEQUENCE container_repositories_id_seq
ALTER SEQUENCE container_repositories_id_seq OWNED BY container_repositories.id;
+CREATE TABLE content_blocked_states (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ commit_sha bytea NOT NULL,
+ blob_sha bytea NOT NULL,
+ path text NOT NULL,
+ container_identifier text NOT NULL,
+ CONSTRAINT check_023093d38f CHECK ((char_length(container_identifier) <= 255)),
+ CONSTRAINT check_1870100678 CHECK ((char_length(path) <= 2048))
+);
+
+COMMENT ON TABLE content_blocked_states IS 'JiHu-specific table';
+
+CREATE SEQUENCE content_blocked_states_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE content_blocked_states_id_seq OWNED BY content_blocked_states.id;
+
CREATE TABLE conversational_development_index_metrics (
id integer NOT NULL,
leader_issues double precision NOT NULL,
@@ -13461,6 +14509,25 @@ CREATE SEQUENCE conversational_development_index_metrics_id_seq
ALTER SEQUENCE conversational_development_index_metrics_id_seq OWNED BY conversational_development_index_metrics.id;
+CREATE TABLE coverage_fuzzing_corpuses (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ user_id bigint,
+ package_id bigint NOT NULL,
+ file_updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE coverage_fuzzing_corpuses_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE coverage_fuzzing_corpuses_id_seq OWNED BY coverage_fuzzing_corpuses.id;
+
CREATE TABLE csv_issue_imports (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -13777,33 +14844,6 @@ CREATE SEQUENCE dast_sites_id_seq
ALTER SEQUENCE dast_sites_id_seq OWNED BY dast_sites.id;
-CREATE TABLE dep_ci_build_trace_section_names (
- id integer NOT NULL,
- project_id integer NOT NULL,
- name character varying NOT NULL
-);
-
-CREATE SEQUENCE dep_ci_build_trace_section_names_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE dep_ci_build_trace_section_names_id_seq OWNED BY dep_ci_build_trace_section_names.id;
-
-CREATE TABLE dep_ci_build_trace_sections (
- project_id integer NOT NULL,
- date_start timestamp with time zone NOT NULL,
- date_end timestamp with time zone NOT NULL,
- byte_start bigint NOT NULL,
- byte_end bigint NOT NULL,
- build_id integer NOT NULL,
- section_name_id integer NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
-);
-
CREATE TABLE dependency_proxy_blobs (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -13812,7 +14852,9 @@ CREATE TABLE dependency_proxy_blobs (
file_store integer,
group_id integer NOT NULL,
size bigint,
- updated_at timestamp with time zone NOT NULL
+ updated_at timestamp with time zone NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ read_at timestamp with time zone DEFAULT now() NOT NULL
);
CREATE SEQUENCE dependency_proxy_blobs_id_seq
@@ -13862,6 +14904,8 @@ CREATE TABLE dependency_proxy_manifests (
file text NOT NULL,
digest text NOT NULL,
content_type text,
+ status smallint DEFAULT 0 NOT NULL,
+ read_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_079b293a7b CHECK ((char_length(file) <= 255)),
CONSTRAINT check_167a9a8a91 CHECK ((char_length(content_type) <= 255)),
CONSTRAINT check_c579e3f586 CHECK ((char_length(file_name) <= 255)),
@@ -13923,6 +14967,24 @@ CREATE SEQUENCE deploy_tokens_id_seq
ALTER SEQUENCE deploy_tokens_id_seq OWNED BY deploy_tokens.id;
+CREATE TABLE deployment_approvals (
+ id bigint NOT NULL,
+ deployment_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,
+ status smallint NOT NULL
+);
+
+CREATE SEQUENCE deployment_approvals_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE deployment_approvals_id_seq OWNED BY deployment_approvals.id;
+
CREATE TABLE deployment_clusters (
deployment_id integer NOT NULL,
cluster_id integer NOT NULL,
@@ -13944,7 +15006,6 @@ CREATE TABLE deployments (
tag boolean NOT NULL,
sha character varying NOT NULL,
user_id integer,
- deployable_id_convert_to_bigint integer,
deployable_type character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@@ -13952,7 +15013,8 @@ CREATE TABLE deployments (
finished_at timestamp with time zone,
status smallint NOT NULL,
cluster_id integer,
- deployable_id bigint
+ deployable_id bigint,
+ archived boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE deployments_id_seq
@@ -14128,7 +15190,9 @@ CREATE TABLE draft_notes (
"position" text,
original_position text,
change_position text,
- commit_id bytea
+ commit_id bytea,
+ line_code text,
+ CONSTRAINT check_c497a94a0e CHECK ((char_length(line_code) <= 255))
);
CREATE SEQUENCE draft_notes_id_seq
@@ -14372,7 +15436,9 @@ CREATE TABLE epics (
state_id smallint DEFAULT 1,
external_key character varying(255),
confidential boolean DEFAULT false NOT NULL,
- CONSTRAINT check_57ee003890 CHECK ((state_id IS NOT NULL))
+ color text DEFAULT '#1068bf'::text,
+ CONSTRAINT check_57ee003890 CHECK ((state_id IS NOT NULL)),
+ CONSTRAINT check_ca608c40b3 CHECK ((char_length(color) <= 7))
);
CREATE SEQUENCE epics_id_seq
@@ -14457,7 +15523,6 @@ CREATE SEQUENCE error_tracking_errors_id_seq
ALTER SEQUENCE error_tracking_errors_id_seq OWNED BY error_tracking_errors.id;
CREATE TABLE events (
- id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
author_id integer NOT NULL,
target_id integer,
@@ -14759,7 +15824,6 @@ CREATE TABLE geo_event_log (
hashed_storage_migrated_event_id bigint,
lfs_object_deleted_event_id bigint,
hashed_storage_attachments_event_id bigint,
- upload_deleted_event_id bigint,
job_artifact_deleted_event_id bigint,
reset_checksum_event_id bigint,
cache_invalidation_event_id bigint,
@@ -14834,7 +15898,6 @@ ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_sto
CREATE TABLE geo_job_artifact_deleted_events (
id bigint NOT NULL,
- job_artifact_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_path character varying NOT NULL,
job_artifact_id bigint NOT NULL
);
@@ -14891,9 +15954,6 @@ CREATE TABLE geo_node_statuses (
lfs_objects_count integer,
lfs_objects_synced_count integer,
lfs_objects_failed_count integer,
- attachments_count integer,
- attachments_synced_count integer,
- attachments_failed_count integer,
last_event_id integer,
last_event_date timestamp without time zone,
cursor_last_event_id integer,
@@ -14918,7 +15978,6 @@ CREATE TABLE geo_node_statuses (
wikis_verification_failed_count integer,
lfs_objects_synced_missing_on_primary_count integer,
job_artifacts_synced_missing_on_primary_count integer,
- attachments_synced_missing_on_primary_count integer,
repositories_checksummed_count integer,
repositories_checksum_failed_count integer,
repositories_checksum_mismatch_count integer,
@@ -15089,24 +16148,6 @@ CREATE SEQUENCE geo_reset_checksum_events_id_seq
ALTER SEQUENCE geo_reset_checksum_events_id_seq OWNED BY geo_reset_checksum_events.id;
-CREATE TABLE geo_upload_deleted_events (
- id bigint NOT NULL,
- upload_id integer NOT NULL,
- file_path character varying NOT NULL,
- model_id integer NOT NULL,
- model_type character varying NOT NULL,
- uploader character varying NOT NULL
-);
-
-CREATE SEQUENCE geo_upload_deleted_events_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE geo_upload_deleted_events_id_seq OWNED BY geo_upload_deleted_events.id;
-
CREATE TABLE gitlab_subscription_histories (
id bigint NOT NULL,
gitlab_subscription_created_at timestamp with time zone,
@@ -15654,6 +16695,35 @@ CREATE SEQUENCE incident_management_oncall_shifts_id_seq
ALTER SEQUENCE incident_management_oncall_shifts_id_seq OWNED BY incident_management_oncall_shifts.id;
+CREATE TABLE incident_management_timeline_events (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ occurred_at timestamp with time zone NOT NULL,
+ project_id bigint NOT NULL,
+ author_id bigint,
+ issue_id bigint NOT NULL,
+ updated_by_user_id bigint,
+ promoted_from_note_id bigint,
+ cached_markdown_version integer,
+ editable boolean DEFAULT false NOT NULL,
+ note text NOT NULL,
+ note_html text NOT NULL,
+ action text NOT NULL,
+ CONSTRAINT check_18fd072206 CHECK ((char_length(action) <= 128)),
+ CONSTRAINT check_3875ed0aac CHECK ((char_length(note) <= 10000)),
+ CONSTRAINT check_94a235d6a4 CHECK ((char_length(note_html) <= 10000))
+);
+
+CREATE SEQUENCE incident_management_timeline_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_timeline_events_id_seq OWNED BY incident_management_timeline_events.id;
+
CREATE TABLE index_statuses (
id integer NOT NULL,
project_id integer NOT NULL,
@@ -15722,6 +16792,7 @@ CREATE TABLE integrations (
group_id bigint,
vulnerability_events boolean DEFAULT false NOT NULL,
type_new text,
+ archive_trace_events boolean DEFAULT false NOT NULL,
CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255))
);
@@ -15825,6 +16896,23 @@ CREATE TABLE issue_assignees (
issue_id integer NOT NULL
);
+CREATE TABLE issue_customer_relations_contacts (
+ id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ contact_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE issue_customer_relations_contacts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE issue_customer_relations_contacts_id_seq OWNED BY issue_customer_relations_contacts.id;
+
CREATE TABLE issue_email_participants (
id bigint NOT NULL,
issue_id bigint NOT NULL,
@@ -15843,6 +16931,22 @@ CREATE SEQUENCE issue_email_participants_id_seq
ALTER SEQUENCE issue_email_participants_id_seq OWNED BY issue_email_participants.id;
+CREATE TABLE issue_emails (
+ id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ email_message_id text NOT NULL,
+ CONSTRAINT check_5abf3e6aea CHECK ((char_length(email_message_id) <= 1000))
+);
+
+CREATE SEQUENCE issue_emails_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE issue_emails_id_seq OWNED BY issue_emails.id;
+
CREATE TABLE issue_links (
id integer NOT NULL,
source_id integer NOT NULL,
@@ -15990,7 +17094,7 @@ CREATE TABLE iterations_cadences (
group_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- start_date date NOT NULL,
+ start_date date,
last_run_date date,
duration_in_weeks integer,
iterations_in_advance integer,
@@ -16240,6 +17344,27 @@ CREATE SEQUENCE lfs_file_locks_id_seq
ALTER SEQUENCE lfs_file_locks_id_seq OWNED BY lfs_file_locks.id;
+CREATE TABLE lfs_object_states (
+ verification_started_at timestamp with time zone,
+ verification_retry_at timestamp with time zone,
+ verified_at timestamp with time zone,
+ lfs_object_id bigint NOT NULL,
+ verification_state smallint DEFAULT 0 NOT NULL,
+ verification_retry_count smallint,
+ verification_checksum bytea,
+ verification_failure text,
+ CONSTRAINT check_efe45a8ab3 CHECK ((char_length(verification_failure) <= 255))
+);
+
+CREATE SEQUENCE lfs_object_states_lfs_object_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE lfs_object_states_lfs_object_id_seq OWNED BY lfs_object_states.lfs_object_id;
+
CREATE TABLE lfs_objects (
id integer NOT NULL,
oid character varying NOT NULL,
@@ -16343,6 +17468,24 @@ CREATE SEQUENCE lists_id_seq
ALTER SEQUENCE lists_id_seq OWNED BY lists.id;
+CREATE TABLE member_tasks (
+ id bigint NOT NULL,
+ member_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,
+ tasks smallint[] DEFAULT '{}'::smallint[] NOT NULL
+);
+
+CREATE SEQUENCE member_tasks_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE member_tasks_id_seq OWNED BY member_tasks.id;
+
CREATE TABLE members (
id integer NOT NULL,
access_level integer NOT NULL,
@@ -16361,7 +17504,8 @@ CREATE TABLE members (
expires_at date,
ldap boolean DEFAULT false NOT NULL,
override boolean DEFAULT false NOT NULL,
- invite_email_success boolean DEFAULT true NOT NULL
+ invite_email_success boolean DEFAULT true NOT NULL,
+ state smallint DEFAULT 0
);
CREATE SEQUENCE members_id_seq
@@ -16378,7 +17522,8 @@ CREATE TABLE merge_request_assignees (
id integer NOT NULL,
user_id integer NOT NULL,
merge_request_id integer NOT NULL,
- created_at timestamp with time zone
+ created_at timestamp with time zone,
+ state smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE merge_request_assignees_id_seq
@@ -16491,10 +17636,6 @@ CREATE TABLE merge_request_diff_commits (
merge_request_diff_id integer NOT NULL,
relative_order integer NOT NULL,
sha bytea NOT NULL,
- author_name text,
- author_email text,
- committer_name text,
- committer_email text,
message text,
trailers jsonb DEFAULT '{}'::jsonb NOT NULL,
commit_author_id bigint,
@@ -16704,6 +17845,22 @@ CREATE SEQUENCE merge_requests_closing_issues_id_seq
ALTER SEQUENCE merge_requests_closing_issues_id_seq OWNED BY merge_requests_closing_issues.id;
+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
+);
+
+CREATE SEQUENCE merge_requests_compliance_violations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE merge_requests_compliance_violations_id_seq OWNED BY merge_requests_compliance_violations.id;
+
CREATE SEQUENCE merge_requests_id_seq
AS integer
START WITH 1
@@ -16925,7 +18082,7 @@ CREATE TABLE namespaces (
owner_id integer,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- type character varying,
+ type character varying DEFAULT 'User'::character varying NOT NULL,
description character varying DEFAULT ''::character varying NOT NULL,
avatar character varying,
share_with_group_lock boolean DEFAULT false,
@@ -16967,7 +18124,7 @@ CREATE TABLE namespaces (
shared_runners_enabled boolean DEFAULT true NOT NULL,
allow_descendants_override_disabled_shared_runners boolean DEFAULT false NOT NULL,
traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL,
- delayed_project_removal boolean DEFAULT false NOT NULL
+ tmp_project_id integer
);
CREATE SEQUENCE namespaces_id_seq
@@ -16980,6 +18137,20 @@ CREATE SEQUENCE namespaces_id_seq
ALTER SEQUENCE namespaces_id_seq OWNED BY namespaces.id;
+CREATE TABLE namespaces_sync_events (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL
+);
+
+CREATE SEQUENCE namespaces_sync_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+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 integer NOT NULL,
@@ -17144,7 +18315,8 @@ CREATE TABLE oauth_applications (
owner_id integer,
owner_type character varying,
trusted boolean DEFAULT false NOT NULL,
- confidential boolean DEFAULT true NOT NULL
+ confidential boolean DEFAULT true NOT NULL,
+ expire_access_tokens boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE oauth_applications_id_seq
@@ -17204,30 +18376,6 @@ CREATE SEQUENCE onboarding_progresses_id_seq
ALTER SEQUENCE onboarding_progresses_id_seq OWNED BY onboarding_progresses.id;
-CREATE TABLE open_project_tracker_data (
- id bigint NOT NULL,
- service_id integer NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- encrypted_url character varying(255),
- encrypted_url_iv character varying(255),
- encrypted_api_url character varying(255),
- encrypted_api_url_iv character varying(255),
- encrypted_token character varying(255),
- encrypted_token_iv character varying(255),
- closed_status_id character varying(5),
- project_identifier_code character varying(100)
-);
-
-CREATE SEQUENCE open_project_tracker_data_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE open_project_tracker_data_id_seq OWNED BY open_project_tracker_data.id;
-
CREATE TABLE operations_feature_flag_scopes (
id bigint NOT NULL,
feature_flag_id bigint NOT NULL,
@@ -17777,7 +18925,7 @@ CREATE TABLE packages_helm_file_metadata (
package_file_id bigint NOT NULL,
channel text NOT NULL,
metadata jsonb,
- CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63))
+ CONSTRAINT check_06e8d100af CHECK ((char_length(channel) <= 255))
);
CREATE TABLE packages_maven_metadata (
@@ -17800,6 +18948,12 @@ CREATE SEQUENCE packages_maven_metadata_id_seq
ALTER SEQUENCE packages_maven_metadata_id_seq OWNED BY packages_maven_metadata.id;
+CREATE TABLE packages_npm_metadata (
+ package_id bigint NOT NULL,
+ package_json jsonb DEFAULT '{}'::jsonb NOT NULL,
+ CONSTRAINT chk_rails_e5cbc301ae CHECK ((char_length((package_json)::text) < 20000))
+);
+
CREATE TABLE packages_nuget_dependency_link_metadata (
dependency_link_id bigint NOT NULL,
target_framework text NOT NULL,
@@ -17959,6 +19113,27 @@ CREATE SEQUENCE packages_tags_id_seq
ALTER SEQUENCE packages_tags_id_seq OWNED BY packages_tags.id;
+CREATE TABLE pages_deployment_states (
+ pages_deployment_id bigint NOT NULL,
+ verification_state smallint DEFAULT 0 NOT NULL,
+ verification_started_at timestamp with time zone,
+ verification_retry_at timestamp with time zone,
+ verified_at timestamp with time zone,
+ verification_retry_count smallint,
+ verification_checksum bytea,
+ verification_failure text,
+ CONSTRAINT check_15217e8c3a CHECK ((char_length(verification_failure) <= 255))
+);
+
+CREATE SEQUENCE pages_deployment_states_pages_deployment_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE pages_deployment_states_pages_deployment_id_seq OWNED BY pages_deployment_states.pages_deployment_id;
+
CREATE TABLE pages_deployments (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -18169,7 +19344,12 @@ CREATE TABLE plan_limits (
pages_file_entries integer DEFAULT 200000 NOT NULL,
ci_max_artifact_size_running_container_scanning integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_cluster_image_scanning integer DEFAULT 0 NOT NULL,
- ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL
+ ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL,
+ dast_profile_schedules integer DEFAULT 1 NOT NULL,
+ 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
);
CREATE SEQUENCE plan_limits_id_seq
@@ -18379,7 +19559,7 @@ CREATE VIEW postgres_indexes AS
FROM ((((pg_index
JOIN pg_class i ON ((i.oid = pg_index.indexrelid)))
JOIN pg_namespace ON ((i.relnamespace = pg_namespace.oid)))
- JOIN pg_indexes ON ((i.relname = pg_indexes.indexname)))
+ JOIN pg_indexes ON (((i.relname = pg_indexes.indexname) AND (pg_namespace.nspname = pg_indexes.schemaname))))
JOIN pg_am a ON ((i.relam = a.oid)))
WHERE ((pg_namespace.nspname <> 'pg_catalog'::name) AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));
@@ -18446,6 +19626,24 @@ CREATE SEQUENCE postgres_reindex_actions_id_seq
ALTER SEQUENCE postgres_reindex_actions_id_seq OWNED BY postgres_reindex_actions.id;
+CREATE TABLE postgres_reindex_queued_actions (
+ id bigint NOT NULL,
+ index_identifier text NOT NULL,
+ state smallint DEFAULT 0 NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT check_e4b01395c0 CHECK ((char_length(index_identifier) <= 255))
+);
+
+CREATE SEQUENCE postgres_reindex_queued_actions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE postgres_reindex_queued_actions_id_seq OWNED BY postgres_reindex_queued_actions.id;
+
CREATE TABLE programming_languages (
id integer NOT NULL,
name character varying NOT NULL,
@@ -18527,7 +19725,7 @@ 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 true NOT NULL
+ job_token_scope_enabled boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -18631,7 +19829,7 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token_iv character varying,
project_name character varying,
organization_name character varying,
- integrated boolean DEFAULT false NOT NULL
+ integrated boolean DEFAULT true NOT NULL
);
CREATE TABLE project_export_jobs (
@@ -18876,7 +20074,13 @@ CREATE TABLE project_settings (
prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
mr_default_target_self boolean DEFAULT false NOT NULL,
previous_default_branch text,
- CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096))
+ warn_about_potentially_unwanted_characters boolean DEFAULT true NOT NULL,
+ merge_commit_template text,
+ has_shimo boolean DEFAULT false NOT NULL,
+ squash_commit_template text,
+ 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))
);
CREATE TABLE project_statistics (
@@ -18969,7 +20173,6 @@ CREATE TABLE projects (
public_builds boolean DEFAULT true NOT NULL,
last_repository_check_failed boolean,
last_repository_check_at timestamp without time zone,
- container_registry_enabled boolean,
only_allow_merge_if_pipeline_succeeds boolean DEFAULT false NOT NULL,
has_external_issue_tracker boolean,
repository_storage character varying DEFAULT 'default'::character varying NOT NULL,
@@ -19037,6 +20240,20 @@ CREATE SEQUENCE projects_id_seq
ALTER SEQUENCE projects_id_seq OWNED BY projects.id;
+CREATE TABLE projects_sync_events (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL
+);
+
+CREATE SEQUENCE projects_sync_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE projects_sync_events_id_seq OWNED BY projects_sync_events.id;
+
CREATE TABLE prometheus_alert_events (
id bigint NOT NULL,
project_id integer NOT NULL,
@@ -19212,6 +20429,7 @@ CREATE TABLE protected_environments (
updated_at timestamp with time zone NOT NULL,
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)))
);
@@ -19265,7 +20483,6 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id;
CREATE TABLE push_event_payloads (
commit_count bigint NOT NULL,
- event_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
action smallint NOT NULL,
ref_type smallint NOT NULL,
commit_from bytea,
@@ -19477,8 +20694,7 @@ CREATE TABLE requirements_management_test_reports (
author_id bigint,
state smallint NOT NULL,
build_id bigint,
- issue_id bigint,
- CONSTRAINT requirements_test_reports_requirement_id_xor_issue_id CHECK ((num_nonnulls(requirement_id, issue_id) = 1))
+ issue_id bigint
);
CREATE SEQUENCE requirements_management_test_reports_id_seq
@@ -19785,7 +21001,9 @@ CREATE TABLE security_scans (
scan_type smallint NOT NULL,
info jsonb DEFAULT '{}'::jsonb NOT NULL,
project_id bigint,
- pipeline_id bigint
+ pipeline_id bigint,
+ latest boolean DEFAULT true NOT NULL,
+ status smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE security_scans_id_seq
@@ -20098,6 +21316,7 @@ CREATE TABLE sprints (
description_html text,
state_enum smallint DEFAULT 1 NOT NULL,
iterations_cadence_id integer,
+ sequence integer,
CONSTRAINT sprints_must_belong_to_project_or_group CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))),
CONSTRAINT sprints_title CHECK ((char_length(title) <= 255))
);
@@ -20231,9 +21450,7 @@ CREATE SEQUENCE system_note_metadata_id_seq
ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id;
CREATE TABLE taggings (
- id_convert_to_bigint integer DEFAULT 0 NOT NULL,
tag_id integer,
- taggable_id_convert_to_bigint integer,
taggable_type character varying,
tagger_id integer,
tagger_type character varying,
@@ -20415,6 +21632,11 @@ CREATE TABLE topics (
name text NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
+ avatar text,
+ description text,
+ total_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))
);
@@ -20482,6 +21704,27 @@ CREATE SEQUENCE upcoming_reconciliations_id_seq
ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id;
+CREATE TABLE upload_states (
+ verification_started_at timestamp with time zone,
+ verification_retry_at timestamp with time zone,
+ verified_at timestamp with time zone,
+ upload_id bigint NOT NULL,
+ verification_state smallint DEFAULT 0 NOT NULL,
+ verification_retry_count smallint,
+ verification_checksum bytea,
+ verification_failure text,
+ CONSTRAINT check_7396dc8591 CHECK ((char_length(verification_failure) <= 255))
+);
+
+CREATE SEQUENCE upload_states_upload_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE upload_states_upload_id_seq OWNED BY upload_states.upload_id;
+
CREATE TABLE uploads (
id integer NOT NULL,
size bigint NOT NULL,
@@ -20564,7 +21807,14 @@ ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id;
CREATE TABLE user_credit_card_validations (
user_id bigint NOT NULL,
- credit_card_validated_at timestamp with time zone NOT NULL
+ credit_card_validated_at timestamp with time zone NOT NULL,
+ expiration_date date,
+ last_digits smallint,
+ holder_name text,
+ 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))
);
CREATE TABLE user_custom_attributes (
@@ -20591,18 +21841,21 @@ CREATE TABLE user_details (
job_title character varying(200) DEFAULT ''::character varying NOT NULL,
bio character varying(255) DEFAULT ''::character varying NOT NULL,
webauthn_xid text,
- bio_html text,
- cached_markdown_version integer,
provisioned_by_group_id bigint,
other_role text,
pronouns text,
pronunciation text,
+ registration_objective smallint,
+ phone text,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
+ CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)),
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))
);
+COMMENT ON COLUMN user_details.phone IS 'JiHu-specific column';
+
CREATE SEQUENCE user_details_user_id_seq
START WITH 1
INCREMENT BY 1
@@ -20789,7 +22042,7 @@ CREATE TABLE users (
encrypted_otp_secret_salt character varying,
otp_required_for_login boolean DEFAULT false NOT NULL,
otp_backup_codes text,
- public_email character varying DEFAULT ''::character varying NOT NULL,
+ public_email character varying,
dashboard integer DEFAULT 0,
project_view integer DEFAULT 0,
consumed_timestep integer,
@@ -20825,7 +22078,9 @@ CREATE TABLE users (
first_name character varying(255),
last_name character varying(255),
role smallint,
- user_type smallint
+ user_type smallint,
+ static_object_token_encrypted text,
+ CONSTRAINT check_7bde697e8e CHECK ((char_length(static_object_token_encrypted) <= 255))
);
CREATE SEQUENCE users_id_seq
@@ -20889,7 +22144,8 @@ CREATE TABLE users_statistics (
with_highest_role_maintainer integer DEFAULT 0 NOT NULL,
with_highest_role_owner integer DEFAULT 0 NOT NULL,
bots integer DEFAULT 0 NOT NULL,
- blocked integer DEFAULT 0 NOT NULL
+ blocked integer DEFAULT 0 NOT NULL,
+ with_highest_role_minimal_access integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE users_statistics_id_seq
@@ -21155,6 +22411,7 @@ CREATE TABLE vulnerability_finding_evidences (
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))
);
@@ -21365,6 +22622,7 @@ CREATE TABLE vulnerability_occurrences (
cve text,
location jsonb,
detection_method smallint DEFAULT 0 NOT NULL,
+ migrated_to_new_structure boolean DEFAULT false NOT NULL,
CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)),
CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)),
CONSTRAINT check_df6dd20219 CHECK ((char_length(message) <= 3000)),
@@ -21380,6 +22638,30 @@ CREATE SEQUENCE vulnerability_occurrences_id_seq
ALTER SEQUENCE vulnerability_occurrences_id_seq OWNED BY vulnerability_occurrences.id;
+CREATE TABLE vulnerability_reads (
+ id bigint NOT NULL,
+ vulnerability_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ scanner_id bigint NOT NULL,
+ report_type smallint NOT NULL,
+ severity smallint NOT NULL,
+ state smallint NOT NULL,
+ has_issues boolean DEFAULT false NOT NULL,
+ 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))
+);
+
+CREATE SEQUENCE vulnerability_reads_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_reads_id_seq OWNED BY vulnerability_reads.id;
+
CREATE TABLE vulnerability_remediations (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -21698,8 +22980,12 @@ ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id;
ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass);
+ALTER TABLE ONLY agent_activity_events ALTER COLUMN id SET DEFAULT nextval('agent_activity_events_id_seq'::regclass);
+
ALTER TABLE ONLY agent_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_group_authorizations_id_seq'::regclass);
+ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_project_authorizations_id_seq'::regclass);
+
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_user_mentions ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_user_mentions_id_seq'::regclass);
@@ -21768,6 +23054,8 @@ ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('
ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass);
+ALTER TABLE ONLY batched_background_migration_job_transition_logs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass);
+
ALTER TABLE ONLY batched_background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_jobs_id_seq'::regclass);
ALTER TABLE ONLY batched_background_migrations ALTER COLUMN id SET DEFAULT nextval('batched_background_migrations_id_seq'::regclass);
@@ -21842,6 +23130,8 @@ ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_grou
ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_instance_variables_id_seq'::regclass);
+ALTER TABLE ONLY ci_job_artifact_states ALTER COLUMN job_artifact_id SET DEFAULT nextval('ci_job_artifact_states_job_artifact_id_seq'::regclass);
+
ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_artifacts_id_seq'::regclass);
ALTER TABLE ONLY ci_job_token_project_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_project_scope_links_id_seq'::regclass);
@@ -21850,6 +23140,8 @@ ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_va
ALTER TABLE ONLY ci_minutes_additional_packs ALTER COLUMN id SET DEFAULT nextval('ci_minutes_additional_packs_id_seq'::regclass);
+ALTER TABLE ONLY ci_namespace_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_namespace_mirrors_id_seq'::regclass);
+
ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass);
ALTER TABLE ONLY ci_pending_builds ALTER COLUMN id SET DEFAULT nextval('ci_pending_builds_id_seq'::regclass);
@@ -21872,6 +23164,8 @@ ALTER TABLE ONLY ci_pipelines_config ALTER COLUMN pipeline_id SET DEFAULT nextva
ALTER TABLE ONLY ci_platform_metrics ALTER COLUMN id SET DEFAULT nextval('ci_platform_metrics_id_seq'::regclass);
+ALTER TABLE ONLY ci_project_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_project_mirrors_id_seq'::regclass);
+
ALTER TABLE ONLY ci_project_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_project_monthly_usages_id_seq'::regclass);
ALTER TABLE ONLY ci_refs ALTER COLUMN id SET DEFAULT nextval('ci_refs_id_seq'::regclass);
@@ -21950,8 +23244,12 @@ ALTER TABLE ONLY compliance_management_frameworks ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('container_repositories_id_seq'::regclass);
+ALTER TABLE ONLY content_blocked_states ALTER COLUMN id SET DEFAULT nextval('content_blocked_states_id_seq'::regclass);
+
ALTER TABLE ONLY conversational_development_index_metrics ALTER COLUMN id SET DEFAULT nextval('conversational_development_index_metrics_id_seq'::regclass);
+ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER COLUMN id SET DEFAULT nextval('coverage_fuzzing_corpuses_id_seq'::regclass);
+
ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issue_imports_id_seq'::regclass);
ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass);
@@ -21976,8 +23274,6 @@ ALTER TABLE ONLY dast_site_validations ALTER COLUMN id SET DEFAULT nextval('dast
ALTER TABLE ONLY dast_sites ALTER COLUMN id SET DEFAULT nextval('dast_sites_id_seq'::regclass);
-ALTER TABLE ONLY dep_ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('dep_ci_build_trace_section_names_id_seq'::regclass);
-
ALTER TABLE ONLY dependency_proxy_blobs ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_blobs_id_seq'::regclass);
ALTER TABLE ONLY dependency_proxy_group_settings ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_group_settings_id_seq'::regclass);
@@ -21988,6 +23284,8 @@ ALTER TABLE ONLY deploy_keys_projects ALTER COLUMN id SET DEFAULT nextval('deplo
ALTER TABLE ONLY deploy_tokens ALTER COLUMN id SET DEFAULT nextval('deploy_tokens_id_seq'::regclass);
+ALTER TABLE ONLY deployment_approvals ALTER COLUMN id SET DEFAULT nextval('deployment_approvals_id_seq'::regclass);
+
ALTER TABLE ONLY deployments ALTER COLUMN id SET DEFAULT nextval('deployments_id_seq'::regclass);
ALTER TABLE ONLY description_versions ALTER COLUMN id SET DEFAULT nextval('description_versions_id_seq'::regclass);
@@ -22096,8 +23394,6 @@ ALTER TABLE ONLY geo_repository_updated_events ALTER COLUMN id SET DEFAULT nextv
ALTER TABLE ONLY geo_reset_checksum_events ALTER COLUMN id SET DEFAULT nextval('geo_reset_checksum_events_id_seq'::regclass);
-ALTER TABLE ONLY geo_upload_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_upload_deleted_events_id_seq'::regclass);
-
ALTER TABLE ONLY gitlab_subscription_histories ALTER COLUMN id SET DEFAULT nextval('gitlab_subscription_histories_id_seq'::regclass);
ALTER TABLE ONLY gitlab_subscriptions ALTER COLUMN id SET DEFAULT nextval('gitlab_subscriptions_id_seq'::regclass);
@@ -22152,6 +23448,8 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id S
ALTER TABLE ONLY incident_management_pending_issue_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_timeline_events ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_events_id_seq'::regclass);
+
ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass);
ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass);
@@ -22168,8 +23466,12 @@ ALTER TABLE ONLY issuable_severities ALTER COLUMN id SET DEFAULT nextval('issuab
ALTER TABLE ONLY issuable_slas ALTER COLUMN id SET DEFAULT nextval('issuable_slas_id_seq'::regclass);
+ALTER TABLE ONLY issue_customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('issue_customer_relations_contacts_id_seq'::regclass);
+
ALTER TABLE ONLY issue_email_participants ALTER COLUMN id SET DEFAULT nextval('issue_email_participants_id_seq'::regclass);
+ALTER TABLE ONLY issue_emails ALTER COLUMN id SET DEFAULT nextval('issue_emails_id_seq'::regclass);
+
ALTER TABLE ONLY issue_links ALTER COLUMN id SET DEFAULT nextval('issue_links_id_seq'::regclass);
ALTER TABLE ONLY issue_metrics ALTER COLUMN id SET DEFAULT nextval('issue_metrics_id_seq'::regclass);
@@ -22202,6 +23504,8 @@ ALTER TABLE ONLY ldap_group_links ALTER COLUMN id SET DEFAULT nextval('ldap_grou
ALTER TABLE ONLY lfs_file_locks ALTER COLUMN id SET DEFAULT nextval('lfs_file_locks_id_seq'::regclass);
+ALTER TABLE ONLY lfs_object_states ALTER COLUMN lfs_object_id SET DEFAULT nextval('lfs_object_states_lfs_object_id_seq'::regclass);
+
ALTER TABLE ONLY lfs_objects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_id_seq'::regclass);
ALTER TABLE ONLY lfs_objects_projects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_projects_id_seq'::regclass);
@@ -22212,6 +23516,10 @@ ALTER TABLE ONLY list_user_preferences ALTER COLUMN id SET DEFAULT nextval('list
ALTER TABLE ONLY lists ALTER COLUMN id SET DEFAULT nextval('lists_id_seq'::regclass);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER COLUMN id SET DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass);
+
+ALTER TABLE ONLY member_tasks ALTER COLUMN id SET DEFAULT nextval('member_tasks_id_seq'::regclass);
+
ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::regclass);
ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass);
@@ -22238,6 +23546,8 @@ ALTER TABLE ONLY merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_reque
ALTER TABLE ONLY merge_requests_closing_issues ALTER COLUMN id SET DEFAULT nextval('merge_requests_closing_issues_id_seq'::regclass);
+ALTER TABLE ONLY merge_requests_compliance_violations ALTER COLUMN id SET DEFAULT nextval('merge_requests_compliance_violations_id_seq'::regclass);
+
ALTER TABLE ONLY merge_trains ALTER COLUMN id SET DEFAULT nextval('merge_trains_id_seq'::regclass);
ALTER TABLE ONLY metrics_dashboard_annotations ALTER COLUMN id SET DEFAULT nextval('metrics_dashboard_annotations_id_seq'::regclass);
@@ -22256,6 +23566,8 @@ ALTER TABLE ONLY namespace_statistics ALTER COLUMN id SET DEFAULT nextval('names
ALTER TABLE ONLY namespaces ALTER COLUMN id SET DEFAULT nextval('namespaces_id_seq'::regclass);
+ALTER TABLE ONLY namespaces_sync_events ALTER COLUMN id SET DEFAULT nextval('namespaces_sync_events_id_seq'::regclass);
+
ALTER TABLE ONLY note_diff_files ALTER COLUMN id SET DEFAULT nextval('note_diff_files_id_seq'::regclass);
ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass);
@@ -22272,8 +23584,6 @@ ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oaut
ALTER TABLE ONLY onboarding_progresses ALTER COLUMN id SET DEFAULT nextval('onboarding_progresses_id_seq'::regclass);
-ALTER TABLE ONLY open_project_tracker_data ALTER COLUMN id SET DEFAULT nextval('open_project_tracker_data_id_seq'::regclass);
-
ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass);
ALTER TABLE ONLY operations_feature_flags ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_id_seq'::regclass);
@@ -22336,6 +23646,8 @@ ALTER TABLE ONLY packages_packages ALTER COLUMN id SET DEFAULT nextval('packages
ALTER TABLE ONLY packages_tags ALTER COLUMN id SET DEFAULT nextval('packages_tags_id_seq'::regclass);
+ALTER TABLE ONLY pages_deployment_states ALTER COLUMN pages_deployment_id SET DEFAULT nextval('pages_deployment_states_pages_deployment_id_seq'::regclass);
+
ALTER TABLE ONLY pages_deployments ALTER COLUMN id SET DEFAULT nextval('pages_deployments_id_seq'::regclass);
ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('pages_domain_acme_orders_id_seq'::regclass);
@@ -22358,6 +23670,8 @@ ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('pos
ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);
+ALTER TABLE ONLY postgres_reindex_queued_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_queued_actions_id_seq'::regclass);
+
ALTER TABLE ONLY product_analytics_events_experimental ALTER COLUMN id SET DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass);
ALTER TABLE ONLY programming_languages ALTER COLUMN id SET DEFAULT nextval('programming_languages_id_seq'::regclass);
@@ -22404,6 +23718,8 @@ ALTER TABLE ONLY project_tracing_settings ALTER COLUMN id SET DEFAULT nextval('p
ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass);
+ALTER TABLE ONLY projects_sync_events ALTER COLUMN id SET DEFAULT nextval('projects_sync_events_id_seq'::regclass);
+
ALTER TABLE ONLY prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('prometheus_alert_events_id_seq'::regclass);
ALTER TABLE ONLY prometheus_alerts ALTER COLUMN id SET DEFAULT nextval('prometheus_alerts_id_seq'::regclass);
@@ -22536,6 +23852,8 @@ ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_regi
ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass);
+ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('upload_states_upload_id_seq'::regclass);
+
ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass);
ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass);
@@ -22608,6 +23926,8 @@ ALTER TABLE ONLY vulnerability_occurrence_pipelines ALTER COLUMN id SET DEFAULT
ALTER TABLE ONLY vulnerability_occurrences ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrences_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_reads ALTER COLUMN id SET DEFAULT nextval('vulnerability_reads_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_remediations_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_scanners ALTER COLUMN id SET DEFAULT nextval('vulnerability_scanners_id_seq'::regclass);
@@ -22668,8 +23988,38 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202307
ADD CONSTRAINT audit_events_202307_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.audit_events_202308
+ ADD CONSTRAINT audit_events_202308_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202309
+ ADD CONSTRAINT audit_events_202309_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);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306
+ ADD CONSTRAINT batched_background_migration_job_transition_logs_202306_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307
+ ADD CONSTRAINT batched_background_migration_job_transition_logs_202307_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308
+ ADD CONSTRAINT batched_background_migration_job_transition_logs_202308_pkey PRIMARY KEY (id, created_at);
+
+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);
@@ -22677,6 +24027,9 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_esc
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 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);
@@ -22698,8 +24051,11 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_esc
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307
ADD CONSTRAINT incident_management_pending_alert_escalations_202307_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_alert_escalations_202308
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202308_pkey PRIMARY KEY (id, process_at);
+
+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);
@@ -22707,6 +24063,9 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc
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 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);
@@ -22728,33 +24087,48 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc
ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307
ADD CONSTRAINT incident_management_pending_issue_escalations_202307_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY loose_foreign_keys_deleted_records
- ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202308_pkey PRIMARY KEY (id, process_at);
-ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000
- ADD CONSTRAINT loose_foreign_keys_deleted_records_000000_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+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.loose_foreign_keys_deleted_records_202212
- ADD CONSTRAINT loose_foreign_keys_deleted_records_202212_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+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.loose_foreign_keys_deleted_records_202301
- ADD CONSTRAINT loose_foreign_keys_deleted_records_202301_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+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.loose_foreign_keys_deleted_records_202302
- ADD CONSTRAINT loose_foreign_keys_deleted_records_202302_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+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.loose_foreign_keys_deleted_records_202303
- ADD CONSTRAINT loose_foreign_keys_deleted_records_202303_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+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.loose_foreign_keys_deleted_records_202304
- ADD CONSTRAINT loose_foreign_keys_deleted_records_202304_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202304
+ ADD CONSTRAINT verification_codes_202304_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.verification_codes_202305
+ ADD CONSTRAINT verification_codes_202305_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202306
+ ADD CONSTRAINT verification_codes_202306_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202307
+ ADD CONSTRAINT verification_codes_202307_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202308
+ ADD CONSTRAINT verification_codes_202308_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone);
+
+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 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);
@@ -22779,6 +24153,12 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306
ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202307
ADD CONSTRAINT web_hook_logs_202307_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202308
+ ADD CONSTRAINT web_hook_logs_202308_pkey PRIMARY KEY (id, created_at);
+
+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 analytics_cycle_analytics_issue_stage_events
ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
@@ -22977,6 +24357,207 @@ ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_reques
ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31
ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+ALTER TABLE ONLY issue_search_data
+ ADD CONSTRAINT issue_search_data_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_00
+ ADD CONSTRAINT issue_search_data_00_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_01
+ ADD CONSTRAINT issue_search_data_01_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_02
+ ADD CONSTRAINT issue_search_data_02_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_03
+ ADD CONSTRAINT issue_search_data_03_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_04
+ ADD CONSTRAINT issue_search_data_04_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_05
+ ADD CONSTRAINT issue_search_data_05_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_06
+ ADD CONSTRAINT issue_search_data_06_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_07
+ ADD CONSTRAINT issue_search_data_07_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_08
+ ADD CONSTRAINT issue_search_data_08_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_09
+ ADD CONSTRAINT issue_search_data_09_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_10
+ ADD CONSTRAINT issue_search_data_10_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_11
+ ADD CONSTRAINT issue_search_data_11_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_12
+ ADD CONSTRAINT issue_search_data_12_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_13
+ ADD CONSTRAINT issue_search_data_13_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_14
+ ADD CONSTRAINT issue_search_data_14_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_15
+ ADD CONSTRAINT issue_search_data_15_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_16
+ ADD CONSTRAINT issue_search_data_16_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_17
+ ADD CONSTRAINT issue_search_data_17_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_18
+ ADD CONSTRAINT issue_search_data_18_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_19
+ ADD CONSTRAINT issue_search_data_19_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_20
+ ADD CONSTRAINT issue_search_data_20_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_21
+ ADD CONSTRAINT issue_search_data_21_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_22
+ ADD CONSTRAINT issue_search_data_22_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_23
+ ADD CONSTRAINT issue_search_data_23_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_24
+ ADD CONSTRAINT issue_search_data_24_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_25
+ ADD CONSTRAINT issue_search_data_25_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_26
+ ADD CONSTRAINT issue_search_data_26_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_27
+ ADD CONSTRAINT issue_search_data_27_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_28
+ ADD CONSTRAINT issue_search_data_28_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_29
+ ADD CONSTRAINT issue_search_data_29_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_30
+ ADD CONSTRAINT issue_search_data_30_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_31
+ ADD CONSTRAINT issue_search_data_31_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_32
+ ADD CONSTRAINT issue_search_data_32_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_33
+ ADD CONSTRAINT issue_search_data_33_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_34
+ ADD CONSTRAINT issue_search_data_34_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_35
+ ADD CONSTRAINT issue_search_data_35_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_36
+ ADD CONSTRAINT issue_search_data_36_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_37
+ ADD CONSTRAINT issue_search_data_37_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_38
+ ADD CONSTRAINT issue_search_data_38_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_39
+ ADD CONSTRAINT issue_search_data_39_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_40
+ ADD CONSTRAINT issue_search_data_40_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_41
+ ADD CONSTRAINT issue_search_data_41_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_42
+ ADD CONSTRAINT issue_search_data_42_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_43
+ ADD CONSTRAINT issue_search_data_43_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_44
+ ADD CONSTRAINT issue_search_data_44_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_45
+ ADD CONSTRAINT issue_search_data_45_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_46
+ ADD CONSTRAINT issue_search_data_46_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_47
+ ADD CONSTRAINT issue_search_data_47_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_48
+ ADD CONSTRAINT issue_search_data_48_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_49
+ ADD CONSTRAINT issue_search_data_49_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_50
+ ADD CONSTRAINT issue_search_data_50_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_51
+ ADD CONSTRAINT issue_search_data_51_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_52
+ ADD CONSTRAINT issue_search_data_52_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_53
+ ADD CONSTRAINT issue_search_data_53_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_54
+ ADD CONSTRAINT issue_search_data_54_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_55
+ ADD CONSTRAINT issue_search_data_55_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_56
+ ADD CONSTRAINT issue_search_data_56_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_57
+ ADD CONSTRAINT issue_search_data_57_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_58
+ ADD CONSTRAINT issue_search_data_58_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_59
+ ADD CONSTRAINT issue_search_data_59_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_60
+ ADD CONSTRAINT issue_search_data_60_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_61
+ ADD CONSTRAINT issue_search_data_61_pkey PRIMARY KEY (project_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62
+ ADD CONSTRAINT issue_search_data_62_pkey PRIMARY KEY (project_id, issue_id);
+
+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);
@@ -23175,9 +24756,15 @@ ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_
ALTER TABLE ONLY abuse_reports
ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT agent_activity_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY agent_group_authorizations
ADD CONSTRAINT agent_group_authorizations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY agent_project_authorizations
+ ADD CONSTRAINT agent_project_authorizations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY alert_management_alert_assignees
ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);
@@ -23367,6 +24954,9 @@ 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;
@@ -23391,9 +24981,6 @@ ALTER TABLE ONLY ci_build_trace_chunks
ALTER TABLE ONLY ci_build_trace_metadata
ADD CONSTRAINT ci_build_trace_metadata_pkey PRIMARY KEY (build_id);
-ALTER TABLE ONLY dep_ci_build_trace_sections
- ADD CONSTRAINT ci_build_trace_sections_pkey PRIMARY KEY (build_id, section_name_id);
-
ALTER TABLE ONLY ci_builds_metadata
ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id);
@@ -23418,6 +25005,9 @@ ALTER TABLE ONLY ci_group_variables
ALTER TABLE ONLY ci_instance_variables
ADD CONSTRAINT ci_instance_variables_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_job_artifact_states
+ ADD CONSTRAINT ci_job_artifact_states_pkey PRIMARY KEY (job_artifact_id);
+
ALTER TABLE ONLY ci_job_artifacts
ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id);
@@ -23430,6 +25020,9 @@ ALTER TABLE ONLY ci_job_variables
ALTER TABLE ONLY ci_minutes_additional_packs
ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_namespace_mirrors
+ ADD CONSTRAINT ci_namespace_mirrors_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_namespace_monthly_usages
ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id);
@@ -23463,6 +25056,9 @@ ALTER TABLE ONLY ci_pipelines
ALTER TABLE ONLY ci_platform_metrics
ADD CONSTRAINT ci_platform_metrics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_project_mirrors
+ ADD CONSTRAINT ci_project_mirrors_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_project_monthly_usages
ADD CONSTRAINT ci_project_monthly_usages_pkey PRIMARY KEY (id);
@@ -23589,9 +25185,15 @@ ALTER TABLE ONLY container_expiration_policies
ALTER TABLE ONLY container_repositories
ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY content_blocked_states
+ ADD CONSTRAINT content_blocked_states_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY conversational_development_index_metrics
ADD CONSTRAINT conversational_development_index_metrics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY coverage_fuzzing_corpuses
+ ADD CONSTRAINT coverage_fuzzing_corpuses_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY csv_issue_imports
ADD CONSTRAINT csv_issue_imports_pkey PRIMARY KEY (id);
@@ -23640,9 +25242,6 @@ ALTER TABLE ONLY dast_site_validations
ALTER TABLE ONLY dast_sites
ADD CONSTRAINT dast_sites_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY dep_ci_build_trace_section_names
- ADD CONSTRAINT dep_ci_build_trace_section_names_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY dependency_proxy_blobs
ADD CONSTRAINT dependency_proxy_blobs_pkey PRIMARY KEY (id);
@@ -23661,6 +25260,9 @@ ALTER TABLE ONLY deploy_keys_projects
ALTER TABLE ONLY deploy_tokens
ADD CONSTRAINT deploy_tokens_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY deployment_approvals
+ ADD CONSTRAINT deployment_approvals_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY deployment_clusters
ADD CONSTRAINT deployment_clusters_pkey PRIMARY KEY (deployment_id);
@@ -23835,9 +25437,6 @@ ALTER TABLE ONLY geo_repository_updated_events
ALTER TABLE ONLY geo_reset_checksum_events
ADD CONSTRAINT geo_reset_checksum_events_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY geo_upload_deleted_events
- ADD CONSTRAINT geo_upload_deleted_events_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY gitlab_subscription_histories
ADD CONSTRAINT gitlab_subscription_histories_pkey PRIMARY KEY (id);
@@ -23925,6 +25524,9 @@ ALTER TABLE ONLY incident_management_oncall_schedules
ALTER TABLE ONLY incident_management_oncall_shifts
ADD CONSTRAINT incident_management_oncall_shifts_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT incident_management_timeline_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY index_statuses
ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id);
@@ -23952,9 +25554,15 @@ ALTER TABLE ONLY issuable_slas
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT issue_assignees_pkey PRIMARY KEY (issue_id, user_id);
+ALTER TABLE ONLY issue_customer_relations_contacts
+ ADD CONSTRAINT issue_customer_relations_contacts_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY issue_email_participants
ADD CONSTRAINT issue_email_participants_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY issue_emails
+ ADD CONSTRAINT issue_emails_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY issue_links
ADD CONSTRAINT issue_links_pkey PRIMARY KEY (id);
@@ -24015,6 +25623,9 @@ ALTER TABLE ONLY ldap_group_links
ALTER TABLE ONLY lfs_file_locks
ADD CONSTRAINT lfs_file_locks_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY lfs_object_states
+ ADD CONSTRAINT lfs_object_states_pkey PRIMARY KEY (lfs_object_id);
+
ALTER TABLE ONLY lfs_objects
ADD CONSTRAINT lfs_objects_pkey PRIMARY KEY (id);
@@ -24030,6 +25641,9 @@ ALTER TABLE ONLY list_user_preferences
ALTER TABLE ONLY lists
ADD CONSTRAINT lists_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY member_tasks
+ ADD CONSTRAINT member_tasks_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY members
ADD CONSTRAINT members_pkey PRIMARY KEY (id);
@@ -24075,6 +25689,9 @@ ALTER TABLE ONLY merge_request_user_mentions
ALTER TABLE ONLY merge_requests_closing_issues
ADD CONSTRAINT merge_requests_closing_issues_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY merge_requests_compliance_violations
+ ADD CONSTRAINT merge_requests_compliance_violations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT merge_requests_pkey PRIMARY KEY (id);
@@ -24117,6 +25734,9 @@ ALTER TABLE ONLY namespace_statistics
ALTER TABLE ONLY namespaces
ADD CONSTRAINT namespaces_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY namespaces_sync_events
+ ADD CONSTRAINT namespaces_sync_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY note_diff_files
ADD CONSTRAINT note_diff_files_pkey PRIMARY KEY (id);
@@ -24141,9 +25761,6 @@ ALTER TABLE ONLY oauth_openid_requests
ALTER TABLE ONLY onboarding_progresses
ADD CONSTRAINT onboarding_progresses_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY open_project_tracker_data
- ADD CONSTRAINT open_project_tracker_data_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY operations_feature_flag_scopes
ADD CONSTRAINT operations_feature_flag_scopes_pkey PRIMARY KEY (id);
@@ -24234,6 +25851,9 @@ ALTER TABLE ONLY packages_helm_file_metadata
ALTER TABLE ONLY packages_maven_metadata
ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY packages_npm_metadata
+ ADD CONSTRAINT packages_npm_metadata_pkey PRIMARY KEY (package_id);
+
ALTER TABLE ONLY packages_nuget_dependency_link_metadata
ADD CONSTRAINT packages_nuget_dependency_link_metadata_pkey PRIMARY KEY (dependency_link_id);
@@ -24258,6 +25878,9 @@ ALTER TABLE ONLY packages_rubygems_metadata
ALTER TABLE ONLY packages_tags
ADD CONSTRAINT packages_tags_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY pages_deployment_states
+ ADD CONSTRAINT pages_deployment_states_pkey PRIMARY KEY (pages_deployment_id);
+
ALTER TABLE ONLY pages_deployments
ADD CONSTRAINT pages_deployments_pkey PRIMARY KEY (id);
@@ -24291,6 +25914,9 @@ ALTER TABLE ONLY postgres_async_indexes
ALTER TABLE ONLY postgres_reindex_actions
ADD CONSTRAINT postgres_reindex_actions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY postgres_reindex_queued_actions
+ ADD CONSTRAINT postgres_reindex_queued_actions_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY programming_languages
ADD CONSTRAINT programming_languages_pkey PRIMARY KEY (id);
@@ -24384,6 +26010,9 @@ ALTER TABLE ONLY project_tracing_settings
ALTER TABLE ONLY projects
ADD CONSTRAINT projects_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY projects_sync_events
+ ADD CONSTRAINT projects_sync_events_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY prometheus_alert_events
ADD CONSTRAINT prometheus_alert_events_pkey PRIMARY KEY (id);
@@ -24504,6 +26133,9 @@ ALTER TABLE ONLY sent_notifications
ALTER TABLE ONLY sentry_issues
ADD CONSTRAINT sentry_issues_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY sprints
+ ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED;
+
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid);
@@ -24600,6 +26232,9 @@ ALTER TABLE ONLY u2f_registrations
ALTER TABLE ONLY upcoming_reconciliations
ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY upload_states
+ ADD CONSTRAINT upload_states_pkey PRIMARY KEY (upload_id);
+
ALTER TABLE ONLY uploads
ADD CONSTRAINT uploads_pkey PRIMARY KEY (id);
@@ -24723,6 +26358,9 @@ ALTER TABLE ONLY vulnerability_occurrence_pipelines
ALTER TABLE ONLY vulnerability_occurrences
ADD CONSTRAINT vulnerability_occurrences_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_reads
+ ADD CONSTRAINT vulnerability_reads_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_remediations
ADD CONSTRAINT vulnerability_remediations_pkey PRIMARY KEY (id);
@@ -24805,18 +26443,44 @@ CREATE INDEX audit_events_202307_created_at_author_id_idx ON gitlab_partitions_d
CREATE INDEX audit_events_202307_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202307 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id ON ONLY incident_management_pending_alert_escalations USING btree (rule_id);
+CREATE INDEX audit_events_202308_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202308 USING btree (created_at, author_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 audit_events_202308_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202308 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
-CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id ON ONLY incident_management_pending_alert_escalations USING btree (alert_id);
+CREATE INDEX audit_events_202309_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202309 USING btree (created_at, author_id);
+
+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 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_idx1 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 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_202304 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_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_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_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_idx7 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_20221_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (rule_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 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 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 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_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (rule_id);
@@ -24831,6 +26495,10 @@ CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON
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_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_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 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_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (alert_id);
@@ -24845,38 +26513,22 @@ CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON
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 index_incident_management_pending_alert_escalations_on_schedule ON ONLY incident_management_pending_alert_escalations USING btree (schedule_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_2_schedule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (schedule_id);
-
-CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (schedule_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_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 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_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 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 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_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (rule_id);
@@ -24891,6 +26543,10 @@ CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON
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_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_idx8 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 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_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (issue_id);
@@ -24905,6 +26561,10 @@ CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON
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 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 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_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id);
CREATE INDEX index_1554dc6f11 ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (web_hook_id);
@@ -24921,6 +26581,28 @@ CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000
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);
+
+CREATE UNIQUE INDEX verification_codes_202306_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202306 USING btree (visitor_id_code, phone, created_at);
+
+CREATE UNIQUE INDEX verification_codes_202307_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202307 USING btree (visitor_id_code, phone, created_at);
+
+CREATE UNIQUE INDEX verification_codes_202308_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202308 USING btree (visitor_id_code, phone, created_at);
+
+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);
@@ -24945,6 +26627,806 @@ CREATE INDEX web_hook_logs_202307_created_at_web_hook_id_idx ON gitlab_partition
CREATE INDEX web_hook_logs_202307_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202307 USING btree (web_hook_id);
+CREATE INDEX web_hook_logs_202308_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202308 USING btree (created_at, web_hook_id);
+
+CREATE INDEX web_hook_logs_202308_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202308 USING btree (web_hook_id);
+
+CREATE INDEX web_hook_logs_202309_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202309 USING btree (created_at, web_hook_id);
+
+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 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);
+
+CREATE INDEX index_merge_request_stage_events_project_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events 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_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);
+
+CREATE INDEX index_0287f5ba09 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_03aa30a758 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 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_group_duration ON ONLY analytics_cycle_analytics_issue_stage_events 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_055179c3ea ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 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_061fe00461 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 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_070cef72c3 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_08e3cfc564 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 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_in_progress_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events 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_09af45dd6f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 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_0c153e2eae 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_issue_stage_events_group_in_progress_duration ON ONLY analytics_cycle_analytics_issue_stage_events 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_0ca85f3d71 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 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_issue_stage_events_project_in_progress_duration ON ONLY analytics_cycle_analytics_issue_stage_events 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_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_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));
+
+CREATE INDEX index_107e123e17 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 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_1230a7a402 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 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_142c4e7ea4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 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_merge_request_stage_events_project_in_progress_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events 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_14e4fa1d7d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 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_14f3645821 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+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_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));
+
+CREATE INDEX index_1af932a3c7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 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_1b0ea30bdb ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 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_1f6c3faabe ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 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_1f8af04ed1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 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_201c5ddbe9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 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_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_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_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);
+
+CREATE INDEX index_2208bd7d7f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 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_223592b4a1 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_22acc9ab11 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 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_22ed8f01dd ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 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_234d38a657 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 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_23783dc748 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 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_241e9a574c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 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_24ac321751 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 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_25e2aaee9b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 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_2653e7eeb8 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 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_2745f5a388 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_27759556bc ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 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_27d7ad78d8 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 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_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_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));
+
+CREATE INDEX index_2b7c0a294e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 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_2c6422f668 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 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_2dfcdbe81e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 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_2e1054b181 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 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_2e6991d05b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 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_2f80c360c3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 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_2fc271c673 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 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_2fcfd0dc70 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 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_3005c75335 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_3206c1e6af ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 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_3249505125 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 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_331eb67441 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 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_3640194b77 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 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_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_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);
+
+CREATE INDEX index_399dc06649 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 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_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_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_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));
+
+CREATE INDEX index_436fa9ad5f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 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_453a659cb6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 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_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_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_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));
+
+CREATE INDEX index_4b1793a4c4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 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_4b22560035 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 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_4c2645eef2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 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_4c9d14f978 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 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_4d04210a95 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 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_4d4f2f7de6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 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_4db5aa5872 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_4dead6f314 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 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_4e6ce1c371 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 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_4f2eb7a06b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 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_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_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));
+
+CREATE INDEX index_52ea79bf8e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 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_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_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_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_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));
+
+CREATE INDEX index_5b944f308d 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+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_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_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));
+
+CREATE INDEX index_5f96b344e2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 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_5fb1867c41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 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_5fe1d00845 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 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_60e3480f23 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 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_6137e27484 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 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_620fe77c99 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 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_625ed9e965 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 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_64e3a1dfa1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 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_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_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_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));
+
+CREATE INDEX index_6a39f6d5ac 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_6add8e74cf ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 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_6b1ce61c8f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 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_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_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);
+
+CREATE INDEX index_6ec4c4afd4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 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_6f4e0abe54 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 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_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_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);
+
+CREATE INDEX index_72027c157f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 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_739845f617 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 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_74addd1240 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 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_75dc81d1d7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 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_765b0cd8db ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 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_77096a1dc6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 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_77c6293242 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 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_7b7c85eceb ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 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_7da2307d2e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 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_7ead2300ca ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 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_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_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);
+
+CREATE INDEX index_80c65daf20 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 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_81b9cf594f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 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_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_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);
+
+CREATE INDEX index_844abd2888 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 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_8464227c80 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 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_8685d7c69c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 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_8688b40056 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 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_87d40fb9f9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 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_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_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_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_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_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));
+
+CREATE INDEX index_9955b1dc59 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 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_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_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));
+
+CREATE INDEX index_a2d9f185a5 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 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_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_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);
+
+CREATE INDEX index_a8276a450f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 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_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_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_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);
+
+CREATE INDEX index_ab22231a16 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 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_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_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);
+
+CREATE INDEX index_aee84adb5b 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+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_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));
+
+CREATE INDEX index_b83fe1306b 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_bc189e47ab ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 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_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_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_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);
+
+CREATE INDEX index_c119f5b92e 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_c17dae3605 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 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_c1cdd90d0d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 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_c2b951bf20 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_c42b2e7eae ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 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_c435d904ce ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 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_c473921734 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 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_c546bb0736 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 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_c59cde6209 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 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_c66758baa7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 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_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_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_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_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_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_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_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_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_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_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_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_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);
+
+CREATE INDEX index_e54adf9acb 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_e6405afea0 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_e64588e276 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, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL);
+
+CREATE INDEX index_e716b8ac3f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 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_e73bc5ba6a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 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_e8f3a327b2 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 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_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_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_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_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));
+
+CREATE INDEX index_ef7be2ae94 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 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_f0cdd09a5e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 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_f112fae8ac ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 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_f1c3d14cdc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 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_f256d3f6a1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 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_f2848acfc7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 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_f3d7d86e09 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 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_f47327ec1f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 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_f6b0d458a3 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 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_f705dc8541 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 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_f76e8a5304 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 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_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_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_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));
+
+CREATE INDEX index_fccbe45c32 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 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_fee429223e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 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_ff00c038cc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 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_ff39be5400 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 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_ff8741d8d7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 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_issue_search_data_on_issue_id ON ONLY issue_search_data USING btree (issue_id);
+
+CREATE INDEX issue_search_data_00_issue_id_idx ON gitlab_partitions_static.issue_search_data_00 USING btree (issue_id);
+
+CREATE INDEX index_issue_search_data_on_search_vector ON ONLY issue_search_data USING gin (search_vector);
+
+CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_01_issue_id_idx ON gitlab_partitions_static.issue_search_data_01 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_02_issue_id_idx ON gitlab_partitions_static.issue_search_data_02 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_03_issue_id_idx ON gitlab_partitions_static.issue_search_data_03 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_04_issue_id_idx ON gitlab_partitions_static.issue_search_data_04 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_05_issue_id_idx ON gitlab_partitions_static.issue_search_data_05 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_06_issue_id_idx ON gitlab_partitions_static.issue_search_data_06 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_07_issue_id_idx ON gitlab_partitions_static.issue_search_data_07 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_08_issue_id_idx ON gitlab_partitions_static.issue_search_data_08 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_09_issue_id_idx ON gitlab_partitions_static.issue_search_data_09 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_10_issue_id_idx ON gitlab_partitions_static.issue_search_data_10 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_11_issue_id_idx ON gitlab_partitions_static.issue_search_data_11 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_12_issue_id_idx ON gitlab_partitions_static.issue_search_data_12 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_13_issue_id_idx ON gitlab_partitions_static.issue_search_data_13 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_14_issue_id_idx ON gitlab_partitions_static.issue_search_data_14 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_15_issue_id_idx ON gitlab_partitions_static.issue_search_data_15 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_16_issue_id_idx ON gitlab_partitions_static.issue_search_data_16 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_17_issue_id_idx ON gitlab_partitions_static.issue_search_data_17 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_18_issue_id_idx ON gitlab_partitions_static.issue_search_data_18 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_19_issue_id_idx ON gitlab_partitions_static.issue_search_data_19 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_20_issue_id_idx ON gitlab_partitions_static.issue_search_data_20 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_21_issue_id_idx ON gitlab_partitions_static.issue_search_data_21 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_22_issue_id_idx ON gitlab_partitions_static.issue_search_data_22 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_23_issue_id_idx ON gitlab_partitions_static.issue_search_data_23 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_24_issue_id_idx ON gitlab_partitions_static.issue_search_data_24 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_25_issue_id_idx ON gitlab_partitions_static.issue_search_data_25 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_26_issue_id_idx ON gitlab_partitions_static.issue_search_data_26 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_27_issue_id_idx ON gitlab_partitions_static.issue_search_data_27 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_28_issue_id_idx ON gitlab_partitions_static.issue_search_data_28 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_29_issue_id_idx ON gitlab_partitions_static.issue_search_data_29 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_30_issue_id_idx ON gitlab_partitions_static.issue_search_data_30 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_31_issue_id_idx ON gitlab_partitions_static.issue_search_data_31 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_32_issue_id_idx ON gitlab_partitions_static.issue_search_data_32 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_33_issue_id_idx ON gitlab_partitions_static.issue_search_data_33 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_34_issue_id_idx ON gitlab_partitions_static.issue_search_data_34 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_35_issue_id_idx ON gitlab_partitions_static.issue_search_data_35 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_36_issue_id_idx ON gitlab_partitions_static.issue_search_data_36 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_37_issue_id_idx ON gitlab_partitions_static.issue_search_data_37 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_38_issue_id_idx ON gitlab_partitions_static.issue_search_data_38 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_39_issue_id_idx ON gitlab_partitions_static.issue_search_data_39 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_40_issue_id_idx ON gitlab_partitions_static.issue_search_data_40 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_41_issue_id_idx ON gitlab_partitions_static.issue_search_data_41 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_42_issue_id_idx ON gitlab_partitions_static.issue_search_data_42 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_43_issue_id_idx ON gitlab_partitions_static.issue_search_data_43 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_44_issue_id_idx ON gitlab_partitions_static.issue_search_data_44 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_45_issue_id_idx ON gitlab_partitions_static.issue_search_data_45 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_46_issue_id_idx ON gitlab_partitions_static.issue_search_data_46 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_47_issue_id_idx ON gitlab_partitions_static.issue_search_data_47 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_48_issue_id_idx ON gitlab_partitions_static.issue_search_data_48 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_49_issue_id_idx ON gitlab_partitions_static.issue_search_data_49 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_50_issue_id_idx ON gitlab_partitions_static.issue_search_data_50 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_51_issue_id_idx ON gitlab_partitions_static.issue_search_data_51 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_52_issue_id_idx ON gitlab_partitions_static.issue_search_data_52 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_53_issue_id_idx ON gitlab_partitions_static.issue_search_data_53 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_54_issue_id_idx ON gitlab_partitions_static.issue_search_data_54 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_55_issue_id_idx ON gitlab_partitions_static.issue_search_data_55 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_56_issue_id_idx ON gitlab_partitions_static.issue_search_data_56 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_57_issue_id_idx ON gitlab_partitions_static.issue_search_data_57 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_58_issue_id_idx ON gitlab_partitions_static.issue_search_data_58 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_59_issue_id_idx ON gitlab_partitions_static.issue_search_data_59 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_60_issue_id_idx ON gitlab_partitions_static.issue_search_data_60 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_61_issue_id_idx ON gitlab_partitions_static.issue_search_data_61 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_62_issue_id_idx ON gitlab_partitions_static.issue_search_data_62 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector);
+
+CREATE INDEX issue_search_data_63_issue_id_idx ON gitlab_partitions_static.issue_search_data_63 USING btree (issue_id);
+
+CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector);
+
CREATE INDEX index_product_analytics_events_experimental_project_and_time ON ONLY product_analytics_events_experimental USING btree (project_id, collector_tstamp);
CREATE INDEX product_analytics_events_expe_project_id_collector_tstamp_idx10 ON gitlab_partitions_static.product_analytics_events_experimental_10 USING btree (project_id, collector_tstamp);
@@ -25093,6 +27575,8 @@ CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING b
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);
@@ -25129,7 +27613,7 @@ CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_fi
CREATE INDEX finding_evidence_supporting_messages_on_finding_evidence_id ON vulnerability_finding_evidence_supporting_messages USING btree (vulnerability_finding_evidence_id);
-CREATE INDEX finding_evidences_on_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
+CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
@@ -25165,6 +27649,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_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 INDEX idx_issues_on_health_status_not_null ON issues USING btree (health_status) WHERE (health_status IS NOT NULL);
@@ -25173,9 +27659,7 @@ CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issu
CREATE INDEX idx_issues_on_project_id_and_due_date_and_id_and_state_id ON issues USING btree (project_id, due_date, id, state_id) WHERE (due_date IS NOT NULL);
-CREATE INDEX idx_issues_on_project_id_and_rel_asc_and_id ON issues USING btree (project_id, relative_position, id);
-
-CREATE INDEX idx_issues_on_project_id_and_rel_position_and_state_id_and_id ON issues USING btree (project_id, relative_position, state_id, id DESC);
+CREATE INDEX idx_issues_on_project_id_and_rel_position_and_id_and_state_id ON issues USING btree (project_id, relative_position, id, state_id);
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);
@@ -25279,10 +27763,24 @@ CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_link_t
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);
+
+CREATE INDEX index_agent_activity_events_on_agent_token_id ON agent_activity_events USING btree (agent_token_id) WHERE (agent_token_id IS NOT NULL);
+
+CREATE INDEX index_agent_activity_events_on_merge_request_id ON agent_activity_events USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL);
+
+CREATE INDEX index_agent_activity_events_on_project_id ON agent_activity_events USING btree (project_id) WHERE (project_id IS NOT NULL);
+
+CREATE INDEX index_agent_activity_events_on_user_id ON agent_activity_events USING btree (user_id) WHERE (user_id IS NOT NULL);
+
CREATE UNIQUE INDEX index_agent_group_authorizations_on_agent_id_and_group_id ON agent_group_authorizations USING btree (agent_id, group_id);
CREATE INDEX index_agent_group_authorizations_on_group_id ON agent_group_authorizations USING btree (group_id);
+CREATE UNIQUE INDEX index_agent_project_authorizations_on_agent_id_and_project_id ON agent_project_authorizations USING btree (agent_id, project_id);
+
+CREATE INDEX index_agent_project_authorizations_on_project_id ON agent_project_authorizations USING btree (project_id);
+
CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assignees USING btree (alert_id);
CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id);
@@ -25375,6 +27873,8 @@ CREATE INDEX index_approval_project_rules_on_rule_type ON approval_project_rules
CREATE INDEX index_approval_project_rules_protected_branches_pb_id ON approval_project_rules_protected_branches USING btree (protected_branch_id);
+CREATE INDEX index_approval_project_rules_report_type ON approval_project_rules USING btree (report_type);
+
CREATE UNIQUE INDEX index_approval_project_rules_users_1 ON approval_project_rules_users USING btree (approval_project_rule_id, user_id);
CREATE INDEX index_approval_project_rules_users_2 ON approval_project_rules_users USING btree (user_id);
@@ -25507,6 +28007,8 @@ 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_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids);
+
CREATE INDEX index_bulk_import_configurations_on_bulk_import_id ON bulk_import_configurations USING btree (bulk_import_id);
CREATE INDEX index_bulk_import_entities_on_bulk_import_id_and_status ON bulk_import_entities USING btree (bulk_import_id, status);
@@ -25569,6 +28071,8 @@ CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_bu
CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at);
+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 index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC);
CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id);
@@ -25609,6 +28113,8 @@ CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment
CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key);
+CREATE INDEX index_ci_job_artifact_states_on_job_artifact_id ON ci_job_artifact_states USING btree (job_artifact_id);
+
CREATE INDEX index_ci_job_artifacts_for_terraform_reports ON ci_job_artifacts USING btree (project_id, id) WHERE (file_type = 18);
CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts USING btree (id) WHERE (file_type = 18);
@@ -25635,6 +28141,8 @@ CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables
CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON ci_minutes_additional_packs USING btree (namespace_id, purchase_xid);
+CREATE UNIQUE INDEX index_ci_namespace_mirrors_on_namespace_id ON ci_namespace_mirrors USING btree (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);
@@ -25723,6 +28231,10 @@ 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_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);
+
CREATE UNIQUE INDEX index_ci_project_monthly_usages_on_project_id_and_date ON ci_project_monthly_usages USING btree (project_id, date);
CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_path ON ci_refs USING btree (project_id, ref_path);
@@ -25861,6 +28373,10 @@ CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON cluster
CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id);
+CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integration_elasticstack USING btree (enabled, created_at, cluster_id);
+
+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);
@@ -25893,6 +28409,14 @@ CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON conta
CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops);
+CREATE UNIQUE INDEX index_content_blocked_states_on_container_id_commit_sha_path ON content_blocked_states USING btree (container_identifier, commit_sha, path);
+
+CREATE UNIQUE INDEX index_coverage_fuzzing_corpuses_on_package_id ON coverage_fuzzing_corpuses USING btree (package_id);
+
+CREATE INDEX index_coverage_fuzzing_corpuses_on_project_id ON coverage_fuzzing_corpuses USING btree (project_id);
+
+CREATE INDEX index_coverage_fuzzing_corpuses_on_user_id ON coverage_fuzzing_corpuses USING btree (user_id);
+
CREATE INDEX index_created_at_on_codeowner_approval_merge_request_rules ON approval_merge_request_rules USING btree (created_at) WHERE ((rule_type = 2) AND (section <> 'codeowners'::text));
CREATE INDEX index_csv_issue_imports_on_project_id ON csv_issue_imports USING btree (project_id);
@@ -25937,6 +28461,8 @@ CREATE UNIQUE INDEX index_dast_site_profiles_on_project_id_and_name ON dast_site
CREATE UNIQUE INDEX index_dast_site_profiles_pipelines_on_ci_pipeline_id ON dast_site_profiles_pipelines USING btree (ci_pipeline_id);
+CREATE UNIQUE INDEX index_dast_site_token_on_project_id_and_url ON dast_site_tokens USING btree (project_id, url);
+
CREATE UNIQUE INDEX index_dast_site_token_on_token ON dast_site_tokens USING btree (token);
CREATE INDEX index_dast_site_tokens_on_project_id ON dast_site_tokens USING btree (project_id);
@@ -25949,17 +28475,19 @@ CREATE INDEX index_dast_sites_on_dast_site_validation_id ON dast_sites USING btr
CREATE UNIQUE INDEX index_dast_sites_on_project_id_and_url ON dast_sites USING btree (project_id, url);
-CREATE UNIQUE INDEX index_dep_ci_build_trace_section_names_on_project_id_and_name ON dep_ci_build_trace_section_names USING btree (project_id, name);
+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_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_trace_sections USING btree (project_id);
+CREATE INDEX index_dependency_proxy_blobs_on_group_id_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name);
-CREATE INDEX index_dep_ci_build_trace_sections_on_section_name_id ON dep_ci_build_trace_sections USING btree (section_name_id);
+CREATE INDEX index_dependency_proxy_blobs_on_group_id_status_read_at_id ON dependency_proxy_blobs USING btree (group_id, status, read_at, id);
-CREATE INDEX index_dependency_proxy_blobs_on_group_id_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name);
+CREATE INDEX index_dependency_proxy_blobs_on_status ON dependency_proxy_blobs USING btree (status);
CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id);
-CREATE UNIQUE INDEX index_dependency_proxy_manifests_on_group_id_and_file_name ON dependency_proxy_manifests USING btree (group_id, file_name);
+CREATE INDEX index_dependency_proxy_manifests_on_group_id_status_read_at_id ON dependency_proxy_manifests USING btree (group_id, status, read_at, id);
+
+CREATE INDEX index_dependency_proxy_manifests_on_status ON dependency_proxy_manifests USING btree (status);
CREATE INDEX index_deploy_key_id_on_protected_branch_push_access_levels ON protected_branch_push_access_levels USING btree (deploy_key_id);
@@ -25973,10 +28501,16 @@ CREATE INDEX index_deploy_tokens_on_token_and_expires_at_and_id ON deploy_tokens
CREATE UNIQUE INDEX index_deploy_tokens_on_token_encrypted ON deploy_tokens USING btree (token_encrypted);
+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);
+
CREATE UNIQUE INDEX index_deployment_clusters_on_cluster_id_and_deployment_id ON deployment_clusters USING btree (cluster_id, deployment_id);
CREATE INDEX index_deployment_merge_requests_on_merge_request_id ON deployment_merge_requests USING btree (merge_request_id);
+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);
CREATE INDEX index_deployments_on_created_at ON deployments USING btree (created_at);
@@ -25987,6 +28521,8 @@ CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btr
CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deployments USING btree (environment_id, iid, project_id);
+CREATE INDEX index_deployments_on_environment_id_and_ref ON deployments USING btree (environment_id, ref);
+
CREATE INDEX index_deployments_on_environment_id_status_and_finished_at ON deployments USING btree (environment_id, status, finished_at);
CREATE INDEX index_deployments_on_environment_id_status_and_id ON deployments USING btree (environment_id, status, id);
@@ -26149,13 +28685,13 @@ CREATE UNIQUE INDEX index_escalation_rules_on_all_attributes ON incident_managem
CREATE INDEX index_escalation_rules_on_user ON incident_management_escalation_rules USING btree (user_id);
-CREATE INDEX index_et_errors_on_project_id_and_status_and_events_count ON error_tracking_errors USING btree (project_id, status, events_count);
+CREATE INDEX index_et_errors_on_project_id_and_status_and_id ON error_tracking_errors USING btree (project_id, status, id);
-CREATE INDEX index_et_errors_on_project_id_and_status_and_first_seen_at ON error_tracking_errors USING btree (project_id, status, first_seen_at);
+CREATE INDEX index_et_errors_on_project_id_and_status_events_count_id_desc ON error_tracking_errors USING btree (project_id, status, events_count DESC, id DESC);
-CREATE INDEX index_et_errors_on_project_id_and_status_and_id ON error_tracking_errors USING btree (project_id, status, id);
+CREATE INDEX index_et_errors_on_project_id_and_status_first_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, first_seen_at DESC, id DESC);
-CREATE INDEX index_et_errors_on_project_id_and_status_and_last_seen_at ON error_tracking_errors USING btree (project_id, status, last_seen_at);
+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_on_action ON events USING btree (action);
@@ -26165,6 +28701,8 @@ CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events U
CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_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);
+
CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL);
CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (project_id, created_at);
@@ -26173,8 +28711,6 @@ CREATE INDEX index_events_on_project_id_and_id ON events USING btree (project_id
CREATE INDEX index_events_on_project_id_and_id_desc_on_merged_action ON events USING btree (project_id, id DESC) WHERE (action = 7);
-CREATE INDEX index_events_on_target_type_and_target_id ON events USING btree (target_type, target_id);
-
CREATE UNIQUE INDEX index_events_on_target_type_and_target_id_and_fingerprint ON events USING btree (target_type, target_id, fingerprint);
CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id);
@@ -26207,8 +28743,6 @@ CREATE UNIQUE INDEX index_feature_gates_on_feature_key_and_key_and_value ON feat
CREATE UNIQUE INDEX index_features_on_key ON features USING btree (key);
-CREATE INDEX index_for_resource_group ON ci_builds USING btree (resource_group_id, id) WHERE (resource_group_id IS NOT NULL);
-
CREATE INDEX index_for_status_per_branch_per_project ON merge_trains USING btree (target_project_id, target_branch, status);
CREATE INDEX index_fork_network_members_on_fork_network_id ON fork_network_members USING btree (fork_network_id);
@@ -26245,8 +28779,6 @@ CREATE INDEX index_geo_event_log_on_repository_updated_event_id ON geo_event_log
CREATE INDEX index_geo_event_log_on_reset_checksum_event_id ON geo_event_log USING btree (reset_checksum_event_id) WHERE (reset_checksum_event_id IS NOT NULL);
-CREATE INDEX index_geo_event_log_on_upload_deleted_event_id ON geo_event_log USING btree (upload_deleted_event_id) WHERE (upload_deleted_event_id IS NOT NULL);
-
CREATE INDEX index_geo_hashed_storage_attachments_events_on_project_id ON geo_hashed_storage_attachments_events USING btree (project_id);
CREATE INDEX index_geo_hashed_storage_migrated_events_on_project_id ON geo_hashed_storage_migrated_events USING btree (project_id);
@@ -26283,7 +28815,9 @@ CREATE INDEX index_geo_repository_updated_events_on_source ON geo_repository_upd
CREATE INDEX index_geo_reset_checksum_events_on_project_id ON geo_reset_checksum_events USING btree (project_id);
-CREATE INDEX index_geo_upload_deleted_events_on_upload_id ON geo_upload_deleted_events USING btree (upload_id);
+CREATE INDEX index_gin_ci_namespace_mirrors_on_traversal_ids ON ci_namespace_mirrors USING gin (traversal_ids);
+
+CREATE INDEX index_gin_ci_pending_builds_on_namespace_traversal_ids ON ci_pending_builds USING gin (namespace_traversal_ids);
CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gitlab_subscription_histories USING btree (gitlab_subscription_id);
@@ -26373,6 +28907,16 @@ CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_mana
CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid);
+CREATE INDEX index_im_timeline_events_author_id ON incident_management_timeline_events USING btree (author_id);
+
+CREATE INDEX index_im_timeline_events_issue_id ON incident_management_timeline_events USING btree (issue_id);
+
+CREATE INDEX index_im_timeline_events_project_id ON incident_management_timeline_events USING btree (project_id);
+
+CREATE INDEX index_im_timeline_events_promoted_from_note_id ON incident_management_timeline_events USING btree (promoted_from_note_id);
+
+CREATE INDEX index_im_timeline_events_updated_by_user_id ON incident_management_timeline_events USING btree (updated_by_user_id);
+
CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL);
CREATE INDEX index_import_export_uploads_on_project_id ON import_export_uploads USING btree (project_id);
@@ -26389,6 +28933,8 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI
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);
+
CREATE INDEX index_in_product_marketing_emails_on_user_id ON in_product_marketing_emails USING btree (user_id);
CREATE UNIQUE INDEX index_in_product_marketing_emails_on_user_track_series ON in_product_marketing_emails USING btree (user_id, track, series);
@@ -26451,14 +28997,24 @@ CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree
CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id);
+CREATE UNIQUE INDEX index_issue_crm_contacts_on_issue_id_and_contact_id ON issue_customer_relations_contacts USING btree (issue_id, contact_id);
+
+CREATE INDEX index_issue_customer_relations_contacts_on_contact_id ON issue_customer_relations_contacts USING btree (contact_id);
+
CREATE UNIQUE INDEX index_issue_email_participants_on_issue_id_and_lower_email ON issue_email_participants USING btree (issue_id, lower(email));
+CREATE INDEX index_issue_emails_on_email_message_id ON issue_emails USING btree (email_message_id);
+
+CREATE INDEX index_issue_emails_on_issue_id ON issue_emails USING btree (issue_id);
+
CREATE INDEX index_issue_links_on_source_id ON issue_links USING btree (source_id);
CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links USING btree (source_id, target_id);
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);
@@ -26527,7 +29083,13 @@ CREATE INDEX index_jira_imports_on_user_id ON jira_imports USING btree (user_id)
CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING btree (service_id);
-CREATE INDEX index_keys_on_expires_at_and_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), expiry_notification_delivered_at) WHERE (expiry_notification_delivered_at IS NULL);
+CREATE INDEX index_job_artifact_states_failed_verification ON ci_job_artifact_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
+
+CREATE INDEX index_job_artifact_states_needs_verification ON ci_job_artifact_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
+
+CREATE INDEX index_job_artifact_states_on_verification_state ON ci_job_artifact_states USING btree (verification_state);
+
+CREATE INDEX index_job_artifact_states_pending_verification ON ci_job_artifact_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
CREATE INDEX index_keys_on_expires_at_and_id ON keys USING btree (date(timezone('UTC'::text, expires_at)), id) WHERE (expiry_notification_delivered_at IS NULL);
@@ -26553,17 +29115,17 @@ CREATE INDEX index_label_priorities_on_priority ON label_priorities USING btree
CREATE UNIQUE INDEX index_label_priorities_on_project_id_and_label_id ON label_priorities USING btree (project_id, label_id);
-CREATE UNIQUE INDEX index_labels_on_group_id_and_project_id_and_title ON labels USING btree (group_id, project_id, title);
+CREATE INDEX index_labels_on_group_id ON labels USING btree (group_id);
-CREATE UNIQUE INDEX index_labels_on_group_id_and_title_unique ON labels USING btree (group_id, title) WHERE (project_id IS NULL);
+CREATE UNIQUE INDEX index_labels_on_group_id_and_title_varchar_unique ON labels USING btree (group_id, title varchar_pattern_ops) WHERE (project_id IS NULL);
CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id);
-CREATE UNIQUE INDEX index_labels_on_project_id_and_title_unique ON labels USING btree (project_id, title) WHERE (group_id IS NULL);
+CREATE UNIQUE INDEX index_labels_on_project_id_and_title_varchar_unique ON labels USING btree (project_id, title varchar_pattern_ops) WHERE (group_id IS NULL);
CREATE INDEX index_labels_on_template ON labels USING btree (template) WHERE template;
-CREATE INDEX index_labels_on_title ON labels USING btree (title);
+CREATE INDEX index_labels_on_title_varchar ON labels USING btree (title varchar_pattern_ops);
CREATE INDEX index_labels_on_type_and_project_id ON labels USING btree (type, project_id);
@@ -26571,6 +29133,16 @@ CREATE UNIQUE INDEX index_lfs_file_locks_on_project_id_and_path ON lfs_file_lock
CREATE INDEX index_lfs_file_locks_on_user_id ON lfs_file_locks USING btree (user_id);
+CREATE INDEX index_lfs_object_states_failed_verification ON lfs_object_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
+
+CREATE INDEX index_lfs_object_states_needs_verification ON lfs_object_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
+
+CREATE INDEX index_lfs_object_states_on_lfs_object_id ON lfs_object_states USING btree (lfs_object_id);
+
+CREATE INDEX index_lfs_object_states_on_verification_state ON lfs_object_states USING btree (verification_state);
+
+CREATE INDEX index_lfs_object_states_pending_verification ON lfs_object_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
+
CREATE INDEX index_lfs_objects_on_file_store ON lfs_objects USING btree (file_store);
CREATE UNIQUE INDEX index_lfs_objects_on_oid ON lfs_objects USING btree (oid);
@@ -26597,6 +29169,12 @@ CREATE INDEX index_lists_on_milestone_id ON lists USING btree (milestone_id);
CREATE INDEX index_lists_on_user_id ON lists USING btree (user_id);
+CREATE INDEX index_member_tasks_on_member_id ON member_tasks USING btree (member_id);
+
+CREATE UNIQUE INDEX index_member_tasks_on_member_id_and_project_id ON member_tasks USING btree (member_id, project_id);
+
+CREATE INDEX index_member_tasks_on_project_id ON member_tasks USING btree (project_id);
+
CREATE INDEX index_members_on_access_level ON members USING btree (access_level);
CREATE INDEX index_members_on_expires_at ON members USING btree (expires_at);
@@ -26677,6 +29255,10 @@ CREATE INDEX index_merge_requests_closing_issues_on_issue_id ON merge_requests_c
CREATE INDEX index_merge_requests_closing_issues_on_merge_request_id ON merge_requests_closing_issues USING btree (merge_request_id);
+CREATE INDEX index_merge_requests_compliance_violations_on_violating_user_id ON merge_requests_compliance_violations USING btree (violating_user_id);
+
+CREATE UNIQUE INDEX index_merge_requests_compliance_violations_unique_columns ON merge_requests_compliance_violations USING btree (merge_request_id, violating_user_id, reason);
+
CREATE INDEX index_merge_requests_on_assignee_id ON merge_requests USING btree (assignee_id);
CREATE INDEX index_merge_requests_on_author_id ON merge_requests USING btree (author_id);
@@ -26785,6 +29367,8 @@ CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree
CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL);
+CREATE UNIQUE INDEX index_namespaces_name_parent_id_type ON namespaces USING btree (name, parent_id, type);
+
CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at);
CREATE INDEX index_namespaces_on_custom_project_templates_group_id_and_type ON namespaces USING btree (custom_project_templates_group_id, type) WHERE (custom_project_templates_group_id IS NOT NULL);
@@ -26795,8 +29379,6 @@ CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespac
CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING btree (ldap_sync_last_update_at);
-CREATE UNIQUE INDEX index_namespaces_on_name_and_parent_id ON namespaces USING btree (name, parent_id);
-
CREATE INDEX index_namespaces_on_name_trigram ON namespaces USING gin (name gin_trgm_ops);
CREATE INDEX index_namespaces_on_owner_id ON namespaces USING btree (owner_id);
@@ -26819,7 +29401,13 @@ CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON names
CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids);
-CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL);
+CREATE INDEX index_namespaces_on_traversal_ids_for_groups ON namespaces USING gin (traversal_ids) WHERE ((type)::text = 'Group'::text);
+
+CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id);
+
+CREATE INDEX index_namespaces_public_groups_name_id ON namespaces USING btree (name, id) WHERE (((type)::text = 'Group'::text) AND (visibility_level = 20));
+
+CREATE INDEX index_namespaces_sync_events_on_namespace_id ON namespaces_sync_events USING btree (namespace_id);
CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON members USING btree (source_id, source_type) WHERE ((requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text));
@@ -26837,8 +29425,6 @@ CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id);
CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code);
-CREATE INDEX index_notes_on_note_trigram ON notes USING gin (note gin_trgm_ops);
-
CREATE INDEX index_notes_on_noteable_id_and_noteable_type_and_system ON notes USING btree (noteable_id, noteable_type, system);
CREATE INDEX index_notes_on_project_id_and_id_and_system_false ON notes USING btree (project_id, id) WHERE (NOT system);
@@ -26871,6 +29457,8 @@ CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON oauth_openid_requ
CREATE UNIQUE INDEX index_on_deploy_keys_id_and_type_and_public ON keys USING btree (id, type) WHERE (public = true);
+CREATE INDEX index_on_group_id_on_webhooks ON web_hooks USING btree (group_id);
+
CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USING btree (lower((extern_uid)::text), provider);
CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at);
@@ -26895,10 +29483,6 @@ CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path):
CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text));
-CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time);
-
-CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at);
-
CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text));
CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username)::text));
@@ -26917,8 +29501,6 @@ CREATE UNIQUE INDEX index_onboarding_progresses_on_namespace_id ON onboarding_pr
CREATE INDEX index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at ON incident_management_oncall_shifts USING btree (rotation_id, starts_at, ends_at);
-CREATE INDEX index_open_project_tracker_data_on_service_id ON open_project_tracker_data USING btree (service_id);
-
CREATE INDEX index_operations_feature_flags_issues_on_issue_id ON operations_feature_flags_issues USING btree (issue_id);
CREATE UNIQUE INDEX index_operations_feature_flags_on_project_id_and_iid ON operations_feature_flags USING btree (project_id, iid);
@@ -26973,6 +29555,8 @@ CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree
CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel);
+CREATE INDEX index_packages_helm_file_metadata_on_pf_id_and_channel ON packages_helm_file_metadata USING btree (package_file_id, channel);
+
CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path);
CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path);
@@ -26993,6 +29577,8 @@ CREATE INDEX index_packages_package_files_on_file_store ON packages_package_file
CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON packages_package_files USING btree (package_id, file_name);
+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_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);
@@ -27015,6 +29601,16 @@ CREATE INDEX index_packages_tags_on_package_id ON packages_tags USING btree (pac
CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags USING btree (package_id, updated_at DESC);
+CREATE INDEX index_pages_deployment_states_failed_verification ON pages_deployment_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
+
+CREATE INDEX index_pages_deployment_states_needs_verification ON pages_deployment_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
+
+CREATE INDEX index_pages_deployment_states_on_pages_deployment_id ON pages_deployment_states USING btree (pages_deployment_id);
+
+CREATE INDEX index_pages_deployment_states_on_verification_state ON pages_deployment_states USING btree (verification_state);
+
+CREATE INDEX index_pages_deployment_states_pending_verification ON pages_deployment_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
+
CREATE INDEX index_pages_deployments_on_ci_build_id ON pages_deployments USING btree (ci_build_id);
CREATE INDEX index_pages_deployments_on_file_store_and_id ON pages_deployments USING btree (file_store, id);
@@ -27081,6 +29677,8 @@ CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_index
CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier);
+CREATE INDEX index_postgres_reindex_queued_actions_on_state ON postgres_reindex_queued_actions USING btree (state);
+
CREATE UNIQUE INDEX index_programming_languages_on_name ON programming_languages USING btree (name);
CREATE INDEX index_project_access_tokens_on_project_id ON project_access_tokens USING btree (project_id);
@@ -27277,6 +29875,8 @@ CREATE INDEX index_projects_on_star_count ON projects USING btree (star_count);
CREATE INDEX index_projects_on_updated_at_and_id ON projects USING btree (updated_at, id);
+CREATE INDEX index_projects_sync_events_on_project_id ON projects_sync_events USING btree (project_id);
+
CREATE UNIQUE INDEX index_prometheus_alert_event_scoped_payload_key ON prometheus_alert_events USING btree (prometheus_alert_id, payload_key);
CREATE INDEX index_prometheus_alert_events_on_project_id_and_status ON prometheus_alert_events USING btree (project_id, status);
@@ -27355,7 +29955,7 @@ CREATE UNIQUE INDEX index_release_links_on_release_id_and_name ON release_links
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 ON releases USING btree (author_id);
+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);
@@ -27625,8 +30225,6 @@ CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadat
CREATE INDEX index_taggings_on_tag_id ON taggings USING btree (tag_id);
-CREATE INDEX index_taggings_on_taggable_id_and_taggable_type ON taggings USING btree (taggable_id, taggable_type);
-
CREATE INDEX index_taggings_on_taggable_id_and_taggable_type_and_context ON taggings USING btree (taggable_id, taggable_type, context);
CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name);
@@ -27683,6 +30281,8 @@ 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_user_id_and_id ON todos USING btree (project_id, user_id, id);
+
CREATE INDEX index_todos_on_target_type_and_target_id ON todos USING btree (target_type, target_id);
CREATE INDEX index_todos_on_user_id ON todos USING btree (user_id);
@@ -27697,6 +30297,10 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING
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);
+
+CREATE INDEX index_topics_total_projects_count ON topics USING btree (total_projects_count DESC, id);
+
CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects USING btree (project_id);
CREATE INDEX index_u2f_registrations_on_key_handle ON u2f_registrations USING btree (key_handle);
@@ -27715,6 +30319,16 @@ CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_fail
CREATE UNIQUE INDEX index_upcoming_reconciliations_on_namespace_id ON upcoming_reconciliations USING btree (namespace_id);
+CREATE INDEX index_upload_states_failed_verification ON upload_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
+
+CREATE INDEX index_upload_states_needs_verification ON upload_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
+
+CREATE INDEX index_upload_states_on_upload_id ON upload_states USING btree (upload_id);
+
+CREATE INDEX index_upload_states_on_verification_state ON upload_states USING btree (verification_state);
+
+CREATE INDEX index_upload_states_pending_verification ON upload_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
+
CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum);
CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type);
@@ -27735,10 +30349,18 @@ CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id ON user_canonical_ema
CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id_and_canonical_email ON user_canonical_emails USING btree (user_id, canonical_email);
+CREATE INDEX index_user_credit_card_validations_meta_data_full_match ON user_credit_card_validations USING btree (holder_name, expiration_date, last_digits, credit_card_validated_at);
+
+CREATE INDEX index_user_credit_card_validations_meta_data_partial_match ON user_credit_card_validations USING btree (expiration_date, last_digits, network, credit_card_validated_at);
+
CREATE INDEX index_user_custom_attributes_on_key_and_value ON user_custom_attributes USING btree (key, value);
CREATE UNIQUE INDEX index_user_custom_attributes_on_user_id_and_key ON user_custom_attributes USING btree (user_id, key);
+CREATE UNIQUE INDEX index_user_details_on_phone ON user_details USING btree (phone) WHERE (phone IS NOT NULL);
+
+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);
@@ -27777,7 +30399,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_non_internal_active ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 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 IS NULL) OR (user_type = 4)));
CREATE INDEX index_users_on_incoming_email_token ON users USING btree (incoming_email_token);
@@ -27787,7 +30409,7 @@ CREATE INDEX index_users_on_name ON users USING btree (name);
CREATE INDEX index_users_on_name_trigram ON users USING gin (name gin_trgm_ops);
-CREATE INDEX index_users_on_public_email ON users USING btree (public_email) WHERE ((public_email)::text <> ''::text);
+CREATE INDEX index_users_on_public_email_excluding_null_and_empty ON users USING btree (public_email) WHERE (((public_email)::text <> ''::text) AND (public_email IS NOT NULL));
CREATE INDEX index_users_on_require_two_factor_authentication_from_group ON users USING btree (require_two_factor_authentication_from_group) WHERE (require_two_factor_authentication_from_group = true);
@@ -27823,6 +30445,8 @@ CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users
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_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);
@@ -27893,12 +30517,20 @@ CREATE INDEX index_vulnerability_occurrence_identifiers_on_identifier_id ON vuln
CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON vulnerability_occurrence_identifiers USING btree (occurrence_id, identifier_id);
+CREATE INDEX index_vulnerability_occurrence_pipelines_occurrence_id_and_id ON vulnerability_occurrence_pipelines USING btree (occurrence_id, id DESC);
+
CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id);
CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint);
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_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);
CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerability_occurrences USING btree (project_fingerprint);
@@ -27911,6 +30543,14 @@ 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_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);
+
+CREATE UNIQUE INDEX index_vulnerability_reads_on_uuid ON vulnerability_reads USING btree (uuid);
+
+CREATE UNIQUE INDEX index_vulnerability_reads_on_vulnerability_id ON vulnerability_reads USING btree (vulnerability_id);
+
CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum ON vulnerability_remediations USING btree (project_id, checksum);
CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id);
@@ -28021,21 +30661,15 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree
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_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true);
-
-CREATE INDEX tmp_index_ci_builds_lock_version ON ci_builds USING btree (id) WHERE (lock_version IS NULL);
-
CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL);
-CREATE INDEX tmp_index_ci_stages_lock_version ON ci_stages USING btree (id_convert_to_bigint) WHERE (lock_version IS NULL);
-
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[]));
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[]));
-CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
+CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USING btree (tmp_project_id);
-CREATE INDEX tmp_index_taggings_on_id_where_taggable_type_project ON taggings USING btree (id) WHERE ((taggable_type)::text = 'Project'::text);
+CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
@@ -28061,6 +30695,8 @@ CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback
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;
@@ -28117,15 +30753,49 @@ 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_202307_pkey;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211_pkey;
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308_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_202308_entity_id_entity_type_id_author_id_crea_idx;
+
+ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308_pkey;
+
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309_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_202309_entity_id_entity_type_id_author_id_crea_idx;
+
+ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309_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;
+
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx2;
+
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx3;
+
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx4;
-ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212_pkey;
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx5;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_20221_rule_id_idx;
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx6;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2022_alert_id_idx;
+ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx7;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2022_rule_id_idx1;
+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;
+
+ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307_pkey;
+
+ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308_pkey;
+
+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;
@@ -28141,6 +30811,10 @@ ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION
ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307_pkey;
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309_pkey;
+
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 index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_alert_id_idx;
@@ -28157,7 +30831,9 @@ 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_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_idx1;
+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_idx2;
@@ -28171,33 +30847,9 @@ 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_idx7;
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2_schedule_id_idx;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx1;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx2;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx3;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx4;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx5;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx6;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx7;
-
-ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx8;
-
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211_pkey;
-
-ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212_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_idx8;
-ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_20221_rule_id_idx;
-
-ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2022_issue_id_idx;
-
-ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2022_rule_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_idx9;
ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301_pkey;
@@ -28213,6 +30865,10 @@ ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION
ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307_pkey;
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309_pkey;
+
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 index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_issue_id_idx;
@@ -28229,7 +30885,9 @@ 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_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_idx1;
+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_idx2;
@@ -28243,31 +30901,53 @@ 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_idx7;
+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_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_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_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_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_eecfac613f;
-
ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea;
-ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000_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 loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212_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 loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301_pkey;
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303_pkey;
-ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302_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 loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303_pkey;
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304_pkey;
-ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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;
-ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey;
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305_pkey;
+
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305_visitor_id_code_phone_created_at_idx;
+
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306_pkey;
+
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306_visitor_id_code_phone_created_at_idx;
+
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307_pkey;
+
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307_visitor_id_code_phone_created_at_idx;
+
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308_pkey;
+
+ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308_visitor_id_code_phone_created_at_idx;
+
+ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309_pkey;
+
+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;
@@ -28309,6 +30989,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_202307_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_202308_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308_pkey;
+
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308_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_202309_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309_pkey;
+
+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 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;
@@ -28437,6 +31129,906 @@ ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PAR
ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31_pkey;
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_000925dbd7;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_03aa30a758;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_055179c3ea;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_061fe00461;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_070cef72c3;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_08e3cfc564;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_09af45dd6f;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_0c153e2eae;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0ca85f3d71;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0d837a5dda;
+
+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;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_107e123e17;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1230a7a402;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_142c4e7ea4;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_14e4fa1d7d;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_14f3645821;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_16627b455e;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1af932a3c7;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1b0ea30bdb;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1f6c3faabe;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1f8af04ed1;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_201c5ddbe9;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_20353089e0;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_206349925b;
+
+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;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2208bd7d7f;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_223592b4a1;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_22acc9ab11;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_22ed8f01dd;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_234d38a657;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_23783dc748;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_241e9a574c;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_24ac321751;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_25e2aaee9b;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2653e7eeb8;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_2745f5a388;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_27759556bc;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_27d7ad78d8;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_281840d2d1;
+
+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;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2b7c0a294e;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2c6422f668;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2dfcdbe81e;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2e1054b181;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2e6991d05b;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2f80c360c3;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2fc271c673;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_2fcfd0dc70;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_3005c75335;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3206c1e6af;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3249505125;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_331eb67441;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3640194b77;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_372160a706;
+
+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;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_399dc06649;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3a10b315c0;
+
+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_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;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_436fa9ad5f;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_453a659cb6;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_46b989b294;
+
+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_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;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4b1793a4c4;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4b22560035;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4c2645eef2;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4c9d14f978;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4d04210a95;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4d4f2f7de6;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4db5aa5872;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4dead6f314;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4e6ce1c371;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4f2eb7a06b;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4f6fc34e57;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_52ea79bf8e;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_541cc045fc;
+
+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_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_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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_5b944f308d;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5bc2f32084;
+
+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_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;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5f96b344e2;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5fb1867c41;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5fe1d00845;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_60e3480f23;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_6137e27484;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_620fe77c99;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_625ed9e965;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_64e3a1dfa1;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_64eb4cf8bd;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6580ecb2db;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_6a39f6d5ac;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6add8e74cf;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6b1ce61c8f;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_6cfb391b86;
+
+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;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6ec4c4afd4;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6f4e0abe54;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6fa47e1334;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_72027c157f;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_739845f617;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_74addd1240;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_75dc81d1d7;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_765b0cd8db;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_77096a1dc6;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_77c6293242;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_7b7c85eceb;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_7da2307d2e;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_7ead2300ca;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_7ecb5b68b4;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_80c65daf20;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_81b9cf594f;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_82c675952c;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_844abd2888;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8464227c80;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8685d7c69c;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_8688b40056;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_87d40fb9f9;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_88b40d6740;
+
+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_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_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_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;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9955b1dc59;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_9b8e89ae41;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a2d9f185a5;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a3feed3097;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_a8276a450f;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a88f20fc98;
+
+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_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;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ab22231a16;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_abbdf80ab1;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_aee84adb5b;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b1dda405af;
+
+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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_b83fe1306b;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bc189e47ab;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_bca83177ef;
+
+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_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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c119f5b92e;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c17dae3605;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c1cdd90d0d;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c2b951bf20;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c42b2e7eae;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c435d904ce;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c473921734;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c546bb0736;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c59cde6209;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c66758baa7;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c6ea8a0e26;
+
+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_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_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_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_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d0d285c264;
+
+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_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_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_group_duration ATTACH PARTITION gitlab_partitions_static.index_dc571ba649;
+
+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_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;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e54adf9acb;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e6405afea0;
+
+ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e64588e276;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e716b8ac3f;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e73bc5ba6a;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e8f3a327b2;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ea0c2d3361;
+
+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_project_duration ATTACH PARTITION gitlab_partitions_static.index_ed094a4f13;
+
+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;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_ef7be2ae94;
+
+ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f0cdd09a5e;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f112fae8ac;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f1c3d14cdc;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f256d3f6a1;
+
+ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_f2848acfc7;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f3d7d86e09;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f47327ec1f;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f6b0d458a3;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f705dc8541;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f76e8a5304;
+
+ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f86acdc2ff;
+
+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_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;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fccbe45c32;
+
+ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_fee429223e;
+
+ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ff00c038cc;
+
+ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ff39be5400;
+
+ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ff8741d8d7;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_pkey;
+
+ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_search_vector_idx;
+
+ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_issue_id_idx;
+
+ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_pkey;
+
+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;
@@ -28693,31 +32285,19 @@ 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;
-CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e();
-
-CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957();
-
-CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2();
+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 trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_490d204c00b3();
+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();
-CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e();
+CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
-CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10();
+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 trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482();
+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 trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3();
+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 trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b();
-
-CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON dep_ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6();
-
-CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3();
-
-CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002();
-
-CREATE TRIGGER trigger_f1ca8ec18d78 BEFORE INSERT OR UPDATE ON geo_job_artifact_deleted_events FOR EACH ROW EXECUTE FUNCTION trigger_f1ca8ec18d78();
+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_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();
@@ -28733,8 +32313,43 @@ 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_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();
+
+CREATE TRIGGER trigger_projects_parent_id_on_insert AFTER INSERT ON projects FOR EACH ROW EXECUTE FUNCTION insert_projects_sync_event();
+
+CREATE TRIGGER trigger_projects_parent_id_on_update AFTER UPDATE ON projects FOR EACH ROW WHEN ((old.namespace_id IS DISTINCT FROM new.namespace_id)) EXECUTE FUNCTION insert_projects_sync_event();
+
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;
+
+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;
+
+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;
+
+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;
+
+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;
+
ALTER TABLE ONLY chat_names
ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -28744,9 +32359,6 @@ ALTER TABLE ONLY deployments
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_013c9f36ca FOREIGN KEY (due_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
-ALTER TABLE ONLY clusters_applications_runners
- ADD CONSTRAINT fk_02de2ded36 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY incident_management_escalation_rules
ADD CONSTRAINT fk_0314ee86eb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -28756,9 +32368,6 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY design_management_designs_versions
ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE;
-ALTER TABLE ONLY terraform_state_versions
- ADD CONSTRAINT fk_04b91e4a9f FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -28771,6 +32380,9 @@ ALTER TABLE ONLY projects
ALTER TABLE ONLY dast_sites
ADD CONSTRAINT fk_0a57f2271b FOREIGN KEY (dast_site_validation_id) REFERENCES dast_site_validations(id) ON DELETE SET NULL;
+ALTER TABLE ONLY issue_customer_relations_contacts
+ ADD CONSTRAINT fk_0c0037f723 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY web_hooks
ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -28783,12 +32395,18 @@ ALTER TABLE ONLY lists
ALTER TABLE ONLY ci_unit_test_failures
ADD CONSTRAINT fk_0f09856e1f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY deployment_approvals
+ ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_pages_metadata
ADD CONSTRAINT fk_0fd5b22688 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE SET NULL;
ALTER TABLE ONLY group_deletion_schedules
ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY member_tasks
+ ADD CONSTRAINT fk_12816d4bbb FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_1302949740 FOREIGN KEY (last_edited_by_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -28807,6 +32425,12 @@ ALTER TABLE ONLY internal_ids
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_176d3fbb5d FOREIGN KEY (job_artifact_deleted_event_id) REFERENCES geo_job_artifact_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_17a5fafbd4 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_1800597ef9 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY project_features
ADD CONSTRAINT fk_18513d9b92 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -28819,6 +32443,9 @@ ALTER TABLE ONLY analytics_devops_adoption_segments
ALTER TABLE ONLY user_details
ADD CONSTRAINT fk_190e4fcc88 FOREIGN KEY (provisioned_by_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+ALTER TABLE ONLY agent_project_authorizations
+ ADD CONSTRAINT fk_1d30bb4987 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL;
@@ -28828,6 +32455,9 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
+ALTER TABLE ONLY coverage_fuzzing_corpuses
+ ADD CONSTRAINT fk_204d40056a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY geo_container_repository_updated_events
ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE;
@@ -28849,24 +32479,33 @@ ALTER TABLE ONLY import_failures
ALTER TABLE ONLY project_ci_cd_settings
ADD CONSTRAINT fk_24c15d2f2e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT fk_256c631779 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_25b99c1be3 FOREIGN KEY (parent_id) REFERENCES epics(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_262d4c2d19 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-ALTER TABLE ONLY dep_ci_build_trace_sections
- ADD CONSTRAINT fk_264e112c66 FOREIGN KEY (section_name_id) REFERENCES dep_ci_build_trace_section_names(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_27548c6db3 FOREIGN KEY (hashed_storage_migrated_event_id) REFERENCES geo_hashed_storage_migrated_events(id) ON DELETE CASCADE;
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL;
+ALTER TABLE ONLY merge_requests_compliance_violations
+ ADD CONSTRAINT fk_290ec1ab02 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY coverage_fuzzing_corpuses
+ ADD CONSTRAINT fk_29f6f15f82 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY agent_group_authorizations
ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+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;
@@ -28912,12 +32551,18 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY push_event_payloads
ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_38a74279df FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
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
ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT fk_3af186389b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL;
@@ -28933,6 +32578,9 @@ ALTER TABLE ONLY ci_pipeline_schedule_variables
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_42c3b54bed FOREIGN KEY (cache_invalidation_event_id) REFERENCES geo_cache_invalidation_events(id) ON DELETE CASCADE;
+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;
@@ -28945,8 +32593,8 @@ ALTER TABLE ONLY releases
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_4a99ebfd60 FOREIGN KEY (repositories_changed_event_id) REFERENCES geo_repositories_changed_events(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dep_ci_build_trace_sections
- ADD CONSTRAINT fk_4ebe41f502 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_reads
+ ADD CONSTRAINT fk_5001652292 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_51ab4b6089 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id) ON DELETE CASCADE;
@@ -28996,6 +32644,9 @@ ALTER TABLE ONLY dast_profile_schedules
ALTER TABLE ONLY events
ADD CONSTRAINT fk_61fbf6ca48 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_reads
+ ADD CONSTRAINT fk_62736f638f FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_641731faff FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -29011,6 +32662,9 @@ ALTER TABLE ONLY application_settings
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
+ALTER TABLE ONLY namespaces
+ ADD CONSTRAINT fk_6a77f66919 FOREIGN KEY (tmp_project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
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;
@@ -29071,6 +32725,9 @@ ALTER TABLE ONLY protected_branches
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY issue_customer_relations_contacts
+ ADD CONSTRAINT fk_7b92f835bb FOREIGN KEY (contact_id) REFERENCES customer_relations_contacts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@@ -29188,6 +32845,9 @@ ALTER TABLE ONLY issues
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_9d480c64b2 FOREIGN KEY (start_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
+ALTER TABLE ONLY user_group_callouts
+ ADD CONSTRAINT fk_9dc8b9d4b2 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY protected_environments
ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -29251,6 +32911,9 @@ ALTER TABLE ONLY identities
ALTER TABLE ONLY boards
ADD CONSTRAINT fk_ab0a250ff6 FOREIGN KEY (iteration_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE;
+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;
@@ -29278,6 +32941,9 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY project_access_tokens
ADD CONSTRAINT fk_b27801bfbf FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_reads
+ ADD CONSTRAINT fk_b28c28abf1 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_b37be69be6 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id);
@@ -29296,6 +32962,9 @@ ALTER TABLE ONLY external_status_checks_protected_branches
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT fk_b7d881734a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_project_authorizations
+ ADD CONSTRAINT fk_b7fe9b4777 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_trigger_requests
ADD CONSTRAINT fk_b8ec8b7245 FOREIGN KEY (trigger_id) REFERENCES ci_triggers(id) ON DELETE CASCADE;
@@ -29332,12 +33001,12 @@ ALTER TABLE ONLY design_management_versions
ALTER TABLE ONLY packages_packages
ADD CONSTRAINT fk_c188f0dba4 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL;
-ALTER TABLE ONLY geo_event_log
- ADD CONSTRAINT fk_c1f241c70d FOREIGN KEY (upload_deleted_event_id) REFERENCES geo_upload_deleted_events(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_c3339bdfc9 FOREIGN KEY (stage_event_hash_id) REFERENCES analytics_cycle_analytics_stage_event_hashes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY user_group_callouts
+ ADD CONSTRAINT fk_c366e12ec3 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_exports
ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -29350,6 +33019,12 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_c63cbf6c25 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT fk_c815368376 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT fk_c8b006d40f FOREIGN KEY (agent_token_id) REFERENCES cluster_agent_tokens(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY issue_links
ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -29398,9 +33073,15 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_d5af95fcd9 FOREIGN KEY (lfs_object_deleted_event_id) REFERENCES geo_lfs_object_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_timeline_events
+ ADD CONSTRAINT fk_d606a2a890 FOREIGN KEY (promoted_from_note_id) REFERENCES notes(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_activity_events
+ ADD CONSTRAINT fk_d6f785c9fc FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY metrics_users_starred_dashboards
ADD CONSTRAINT fk_d76a2b9a8c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29488,9 +33169,15 @@ ALTER TABLE ONLY pages_domains
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_ec757bd087 FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
+ALTER TABLE ONLY merge_requests_compliance_violations
+ ADD CONSTRAINT fk_ec881c1c6f FOREIGN KEY (violating_user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY events
ADD CONSTRAINT fk_edfd187b6f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY coverage_fuzzing_corpuses
+ ADD CONSTRAINT fk_ef5ebf339f FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_efb96ab1e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29713,9 +33400,6 @@ ALTER TABLE ONLY project_deploy_tokens
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_1722574860 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE;
-ALTER TABLE ONLY packages_build_infos
- ADD CONSTRAINT fk_rails_17a9a0dffc FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY security_orchestration_policy_rule_schedules
ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE;
@@ -29737,9 +33421,6 @@ ALTER TABLE ONLY bulk_import_failures
ALTER TABLE ONLY group_wiki_repositories
ADD CONSTRAINT fk_rails_19755e374b FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT;
-ALTER TABLE ONLY open_project_tracker_data
- ADD CONSTRAINT fk_rails_1987546e48 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY gpg_signatures
ADD CONSTRAINT fk_rails_19d4f1c6f9 FOREIGN KEY (gpg_key_subkey_id) REFERENCES gpg_key_subkeys(id) ON DELETE SET NULL;
@@ -29824,9 +33505,6 @@ ALTER TABLE ONLY incident_management_oncall_rotations
ALTER TABLE ONLY ci_unit_test_failures
ADD CONSTRAINT fk_rails_259da3e79c FOREIGN KEY (unit_test_id) REFERENCES ci_unit_tests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY analytics_devops_adoption_snapshots
- ADD CONSTRAINT fk_rails_25da9a92c0 FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY cluster_agents
ADD CONSTRAINT fk_rails_25e9fc2d5d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29983,9 +33661,6 @@ ALTER TABLE ONLY snippet_user_mentions
ALTER TABLE ONLY clusters_applications_helm
ADD CONSTRAINT fk_rails_3e2b1c06bc FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
-ALTER TABLE ONLY packages_package_file_build_infos
- ADD CONSTRAINT fk_rails_3e3f630188 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY epic_user_mentions
ADD CONSTRAINT fk_rails_3eaf4d88cc FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE;
@@ -30001,6 +33676,9 @@ ALTER TABLE ONLY description_versions
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_40cc7ccbc3 FOREIGN KEY (cluster_project_id) REFERENCES cluster_projects(id) ON DELETE SET NULL;
+ALTER TABLE ONLY lfs_object_states
+ ADD CONSTRAINT fk_rails_4188448cd5 FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY geo_node_namespace_links
ADD CONSTRAINT fk_rails_41ff5fb854 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -30010,9 +33688,6 @@ ALTER TABLE ONLY epic_issues
ALTER TABLE ONLY ci_refs
ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY security_orchestration_policy_configurations
- ADD CONSTRAINT fk_rails_42ed6c25ec FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE RESTRICT;
-
ALTER TABLE ONLY ci_resources
ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE;
@@ -30424,6 +34099,9 @@ ALTER TABLE ONLY application_settings
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_7e7688ecaf FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_job_artifact_states
+ ADD CONSTRAINT fk_rails_80a9cba3b2 FOREIGN KEY (job_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_merge_request_rules_users
ADD CONSTRAINT fk_rails_80e6801803 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE;
@@ -30598,6 +34276,9 @@ ALTER TABLE ONLY gpg_keys
ALTER TABLE ONLY analytics_language_trend_repository_languages
ADD CONSTRAINT fk_rails_9d851d566c FOREIGN KEY (programming_language_id) REFERENCES programming_languages(id) ON DELETE CASCADE;
+ALTER TABLE ONLY namespaces_sync_events
+ ADD CONSTRAINT fk_rails_9da32a0431 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY badges
ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -30679,9 +34360,6 @@ ALTER TABLE ONLY merge_request_user_mentions
ALTER TABLE ONLY x509_commit_signatures
ADD CONSTRAINT fk_rails_ab07452314 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dep_ci_build_trace_sections
- ADD CONSTRAINT fk_rails_ab7c104e26 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_abf5d4affa FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -30745,6 +34423,9 @@ ALTER TABLE ONLY packages_debian_project_component_files
ALTER TABLE ONLY namespace_aggregation_schedules
ADD CONSTRAINT fk_rails_b565c8d16c FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE batched_background_migration_job_transition_logs
+ ADD CONSTRAINT fk_rails_b7523a175b FOREIGN KEY (batched_background_migration_job_id) REFERENCES batched_background_migration_jobs(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_project_rules_protected_branches
ADD CONSTRAINT fk_rails_b7567b031b FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
@@ -30769,6 +34450,9 @@ ALTER TABLE ONLY security_findings
ALTER TABLE ONLY packages_debian_project_component_files
ADD CONSTRAINT fk_rails_bbe9ebfbd9 FOREIGN KEY (component_id) REFERENCES packages_debian_project_components(id) ON DELETE RESTRICT;
+ALTER TABLE ONLY projects_sync_events
+ ADD CONSTRAINT fk_rails_bbf0eef59f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_merge_request_rules_users
ADD CONSTRAINT fk_rails_bc8972fa55 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -30802,6 +34486,9 @@ ALTER TABLE ONLY atlassian_identities
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT fk_rails_c09009dee1 FOREIGN KEY (pages_domain_id) REFERENCES pages_domains(id) ON DELETE CASCADE;
+ALTER TABLE ONLY packages_npm_metadata
+ ADD CONSTRAINT fk_rails_c0e5fce6f3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY labels
ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -30820,9 +34507,6 @@ ALTER TABLE ONLY packages_nuget_dependency_link_metadata
ALTER TABLE ONLY group_deploy_keys_groups
ADD CONSTRAINT fk_rails_c3854f19f5 FOREIGN KEY (group_deploy_key_id) REFERENCES group_deploy_keys(id) ON DELETE CASCADE;
-ALTER TABLE ONLY pages_deployments
- ADD CONSTRAINT fk_rails_c3a90cf29b FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
@@ -30895,6 +34579,9 @@ ALTER TABLE ONLY resource_iteration_events
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;
+
ALTER TABLE ONLY epic_metrics
ADD CONSTRAINT fk_rails_d071904753 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE;
@@ -30988,6 +34675,9 @@ ALTER TABLE ONLY packages_packages
ALTER TABLE ONLY cluster_platforms_kubernetes
ADD CONSTRAINT fk_rails_e1e2cf841a FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
+ALTER TABLE ONLY issue_emails
+ ADD CONSTRAINT fk_rails_e2ee00a8f7 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT fk_rails_e3205a0c65 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
@@ -31102,9 +34792,6 @@ ALTER TABLE ONLY snippet_repositories
ALTER TABLE ONLY elastic_reindexing_subtasks
ADD CONSTRAINT fk_rails_f2cc190164 FOREIGN KEY (elastic_reindexing_task_id) REFERENCES elastic_reindexing_tasks(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_chat_data
- ADD CONSTRAINT fk_rails_f300456b63 FOREIGN KEY (chat_name_id) REFERENCES chat_names(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY approval_project_rules_users
ADD CONSTRAINT fk_rails_f365da8250 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -31141,9 +34828,6 @@ ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
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 dep_ci_build_trace_section_names
- ADD CONSTRAINT fk_rails_f8cd72cd26 FOREIGN KEY (project_id) REFERENCES projects(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;
@@ -31171,9 +34855,6 @@ ALTER TABLE ONLY ci_job_variables
ALTER TABLE ONLY packages_nuget_metadata
ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
-ALTER TABLE incident_management_pending_alert_escalations
- ADD CONSTRAINT fk_rails_fcbfd9338b FOREIGN KEY (schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY customer_relations_contacts
ADD CONSTRAINT fk_rails_fd3f2e7572 FOREIGN KEY (organization_id) REFERENCES customer_relations_organizations(id) ON DELETE CASCADE;
@@ -31192,9 +34873,15 @@ ALTER TABLE ONLY project_tracing_settings
ALTER TABLE ONLY resource_label_events
ADD CONSTRAINT fk_rails_fe91ece594 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+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;
+
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -31213,6 +34900,12 @@ ALTER TABLE ONLY timelogs
ALTER TABLE ONLY u2f_registrations
ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE issue_search_data
+ ADD CONSTRAINT issue_search_data_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
+ALTER TABLE issue_search_data
+ ADD CONSTRAINT issue_search_data_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
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;
diff --git a/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb b/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb
deleted file mode 100644
index bc515bc061c..00000000000
--- a/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleAuthenticatedGitLfsColumns < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period, :integer, default: 1000, null: false
- add_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds, :integer, default: 60, null: false
- add_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period
- remove_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds
- remove_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean
- end
- end
-end
diff --git a/db/migrate/20210830140524_add_state_to_member.rb b/db/migrate/20210830140524_add_state_to_member.rb
deleted file mode 100644
index 6009376badb..00000000000
--- a/db/migrate/20210830140524_add_state_to_member.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateToMember < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- unless column_exists?(:members, :state)
- with_lock_retries do
- add_column :members, :state, :integer, limit: 2, default: 0
- end
- end
- end
-
- def down
- if column_exists?(:members, :state)
- with_lock_retries do
- remove_column :members, :state
- end
- end
- end
-end
diff --git a/db/migrate/20210830154358_add_yaml_limit_constraints.rb b/db/migrate/20210830154358_add_yaml_limit_constraints.rb
deleted file mode 100644
index 74236993fff..00000000000
--- a/db/migrate/20210830154358_add_yaml_limit_constraints.rb
+++ /dev/null
@@ -1,25 +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 AddYamlLimitConstraints < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- SIZE_CONSTRAINT_NAME = 'app_settings_yaml_max_size_positive'
- DEPTH_CONSTRAINT_NAME = 'app_settings_yaml_max_depth_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :application_settings, 'max_yaml_size_bytes > 0', SIZE_CONSTRAINT_NAME
- add_check_constraint :application_settings, 'max_yaml_depth > 0', DEPTH_CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :application_settings, SIZE_CONSTRAINT_NAME
- remove_check_constraint :application_settings, DEPTH_CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb b/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb
deleted file mode 100644
index a3366bd9ddb..00000000000
--- a/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPackageFileIdChannelIdxToPackagesHelmFileMetadata < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_helm_file_metadata_on_pf_id_and_channel'
-
- def up
- add_concurrent_index :packages_helm_file_metadata, [:package_file_id, :channel], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :packages_helm_file_metadata, [:package_file_id, :channel], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb b/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb
deleted file mode 100644
index 5e65b5c0fe1..00000000000
--- a/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddInstallableHelmPkgsIdxToPackages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_installable_helm_pkgs_on_project_id_id'
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :packages_packages, [:project_id, :id], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210831203408_upsert_base_work_item_types.rb b/db/migrate/20210831203408_upsert_base_work_item_types.rb
deleted file mode 100644
index 9a556bd6c2c..00000000000
--- a/db/migrate/20210831203408_upsert_base_work_item_types.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class UpsertBaseWorkItemTypes < ActiveRecord::Migration[6.1]
- module WorkItem
- class Type < ActiveRecord::Base
- self.table_name = 'work_item_types'
-
- enum base_type: {
- issue: 0,
- incident: 1,
- test_case: 2,
- requirement: 3
- }
- end
- end
-
- def up
- # upsert default types
- WorkItem::Type.find_or_create_by(name: 'Issue', namespace_id: nil, base_type: :issue, icon_name: 'issue-type-issue')
- WorkItem::Type.find_or_create_by(name: 'Incident', namespace_id: nil, base_type: :incident, icon_name: 'issue-type-incident')
- WorkItem::Type.find_or_create_by(name: 'Test Case', namespace_id: nil, base_type: :test_case, icon_name: 'issue-type-test-case')
- WorkItem::Type.find_or_create_by(name: 'Requirement', namespace_id: nil, base_type: :requirement, icon_name: 'issue-type-requirements')
- end
-
- def down
- # We expect this table to be empty at the point of the up migration,
- # however there is a remote possibility that issues could already be
- # using one of these types, with a tight foreign constraint.
- # Therefore we will not attempt to remove any data.
- end
-end
diff --git a/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb b/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb
deleted file mode 100644
index e0c9d932b38..00000000000
--- a/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnNameAndIdToPublicGroups < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_namespaces_public_groups_name_id'
- PUBLIC_VISIBILITY_LEVEL = 20
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, [:name, :id],
- name: INDEX_NAME,
- where: "type = 'Group' AND visibility_level = #{PUBLIC_VISIBILITY_LEVEL}"
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb b/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb
deleted file mode 100644
index 3c022cbaf5e..00000000000
--- a/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddLatestColumnIntoTheSecurityScansTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :security_scans, :latest, :boolean, default: true, null: false
- end
-
- def down
- remove_column :security_scans, :latest
- end
-end
diff --git a/db/migrate/20210902171808_set_default_job_token_scope_false.rb b/db/migrate/20210902171808_set_default_job_token_scope_false.rb
deleted file mode 100644
index 0680382094f..00000000000
--- a/db/migrate/20210902171808_set_default_job_token_scope_false.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class SetDefaultJobTokenScopeFalse < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-end
diff --git a/db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb b/db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb
deleted file mode 100644
index 4638637331d..00000000000
--- a/db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddExpireAccessTokensToDoorkeeperApplication < Gitlab::Database::Migration[1.0]
- def change
- add_column :oauth_applications, :expire_access_tokens, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb b/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb
deleted file mode 100644
index 6c5d23d8703..00000000000
--- a/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-class RecreateStageIssueEventsTableWithBigints < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- drop_table :analytics_cycle_analytics_issue_stage_events # rubocop:disable Migration/DropTable
-
- execute <<~SQL
- CREATE TABLE analytics_cycle_analytics_issue_stage_events (
- stage_event_hash_id bigint NOT NULL,
- issue_id bigint NOT NULL,
- group_id bigint NOT NULL,
- project_id bigint NOT NULL,
- milestone_id bigint,
- author_id bigint,
- start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone,
- PRIMARY KEY (stage_event_hash_id, issue_id)
- ) PARTITION BY HASH (stage_event_hash_id)
- SQL
-
- create_hash_partitions :analytics_cycle_analytics_issue_stage_events, 32
- end
-
- def down
- drop_table :analytics_cycle_analytics_issue_stage_events
-
- execute <<~SQL
- CREATE TABLE analytics_cycle_analytics_issue_stage_events (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
- start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone,
- PRIMARY KEY (stage_event_hash_id, issue_id)
- ) PARTITION BY HASH (stage_event_hash_id)
- SQL
-
- create_hash_partitions :analytics_cycle_analytics_issue_stage_events, 32
- end
-end
diff --git a/db/migrate/20210906100021_delete_project_namespace_trigger.rb b/db/migrate/20210906100021_delete_project_namespace_trigger.rb
deleted file mode 100644
index ce68cf7d6d4..00000000000
--- a/db/migrate/20210906100021_delete_project_namespace_trigger.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteProjectNamespaceTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- TRIGGER_NAME = "trigger_delete_project_namespace_on_project_delete"
- FUNCTION_NAME = 'delete_associated_project_namespace'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- DELETE FROM namespaces
- WHERE namespaces.id = OLD.project_namespace_id AND
- namespaces.type = 'Project';
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL.squish)
- CREATE TRIGGER #{TRIGGER_NAME}
- AFTER DELETE ON projects FOR EACH ROW
- WHEN (OLD.project_namespace_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:projects, TRIGGER_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb b/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb
deleted file mode 100644
index 540344bd761..00000000000
--- a/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupIdFkeyForUserGroupCallout < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :user_group_callouts, :namespaces, column: :group_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :user_group_callouts, column: :group_id
- end
- end
-end
diff --git a/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb b/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb
deleted file mode 100644
index 37b73335933..00000000000
--- a/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserIdFkeyForUserGroupCallout < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :user_group_callouts, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :user_group_callouts, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb b/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb
deleted file mode 100644
index 85c7522d006..00000000000
--- a/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDastSchedulesToPlanLimits < Gitlab::Database::Migration[1.0]
- def change
- add_column(:plan_limits, :dast_profile_schedules, :integer, default: 1, null: false)
- end
-end
diff --git a/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb b/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb
deleted file mode 100644
index b9980f65c98..00000000000
--- a/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class InsertDastProfileSchedulesPlanLimits < Gitlab::Database::Migration[1.0]
- def up
- create_or_update_plan_limit('dast_profile_schedules', 'default', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'free', 1)
- create_or_update_plan_limit('dast_profile_schedules', 'bronze', 1)
- create_or_update_plan_limit('dast_profile_schedules', 'silver', 1)
- create_or_update_plan_limit('dast_profile_schedules', 'premium', 1)
- create_or_update_plan_limit('dast_profile_schedules', 'premium_trial', 1)
- create_or_update_plan_limit('dast_profile_schedules', 'gold', 20)
- create_or_update_plan_limit('dast_profile_schedules', 'ultimate', 20)
- create_or_update_plan_limit('dast_profile_schedules', 'ultimate_trial', 20)
- end
-
- def down
- create_or_update_plan_limit('dast_profile_schedules', 'default', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'free', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'bronze', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'silver', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'premium', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'premium_trial', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'gold', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'ultimate', 0)
- create_or_update_plan_limit('dast_profile_schedules', 'ultimate_trial', 0)
- end
-end
diff --git a/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb b/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb
deleted file mode 100644
index 81a76ecb10a..00000000000
--- a/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddJobsPerStagePageSizeToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :jobs_per_stage_page_size, :integer, default: 200, null: false
- end
-end
diff --git a/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb b/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb
deleted file mode 100644
index dd0796a1c86..00000000000
--- a/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddSidekiqLimitsToApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction! # needed for now to avoid subtransactions
-
- def up
- with_lock_retries do
- add_column :application_settings, :sidekiq_job_limiter_mode, :smallint, default: 1, null: false
- add_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes, :integer, default: 100_000, null: false
- add_column :application_settings, :sidekiq_job_limiter_limit_bytes, :integer, default: 0, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :application_settings, :sidekiq_job_limiter_mode
- remove_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes
- remove_column :application_settings, :sidekiq_job_limiter_limit_bytes
- end
- end
-end
diff --git a/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb b/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb
deleted file mode 100644
index b8e7c7af144..00000000000
--- a/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToDependencyProxyManifests < Gitlab::Database::Migration[1.0]
- def change
- add_column :dependency_proxy_manifests, :status, :smallint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb b/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb
deleted file mode 100644
index 4fbdcad33cd..00000000000
--- a/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToDependencyProxyBlobs < Gitlab::Database::Migration[1.0]
- def change
- add_column :dependency_proxy_blobs, :status, :smallint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb b/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb
deleted file mode 100644
index 447508d3d5b..00000000000
--- a/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDataToVulnerabilityFindingEvidence < Gitlab::Database::Migration[1.0]
- def change
- add_column :vulnerability_finding_evidences, :data, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb b/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb
deleted file mode 100644
index 38d9c4b5dd9..00000000000
--- a/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexPackageIdIdOnPackageFiles < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_package_files_on_package_id_id'
-
- def up
- disable_statement_timeout do
- execute "CREATE INDEX CONCURRENTLY #{INDEX_NAME} ON packages_package_files (package_id, id)" unless index_exists_by_name?(:package_package_files, INDEX_NAME)
- end
- end
-
- def down
- remove_concurrent_index_by_name :packages_package_files, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb
deleted file mode 100644
index 52fab5a63ee..00000000000
--- a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddDependencyProxyTtlGroupPolicyWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings,
- :dependency_proxy_ttl_group_policy_worker_capacity,
- :smallint,
- default: 2,
- null: false
- end
-end
diff --git a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb
deleted file mode 100644
index 9b522f2874f..00000000000
--- a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddAppSettingsDepProxyTtlWorkerCapacityCheckConstraint < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'app_settings_dep_proxy_ttl_policies_worker_capacity_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :application_settings, 'dependency_proxy_ttl_group_policy_worker_capacity >= 0', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :application_settings, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb b/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb
deleted file mode 100644
index ebb0de53d6a..00000000000
--- a/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeCiMinutesAdditionalPackTextLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_text_limit :ci_minutes_additional_packs, :purchase_xid
- add_text_limit :ci_minutes_additional_packs, :purchase_xid, 50
- end
-
- def down
- remove_text_limit :ci_minutes_additional_packs, :purchase_xid
- add_text_limit :ci_minutes_additional_packs, :purchase_xid, 32, validate: false
- end
-end
diff --git a/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb b/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb
deleted file mode 100644
index 4b147034657..00000000000
--- a/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddReportTypeIntoApprovalProjectRules < Gitlab::Database::Migration[1.0]
- def up
- add_column :approval_project_rules, :report_type, :integer, limit: 2
- end
-
- def down
- remove_column :approval_project_rules, :report_type
- end
-end
diff --git a/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb b/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb
deleted file mode 100644
index 83eddf2fb0d..00000000000
--- a/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunnerFeaturesToCiBuildsMetadata < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :ci_builds_metadata, :runner_features, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/migrate/20210913010411_create_agent_project_authorizations.rb b/db/migrate/20210913010411_create_agent_project_authorizations.rb
deleted file mode 100644
index 02b6ac677e0..00000000000
--- a/db/migrate/20210913010411_create_agent_project_authorizations.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAgentProjectAuthorizations < Gitlab::Database::Migration[1.0]
- def change
- create_table :agent_project_authorizations do |t|
- t.bigint :project_id, null: false
- t.bigint :agent_id, null: false
- t.jsonb :config, null: false
-
- t.index :project_id
- t.index [:agent_id, :project_id], unique: true
- end
- end
-end
diff --git a/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb b/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb
deleted file mode 100644
index 545fc125950..00000000000
--- a/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddAgentProjectAuthorizationsForeignKeys < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :agent_project_authorizations, :projects, column: :project_id
- add_concurrent_foreign_key :agent_project_authorizations, :cluster_agents, column: :agent_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :agent_project_authorizations, column: :project_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_project_authorizations, column: :agent_id
- end
- end
-end
diff --git a/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb b/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb
deleted file mode 100644
index 9dd420604f4..00000000000
--- a/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddNamespaceTraversalIdsToCiPendingBuilds < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :ci_pending_builds, :namespace_traversal_ids, :integer, array: true, default: []
- end
-end
diff --git a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb
deleted file mode 100644
index 845697c28b5..00000000000
--- a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateDependencyProxyManifestsUniquenessConstraint < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NEW_INDEX_NAME = 'index_dep_prox_manifests_on_group_id_file_name_and_status'
- OLD_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_and_file_name'
-
- def up
- add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name, :status], unique: true, name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name], unique: true, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb b/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb
deleted file mode 100644
index 6e57429bca8..00000000000
--- a/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleDeprecatedApiColumns < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false
- add_column :application_settings, :throttle_unauthenticated_deprecated_api_period_in_seconds, :integer, default: 3600, null: false
- add_column :application_settings, :throttle_unauthenticated_deprecated_api_enabled, :boolean, default: false, null: false
-
- add_column :application_settings, :throttle_authenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false
- add_column :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, :integer, default: 1800, null: false
- add_column :application_settings, :throttle_authenticated_deprecated_api_enabled, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb
deleted file mode 100644
index 9b593fbe540..00000000000
--- a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0]
- MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_status'
- BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_status'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :dependency_proxy_manifests, :status, name: MANIFEST_INDEX_NAME
- add_concurrent_index :dependency_proxy_blobs, :status, name: BLOB_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME
- remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb b/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb
deleted file mode 100644
index 35cd18c1da9..00000000000
--- a/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnClustersIntegrationPrometheusEnabled < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_clusters_integration_prometheus_enabled'
-
- def up
- add_concurrent_index(:clusters_integration_prometheus, [:enabled, :created_at, :cluster_id], name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:clusters_integration_prometheus, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb b/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb
deleted file mode 100644
index bdaa84f27fe..00000000000
--- a/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnClustersIntegrationElasticStackEnabled < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_clusters_integration_elasticstack_enabled'
-
- def up
- add_concurrent_index(:clusters_integration_elasticstack, [:enabled, :created_at, :cluster_id], name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:clusters_integration_elasticstack, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb b/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb
deleted file mode 100644
index 2ceeb53cd1e..00000000000
--- a/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddAvatarAndDescriptionToTopic < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- def up
- add_column :topics, :avatar, :text
- add_column :topics, :description, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- remove_column :topics, :avatar
- remove_column :topics, :description
- end
-end
diff --git a/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb b/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb
deleted file mode 100644
index 6bac264fcf4..00000000000
--- a/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddProcessModeToResourceGroups < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- PROCESS_MODE_UNORDERED = 0
-
- def up
- add_column :ci_resource_groups, :process_mode, :integer, default: PROCESS_MODE_UNORDERED, null: false, limit: 2
- end
-
- def down
- remove_column :ci_resource_groups, :process_mode
- end
-end
diff --git a/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb b/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb
deleted file mode 100644
index ac4821b8007..00000000000
--- a/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTemporaryIndexForProjectTopicsOnTaggings < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ExtractProjectTopicsIntoSeparateTable'
- INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project'
- INDEX_CONDITION = "taggable_type = 'Project'"
-
- disable_ddl_transaction!
-
- def up
- # Ensure that no background jobs of 20210730104800_schedule_extract_project_topics_into_separate_table remain
- finalize_background_migration MIGRATION
- # this index was used in 20210730104800_schedule_extract_project_topics_into_separate_table
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-
- def down
- add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation
- end
-end
diff --git a/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb b/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb
deleted file mode 100644
index 456788de521..00000000000
--- a/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemovePipelineFkFromPackagesBuildInfos < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:packages_build_infos, :ci_pipelines)
- end
- end
-
- def down
- add_concurrent_foreign_key(:packages_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify)
- end
-end
diff --git a/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb b/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb
deleted file mode 100644
index 187ddc8a088..00000000000
--- a/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemovePipelineFkFromPackagesPackageFileBuildInfos < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:packages_package_file_build_infos, :ci_pipelines)
- end
- end
-
- def down
- add_concurrent_foreign_key(:packages_package_file_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify)
- end
-end
diff --git a/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb b/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb
deleted file mode 100644
index ee7a474928e..00000000000
--- a/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRegistrationObjectiveToUserDetail < Gitlab::Database::Migration[1.0]
- def change
- add_column :user_details, :registration_objective, :smallint
- end
-end
diff --git a/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb b/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb
deleted file mode 100644
index 83ceaa58ff4..00000000000
--- a/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToTopicsDescriptionAndAvatar < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :topics, :description, 1024
- add_text_limit :topics, :avatar, 255
- end
-
- def down
- remove_text_limit :topics, :avatar
- remove_text_limit :topics, :description
- end
-end
diff --git a/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb b/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb
deleted file mode 100644
index 5ac12eccc7d..00000000000
--- a/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddSuggestPipelineEnabledToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :suggest_pipeline_enabled, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb b/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb
deleted file mode 100644
index 67975636488..00000000000
--- a/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-class IndexLabelsUsingVarcharPatternOps < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NEW_TITLE_INDEX_NAME = 'index_labels_on_title_varchar'
- NEW_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_varchar_unique'
- NEW_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_varchar_unique'
- NEW_GROUP_ID_INDEX_NAME = 'index_labels_on_group_id'
-
- OLD_TITLE_INDEX_NAME = 'index_labels_on_title'
- OLD_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_unique'
- OLD_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_unique'
- OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_project_id_and_title'
-
- def up
- add_concurrent_index :labels, :title, order: { title: :varchar_pattern_ops }, name: NEW_TITLE_INDEX_NAME
- add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_PROJECT_ID_TITLE_INDEX_NAME
- add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_GROUP_ID_TITLE_INDEX_NAME
- add_concurrent_index :labels, :group_id, name: NEW_GROUP_ID_INDEX_NAME
-
- remove_concurrent_index_by_name :labels, OLD_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, OLD_PROJECT_ID_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, OLD_GROUP_ID_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME
- end
-
- def down
- add_concurrent_index :labels, :title, name: OLD_TITLE_INDEX_NAME
- add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, name: OLD_PROJECT_ID_TITLE_INDEX_NAME
- add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, name: OLD_GROUP_ID_TITLE_INDEX_NAME
- add_concurrent_index :labels, [:group_id, :project_id, :title], unique: true, name: OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME
-
- remove_concurrent_index_by_name :labels, NEW_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, NEW_PROJECT_ID_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, NEW_GROUP_ID_TITLE_INDEX_NAME
- remove_concurrent_index_by_name :labels, NEW_GROUP_ID_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb b/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb
deleted file mode 100644
index c03c463b9bb..00000000000
--- a/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddReportTypeIndexIntoApprovalProjectRules < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_approval_project_rules_report_type'
-
- def up
- add_concurrent_index :approval_project_rules, :report_type, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :approval_project_rules, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb b/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb
deleted file mode 100644
index 6cbbe582ff6..00000000000
--- a/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueNamespacesIndexOnNameParentIdAndType < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_namespaces_name_parent_id_type'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, [:name, :parent_id, :type], unique: true, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb b/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb
deleted file mode 100644
index 001f3a6964b..00000000000
--- a/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class DropUniqueNamespacesIndexOnNameAndParentId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_namespaces_on_name_and_parent_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-
- def down
- add_concurrent_index :namespaces, [:name, :parent_id], unique: true, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb b/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb
deleted file mode 100644
index 2d89d295608..00000000000
--- a/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIssueCustomerRelationsContacts < Gitlab::Database::Migration[1.0]
- def change
- create_table :issue_customer_relations_contacts do |t|
- t.bigint :issue_id, null: false
- t.bigint :contact_id, null: false
- t.timestamps_with_timezone null: false
-
- t.index :contact_id
- t.index [:issue_id, :contact_id], unique: true, name: :index_issue_crm_contacts_on_issue_id_and_contact_id
- end
- end
-end
diff --git a/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb b/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb
deleted file mode 100644
index 7be465ca31a..00000000000
--- a/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueCustomerRelationsContactsForeignKeys < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :issue_customer_relations_contacts, :issues, column: :issue_id
- add_concurrent_foreign_key :issue_customer_relations_contacts, :customer_relations_contacts, column: :contact_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :issue_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :contact_id
- end
- end
-end
diff --git a/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb b/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb
deleted file mode 100644
index 2958285e7a5..00000000000
--- a/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddMetaDataToUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- def change
- change_table :user_credit_card_validations do |t|
- t.date :expiration_date
- t.integer :last_digits, limit: 2 # last 4 digits
- t.text :holder_name
- end
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb b/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb
deleted file mode 100644
index 11d436093b7..00000000000
--- a/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class LimitHolderNameOnUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_credit_card_validations, :holder_name, 26 # ISO IEC 7813
-
- add_check_constraint(:user_credit_card_validations, 'last_digits BETWEEN 0 AND 9999', constraint_name)
- end
-
- def down
- remove_text_limit :user_credit_card_validations, :holder_name
-
- remove_check_constraint(:user_credit_card_validations, constraint_name)
- end
-
- private
-
- def constraint_name
- check_constraint_name(:user_credit_card_validations, :last_digits, 'range')
- end
-end
diff --git a/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb b/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb
deleted file mode 100644
index cc4f4d35f09..00000000000
--- a/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class IndexMetaDataOnUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_user_credit_card_validations_meta_data_full_match'
-
- def up
- add_concurrent_index :user_credit_card_validations,
- [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :user_credit_card_validations,
- [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at],
- name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb
deleted file mode 100644
index fc4cc1945f3..00000000000
--- a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDefaultForIntegratedErrorTracking < Gitlab::Database::Migration[1.0]
- def up
- change_column_default :project_error_tracking_settings, :integrated, from: false, to: true
- end
-
- def down
- change_column_default :project_error_tracking_settings, :integrated, from: true, to: false
- end
-end
diff --git a/db/migrate/20210928155022_improve_index_for_error_tracking.rb b/db/migrate/20210928155022_improve_index_for_error_tracking.rb
deleted file mode 100644
index ec8427670d7..00000000000
--- a/db/migrate/20210928155022_improve_index_for_error_tracking.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class ImproveIndexForErrorTracking < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :error_tracking_errors, %i(project_id status last_seen_at id),
- order: { last_seen_at: :desc, id: :desc },
- name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc'
-
- add_concurrent_index :error_tracking_errors, %i(project_id status first_seen_at id),
- order: { first_seen_at: :desc, id: :desc },
- name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc'
-
- add_concurrent_index :error_tracking_errors, %i(project_id status events_count id),
- order: { events_count: :desc, id: :desc },
- name: 'index_et_errors_on_project_id_and_status_events_count_id_desc'
-
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count'
- end
-
- def down
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count'
-
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count, :id], name: 'index_et_errors_on_project_id_and_status_events_count_id_desc'
- end
-end
diff --git a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb
deleted file mode 100644
index ef437641f2c..00000000000
--- a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupIdStatusIdIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0]
- MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_status_and_id'
- BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_group_id_status_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: MANIFEST_INDEX_NAME
- add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: BLOB_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME
- remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210929025600_add_phone_to_user_details.rb b/db/migrate/20210929025600_add_phone_to_user_details.rb
deleted file mode 100644
index 9bcfd4ab7e3..00000000000
--- a/db/migrate/20210929025600_add_phone_to_user_details.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddPhoneToUserDetails < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- # rubocop:disable Migration/AddLimitToTextColumns
- def up
- add_column :user_details, :phone, :text, comment: 'JiHu-specific column'
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- remove_column :user_details, :phone
- end
-end
diff --git a/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb b/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb
deleted file mode 100644
index f250aad3253..00000000000
--- a/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserDetailsPhone < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_details, :phone, 32
- end
-
- def down
- remove_text_limit :user_details, :phone
- end
-end
diff --git a/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb b/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb
deleted file mode 100644
index e0cf7aa8a44..00000000000
--- a/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexPhoneOnUserDetails < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_user_details_on_phone'
-
- def up
- add_concurrent_index :user_details, :phone, unique: true, where: 'phone IS NOT NULL', name: INDEX_NAME, comment: 'JiHu-specific index'
- end
-
- def down
- remove_concurrent_index_by_name :user_details, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210929032555_create_verification_codes.rb b/db/migrate/20210929032555_create_verification_codes.rb
deleted file mode 100644
index ad743641b9c..00000000000
--- a/db/migrate/20210929032555_create_verification_codes.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVerificationCodes < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- constraint_visitor_id_code = check_constraint_name('verification_codes', 'visitor_id_code', 'max_length')
- constraint_code = check_constraint_name('verification_codes', 'code', 'max_length')
- constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length')
-
- execute(<<~SQL)
- CREATE TABLE verification_codes (
- created_at timestamp with time zone NOT NULL DEFAULT NOW(),
- visitor_id_code text,
- code text,
- phone text,
- PRIMARY KEY (created_at, visitor_id_code, code, phone),
- CONSTRAINT #{constraint_visitor_id_code} CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT #{constraint_code} CHECK ((char_length(code) <= 8)),
- CONSTRAINT #{constraint_phone} CHECK ((char_length(phone) <= 32))
- ) PARTITION BY RANGE (created_at);
- COMMENT ON TABLE verification_codes IS 'JiHu-specific table';
-
- CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON verification_codes (visitor_id_code, phone, created_at);
- COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index';
- SQL
-
- min_date = Date.today - 1.month
- max_date = Date.today + 1.month
- create_daterange_partitions('verification_codes', 'created_at', min_date, max_date)
- end
-
- def down
- drop_table :verification_codes
- end
-end
diff --git a/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb b/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb
deleted file mode 100644
index 1335c06cf1f..00000000000
--- a/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityPolicyConfigurationsManagementProjectIdForeignKey < Gitlab::Database::Migration[1.0]
- CONSTRAINT_NAME = 'fk_security_policy_configurations_management_project_id'
- OLD_CONSTRAINT_NAME = 'fk_rails_42ed6c25ec'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME)
- remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME)
- end
-
- def down
- add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME)
- remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME)
- end
-end
diff --git a/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb b/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb
deleted file mode 100644
index 60ca3040d70..00000000000
--- a/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-class AddReleasesAuthorIdIdCreatedAtIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_releases_on_author_id_id_created_at'
-
- def up
- add_concurrent_index :releases, [:author_id, :id, :created_at], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :releases, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb b/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb
deleted file mode 100644
index 166afa13371..00000000000
--- a/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.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 AddWarnAboutPotentiallyUnwantedCharactersToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :project_settings, :warn_about_potentially_unwanted_characters, :boolean, null: false, default: true
- end
-
- def down
- remove_column :project_settings, :warn_about_potentially_unwanted_characters
- end
-end
diff --git a/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb b/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb
deleted file mode 100644
index be82b16ee8c..00000000000
--- a/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class FixDeprecatedApiThrottleDefaults < Gitlab::Database::Migration[1.0]
- def change
- change_column_default :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, from: 3600, to: 1800
- change_column_default :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, from: 1800, to: 3600
- end
-end
diff --git a/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb b/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb
deleted file mode 100644
index d0eb4a32cac..00000000000
--- a/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddSourceVersionToBulkImports < Gitlab::Database::Migration[1.0]
- def change
- add_column :bulk_imports, :source_version, :text # rubocop:disable Migration/AddLimitToTextColumns
- end
-end
diff --git a/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb b/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb
deleted file mode 100644
index c24883b626d..00000000000
--- a/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCoverageFuzzingCorpuses < Gitlab::Database::Migration[1.0]
- def change
- create_table :coverage_fuzzing_corpuses do |t|
- t.bigint :project_id, null: false
- t.bigint :user_id
- t.bigint :package_id, null: false
-
- t.datetime_with_timezone :file_updated_at, null: false, default: -> { 'NOW()' }
- t.timestamps_with_timezone null: false
-
- t.index :project_id
- t.index :user_id
- t.index :package_id
- end
- end
-end
diff --git a/db/migrate/20211004075629_add_topics_name_gin_index.rb b/db/migrate/20211004075629_add_topics_name_gin_index.rb
deleted file mode 100644
index 94634a4cb2f..00000000000
--- a/db/migrate/20211004075629_add_topics_name_gin_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsNameGinIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_topics_on_name_trigram'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :topics, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops }
- end
-
- def down
- remove_concurrent_index_by_name :topics, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb b/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb
deleted file mode 100644
index 3e44c388617..00000000000
--- a/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddExternalEventDestinationLimitToPlanLimits < Gitlab::Database::Migration[1.0]
- def change
- add_column(:plan_limits, :external_audit_event_destinations, :integer, default: 5, null: false)
- end
-end
diff --git a/db/migrate/20211004122540_create_member_tasks.rb b/db/migrate/20211004122540_create_member_tasks.rb
deleted file mode 100644
index e1141873bcb..00000000000
--- a/db/migrate/20211004122540_create_member_tasks.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class CreateMemberTasks < Gitlab::Database::Migration[1.0]
- def change
- create_table :member_tasks do |t|
- t.references :member, index: true, null: false
- t.references :project, index: true, null: false
- t.timestamps_with_timezone null: false
- t.integer :tasks, limit: 2, array: true, null: false, default: []
- t.index [:member_id, :project_id], unique: true
- end
- end
-end
diff --git a/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb b/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb
deleted file mode 100644
index ba1fb443343..00000000000
--- a/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToCorpusesOnProject < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :coverage_fuzzing_corpuses, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :coverage_fuzzing_corpuses, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb b/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb
deleted file mode 100644
index da08ab97acf..00000000000
--- a/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToCorpusesOnUser < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :coverage_fuzzing_corpuses, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :coverage_fuzzing_corpuses, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb b/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb
deleted file mode 100644
index 74ba7b070d0..00000000000
--- a/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToCorpusesOnPackage < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :coverage_fuzzing_corpuses, :packages_packages, column: :package_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :coverage_fuzzing_corpuses, column: :package_id
- end
- end
-end
diff --git a/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb b/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb
deleted file mode 100644
index 2aaf5e4cf87..00000000000
--- a/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class DropTimeRangePartitionedLooseFk < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- def up
- # the table is not in use
- drop_table :loose_foreign_keys_deleted_records # rubocop: disable Migration/DropTable
- end
-
- def down
- constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'deleted_table_name', 'max_length')
- execute(<<~SQL)
- CREATE TABLE loose_foreign_keys_deleted_records (
- created_at timestamp with time zone NOT NULL DEFAULT NOW(),
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value),
- CONSTRAINT #{constraint_name} CHECK ((char_length(deleted_table_name) <= 63))
- ) PARTITION BY RANGE (created_at);
- SQL
-
- min_date = Date.today - 1.month
- max_date = Date.today + 3.months
- create_daterange_partitions('loose_foreign_keys_deleted_records', 'created_at', min_date, max_date)
- end
-end
diff --git a/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb b/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb
deleted file mode 100644
index 6f52b6ec63b..00000000000
--- a/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class AddRangePartitionedLooseFkTable < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'fully_qualified_table_name', 'max_length')
- execute(<<~SQL)
- CREATE TABLE loose_foreign_keys_deleted_records (
- id BIGSERIAL NOT NULL,
- partition bigint NOT NULL,
- primary_key_value bigint NOT NULL,
- status smallint NOT NULL DEFAULT 1,
- created_at timestamp with time zone NOT NULL DEFAULT NOW(),
- fully_qualified_table_name text NOT NULL,
- PRIMARY KEY (partition, id),
- CONSTRAINT #{constraint_name} CHECK ((char_length(fully_qualified_table_name) <= 150))
- ) PARTITION BY LIST (partition);
-
- CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1
- PARTITION OF loose_foreign_keys_deleted_records
- FOR VALUES IN (1);
- SQL
- end
-
- def down
- drop_table :loose_foreign_keys_deleted_records
- end
-end
diff --git a/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb b/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb
deleted file mode 100644
index b03ad069eba..00000000000
--- a/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class RecreateLooseFkInsertFunction < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- def up
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
- RETURNS TRIGGER AS
- $$
- BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (partition, fully_qualified_table_name, primary_key_value)
- SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table
- ON CONFLICT DO NOTHING;
-
- RETURN NULL;
- END
- $$ LANGUAGE PLPGSQL
- SQL
- end
-
- def down
- # old function
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
- RETURNS TRIGGER AS
- $$
- BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (deleted_table_name, deleted_table_primary_key_value)
- SELECT TG_TABLE_NAME, old_table.id FROM old_table
- ON CONFLICT DO NOTHING;
-
- RETURN NULL;
- END
- $$ LANGUAGE PLPGSQL
- SQL
- end
-end
diff --git a/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb b/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb
deleted file mode 100644
index f3447918ad3..00000000000
--- a/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddMemberIdForeignKeyToMemberTasks < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :member_tasks, :members, column: :member_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :member_tasks, column: :member_id
- end
- end
-end
diff --git a/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb b/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb
deleted file mode 100644
index ead6bb88e60..00000000000
--- a/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectIdForeignKeyToMemberTasks < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :member_tasks, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :member_tasks, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb b/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb
deleted file mode 100644
index ebca4c70879..00000000000
--- a/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0]
- def up
- add_column :topics, :total_projects_count, :bigint, null: false, default: 0
- end
-
- def down
- remove_column :topics, :total_projects_count
- end
-end
diff --git a/db/migrate/20211006103122_change_helm_channel_length.rb b/db/migrate/20211006103122_change_helm_channel_length.rb
deleted file mode 100644
index 6579ca4053b..00000000000
--- a/db/migrate/20211006103122_change_helm_channel_length.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeHelmChannelLength < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :packages_helm_file_metadata, :channel, 255, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length_v2')
- remove_text_limit :packages_helm_file_metadata, :channel, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length')
- end
-
- def down
- # no-op: Danger of failing if there are records with length(channel) > 63
- end
-end
diff --git a/db/migrate/20211006122010_add_topics_total_projects_count_index.rb b/db/migrate/20211006122010_add_topics_total_projects_count_index.rb
deleted file mode 100644
index bd969a9ff0a..00000000000
--- a/db/migrate/20211006122010_add_topics_total_projects_count_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTopicsTotalProjectsCountIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_topics_total_projects_count'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :topics, [:total_projects_count, :id], order: { total_projects_count: :desc }, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :topics, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211007090229_create_issue_search_table.rb b/db/migrate/20211007090229_create_issue_search_table.rb
deleted file mode 100644
index 1fc15d20bd0..00000000000
--- a/db/migrate/20211007090229_create_issue_search_table.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIssueSearchTable < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- execute <<~SQL
- CREATE TABLE issue_search_data (
- project_id bigint NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
- issue_id bigint NOT NULL REFERENCES issues(id) ON DELETE CASCADE,
- created_at timestamp with time zone DEFAULT NOW() NOT NULL,
- updated_at timestamp with time zone DEFAULT NOW() NOT NULL,
- search_vector tsvector,
- PRIMARY KEY (project_id, issue_id)
- ) PARTITION BY HASH (project_id)
- SQL
-
- # rubocop: disable Migration/AddIndex
- add_index :issue_search_data, :issue_id
- add_index :issue_search_data, :search_vector, using: :gin, name: 'index_issue_search_data_on_search_vector'
- # rubocop: enable Migration/AddIndex
-
- create_hash_partitions :issue_search_data, 64
- end
-
- def down
- drop_table :issue_search_data
- end
-end
diff --git a/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb b/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb
deleted file mode 100644
index d60171dead7..00000000000
--- a/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusColumnToSecurityScansTable < Gitlab::Database::Migration[1.0]
- def change
- add_column :security_scans, :status, :integer, limit: 1, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211008043855_remove_notes_trigram_index.rb b/db/migrate/20211008043855_remove_notes_trigram_index.rb
deleted file mode 100644
index a20ef1852e2..00000000000
--- a/db/migrate/20211008043855_remove_notes_trigram_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotesTrigramIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NOTES_TRIGRAM_INDEX_NAME = 'index_notes_on_note_trigram'
-
- def up
- remove_concurrent_index_by_name(:notes, NOTES_TRIGRAM_INDEX_NAME)
- end
-
- def down
- add_concurrent_index :notes, :note, name: NOTES_TRIGRAM_INDEX_NAME, using: :gin, opclass: { content: :gin_trgm_ops }
- end
-end
diff --git a/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb b/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb
deleted file mode 100644
index 862d1a26867..00000000000
--- a/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddSharedRunnersDurationToCiNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :ci_namespace_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb b/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb
deleted file mode 100644
index 76bb7356f0f..00000000000
--- a/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddSharedRunnersDurationToCiProjectMonthlyUsages < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :ci_project_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb b/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb
deleted file mode 100644
index a69d12d4e52..00000000000
--- a/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddHealthStatusColumnOnClustersIntegrationPrometheus < Gitlab::Database::Migration[1.0]
- def change
- # For now, health checks will only run on monitor demo projects
- add_column :clusters_integration_prometheus, :health_status, :smallint, limit: 2, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211011004242_create_content_blocked_states.rb b/db/migrate/20211011004242_create_content_blocked_states.rb
deleted file mode 100644
index d70717f9786..00000000000
--- a/db/migrate/20211011004242_create_content_blocked_states.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateContentBlockedStates < Gitlab::Database::Migration[1.0]
- def change
- create_table :content_blocked_states, comment: 'JiHu-specific table' do |t|
- t.timestamps_with_timezone null: false
- t.binary :commit_sha, null: false
- t.binary :blob_sha, null: false
- t.text :path, null: false, limit: 2048
- t.text :container_identifier, null: false, limit: 255
-
- t.index [:container_identifier, :commit_sha, :path], name: 'index_content_blocked_states_on_container_id_commit_sha_path', unique: true
- end
- end
-end
diff --git a/db/migrate/20211011140930_create_ci_namespace_mirrors.rb b/db/migrate/20211011140930_create_ci_namespace_mirrors.rb
deleted file mode 100644
index b9a708c5d7b..00000000000
--- a/db/migrate/20211011140930_create_ci_namespace_mirrors.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiNamespaceMirrors < Gitlab::Database::Migration[1.0]
- TABLE_NAME = :ci_namespace_mirrors
- INDEX_NAME = "index_gin_#{TABLE_NAME}_on_traversal_ids"
-
- def change
- create_table TABLE_NAME do |t|
- t.integer :namespace_id, null: false, index: { unique: true }
- t.integer :traversal_ids, array: true, default: [], null: false
-
- t.index :traversal_ids, name: INDEX_NAME, using: :gin
- end
- end
-end
diff --git a/db/migrate/20211011140931_create_ci_project_mirrors.rb b/db/migrate/20211011140931_create_ci_project_mirrors.rb
deleted file mode 100644
index 2407b7e0b84..00000000000
--- a/db/migrate/20211011140931_create_ci_project_mirrors.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiProjectMirrors < Gitlab::Database::Migration[1.0]
- TABLE_NAME = :ci_project_mirrors
-
- def change
- create_table TABLE_NAME do |t|
- t.integer :project_id, null: false, index: { unique: true }
- t.integer :namespace_id, null: false, index: true
- end
- end
-end
diff --git a/db/migrate/20211011140932_create_namespaces_sync_events.rb b/db/migrate/20211011140932_create_namespaces_sync_events.rb
deleted file mode 100644
index 06831423343..00000000000
--- a/db/migrate/20211011140932_create_namespaces_sync_events.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class CreateNamespacesSyncEvents < Gitlab::Database::Migration[1.0]
- def change
- create_table :namespaces_sync_events do |t|
- t.references :namespace, null: false, index: true, foreign_key: { on_delete: :cascade }
- end
- end
-end
diff --git a/db/migrate/20211011141239_create_projects_sync_events.rb b/db/migrate/20211011141239_create_projects_sync_events.rb
deleted file mode 100644
index 50fe988ac1b..00000000000
--- a/db/migrate/20211011141239_create_projects_sync_events.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectsSyncEvents < Gitlab::Database::Migration[1.0]
- def change
- create_table :projects_sync_events do |t|
- t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade }
- end
- end
-end
diff --git a/db/migrate/20211011141242_create_namespaces_sync_trigger.rb b/db/migrate/20211011141242_create_namespaces_sync_trigger.rb
deleted file mode 100644
index 91f64709f28..00000000000
--- a/db/migrate/20211011141242_create_namespaces_sync_trigger.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-class CreateNamespacesSyncTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- enable_lock_retries!
-
- TABLE_NAME = 'namespaces'
- EVENT_TABLE_NAME = 'namespaces_sync_events'
- FUNCTION_NAME = 'insert_namespaces_sync_event'
- TRIGGER_ON_INSERT = 'trigger_namespaces_parent_id_on_insert'
- TRIGGER_ON_UPDATE = 'trigger_namespaces_parent_id_on_update'
-
- def up
- create_trigger_function(FUNCTION_NAME) do
- <<~SQL
- INSERT INTO #{EVENT_TABLE_NAME} (namespace_id)
- VALUES(COALESCE(NEW.id, OLD.id));
- RETURN NULL;
- SQL
- end
-
- create_trigger(TABLE_NAME, TRIGGER_ON_INSERT, FUNCTION_NAME, fires: 'AFTER INSERT')
-
- create_trigger(TABLE_NAME, TRIGGER_ON_UPDATE, FUNCTION_NAME, fires: 'AFTER UPDATE') do
- <<~SQL
- WHEN (OLD.parent_id IS DISTINCT FROM NEW.parent_id)
- SQL
- end
- end
-
- def down
- drop_trigger(TABLE_NAME, TRIGGER_ON_INSERT)
- drop_trigger(TABLE_NAME, TRIGGER_ON_UPDATE)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20211011141243_create_projects_sync_trigger.rb b/db/migrate/20211011141243_create_projects_sync_trigger.rb
deleted file mode 100644
index 03b31c35a3a..00000000000
--- a/db/migrate/20211011141243_create_projects_sync_trigger.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectsSyncTrigger < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- enable_lock_retries!
-
- TABLE_NAME = 'projects'
- EVENT_TABLE_NAME = 'projects_sync_events'
- FUNCTION_NAME = 'insert_projects_sync_event'
- TRIGGER_ON_INSERT = 'trigger_projects_parent_id_on_insert'
- TRIGGER_ON_UPDATE = 'trigger_projects_parent_id_on_update'
-
- def up
- create_trigger_function(FUNCTION_NAME) do
- <<~SQL
- INSERT INTO #{EVENT_TABLE_NAME} (project_id)
- VALUES(COALESCE(NEW.id, OLD.id));
- RETURN NULL;
- SQL
- end
-
- create_trigger(TABLE_NAME, TRIGGER_ON_INSERT, FUNCTION_NAME, fires: 'AFTER INSERT')
-
- create_trigger(TABLE_NAME, TRIGGER_ON_UPDATE, FUNCTION_NAME, fires: 'AFTER UPDATE') do
- <<~SQL
- WHEN (OLD.namespace_id IS DISTINCT FROM NEW.namespace_id)
- SQL
- end
- end
-
- def down
- drop_trigger(TABLE_NAME, TRIGGER_ON_INSERT)
- drop_trigger(TABLE_NAME, TRIGGER_ON_UPDATE)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb b/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb
deleted file mode 100644
index f32b8fc5a65..00000000000
--- a/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class NextTraversalIdsSiblingFunction < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'next_traversal_ids_sibling'
-
- def up
- # Given array [1,2,3,4,5], concatenate the first part of the array [1,2,3,4]
- # with the last element in the array (5) after being incremented ([6]).
- #
- # [1,2,3,4,5] => [1,2,3,4,6]
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{FUNCTION_NAME}(traversal_ids INT[]) RETURNS INT[]
- AS $$
- BEGIN
- return traversal_ids[1:array_length(traversal_ids, 1)-1] ||
- ARRAY[traversal_ids[array_length(traversal_ids, 1)]+1];
- END;
- $$
- LANGUAGE plpgsql
- IMMUTABLE
- RETURNS NULL ON NULL INPUT;
- SQL
- end
-
- def down
- execute("DROP FUNCTION #{FUNCTION_NAME}(traversal_ids INT[])")
- end
-end
diff --git a/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb b/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb
deleted file mode 100644
index 9b4fca9a98c..00000000000
--- a/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToBulkImportsSourceVersion < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :bulk_imports, :source_version, 63
- end
-
- def down
- remove_text_limit :bulk_imports, :source_version
- end
-end
diff --git a/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb b/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb
deleted file mode 100644
index 443dbe37c0b..00000000000
--- a/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class CleanUpMigrateMergeRequestDiffCommitUsers < Gitlab::Database::Migration[1.0]
- def up
- jobs = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class('MigrateMergeRequestDiffCommitUsers')
- .pending
- .to_a
-
- return if jobs.empty?
-
- say("#{jobs.length} MigrateMergeRequestDiffCommitUsers are still pending")
-
- # Normally we don't process background migrations in a regular migration, as
- # this could take a while to complete and thus block a deployment.
- #
- # In this case the jobs have all been processed for GitLab.com at the time
- # of writing. In addition, it's been a few releases since this migration was
- # introduced. As a result, self-hosted instances should have their
- # migrations finished a long time ago.
- #
- # For these reasons we clean up any pending jobs (just in case) before
- # deploying the code. This also allows us to immediately start using the new
- # setup only, instead of having to support both the old and new approach for
- # at least one more release.
- jobs.each do |job|
- Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers
- .new
- .perform(*job.arguments)
- end
- end
-
- def down
- end
-end
diff --git a/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb b/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb
deleted file mode 100644
index 9a79fdca192..00000000000
--- a/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddContentValidationEndpointToApplicationSettings < Gitlab::Database::Migration[1.0]
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- add_column :application_settings, :content_validation_endpoint_url, :text, comment: 'JiHu-specific column'
- # rubocop:disable Migration/AddLimitToTextColumns
-
- add_column :application_settings, :encrypted_content_validation_api_key, :binary, comment: 'JiHu-specific column'
- add_column :application_settings, :encrypted_content_validation_api_key_iv, :binary, comment: 'JiHu-specific column'
- add_column :application_settings, :content_validation_endpoint_enabled, :boolean, null: false, default: false, comment: 'JiHu-specific column'
- end
-
- def down
- remove_column :application_settings, :content_validation_endpoint_url
- remove_column :application_settings, :encrypted_content_validation_api_key
- remove_column :application_settings, :encrypted_content_validation_api_key_iv
- remove_column :application_settings, :content_validation_endpoint_enabled
- end
-end
diff --git a/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb b/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb
deleted file mode 100644
index eee4cbad796..00000000000
--- a/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddNetworkToUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- def change
- add_column :user_credit_card_validations, :network, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb b/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb
deleted file mode 100644
index 38a019e718d..00000000000
--- a/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class LimitNetworkOnUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_credit_card_validations, :network, 32
- end
-
- def down
- remove_text_limit :user_credit_card_validations, :network
- end
-end
diff --git a/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb b/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb
deleted file mode 100644
index 849dbab77db..00000000000
--- a/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class IndexIncludeNetworkOnUserCreditCardValidations < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_user_credit_card_validations_meta_data_partial_match'
-
- def up
- add_concurrent_index :user_credit_card_validations,
- [:expiration_date, :last_digits, :network, :credit_card_validated_at],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :user_credit_card_validations, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211013192749_add_states_into_approval_project_rules.rb b/db/migrate/20211013192749_add_states_into_approval_project_rules.rb
deleted file mode 100644
index 98fefbab12c..00000000000
--- a/db/migrate/20211013192749_add_states_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatesIntoApprovalProjectRules < Gitlab::Database::Migration[1.0]
- def up
- add_column :approval_project_rules, :vulnerability_states, :text, array: true, null: false, default: ['newly_detected']
- end
-
- def down
- remove_column :approval_project_rules, :vulnerability_states
- end
-end
diff --git a/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb b/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb
deleted file mode 100644
index adf2fdb2da7..00000000000
--- a/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddMergeCommitTemplateToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_settings, :merge_commit_template, :text # rubocop:disable Migration/AddLimitToTextColumns
- end
-end
diff --git a/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb b/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb
deleted file mode 100644
index 972872b8d2a..00000000000
--- a/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddMergeCommitTemplateLimitToProjectSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :project_settings, :merge_commit_template, 500
- end
-
- def down
- remove_text_limit :project_settings, :merge_commit_template
- end
-end
diff --git a/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb b/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb
deleted file mode 100644
index cc73cb5047b..00000000000
--- a/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddTmpProjectIdColumnToNamespaces < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- # this is a temporary column to be able to batch insert records into namespaces table and then be able to link these
- # to projects table.
- add_column :namespaces, :tmp_project_id, :integer # rubocop: disable Migration/AddColumnsToWideTables
- end
-end
diff --git a/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb b/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb
deleted file mode 100644
index 574f54bc60e..00000000000
--- a/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-class FixDoubleEntriesInPostgresIndexView < Gitlab::Database::Migration[1.0]
- def up
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_indexes;
-
- CREATE VIEW postgres_indexes AS
- SELECT (pg_namespace.nspname::text || '.'::text) || i.relname::text AS identifier,
- pg_index.indexrelid,
- pg_namespace.nspname AS schema,
- i.relname AS name,
- pg_indexes.tablename,
- a.amname AS type,
- pg_index.indisunique AS "unique",
- pg_index.indisvalid AS valid_index,
- i.relispartition AS partitioned,
- pg_index.indisexclusion AS exclusion,
- pg_index.indexprs IS NOT NULL AS expression,
- pg_index.indpred IS NOT NULL AS partial,
- pg_indexes.indexdef AS definition,
- pg_relation_size(i.oid::regclass) AS ondisk_size_bytes
- FROM pg_index
- JOIN pg_class i ON i.oid = pg_index.indexrelid
- JOIN pg_namespace ON i.relnamespace = pg_namespace.oid
- JOIN pg_indexes ON i.relname = pg_indexes.indexname AND pg_namespace.nspname = pg_indexes.schemaname
- JOIN pg_am a ON i.relam = a.oid
- WHERE pg_namespace.nspname <> 'pg_catalog'::name AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name]));
- SQL
- end
-
- def down
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_indexes;
-
- CREATE VIEW postgres_indexes AS
- SELECT (pg_namespace.nspname::text || '.'::text) || i.relname::text AS identifier,
- pg_index.indexrelid,
- pg_namespace.nspname AS schema,
- i.relname AS name,
- pg_indexes.tablename,
- a.amname AS type,
- pg_index.indisunique AS "unique",
- pg_index.indisvalid AS valid_index,
- i.relispartition AS partitioned,
- pg_index.indisexclusion AS exclusion,
- pg_index.indexprs IS NOT NULL AS expression,
- pg_index.indpred IS NOT NULL AS partial,
- pg_indexes.indexdef AS definition,
- pg_relation_size(i.oid::regclass) AS ondisk_size_bytes
- FROM pg_index
- JOIN pg_class i ON i.oid = pg_index.indexrelid
- JOIN pg_namespace ON i.relnamespace = pg_namespace.oid
- JOIN pg_indexes ON i.relname = pg_indexes.indexname
- JOIN pg_am a ON i.relam = a.oid
- WHERE pg_namespace.nspname <> 'pg_catalog'::name AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name]));
- SQL
- end
-end
diff --git a/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb b/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb
deleted file mode 100644
index 0eb8d0989a5..00000000000
--- a/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-class AddStateToMergeRequestAssignees < Gitlab::Database::Migration[1.0]
- REVIEW_DEFAULT_STATE = 0
-
- def change
- add_column :merge_request_assignees, :state, :smallint, default: REVIEW_DEFAULT_STATE, null: false
- end
-end
diff --git a/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb b/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb
deleted file mode 100644
index 970c018df46..00000000000
--- a/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRuntimeRunnerFeaturesToCiBuildsMetadata < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :ci_builds_metadata, :runtime_runner_features, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/migrate/20211020095357_add_group_traversal_id_index.rb b/db/migrate/20211020095357_add_group_traversal_id_index.rb
deleted file mode 100644
index e4739ff217e..00000000000
--- a/db/migrate/20211020095357_add_group_traversal_id_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupTraversalIdIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_namespaces_on_traversal_ids_for_groups'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, :traversal_ids, using: :gin, where: "type='Group'", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211021115409_add_color_to_epics.rb b/db/migrate/20211021115409_add_color_to_epics.rb
deleted file mode 100644
index 14b38209f30..00000000000
--- a/db/migrate/20211021115409_add_color_to_epics.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddColorToEpics < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20211021124715_add_text_limit_to_epics_color
- def change
- add_column :epics, :color, :text, default: '#1068bf'
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20211021124715_add_text_limit_to_epics_color.rb b/db/migrate/20211021124715_add_text_limit_to_epics_color.rb
deleted file mode 100644
index 7844575c521..00000000000
--- a/db/migrate/20211021124715_add_text_limit_to_epics_color.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToEpicsColor < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :epics, :color, 7
- end
-
- def down
- remove_text_limit :epics, :color
- end
-end
diff --git a/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb b/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb
deleted file mode 100644
index d8b40893b47..00000000000
--- a/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class AddSentrySettingsToApplicationSettings < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- def change
- add_column :application_settings, :sentry_enabled, :boolean, default: false, null: false
- add_column :application_settings, :sentry_dsn, :text
- add_column :application_settings, :sentry_clientside_dsn, :text
- add_column :application_settings, :sentry_environment, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb b/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb
deleted file mode 100644
index 34d18741788..00000000000
--- a/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddLimitsToSentrySettingsOnApplicationSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :sentry_dsn, 255
- add_text_limit :application_settings, :sentry_clientside_dsn, 255
- add_text_limit :application_settings, :sentry_environment, 255
- end
-
- def down
- remove_text_limit :application_settings, :sentry_dsn
- remove_text_limit :application_settings, :sentry_clientside_dsn
- remove_text_limit :application_settings, :sentry_environment
- end
-end
diff --git a/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb b/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb
deleted file mode 100644
index 345cd1785ea..00000000000
--- a/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateIdToVsaIssueStageEvents < Gitlab::Database::Migration[1.0]
- def change
- add_column :analytics_cycle_analytics_issue_stage_events, :state_id, :smallint, default: 1, null: false
- end
-end
diff --git a/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb b/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb
deleted file mode 100644
index be28d56e19d..00000000000
--- a/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateIdToVsaMergeRequestStageEvents < Gitlab::Database::Migration[1.0]
- def change
- add_column :analytics_cycle_analytics_merge_request_stage_events, :state_id, :smallint, default: 1, null: false
- end
-end
diff --git a/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb b/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb
deleted file mode 100644
index 90e68f6a0ac..00000000000
--- a/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddArchiveTraceEventsToIntegrations < Gitlab::Database::Migration[1.0]
- def change
- add_column :integrations, :archive_trace_events, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20211026143238_remove_index_releases_on_author_id.rb b/db/migrate/20211026143238_remove_index_releases_on_author_id.rb
deleted file mode 100644
index 7cd086dbf7d..00000000000
--- a/db/migrate/20211026143238_remove_index_releases_on_author_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexReleasesOnAuthorId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_releases_on_author_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :releases, INDEX_NAME
- end
-
- def down
- add_concurrent_index :releases, [:author_id], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb b/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb
deleted file mode 100644
index 8b004af06c0..00000000000
--- a/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdatedIndexForDormantUsers < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_active_human_service'
-
- disable_ddl_transaction!
-
- def up
- index_condition = "state = 'active' AND (users.user_type IS NULL OR users.user_type = 4)"
-
- add_concurrent_index :users, [:id, :last_activity_on], where: index_condition, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :users, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211028132247_create_packages_npm_metadata.rb b/db/migrate/20211028132247_create_packages_npm_metadata.rb
deleted file mode 100644
index cbe5429fca1..00000000000
--- a/db/migrate/20211028132247_create_packages_npm_metadata.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePackagesNpmMetadata < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- create_table :packages_npm_metadata, id: false do |t|
- t.references :package, primary_key: true, default: nil, index: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint
- t.jsonb :package_json, default: {}, null: false
-
- t.check_constraint 'char_length(package_json::text) < 20000'
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :packages_npm_metadata
- end
- end
-end
diff --git a/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb b/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb
deleted file mode 100644
index d9949863a92..00000000000
--- a/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDefaultToPersonalAccessTokensPrefix < Gitlab::Database::Migration[1.0]
- def change
- change_column_default(:application_settings, :personal_access_token_prefix, from: nil, to: 'glpat-')
- end
-end
diff --git a/db/migrate/20211101132310_add_reindexing_queue.rb b/db/migrate/20211101132310_add_reindexing_queue.rb
deleted file mode 100644
index d9d1f9dce89..00000000000
--- a/db/migrate/20211101132310_add_reindexing_queue.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddReindexingQueue < Gitlab::Database::Migration[1.0]
- def change
- create_table :postgres_reindex_queued_actions do |t|
- t.text :index_identifier, null: false, limit: 255
- t.integer :state, limit: 2, null: false, default: 0
- t.timestamps_with_timezone null: false
-
- t.index :state
- end
-
- change_column_default :postgres_reindex_queued_actions, :created_at, from: nil, to: -> { 'NOW()' }
- change_column_default :postgres_reindex_queued_actions, :updated_at, from: nil, to: -> { 'NOW()' }
- end
-end
diff --git a/db/migrate/20211101165656_create_upload_states.rb b/db/migrate/20211101165656_create_upload_states.rb
deleted file mode 100644
index 64873f4c9a2..00000000000
--- a/db/migrate/20211101165656_create_upload_states.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class CreateUploadStates < Gitlab::Database::Migration[1.0]
- VERIFICATION_STATE_INDEX_NAME = "index_upload_states_on_verification_state"
- PENDING_VERIFICATION_INDEX_NAME = "index_upload_states_pending_verification"
- FAILED_VERIFICATION_INDEX_NAME = "index_upload_states_failed_verification"
- NEEDS_VERIFICATION_INDEX_NAME = "index_upload_states_needs_verification"
-
- disable_ddl_transaction!
-
- def up
- create_table :upload_states, id: false do |t|
- t.datetime_with_timezone :verification_started_at
- t.datetime_with_timezone :verification_retry_at
- t.datetime_with_timezone :verified_at
- t.references :upload, primary_key: true, null: false, foreign_key: { on_delete: :cascade }
- 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.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
-
- def down
- drop_table :upload_states
- end
-end
diff --git a/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb b/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb
deleted file mode 100644
index 43cd7afbf06..00000000000
--- a/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddWithHighestRoleMinimalAccessToUsersStatistics < Gitlab::Database::Migration[1.0]
- def change
- add_column :users_statistics, :with_highest_role_minimal_access, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb b/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb
deleted file mode 100644
index 4062fd1be01..00000000000
--- a/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToApplicationSettingsContentValidationEndpointUrl < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :content_validation_endpoint_url, 255
- end
-
- def down
- remove_text_limit :application_settings, :content_validation_endpoint_url
- end
-end
diff --git a/db/migrate/20211105010101_add_archived_column_to_deployments.rb b/db/migrate/20211105010101_add_archived_column_to_deployments.rb
deleted file mode 100644
index f9ac81915b4..00000000000
--- a/db/migrate/20211105010101_add_archived_column_to_deployments.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddArchivedColumnToDeployments < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :deployments, :archived, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb b/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb
deleted file mode 100644
index a594674f470..00000000000
--- a/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddReadAtToDependencyProxyManifests < Gitlab::Database::Migration[1.0]
- def change
- add_column :dependency_proxy_manifests, :read_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' }
- end
-end
diff --git a/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb b/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb
deleted file mode 100644
index 1808a541498..00000000000
--- a/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddReadAtToDependencyProxyBlobs < Gitlab::Database::Migration[1.0]
- def change
- add_column :dependency_proxy_blobs, :read_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' }
- end
-end
diff --git a/db/migrate/20211105160316_create_dotenv_application_limits.rb b/db/migrate/20211105160316_create_dotenv_application_limits.rb
deleted file mode 100644
index 3ea94fd60fc..00000000000
--- a/db/migrate/20211105160316_create_dotenv_application_limits.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDotenvApplicationLimits < Gitlab::Database::Migration[1.0]
- def change
- add_column(:plan_limits, :dotenv_variables, :integer, default: 20, null: false)
- add_column(:plan_limits, :dotenv_size, :integer, default: 5.kilobytes, null: false)
- end
-end
diff --git a/db/migrate/20211105161404_insert_dotenv_application_limits.rb b/db/migrate/20211105161404_insert_dotenv_application_limits.rb
deleted file mode 100644
index 2749cf4a019..00000000000
--- a/db/migrate/20211105161404_insert_dotenv_application_limits.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class InsertDotenvApplicationLimits < Gitlab::Database::Migration[1.0]
- def up
- create_or_update_plan_limit('dotenv_variables', 'default', 150)
- create_or_update_plan_limit('dotenv_variables', 'free', 50)
- create_or_update_plan_limit('dotenv_variables', 'opensource', 150)
- create_or_update_plan_limit('dotenv_variables', 'premium', 100)
- create_or_update_plan_limit('dotenv_variables', 'premium_trial', 100)
- create_or_update_plan_limit('dotenv_variables', 'ultimate', 150)
- create_or_update_plan_limit('dotenv_variables', 'ultimate_trial', 150)
-
- create_or_update_plan_limit('dotenv_size', 'default', 5.kilobytes)
- end
-
- def down
- create_or_update_plan_limit('dotenv_variables', 'default', 20)
- create_or_update_plan_limit('dotenv_variables', 'free', 20)
- create_or_update_plan_limit('dotenv_variables', 'opensource', 20)
- create_or_update_plan_limit('dotenv_variables', 'premium', 20)
- create_or_update_plan_limit('dotenv_variables', 'premium_trial', 20)
- create_or_update_plan_limit('dotenv_variables', 'ultimate', 20)
- create_or_update_plan_limit('dotenv_variables', 'ultimate_trial', 20)
-
- create_or_update_plan_limit('dotenv_size', 'default', 5.kilobytes)
- end
-end
diff --git a/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb b/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb
deleted file mode 100644
index 38671c75e0c..00000000000
--- a/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePipelineTriggersApplicationLimits < Gitlab::Database::Migration[1.0]
- def change
- add_column(:plan_limits, :pipeline_triggers, :integer, default: 25_000, null: false)
- end
-end
diff --git a/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb b/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb
deleted file mode 100644
index c1341fad729..00000000000
--- a/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class InsertPipelineTriggersApplicationLimits < Gitlab::Database::Migration[1.0]
- def up
- create_or_update_plan_limit('pipeline_triggers', 'default', 0)
- create_or_update_plan_limit('pipeline_triggers', 'free', 25_000)
- create_or_update_plan_limit('pipeline_triggers', 'opensource', 0)
- create_or_update_plan_limit('pipeline_triggers', 'premium', 0)
- create_or_update_plan_limit('pipeline_triggers', 'premium_trial', 0)
- create_or_update_plan_limit('pipeline_triggers', 'ultimate', 0)
- create_or_update_plan_limit('pipeline_triggers', 'ultimate_trial', 0)
- end
-
- def down
- create_or_update_plan_limit('pipeline_triggers', 'default', 0)
- create_or_update_plan_limit('pipeline_triggers', 'free', 0)
- create_or_update_plan_limit('pipeline_triggers', 'opensource', 0)
- create_or_update_plan_limit('pipeline_triggers', 'premium', 0)
- create_or_update_plan_limit('pipeline_triggers', 'premium_trial', 0)
- create_or_update_plan_limit('pipeline_triggers', 'ultimate', 0)
- create_or_update_plan_limit('pipeline_triggers', 'ultimate_trial', 0)
- end
-end
diff --git a/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb b/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb
deleted file mode 100644
index ac0f0ddca17..00000000000
--- a/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateDependencyProxyIndexesWithReadAt < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- NEW_BLOB_INDEX = 'index_dependency_proxy_blobs_on_group_id_status_read_at_id'
- OLD_BLOB_INDEX = 'index_dependency_proxy_blobs_on_group_id_status_and_id'
-
- NEW_MANIFEST_INDEX = 'index_dependency_proxy_manifests_on_group_id_status_read_at_id'
- OLD_MANIFEST_INDEX = 'index_dependency_proxy_manifests_on_group_id_status_and_id'
-
- def up
- add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :read_at, :id], name: NEW_BLOB_INDEX
- add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :read_at, :id], name: NEW_MANIFEST_INDEX
-
- remove_concurrent_index_by_name :dependency_proxy_blobs, OLD_BLOB_INDEX
- remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_MANIFEST_INDEX
- end
-
- def down
- add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: OLD_BLOB_INDEX
- add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: OLD_MANIFEST_INDEX
-
- remove_concurrent_index_by_name :dependency_proxy_blobs, NEW_BLOB_INDEX
- remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_MANIFEST_INDEX
- end
-end
diff --git a/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb b/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb
deleted file mode 100644
index 90e5fa34817..00000000000
--- a/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddPolicyIdxToApprovalProjectRule < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :approval_project_rules, :orchestration_policy_idx, :integer, limit: 2
- end
-end
diff --git a/db/migrate/20211108211434_remove_index_for_resource_group.rb b/db/migrate/20211108211434_remove_index_for_resource_group.rb
deleted file mode 100644
index 8b03f12d08b..00000000000
--- a/db/migrate/20211108211434_remove_index_for_resource_group.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexForResourceGroup < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_for_resource_group'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :ci_builds, INDEX_NAME
- end
-
- def down
- # rubocop:disable Migration/PreventIndexCreation
- add_concurrent_index :ci_builds, [:resource_group_id, :id], where: 'resource_group_id IS NOT NULL', name: INDEX_NAME
- # rubocop:enable Migration/PreventIndexCreation
- end
-end
diff --git a/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb b/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb
deleted file mode 100644
index 6b8e8c0d4f3..00000000000
--- a/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddConsumeAfterToLooseFkDeletedRecords < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :loose_foreign_keys_deleted_records, :consume_after, :datetime_with_timezone, default: -> { 'NOW()' }
- end
-
- def down
- remove_column :loose_foreign_keys_deleted_records, :consume_after
- end
-end
diff --git a/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb b/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb
deleted file mode 100644
index fccb1fc5cac..00000000000
--- a/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class SupportPartitionQueryInLooseFkTable < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_partitioned_query'
-
- def up
- add_concurrent_partitioned_index :loose_foreign_keys_deleted_records,
- %I[partition fully_qualified_table_name consume_after id],
- where: 'status = 1',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb b/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb
deleted file mode 100644
index 0bfafb94d0b..00000000000
--- a/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnUnarchivedDeployments < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_deployments_on_archived_project_id_iid'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :deployments, %i[archived project_id iid], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :deployments, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211110014701_create_agent_activity_events.rb b/db/migrate/20211110014701_create_agent_activity_events.rb
deleted file mode 100644
index 11b9c6d03b3..00000000000
--- a/db/migrate/20211110014701_create_agent_activity_events.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAgentActivityEvents < Gitlab::Database::Migration[1.0]
- def change
- create_table :agent_activity_events do |t|
- t.bigint :agent_id, null: false
- t.bigint :user_id, index: { where: 'user_id IS NOT NULL' }
- t.bigint :project_id, index: { where: 'project_id IS NOT NULL' }
- t.bigint :merge_request_id, index: { where: 'merge_request_id IS NOT NULL' }
- t.bigint :agent_token_id, index: { where: 'agent_token_id IS NOT NULL' }
-
- t.datetime_with_timezone :recorded_at, null: false
- t.integer :kind, limit: 2, null: false
- t.integer :level, limit: 2, null: false
-
- t.binary :sha
- t.text :detail, limit: 255
-
- t.index [:agent_id, :recorded_at, :id]
- end
- end
-end
diff --git a/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb b/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb
deleted file mode 100644
index fcbafcccb06..00000000000
--- a/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class AddAgentActivityEventsForeignKeys < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :agent_activity_events, :cluster_agents, column: :agent_id, on_delete: :cascade
- add_concurrent_foreign_key :agent_activity_events, :users, column: :user_id, on_delete: :nullify
- add_concurrent_foreign_key :agent_activity_events, :projects, column: :project_id, on_delete: :nullify
- add_concurrent_foreign_key :agent_activity_events, :merge_requests, column: :merge_request_id, on_delete: :nullify
- add_concurrent_foreign_key :agent_activity_events, :cluster_agent_tokens, column: :agent_token_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :agent_activity_events, column: :agent_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_activity_events, column: :user_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_activity_events, column: :project_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_activity_events, column: :merge_request_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_activity_events, column: :agent_token_id
- end
- end
-end
diff --git a/db/migrate/20211110092710_create_issue_emails.rb b/db/migrate/20211110092710_create_issue_emails.rb
deleted file mode 100644
index 5f6104fa2c3..00000000000
--- a/db/migrate/20211110092710_create_issue_emails.rb
+++ /dev/null
@@ -1,21 +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 CreateIssueEmails < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- create_table :issue_emails do |t|
- t.references :issue, index: true, null: false, unique: true, foreign_key: { on_delete: :cascade }
- t.text :email_message_id, null: false, limit: 1000
-
- t.index :email_message_id
- end
- end
-
- def down
- drop_table :issue_emails
- end
-end
diff --git a/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb b/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb
deleted file mode 100644
index 01507908e0f..00000000000
--- a/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddHasShimoToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_settings, :has_shimo, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb b/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb
deleted file mode 100644
index 064dc38f5b3..00000000000
--- a/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class CreateMergeRequestsComplianceViolations < Gitlab::Database::Migration[1.0]
- def change
- create_table :merge_requests_compliance_violations do |t|
- t.bigint :violating_user_id, null: false
- t.bigint :merge_request_id, null: false
- t.integer :reason, limit: 2, null: false
- t.index :violating_user_id
- t.index [:merge_request_id, :violating_user_id, :reason], unique: true, name: 'index_merge_requests_compliance_violations_unique_columns'
- end
- end
-end
diff --git a/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb b/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb
deleted file mode 100644
index b280c35433b..00000000000
--- a/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkComplianceViolationsMergeRequest < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :merge_requests_compliance_violations,
- :merge_requests,
- column: :merge_request_id,
- on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :merge_requests_compliance_violations, column: :merge_request_id
- end
- end
-end
diff --git a/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb b/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb
deleted file mode 100644
index af1cd6f07ed..00000000000
--- a/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkComplianceViolationsViolatingUser < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :merge_requests_compliance_violations,
- :users,
- column: :violating_user_id,
- on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :merge_requests_compliance_violations, column: :violating_user_id
- end
- end
-end
diff --git a/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb b/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb
deleted file mode 100644
index 6120a6ed0b4..00000000000
--- a/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddSquashCommitTemplateToProjectSettings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :project_settings, :squash_commit_template, :text # rubocop:disable Migration/AddLimitToTextColumns
- end
-end
diff --git a/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb b/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb
deleted file mode 100644
index 578d2271d60..00000000000
--- a/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSquashCommitTemplateLimitToProjectSettings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :project_settings, :squash_commit_template, 500
- end
-
- def down
- remove_text_limit :project_settings, :squash_commit_template
- end
-end
diff --git a/db/migrate/20211112073413_change_package_index_on_corpus.rb b/db/migrate/20211112073413_change_package_index_on_corpus.rb
deleted file mode 100644
index 6e8222f853c..00000000000
--- a/db/migrate/20211112073413_change_package_index_on_corpus.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ChangePackageIndexOnCorpus < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_coverage_fuzzing_corpuses_on_package_id'
-
- disable_ddl_transaction!
-
- # Changing this index is safe.
- # The table does not have any data in it as it's behind a feature flag.
- def up
- remove_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME
- add_concurrent_index :coverage_fuzzing_corpuses, :package_id, unique: true, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME
- add_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb b/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb
deleted file mode 100644
index 8dd23e1a72e..00000000000
--- a/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class PopulateDefaultValueForPersonalAccessTokensPrefix < Gitlab::Database::Migration[1.0]
- def up
- execute(
- <<-SQL
- UPDATE
- application_settings
- SET
- personal_access_token_prefix = default
- WHERE
- personal_access_token_prefix IS NULL
- SQL
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20211115132613_create_incident_management_timeline_events.rb b/db/migrate/20211115132613_create_incident_management_timeline_events.rb
deleted file mode 100644
index 217dcd27b4c..00000000000
--- a/db/migrate/20211115132613_create_incident_management_timeline_events.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementTimelineEvents < Gitlab::Database::Migration[1.0]
- def up
- create_table :incident_management_timeline_events do |t|
- t.timestamps_with_timezone null: false
- t.datetime_with_timezone :occurred_at, null: false
- t.bigint :project_id, null: false
- t.bigint :author_id
- t.bigint :issue_id, null: false
- t.bigint :updated_by_user_id
- t.bigint :promoted_from_note_id
- t.integer :cached_markdown_version
- t.boolean :editable, null: false, default: false
- t.text :note, limit: 10_000, null: false
- t.text :note_html, limit: 10_000, null: false
- t.text :action, limit: 128, null: false
-
- t.index :project_id, name: 'index_im_timeline_events_project_id'
- t.index :author_id, name: 'index_im_timeline_events_author_id'
- t.index :issue_id, name: 'index_im_timeline_events_issue_id'
- t.index :updated_by_user_id, name: 'index_im_timeline_events_updated_by_user_id'
- t.index :promoted_from_note_id, name: 'index_im_timeline_events_promoted_from_note_id'
- end
- end
-
- def down
- drop_table :incident_management_timeline_events
- end
-end
diff --git a/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb b/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb
deleted file mode 100644
index 893043cc1ab..00000000000
--- a/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToIncidentManagementTimelineEventsOnProject < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_timeline_events, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :incident_management_timeline_events, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb b/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb
deleted file mode 100644
index 0f5886eb5ed..00000000000
--- a/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToIncidentManagementTimelineEventsOnUser < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :author_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :incident_management_timeline_events, column: :author_id
- end
- end
-end
diff --git a/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb b/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb
deleted file mode 100644
index bdcf7f389d1..00000000000
--- a/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToIncidentManagementTimelineEventsOnIssue < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_timeline_events, :issues, column: :issue_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :incident_management_timeline_events, column: :issue_id
- end
- end
-end
diff --git a/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb b/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb
deleted file mode 100644
index e0e2bec72ad..00000000000
--- a/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatedAtToNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :ci_namespace_monthly_usages, :created_at, :datetime_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_namespace_monthly_usages, :created_at
- end
- end
-end
diff --git a/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb b/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb
deleted file mode 100644
index eb0cd448da3..00000000000
--- a/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatedAtToProjectMonthlyUsage < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :ci_project_monthly_usages, :created_at, :datetime_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_project_monthly_usages, :created_at
- end
- end
-end
diff --git a/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb b/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb
deleted file mode 100644
index a35020699fc..00000000000
--- a/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToIncidentManagementTimelineEventsOnUpdatedByUser < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :updated_by_user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :incident_management_timeline_events, column: :updated_by_user_id
- end
- end
-end
diff --git a/db/migrate/20211117174209_create_vulnerability_reads.rb b/db/migrate/20211117174209_create_vulnerability_reads.rb
deleted file mode 100644
index b9e32bfd0fa..00000000000
--- a/db/migrate/20211117174209_create_vulnerability_reads.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityReads < Gitlab::Database::Migration[1.0]
- def change
- create_table :vulnerability_reads do |t|
- t.bigint :vulnerability_id, null: false
- t.bigint :project_id, null: false
- t.bigint :scanner_id, null: false
- t.integer :report_type, limit: 2, null: false
- t.integer :severity, limit: 2, null: false
- t.integer :state, limit: 2, null: false
- t.boolean :has_issues, default: false, null: false
- t.boolean :resolved_on_default_branch, default: false, null: false
- t.uuid :uuid, null: false
- t.text :location_image, limit: 2048
-
- t.index :vulnerability_id, unique: true
- t.index :scanner_id
- t.index :uuid, unique: true
- t.index [:project_id, :state, :severity, :vulnerability_id], name: :index_vuln_reads_on_project_id_state_severity_and_vuln_id, order: { vulnerability_id: :desc }
- t.index :location_image, where: "report_type IN (2, 7)", name: :index_vulnerability_reads_on_location_image
- end
- end
-end
diff --git a/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb b/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb
deleted file mode 100644
index 185178d8025..00000000000
--- a/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDefaultValueOfLooseFkDeletedRecordsPartition < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- change_column_default(:loose_foreign_keys_deleted_records, :partition, from: nil, to: 1)
- end
-end
diff --git a/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb b/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb
deleted file mode 100644
index 33159167b19..00000000000
--- a/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveHardcodedPartitionFromLooseFkTriggerFunction < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
- RETURNS TRIGGER AS
- $$
- BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (fully_qualified_table_name, primary_key_value)
- SELECT TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table;
-
- RETURN NULL;
- END
- $$ LANGUAGE PLPGSQL
- SQL
- end
-
- def down
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
- RETURNS TRIGGER AS
- $$
- BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (partition, fully_qualified_table_name, primary_key_value)
- SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table
- ON CONFLICT DO NOTHING;
-
- RETURN NULL;
- END
- $$ LANGUAGE PLPGSQL
- SQL
- end
-end
diff --git a/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb b/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb
deleted file mode 100644
index 1b0d2104c91..00000000000
--- a/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddMaxSshKeyLifetimeToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :max_ssh_key_lifetime, :integer
- end
-end
diff --git a/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb b/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb
deleted file mode 100644
index dd5b0bdc028..00000000000
--- a/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToVulnerabilityReadsOnVulnerability < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :vulnerability_reads, :vulnerabilities, column: :vulnerability_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :vulnerability_reads, column: :vulnerability_id
- end
- end
-end
diff --git a/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb b/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb
deleted file mode 100644
index 14dde371e3d..00000000000
--- a/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToVulnerabilityReadsOnProject < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :vulnerability_reads, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :vulnerability_reads, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb b/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb
deleted file mode 100644
index 923e62a4beb..00000000000
--- a/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToVulnerabilityReadsOnScanner < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :vulnerability_reads, :vulnerability_scanners, column: :scanner_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :vulnerability_reads, column: :scanner_id
- end
- end
-end
diff --git a/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb b/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb
deleted file mode 100644
index f52bc346d16..00000000000
--- a/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddOrignalFilenameToCiJobArtifact < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20211119085036_add_text_limit_to_job_artifact_original_filename.rb
- def up
- add_column :ci_job_artifacts, :original_filename, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- remove_column :ci_job_artifacts, :original_filename, :text
- end
-end
diff --git a/db/migrate/20211119111006_create_job_artifact_states.rb b/db/migrate/20211119111006_create_job_artifact_states.rb
deleted file mode 100644
index 44dffed58ee..00000000000
--- a/db/migrate/20211119111006_create_job_artifact_states.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class CreateJobArtifactStates < Gitlab::Database::Migration[1.0]
- VERIFICATION_STATE_INDEX_NAME = "index_job_artifact_states_on_verification_state"
- PENDING_VERIFICATION_INDEX_NAME = "index_job_artifact_states_pending_verification"
- FAILED_VERIFICATION_INDEX_NAME = "index_job_artifact_states_failed_verification"
- NEEDS_VERIFICATION_INDEX_NAME = "index_job_artifact_states_needs_verification"
-
- enable_lock_retries!
-
- def up
- create_table :ci_job_artifact_states, id: false do |t|
- t.datetime_with_timezone :verification_started_at
- t.datetime_with_timezone :verification_retry_at
- t.datetime_with_timezone :verified_at
- t.references :job_artifact, primary_key: true, null: false, foreign_key: { on_delete: :cascade, to_table: :ci_job_artifacts }
- 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.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
-
- def down
- drop_table :ci_job_artifact_states
- end
-end
diff --git a/db/migrate/20211119154221_create_pages_deployment_states.rb b/db/migrate/20211119154221_create_pages_deployment_states.rb
deleted file mode 100644
index 283f6c7d0d7..00000000000
--- a/db/migrate/20211119154221_create_pages_deployment_states.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePagesDeploymentStates < Gitlab::Database::Migration[1.0]
- VERIFICATION_STATE_INDEX_NAME = "index_pages_deployment_states_on_verification_state"
- PENDING_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_pending_verification"
- FAILED_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_failed_verification"
- NEEDS_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_needs_verification"
-
- disable_ddl_transaction!
-
- def up
- unless table_exists?(:pages_deployment_states)
- with_lock_retries do
- create_table :pages_deployment_states, id: false do |t|
- t.references :pages_deployment, primary_key: true, null: false, foreign_key: { on_delete: :cascade }
- t.integer :verification_state, default: 0, limit: 2, null: false
- t.column :verification_started_at, :datetime_with_timezone
- t.datetime_with_timezone :verification_retry_at
- t.datetime_with_timezone :verified_at
- t.integer :verification_retry_count, limit: 2
- t.binary :verification_checksum, using: 'verification_checksum::bytea'
- t.text :verification_failure
-
- 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
- end
-
- add_text_limit :pages_deployment_states, :verification_failure, 255
- end
-
- def down
- drop_table :pages_deployment_states
- end
-end
diff --git a/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb b/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb
deleted file mode 100644
index 9064242ee30..00000000000
--- a/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTestReportRequirementIssueConstraint < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TARGET_TABLE = :requirements_management_test_reports
- CONSTRAINT_NAME = 'requirements_test_reports_requirement_id_xor_issue_id'
-
- def up
- remove_check_constraint TARGET_TABLE, CONSTRAINT_NAME
- end
-
- def down
- add_check_constraint(TARGET_TABLE, 'num_nonnulls(requirement_id, issue_id) = 1', CONSTRAINT_NAME)
- end
-end
diff --git a/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb b/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb
deleted file mode 100644
index ca6b78efbc7..00000000000
--- a/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequiredApprovalCountToProtectedEnvironments < Gitlab::Database::Migration[1.0]
- def change
- add_column :protected_environments, :required_approval_count, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20211119195201_create_deployment_approvals.rb b/db/migrate/20211119195201_create_deployment_approvals.rb
deleted file mode 100644
index a238da302f9..00000000000
--- a/db/migrate/20211119195201_create_deployment_approvals.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDeploymentApprovals < Gitlab::Database::Migration[1.0]
- def change
- create_table :deployment_approvals do |t|
- t.bigint :deployment_id, null: false
- t.bigint :user_id, null: false, index: true
- t.timestamps_with_timezone null: false
- t.integer :status, limit: 2, null: false
- t.index [:deployment_id, :user_id], unique: true
- end
- end
-end
diff --git a/db/migrate/20211122103051_add_line_code_to_draft_notes.rb b/db/migrate/20211122103051_add_line_code_to_draft_notes.rb
deleted file mode 100644
index c78b75f3a33..00000000000
--- a/db/migrate/20211122103051_add_line_code_to_draft_notes.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddLineCodeToDraftNotes < Gitlab::Database::Migration[1.0]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb
- def change
- add_column :draft_notes, :line_code, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb b/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb
deleted file mode 100644
index b1c7bc4d5ce..00000000000
--- a/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddPolicyIdxToApprovalMergeRequestRule < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :approval_merge_request_rules, :orchestration_policy_idx, :integer, limit: 2
- end
-end
diff --git a/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb b/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb
deleted file mode 100644
index 280626c5d3b..00000000000
--- a/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBatchedBackgroundMigrationJobTransitionLogs < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- def up
- execute(<<~SQL)
- CREATE TABLE batched_background_migration_job_transition_logs (
- id bigserial NOT NULL,
- batched_background_migration_job_id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- previous_status smallint NOT NULL,
- next_status smallint NOT NULL,
- exception_class text,
- exception_message text,
- CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)),
- CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)),
- PRIMARY KEY (id, created_at)
- ) PARTITION BY RANGE (created_at);
-
- CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id
- ON batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id);
-
- ALTER TABLE batched_background_migration_job_transition_logs ADD CONSTRAINT fk_rails_b7523a175b
- FOREIGN KEY (batched_background_migration_job_id) REFERENCES batched_background_migration_jobs(id) ON DELETE CASCADE;
- SQL
-
- min_date = Date.today
- max_date = Date.today + 6.months
-
- create_daterange_partitions('batched_background_migration_job_transition_logs', 'created_at', min_date, max_date)
- end
-
- def down
- drop_table :batched_background_migration_job_transition_logs
- end
-end
diff --git a/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb b/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb
deleted file mode 100644
index da20e9a8f8e..00000000000
--- a/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserForeignKeyToDeploymentApprovals < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :deployment_approvals, :users, column: :user_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :deployment_approvals, :users
- end
- end
-end
diff --git a/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb b/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb
deleted file mode 100644
index 10a0c6ca402..00000000000
--- a/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class MakeIterationCadencesStartDateNullable < Gitlab::Database::Migration[1.0]
- def change
- change_column_null :iterations_cadences, :start_date, true
- end
-end
diff --git a/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb b/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb
deleted file mode 100644
index b3567d6b873..00000000000
--- a/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddDraftNotesLineCodeTextLimit < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :draft_notes, :line_code, 255
- end
-
- def down
- remove_text_limit :draft_notes, :line_code
- end
-end
diff --git a/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb b/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb
deleted file mode 100644
index 868bc4f14f2..00000000000
--- a/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddEncryptedStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0]
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20211126113029_add_text_limit_for_static_objects_external_storage_auth_token
- add_column :application_settings, :static_objects_external_storage_auth_token_encrypted, :text
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- remove_column :application_settings, :static_objects_external_storage_auth_token_encrypted
- end
-end
diff --git a/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb b/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb
deleted file mode 100644
index cbe5dbf99fc..00000000000
--- a/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddSequenceColumnToSprintsTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- add_column :sprints, :sequence, :integer
- execute "ALTER TABLE sprints ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED"
- end
-
- def down
- remove_column :sprints, :sequence
- end
-end
diff --git a/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb b/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb
deleted file mode 100644
index 45c4686e674..00000000000
--- a/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-class AddTextLimitForStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :static_objects_external_storage_auth_token_encrypted, 255
- end
-
- def down
- remove_text_limit :application_settings, :static_objects_external_storage_auth_token_encrypted
- end
-end
diff --git a/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb b/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb
deleted file mode 100644
index 92ba54d4c89..00000000000
--- a/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class EncryptStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0]
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = 'application_settings'
-
- scope :encrypted_token_is_null, -> { where(static_objects_external_storage_auth_token_encrypted: nil) }
- scope :encrypted_token_is_not_null, -> { where.not(static_objects_external_storage_auth_token_encrypted: nil) }
- scope :plaintext_token_is_not_null, -> { where.not(static_objects_external_storage_auth_token: nil) }
- end
-
- def up
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.encrypted_token_is_null.plaintext_token_is_not_null.find_each do |application_setting|
- next if application_setting.static_objects_external_storage_auth_token.empty?
-
- token_encrypted = Gitlab::CryptoHelper.aes256_gcm_encrypt(application_setting.static_objects_external_storage_auth_token)
- application_setting.update!(static_objects_external_storage_auth_token_encrypted: token_encrypted)
- end
- end
-
- def down
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.encrypted_token_is_not_null.find_each do |application_setting|
- token = Gitlab::CryptoHelper.aes256_gcm_decrypt(application_setting.static_objects_external_storage_auth_token_encrypted)
- application_setting.update!(static_objects_external_storage_auth_token: token, static_objects_external_storage_auth_token_encrypted: nil)
- end
- end
-end
diff --git a/db/migrate/20211126142200_add_encrypted_static_object_token.rb b/db/migrate/20211126142200_add_encrypted_static_object_token.rb
deleted file mode 100644
index 839354244e7..00000000000
--- a/db/migrate/20211126142200_add_encrypted_static_object_token.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddEncryptedStaticObjectToken < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20211126142354_add_text_limit_to_encrypted_static_object_token
- add_column :users, :static_object_token_encrypted, :text # rubocop:disable Migration/AddColumnsToWideTables
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- remove_column :users, :static_object_token_encrypted
- end
-end
diff --git a/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb b/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb
deleted file mode 100644
index a43e7d9a741..00000000000
--- a/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToEncryptedStaticObjectToken < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :users, :static_object_token_encrypted, 255
- end
-
- def down
- remove_text_limit :users, :static_object_token_encrypted
- end
-end
diff --git a/db/migrate/20211126204445_add_task_to_work_item_types.rb b/db/migrate/20211126204445_add_task_to_work_item_types.rb
deleted file mode 100644
index 875c2272c6d..00000000000
--- a/db/migrate/20211126204445_add_task_to_work_item_types.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class AddTaskToWorkItemTypes < Gitlab::Database::Migration[1.0]
- TASK_ENUM_VALUE = 4
-
- class WorkItemType < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
- self.table_name = 'work_item_types'
-
- validates :name, uniqueness: { case_sensitive: false, scope: [:namespace_id] }
- end
-
- def up
- # New instances will not run this migration and add this type via fixtures
- # checking if record exists mostly because migration specs will run all migrations
- # and that will conflict with the preloaded base work item types
- task_work_item = WorkItemType.find_by(name: 'Task', namespace_id: nil)
-
- if task_work_item
- say('Task item record exist, skipping creation')
- else
- WorkItemType.create(name: 'Task', namespace_id: nil, base_type: TASK_ENUM_VALUE, icon_name: 'issue-type-task')
- end
- end
-
- def down
- # There's the remote possibility that issues could already be
- # using this issue type, with a tight foreign constraint.
- # Therefore we will not attempt to remove any data.
- end
-end
diff --git a/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb b/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb
deleted file mode 100644
index 8c3cf82d7c7..00000000000
--- a/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddMigratedToNewStructureColumnToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- def change
- add_column :vulnerability_occurrences, :migrated_to_new_structure, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb b/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb
deleted file mode 100644
index 4cf8263f8f0..00000000000
--- a/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnVulnerabilityOccurrencesMigratedToNewStructureColumn < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_vulnerability_occurrences_on_migrated_to_new_structure'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerability_occurrences, [:migrated_to_new_structure, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
- end
-end
diff --git a/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb b/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb
deleted file mode 100644
index a09409900f7..00000000000
--- a/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToIncidentManagementTimelineEventsOnNote < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_timeline_events, :notes, column: :promoted_from_note_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :incident_management_timeline_events, column: :promoted_from_note_id
- end
- end
-end
diff --git a/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb b/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb
deleted file mode 100644
index 1aca3e7e8e2..00000000000
--- a/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniquenessForEvidenceOccurrenceId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'finding_evidences_on_vulnerability_occurrence_id'
- UNIQUE_INDEX_NAME = 'finding_evidences_on_unique_vulnerability_occurrence_id'
-
- def up
- add_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], unique: true, name: UNIQUE_INDEX_NAME
- remove_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: INDEX_NAME
- remove_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: UNIQUE_INDEX_NAME
- end
-end
diff --git a/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb b/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb
deleted file mode 100644
index 9cbbef42327..00000000000
--- a/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddFutureSubscriptionsToApplicationSettings < Gitlab::Database::Migration[1.0]
- def change
- add_column :application_settings, :future_subscriptions, :jsonb, null: false, default: []
- end
-end
diff --git a/db/migrate/20211201143042_create_lfs_object_states.rb b/db/migrate/20211201143042_create_lfs_object_states.rb
deleted file mode 100644
index 91accbcd438..00000000000
--- a/db/migrate/20211201143042_create_lfs_object_states.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class CreateLfsObjectStates < Gitlab::Database::Migration[1.0]
- VERIFICATION_STATE_INDEX_NAME = "index_lfs_object_states_on_verification_state"
- PENDING_VERIFICATION_INDEX_NAME = "index_lfs_object_states_pending_verification"
- FAILED_VERIFICATION_INDEX_NAME = "index_lfs_object_states_failed_verification"
- NEEDS_VERIFICATION_INDEX_NAME = "index_lfs_object_states_needs_verification"
-
- disable_ddl_transaction!
-
- def up
- create_table :lfs_object_states, id: false do |t|
- t.datetime_with_timezone :verification_started_at
- t.datetime_with_timezone :verification_retry_at
- t.datetime_with_timezone :verified_at
- t.references :lfs_object, primary_key: true, null: false, foreign_key: { on_delete: :cascade }
- 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.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
-
- def down
- drop_table :lfs_object_states
- end
-end
diff --git a/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb b/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb
deleted file mode 100644
index 60bc892d792..00000000000
--- a/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddDeploymentForeignKeyToDeploymentApprovals < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :deployment_approvals, :deployments, column: :deployment_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :deployment_approvals, :deployments
- end
- end
-end
diff --git a/db/migrate/20210826171758_init_schema.rb b/db/migrate/20211202041233_init_schema.rb
index 971a3e0e2db..97027f8a9e4 100644
--- a/db/migrate/20210826171758_init_schema.rb
+++ b/db/migrate/20211202041233_init_schema.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class InitSchema < ActiveRecord::Migration[6.0]
+class InitSchema < Gitlab::Database::Migration[1.0]
DOWNTIME = false
def up
diff --git a/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb b/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb
new file mode 100644
index 00000000000..c0537a1985d
--- /dev/null
+++ b/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class CreateServiceDeskCustomEmailCredentials < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ create_table(:service_desk_custom_email_credentials, id: false) do |t|
+ t.references :project,
+ primary_key: true,
+ default: nil,
+ index: false,
+ foreign_key: { to_table: :projects, on_delete: :cascade }
+ t.timestamps_with_timezone
+ t.integer :smtp_port
+ t.text :smtp_address, limit: 255
+ t.binary :encrypted_smtp_username
+ t.binary :encrypted_smtp_username_iv
+ t.binary :encrypted_smtp_password
+ t.binary :encrypted_smtp_password_iv
+ end
+ end
+end
diff --git a/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb b/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb
deleted file mode 100644
index 1e65d5647e4..00000000000
--- a/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexDastSiteTokenProjectIdAndUrl < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_dast_site_token_on_project_id_and_url'
-
- def up
- add_concurrent_index :dast_site_tokens, [:project_id, :url], name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :dast_site_tokens, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb b/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb
deleted file mode 100644
index d6b2db7790f..00000000000
--- a/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleExtractProjectTopicsIntoSeparateTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'ExtractProjectTopicsIntoSeparateTable'
- DELAY_INTERVAL = 4.minutes
-
- disable_ddl_transaction!
-
- def up
- requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb b/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb
deleted file mode 100644
index a3fe0e6bd7a..00000000000
--- a/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryTriggerForCiSourcesPipelines < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = 'ci_sources_pipelines'
- TEMPORARY_COLUMN = 'source_job_id_convert_to_bigint'
- MAIN_COLUMN = 'source_job_id'
- TRIGGER = 'trigger_8485e97c00e3'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- remove_rename_triggers(TABLE, TRIGGER)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- install_rename_triggers(TABLE, MAIN_COLUMN, TEMPORARY_COLUMN, trigger_name: TRIGGER)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb b/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb
deleted file mode 100644
index e11f0d46563..00000000000
--- a/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class PushEventPayloadsBigintConversionRemoveTriggers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = :push_event_payloads
- TRIGGER_NAME = 'trigger_07c94931164e'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- check_trigger_permissions!(TABLE_NAME)
-
- with_lock_retries do
- remove_rename_triggers(TABLE_NAME, TRIGGER_NAME)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE_NAME)
-
- with_lock_retries do
- install_rename_triggers(TABLE_NAME, :event_id, :event_id_convert_to_bigint, trigger_name: TRIGGER_NAME)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb b/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb
deleted file mode 100644
index bfe3af2efa8..00000000000
--- a/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class EventsBigintConversionRemoveTriggers < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = :events
- TRIGGER_NAME = :trigger_69523443cc10
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- check_trigger_permissions!(TABLE_NAME)
-
- with_lock_retries do
- remove_rename_triggers(TABLE_NAME, TRIGGER_NAME)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE_NAME)
-
- with_lock_retries do
- install_rename_triggers(TABLE_NAME, :id, :id_convert_to_bigint, trigger_name: TRIGGER_NAME)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb b/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb
deleted file mode 100644
index 8ee7feae1a6..00000000000
--- a/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-class SliceMergeRequestDiffCommitMigrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- BATCH_SIZE = 5_000
- MIGRATION_CLASS = 'MigrateMergeRequestDiffCommitUsers'
- STEAL_MIGRATION_CLASS = 'StealMigrateMergeRequestDiffCommitUsers'
-
- def up
- old_jobs = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION_CLASS)
- .pending
- .to_a
-
- return if old_jobs.empty?
-
- transaction do
- # This ensures we stop processing the old ranges, as the background
- # migrations skip already processed jobs.
- Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION_CLASS)
- .pending
- .update_all(status: :succeeded)
-
- rows = []
-
- old_jobs.each do |job|
- min, max = job.arguments
-
- while min < max
- rows << {
- class_name: MIGRATION_CLASS,
- arguments: [min, min + BATCH_SIZE],
- created_at: Time.now.utc,
- updated_at: Time.now.utc
- }
-
- min += BATCH_SIZE
- end
- end
-
- Gitlab::Database::BackgroundMigrationJob.insert_all!(rows)
- end
-
- job = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION_CLASS)
- .pending
- .first
-
- migrate_in(1.hour, STEAL_MIGRATION_CLASS, job.arguments)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb b/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb
deleted file mode 100644
index 47795c5d646..00000000000
--- a/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareAsyncIndexesForCiBuilds < Gitlab::Database::Migration[1.0]
- def up
- prepare_async_index :ci_builds, :stage_id_convert_to_bigint, name: :index_ci_builds_on_converted_stage_id
-
- prepare_async_index :ci_builds, [:commit_id, :artifacts_expire_at, :id_convert_to_bigint],
- 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]))",
- name: :index_ci_builds_on_commit_id_expire_at_and_converted_id
-
- prepare_async_index :ci_builds, [:project_id, :id_convert_to_bigint],
- name: :index_ci_builds_on_project_and_converted_id
-
- prepare_async_index :ci_builds, [:runner_id, :id_convert_to_bigint],
- order: { id_convert_to_bigint: :desc },
- name: :index_ci_builds_on_runner_id_and_converted_id_desc
-
- prepare_async_index :ci_builds, [:resource_group_id, :id_convert_to_bigint],
- where: 'resource_group_id IS NOT NULL',
- name: :index_ci_builds_on_resource_group_and_converted_id
-
- prepare_async_index :ci_builds, [:name, :id_convert_to_bigint],
- 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",
- name: :index_security_ci_builds_on_name_and_converted_id_parser
-
- prepare_async_index_from_sql(:ci_builds, :index_ci_builds_runner_id_and_converted_id_pending_covering, <<~SQL.squish)
- CREATE INDEX CONCURRENTLY index_ci_builds_runner_id_and_converted_id_pending_covering
- ON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id)
- WHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text
- SQL
- end
-
- def down
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_runner_id_and_converted_id_pending_covering
-
- unprepare_async_index_by_name :ci_builds, :index_security_ci_builds_on_name_and_converted_id_parser
-
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_resource_group_and_converted_id
-
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_runner_id_and_converted_id_desc
-
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_project_and_converted_id
-
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_commit_id_expire_at_and_converted_id
-
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_converted_stage_id
- end
-
- private
-
- def prepare_async_index_from_sql(table_name, index_name, definition)
- return unless async_index_creation_available?
-
- return if index_name_exists?(table_name, index_name)
-
- async_index = Gitlab::Database::AsyncIndexes::PostgresAsyncIndex.find_or_create_by!(name: index_name) do |rec|
- rec.table_name = table_name
- rec.definition = definition
- end
-
- Gitlab::AppLogger.info(
- message: 'Prepared index for async creation',
- table_name: async_index.table_name,
- index_name: async_index.name)
- end
-end
diff --git a/db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb b/db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb
deleted file mode 100644
index f04c5cd6561..00000000000
--- a/db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryColumnsAndTriggersForCiBuildNeeds < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = 'ci_build_needs'
- TEMPORARY_COLUMN = 'build_id_convert_to_bigint'
- MAIN_COLUMN = 'build_id'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, MAIN_COLUMN)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- add_column(TABLE, TEMPORARY_COLUMN, :int, default: 0, null: false)
- install_rename_triggers(TABLE, MAIN_COLUMN, TEMPORARY_COLUMN)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb b/db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb
deleted file mode 100644
index 44bec402cae..00000000000
--- a/db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryColumnsAndTriggersForCiBuildTraceChunks < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = 'ci_build_trace_chunks'
- COLUMN = 'build_id'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
-end
diff --git a/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb b/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb
deleted file mode 100644
index cb5714055bb..00000000000
--- a/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryColumnsAndTriggersForTaggings < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- TABLE = 'taggings'
- COLUMNS = %w(id taggable_id)
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb b/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb
deleted file mode 100644
index 54dce0a7da8..00000000000
--- a/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBigintConversionForCiBuildsMetadata < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- TABLE = :ci_builds_metadata
-
- def up
- cleanup_conversion_of_integer_to_bigint(TABLE, :id)
- cleanup_conversion_of_integer_to_bigint(TABLE, :build_id)
- end
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, :build_id)
- restore_conversion_of_integer_to_bigint(TABLE, :id)
- end
-end
diff --git a/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb b/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb
deleted file mode 100644
index 096b5b3bf42..00000000000
--- a/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBigintConversionForCiStages < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = :ci_stages
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, :id)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, :id)
- end
-end
diff --git a/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb b/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb
deleted file mode 100644
index 2d71c11cfa8..00000000000
--- a/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBigintConversionForDeployments < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = :deployments
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, :deployable_id)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, :deployable_id)
- end
-end
diff --git a/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb b/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb
deleted file mode 100644
index 26f00454029..00000000000
--- a/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBigintConversionForGeoJobArtifactDeletedEvents < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE = :geo_job_artifact_deleted_events
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, :job_artifact_id)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, :job_artifact_id)
- end
-end
diff --git a/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb b/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb
deleted file mode 100644
index f164cdbf379..00000000000
--- a/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb
+++ /dev/null
@@ -1,223 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsBigintConversion < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds'
- PK_INDEX_NAME = 'index_ci_builds_on_converted_id'
-
- SECONDARY_INDEXES = [
- {
- original_name: :index_ci_builds_on_commit_id_artifacts_expired_at_and_id,
- temporary_name: :index_ci_builds_on_commit_id_expire_at_and_converted_id,
- columns: [:commit_id, :artifacts_expire_at, :id_convert_to_bigint],
- options: {
- 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]))"
- }
- },
- {
- original_name: :index_ci_builds_on_project_id_and_id,
- temporary_name: :index_ci_builds_on_project_and_converted_id,
- columns: [:project_id, :id_convert_to_bigint],
- options: {}
- },
- {
- original_name: :index_ci_builds_on_runner_id_and_id_desc,
- temporary_name: :index_ci_builds_on_runner_id_and_converted_id_desc,
- columns: [:runner_id, :id_convert_to_bigint],
- options: { order: { id_convert_to_bigint: :desc } }
- },
- {
- original_name: :index_for_resource_group,
- temporary_name: :index_ci_builds_on_resource_group_and_converted_id,
- columns: [:resource_group_id, :id_convert_to_bigint],
- options: { where: 'resource_group_id IS NOT NULL' }
- },
- {
- original_name: :index_security_ci_builds_on_name_and_id_parser_features,
- temporary_name: :index_security_ci_builds_on_name_and_converted_id_parser,
- columns: [:name, :id_convert_to_bigint],
- options: {
- 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"
- }
- }
- ].freeze
-
- MANUAL_INDEX_NAMES = {
- original_name: :index_ci_builds_runner_id_pending_covering,
- temporary_name: :index_ci_builds_runner_id_and_converted_id_pending_covering
- }.freeze
-
- REFERENCING_FOREIGN_KEYS = [
- [:ci_build_needs, :build_id, :cascade, 'fk_rails_'],
- [:ci_build_pending_states, :build_id, :cascade, 'fk_rails_'],
- [:ci_build_report_results, :build_id, :cascade, 'fk_rails_'],
- [:ci_build_trace_chunks, :build_id, :cascade, 'fk_rails_'],
- [:ci_build_trace_metadata, :build_id, :cascade, 'fk_rails_'],
- [:ci_builds_runner_session, :build_id, :cascade, 'fk_rails_'],
- [:ci_builds_metadata, :build_id, :cascade, 'fk_'],
- [:ci_job_artifacts, :job_id, :cascade, 'fk_rails_'],
- [:ci_job_variables, :job_id, :cascade, 'fk_rails_'],
- [:ci_pending_builds, :build_id, :cascade, 'fk_rails_'],
- [:ci_resources, :build_id, :nullify, 'fk_'],
- [:ci_running_builds, :build_id, :cascade, 'fk_rails_'],
- [:ci_sources_pipelines, :source_job_id, :cascade, 'fk_'],
- [:ci_unit_test_failures, :build_id, :cascade, 'fk_'],
- [:dast_scanner_profiles_builds, :ci_build_id, :cascade, 'fk_'],
- [:dast_site_profiles_builds, :ci_build_id, :cascade, 'fk_'],
- [:pages_deployments, :ci_build_id, :nullify, 'fk_rails_'],
- [:requirements_management_test_reports, :build_id, :nullify, 'fk_rails_'],
- [:security_scans, :build_id, :cascade, 'fk_rails_'],
- [:terraform_state_versions, :ci_build_id, :nullify, 'fk_']
- ].freeze
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id stage_id], %w[id_convert_to_bigint stage_id_convert_to_bigint]]
- )
-
- # Remove this upfront since this table is being dropped, and doesn't need to be migrated
- if foreign_key_exists?(:dep_ci_build_trace_sections, TABLE_NAME, column: :build_id)
- remove_foreign_key(:dep_ci_build_trace_sections, TABLE_NAME, column: :build_id)
- end
-
- # Remove this unexpected FK if it exists - https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5531#note_676576081
- if foreign_key_exists?(:ci_resources, TABLE_NAME, column: :build_id, name: 'fk_rails_e169a8e3d5')
- remove_foreign_key(:ci_resources, TABLE_NAME, column: :build_id, name: 'fk_rails_e169a8e3d5')
- end
-
- # Remove this unexpected FK if it exists - https://gitlab.com/gitlab-org/gitlab/-/issues/341822
- if foreign_key_exists?(:ci_sources_pipelines, TABLE_NAME, column: :source_job_id, name: 'fk_3f0c88d7dc')
- remove_foreign_key(:ci_sources_pipelines, TABLE_NAME, column: :source_job_id, name: 'fk_3f0c88d7dc')
- end
-
- swap_columns
- end
-
- def down
- swap_columns
- end
-
- private
-
- def swap_columns
- # 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
- quoted_table_name = quote_table_name(TABLE_NAME)
-
- # Swap the original and new column names
- temporary_name = 'id_tmp'
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temporary_name)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(temporary_name)} TO #{quote_column_name(: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, :stage_id], [:id_convert_to_bigint, :stage_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 ci_builds_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_builds_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 #{quoted_table_name} DROP CONSTRAINT ci_builds_pkey"
- rename_index TABLE_NAME, PK_INDEX_NAME, 'ci_builds_pkey'
- execute "ALTER TABLE #{quoted_table_name} ADD CONSTRAINT ci_builds_pkey PRIMARY KEY USING INDEX ci_builds_pkey"
-
- # Remove old column indexes and change new column indexes to have the original names
- rename_secondary_indexes # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- end
- 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
-
- unless index_name_exists?(TABLE_NAME, MANUAL_INDEX_NAMES[:temporary_name])
- execute(<<~SQL)
- CREATE INDEX CONCURRENTLY #{MANUAL_INDEX_NAMES[:temporary_name]}
- ON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id)
- WHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text
- SQL
- end
- end
-
- def rename_secondary_indexes
- (SECONDARY_INDEXES + [MANUAL_INDEX_NAMES]).each do |index_definition|
- remove_index(TABLE_NAME, name: index_definition[:original_name]) # 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, column, on_delete, prefix)|
- # 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)
-
- temporary_name = "#{concurrent_foreign_key_name(from_table, column, prefix: prefix)}_tmp"
-
- add_concurrent_foreign_key(
- from_table,
- TABLE_NAME,
- column: column,
- target_column: :id_convert_to_bigint,
- name: temporary_name,
- on_delete: on_delete)
- end
- end
-
- def replace_referencing_foreign_keys
- REFERENCING_FOREIGN_KEYS.each do |(from_table, column, _, prefix)|
- existing_name = concurrent_foreign_key_name(from_table, column, prefix: prefix)
-
- # 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: existing_name)
-
- with_lock_retries do
- temporary_name = "#{existing_name}_tmp"
-
- remove_foreign_key(from_table, TABLE_NAME, column: column, primary_key: :id, name: existing_name)
- rename_constraint(from_table, temporary_name, existing_name)
- end
- end
- end
-end
diff --git a/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb b/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb
deleted file mode 100644
index 3a758394d7f..00000000000
--- a/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class DisableJobTokenScopeWhenUnused < Gitlab::Database::Migration[1.0]
- def up
- # no-op: Must have run before %"15.X" as it is not compatible with decomposed CI database
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb b/db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb
deleted file mode 100644
index ad31a40f324..00000000000
--- a/db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleExtractProjectTopicsIntoSeparateTable2 < Gitlab::Database::Migration[1.0]
- MIGRATION = 'ExtractProjectTopicsIntoSeparateTable'
- DELAY_INTERVAL = 4.minutes
-
- disable_ddl_transaction!
-
- def up
- requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210909152027_remove_container_registry_enabled.rb b/db/post_migrate/20210909152027_remove_container_registry_enabled.rb
deleted file mode 100644
index d97faaf58d2..00000000000
--- a/db/post_migrate/20210909152027_remove_container_registry_enabled.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveContainerRegistryEnabled < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :projects, :container_registry_enabled
- end
- end
-
- def down
- with_lock_retries do
- add_column :projects, :container_registry_enabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
- end
- end
-end
diff --git a/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb b/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb
deleted file mode 100644
index 537c235edab..00000000000
--- a/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateReportTypeForExistingApprovalProjectRules < Gitlab::Database::Migration[1.0]
- def up
- # 1. We only want to consider when rule_type is set to :report_approver (i.e., 2):
- # enum rule_type: {
- # regular: 0,
- # code_owner: 1, # currently unused
- # report_approver: 2,
- # any_approver: 3
- # }
- # 2. Also we want to change only the folowing names and respective values:
- # DEFAULT_NAME_FOR_LICENSE_REPORT = 'License-Check'
- # DEFAULT_NAME_FOR_VULNERABILITY_REPORT = 'Vulnerability-Check'
- # DEFAULT_NAME_FOR_COVERAGE = 'Coverage-Check'
- # enum report_type: {
- # vulnerability: 1,
- # license_scanning: 2,
- # code_coverage: 3
- # }
-
- execute <<~SQL
- UPDATE approval_project_rules
- SET report_type = converted_values.report_type
- FROM
- ( values
- (1, 'Vulnerability-Check'),
- (2, 'License-Check'),
- (3, 'Coverage-Check')
- ) AS converted_values(report_type, name)
- WHERE approval_project_rules.name = converted_values.name
- AND approval_project_rules.rule_type = 2;
- SQL
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb b/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb
deleted file mode 100644
index 3584c7136e3..00000000000
--- a/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddGinIndexOnPendingBuildsNamespaceTraversalIds < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_gin_ci_pending_builds_on_namespace_traversal_ids'
-
- def up
- add_concurrent_index :ci_pending_builds, :namespace_traversal_ids, name: INDEX_NAME, using: :gin
- end
-
- def down
- remove_concurrent_index_by_name :ci_pending_builds, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb b/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb
deleted file mode 100644
index 4756bc3dca5..00000000000
--- a/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupOrphanProjectAccessTokens < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'idx_users_on_user_type_project_bots_batched'
-
- def up
- users_table = define_batchable_model('users')
-
- add_concurrent_index(:users, :id, name: TMP_INDEX_NAME, where: 'user_type = 6')
-
- accumulated_orphans = []
- users_table.where(user_type: 6).each_batch(of: 500) do |relation|
- orphan_ids = relation.where("not exists(select 1 from members where members.user_id = users.id)").pluck(:id)
-
- orphan_ids.each_slice(10) do |ids|
- users_table.where(id: ids).update_all(state: 'deactivated')
- end
-
- accumulated_orphans += orphan_ids
- end
-
- schedule_deletion(accumulated_orphans)
- ensure
- remove_concurrent_index_by_name(:users, TMP_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:users, TMP_INDEX_NAME) if index_exists_by_name?(:users, TMP_INDEX_NAME)
- end
-
- private
-
- def schedule_deletion(orphan_ids)
- return unless deletion_worker
-
- orphan_ids.each_slice(100) do |ids|
- job_arguments = ids.map do |orphan_id|
- [orphan_id, orphan_id, { skip_authorization: true }]
- end
-
- deletion_worker.bulk_perform_async(job_arguments)
- end
- rescue StandardError
- # Ignore any errors or interface changes since this part of migration is optional
- end
-
- def deletion_worker
- @deletion_worker = "DeleteUserWorker".safe_constantize unless defined?(@deletion_worker)
-
- @deletion_worker
- end
-end
diff --git a/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb b/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb
deleted file mode 100644
index d72866691ff..00000000000
--- a/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBigintConversionForCiBuilds < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- TABLE = :ci_builds
- COLUMNS = [:id, :stage_id]
-
- def up
- cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-
- def down
- restore_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb b/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb
deleted file mode 100644
index 42d21806405..00000000000
--- a/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id'
-
- def up
- prepare_async_index :ci_builds, [:resource_group_id, :status, :commit_id],
- where: 'resource_group_id IS NOT NULL',
- name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name :ci_builds, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
deleted file mode 100644
index 224d97243c5..00000000000
--- a/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveOldPendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0]
- MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid'
- NEW_MIGRATION_START_DATE = DateTime.new(2021, 8, 18, 0, 0, 0)
-
- def up
- Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION_NAME)
- .where('created_at < ?', NEW_MIGRATION_START_DATE)
- .where(status: :pending)
- .delete_all
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
deleted file mode 100644
index c03c379dcc0..00000000000
--- a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ReschedulePendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- # no replacement because we will reschedule this for the whole table
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb b/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb
deleted file mode 100644
index 7435a2c889b..00000000000
--- a/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiBuildsForeignKeyFromTerraformStateVersions < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:terraform_state_versions, :ci_builds)
- end
- end
-
- def down
- add_concurrent_foreign_key(:terraform_state_versions, :ci_builds, column: :ci_build_id, on_delete: :nullify)
- end
-end
diff --git a/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb
deleted file mode 100644
index 7a6543395ff..00000000000
--- a/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddImageLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_vulnerability_occurrences_on_location_image'
-
- def up
- add_concurrent_index :vulnerability_occurrences, "(location -> 'image')",
- using: 'GIN',
- where: 'report_type IN (2, 7)',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb b/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb
deleted file mode 100644
index e45d6ed34aa..00000000000
--- a/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class DropInt4ColumnsForCiJobArtifacts < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :ci_job_artifacts, :id_convert_to_bigint, :integer, null: false, default: 0
- remove_column :ci_job_artifacts, :job_id_convert_to_bigint, :integer, null: false, default: 0
- end
-end
diff --git a/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb b/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb
deleted file mode 100644
index b25f1d88736..00000000000
--- a/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DropInt4ColumnForCiSourcesPipelines < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :ci_sources_pipelines, :source_job_id_convert_to_bigint, :integer
- end
-end
diff --git a/db/post_migrate/20210922082019_drop_int4_column_for_events.rb b/db/post_migrate/20210922082019_drop_int4_column_for_events.rb
deleted file mode 100644
index a34d54e11e3..00000000000
--- a/db/post_migrate/20210922082019_drop_int4_column_for_events.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DropInt4ColumnForEvents < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :events, :id_convert_to_bigint, :integer, null: false, default: 0
- end
-end
diff --git a/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb b/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb
deleted file mode 100644
index 922a9b64b55..00000000000
--- a/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class ConcurrentIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id'
-
- disable_ddl_transaction!
-
- # Indexes were pre-created on gitlab.com to avoid slowing down deployments
- # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70279
-
- # rubocop: disable Migration/PreventIndexCreation
- def up
- add_concurrent_index :ci_builds, [:resource_group_id, :status, :commit_id],
- where: 'resource_group_id IS NOT NULL',
- name: INDEX_NAME
- end
- # rubocop: enable Migration/PreventIndexCreation
-
- def down
- remove_concurrent_index_by_name :ci_builds, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb b/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb
deleted file mode 100644
index 5e30ddacc98..00000000000
--- a/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DropInt4ColumnForPushEventPayloads < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :push_event_payloads, :event_id_convert_to_bigint, :integer, null: false, default: 0
- end
-end
diff --git a/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb b/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb
deleted file mode 100644
index a33885cc87b..00000000000
--- a/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveRedundantTaggingsIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = :index_taggings_on_taggable_id_and_taggable_type
-
- def up
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-
- def down
- add_concurrent_index :taggings, [:taggable_id, :taggable_type], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb
deleted file mode 100644
index 531410a91d9..00000000000
--- a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDelayedProjectRemovalFromNamespaces < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :namespaces, :delayed_project_removal
- end
- end
-
- def down
- with_lock_retries do
- add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false, if_not_exists: true # rubocop:disable Migration/AddColumnsToWideTables
- end
-
- add_concurrent_index :namespaces, :id, name: 'tmp_idx_on_namespaces_delayed_project_removal', where: 'delayed_project_removal = TRUE'
- end
-end
diff --git a/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb b/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb
deleted file mode 100644
index 1da5aad0fab..00000000000
--- a/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromOpenProjectDataTable < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key :open_project_tracker_data, column: :service_id
- end
- end
-
- def down
- with_lock_retries do
- add_foreign_key :open_project_tracker_data, :integrations, column: :service_id, on_delete: :cascade
- end
- end
-end
diff --git a/db/post_migrate/20210923192649_remove_open_project_data_table.rb b/db/post_migrate/20210923192649_remove_open_project_data_table.rb
deleted file mode 100644
index 252d7e07261..00000000000
--- a/db/post_migrate/20210923192649_remove_open_project_data_table.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveOpenProjectDataTable < Gitlab::Database::Migration[1.0]
- def up
- drop_table :open_project_tracker_data
- end
-
- def down
- create_table :open_project_tracker_data do |t|
- t.integer :service_id, index: { name: 'index_open_project_tracker_data_on_service_id' }, null: false
- t.timestamps_with_timezone
- t.string :encrypted_url, limit: 255
- t.string :encrypted_url_iv, limit: 255
- t.string :encrypted_api_url, limit: 255
- t.string :encrypted_api_url_iv, limit: 255
- t.string :encrypted_token, limit: 255
- t.string :encrypted_token_iv, limit: 255
- t.string :closed_status_id, limit: 5
- t.string :project_identifier_code, limit: 100
- end
- end
-end
diff --git a/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb b/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb
deleted file mode 100644
index c7b0c7c6d14..00000000000
--- a/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIssuesRelativePositionIndexes < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- RELATIVE_POSITION_INDEX_NAME = 'idx_issues_on_project_id_and_rel_asc_and_id'
- RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_state_id_and_id'
-
- NEW_RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_id_and_state_id'
-
- def up
- add_concurrent_index :issues, [:project_id, :relative_position, :id, :state_id], name: NEW_RELATIVE_POSITION_STATE_INDEX_NAME
-
- remove_concurrent_index_by_name :issues, RELATIVE_POSITION_INDEX_NAME
- remove_concurrent_index_by_name :issues, RELATIVE_POSITION_STATE_INDEX_NAME
- end
-
- def down
- add_concurrent_index :issues, [:project_id, :relative_position, :state_id, :id], order: { id: :desc }, name: RELATIVE_POSITION_STATE_INDEX_NAME
- add_concurrent_index :issues, [:project_id, :relative_position, :id], name: RELATIVE_POSITION_INDEX_NAME
-
- remove_concurrent_index_by_name :issues, NEW_RELATIVE_POSITION_STATE_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210930211936_backfill_user_namespace.rb b/db/post_migrate/20210930211936_backfill_user_namespace.rb
deleted file mode 100644
index 6d71b09ad63..00000000000
--- a/db/post_migrate/20210930211936_backfill_user_namespace.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillUserNamespace < Gitlab::Database::Migration[1.0]
- MIGRATION = 'BackfillUserNamespace'
- INTERVAL = 2.minutes
- BATCH_SIZE = 1_000
- SUB_BATCH_SIZE = 200
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :namespaces,
- :id,
- job_interval: INTERVAL,
- batch_size: BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :namespaces, :id, [])
- end
-end
diff --git a/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb b/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb
deleted file mode 100644
index 2c2c3ac00af..00000000000
--- a/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTemporaryIndexToIssueMetrics < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit'
-
- def up
- condition = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics
- .first_mentioned_in_commit_at_condition
- add_concurrent_index :issue_metrics, :issue_id, where: condition, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb b/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb
deleted file mode 100644
index ffdb7f80f0e..00000000000
--- a/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleFixFirstMentionedInCommitAtJob < Gitlab::Database::Migration[1.0]
- MIGRATION = 'FixFirstMentionedInCommitAt'
- BATCH_SIZE = 10_000
- INTERVAL = 2.minutes.to_i
-
- disable_ddl_transaction!
-
- def up
- scope = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics
- .from_2020
-
- queue_background_migration_jobs_by_range_at_intervals(
- scope,
- MIGRATION,
- INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true,
- primary_column_name: :issue_id
- )
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb b/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb
deleted file mode 100644
index d82589efc90..00000000000
--- a/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBioHtmlFromUserDetails < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :user_details, :bio_html, :text, null: true
- remove_column :user_details, :cached_markdown_version, :integer, null: true
- end
-end
diff --git a/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb b/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb
deleted file mode 100644
index f49a0fe2f56..00000000000
--- a/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RerescheduleDeleteOrphanedDeployments < Gitlab::Database::Migration[1.0]
- MIGRATION = 'DeleteOrphanedDeployments'
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- # This is the third time to schedule `DeleteOrphanedDeployments` migration.
- # The first time failed by an inappropriate batch size and the second time failed by a retry bug.
- # Since there is no issue in this migration itself, we can simply requeue the
- # migration jobs **without** no-op-ing the previous migration.
- # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69051#note_669230405 for more information.
- def up
- delete_queued_jobs(MIGRATION)
-
- requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb
deleted file mode 100644
index 9887752618d..00000000000
--- a/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures < 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_broken"
- 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])
- ) 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/20211005194425_schedule_requirements_migration.rb b/db/post_migrate/20211005194425_schedule_requirements_migration.rb
deleted file mode 100644
index 56211989b8e..00000000000
--- a/db/post_migrate/20211005194425_schedule_requirements_migration.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRequirementsMigration < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
-
- # 2021-10-05 requirements count: ~12500
- #
- # Using 30 as batch size and 120 seconds default interval will produce:
- # ~420 jobs - taking ~14 hours to perform
- BATCH_SIZE = 30
-
- MIGRATION = 'MigrateRequirementsToWorkItems'
-
- disable_ddl_transaction!
-
- class Requirement < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'requirements'
- end
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- Requirement.where(issue_id: nil),
- MIGRATION,
- 2.minutes,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # NO OP
- end
-end
diff --git a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb
deleted file mode 100644
index b14a9ab88b9..00000000000
--- a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class SchedulePopulateTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0]
- MIGRATION = 'PopulateTopicsTotalProjectsCountCache'
- 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/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb b/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
deleted file mode 100644
index b046ab6ab03..00000000000
--- a/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeIndexesForCiJobArtifactsExpireAtUnlocked < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx'
-
- def up
- add_concurrent_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb b/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb
deleted file mode 100644
index 0185e4cbc5e..00000000000
--- a/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddNamespaceIndexOnTypeSync < Gitlab::Database::Migration[1.0]
- FULL_INDEX_NAME = 'index_namespaces_on_type_and_id'
- PARTIAL_INDEX_NAME = 'index_namespaces_on_type_and_id_partial'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, [:type, :id], name: FULL_INDEX_NAME
-
- remove_concurrent_index_by_name :namespaces, name: PARTIAL_INDEX_NAME
- end
-
- def down
- add_concurrent_index(:namespaces, [:type, :id], where: 'type IS NOT NULL', name: PARTIAL_INDEX_NAME)
-
- remove_concurrent_index_by_name :namespaces, name: FULL_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb b/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb
deleted file mode 100644
index df0b8ef2a94..00000000000
--- a/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAnalyticsSnapshotsSegmentIdColumn < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_column :analytics_devops_adoption_snapshots, :segment_id
- end
-
- def down
- add_column :analytics_devops_adoption_snapshots, :segment_id, :bigint, after: :id
- add_concurrent_foreign_key :analytics_devops_adoption_snapshots, :analytics_devops_adoption_segments,
- column: :segment_id, name: 'fk_rails_25da9a92c0', on_delete: :cascade
- add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :end_time], name: :index_on_snapshots_segment_id_end_time
- add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :recorded_at], name: :index_on_snapshots_segment_id_recorded_at
- end
-end
diff --git a/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb b/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb
deleted file mode 100644
index 04af23446fd..00000000000
--- a/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class SchedulePopulateStatusColumnOfSecurityScans < Gitlab::Database::Migration[1.0]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211011104843_add_new_loose_fk_index.rb b/db/post_migrate/20211011104843_add_new_loose_fk_index.rb
deleted file mode 100644
index 710d0917d7f..00000000000
--- a/db/post_migrate/20211011104843_add_new_loose_fk_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddNewLooseFkIndex < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_loading_records'
-
- def up
- add_concurrent_partitioned_index :loose_foreign_keys_deleted_records,
- %I[fully_qualified_table_name id primary_key_value partition],
- where: 'status = 1',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb b/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb
deleted file mode 100644
index 82a0b1ac9c8..00000000000
--- a/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupDeleteOrphanedDeploymentsBackgroundMigration < Gitlab::Database::Migration[1.0]
- MIGRATION = 'DeleteOrphanedDeployments'
-
- disable_ddl_transaction!
-
- def up
- finalize_background_migration(MIGRATION)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb b/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb
deleted file mode 100644
index 882351ab974..00000000000
--- a/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexBtreeNamespacesTraversalIds < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_btree_namespaces_traversal_ids'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, :traversal_ids, using: :btree, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :namespaces, :traversal_ids, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb b/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb
deleted file mode 100644
index 80ed834903c..00000000000
--- a/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveMergeRequestDiffCommitColumns < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- COLUMNS = %i[author_name author_email committer_name committer_email].freeze
-
- def change
- COLUMNS.each do |column|
- remove_column(:merge_request_diff_commits, column, :text)
- end
- end
-end
diff --git a/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb b/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb
deleted file mode 100644
index e895ab6b9a0..00000000000
--- a/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveScheduleAndStatusFromPendingAlertEscalations < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- ESCALATIONS_TABLE = :incident_management_pending_alert_escalations
- SCHEDULES_TABLE = :incident_management_oncall_schedules
- INDEX_NAME = 'index_incident_management_pending_alert_escalations_on_schedule'
- CONSTRAINT_NAME = 'fk_rails_fcbfd9338b'
-
- def up
- with_lock_retries do
- remove_column ESCALATIONS_TABLE, :schedule_id
- remove_column ESCALATIONS_TABLE, :status
- end
- end
-
- def down
- with_lock_retries do
- add_column ESCALATIONS_TABLE, :schedule_id, :bigint unless column_exists?(ESCALATIONS_TABLE, :schedule_id)
- add_column ESCALATIONS_TABLE, :status, :smallint unless column_exists?(ESCALATIONS_TABLE, :status)
- end
-
- add_concurrent_partitioned_index ESCALATIONS_TABLE, :schedule_id, name: INDEX_NAME
- add_concurrent_partitioned_foreign_key ESCALATIONS_TABLE, SCHEDULES_TABLE, column: :schedule_id, name: CONSTRAINT_NAME
- end
-end
diff --git a/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb
deleted file mode 100644
index 2efbfad6c56..00000000000
--- a/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexSecurityCiBuildsOnNameAndIdParserFeatures < 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])
- ) 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/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb b/db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb
deleted file mode 100644
index b50b7fa21a5..00000000000
--- a/db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToTmpProjectIdColumnOnNamespacesTable < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_on_tmp_project_id_on_namespaces'
-
- def up
- add_concurrent_index :namespaces, :tmp_project_id, name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb b/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb
deleted file mode 100644
index f2772389d02..00000000000
--- a/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkToTmpProjectIdColumnOnNamespacesTable < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :namespaces, :projects, column: :tmp_project_id
- end
-
- def down
- remove_foreign_key :namespaces, column: :tmp_project_id
- end
-end
diff --git a/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb b/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb
deleted file mode 100644
index d5fac373ca4..00000000000
--- a/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToGroupIdColumnOnWebhooksTable < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_group_id_on_webhooks'
-
- def up
- add_concurrent_index :web_hooks, :group_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :web_hooks, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb b/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb
deleted file mode 100644
index 72a5970b6d7..00000000000
--- a/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotNullConstraintAndDefaultForPublicEmail < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- change_column_null :users, :public_email, true
- change_column_default :users, :public_email, from: '', to: nil
- end
-
- def down
- # There may now be nulls in the table, so we cannot re-add the constraint here.
- change_column_default :users, :public_email, from: nil, to: ''
- end
-end
diff --git a/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb b/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb
deleted file mode 100644
index ecad4466c53..00000000000
--- a/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRemoveDuplicateVulnerabilitiesFindings3 < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'RemoveDuplicateVulnerabilitiesFindings'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 5_000
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('vulnerability_occurrences'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb b/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb
deleted file mode 100644
index 8014c006f35..00000000000
--- a/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddDeploymentsEnvironmentIdAndRefIndex < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_deployments_on_environment_id_and_ref'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :deployments, [:environment_id, :ref], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :deployments, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb b/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb
deleted file mode 100644
index 7d0033c0ab9..00000000000
--- a/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveGeoUploadDeprecatedFields < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :geo_event_log, :upload_deleted_event_id, :bigint
- end
- end
-
- def down
- with_lock_retries do
- add_column(:geo_event_log, :upload_deleted_event_id, :bigint) unless column_exists?(:geo_event_log, :upload_deleted_event_id)
- end
-
- add_concurrent_foreign_key :geo_event_log, :geo_upload_deleted_events,
- column: :upload_deleted_event_id,
- name: 'fk_c1f241c70d',
- on_delete: :cascade
-
- add_concurrent_index :geo_event_log,
- :upload_deleted_event_id,
- name: 'index_geo_event_log_on_upload_deleted_event_id',
- where: "(upload_deleted_event_id IS NOT NULL)"
- end
-end
diff --git a/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb b/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb
deleted file mode 100644
index b6987e68fb1..00000000000
--- a/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class DropGeoUploadDeletedEventsTable < Gitlab::Database::Migration[1.0]
- def up
- drop_table :geo_upload_deleted_events
- end
-
- def down
- create_table :geo_upload_deleted_events, id: :bigserial do |t|
- t.integer :upload_id, null: false, index: true
- t.string :file_path, null: false
- t.integer :model_id, null: false
- t.string :model_type, null: false
- t.string :uploader, null: false
- end
- end
-end
diff --git a/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb
deleted file mode 100644
index 9c40e81f527..00000000000
--- a/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddClusterIdLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_vulnerability_occurrences_on_location_cluster_id'
-
- def up
- add_concurrent_index :vulnerability_occurrences, "(location -> 'cluster_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/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb b/db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb
deleted file mode 100644
index 9ee1b10a072..00000000000
--- a/db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class DropIndexSecurityCiBuildsOnNameAndIdParserFeaturesBroken < Gitlab::Database::Migration[1.0]
- TABLE = "ci_builds"
- COLUMNS = %i[name id]
- INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_broken"
- 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/20211022160154_remove_outdated_fields_from_geo_node_status.rb b/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb
deleted file mode 100644
index 5b117f9e4b8..00000000000
--- a/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveOutdatedFieldsFromGeoNodeStatus < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- remove_column :geo_node_statuses, :attachments_count, :integer
- remove_column :geo_node_statuses, :attachments_synced_count, :integer
- remove_column :geo_node_statuses, :attachments_failed_count, :integer
- remove_column :geo_node_statuses, :attachments_synced_missing_on_primary_count, :integer
- end
-end
diff --git a/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb
deleted file mode 100644
index 105d5ec98f4..00000000000
--- a/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings'
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- # no-op based on https://docs.gitlab.com/ee/development/background_migrations.html#rescheduling-background-migrations
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb b/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb
deleted file mode 100644
index e08ad8d89d1..00000000000
--- a/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleDeleteInvalidEpicIssues < Gitlab::Database::Migration[1.0]
- # This is a now a no-op
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/348477
-
- def up
- # no-op
- end
-
- def down
- # also no-op
- end
-end
diff --git a/db/post_migrate/20211026070408_backfill_issue_search_data.rb b/db/post_migrate/20211026070408_backfill_issue_search_data.rb
deleted file mode 100644
index a2cf7b36a59..00000000000
--- a/db/post_migrate/20211026070408_backfill_issue_search_data.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIssueSearchData < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillIssueSearchData'
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :issues,
- :id,
- batch_size: 100_000,
- sub_batch_size: 1_000,
- job_interval: 5.minutes
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :issues, :id, [])
- end
-end
diff --git a/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb b/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb
deleted file mode 100644
index 3836159c2cd..00000000000
--- a/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackCiPipelineDeletions < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:ci_pipelines)
- end
-
- def down
- untrack_record_deletions(:ci_pipelines)
- end
-end
diff --git a/db/post_migrate/20211027043229_track_ci_build_deletions.rb b/db/post_migrate/20211027043229_track_ci_build_deletions.rb
deleted file mode 100644
index b76d5f3261c..00000000000
--- a/db/post_migrate/20211027043229_track_ci_build_deletions.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackCiBuildDeletions < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:ci_builds)
- end
-
- def down
- untrack_record_deletions(:ci_builds)
- end
-end
diff --git a/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb b/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb
deleted file mode 100644
index 14cf305fb2e..00000000000
--- a/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackDeletionsInCiRunners < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:ci_runners)
- end
-
- def down
- untrack_record_deletions(:ci_runners)
- end
-end
diff --git a/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb b/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb
deleted file mode 100644
index 1c8f9d5196a..00000000000
--- a/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackDeletionsInChatNames < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:chat_names)
- end
-
- def down
- untrack_record_deletions(:chat_names)
- end
-end
diff --git a/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb b/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb
deleted file mode 100644
index 3447c4da81a..00000000000
--- a/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class DropIndexKeysOnExpiresAtAndBeforeExpiryNotificationUndelivered < Gitlab::Database::Migration[1.0]
- DOWNTIME = false
- INDEX_NAME = 'index_keys_on_expires_at_and_expiry_notification_undelivered'
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name(:keys, INDEX_NAME)
- end
-
- def down
- add_concurrent_index :keys,
- "date(timezone('UTC', expires_at)), expiry_notification_delivered_at",
- where: 'expiry_notification_delivered_at IS NULL', name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb b/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb
deleted file mode 100644
index 5e556fe1f32..00000000000
--- a/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexForDormantUsers < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_non_internal_active'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :users, INDEX_NAME
- end
-
- def down
- index_condition = "state = 'active' AND (users.user_type IS NULL OR users.user_type IN (NULL, 6, 4))"
-
- add_concurrent_index :users, [:id, :last_activity_on], where: index_condition, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb b/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb
deleted file mode 100644
index 1f03e39aa81..00000000000
--- a/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddOccurrenceIdIdDescIndexToVulnerabilityOccurrencePipelines < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = "index_vulnerability_occurrence_pipelines_occurrence_id_and_id"
-
- def up
- add_concurrent_index(
- :vulnerability_occurrence_pipelines,
- [:occurrence_id, :id],
- order: { id: :desc },
- name: INDEX_NAME
- )
- end
-
- def down
- remove_concurrent_index_by_name(
- :vulnerability_occurrence_pipelines,
- INDEX_NAME
- )
- end
-end
diff --git a/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb b/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb
deleted file mode 100644
index 98984239ca4..00000000000
--- a/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class TmpIndexForDeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_issue_mr'
- INDEX_CONDITION = "taggable_type IN ('Issue', 'MergeRequest')"
-
- def up
- add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation
- end
-
- def down
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb b/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb
deleted file mode 100644
index a53f5a4fc25..00000000000
--- a/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_issue_mr'
-
- BATCH_SIZE = 3_000
- TAGGABLE_TYPES = %w(Issue MergeRequest)
-
- class Tagging < ActiveRecord::Base
- self.table_name = "taggings"
- end
-
- def up
- sleep 2 while Tagging.where(taggable_type: TAGGABLE_TYPES).limit(BATCH_SIZE).delete_all > 0
-
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb b/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb
deleted file mode 100644
index 03e461dfcd0..00000000000
--- a/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddAsyncIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_on_created_at_and_id'
- TABLE = :events
- COLUMNS = %i[created_at id]
- CONSTRAINTS = "created_at > '2021-08-27'"
-
- def up
- prepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
- end
-
- def down
- unprepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS
- end
-end
diff --git a/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb b/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb
deleted file mode 100644
index 659cb7b76b2..00000000000
--- a/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleFixMergeRequestDiffCommitUsersMigration < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION_CLASS = 'FixMergeRequestDiffCommitUsers'
-
- class Project < ApplicationRecord
- include EachBatch
-
- self.table_name = 'projects'
- end
-
- def up
- # This is the day on which we merged
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63669. Since the
- # deploy of this MR we may have imported projects using the old format, but
- # after their merge_request_diff_id range had been migrated by Sidekiq. As a
- # result, there may be rows without a committer_id or commit_author_id
- # field.
- date = '2021-07-07 00:00:00'
-
- transaction do
- Project.each_batch(of: 10_000) do |batch|
- time = Time.now.utc
- rows = batch
- .where('created_at >= ?', date)
- .where(import_type: 'gitlab_project')
- .pluck(:id)
- .map do |id|
- Gitlab::Database::BackgroundMigrationJob.new(
- class_name: MIGRATION_CLASS,
- arguments: [id],
- created_at: time,
- updated_at: time
- )
- end
-
- Gitlab::Database::BackgroundMigrationJob
- .bulk_insert!(rows, validate: false)
- end
- end
-
- job = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(MIGRATION_CLASS)
- .pending
- .first
-
- migrate_in(2.minutes, MIGRATION_CLASS, job.arguments) if job
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211029102822_add_open_source_plan.rb b/db/post_migrate/20211029102822_add_open_source_plan.rb
deleted file mode 100644
index bb65637ffca..00000000000
--- a/db/post_migrate/20211029102822_add_open_source_plan.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-class AddOpenSourcePlan < Gitlab::Database::Migration[1.0]
- class Plan < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- has_one :limits, class_name: 'PlanLimits'
-
- def actual_limits
- self.limits || self.build_limits
- end
- end
-
- class PlanLimits < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- belongs_to :plan
- end
-
- def create_plan_limits(plan_limit_name, plan)
- plan_limit = Plan.find_or_initialize_by(name: plan_limit_name).actual_limits.dup
- plan_limit.plan = plan
- plan_limit.save!
- end
-
- def up
- return unless Gitlab.com?
-
- opensource = Plan.create!(name: 'opensource', title: 'Open Source Program')
-
- create_plan_limits('ultimate', opensource)
- end
-
- def down
- return unless Gitlab.com?
-
- Plan.where(name: 'opensource').delete_all
- end
-end
diff --git a/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb b/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb
deleted file mode 100644
index 73b70ad1e27..00000000000
--- a/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexesToIssueStageEvents < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- GROUP_INDEX_NAME = 'index_issue_stage_events_group_duration'
- GROUP_IN_PROGRESS_INDEX_NAME = 'index_issue_stage_events_group_in_progress_duration'
- PROJECT_INDEX_NAME = 'index_issue_stage_events_project_duration'
- PROJECT_IN_PROGRESS_INDEX_NAME = 'index_issue_stage_events_project_in_progress_duration'
-
- def up
- add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events,
- 'stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp',
- where: 'end_event_timestamp IS NOT NULL',
- name: GROUP_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events,
- 'stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp',
- where: 'end_event_timestamp IS NOT NULL',
- name: PROJECT_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events,
- 'stage_event_hash_id, group_id, start_event_timestamp, issue_id',
- where: 'end_event_timestamp IS NULL AND state_id = 1',
- name: GROUP_IN_PROGRESS_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events,
- 'stage_event_hash_id, project_id, start_event_timestamp, issue_id',
- where: 'end_event_timestamp IS NULL AND state_id = 1',
- name: PROJECT_IN_PROGRESS_INDEX_NAME
- end
-
- def down
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, GROUP_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, PROJECT_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, GROUP_IN_PROGRESS_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, PROJECT_IN_PROGRESS_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb b/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb
deleted file mode 100644
index 9cc9d73c968..00000000000
--- a/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexesToMergeRequestStageEvents < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- GROUP_INDEX_NAME = 'index_merge_request_stage_events_group_duration'
- GROUP_IN_PROGRESS_INDEX_NAME = 'index_merge_request_stage_events_group_in_progress_duration'
- PROJECT_INDEX_NAME = 'index_merge_request_stage_events_project_duration'
- PROJECT_IN_PROGRESS_INDEX_NAME = 'index_merge_request_stage_events_project_in_progress_duration'
-
- def up
- add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events,
- 'stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp',
- where: 'end_event_timestamp IS NOT NULL',
- name: GROUP_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events,
- 'stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp',
- where: 'end_event_timestamp IS NOT NULL',
- name: PROJECT_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events,
- 'stage_event_hash_id, group_id, start_event_timestamp, merge_request_id',
- where: 'end_event_timestamp IS NULL AND state_id = 1',
- name: GROUP_IN_PROGRESS_INDEX_NAME
-
- add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events,
- 'stage_event_hash_id, project_id, start_event_timestamp, merge_request_id',
- where: 'end_event_timestamp IS NULL AND state_id = 1',
- name: PROJECT_IN_PROGRESS_INDEX_NAME
- end
-
- def down
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, GROUP_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, PROJECT_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, GROUP_IN_PROGRESS_INDEX_NAME
- remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, PROJECT_IN_PROGRESS_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb b/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb
deleted file mode 100644
index ded9e717bb1..00000000000
--- a/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class ConsumeRemainingUserNamespaceJobs < Gitlab::Database::Migration[1.0]
- MIGRATION = 'BackfillUserNamespace'
- BATCH_SIZE = 200
- DEFAULT_VALUE = 'User'
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION)
-
- # Do a manual update in case we lost BG jobs. The expected record count should be 0 or very low.
- define_batchable_model('namespaces').where(type: nil).each_batch(of: BATCH_SIZE) do |batch|
- min, max = batch.pluck('MIN(id), MAX(id)').flatten
-
- Gitlab::BackgroundMigration::BackfillUserNamespace.new.perform(min, max, :namespaces, :id, BATCH_SIZE, 0)
- end
-
- change_column_null :namespaces, :type, false
- end
-
- def down
- change_column_null :namespaces, :type, true
- end
-end
diff --git a/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb
deleted file mode 100644
index 4aee79950dc..00000000000
--- a/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTempIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'vulnerability_occurrences_location_temp_index'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerability_occurrences, :id, where: 'location IS NULL', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb b/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb
deleted file mode 100644
index 44e2630af06..00000000000
--- a/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateVulnerabilityOccurrencesLocation < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 20_000
- DELAY_INTERVAL = 3.minutes
- MIGRATION_NAME = 'UpdateVulnerabilityOccurrencesLocation'
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee?
-
- relation = Gitlab::BackgroundMigration::UpdateVulnerabilityOccurrencesLocation::Occurrence.where(location: nil)
- queue_background_migration_jobs_by_range_at_intervals(relation,
- MIGRATION_NAME,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb b/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb
deleted file mode 100644
index d949641dbce..00000000000
--- a/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemovePropagateServiceTemplateWorker < Gitlab::Database::Migration[1.0]
- def up
- Sidekiq::Queue.new('propagate_service_template').clear
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb b/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb
deleted file mode 100644
index 33d5833db1a..00000000000
--- a/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_on_created_at_and_id'
- TABLE = :events
- COLUMNS = %i[created_at id]
- CONSTRAINTS = "created_at > '2021-08-27 00:00:00+00'"
- 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/20211103184303_drop_runner_features_from_ci_builds_metadata.rb b/db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb
deleted file mode 100644
index 00580b2f933..00000000000
--- a/db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class DropRunnerFeaturesFromCiBuildsMetadata < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- remove_column :ci_builds_metadata, :runner_features
- end
-
- def down
- add_column :ci_builds_metadata, :runner_features, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/post_migrate/20211104044453_remove_redundant_events_index.rb b/db/post_migrate/20211104044453_remove_redundant_events_index.rb
deleted file mode 100644
index 54e71e1b54b..00000000000
--- a/db/post_migrate/20211104044453_remove_redundant_events_index.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveRedundantEventsIndex < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :events, :index_events_on_target_type_and_target_id
- end
-
- def down
- add_concurrent_index :events, [:target_type, :target_id], name: :index_events_on_target_type_and_target_id
- end
-end
diff --git a/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb b/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb
deleted file mode 100644
index 1625d24ef92..00000000000
--- a/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveVulnerabilityFindingLinks < 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/20211105135157_drop_ci_build_trace_sections.rb b/db/post_migrate/20211105135157_drop_ci_build_trace_sections.rb
deleted file mode 100644
index 1595068952d..00000000000
--- a/db/post_migrate/20211105135157_drop_ci_build_trace_sections.rb
+++ /dev/null
@@ -1,99 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiBuildTraceSections < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:dep_ci_build_trace_sections, column: :project_id)
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists(:dep_ci_build_trace_section_names, column: :project_id)
- end
-
- if table_exists?(:dep_ci_build_trace_sections)
- with_lock_retries do
- drop_table :dep_ci_build_trace_sections
- end
- end
-
- if table_exists?(:dep_ci_build_trace_section_names)
- with_lock_retries do
- drop_table :dep_ci_build_trace_section_names
- end
- end
-
- drop_function('trigger_91dc388a5fe6')
- end
-
- def down
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION trigger_91dc388a5fe6() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
- BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
- RETURN NEW;
- END;
- $$;
- SQL
-
- execute_in_transaction(<<~SQL, !table_exists?(:dep_ci_build_trace_section_names))
- CREATE TABLE dep_ci_build_trace_section_names (
- id integer NOT NULL,
- project_id integer NOT NULL,
- name character varying NOT NULL
- );
-
- CREATE SEQUENCE dep_ci_build_trace_section_names_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
- ALTER SEQUENCE dep_ci_build_trace_section_names_id_seq OWNED BY dep_ci_build_trace_section_names.id;
-
- ALTER TABLE ONLY dep_ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('dep_ci_build_trace_section_names_id_seq'::regclass);
- ALTER TABLE ONLY dep_ci_build_trace_section_names ADD CONSTRAINT dep_ci_build_trace_section_names_pkey PRIMARY KEY (id);
- SQL
-
- execute_in_transaction(<<~SQL, !table_exists?(:dep_ci_build_trace_sections))
- CREATE TABLE dep_ci_build_trace_sections (
- project_id integer NOT NULL,
- date_start timestamp without time zone NOT NULL,
- date_end timestamp without time zone NOT NULL,
- byte_start bigint NOT NULL,
- byte_end bigint NOT NULL,
- build_id integer NOT NULL,
- section_name_id integer NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
- );
-
- ALTER TABLE ONLY dep_ci_build_trace_sections ADD CONSTRAINT ci_build_trace_sections_pkey PRIMARY KEY (build_id, section_name_id);
- CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON dep_ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6();
- SQL
-
- add_concurrent_index :dep_ci_build_trace_section_names, [:project_id, :name], unique: true, name: 'index_dep_ci_build_trace_section_names_on_project_id_and_name'
- add_concurrent_index :dep_ci_build_trace_sections, :project_id, name: 'index_dep_ci_build_trace_sections_on_project_id'
- add_concurrent_index :dep_ci_build_trace_sections, :section_name_id, name: 'index_dep_ci_build_trace_sections_on_section_name_id'
-
- add_concurrent_foreign_key :dep_ci_build_trace_sections, :dep_ci_build_trace_section_names, column: :section_name_id, on_delete: :cascade, name: 'fk_264e112c66'
- add_concurrent_foreign_key :dep_ci_build_trace_sections, :projects, column: :project_id, on_delete: :cascade, name: 'fk_ab7c104e26'
- add_concurrent_foreign_key :dep_ci_build_trace_section_names, :projects, column: :project_id, on_delete: :cascade, name: 'fk_f8cd72cd26'
- end
-
- private
-
- def execute_in_transaction(sql, condition)
- return unless condition
-
- transaction do
- execute(sql)
- end
- end
-end
diff --git a/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb b/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb
deleted file mode 100644
index ef5a70713d0..00000000000
--- a/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class DropOldLooseFkDeletedRecordsIndex < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_loading_records'
-
- def up
- remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME
- end
-
- def down
- add_concurrent_partitioned_index :loose_foreign_keys_deleted_records,
- %I[fully_qualified_table_name id primary_key_value partition],
- where: 'status = 1',
- name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb b/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb
deleted file mode 100644
index bdb8f5cd120..00000000000
--- a/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotNullConstraintToSecurityFindingsUuid < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_not_null_constraint(
- :security_findings,
- :uuid,
- validate: false
- )
- end
-
- def down
- remove_not_null_constraint(
- :security_findings,
- :uuid
- )
- end
-end
diff --git a/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb b/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb
deleted file mode 100644
index 7bc4af0ec4d..00000000000
--- a/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddTemporaryIndexOnSecurityFindingsUuid < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = "tmp_index_uuid_is_null"
-
- def up
- add_concurrent_index(
- :security_findings,
- :id,
- where: "uuid IS NULL",
- name: INDEX_NAME
- )
- end
-
- def down
- remove_concurrent_index_by_name(
- :security_findings,
- INDEX_NAME
- )
- end
-end
diff --git a/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb b/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb
deleted file mode 100644
index 98e7b2a8a15..00000000000
--- a/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleDropInvalidSecurityFindings < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = "DropInvalidSecurityFindings"
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 100_000
- SUB_BATCH_SIZE = 10_000
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('security_findings').where(uuid: nil),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- other_job_arguments: [SUB_BATCH_SIZE],
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb b/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb
deleted file mode 100644
index 19adc6c7084..00000000000
--- a/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiPipelineChatDataFkOnChatNames < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:ci_pipeline_chat_data, :chat_names, name: "fk_rails_f300456b63")
- end
- end
-
- def down
- # Remove orphaned rows
- execute <<~SQL
- DELETE FROM ci_pipeline_chat_data
- WHERE
- NOT EXISTS (SELECT 1 FROM chat_names WHERE chat_names.id=ci_pipeline_chat_data.chat_name_id)
- SQL
-
- add_concurrent_foreign_key(:ci_pipeline_chat_data, :chat_names, name: "fk_rails_f300456b63", column: :chat_name_id, target_column: :id, on_delete: "cascade")
- end
-end
diff --git a/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb b/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb
deleted file mode 100644
index b54edc1cf73..00000000000
--- a/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnProjectsImportTypeId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_imported_projects_on_import_type_id'
-
- def up
- add_concurrent_index(:projects, [:import_type, :id], where: 'import_type IS NOT NULL', name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:projects, INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb b/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb
deleted file mode 100644
index 468b26e9eb1..00000000000
--- a/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeNamespaceTypeDefaultToUser < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- change_column_default :namespaces, :type, 'User'
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :namespaces, :type, nil
- end
- end
-end
diff --git a/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb b/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb
deleted file mode 100644
index 0424d32a81e..00000000000
--- a/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings < Gitlab::Database::Migration[1.0]
- MIGRATION = 'RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 10_000
-
- disable_ddl_transaction!
-
- def up
- 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/20211117084814_migrate_remaining_u2f_registrations.rb b/db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb
deleted file mode 100644
index ae9dba32a4a..00000000000
--- a/db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateRemainingU2fRegistrations < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- def up
- # We expect only a few number of records satisfying these conditions.
- # on gitlab.com database, this number is 70 as on 17th Nov, 2021.
- define_batchable_model('u2f_registrations')
- .joins("LEFT JOIN webauthn_registrations ON webauthn_registrations.u2f_registration_id = u2f_registrations.id")
- .where(webauthn_registrations: { u2f_registration_id: nil })
- .each_batch(of: BATCH_SIZE) do |batch, index|
- batch.each do |record|
- Gitlab::BackgroundMigration::MigrateU2fWebauthn.new.perform(record.id, record.id)
- rescue StandardError => e
- Gitlab::ErrorTracking.track_exception(e, u2f_registration_id: record.id)
- end
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb b/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb
deleted file mode 100644
index 5eb532f2a00..00000000000
--- a/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class DropPagesDeploymentsBuildsFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- FK_NAME = 'fk_rails_c3a90cf29b'
-
- def up
- remove_foreign_key_if_exists(:pages_deployments, :ci_builds, name: FK_NAME)
- end
-
- def down
- add_concurrent_foreign_key(
- :pages_deployments,
- :ci_builds,
- name: FK_NAME,
- column: :ci_build_id,
- target_column: :id,
- on_delete: :nullify
- )
- end
-end
diff --git a/db/post_migrate/20211118194239_drop_invalid_remediations.rb b/db/post_migrate/20211118194239_drop_invalid_remediations.rb
deleted file mode 100644
index 93edde87936..00000000000
--- a/db/post_migrate/20211118194239_drop_invalid_remediations.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class DropInvalidRemediations < Gitlab::Database::Migration[1.0]
- BATCH_SIZE = 3_000
- DELAY_INTERVAL = 3.minutes
- MIGRATION_NAME = 'DropInvalidRemediations'
- DAY_PRIOR_TO_BUG_INTRODUCTION = DateTime.new(2021, 8, 1, 0, 0, 0)
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee?
-
- relation = Gitlab::BackgroundMigration::DropInvalidRemediations::FindingRemediation.where("created_at > ?", DAY_PRIOR_TO_BUG_INTRODUCTION)
- queue_background_migration_jobs_by_range_at_intervals(relation,
- MIGRATION_NAME,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb b/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb
deleted file mode 100644
index 3eccbb1b3a4..00000000000
--- a/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToJobArtifactOriginalFilename < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- add_text_limit :ci_job_artifacts, :original_filename, 512
- end
-
- def down
- remove_text_limit :ci_job_artifacts, :original_filename
- end
-end
diff --git a/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb b/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb
deleted file mode 100644
index 517e0f08d6a..00000000000
--- a/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ImproveIndexOnEventsForCalendar < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at'
-
- def up
- prepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
- end
-
- def down
- unprepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb b/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb
deleted file mode 100644
index df4867d6ae7..00000000000
--- a/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupBackgroundMigrationOfRequirementsToWorkItems < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- MIGRATION = 'MigrateRequirementsToWorkItems'
-
- disable_ddl_transaction!
-
- def up
- finalize_background_migration(MIGRATION)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb b/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb
deleted file mode 100644
index 599342e83e3..00000000000
--- a/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupAfterDropInvalidSecurityFindings < Gitlab::Database::Migration[1.0]
- MIGRATION = "DropInvalidSecurityFindings"
- INDEX_NAME = "tmp_index_uuid_is_null"
-
- disable_ddl_transaction!
-
- def up
- # Make sure all jobs scheduled by
- # db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb
- # are finished
- finalize_background_migration(MIGRATION)
- # Created by db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb
- remove_concurrent_index_by_name :security_findings, INDEX_NAME
- end
-
- def down
- add_concurrent_index(
- :security_findings,
- :id,
- where: "uuid IS NULL",
- name: INDEX_NAME
- )
- end
-end
diff --git a/db/post_migrate/20211124132705_change_index_users_on_public_email.rb b/db/post_migrate/20211124132705_change_index_users_on_public_email.rb
deleted file mode 100644
index 6e74a325033..00000000000
--- a/db/post_migrate/20211124132705_change_index_users_on_public_email.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeIndexUsersOnPublicEmail < Gitlab::Database::Migration[1.0]
- INDEX_NAME = 'index_users_on_public_email'
- INDEX_EXCLUDING_NULL_NAME = 'index_users_on_public_email_excluding_null_and_empty'
-
- disable_ddl_transaction!
-
- def up
- index_condition = "public_email != '' AND public_email IS NOT NULL"
-
- add_concurrent_index :users, [:public_email], where: index_condition, name: INDEX_EXCLUDING_NULL_NAME
- remove_concurrent_index_by_name :users, INDEX_NAME
- end
-
- def down
- index_condition = "public_email != ''"
-
- add_concurrent_index :users, [:public_email], where: index_condition, name: INDEX_NAME
- remove_concurrent_index_by_name :users, INDEX_EXCLUDING_NULL_NAME
- end
-end
diff --git a/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb b/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb
deleted file mode 100644
index 5cc78fc75c4..00000000000
--- a/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexTodosProjectIdUserId < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_todos_on_project_id_and_user_id_and_id'
-
- def up
- add_concurrent_index :todos, [:project_id, :user_id, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :todos, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb b/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb
deleted file mode 100644
index 420bfb8bcbc..00000000000
--- a/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillSequenceColumnForSprintsTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def up
- execute(
- <<-SQL
- UPDATE sprints
- SET sequence=t.row_number
- FROM (
- SELECT id, row_number() OVER (PARTITION BY iterations_cadence_id ORDER BY start_date)
- FROM sprints as s1
- WHERE s1.iterations_cadence_id IS NOT NULL
- ) as t
- WHERE t.id=sprints.id AND (sprints.sequence IS NULL OR sprints.sequence <> t.row_number)
- SQL
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb b/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb
deleted file mode 100644
index e688e0b467d..00000000000
--- a/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackDeletionsInNamespaces < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:namespaces)
- end
-
- def down
- untrack_record_deletions(:namespaces)
- end
-end
diff --git a/db/post_migrate/20211130201101_track_deletions_in_projects.rb b/db/post_migrate/20211130201101_track_deletions_in_projects.rb
deleted file mode 100644
index dfe7ab4c037..00000000000
--- a/db/post_migrate/20211130201101_track_deletions_in_projects.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class TrackDeletionsInProjects < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- enable_lock_retries!
-
- def up
- track_record_deletions(:projects)
- end
-
- def down
- untrack_record_deletions(:projects)
- end
-end
diff --git a/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb b/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb
deleted file mode 100644
index 9a02f64e350..00000000000
--- a/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class DropClustersApplicationsRunnersCiRunnersFk < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36')
- end
- end
-
- def down
- add_concurrent_foreign_key(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36', column: :runner_id, target_column: :id, on_delete: 'set null')
- end
-end
diff --git a/db/schema_migrations/20210826171758 b/db/schema_migrations/20210826171758
deleted file mode 100644
index a0bb0f5cfc6..00000000000
--- a/db/schema_migrations/20210826171758
+++ /dev/null
@@ -1 +0,0 @@
-96a8a87cc075b7a2bf3919d0c891fdfedb2a9b7bab6460b82bfb43a3f8abe3cf \ No newline at end of file
diff --git a/db/schema_migrations/20210826193907 b/db/schema_migrations/20210826193907
deleted file mode 100644
index 417333d7212..00000000000
--- a/db/schema_migrations/20210826193907
+++ /dev/null
@@ -1 +0,0 @@
-b7916e025131f11da97ab89a01b32d1dbacf94bb96dc84877ba18404c8b0b2ba \ No newline at end of file
diff --git a/db/schema_migrations/20210830085837 b/db/schema_migrations/20210830085837
deleted file mode 100644
index 590ff1fe13b..00000000000
--- a/db/schema_migrations/20210830085837
+++ /dev/null
@@ -1 +0,0 @@
-cf1a51194961500cb63d848afb1d5ebbf2ef77f54d60957e92c9dd6a667913ea \ No newline at end of file
diff --git a/db/schema_migrations/20210830104800 b/db/schema_migrations/20210830104800
deleted file mode 100644
index ca1aa9180e2..00000000000
--- a/db/schema_migrations/20210830104800
+++ /dev/null
@@ -1 +0,0 @@
-84a68304f95ae04b85625c214b28a251014582fb142390ff3df8ea6d6f0947e1 \ No newline at end of file
diff --git a/db/schema_migrations/20210830140524 b/db/schema_migrations/20210830140524
deleted file mode 100644
index ed07d932278..00000000000
--- a/db/schema_migrations/20210830140524
+++ /dev/null
@@ -1 +0,0 @@
-54f7c66eed745b62d0b53a407a96721f90392ab7f800db9c8a2607f22974ef3c \ No newline at end of file
diff --git a/db/schema_migrations/20210830154358 b/db/schema_migrations/20210830154358
deleted file mode 100644
index 7486c54c4c5..00000000000
--- a/db/schema_migrations/20210830154358
+++ /dev/null
@@ -1 +0,0 @@
-04a44d0e261b26cc7f39b81a4c59ea8e4903d6d7bf73c2004b426204db4491bc \ No newline at end of file
diff --git a/db/schema_migrations/20210831123008 b/db/schema_migrations/20210831123008
deleted file mode 100644
index 35a14b2b10b..00000000000
--- a/db/schema_migrations/20210831123008
+++ /dev/null
@@ -1 +0,0 @@
-36572ad3a4a8a7511512ff45e2a68252950ce852af1b5a28c6b4e4491f97be07 \ No newline at end of file
diff --git a/db/schema_migrations/20210831134840 b/db/schema_migrations/20210831134840
deleted file mode 100644
index d05a375f8fd..00000000000
--- a/db/schema_migrations/20210831134840
+++ /dev/null
@@ -1 +0,0 @@
-6cad93bd4c086a60164c3cb5c42737194c4b7b20c1ea9f4c6d998b7c3a8918b5 \ No newline at end of file
diff --git a/db/schema_migrations/20210831135249 b/db/schema_migrations/20210831135249
deleted file mode 100644
index a08cfa6d8d9..00000000000
--- a/db/schema_migrations/20210831135249
+++ /dev/null
@@ -1 +0,0 @@
-78b14e92c91e7ccb11b7b37e89e8e55749cf109b0fa5ce06e4e396a2ac743f1c \ No newline at end of file
diff --git a/db/schema_migrations/20210831203408 b/db/schema_migrations/20210831203408
deleted file mode 100644
index 6ab3f810e57..00000000000
--- a/db/schema_migrations/20210831203408
+++ /dev/null
@@ -1 +0,0 @@
-50a06a2a57ed26c25af53d3d7f6f5ef73efde8a23a36c5f825af56b4d0c4c3f6 \ No newline at end of file
diff --git a/db/schema_migrations/20210901044202 b/db/schema_migrations/20210901044202
deleted file mode 100644
index 8601b0d20a2..00000000000
--- a/db/schema_migrations/20210901044202
+++ /dev/null
@@ -1 +0,0 @@
-1f070444e77eb56ba612f60ed4a0d90b8a44c4af419a09c873f3bf663c78af72 \ No newline at end of file
diff --git a/db/schema_migrations/20210901044237 b/db/schema_migrations/20210901044237
deleted file mode 100644
index 25418c94441..00000000000
--- a/db/schema_migrations/20210901044237
+++ /dev/null
@@ -1 +0,0 @@
-0d8caaa078914ed2bd43b383ee2efe50093947d65862c2f4dd8dc960cad0a43e \ No newline at end of file
diff --git a/db/schema_migrations/20210901065504 b/db/schema_migrations/20210901065504
deleted file mode 100644
index f62e6ce1272..00000000000
--- a/db/schema_migrations/20210901065504
+++ /dev/null
@@ -1 +0,0 @@
-9724a5fc1703418f9b1ea1d5375fc3b01834b30e5ff16c60537db5cb00bc210a \ No newline at end of file
diff --git a/db/schema_migrations/20210901153324 b/db/schema_migrations/20210901153324
deleted file mode 100644
index a08982bad39..00000000000
--- a/db/schema_migrations/20210901153324
+++ /dev/null
@@ -1 +0,0 @@
-34287b86616026b94374856991c793ad869c52badddc09be923984002c6214bd \ No newline at end of file
diff --git a/db/schema_migrations/20210901184511 b/db/schema_migrations/20210901184511
deleted file mode 100644
index 45a3b3b8c18..00000000000
--- a/db/schema_migrations/20210901184511
+++ /dev/null
@@ -1 +0,0 @@
-40780a28f881d4e80bdb6b023f22804c4da735223323c8cf03cfcdcaf5337fe6 \ No newline at end of file
diff --git a/db/schema_migrations/20210902144144 b/db/schema_migrations/20210902144144
deleted file mode 100644
index 330569f1beb..00000000000
--- a/db/schema_migrations/20210902144144
+++ /dev/null
@@ -1 +0,0 @@
-c99df310082dd6f5faff3cfd90dfca88af26d840889910ebac0e73ba483a09b2 \ No newline at end of file
diff --git a/db/schema_migrations/20210902171406 b/db/schema_migrations/20210902171406
deleted file mode 100644
index 89635e256ea..00000000000
--- a/db/schema_migrations/20210902171406
+++ /dev/null
@@ -1 +0,0 @@
-d7be9a34d626e507add67f407a6fa0b45f16b244e8ebeeb071debc538fa25b49 \ No newline at end of file
diff --git a/db/schema_migrations/20210902171808 b/db/schema_migrations/20210902171808
deleted file mode 100644
index 1398c2db4b6..00000000000
--- a/db/schema_migrations/20210902171808
+++ /dev/null
@@ -1 +0,0 @@
-09b482e4716a2b0808ad83770222baed8e863a8f94f85f77ed2d557eaa348df4 \ No newline at end of file
diff --git a/db/schema_migrations/20210902184334 b/db/schema_migrations/20210902184334
deleted file mode 100644
index f35699b357e..00000000000
--- a/db/schema_migrations/20210902184334
+++ /dev/null
@@ -1 +0,0 @@
-508b8d4608d28b2a12cf429262c3dd336e130013a41e51ff6c95027ece1540e5 \ No newline at end of file
diff --git a/db/schema_migrations/20210903054158 b/db/schema_migrations/20210903054158
deleted file mode 100644
index 8810481ab85..00000000000
--- a/db/schema_migrations/20210903054158
+++ /dev/null
@@ -1 +0,0 @@
-113d6bb813a89646d48c8ba6a86fc8e73f741d5c345f603bfe33939fb90f9428 \ No newline at end of file
diff --git a/db/schema_migrations/20210906100021 b/db/schema_migrations/20210906100021
deleted file mode 100644
index 9ae19276eab..00000000000
--- a/db/schema_migrations/20210906100021
+++ /dev/null
@@ -1 +0,0 @@
-74f6800c968f80e18aa000df42fd23086404fdd7a863237e453541b7eeb4eb7f \ No newline at end of file
diff --git a/db/schema_migrations/20210906100316 b/db/schema_migrations/20210906100316
deleted file mode 100644
index 4ce17059b07..00000000000
--- a/db/schema_migrations/20210906100316
+++ /dev/null
@@ -1 +0,0 @@
-b7329d4ff7ee651b56cb86c7091e0d933c4f43a77125323fb6c283eedcb737c2 \ No newline at end of file
diff --git a/db/schema_migrations/20210906130643 b/db/schema_migrations/20210906130643
deleted file mode 100644
index 150e594026d..00000000000
--- a/db/schema_migrations/20210906130643
+++ /dev/null
@@ -1 +0,0 @@
-c707c0879e439de95f24f8fe2084388276a46c5e0ee30e4134a43e22ca19b4ec \ No newline at end of file
diff --git a/db/schema_migrations/20210907013944 b/db/schema_migrations/20210907013944
deleted file mode 100644
index 97cf6ef7b2f..00000000000
--- a/db/schema_migrations/20210907013944
+++ /dev/null
@@ -1 +0,0 @@
-1a449d347248cacae48d10340c5682abe6de57d2991712f4e0a39c921892e0c5 \ No newline at end of file
diff --git a/db/schema_migrations/20210907021940 b/db/schema_migrations/20210907021940
deleted file mode 100644
index c6392fca8de..00000000000
--- a/db/schema_migrations/20210907021940
+++ /dev/null
@@ -1 +0,0 @@
-53d1dee0bbe106eeaad3eda6e8012475cf4b59d30f78020c8d2ecf3499ff7e0f \ No newline at end of file
diff --git a/db/schema_migrations/20210907033745 b/db/schema_migrations/20210907033745
deleted file mode 100644
index 23d1c138824..00000000000
--- a/db/schema_migrations/20210907033745
+++ /dev/null
@@ -1 +0,0 @@
-d02cc8e136f1d761a34c7c585a3fe2b8c3bc3bca67e0e45f950248a5fad36a24 \ No newline at end of file
diff --git a/db/schema_migrations/20210907041000 b/db/schema_migrations/20210907041000
deleted file mode 100644
index 9b7b3d4b14c..00000000000
--- a/db/schema_migrations/20210907041000
+++ /dev/null
@@ -1 +0,0 @@
-23d4d2d037cd70c5b810824a837b45f016a3be5d112938123c1da08416f667cd \ No newline at end of file
diff --git a/db/schema_migrations/20210907182337 b/db/schema_migrations/20210907182337
deleted file mode 100644
index cc3d32067c2..00000000000
--- a/db/schema_migrations/20210907182337
+++ /dev/null
@@ -1 +0,0 @@
-ad564a1fda815473b09f1eda469e67cdd8f532b9b481f7e8ae3ddb8f2df6ee40 \ No newline at end of file
diff --git a/db/schema_migrations/20210907182359 b/db/schema_migrations/20210907182359
deleted file mode 100644
index 41e72e9dfec..00000000000
--- a/db/schema_migrations/20210907182359
+++ /dev/null
@@ -1 +0,0 @@
-da57784c8c7f8bcb3c8c61089b5a695efdb31b209cb1616af68240380c734669 \ No newline at end of file
diff --git a/db/schema_migrations/20210907211557 b/db/schema_migrations/20210907211557
deleted file mode 100644
index e89552729ba..00000000000
--- a/db/schema_migrations/20210907211557
+++ /dev/null
@@ -1 +0,0 @@
-387dcbda7c3b32050298d8a679361a17916a66d0ab686211f0d1a0dc708c4a74 \ No newline at end of file
diff --git a/db/schema_migrations/20210908060951 b/db/schema_migrations/20210908060951
deleted file mode 100644
index cd4ed794cc5..00000000000
--- a/db/schema_migrations/20210908060951
+++ /dev/null
@@ -1 +0,0 @@
-716fad7f9005a40d0c6a3acb8e348c7e9459a6a619fc0bf085f231f328f19fd1 \ No newline at end of file
diff --git a/db/schema_migrations/20210908061132 b/db/schema_migrations/20210908061132
deleted file mode 100644
index a5b7e482228..00000000000
--- a/db/schema_migrations/20210908061132
+++ /dev/null
@@ -1 +0,0 @@
-f9e14410f22c94d0500102bb0fd0a3a6bd27343b74810b852ceb1349a04be72d \ No newline at end of file
diff --git a/db/schema_migrations/20210908100810 b/db/schema_migrations/20210908100810
deleted file mode 100644
index a8c9023a1cc..00000000000
--- a/db/schema_migrations/20210908100810
+++ /dev/null
@@ -1 +0,0 @@
-06e45cf159cf1182b34e83f893bcff65e4722dded2bf4cbcf61fafd652158823 \ No newline at end of file
diff --git a/db/schema_migrations/20210908132335 b/db/schema_migrations/20210908132335
deleted file mode 100644
index 864d6ccc942..00000000000
--- a/db/schema_migrations/20210908132335
+++ /dev/null
@@ -1 +0,0 @@
-399e35197111c257786a2bdf5dac990a26f48d2cc8493de642dcfa47ddececd2 \ No newline at end of file
diff --git a/db/schema_migrations/20210908140437 b/db/schema_migrations/20210908140437
deleted file mode 100644
index fec99dfe6fd..00000000000
--- a/db/schema_migrations/20210908140437
+++ /dev/null
@@ -1 +0,0 @@
-a8dc6d1fecf7b26182dd89f4dae088fb315774ff4720c282f608bd0c45c75a41 \ No newline at end of file
diff --git a/db/schema_migrations/20210908185736 b/db/schema_migrations/20210908185736
deleted file mode 100644
index 826ec2b44e8..00000000000
--- a/db/schema_migrations/20210908185736
+++ /dev/null
@@ -1 +0,0 @@
-4e9a585d33caed70c3e003e4f0127158ab9c98c790f8131012f052c2bd9cd1f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210908185754 b/db/schema_migrations/20210908185754
deleted file mode 100644
index 53b9efc22d4..00000000000
--- a/db/schema_migrations/20210908185754
+++ /dev/null
@@ -1 +0,0 @@
-fc70f26e1d691773728e8e2251b23fe39247fc233996c2161143c660a92fe141 \ No newline at end of file
diff --git a/db/schema_migrations/20210908195506 b/db/schema_migrations/20210908195506
deleted file mode 100644
index 8680c7639d0..00000000000
--- a/db/schema_migrations/20210908195506
+++ /dev/null
@@ -1 +0,0 @@
-1ad794ac96f6297203046562c2ec422fbb4d1818a65266bb92179096040f7d82 \ No newline at end of file
diff --git a/db/schema_migrations/20210909104800 b/db/schema_migrations/20210909104800
deleted file mode 100644
index 70ad28d72b8..00000000000
--- a/db/schema_migrations/20210909104800
+++ /dev/null
@@ -1 +0,0 @@
-834825de758314db01a3daa2d2b943c11751553705c4dd078f2087b9ec6ff7f7 \ No newline at end of file
diff --git a/db/schema_migrations/20210909152027 b/db/schema_migrations/20210909152027
deleted file mode 100644
index 39db0c43aa6..00000000000
--- a/db/schema_migrations/20210909152027
+++ /dev/null
@@ -1 +0,0 @@
-abed3f9a6c188890d3dcd21f73a09347f8ccec0f6cc448220fadba5cbda17281 \ No newline at end of file
diff --git a/db/schema_migrations/20210909184349 b/db/schema_migrations/20210909184349
deleted file mode 100644
index 5997ddc46cf..00000000000
--- a/db/schema_migrations/20210909184349
+++ /dev/null
@@ -1 +0,0 @@
-6be3a6f8f748d8f02e2d42cd1a5103ec8bd5c17097d9e440b152685fc8d6ff83 \ No newline at end of file
diff --git a/db/schema_migrations/20210910014741 b/db/schema_migrations/20210910014741
deleted file mode 100644
index b0f32fcabf3..00000000000
--- a/db/schema_migrations/20210910014741
+++ /dev/null
@@ -1 +0,0 @@
-e6342d440d398980470f4dd018c5df56d0b5d4df11caa7ba5dd2e92578dbf678 \ No newline at end of file
diff --git a/db/schema_migrations/20210910015047 b/db/schema_migrations/20210910015047
deleted file mode 100644
index 3f76060a9bb..00000000000
--- a/db/schema_migrations/20210910015047
+++ /dev/null
@@ -1 +0,0 @@
-d0b2ee97781a5d3c671b855fb6be844431a73584be47ba35d83c7e8cfec69bcb \ No newline at end of file
diff --git a/db/schema_migrations/20210910141043 b/db/schema_migrations/20210910141043
deleted file mode 100644
index ccb687b8bda..00000000000
--- a/db/schema_migrations/20210910141043
+++ /dev/null
@@ -1 +0,0 @@
-3885d2fca4166e71610cd957f1c5a703118cbb5ba47a8d494eb4e017fe499a7d \ No newline at end of file
diff --git a/db/schema_migrations/20210910192921 b/db/schema_migrations/20210910192921
deleted file mode 100644
index d593bca14ac..00000000000
--- a/db/schema_migrations/20210910192921
+++ /dev/null
@@ -1 +0,0 @@
-48b5f8e614117ac5f1e7af4ab85a8835c3b3b34103154565dd7ef6f541dd3c37 \ No newline at end of file
diff --git a/db/schema_migrations/20210910194952 b/db/schema_migrations/20210910194952
deleted file mode 100644
index 2af73174c34..00000000000
--- a/db/schema_migrations/20210910194952
+++ /dev/null
@@ -1 +0,0 @@
-b805a0d3143f968343694ec864b38ba4991931131e8a5082dcd719420328a3ef \ No newline at end of file
diff --git a/db/schema_migrations/20210912034903 b/db/schema_migrations/20210912034903
deleted file mode 100644
index 8003a5b110c..00000000000
--- a/db/schema_migrations/20210912034903
+++ /dev/null
@@ -1 +0,0 @@
-76bfbf3f12fed895c3cfb891080b5a452d1204c83ce96736048f857b33458ad1 \ No newline at end of file
diff --git a/db/schema_migrations/20210913010411 b/db/schema_migrations/20210913010411
deleted file mode 100644
index 8ae59414604..00000000000
--- a/db/schema_migrations/20210913010411
+++ /dev/null
@@ -1 +0,0 @@
-71d51d1ac74f5c559bf41b23e5677af7228ba824da835afbe0f2299695912c19 \ No newline at end of file
diff --git a/db/schema_migrations/20210913010432 b/db/schema_migrations/20210913010432
deleted file mode 100644
index db2f53a8d06..00000000000
--- a/db/schema_migrations/20210913010432
+++ /dev/null
@@ -1 +0,0 @@
-172e77890657dd82c6ce770c286894731f6ef7fbcffb4b4fc97e0a41d132b8e8 \ No newline at end of file
diff --git a/db/schema_migrations/20210913122457 b/db/schema_migrations/20210913122457
deleted file mode 100644
index e8f322c64c8..00000000000
--- a/db/schema_migrations/20210913122457
+++ /dev/null
@@ -1 +0,0 @@
-031fb794e4fa3d54098596defd9de6fb1e507e01bd8f02462c0079e7e59c3416 \ No newline at end of file
diff --git a/db/schema_migrations/20210913224558 b/db/schema_migrations/20210913224558
deleted file mode 100644
index f2fb4eaeb71..00000000000
--- a/db/schema_migrations/20210913224558
+++ /dev/null
@@ -1 +0,0 @@
-377af41414793d7e52ffbb1fd60f2f19c58cd63bb0e85192983b5bfe98515ae8 \ No newline at end of file
diff --git a/db/schema_migrations/20210914094840 b/db/schema_migrations/20210914094840
deleted file mode 100644
index 51d46c05ae6..00000000000
--- a/db/schema_migrations/20210914094840
+++ /dev/null
@@ -1 +0,0 @@
-994de4d18202a420a7184cabe787f6e3f872900147df0cd848731483e6d87566 \ No newline at end of file
diff --git a/db/schema_migrations/20210914095310 b/db/schema_migrations/20210914095310
deleted file mode 100644
index fee7e0b9719..00000000000
--- a/db/schema_migrations/20210914095310
+++ /dev/null
@@ -1 +0,0 @@
-6fcf3ff9867df68f5e9603ae0311b29bec33aa5c5b826786b094ab0960ebcd90 \ No newline at end of file
diff --git a/db/schema_migrations/20210914145810 b/db/schema_migrations/20210914145810
deleted file mode 100644
index 1c2cdc8cbf2..00000000000
--- a/db/schema_migrations/20210914145810
+++ /dev/null
@@ -1 +0,0 @@
-a30acb6d2a3772be29dfefc7d8cda2f2df94002556fa5de85483b7fca245be86 \ No newline at end of file
diff --git a/db/schema_migrations/20210914172202 b/db/schema_migrations/20210914172202
deleted file mode 100644
index 2f7531b98aa..00000000000
--- a/db/schema_migrations/20210914172202
+++ /dev/null
@@ -1 +0,0 @@
-2ab67d4cc17d0fdf01b5861a46d6ec51d1e76e7e88209b0964a884edd22cc63d \ No newline at end of file
diff --git a/db/schema_migrations/20210915000453 b/db/schema_migrations/20210915000453
deleted file mode 100644
index 611af2b1310..00000000000
--- a/db/schema_migrations/20210915000453
+++ /dev/null
@@ -1 +0,0 @@
-ffb4e066420e1492550255e5866df6dc9f83d3d6cec9033284c4c3194d53b827 \ No newline at end of file
diff --git a/db/schema_migrations/20210915001242 b/db/schema_migrations/20210915001242
deleted file mode 100644
index 7aa9b5c5787..00000000000
--- a/db/schema_migrations/20210915001242
+++ /dev/null
@@ -1 +0,0 @@
-fc8f86f794d77902fd86acaec6046b65821ff685f841d28158dc05fb55773c16 \ No newline at end of file
diff --git a/db/schema_migrations/20210915022415 b/db/schema_migrations/20210915022415
deleted file mode 100644
index ab3ca284269..00000000000
--- a/db/schema_migrations/20210915022415
+++ /dev/null
@@ -1 +0,0 @@
-ecb73d9a0be0cf04a8b405f1225d1a5de2fcdbb4c277fd5549f72a7a21596cdc \ No newline at end of file
diff --git a/db/schema_migrations/20210915070423 b/db/schema_migrations/20210915070423
deleted file mode 100644
index 772226db1dd..00000000000
--- a/db/schema_migrations/20210915070423
+++ /dev/null
@@ -1 +0,0 @@
-f11b237fab6b4133c73f1d6105d85c8db1548b6d0753b2fd96f613c90a4fa3c1 \ No newline at end of file
diff --git a/db/schema_migrations/20210915202900 b/db/schema_migrations/20210915202900
deleted file mode 100644
index bbe7f918f7a..00000000000
--- a/db/schema_migrations/20210915202900
+++ /dev/null
@@ -1 +0,0 @@
-cc8f1bea8c722dfa06fc23a3dbaaacd7f1b7c5f7b529ebfab34b7c7c38e5db79 \ No newline at end of file
diff --git a/db/schema_migrations/20210916132547 b/db/schema_migrations/20210916132547
deleted file mode 100644
index 69932a531d9..00000000000
--- a/db/schema_migrations/20210916132547
+++ /dev/null
@@ -1 +0,0 @@
-d0953fdbaa6cf656e298ea482b3e3f931254276cb2285cffafba3d94b0626d3f \ No newline at end of file
diff --git a/db/schema_migrations/20210917134321 b/db/schema_migrations/20210917134321
deleted file mode 100644
index 3c5c397ecbf..00000000000
--- a/db/schema_migrations/20210917134321
+++ /dev/null
@@ -1 +0,0 @@
-a0ba9fb9e2f7f738926a2273f9ff644c43acb999f4d27adf192e5006582a2a0e \ No newline at end of file
diff --git a/db/schema_migrations/20210917153645 b/db/schema_migrations/20210917153645
deleted file mode 100644
index 483c6153a24..00000000000
--- a/db/schema_migrations/20210917153645
+++ /dev/null
@@ -1 +0,0 @@
-fb4c7ce2ed33b3843fbaaf34ea6dbb6db52776039db62b0ab0bb880744f615d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210917153905 b/db/schema_migrations/20210917153905
deleted file mode 100644
index a4e424dfad3..00000000000
--- a/db/schema_migrations/20210917153905
+++ /dev/null
@@ -1 +0,0 @@
-3f0ac2bbfdfe6a2c05043e02ec383bdc7787f86741d6b2df7da2cc6a7aef9ce3 \ No newline at end of file
diff --git a/db/schema_migrations/20210917224419 b/db/schema_migrations/20210917224419
deleted file mode 100644
index a8b059e7b8d..00000000000
--- a/db/schema_migrations/20210917224419
+++ /dev/null
@@ -1 +0,0 @@
-9204c844b22ad0d3a938ed908377c8baacdda038725a5cf105e4b11841c1ae21 \ No newline at end of file
diff --git a/db/schema_migrations/20210918201050 b/db/schema_migrations/20210918201050
deleted file mode 100644
index 9c8f28bd813..00000000000
--- a/db/schema_migrations/20210918201050
+++ /dev/null
@@ -1 +0,0 @@
-596fd274ca1d0b2ce8698e048fea6080c9b777c48febb35a4917a6027826908e \ No newline at end of file
diff --git a/db/schema_migrations/20210918202855 b/db/schema_migrations/20210918202855
deleted file mode 100644
index f9d48eb269f..00000000000
--- a/db/schema_migrations/20210918202855
+++ /dev/null
@@ -1 +0,0 @@
-a735ae13c13f5492a5c16d3e60884b60c44d1d57f6aaacaea13f3b1bf00a8d78 \ No newline at end of file
diff --git a/db/schema_migrations/20210920104446 b/db/schema_migrations/20210920104446
deleted file mode 100644
index 4687dca7d3c..00000000000
--- a/db/schema_migrations/20210920104446
+++ /dev/null
@@ -1 +0,0 @@
-e7e9b13874081a7df42d07ccc9a54fb81973210d1c175cd995300f6339d57495 \ No newline at end of file
diff --git a/db/schema_migrations/20210920232025 b/db/schema_migrations/20210920232025
deleted file mode 100644
index 1c5b248981f..00000000000
--- a/db/schema_migrations/20210920232025
+++ /dev/null
@@ -1 +0,0 @@
-12dfb473067fc836cd435474405c3ca978d159a13e975f7663fe22c078731fd1 \ No newline at end of file
diff --git a/db/schema_migrations/20210921032008 b/db/schema_migrations/20210921032008
deleted file mode 100644
index 058a4366e4a..00000000000
--- a/db/schema_migrations/20210921032008
+++ /dev/null
@@ -1 +0,0 @@
-262127539fc16715a56e2cf7426f0f8d24922e26847a01a0a15552d71cd148f8 \ No newline at end of file
diff --git a/db/schema_migrations/20210921062820 b/db/schema_migrations/20210921062820
deleted file mode 100644
index 0f83c4cb322..00000000000
--- a/db/schema_migrations/20210921062820
+++ /dev/null
@@ -1 +0,0 @@
-ae98a673b649faf8644990de328470579e121544d4fc417562cc64a7687550ca \ No newline at end of file
diff --git a/db/schema_migrations/20210921063924 b/db/schema_migrations/20210921063924
deleted file mode 100644
index ed849aa174c..00000000000
--- a/db/schema_migrations/20210921063924
+++ /dev/null
@@ -1 +0,0 @@
-4430d4e0d688c85768201ab09056d60151fdc949b4b5f4ebc5397a99b9ec5f83 \ No newline at end of file
diff --git a/db/schema_migrations/20210921191010 b/db/schema_migrations/20210921191010
deleted file mode 100644
index c01a8f41437..00000000000
--- a/db/schema_migrations/20210921191010
+++ /dev/null
@@ -1 +0,0 @@
-8fa4dbfc075036ca379f153e97b7afd2b7600d129f7fb5294dcf4574be9dd7d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210922021816 b/db/schema_migrations/20210922021816
deleted file mode 100644
index 8286647353d..00000000000
--- a/db/schema_migrations/20210922021816
+++ /dev/null
@@ -1 +0,0 @@
-1d18e061cb5bcdaa7d3fcea93e58d65a6f2c8b557fe53ba461b6cfa570f565be \ No newline at end of file
diff --git a/db/schema_migrations/20210922025631 b/db/schema_migrations/20210922025631
deleted file mode 100644
index 217c1d9da25..00000000000
--- a/db/schema_migrations/20210922025631
+++ /dev/null
@@ -1 +0,0 @@
-43b02083323765888f019386138e8fbaa3182d74bd5e8790d6fae6ea6f0a2104 \ No newline at end of file
diff --git a/db/schema_migrations/20210922082019 b/db/schema_migrations/20210922082019
deleted file mode 100644
index c987f19e595..00000000000
--- a/db/schema_migrations/20210922082019
+++ /dev/null
@@ -1 +0,0 @@
-011b714ee5d4389a5a172ae687eea3a814915fb39a5e5eae38b6ee423a903eaf \ No newline at end of file
diff --git a/db/schema_migrations/20210922084115 b/db/schema_migrations/20210922084115
deleted file mode 100644
index 7870576c40e..00000000000
--- a/db/schema_migrations/20210922084115
+++ /dev/null
@@ -1 +0,0 @@
-6401de932d87b684c8a00254231312f8633c66a8ea96670b2761442c771d3d7f \ No newline at end of file
diff --git a/db/schema_migrations/20210922091402 b/db/schema_migrations/20210922091402
deleted file mode 100644
index cb8e307e928..00000000000
--- a/db/schema_migrations/20210922091402
+++ /dev/null
@@ -1 +0,0 @@
-4f3a1dbf39f1955122f94616952bfe04836c43e97268035b2daec3bc16e55e66 \ No newline at end of file
diff --git a/db/schema_migrations/20210922172056 b/db/schema_migrations/20210922172056
deleted file mode 100644
index 834280df2a8..00000000000
--- a/db/schema_migrations/20210922172056
+++ /dev/null
@@ -1 +0,0 @@
-c50ccd9986188356776c2d19c5544a6da6e31b5bb1b16ed259455604cb6fd862 \ No newline at end of file
diff --git a/db/schema_migrations/20210922172156 b/db/schema_migrations/20210922172156
deleted file mode 100644
index 06852710217..00000000000
--- a/db/schema_migrations/20210922172156
+++ /dev/null
@@ -1 +0,0 @@
-083b18b8e687ae8ff9d93ee77c6d4fc2916a2f1b77acf44132f216236b0ff06c \ No newline at end of file
diff --git a/db/schema_migrations/20210922215740 b/db/schema_migrations/20210922215740
deleted file mode 100644
index b7fdf9b4dfe..00000000000
--- a/db/schema_migrations/20210922215740
+++ /dev/null
@@ -1 +0,0 @@
-7b343a5e1fd2600585d8fe4ef7585f91fb4c72da329b6f9474384f7217381d12 \ No newline at end of file
diff --git a/db/schema_migrations/20210922220104 b/db/schema_migrations/20210922220104
deleted file mode 100644
index 0cacca67f8f..00000000000
--- a/db/schema_migrations/20210922220104
+++ /dev/null
@@ -1 +0,0 @@
-ced8a8373bdbf07b2be23701f243f3a9f338776eeaec0a6c4e5cc0e68572a16e \ No newline at end of file
diff --git a/db/schema_migrations/20210923042323 b/db/schema_migrations/20210923042323
deleted file mode 100644
index 944cb833939..00000000000
--- a/db/schema_migrations/20210923042323
+++ /dev/null
@@ -1 +0,0 @@
-7b08303dae62fe9b9b5081221a6aa4bd6b687e0206e78e4b8a6f5964bc42b344 \ No newline at end of file
diff --git a/db/schema_migrations/20210923042324 b/db/schema_migrations/20210923042324
deleted file mode 100644
index 445a6db0351..00000000000
--- a/db/schema_migrations/20210923042324
+++ /dev/null
@@ -1 +0,0 @@
-52785c2791be5c17517335496e7cabd99fba1a82e82d8c783703bd68f8b40163 \ No newline at end of file
diff --git a/db/schema_migrations/20210923042325 b/db/schema_migrations/20210923042325
deleted file mode 100644
index a89582ef187..00000000000
--- a/db/schema_migrations/20210923042325
+++ /dev/null
@@ -1 +0,0 @@
-f253f2bd5643f8cf72f020e5ba5237506833dee84aa98828166d8ad1570f925f \ No newline at end of file
diff --git a/db/schema_migrations/20210923133143 b/db/schema_migrations/20210923133143
deleted file mode 100644
index c0e7bb485fb..00000000000
--- a/db/schema_migrations/20210923133143
+++ /dev/null
@@ -1 +0,0 @@
-d2736a06009d6232d832a03d6842a81b1de2ce79b901331a0e09ac40fc51a463 \ No newline at end of file
diff --git a/db/schema_migrations/20210923135909 b/db/schema_migrations/20210923135909
deleted file mode 100644
index b7b1ecc6bf2..00000000000
--- a/db/schema_migrations/20210923135909
+++ /dev/null
@@ -1 +0,0 @@
-2afb8292fcdf9a56c11d9404275ffecfde4b2a474e733e3e19f4db62c628aa6c \ No newline at end of file
diff --git a/db/schema_migrations/20210923151641 b/db/schema_migrations/20210923151641
deleted file mode 100644
index bd38d8c6a28..00000000000
--- a/db/schema_migrations/20210923151641
+++ /dev/null
@@ -1 +0,0 @@
-30c135ab62a57208160dd0949d6615f42af39117e25769d70a9658de5417b7e4 \ No newline at end of file
diff --git a/db/schema_migrations/20210923192648 b/db/schema_migrations/20210923192648
deleted file mode 100644
index 5514ec65903..00000000000
--- a/db/schema_migrations/20210923192648
+++ /dev/null
@@ -1 +0,0 @@
-d9cb520f198893019b24c970ba409471e3d98581eb62f746320fc6e81a16af08 \ No newline at end of file
diff --git a/db/schema_migrations/20210923192649 b/db/schema_migrations/20210923192649
deleted file mode 100644
index e91955f09fe..00000000000
--- a/db/schema_migrations/20210923192649
+++ /dev/null
@@ -1 +0,0 @@
-12fb550e936ede5a8e83ab06f2fc535201e7a276295a2103564412ded32958f8 \ No newline at end of file
diff --git a/db/schema_migrations/20210927153807 b/db/schema_migrations/20210927153807
deleted file mode 100644
index c6a675e380b..00000000000
--- a/db/schema_migrations/20210927153807
+++ /dev/null
@@ -1 +0,0 @@
-8e54f43a955023e422bf40476f468fbdf04f06e806b08fddf35208c65607fec3 \ No newline at end of file
diff --git a/db/schema_migrations/20210928155022 b/db/schema_migrations/20210928155022
deleted file mode 100644
index d953746413a..00000000000
--- a/db/schema_migrations/20210928155022
+++ /dev/null
@@ -1 +0,0 @@
-41ea0971cd62ba43bf98c1901169e7bb8fcebe68025d947f26b0ccf6806c976e \ No newline at end of file
diff --git a/db/schema_migrations/20210928171122 b/db/schema_migrations/20210928171122
deleted file mode 100644
index ccddd09345b..00000000000
--- a/db/schema_migrations/20210928171122
+++ /dev/null
@@ -1 +0,0 @@
-f257ff9896e2d90ced39c2c010df1d4b74badae046651a190585c9c47342d119 \ No newline at end of file
diff --git a/db/schema_migrations/20210929025600 b/db/schema_migrations/20210929025600
deleted file mode 100644
index fb00216afac..00000000000
--- a/db/schema_migrations/20210929025600
+++ /dev/null
@@ -1 +0,0 @@
-c757a7e17433b8ddf15ae6304286fe3da69f820966455e7fbed7282286f5eb67 \ No newline at end of file
diff --git a/db/schema_migrations/20210929030834 b/db/schema_migrations/20210929030834
deleted file mode 100644
index a3dc19d0440..00000000000
--- a/db/schema_migrations/20210929030834
+++ /dev/null
@@ -1 +0,0 @@
-b5302b3a2384bd7d0e639f00941efb490c3121a9332f1e73be620ab0f6f3e771 \ No newline at end of file
diff --git a/db/schema_migrations/20210929031049 b/db/schema_migrations/20210929031049
deleted file mode 100644
index 19ba54b465a..00000000000
--- a/db/schema_migrations/20210929031049
+++ /dev/null
@@ -1 +0,0 @@
-d3f588e4edded61f36acbf25fba39be17a2ac16f37e9114f2c5c257c47dc1308 \ No newline at end of file
diff --git a/db/schema_migrations/20210929032555 b/db/schema_migrations/20210929032555
deleted file mode 100644
index 779e6a63fe2..00000000000
--- a/db/schema_migrations/20210929032555
+++ /dev/null
@@ -1 +0,0 @@
-08593002910759482c58f9b31f251d589ab32b540d9614a2c677df11d32f7f26 \ No newline at end of file
diff --git a/db/schema_migrations/20210929115340 b/db/schema_migrations/20210929115340
deleted file mode 100644
index 2f6bf226e09..00000000000
--- a/db/schema_migrations/20210929115340
+++ /dev/null
@@ -1 +0,0 @@
-0de2844fdec43eca860648bdb1a5b184bcc0f79b51086b16d8ef398f32cfd5de \ No newline at end of file
diff --git a/db/schema_migrations/20210929121516 b/db/schema_migrations/20210929121516
deleted file mode 100644
index c42d39c9c34..00000000000
--- a/db/schema_migrations/20210929121516
+++ /dev/null
@@ -1 +0,0 @@
-432dc1f1e0280a79e4a6af56c2f2cb40c99edbc09e254b82b7f48c7c9217372b \ No newline at end of file
diff --git a/db/schema_migrations/20210929144453 b/db/schema_migrations/20210929144453
deleted file mode 100644
index 753ea50c272..00000000000
--- a/db/schema_migrations/20210929144453
+++ /dev/null
@@ -1 +0,0 @@
-0f808c27d19e6a38d4aa31f2dd820fe226681af84e05c4af47213409b2043e5a \ No newline at end of file
diff --git a/db/schema_migrations/20210930081208 b/db/schema_migrations/20210930081208
deleted file mode 100644
index a0c1d701717..00000000000
--- a/db/schema_migrations/20210930081208
+++ /dev/null
@@ -1 +0,0 @@
-4b2c1b8e80f481d2dbbcfcb61c0a3d3081cbe4081fdd710040a028d72bd5d0e4 \ No newline at end of file
diff --git a/db/schema_migrations/20210930211936 b/db/schema_migrations/20210930211936
deleted file mode 100644
index 4538ddf180d..00000000000
--- a/db/schema_migrations/20210930211936
+++ /dev/null
@@ -1 +0,0 @@
-3aaf2a4fa834331768e2acc10f67b8d456e70aca9784787e40b55dade7b6f64c \ No newline at end of file
diff --git a/db/schema_migrations/20211001001222 b/db/schema_migrations/20211001001222
deleted file mode 100644
index 2b0ebb346a9..00000000000
--- a/db/schema_migrations/20211001001222
+++ /dev/null
@@ -1 +0,0 @@
-23be5444bb11f731e98edc9b6aad814d02fd0f3f6be9abdea9060898cc2b95f1 \ No newline at end of file
diff --git a/db/schema_migrations/20211004062942 b/db/schema_migrations/20211004062942
deleted file mode 100644
index 6ad1af289f7..00000000000
--- a/db/schema_migrations/20211004062942
+++ /dev/null
@@ -1 +0,0 @@
-95dcfdc6c03705b0db5e96d669051edf335b5d6501243f70588f9b73478116a6 \ No newline at end of file
diff --git a/db/schema_migrations/20211004075629 b/db/schema_migrations/20211004075629
deleted file mode 100644
index d55f7370798..00000000000
--- a/db/schema_migrations/20211004075629
+++ /dev/null
@@ -1 +0,0 @@
-e035616201329b7610e8c3a647bc01c52ce722790ea7bb88d4a38bc0feb4737e \ No newline at end of file
diff --git a/db/schema_migrations/20211004081911 b/db/schema_migrations/20211004081911
deleted file mode 100644
index c849cb776d8..00000000000
--- a/db/schema_migrations/20211004081911
+++ /dev/null
@@ -1 +0,0 @@
-cc53e8c85fdb00c0772987516e0c23f5349cc6dc1e21b4124eb50efdaa6a4fcd \ No newline at end of file
diff --git a/db/schema_migrations/20211004110500 b/db/schema_migrations/20211004110500
deleted file mode 100644
index e22ed05de83..00000000000
--- a/db/schema_migrations/20211004110500
+++ /dev/null
@@ -1 +0,0 @@
-1b0b562aefb724afe24b8640a22013cea6fddd0e594d6723f6819f69804ba9f7 \ No newline at end of file
diff --git a/db/schema_migrations/20211004110927 b/db/schema_migrations/20211004110927
deleted file mode 100644
index aa70a4aa0d8..00000000000
--- a/db/schema_migrations/20211004110927
+++ /dev/null
@@ -1 +0,0 @@
-50c937f979c83f6937364d92bf65ed42ef963f2d241eadcee6355c1b256c3ec9 \ No newline at end of file
diff --git a/db/schema_migrations/20211004122540 b/db/schema_migrations/20211004122540
deleted file mode 100644
index 1c7fc785b29..00000000000
--- a/db/schema_migrations/20211004122540
+++ /dev/null
@@ -1 +0,0 @@
-72358f01061f5296e21647d5da9bbb6a33e94055c9c9aded6088cfb9126564b2 \ No newline at end of file
diff --git a/db/schema_migrations/20211004151202 b/db/schema_migrations/20211004151202
deleted file mode 100644
index f21ef531938..00000000000
--- a/db/schema_migrations/20211004151202
+++ /dev/null
@@ -1 +0,0 @@
-88f8e8391a480450a3d76d98f089e1e2287048007d0ecdcbd0799c9cc021481f \ No newline at end of file
diff --git a/db/schema_migrations/20211005010101 b/db/schema_migrations/20211005010101
deleted file mode 100644
index 9789f36adea..00000000000
--- a/db/schema_migrations/20211005010101
+++ /dev/null
@@ -1 +0,0 @@
-40e15593d9ee0fb5a59d1576c6da5a1eece265730f7ae15c5c81c2c5343b362c \ No newline at end of file
diff --git a/db/schema_migrations/20211005063519 b/db/schema_migrations/20211005063519
deleted file mode 100644
index d3450d4282a..00000000000
--- a/db/schema_migrations/20211005063519
+++ /dev/null
@@ -1 +0,0 @@
-e45163c2d0d691fb5deab86d024c4edb8e3cd350271418e1ff132c31e2ca90a3 \ No newline at end of file
diff --git a/db/schema_migrations/20211005063616 b/db/schema_migrations/20211005063616
deleted file mode 100644
index 030dfc12a68..00000000000
--- a/db/schema_migrations/20211005063616
+++ /dev/null
@@ -1 +0,0 @@
-20d35e9baae343bccbb67a25eacd7fdb4b32fd4cedd95e6f8f7a2933470350fb \ No newline at end of file
diff --git a/db/schema_migrations/20211005063723 b/db/schema_migrations/20211005063723
deleted file mode 100644
index b4d8c7a3f6e..00000000000
--- a/db/schema_migrations/20211005063723
+++ /dev/null
@@ -1 +0,0 @@
-4659ab6d971b03d9b44dda72fe1b571c5050fd6892cb4f16f2ca1ced0905c1ce \ No newline at end of file
diff --git a/db/schema_migrations/20211005083015 b/db/schema_migrations/20211005083015
deleted file mode 100644
index 0e5a20b824f..00000000000
--- a/db/schema_migrations/20211005083015
+++ /dev/null
@@ -1 +0,0 @@
-37016ec5e5ab1bd8d2bd8020f98277b3ad9f450b833ce3ebde70aebce5130a26 \ No newline at end of file
diff --git a/db/schema_migrations/20211005092428 b/db/schema_migrations/20211005092428
deleted file mode 100644
index 0ac1a5f6ee6..00000000000
--- a/db/schema_migrations/20211005092428
+++ /dev/null
@@ -1 +0,0 @@
-43abb71ecc1f1b4e699af1258934884a06e4e4eb1445ec3cc7a2c6668f42f14a \ No newline at end of file
diff --git a/db/schema_migrations/20211005093558 b/db/schema_migrations/20211005093558
deleted file mode 100644
index 943f905b497..00000000000
--- a/db/schema_migrations/20211005093558
+++ /dev/null
@@ -1 +0,0 @@
-16638e14f1920b2e615dcb14965b7ef2a16ead099e7f8b1cdad6dd75d6d45107 \ No newline at end of file
diff --git a/db/schema_migrations/20211005100112 b/db/schema_migrations/20211005100112
deleted file mode 100644
index 1f7a92ca316..00000000000
--- a/db/schema_migrations/20211005100112
+++ /dev/null
@@ -1 +0,0 @@
-196cd1cf84babb12e92830bf2b7a0315499fdb976f825d4913a506e744b4fd53 \ No newline at end of file
diff --git a/db/schema_migrations/20211005112404 b/db/schema_migrations/20211005112404
deleted file mode 100644
index 80ce0534de8..00000000000
--- a/db/schema_migrations/20211005112404
+++ /dev/null
@@ -1 +0,0 @@
-f4fe6c4a2860dd35f767d98d5025326142cab7fc9c12b5efb1541e2604791691 \ No newline at end of file
diff --git a/db/schema_migrations/20211005112645 b/db/schema_migrations/20211005112645
deleted file mode 100644
index e17b00586e5..00000000000
--- a/db/schema_migrations/20211005112645
+++ /dev/null
@@ -1 +0,0 @@
-59e5de7766dc55e820ec714fbb61b5db61a73959f1e877e66caf668f93d0d633 \ No newline at end of file
diff --git a/db/schema_migrations/20211005194425 b/db/schema_migrations/20211005194425
deleted file mode 100644
index cd3710a6492..00000000000
--- a/db/schema_migrations/20211005194425
+++ /dev/null
@@ -1 +0,0 @@
-6647e94d315c76629f9726e26bafd124fb2fed361568d65315e7c7557f8d9ecf \ No newline at end of file
diff --git a/db/schema_migrations/20211006060254 b/db/schema_migrations/20211006060254
deleted file mode 100644
index 2891170a092..00000000000
--- a/db/schema_migrations/20211006060254
+++ /dev/null
@@ -1 +0,0 @@
-0d6ec7c1d96f32c645ddc051d8e3b3bd0ad759c52c8938888287b1c6b57d27a3 \ No newline at end of file
diff --git a/db/schema_migrations/20211006060436 b/db/schema_migrations/20211006060436
deleted file mode 100644
index e2374c092c7..00000000000
--- a/db/schema_migrations/20211006060436
+++ /dev/null
@@ -1 +0,0 @@
-918852db691546e4e93a933789968115ac98b5757d480ed1e09118508e6024d5 \ No newline at end of file
diff --git a/db/schema_migrations/20211006103122 b/db/schema_migrations/20211006103122
deleted file mode 100644
index 4d2347702de..00000000000
--- a/db/schema_migrations/20211006103122
+++ /dev/null
@@ -1 +0,0 @@
-1e29e4712d81aacf1178996c2dd9e82593be5a2311273800d91640d8eccd38ed \ No newline at end of file
diff --git a/db/schema_migrations/20211006122010 b/db/schema_migrations/20211006122010
deleted file mode 100644
index 6758ab4978a..00000000000
--- a/db/schema_migrations/20211006122010
+++ /dev/null
@@ -1 +0,0 @@
-19efbbf7aab5837e33ff72d87e101a76da7eeb1d60c05ffc0ceddad1d0cbc69c \ No newline at end of file
diff --git a/db/schema_migrations/20211006145004 b/db/schema_migrations/20211006145004
deleted file mode 100644
index 6a99396d34a..00000000000
--- a/db/schema_migrations/20211006145004
+++ /dev/null
@@ -1 +0,0 @@
-9fca672eaa0b82a37c211de35a4961b81fb163d290004907be7bf641327c65b1 \ No newline at end of file
diff --git a/db/schema_migrations/20211006174114 b/db/schema_migrations/20211006174114
deleted file mode 100644
index 1d015b78676..00000000000
--- a/db/schema_migrations/20211006174114
+++ /dev/null
@@ -1 +0,0 @@
-15d1bc08a87241b4217278ce8214f41d1d3c0cc4c26a3e659f395a602d139758 \ No newline at end of file
diff --git a/db/schema_migrations/20211007090229 b/db/schema_migrations/20211007090229
deleted file mode 100644
index 9302c958709..00000000000
--- a/db/schema_migrations/20211007090229
+++ /dev/null
@@ -1 +0,0 @@
-9d87052305a552ce380e81a33c690496c44e332eb86869ea6882f5cd4856ab93 \ No newline at end of file
diff --git a/db/schema_migrations/20211007093340 b/db/schema_migrations/20211007093340
deleted file mode 100644
index 9b11d742548..00000000000
--- a/db/schema_migrations/20211007093340
+++ /dev/null
@@ -1 +0,0 @@
-fbb3092caba901ddd5a740bb67a91d1c8a4c458651afaf02704399844acbd2b8 \ No newline at end of file
diff --git a/db/schema_migrations/20211007113136 b/db/schema_migrations/20211007113136
deleted file mode 100644
index dc245a3723b..00000000000
--- a/db/schema_migrations/20211007113136
+++ /dev/null
@@ -1 +0,0 @@
-7abcc243cd02a4eba77ea39cbb1b1f2de74d85e55055def9ae02c4fdeaba3d9a \ No newline at end of file
diff --git a/db/schema_migrations/20211007155221 b/db/schema_migrations/20211007155221
deleted file mode 100644
index 662668fe983..00000000000
--- a/db/schema_migrations/20211007155221
+++ /dev/null
@@ -1 +0,0 @@
-115427979cd7ecfc14bf4f663a9afd5abc6d481d08fafc13ca7e6a8cac9ba20c \ No newline at end of file
diff --git a/db/schema_migrations/20211008043855 b/db/schema_migrations/20211008043855
deleted file mode 100644
index 0abc8393efa..00000000000
--- a/db/schema_migrations/20211008043855
+++ /dev/null
@@ -1 +0,0 @@
-166ae24ae4856488c81a71c650dca038c8cd7cb2221545e84431e118da097688 \ No newline at end of file
diff --git a/db/schema_migrations/20211008181451 b/db/schema_migrations/20211008181451
deleted file mode 100644
index 1687056609f..00000000000
--- a/db/schema_migrations/20211008181451
+++ /dev/null
@@ -1 +0,0 @@
-b4104ebb3d99100ed5b6831174af563ea7cda46428007e30219198b910313b05 \ No newline at end of file
diff --git a/db/schema_migrations/20211008182954 b/db/schema_migrations/20211008182954
deleted file mode 100644
index e530f090840..00000000000
--- a/db/schema_migrations/20211008182954
+++ /dev/null
@@ -1 +0,0 @@
-d16b96a960e03e50135802885f5b8c44168d2413f3db1f53ac15389a33dddc61 \ No newline at end of file
diff --git a/db/schema_migrations/20211008193137 b/db/schema_migrations/20211008193137
deleted file mode 100644
index 57d2f8cfbc8..00000000000
--- a/db/schema_migrations/20211008193137
+++ /dev/null
@@ -1 +0,0 @@
-97efc3bb2039b66dac98135d93baefc780a62571bd80aa39d7458f37ce92905b \ No newline at end of file
diff --git a/db/schema_migrations/20211011004242 b/db/schema_migrations/20211011004242
deleted file mode 100644
index f25581cae75..00000000000
--- a/db/schema_migrations/20211011004242
+++ /dev/null
@@ -1 +0,0 @@
-88bb0ca64281134fd97be474a1bb2be3ee60e59f10b9e144776a3282bba5a4c5 \ No newline at end of file
diff --git a/db/schema_migrations/20211011104843 b/db/schema_migrations/20211011104843
deleted file mode 100644
index 78789b94ece..00000000000
--- a/db/schema_migrations/20211011104843
+++ /dev/null
@@ -1 +0,0 @@
-e2812344b16cd51c544235bae8a365713ab7e34652c2c05511a7fe9d84c05fb1 \ No newline at end of file
diff --git a/db/schema_migrations/20211011140930 b/db/schema_migrations/20211011140930
deleted file mode 100644
index 6347ee5d51d..00000000000
--- a/db/schema_migrations/20211011140930
+++ /dev/null
@@ -1 +0,0 @@
-cdae819e8de3b5ad721014376bfd9af97a45e953e2d345daf62784f986a5eb31 \ No newline at end of file
diff --git a/db/schema_migrations/20211011140931 b/db/schema_migrations/20211011140931
deleted file mode 100644
index c959d97074e..00000000000
--- a/db/schema_migrations/20211011140931
+++ /dev/null
@@ -1 +0,0 @@
-7e51eb4443fd74da9bef4d9c1c3cc40376c311abbc05ca7871f725fada79b48a \ No newline at end of file
diff --git a/db/schema_migrations/20211011140932 b/db/schema_migrations/20211011140932
deleted file mode 100644
index af0e000b9f3..00000000000
--- a/db/schema_migrations/20211011140932
+++ /dev/null
@@ -1 +0,0 @@
-0209db1e7be48bcbf0e52b451d37da0ef2ecadd567cdfa47907fc5032c258a27 \ No newline at end of file
diff --git a/db/schema_migrations/20211011141239 b/db/schema_migrations/20211011141239
deleted file mode 100644
index f215f234a7e..00000000000
--- a/db/schema_migrations/20211011141239
+++ /dev/null
@@ -1 +0,0 @@
-bc0ae055b331801fbe020c12a66e4e6ae790780121bfd66fd161093c94c7a84a \ No newline at end of file
diff --git a/db/schema_migrations/20211011141242 b/db/schema_migrations/20211011141242
deleted file mode 100644
index 01d082a4bc8..00000000000
--- a/db/schema_migrations/20211011141242
+++ /dev/null
@@ -1 +0,0 @@
-9fd4977cdb57df827fe1a01f55a305d832ee4240d40af9396e093e3b4dbd1e33 \ No newline at end of file
diff --git a/db/schema_migrations/20211011141243 b/db/schema_migrations/20211011141243
deleted file mode 100644
index cb2df22b8d7..00000000000
--- a/db/schema_migrations/20211011141243
+++ /dev/null
@@ -1 +0,0 @@
-b3ce6aa41c70cdcf8637a94c3d4d4e97730899221530f5507c4581aaf2fc3a6c \ No newline at end of file
diff --git a/db/schema_migrations/20211011152701 b/db/schema_migrations/20211011152701
deleted file mode 100644
index fcd6f8ad953..00000000000
--- a/db/schema_migrations/20211011152701
+++ /dev/null
@@ -1 +0,0 @@
-5701681a1006584149c88da520f780b186ca32ba1facb8b952252c6d426b6c0d \ No newline at end of file
diff --git a/db/schema_migrations/20211012015903 b/db/schema_migrations/20211012015903
deleted file mode 100644
index bfa36780370..00000000000
--- a/db/schema_migrations/20211012015903
+++ /dev/null
@@ -1 +0,0 @@
-4c3a55f7891dab4ee1ae019d97cf9d40e7bba81d87a544d6aa23a7f57e6d0f70 \ No newline at end of file
diff --git a/db/schema_migrations/20211012051221 b/db/schema_migrations/20211012051221
deleted file mode 100644
index 0dc5e9331e1..00000000000
--- a/db/schema_migrations/20211012051221
+++ /dev/null
@@ -1 +0,0 @@
-52b2a6d78fa649078167e842061ab7c04e3c41c0fc4a092a0a6123dad202fb0e \ No newline at end of file
diff --git a/db/schema_migrations/20211012091822 b/db/schema_migrations/20211012091822
deleted file mode 100644
index 09c198571af..00000000000
--- a/db/schema_migrations/20211012091822
+++ /dev/null
@@ -1 +0,0 @@
-3482e5c12f1603cb67d24aee14f003345ef2a5c350c7dccafdea6554db04c4cc \ No newline at end of file
diff --git a/db/schema_migrations/20211012134316 b/db/schema_migrations/20211012134316
deleted file mode 100644
index 72e01841ddf..00000000000
--- a/db/schema_migrations/20211012134316
+++ /dev/null
@@ -1 +0,0 @@
-0f2578f0266154ad2790cc808233c71566b3a3ea87c40909feba9ccc5872927c \ No newline at end of file
diff --git a/db/schema_migrations/20211012143815 b/db/schema_migrations/20211012143815
deleted file mode 100644
index 6e6a5493e99..00000000000
--- a/db/schema_migrations/20211012143815
+++ /dev/null
@@ -1 +0,0 @@
-2685a534728ab1a50acb49a7a5ac7d9285fdc36ec3610b93a4219e6687c22b06 \ No newline at end of file
diff --git a/db/schema_migrations/20211012155931 b/db/schema_migrations/20211012155931
deleted file mode 100644
index 1974e553fb7..00000000000
--- a/db/schema_migrations/20211012155931
+++ /dev/null
@@ -1 +0,0 @@
-0a9317419b856ba2abf3cad07c43ccfc79abfcd5efd02c464ee76f4debe362c8 \ No newline at end of file
diff --git a/db/schema_migrations/20211013014228 b/db/schema_migrations/20211013014228
deleted file mode 100644
index 5a833b7ee14..00000000000
--- a/db/schema_migrations/20211013014228
+++ /dev/null
@@ -1 +0,0 @@
-5316cfddc074ae5a320ba763dd9481b46ba47d30eefa28d6bb5caa9368027598 \ No newline at end of file
diff --git a/db/schema_migrations/20211013080714 b/db/schema_migrations/20211013080714
deleted file mode 100644
index 3579bdf3c78..00000000000
--- a/db/schema_migrations/20211013080714
+++ /dev/null
@@ -1 +0,0 @@
-5c5adaf0f6f053c7e737051fbccf61d1fc36e20360a82d5fca142883d3e3bfdd \ No newline at end of file
diff --git a/db/schema_migrations/20211013080715 b/db/schema_migrations/20211013080715
deleted file mode 100644
index ff2d473c946..00000000000
--- a/db/schema_migrations/20211013080715
+++ /dev/null
@@ -1 +0,0 @@
-06d6458f7b85b3e729c3c8a8ae29c29f7c5504ea330ae3a3bcf1e0074ed66cf6 \ No newline at end of file
diff --git a/db/schema_migrations/20211013080716 b/db/schema_migrations/20211013080716
deleted file mode 100644
index d2131eb811a..00000000000
--- a/db/schema_migrations/20211013080716
+++ /dev/null
@@ -1 +0,0 @@
-a5928cef69626ad5e972e8cb7a570ca83201cdfe7ec4f2401f2aa14c34b9cfb8 \ No newline at end of file
diff --git a/db/schema_migrations/20211013125341 b/db/schema_migrations/20211013125341
deleted file mode 100644
index 6177dfa56bc..00000000000
--- a/db/schema_migrations/20211013125341
+++ /dev/null
@@ -1 +0,0 @@
-933c37a1a44869588b6586d34dec6bc8d731c81b6e5889ce588d535c011b9340 \ No newline at end of file
diff --git a/db/schema_migrations/20211013192749 b/db/schema_migrations/20211013192749
deleted file mode 100644
index 54f05dc3fd6..00000000000
--- a/db/schema_migrations/20211013192749
+++ /dev/null
@@ -1 +0,0 @@
-eeda27c42a80d23851bb58b00cee79feeffbe9ae1fef76b3034f92c8610a8aaf \ No newline at end of file
diff --git a/db/schema_migrations/20211015021114 b/db/schema_migrations/20211015021114
deleted file mode 100644
index 1acbe9eded3..00000000000
--- a/db/schema_migrations/20211015021114
+++ /dev/null
@@ -1 +0,0 @@
-687fa7d06a8d74b561d2b392e706fb209dbb1c0c8a483ad066820d29f7df059b \ No newline at end of file
diff --git a/db/schema_migrations/20211015024135 b/db/schema_migrations/20211015024135
deleted file mode 100644
index 9f40fe5b71c..00000000000
--- a/db/schema_migrations/20211015024135
+++ /dev/null
@@ -1 +0,0 @@
-d3cafd6eb712ba3f11aa0e2bddc15bf312230e52d53ba8b7ae6c8d3cfd4aabcc \ No newline at end of file
diff --git a/db/schema_migrations/20211018101034 b/db/schema_migrations/20211018101034
deleted file mode 100644
index 57b1cc1e3c2..00000000000
--- a/db/schema_migrations/20211018101034
+++ /dev/null
@@ -1 +0,0 @@
-1cadc3a932d5b62cfeafcd4090eddc37b44997dbbd0b34da1c7c87a5774bb683 \ No newline at end of file
diff --git a/db/schema_migrations/20211018101552 b/db/schema_migrations/20211018101552
deleted file mode 100644
index 3814122d9a3..00000000000
--- a/db/schema_migrations/20211018101552
+++ /dev/null
@@ -1 +0,0 @@
-9a62f0ec43ab295619d82494090c38539cb16408c8971bdde86bb8d02546f558 \ No newline at end of file
diff --git a/db/schema_migrations/20211018101852 b/db/schema_migrations/20211018101852
deleted file mode 100644
index 5288e753211..00000000000
--- a/db/schema_migrations/20211018101852
+++ /dev/null
@@ -1 +0,0 @@
-30e9632877d3ad33528be0f56962c0ab57f5eee3889183d9638cbaea903a3d82 \ No newline at end of file
diff --git a/db/schema_migrations/20211018102252 b/db/schema_migrations/20211018102252
deleted file mode 100644
index 7d8b2c19da1..00000000000
--- a/db/schema_migrations/20211018102252
+++ /dev/null
@@ -1 +0,0 @@
-14bb815cbdad2db56dafb7eaaff893de96116a1a9e8d6c5ed95f4bef9b9717fc \ No newline at end of file
diff --git a/db/schema_migrations/20211018123316 b/db/schema_migrations/20211018123316
deleted file mode 100644
index 37bf0b261f1..00000000000
--- a/db/schema_migrations/20211018123316
+++ /dev/null
@@ -1 +0,0 @@
-fcee17f25ad3a8b6fb56c23b72978f4a6952200264d285b9e3df4b5e7733e8f6 \ No newline at end of file
diff --git a/db/schema_migrations/20211018152654 b/db/schema_migrations/20211018152654
deleted file mode 100644
index 86e9980ad10..00000000000
--- a/db/schema_migrations/20211018152654
+++ /dev/null
@@ -1 +0,0 @@
-fd7b6eb9439c00334f613e3e4977e44054930c1343e5df32bbe82c64acd6ca7b \ No newline at end of file
diff --git a/db/schema_migrations/20211018161447 b/db/schema_migrations/20211018161447
deleted file mode 100644
index e10f5b06d9a..00000000000
--- a/db/schema_migrations/20211018161447
+++ /dev/null
@@ -1 +0,0 @@
-168b383c4a85de35ade8a26e442ca49a40342ba05fb23fab4f0444814d976f65 \ No newline at end of file
diff --git a/db/schema_migrations/20211019153615 b/db/schema_migrations/20211019153615
deleted file mode 100644
index 7c1c7d7775f..00000000000
--- a/db/schema_migrations/20211019153615
+++ /dev/null
@@ -1 +0,0 @@
-713efc9673bc6cda8eff4e433c3c85f0cc4b8b8ca7b5cc4308e57a6d0b0040a0 \ No newline at end of file
diff --git a/db/schema_migrations/20211020030948 b/db/schema_migrations/20211020030948
deleted file mode 100644
index 1964b852444..00000000000
--- a/db/schema_migrations/20211020030948
+++ /dev/null
@@ -1 +0,0 @@
-97e8b2ce324594581ec0af65840a0dde8271b1b2712e22059f5c26b30d7d5cac \ No newline at end of file
diff --git a/db/schema_migrations/20211020095357 b/db/schema_migrations/20211020095357
deleted file mode 100644
index 7fcb8fa6866..00000000000
--- a/db/schema_migrations/20211020095357
+++ /dev/null
@@ -1 +0,0 @@
-a62ac8920223469c6e4c5a7f67ce9eec972189c98a8c542b377afe4ab28ee25a \ No newline at end of file
diff --git a/db/schema_migrations/20211021115409 b/db/schema_migrations/20211021115409
deleted file mode 100644
index bcbed298377..00000000000
--- a/db/schema_migrations/20211021115409
+++ /dev/null
@@ -1 +0,0 @@
-93960203e6703716f9c513dca340e17041a33792f9233dc4b7e35d1e19614191 \ No newline at end of file
diff --git a/db/schema_migrations/20211021124715 b/db/schema_migrations/20211021124715
deleted file mode 100644
index 2d03c608bac..00000000000
--- a/db/schema_migrations/20211021124715
+++ /dev/null
@@ -1 +0,0 @@
-406af18458c7f5ee8a4fa3860ed5fb87c358363926fed2830be8e8a55578822b \ No newline at end of file
diff --git a/db/schema_migrations/20211021125908 b/db/schema_migrations/20211021125908
deleted file mode 100644
index 9cb92e1eabe..00000000000
--- a/db/schema_migrations/20211021125908
+++ /dev/null
@@ -1 +0,0 @@
-d6fbe3efc3e45b750d82e277e30b7b0048b960d9f9f5b4f7c6a7a1ed869e76b5 \ No newline at end of file
diff --git a/db/schema_migrations/20211021131217 b/db/schema_migrations/20211021131217
deleted file mode 100644
index 70b45512900..00000000000
--- a/db/schema_migrations/20211021131217
+++ /dev/null
@@ -1 +0,0 @@
-87834e00821eb1ed8489c1d772dc3ac743bcf84669e78c04c7988f6f761970b8 \ No newline at end of file
diff --git a/db/schema_migrations/20211021134458 b/db/schema_migrations/20211021134458
deleted file mode 100644
index dc168e12229..00000000000
--- a/db/schema_migrations/20211021134458
+++ /dev/null
@@ -1 +0,0 @@
-1baa8db0d42a8d99e48b61930f5c42d1af5f86555488419b6551e1dbf417d3ad \ No newline at end of file
diff --git a/db/schema_migrations/20211021140426 b/db/schema_migrations/20211021140426
deleted file mode 100644
index c32db84a138..00000000000
--- a/db/schema_migrations/20211021140426
+++ /dev/null
@@ -1 +0,0 @@
-bc7974917509bfbda47375299009295bc5a55970b92443dd5d7134075b161279 \ No newline at end of file
diff --git a/db/schema_migrations/20211021141930 b/db/schema_migrations/20211021141930
deleted file mode 100644
index 294e1c80aea..00000000000
--- a/db/schema_migrations/20211021141930
+++ /dev/null
@@ -1 +0,0 @@
-483e4cbe2a0be2afbda511f2298e3715abaca29afafeeae26449fc862f49a08f \ No newline at end of file
diff --git a/db/schema_migrations/20211022112202 b/db/schema_migrations/20211022112202
deleted file mode 100644
index 6ef610f80bc..00000000000
--- a/db/schema_migrations/20211022112202
+++ /dev/null
@@ -1 +0,0 @@
-b5fbbfe186b3eeeb88bfd901ac426fc52355b71b67c5f5b42373008c19c35bee \ No newline at end of file
diff --git a/db/schema_migrations/20211022113000 b/db/schema_migrations/20211022113000
deleted file mode 100644
index 85044f34206..00000000000
--- a/db/schema_migrations/20211022113000
+++ /dev/null
@@ -1 +0,0 @@
-ded528d0485951403f1c5af804f40b1c0a7c71a0dc67f24fadbc357a45fb1a19 \ No newline at end of file
diff --git a/db/schema_migrations/20211022160154 b/db/schema_migrations/20211022160154
deleted file mode 100644
index 2a76379bc66..00000000000
--- a/db/schema_migrations/20211022160154
+++ /dev/null
@@ -1 +0,0 @@
-c474870a626c909da772a1c9f459f369d50658ce8f585a35e7cc3c7ef64af657 \ No newline at end of file
diff --git a/db/schema_migrations/20211022214523 b/db/schema_migrations/20211022214523
deleted file mode 100644
index b47f13696b0..00000000000
--- a/db/schema_migrations/20211022214523
+++ /dev/null
@@ -1 +0,0 @@
-b372da05f40fa67680b6a28ddf9bed3dc4b95795c144bf4367e4826b5cd64d6b \ No newline at end of file
diff --git a/db/schema_migrations/20211023102243 b/db/schema_migrations/20211023102243
deleted file mode 100644
index ec507da6b47..00000000000
--- a/db/schema_migrations/20211023102243
+++ /dev/null
@@ -1 +0,0 @@
-f5039be0bd028dab4f2623fe9997a95d50bd9020ffd8b92074418024cda39b6a \ No newline at end of file
diff --git a/db/schema_migrations/20211025103744 b/db/schema_migrations/20211025103744
deleted file mode 100644
index 29c49c81606..00000000000
--- a/db/schema_migrations/20211025103744
+++ /dev/null
@@ -1 +0,0 @@
-56f86f2a20509f2052d0eab918a6d2bbb679d785cf5349916ba695aa92f0609f \ No newline at end of file
diff --git a/db/schema_migrations/20211025103758 b/db/schema_migrations/20211025103758
deleted file mode 100644
index 902973a42d9..00000000000
--- a/db/schema_migrations/20211025103758
+++ /dev/null
@@ -1 +0,0 @@
-1722382c5141157497f48b209c0fa60c5959fa16c53d09fb6e8e6b2cb6e6ab9b \ No newline at end of file
diff --git a/db/schema_migrations/20211026070408 b/db/schema_migrations/20211026070408
deleted file mode 100644
index e48db972388..00000000000
--- a/db/schema_migrations/20211026070408
+++ /dev/null
@@ -1 +0,0 @@
-630899d5a7f833ce0533ae553de89e70bd03fad9b438fd367e3a568261b08b00 \ No newline at end of file
diff --git a/db/schema_migrations/20211026124336 b/db/schema_migrations/20211026124336
deleted file mode 100644
index dc6663e81a8..00000000000
--- a/db/schema_migrations/20211026124336
+++ /dev/null
@@ -1 +0,0 @@
-a6807d2c17c4efdc759f39101856d7a082ae4d531ca3ced525de10e3de808b9d \ No newline at end of file
diff --git a/db/schema_migrations/20211026143238 b/db/schema_migrations/20211026143238
deleted file mode 100644
index 9f0e7f76cd9..00000000000
--- a/db/schema_migrations/20211026143238
+++ /dev/null
@@ -1 +0,0 @@
-6b1377dd7e9b78a35c2f5635d2d11f5fe254aa772576510b41fcf1e03ad56c87 \ No newline at end of file
diff --git a/db/schema_migrations/20211027043206 b/db/schema_migrations/20211027043206
deleted file mode 100644
index 7387484a118..00000000000
--- a/db/schema_migrations/20211027043206
+++ /dev/null
@@ -1 +0,0 @@
-543feeedace6596d63207738829dcd62249a9f048a08928fbe4131ec69058322 \ No newline at end of file
diff --git a/db/schema_migrations/20211027043229 b/db/schema_migrations/20211027043229
deleted file mode 100644
index 75c99cb5491..00000000000
--- a/db/schema_migrations/20211027043229
+++ /dev/null
@@ -1 +0,0 @@
-2bceb12bdb90052cc8c1aedbd52c11cb8125471e1b59de3d75ef476fc64851c9 \ No newline at end of file
diff --git a/db/schema_migrations/20211027064021 b/db/schema_migrations/20211027064021
deleted file mode 100644
index 3bd57b30583..00000000000
--- a/db/schema_migrations/20211027064021
+++ /dev/null
@@ -1 +0,0 @@
-f1b218eaddb9bcc5e4d854a6b43fc5e122b38dc989225327a1c4a899f41e5ac6 \ No newline at end of file
diff --git a/db/schema_migrations/20211027064156 b/db/schema_migrations/20211027064156
deleted file mode 100644
index 880b7a00694..00000000000
--- a/db/schema_migrations/20211027064156
+++ /dev/null
@@ -1 +0,0 @@
-3d7b72684102836d7a7efcab7590b3d14bc63eb3e1bfbc7a95fb5eb5c6a906af \ No newline at end of file
diff --git a/db/schema_migrations/20211027112901 b/db/schema_migrations/20211027112901
deleted file mode 100644
index 0e4cb808f00..00000000000
--- a/db/schema_migrations/20211027112901
+++ /dev/null
@@ -1 +0,0 @@
-83c1d699e5de98007ef815b5f9dfbc9a644c6289bf86832af1d5b8a6d3d83659 \ No newline at end of file
diff --git a/db/schema_migrations/20211027203950 b/db/schema_migrations/20211027203950
deleted file mode 100644
index 4e4265a34c9..00000000000
--- a/db/schema_migrations/20211027203950
+++ /dev/null
@@ -1 +0,0 @@
-38643fbd719e7d65e5e79eeb279a5732cee5c28774a300859a2bace13d882ee2 \ No newline at end of file
diff --git a/db/schema_migrations/20211027204011 b/db/schema_migrations/20211027204011
deleted file mode 100644
index 7c1e07a87c0..00000000000
--- a/db/schema_migrations/20211027204011
+++ /dev/null
@@ -1 +0,0 @@
-8542de6f3bf260b4e7596ed497ff8ed4204c81519d8f19e64ac86cd5532e7a61 \ No newline at end of file
diff --git a/db/schema_migrations/20211028085926 b/db/schema_migrations/20211028085926
deleted file mode 100644
index c1e8d928fa0..00000000000
--- a/db/schema_migrations/20211028085926
+++ /dev/null
@@ -1 +0,0 @@
-ed6939c1e89f78290c312bf005cb33bd1a5ee778e8d9be3ae2eb04cc25416b92 \ No newline at end of file
diff --git a/db/schema_migrations/20211028100303 b/db/schema_migrations/20211028100303
deleted file mode 100644
index 472b2ce78ef..00000000000
--- a/db/schema_migrations/20211028100303
+++ /dev/null
@@ -1 +0,0 @@
-bb28267d020cbc26614e4635c803af0168ab5606f3aadc40e1c0e0bc6d988254 \ No newline at end of file
diff --git a/db/schema_migrations/20211028100843 b/db/schema_migrations/20211028100843
deleted file mode 100644
index 4be06f29039..00000000000
--- a/db/schema_migrations/20211028100843
+++ /dev/null
@@ -1 +0,0 @@
-27578f62b5cde4fdbfe79eb717404a5cef62b8c17170525428dbf81e6b394ce9 \ No newline at end of file
diff --git a/db/schema_migrations/20211028123412 b/db/schema_migrations/20211028123412
deleted file mode 100644
index d32c7c95d8f..00000000000
--- a/db/schema_migrations/20211028123412
+++ /dev/null
@@ -1 +0,0 @@
-d7655fb2a01e389f59990b395ed7ef683b21a3371b7e68d3eb29def85eea1888 \ No newline at end of file
diff --git a/db/schema_migrations/20211028132247 b/db/schema_migrations/20211028132247
deleted file mode 100644
index ab8fa3b55eb..00000000000
--- a/db/schema_migrations/20211028132247
+++ /dev/null
@@ -1 +0,0 @@
-50a5c8af2cde1ae79d627f70d3b266488f76f76b481aefca8516db5360cfa843 \ No newline at end of file
diff --git a/db/schema_migrations/20211028155449 b/db/schema_migrations/20211028155449
deleted file mode 100644
index 00b1c4e14dd..00000000000
--- a/db/schema_migrations/20211028155449
+++ /dev/null
@@ -1 +0,0 @@
-385c540b1f80c31a5ba009ae3507d2b855a737389bcb75c07a8872f26f8a9b44 \ No newline at end of file
diff --git a/db/schema_migrations/20211028212259 b/db/schema_migrations/20211028212259
deleted file mode 100644
index 777c5546592..00000000000
--- a/db/schema_migrations/20211028212259
+++ /dev/null
@@ -1 +0,0 @@
-56af9791c8625d99e9a53690135086afccdbe8f58a5c236d6805b0883fb971b0 \ No newline at end of file
diff --git a/db/schema_migrations/20211029102822 b/db/schema_migrations/20211029102822
deleted file mode 100644
index 72198f302b3..00000000000
--- a/db/schema_migrations/20211029102822
+++ /dev/null
@@ -1 +0,0 @@
-e1f9d87287048010e9816fd5b4a9a2d30b64d2ad150226852f6679b950031914 \ No newline at end of file
diff --git a/db/schema_migrations/20211031152417 b/db/schema_migrations/20211031152417
deleted file mode 100644
index 429c7dc0d8c..00000000000
--- a/db/schema_migrations/20211031152417
+++ /dev/null
@@ -1 +0,0 @@
-f46a0dd662a80d38a4e8d3e6c4db05e61563a959b75d30a4c3724ae6afc2647f \ No newline at end of file
diff --git a/db/schema_migrations/20211031154919 b/db/schema_migrations/20211031154919
deleted file mode 100644
index 29cf7cc1580..00000000000
--- a/db/schema_migrations/20211031154919
+++ /dev/null
@@ -1 +0,0 @@
-08399bfbf62533c00dfe3ca3434f6be292ec768f053d3b1fde41d2d68de32fe7 \ No newline at end of file
diff --git a/db/schema_migrations/20211101132310 b/db/schema_migrations/20211101132310
deleted file mode 100644
index 08a95d2747e..00000000000
--- a/db/schema_migrations/20211101132310
+++ /dev/null
@@ -1 +0,0 @@
-3e02605ce307d0ce37c3830e6909e7cfe5632408a757adf59209a70da92c0bc6 \ No newline at end of file
diff --git a/db/schema_migrations/20211101165656 b/db/schema_migrations/20211101165656
deleted file mode 100644
index 6886ce7b564..00000000000
--- a/db/schema_migrations/20211101165656
+++ /dev/null
@@ -1 +0,0 @@
-853e68aa974f49b7ab9f60acc0191da47598db115748e96752145c3cea89a986 \ No newline at end of file
diff --git a/db/schema_migrations/20211101222614 b/db/schema_migrations/20211101222614
deleted file mode 100644
index 619ca607a75..00000000000
--- a/db/schema_migrations/20211101222614
+++ /dev/null
@@ -1 +0,0 @@
-a579b14aff1d186d89173e383442f2ffbd69b1baed3f9a4c758fbb001b445139 \ No newline at end of file
diff --git a/db/schema_migrations/20211102103127 b/db/schema_migrations/20211102103127
deleted file mode 100644
index 2ce33ad085a..00000000000
--- a/db/schema_migrations/20211102103127
+++ /dev/null
@@ -1 +0,0 @@
-450028c90cb92f5ce3f8239eb56364b83ed025839aaf305b7ceb4fda077681b1 \ No newline at end of file
diff --git a/db/schema_migrations/20211102114802 b/db/schema_migrations/20211102114802
deleted file mode 100644
index 35d3a25f3cb..00000000000
--- a/db/schema_migrations/20211102114802
+++ /dev/null
@@ -1 +0,0 @@
-a3f9fcac354cccfdfc42b8f5baab651cb65ca60e4474ce937ab25b552bfe483c \ No newline at end of file
diff --git a/db/schema_migrations/20211103062728 b/db/schema_migrations/20211103062728
deleted file mode 100644
index 45bb2fcda65..00000000000
--- a/db/schema_migrations/20211103062728
+++ /dev/null
@@ -1 +0,0 @@
-a22322122144f28306b3b38dbe50b3465ad623c389f8bfe6fa97a0f71b1c7c21 \ No newline at end of file
diff --git a/db/schema_migrations/20211103141403 b/db/schema_migrations/20211103141403
deleted file mode 100644
index 357a24ae4bb..00000000000
--- a/db/schema_migrations/20211103141403
+++ /dev/null
@@ -1 +0,0 @@
-d16d62b2984586540a99aa5fc67de6459a4cd473089ddbae8d45e8783863d78d \ No newline at end of file
diff --git a/db/schema_migrations/20211103162025 b/db/schema_migrations/20211103162025
deleted file mode 100644
index e6cb01358d4..00000000000
--- a/db/schema_migrations/20211103162025
+++ /dev/null
@@ -1 +0,0 @@
-2ed9198926eb0579fccd4a8b1866f10ba4f42683d676e0664db3fadefe0bed39 \ No newline at end of file
diff --git a/db/schema_migrations/20211103184303 b/db/schema_migrations/20211103184303
deleted file mode 100644
index f488474ce82..00000000000
--- a/db/schema_migrations/20211103184303
+++ /dev/null
@@ -1 +0,0 @@
-fdec8e2d58c5b857a997d7fa3536969df8c05b8c455811cbec984834e031f2cb \ No newline at end of file
diff --git a/db/schema_migrations/20211104012209 b/db/schema_migrations/20211104012209
deleted file mode 100644
index 8a81fbdf9b8..00000000000
--- a/db/schema_migrations/20211104012209
+++ /dev/null
@@ -1 +0,0 @@
-e7cf08543f911b5f95f08d4aa6063e05b026e463e71a65b6b8200191de1b02a1 \ No newline at end of file
diff --git a/db/schema_migrations/20211104044453 b/db/schema_migrations/20211104044453
deleted file mode 100644
index 7d39c0e48e8..00000000000
--- a/db/schema_migrations/20211104044453
+++ /dev/null
@@ -1 +0,0 @@
-fc5a60c27ca89b122d798abe8f55a0951fece712c885555df0d2f37b565d6f94 \ No newline at end of file
diff --git a/db/schema_migrations/20211104165220 b/db/schema_migrations/20211104165220
deleted file mode 100644
index abfa37a45a4..00000000000
--- a/db/schema_migrations/20211104165220
+++ /dev/null
@@ -1 +0,0 @@
-52625ff0a6117724cc1d7c6417ef95fe8dbcbb394486bb4734e28d3b41d23fd2 \ No newline at end of file
diff --git a/db/schema_migrations/20211105010101 b/db/schema_migrations/20211105010101
deleted file mode 100644
index a7f79387e9f..00000000000
--- a/db/schema_migrations/20211105010101
+++ /dev/null
@@ -1 +0,0 @@
-26c534cdae8630e3f28ad2b61a1049aaab5c5b7a1b761f0961831b621e148ed3 \ No newline at end of file
diff --git a/db/schema_migrations/20211105125756 b/db/schema_migrations/20211105125756
deleted file mode 100644
index 842187d9ae2..00000000000
--- a/db/schema_migrations/20211105125756
+++ /dev/null
@@ -1 +0,0 @@
-13cf3d164d541df48b6d14d7cc1953113476ba8ea5975d7d0c5f84098e2e0e61 \ No newline at end of file
diff --git a/db/schema_migrations/20211105125813 b/db/schema_migrations/20211105125813
deleted file mode 100644
index 449c3d95d6a..00000000000
--- a/db/schema_migrations/20211105125813
+++ /dev/null
@@ -1 +0,0 @@
-a48f62bed7e4c4a0e69acd3b340065317aff71602e696970276a4e443f1dcabf \ No newline at end of file
diff --git a/db/schema_migrations/20211105135157 b/db/schema_migrations/20211105135157
deleted file mode 100644
index 694509bfafd..00000000000
--- a/db/schema_migrations/20211105135157
+++ /dev/null
@@ -1 +0,0 @@
-20f10ae28d439de1d07357ab7e977dae88feaaedb16770820350a9bf8242817f \ No newline at end of file
diff --git a/db/schema_migrations/20211105160316 b/db/schema_migrations/20211105160316
deleted file mode 100644
index 493dfb4afbd..00000000000
--- a/db/schema_migrations/20211105160316
+++ /dev/null
@@ -1 +0,0 @@
-afb9552a4104b10b25d65a9fec478c5c28a31ec31402400554db4288033bacb6 \ No newline at end of file
diff --git a/db/schema_migrations/20211105161404 b/db/schema_migrations/20211105161404
deleted file mode 100644
index 98b4bcdacfb..00000000000
--- a/db/schema_migrations/20211105161404
+++ /dev/null
@@ -1 +0,0 @@
-911cc21de320d0d5716ce80ebca56433b793c2072cb62da783605c99bb9aada9 \ No newline at end of file
diff --git a/db/schema_migrations/20211108154510 b/db/schema_migrations/20211108154510
deleted file mode 100644
index c978d671d29..00000000000
--- a/db/schema_migrations/20211108154510
+++ /dev/null
@@ -1 +0,0 @@
-024c123bf06b796341a22e54f4c34b967d84aeb9b2006acf5cfef96a6161c13d \ No newline at end of file
diff --git a/db/schema_migrations/20211108154841 b/db/schema_migrations/20211108154841
deleted file mode 100644
index c602a1b6c24..00000000000
--- a/db/schema_migrations/20211108154841
+++ /dev/null
@@ -1 +0,0 @@
-03842b87c4118f0e2aba1597ff08a6830b1dd5442a455e4bc9774b93b36a09b5 \ No newline at end of file
diff --git a/db/schema_migrations/20211108203248 b/db/schema_migrations/20211108203248
deleted file mode 100644
index 4f8c570b627..00000000000
--- a/db/schema_migrations/20211108203248
+++ /dev/null
@@ -1 +0,0 @@
-a2556a3d8b21e59caa6cbf7f83d621fef391904d0c13c77c0e5da713a580b4c9 \ No newline at end of file
diff --git a/db/schema_migrations/20211108204736 b/db/schema_migrations/20211108204736
deleted file mode 100644
index 6d37b1b1184..00000000000
--- a/db/schema_migrations/20211108204736
+++ /dev/null
@@ -1 +0,0 @@
-9e01b1817e4c578f5be7d7378dc12a8535c2bbbff5ecbc77f5a7cfdb148927f5 \ No newline at end of file
diff --git a/db/schema_migrations/20211108211434 b/db/schema_migrations/20211108211434
deleted file mode 100644
index 17a90668900..00000000000
--- a/db/schema_migrations/20211108211434
+++ /dev/null
@@ -1 +0,0 @@
-06cbecc52e62a48664ae486181047d8ca4d71a7991ba36bdca4bfa44257627f3 \ No newline at end of file
diff --git a/db/schema_migrations/20211109100050 b/db/schema_migrations/20211109100050
deleted file mode 100644
index 94f9612277f..00000000000
--- a/db/schema_migrations/20211109100050
+++ /dev/null
@@ -1 +0,0 @@
-86aa6ad1759a00c2cc5cb6dc2e381aead2910a24f0e37933a5e72af56d08101a \ No newline at end of file
diff --git a/db/schema_migrations/20211109101010 b/db/schema_migrations/20211109101010
deleted file mode 100644
index ea24f5e7e37..00000000000
--- a/db/schema_migrations/20211109101010
+++ /dev/null
@@ -1 +0,0 @@
-30eb98b8fdb24bc5de357b0ec14a6b92d520db025c82bd7b9448f71542c7d7e3 \ No newline at end of file
diff --git a/db/schema_migrations/20211109112454 b/db/schema_migrations/20211109112454
deleted file mode 100644
index 6fdb1e344b9..00000000000
--- a/db/schema_migrations/20211109112454
+++ /dev/null
@@ -1 +0,0 @@
-1bc48cdae55eea5a5963edd3a138d7d6859afa6caafe0b793c553fdfabe9f488 \ No newline at end of file
diff --git a/db/schema_migrations/20211110010101 b/db/schema_migrations/20211110010101
deleted file mode 100644
index bedcfdb2b3b..00000000000
--- a/db/schema_migrations/20211110010101
+++ /dev/null
@@ -1 +0,0 @@
-63495b9f9ca2d4fa121b75eea36f2923942a6e11f27bef2c51414e00ccd48973 \ No newline at end of file
diff --git a/db/schema_migrations/20211110014701 b/db/schema_migrations/20211110014701
deleted file mode 100644
index fe3721eb055..00000000000
--- a/db/schema_migrations/20211110014701
+++ /dev/null
@@ -1 +0,0 @@
-1c5f65a25c9cf81a50bd9ffa2e74e2621cff04e58a2f90b19c66741ebb459d3e \ No newline at end of file
diff --git a/db/schema_migrations/20211110015252 b/db/schema_migrations/20211110015252
deleted file mode 100644
index 06a6a5b0ad7..00000000000
--- a/db/schema_migrations/20211110015252
+++ /dev/null
@@ -1 +0,0 @@
-4038c269ce9c47ca9327fb1b81bb588e9065f0821f291d17c7965d7f8fe1f275 \ No newline at end of file
diff --git a/db/schema_migrations/20211110092710 b/db/schema_migrations/20211110092710
deleted file mode 100644
index 691194456d4..00000000000
--- a/db/schema_migrations/20211110092710
+++ /dev/null
@@ -1 +0,0 @@
-f6312d56d2ac77537383c8671d73ad202fed9bb8eddba4bdb24d19dbe821cdf3 \ No newline at end of file
diff --git a/db/schema_migrations/20211110100050 b/db/schema_migrations/20211110100050
deleted file mode 100644
index eed0afbac1c..00000000000
--- a/db/schema_migrations/20211110100050
+++ /dev/null
@@ -1 +0,0 @@
-54b83ba1f8e8aa8a23f230664bcd6cc068a2df2d669e395713f0805d0f054f9c \ No newline at end of file
diff --git a/db/schema_migrations/20211110143306 b/db/schema_migrations/20211110143306
deleted file mode 100644
index e1618c07f75..00000000000
--- a/db/schema_migrations/20211110143306
+++ /dev/null
@@ -1 +0,0 @@
-7724e5a2c52be99b1b40c449f25abdc23f279f5b0bdaebcfd897c39d295fda41 \ No newline at end of file
diff --git a/db/schema_migrations/20211110151320 b/db/schema_migrations/20211110151320
deleted file mode 100644
index 91f780811c3..00000000000
--- a/db/schema_migrations/20211110151320
+++ /dev/null
@@ -1 +0,0 @@
-dab6123f19fb44a1566a8de9c760dedec5548dd64e472a180e7748cd7c93eea9 \ No newline at end of file
diff --git a/db/schema_migrations/20211110151350 b/db/schema_migrations/20211110151350
deleted file mode 100644
index 98d590c26e9..00000000000
--- a/db/schema_migrations/20211110151350
+++ /dev/null
@@ -1 +0,0 @@
-f5e69502e582c5f30ba686f8b668d8f0ce5cf8078b0833d2eda67f5ed97ac074 \ No newline at end of file
diff --git a/db/schema_migrations/20211111112425 b/db/schema_migrations/20211111112425
deleted file mode 100644
index 5201a7d3156..00000000000
--- a/db/schema_migrations/20211111112425
+++ /dev/null
@@ -1 +0,0 @@
-0ab93a0bfd52d6c13203a0b183b2fcb9d6770334e5b1bd00a28fb623b65c428d \ No newline at end of file
diff --git a/db/schema_migrations/20211111112639 b/db/schema_migrations/20211111112639
deleted file mode 100644
index e05cba2db8a..00000000000
--- a/db/schema_migrations/20211111112639
+++ /dev/null
@@ -1 +0,0 @@
-870100261e3704522d390885b8ff13ebbcb093aa508d79b90f9738f6a0fffd10 \ No newline at end of file
diff --git a/db/schema_migrations/20211111112713 b/db/schema_migrations/20211111112713
deleted file mode 100644
index 368378c28b8..00000000000
--- a/db/schema_migrations/20211111112713
+++ /dev/null
@@ -1 +0,0 @@
-0cc2f19a8e31d9418ffd4fa1307f5210f0f2d781b957d417f06e19aca0b53985 \ No newline at end of file
diff --git a/db/schema_migrations/20211111164025 b/db/schema_migrations/20211111164025
deleted file mode 100644
index 409cc160b9e..00000000000
--- a/db/schema_migrations/20211111164025
+++ /dev/null
@@ -1 +0,0 @@
-d78fe687517e14ff67dc76eff63391e33b73d29446d2a0445595175c7cd6806a \ No newline at end of file
diff --git a/db/schema_migrations/20211111164047 b/db/schema_migrations/20211111164047
deleted file mode 100644
index 30e0875cf73..00000000000
--- a/db/schema_migrations/20211111164047
+++ /dev/null
@@ -1 +0,0 @@
-c8ed7f8c0f818156dba9c25be848da97d4eb6dbf0aa9c48f87e940f3ca0967d9 \ No newline at end of file
diff --git a/db/schema_migrations/20211112073413 b/db/schema_migrations/20211112073413
deleted file mode 100644
index 11551bb5819..00000000000
--- a/db/schema_migrations/20211112073413
+++ /dev/null
@@ -1 +0,0 @@
-8960c0a2b7e621e466fde3bde6a252119008579c058046a16d57a6f6bff42008 \ No newline at end of file
diff --git a/db/schema_migrations/20211112113300 b/db/schema_migrations/20211112113300
deleted file mode 100644
index 8074c437751..00000000000
--- a/db/schema_migrations/20211112113300
+++ /dev/null
@@ -1 +0,0 @@
-be11c0b1c7b9c99c28d44c164742815da57bfc4a32afd54df9135e3ce6edeff9 \ No newline at end of file
diff --git a/db/schema_migrations/20211112155416 b/db/schema_migrations/20211112155416
deleted file mode 100644
index 91037c578a7..00000000000
--- a/db/schema_migrations/20211112155416
+++ /dev/null
@@ -1 +0,0 @@
-0c5627518093f6261679940402cbd756a91bf4617a37eecdbbc82dc57856dcec \ No newline at end of file
diff --git a/db/schema_migrations/20211115132613 b/db/schema_migrations/20211115132613
deleted file mode 100644
index be6f19bdc70..00000000000
--- a/db/schema_migrations/20211115132613
+++ /dev/null
@@ -1 +0,0 @@
-a9cc7d1fc3317958ecda959b62b42f93b2609c4e784566f9696fef51c5ebdf3b \ No newline at end of file
diff --git a/db/schema_migrations/20211115142803 b/db/schema_migrations/20211115142803
deleted file mode 100644
index 0e9022f7c0e..00000000000
--- a/db/schema_migrations/20211115142803
+++ /dev/null
@@ -1 +0,0 @@
-52fd12693481ae7e08eb084ef679434592538d99117c1906f30ca6a36b12a212 \ No newline at end of file
diff --git a/db/schema_migrations/20211115142847 b/db/schema_migrations/20211115142847
deleted file mode 100644
index 049efcf8bcf..00000000000
--- a/db/schema_migrations/20211115142847
+++ /dev/null
@@ -1 +0,0 @@
-cded37f94d578a503e5b389e6483ec68666983f71395c13b4f0011db04e807c3 \ No newline at end of file
diff --git a/db/schema_migrations/20211115142911 b/db/schema_migrations/20211115142911
deleted file mode 100644
index 43bae5192c5..00000000000
--- a/db/schema_migrations/20211115142911
+++ /dev/null
@@ -1 +0,0 @@
-63141e62fc21cf0a4b47355ecd3814c1f0cc829b7f4851d833f95369206c8919 \ No newline at end of file
diff --git a/db/schema_migrations/20211115145107 b/db/schema_migrations/20211115145107
deleted file mode 100644
index 25270a5c587..00000000000
--- a/db/schema_migrations/20211115145107
+++ /dev/null
@@ -1 +0,0 @@
-2b6bc8067402744b79eee06022cf3c91ba7ffd519df83aae4067600a6bbf43ad \ No newline at end of file
diff --git a/db/schema_migrations/20211115151704 b/db/schema_migrations/20211115151704
deleted file mode 100644
index 03093ade126..00000000000
--- a/db/schema_migrations/20211115151704
+++ /dev/null
@@ -1 +0,0 @@
-3db18116febc760bcfeab597e0508d5b2835d0135068d79073770d343aa4b09c \ No newline at end of file
diff --git a/db/schema_migrations/20211115154103 b/db/schema_migrations/20211115154103
deleted file mode 100644
index 2b721bc7b39..00000000000
--- a/db/schema_migrations/20211115154103
+++ /dev/null
@@ -1 +0,0 @@
-ad65e6deb885397dc91f33dc117a50e9a1b6d60f4caed8c5b77d474ec0340995 \ No newline at end of file
diff --git a/db/schema_migrations/20211116091751 b/db/schema_migrations/20211116091751
deleted file mode 100644
index 8b13b53e437..00000000000
--- a/db/schema_migrations/20211116091751
+++ /dev/null
@@ -1 +0,0 @@
-d71889bba2150265e9482be0b5ee89f43168d4a35b47469a36873d65f00df878 \ No newline at end of file
diff --git a/db/schema_migrations/20211116093739 b/db/schema_migrations/20211116093739
deleted file mode 100644
index b0ded3f2a0f..00000000000
--- a/db/schema_migrations/20211116093739
+++ /dev/null
@@ -1 +0,0 @@
-39d1988fe409944877df24e9859b171eab13c4a4703c8e85a2bff33318fb61fc \ No newline at end of file
diff --git a/db/schema_migrations/20211116111644 b/db/schema_migrations/20211116111644
deleted file mode 100644
index c2bc9dbee0d..00000000000
--- a/db/schema_migrations/20211116111644
+++ /dev/null
@@ -1 +0,0 @@
-664c7fa75d3283b6e984fcca4ffcefab6dba24a78e4cc24ac86f791ab4495def \ No newline at end of file
diff --git a/db/schema_migrations/20211117084814 b/db/schema_migrations/20211117084814
deleted file mode 100644
index d24eb0a0c04..00000000000
--- a/db/schema_migrations/20211117084814
+++ /dev/null
@@ -1 +0,0 @@
-d6b0ca9d1e88e9e531ee0da5c82723309d746b6d83ea5dfb8326d3cc718a31b6 \ No newline at end of file
diff --git a/db/schema_migrations/20211117174209 b/db/schema_migrations/20211117174209
deleted file mode 100644
index f5e8cd180c2..00000000000
--- a/db/schema_migrations/20211117174209
+++ /dev/null
@@ -1 +0,0 @@
-c7c29b136fbe00271807fcd3133baf7a6e9ded40989fc274e941fc99f2c19e4d \ No newline at end of file
diff --git a/db/schema_migrations/20211118100959 b/db/schema_migrations/20211118100959
deleted file mode 100644
index e3c42353b8d..00000000000
--- a/db/schema_migrations/20211118100959
+++ /dev/null
@@ -1 +0,0 @@
-8b1bb9758150151518f16307d3f145431000b7edf946fd44e54cf7301087b002 \ No newline at end of file
diff --git a/db/schema_migrations/20211118103439 b/db/schema_migrations/20211118103439
deleted file mode 100644
index 5b5891c3b16..00000000000
--- a/db/schema_migrations/20211118103439
+++ /dev/null
@@ -1 +0,0 @@
-721f1ada9fe5a3d7e5da3750a43d5021a85a26e8adc4d649e7f0fff8cdf68344 \ No newline at end of file
diff --git a/db/schema_migrations/20211118114228 b/db/schema_migrations/20211118114228
deleted file mode 100644
index 82c7984750d..00000000000
--- a/db/schema_migrations/20211118114228
+++ /dev/null
@@ -1 +0,0 @@
-7686fd3e33b25b811aba459aba514cde8e88102277edb3be7e12378cb7e8de85 \ No newline at end of file
diff --git a/db/schema_migrations/20211118124537 b/db/schema_migrations/20211118124537
deleted file mode 100644
index 537c3aa88fa..00000000000
--- a/db/schema_migrations/20211118124537
+++ /dev/null
@@ -1 +0,0 @@
-d9a0886d95cd54add9e63475a2f1ca0601304bb64ffe6e6d9e62cb8997d5fe40 \ No newline at end of file
diff --git a/db/schema_migrations/20211118124628 b/db/schema_migrations/20211118124628
deleted file mode 100644
index e6364327ca4..00000000000
--- a/db/schema_migrations/20211118124628
+++ /dev/null
@@ -1 +0,0 @@
-f25ee0df287f1c44740be143831537bf262d09d7068ceca1c516ee964bc3aa24 \ No newline at end of file
diff --git a/db/schema_migrations/20211118124650 b/db/schema_migrations/20211118124650
deleted file mode 100644
index 739cfeb80b3..00000000000
--- a/db/schema_migrations/20211118124650
+++ /dev/null
@@ -1 +0,0 @@
-e032fd334d175d803b943c6328048705e81bd70af6ac226a032281304840f1cd \ No newline at end of file
diff --git a/db/schema_migrations/20211118130836 b/db/schema_migrations/20211118130836
deleted file mode 100644
index df16d8c5c5e..00000000000
--- a/db/schema_migrations/20211118130836
+++ /dev/null
@@ -1 +0,0 @@
-2630b21c7134ac539a18798f2f2b99f468e171b79e30a184f7e8cdaccd11d465 \ No newline at end of file
diff --git a/db/schema_migrations/20211118194239 b/db/schema_migrations/20211118194239
deleted file mode 100644
index ce3c1eb83d1..00000000000
--- a/db/schema_migrations/20211118194239
+++ /dev/null
@@ -1 +0,0 @@
-04a4b10085bae2006ac78600b3cc410d130f9ac6944103c7bd85f71e060d4a67 \ No newline at end of file
diff --git a/db/schema_migrations/20211119085015 b/db/schema_migrations/20211119085015
deleted file mode 100644
index 874bd158e7c..00000000000
--- a/db/schema_migrations/20211119085015
+++ /dev/null
@@ -1 +0,0 @@
-88b289d724f98f75e0340cde4c6e2bc3cb55df2a979934fb2bc544d22e4c032d \ No newline at end of file
diff --git a/db/schema_migrations/20211119085036 b/db/schema_migrations/20211119085036
deleted file mode 100644
index f9d1eeffbcb..00000000000
--- a/db/schema_migrations/20211119085036
+++ /dev/null
@@ -1 +0,0 @@
-2b2c28e0370ae1bb84bee5ff769c9b313902d1f1afc50fa54e23a1627b1121f3 \ No newline at end of file
diff --git a/db/schema_migrations/20211119111006 b/db/schema_migrations/20211119111006
deleted file mode 100644
index ebb8e460452..00000000000
--- a/db/schema_migrations/20211119111006
+++ /dev/null
@@ -1 +0,0 @@
-d618c28360f7716807e9727566019e269963d85164cf2f306ec9692d3b037802 \ No newline at end of file
diff --git a/db/schema_migrations/20211119154221 b/db/schema_migrations/20211119154221
deleted file mode 100644
index c8b6005b48b..00000000000
--- a/db/schema_migrations/20211119154221
+++ /dev/null
@@ -1 +0,0 @@
-020e17ffd6851fb861a17c1b120ca7cdfa300434d4a9ec923a4edcaa7f951b31 \ No newline at end of file
diff --git a/db/schema_migrations/20211119170805 b/db/schema_migrations/20211119170805
deleted file mode 100644
index fffb02d4285..00000000000
--- a/db/schema_migrations/20211119170805
+++ /dev/null
@@ -1 +0,0 @@
-adb95bc78104382fb1d3af2c2775b4b5bd23394b4260c3a97667b4bd7917e0da \ No newline at end of file
diff --git a/db/schema_migrations/20211119194024 b/db/schema_migrations/20211119194024
deleted file mode 100644
index 0d90b09e732..00000000000
--- a/db/schema_migrations/20211119194024
+++ /dev/null
@@ -1 +0,0 @@
-ac2e376ad32f0e2fd45d8695f13a0b46c2d5964b881f79e3a30a51ac85d4359b \ No newline at end of file
diff --git a/db/schema_migrations/20211119195201 b/db/schema_migrations/20211119195201
deleted file mode 100644
index dd7f7b83d8d..00000000000
--- a/db/schema_migrations/20211119195201
+++ /dev/null
@@ -1 +0,0 @@
-caaf92f12bf0ed144d99f629c9e5d64fd45832a90bbd743e40febcdc4802cd59 \ No newline at end of file
diff --git a/db/schema_migrations/20211122033501 b/db/schema_migrations/20211122033501
deleted file mode 100644
index 08673370b57..00000000000
--- a/db/schema_migrations/20211122033501
+++ /dev/null
@@ -1 +0,0 @@
-e010b4c12ae8203d9ea8a4c2035be5e7165aba0030f4d5fd0b0f978f84748707 \ No newline at end of file
diff --git a/db/schema_migrations/20211122103051 b/db/schema_migrations/20211122103051
deleted file mode 100644
index eacca224329..00000000000
--- a/db/schema_migrations/20211122103051
+++ /dev/null
@@ -1 +0,0 @@
-674a44e70291d6ed04318a5f6b639d216f2c26c43d15cb00e59b06cc6f6cc401 \ No newline at end of file
diff --git a/db/schema_migrations/20211122193948 b/db/schema_migrations/20211122193948
deleted file mode 100644
index 94dbab4cd73..00000000000
--- a/db/schema_migrations/20211122193948
+++ /dev/null
@@ -1 +0,0 @@
-12203afb7b66a12946d971dd601d2ce91e1408fcdf36d9d8b2fadcf09d7c1e56 \ No newline at end of file
diff --git a/db/schema_migrations/20211122215001 b/db/schema_migrations/20211122215001
deleted file mode 100644
index be0fd652eb7..00000000000
--- a/db/schema_migrations/20211122215001
+++ /dev/null
@@ -1 +0,0 @@
-fc29e10717357f7dd57940042d69a6c43a0d17fdf3c951917a76eae8c1d93ba3 \ No newline at end of file
diff --git a/db/schema_migrations/20211123135255 b/db/schema_migrations/20211123135255
deleted file mode 100644
index e151abb0e33..00000000000
--- a/db/schema_migrations/20211123135255
+++ /dev/null
@@ -1 +0,0 @@
-cf6b9bb5711b6a097e399e79fdabe01a237581d99de7fed3c2b69c65ffd23a06 \ No newline at end of file
diff --git a/db/schema_migrations/20211123161906 b/db/schema_migrations/20211123161906
deleted file mode 100644
index 1370811b3af..00000000000
--- a/db/schema_migrations/20211123161906
+++ /dev/null
@@ -1 +0,0 @@
-46767d804bde08ad4a076f20436652f980eb935a79b2ad30b4735b956be69a7a \ No newline at end of file
diff --git a/db/schema_migrations/20211123181236 b/db/schema_migrations/20211123181236
deleted file mode 100644
index 25f00af5d72..00000000000
--- a/db/schema_migrations/20211123181236
+++ /dev/null
@@ -1 +0,0 @@
-ac21109099642d5934c16b3f0130736a587c4f20143552545c2b524062ff71e0 \ No newline at end of file
diff --git a/db/schema_migrations/20211123182614 b/db/schema_migrations/20211123182614
deleted file mode 100644
index 8b67ec7cd26..00000000000
--- a/db/schema_migrations/20211123182614
+++ /dev/null
@@ -1 +0,0 @@
-9a3ba69a1df02059b240393cc381c4a5ba9db0f116818aa9f3d4f1009f055b09 \ No newline at end of file
diff --git a/db/schema_migrations/20211124095704 b/db/schema_migrations/20211124095704
deleted file mode 100644
index db18301ecd9..00000000000
--- a/db/schema_migrations/20211124095704
+++ /dev/null
@@ -1 +0,0 @@
-1f5ed9e7af3f56d0e11d1a2bb78a7430ce05af49c8102d1c75c8ff84ae4e1c6d \ No newline at end of file
diff --git a/db/schema_migrations/20211124132319 b/db/schema_migrations/20211124132319
deleted file mode 100644
index 1809d13a553..00000000000
--- a/db/schema_migrations/20211124132319
+++ /dev/null
@@ -1 +0,0 @@
-cdb85c8633687338a11ebce0603f82f5cab00e7c58f923d30b68a877b94e2db2 \ No newline at end of file
diff --git a/db/schema_migrations/20211124132705 b/db/schema_migrations/20211124132705
deleted file mode 100644
index 12e3f08365b..00000000000
--- a/db/schema_migrations/20211124132705
+++ /dev/null
@@ -1 +0,0 @@
-4eacad00017890c71f3354d80061fae7af40499256475cdf035bdf41b916e5f3 \ No newline at end of file
diff --git a/db/schema_migrations/20211125120444 b/db/schema_migrations/20211125120444
deleted file mode 100644
index 8dca57e74ef..00000000000
--- a/db/schema_migrations/20211125120444
+++ /dev/null
@@ -1 +0,0 @@
-19062282d022e5d93cd525cff44c67f1fbc5557f1201e523a57725dc0b6ecd70 \ No newline at end of file
diff --git a/db/schema_migrations/20211126042235 b/db/schema_migrations/20211126042235
deleted file mode 100644
index 8c34dd173a9..00000000000
--- a/db/schema_migrations/20211126042235
+++ /dev/null
@@ -1 +0,0 @@
-c6992d23fc43c26861accf7c516603802c95367460ad688d1a420a60a33833f1 \ No newline at end of file
diff --git a/db/schema_migrations/20211126113029 b/db/schema_migrations/20211126113029
deleted file mode 100644
index aaf1a421982..00000000000
--- a/db/schema_migrations/20211126113029
+++ /dev/null
@@ -1 +0,0 @@
-96abde258e6527a2b09bb60e1cc0cb90802c8a7e43a2132e9956536390a8aab8 \ No newline at end of file
diff --git a/db/schema_migrations/20211126115449 b/db/schema_migrations/20211126115449
deleted file mode 100644
index 693dfb46149..00000000000
--- a/db/schema_migrations/20211126115449
+++ /dev/null
@@ -1 +0,0 @@
-2e6e432ecf7b2c885905fd4df6b57fa99b324f56cb0850d9fc792b4a9b363423 \ No newline at end of file
diff --git a/db/schema_migrations/20211126142200 b/db/schema_migrations/20211126142200
deleted file mode 100644
index 136addef509..00000000000
--- a/db/schema_migrations/20211126142200
+++ /dev/null
@@ -1 +0,0 @@
-a00ce6a11c7671b6d2efe47e3859afaec72c437fdf5383b990ee09cf14081c9b \ No newline at end of file
diff --git a/db/schema_migrations/20211126142354 b/db/schema_migrations/20211126142354
deleted file mode 100644
index fc84b266263..00000000000
--- a/db/schema_migrations/20211126142354
+++ /dev/null
@@ -1 +0,0 @@
-31d5fa3caff916a485f26b6834e37037455068cdcf502802196bf1d663716f49 \ No newline at end of file
diff --git a/db/schema_migrations/20211126204445 b/db/schema_migrations/20211126204445
deleted file mode 100644
index b130d90b8ec..00000000000
--- a/db/schema_migrations/20211126204445
+++ /dev/null
@@ -1 +0,0 @@
-e31592bbeb6ba6175f19cfceaafb37672633028dd021052542909999b46eac38 \ No newline at end of file
diff --git a/db/schema_migrations/20211129151155 b/db/schema_migrations/20211129151155
deleted file mode 100644
index 4aa3e56bae6..00000000000
--- a/db/schema_migrations/20211129151155
+++ /dev/null
@@ -1 +0,0 @@
-c1ba97f01fca6330628090010abb54220c0d057514386c6bb867c1b6f13f252c \ No newline at end of file
diff --git a/db/schema_migrations/20211129151832 b/db/schema_migrations/20211129151832
deleted file mode 100644
index fdfc464d136..00000000000
--- a/db/schema_migrations/20211129151832
+++ /dev/null
@@ -1 +0,0 @@
-c6d257f635049f88cd6efba903c9384a0a1af23b3c8fe6fa7f0842dcdf9f7e39 \ No newline at end of file
diff --git a/db/schema_migrations/20211130151724 b/db/schema_migrations/20211130151724
deleted file mode 100644
index 090d49ca482..00000000000
--- a/db/schema_migrations/20211130151724
+++ /dev/null
@@ -1 +0,0 @@
-f9bd521c92558ba9ad3cfa3fd6ff1a647847c0fc767e1e4f45b43422542d5cc7 \ No newline at end of file
diff --git a/db/schema_migrations/20211130165043 b/db/schema_migrations/20211130165043
deleted file mode 100644
index 3d4f7b52a69..00000000000
--- a/db/schema_migrations/20211130165043
+++ /dev/null
@@ -1 +0,0 @@
-2eece823b66fec7f5a9a5c24b93d354a47939a7cdd915349a433b7bbec6abc22 \ No newline at end of file
diff --git a/db/schema_migrations/20211130201100 b/db/schema_migrations/20211130201100
deleted file mode 100644
index 80c2d68671b..00000000000
--- a/db/schema_migrations/20211130201100
+++ /dev/null
@@ -1 +0,0 @@
-cc0146769929c9fbb0b7b6788826d2e188c8664a14e1015563ba4f9e65397c4e \ No newline at end of file
diff --git a/db/schema_migrations/20211130201101 b/db/schema_migrations/20211130201101
deleted file mode 100644
index ef1178c10c5..00000000000
--- a/db/schema_migrations/20211130201101
+++ /dev/null
@@ -1 +0,0 @@
-b0215ac45031593ca98de4f8858d21f1c29af03742a422bffd83598e39a6871c \ No newline at end of file
diff --git a/db/schema_migrations/20211130205719 b/db/schema_migrations/20211130205719
deleted file mode 100644
index aae23faabc9..00000000000
--- a/db/schema_migrations/20211130205719
+++ /dev/null
@@ -1 +0,0 @@
-567a80916756adcca93bdbe82d69a923e539aac74146e714b58a1b023134d2c9 \ No newline at end of file
diff --git a/db/schema_migrations/20211201061733 b/db/schema_migrations/20211201061733
deleted file mode 100644
index 722e7dd828c..00000000000
--- a/db/schema_migrations/20211201061733
+++ /dev/null
@@ -1 +0,0 @@
-c5282e48f31c0896a3ce21fe238eb602dc006b0bfe62aa4f12ee39bbd620c76c \ No newline at end of file
diff --git a/db/schema_migrations/20211201101541 b/db/schema_migrations/20211201101541
deleted file mode 100644
index 52f43ddcd2f..00000000000
--- a/db/schema_migrations/20211201101541
+++ /dev/null
@@ -1 +0,0 @@
-277cfcd1002e32c6cd664d6c0b6a7cbdf2ed7e5242e46dbddc4f99b0e8422361 \ No newline at end of file
diff --git a/db/schema_migrations/20211201143042 b/db/schema_migrations/20211201143042
deleted file mode 100644
index a5f0c8be842..00000000000
--- a/db/schema_migrations/20211201143042
+++ /dev/null
@@ -1 +0,0 @@
-0d27ca1250d10b8915fa4523707044f9a8c2372110537f5639a1811aeb0858b8 \ No newline at end of file
diff --git a/db/schema_migrations/20230316095948 b/db/schema_migrations/20230316095948
new file mode 100644
index 00000000000..c2c829f1d20
--- /dev/null
+++ b/db/schema_migrations/20230316095948
@@ -0,0 +1 @@
+4db14f0a961e98597fd2f4fc75e05309bfbda3b8cf83c1296c937be24207595e \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 682169aff3a..2982be22aa7 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -22270,6 +22270,19 @@ CREATE TABLE serverless_domain_cluster (
certificate text
);
+CREATE TABLE service_desk_custom_email_credentials (
+ project_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ smtp_port integer,
+ smtp_address text,
+ encrypted_smtp_username bytea,
+ encrypted_smtp_username_iv bytea,
+ encrypted_smtp_password bytea,
+ encrypted_smtp_password_iv bytea,
+ CONSTRAINT check_6dd11e956a CHECK ((char_length(smtp_address) <= 255))
+);
+
CREATE TABLE service_desk_custom_email_verifications (
project_id bigint NOT NULL,
triggerer_id bigint,
@@ -27734,6 +27747,9 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid);
+ALTER TABLE ONLY service_desk_custom_email_credentials
+ ADD CONSTRAINT service_desk_custom_email_credentials_pkey PRIMARY KEY (project_id);
+
ALTER TABLE ONLY service_desk_custom_email_verifications
ADD CONSTRAINT service_desk_custom_email_verifications_pkey PRIMARY KEY (project_id);
@@ -36075,6 +36091,9 @@ ALTER TABLE ONLY boards_epic_boards
ALTER TABLE ONLY ci_runner_namespaces
ADD CONSTRAINT fk_rails_8767676b7a FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE;
+ALTER TABLE ONLY service_desk_custom_email_credentials
+ ADD CONSTRAINT fk_rails_878b562d12 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY software_license_policies
ADD CONSTRAINT fk_rails_87b2247ce5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
diff --git a/doc/development/pipelines/index.md b/doc/development/pipelines/index.md
index b56259dbdaf..9fcbe8c55e4 100644
--- a/doc/development/pipelines/index.md
+++ b/doc/development/pipelines/index.md
@@ -150,8 +150,8 @@ This number can be overridden by setting a CI/CD variable named `RSPEC_FAIL_FAST
## Re-run previously failed tests in merge request pipelines
-In order to reduce the feedback time after resolving failed tests for a merge request, the `rspec rspec-pg12-rerun-previous-failed-tests`
-and `rspec rspec-ee-pg12-rerun-previous-failed-tests` jobs run the failed tests from the previous MR pipeline.
+In order to reduce the feedback time after resolving failed tests for a merge request, the `rspec rspec-pg13-rerun-previous-failed-tests`
+and `rspec rspec-ee-pg13-rerun-previous-failed-tests` jobs run the failed tests from the previous MR pipeline.
This was introduced on August 25th 2021, with <https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69053>.
@@ -159,7 +159,7 @@ This was introduced on August 25th 2021, with <https://gitlab.com/gitlab-org/git
1. The `detect-previous-failed-tests` job (`prepare` stage) detects the test files associated with failed RSpec
jobs from the previous MR pipeline.
-1. The `rspec rspec-pg12-rerun-previous-failed-tests` and `rspec rspec-ee-pg12-rerun-previous-failed-tests` jobs
+1. The `rspec rspec-pg13-rerun-previous-failed-tests` and `rspec rspec-ee-pg13-rerun-previous-failed-tests` jobs
will run the test files gathered by the `detect-previous-failed-tests` job.
```mermaid
@@ -169,8 +169,8 @@ graph LR
end
subgraph "test stage";
- B["rspec rspec-pg12-rerun-previous-failed-tests"];
- C["rspec rspec-ee-pg12-rerun-previous-failed-tests"];
+ B["rspec rspec-pg13-rerun-previous-failed-tests"];
+ C["rspec rspec-ee-pg13-rerun-previous-failed-tests"];
end
A --"artifact: list of test files"--> B & C
@@ -483,20 +483,22 @@ This should let us:
### PostgreSQL versions testing
-Our test suite runs against PG12 as GitLab.com runs on PG12 and
-[Omnibus defaults to PG12 for new installs and upgrades](../../administration/package_information/postgresql_versions.md).
+Our test suite runs against PG13 as GitLab.com runs on PG13 and
+[Omnibus defaults to PG13 for new installs and upgrades](../../administration/package_information/postgresql_versions.md).
We do run our test suite against PG13 on nightly scheduled pipelines.
+We also run our test suite against PG13 upon specific database library changes in MRs and `main` pipelines (with the `rspec db-library-code pg13` job).
+
#### Current versions testing
-| Where? | PostgreSQL version | Ruby version |
-|------------------------------------------------------------------------------------------------|--------------------------|-----------------------|
-| Merge requests | 12 (default version) | 3.0 (default version) |
-| `master` branch commits | 12 (default version) | 3.0 (default version) |
-| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour) | 12 (default version) | 3.0 (default version) |
-| `maintenance` scheduled pipelines for the `ruby2` branch (every odd-numbered hour), see below. | 12 (default version) | 2.7 |
-| `nightly` scheduled pipelines for the `master` branch | 12 (default version), 13 | 3.0 (default version) |
+| Where? | PostgreSQL version | Ruby version |
+|------------------------------------------------------------------------------------------------|-------------------------------------------------|-----------------------|
+| Merge requests | 13 (default version), 12 for DB library changes | 3.0 (default version) |
+| `master` branch commits | 13 (default version), 12 for DB library changes | 3.0 (default version) |
+| `maintenance` scheduled pipelines for the `master` branch (every even-numbered hour) | 13 (default version), 12 for DB library changes | 3.0 (default version) |
+| `maintenance` scheduled pipelines for the `ruby2` branch (every odd-numbered hour), see below. | 13 (default version), 12 for DB library changes | 2.7 |
+| `nightly` scheduled pipelines for the `master` branch | 13 (default version), 12, 14 | 3.0 (default version) |
There are 2 pipeline schedules used for testing Ruby 2.7. One is triggering a
pipeline in `ruby2-sync` branch, which updates the `ruby2` branch with latest
@@ -511,15 +513,6 @@ The `gitlab` job in the `ruby2-sync` branch uses a `gitlab-org/gitlab` project
token with `write_repository` scope and `Maintainer` role with no expiration.
The token is stored in the `RUBY2_SYNC_TOKEN` variable in `gitlab-org/gitlab`.
-#### Long-term plan
-
-We follow the [PostgreSQL versions shipped with Omnibus GitLab](../../administration/package_information/postgresql_versions.md):
-
-| PostgreSQL version | 14.1 (July 2021) | 14.2 (August 2021) | 14.3 (September 2021) | 14.4 (October 2021) | 14.5 (November 2021) | 14.6 (December 2021) |
-| -------------------| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
-| PG12 | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` | MRs/`2-hour`/`nightly` |
-| PG13 | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` | `nightly` |
-
### Redis versions testing
Our test suite runs against Redis 6 as GitLab.com runs on Redis 6 and
diff --git a/doc/development/pipelines/internals.md b/doc/development/pipelines/internals.md
index bd96f2f2872..81b95eb204f 100644
--- a/doc/development/pipelines/internals.md
+++ b/doc/development/pipelines/internals.md
@@ -136,10 +136,10 @@ that are scoped to a single [configuration keyword](../../ci/yaml/index.md#job-k
| `.qa-cache` | Allows a job to use a default `cache` definition suitable for QA tasks. |
| `.yarn-cache` | Allows a job to use a default `cache` definition suitable for frontend jobs that do a `yarn install`. |
| `.assets-compile-cache` | Allows a job to use a default `cache` definition suitable for frontend jobs that compile assets. |
-| `.use-pg12` | Allows a job to use the `postgres` 12 and `redis` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). |
-| `.use-pg12-ee` | Same as `.use-pg12` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). |
| `.use-pg13` | Allows a job to use the `postgres` 13 and `redis` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). |
| `.use-pg13-ee` | Same as `.use-pg13` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). |
+| `.use-pg14` | Allows a job to use the `postgres` 14 and `redis` services (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific versions of the services). |
+| `.use-pg14-ee` | Same as `.use-pg14` but also use an `elasticsearch` service (see [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/ci/global.gitlab-ci.yml) for the specific version of the service). |
| `.use-kaniko` | Allows a job to use the `kaniko` tool to build Docker images. |
| `.as-if-foss` | Simulate the FOSS project by setting the `FOSS_ONLY='1'` CI/CD variable. |
| `.use-docker-in-docker` | Allows a job to use Docker in Docker. |
diff --git a/doc/development/project_templates.md b/doc/development/project_templates.md
index 31537b21527..cc53ef77c62 100644
--- a/doc/development/project_templates.md
+++ b/doc/development/project_templates.md
@@ -8,110 +8,63 @@ info: "To determine the technical writer assigned to the Stage/Group associated
## Adding a new built-in project template
-This page provides instructions about how to contribute a
-[built-in project template](../user/project/index.md#create-a-project-from-a-built-in-template).
-
-To contribute a built-in project template, you must complete the following tasks:
-
-1. [Create a project template for GitLab review](#create-a-project-template-for-review)
-1. [Add the template SVG icon to GitLab SVGs](#add-the-template-svg-icon-to-gitlab-svgs)
-1. [Create a merge request with vendor details](#create-a-merge-request-with-vendor-details)
-
-You can contribute the following types of project templates:
-
-- Enterprise: For users with GitLab Premium and above.
-- Non-enterprise: For users with GitLab Free and above.
-
-### Prerequisites
-
-To add or update an existing template, you must have the following tools
-installed:
-
-- `wget`
-- `tar`
-
-### Create a project template for review
-
-1. In your selected namespace, create a public project.
-1. Add the project content you want to use in the template. Do not include unnecessary assets or dependencies. For an example,
-[see this project](https://gitlab.com/gitlab-org/project-templates/dotnetcore).
-1. When the project is ready for review, [create an issue](https://gitlab.com/gitlab-org/gitlab/-/issues) with a link to your project.
- In your issue, mention the Create:Source Code [Backend Engineering Manager and Product Manager](https://about.gitlab.com/handbook/product/categories/#source-code-group)
- for the Templates feature.
-
-### Add the template SVG icon to GitLab SVGs
-
-If the project template has an SVG icon, you must add it to the
-[GitLab SVGs project](https://gitlab.com/gitlab-org/gitlab-svgs/-/blob/main/README.md#adding-icons-or-illustrations)
-before you can create a merge request with vendor details.
-
-### Create a merge request with vendor details
-
-Before GitLab can implement the project template, you must [create a merge request](../user/project/merge_requests/creating_merge_requests.md) in [`gitlab-org/gitlab`](https://gitlab.com/gitlab-org/gitlab) that includes vendor details about the project.
-
-1. [Export the project](../user/project/settings/import_export.md#export-a-project-and-its-data)
- and save the file as `<name>.tar.gz`, where `<name>` is the short name of the project.
- Move this file to the root directory of `gitlab-org/gitlab`.
-1. In `gitlab-org/gitlab`, create and check out a new branch.
-1. Edit the following files to include the project template:
- - For **non-Enterprise** project templates:
- - In `lib/gitlab/project_template.rb`, add details about the template
- in the `localized_templates_table` method. In the following example,
- the short name of the project is `hugo`:
-
- ```ruby
- ProjectTemplate.new('hugo', 'Pages/Hugo', _('Everything you need to create a GitLab Pages site using Hugo'), 'https://gitlab.com/pages/hugo', 'illustrations/logos/hugo.svg'),
- ```
-
- If the project doesn't have an SVG icon, exclude `, 'illustrations/logos/hugo.svg'`.
-
- - In `spec/support/helpers/project_template_test_helper.rb`, append the short name
- of the template in the `all_templates` method.
- - In `app/assets/javascripts/projects/default_project_templates.js`,
- add details of the template. For example:
-
- ```javascript
- hugo: {
- text: s__('ProjectTemplates|Pages/Hugo'),
- icon: '.template-option .icon-hugo',
- },
- ```
-
- If the project doesn't have an SVG icon, use `.icon-gitlab_logo`
- instead.
- - For **Enterprise** project templates:
- - In `ee/lib/ee/gitlab/project_template.rb`, in the `localized_ee_templates_table` method, add details about the template. For example:
-
- ```ruby
- ::Gitlab::ProjectTemplate.new('hipaa_audit_protocol', 'HIPAA Audit Protocol', _('A project containing issues for each audit inquiry in the HIPAA Audit Protocol published by the U.S. Department of Health & Human Services'), 'https://gitlab.com/gitlab-org/project-templates/hipaa-audit-protocol', 'illustrations/logos/asklepian.svg')
- ```
-
- - In `ee/spec/lib/gitlab/project_template_spec.rb`, add the short name
- of the template in the `.all` test.
- - In `ee/app/assets/javascripts/projects/default_project_templates.js`,
- add the template details. For example:
-
- ```javascript
- hipaa_audit_protocol: {
- text: s__('ProjectTemplates|HIPAA Audit Protocol'),
- icon: '.template-option .icon-hipaa_audit_protocol',
- },
- ```
-
-1. Run the following Rake task, where `<path>/<name>` is the
- name you gave the template in `lib/gitlab/project_template.rb`:
+If you'd like to contribute a new built-in project template to be distributed with GitLab, please do the following:
+
+1. Create a new public project with the project content you'd like to contribute in a namespace of your choosing. You can view a working example [here](https://gitlab.com/gitlab-org/project-templates/dotnetcore).
+ - Projects should be as simple as possible and free of any unnecessary assets or dependencies.
+1. When the project is ready for review, please create a new issue in [GitLab](https://gitlab.com/gitlab-org/gitlab/issues) with a link to your project.
+ - In your issue, `@` mention the relevant Backend Engineering Manager and Product Manager for the [Create:Source Code group](https://about.gitlab.com/handbook/product/categories/#source-code-group).
+
+To make the project template available when creating a new project, the vendoring process will have to be completed:
+
+1. Create a working template ([example](https://gitlab.com/gitlab-org/project-templates/dotnetcore))
+ - 2 types of built-in templates are available within GitLab:
+ - **Normal templates**: Available in GitLab Core, Starter and above (this is the most common type of built-in template).
+ - To contribute a normal template:
+ - Add details of the template in the `localized_templates_table` method in `gitlab/lib/gitlab/project_template.rb`,
+ - Add details of the template in `spec/lib/gitlab/project_template_spec.rb`, in the test for the `all` method, and
+ - Add details of the template in `gitlab/app/assets/javascripts/projects/default_project_templates.js`.
+ - See MR [!25318](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25318) for an example
+ - **Enterprise templates**: Introduced in GitLab 12.10, that are available only in GitLab Gold & Ultimate.
+ - To contribute an Enterprise template:
+ - Add details of the template in the `localized_ee_templates_table` method in `gitlab/ee/lib/ee/gitlab/project_template.rb`,
+ - Add details of the template in `gitlab/ee/spec/lib/gitlab/project_template_spec.rb`, in the `enterprise_templates` method, and
+ - Add details of the template in `gitlab/ee/app/assets/javascripts/projects/default_project_templates.js`.
+ - See MR [!28187](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28187) for an example.
+
+1. Run the following in the `gitlab` project, where `$name` is the name you gave the template in `gitlab/project_template.rb`:
```shell
- bin/rake gitlab:update_project_templates\[<path>/<name>\]
+ bin/rake gitlab:update_project_templates[$name]
```
-1. Regenerate `gitlab.pot`:
-
- ```shell
- bin/rake gettext:regenerate
- ```
-
-1. After you run the scripts, there is one new file in `vendor/project_templates/` and four changed files. Commit all changes and push your branch to update the merge request. For an example, see this [merge request](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25318).
+1. Run the `bundle_repo` script. Make sure to pass the correct arguments, or the script may damage the folder structure.
+1. Add exported project (`$name.tar.gz`) to `gitlab/vendor/project_templates` and remove the resulting build folders `tar-base` and `project`.
+1. Run `bin/rake gettext:regenerate` in the `gitlab` project and commit new `.pot` file.
+1. Add a changelog entry in the commit message (for example, `Changelog: added`).
+ For more information, see [Changelog entries](changelog.md).
+1. Add an icon to [`gitlab-svgs`](https://gitlab.com/gitlab-org/gitlab-svgs), as shown in
+ [this example](https://gitlab.com/gitlab-org/gitlab-svgs/merge_requests/195). If a logo
+ is not available for the project, use the default 'Tanuki' logo instead.
+1. Run `yarn run svgs` on `gitlab-svgs` project and commit result.
+1. Forward changes in `gitlab-svgs` project to master. This involves:
+ - Merging your MR in `gitlab-svgs`
+ - [The bot](https://gitlab.com/gitlab-org/frontend/renovate-gitlab-bot/)
+ will pick the new release up and create an MR in `gitlab-org/gitlab`.
+1. Once the bot-created MR created above is merged, you can rebase your template MR onto the updated `master` to pick up the new svgs.
+1. Test everything is working.
+
+### Contributing an improvement to an existing template
+
+Existing templates are available in the [project-templates](https://gitlab.com/gitlab-org/project-templates)
+group.
+
+To contribute a change, please open a merge request in the relevant project
+and mention `@gitlab-org/manage/import/backend` when you are ready for a review.
+
+Then, if your merge request gets accepted, either open an issue on
+`gitlab` to ask for it to get updated, or open a merge request updating
+the vendored template using [these instructions](rake_tasks.md#update-project-templates).
### Test your built-in project with the GitLab Development Kit
@@ -124,17 +77,6 @@ Complete the following steps to test the project template in your own GitLab Dev
bin/rake gitlab:update_project_templates\[<path>/<name>\]
```
-## Contribute an improvement to an existing template
-
-To update an existing built-in project template, changes are usually made to the existing template, found in the [project-templates](https://gitlab.com/gitlab-org/project-templates) group. A merge request is made directly against the template and the Create:Source Code [Backend Engineering Manager and Product Manager](https://about.gitlab.com/handbook/product/categories/#source-code-group) pinged for review.
-
-Sometimes it is necessary to completely replace the template files. In this case the process would be:
-
-1. Create a merge request in the relevant project of the `project-templates` and `pages` group and mention `@gitlab-org/manage/import/backend` when you are ready for a review.
-1. If your merge request is accepted, either:
- - [Create an issue](https://gitlab.com/gitlab-org/gitlab/-/issues) to ask for the template to get updated.
- - [Create a merge request with vendor details](#create-a-merge-request-with-vendor-details) to update the template.
-
## For GitLab team members
Please ensure the merge request has been reviewed by the Security Counterpart before merging.
diff --git a/doc/development/sec/security_report_ingestion_overview.md b/doc/development/sec/security_report_ingestion_overview.md
index 688986e0eb1..f2b4f100c8b 100644
--- a/doc/development/sec/security_report_ingestion_overview.md
+++ b/doc/development/sec/security_report_ingestion_overview.md
@@ -28,9 +28,10 @@ Assumptions:
1. GitLab CI runs a new pipeline for that branch.
1. Pipeline status transitions to any of [`::Ci::Pipeline.completed_statuses`](https://gitlab.com/gitlab-org/gitlab/-/blob/354261b2fe4fc5b86d1408467beadd90e466ce0a/app/models/concerns/ci/has_status.rb#L12).
1. `Security::StoreScansWorker` is called and it schedules `Security::StoreScansService`.
-1. `Security::StoreScansService` calls `Security::StoreGroupedScansService`.
+1. `Security::StoreScansService` calls `Security::StoreGroupedScansService` and schedules `ScanSecurityReportSecretsWorker`.
1. `Security::StoreGroupedScansService` calls `Security::StoreScanService`.
1. `Security::StoreScanService` calls `Security::StoreFindingsService`.
+1. `ScanSecurityReportSecretsWorker` calls `Security::TokenRevocationService` to revoke any leaked keys.
1. At this point we have `Security::Finding` objects **only**.
At this point, the following things can happen to the `Security::Finding`:
@@ -41,8 +42,8 @@ At this point, the following things can happen to the `Security::Finding`:
If the pipeline ran on the default branch then the following, additional steps are done:
-1. `Security::StoreScansService` gets called and schedules `Security::StoreSecurityReportsWorker`.
-1. `Security::StoreSecurityReportsWorker` executes `Security::Ingestion::IngestReportsService`.
+1. `Security::StoreScansService` gets called and schedules `StoreSecurityReportsWorker`.
+1. `StoreSecurityReportsWorker` executes `Security::Ingestion::IngestReportsService`.
1. `Security::Ingestion::IngestReportsService` takes all reports from a given Pipeline and calls `Security::Ingestion::IngestReportService` and then calls `Security::Ingestion::MarkAsResolvedService`.
1. `Security::Ingestion::IngestReportService` calls `Security::Ingestion::IngestReportSliceService` which executes a number of tasks for a report slice.
diff --git a/doc/development/testing_guide/end_to_end/running_tests_that_require_special_setup.md b/doc/development/testing_guide/end_to_end/running_tests_that_require_special_setup.md
index 0d6d7a161c7..bf4d750423d 100644
--- a/doc/development/testing_guide/end_to_end/running_tests_that_require_special_setup.md
+++ b/doc/development/testing_guide/end_to_end/running_tests_that_require_special_setup.md
@@ -428,6 +428,8 @@ For instructions on how to run these tests using the `gitlab-qa` gem, please ref
Tests that are tagged with `:mobile` can be run against specified mobile devices using cloud emulator/simulator services.
+These tests run in the [nightly pipeline](https://gitlab.com/gitlab-org/quality/nightly/-/pipelines) in the `ce:remote_mobile_safari` job.
+
### How to run mobile tests with Sauce Labs
Running directly against an environment like staging is not recommended because Sauce Labs test logs expose credentials. Therefore, it is best practice and the default to use a tunnel.
diff --git a/doc/development/testing_guide/flaky_tests.md b/doc/development/testing_guide/flaky_tests.md
index c626a4fa81c..4f4ba71aac5 100644
--- a/doc/development/testing_guide/flaky_tests.md
+++ b/doc/development/testing_guide/flaky_tests.md
@@ -150,7 +150,7 @@ usually a good idea.
## Quarantined tests
-When a test frequently fails in `master`,
+When a test fails in `master`,
create [a ~"failure::flaky-test" issue](https://about.gitlab.com/handbook/engineering/workflow/#broken-master).
If the test cannot be fixed in a timely fashion, there is an impact on the
@@ -158,6 +158,7 @@ productivity of all the developers, so it should be quarantined. There are two w
### RSpec
+Add the corresponding category and group labels to issue using [`feature_category` metadata](../feature_categorization/index.md#rspec-examples).
For RSpec tests, you can use the `:quarantine` metadata with the issue URL.
```ruby
@@ -300,6 +301,12 @@ If a spec hangs, it might be caused by a [bug in Rails](https://github.com/rails
- <https://gitlab.com/gitlab-org/gitlab/-/merge_requests/81112>
- <https://gitlab.com/gitlab-org/gitlab/-/issues/337039>
+## Suggestions
+
+### Split the test file
+
+It could help to split the large RSpec files in multiple files in order to narrow down the context and identify the problematic tests.
+
## Resources
- [Flaky Tests: Are You Sure You Want to Rerun Them?](https://semaphoreci.com/blog/2017/04/20/flaky-tests.html)
diff --git a/doc/integration/saml.md b/doc/integration/saml.md
index 888dd47a968..195ca6bd904 100644
--- a/doc/integration/saml.md
+++ b/doc/integration/saml.md
@@ -699,7 +699,7 @@ When configuring the Google Workspace SAML application, record the following inf
| | Value | Description |
|-------------|--------------|-----------------------------------------------------------------------------------|
| SSO URL | Depends | Google Identity Provider details. Set to the GitLab `idp_sso_target_url` setting. |
-| Certificate | Downloadable | Run `openssl x509 -in <your_certificate.crt> -noout -fingerprint` to generate the SHA1 fingerprint that can be used in the `idp_cert_fingerprint` setting. |
+| Certificate | Downloadable | Run `openssl x509 -in <your_certificate.crt> -noout -fingerprint -sha1` to generate the SHA1 fingerprint that can be used in the `idp_cert_fingerprint` setting. |
Google Workspace Administrator also provides the IdP metadata, Entity ID, and SHA-256
fingerprint. However, GitLab does not need this information to connect to the
diff --git a/doc/user/application_security/sast/index.md b/doc/user/application_security/sast/index.md
index 82ceaad244d..5776072f77b 100644
--- a/doc/user/application_security/sast/index.md
+++ b/doc/user/application_security/sast/index.md
@@ -79,20 +79,20 @@ For more information about our plans for language support in SAST, see the [cate
|------------------------------|--------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| .NET Core | [Security Code Scan](https://gitlab.com/gitlab-org/security-products/analyzers/security-code-scan) | 11.0 |
| .NET Framework<sup>1</sup> | [Security Code Scan](https://gitlab.com/gitlab-org/security-products/analyzers/security-code-scan) | 13.0 |
-| .NET (all versions, C# only) | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 15.4 |
+| .NET (all versions, C# only) | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 15.4 |
| Apex (Salesforce) | [PMD](https://gitlab.com/gitlab-org/security-products/analyzers/pmd-apex) | 12.1 |
-| C | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 14.2 |
+| C | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 14.2 |
| C/C++ | [Flawfinder](https://gitlab.com/gitlab-org/security-products/analyzers/flawfinder) | 10.7 |
| Elixir (Phoenix) | [Sobelow](https://gitlab.com/gitlab-org/security-products/analyzers/sobelow) | 11.1 |
| Go<sup>3</sup> | [Gosec](https://gitlab.com/gitlab-org/security-products/analyzers/gosec) | 10.7 |
-| Go | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 14.4 |
+| Go | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 14.4 |
| Groovy<sup>2</sup> | [SpotBugs](https://gitlab.com/gitlab-org/security-products/analyzers/spotbugs) with the find-sec-bugs plugin | 11.3 (Gradle) & 11.9 (Maven, SBT) |
| Helm Charts | [Kubesec](https://gitlab.com/gitlab-org/security-products/analyzers/kubesec) | 13.1 |
-| Java (any build system) | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 14.10 |
+| Java (any build system) | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 14.10 |
| Java<sup>2, 3</sup> | [SpotBugs](https://gitlab.com/gitlab-org/security-products/analyzers/spotbugs) with the find-sec-bugs plugin | 10.6 (Maven), 10.8 (Gradle) & 11.9 (SBT) |
| Java (Android) | [MobSF (beta)](https://gitlab.com/gitlab-org/security-products/analyzers/mobsf) | 13.5 |
| JavaScript<sup>3</sup> | [ESLint security plugin](https://gitlab.com/gitlab-org/security-products/analyzers/eslint) | 11.8 |
-| JavaScript | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 13.10 |
+| JavaScript | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 13.10 |
| Kotlin (Android) | [MobSF (beta)](https://gitlab.com/gitlab-org/security-products/analyzers/mobsf) | 13.5 |
| Kotlin (General)<sup>2</sup> | [SpotBugs](https://gitlab.com/gitlab-org/security-products/analyzers/spotbugs) with the find-sec-bugs plugin | 13.11 |
| Kubernetes manifests | [Kubesec](https://gitlab.com/gitlab-org/security-products/analyzers/kubesec) | 12.6 |
@@ -100,15 +100,15 @@ For more information about our plans for language support in SAST, see the [cate
| Objective-C (iOS) | [MobSF (beta)](https://gitlab.com/gitlab-org/security-products/analyzers/mobsf) | 13.5 |
| PHP | [phpcs-security-audit](https://gitlab.com/gitlab-org/security-products/analyzers/phpcs-security-audit) | 10.8 |
| Python<sup>3</sup> | [bandit](https://gitlab.com/gitlab-org/security-products/analyzers/bandit) | 10.3 |
-| Python | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 13.9 |
+| Python | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 13.9 |
| React<sup>3</sup> | [ESLint react plugin](https://gitlab.com/gitlab-org/security-products/analyzers/eslint) | 12.5 |
-| React | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 13.10 |
+| React | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 13.10 |
| Ruby | [brakeman](https://gitlab.com/gitlab-org/security-products/analyzers/brakeman) | 13.9 |
| Ruby on Rails | [brakeman](https://gitlab.com/gitlab-org/security-products/analyzers/brakeman) | 10.3 |
| Scala<sup>2</sup> | [SpotBugs](https://gitlab.com/gitlab-org/security-products/analyzers/spotbugs) with the find-sec-bugs plugin | 11.0 (SBT) & 11.9 (Gradle, Maven) |
| Swift (iOS) | [MobSF (beta)](https://gitlab.com/gitlab-org/security-products/analyzers/mobsf) | 13.5 |
| TypeScript<sup>3</sup> | [ESLint security plugin](https://gitlab.com/gitlab-org/security-products/analyzers/eslint) | 11.9, [merged](https://gitlab.com/gitlab-org/gitlab/-/issues/36059) with ESLint in 13.2 |
-| TypeScript | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with GitLab-managed rules | 13.10 |
+| TypeScript | [Semgrep](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep) with [GitLab-managed rules](https://gitlab.com/gitlab-org/security-products/analyzers/semgrep/-/blob/main/RULES.md) | 13.10 |
1. .NET 4 support is limited. The analyzer runs in a Linux container and does not have access to Windows-specific libraries or features. Use the Semgrep-based scanner if you need .NET 4 support.
1. The SpotBugs-based analyzer supports [Gradle](https://gradle.org/), [Maven](https://maven.apache.org/), and [SBT](https://www.scala-sbt.org/). It can also be used with variants like the
diff --git a/doc/user/group/saml_sso/index.md b/doc/user/group/saml_sso/index.md
index 347b8cd0a2d..f7e6ea610fe 100644
--- a/doc/user/group/saml_sso/index.md
+++ b/doc/user/group/saml_sso/index.md
@@ -183,6 +183,33 @@ To find this URL:
Check your identity provider's documentation to see if it supports the GitLab metadata URL.
+### Manage the identity provider
+
+After you have set up your identity provider, you can:
+
+- Change the identity provider.
+- Change email domains.
+
+#### Change the identity provider
+
+You can change to a different identity provider. During the change process,
+users cannot access any of the SAML groups. To mitigate this, you can disable
+[SSO enforcement](#sso-enforcement).
+
+To change identity providers:
+
+1. [Configure](#configure-your-identity-provider) the group with the new identity provider.
+1. Optional. If the **NameID** is not identical, [change the **NameID** for users](#change-nameid-for-one-or-more-users).
+
+#### Change email domains
+
+To migrate users to a new email domain, tell users to:
+
+1. Add their new email as the primary email to their accounts and verify it.
+1. Optional. Remove their old email from the account.
+
+If the **NameID** is configured with the email address, [change the **NameID** for users](#change-nameid-for-one-or-more-users).
+
### User attributes
To create users with the correct information for improved [user access and management](#user-access-and-management),
@@ -294,41 +321,6 @@ immediately. If the user:
- Is signed out, they cannot access the group after being removed from the
identity provider.
-### Change the SAML app
-
-After you have configured your identity provider, you can:
-
-- Change the identity provider users sign in with.
-- Migrate to a different identity provider.
-- Change email domains.
-
-#### Change the identity provider
-
-To change the identity provider:
-
-- If the **NameID** value is not identical in the existing and new identity providers, [change the **NameID** for users](#change-nameid-for-one-or-more-users).
-- If the **NameID** value is identical, users do not have to make any changes.
-
-#### Migrate to a different identity provider
-
-You can migrate to a different identity provider. During the migration process,
-users cannot access any of the SAML groups. To mitigate this, you can disable
-[SSO enforcement](#sso-enforcement).
-
-To migrate identity providers:
-
-1. [Configure](#configure-your-identity-provider) the group with the new identity provider.
-1. [Change the **NameID** for users](#change-nameid-for-one-or-more-users).
-
-#### Change email domains
-
-To migrate users to a new email domain, tell users to:
-
-1. Add their new email as the primary email to their accounts and verify it.
-1. Optional. Remove their old email from the account.
-
-If the **NameID** is configured with the email address, [change the **NameID** for users](#change-nameid-for-one-or-more-users).
-
## User access and management
> - SAML user provisioning [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/268142) in GitLab 13.7.
diff --git a/doc/user/project/merge_requests/approvals/rules.md b/doc/user/project/merge_requests/approvals/rules.md
index 0a5e7c29860..7ffb05cb4f1 100644
--- a/doc/user/project/merge_requests/approvals/rules.md
+++ b/doc/user/project/merge_requests/approvals/rules.md
@@ -106,6 +106,9 @@ reduces the number of approvals left (the **Approvals** column) for all rules th
![Approvals premium merge request widget](img/approvals_premium_mr_widget_v13_3.png)
+<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
+For an overview, see [Multiple Approvers](https://www.youtube.com/watch?v=8JQJ5821FrA).
+
## Eligible approvers
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/10294) in GitLab 13.3, when an eligible approver comments on a merge request, it appears in the **Commented by** column of the Approvals widget.
diff --git a/lib/api/helpers/members_helpers.rb b/lib/api/helpers/members_helpers.rb
index 4b34a2bbe79..90f86688367 100644
--- a/lib/api/helpers/members_helpers.rb
+++ b/lib/api/helpers/members_helpers.rb
@@ -43,8 +43,7 @@ module API
end
def source_members(source)
- return source.namespace_members if source.is_a?(Project) &&
- Feature.enabled?(:project_members_index_by_project_namespace, source)
+ return source.namespace_members if source.is_a?(Project)
source.members
end
diff --git a/lib/gitlab/analytics/cycle_analytics/aggregated/stage_query_helpers.rb b/lib/gitlab/analytics/cycle_analytics/aggregated/stage_query_helpers.rb
index b00925495f2..1d041e76277 100644
--- a/lib/gitlab/analytics/cycle_analytics/aggregated/stage_query_helpers.rb
+++ b/lib/gitlab/analytics/cycle_analytics/aggregated/stage_query_helpers.rb
@@ -32,7 +32,7 @@ module Gitlab
end
def duration_in_seconds(duration_expression = duration)
- Arel::Nodes::Extract.new(duration_expression, :epoch)
+ Arel::Nodes::NamedFunction.new('CAST', [Arel::Nodes::Extract.new(duration_expression, :epoch).as('double precision')])
end
end
end
diff --git a/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children.rb b/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children.rb
deleted file mode 100644
index 3b8a452b855..00000000000
--- a/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A job to set namespaces.traversal_ids in sub-batches, of all namespaces with
- # a parent and not already set.
- # rubocop:disable Style/Documentation
- class BackfillNamespaceTraversalIdsChildren
- class Namespace < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'namespaces'
-
- scope :base_query, -> { where.not(parent_id: nil) }
- end
-
- PAUSE_SECONDS = 0.1
-
- def perform(start_id, end_id, sub_batch_size)
- batch_query = Namespace.base_query.where(id: start_id..end_id)
- batch_query.each_batch(of: sub_batch_size) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
- ranged_query = Namespace.unscoped.base_query.where(id: first..last)
-
- update_sql = <<~SQL
- UPDATE namespaces
- SET traversal_ids = calculated_ids.traversal_ids
- FROM #{calculated_traversal_ids(ranged_query)} calculated_ids
- WHERE namespaces.id = calculated_ids.id
- AND namespaces.traversal_ids = '{}'
- SQL
- ApplicationRecord.connection.execute(update_sql)
-
- sleep PAUSE_SECONDS
- end
-
- # We have to add all arguments when marking a job as succeeded as they
- # are all used to track the job by `queue_background_migration_jobs_by_range_at_intervals`
- mark_job_as_succeeded(start_id, end_id, sub_batch_size)
- end
-
- private
-
- # Calculate the ancestor path for a given set of namespaces.
- def calculated_traversal_ids(batch)
- <<~SQL
- (
- WITH RECURSIVE cte(source_id, namespace_id, parent_id, height) AS (
- (
- SELECT batch.id, batch.id, batch.parent_id, 1
- FROM (#{batch.to_sql}) AS batch
- )
- UNION ALL
- (
- SELECT cte.source_id, n.id, n.parent_id, cte.height+1
- FROM namespaces n, cte
- WHERE n.id = cte.parent_id
- )
- )
- SELECT flat_hierarchy.source_id as id,
- array_agg(flat_hierarchy.namespace_id ORDER BY flat_hierarchy.height DESC) as traversal_ids
- FROM (SELECT * FROM cte FOR UPDATE) flat_hierarchy
- GROUP BY flat_hierarchy.source_id
- )
- SQL
- end
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'BackfillNamespaceTraversalIdsChildren',
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots.rb b/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots.rb
deleted file mode 100644
index c69289fb91f..00000000000
--- a/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A job to set namespaces.traversal_ids in sub-batches, of all namespaces
- # without a parent and not already set.
- # rubocop:disable Style/Documentation
- class BackfillNamespaceTraversalIdsRoots
- class Namespace < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'namespaces'
-
- scope :base_query, -> { where(parent_id: nil) }
- end
-
- PAUSE_SECONDS = 0.1
-
- def perform(start_id, end_id, sub_batch_size)
- ranged_query = Namespace.base_query
- .where(id: start_id..end_id)
- .where("traversal_ids = '{}'")
-
- ranged_query.each_batch(of: sub_batch_size) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
-
- # The query need to be reconstructed because .each_batch modifies the default scope
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/330510
- Namespace.unscoped
- .base_query
- .where(id: first..last)
- .where("traversal_ids = '{}'")
- .update_all('traversal_ids = ARRAY[id]')
-
- sleep PAUSE_SECONDS
- end
-
- mark_job_as_succeeded(start_id, end_id, sub_batch_size)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'BackfillNamespaceTraversalIdsRoots',
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb b/lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb
deleted file mode 100644
index 3bf6bf993dd..00000000000
--- a/lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Class that will populate the upvotes_count field
- # for each issue
- class BackfillUpvotesCountOnIssues
- BATCH_SIZE = 1_000
-
- def perform(start_id, stop_id)
- (start_id..stop_id).step(BATCH_SIZE).each do |offset|
- update_issue_upvotes_count(offset, offset + BATCH_SIZE)
- end
- end
-
- private
-
- def execute(sql)
- @connection ||= ApplicationRecord.connection
- @connection.execute(sql)
- end
-
- def update_issue_upvotes_count(batch_start, batch_stop)
- execute(<<~SQL)
- UPDATE issues
- SET upvotes_count = sub_q.count_all
- FROM (
- SELECT COUNT(*) AS count_all, e.awardable_id AS issue_id
- FROM award_emoji AS e
- WHERE e.name = 'thumbsup' AND
- e.awardable_type = 'Issue' AND
- e.awardable_id BETWEEN #{batch_start} AND #{batch_stop}
- GROUP BY issue_id
- ) AS sub_q
- WHERE sub_q.issue_id = issues.id;
- SQL
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/backfill_user_namespace.rb b/lib/gitlab/background_migration/backfill_user_namespace.rb
deleted file mode 100644
index df6b1f083c3..00000000000
--- a/lib/gitlab/background_migration/backfill_user_namespace.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Backfills the `namespaces.type` column, replacing any
- # instances of `NULL` with `User`
- class BackfillUserNamespace
- include Gitlab::Database::DynamicModelHelpers
-
- def perform(start_id, end_id, batch_table, batch_column, sub_batch_size, pause_ms)
- parent_batch_relation = relation_scoped_to_range(batch_table, batch_column, start_id, end_id)
- parent_batch_relation.each_batch(column: batch_column, of: sub_batch_size, order_hint: :type) do |sub_batch|
- batch_metrics.time_operation(:update_all) do
- sub_batch.update_all(type: 'User')
- end
- pause_ms = 0 if pause_ms < 0
- sleep(pause_ms * 0.001)
- end
- end
-
- def batch_metrics
- @batch_metrics ||= Gitlab::Database::BackgroundMigration::BatchMetrics.new
- end
-
- private
-
- def connection
- ApplicationRecord.connection
- end
-
- def relation_scoped_to_range(source_table, source_key_column, start_id, stop_id)
- define_batchable_model(source_table, connection: connection)
- .where(source_key_column => start_id..stop_id)
- .where(type: nil)
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects.rb b/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects.rb
deleted file mode 100644
index 4da120769a0..00000000000
--- a/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The migration is used to cleanup orphaned lfs_objects_projects in order to
- # introduce valid foreign keys to this table
- class CleanupOrphanedLfsObjectsProjects
- # A model to access lfs_objects_projects table in migrations
- class LfsObjectsProject < ActiveRecord::Base
- self.table_name = 'lfs_objects_projects'
-
- include ::EachBatch
-
- belongs_to :lfs_object
- belongs_to :project
- end
-
- # A model to access lfs_objects table in migrations
- class LfsObject < ActiveRecord::Base
- self.table_name = 'lfs_objects'
- end
-
- # A model to access projects table in migrations
- class Project < ActiveRecord::Base
- self.table_name = 'projects'
- end
-
- SUB_BATCH_SIZE = 5000
- CLEAR_CACHE_DELAY = 1.minute
-
- def perform(start_id, end_id)
- cleanup_lfs_objects_projects_without_lfs_object(start_id, end_id)
- cleanup_lfs_objects_projects_without_project(start_id, end_id)
- end
-
- private
-
- def cleanup_lfs_objects_projects_without_lfs_object(start_id, end_id)
- each_record_without_association(start_id, end_id, :lfs_object, :lfs_objects) do |lfs_objects_projects_without_lfs_objects|
- projects = Project.where(id: lfs_objects_projects_without_lfs_objects.select(:project_id))
-
- if projects.present?
- ProjectCacheWorker.bulk_perform_in_with_contexts(
- CLEAR_CACHE_DELAY,
- projects,
- arguments_proc: ->(project) { [project.id, [], [:lfs_objects_size]] },
- context_proc: ->(project) { { project: project } }
- )
- end
-
- lfs_objects_projects_without_lfs_objects.delete_all
- end
- end
-
- def cleanup_lfs_objects_projects_without_project(start_id, end_id)
- each_record_without_association(start_id, end_id, :project, :projects) do |lfs_objects_projects_without_projects|
- lfs_objects_projects_without_projects.delete_all
- end
- end
-
- def each_record_without_association(start_id, end_id, association, table_name)
- batch = LfsObjectsProject.where(id: start_id..end_id)
-
- batch.each_batch(of: SUB_BATCH_SIZE) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(lfs_objects_projects.id), max(lfs_objects_projects.id)'))
-
- lfs_objects_without_association =
- LfsObjectsProject
- .unscoped
- .left_outer_joins(association)
- .where(id: (first..last), table_name => { id: nil })
-
- yield lfs_objects_without_association
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/delete_orphaned_deployments.rb b/lib/gitlab/background_migration/delete_orphaned_deployments.rb
deleted file mode 100644
index 4a3a12ab53d..00000000000
--- a/lib/gitlab/background_migration/delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Background migration for deleting orphaned deployments.
- class DeleteOrphanedDeployments
- include Database::MigrationHelpers
-
- def perform(start_id, end_id)
- orphaned_deployments
- .where(id: start_id..end_id)
- .delete_all
-
- mark_job_as_succeeded(start_id, end_id)
- end
-
- def orphaned_deployments
- define_batchable_model('deployments', connection: ApplicationRecord.connection)
- .where('NOT EXISTS (SELECT 1 FROM environments WHERE deployments.environment_id = environments.id)')
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images.rb b/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images.rb
deleted file mode 100644
index dad5da875ab..00000000000
--- a/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images.rb
+++ /dev/null
@@ -1,41 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- BATCH_SIZE = 1000
-
- # This background migration disables container expiration policies connected
- # to a project that has no container repositories
- class DisableExpirationPoliciesLinkedToNoContainerImages
- # rubocop: disable Style/Documentation
- class ContainerExpirationPolicy < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'container_expiration_policies'
- end
- # rubocop: enable Style/Documentation
-
- def perform(from_id, to_id)
- ContainerExpirationPolicy.where(enabled: true, project_id: from_id..to_id).each_batch(of: BATCH_SIZE) do |batch|
- sql = <<-SQL
- WITH batched_relation AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (#{batch.select(:project_id).limit(BATCH_SIZE).to_sql})
- UPDATE container_expiration_policies
- SET enabled = FALSE
- FROM batched_relation
- WHERE container_expiration_policies.project_id = batched_relation.project_id
- AND NOT EXISTS (SELECT 1 FROM "container_repositories" WHERE container_repositories.project_id = container_expiration_policies.project_id)
- SQL
- execute(sql)
- end
- end
-
- private
-
- def execute(sql)
- ApplicationRecord
- .connection
- .execute(sql)
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/drop_invalid_remediations.rb b/lib/gitlab/background_migration/drop_invalid_remediations.rb
deleted file mode 100644
index f0a0de586f5..00000000000
--- a/lib/gitlab/background_migration/drop_invalid_remediations.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop: disable Style/Documentation
- class DropInvalidRemediations
- def perform(start_id, stop_id)
- end
- end
- # rubocop: enable Style/Documentation
- end
-end
-
-Gitlab::BackgroundMigration::DropInvalidRemediations.prepend_mod_with('Gitlab::BackgroundMigration::DropInvalidRemediations')
diff --git a/lib/gitlab/background_migration/drop_invalid_security_findings.rb b/lib/gitlab/background_migration/drop_invalid_security_findings.rb
deleted file mode 100644
index 000628e109c..00000000000
--- a/lib/gitlab/background_migration/drop_invalid_security_findings.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-module Gitlab
- module BackgroundMigration
- # Drop rows from security_findings where the uuid is NULL
- class DropInvalidSecurityFindings
- # rubocop:disable Style/Documentation
- class SecurityFinding < ActiveRecord::Base
- include ::EachBatch
- self.table_name = 'security_findings'
- scope :no_uuid, -> { where(uuid: nil) }
- end
- # rubocop:enable Style/Documentation
-
- PAUSE_SECONDS = 0.1
-
- def perform(start_id, end_id, sub_batch_size)
- ranged_query = SecurityFinding
- .where(id: start_id..end_id)
- .no_uuid
-
- ranged_query.each_batch(of: sub_batch_size) do |sub_batch|
- first, last = sub_batch.pick(Arel.sql('min(id), max(id)'))
-
- # The query need to be reconstructed because .each_batch modifies the default scope
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/330510
- SecurityFinding.unscoped
- .where(id: first..last)
- .no_uuid
- .delete_all
-
- sleep PAUSE_SECONDS
- end
-
- mark_job_as_succeeded(start_id, end_id, sub_batch_size)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/drop_invalid_vulnerabilities.rb b/lib/gitlab/background_migration/drop_invalid_vulnerabilities.rb
deleted file mode 100644
index 293530f6536..00000000000
--- a/lib/gitlab/background_migration/drop_invalid_vulnerabilities.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-# rubocop: disable Style/Documentation
-class Gitlab::BackgroundMigration::DropInvalidVulnerabilities
- # rubocop: disable Gitlab/NamespacedClass
- class Vulnerability < ActiveRecord::Base
- self.table_name = "vulnerabilities"
- has_many :findings, class_name: 'VulnerabilitiesFinding', inverse_of: :vulnerability
- end
-
- class VulnerabilitiesFinding < ActiveRecord::Base
- self.table_name = "vulnerability_occurrences"
- belongs_to :vulnerability, class_name: 'Vulnerability', inverse_of: :findings, foreign_key: 'vulnerability_id'
- end
- # rubocop: enable Gitlab/NamespacedClass
-
- # rubocop: disable CodeReuse/ActiveRecord
- def perform(start_id, end_id)
- Vulnerability
- .where(id: start_id..end_id)
- .left_joins(:findings)
- .where(vulnerability_occurrences: { vulnerability_id: nil })
- .delete_all
-
- mark_job_as_succeeded(start_id, end_id)
- end
- # rubocop: enable CodeReuse/ActiveRecord
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'DropInvalidVulnerabilities',
- arguments
- )
- end
-end
diff --git a/lib/gitlab/background_migration/extract_project_topics_into_separate_table.rb b/lib/gitlab/background_migration/extract_project_topics_into_separate_table.rb
deleted file mode 100644
index 31b5b5cdb73..00000000000
--- a/lib/gitlab/background_migration/extract_project_topics_into_separate_table.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to extract the project topics into a separate `topics` table
- class ExtractProjectTopicsIntoSeparateTable
- # Temporary AR table for tags
- class Tag < ActiveRecord::Base
- self.table_name = 'tags'
- end
-
- # Temporary AR table for taggings
- class Tagging < ActiveRecord::Base
- self.table_name = 'taggings'
- belongs_to :tag
- end
-
- # Temporary AR table for topics
- class Topic < ActiveRecord::Base
- self.table_name = 'topics'
- end
-
- # Temporary AR table for project topics
- class ProjectTopic < ActiveRecord::Base
- self.table_name = 'project_topics'
- belongs_to :topic
- end
-
- # Temporary AR table for projects
- class Project < ActiveRecord::Base
- self.table_name = 'projects'
- end
-
- def perform(start_id, stop_id)
- Tagging.includes(:tag).where(taggable_type: 'Project', id: start_id..stop_id).each do |tagging|
- if Project.exists?(id: tagging.taggable_id) && tagging.tag
- begin
- topic = Topic.find_or_create_by(name: tagging.tag.name)
- project_topic = ProjectTopic.find_or_create_by(project_id: tagging.taggable_id, topic: topic)
-
- tagging.delete if project_topic.persisted?
- rescue StandardError => e
- Gitlab::ErrorTracking.log_exception(e, tagging_id: tagging.id)
- end
- else
- tagging.delete
- end
- end
-
- mark_job_as_succeeded(start_id, stop_id)
- end
-
- private
-
- def mark_job_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
- self.class.name.demodulize,
- arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/fix_merge_request_diff_commit_users.rb b/lib/gitlab/background_migration/fix_merge_request_diff_commit_users.rb
deleted file mode 100644
index 4df55a7b02a..00000000000
--- a/lib/gitlab/background_migration/fix_merge_request_diff_commit_users.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Background migration for fixing merge_request_diff_commit rows that don't
- # have committer/author details due to
- # https://gitlab.com/gitlab-org/gitlab/-/issues/344080.
- class FixMergeRequestDiffCommitUsers
- BATCH_SIZE = 100
-
- def initialize
- @commits = {}
- @users = {}
- end
-
- def perform(project_id)
- # No-op, see https://gitlab.com/gitlab-org/gitlab/-/issues/344540
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb b/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb
deleted file mode 100644
index 7d150b9cd83..00000000000
--- a/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users.rb
+++ /dev/null
@@ -1,296 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Migrates author and committer names and emails from
- # merge_request_diff_commits to two columns that point to
- # merge_request_diff_commit_users.
- #
- # rubocop: disable Metrics/ClassLength
- class MigrateMergeRequestDiffCommitUsers
- # The number of user rows in merge_request_diff_commit_users to get in a
- # single query.
- USER_ROWS_PER_QUERY = 1_000
-
- # The number of rows in merge_request_diff_commits to get in a single
- # query.
- COMMIT_ROWS_PER_QUERY = 1_000
-
- # The number of rows in merge_request_diff_commits to update in a single
- # query.
- #
- # Tests in staging revealed that increasing the number of updates per
- # query translates to a longer total runtime for a migration. For example,
- # given the same range of rows to migrate, 1000 updates per query required
- # a total of roughly 15 seconds. On the other hand, 5000 updates per query
- # required a total of roughly 25 seconds. For this reason, we use a value
- # of 1000 rows per update.
- UPDATES_PER_QUERY = 1_000
-
- # rubocop: disable Style/Documentation
- class MergeRequestDiffCommit < ActiveRecord::Base
- include FromUnion
- extend ::SuppressCompositePrimaryKeyWarning
-
- self.table_name = 'merge_request_diff_commits'
-
- # Yields each row to migrate in the given range.
- #
- # This method uses keyset pagination to ensure we don't retrieve
- # potentially tens of thousands (or even hundreds of thousands) of rows
- # in a single query. Such queries could time out, or increase the amount
- # of memory needed to process the data.
- #
- # We can't use `EachBatch` and similar approaches, as
- # merge_request_diff_commits doesn't have a single monotonically
- # increasing primary key.
- def self.each_row_to_migrate(start_id, stop_id, &block)
- order = Pagination::Keyset::Order.build(
- %w[merge_request_diff_id relative_order].map do |col|
- Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: col,
- order_expression: self.arel_table[col.to_sym].asc,
- nullable: :not_nullable,
- distinct: false
- )
- end
- )
-
- scope = MergeRequestDiffCommit
- .where(merge_request_diff_id: start_id...stop_id)
- .order(order)
-
- Pagination::Keyset::Iterator
- .new(scope: scope, use_union_optimization: true)
- .each_batch(of: COMMIT_ROWS_PER_QUERY) { |rows| rows.each(&block) }
- end
- end
- # rubocop: enable Style/Documentation
-
- # rubocop: disable Style/Documentation
- class MergeRequestDiffCommitUser < ActiveRecord::Base
- self.table_name = 'merge_request_diff_commit_users'
-
- def self.union(queries)
- from("(#{queries.join("\nUNION ALL\n")}) #{table_name}")
- end
- end
- # rubocop: enable Style/Documentation
-
- def perform(start_id, stop_id)
- return if already_processed?(start_id, stop_id)
-
- # This Hash maps user names + emails to their corresponding rows in
- # merge_request_diff_commit_users.
- user_mapping = {}
-
- user_details, diff_rows_to_update = get_data_to_update(start_id, stop_id)
-
- get_user_rows_in_batches(user_details, user_mapping)
- create_missing_users(user_details, user_mapping)
- update_commit_rows(diff_rows_to_update, user_mapping)
-
- Database::BackgroundMigrationJob.mark_all_as_succeeded(
- 'MigrateMergeRequestDiffCommitUsers',
- [start_id, stop_id]
- )
- end
-
- def already_processed?(start_id, stop_id)
- Database::BackgroundMigrationJob
- .for_migration_execution('MigrateMergeRequestDiffCommitUsers', [start_id, stop_id])
- .succeeded
- .any?
- end
-
- # Returns the data we'll use to determine what merge_request_diff_commits
- # rows to update, and what data to use for populating their
- # commit_author_id and committer_id columns.
- def get_data_to_update(start_id, stop_id)
- # This Set is used to retrieve users that already exist in
- # merge_request_diff_commit_users.
- users = Set.new
-
- # This Hash maps the primary key of every row in
- # merge_request_diff_commits to the (trimmed) author and committer
- # details to use for updating the row.
- to_update = {}
-
- MergeRequestDiffCommit.each_row_to_migrate(start_id, stop_id) do |row|
- author = [prepare(row.author_name), prepare(row.author_email)]
- committer = [prepare(row.committer_name), prepare(row.committer_email)]
-
- to_update[[row.merge_request_diff_id, row.relative_order]] =
- [author, committer]
-
- users << author if author[0] || author[1]
- users << committer if committer[0] || committer[1]
- end
-
- [users, to_update]
- end
-
- # Gets any existing rows in merge_request_diff_commit_users in batches.
- #
- # This method may end up having to retrieve lots of rows. To reduce the
- # overhead, we batch queries into a UNION query. We limit the number of
- # queries per UNION so we don't end up sending a single query containing
- # too many SELECT statements.
- def get_user_rows_in_batches(users, user_mapping)
- users.each_slice(USER_ROWS_PER_QUERY) do |pairs|
- queries = pairs.map do |(name, email)|
- MergeRequestDiffCommitUser.where(name: name, email: email).to_sql
- end
-
- MergeRequestDiffCommitUser.union(queries).each do |row|
- user_mapping[[row.name.to_s, row.email.to_s]] = row
- end
- end
- end
-
- # Creates any users for which no row exists in
- # merge_request_diff_commit_users.
- #
- # Not all users queried may exist yet, so we need to create any missing
- # ones; making sure we handle concurrent creations of the same user
- def create_missing_users(users, mapping)
- create = []
-
- users.each do |(name, email)|
- create << { name: name, email: email } unless mapping[[name, email]]
- end
-
- return if create.empty?
-
- MergeRequestDiffCommitUser
- .insert_all(create, returning: %w[id name email])
- .each do |row|
- mapping[[row['name'], row['email']]] = MergeRequestDiffCommitUser
- .new(id: row['id'], name: row['name'], email: row['email'])
- end
-
- # It's possible for (name, email) pairs to be inserted concurrently,
- # resulting in the above insert not returning anything. Here we get any
- # remaining users that were created concurrently.
- get_user_rows_in_batches(
- users.reject { |pair| mapping.key?(pair) },
- mapping
- )
- end
-
- # Updates rows in merge_request_diff_commits with their new
- # commit_author_id and committer_id values.
- def update_commit_rows(to_update, user_mapping)
- to_update.each_slice(UPDATES_PER_QUERY) do |slice|
- updates = {}
-
- slice.each do |(diff_id, order), (author, committer)|
- author_id = user_mapping[author]&.id
- committer_id = user_mapping[committer]&.id
-
- updates[[diff_id, order]] = [author_id, committer_id]
- end
-
- bulk_update_commit_rows(updates)
- end
- end
-
- # Bulk updates rows in the merge_request_diff_commits table with their new
- # author and/or committer ID values.
- #
- # Updates are batched together to reduce the overhead of having to produce
- # a single UPDATE for every row, as we may end up having to update
- # thousands of rows at once.
- #
- # The query produced by this method is along the lines of the following:
- #
- # UPDATE merge_request_diff_commits
- # SET commit_author_id =
- # CASE
- # WHEN (merge_request_diff_id, relative_order) = (x, y) THEN X
- # WHEN ...
- # END,
- # committer_id =
- # CASE
- # WHEN (merge_request_diff_id, relative_order) = (x, y) THEN Y
- # WHEN ...
- # END
- # WHERE (merge_request_diff_id, relative_order) IN ( (x, y), ... )
- #
- # The `mapping` argument is a Hash in the following format:
- #
- # { [merge_request_diff_id, relative_order] => [author_id, committer_id] }
- #
- # rubocop: disable Metrics/AbcSize
- def bulk_update_commit_rows(mapping)
- author_case = Arel::Nodes::Case.new
- committer_case = Arel::Nodes::Case.new
- primary_values = []
-
- mapping.each do |diff_id_and_order, (author_id, committer_id)|
- primary_value = Arel::Nodes::Grouping.new(diff_id_and_order)
-
- primary_values << primary_value
-
- if author_id
- author_case.when(primary_key.eq(primary_value)).then(author_id)
- end
-
- if committer_id
- committer_case.when(primary_key.eq(primary_value)).then(committer_id)
- end
- end
-
- if author_case.conditions.empty? && committer_case.conditions.empty?
- return
- end
-
- fields = []
-
- # Statements such as `SET x = CASE END` are not valid SQL statements, so
- # we omit setting an ID field if there are no values to populate it
- # with.
- if author_case.conditions.any?
- fields << [arel_table[:commit_author_id], author_case]
- end
-
- if committer_case.conditions.any?
- fields << [arel_table[:committer_id], committer_case]
- end
-
- query = Arel::UpdateManager.new
- .table(arel_table)
- .where(primary_key.in(primary_values))
- .set(fields)
- .to_sql
-
- MergeRequestDiffCommit.connection.execute(query)
- end
- # rubocop: enable Metrics/AbcSize
-
- def primary_key
- Arel::Nodes::Grouping.new(
- [arel_table[:merge_request_diff_id], arel_table[:relative_order]]
- )
- end
-
- def arel_table
- MergeRequestDiffCommit.arel_table
- end
-
- # Prepares a value to be inserted into a column in the table
- # `merge_request_diff_commit_users`. Values in this table are limited to
- # 512 characters.
- #
- # We treat empty strings as NULL values, as there's no point in (for
- # example) storing a row where both the name and Email are an empty
- # string. In addition, if we treated them differently we could end up with
- # two rows: one where field X is NULL, and one where field X is an empty
- # string. This is redundant, so we avoid storing such data.
- def prepare(value)
- value.present? ? value[0..511] : nil
- end
- end
- # rubocop: enable Metrics/ClassLength
- end
-end
diff --git a/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb b/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb
deleted file mode 100644
index 68bbd3cfebb..00000000000
--- a/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # The class to migrate the context of project taggings from `tags` to `topics`
- class MigrateProjectTaggingsContextFromTagsToTopics
- # Temporary AR table for taggings
- class Tagging < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'taggings'
- end
-
- def perform(start_id, stop_id)
- Tagging.where(taggable_type: 'Project', context: 'tags', id: start_id..stop_id).each_batch(of: 500) do |relation|
- relation.update_all(context: 'topics')
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb b/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb
deleted file mode 100644
index 06422ed282f..00000000000
--- a/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # This migration moves projects.container_registry_enabled values to
- # project_features.container_registry_access_level for the projects within
- # the given range of ids.
- class MoveContainerRegistryEnabledToProjectFeature
- MAX_BATCH_SIZE = 300
-
- ENABLED = 20
- DISABLED = 0
-
- def perform(from_id, to_id)
- (from_id..to_id).each_slice(MAX_BATCH_SIZE) do |batch|
- process_batch(batch.first, batch.last)
- end
-
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded('MoveContainerRegistryEnabledToProjectFeature', [from_id, to_id])
- end
-
- private
-
- def process_batch(from_id, to_id)
- ApplicationRecord.connection.execute(update_sql(from_id, to_id))
-
- logger.info(message: "#{self.class}: Copied container_registry_enabled values for projects with IDs between #{from_id}..#{to_id}")
- end
-
- # For projects that have a project_feature:
- # Set project_features.container_registry_access_level to ENABLED (20) or DISABLED (0)
- # depending if container_registry_enabled is true or false.
- def update_sql(from_id, to_id)
- <<~SQL
- UPDATE project_features
- SET container_registry_access_level = (CASE p.container_registry_enabled
- WHEN true THEN #{ENABLED}
- WHEN false THEN #{DISABLED}
- ELSE #{DISABLED}
- END)
- FROM projects p
- WHERE project_id = p.id AND
- project_id BETWEEN #{from_id} AND #{to_id}
- SQL
- end
-
- def logger
- @logger ||= Gitlab::BackgroundMigration::Logger.build
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/populate_topics_total_projects_count_cache.rb b/lib/gitlab/background_migration/populate_topics_total_projects_count_cache.rb
deleted file mode 100644
index 2495cb51364..00000000000
--- a/lib/gitlab/background_migration/populate_topics_total_projects_count_cache.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- SUB_BATCH_SIZE = 1_000
-
- # The class to populates the total projects counter cache of topics
- class PopulateTopicsTotalProjectsCountCache
- # Temporary AR model for topics
- class Topic < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'topics'
- end
-
- def perform(start_id, stop_id)
- Topic.where(id: start_id..stop_id).each_batch(of: SUB_BATCH_SIZE) do |batch|
- ApplicationRecord.connection.execute(<<~SQL)
- WITH batched_relation AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (#{batch.select(:id).limit(SUB_BATCH_SIZE).to_sql})
- UPDATE topics
- SET total_projects_count = (SELECT COUNT(*) FROM project_topics WHERE topic_id = batched_relation.id)
- FROM batched_relation
- WHERE topics.id = batched_relation.id
- SQL
- end
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/populate_uuids_for_security_findings.rb b/lib/gitlab/background_migration/populate_uuids_for_security_findings.rb
deleted file mode 100644
index 175966b940d..00000000000
--- a/lib/gitlab/background_migration/populate_uuids_for_security_findings.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop:disable Style/Documentation
- class PopulateUuidsForSecurityFindings
- NOP_RELATION = Class.new { def each_batch(*); end }
-
- def self.security_findings
- NOP_RELATION.new
- end
-
- def perform(*_scan_ids); end
- end
- end
-end
-
-Gitlab::BackgroundMigration::PopulateUuidsForSecurityFindings.prepend_mod_with('Gitlab::BackgroundMigration::PopulateUuidsForSecurityFindings')
diff --git a/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings.rb b/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings.rb
deleted file mode 100644
index 15799659b55..00000000000
--- a/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings.rb
+++ /dev/null
@@ -1,64 +0,0 @@
-# frozen_string_literal: true
-
-# rubocop: disable Style/Documentation
-class Gitlab::BackgroundMigration::RemoveDuplicateVulnerabilitiesFindings
- DELETE_BATCH_SIZE = 50
-
- # rubocop:disable Gitlab/NamespacedClass
- class VulnerabilitiesFinding < ActiveRecord::Base
- self.table_name = "vulnerability_occurrences"
- end
- # rubocop:enable Gitlab/NamespacedClass
-
- # rubocop:disable Gitlab/NamespacedClass
- class Vulnerability < ActiveRecord::Base
- self.table_name = "vulnerabilities"
- end
- # rubocop:enable Gitlab/NamespacedClass
-
- def perform(start_id, end_id)
- batch = VulnerabilitiesFinding.where(id: start_id..end_id)
-
- cte = Gitlab::SQL::CTE.new(:batch, batch.select(:report_type, :location_fingerprint, :primary_identifier_id, :project_id))
-
- query = VulnerabilitiesFinding
- .select('batch.report_type', 'batch.location_fingerprint', 'batch.primary_identifier_id', 'batch.project_id', 'array_agg(id) as ids')
- .distinct
- .with(cte.to_arel)
- .from(cte.alias_to(Arel.sql('batch')))
- .joins(
- %(
- INNER JOIN
- vulnerability_occurrences ON
- vulnerability_occurrences.report_type = batch.report_type AND
- vulnerability_occurrences.location_fingerprint = batch.location_fingerprint AND
- vulnerability_occurrences.primary_identifier_id = batch.primary_identifier_id AND
- vulnerability_occurrences.project_id = batch.project_id
- )).group('batch.report_type', 'batch.location_fingerprint', 'batch.primary_identifier_id', 'batch.project_id')
- .having('COUNT(*) > 1')
-
- ids_to_delete = []
-
- query.to_a.each do |record|
- # We want to keep the latest finding since it might have recent metadata
- duplicate_ids = record.ids.uniq.sort
- duplicate_ids.pop
- ids_to_delete.concat(duplicate_ids)
-
- if ids_to_delete.size == DELETE_BATCH_SIZE
- delete_findings_and_vulnerabilities(ids_to_delete)
- ids_to_delete.clear
- end
- end
-
- delete_findings_and_vulnerabilities(ids_to_delete) if ids_to_delete.any?
- end
-
- private
-
- def delete_findings_and_vulnerabilities(ids)
- vulnerability_ids = VulnerabilitiesFinding.where(id: ids).pluck(:vulnerability_id).compact
- VulnerabilitiesFinding.where(id: ids).delete_all
- Vulnerability.where(id: vulnerability_ids).delete_all
- end
-end
diff --git a/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users.rb b/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users.rb
deleted file mode 100644
index 43a7032e682..00000000000
--- a/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # A background migration that finished any pending
- # MigrateMergeRequestDiffCommitUsers jobs, and schedules new jobs itself.
- #
- # This migration exists so we can bypass rescheduling issues (e.g. jobs
- # getting dropped after too many retries) that may occur when
- # MigrateMergeRequestDiffCommitUsers jobs take longer than expected.
- class StealMigrateMergeRequestDiffCommitUsers
- def perform(start_id, stop_id)
- MigrateMergeRequestDiffCommitUsers.new.perform(start_id, stop_id)
- schedule_next_job
- end
-
- def schedule_next_job
- next_job = Database::BackgroundMigrationJob
- .for_migration_class('MigrateMergeRequestDiffCommitUsers')
- .pending
- .first
-
- return unless next_job
-
- BackgroundMigrationWorker.perform_in(
- 5.minutes,
- 'StealMigrateMergeRequestDiffCommitUsers',
- next_job.arguments
- )
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/update_timelogs_project_id.rb b/lib/gitlab/background_migration/update_timelogs_project_id.rb
deleted file mode 100644
index 69bb5cf6e6d..00000000000
--- a/lib/gitlab/background_migration/update_timelogs_project_id.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Class to populate project_id for timelogs
- class UpdateTimelogsProjectId
- BATCH_SIZE = 1000
-
- def perform(start_id, stop_id)
- (start_id..stop_id).step(BATCH_SIZE).each do |offset|
- update_issue_timelogs(offset, offset + BATCH_SIZE)
- update_merge_request_timelogs(offset, offset + BATCH_SIZE)
- end
- end
-
- def update_issue_timelogs(batch_start, batch_stop)
- execute(<<~SQL)
- UPDATE timelogs
- SET project_id = issues.project_id
- FROM issues
- WHERE issues.id = timelogs.issue_id
- AND timelogs.id BETWEEN #{batch_start} AND #{batch_stop}
- AND timelogs.project_id IS NULL;
- SQL
- end
-
- def update_merge_request_timelogs(batch_start, batch_stop)
- execute(<<~SQL)
- UPDATE timelogs
- SET project_id = merge_requests.target_project_id
- FROM merge_requests
- WHERE merge_requests.id = timelogs.merge_request_id
- AND timelogs.id BETWEEN #{batch_start} AND #{batch_stop}
- AND timelogs.project_id IS NULL;
- SQL
- end
-
- def execute(sql)
- @connection ||= ApplicationRecord.connection
- @connection.execute(sql)
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group.rb b/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group.rb
deleted file mode 100644
index 10db9f5064a..00000000000
--- a/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-# frozen_string_literal: true
-# rubocop:disable Style/Documentation
-
-module Gitlab
- module BackgroundMigration
- class UpdateUsersWhereTwoFactorAuthRequiredFromGroup # rubocop:disable Metrics/ClassLength
- def perform(start_id, stop_id)
- ApplicationRecord.connection.execute <<~SQL
- UPDATE
- users
- SET
- require_two_factor_authentication_from_group = TRUE
- WHERE
- users.id BETWEEN #{start_id}
- AND #{stop_id}
- AND users.require_two_factor_authentication_from_group = FALSE
- AND users.id IN (
- SELECT
- DISTINCT users_groups_query.user_id
- FROM
- (
- SELECT
- users.id AS user_id,
- members.source_id AS group_ids
- FROM
- users
- LEFT JOIN members ON members.source_type = 'Namespace'
- AND members.requested_at IS NULL
- AND members.user_id = users.id
- AND members.type = 'GroupMember'
- WHERE
- users.require_two_factor_authentication_from_group = FALSE
- AND users.id BETWEEN #{start_id}
- AND #{stop_id}) AS users_groups_query
- INNER JOIN LATERAL (
- WITH RECURSIVE "base_and_ancestors" AS (
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "namespaces"
- WHERE
- "namespaces"."type" = 'Group'
- AND "namespaces"."id" = users_groups_query.group_ids
- )
- UNION
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "namespaces",
- "base_and_ancestors"
- WHERE
- "namespaces"."type" = 'Group'
- AND "namespaces"."id" = "base_and_ancestors"."parent_id"
- )
- ),
- "base_and_descendants" AS (
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "namespaces"
- WHERE
- "namespaces"."type" = 'Group'
- AND "namespaces"."id" = users_groups_query.group_ids
- )
- UNION
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "namespaces",
- "base_and_descendants"
- WHERE
- "namespaces"."type" = 'Group'
- AND "namespaces"."parent_id" = "base_and_descendants"."id"
- )
- )
- SELECT
- "namespaces".*
- FROM
- (
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "base_and_ancestors" AS "namespaces"
- WHERE
- "namespaces"."type" = 'Group'
- )
- UNION
- (
- SELECT
- "namespaces"."type",
- "namespaces"."id",
- "namespaces"."parent_id",
- "namespaces"."require_two_factor_authentication"
- FROM
- "base_and_descendants" AS "namespaces"
- WHERE
- "namespaces"."type" = 'Group'
- )
- ) namespaces
- WHERE
- "namespaces"."type" = 'Group'
- AND "namespaces"."require_two_factor_authentication" = TRUE
- ) AS hierarchy_tree ON TRUE
- );
- SQL
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/update_vulnerability_occurrences_location.rb b/lib/gitlab/background_migration/update_vulnerability_occurrences_location.rb
deleted file mode 100644
index 458e0537f1c..00000000000
--- a/lib/gitlab/background_migration/update_vulnerability_occurrences_location.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # rubocop: disable Style/Documentation
- class UpdateVulnerabilityOccurrencesLocation
- def perform(start_id, stop_id)
- end
- end
- # rubocop: enable Style/Documentation
- end
-end
-
-Gitlab::BackgroundMigration::UpdateVulnerabilityOccurrencesLocation.prepend_mod_with('Gitlab::BackgroundMigration::UpdateVulnerabilityOccurrencesLocation')
diff --git a/lib/gitlab/ci/reports/security/finding.rb b/lib/gitlab/ci/reports/security/finding.rb
index 45e67528f12..bf48c7d0bb7 100644
--- a/lib/gitlab/ci/reports/security/finding.rb
+++ b/lib/gitlab/ci/reports/security/finding.rb
@@ -190,6 +190,10 @@ module Gitlab
original_data['assets'] || []
end
+ def raw_source_code_extract
+ original_data['raw_source_code_extract']
+ end
+
# Returns either the max priority signature hex
# or the location fingerprint
def location_fingerprint
diff --git a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
index 61c2b468899..e336f69a7f6 100644
--- a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.47.0'
+ DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.48.0'
.dast-auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${DAST_AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
index 9bac82b660f..ea6216a9210 100644
--- a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- AUTO_DEPLOY_IMAGE_VERSION: 'v2.47.0'
+ AUTO_DEPLOY_IMAGE_VERSION: 'v2.48.0'
.auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
index ec43217792f..34560600c10 100644
--- a/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Deploy.latest.gitlab-ci.yml
@@ -1,5 +1,5 @@
variables:
- AUTO_DEPLOY_IMAGE_VERSION: 'v2.47.0'
+ AUTO_DEPLOY_IMAGE_VERSION: 'v2.48.0'
.auto-deploy:
image: "${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}"
diff --git a/lib/gitlab/import/metrics.rb b/lib/gitlab/import/metrics.rb
index e457d9ec57c..8263df3dc37 100644
--- a/lib/gitlab/import/metrics.rb
+++ b/lib/gitlab/import/metrics.rb
@@ -32,14 +32,14 @@ module Gitlab
return unless project.github_import?
track_usage_event(:github_import_project_failure, project.id)
- track_import_state('github')
+ track_import_state('github', 'Import::GithubService')
end
def track_canceled_import
return unless project.github_import?
track_usage_event(:github_import_project_cancelled, project.id)
- track_import_state('github')
+ track_import_state('github', 'Import::GithubService')
end
def issues_counter
@@ -83,7 +83,7 @@ module Gitlab
def track_finish_metric
return unless project.github_import?
- track_import_state('github')
+ track_import_state('github', 'Import::GithubService')
case project.beautified_import_status_name
when 'partially completed'
@@ -93,13 +93,14 @@ module Gitlab
end
end
- def track_import_state(type)
+ def track_import_state(type, category)
Gitlab::Tracking.event(
- importer,
+ category,
'create',
label: "#{type}_import_project_state",
project: project,
- extra: { import_type: type, state: project.beautified_import_status_name }
+ import_type: type,
+ state: project.beautified_import_status_name
)
end
end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9abbb850718..75ce826e1be 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -14056,9 +14056,6 @@ msgstr ""
msgid "Dependencies|Vulnerable components"
msgstr ""
-msgid "Dependency List"
-msgstr ""
-
msgid "Dependency List has no entries"
msgstr ""
@@ -31032,6 +31029,15 @@ msgstr ""
msgid "PackageRegistry|There are no packages yet"
msgstr ""
+msgid "PackageRegistry|There are security risks if packages are deleted while request forwarding is enabled."
+msgstr ""
+
+msgid "PackageRegistry|There are security risks if packages are deleted while request forwarding is enabled. %{docLinkStart}What are the risks?%{docLinkEnd}"
+msgstr ""
+
+msgid "PackageRegistry|There are security risks if packages are deleted while request forwarding is enabled. %{docs_link_start}What are the risks?%{docs_link_end}"
+msgstr ""
+
msgid "PackageRegistry|There was a problem fetching the details for this package."
msgstr ""
@@ -39710,7 +39716,7 @@ msgstr ""
msgid "SecurityReports|Scan details"
msgstr ""
-msgid "SecurityReports|Security Dashboard"
+msgid "SecurityReports|Security dashboard"
msgstr ""
msgid "SecurityReports|Security reports can only be accessed by authorized users."
@@ -39815,7 +39821,7 @@ msgstr ""
msgid "SecurityReports|Upgrade to manage vulnerabilities"
msgstr ""
-msgid "SecurityReports|Vulnerability Report"
+msgid "SecurityReports|Vulnerability report"
msgstr ""
msgid "SecurityReports|Warning parsing security reports"
@@ -50770,6 +50776,9 @@ msgstr ""
msgid "Your work"
msgstr ""
+msgid "Your work items are being imported. Once finished, you'll receive a confirmation email."
+msgstr ""
+
msgid "You’re about to permanently delete the %{issuableType} ‘%{strongOpen}%{issuableTitle}%{strongClose}’. To avoid data loss, consider %{strongOpen}closing this %{issuableType}%{strongClose} instead. Once deleted, it cannot be undone or recovered."
msgstr ""
diff --git a/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb b/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb
index 7b40c8a62c1..f81b8c2cf23 100644
--- a/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/web_ide_new/add_new_directory_in_web_ide_spec.rb
@@ -57,7 +57,11 @@ module QA
end
it 'shows successfully but not able to be committed',
-testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386761' do
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/386761',
+ quarantine: {
+ type: :stale,
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/399544'
+ } do
Page::Project::WebIDE::VSCode.perform do |ide|
ide.wait_for_ide_to_load
ide.create_new_folder(directory_name)
diff --git a/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb b/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb
index 4ba6526ca89..d79befc6837 100644
--- a/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/container_registry/container_registry_omnibus_spec.rb
@@ -1,7 +1,10 @@
# frozen_string_literal: true
module QA
- RSpec.describe 'Package', :orchestrated, :skip_live_env, product_group: :container_registry do
+ RSpec.describe 'Package', :orchestrated, :skip_live_env, product_group: :container_registry, quarantine: {
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/399556',
+ type: :flaky
+ } do
describe 'Self-managed Container Registry' do
include Support::Helpers::MaskToken
diff --git a/scripts/failed_tests.rb b/scripts/failed_tests.rb
index 786d3c24c74..0ba454894b7 100755
--- a/scripts/failed_tests.rb
+++ b/scripts/failed_tests.rb
@@ -12,8 +12,8 @@ class FailedTests
previous_tests_report_path: 'test_results/previous/test_reports.json',
output_directory: 'tmp/previous_failed_tests/',
format: :oneline,
- rspec_pg_regex: /rspec .+ pg12( .+)?/,
- rspec_ee_pg_regex: /rspec-ee .+ pg12( .+)?/
+ rspec_pg_regex: /rspec .+ pg13( .+)?/,
+ rspec_ee_pg_regex: /rspec-ee .+ pg13( .+)?/
}.freeze
def initialize(options)
diff --git a/scripts/rspec_helpers.sh b/scripts/rspec_helpers.sh
index f96f96c4725..c6ec773cf78 100644
--- a/scripts/rspec_helpers.sh
+++ b/scripts/rspec_helpers.sh
@@ -163,7 +163,7 @@ function rspec_paralellized_job() {
read -ra job_name <<< "${CI_JOB_NAME}"
local test_tool="${job_name[0]}"
local test_level="${job_name[1]}"
- local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg12 1/24' would become 'rspec_unit_pg12_1_24'
+ local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg13 1/24' would become 'rspec_unit_pg13_1_24'
local rspec_opts="${1:-}"
local rspec_tests_mapping_enabled="${RSPEC_TESTS_MAPPING_ENABLED:-}"
local spec_folder_prefixes=""
@@ -241,7 +241,7 @@ function retry_failed_rspec_examples() {
# Keep track of the tests that are retried, later consolidated in a single file by the `rspec:flaky-tests-report` job
local failed_examples=$(grep " failed" ${RSPEC_LAST_RUN_RESULTS_FILE})
- local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg12 1/24' would become 'rspec_unit_pg12_1_24'
+ local report_name=$(echo "${CI_JOB_NAME}" | sed -E 's|[/ ]|_|g') # e.g. 'rspec unit pg13 1/24' would become 'rspec_unit_pg13_1_24'
local rspec_flaky_folder_path="$(dirname "${FLAKY_RSPEC_SUITE_REPORT_PATH}")/"
export RETRIED_TESTS_REPORT_PATH="${rspec_flaky_folder_path}retried_tests_${report_name}_report.txt"
diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping
index 2fbafed3987..2f803bcda28 100755
--- a/scripts/verify-tff-mapping
+++ b/scripts/verify-tff-mapping
@@ -81,13 +81,13 @@ tests = [
source: 'db/migrate/20221014034338_populate_releases_access_level_from_repository.rb',
expected: ['spec/migrations/populate_releases_access_level_from_repository_spec.rb']
},
-
+ # rubocop:disable Layout/LineLength
{
explanation: 'Migration should map to its timestamped spec',
- source: 'db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb',
- expected: ['spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb']
+ source: 'db/post_migrate/20230105172120_sync_new_amount_used_with_amount_used_on_ci_namespace_monthly_usages_table.rb',
+ expected: ['spec/migrations/20230105172120_sync_new_amount_used_with_amount_used_on_ci_namespace_monthly_usages_table_spec.rb']
},
-
+ # rubocop:enable Layout/LineLength
{
explanation: 'FOSS views should map to respective spec',
source: 'app/views/admin/dashboard/index.html.haml',
diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb
index ab33195eb83..dbea3592e24 100644
--- a/spec/controllers/projects/project_members_controller_spec.rb
+++ b/spec/controllers/projects/project_members_controller_spec.rb
@@ -560,12 +560,4 @@ RSpec.describe Projects::ProjectMembersController do
end
it_behaves_like 'controller actions'
-
- context 'when project_members_index_by_project_namespace feature flag is disabled' do
- before do
- stub_feature_flags(project_members_index_by_project_namespace: false)
- end
-
- it_behaves_like 'controller actions'
- end
end
diff --git a/spec/controllers/projects/work_items_controller_spec.rb b/spec/controllers/projects/work_items_controller_spec.rb
new file mode 100644
index 00000000000..e0f61a4977b
--- /dev/null
+++ b/spec/controllers/projects/work_items_controller_spec.rb
@@ -0,0 +1,156 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Projects::WorkItemsController, feature_category: :team_planning do
+ let_it_be(:reporter) { create(:user) }
+ let_it_be(:guest) { create(:user) }
+ let_it_be(:project) { create(:project) }
+ let_it_be(:work_item) { create(:work_item, project: project) }
+
+ let(:file) { 'file' }
+
+ before do
+ project.add_reporter(reporter)
+ project.add_guest(guest)
+ end
+
+ shared_examples 'response with 404 status' do
+ it 'renders a not found message' do
+ expect(WorkItems::ImportWorkItemsCsvWorker).not_to receive(:perform_async)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
+
+ shared_examples 'redirects to new session path' do
+ it 'redirects to sign in' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:found)
+ expect(response).to redirect_to(new_user_session_path)
+ end
+ end
+
+ describe 'GET index' do
+ specify do
+ expect(
+ get(:index, params: { namespace_id: project.namespace, project_id: project, work_items_path: work_item.id })
+ ).to have_request_urgency(:low)
+ end
+ end
+
+ describe 'POST authorize' do
+ subject do
+ post(:authorize, params: { namespace_id: project.namespace, project_id: project, file: file })
+ end
+
+ specify do
+ expect(subject).to have_request_urgency(:high)
+ end
+
+ context 'when user is anonymous' do
+ it_behaves_like 'redirects to new session path'
+ end
+ end
+
+ describe 'POST import_csv' do
+ subject { post :import_csv, params: { namespace_id: project.namespace, project_id: project, file: file } }
+
+ let(:upload_service) { double }
+ let(:uploader) { double }
+ let(:upload) { double }
+ let(:upload_id) { 99 }
+
+ specify do
+ expect(subject).to have_request_urgency(:low)
+ end
+
+ context 'with authorized user' do
+ before do
+ sign_in(reporter)
+ allow(controller).to receive(:file_is_valid?).and_return(true)
+ end
+
+ context 'when feature is available' do
+ context 'when the upload is processed successfully' do
+ before do
+ mock_upload
+ end
+
+ it 'renders the correct message' do
+ expect(WorkItems::ImportWorkItemsCsvWorker).to receive(:perform_async)
+ .with(reporter.id, project.id, upload_id)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(json_response['message']).to eq(
+ "Your work items are being imported. Once finished, you'll receive a confirmation email."
+ )
+ end
+ end
+
+ context 'when file is not valid' do
+ before do
+ allow(controller).to receive(:file_is_valid?).and_return(false)
+ end
+
+ it 'renders the error message' do
+ expect(WorkItems::ImportWorkItemsCsvWorker).not_to receive(:perform_async)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['errors'])
+ .to eq('The uploaded file was invalid. Supported file extensions are .csv.')
+ end
+ end
+
+ context 'when service response includes errors' do
+ before do
+ mock_upload(false)
+ end
+
+ it 'renders the error message' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response['errors']).to eq('File upload error.')
+ end
+ end
+ end
+
+ context 'when feature is not available' do
+ before do
+ stub_feature_flags(import_export_work_items_csv: false)
+ end
+
+ it_behaves_like 'response with 404 status'
+ end
+ end
+
+ context 'with unauthorised user' do
+ before do
+ mock_upload
+ sign_in(guest)
+ allow(controller).to receive(:file_is_valid?).and_return(true)
+ end
+
+ it_behaves_like 'response with 404 status'
+ end
+
+ context 'with anonymous user' do
+ it 'redirects to sign in page' do
+ expect(WorkItems::ImportWorkItemsCsvWorker).not_to receive(:perform_async)
+
+ subject
+
+ expect(response).to have_gitlab_http_status(:found)
+ expect(response).to redirect_to(new_user_session_path)
+ end
+ end
+ end
+end
diff --git a/spec/factories/ci/reports/security/findings.rb b/spec/factories/ci/reports/security/findings.rb
index 78c11210f97..c57a2dd479f 100644
--- a/spec/factories/ci/reports/security/findings.rb
+++ b/spec/factories/ci/reports/security/findings.rb
@@ -27,6 +27,7 @@ FactoryBot.define do
url: "https://crypto.stackexchange.com/questions/31428/pbewithmd5anddes-cipher-does-not-check-for-integrity-first"
}
],
+ raw_source_code_extract: 'AES/ECB/NoPadding',
evidence: {
summary: 'Credit card detected',
request: {
diff --git a/spec/factories/service_desk/custom_email_credential.rb b/spec/factories/service_desk/custom_email_credential.rb
new file mode 100644
index 00000000000..da131dd8250
--- /dev/null
+++ b/spec/factories/service_desk/custom_email_credential.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :service_desk_custom_email_credential, class: '::ServiceDesk::CustomEmailCredential' do
+ project
+ smtp_address { "smtp.example.com" }
+ smtp_username { "text@example.com" }
+ smtp_port { 587 }
+ smtp_password { "supersecret" }
+ end
+end
diff --git a/spec/features/groups/settings/packages_and_registries_spec.rb b/spec/features/groups/settings/packages_and_registries_spec.rb
index a6c980f539c..8ea8dc9219a 100644
--- a/spec/features/groups/settings/packages_and_registries_spec.rb
+++ b/spec/features/groups/settings/packages_and_registries_spec.rb
@@ -61,7 +61,8 @@ RSpec.describe 'Group Package and registry settings', feature_category: :package
wait_for_requests
- expect(page).to be_axe_clean.within '[data-testid="packages-and-registries-group-settings"]'
+ expect(page).to be_axe_clean.within('[data-testid="packages-and-registries-group-settings"]')
+ .skipping :'link-in-text-block'
end
it 'has a Duplicate packages section', :js do
diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb
index 3610c350f67..d1f8929ee8a 100644
--- a/spec/features/issues/issue_sidebar_spec.rb
+++ b/spec/features/issues/issue_sidebar_spec.rb
@@ -90,8 +90,8 @@ RSpec.describe 'Issue Sidebar', feature_category: :team_planning do
find('.block.assignee .edit-link').click
end
- expect(page.all('.dropdown-menu-user li').length).to eq(1)
- expect(find('.dropdown-input-field').value).to eq(user2.name)
+ expect(page.all('.dropdown-menu-user li').length).to eq(6)
+ expect(find('.dropdown-input-field').value).to eq('')
end
it 'shows label text as "Apply" when assignees are changed' do
diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb
index 098d1201939..01d3d81deb6 100644
--- a/spec/features/projects/pipelines/pipeline_spec.rb
+++ b/spec/features/projects/pipelines/pipeline_spec.rb
@@ -133,17 +133,6 @@ RSpec.describe 'Pipeline', :js, feature_category: :projects do
expect(page).to have_content("and was queued for #{finished_pipeline.queued_duration} seconds")
end
end
-
- it 'shows pipeline stats with flag off' do
- stub_feature_flags(refactor_ci_minutes_consumption: false)
-
- visit project_pipeline_path(project, finished_pipeline)
-
- within '.pipeline-info' do
- expect(page).to have_content("in #{finished_pipeline.duration} seconds " \
- "and was queued for #{finished_pipeline.queued_duration} seconds")
- end
- end
end
context 'pipeline has not finished' do
diff --git a/spec/finders/access_requests_finder_spec.rb b/spec/finders/access_requests_finder_spec.rb
index b82495d55fd..5d7f35581ee 100644
--- a/spec/finders/access_requests_finder_spec.rb
+++ b/spec/finders/access_requests_finder_spec.rb
@@ -96,13 +96,4 @@ RSpec.describe AccessRequestsFinder do
it_behaves_like '#execute'
it_behaves_like '#execute!'
-
- context 'when project_members_index_by_project_namespace feature flag is disabled' do
- before do
- stub_feature_flags(project_members_index_by_project_namespace: false)
- end
-
- it_behaves_like '#execute'
- it_behaves_like '#execute!'
- end
end
diff --git a/spec/finders/members_finder_spec.rb b/spec/finders/members_finder_spec.rb
index c48a0271471..dd995e99b9f 100644
--- a/spec/finders/members_finder_spec.rb
+++ b/spec/finders/members_finder_spec.rb
@@ -207,12 +207,4 @@ RSpec.describe MembersFinder, feature_category: :subgroups do
end
it_behaves_like '#execute'
-
- context 'when project_members_index_by_project_namespace feature flag is disabled' do
- before do
- stub_feature_flags(project_members_index_by_project_namespace: false)
- end
-
- it_behaves_like '#execute'
- end
end
diff --git a/spec/fixtures/scripts/test_report.json b/spec/fixtures/scripts/test_report.json
index 29fd9a4bcb5..520ab3a8578 100644
--- a/spec/fixtures/scripts/test_report.json
+++ b/spec/fixtures/scripts/test_report.json
@@ -1,7 +1,7 @@
{
"suites": [
{
- "name": "rspec unit pg12",
+ "name": "rspec unit pg13",
"total_time": 975.6635620000018,
"total_count": 3811,
"success_count": 3800,
diff --git a/spec/frontend/packages_and_registries/settings/group/components/packages_forwarding_settings_spec.js b/spec/frontend/packages_and_registries/settings/group/components/packages_forwarding_settings_spec.js
index d57077b31c8..8a66a685733 100644
--- a/spec/frontend/packages_and_registries/settings/group/components/packages_forwarding_settings_spec.js
+++ b/spec/frontend/packages_and_registries/settings/group/components/packages_forwarding_settings_spec.js
@@ -1,12 +1,13 @@
import Vue from 'vue';
-import { GlButton } from '@gitlab/ui';
+import { GlButton, GlLink, GlSprintf } from '@gitlab/ui';
import VueApollo from 'vue-apollo';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
+import { s__ } from '~/locale';
import component from '~/packages_and_registries/settings/group/components/packages_forwarding_settings.vue';
import {
- PACKAGE_FORWARDING_SETTINGS_DESCRIPTION,
+ REQUEST_FORWARDING_HELP_PAGE_PATH,
PACKAGE_FORWARDING_SETTINGS_HEADER,
} from '~/packages_and_registries/settings/group/constants';
@@ -60,6 +61,7 @@ describe('Packages Forwarding Settings', () => {
forwardSettings,
},
stubs: {
+ GlSprintf,
SettingsBlock,
},
});
@@ -72,6 +74,7 @@ describe('Packages Forwarding Settings', () => {
const findMavenForwardingSettings = () => wrapper.findByTestId('maven');
const findNpmForwardingSettings = () => wrapper.findByTestId('npm');
const findPyPiForwardingSettings = () => wrapper.findByTestId('pypi');
+ const findRequestForwardingDocsLink = () => wrapper.findComponent(GlLink);
const fillApolloCache = () => {
apolloProvider.defaultClient.cache.writeQuery({
@@ -111,8 +114,18 @@ describe('Packages Forwarding Settings', () => {
it('has the correct description text', () => {
mountComponent();
- expect(findDescription().text()).toMatchInterpolatedText(
- PACKAGE_FORWARDING_SETTINGS_DESCRIPTION,
+ expect(findDescription().text()).toBe(
+ s__(
+ 'PackageRegistry|Forward package requests to a public registry if the packages are not found in the GitLab package registry.',
+ ),
+ );
+ });
+
+ it('has the right help link', () => {
+ mountComponent();
+
+ expect(findRequestForwardingDocsLink().attributes('href')).toBe(
+ REQUEST_FORWARDING_HELP_PAGE_PATH,
);
});
diff --git a/spec/lib/api/helpers/members_helpers_spec.rb b/spec/lib/api/helpers/members_helpers_spec.rb
index 987d5ba9f6c..ee1ae6b1781 100644
--- a/spec/lib/api/helpers/members_helpers_spec.rb
+++ b/spec/lib/api/helpers/members_helpers_spec.rb
@@ -22,15 +22,6 @@ RSpec.describe API::Helpers::MembersHelpers, feature_category: :subgroups do
it_behaves_like 'returns all direct members'
it_behaves_like 'query with source filters'
-
- context 'when project_members_index_by_project_namespace feature flag is disabled' do
- before do
- stub_feature_flags(project_members_index_by_project_namespace: false)
- end
-
- it_behaves_like 'returns all direct members'
- it_behaves_like 'query with source filters'
- end
end
context 'for a project' do
@@ -39,15 +30,6 @@ RSpec.describe API::Helpers::MembersHelpers, feature_category: :subgroups do
it_behaves_like 'returns all direct members'
it_behaves_like 'query without source filters'
-
- context 'when project_members_index_by_project_namespace feature flag is disabled' do
- before do
- stub_feature_flags(project_members_index_by_project_namespace: false)
- end
-
- it_behaves_like 'returns all direct members'
- it_behaves_like 'query with source filters'
- end
end
end
end
diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb
deleted file mode 100644
index 876eb070745..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren, :migration, schema: 20210826171758 do
- let(:namespaces_table) { table(:namespaces) }
-
- let!(:user_namespace) { namespaces_table.create!(id: 1, name: 'user', path: 'user', type: nil) }
- let!(:root_group) { namespaces_table.create!(id: 2, name: 'group', path: 'group', type: 'Group', parent_id: nil) }
- let!(:sub_group) { namespaces_table.create!(id: 3, name: 'subgroup', path: 'subgroup', type: 'Group', parent_id: 2) }
-
- describe '#perform' do
- it 'backfills traversal_ids for child namespaces' do
- described_class.new.perform(1, 3, 5)
-
- expect(user_namespace.reload.traversal_ids).to eq([])
- expect(root_group.reload.traversal_ids).to eq([])
- expect(sub_group.reload.traversal_ids).to eq([root_group.id, sub_group.id])
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb
deleted file mode 100644
index ad9b54608c6..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots, :migration, schema: 20210826171758 do
- let(:namespaces_table) { table(:namespaces) }
-
- let!(:user_namespace) { namespaces_table.create!(id: 1, name: 'user', path: 'user', type: nil) }
- let!(:root_group) { namespaces_table.create!(id: 2, name: 'group', path: 'group', type: 'Group', parent_id: nil) }
- let!(:sub_group) { namespaces_table.create!(id: 3, name: 'subgroup', path: 'subgroup', type: 'Group', parent_id: 2) }
-
- describe '#perform' do
- it 'backfills traversal_ids for root namespaces' do
- described_class.new.perform(1, 3, 5)
-
- expect(user_namespace.reload.traversal_ids).to eq([user_namespace.id])
- expect(root_group.reload.traversal_ids).to eq([root_group.id])
- expect(sub_group.reload.traversal_ids).to eq([])
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb
index 80fd86e90bb..4a50d08b2aa 100644
--- a/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb
+++ b/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migration, schema: 20210826171758,
+RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migration, schema: 20211202041233,
feature_category: :source_code_management do
let(:gitlab_shell) { Gitlab::Shell.new }
let(:users) { table(:users) }
diff --git a/spec/lib/gitlab/background_migration/backfill_upvotes_count_on_issues_spec.rb b/spec/lib/gitlab/background_migration/backfill_upvotes_count_on_issues_spec.rb
deleted file mode 100644
index 7142aea3ab2..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_upvotes_count_on_issues_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillUpvotesCountOnIssues, schema: 20210826171758 do
- let(:award_emoji) { table(:award_emoji) }
-
- let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') }
- let!(:project1) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:project2) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:issue1) { table(:issues).create!(project_id: project1.id) }
- let!(:issue2) { table(:issues).create!(project_id: project2.id) }
- let!(:issue3) { table(:issues).create!(project_id: project2.id) }
- let!(:issue4) { table(:issues).create!(project_id: project2.id) }
-
- describe '#perform' do
- before do
- add_upvotes(issue1, :thumbsdown, 1)
- add_upvotes(issue2, :thumbsup, 2)
- add_upvotes(issue2, :thumbsdown, 1)
- add_upvotes(issue3, :thumbsup, 3)
- add_upvotes(issue4, :thumbsup, 4)
- end
-
- it 'updates upvotes_count' do
- subject.perform(issue1.id, issue4.id)
-
- expect(issue1.reload.upvotes_count).to eq(0)
- expect(issue2.reload.upvotes_count).to eq(2)
- expect(issue3.reload.upvotes_count).to eq(3)
- expect(issue4.reload.upvotes_count).to eq(4)
- end
- end
-
- private
-
- def add_upvotes(issue, name, count)
- count.times do
- award_emoji.create!(
- name: name.to_s,
- awardable_type: 'Issue',
- awardable_id: issue.id
- )
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/backfill_user_namespace_spec.rb b/spec/lib/gitlab/background_migration/backfill_user_namespace_spec.rb
deleted file mode 100644
index 395248b786d..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_user_namespace_spec.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillUserNamespace, :migration, schema: 20210930211936 do
- let(:migration) { described_class.new }
- let(:namespaces_table) { table(:namespaces) }
-
- let(:table_name) { 'namespaces' }
- let(:batch_column) { :id }
- let(:sub_batch_size) { 100 }
- let(:pause_ms) { 0 }
-
- subject(:perform_migration) { migration.perform(1, 10, table_name, batch_column, sub_batch_size, pause_ms) }
-
- before do
- namespaces_table.create!(id: 1, name: 'test1', path: 'test1', type: nil)
- namespaces_table.create!(id: 2, name: 'test2', path: 'test2', type: 'User')
- namespaces_table.create!(id: 3, name: 'test3', path: 'test3', type: 'Group')
- namespaces_table.create!(id: 4, name: 'test4', path: 'test4', type: nil)
- namespaces_table.create!(id: 11, name: 'test11', path: 'test11', type: nil)
- end
-
- it 'backfills `type` for the selected records', :aggregate_failures do
- queries = ActiveRecord::QueryRecorder.new do
- perform_migration
- end
-
- expect(queries.count).to eq(3)
- expect(namespaces_table.where(type: 'User').count).to eq 3
- expect(namespaces_table.where(type: 'User').pluck(:id)).to match_array([1, 2, 4])
- end
-
- it 'tracks timings of queries' do
- expect(migration.batch_metrics.timings).to be_empty
-
- expect { perform_migration }.to change { migration.batch_metrics.timings }
- end
-end
diff --git a/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb b/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb
deleted file mode 100644
index 5ffe665f0ad..00000000000
--- a/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb
+++ /dev/null
@@ -1,85 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::CleanupOrphanedLfsObjectsProjects, schema: 20210826171758 do
- let(:lfs_objects_projects) { table(:lfs_objects_projects) }
- let(:lfs_objects) { table(:lfs_objects) }
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
-
- let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') }
- let(:project) { projects.create!(namespace_id: namespace.id) }
- let(:another_project) { projects.create!(namespace_id: namespace.id) }
- let(:lfs_object) { lfs_objects.create!(oid: 'abcdef', size: 1) }
- let(:another_lfs_object) { lfs_objects.create!(oid: '1abcde', size: 2) }
-
- let!(:without_object1) { create_object(project_id: project.id) }
- let!(:without_object2) { create_object(project_id: another_project.id) }
- let!(:without_object3) { create_object(project_id: another_project.id) }
- let!(:with_project_and_object1) { create_object(project_id: project.id, lfs_object_id: lfs_object.id) }
- let!(:with_project_and_object2) { create_object(project_id: project.id, lfs_object_id: another_lfs_object.id) }
- let!(:with_project_and_object3) { create_object(project_id: another_project.id, lfs_object_id: another_lfs_object.id) }
- let!(:without_project1) { create_object(lfs_object_id: lfs_object.id) }
- let!(:without_project2) { create_object(lfs_object_id: another_lfs_object.id) }
- let!(:without_project_and_object) { create_object }
-
- def create_object(project_id: non_existing_record_id, lfs_object_id: non_existing_record_id)
- lfs_objects_project = nil
-
- ActiveRecord::Base.connection.disable_referential_integrity do
- lfs_objects_project = lfs_objects_projects.create!(project_id: project_id, lfs_object_id: lfs_object_id)
- end
-
- lfs_objects_project
- end
-
- subject { described_class.new }
-
- describe '#perform' do
- it 'lfs_objects_projects without an existing lfs object or project are removed' do
- subject.perform(without_object1.id, without_object3.id)
-
- expect(lfs_objects_projects.all).to match_array(
- [
- with_project_and_object1, with_project_and_object2, with_project_and_object3,
- without_project1, without_project2, without_project_and_object
- ])
-
- subject.perform(with_project_and_object1.id, with_project_and_object3.id)
-
- expect(lfs_objects_projects.all).to match_array(
- [
- with_project_and_object1, with_project_and_object2, with_project_and_object3,
- without_project1, without_project2, without_project_and_object
- ])
-
- subject.perform(without_project1.id, without_project_and_object.id)
-
- expect(lfs_objects_projects.all).to match_array(
- [
- with_project_and_object1, with_project_and_object2, with_project_and_object3
- ])
-
- expect(lfs_objects.ids).to contain_exactly(lfs_object.id, another_lfs_object.id)
- expect(projects.ids).to contain_exactly(project.id, another_project.id)
- end
-
- it 'cache for affected projects is being reset' do
- expect(ProjectCacheWorker).to receive(:bulk_perform_in) do |delay, args|
- expect(delay).to eq(1.minute)
- expect(args).to match_array([[project.id, [], [:lfs_objects_size]], [another_project.id, [], [:lfs_objects_size]]])
- end
-
- subject.perform(without_object1.id, with_project_and_object1.id)
-
- expect(ProjectCacheWorker).not_to receive(:bulk_perform_in)
-
- subject.perform(with_project_and_object1.id, with_project_and_object3.id)
-
- expect(ProjectCacheWorker).not_to receive(:bulk_perform_in)
-
- subject.perform(without_project1.id, without_project_and_object.id)
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb b/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb
deleted file mode 100644
index 8f058c875a2..00000000000
--- a/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedDeployments, :migration, schema: 20210826171758 do
- let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let!(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:environment) { table(:environments).create!(name: 'production', slug: 'production', project_id: project.id) }
- let(:background_migration_jobs) { table(:background_migration_jobs) }
-
- before do
- create_deployment!(environment.id, project.id)
- end
-
- it 'deletes only orphaned deployments' do
- expect(valid_deployments.pluck(:id)).not_to be_empty
-
- subject.perform(table(:deployments).minimum(:id), table(:deployments).maximum(:id))
-
- expect(valid_deployments.pluck(:id)).not_to be_empty
- end
-
- it 'marks jobs as done' do
- first_job = background_migration_jobs.create!(
- class_name: 'DeleteOrphanedDeployments',
- arguments: [table(:deployments).minimum(:id), table(:deployments).minimum(:id)]
- )
-
- subject.perform(table(:deployments).minimum(:id), table(:deployments).minimum(:id))
-
- expect(first_job.reload.status).to eq(Gitlab::Database::BackgroundMigrationJob.statuses[:succeeded])
- end
-
- private
-
- def valid_deployments
- table(:deployments).where('EXISTS (SELECT 1 FROM environments WHERE deployments.environment_id = environments.id)')
- end
-
- def orphaned_deployments
- table(:deployments).where('NOT EXISTS (SELECT 1 FROM environments WHERE deployments.environment_id = environments.id)')
- end
-
- def create_deployment!(environment_id, project_id)
- table(:deployments).create!(
- environment_id: environment_id,
- project_id: project_id,
- ref: 'master',
- tag: false,
- sha: 'x',
- status: 1,
- iid: table(:deployments).count + 1)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images_spec.rb b/spec/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images_spec.rb
deleted file mode 100644
index e7b0471810d..00000000000
--- a/spec/lib/gitlab/background_migration/disable_expiration_policies_linked_to_no_container_images_spec.rb
+++ /dev/null
@@ -1,142 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::DisableExpirationPoliciesLinkedToNoContainerImages, :migration, schema: 20220326161803 do # rubocop:disable Layout/LineLength
- let!(:projects) { table(:projects) }
- let!(:container_expiration_policies) { table(:container_expiration_policies) }
- let!(:container_repositories) { table(:container_repositories) }
- let!(:namespaces) { table(:namespaces) }
-
- let!(:namespace) { namespaces.create!(name: 'test', path: 'test') }
-
- let!(:policy1) { create_expiration_policy(project_id: 1, enabled: true) }
- let!(:policy2) { create_expiration_policy(project_id: 2, enabled: false) }
- let!(:policy3) { create_expiration_policy(project_id: 3, enabled: false) }
- let!(:policy4) { create_expiration_policy(project_id: 4, enabled: true, with_images: true) }
- let!(:policy5) { create_expiration_policy(project_id: 5, enabled: false, with_images: true) }
- let!(:policy6) { create_expiration_policy(project_id: 6, enabled: false) }
- let!(:policy7) { create_expiration_policy(project_id: 7, enabled: true) }
- let!(:policy8) { create_expiration_policy(project_id: 8, enabled: true, with_images: true) }
- let!(:policy9) { create_expiration_policy(project_id: 9, enabled: true) }
-
- describe '#perform' do
- subject { described_class.new.perform(from_id, to_id) }
-
- shared_examples 'disabling policies with no images' do
- it 'disables the proper policies' do
- subject
-
- rows = container_expiration_policies.order(:project_id).to_h do |row|
- [row.project_id, row.enabled]
- end
- expect(rows).to eq(expected_rows)
- end
- end
-
- context 'the whole range' do
- let(:from_id) { 1 }
- let(:to_id) { 9 }
-
- it_behaves_like 'disabling policies with no images' do
- let(:expected_rows) do
- {
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => true,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => true,
- 9 => false
- }
- end
- end
- end
-
- context 'a range with no policies to disable' do
- let(:from_id) { 2 }
- let(:to_id) { 6 }
-
- it_behaves_like 'disabling policies with no images' do
- let(:expected_rows) do
- {
- 1 => true,
- 2 => false,
- 3 => false,
- 4 => true,
- 5 => false,
- 6 => false,
- 7 => true,
- 8 => true,
- 9 => true
- }
- end
- end
- end
-
- context 'a range with only images' do
- let(:from_id) { 4 }
- let(:to_id) { 5 }
-
- it_behaves_like 'disabling policies with no images' do
- let(:expected_rows) do
- {
- 1 => true,
- 2 => false,
- 3 => false,
- 4 => true,
- 5 => false,
- 6 => false,
- 7 => true,
- 8 => true,
- 9 => true
- }
- end
- end
- end
-
- context 'a range with a single element' do
- let(:from_id) { 9 }
- let(:to_id) { 9 }
-
- it_behaves_like 'disabling policies with no images' do
- let(:expected_rows) do
- {
- 1 => true,
- 2 => false,
- 3 => false,
- 4 => true,
- 5 => false,
- 6 => false,
- 7 => true,
- 8 => true,
- 9 => false
- }
- end
- end
- end
- end
-
- def create_expiration_policy(project_id:, enabled:, with_images: false)
- projects.create!(id: project_id, namespace_id: namespace.id, name: "gitlab-#{project_id}")
-
- if with_images
- container_repositories.create!(project_id: project_id, name: "image-#{project_id}")
- end
-
- container_expiration_policies.create!(
- enabled: enabled,
- project_id: project_id
- )
- end
-
- def enabled_policies
- container_expiration_policies.where(enabled: true)
- end
-
- def disabled_policies
- container_expiration_policies.where(enabled: false)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/drop_invalid_security_findings_spec.rb b/spec/lib/gitlab/background_migration/drop_invalid_security_findings_spec.rb
deleted file mode 100644
index 5fdd8683d06..00000000000
--- a/spec/lib/gitlab/background_migration/drop_invalid_security_findings_spec.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::DropInvalidSecurityFindings, :suppress_gitlab_schemas_validate_connection,
- schema: 20211108211434 do
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user', type: Namespaces::UserNamespace.sti_name) }
- let(:project) { table(:projects).create!(namespace_id: namespace.id) }
-
- let(:pipelines) { table(:ci_pipelines) }
- let!(:pipeline) { pipelines.create!(project_id: project.id) }
-
- let(:ci_builds) { table(:ci_builds) }
- let!(:ci_build) { ci_builds.create! }
-
- let(:security_scans) { table(:security_scans) }
- let!(:security_scan) do
- security_scans.create!(
- scan_type: 1,
- status: 1,
- build_id: ci_build.id,
- project_id: project.id,
- pipeline_id: pipeline.id
- )
- end
-
- let(:vulnerability_scanners) { table(:vulnerability_scanners) }
- let!(:vulnerability_scanner) { vulnerability_scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
-
- let(:security_findings) { table(:security_findings) }
- let!(:security_finding_without_uuid) do
- security_findings.create!(
- severity: 1,
- confidence: 1,
- scan_id: security_scan.id,
- scanner_id: vulnerability_scanner.id,
- uuid: nil
- )
- end
-
- let!(:security_finding_with_uuid) do
- security_findings.create!(
- severity: 1,
- confidence: 1,
- scan_id: security_scan.id,
- scanner_id: vulnerability_scanner.id,
- uuid: 'bd95c085-71aa-51d7-9bb6-08ae669c262e'
- )
- end
-
- let(:sub_batch_size) { 10_000 }
-
- subject { described_class.new.perform(security_finding_without_uuid.id, security_finding_with_uuid.id, sub_batch_size) }
-
- it 'drops Security::Finding objects with no UUID' do
- expect { subject }.to change(security_findings, :count).from(2).to(1)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb b/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb
deleted file mode 100644
index 8f3ef44e00c..00000000000
--- a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb
+++ /dev/null
@@ -1,126 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::DropInvalidVulnerabilities, schema: 20210826171758 do
- let!(:background_migration_jobs) { table(:background_migration_jobs) }
- let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let!(:users) { table(:users) }
- let!(:user) { create_user! }
- let!(:project) { table(:projects).create!(id: 123, namespace_id: namespace.id) }
-
- let!(:scanners) { table(:vulnerability_scanners) }
- let!(:scanner) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let!(:different_scanner) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') }
-
- let!(:vulnerabilities) { table(:vulnerabilities) }
- let!(:vulnerability_with_finding) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:vulnerability_without_finding) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:vulnerability_identifiers) { table(:vulnerability_identifiers) }
- let!(:primary_identifier) do
- vulnerability_identifiers.create!(
- project_id: project.id,
- external_type: 'uuid-v5',
- external_id: 'uuid-v5',
- fingerprint: '7e394d1b1eb461a7406d7b1e08f057a1cf11287a',
- name: 'Identifier for UUIDv5')
- end
-
- let!(:vulnerabilities_findings) { table(:vulnerability_occurrences) }
- let!(:finding) do
- create_finding!(
- vulnerability_id: vulnerability_with_finding.id,
- project_id: project.id,
- scanner_id: scanner.id,
- primary_identifier_id: primary_identifier.id
- )
- end
-
- let(:succeeded_status) { 1 }
- let(:pending_status) { 0 }
-
- it 'drops Vulnerabilities without any Findings' do
- expect(vulnerabilities.pluck(:id)).to eq([vulnerability_with_finding.id, vulnerability_without_finding.id])
-
- expect { subject.perform(vulnerability_with_finding.id, vulnerability_without_finding.id) }.to change(vulnerabilities, :count).by(-1)
-
- expect(vulnerabilities.pluck(:id)).to eq([vulnerability_with_finding.id])
- end
-
- it 'marks jobs as done' do
- background_migration_jobs.create!(
- class_name: 'DropInvalidVulnerabilities',
- arguments: [vulnerability_with_finding.id, vulnerability_with_finding.id]
- )
-
- background_migration_jobs.create!(
- class_name: 'DropInvalidVulnerabilities',
- arguments: [vulnerability_without_finding.id, vulnerability_without_finding.id]
- )
-
- subject.perform(vulnerability_with_finding.id, vulnerability_with_finding.id)
-
- expect(background_migration_jobs.first.status).to eq(succeeded_status)
- expect(background_migration_jobs.second.status).to eq(pending_status)
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- vulnerabilities_findings.create!(
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: primary_identifier_id,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- )
- end
- # rubocop:enable Metrics/ParameterLists
-
- def create_user!(name: "Example User", email: "user@example.com", user_type: nil)
- users.create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- user_type: user_type,
- confirmed_at: Time.current
- )
- end
-end
diff --git a/spec/lib/gitlab/background_migration/extract_project_topics_into_separate_table_spec.rb b/spec/lib/gitlab/background_migration/extract_project_topics_into_separate_table_spec.rb
deleted file mode 100644
index 586e75ffb37..00000000000
--- a/spec/lib/gitlab/background_migration/extract_project_topics_into_separate_table_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::ExtractProjectTopicsIntoSeparateTable,
- :suppress_gitlab_schemas_validate_connection, schema: 20210826171758 do
- it 'correctly extracts project topics into separate table' do
- namespaces = table(:namespaces)
- projects = table(:projects)
- taggings = table(:taggings)
- tags = table(:tags)
- project_topics = table(:project_topics)
- topics = table(:topics)
-
- namespace = namespaces.create!(name: 'foo', path: 'foo')
- project = projects.create!(namespace_id: namespace.id)
- tag_1 = tags.create!(name: 'Topic1')
- tag_2 = tags.create!(name: 'Topic2')
- tag_3 = tags.create!(name: 'Topic3')
- topic_3 = topics.create!(name: 'Topic3')
- tagging_1 = taggings.create!(taggable_type: 'Project', taggable_id: project.id, context: 'topics', tag_id: tag_1.id)
- tagging_2 = taggings.create!(taggable_type: 'Project', taggable_id: project.id, context: 'topics', tag_id: tag_2.id)
- other_tagging = taggings.create!(taggable_type: 'Other', taggable_id: project.id, context: 'topics', tag_id: tag_1.id)
- tagging_3 = taggings.create!(taggable_type: 'Project', taggable_id: project.id, context: 'topics', tag_id: tag_3.id)
- tagging_4 = taggings.create!(taggable_type: 'Project', taggable_id: -1, context: 'topics', tag_id: tag_1.id)
- tagging_5 = taggings.create!(taggable_type: 'Project', taggable_id: project.id, context: 'topics', tag_id: -1)
-
- subject.perform(tagging_1.id, tagging_5.id)
-
- # Tagging records
- expect { tagging_1.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { tagging_2.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { other_tagging.reload }.not_to raise_error
- expect { tagging_3.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { tagging_4.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { tagging_5.reload }.to raise_error(ActiveRecord::RecordNotFound)
-
- # Topic records
- topic_1 = topics.find_by(name: 'Topic1')
- topic_2 = topics.find_by(name: 'Topic2')
- expect(topics.all).to contain_exactly(topic_1, topic_2, topic_3)
-
- # ProjectTopic records
- expect(project_topics.all.map(&:topic_id)).to contain_exactly(topic_1.id, topic_2.id, topic_3.id)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/fix_first_mentioned_in_commit_at_spec.rb b/spec/lib/gitlab/background_migration/fix_first_mentioned_in_commit_at_spec.rb
deleted file mode 100644
index 7f15aceca42..00000000000
--- a/spec/lib/gitlab/background_migration/fix_first_mentioned_in_commit_at_spec.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require Rails.root.join('db', 'post_migrate', '20211004110500_add_temporary_index_to_issue_metrics.rb')
-
-RSpec.describe Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt, :migration, schema: 20211004110500 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:users) { table(:users) }
- let(:merge_requests) { table(:merge_requests) }
- let(:issues) { table(:issues) }
- let(:issue_metrics) { table(:issue_metrics) }
- let(:merge_requests_closing_issues) { table(:merge_requests_closing_issues) }
- let(:diffs) { table(:merge_request_diffs) }
- let(:ten_days_ago) { 10.days.ago }
- let(:commits) do
- table(:merge_request_diff_commits).tap do |t|
- t.extend(SuppressCompositePrimaryKeyWarning)
- end
- end
-
- let(:namespace) { namespaces.create!(name: 'ns', path: 'ns') }
- let(:project) { projects.create!(namespace_id: namespace.id) }
-
- let!(:issue1) do
- issues.create!(
- title: 'issue',
- description: 'description',
- project_id: project.id
- )
- end
-
- let!(:issue2) do
- issues.create!(
- title: 'issue',
- description: 'description',
- project_id: project.id
- )
- end
-
- let!(:merge_request1) do
- merge_requests.create!(
- source_branch: 'a',
- target_branch: 'master',
- target_project_id: project.id
- )
- end
-
- let!(:merge_request2) do
- merge_requests.create!(
- source_branch: 'b',
- target_branch: 'master',
- target_project_id: project.id
- )
- end
-
- let!(:merge_request_closing_issue1) do
- merge_requests_closing_issues.create!(issue_id: issue1.id, merge_request_id: merge_request1.id)
- end
-
- let!(:merge_request_closing_issue2) do
- merge_requests_closing_issues.create!(issue_id: issue2.id, merge_request_id: merge_request2.id)
- end
-
- let!(:diff1) { diffs.create!(merge_request_id: merge_request1.id) }
- let!(:diff2) { diffs.create!(merge_request_id: merge_request1.id) }
-
- let!(:other_diff) { diffs.create!(merge_request_id: merge_request2.id) }
-
- let!(:commit1) do
- commits.create!(
- merge_request_diff_id: diff2.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('aaa'),
- authored_date: 5.days.ago
- )
- end
-
- let!(:commit2) do
- commits.create!(
- merge_request_diff_id: diff2.id,
- relative_order: 1,
- sha: Gitlab::Database::ShaAttribute.serialize('aaa'),
- authored_date: 10.days.ago
- )
- end
-
- let!(:commit3) do
- commits.create!(
- merge_request_diff_id: other_diff.id,
- relative_order: 1,
- sha: Gitlab::Database::ShaAttribute.serialize('aaa'),
- authored_date: 5.days.ago
- )
- end
-
- def run_migration
- described_class
- .new
- .perform(issue_metrics.minimum(:issue_id), issue_metrics.maximum(:issue_id))
- end
-
- shared_examples 'fixes first_mentioned_in_commit_at' do
- it "marks successful slices as completed" do
- min_issue_id = issue_metrics.minimum(:issue_id)
- max_issue_id = issue_metrics.maximum(:issue_id)
-
- expect(subject).to receive(:mark_job_as_succeeded).with(min_issue_id, max_issue_id)
-
- subject.perform(min_issue_id, max_issue_id)
- end
-
- context 'when the persisted first_mentioned_in_commit_at is later than the first commit authored_date' do
- it 'updates the issue_metrics record' do
- record1 = issue_metrics.create!(issue_id: issue1.id, first_mentioned_in_commit_at: Time.current)
- record2 = issue_metrics.create!(issue_id: issue2.id, first_mentioned_in_commit_at: Time.current)
-
- run_migration
- record1.reload
- record2.reload
-
- expect(record1.first_mentioned_in_commit_at).to be_within(2.seconds).of(commit2.authored_date)
- expect(record2.first_mentioned_in_commit_at).to be_within(2.seconds).of(commit3.authored_date)
- end
- end
-
- context 'when the persisted first_mentioned_in_commit_at is earlier than the first commit authored_date' do
- it 'does not update the issue_metrics record' do
- record = issue_metrics.create!(issue_id: issue1.id, first_mentioned_in_commit_at: 20.days.ago)
-
- expect { run_migration }.not_to change { record.reload.first_mentioned_in_commit_at }
- end
- end
-
- context 'when the first_mentioned_in_commit_at is null' do
- it 'does nothing' do
- record = issue_metrics.create!(issue_id: issue1.id, first_mentioned_in_commit_at: nil)
-
- expect { run_migration }.not_to change { record.reload.first_mentioned_in_commit_at }
- end
- end
- end
-
- describe 'running the migration when first_mentioned_in_commit_at is timestamp without time zone' do
- it_behaves_like 'fixes first_mentioned_in_commit_at'
- end
-
- describe 'running the migration when first_mentioned_in_commit_at is timestamp with time zone' do
- around do |example|
- AddTemporaryIndexToIssueMetrics.new.down
-
- ActiveRecord::Base.connection.execute "ALTER TABLE issue_metrics ALTER first_mentioned_in_commit_at type timestamp with time zone"
- Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics.reset_column_information
- AddTemporaryIndexToIssueMetrics.new.up
-
- example.run
-
- AddTemporaryIndexToIssueMetrics.new.down
- ActiveRecord::Base.connection.execute "ALTER TABLE issue_metrics ALTER first_mentioned_in_commit_at type timestamp without time zone"
- Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics.reset_column_information
- AddTemporaryIndexToIssueMetrics.new.up
- end
-
- it_behaves_like 'fixes first_mentioned_in_commit_at'
- end
-end
diff --git a/spec/lib/gitlab/background_migration/fix_merge_request_diff_commit_users_spec.rb b/spec/lib/gitlab/background_migration/fix_merge_request_diff_commit_users_spec.rb
deleted file mode 100644
index 99df21562b0..00000000000
--- a/spec/lib/gitlab/background_migration/fix_merge_request_diff_commit_users_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-# rubocop: disable RSpec/FactoriesInMigrationSpecs
-RSpec.describe Gitlab::BackgroundMigration::FixMergeRequestDiffCommitUsers do
- let(:migration) { described_class.new }
-
- describe '#perform' do
- context 'when the project exists' do
- it 'does nothing' do
- project = create(:project)
-
- expect { migration.perform(project.id) }.not_to raise_error
- end
- end
-
- context 'when the project does not exist' do
- it 'does nothing' do
- expect { migration.perform(-1) }.not_to raise_error
- end
- end
- end
-end
-# rubocop: enable RSpec/FactoriesInMigrationSpecs
diff --git a/spec/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users_spec.rb b/spec/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users_spec.rb
deleted file mode 100644
index c3ae2cc060c..00000000000
--- a/spec/lib/gitlab/background_migration/migrate_merge_request_diff_commit_users_spec.rb
+++ /dev/null
@@ -1,413 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers, schema: 20211012134316 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:users) { table(:users) }
- let(:merge_requests) { table(:merge_requests) }
- let(:diffs) { table(:merge_request_diffs) }
- let(:commits) do
- table(:merge_request_diff_commits).tap do |t|
- t.extend(SuppressCompositePrimaryKeyWarning)
- end
- end
-
- let(:commit_users) { described_class::MergeRequestDiffCommitUser }
-
- let(:namespace) { namespaces.create!(name: 'foo', path: 'foo') }
- let(:project) { projects.create!(namespace_id: namespace.id) }
- let(:merge_request) do
- merge_requests.create!(
- source_branch: 'x',
- target_branch: 'master',
- target_project_id: project.id
- )
- end
-
- let(:diff) { diffs.create!(merge_request_id: merge_request.id) }
- let(:migration) { described_class.new }
-
- describe 'MergeRequestDiffCommit' do
- describe '.each_row_to_migrate' do
- it 'yields the rows to migrate for a given range' do
- commit1 = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: 'bob',
- author_email: 'bob@example.com',
- committer_name: 'bob',
- committer_email: 'bob@example.com'
- )
-
- commit2 = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 1,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: 'Alice',
- author_email: 'alice@example.com',
- committer_name: 'Alice',
- committer_email: 'alice@example.com'
- )
-
- # We stub this constant to make sure we run at least two pagination
- # queries for getting the data. This way we can test if the pagination
- # is actually working properly.
- stub_const(
- 'Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers::COMMIT_ROWS_PER_QUERY',
- 1
- )
-
- rows = []
-
- described_class::MergeRequestDiffCommit.each_row_to_migrate(diff.id, diff.id + 1) do |row|
- rows << row
- end
-
- expect(rows.length).to eq(2)
-
- expect(rows[0].author_name).to eq(commit1.author_name)
- expect(rows[1].author_name).to eq(commit2.author_name)
- end
- end
- end
-
- describe 'MergeRequestDiffCommitUser' do
- describe '.union' do
- it 'produces a union of the given queries' do
- alice = commit_users.create!(name: 'Alice', email: 'alice@example.com')
- bob = commit_users.create!(name: 'Bob', email: 'bob@example.com')
- users = commit_users.union(
- [
- commit_users.where(name: 'Alice').to_sql,
- commit_users.where(name: 'Bob').to_sql
- ])
-
- expect(users).to include(alice)
- expect(users).to include(bob)
- end
- end
- end
-
- describe '#perform' do
- it 'skips jobs that have already been completed' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- arguments: [1, 10],
- status: :succeeded
- )
-
- expect(migration).not_to receive(:get_data_to_update)
-
- migration.perform(1, 10)
- end
-
- it 'migrates the data in the range' do
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: 'bob',
- author_email: 'bob@example.com',
- committer_name: 'bob',
- committer_email: 'bob@example.com'
- )
-
- migration.perform(diff.id, diff.id + 1)
-
- bob = commit_users.find_by(name: 'bob')
- commit = commits.first
-
- expect(commit.commit_author_id).to eq(bob.id)
- expect(commit.committer_id).to eq(bob.id)
- end
-
- it 'treats empty names and Emails the same as NULL values' do
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: 'bob',
- author_email: 'bob@example.com',
- committer_name: '',
- committer_email: ''
- )
-
- migration.perform(diff.id, diff.id + 1)
-
- bob = commit_users.find_by(name: 'bob')
- commit = commits.first
-
- expect(commit.commit_author_id).to eq(bob.id)
- expect(commit.committer_id).to be_nil
- end
-
- it 'does not update rows without a committer and author' do
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc')
- )
-
- migration.perform(diff.id, diff.id + 1)
-
- commit = commits.first
-
- expect(commit_users.count).to eq(0)
- expect(commit.commit_author_id).to be_nil
- expect(commit.committer_id).to be_nil
- end
-
- it 'marks the background job as done' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- arguments: [diff.id, diff.id + 1]
- )
-
- migration.perform(diff.id, diff.id + 1)
-
- job = Gitlab::Database::BackgroundMigrationJob.first
-
- expect(job.status).to eq('succeeded')
- end
- end
-
- describe '#get_data_to_update' do
- it 'returns the users and commit rows to update' do
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: 'bob' + ('a' * 510),
- author_email: 'bob@example.com',
- committer_name: 'bob' + ('a' * 510),
- committer_email: 'bob@example.com'
- )
-
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 1,
- sha: Gitlab::Database::ShaAttribute.serialize('456abc'),
- author_name: 'alice',
- author_email: 'alice@example.com',
- committer_name: 'alice',
- committer_email: 'alice@example.com'
- )
-
- users, to_update = migration.get_data_to_update(diff.id, diff.id + 1)
-
- bob_name = 'bob' + ('a' * 509)
-
- expect(users).to include(%w[alice alice@example.com])
- expect(users).to include([bob_name, 'bob@example.com'])
-
- expect(to_update[[diff.id, 0]])
- .to eq([[bob_name, 'bob@example.com'], [bob_name, 'bob@example.com']])
-
- expect(to_update[[diff.id, 1]])
- .to eq([%w[alice alice@example.com], %w[alice alice@example.com]])
- end
-
- it 'does not include a user if both the name and Email are missing' do
- commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc'),
- author_name: nil,
- author_email: nil,
- committer_name: 'bob',
- committer_email: 'bob@example.com'
- )
-
- users, _ = migration.get_data_to_update(diff.id, diff.id + 1)
-
- expect(users).to eq([%w[bob bob@example.com]].to_set)
- end
- end
-
- describe '#get_user_rows_in_batches' do
- it 'retrieves all existing users' do
- alice = commit_users.create!(name: 'alice', email: 'alice@example.com')
- bob = commit_users.create!(name: 'bob', email: 'bob@example.com')
-
- users = [[alice.name, alice.email], [bob.name, bob.email]]
- mapping = {}
-
- migration.get_user_rows_in_batches(users, mapping)
-
- expect(mapping[%w[alice alice@example.com]]).to eq(alice)
- expect(mapping[%w[bob bob@example.com]]).to eq(bob)
- end
- end
-
- describe '#create_missing_users' do
- it 'creates merge request diff commit users that are missing' do
- alice = commit_users.create!(name: 'alice', email: 'alice@example.com')
- users = [%w[alice alice@example.com], %w[bob bob@example.com]]
- mapping = { %w[alice alice@example.com] => alice }
-
- migration.create_missing_users(users, mapping)
-
- expect(mapping[%w[alice alice@example.com]]).to eq(alice)
- expect(mapping[%w[bob bob@example.com]].name).to eq('bob')
- expect(mapping[%w[bob bob@example.com]].email).to eq('bob@example.com')
- end
- end
-
- describe '#update_commit_rows' do
- it 'updates the merge request diff commit rows' do
- to_update = { [42, 0] => [%w[alice alice@example.com], []] }
- user_mapping = { %w[alice alice@example.com] => double(:user, id: 1) }
-
- expect(migration)
- .to receive(:bulk_update_commit_rows)
- .with({ [42, 0] => [1, nil] })
-
- migration.update_commit_rows(to_update, user_mapping)
- end
- end
-
- describe '#bulk_update_commit_rows' do
- context 'when there are no authors and committers' do
- it 'does not update any rows' do
- migration.bulk_update_commit_rows({ [1, 0] => [] })
-
- expect(described_class::MergeRequestDiffCommit.connection)
- .not_to receive(:execute)
- end
- end
-
- context 'when there are only authors' do
- it 'only updates the author IDs' do
- author = commit_users.create!(name: 'Alice', email: 'alice@example.com')
- commit = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc')
- )
-
- mapping = {
- [commit.merge_request_diff_id, commit.relative_order] =>
- [author.id, nil]
- }
-
- migration.bulk_update_commit_rows(mapping)
-
- commit = commits.first
-
- expect(commit.commit_author_id).to eq(author.id)
- expect(commit.committer_id).to be_nil
- end
- end
-
- context 'when there are only committers' do
- it 'only updates the committer IDs' do
- committer =
- commit_users.create!(name: 'Alice', email: 'alice@example.com')
-
- commit = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc')
- )
-
- mapping = {
- [commit.merge_request_diff_id, commit.relative_order] =>
- [nil, committer.id]
- }
-
- migration.bulk_update_commit_rows(mapping)
-
- commit = commits.first
-
- expect(commit.committer_id).to eq(committer.id)
- expect(commit.commit_author_id).to be_nil
- end
- end
-
- context 'when there are both authors and committers' do
- it 'updates both the author and committer IDs' do
- author = commit_users.create!(name: 'Bob', email: 'bob@example.com')
- committer =
- commit_users.create!(name: 'Alice', email: 'alice@example.com')
-
- commit = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc')
- )
-
- mapping = {
- [commit.merge_request_diff_id, commit.relative_order] =>
- [author.id, committer.id]
- }
-
- migration.bulk_update_commit_rows(mapping)
-
- commit = commits.first
-
- expect(commit.commit_author_id).to eq(author.id)
- expect(commit.committer_id).to eq(committer.id)
- end
- end
-
- context 'when there are multiple commit rows to update' do
- it 'updates all the rows' do
- author = commit_users.create!(name: 'Bob', email: 'bob@example.com')
- committer =
- commit_users.create!(name: 'Alice', email: 'alice@example.com')
-
- commit1 = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 0,
- sha: Gitlab::Database::ShaAttribute.serialize('123abc')
- )
-
- commit2 = commits.create!(
- merge_request_diff_id: diff.id,
- relative_order: 1,
- sha: Gitlab::Database::ShaAttribute.serialize('456abc')
- )
-
- mapping = {
- [commit1.merge_request_diff_id, commit1.relative_order] =>
- [author.id, committer.id],
-
- [commit2.merge_request_diff_id, commit2.relative_order] =>
- [author.id, nil]
- }
-
- migration.bulk_update_commit_rows(mapping)
-
- commit1 = commits.find_by(relative_order: 0)
- commit2 = commits.find_by(relative_order: 1)
-
- expect(commit1.commit_author_id).to eq(author.id)
- expect(commit1.committer_id).to eq(committer.id)
-
- expect(commit2.commit_author_id).to eq(author.id)
- expect(commit2.committer_id).to be_nil
- end
- end
- end
-
- describe '#primary_key' do
- it 'returns the primary key for the commits table' do
- key = migration.primary_key
-
- expect(key.to_sql).to eq('("merge_request_diff_commits"."merge_request_diff_id", "merge_request_diff_commits"."relative_order")')
- end
- end
-
- describe '#prepare' do
- it 'trims a value to at most 512 characters' do
- expect(migration.prepare('€' * 1_000)).to eq('€' * 512)
- end
-
- it 'returns nil if the value is an empty string' do
- expect(migration.prepare('')).to be_nil
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb b/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb
deleted file mode 100644
index b252df4ecff..00000000000
--- a/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MigrateProjectTaggingsContextFromTagsToTopics,
- :suppress_gitlab_schemas_validate_connection, schema: 20210826171758 do
- it 'correctly migrates project taggings context from tags to topics' do
- taggings = table(:taggings)
-
- project_old_tagging_1 = taggings.create!(taggable_type: 'Project', context: 'tags')
- project_new_tagging_1 = taggings.create!(taggable_type: 'Project', context: 'topics')
- project_other_context_tagging_1 = taggings.create!(taggable_type: 'Project', context: 'other')
- project_old_tagging_2 = taggings.create!(taggable_type: 'Project', context: 'tags')
- project_old_tagging_3 = taggings.create!(taggable_type: 'Project', context: 'tags')
-
- subject.perform(project_old_tagging_1.id, project_old_tagging_2.id)
-
- project_old_tagging_1.reload
- project_new_tagging_1.reload
- project_other_context_tagging_1.reload
- project_old_tagging_2.reload
- project_old_tagging_3.reload
-
- expect(project_old_tagging_1.context).to eq('topics')
- expect(project_new_tagging_1.context).to eq('topics')
- expect(project_other_context_tagging_1.context).to eq('other')
- expect(project_old_tagging_2.context).to eq('topics')
- expect(project_old_tagging_3.context).to eq('tags')
- end
-end
diff --git a/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb b/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb
index 08fde0d0ff4..6554ee9d7b5 100644
--- a/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb
+++ b/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
require 'webauthn/u2f_migrator'
-RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20210826171758 do
+RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20211202041233 do
let(:users) { table(:users) }
let(:user) { users.create!(email: 'email@email.com', name: 'foo', username: 'foo', projects_limit: 0) }
diff --git a/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb b/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb
deleted file mode 100644
index 71cf58a933f..00000000000
--- a/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210826171758 do
- let(:enabled) { 20 }
- let(:disabled) { 0 }
-
- let(:namespaces) { table(:namespaces) }
- let(:project_features) { table(:project_features) }
- let(:projects) { table(:projects) }
-
- let(:namespace) { namespaces.create!(name: 'user', path: 'user') }
- let!(:project1) { projects.create!(namespace_id: namespace.id) }
- let!(:project2) { projects.create!(namespace_id: namespace.id) }
- let!(:project3) { projects.create!(namespace_id: namespace.id) }
- let!(:project4) { projects.create!(namespace_id: namespace.id) }
-
- # pages_access_level cannot be null.
- let(:non_null_project_features) { { pages_access_level: enabled } }
- let!(:project_feature1) { project_features.create!(project_id: project1.id, **non_null_project_features) }
- let!(:project_feature2) { project_features.create!(project_id: project2.id, **non_null_project_features) }
- let!(:project_feature3) { project_features.create!(project_id: project3.id, **non_null_project_features) }
-
- describe '#perform' do
- before do
- project1.update!(container_registry_enabled: true)
- project2.update!(container_registry_enabled: false)
- project3.update!(container_registry_enabled: nil)
- project4.update!(container_registry_enabled: true)
- end
-
- it 'copies values to project_features' do
- table(:background_migration_jobs).create!(
- class_name: 'MoveContainerRegistryEnabledToProjectFeature',
- arguments: [project1.id, project4.id]
- )
- table(:background_migration_jobs).create!(
- class_name: 'MoveContainerRegistryEnabledToProjectFeature',
- arguments: [-1, -3]
- )
-
- expect(project1.container_registry_enabled).to eq(true)
- expect(project2.container_registry_enabled).to eq(false)
- expect(project3.container_registry_enabled).to eq(nil)
- expect(project4.container_registry_enabled).to eq(true)
-
- expect(project_feature1.container_registry_access_level).to eq(disabled)
- expect(project_feature2.container_registry_access_level).to eq(disabled)
- expect(project_feature3.container_registry_access_level).to eq(disabled)
-
- expect_next_instance_of(Gitlab::BackgroundMigration::Logger) do |logger|
- expect(logger).to receive(:info)
- .with(message: "#{described_class}: Copied container_registry_enabled values for projects with IDs between #{project1.id}..#{project4.id}")
-
- expect(logger).not_to receive(:info)
- end
-
- subject.perform(project1.id, project4.id)
-
- expect(project1.reload.container_registry_enabled).to eq(true)
- expect(project2.reload.container_registry_enabled).to eq(false)
- expect(project3.reload.container_registry_enabled).to eq(nil)
- expect(project4.container_registry_enabled).to eq(true)
-
- expect(project_feature1.reload.container_registry_access_level).to eq(enabled)
- expect(project_feature2.reload.container_registry_access_level).to eq(disabled)
- expect(project_feature3.reload.container_registry_access_level).to eq(disabled)
-
- expect(table(:background_migration_jobs).first.status).to eq(1) # succeeded
- expect(table(:background_migration_jobs).second.status).to eq(0) # pending
- end
-
- context 'when no projects exist in range' do
- it 'does not fail' do
- expect(project1.container_registry_enabled).to eq(true)
- expect(project_feature1.container_registry_access_level).to eq(disabled)
-
- expect { subject.perform(-1, -2) }.not_to raise_error
-
- expect(project1.container_registry_enabled).to eq(true)
- expect(project_feature1.container_registry_access_level).to eq(disabled)
- end
- end
-
- context 'when projects in range all have nil container_registry_enabled' do
- it 'does not fail' do
- expect(project3.container_registry_enabled).to eq(nil)
- expect(project_feature3.container_registry_access_level).to eq(disabled)
-
- expect { subject.perform(project3.id, project3.id) }.not_to raise_error
-
- expect(project3.container_registry_enabled).to eq(nil)
- expect(project_feature3.container_registry_access_level).to eq(disabled)
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/populate_topics_total_projects_count_cache_spec.rb b/spec/lib/gitlab/background_migration/populate_topics_total_projects_count_cache_spec.rb
deleted file mode 100644
index 8e07b43f5b9..00000000000
--- a/spec/lib/gitlab/background_migration/populate_topics_total_projects_count_cache_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::PopulateTopicsTotalProjectsCountCache, schema: 20211006060436 do
- it 'correctly populates total projects count cache' do
- namespaces = table(:namespaces)
- projects = table(:projects)
- topics = table(:topics)
- project_topics = table(:project_topics)
-
- group = namespaces.create!(name: 'group', path: 'group')
- project_1 = projects.create!(namespace_id: group.id)
- project_2 = projects.create!(namespace_id: group.id)
- project_3 = projects.create!(namespace_id: group.id)
- topic_1 = topics.create!(name: 'Topic1')
- topic_2 = topics.create!(name: 'Topic2')
- topic_3 = topics.create!(name: 'Topic3')
- topic_4 = topics.create!(name: 'Topic4')
-
- project_topics.create!(project_id: project_1.id, topic_id: topic_1.id)
- project_topics.create!(project_id: project_1.id, topic_id: topic_3.id)
- project_topics.create!(project_id: project_2.id, topic_id: topic_3.id)
- project_topics.create!(project_id: project_1.id, topic_id: topic_4.id)
- project_topics.create!(project_id: project_2.id, topic_id: topic_4.id)
- project_topics.create!(project_id: project_3.id, topic_id: topic_4.id)
-
- subject.perform(topic_1.id, topic_4.id)
-
- expect(topic_1.reload.total_projects_count).to eq(1)
- expect(topic_2.reload.total_projects_count).to eq(0)
- expect(topic_3.reload.total_projects_count).to eq(2)
- expect(topic_4.reload.total_projects_count).to eq(3)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid_spec.rb b/spec/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid_spec.rb
index 2271bbfb2f3..543dd204f89 100644
--- a/spec/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid_spec.rb
+++ b/spec/lib/gitlab/background_migration/recalculate_vulnerabilities_occurrences_uuid_spec.rb
@@ -20,7 +20,7 @@ def create_background_migration_job(ids, status)
)
end
-RSpec.describe Gitlab::BackgroundMigration::RecalculateVulnerabilitiesOccurrencesUuid, :suppress_gitlab_schemas_validate_connection, schema: 20211124132705 do
+RSpec.describe Gitlab::BackgroundMigration::RecalculateVulnerabilitiesOccurrencesUuid, :suppress_gitlab_schemas_validate_connection, schema: 20211202041233 do
let(:background_migration_jobs) { table(:background_migration_jobs) }
let(:pending_jobs) { background_migration_jobs.where(status: Gitlab::Database::BackgroundMigrationJob.statuses['pending']) }
let(:succeeded_jobs) { background_migration_jobs.where(status: Gitlab::Database::BackgroundMigrationJob.statuses['succeeded']) }
diff --git a/spec/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings_spec.rb b/spec/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings_spec.rb
deleted file mode 100644
index ed08ae22245..00000000000
--- a/spec/lib/gitlab/background_migration/remove_duplicate_vulnerabilities_findings_spec.rb
+++ /dev/null
@@ -1,171 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::RemoveDuplicateVulnerabilitiesFindings, :migration, schema: 20220326161803 do
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let(:users) { table(:users) }
- let(:user) { create_user! }
- let(:project) { table(:projects).create!(id: 14219619, namespace_id: namespace.id) }
- let(:scanners) { table(:vulnerability_scanners) }
- let!(:scanner1) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let!(:scanner2) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') }
- let!(:scanner3) { scanners.create!(project_id: project.id, external_id: 'test 3', name: 'test scanner 3') }
- let!(:unrelated_scanner) { scanners.create!(project_id: project.id, external_id: 'unreleated_scanner', name: 'unrelated scanner') }
- let(:vulnerabilities) { table(:vulnerabilities) }
- let(:vulnerability_findings) { table(:vulnerability_occurrences) }
- let(:vulnerability_identifiers) { table(:vulnerability_identifiers) }
- let(:vulnerability_identifier) do
- vulnerability_identifiers.create!(
- id: 1244459,
- project_id: project.id,
- external_type: 'vulnerability-identifier',
- external_id: 'vulnerability-identifier',
- fingerprint: '0a203e8cd5260a1948edbedc76c7cb91ad6a2e45',
- name: 'vulnerability identifier')
- end
-
- let!(:vulnerability_for_first_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:first_finding_duplicate) do
- create_finding!(
- id: 5606961,
- uuid: "bd95c085-71aa-51d7-9bb6-08ae669c262e",
- vulnerability_id: vulnerability_for_first_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner1.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_second_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:second_finding_duplicate) do
- create_finding!(
- id: 8765432,
- uuid: "5b714f58-1176-5b26-8fd5-e11dfcb031b5",
- vulnerability_id: vulnerability_for_second_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner2.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_third_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:third_finding_duplicate) do
- create_finding!(
- id: 8832995,
- uuid: "cfe435fa-b25b-5199-a56d-7b007cc9e2d4",
- vulnerability_id: vulnerability_for_third_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner3.id,
- project_id: project.id
- )
- end
-
- let!(:unrelated_finding) do
- create_finding!(
- id: 9999999,
- uuid: Gitlab::UUID.v5(SecureRandom.hex),
- vulnerability_id: nil,
- report_type: 1,
- location_fingerprint: 'random_location_fingerprint',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: unrelated_scanner.id,
- project_id: project.id
- )
- end
-
- subject { described_class.new.perform(first_finding_duplicate.id, unrelated_finding.id) }
-
- before do
- stub_const("#{described_class}::DELETE_BATCH_SIZE", 1)
- end
-
- it "removes entries which would result in duplicate UUIDv5" do
- expect(vulnerability_findings.count).to eq(4)
-
- expect { subject }.to change { vulnerability_findings.count }.from(4).to(2)
-
- expect(vulnerability_findings.pluck(:id)).to match_array([third_finding_duplicate.id, unrelated_finding.id])
- end
-
- it "removes vulnerabilites without findings" do
- expect(vulnerabilities.count).to eq(3)
-
- expect { subject }.to change { vulnerabilities.count }.from(3).to(1)
-
- expect(vulnerabilities.pluck(:id)).to match_array([vulnerability_for_third_duplicate.id])
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, id: nil,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- params = {
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: vulnerability_identifier.id,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- }
- params[:id] = id unless id.nil?
- vulnerability_findings.create!(params)
- end
- # rubocop:enable Metrics/ParameterLists
-
- def create_user!(name: "Example User", email: "user@example.com", user_type: nil, created_at: Time.zone.now, confirmed_at: Time.zone.now)
- users.create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- user_type: user_type,
- confirmed_at: confirmed_at
- )
- end
-end
diff --git a/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb b/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb
index 918df8f4442..32134b99e37 100644
--- a/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb
+++ b/spec/lib/gitlab/background_migration/remove_vulnerability_finding_links_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::RemoveVulnerabilityFindingLinks, :migration, schema: 20211104165220 do
+RSpec.describe Gitlab::BackgroundMigration::RemoveVulnerabilityFindingLinks, :migration, schema: 20211202041233 do
let(:vulnerability_findings) { table(:vulnerability_occurrences) }
let(:finding_links) { table(:vulnerability_finding_links) }
diff --git a/spec/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users_spec.rb b/spec/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users_spec.rb
deleted file mode 100644
index 841a7f306d7..00000000000
--- a/spec/lib/gitlab/background_migration/steal_migrate_merge_request_diff_commit_users_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::StealMigrateMergeRequestDiffCommitUsers, schema: 20211012134316 do
- let(:migration) { described_class.new }
-
- describe '#perform' do
- it 'processes the background migration' do
- spy = instance_spy(
- Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers
- )
-
- allow(Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers)
- .to receive(:new)
- .and_return(spy)
-
- expect(spy).to receive(:perform).with(1, 4)
- expect(migration).to receive(:schedule_next_job)
-
- migration.perform(1, 4)
- end
- end
-
- describe '#schedule_next_job' do
- it 'schedules the next job in ascending order' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- arguments: [10, 20]
- )
-
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- arguments: [40, 50]
- )
-
- expect(BackgroundMigrationWorker)
- .to receive(:perform_in)
- .with(5.minutes, 'StealMigrateMergeRequestDiffCommitUsers', [10, 20])
-
- migration.schedule_next_job
- end
-
- it 'does not schedule any new jobs when there are none' do
- expect(BackgroundMigrationWorker).not_to receive(:perform_in)
-
- migration.schedule_next_job
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb b/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb
deleted file mode 100644
index b8c3bf8f3ac..00000000000
--- a/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::UpdateTimelogsProjectId, schema: 20210826171758 do
- let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') }
- let!(:project1) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:project2) { table(:projects).create!(namespace_id: namespace.id) }
- let!(:issue1) { table(:issues).create!(project_id: project1.id) }
- let!(:issue2) { table(:issues).create!(project_id: project2.id) }
- let!(:merge_request1) { table(:merge_requests).create!(target_project_id: project1.id, source_branch: 'master', target_branch: 'feature') }
- let!(:merge_request2) { table(:merge_requests).create!(target_project_id: project2.id, source_branch: 'master', target_branch: 'feature') }
- let!(:timelog1) { table(:timelogs).create!(issue_id: issue1.id, time_spent: 60) }
- let!(:timelog2) { table(:timelogs).create!(issue_id: issue1.id, time_spent: 60) }
- let!(:timelog3) { table(:timelogs).create!(issue_id: issue2.id, time_spent: 60) }
- let!(:timelog4) { table(:timelogs).create!(merge_request_id: merge_request1.id, time_spent: 600) }
- let!(:timelog5) { table(:timelogs).create!(merge_request_id: merge_request1.id, time_spent: 600) }
- let!(:timelog6) { table(:timelogs).create!(merge_request_id: merge_request2.id, time_spent: 600) }
- let!(:timelog7) { table(:timelogs).create!(issue_id: issue2.id, time_spent: 60, project_id: project1.id) }
- let!(:timelog8) { table(:timelogs).create!(merge_request_id: merge_request2.id, time_spent: 600, project_id: project1.id) }
-
- describe '#perform' do
- context 'when timelogs belong to issues' do
- it 'sets correct project_id' do
- subject.perform(timelog1.id, timelog3.id)
-
- expect(timelog1.reload.project_id).to eq(issue1.project_id)
- expect(timelog2.reload.project_id).to eq(issue1.project_id)
- expect(timelog3.reload.project_id).to eq(issue2.project_id)
- end
- end
-
- context 'when timelogs belong to merge requests' do
- it 'sets correct project ids' do
- subject.perform(timelog4.id, timelog6.id)
-
- expect(timelog4.reload.project_id).to eq(merge_request1.target_project_id)
- expect(timelog5.reload.project_id).to eq(merge_request1.target_project_id)
- expect(timelog6.reload.project_id).to eq(merge_request2.target_project_id)
- end
- end
-
- context 'when timelogs already belong to projects' do
- it 'does not update the project id' do
- subject.perform(timelog7.id, timelog8.id)
-
- expect(timelog7.reload.project_id).to eq(project1.id)
- expect(timelog8.reload.project_id).to eq(project1.id)
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb b/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb
deleted file mode 100644
index f16ae489b78..00000000000
--- a/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::UpdateUsersWhereTwoFactorAuthRequiredFromGroup, :migration, schema: 20210826171758 do
- include MigrationHelpers::NamespacesHelpers
-
- let(:group_with_2fa_parent) { create_namespace('parent', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: true) }
- let(:group_with_2fa_child) { create_namespace('child', Gitlab::VisibilityLevel::PRIVATE, parent_id: group_with_2fa_parent.id) }
- let(:members_table) { table(:members) }
- let(:users_table) { table(:users) }
-
- subject { described_class.new }
-
- describe '#perform' do
- context 'with group members' do
- let(:user_1) { create_user('user@example.com') }
- let!(:member) { create_group_member(user_1, group_with_2fa_parent) }
- let!(:user_without_group) { create_user('user_without@example.com') }
- let(:user_other) { create_user('user_other@example.com') }
- let!(:member_other) { create_group_member(user_other, group_with_2fa_parent) }
-
- it 'updates user when user should be required to establish two factor authentication' do
- subject.perform(user_1.id, user_without_group.id)
-
- expect(user_1.reload.require_two_factor_authentication_from_group).to eq(true)
- end
-
- it 'does not update user who is not in current batch' do
- subject.perform(user_1.id, user_without_group.id)
-
- expect(user_other.reload.require_two_factor_authentication_from_group).to eq(false)
- end
-
- it 'updates all users in current batch' do
- subject.perform(user_1.id, user_other.id)
-
- expect(user_other.reload.require_two_factor_authentication_from_group).to eq(true)
- end
-
- it 'updates user when user is member of group in which parent group requires two factor authentication' do
- member.destroy!
-
- subgroup = create_namespace('subgroup', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: false, parent_id: group_with_2fa_child.id)
- create_group_member(user_1, subgroup)
-
- subject.perform(user_1.id, user_other.id)
-
- expect(user_1.reload.require_two_factor_authentication_from_group).to eq(true)
- end
-
- it 'updates user when user is member of a group and the subgroup requires two factor authentication' do
- member.destroy!
-
- parent = create_namespace('other_parent', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: false)
- create_namespace('other_subgroup', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: true, parent_id: parent.id)
- create_group_member(user_1, parent)
-
- subject.perform(user_1.id, user_other.id)
-
- expect(user_1.reload.require_two_factor_authentication_from_group).to eq(true)
- end
-
- it 'does not update user when not a member of a group that requires two factor authentication' do
- member_other.destroy!
-
- other_group = create_namespace('other_group', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: false)
- create_group_member(user_other, other_group)
-
- subject.perform(user_1.id, user_other.id)
-
- expect(user_other.reload.require_two_factor_authentication_from_group).to eq(false)
- end
- end
- end
-
- def create_user(email, require_2fa: false)
- users_table.create!(email: email, projects_limit: 10, require_two_factor_authentication_from_group: require_2fa)
- end
-
- def create_group_member(user, group)
- members_table.create!(user_id: user.id, source_id: group.id, access_level: GroupMember::MAINTAINER, source_type: "Namespace", type: "GroupMember", notification_level: 3)
- end
-end
diff --git a/spec/lib/gitlab/import/metrics_spec.rb b/spec/lib/gitlab/import/metrics_spec.rb
index 1a988af0dbd..9a7eb7b875e 100644
--- a/spec/lib/gitlab/import/metrics_spec.rb
+++ b/spec/lib/gitlab/import/metrics_spec.rb
@@ -42,11 +42,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
it 'does not emit importer metrics' do
expect(subject).not_to receive(:track_usage_event)
expect_no_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'failed' }
+ import_type: 'github', state: 'failed'
)
subject.track_failed_import
@@ -65,11 +65,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
subject.track_failed_import
expect_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'failed' }
+ import_type: 'github', state: 'failed'
)
end
end
@@ -102,11 +102,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
subject.track_finished_import
expect_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'completed' }
+ import_type: 'github', state: 'completed'
)
expect(subject.duration).not_to be_nil
@@ -123,11 +123,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
subject.track_finished_import
expect_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'partially completed' }
+ import_type: 'github', state: 'partially completed'
)
end
end
@@ -140,11 +140,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
subject.track_finished_import
expect_no_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'completed' }
+ import_type: 'github', state: 'completed'
)
end
end
@@ -155,11 +155,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
it 'does not emit importer metrics' do
expect(subject).not_to receive(:track_usage_event)
expect_no_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'canceled' }
+ import_type: 'github', state: 'canceled'
)
subject.track_canceled_import
@@ -178,11 +178,11 @@ RSpec.describe Gitlab::Import::Metrics, :aggregate_failures do
subject.track_canceled_import
expect_snowplow_event(
- category: :test_importer,
+ category: 'Import::GithubService',
action: 'create',
label: 'github_import_project_state',
project: project,
- extra: { import_type: 'github', state: 'canceled' }
+ import_type: 'github', state: 'canceled'
)
end
end
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index d481a75667d..efcad589696 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -725,6 +725,7 @@ project:
- downstream_project_subscriptions
- service_desk_setting
- service_desk_custom_email_verification
+- service_desk_custom_email_credential
- security_setting
- import_failures
- container_expiration_policy
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 83c132e0969..b1c2e6f3809 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -1424,7 +1424,7 @@ RSpec.describe Notify do
issue.issue_email_participants.create!(email: 'service.desk@example.com')
end
- describe 'thank you email' do
+ describe 'thank you email', feature_category: :service_desk do
subject { described_class.service_desk_thank_you_email(issue.id) }
it_behaves_like 'an unsubscribeable thread'
@@ -1477,16 +1477,19 @@ RSpec.describe Notify do
end
context 'when custom email is enabled' do
+ let_it_be(:credentials) do
+ create(
+ :service_desk_custom_email_credential,
+ project: project
+ )
+ end
+
let_it_be(:settings) do
create(
:service_desk_setting,
project: project,
custom_email_enabled: true,
- custom_email: 'supersupport@example.com',
- custom_email_smtp_address: 'smtp.example.com',
- custom_email_smtp_port: 587,
- custom_email_smtp_username: 'supersupport@example.com',
- custom_email_smtp_password: 'supersecret'
+ custom_email: 'supersupport@example.com'
)
end
@@ -1501,7 +1504,7 @@ RSpec.describe Notify do
end
end
- describe 'new note email' do
+ describe 'new note email', feature_category: :service_desk do
let_it_be(:first_note) { create(:discussion_note_on_issue, note: 'Hello world') }
subject { described_class.service_desk_new_note_email(issue.id, first_note.id, 'service.desk@example.com') }
@@ -1538,16 +1541,19 @@ RSpec.describe Notify do
end
context 'when custom email is enabled' do
+ let_it_be(:credentials) do
+ create(
+ :service_desk_custom_email_credential,
+ project: project
+ )
+ end
+
let_it_be(:settings) do
create(
:service_desk_setting,
project: project,
custom_email_enabled: true,
- custom_email: 'supersupport@example.com',
- custom_email_smtp_address: 'smtp.example.com',
- custom_email_smtp_port: 587,
- custom_email_smtp_username: 'supersupport@example.com',
- custom_email_smtp_password: 'supersecret'
+ custom_email: 'supersupport@example.com'
)
end
@@ -2361,21 +2367,4 @@ RSpec.describe Notify do
expect(mail.body.parts.first.to_s).to include('Start a GitLab Ultimate trial today in less than one minute, no credit card required.')
end
end
-
- def expect_sender(user, sender_email: nil)
- sender = subject.header[:from].addrs[0]
- expect(sender.display_name).to eq("#{user.name} (@#{user.username})")
- expect(sender.address).to eq(sender_email.presence || gitlab_sender)
- end
-
- def expect_service_desk_custom_email_delivery_options(service_desk_setting)
- expect(subject.delivery_method).to be_a Mail::SMTP
- expect(subject.delivery_method.settings).to include(
- address: service_desk_setting.custom_email_smtp_address,
- port: service_desk_setting.custom_email_smtp_port,
- user_name: service_desk_setting.custom_email_smtp_username,
- password: service_desk_setting.custom_email_smtp_password,
- domain: service_desk_setting.custom_email.split('@').last
- )
- end
end
diff --git a/spec/migrations/20210831203408_upsert_base_work_item_types_spec.rb b/spec/migrations/20210831203408_upsert_base_work_item_types_spec.rb
deleted file mode 100644
index 4c7ef9ac1e8..00000000000
--- a/spec/migrations/20210831203408_upsert_base_work_item_types_spec.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe UpsertBaseWorkItemTypes, :migration, feature_category: :team_planning do
- include MigrationHelpers::WorkItemTypesHelper
-
- let!(:work_item_types) { table(:work_item_types) }
-
- let(:base_types) do
- {
- issue: 0,
- incident: 1,
- test_case: 2,
- requirement: 3
- }
- end
-
- append_after(:all) do
- # Make sure base types are recreated after running the migration
- # because migration specs are not run in a transaction
- reset_work_item_types
- end
-
- context 'when no default types exist' do
- it 'creates default data' do
- # Need to delete all as base types are seeded before entire test suite
- work_item_types.delete_all
-
- expect(work_item_types.count).to eq(0)
-
- reversible_migration do |migration|
- migration.before -> {
- # Depending on whether the migration has been run before,
- # the size could be 4, or 0, so we don't set any expectations
- # as we don't delete base types on migration reverse
- }
-
- migration.after -> {
- expect(work_item_types.count).to eq(4)
- expect(work_item_types.all.pluck(:base_type)).to match_array(base_types.values)
- }
- end
- end
- end
-
- context 'when default types already exist' do
- it 'does not create default types again' do
- # Database needs to be in a similar state as when this migration was created
- work_item_types.delete_all
- work_item_types.find_or_create_by!(name: 'Issue', namespace_id: nil, base_type: base_types[:issue], icon_name: 'issue-type-issue')
- work_item_types.find_or_create_by!(name: 'Incident', namespace_id: nil, base_type: base_types[:incident], icon_name: 'issue-type-incident')
- work_item_types.find_or_create_by!(name: 'Test Case', namespace_id: nil, base_type: base_types[:test_case], icon_name: 'issue-type-test-case')
- work_item_types.find_or_create_by!(name: 'Requirement', namespace_id: nil, base_type: base_types[:requirement], icon_name: 'issue-type-requirements')
-
- reversible_migration do |migration|
- migration.before -> {
- expect(work_item_types.all.pluck(:base_type)).to match_array(base_types.values)
- }
-
- migration.after -> {
- expect(work_item_types.count).to eq(4)
- expect(work_item_types.all.pluck(:base_type)).to match_array(base_types.values)
- }
- end
- end
- end
-end
diff --git a/spec/migrations/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs_spec.rb b/spec/migrations/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs_spec.rb
deleted file mode 100644
index 56482e8bd25..00000000000
--- a/spec/migrations/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropTemporaryColumnsAndTriggersForCiBuildNeeds, feature_category: :pipeline_composition do
- let(:ci_build_needs_table) { table(:ci_build_needs) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_build_needs_table.column_names).to include('build_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_build_needs_table.reset_column_information
- expect(ci_build_needs_table.column_names).not_to include('build_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks_spec.rb b/spec/migrations/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks_spec.rb
deleted file mode 100644
index eef4c7bc9fd..00000000000
--- a/spec/migrations/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropTemporaryColumnsAndTriggersForCiBuildTraceChunks, feature_category: :continuous_integration do
- let(:ci_build_trace_chunks_table) { table(:ci_build_trace_chunks) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_build_trace_chunks_table.column_names).to include('build_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_build_trace_chunks_table.reset_column_information
- expect(ci_build_trace_chunks_table.column_names).not_to include('build_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210906130643_drop_temporary_columns_and_triggers_for_taggings_spec.rb b/spec/migrations/20210906130643_drop_temporary_columns_and_triggers_for_taggings_spec.rb
deleted file mode 100644
index 208cbac2ae9..00000000000
--- a/spec/migrations/20210906130643_drop_temporary_columns_and_triggers_for_taggings_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropTemporaryColumnsAndTriggersForTaggings, feature_category: :continuous_integration do
- let(:taggings_table) { table(:taggings) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(taggings_table.column_names).to include('id_convert_to_bigint')
- expect(taggings_table.column_names).to include('taggable_id_convert_to_bigint')
- }
-
- migration.after -> {
- taggings_table.reset_column_information
- expect(taggings_table.column_names).not_to include('id_convert_to_bigint')
- expect(taggings_table.column_names).not_to include('taggable_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata_spec.rb b/spec/migrations/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata_spec.rb
deleted file mode 100644
index 63664803fba..00000000000
--- a/spec/migrations/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe CleanupBigintConversionForCiBuildsMetadata, feature_category: :continuous_integration do
- let(:ci_builds_metadata) { table(:ci_builds_metadata) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_builds_metadata.column_names).to include('id_convert_to_bigint')
- expect(ci_builds_metadata.column_names).to include('build_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_builds_metadata.reset_column_information
- expect(ci_builds_metadata.column_names).not_to include('id_convert_to_bigint')
- expect(ci_builds_metadata.column_names).not_to include('build_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb b/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb
deleted file mode 100644
index 663b90f3fa7..00000000000
--- a/spec/migrations/20210907211557_finalize_ci_builds_bigint_conversion_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe FinalizeCiBuildsBigintConversion, :migration, schema: 20210907182359, feature_category: :continuous_integration do
- context 'with an unexpected FK fk_3f0c88d7dc' do
- it 'removes the FK and migrates successfully' do
- # Add the unexpected FK
- subject.add_foreign_key(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc')
-
- expect { migrate! }.to change { subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc') }.from(true).to(false)
-
- # Additional check: The actually expected FK should still exist
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_be5624bf37')).to be_truthy
- end
- end
-end
diff --git a/spec/migrations/20210910194952_update_report_type_for_existing_approval_project_rules_spec.rb b/spec/migrations/20210910194952_update_report_type_for_existing_approval_project_rules_spec.rb
deleted file mode 100644
index e9d34fad76d..00000000000
--- a/spec/migrations/20210910194952_update_report_type_for_existing_approval_project_rules_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe UpdateReportTypeForExistingApprovalProjectRules, :migration, feature_category: :source_code_management do
- using RSpec::Parameterized::TableSyntax
-
- let(:group) { table(:namespaces).create!(name: 'user', path: 'user') }
- let(:project) { table(:projects).create!(namespace_id: group.id) }
- let(:approval_project_rule) { table(:approval_project_rules).create!(name: rule_name, rule_type: rule_type, project_id: project.id) }
- let(:rule_type) { 2 }
- let(:rule_name) { 'Vulnerability-Check' }
-
- context 'with rule_type set to :report_approver' do
- where(:rule_name, :report_type) do
- [
- ['Vulnerability-Check', 1],
- ['License-Check', 2],
- ['Coverage-Check', 3]
- ]
- end
-
- with_them do
- context "with names associated with report type" do
- it 'updates report_type' do
- expect { migrate! }.to change { approval_project_rule.reload.report_type }.from(nil).to(report_type)
- end
- end
- end
- end
-
- context 'with rule_type set to another value (e.g., :regular)' do
- let(:rule_type) { 0 }
-
- it 'does not update report_type' do
- expect { migrate! }.not_to change { approval_project_rule.reload.report_type }
- end
- end
-
- context 'with the rule name set to another value (e.g., Test Rule)' do
- let(:rule_name) { 'Test Rule' }
-
- it 'does not update report_type' do
- expect { migrate! }.not_to change { approval_project_rule.reload.report_type }
- end
- end
-end
diff --git a/spec/migrations/20210914095310_cleanup_orphan_project_access_tokens_spec.rb b/spec/migrations/20210914095310_cleanup_orphan_project_access_tokens_spec.rb
deleted file mode 100644
index a198ae9e473..00000000000
--- a/spec/migrations/20210914095310_cleanup_orphan_project_access_tokens_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe CleanupOrphanProjectAccessTokens, :migration, feature_category: :user_profile do
- def create_user(**extra_options)
- defaults = { state: 'active', projects_limit: 0, email: "#{extra_options[:username]}@example.com" }
-
- table(:users).create!(defaults.merge(extra_options))
- end
-
- def create_membership(**extra_options)
- defaults = { access_level: 30, notification_level: 0, source_id: 1, source_type: 'Project' }
-
- table(:members).create!(defaults.merge(extra_options))
- end
-
- let!(:regular_user) { create_user(username: 'regular') }
- let!(:orphan_bot) { create_user(username: 'orphaned_bot', user_type: 6) }
- let!(:used_bot) do
- create_user(username: 'used_bot', user_type: 6).tap do |bot|
- create_membership(user_id: bot.id)
- end
- end
-
- it 'marks all bots without memberships as deactivated' do
- expect do
- migrate!
- regular_user.reload
- orphan_bot.reload
- used_bot.reload
- end.to change {
- [regular_user.state, orphan_bot.state, used_bot.state]
- }.from(%w[active active active]).to(%w[active deactivated active])
- end
-
- it 'schedules for deletion all bots without memberships' do
- job_class = 'DeleteUserWorker'.safe_constantize
-
- if job_class
- expect(job_class).to receive(:bulk_perform_async).with([[orphan_bot.id, orphan_bot.id, skip_authorization: true]])
-
- migrate!
- end
- end
-end
diff --git a/spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb b/spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb
deleted file mode 100644
index 808c5371018..00000000000
--- a/spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe CleanupBigintConversionForCiBuilds, feature_category: :continuous_integration do
- let(:ci_builds) { table(:ci_builds) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_builds.column_names).to include('id_convert_to_bigint')
- expect(ci_builds.column_names).to include('stage_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_builds.reset_column_information
- expect(ci_builds.column_names).not_to include('id_convert_to_bigint')
- expect(ci_builds.column_names).not_to include('stage_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid_spec.rb b/spec/migrations/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid_spec.rb
deleted file mode 100644
index 66b391d7fd5..00000000000
--- a/spec/migrations/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-def create_background_migration_jobs(ids, status, created_at)
- proper_status = case status
- when :pending
- Gitlab::Database::BackgroundMigrationJob.statuses['pending']
- when :succeeded
- Gitlab::Database::BackgroundMigrationJob.statuses['succeeded']
- else
- raise ArgumentError
- end
-
- background_migration_jobs.create!(
- class_name: 'RecalculateVulnerabilitiesOccurrencesUuid',
- arguments: Array(ids),
- status: proper_status,
- created_at: created_at
- )
-end
-
-RSpec.describe RemoveOldPendingJobsForRecalculateVulnerabilitiesOccurrencesUuid, :migration,
- feature_category: :vulnerability_management do
- let!(:background_migration_jobs) { table(:background_migration_jobs) }
- let!(:before_target_date) { -Float::INFINITY..(DateTime.new(2021, 8, 17, 23, 59, 59)) }
- let!(:after_target_date) { (DateTime.new(2021, 8, 18, 0, 0, 0))..Float::INFINITY }
-
- context 'when old RecalculateVulnerabilitiesOccurrencesUuid jobs are pending' do
- before do
- create_background_migration_jobs([1, 2, 3], :succeeded, DateTime.new(2021, 5, 5, 0, 2))
- create_background_migration_jobs([4, 5, 6], :pending, DateTime.new(2021, 5, 5, 0, 4))
-
- create_background_migration_jobs([1, 2, 3], :succeeded, DateTime.new(2021, 8, 18, 0, 0))
- create_background_migration_jobs([4, 5, 6], :pending, DateTime.new(2021, 8, 18, 0, 2))
- create_background_migration_jobs([7, 8, 9], :pending, DateTime.new(2021, 8, 18, 0, 4))
- end
-
- it 'removes old, pending jobs' do
- migrate!
-
- expect(background_migration_jobs.where(created_at: before_target_date).count).to eq(1)
- expect(background_migration_jobs.where(created_at: after_target_date).count).to eq(3)
- end
- end
-end
diff --git a/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb b/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb
deleted file mode 100644
index c463f69c80c..00000000000
--- a/spec/migrations/20210922021816_drop_int4_columns_for_ci_job_artifacts_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropInt4ColumnsForCiJobArtifacts, feature_category: :build_artifacts do
- let(:ci_job_artifacts) { table(:ci_job_artifacts) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_job_artifacts.column_names).to include('id_convert_to_bigint')
- expect(ci_job_artifacts.column_names).to include('job_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_job_artifacts.reset_column_information
- expect(ci_job_artifacts.column_names).not_to include('id_convert_to_bigint')
- expect(ci_job_artifacts.column_names).not_to include('job_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210922025631_drop_int4_column_for_ci_sources_pipelines_spec.rb b/spec/migrations/20210922025631_drop_int4_column_for_ci_sources_pipelines_spec.rb
deleted file mode 100644
index 5a3ba16fcc0..00000000000
--- a/spec/migrations/20210922025631_drop_int4_column_for_ci_sources_pipelines_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropInt4ColumnForCiSourcesPipelines, feature_category: :pipeline_composition do
- let(:ci_sources_pipelines) { table(:ci_sources_pipelines) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_sources_pipelines.column_names).to include('source_job_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_sources_pipelines.reset_column_information
- expect(ci_sources_pipelines.column_names).not_to include('source_job_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb b/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb
deleted file mode 100644
index 49cf1a01f2a..00000000000
--- a/spec/migrations/20210922082019_drop_int4_column_for_events_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropInt4ColumnForEvents, feature_category: :user_profile do
- let(:events) { table(:events) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(events.column_names).to include('id_convert_to_bigint')
- }
-
- migration.after -> {
- events.reset_column_information
- expect(events.column_names).not_to include('id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20210922091402_drop_int4_column_for_push_event_payloads_spec.rb b/spec/migrations/20210922091402_drop_int4_column_for_push_event_payloads_spec.rb
deleted file mode 100644
index 3e241438339..00000000000
--- a/spec/migrations/20210922091402_drop_int4_column_for_push_event_payloads_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropInt4ColumnForPushEventPayloads, feature_category: :user_profile do
- let(:push_event_payloads) { table(:push_event_payloads) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(push_event_payloads.column_names).to include('event_id_convert_to_bigint')
- }
-
- migration.after -> {
- push_event_payloads.reset_column_information
- expect(push_event_payloads.column_names).not_to include('event_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/20211006060436_schedule_populate_topics_total_projects_count_cache_spec.rb b/spec/migrations/20211006060436_schedule_populate_topics_total_projects_count_cache_spec.rb
deleted file mode 100644
index 2f3903a20a9..00000000000
--- a/spec/migrations/20211006060436_schedule_populate_topics_total_projects_count_cache_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe SchedulePopulateTopicsTotalProjectsCountCache, feature_category: :projects do
- let(:topics) { table(:topics) }
- let!(:topic_1) { topics.create!(name: 'Topic1') }
- let!(:topic_2) { topics.create!(name: 'Topic2') }
- let!(:topic_3) { topics.create!(name: 'Topic3') }
-
- describe '#up' do
- before do
- stub_const("#{described_class}::BATCH_SIZE", 2)
- end
-
- it 'schedules BackfillProjectsWithCoverage background jobs', :aggregate_failures do
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, topic_1.id, topic_2.id)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, topic_3.id, topic_3.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq(2)
- end
- end
- end
- end
-end
diff --git a/spec/migrations/20211012134316_clean_up_migrate_merge_request_diff_commit_users_spec.rb b/spec/migrations/20211012134316_clean_up_migrate_merge_request_diff_commit_users_spec.rb
deleted file mode 100644
index a61e450d9ab..00000000000
--- a/spec/migrations/20211012134316_clean_up_migrate_merge_request_diff_commit_users_spec.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration! 'clean_up_migrate_merge_request_diff_commit_users'
-
-RSpec.describe CleanUpMigrateMergeRequestDiffCommitUsers, :migration, feature_category: :code_review_workflow do
- describe '#up' do
- context 'when there are pending jobs' do
- it 'processes the jobs immediately' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- status: :pending,
- arguments: [10, 20]
- )
-
- spy = Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers
- migration = described_class.new
-
- allow(Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers)
- .to receive(:new)
- .and_return(spy)
-
- expect(migration).to receive(:say)
- expect(spy).to receive(:perform).with(10, 20)
-
- migration.up
- end
- end
-
- context 'when all jobs are completed' do
- it 'does nothing' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- status: :succeeded,
- arguments: [10, 20]
- )
-
- migration = described_class.new
-
- expect(migration).not_to receive(:say)
- expect(Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers)
- .not_to receive(:new)
-
- migration.up
- end
- end
- end
-end
diff --git a/spec/migrations/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3_spec.rb b/spec/migrations/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3_spec.rb
deleted file mode 100644
index 3e8176a36a1..00000000000
--- a/spec/migrations/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3_spec.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-require_migration!('schedule_remove_duplicate_vulnerabilities_findings3')
-
-RSpec.describe ScheduleRemoveDuplicateVulnerabilitiesFindings3, :migration, feature_category: :vulnerability_management do
- let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let(:users) { table(:users) }
- let(:user) { create_user! }
- let(:project) { table(:projects).create!(id: 14219619, namespace_id: namespace.id) }
- let(:scanners) { table(:vulnerability_scanners) }
- let!(:scanner1) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let!(:scanner2) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') }
- let!(:scanner3) { scanners.create!(project_id: project.id, external_id: 'test 3', name: 'test scanner 3') }
- let!(:unrelated_scanner) { scanners.create!(project_id: project.id, external_id: 'unreleated_scanner', name: 'unrelated scanner') }
- let(:vulnerabilities) { table(:vulnerabilities) }
- let(:vulnerability_findings) { table(:vulnerability_occurrences) }
- let(:vulnerability_identifiers) { table(:vulnerability_identifiers) }
- let(:vulnerability_identifier) do
- vulnerability_identifiers.create!(
- id: 1244459,
- project_id: project.id,
- external_type: 'vulnerability-identifier',
- external_id: 'vulnerability-identifier',
- fingerprint: '0a203e8cd5260a1948edbedc76c7cb91ad6a2e45',
- name: 'vulnerability identifier')
- end
-
- let!(:vulnerability_for_first_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:first_finding_duplicate) do
- create_finding!(
- id: 5606961,
- uuid: "bd95c085-71aa-51d7-9bb6-08ae669c262e",
- vulnerability_id: vulnerability_for_first_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner1.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_second_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:second_finding_duplicate) do
- create_finding!(
- id: 8765432,
- uuid: "5b714f58-1176-5b26-8fd5-e11dfcb031b5",
- vulnerability_id: vulnerability_for_second_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner2.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_third_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:third_finding_duplicate) do
- create_finding!(
- id: 8832995,
- uuid: "cfe435fa-b25b-5199-a56d-7b007cc9e2d4",
- vulnerability_id: vulnerability_for_third_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner3.id,
- project_id: project.id
- )
- end
-
- let!(:unrelated_finding) do
- create_finding!(
- id: 9999999,
- vulnerability_id: nil,
- report_type: 1,
- location_fingerprint: 'random_location_fingerprint',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: unrelated_scanner.id,
- project_id: project.id
- )
- end
-
- before do
- stub_const("#{described_class}::BATCH_SIZE", 1)
- end
-
- around do |example|
- freeze_time { Sidekiq::Testing.fake! { example.run } }
- end
-
- it 'schedules background migration' do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(4)
- expect(described_class::MIGRATION).to be_scheduled_migration(first_finding_duplicate.id, first_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_migration(second_finding_duplicate.id, second_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_migration(third_finding_duplicate.id, third_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_migration(unrelated_finding.id, unrelated_finding.id)
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, id: nil,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- vulnerability_findings.create!({
- id: id,
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: vulnerability_identifier.id,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- }.compact)
- end
- # rubocop:enable Metrics/ParameterLists
-
- def create_user!(name: "Example User", email: "user@example.com", user_type: nil, created_at: Time.zone.now, confirmed_at: Time.zone.now)
- users.create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- user_type: user_type,
- confirmed_at: confirmed_at
- )
- end
-end
diff --git a/spec/migrations/20211028155449_schedule_fix_merge_request_diff_commit_users_migration_spec.rb b/spec/migrations/20211028155449_schedule_fix_merge_request_diff_commit_users_migration_spec.rb
deleted file mode 100644
index 968d9cf176c..00000000000
--- a/spec/migrations/20211028155449_schedule_fix_merge_request_diff_commit_users_migration_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration! 'schedule_fix_merge_request_diff_commit_users_migration'
-
-RSpec.describe ScheduleFixMergeRequestDiffCommitUsersMigration, :migration, feature_category: :code_review_workflow do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:namespace) { namespaces.create!(name: 'foo', path: 'foo') }
-
- describe '#up' do
- it 'does nothing when there are no projects to correct' do
- migration.up
-
- expect(Gitlab::Database::BackgroundMigrationJob.count).to be_zero
- end
-
- it 'schedules imported projects created after July' do
- project = projects.create!(
- namespace_id: namespace.id,
- import_type: 'gitlab_project',
- created_at: '2021-08-01'
- )
-
- expect(migration)
- .to receive(:migrate_in)
- .with(2.minutes, 'FixMergeRequestDiffCommitUsers', [project.id])
-
- migration.up
-
- expect(Gitlab::Database::BackgroundMigrationJob.count).to eq(1)
-
- job = Gitlab::Database::BackgroundMigrationJob.first
-
- expect(job.class_name).to eq('FixMergeRequestDiffCommitUsers')
- expect(job.arguments).to eq([project.id])
- end
-
- it 'ignores projects imported before July' do
- projects.create!(
- namespace_id: namespace.id,
- import_type: 'gitlab_project',
- created_at: '2020-08-01'
- )
-
- migration.up
-
- expect(Gitlab::Database::BackgroundMigrationJob.count).to be_zero
- end
-
- it 'ignores projects that are not imported' do
- projects.create!(
- namespace_id: namespace.id,
- created_at: '2021-08-01'
- )
-
- migration.up
-
- expect(Gitlab::Database::BackgroundMigrationJob.count).to be_zero
- end
- end
-end
diff --git a/spec/migrations/20211101222614_consume_remaining_user_namespace_jobs_spec.rb b/spec/migrations/20211101222614_consume_remaining_user_namespace_jobs_spec.rb
deleted file mode 100644
index 1688ebf7cb1..00000000000
--- a/spec/migrations/20211101222614_consume_remaining_user_namespace_jobs_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ConsumeRemainingUserNamespaceJobs, feature_category: :subgroups do
- let(:namespaces) { table(:namespaces) }
- let!(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org', type: nil) }
-
- context 'when Namespaces with nil `type` still exist' do
- it 'steals sidekiq jobs from BackfillUserNamespace background migration' do
- expect(Gitlab::BackgroundMigration).to receive(:steal).with('BackfillUserNamespace')
-
- migrate!
- end
-
- it 'migrates namespaces without type' do
- expect { migrate! }.to change { namespaces.where(type: 'User').count }.from(0).to(1)
- end
- end
-end
diff --git a/spec/migrations/20211110143306_add_not_null_constraint_to_security_findings_uuid_spec.rb b/spec/migrations/20211110143306_add_not_null_constraint_to_security_findings_uuid_spec.rb
deleted file mode 100644
index 3b69169b2d6..00000000000
--- a/spec/migrations/20211110143306_add_not_null_constraint_to_security_findings_uuid_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AddNotNullConstraintToSecurityFindingsUuid, feature_category: :vulnerability_management do
- let!(:security_findings) { table(:security_findings) }
- let!(:migration) { described_class.new }
-
- before do
- allow(migration).to receive(:transaction_open?).and_return(false)
- allow(migration).to receive(:with_lock_retries).and_yield
- end
-
- it 'adds a check constraint' do
- constraint = security_findings.connection.check_constraints(:security_findings).find { |constraint| constraint.expression == "uuid IS NOT NULL" }
- expect(constraint).to be_nil
-
- migration.up
-
- constraint = security_findings.connection.check_constraints(:security_findings).find { |constraint| constraint.expression == "uuid IS NOT NULL" }
- expect(constraint).to be_a(ActiveRecord::ConnectionAdapters::CheckConstraintDefinition)
- end
-end
diff --git a/spec/migrations/20211110151350_schedule_drop_invalid_security_findings_spec.rb b/spec/migrations/20211110151350_schedule_drop_invalid_security_findings_spec.rb
deleted file mode 100644
index 3b27b1a1921..00000000000
--- a/spec/migrations/20211110151350_schedule_drop_invalid_security_findings_spec.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ScheduleDropInvalidSecurityFindings, :migration, :suppress_gitlab_schemas_validate_connection,
- schema: 20211108211434, feature_category: :vulnerability_management do
- let!(:background_migration_jobs) { table(:background_migration_jobs) }
-
- let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user', type: Namespaces::UserNamespace.sti_name) }
- let!(:project) { table(:projects).create!(namespace_id: namespace.id) }
-
- let!(:pipelines) { table(:ci_pipelines) }
- let!(:pipeline) { pipelines.create!(project_id: project.id) }
-
- let!(:ci_builds) { table(:ci_builds) }
- let!(:ci_build) { ci_builds.create! }
-
- let!(:security_scans) { table(:security_scans) }
- let!(:security_scan) do
- security_scans.create!(
- scan_type: 1,
- status: 1,
- build_id: ci_build.id,
- project_id: project.id,
- pipeline_id: pipeline.id
- )
- end
-
- let!(:vulnerability_scanners) { table(:vulnerability_scanners) }
- let!(:vulnerability_scanner) { vulnerability_scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
-
- let!(:security_findings) { table(:security_findings) }
- let!(:security_finding_without_uuid) do
- security_findings.create!(
- severity: 1,
- confidence: 1,
- scan_id: security_scan.id,
- scanner_id: vulnerability_scanner.id,
- uuid: nil
- )
- end
-
- let!(:security_finding_with_uuid) do
- security_findings.create!(
- severity: 1,
- confidence: 1,
- scan_id: security_scan.id,
- scanner_id: vulnerability_scanner.id,
- uuid: 'bd95c085-71aa-51d7-9bb6-08ae669c262e'
- )
- end
-
- before do
- stub_const("#{described_class}::BATCH_SIZE", 1)
- stub_const("#{described_class}::SUB_BATCH_SIZE", 1)
- end
-
- around do |example|
- freeze_time { Sidekiq::Testing.fake! { example.run } }
- end
-
- it 'schedules background migrations' do
- migrate!
-
- expect(background_migration_jobs.count).to eq(1)
- expect(background_migration_jobs.first.arguments).to match_array([security_finding_without_uuid.id, security_finding_without_uuid.id, described_class::SUB_BATCH_SIZE])
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(1)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, security_finding_without_uuid.id, security_finding_without_uuid.id, described_class::SUB_BATCH_SIZE)
- end
-end
diff --git a/spec/migrations/20211116091751_change_namespace_type_default_to_user_spec.rb b/spec/migrations/20211116091751_change_namespace_type_default_to_user_spec.rb
deleted file mode 100644
index deba6f9b87c..00000000000
--- a/spec/migrations/20211116091751_change_namespace_type_default_to_user_spec.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-# frozen_string_literal: true
-
-# With https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73495, we no longer allow
-# a Namespace type to be nil. There is nothing left to test for this migration,
-# but we'll keep this file here as a tombstone.
diff --git a/spec/migrations/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb b/spec/migrations/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb
deleted file mode 100644
index 745fcac8220..00000000000
--- a/spec/migrations/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings_spec.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-# frozen_string_literal: true
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe ScheduleRemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings,
- :suppress_gitlab_schemas_validate_connection, :migration, feature_category: :vulnerability_management do
- let!(:background_migration_jobs) { table(:background_migration_jobs) }
- let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
- let!(:users) { table(:users) }
- let!(:user) { create_user! }
- let!(:project) { table(:projects).create!(id: 14219619, namespace_id: namespace.id) }
- let!(:pipelines) { table(:ci_pipelines) }
- let!(:scanners) { table(:vulnerability_scanners) }
- let!(:scanner1) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') }
- let!(:scanner2) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') }
- let!(:scanner3) { scanners.create!(project_id: project.id, external_id: 'test 3', name: 'test scanner 3') }
- let!(:unrelated_scanner) { scanners.create!(project_id: project.id, external_id: 'unreleated_scanner', name: 'unrelated scanner') }
- let!(:vulnerabilities) { table(:vulnerabilities) }
- let!(:vulnerability_findings) { table(:vulnerability_occurrences) }
- let!(:vulnerability_finding_pipelines) { table(:vulnerability_occurrence_pipelines) }
- let!(:vulnerability_identifiers) { table(:vulnerability_identifiers) }
- let!(:vulnerability_identifier) do
- vulnerability_identifiers.create!(
- id: 1244459,
- project_id: project.id,
- external_type: 'vulnerability-identifier',
- external_id: 'vulnerability-identifier',
- fingerprint: '0a203e8cd5260a1948edbedc76c7cb91ad6a2e45',
- name: 'vulnerability identifier')
- end
-
- let!(:vulnerability_for_first_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:first_finding_duplicate) do
- create_finding!(
- id: 5606961,
- uuid: "bd95c085-71aa-51d7-9bb6-08ae669c262e",
- vulnerability_id: vulnerability_for_first_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner1.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_second_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:second_finding_duplicate) do
- create_finding!(
- id: 8765432,
- uuid: "5b714f58-1176-5b26-8fd5-e11dfcb031b5",
- vulnerability_id: vulnerability_for_second_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner2.id,
- project_id: project.id
- )
- end
-
- let!(:vulnerability_for_third_duplicate) do
- create_vulnerability!(
- project_id: project.id,
- author_id: user.id
- )
- end
-
- let!(:third_finding_duplicate) do
- create_finding!(
- id: 8832995,
- uuid: "cfe435fa-b25b-5199-a56d-7b007cc9e2d4",
- vulnerability_id: vulnerability_for_third_duplicate.id,
- report_type: 0,
- location_fingerprint: '00049d5119c2cb3bfb3d1ee1f6e031fe925aed75',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: scanner3.id,
- project_id: project.id
- )
- end
-
- let!(:unrelated_finding) do
- create_finding!(
- id: 9999999,
- vulnerability_id: nil,
- report_type: 1,
- location_fingerprint: 'random_location_fingerprint',
- primary_identifier_id: vulnerability_identifier.id,
- scanner_id: unrelated_scanner.id,
- project_id: project.id
- )
- end
-
- before do
- stub_const("#{described_class}::BATCH_SIZE", 1)
-
- 4.times do
- create_finding_pipeline!(project_id: project.id, finding_id: first_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: second_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: third_finding_duplicate.id)
- create_finding_pipeline!(project_id: project.id, finding_id: unrelated_finding.id)
- end
- end
-
- around do |example|
- freeze_time { Sidekiq::Testing.fake! { example.run } }
- end
-
- it 'schedules background migrations' do
- migrate!
-
- expect(background_migration_jobs.count).to eq(4)
- expect(background_migration_jobs.first.arguments).to match_array([first_finding_duplicate.id, first_finding_duplicate.id])
- expect(background_migration_jobs.second.arguments).to match_array([second_finding_duplicate.id, second_finding_duplicate.id])
- expect(background_migration_jobs.third.arguments).to match_array([third_finding_duplicate.id, third_finding_duplicate.id])
- expect(background_migration_jobs.fourth.arguments).to match_array([unrelated_finding.id, unrelated_finding.id])
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(4)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, first_finding_duplicate.id, first_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, second_finding_duplicate.id, second_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(6.minutes, third_finding_duplicate.id, third_finding_duplicate.id)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(8.minutes, unrelated_finding.id, unrelated_finding.id)
- end
-
- private
-
- def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0)
- vulnerabilities.create!(
- project_id: project_id,
- author_id: author_id,
- title: title,
- severity: severity,
- confidence: confidence,
- report_type: report_type
- )
- end
-
- # rubocop:disable Metrics/ParameterLists
- def create_finding!(
- vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, id: nil,
- name: "test", severity: 7, confidence: 7, report_type: 0,
- project_fingerprint: '123qweasdzxc', location_fingerprint: 'test',
- metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid)
- params = {
- vulnerability_id: vulnerability_id,
- project_id: project_id,
- name: name,
- severity: severity,
- confidence: confidence,
- report_type: report_type,
- project_fingerprint: project_fingerprint,
- scanner_id: scanner_id,
- primary_identifier_id: vulnerability_identifier.id,
- location_fingerprint: location_fingerprint,
- metadata_version: metadata_version,
- raw_metadata: raw_metadata,
- uuid: uuid
- }
- params[:id] = id unless id.nil?
- vulnerability_findings.create!(params)
- end
- # rubocop:enable Metrics/ParameterLists
-
- def create_user!(name: "Example User", email: "user@example.com", user_type: nil, created_at: Time.zone.now, confirmed_at: Time.zone.now)
- users.create!(
- name: name,
- email: email,
- username: name,
- projects_limit: 0,
- user_type: user_type,
- confirmed_at: confirmed_at
- )
- end
-
- def create_finding_pipeline!(project_id:, finding_id:)
- pipeline = pipelines.create!(project_id: project_id)
- vulnerability_finding_pipelines.create!(pipeline_id: pipeline.id, occurrence_id: finding_id)
- end
-end
diff --git a/spec/migrations/20211117084814_migrate_remaining_u2f_registrations_spec.rb b/spec/migrations/20211117084814_migrate_remaining_u2f_registrations_spec.rb
deleted file mode 100644
index ede9c5ea7e8..00000000000
--- a/spec/migrations/20211117084814_migrate_remaining_u2f_registrations_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe MigrateRemainingU2fRegistrations, :migration, feature_category: :system_access do
- let(:u2f_registrations) { table(:u2f_registrations) }
- let(:webauthn_registrations) { table(:webauthn_registrations) }
- let(:users) { table(:users) }
-
- let(:user) { users.create!(email: 'email@email.com', name: 'foo', username: 'foo', projects_limit: 0) }
-
- before do
- create_u2f_registration(1, 'reg1')
- create_u2f_registration(2, 'reg2')
- create_u2f_registration(3, '')
- create_u2f_registration(4, nil)
- webauthn_registrations.create!({ name: 'reg1', u2f_registration_id: 1, credential_xid: '', public_key: '', user_id: user.id })
- end
-
- it 'correctly migrates u2f registrations previously not migrated' do
- expect { migrate! }.to change { webauthn_registrations.count }.from(1).to(4)
- end
-
- it 'migrates all valid u2f registrations depite errors' do
- create_u2f_registration(5, 'reg3', 'invalid!')
- create_u2f_registration(6, 'reg4')
-
- expect { migrate! }.to change { webauthn_registrations.count }.from(1).to(5)
- end
-
- def create_u2f_registration(id, name, public_key = nil)
- device = U2F::FakeU2F.new(FFaker::BaconIpsum.characters(5), { key_handle: SecureRandom.random_bytes(255) })
- public_key ||= Base64.strict_encode64(device.origin_public_key_raw)
- u2f_registrations.create!({ id: id,
- certificate: Base64.strict_encode64(device.cert_raw),
- key_handle: U2F.urlsafe_encode64(device.key_handle_raw),
- public_key: public_key,
- counter: 5,
- name: name,
- user_id: user.id })
- end
-end
diff --git a/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb b/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb
deleted file mode 100644
index 09a8bb44d88..00000000000
--- a/spec/migrations/20211126115449_encrypt_static_objects_external_storage_auth_token_spec.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe EncryptStaticObjectsExternalStorageAuthToken, :migration, feature_category: :source_code_management do
- let(:application_settings) do
- Class.new(ActiveRecord::Base) do
- self.table_name = 'application_settings'
- end
- end
-
- context 'when static_objects_external_storage_auth_token is not set' do
- it 'does nothing' do
- application_settings.create!
-
- reversible_migration do |migration|
- migration.before -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to be_nil
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil
- }
-
- migration.after -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to be_nil
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil
- }
- end
- end
- end
-
- context 'when static_objects_external_storage_auth_token is set' do
- it 'encrypts static_objects_external_storage_auth_token' do
- settings = application_settings.create!
- settings.update_column(:static_objects_external_storage_auth_token, 'Test')
-
- reversible_migration do |migration|
- migration.before -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to eq('Test')
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil
- }
- migration.after -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to eq('Test')
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_present
- }
- end
- end
- end
-
- context 'when static_objects_external_storage_auth_token is empty string' do
- it 'does not break' do
- settings = application_settings.create!
- settings.update_column(:static_objects_external_storage_auth_token, '')
-
- reversible_migration do |migration|
- migration.before -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to eq('')
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil
- }
- migration.after -> {
- settings = application_settings.first
-
- expect(settings.static_objects_external_storage_auth_token).to eq('')
- expect(settings.static_objects_external_storage_auth_token_encrypted).to be_nil
- }
- end
- end
- end
-end
diff --git a/spec/migrations/20211126204445_add_task_to_work_item_types_spec.rb b/spec/migrations/20211126204445_add_task_to_work_item_types_spec.rb
deleted file mode 100644
index db68e895b61..00000000000
--- a/spec/migrations/20211126204445_add_task_to_work_item_types_spec.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AddTaskToWorkItemTypes, :migration, feature_category: :team_planning do
- include MigrationHelpers::WorkItemTypesHelper
-
- let!(:work_item_types) { table(:work_item_types) }
-
- let(:base_types) do
- {
- issue: 0,
- incident: 1,
- test_case: 2,
- requirement: 3,
- task: 4
- }
- end
-
- append_after(:all) do
- # Make sure base types are recreated after running the migration
- # because migration specs are not run in a transaction
- reset_work_item_types
- end
-
- it 'skips creating the record if it already exists' do
- reset_db_state_prior_to_migration
- work_item_types.find_or_create_by!(name: 'Task', namespace_id: nil, base_type: base_types[:task], icon_name: 'issue-type-task')
-
- expect do
- migrate!
- end.to not_change(work_item_types, :count)
- end
-
- it 'adds task to base work item types' do
- reset_db_state_prior_to_migration
-
- expect do
- migrate!
- end.to change(work_item_types, :count).from(4).to(5)
-
- expect(work_item_types.all.pluck(:base_type)).to include(base_types[:task])
- end
-
- def reset_db_state_prior_to_migration
- # Database needs to be in a similar state as when this migration was created
- work_item_types.delete_all
- work_item_types.find_or_create_by!(name: 'Issue', namespace_id: nil, base_type: base_types[:issue], icon_name: 'issue-type-issue')
- work_item_types.find_or_create_by!(name: 'Incident', namespace_id: nil, base_type: base_types[:incident], icon_name: 'issue-type-incident')
- work_item_types.find_or_create_by!(name: 'Test Case', namespace_id: nil, base_type: base_types[:test_case], icon_name: 'issue-type-test-case')
- work_item_types.find_or_create_by!(name: 'Requirement', namespace_id: nil, base_type: base_types[:requirement], icon_name: 'issue-type-requirements')
- end
-end
diff --git a/spec/migrations/20211130165043_backfill_sequence_column_for_sprints_table_spec.rb b/spec/migrations/20211130165043_backfill_sequence_column_for_sprints_table_spec.rb
deleted file mode 100644
index 91646da4791..00000000000
--- a/spec/migrations/20211130165043_backfill_sequence_column_for_sprints_table_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe BackfillSequenceColumnForSprintsTable, :migration, schema: 20211126042235, feature_category: :team_planning do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:sprints) { table(:sprints) }
- let(:iterations_cadences) { table(:iterations_cadences) }
-
- let!(:group) { namespaces.create!(name: 'foo', path: 'foo') }
- let!(:cadence_1) { iterations_cadences.create!(group_id: group.id, title: "cadence 1") }
- let!(:cadence_2) { iterations_cadences.create!(group_id: group.id, title: "cadence 2") }
- let!(:iteration_1) { sprints.create!(id: 1, group_id: group.id, iterations_cadence_id: cadence_1.id, start_date: Date.new(2021, 11, 1), due_date: Date.new(2021, 11, 5), iid: 1, title: 'a' ) }
- let!(:iteration_2) { sprints.create!(id: 2, group_id: group.id, iterations_cadence_id: cadence_1.id, start_date: Date.new(2021, 12, 1), due_date: Date.new(2021, 12, 5), iid: 2, title: 'b') }
- let!(:iteration_3) { sprints.create!(id: 3, group_id: group.id, iterations_cadence_id: cadence_2.id, start_date: Date.new(2021, 12, 1), due_date: Date.new(2021, 12, 5), iid: 4, title: 'd') }
- let!(:iteration_4) { sprints.create!(id: 4, group_id: group.id, iterations_cadence_id: nil, start_date: Date.new(2021, 11, 15), due_date: Date.new(2021, 11, 20), iid: 3, title: 'c') }
-
- describe '#up' do
- it "correctly sets the sequence attribute with idempotency" do
- migration.up
-
- expect(iteration_1.reload.sequence).to be 1
- expect(iteration_2.reload.sequence).to be 2
- expect(iteration_3.reload.sequence).to be 1
- expect(iteration_4.reload.sequence).to be nil
-
- iteration_5 = sprints.create!(id: 5, group_id: group.id, iterations_cadence_id: cadence_1.id, start_date: Date.new(2022, 1, 1), due_date: Date.new(2022, 1, 5), iid: 1, title: 'e' )
-
- migration.down
- migration.up
-
- expect(iteration_1.reload.sequence).to be 1
- expect(iteration_2.reload.sequence).to be 2
- expect(iteration_5.reload.sequence).to be 3
- expect(iteration_3.reload.sequence).to be 1
- expect(iteration_4.reload.sequence).to be nil
- end
- end
-end
diff --git a/spec/migrations/add_open_source_plan_spec.rb b/spec/migrations/add_open_source_plan_spec.rb
deleted file mode 100644
index f5d68f455e6..00000000000
--- a/spec/migrations/add_open_source_plan_spec.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddOpenSourcePlan, :migration, feature_category: :purchase do
- describe '#up' do
- before do
- allow(Gitlab).to receive(:com?).and_return true
- end
-
- it 'creates 1 entry within the plans table' do
- expect { migrate! }.to change { AddOpenSourcePlan::Plan.count }.by 1
- expect(AddOpenSourcePlan::Plan.last.name).to eql('opensource')
- end
-
- it 'creates 1 entry for plan limits' do
- expect { migrate! }.to change { AddOpenSourcePlan::PlanLimits.count }.by 1
- end
-
- context 'when the plan limits for gold and silver exists' do
- before do
- table(:plans).create!(id: 1, name: 'ultimate', title: 'Ultimate')
- table(:plan_limits).create!(id: 1, plan_id: 1, storage_size_limit: 2000)
- end
-
- it 'duplicates the gold and silvers plan limits entries' do
- migrate!
-
- opensource_limits = AddOpenSourcePlan::Plan.find_by(name: 'opensource').limits
- expect(opensource_limits.storage_size_limit).to be 2000
- end
- end
-
- context 'when the instance is not SaaS' do
- before do
- allow(Gitlab).to receive(:com?).and_return false
- end
-
- it 'does not create plans and plan limits and returns' do
- expect { migrate! }.not_to change { AddOpenSourcePlan::Plan.count }
- end
- end
- end
-
- describe '#down' do
- before do
- table(:plans).create!(id: 3, name: 'other')
- table(:plan_limits).create!(plan_id: 3)
- end
-
- context 'when the instance is SaaS' do
- before do
- allow(Gitlab).to receive(:com?).and_return true
- end
-
- it 'removes the newly added opensource entry' do
- migrate!
-
- expect { described_class.new.down }.to change { AddOpenSourcePlan::Plan.count }.by(-1)
- expect(AddOpenSourcePlan::Plan.find_by(name: 'opensource')).to be_nil
-
- other_plan = AddOpenSourcePlan::Plan.find_by(name: 'other')
- expect(other_plan).to be_persisted
- expect(AddOpenSourcePlan::PlanLimits.count).to eq(1)
- expect(AddOpenSourcePlan::PlanLimits.first.plan_id).to eq(other_plan.id)
- end
- end
-
- context 'when the instance is not SaaS' do
- before do
- allow(Gitlab).to receive(:com?).and_return false
- table(:plans).create!(id: 1, name: 'opensource', title: 'Open Source Program')
- table(:plan_limits).create!(id: 1, plan_id: 1)
- end
-
- it 'does not delete plans and plan limits and returns' do
- migrate!
-
- expect { described_class.new.down }.not_to change { AddOpenSourcePlan::Plan.count }
- expect(AddOpenSourcePlan::PlanLimits.count).to eq(2)
- end
- end
- end
-end
diff --git a/spec/migrations/backfill_user_namespace_spec.rb b/spec/migrations/backfill_user_namespace_spec.rb
deleted file mode 100644
index a58030803b1..00000000000
--- a/spec/migrations/backfill_user_namespace_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe BackfillUserNamespace, feature_category: :subgroups do
- let!(:migration) { described_class::MIGRATION }
-
- describe '#up' do
- it 'schedules background jobs for each batch of namespaces' do
- migrate!
-
- expect(migration).to have_scheduled_batched_migration(
- table_name: :namespaces,
- column_name: :id,
- interval: described_class::INTERVAL
- )
- end
- end
-
- describe '#down' do
- it 'deletes all batched migration records' do
- migrate!
- schema_migrate_down!
-
- expect(migration).not_to have_scheduled_batched_migration
- end
- end
-end
diff --git a/spec/migrations/disable_job_token_scope_when_unused_spec.rb b/spec/migrations/disable_job_token_scope_when_unused_spec.rb
deleted file mode 100644
index fddf3594e2b..00000000000
--- a/spec/migrations/disable_job_token_scope_when_unused_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DisableJobTokenScopeWhenUnused, feature_category: :continuous_integration do
- it 'is a no-op' do
- migrate!
- end
-end
diff --git a/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb b/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb
deleted file mode 100644
index 0cebe7b9f91..00000000000
--- a/spec/migrations/finalize_traversal_ids_background_migrations_spec.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!('finalize_traversal_ids_background_migrations')
-
-RSpec.describe FinalizeTraversalIdsBackgroundMigrations, :migration, feature_category: :database do
- shared_context 'incomplete background migration' do
- before do
- # Jobs enqueued in Sidekiq.
- Sidekiq::Testing.disable! do
- BackgroundMigrationWorker.perform_in(10, job_class_name, [1, 2, 100])
- BackgroundMigrationWorker.perform_in(20, job_class_name, [3, 4, 100])
- end
-
- # Jobs tracked in the database.
- # table(:background_migration_jobs).create!(
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: job_class_name,
- arguments: [5, 6, 100],
- status: Gitlab::Database::BackgroundMigrationJob.statuses['pending']
- )
- # table(:background_migration_jobs).create!(
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: job_class_name,
- arguments: [7, 8, 100],
- status: Gitlab::Database::BackgroundMigrationJob.statuses['succeeded']
- )
- end
- end
-
- context 'BackfillNamespaceTraversalIdsRoots background migration' do
- let(:job_class_name) { 'BackfillNamespaceTraversalIdsRoots' }
-
- include_context 'incomplete background migration'
-
- before do
- migrate!
- end
-
- it_behaves_like(
- 'finalized tracked background migration',
- Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots
- )
- end
-
- context 'BackfillNamespaceTraversalIdsChildren background migration' do
- let(:job_class_name) { 'BackfillNamespaceTraversalIdsChildren' }
-
- include_context 'incomplete background migration'
-
- before do
- migrate!
- end
-
- it_behaves_like(
- 'finalized tracked background migration',
- Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren
- )
- end
-end
diff --git a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb b/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb
deleted file mode 100644
index 80ecc23dfbe..00000000000
--- a/spec/migrations/recreate_index_security_ci_builds_on_name_and_id_parser_features_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures, :migration, feature_category: :database do
- let(:db) { described_class.new }
- let(:pg_class) { table(:pg_class) }
- let(:pg_index) { table(:pg_index) }
- let(:async_indexes) { table(:postgres_async_indexes) }
-
- it "recreates index" do
- reversible_migration do |migration|
- migration.before -> {
- expect(async_indexes.where(name: described_class::OLD_INDEX_NAME).exists?).to be false
- expect(db.index_exists?(described_class::TABLE, described_class::COLUMNS, name: described_class::OLD_INDEX_NAME)).to be true
- expect(db.index_exists?(described_class::TABLE, described_class::COLUMNS, name: described_class::NEW_INDEX_NAME)).to be false
- }
-
- migration.after -> {
- expect(async_indexes.where(name: described_class::OLD_INDEX_NAME).exists?).to be true
- expect(db.index_exists?(described_class::TABLE, described_class::COLUMNS, name: described_class::OLD_INDEX_NAME)).to be false
- expect(db.index_exists?(described_class::TABLE, described_class::COLUMNS, name: described_class::NEW_INDEX_NAME)).to be true
- }
- end
- end
-end
diff --git a/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb b/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb
deleted file mode 100644
index 86e161cea43..00000000000
--- a/spec/migrations/remove_schedule_and_status_from_pending_alert_escalations_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RemoveScheduleAndStatusFromPendingAlertEscalations, feature_category: :incident_management do
- let(:escalations) { table(:incident_management_pending_alert_escalations) }
- let(:schedule_index) { 'index_incident_management_pending_alert_escalations_on_schedule' }
- let(:schedule_foreign_key) { 'fk_rails_fcbfd9338b' }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(escalations.column_names).to include('schedule_id', 'status')
- expect(escalations_indexes).to include(schedule_index)
- expect(escalations_constraints).to include(schedule_foreign_key)
- }
-
- migration.after -> {
- escalations.reset_column_information
- expect(escalations.column_names).not_to include('schedule_id', 'status')
- expect(escalations_indexes).not_to include(schedule_index)
- expect(escalations_constraints).not_to include(schedule_foreign_key)
- }
- end
- end
-
- private
-
- def escalations_indexes
- ActiveRecord::Base.connection.indexes(:incident_management_pending_alert_escalations).collect(&:name)
- end
-
- def escalations_constraints
- ActiveRecord::Base.connection.foreign_keys(:incident_management_pending_alert_escalations).collect(&:name)
- end
-end
diff --git a/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb b/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb
deleted file mode 100644
index 602a157fffb..00000000000
--- a/spec/migrations/schedule_recalculate_vulnerability_finding_signatures_for_findings_spec.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ScheduleRecalculateVulnerabilityFindingSignaturesForFindings, :migration,
- feature_category: :vulnerability_management do
- before do
- allow(Gitlab).to receive(:ee?).and_return(ee?)
- stub_const("#{described_class.name}::BATCH_SIZE", 2)
- end
-
- context 'when the Gitlab instance is FOSS' do
- let(:ee?) { false }
-
- it 'does not run the migration' do
- expect { migrate! }.not_to change { BackgroundMigrationWorker.jobs.size }
- end
- end
-
- context 'when the Gitlab instance is EE' do
- let(:ee?) { true }
-
- let!(:namespaces) { table(:namespaces) }
- let!(:projects) { table(:projects) }
- let!(:findings) { table(:vulnerability_occurrences) }
- let!(:scanners) { table(:vulnerability_scanners) }
- let!(:identifiers) { table(:vulnerability_identifiers) }
- let!(:vulnerability_finding_signatures) { table(:vulnerability_finding_signatures) }
-
- let!(:namespace) { namespaces.create!(name: 'test', path: 'test') }
- let!(:project) { projects.create!(namespace_id: namespace.id, name: 'gitlab', path: 'gitlab') }
-
- let!(:scanner) do
- scanners.create!(project_id: project.id, external_id: 'trivy', name: 'Security Scanner')
- end
-
- let!(:identifier) do
- identifiers.create!(
- project_id: project.id,
- fingerprint: 'd432c2ad2953e8bd587a3a43b3ce309b5b0154c123',
- external_type: 'SECURITY_ID',
- external_id: 'SECURITY_0',
- name: 'SECURITY_IDENTIFIER 0'
- )
- end
-
- let!(:finding1) { findings.create!(finding_params) }
- let!(:signature1) { vulnerability_finding_signatures.create!(finding_id: finding1.id, algorithm_type: 0, signature_sha: ::Digest::SHA1.digest(SecureRandom.hex(50))) }
-
- let!(:finding2) { findings.create!(finding_params) }
- let!(:signature2) { vulnerability_finding_signatures.create!(finding_id: finding2.id, algorithm_type: 0, signature_sha: ::Digest::SHA1.digest(SecureRandom.hex(50))) }
-
- let!(:finding3) { findings.create!(finding_params) }
- let!(:signature3) { vulnerability_finding_signatures.create!(finding_id: finding3.id, algorithm_type: 0, signature_sha: ::Digest::SHA1.digest(SecureRandom.hex(50))) }
-
- # this migration is now a no-op
- it 'does not schedule the background jobs', :aggregate_failures do
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(0)
- expect(described_class::MIGRATION)
- .not_to be_scheduled_migration_with_multiple_args(signature1.id, signature2.id)
- expect(described_class::MIGRATION)
- .not_to be_scheduled_migration_with_multiple_args(signature3.id, signature3.id)
- end
- end
- end
-
- def finding_params
- uuid = SecureRandom.uuid
-
- {
- severity: 0,
- confidence: 5,
- report_type: 2,
- project_id: project.id,
- scanner_id: scanner.id,
- primary_identifier_id: identifier.id,
- location: nil,
- project_fingerprint: SecureRandom.hex(20),
- location_fingerprint: Digest::SHA1.hexdigest(SecureRandom.hex(10)),
- uuid: uuid,
- name: "Vulnerability Finding #{uuid}",
- metadata_version: '1.3',
- raw_metadata: '{}'
- }
- end
- end
-end
diff --git a/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb b/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb
deleted file mode 100644
index ffd25152a45..00000000000
--- a/spec/migrations/slice_merge_request_diff_commit_migrations_spec.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe SliceMergeRequestDiffCommitMigrations, :migration, feature_category: :code_review_workflow do
- let(:migration) { described_class.new }
-
- describe '#up' do
- context 'when there are no jobs to process' do
- it 'does nothing' do
- expect(migration).not_to receive(:migrate_in)
- expect(Gitlab::Database::BackgroundMigrationJob).not_to receive(:create!)
-
- migration.up
- end
- end
-
- context 'when there are pending jobs' do
- let!(:job1) do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: described_class::MIGRATION_CLASS,
- arguments: [1, 10_001]
- )
- end
-
- let!(:job2) do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: described_class::MIGRATION_CLASS,
- arguments: [10_001, 20_001]
- )
- end
-
- it 'marks the old jobs as finished' do
- migration.up
-
- job1.reload
- job2.reload
-
- expect(job1).to be_succeeded
- expect(job2).to be_succeeded
- end
-
- it 'the jobs are slices into smaller ranges' do
- migration.up
-
- new_jobs = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class(described_class::MIGRATION_CLASS)
- .pending
- .to_a
-
- expect(new_jobs.map(&:arguments)).to eq(
- [
- [1, 5_001],
- [5_001, 10_001],
- [10_001, 15_001],
- [15_001, 20_001]
- ])
- end
-
- it 'schedules a background migration for the first job' do
- expect(migration)
- .to receive(:migrate_in)
- .with(1.hour, described_class::STEAL_MIGRATION_CLASS, [1, 5_001])
-
- migration.up
- end
- end
- end
-end
diff --git a/spec/models/service_desk/custom_email_credential_spec.rb b/spec/models/service_desk/custom_email_credential_spec.rb
new file mode 100644
index 00000000000..a990b77128e
--- /dev/null
+++ b/spec/models/service_desk/custom_email_credential_spec.rb
@@ -0,0 +1,67 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe ServiceDesk::CustomEmailCredential, feature_category: :service_desk do
+ let(:project) { build_stubbed(:project) }
+ let(:credential) { build_stubbed(:service_desk_custom_email_credential, project: project) }
+ let(:smtp_username) { "user@example.com" }
+ let(:smtp_password) { "supersecret" }
+
+ describe 'validations' do
+ it { is_expected.to validate_presence_of(:project) }
+
+ it { is_expected.to validate_presence_of(:smtp_address) }
+ it { is_expected.to validate_length_of(:smtp_address).is_at_most(255) }
+ it { is_expected.to allow_value('smtp.gmail.com').for(:smtp_address) }
+ it { is_expected.to allow_value('1.1.1.1').for(:smtp_address) }
+ it { is_expected.to allow_value('199.1.1.1').for(:smtp_address) }
+ it { is_expected.not_to allow_value('https://example.com').for(:smtp_address) }
+ it { is_expected.not_to allow_value('file://example').for(:smtp_address) }
+ it { is_expected.not_to allow_value('/example').for(:smtp_address) }
+ it { is_expected.not_to allow_value('localhost').for(:smtp_address) }
+ it { is_expected.not_to allow_value('127.0.0.1').for(:smtp_address) }
+ it { is_expected.not_to allow_value('192.168.12.12').for(:smtp_address) } # disallow local network
+
+ it { is_expected.to validate_presence_of(:smtp_port) }
+ it { is_expected.to validate_numericality_of(:smtp_port).only_integer.is_greater_than(0) }
+
+ it { is_expected.to validate_presence_of(:smtp_username) }
+ it { is_expected.to validate_length_of(:smtp_username).is_at_most(255) }
+
+ it { is_expected.to validate_presence_of(:smtp_password) }
+ it { is_expected.to validate_length_of(:smtp_password).is_at_least(8).is_at_most(128) }
+ end
+
+ describe 'encrypted #smtp_username' do
+ subject { build_stubbed(:service_desk_custom_email_credential, smtp_username: smtp_username) }
+
+ it 'saves and retrieves the encrypted smtp username and iv correctly' do
+ expect(subject.encrypted_smtp_username).not_to be_nil
+ expect(subject.encrypted_smtp_username_iv).not_to be_nil
+
+ expect(subject.smtp_username).to eq(smtp_username)
+ end
+ end
+
+ describe 'encrypted #smtp_password' do
+ subject { build_stubbed(:service_desk_custom_email_credential, smtp_password: smtp_password) }
+
+ it 'saves and retrieves the encrypted smtp password and iv correctly' do
+ expect(subject.encrypted_smtp_password).not_to be_nil
+ expect(subject.encrypted_smtp_password_iv).not_to be_nil
+
+ expect(subject.smtp_password).to eq(smtp_password)
+ end
+ end
+
+ describe 'associations' do
+ it { is_expected.to belong_to(:project) }
+
+ it 'can access service desk setting from project' do
+ setting = build_stubbed(:service_desk_setting, project: project)
+
+ expect(credential.service_desk_setting).to eq(setting)
+ end
+ end
+end
diff --git a/spec/models/service_desk_setting_spec.rb b/spec/models/service_desk_setting_spec.rb
index b99494e6736..dba33e829c6 100644
--- a/spec/models/service_desk_setting_spec.rb
+++ b/spec/models/service_desk_setting_spec.rb
@@ -16,8 +16,6 @@ RSpec.describe ServiceDeskSetting, feature_category: :service_desk do
it { is_expected.not_to allow_value('abc 12').for(:project_key).with_message("can contain only lowercase letters, digits, and '_'.") }
it { is_expected.not_to allow_value('Big val').for(:project_key) }
it { is_expected.to validate_length_of(:custom_email).is_at_most(255) }
- it { is_expected.to validate_length_of(:custom_email_smtp_address).is_at_most(255) }
- it { is_expected.to validate_length_of(:custom_email_smtp_username).is_at_most(255) }
describe '#custom_email_enabled' do
it { expect(subject.custom_email_enabled).to be_falsey }
@@ -27,7 +25,6 @@ RSpec.describe ServiceDeskSetting, feature_category: :service_desk do
context 'when custom_email_enabled is true' do
before do
# Test without ServiceDesk::CustomEmailVerification for simplicity
- # See dedicated simplified tests below
subject.custom_email_enabled = true
end
@@ -47,28 +44,6 @@ RSpec.describe ServiceDeskSetting, feature_category: :service_desk do
it { is_expected.not_to allow_value('"><script>alert(1);</script>"@example.org').for(:custom_email) }
it { is_expected.not_to allow_value('file://example').for(:custom_email) }
it { is_expected.not_to allow_value('no email at all').for(:custom_email) }
-
- it { is_expected.to validate_presence_of(:custom_email_smtp_username) }
-
- it { is_expected.to validate_presence_of(:custom_email_smtp_port) }
- it { is_expected.to validate_numericality_of(:custom_email_smtp_port).only_integer.is_greater_than(0) }
-
- it { is_expected.to validate_presence_of(:custom_email_smtp_address) }
- it { is_expected.to allow_value('smtp.gmail.com').for(:custom_email_smtp_address) }
- it { is_expected.not_to allow_value('https://example.com').for(:custom_email_smtp_address) }
- it { is_expected.not_to allow_value('file://example').for(:custom_email_smtp_address) }
- it { is_expected.not_to allow_value('/example').for(:custom_email_smtp_address) }
- end
-
- context 'when custom email verification is present/was triggered' do
- before do
- subject.project.service_desk_custom_email_verification = verification
- end
-
- it { is_expected.to validate_presence_of(:custom_email) }
- it { is_expected.to validate_presence_of(:custom_email_smtp_username) }
- it { is_expected.to validate_presence_of(:custom_email_smtp_port) }
- it { is_expected.to validate_presence_of(:custom_email_smtp_address) }
end
describe '#valid_issue_template' do
@@ -138,36 +113,11 @@ RSpec.describe ServiceDeskSetting, feature_category: :service_desk do
end
end
- describe 'encrypted #custom_email_smtp_password' do
- let_it_be(:settings) do
- create(
- :service_desk_setting,
- custom_email_enabled: true,
- custom_email: 'support@example.com',
- custom_email_smtp_address: 'smtp.example.com',
- custom_email_smtp_port: 587,
- custom_email_smtp_username: 'support@example.com',
- custom_email_smtp_password: 'supersecret'
- )
- end
-
- it 'saves and retrieves the encrypted custom email smtp password and iv correctly' do
- expect(settings.encrypted_custom_email_smtp_password).not_to be_nil
- expect(settings.encrypted_custom_email_smtp_password_iv).not_to be_nil
-
- expect(settings.custom_email_smtp_password).to eq('supersecret')
- end
- end
-
describe 'associations' do
let(:custom_email_settings) do
build_stubbed(
:service_desk_setting,
- custom_email: 'support@example.com',
- custom_email_smtp_address: 'smtp.example.com',
- custom_email_smtp_port: 587,
- custom_email_smtp_username: 'support@example.com',
- custom_email_smtp_password: 'supersecret'
+ custom_email: 'support@example.com'
)
end
diff --git a/spec/requests/projects/work_items_spec.rb b/spec/requests/projects/work_items_spec.rb
index 056416d380d..c13707e1945 100644
--- a/spec/requests/projects/work_items_spec.rb
+++ b/spec/requests/projects/work_items_spec.rb
@@ -3,16 +3,41 @@
require 'spec_helper'
RSpec.describe 'Work Items', feature_category: :team_planning do
+ include WorkhorseHelpers
+
+ include_context 'workhorse headers'
+
let_it_be(:work_item) { create(:work_item) }
- let_it_be(:developer) { create(:user) }
+ let_it_be(:current_user) { create(:user) }
+ let_it_be(:project) { create(:project) }
+
+ let(:file) { fixture_file_upload("spec/fixtures/#{filename}") }
before_all do
- work_item.project.add_developer(developer)
+ work_item.project.add_developer(current_user)
+ end
+
+ shared_examples 'response with 404 status' do
+ it 'returns 404' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
+
+ shared_examples 'safely handles uploaded files', :aggregate_failures do
+ it 'ensures the upload is handled safely' do
+ allow(Gitlab::Utils).to receive(:check_path_traversal!).and_call_original
+ expect(Gitlab::Utils).to receive(:check_path_traversal!).with(filename).at_least(:once)
+ expect(FileUploader).not_to receive(:cache)
+
+ subject
+ end
end
describe 'GET /:namespace/:project/work_items/:id' do
before do
- sign_in(developer)
+ sign_in(current_user)
end
it 'renders index' do
@@ -21,4 +46,149 @@ RSpec.describe 'Work Items', feature_category: :team_planning do
expect(response).to have_gitlab_http_status(:ok)
end
end
+
+ describe 'POST /:namespace/:project/work_items/import_csv' do
+ let(:filename) { 'work_items_valid_types.csv' }
+ let(:params) { { namespace_id: project.namespace.id, path: 'test' } }
+
+ subject { upload_file(file, workhorse_headers, params) }
+
+ shared_examples 'handles authorisation' do
+ context 'when unauthorized' do
+ context 'with non-member' do
+ let_it_be(:current_user) { create(:user) }
+
+ before do
+ sign_in(current_user)
+ end
+
+ it 'responds with error' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:not_found)
+ end
+ end
+
+ context 'with anonymous user' do
+ it 'responds with error' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:found)
+ expect(response).to be_redirect
+ end
+ end
+ end
+
+ context 'when authorized' do
+ before do
+ sign_in(current_user)
+ project.add_reporter(current_user)
+ end
+
+ context 'when import/export work items feature is available and member is a reporter' do
+ shared_examples 'response with success status' do
+ it 'returns 200 status and success message' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:success)
+ expect(json_response).to eq(
+ 'message' => "Your work items are being imported. Once finished, you'll receive a confirmation email.")
+ end
+ end
+
+ it_behaves_like 'response with success status'
+ it_behaves_like 'safely handles uploaded files'
+
+ it 'shows error when upload fails' do
+ expect_next_instance_of(UploadService) do |upload_service|
+ expect(upload_service).to receive(:execute).and_return(nil)
+ end
+
+ subject
+
+ expect(json_response).to eq('errors' => 'File upload error.')
+ end
+
+ context 'when file extension is not csv' do
+ let(:filename) { 'sample_doc.md' }
+
+ it 'returns error message' do
+ subject
+
+ expect(response).to have_gitlab_http_status(:bad_request)
+ expect(json_response).to eq(
+ 'errors' => "The uploaded file was invalid. Supported file extensions are .csv.")
+ end
+ end
+ end
+
+ context 'when work items import/export feature is not available' do
+ before do
+ stub_feature_flags(import_export_work_items_csv: false)
+ end
+
+ it_behaves_like 'response with 404 status'
+ end
+ end
+ end
+
+ context 'with public project' do
+ let_it_be(:project) { create(:project, :public) }
+
+ it_behaves_like 'handles authorisation'
+ end
+
+ context 'with private project' do
+ it_behaves_like 'handles authorisation'
+ end
+
+ def upload_file(file, headers = {}, params = {})
+ workhorse_finalize(
+ import_csv_project_work_items_path(project),
+ method: :post,
+ file_key: :file,
+ params: params.merge(file: file),
+ headers: headers,
+ send_rewritten_field: true
+ )
+ end
+ end
+
+ describe 'POST #authorize' do
+ subject do
+ post import_csv_authorize_project_work_items_path(project),
+ headers: workhorse_headers
+ end
+
+ before do
+ sign_in(current_user)
+ end
+
+ context 'with authorized user' do
+ before do
+ project.add_reporter(current_user)
+ end
+
+ context 'when work items import/export feature is enabled' do
+ let(:user) { current_user }
+
+ it_behaves_like 'handle uploads authorize request' do
+ let(:uploader_class) { FileUploader }
+ let(:maximum_size) { Gitlab::CurrentSettings.max_attachment_size.megabytes }
+ end
+ end
+
+ context 'when work items import/export feature is disabled' do
+ before do
+ stub_feature_flags(import_export_work_items_csv: false)
+ end
+
+ it_behaves_like 'response with 404 status'
+ end
+ end
+
+ context 'with unauthorized user' do
+ it_behaves_like 'response with 404 status'
+ end
+ end
end
diff --git a/spec/scripts/failed_tests_spec.rb b/spec/scripts/failed_tests_spec.rb
index ce0ec66cdb6..c9fe6eecd11 100644
--- a/spec/scripts/failed_tests_spec.rb
+++ b/spec/scripts/failed_tests_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe FailedTests do
'suites' => [
{
'failed_count' => 1,
- 'name' => 'rspec unit pg12 10/12',
+ 'name' => 'rspec unit pg13 10/12',
'test_cases' => [
{
'status' => 'failed',
@@ -23,7 +23,7 @@ RSpec.describe FailedTests do
},
{
'failed_count' => 1,
- 'name' => 'rspec-ee unit pg12',
+ 'name' => 'rspec-ee unit pg13',
'test_cases' => [
{
'status' => 'failed',
@@ -33,7 +33,7 @@ RSpec.describe FailedTests do
},
{
'failed_count' => 1,
- 'name' => 'rspec unit pg13 10/12',
+ 'name' => 'rspec unit pg14 10/12',
'test_cases' => [
{
'status' => 'failed',
diff --git a/spec/services/work_items/prepare_import_csv_service_spec.rb b/spec/services/work_items/prepare_import_csv_service_spec.rb
new file mode 100644
index 00000000000..6a657120690
--- /dev/null
+++ b/spec/services/work_items/prepare_import_csv_service_spec.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe WorkItems::PrepareImportCsvService, feature_category: :team_planning do
+ let_it_be(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+
+ let(:file) { double }
+ let(:upload_service) { double }
+ let(:uploader) { double }
+ let(:upload) { double }
+
+ let(:subject) do
+ described_class.new(project, user, file: file).execute
+ end
+
+ context 'when file is uploaded correctly' do
+ let(:upload_id) { 99 }
+
+ before do
+ mock_upload
+ end
+
+ it 'returns a success message' do
+ result = subject
+
+ expect(result[:status]).to eq(:success)
+ expect(result[:message]).to eq(
+ "Your work items are being imported. Once finished, you'll receive a confirmation email.")
+ end
+
+ it 'enqueues the ImportWorkItemsCsvWorker' do
+ expect(WorkItems::ImportWorkItemsCsvWorker).to receive(:perform_async).with(user.id, project.id, upload_id)
+
+ subject
+ end
+ end
+
+ context 'when file upload fails' do
+ before do
+ mock_upload(false)
+ end
+
+ it 'returns an error message' do
+ result = subject
+
+ expect(result[:status]).to eq(:error)
+ expect(result[:message]).to eq('File upload error.')
+ end
+ end
+end
diff --git a/spec/support/helpers/email_helpers.rb b/spec/support/helpers/email_helpers.rb
index f4bdaa7e425..57386233775 100644
--- a/spec/support/helpers/email_helpers.rb
+++ b/spec/support/helpers/email_helpers.rb
@@ -76,4 +76,25 @@ module EmailHelpers
composed_expectation.and(have_enqueued_mail(mailer_class, mailer_method).with(*arguments))
end
end
+
+ def expect_sender(user, sender_email: nil)
+ sender = subject.header[:from].addrs[0]
+ expect(sender.display_name).to eq("#{user.name} (@#{user.username})")
+ expect(sender.address).to eq(sender_email.presence || gitlab_sender)
+ end
+
+ def expect_service_desk_custom_email_delivery_options(service_desk_setting)
+ expect(subject.delivery_method).to be_a Mail::SMTP
+ expect(service_desk_setting.custom_email_credential).to be_present
+
+ credential = service_desk_setting.custom_email_credential
+
+ expect(subject.delivery_method.settings).to include(
+ address: credential.smtp_address,
+ port: credential.smtp_port,
+ user_name: credential.smtp_username,
+ password: credential.smtp_password,
+ domain: service_desk_setting.custom_email.split('@').last
+ )
+ end
end
diff --git a/spec/support/helpers/migrations_helpers.rb b/spec/support/helpers/migrations_helpers.rb
index 6fc5904fc83..1b8c3388051 100644
--- a/spec/support/helpers/migrations_helpers.rb
+++ b/spec/support/helpers/migrations_helpers.rb
@@ -92,7 +92,7 @@ module MigrationsHelpers
end
def reset_column_information(klass)
- klass.reset_column_information
+ klass.reset_column_information if klass.instance_variable_get(:@table_name)
end
# In some migration tests, we're using factories to create records,
diff --git a/spec/support_specs/helpers/migrations_helpers_spec.rb b/spec/support_specs/helpers/migrations_helpers_spec.rb
index 5d44dac8eb7..2af16151350 100644
--- a/spec/support_specs/helpers/migrations_helpers_spec.rb
+++ b/spec/support_specs/helpers/migrations_helpers_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe MigrationsHelpers do
+RSpec.describe MigrationsHelpers, feature_category: :database do
let(:helper_class) do
Class.new.tap do |klass|
klass.include described_class
@@ -71,4 +71,40 @@ RSpec.describe MigrationsHelpers do
end
end
end
+
+ describe '#reset_column_information' do
+ context 'with a regular ActiveRecord model class' do
+ let(:klass) { Project }
+
+ it 'calls reset_column_information' do
+ expect(klass).to receive(:reset_column_information)
+
+ helper.reset_column_information(klass)
+ end
+ end
+
+ context 'with an anonymous class with table name defined' do
+ let(:klass) do
+ Class.new(ActiveRecord::Base) do
+ self.table_name = :projects
+ end
+ end
+
+ it 'calls reset_column_information' do
+ expect(klass).to receive(:reset_column_information)
+
+ helper.reset_column_information(klass)
+ end
+ end
+
+ context 'with an anonymous class with no table name defined' do
+ let(:klass) { Class.new(ActiveRecord::Base) }
+
+ it 'does not call reset_column_information' do
+ expect(klass).not_to receive(:reset_column_information)
+
+ helper.reset_column_information(klass)
+ end
+ end
+ end
end
diff --git a/spec/workers/every_sidekiq_worker_spec.rb b/spec/workers/every_sidekiq_worker_spec.rb
index b02067bba3f..481a2848f48 100644
--- a/spec/workers/every_sidekiq_worker_spec.rb
+++ b/spec/workers/every_sidekiq_worker_spec.rb
@@ -477,6 +477,7 @@ RSpec.describe 'Every Sidekiq worker', feature_category: :shared do
'WebHooks::DestroyWorker' => 3,
'WebHooks::LogExecutionWorker' => 3,
'Wikis::GitGarbageCollectWorker' => false,
+ 'WorkItems::ImportWorkItemsCsvWorker' => 3,
'X509CertificateRevokeWorker' => 3,
'ComplianceManagement::MergeRequests::ComplianceViolationsWorker' => 3
}
diff --git a/spec/workers/work_items/import_work_items_csv_worker_spec.rb b/spec/workers/work_items/import_work_items_csv_worker_spec.rb
new file mode 100644
index 00000000000..056960fbcf2
--- /dev/null
+++ b/spec/workers/work_items/import_work_items_csv_worker_spec.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe WorkItems::ImportWorkItemsCsvWorker, feature_category: :team_planning do
+ let_it_be(:project) { create(:project) }
+ let_it_be(:user) { create(:user) }
+
+ let(:upload) { create(:upload, :with_file) }
+
+ before_all do
+ project.add_reporter(user)
+ end
+
+ subject { described_class.new.perform(user.id, project.id, upload.id) }
+
+ describe '#perform' do
+ it 'calls #execute on WorkItems::ImportCsvService and destroys upload' do
+ expect_next_instance_of(WorkItems::ImportCsvService) do |instance|
+ expect(instance).to receive(:execute).and_return({ success: 5, error_lines: [], parse_error: false })
+ end
+
+ subject
+
+ expect { upload.reload }.to raise_error ActiveRecord::RecordNotFound
+ end
+
+ it_behaves_like 'an idempotent worker' do
+ let(:job_args) { [user.id, project.id, upload.id] }
+ end
+ end
+
+ describe '.sidekiq_retries_exhausted' do
+ let_it_be(:job) { { 'args' => [user.id, project.id, create(:upload, :with_file).id] } }
+
+ subject(:sidekiq_retries_exhausted) do
+ described_class.sidekiq_retries_exhausted_block.call(job)
+ end
+
+ it 'destroys upload' do
+ expect { sidekiq_retries_exhausted }.to change { Upload.count }.by(-1)
+ end
+ end
+end
diff --git a/workhorse/internal/upstream/routes.go b/workhorse/internal/upstream/routes.go
index 982f3a5b5f8..8f9d056b8f3 100644
--- a/workhorse/internal/upstream/routes.go
+++ b/workhorse/internal/upstream/routes.go
@@ -325,6 +325,9 @@ func configureRoutes(u *upstream) {
// Requirements Import via UI upload acceleration
u.route("POST", projectPattern+`requirements_management/requirements/import_csv`, mimeMultipartUploader),
+ // Work items Import via UI upload acceleration
+ u.route("POST", projectPattern+`work_items/import_csv`, mimeMultipartUploader),
+
// Uploads via API
u.route("POST", apiProjectPattern+`/uploads\z`, mimeMultipartUploader),
diff --git a/workhorse/upload_test.go b/workhorse/upload_test.go
index 333301091c7..cf308504e21 100644
--- a/workhorse/upload_test.go
+++ b/workhorse/upload_test.go
@@ -176,6 +176,8 @@ func TestAcceleratedUpload(t *testing.T) {
{"POST", `/api/v4/projects/group%2Fsubgroup%2Fproject/issues/30/metric_images`, true},
{"POST", `/my/project/-/requirements_management/requirements/import_csv`, true},
{"POST", `/my/project/-/requirements_management/requirements/import_csv/`, true},
+ {"POST", `/my/project/-/work_items/import_csv`, true},
+ {"POST", `/my/project/-/work_items/import_csv/`, true},
{"POST", "/api/v4/projects/2412/packages/helm/api/stable/charts", true},
{"POST", "/api/v4/projects/group%2Fproject/packages/helm/api/stable/charts", true},
{"POST", "/api/v4/projects/group%2Fsubgroup%2Fproject/packages/helm/api/stable/charts", true},