summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 15:08:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 15:08:59 +0000
commitc6c5dd8848b78528d7ad7f044a0c95be629d372e (patch)
tree261577e229ade85472353eb5b380c1e4fed9bc60
parentd0aeb5df3d6b06165355b023a25b79c7bd74a27d (diff)
downloadgitlab-ce-c6c5dd8848b78528d7ad7f044a0c95be629d372e.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--.rubocop_todo/layout/argument_alignment.yml3
-rw-r--r--.rubocop_todo/layout/space_inside_parens.yml1
-rw-r--r--.rubocop_todo/rails/inverse_of.yml2
-rw-r--r--.rubocop_todo/rails/redundant_foreign_key.yml1
-rw-r--r--.rubocop_todo/rspec/context_wording.yml1
-rw-r--r--.rubocop_todo/rspec/missing_feature_category.yml8
-rw-r--r--.rubocop_todo/style/guard_clause.yml1
-rw-r--r--app/assets/javascripts/vue_shared/components/source_viewer/constants.js2
-rw-r--r--app/assets/javascripts/vue_shared/components/source_viewer/workers/highlight_utils.js50
-rw-r--r--app/assets/stylesheets/startup/startup-signin.scss2
-rw-r--r--app/helpers/application_settings_helper.rb3
-rw-r--r--app/models/ci/pipeline.rb103
-rw-r--r--app/models/ci/runner.rb4
-rw-r--r--app/models/integrations/jira.rb10
-rw-r--r--app/services/ci/pipeline_schedule_service.rb2
-rw-r--r--app/services/ci/register_job_service.rb6
-rw-r--r--app/views/layouts/mailer/_user_deactivated_additional_text.html.haml3
-rw-r--r--app/views/layouts/mailer/_user_deactivated_additional_text.text.erb3
-rw-r--r--app/views/notify/user_deactivated_email.html.haml2
-rw-r--r--app/views/notify/user_deactivated_email.text.erb1
-rw-r--r--app/workers/pipeline_schedule_worker.rb2
-rw-r--r--app/workers/run_pipeline_schedule_worker.rb4
-rw-r--r--config/README.md19
-rw-r--r--config/application.rb1
-rw-r--r--config/feature_flags/development/create_runner_machine.yml8
-rw-r--r--config/feature_flags/development/deactivation_email_additional_text.yml8
-rw-r--r--config/feature_flags/development/use_primary_and_secondary_stores_for_db_load_balancing.yml8
-rw-r--r--config/feature_flags/development/use_primary_store_as_default_for_db_load_balancing.yml8
-rw-r--r--config/feature_flags/ops/database_async_index_operations.yml8
-rw-r--r--db/docs/postgres_async_foreign_key_validations.yml11
-rw-r--r--db/init_structure.sql3572
-rw-r--r--db/migrate/20210603140302_add_pronouns_to_user_details.rb20
-rw-r--r--db/migrate/20210603222333_remove_builds_email_service_from_services.rb11
-rw-r--r--db/migrate/20210604032738_create_dast_site_profiles_builds.rb18
-rw-r--r--db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb19
-rw-r--r--db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb19
-rw-r--r--db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb18
-rw-r--r--db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb19
-rw-r--r--db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb19
-rw-r--r--db/migrate/20210604082145_create_external_status_checks_table.rb42
-rw-r--r--db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb34
-rw-r--r--db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb15
-rw-r--r--db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb18
-rw-r--r--db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb17
-rw-r--r--db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb16
-rw-r--r--db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb18
-rw-r--r--db/migrate/20210608103230_add_issue_id_to_test_report.rb17
-rw-r--r--db/migrate/20210608103235_add_issue_index_to_test_report.rb17
-rw-r--r--db/migrate/20210608110752_change_column_null_test_report_requirement.rb17
-rw-r--r--db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb24
-rw-r--r--db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb28
-rw-r--r--db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb20
-rw-r--r--db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb17
-rw-r--r--db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb17
-rw-r--r--db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb7
-rw-r--r--db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb13
-rw-r--r--db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb7
-rw-r--r--db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb39
-rw-r--r--db/migrate/20210611101034_add_devops_adoption_sast_dast.rb8
-rw-r--r--db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb17
-rw-r--r--db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb7
-rw-r--r--db/migrate/20210614143954_add_unique_index_for_helm_packages.rb18
-rw-r--r--db/migrate/20210615064342_add_issue_id_to_requirement.rb17
-rw-r--r--db/migrate/20210616110748_add_issue_index_to_requirement.rb17
-rw-r--r--db/migrate/20210616111311_add_issue_requirement_foreign_key.rb19
-rw-r--r--db/migrate/20210616134905_add_timestamp_to_schema_migration.rb15
-rw-r--r--db/migrate/20210616154808_remove_ci_build_protected_index.rb19
-rw-r--r--db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb10
-rw-r--r--db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb48
-rw-r--r--db/migrate/20210617161348_cascade_delete_freeze_periods.rb23
-rw-r--r--db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb15
-rw-r--r--db/migrate/20210621043337_rename_services_to_integrations.rb151
-rw-r--r--db/migrate/20210621044000_rename_services_indexes_to_integrations.rb30
-rw-r--r--db/migrate/20210621084632_add_summary_to_timelogs.rb10
-rw-r--r--db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb15
-rw-r--r--db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb7
-rw-r--r--db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb21
-rw-r--r--db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb11
-rw-r--r--db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb17
-rw-r--r--db/migrate/20210623133635_create_error_tracking_errors.rb28
-rw-r--r--db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb17
-rw-r--r--db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb7
-rw-r--r--db/migrate/20210624180613_add_last_synced_at_to_licenses.rb7
-rw-r--r--db/migrate/20210625094554_create_error_tracking_error_events.rb30
-rw-r--r--db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb7
-rw-r--r--db/migrate/20210628154900_create_detached_partitions_table.rb23
-rw-r--r--db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb11
-rw-r--r--db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb20
-rw-r--r--db/migrate/20210630144339_add_invite_email_success_to_members.rb11
-rw-r--r--db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb10
-rw-r--r--db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb32
-rw-r--r--db/migrate/20210701111627_add_upvotes_count_to_issues.rb15
-rw-r--r--db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb7
-rw-r--r--db/migrate/20210705124128_add_project_settings_previous_default_branch.rb20
-rw-r--r--db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb24
-rw-r--r--db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb17
-rw-r--r--db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb16
-rw-r--r--db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb19
-rw-r--r--db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb17
-rw-r--r--db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb21
-rw-r--r--db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb18
-rw-r--r--db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb57
-rw-r--r--db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb40
-rw-r--r--db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb25
-rw-r--r--db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb17
-rw-r--r--db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb26
-rw-r--r--db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb9
-rw-r--r--db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb28
-rw-r--r--db/migrate/20210707171554_create_vulnerability_flags.rb30
-rw-r--r--db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb15
-rw-r--r--db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb26
-rw-r--r--db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb28
-rw-r--r--db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb9
-rw-r--r--db/migrate/20210708124229_add_security_scans_created_at_index.rb17
-rw-r--r--db/migrate/20210708131048_add_error_tracking_counter_cache.rb11
-rw-r--r--db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb11
-rw-r--r--db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb11
-rw-r--r--db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb17
-rw-r--r--db/migrate/20210709132707_change_default_job_token_scope_enabled.rb17
-rw-r--r--db/migrate/20210709221051_create_work_item_types.rb34
-rw-r--r--db/migrate/20210709221659_add_work_item_type_id_to_issue.rb31
-rw-r--r--db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb8
-rw-r--r--db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb20
-rw-r--r--db/migrate/20210713123345_create_dast_profile_schedule.rb36
-rw-r--r--db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb7
-rw-r--r--db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb17
-rw-r--r--db/migrate/20210713211008_create_banned_users.rb20
-rw-r--r--db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb11
-rw-r--r--db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb17
-rw-r--r--db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb18
-rw-r--r--db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb17
-rw-r--r--db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb17
-rw-r--r--db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb17
-rw-r--r--db/migrate/20210716074555_revert_default_job_token_scope.rb17
-rw-r--r--db/migrate/20210719145532_add_foreign_keys_view.rb26
-rw-r--r--db/migrate/20210719182944_add_request_response_to_supporing_message.rb20
-rw-r--r--db/migrate/20210719192928_add_invite_email_success_to_member.rb11
-rw-r--r--db/migrate/20210720083432_change_application_setting_terms_not_null.rb12
-rw-r--r--db/migrate/20210720130006_create_error_tracking_client_keys.rb24
-rw-r--r--db/migrate/20210720140841_create_postgres_async_indexes_table.rb27
-rw-r--r--db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb13
-rw-r--r--db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb13
-rw-r--r--db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb14
-rw-r--r--db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb14
-rw-r--r--db/migrate/20210721134706_add_type_new_to_integrations.rb10
-rw-r--r--db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb15
-rw-r--r--db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb79
-rw-r--r--db/migrate/20210721145029_add_state_to_members.rb13
-rw-r--r--db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb7
-rw-r--r--db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb29
-rw-r--r--db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb34
-rw-r--r--db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb13
-rw-r--r--db/migrate/20210722074242_add_user_to_escalation_rules.rb17
-rw-r--r--db/migrate/20210722074256_add_user_index_to_escalation_rules.rb33
-rw-r--r--db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb17
-rw-r--r--db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb17
-rw-r--r--db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb20
-rw-r--r--db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb29
-rw-r--r--db/migrate/20210722151951_add_columns_to_security_scans.rb21
-rw-r--r--db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb17
-rw-r--r--db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb20
-rw-r--r--db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb11
-rw-r--r--db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20210728110654_add_status_to_error_tracking_error.rb11
-rw-r--r--db/migrate/20210728174349_add_fk_to_security_scans_columns.rb21
-rw-r--r--db/migrate/20210729061526_add_pronunciation_to_user_details.rb20
-rw-r--r--db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb15
-rw-r--r--db/migrate/20210729081351_create_topics.rb22
-rw-r--r--db/migrate/20210729081739_create_project_topics.rb16
-rw-r--r--db/migrate/20210729123101_confirm_security_bot.rb18
-rw-r--r--db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb17
-rw-r--r--db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb17
-rw-r--r--db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb24
-rw-r--r--db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb19
-rw-r--r--db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb20
-rw-r--r--db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb10
-rw-r--r--db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb20
-rw-r--r--db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb20
-rw-r--r--db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb33
-rw-r--r--db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb17
-rw-r--r--db/migrate/20210804150320_create_base_work_item_types.rb35
-rw-r--r--db/migrate/20210804200114_create_customer_relations_organizations.rb27
-rw-r--r--db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb20
-rw-r--r--db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb7
-rw-r--r--db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb17
-rw-r--r--db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb7
-rw-r--r--db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb26
-rw-r--r--db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb7
-rw-r--r--db/migrate/20210809014850_create_agent_group_authorizations.rb16
-rw-r--r--db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb22
-rw-r--r--db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb11
-rw-r--r--db/migrate/20210811120204_create_customer_relations_contacts.rb31
-rw-r--r--db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb14
-rw-r--r--db/migrate/20210812171704_create_project_ci_feature_usages.rb12
-rw-r--r--db/migrate/20210813101742_create_zentao_tracker_data.rb18
-rw-r--r--db/migrate/20210813111909_create_ci_build_trace_metadata.rb32
-rw-r--r--db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb22
-rw-r--r--db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb38
-rw-r--r--db/migrate/20210816161107_remove_index_containing_faulty_regex.rb18
-rw-r--r--db/migrate/20210816192041_add_invites_email_success_to_member.rb13
-rw-r--r--db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb20
-rw-r--r--db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb17
-rw-r--r--db/migrate/20210817172214_add_yaml_limits_application_setting.rb10
-rw-r--r--db/migrate/20210818034001_index_historical_data_on_recorded_at.rb17
-rw-r--r--db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb29
-rw-r--r--db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb30
-rw-r--r--db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb13
-rw-r--r--db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb79
-rw-r--r--db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb17
-rw-r--r--db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb9
-rw-r--r--db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb22
-rw-r--r--db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb24
-rw-r--r--db/migrate/20210819120243_add_throttle_files_api_columns.rb13
-rw-r--r--db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb17
-rw-r--r--db/migrate/20210819153805_set_default_job_token_scope_true.rb17
-rw-r--r--db/migrate/20210819162047_add_columns_to_namespace_settings.rb21
-rw-r--r--db/migrate/20210819185500_create_external_audit_event_destinations_table.rb15
-rw-r--r--db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb22
-rw-r--r--db/migrate/20210823172643_create_user_group_callout.rb19
-rw-r--r--db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb22
-rw-r--r--db/migrate/20210824055322_add_project_namespace_id_to_project.rb21
-rw-r--r--db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb8
-rw-r--r--db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb7
-rw-r--r--db/migrate/20210825104558_change_description_limit_error_tracking_event.rb17
-rw-r--r--db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb28
-rw-r--r--db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb28
-rw-r--r--db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb10
-rw-r--r--db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb9
-rw-r--r--db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb22
-rw-r--r--db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb26
-rw-r--r--db/migrate/20210826124311_add_index_to_error_tracking_error.rb23
-rw-r--r--db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb27
-rw-r--r--db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb10
-rw-r--r--db/migrate/20210826171758_init_schema.rb (renamed from db/migrate/20210602155110_init_schema.rb)0
-rw-r--r--db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb11
-rw-r--r--db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb13
-rw-r--r--db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb17
-rw-r--r--db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb13
-rw-r--r--db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb11
-rw-r--r--db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb36
-rw-r--r--db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb43
-rw-r--r--db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb13
-rw-r--r--db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb26
-rw-r--r--db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb26
-rw-r--r--db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb17
-rw-r--r--db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb32
-rw-r--r--db/post_migrate/20210611080951_fix_missing_traversal_ids.rb48
-rw-r--r--db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb20
-rw-r--r--db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb32
-rw-r--r--db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb17
-rw-r--r--db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb17
-rw-r--r--db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb20
-rw-r--r--db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb19
-rw-r--r--db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb14
-rw-r--r--db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb13
-rw-r--r--db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb75
-rw-r--r--db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb86
-rw-r--r--db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb25
-rw-r--r--db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb16
-rw-r--r--db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb21
-rw-r--r--db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb17
-rw-r--r--db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb15
-rw-r--r--db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb69
-rw-r--r--db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb26
-rw-r--r--db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb65
-rw-r--r--db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb18
-rw-r--r--db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb19
-rw-r--r--db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb17
-rw-r--r--db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb7
-rw-r--r--db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb9
-rw-r--r--db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb84
-rw-r--r--db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb77
-rw-r--r--db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb113
-rw-r--r--db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb58
-rw-r--r--db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb13
-rw-r--r--db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb59
-rw-r--r--db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb12
-rw-r--r--db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb11
-rw-r--r--db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb10
-rw-r--r--db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb10
-rw-r--r--db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb56
-rw-r--r--db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb28
-rw-r--r--db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb31
-rw-r--r--db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb17
-rw-r--r--db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb18
-rw-r--r--db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb55
-rw-r--r--db/post_migrate/20210727113447_backfill_integrations_type_new.rb23
-rw-r--r--db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb27
-rw-r--r--db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb30
-rw-r--r--db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb24
-rw-r--r--db/post_migrate/20210729193056_drop_ci_test_cases_table.rb23
-rw-r--r--db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb37
-rw-r--r--db/post_migrate/20210730170823_schedule_security_setting_creation.rb26
-rw-r--r--db/post_migrate/20210731132939_backfill_stage_event_hash.rb115
-rw-r--r--db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb87
-rw-r--r--db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb18
-rw-r--r--db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb45
-rw-r--r--db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb11
-rw-r--r--db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb38
-rw-r--r--db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb29
-rw-r--r--db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb21
-rw-r--r--db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb48
-rw-r--r--db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb13
-rw-r--r--db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb88
-rw-r--r--db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb51
-rw-r--r--db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb79
-rw-r--r--db/post_migrate/20210811122206_update_external_project_bots.rb33
-rw-r--r--db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb13
-rw-r--r--db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb112
-rw-r--r--db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb16
-rw-r--r--db/post_migrate/20210813151908_replace_external_wiki_triggers.rb66
-rw-r--r--db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb12
-rw-r--r--db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb11
-rw-r--r--db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb25
-rw-r--r--db/post_migrate/20210818185845_backfill_projects_with_coverage.rb11
-rw-r--r--db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb28
-rw-r--r--db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb17
-rw-r--r--db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb28
-rw-r--r--db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb33
-rw-r--r--db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb30
-rw-r--r--db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb19
-rw-r--r--db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb17
-rw-r--r--db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb19
-rw-r--r--db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb55
-rw-r--r--db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb27
-rw-r--r--db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb23
-rw-r--r--db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb19
-rw-r--r--db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb49
-rw-r--r--db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb16
-rw-r--r--db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb23
-rw-r--r--db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb17
-rw-r--r--db/schema_migrations/202106021551101
-rw-r--r--db/schema_migrations/202106021640441
-rw-r--r--db/schema_migrations/202106031403021
-rw-r--r--db/schema_migrations/202106032223331
-rw-r--r--db/schema_migrations/202106040327381
-rw-r--r--db/schema_migrations/202106040341581
-rw-r--r--db/schema_migrations/202106040343541
-rw-r--r--db/schema_migrations/202106040513301
-rw-r--r--db/schema_migrations/202106040517421
-rw-r--r--db/schema_migrations/202106040519171
-rw-r--r--db/schema_migrations/202106040821451
-rw-r--r--db/schema_migrations/202106040856001
-rw-r--r--db/schema_migrations/202106041336511
-rw-r--r--db/schema_migrations/202106061434261
-rw-r--r--db/schema_migrations/202106070505311
-rw-r--r--db/schema_migrations/202106070800441
-rw-r--r--db/schema_migrations/202106071547191
-rw-r--r--db/schema_migrations/202106080723121
-rw-r--r--db/schema_migrations/202106080723461
-rw-r--r--db/schema_migrations/202106081032301
-rw-r--r--db/schema_migrations/202106081032351
-rw-r--r--db/schema_migrations/202106081107521
-rw-r--r--db/schema_migrations/202106081107601
-rw-r--r--db/schema_migrations/202106090135121
-rw-r--r--db/schema_migrations/202106090908561
-rw-r--r--db/schema_migrations/202106091250051
-rw-r--r--db/schema_migrations/202106091927281
-rw-r--r--db/schema_migrations/202106091931011
-rw-r--r--db/schema_migrations/202106092025011
-rw-r--r--db/schema_migrations/202106100427001
-rw-r--r--db/schema_migrations/202106101024101
-rw-r--r--db/schema_migrations/202106101024131
-rw-r--r--db/schema_migrations/202106101132291
-rw-r--r--db/schema_migrations/202106101417111
-rw-r--r--db/schema_migrations/202106101535561
-rw-r--r--db/schema_migrations/202106110809511
-rw-r--r--db/schema_migrations/202106110828221
-rw-r--r--db/schema_migrations/202106111003591
-rw-r--r--db/schema_migrations/202106111010341
-rw-r--r--db/schema_migrations/202106141241111
-rw-r--r--db/schema_migrations/202106141310021
-rw-r--r--db/schema_migrations/202106141423111
-rw-r--r--db/schema_migrations/202106141439541
-rw-r--r--db/schema_migrations/202106150643421
-rw-r--r--db/schema_migrations/202106152349351
-rw-r--r--db/schema_migrations/202106161107481
-rw-r--r--db/schema_migrations/202106161113111
-rw-r--r--db/schema_migrations/202106161349051
-rw-r--r--db/schema_migrations/202106161452541
-rw-r--r--db/schema_migrations/202106161548081
-rw-r--r--db/schema_migrations/202106161859471
-rw-r--r--db/schema_migrations/202106170223241
-rw-r--r--db/schema_migrations/202106171613481
-rw-r--r--db/schema_migrations/202106171801311
-rw-r--r--db/schema_migrations/202106210433371
-rw-r--r--db/schema_migrations/202106210440001
-rw-r--r--db/schema_migrations/202106210846321
-rw-r--r--db/schema_migrations/202106210900301
-rw-r--r--db/schema_migrations/202106210918301
-rw-r--r--db/schema_migrations/202106211117471
-rw-r--r--db/schema_migrations/202106211553281
-rw-r--r--db/schema_migrations/202106211642101
-rw-r--r--db/schema_migrations/202106212230001
-rw-r--r--db/schema_migrations/202106212232421
-rw-r--r--db/schema_migrations/202106220418461
-rw-r--r--db/schema_migrations/202106220457051
-rw-r--r--db/schema_migrations/202106221352211
-rw-r--r--db/schema_migrations/202106221411481
-rw-r--r--db/schema_migrations/202106230742261
-rw-r--r--db/schema_migrations/202106231237221
-rw-r--r--db/schema_migrations/202106231336351
-rw-r--r--db/schema_migrations/202106231633421
-rw-r--r--db/schema_migrations/202106241128211
-rw-r--r--db/schema_migrations/202106241806131
-rw-r--r--db/schema_migrations/202106250945541
-rw-r--r--db/schema_migrations/202106272049361
-rw-r--r--db/schema_migrations/202106281245051
-rw-r--r--db/schema_migrations/202106281549001
-rw-r--r--db/schema_migrations/202106290319001
-rw-r--r--db/schema_migrations/202106291017121
-rw-r--r--db/schema_migrations/202106291049331
-rw-r--r--db/schema_migrations/202106291535191
-rw-r--r--db/schema_migrations/202106300250201
-rw-r--r--db/schema_migrations/202106301443391
-rw-r--r--db/schema_migrations/202106302225221
-rw-r--r--db/schema_migrations/202106302246251
-rw-r--r--db/schema_migrations/202107010336221
-rw-r--r--db/schema_migrations/202107011116271
-rw-r--r--db/schema_migrations/202107011119091
-rw-r--r--db/schema_migrations/202107011413461
-rw-r--r--db/schema_migrations/202107021248421
-rw-r--r--db/schema_migrations/202107051241281
-rw-r--r--db/schema_migrations/202107051309191
-rw-r--r--db/schema_migrations/202107051329281
-rw-r--r--db/schema_migrations/202107051427141
-rw-r--r--db/schema_migrations/202107051431501
-rw-r--r--db/schema_migrations/202107051446571
-rw-r--r--db/schema_migrations/202107060847131
-rw-r--r--db/schema_migrations/202107061128001
-rw-r--r--db/schema_migrations/202107061153121
-rw-r--r--db/schema_migrations/202107061208471
-rw-r--r--db/schema_migrations/202107061428191
-rw-r--r--db/schema_migrations/202107061511541
-rw-r--r--db/schema_migrations/202107061514461
-rw-r--r--db/schema_migrations/202107061521391
-rw-r--r--db/schema_migrations/202107062127101
-rw-r--r--db/schema_migrations/202107062135371
-rw-r--r--db/schema_migrations/202107070955451
-rw-r--r--db/schema_migrations/202107071130561
-rw-r--r--db/schema_migrations/202107071515361
-rw-r--r--db/schema_migrations/202107071636591
-rw-r--r--db/schema_migrations/202107071715361
-rw-r--r--db/schema_migrations/202107071715541
-rw-r--r--db/schema_migrations/202107071736451
-rw-r--r--db/schema_migrations/202107071815361
-rw-r--r--db/schema_migrations/202107072109161
-rw-r--r--db/schema_migrations/202107080114251
-rw-r--r--db/schema_migrations/202107080114261
-rw-r--r--db/schema_migrations/202107080630321
-rw-r--r--db/schema_migrations/202107081242291
-rw-r--r--db/schema_migrations/202107081304191
-rw-r--r--db/schema_migrations/202107081310481
-rw-r--r--db/schema_migrations/202107081344461
-rw-r--r--db/schema_migrations/202107082025481
-rw-r--r--db/schema_migrations/202107090240481
-rw-r--r--db/schema_migrations/202107090857591
-rw-r--r--db/schema_migrations/202107091327071
-rw-r--r--db/schema_migrations/202107092210511
-rw-r--r--db/schema_migrations/202107092216591
-rw-r--r--db/schema_migrations/202107120525191
-rw-r--r--db/schema_migrations/202107130420001
-rw-r--r--db/schema_migrations/202107130421531
-rw-r--r--db/schema_migrations/202107130708421
-rw-r--r--db/schema_migrations/202107130751171
-rw-r--r--db/schema_migrations/202107131233451
-rw-r--r--db/schema_migrations/202107131351521
-rw-r--r--db/schema_migrations/202107131446371
-rw-r--r--db/schema_migrations/202107132110081
-rw-r--r--db/schema_migrations/202107132239411
-rw-r--r--db/schema_migrations/202107140155371
-rw-r--r--db/schema_migrations/202107140438181
-rw-r--r--db/schema_migrations/202107141206001
-rw-r--r--db/schema_migrations/202107150743591
-rw-r--r--db/schema_migrations/202107150749331
-rw-r--r--db/schema_migrations/202107150752031
-rw-r--r--db/schema_migrations/202107160745551
-rw-r--r--db/schema_migrations/202107191455321
-rw-r--r--db/schema_migrations/202107191829441
-rw-r--r--db/schema_migrations/202107191929281
-rw-r--r--db/schema_migrations/202107200834321
-rw-r--r--db/schema_migrations/202107201300061
-rw-r--r--db/schema_migrations/202107201408411
-rw-r--r--db/schema_migrations/202107211228401
-rw-r--r--db/schema_migrations/202107211255251
-rw-r--r--db/schema_migrations/202107211255451
-rw-r--r--db/schema_migrations/202107211256201
-rw-r--r--db/schema_migrations/202107211256371
-rw-r--r--db/schema_migrations/202107211258041
-rw-r--r--db/schema_migrations/202107211258201
-rw-r--r--db/schema_migrations/202107211347061
-rw-r--r--db/schema_migrations/202107211347071
-rw-r--r--db/schema_migrations/202107211356381
-rw-r--r--db/schema_migrations/202107211450291
-rw-r--r--db/schema_migrations/202107211744111
-rw-r--r--db/schema_migrations/202107211744411
-rw-r--r--db/schema_migrations/202107211744531
-rw-r--r--db/schema_migrations/202107211745211
-rw-r--r--db/schema_migrations/202107212116021
-rw-r--r--db/schema_migrations/202107220101011
-rw-r--r--db/schema_migrations/202107220429391
-rw-r--r--db/schema_migrations/202107220552171
-rw-r--r--db/schema_migrations/202107220742201
-rw-r--r--db/schema_migrations/202107220742421
-rw-r--r--db/schema_migrations/202107220742561
-rw-r--r--db/schema_migrations/202107220743091
-rw-r--r--db/schema_migrations/202107220743391
-rw-r--r--db/schema_migrations/202107221105151
-rw-r--r--db/schema_migrations/202107221328441
-rw-r--r--db/schema_migrations/202107221501021
-rw-r--r--db/schema_migrations/202107221519511
-rw-r--r--db/schema_migrations/202107221556351
-rw-r--r--db/schema_migrations/202107222100411
-rw-r--r--db/schema_migrations/202107231731321
-rw-r--r--db/schema_migrations/202107261349501
-rw-r--r--db/schema_migrations/202107262027481
-rw-r--r--db/schema_migrations/202107271134471
-rw-r--r--db/schema_migrations/202107271752011
-rw-r--r--db/schema_migrations/202107281106541
-rw-r--r--db/schema_migrations/202107281743491
-rw-r--r--db/schema_migrations/202107290615261
-rw-r--r--db/schema_migrations/202107290615561
-rw-r--r--db/schema_migrations/202107290813511
-rw-r--r--db/schema_migrations/202107290817391
-rw-r--r--db/schema_migrations/202107291231011
-rw-r--r--db/schema_migrations/202107291256411
-rw-r--r--db/schema_migrations/202107291256591
-rw-r--r--db/schema_migrations/202107291612421
-rw-r--r--db/schema_migrations/202107291633121
-rw-r--r--db/schema_migrations/202107291921481
-rw-r--r--db/schema_migrations/202107291929591
-rw-r--r--db/schema_migrations/202107291930561
-rw-r--r--db/schema_migrations/202107292021431
-rw-r--r--db/schema_migrations/202107301016091
-rw-r--r--db/schema_migrations/202107301029521
-rw-r--r--db/schema_migrations/202107301038081
-rw-r--r--db/schema_migrations/202107301048001
-rw-r--r--db/schema_migrations/202107301708231
-rw-r--r--db/schema_migrations/202107301945551
-rw-r--r--db/schema_migrations/202107311329391
-rw-r--r--db/schema_migrations/202108020432531
-rw-r--r--db/schema_migrations/202108021122331
-rw-r--r--db/schema_migrations/202108021318121
-rw-r--r--db/schema_migrations/202108031109201
-rw-r--r--db/schema_migrations/202108041503201
-rw-r--r--db/schema_migrations/202108041506241
-rw-r--r--db/schema_migrations/202108041514441
-rw-r--r--db/schema_migrations/202108041533071
-rw-r--r--db/schema_migrations/202108041544071
-rw-r--r--db/schema_migrations/202108042001141
-rw-r--r--db/schema_migrations/202108042020571
-rw-r--r--db/schema_migrations/202108050857061
-rw-r--r--db/schema_migrations/202108051315101
-rw-r--r--db/schema_migrations/202108051924501
-rw-r--r--db/schema_migrations/202108060118111
-rw-r--r--db/schema_migrations/202108061317061
-rw-r--r--db/schema_migrations/202108061521041
-rw-r--r--db/schema_migrations/202108071014461
-rw-r--r--db/schema_migrations/202108071016211
-rw-r--r--db/schema_migrations/202108071020041
-rw-r--r--db/schema_migrations/202108090148501
-rw-r--r--db/schema_migrations/202108090149181
-rw-r--r--db/schema_migrations/202108091236581
-rw-r--r--db/schema_migrations/202108091439311
-rw-r--r--db/schema_migrations/202108091942501
-rw-r--r--db/schema_migrations/202108111202041
-rw-r--r--db/schema_migrations/202108111222061
-rw-r--r--db/schema_migrations/202108111930331
-rw-r--r--db/schema_migrations/202108112148111
-rw-r--r--db/schema_migrations/202108120130421
-rw-r--r--db/schema_migrations/202108121450101
-rw-r--r--db/schema_migrations/202108121717041
-rw-r--r--db/schema_migrations/202108131017421
-rw-r--r--db/schema_migrations/202108131119091
-rw-r--r--db/schema_migrations/202108131313131
-rw-r--r--db/schema_migrations/202108131519081
-rw-r--r--db/schema_migrations/202108131955181
-rw-r--r--db/schema_migrations/202108160958261
-rw-r--r--db/schema_migrations/202108161611071
-rw-r--r--db/schema_migrations/202108161833041
-rw-r--r--db/schema_migrations/202108161920411
-rw-r--r--db/schema_migrations/202108170243351
-rw-r--r--db/schema_migrations/202108170843381
-rw-r--r--db/schema_migrations/202108171304151
-rw-r--r--db/schema_migrations/202108171722141
-rw-r--r--db/schema_migrations/202108180340011
-rw-r--r--db/schema_migrations/202108180553571
-rw-r--r--db/schema_migrations/202108180611561
-rw-r--r--db/schema_migrations/202108181156131
-rw-r--r--db/schema_migrations/202108181759491
-rw-r--r--db/schema_migrations/202108181855481
-rw-r--r--db/schema_migrations/202108181858451
-rw-r--r--db/schema_migrations/202108181930081
-rw-r--r--db/schema_migrations/202108182004551
-rw-r--r--db/schema_migrations/202108182202341
-rw-r--r--db/schema_migrations/202108191202431
-rw-r--r--db/schema_migrations/202108191450001
-rw-r--r--db/schema_migrations/202108191527231
-rw-r--r--db/schema_migrations/202108191538051
-rw-r--r--db/schema_migrations/202108191620471
-rw-r--r--db/schema_migrations/202108191831281
-rw-r--r--db/schema_migrations/202108191855001
-rw-r--r--db/schema_migrations/202108201718341
-rw-r--r--db/schema_migrations/202108231132591
-rw-r--r--db/schema_migrations/202108231326001
-rw-r--r--db/schema_migrations/202108231420361
-rw-r--r--db/schema_migrations/202108231726431
-rw-r--r--db/schema_migrations/202108231932341
-rw-r--r--db/schema_migrations/202108232134171
-rw-r--r--db/schema_migrations/202108240553221
-rw-r--r--db/schema_migrations/202108241026241
-rw-r--r--db/schema_migrations/202108241027501
-rw-r--r--db/schema_migrations/202108241050381
-rw-r--r--db/schema_migrations/202108241604591
-rw-r--r--db/schema_migrations/202108241746151
-rw-r--r--db/schema_migrations/202108251045581
-rw-r--r--db/schema_migrations/202108251046561
-rw-r--r--db/schema_migrations/202108251100161
-rw-r--r--db/schema_migrations/202108251502121
-rw-r--r--db/schema_migrations/202108251823031
-rw-r--r--db/schema_migrations/202108251904581
-rw-r--r--db/schema_migrations/202108251934481
-rw-r--r--db/schema_migrations/202108251935481
-rw-r--r--db/schema_migrations/202108251936521
-rw-r--r--db/schema_migrations/202108261108391
-rw-r--r--db/schema_migrations/202108261208341
-rw-r--r--db/schema_migrations/202108261227481
-rw-r--r--db/schema_migrations/202108261243111
-rw-r--r--db/schema_migrations/202108261455091
-rw-r--r--db/schema_migrations/202108261709021
-rw-r--r--db/schema_migrations/202301301255411
-rw-r--r--db/schema_migrations/202301301306241
-rw-r--r--db/schema_migrations/202302061438511
-rw-r--r--db/schema_migrations/202302071436021
-rw-r--r--db/schema_migrations/202302071438441
-rw-r--r--db/structure.sql32
-rw-r--r--doc/api/graphql/reference/index.md40
-rw-r--r--doc/api/projects.md15
-rw-r--r--doc/api/runners.md7
-rw-r--r--doc/architecture/blueprints/search/code_search_with_zoekt.md305
-rw-r--r--doc/development/fe_guide/customizable_dashboards.md30
-rw-r--r--doc/user/application_security/vulnerability_report/index.md2
-rw-r--r--lib/api/ci/helpers/runner.rb16
-rw-r--r--lib/api/ci/runner.rb3
-rw-r--r--lib/api/entities/project.rb1
-rw-r--r--lib/api/helpers/projects_helpers.rb2
-rw-r--r--lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2.rb86
-rw-r--r--lib/gitlab/ci/variables/builder.rb6
-rw-r--r--lib/gitlab/ci/variables/builder/pipeline.rb120
-rw-r--r--lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb20
-rw-r--r--lib/gitlab/database/async_indexes.rb9
-rw-r--r--lib/gitlab/database/async_indexes/index_base.rb90
-rw-r--r--lib/gitlab/database/async_indexes/index_creator.rb48
-rw-r--r--lib/gitlab/database/async_indexes/index_destructor.rb61
-rw-r--r--lib/gitlab/database/async_indexes/migration_helpers.rb2
-rw-r--r--lib/gitlab/database/async_indexes/postgres_async_index.rb20
-rw-r--r--lib/gitlab/database/load_balancing/sticking.rb12
-rw-r--r--lib/gitlab/redis.rb1
-rw-r--r--lib/gitlab/redis/db_load_balancing.rb23
-rw-r--r--lib/tasks/gitlab/db.rake30
-rw-r--r--locale/gitlab.pot35
-rw-r--r--package.json2
-rwxr-xr-xscripts/verify-tff-mapping4
-rw-r--r--spec/factories/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb9
-rw-r--r--spec/frontend/vue_shared/components/source_viewer/highlight_util_spec.js70
-rw-r--r--spec/lib/api/ci/helpers/runner_helpers_spec.rb7
-rw-r--r--spec/lib/api/ci/helpers/runner_spec.rb72
-rw-r--r--spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb65
-rw-r--r--spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb2
-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.rb2
-rw-r--r--spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb11
-rw-r--r--spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/extract_project_topics_into_separate_table_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb2
-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.rb2
-rw-r--r--spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/variables/builder/pipeline_spec.rb336
-rw-r--r--spec/lib/gitlab/ci/variables/builder_spec.rb13
-rw-r--r--spec/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation_spec.rb34
-rw-r--r--spec/lib/gitlab/database/async_indexes/index_base_spec.rb88
-rw-r--r--spec/lib/gitlab/database/async_indexes/index_creator_spec.rb38
-rw-r--r--spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb38
-rw-r--r--spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb2
-rw-r--r--spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb36
-rw-r--r--spec/lib/gitlab/database/async_indexes_spec.rb57
-rw-r--r--spec/lib/gitlab/database/load_balancing/sticking_spec.rb443
-rw-r--r--spec/lib/gitlab/redis/db_load_balancing_spec.rb52
-rw-r--r--spec/migrations/20210603222333_remove_builds_email_service_from_services_spec.rb24
-rw-r--r--spec/migrations/20210610153556_delete_legacy_operations_feature_flags_spec.rb45
-rw-r--r--spec/migrations/2021061716138_cascade_delete_freeze_periods_spec.rb22
-rw-r--r--spec/migrations/20210708130419_reschedule_merge_request_diff_users_background_migration_spec.rb76
-rw-r--r--spec/migrations/20210713042000_fix_ci_sources_pipelines_index_names_spec.rb67
-rw-r--r--spec/migrations/20210722042939_update_issuable_slas_where_issue_closed_spec.rb31
-rw-r--r--spec/migrations/20210722150102_operations_feature_flags_correct_flexible_rollout_values_spec.rb66
-rw-r--r--spec/migrations/20210804150320_create_base_work_item_types_spec.rb43
-rw-r--r--spec/migrations/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers_spec.rb137
-rw-r--r--spec/migrations/20210811122206_update_external_project_bots_spec.rb25
-rw-r--r--spec/migrations/20210812013042_remove_duplicate_project_authorizations_spec.rb62
-rw-r--r--spec/migrations/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session_spec.rb21
-rw-r--r--spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb35
-rw-r--r--spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb88
-rw-r--r--spec/migrations/add_triggers_to_integrations_type_new_spec.rb77
-rw-r--r--spec/migrations/add_upvotes_count_index_to_issues_spec.rb22
-rw-r--r--spec/migrations/associate_existing_dast_builds_with_variables_spec.rb10
-rw-r--r--spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb108
-rw-r--r--spec/migrations/backfill_integrations_type_new_spec.rb38
-rw-r--r--spec/migrations/backfill_issues_upvotes_count_spec.rb35
-rw-r--r--spec/migrations/backfill_stage_event_hash_spec.rb103
-rw-r--r--spec/migrations/cleanup_remaining_orphan_invites_spec.rb37
-rw-r--r--spec/migrations/confirm_security_bot_spec.rb38
-rw-r--r--spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb46
-rw-r--r--spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb63
-rw-r--r--spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb42
-rw-r--r--spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb34
-rw-r--r--spec/migrations/orphaned_invite_tokens_cleanup_spec.rb50
-rw-r--r--spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb62
-rw-r--r--spec/migrations/remove_duplicate_dast_site_tokens_spec.rb53
-rw-r--r--spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb53
-rw-r--r--spec/migrations/rename_services_to_integrations_spec.rb255
-rw-r--r--spec/migrations/replace_external_wiki_triggers_spec.rb132
-rw-r--r--spec/migrations/reschedule_delete_orphaned_deployments_spec.rb74
-rw-r--r--spec/migrations/reset_job_token_scope_enabled_again_spec.rb25
-rw-r--r--spec/migrations/reset_job_token_scope_enabled_spec.rb25
-rw-r--r--spec/migrations/reset_severity_levels_to_new_default_spec.rb33
-rw-r--r--spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb10
-rw-r--r--spec/migrations/schedule_security_setting_creation_spec.rb58
-rw-r--r--spec/migrations/set_default_job_token_scope_true_spec.rb33
-rw-r--r--spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb29
-rw-r--r--spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb102
-rw-r--r--spec/models/ci/build_spec.rb9
-rw-r--r--spec/models/ci/pipeline_spec.rb318
-rw-r--r--spec/requests/api/ci/runner/jobs_request_post_spec.rb28
-rw-r--r--spec/requests/api/graphql/mutations/ci/pipeline_schedule_play_spec.rb4
-rw-r--r--spec/requests/api/project_attributes.yml1
-rw-r--r--spec/requests/api/projects_spec.rb2
-rw-r--r--spec/serializers/integrations/field_entity_spec.rb6
-rw-r--r--spec/services/ci/pipeline_schedule_service_spec.rb4
-rw-r--r--spec/services/ci/register_job_service_spec.rb1161
-rw-r--r--spec/tasks/gitlab/db_rake_spec.rb74
-rw-r--r--spec/views/notify/user_deactivated_email.html.haml_spec.rb56
-rw-r--r--spec/views/notify/user_deactivated_email.text.erb_spec.rb58
-rw-r--r--spec/workers/run_pipeline_schedule_worker_spec.rb24
-rw-r--r--yarn.lock8
754 files changed, 6078 insertions, 12068 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6947c6db23b..6593fc107f1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -169,7 +169,7 @@ variables:
CACHE_CLASSES: "true"
CHECK_PRECOMPILED_ASSETS: "true"
FF_USE_FASTZIP: "true"
- SKIP_FLAKY_TESTS_AUTOMATICALLY: "true"
+ SKIP_FLAKY_TESTS_AUTOMATICALLY: "false"
RETRY_FAILED_TESTS_IN_NEW_PROCESS: "true"
# Run with decomposed databases by default
DECOMPOSED_DB: "true"
diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml
index 65750e500c1..5d46979d563 100644
--- a/.rubocop_todo/layout/argument_alignment.yml
+++ b/.rubocop_todo/layout/argument_alignment.yml
@@ -1251,9 +1251,6 @@ Layout/ArgumentAlignment:
- 'ee/app/mailers/ee/emails/projects.rb'
- 'ee/app/mailers/emails/namespace_storage_usage_mailer.rb'
- 'ee/app/models/approval_wrapped_rule.rb'
- - 'ee/app/models/audit_events/external_audit_event_destination.rb'
- - 'ee/app/models/audit_events/streaming/event_type_filter.rb'
- - 'ee/app/models/audit_events/streaming/header.rb'
- 'ee/app/models/ci/minutes/notification.rb'
- 'ee/app/models/concerns/ee/protected_ref_access.rb'
- 'ee/app/models/concerns/geo/verifiable_replicator.rb'
diff --git a/.rubocop_todo/layout/space_inside_parens.yml b/.rubocop_todo/layout/space_inside_parens.yml
index 1457db33eab..e6e0b471e1b 100644
--- a/.rubocop_todo/layout/space_inside_parens.yml
+++ b/.rubocop_todo/layout/space_inside_parens.yml
@@ -26,7 +26,6 @@ Layout/SpaceInsideParens:
- 'ee/spec/migrations/add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations_spec.rb'
- 'ee/spec/migrations/drop_invalid_remediations_spec.rb'
- 'ee/spec/models/allowed_email_domain_spec.rb'
- - 'ee/spec/models/audit_events/external_audit_event_destination_spec.rb'
- 'ee/spec/models/boards/epic_board_position_spec.rb'
- 'ee/spec/models/dora/change_failure_rate_metric_spec.rb'
- 'ee/spec/models/ee/integrations/jira_spec.rb'
diff --git a/.rubocop_todo/rails/inverse_of.yml b/.rubocop_todo/rails/inverse_of.yml
index 376342cdede..28817bebc48 100644
--- a/.rubocop_todo/rails/inverse_of.yml
+++ b/.rubocop_todo/rails/inverse_of.yml
@@ -71,8 +71,6 @@ Rails/InverseOf:
- 'ee/app/models/allowed_email_domain.rb'
- 'ee/app/models/analytics/devops_adoption/enabled_namespace.rb'
- 'ee/app/models/analytics/devops_adoption/snapshot.rb'
- - 'ee/app/models/audit_events/external_audit_event_destination.rb'
- - 'ee/app/models/audit_events/streaming/header.rb'
- 'ee/app/models/ci/sources/project.rb'
- 'ee/app/models/compliance_management/compliance_framework/project_settings.rb'
- 'ee/app/models/concerns/incident_management/base_pending_escalation.rb'
diff --git a/.rubocop_todo/rails/redundant_foreign_key.yml b/.rubocop_todo/rails/redundant_foreign_key.yml
index 3a7c4a3754e..8705236aaf9 100644
--- a/.rubocop_todo/rails/redundant_foreign_key.yml
+++ b/.rubocop_todo/rails/redundant_foreign_key.yml
@@ -39,7 +39,6 @@ Rails/RedundantForeignKey:
- 'app/models/work_item.rb'
- 'app/models/x509_certificate.rb'
- 'ee/app/models/allowed_email_domain.rb'
- - 'ee/app/models/audit_events/streaming/header.rb'
- 'ee/app/models/boards/epic_board.rb'
- 'ee/app/models/boards/epic_list_user_preference.rb'
- 'ee/app/models/ci/sources/project.rb'
diff --git a/.rubocop_todo/rspec/context_wording.yml b/.rubocop_todo/rspec/context_wording.yml
index 3a29281d16b..7c20624ccc7 100644
--- a/.rubocop_todo/rspec/context_wording.yml
+++ b/.rubocop_todo/rspec/context_wording.yml
@@ -439,7 +439,6 @@ RSpec/ContextWording:
- 'ee/spec/models/approval_merge_request_rule_spec.rb'
- 'ee/spec/models/approval_project_rule_spec.rb'
- 'ee/spec/models/approval_state_spec.rb'
- - 'ee/spec/models/audit_events/external_audit_event_destination_spec.rb'
- 'ee/spec/models/board_spec.rb'
- 'ee/spec/models/boards/epic_board_position_spec.rb'
- 'ee/spec/models/ci/minutes/namespace_monthly_usage_spec.rb'
diff --git a/.rubocop_todo/rspec/missing_feature_category.yml b/.rubocop_todo/rspec/missing_feature_category.yml
index 3386eb650f3..32a479a4ba5 100644
--- a/.rubocop_todo/rspec/missing_feature_category.yml
+++ b/.rubocop_todo/rspec/missing_feature_category.yml
@@ -1253,9 +1253,6 @@ RSpec/MissingFeatureCategory:
- 'ee/spec/models/approvals/scan_finding_wrapped_rule_set_spec.rb'
- 'ee/spec/models/approvals/wrapped_rule_set_spec.rb'
- 'ee/spec/models/approver_group_spec.rb'
- - 'ee/spec/models/audit_events/external_audit_event_destination_spec.rb'
- - 'ee/spec/models/audit_events/streaming/event_type_filter_spec.rb'
- - 'ee/spec/models/audit_events/streaming/header_spec.rb'
- 'ee/spec/models/board_assignee_spec.rb'
- 'ee/spec/models/board_label_spec.rb'
- 'ee/spec/models/board_spec.rb'
@@ -4754,11 +4751,6 @@ RSpec/MissingFeatureCategory:
- 'spec/lib/gitlab/data_builder/pipeline_spec.rb'
- 'spec/lib/gitlab/data_builder/push_spec.rb'
- 'spec/lib/gitlab/data_builder/wiki_page_spec.rb'
- - 'spec/lib/gitlab/database/async_indexes/index_creator_spec.rb'
- - 'spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb'
- - 'spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb'
- - 'spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb'
- - 'spec/lib/gitlab/database/async_indexes_spec.rb'
- 'spec/lib/gitlab/database/background_migration/batch_metrics_spec.rb'
- 'spec/lib/gitlab/database/background_migration/batch_optimizer_spec.rb'
- 'spec/lib/gitlab/database/background_migration/batched_job_spec.rb'
diff --git a/.rubocop_todo/style/guard_clause.yml b/.rubocop_todo/style/guard_clause.yml
index 586f146c2ba..37be7467127 100644
--- a/.rubocop_todo/style/guard_clause.yml
+++ b/.rubocop_todo/style/guard_clause.yml
@@ -317,7 +317,6 @@ Style/GuardClause:
- 'ee/app/models/allowed_email_domain.rb'
- 'ee/app/models/app_sec/fuzzing/coverage/corpus.rb'
- 'ee/app/models/approval_merge_request_rule_source.rb'
- - 'ee/app/models/audit_events/external_audit_event_destination.rb'
- 'ee/app/models/concerns/app_sec/dast/buildable.rb'
- 'ee/app/models/concerns/ee/protected_ref_access.rb'
- 'ee/app/models/concerns/elastic/application_versioned_search.rb'
diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
index f382ded90d7..15335ea6edc 100644
--- a/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
+++ b/app/assets/javascripts/vue_shared/components/source_viewer/constants.js
@@ -120,6 +120,8 @@ export const EVENT_LABEL_FALLBACK = 'legacy_fallback';
export const LINES_PER_CHUNK = 70;
+export const NEWLINE = '\n';
+
export const BIDI_CHARS = [
'\u202A', // Left-to-Right Embedding (Try treating following text as left-to-right)
'\u202B', // Right-to-Left Embedding (Try treating following text as right-to-left)
diff --git a/app/assets/javascripts/vue_shared/components/source_viewer/workers/highlight_utils.js b/app/assets/javascripts/vue_shared/components/source_viewer/workers/highlight_utils.js
index 0da57f9e6fa..142c135e9c1 100644
--- a/app/assets/javascripts/vue_shared/components/source_viewer/workers/highlight_utils.js
+++ b/app/assets/javascripts/vue_shared/components/source_viewer/workers/highlight_utils.js
@@ -1,15 +1,47 @@
-import hljs from 'highlight.js/lib/core';
-import languageLoader from '~/content_editor/services/highlight_js_language_loader';
+import hljs from 'highlight.js';
import { registerPlugins } from '../plugins/index';
+import { LINES_PER_CHUNK, NEWLINE, ROUGE_TO_HLJS_LANGUAGE_MAP } from '../constants';
-const initHighlightJs = async (fileType, content, language) => {
- const languageDefinition = await languageLoader[language]();
-
+const initHighlightJs = (fileType, content) => {
registerPlugins(hljs, fileType, content);
- hljs.registerLanguage(language, languageDefinition.default);
};
-export const highlight = (fileType, content, language) => {
- initHighlightJs(fileType, content, language);
- return hljs.highlight(content, { language }).value;
+const splitByLineBreaks = (content = '') => content.split(/\r?\n/);
+
+const createChunk = (language, rawChunkLines, highlightedChunkLines = [], startingFrom = 0) => ({
+ highlightedContent: highlightedChunkLines.join(NEWLINE),
+ rawContent: rawChunkLines.join(NEWLINE),
+ totalLines: rawChunkLines.length,
+ startingFrom,
+ language,
+});
+
+const splitIntoChunks = (language, rawContent, highlightedContent) => {
+ const result = [];
+ const splitRawContent = splitByLineBreaks(rawContent);
+ const splitHighlightedContent = splitByLineBreaks(highlightedContent);
+
+ for (let i = 0; i < splitRawContent.length; i += LINES_PER_CHUNK) {
+ const chunkIndex = Math.floor(i / LINES_PER_CHUNK);
+ const highlightedChunk = splitHighlightedContent.slice(i, i + LINES_PER_CHUNK);
+ const rawChunk = splitRawContent.slice(i, i + LINES_PER_CHUNK);
+ result[chunkIndex] = createChunk(language, rawChunk, highlightedChunk, i);
+ }
+
+ return result;
+};
+
+const highlight = (fileType, rawContent, lang) => {
+ const language = ROUGE_TO_HLJS_LANGUAGE_MAP[lang.toLowerCase()];
+ let result;
+
+ if (language) {
+ initHighlightJs(fileType, rawContent, language);
+ const highlightedContent = hljs.highlight(rawContent, { language }).value;
+ result = splitIntoChunks(language, rawContent, highlightedContent);
+ }
+
+ return result;
};
+
+export { highlight, splitIntoChunks };
diff --git a/app/assets/stylesheets/startup/startup-signin.scss b/app/assets/stylesheets/startup/startup-signin.scss
index d8afff1a200..3aace601c45 100644
--- a/app/assets/stylesheets/startup/startup-signin.scss
+++ b/app/assets/stylesheets/startup/startup-signin.scss
@@ -511,7 +511,7 @@ input.btn-block[type="button"] {
.gl-form-checkbox.custom-control
.custom-control-input[type="checkbox"]:indeterminate:disabled
~ .custom-control-label::after {
- background-color: #626168;
+ background-color: #737278;
}
.gl-button {
display: inline-flex;
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb
index 40c5967723c..29d2ecb1bd9 100644
--- a/app/helpers/application_settings_helper.rb
+++ b/app/helpers/application_settings_helper.rb
@@ -450,7 +450,8 @@ module ApplicationSettingsHelper
:can_create_group,
:bulk_import_enabled,
:allow_runner_registration_token,
- :user_defaults_to_private_profile
+ :user_defaults_to_private_profile,
+ :deactivation_email_additional_text
].tap do |settings|
next if Gitlab.com?
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 21d17f11c50..bd426e02b9c 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -845,97 +845,6 @@ module Ci
end
end
- def predefined_variables
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- variables.append(key: 'CI_PIPELINE_IID', value: iid.to_s)
- variables.append(key: 'CI_PIPELINE_SOURCE', value: source.to_s)
- variables.append(key: 'CI_PIPELINE_CREATED_AT', value: created_at&.iso8601)
-
- variables.concat(predefined_commit_variables)
- variables.concat(predefined_merge_request_variables)
-
- if open_merge_requests_refs.any?
- variables.append(key: 'CI_OPEN_MERGE_REQUESTS', value: open_merge_requests_refs.join(','))
- end
-
- variables.append(key: 'CI_GITLAB_FIPS_MODE', value: 'true') if Gitlab::FIPS.enabled?
-
- variables.append(key: 'CI_KUBERNETES_ACTIVE', value: 'true') if has_kubernetes_active?
- variables.append(key: 'CI_DEPLOY_FREEZE', value: 'true') if freeze_period?
-
- if external_pull_request_event? && external_pull_request
- variables.concat(external_pull_request.predefined_variables)
- end
- end
- end
-
- def predefined_commit_variables
- strong_memoize(:predefined_commit_variables) do
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- next variables unless sha.present?
-
- variables.append(key: 'CI_COMMIT_SHA', value: sha)
- variables.append(key: 'CI_COMMIT_SHORT_SHA', value: short_sha)
- variables.append(key: 'CI_COMMIT_BEFORE_SHA', value: before_sha)
- variables.append(key: 'CI_COMMIT_REF_NAME', value: source_ref)
- variables.append(key: 'CI_COMMIT_REF_SLUG', value: source_ref_slug)
- variables.append(key: 'CI_COMMIT_BRANCH', value: ref) if branch?
- variables.append(key: 'CI_COMMIT_MESSAGE', value: git_commit_message.to_s)
- variables.append(key: 'CI_COMMIT_TITLE', value: git_commit_full_title.to_s)
- variables.append(key: 'CI_COMMIT_DESCRIPTION', value: git_commit_description.to_s)
- variables.append(key: 'CI_COMMIT_REF_PROTECTED', value: (!!protected_ref?).to_s)
- variables.append(key: 'CI_COMMIT_TIMESTAMP', value: git_commit_timestamp.to_s)
- variables.append(key: 'CI_COMMIT_AUTHOR', value: git_author_full_text.to_s)
-
- # legacy variables
- variables.append(key: 'CI_BUILD_REF', value: sha)
- variables.append(key: 'CI_BUILD_BEFORE_SHA', value: before_sha)
- variables.append(key: 'CI_BUILD_REF_NAME', value: source_ref)
- variables.append(key: 'CI_BUILD_REF_SLUG', value: source_ref_slug)
-
- variables.concat(predefined_commit_tag_variables)
- end
- end
- end
-
- def predefined_merge_request_variables
- strong_memoize(:predefined_merge_request_variables) do
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- next variables unless merge_request?
-
- variables.append(key: 'CI_MERGE_REQUEST_EVENT_TYPE', value: merge_request_event_type.to_s)
- variables.append(key: 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA', value: source_sha.to_s)
- variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA', value: target_sha.to_s)
-
- diff = self.merge_request_diff
- if diff.present?
- variables.append(key: 'CI_MERGE_REQUEST_DIFF_ID', value: diff.id.to_s)
- variables.append(key: 'CI_MERGE_REQUEST_DIFF_BASE_SHA', value: diff.base_commit_sha)
- end
-
- variables.concat(merge_request.predefined_variables)
- end
- end
- end
-
- def predefined_commit_tag_variables
- strong_memoize(:predefined_commit_ref_variables) do
- Gitlab::Ci::Variables::Collection.new.tap do |variables|
- next variables unless tag?
-
- git_tag = project.repository.find_tag(ref)
-
- next variables unless git_tag
-
- variables.append(key: 'CI_COMMIT_TAG', value: ref)
- variables.append(key: 'CI_COMMIT_TAG_MESSAGE', value: git_tag.message)
-
- # legacy variable
- variables.append(key: 'CI_BUILD_TAG', value: ref)
- end
- end
- end
-
def queued_duration
return unless started_at
@@ -1407,6 +1316,12 @@ module Ci
(Time.current - created_at).ceil / 60
end
+ def merge_request_diff
+ return unless merge_request?
+
+ merge_request.merge_request_diff_for(merge_request_diff_sha)
+ end
+
private
def cancel_jobs(jobs, retries: 1, auto_canceled_by_pipeline_id: nil)
@@ -1459,12 +1374,6 @@ module Ci
end
end
- def merge_request_diff
- return unless merge_request?
-
- merge_request.merge_request_diff_for(merge_request_diff_sha)
- end
-
def push_details
strong_memoize(:push_details) do
Gitlab::Git::Push.new(project, before_sha, sha, git_ref)
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index db58a995f0b..eea8915b690 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -502,6 +502,10 @@ module Ci
token.start_with?(CREATED_RUNNER_TOKEN_PREFIX)
end
+ def ensure_machine(machine_xid:, &blk)
+ RunnerMachine.safe_find_or_create_by!(runner_id: id, machine_xid: machine_xid.to_s, &blk) # rubocop: disable Performance/ActiveRecordSubtransactionMethods
+ end
+
private
scope :with_upgrade_status, ->(upgrade_status) do
diff --git a/app/models/integrations/jira.rb b/app/models/integrations/jira.rb
index 45302a0bd09..d96a848c72e 100644
--- a/app/models/integrations/jira.rb
+++ b/app/models/integrations/jira.rb
@@ -48,21 +48,21 @@ module Integrations
section: SECTION_TYPE_CONNECTION,
required: true,
title: -> { s_('JiraService|Web URL') },
- help: -> { s_('JiraService|Base URL of the Jira instance.') },
+ help: -> { s_('JiraService|Base URL of the Jira instance') },
placeholder: 'https://jira.example.com',
exposes_secrets: true
field :api_url,
section: SECTION_TYPE_CONNECTION,
title: -> { s_('JiraService|Jira API URL') },
- help: -> { s_('JiraService|If different from Web URL.') },
+ help: -> { s_('JiraService|If different from the Web URL') },
exposes_secrets: true
field :username,
section: SECTION_TYPE_CONNECTION,
required: true,
- title: -> { s_('JiraService|Username or Email') },
- help: -> { s_('JiraService|Use a username for server version and an email for cloud version.') }
+ title: -> { s_('JiraService|Username or email') },
+ help: -> { s_('JiraService|Username for the server version or an email for the cloud version') }
field :password,
section: SECTION_TYPE_CONNECTION,
@@ -70,7 +70,7 @@ module Integrations
title: -> { s_('JiraService|Password or API token') },
non_empty_password_title: -> { s_('JiraService|Enter new password or API token') },
non_empty_password_help: -> { s_('JiraService|Leave blank to use your current password or API token.') },
- help: -> { s_('JiraService|Use a password for server version and an API token for cloud version.') }
+ help: -> { s_('JiraService|Password for the server version or an API token for the cloud version') }
field :jira_issue_transition_id, api_only: true
diff --git a/app/services/ci/pipeline_schedule_service.rb b/app/services/ci/pipeline_schedule_service.rb
index e9fdadedcc3..d320382d19f 100644
--- a/app/services/ci/pipeline_schedule_service.rb
+++ b/app/services/ci/pipeline_schedule_service.rb
@@ -8,7 +8,7 @@ module Ci
# Ensure `next_run_at` is set properly before creating a pipeline.
# Otherwise, multiple pipelines could be created in a short interval.
schedule.schedule_next_run!
- RunPipelineScheduleWorker.perform_async(schedule.id, current_user&.id, next_run_scheduled: true)
+ RunPipelineScheduleWorker.perform_async(schedule.id, current_user&.id)
end
end
end
diff --git a/app/services/ci/register_job_service.rb b/app/services/ci/register_job_service.rb
index ccc23283ec4..205da2632c2 100644
--- a/app/services/ci/register_job_service.rb
+++ b/app/services/ci/register_job_service.rb
@@ -6,7 +6,7 @@ module Ci
class RegisterJobService
include ::Gitlab::Ci::Artifacts::Logger
- attr_reader :runner, :metrics
+ attr_reader :runner, :runner_machine, :metrics
TEMPORARY_LOCK_TIMEOUT = 3.seconds
@@ -18,8 +18,9 @@ module Ci
# affect 5% of the worst case scenarios.
MAX_QUEUE_DEPTH = 45
- def initialize(runner)
+ def initialize(runner, runner_machine)
@runner = runner
+ @runner_machine = runner_machine
@metrics = ::Gitlab::Ci::Queue::Metrics.new(runner)
end
@@ -243,6 +244,7 @@ module Ci
def assign_runner!(build, params)
build.runner_id = runner.id
build.runner_session_attributes = params[:session] if params[:session].present?
+ build.ensure_metadata.runner_machine = runner_machine if runner_machine
failure_reason, _ = pre_assign_runner_checks.find { |_, check| check.call(build, params) }
diff --git a/app/views/layouts/mailer/_user_deactivated_additional_text.html.haml b/app/views/layouts/mailer/_user_deactivated_additional_text.html.haml
new file mode 100644
index 00000000000..cabdd4b09ec
--- /dev/null
+++ b/app/views/layouts/mailer/_user_deactivated_additional_text.html.haml
@@ -0,0 +1,3 @@
+- return unless Feature.enabled?(:deactivation_email_additional_text) && Gitlab::CurrentSettings.deactivation_email_additional_text.present?
+%p
+ = Gitlab::Utils.nlbr(Gitlab::CurrentSettings.deactivation_email_additional_text)
diff --git a/app/views/layouts/mailer/_user_deactivated_additional_text.text.erb b/app/views/layouts/mailer/_user_deactivated_additional_text.text.erb
new file mode 100644
index 00000000000..5862c8059f9
--- /dev/null
+++ b/app/views/layouts/mailer/_user_deactivated_additional_text.text.erb
@@ -0,0 +1,3 @@
+<% return unless Feature.enabled?(:deactivation_email_additional_text) && Gitlab::CurrentSettings.deactivation_email_additional_text.present? %>
+
+<%= Gitlab::CurrentSettings.deactivation_email_additional_text %>
diff --git a/app/views/notify/user_deactivated_email.html.haml b/app/views/notify/user_deactivated_email.html.haml
index a9262cab219..d8ba2639fe6 100644
--- a/app/views/notify/user_deactivated_email.html.haml
+++ b/app/views/notify/user_deactivated_email.html.haml
@@ -15,3 +15,5 @@
%p
= _('Please contact your GitLab administrator if you think this is an error.')
+
+= render 'layouts/mailer/user_deactivated_additional_text'
diff --git a/app/views/notify/user_deactivated_email.text.erb b/app/views/notify/user_deactivated_email.text.erb
index 9e7d00f4ad1..6faeb5ba0f4 100644
--- a/app/views/notify/user_deactivated_email.text.erb
+++ b/app/views/notify/user_deactivated_email.text.erb
@@ -8,3 +8,4 @@
<%= _('To reactivate your account, sign in to GitLab at %{gitlab_url}.') % { gitlab_url: root_url } %>
<%= _('Please contact your GitLab administrator if you think this is an error.') %>
+<%= render 'layouts/mailer/user_deactivated_additional_text' %>
diff --git a/app/workers/pipeline_schedule_worker.rb b/app/workers/pipeline_schedule_worker.rb
index fb843bd421c..cb7878c92dd 100644
--- a/app/workers/pipeline_schedule_worker.rb
+++ b/app/workers/pipeline_schedule_worker.rb
@@ -24,7 +24,7 @@ class PipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
.find_in_batches do |schedules|
RunPipelineScheduleWorker.bulk_perform_async_with_contexts(
schedules,
- arguments_proc: ->(schedule) { [schedule.id, schedule.owner_id] },
+ arguments_proc: ->(schedule) { [schedule.id, schedule.owner_id, { scheduling: true }] },
context_proc: ->(schedule) { { project: schedule.project, user: schedule.owner } }
)
end
diff --git a/app/workers/run_pipeline_schedule_worker.rb b/app/workers/run_pipeline_schedule_worker.rb
index f7012ec265c..41467b89c15 100644
--- a/app/workers/run_pipeline_schedule_worker.rb
+++ b/app/workers/run_pipeline_schedule_worker.rb
@@ -19,7 +19,9 @@ class RunPipelineScheduleWorker # rubocop:disable Scalability/IdempotentWorker
return unless schedule && schedule.project && user
- if Feature.enabled?(:ci_use_run_pipeline_schedule_worker) && !options['next_run_scheduled']
+ options.symbolize_keys!
+
+ if Feature.enabled?(:ci_use_run_pipeline_schedule_worker) && options[:scheduling]
return if schedule.next_run_at > Time.current
update_next_run_at_for(schedule)
diff --git a/config/README.md b/config/README.md
index 861cda5a5b6..71f18505a88 100644
--- a/config/README.md
+++ b/config/README.md
@@ -71,15 +71,16 @@ environment variable.
An example configuration file for Redis is in this directory under the name
`resque.yml.example`.
-| Name | Fallback instance | Purpose |
-|--------------------|-------------------|-------------------------------------------------------------------------------------------------------------|
-| `cache` | | Volatile non-persistent data |
-| `queues` | | Background job processing queues |
-| `shared_state` | | Persistent application state |
-| `trace_chunks` | `shared_state` | [CI trace chunks](https://docs.gitlab.com/ee/administration/job_logs.html#incremental-logging-architecture) |
-| `rate_limiting` | `cache` | [Rate limiting](https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html) state |
-| `sessions` | `shared_state` | [Sessions](https://docs.gitlab.com/ee/development/session.html#redis) |
-| `repository_cache` | `cache` | Repository related information |
+| Name | Fallback instance | Purpose |
+|---------------------|-------------------|--------------------------------------------------------------------------------------------------------------|
+| `cache` | | Volatile non-persistent data |
+| `queues` | | Background job processing queues |
+| `shared_state` | | Persistent application state |
+| `trace_chunks` | `shared_state` | [CI trace chunks](https://docs.gitlab.com/ee/administration/job_logs.html#incremental-logging-architecture) |
+| `rate_limiting` | `cache` | [Rate limiting](https://docs.gitlab.com/ee/user/admin_area/settings/user_and_ip_rate_limits.html) state |
+| `sessions` | `shared_state` | [Sessions](https://docs.gitlab.com/ee/development/session.html#redis) |
+| `repository_cache` | `cache` | Repository related information |
+| `db_load_balancing` | `shared_state` | [Database Load Balancing](https://docs.gitlab.com/ee/administration/postgresql/database_load_balancing.html) |
If no configuration is found, or no URL is found in the configuration
file, the default URL used is:
diff --git a/config/application.rb b/config/application.rb
index 5358c5d5b19..2d97bb1c0af 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -60,6 +60,7 @@ module Gitlab
require_dependency Rails.root.join('lib/gitlab/redis/rate_limiting')
require_dependency Rails.root.join('lib/gitlab/redis/sessions')
require_dependency Rails.root.join('lib/gitlab/redis/repository_cache')
+ require_dependency Rails.root.join('lib/gitlab/redis/db_load_balancing')
require_dependency Rails.root.join('lib/gitlab/current_settings')
require_dependency Rails.root.join('lib/gitlab/middleware/read_only')
require_dependency Rails.root.join('lib/gitlab/middleware/compressed_json')
diff --git a/config/feature_flags/development/create_runner_machine.yml b/config/feature_flags/development/create_runner_machine.yml
new file mode 100644
index 00000000000..5ad3766ff6e
--- /dev/null
+++ b/config/feature_flags/development/create_runner_machine.yml
@@ -0,0 +1,8 @@
+---
+name: create_runner_machine
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109983
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/390261
+milestone: '15.9'
+type: development
+group: group::runner
+default_enabled: false
diff --git a/config/feature_flags/development/deactivation_email_additional_text.yml b/config/feature_flags/development/deactivation_email_additional_text.yml
new file mode 100644
index 00000000000..0c657d20727
--- /dev/null
+++ b/config/feature_flags/development/deactivation_email_additional_text.yml
@@ -0,0 +1,8 @@
+---
+name: deactivation_email_additional_text
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110033
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/389538
+milestone: '15.9'
+type: development
+group: group::authentication and authorization
+default_enabled: false
diff --git a/config/feature_flags/development/use_primary_and_secondary_stores_for_db_load_balancing.yml b/config/feature_flags/development/use_primary_and_secondary_stores_for_db_load_balancing.yml
new file mode 100644
index 00000000000..18f060f247d
--- /dev/null
+++ b/config/feature_flags/development/use_primary_and_secondary_stores_for_db_load_balancing.yml
@@ -0,0 +1,8 @@
+---
+name: use_primary_and_secondary_stores_for_db_load_balancing
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111269
+rollout_issue_url:
+milestone: '15.9'
+type: development
+group: group::scalability
+default_enabled: false
diff --git a/config/feature_flags/development/use_primary_store_as_default_for_db_load_balancing.yml b/config/feature_flags/development/use_primary_store_as_default_for_db_load_balancing.yml
new file mode 100644
index 00000000000..632ec40adfa
--- /dev/null
+++ b/config/feature_flags/development/use_primary_store_as_default_for_db_load_balancing.yml
@@ -0,0 +1,8 @@
+---
+name: use_primary_store_as_default_for_db_load_balancing
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111269
+rollout_issue_url:
+milestone: '15.9'
+type: development
+group: group::scalability
+default_enabled: false
diff --git a/config/feature_flags/ops/database_async_index_operations.yml b/config/feature_flags/ops/database_async_index_operations.yml
new file mode 100644
index 00000000000..22fbcbe6569
--- /dev/null
+++ b/config/feature_flags/ops/database_async_index_operations.yml
@@ -0,0 +1,8 @@
+---
+name: database_async_index_operations
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110530
+rollout_issue_url:
+milestone: '15.9'
+type: ops
+group: group::database
+default_enabled: false
diff --git a/db/docs/postgres_async_foreign_key_validations.yml b/db/docs/postgres_async_foreign_key_validations.yml
new file mode 100644
index 00000000000..0b9608a3ace
--- /dev/null
+++ b/db/docs/postgres_async_foreign_key_validations.yml
@@ -0,0 +1,11 @@
+---
+table_name: postgres_async_foreign_key_validations
+classes:
+- Gitlab::Database::AsyncForeignKeys::PostgresAsyncForeignKeyValidation
+feature_categories:
+- database
+description: >-
+ Contains a queue-like structure for database foreign key validations scheduled to be executed asynchronously.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111293
+milestone: '15.9'
+gitlab_schema: gitlab_shared
diff --git a/db/init_structure.sql b/db/init_structure.sql
index 00f06078426..2b952381952 100644
--- a/db/init_structure.sql
+++ b/db/init_structure.sql
@@ -10,6 +10,30 @@ 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
+ 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;
+
+ RETURN NULL;
+END
+$$;
+
+CREATE FUNCTION integrations_set_type_new() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1')
+WHERE integrations.id = NEW.id;
+RETURN NULL;
+
+END
+$$;
+
CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -18,7 +42,7 @@ UPDATE projects SET has_external_issue_tracker = (
EXISTS
(
SELECT 1
- FROM services
+ FROM integrations
WHERE project_id = COALESCE(NEW.project_id, OLD.project_id)
AND active = TRUE
AND category = 'issue_tracker'
@@ -41,62 +65,6 @@ RETURN NULL;
END
$$;
-CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
-IF (TG_OP = 'DELETE') THEN
- DELETE FROM web_hook_logs_archived where id = OLD.id;
-ELSIF (TG_OP = 'UPDATE') THEN
- UPDATE web_hook_logs_archived
- SET web_hook_id = NEW.web_hook_id,
- trigger = NEW.trigger,
- url = NEW.url,
- request_headers = NEW.request_headers,
- request_data = NEW.request_data,
- response_headers = NEW.response_headers,
- response_body = NEW.response_body,
- response_status = NEW.response_status,
- execution_duration = NEW.execution_duration,
- internal_error_message = NEW.internal_error_message,
- created_at = NEW.created_at,
- updated_at = NEW.updated_at
- WHERE web_hook_logs_archived.id = NEW.id;
-ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO web_hook_logs_archived (id,
- web_hook_id,
- trigger,
- url,
- request_headers,
- request_data,
- response_headers,
- response_body,
- response_status,
- execution_duration,
- internal_error_message,
- created_at,
- updated_at)
- VALUES (NEW.id,
- NEW.web_hook_id,
- NEW.trigger,
- NEW.url,
- NEW.request_headers,
- NEW.request_data,
- NEW.response_headers,
- NEW.response_body,
- NEW.response_status,
- NEW.execution_duration,
- NEW.internal_error_message,
- NEW.created_at,
- NEW.updated_at);
-END IF;
-RETURN NULL;
-
-END
-$$;
-
-COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table';
-
CREATE FUNCTION trigger_07c94931164e() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -125,11 +93,20 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger
+CREATE FUNCTION trigger_490d204c00b3() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
+ 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;
$$;
@@ -189,16 +166,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_be1804f21693() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- NEW."job_id_convert_to_bigint" := NEW."job_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -407,6 +374,320 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 (
);
ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
+ 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_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
+
+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
+)
+PARTITION BY RANGE (process_at);
+
+CREATE SEQUENCE incident_management_pending_alert_escalations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_pending_alert_escalations_id_seq OWNED BY incident_management_pending_alert_escalations.id;
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ 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
+);
+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
+);
+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
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ 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
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 (
+ 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
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 (
+ 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
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ 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
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ 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
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ 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
+);
+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 incident_management_pending_issue_escalations (
+ id bigint 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
+)
+PARTITION BY RANGE (process_at);
+
+CREATE SEQUENCE incident_management_pending_issue_escalations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_pending_issue_escalations_id_seq OWNED BY incident_management_pending_issue_escalations.id;
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 (
+ 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_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,
+ 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_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,
+ 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_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 (
+ 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_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 (
+ 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_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 (
+ 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_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ 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_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ 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_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+
+CREATE TABLE loose_foreign_keys_deleted_records (
+ 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))
+)
+PARTITION BY RANGE (created_at);
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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))
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 (
+ 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))
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301 (
+ 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))
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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))
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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))
+);
+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');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_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))
+);
+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');
+
CREATE TABLE web_hook_logs (
id bigint NOT NULL,
web_hook_id integer NOT NULL,
@@ -570,6 +851,815 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 (
);
ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
+ 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_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+)
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+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);
+
+CREATE TABLE analytics_cycle_analytics_merge_request_stage_events (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+)
+PARTITION BY HASH (stage_event_hash_id);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_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
+);
+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 product_analytics_events_experimental (
id bigint NOT NULL,
project_id integer NOT NULL,
@@ -9245,6 +10335,22 @@ CREATE SEQUENCE abuse_reports_id_seq
ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id;
+CREATE TABLE agent_group_authorizations (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ agent_id bigint NOT NULL,
+ config jsonb NOT NULL
+);
+
+CREATE SEQUENCE agent_group_authorizations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE agent_group_authorizations_id_seq OWNED BY agent_group_authorizations.id;
+
CREATE TABLE alert_management_alert_assignees (
id bigint NOT NULL,
user_id bigint NOT NULL,
@@ -9372,7 +10478,9 @@ CREATE TABLE analytics_cycle_analytics_group_stages (
hidden boolean DEFAULT false NOT NULL,
custom boolean DEFAULT true NOT NULL,
name character varying(255) NOT NULL,
- group_value_stream_id bigint NOT NULL
+ group_value_stream_id bigint NOT NULL,
+ stage_event_hash_id bigint,
+ CONSTRAINT check_e6bd4271b5 CHECK ((stage_event_hash_id IS NOT NULL))
);
CREATE SEQUENCE analytics_cycle_analytics_group_stages_id_seq
@@ -9415,7 +10523,9 @@ CREATE TABLE analytics_cycle_analytics_project_stages (
hidden boolean DEFAULT false NOT NULL,
custom boolean DEFAULT true NOT NULL,
name character varying(255) NOT NULL,
- project_value_stream_id bigint NOT NULL
+ project_value_stream_id bigint NOT NULL,
+ stage_event_hash_id bigint,
+ CONSTRAINT check_8f6019de1e CHECK ((stage_event_hash_id IS NOT NULL))
);
CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq
@@ -9445,6 +10555,20 @@ CREATE SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq
ALTER SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq OWNED BY analytics_cycle_analytics_project_value_streams.id;
+CREATE TABLE analytics_cycle_analytics_stage_event_hashes (
+ id bigint NOT NULL,
+ hash_sha256 bytea
+);
+
+CREATE SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY analytics_cycle_analytics_stage_event_hashes.id;
+
CREATE TABLE analytics_devops_adoption_segments (
id bigint NOT NULL,
last_recorded_at timestamp with time zone,
@@ -9478,6 +10602,11 @@ CREATE TABLE analytics_devops_adoption_snapshots (
total_projects_count integer,
code_owners_used_count integer,
namespace_id integer,
+ sast_enabled_count integer,
+ dast_enabled_count integer,
+ dependency_scanning_enabled_count integer,
+ coverage_fuzzing_enabled_count integer,
+ vulnerability_management_used_count integer,
CONSTRAINT check_3f472de131 CHECK ((namespace_id IS NOT NULL))
);
@@ -9794,7 +10923,6 @@ CREATE TABLE application_settings (
npm_package_requests_forwarding boolean DEFAULT true NOT NULL,
push_rule_id bigint,
issues_create_limit integer DEFAULT 0 NOT NULL,
- seat_link_enabled boolean DEFAULT true NOT NULL,
container_expiration_policies_enable_historic_entries boolean DEFAULT false NOT NULL,
group_owners_can_manage_default_branch_protection boolean DEFAULT true NOT NULL,
container_registry_vendor text DEFAULT ''::text NOT NULL,
@@ -9848,7 +10976,6 @@ CREATE TABLE application_settings (
secret_detection_revocation_token_types_url text,
encrypted_cloud_license_auth_token text,
encrypted_cloud_license_auth_token_iv text,
- cloud_license_enabled boolean DEFAULT false NOT NULL,
personal_access_token_prefix text,
kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL,
disable_feed_token boolean DEFAULT false NOT NULL,
@@ -9886,6 +11013,25 @@ CREATE TABLE application_settings (
floc_enabled boolean DEFAULT false NOT NULL,
diff_max_lines integer DEFAULT 50000 NOT NULL,
diff_max_files integer DEFAULT 1000 NOT NULL,
+ encrypted_mailgun_signing_key bytea,
+ encrypted_mailgun_signing_key_iv bytea,
+ mailgun_events_enabled boolean DEFAULT false NOT NULL,
+ usage_ping_features_enabled boolean DEFAULT false NOT NULL,
+ encrypted_customers_dot_jwt_signing_key bytea,
+ encrypted_customers_dot_jwt_signing_key_iv bytea,
+ pypi_package_requests_forwarding boolean DEFAULT true NOT NULL,
+ max_yaml_size_bytes bigint DEFAULT 1048576 NOT NULL,
+ max_yaml_depth integer DEFAULT 100 NOT NULL,
+ throttle_unauthenticated_files_api_requests_per_period integer DEFAULT 125 NOT NULL,
+ throttle_unauthenticated_files_api_period_in_seconds integer DEFAULT 15 NOT NULL,
+ throttle_authenticated_files_api_requests_per_period integer DEFAULT 500 NOT NULL,
+ throttle_authenticated_files_api_period_in_seconds integer DEFAULT 15 NOT NULL,
+ throttle_unauthenticated_files_api_enabled boolean DEFAULT false NOT NULL,
+ throttle_authenticated_files_api_enabled boolean DEFAULT false NOT NULL,
+ user_deactivation_emails_enabled boolean DEFAULT true NOT NULL,
+ 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,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 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)),
@@ -10007,7 +11153,10 @@ CREATE TABLE approval_project_rules (
project_id integer NOT NULL,
approvals_required smallint DEFAULT 0 NOT NULL,
name character varying NOT NULL,
- rule_type smallint DEFAULT 0 NOT NULL
+ rule_type smallint DEFAULT 0 NOT NULL,
+ scanners text[],
+ vulnerabilities_allowed smallint DEFAULT 0 NOT NULL,
+ severity_levels text[] DEFAULT '{}'::text[] NOT NULL
);
CREATE TABLE approval_project_rules_groups (
@@ -10136,6 +11285,24 @@ CREATE SEQUENCE atlassian_identities_user_id_seq
ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id;
+CREATE TABLE audit_events_external_audit_event_destinations (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ destination_url text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255))
+);
+
+CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE audit_events_external_audit_event_destinations_id_seq OWNED BY audit_events_external_audit_event_destinations.id;
+
CREATE TABLE authentication_events (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -10228,6 +11395,12 @@ CREATE SEQUENCE badges_id_seq
ALTER SEQUENCE badges_id_seq OWNED BY badges.id;
+CREATE TABLE banned_users (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ user_id bigint NOT NULL
+);
+
CREATE TABLE batched_background_migration_jobs (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -10387,7 +11560,8 @@ CREATE TABLE boards (
name character varying DEFAULT 'Development'::character varying NOT NULL,
hide_backlog_list boolean DEFAULT false NOT NULL,
hide_closed_list boolean DEFAULT false NOT NULL,
- iteration_id bigint
+ iteration_id bigint,
+ iteration_cadence_id bigint
);
CREATE TABLE boards_epic_board_labels (
@@ -10753,11 +11927,11 @@ ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id;
CREATE TABLE ci_build_needs (
id integer NOT NULL,
- build_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,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_build_needs_id_seq
@@ -10807,13 +11981,13 @@ 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 integer 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,
checksum bytea,
lock_version integer DEFAULT 0 NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_build_trace_chunks_id_seq
@@ -10825,31 +11999,14 @@ CREATE SEQUENCE ci_build_trace_chunks_id_seq
ALTER SEQUENCE ci_build_trace_chunks_id_seq OWNED BY ci_build_trace_chunks.id;
-CREATE TABLE ci_build_trace_section_names (
- id integer NOT NULL,
- project_id integer NOT NULL,
- name character varying NOT NULL
-);
-
-CREATE SEQUENCE ci_build_trace_section_names_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_build_trace_section_names_id_seq OWNED BY ci_build_trace_section_names.id;
-
-CREATE TABLE 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 ci_build_trace_metadata (
+ build_id bigint NOT NULL,
+ trace_artifact_id bigint,
+ archival_attempts smallint DEFAULT 0 NOT NULL,
+ checksum bytea,
+ remote_checksum bytea,
+ last_archival_attempt_at timestamp with time zone,
+ archived_at timestamp with time zone
);
CREATE TABLE ci_builds (
@@ -10888,7 +12045,7 @@ CREATE TABLE ci_builds (
coverage_regex character varying,
auto_canceled_by_id integer,
retried boolean,
- stage_id integer,
+ stage_id_convert_to_bigint integer,
protected boolean,
failure_reason integer,
scheduled_at timestamp with time zone,
@@ -10899,7 +12056,7 @@ CREATE TABLE ci_builds (
waiting_for_resource_at timestamp with time zone,
scheduling_type smallint,
id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- stage_id_convert_to_bigint bigint
+ stage_id bigint
);
CREATE SEQUENCE ci_builds_id_seq
@@ -10913,8 +12070,8 @@ CREATE SEQUENCE ci_builds_id_seq
ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id;
CREATE TABLE ci_builds_metadata (
- id integer NOT NULL,
- build_id integer NOT NULL,
+ 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,
@@ -10925,7 +12082,8 @@ CREATE TABLE ci_builds_metadata (
environment_auto_stop_in character varying(255),
expanded_environment_name character varying(255),
secrets jsonb DEFAULT '{}'::jsonb NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL,
+ id bigint NOT NULL
);
CREATE SEQUENCE ci_builds_metadata_id_seq
@@ -10940,11 +12098,10 @@ ALTER SEQUENCE ci_builds_metadata_id_seq OWNED BY ci_builds_metadata.id;
CREATE TABLE ci_builds_runner_session (
id bigint NOT NULL,
- build_id integer NOT NULL,
url character varying NOT NULL,
certificate character varying,
"authorization" character varying,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_builds_runner_session_id_seq
@@ -11067,9 +12224,9 @@ CREATE SEQUENCE ci_instance_variables_id_seq
ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id;
CREATE TABLE ci_job_artifacts (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
- job_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,
@@ -11080,8 +12237,9 @@ CREATE TABLE ci_job_artifacts (
file_sha256 bytea,
file_format smallint,
file_location smallint,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- job_id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ id bigint NOT NULL,
+ job_id bigint NOT NULL,
+ locked smallint DEFAULT 2,
CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL))
);
@@ -11157,6 +12315,7 @@ CREATE TABLE ci_namespace_monthly_usages (
date date NOT NULL,
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,
CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
);
@@ -11173,7 +12332,12 @@ CREATE TABLE ci_pending_builds (
id bigint NOT NULL,
build_id bigint NOT NULL,
project_id bigint NOT NULL,
- created_at timestamp with time zone DEFAULT now() NOT NULL
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ protected boolean DEFAULT false NOT NULL,
+ instance_runners_enabled boolean DEFAULT false NOT NULL,
+ namespace_id bigint,
+ minutes_exceeded boolean DEFAULT false NOT NULL,
+ tag_ids integer[] DEFAULT '{}'::integer[]
);
CREATE SEQUENCE ci_pending_builds_id_seq
@@ -11553,9 +12717,9 @@ CREATE TABLE ci_sources_pipelines (
project_id integer,
pipeline_id integer,
source_project_id integer,
- source_job_id integer,
+ source_job_id_convert_to_bigint integer,
source_pipeline_id integer,
- source_job_id_convert_to_bigint bigint
+ source_job_id bigint
);
CREATE SEQUENCE ci_sources_pipelines_id_seq
@@ -11584,7 +12748,7 @@ 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 integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
pipeline_id integer,
created_at timestamp without time zone,
@@ -11592,7 +12756,8 @@ CREATE TABLE ci_stages (
name character varying,
status integer,
lock_version integer DEFAULT 0,
- "position" integer
+ "position" integer,
+ id bigint NOT NULL
);
CREATE SEQUENCE ci_stages_id_seq
@@ -11620,38 +12785,6 @@ CREATE SEQUENCE ci_subscriptions_projects_id_seq
ALTER SEQUENCE ci_subscriptions_projects_id_seq OWNED BY ci_subscriptions_projects.id;
-CREATE TABLE ci_test_case_failures (
- id bigint NOT NULL,
- failed_at timestamp with time zone,
- test_case_id bigint NOT NULL,
- build_id bigint NOT NULL
-);
-
-CREATE SEQUENCE ci_test_case_failures_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_test_case_failures_id_seq OWNED BY ci_test_case_failures.id;
-
-CREATE TABLE ci_test_cases (
- id bigint NOT NULL,
- project_id bigint NOT NULL,
- key_hash text NOT NULL,
- CONSTRAINT check_dd3c5d1c15 CHECK ((char_length(key_hash) <= 64))
-);
-
-CREATE SEQUENCE ci_test_cases_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_test_cases_id_seq OWNED BY ci_test_cases.id;
-
CREATE TABLE ci_trigger_requests (
id integer NOT NULL,
trigger_id integer NOT NULL,
@@ -12015,30 +13148,6 @@ CREATE SEQUENCE clusters_applications_elastic_stacks_id_seq
ALTER SEQUENCE clusters_applications_elastic_stacks_id_seq OWNED BY clusters_applications_elastic_stacks.id;
-CREATE TABLE clusters_applications_fluentd (
- id bigint NOT NULL,
- protocol smallint NOT NULL,
- status integer NOT NULL,
- port integer NOT NULL,
- cluster_id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- version character varying(255) NOT NULL,
- host character varying(255) NOT NULL,
- status_reason text,
- waf_log_enabled boolean DEFAULT true NOT NULL,
- cilium_log_enabled boolean DEFAULT true NOT NULL
-);
-
-CREATE SEQUENCE clusters_applications_fluentd_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE clusters_applications_fluentd_id_seq OWNED BY clusters_applications_fluentd.id;
-
CREATE TABLE clusters_applications_helm (
id integer NOT NULL,
cluster_id integer NOT NULL,
@@ -12073,9 +13182,7 @@ CREATE TABLE clusters_applications_ingress (
cluster_ip character varying,
status_reason text,
external_ip character varying,
- external_hostname character varying,
- modsecurity_enabled boolean,
- modsecurity_mode smallint DEFAULT 0 NOT NULL
+ external_hostname character varying
);
CREATE SEQUENCE clusters_applications_ingress_id_seq
@@ -12393,6 +13500,84 @@ CREATE SEQUENCE custom_emoji_id_seq
ALTER SEQUENCE custom_emoji_id_seq OWNED BY custom_emoji.id;
+CREATE TABLE customer_relations_contacts (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ organization_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ state smallint DEFAULT 1 NOT NULL,
+ phone text,
+ first_name text NOT NULL,
+ last_name text NOT NULL,
+ email text,
+ description text,
+ CONSTRAINT check_1195f4c929 CHECK ((char_length(first_name) <= 255)),
+ CONSTRAINT check_40c70da037 CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_cd2d67c484 CHECK ((char_length(last_name) <= 255)),
+ CONSTRAINT check_f4b7f78c89 CHECK ((char_length(phone) <= 32)),
+ CONSTRAINT check_fc0adabf60 CHECK ((char_length(email) <= 255))
+);
+
+CREATE SEQUENCE customer_relations_contacts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE customer_relations_contacts_id_seq OWNED BY customer_relations_contacts.id;
+
+CREATE TABLE customer_relations_organizations (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ state smallint DEFAULT 1 NOT NULL,
+ default_rate numeric(18,2),
+ name text NOT NULL,
+ description text,
+ CONSTRAINT check_2ba9ef1c4c CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_e476b6058e CHECK ((char_length(description) <= 1024))
+);
+
+CREATE SEQUENCE customer_relations_organizations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE customer_relations_organizations_id_seq OWNED BY customer_relations_organizations.id;
+
+CREATE TABLE dast_profile_schedules (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ dast_profile_id bigint NOT NULL,
+ user_id bigint,
+ next_run_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ cron text NOT NULL,
+ cadence jsonb DEFAULT '{}'::jsonb NOT NULL,
+ timezone text NOT NULL,
+ starts_at timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT check_86531ea73f CHECK ((char_length(cron) <= 255)),
+ CONSTRAINT check_be4d1c3af1 CHECK ((char_length(timezone) <= 255))
+);
+
+COMMENT ON TABLE dast_profile_schedules IS '{"owner":"group::dynamic analysis","description":"Scheduling for scans using DAST Profiles"}';
+
+CREATE SEQUENCE dast_profile_schedules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dast_profile_schedules_id_seq OWNED BY dast_profile_schedules.id;
+
CREATE TABLE dast_profiles (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -12440,6 +13625,13 @@ CREATE TABLE dast_scanner_profiles (
CONSTRAINT check_568568fabf CHECK ((char_length(name) <= 255))
);
+CREATE TABLE dast_scanner_profiles_builds (
+ dast_scanner_profile_id bigint NOT NULL,
+ ci_build_id bigint NOT NULL
+);
+
+COMMENT ON TABLE dast_scanner_profiles_builds IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Scanner Profiles and CI Builds"}';
+
CREATE SEQUENCE dast_scanner_profiles_id_seq
START WITH 1
INCREMENT BY 1
@@ -12495,6 +13687,13 @@ CREATE TABLE dast_site_profiles (
CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255))
);
+CREATE TABLE dast_site_profiles_builds (
+ dast_site_profile_id bigint NOT NULL,
+ ci_build_id bigint NOT NULL
+);
+
+COMMENT ON TABLE dast_site_profiles_builds IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Site Profiles and CI Builds"}';
+
CREATE SEQUENCE dast_site_profiles_id_seq
START WITH 1
INCREMENT BY 1
@@ -12578,6 +13777,33 @@ 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,
@@ -12617,6 +13843,14 @@ CREATE SEQUENCE dependency_proxy_group_settings_id_seq
ALTER SEQUENCE dependency_proxy_group_settings_id_seq OWNED BY dependency_proxy_group_settings.id;
+CREATE TABLE dependency_proxy_image_ttl_group_policies (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ group_id bigint NOT NULL,
+ ttl integer DEFAULT 90,
+ enabled boolean DEFAULT false NOT NULL
+);
+
CREATE TABLE dependency_proxy_manifests (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12710,7 +13944,7 @@ CREATE TABLE deployments (
tag boolean NOT NULL,
sha character varying NOT NULL,
user_id integer,
- deployable_id integer,
+ deployable_id_convert_to_bigint integer,
deployable_type character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@@ -12718,7 +13952,7 @@ CREATE TABLE deployments (
finished_at timestamp with time zone,
status smallint NOT NULL,
cluster_id integer,
- deployable_id_convert_to_bigint bigint
+ deployable_id bigint
);
CREATE SEQUENCE deployments_id_seq
@@ -12823,6 +14057,24 @@ CREATE SEQUENCE design_user_mentions_id_seq
ALTER SEQUENCE design_user_mentions_id_seq OWNED BY design_user_mentions.id;
+CREATE TABLE detached_partitions (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ drop_after timestamp with time zone NOT NULL,
+ table_name text NOT NULL,
+ CONSTRAINT check_aecee24ba3 CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE detached_partitions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE detached_partitions_id_seq OWNED BY detached_partitions.id;
+
CREATE TABLE diff_note_positions (
id bigint NOT NULL,
note_id bigint NOT NULL,
@@ -12958,21 +14210,13 @@ CREATE TABLE elastic_reindexing_tasks (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- documents_count integer,
state smallint DEFAULT 0 NOT NULL,
in_progress boolean DEFAULT true NOT NULL,
- index_name_from text,
- index_name_to text,
- elastic_task text,
error_message text,
- documents_count_target integer,
delete_original_index_at timestamp with time zone,
max_slices_running smallint DEFAULT 60 NOT NULL,
slice_multiplier smallint DEFAULT 2 NOT NULL,
- CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)),
- CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)),
- CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)),
- CONSTRAINT check_942e5aae53 CHECK ((char_length(elastic_task) <= 255))
+ CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255))
);
CREATE SEQUENCE elastic_reindexing_tasks_id_seq
@@ -13141,8 +14385,79 @@ CREATE SEQUENCE epics_id_seq
ALTER SEQUENCE epics_id_seq OWNED BY epics.id;
+CREATE TABLE error_tracking_client_keys (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ public_key text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_840b719790 CHECK ((char_length(public_key) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_client_keys_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_client_keys_id_seq OWNED BY error_tracking_client_keys.id;
+
+CREATE TABLE error_tracking_error_events (
+ id bigint NOT NULL,
+ error_id bigint NOT NULL,
+ description text NOT NULL,
+ environment text,
+ level text,
+ occurred_at timestamp with time zone NOT NULL,
+ payload jsonb DEFAULT '{}'::jsonb NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_92ecc3077b CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_c67d5b8007 CHECK ((char_length(level) <= 255)),
+ CONSTRAINT check_f4b52474ad CHECK ((char_length(environment) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_error_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_error_events_id_seq OWNED BY error_tracking_error_events.id;
+
+CREATE TABLE error_tracking_errors (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ name text NOT NULL,
+ description text NOT NULL,
+ actor text NOT NULL,
+ first_seen_at timestamp with time zone DEFAULT now() NOT NULL,
+ last_seen_at timestamp with time zone DEFAULT now() NOT NULL,
+ platform text,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ events_count bigint DEFAULT 0 NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ CONSTRAINT check_18a758e537 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_b5cb4d3888 CHECK ((char_length(actor) <= 255)),
+ CONSTRAINT check_c739788b12 CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_fe99886883 CHECK ((char_length(platform) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_errors_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_errors_id_seq OWNED BY error_tracking_errors.id;
+
CREATE TABLE events (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
author_id integer NOT NULL,
target_id integer,
@@ -13152,7 +14467,7 @@ CREATE TABLE events (
target_type character varying,
group_id bigint,
fingerprint bytea,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ id bigint NOT NULL,
CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128))
);
@@ -13301,6 +14616,41 @@ CREATE SEQUENCE external_pull_requests_id_seq
ALTER SEQUENCE external_pull_requests_id_seq OWNED BY external_pull_requests.id;
+CREATE TABLE external_status_checks (
+ 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,
+ external_url text NOT NULL,
+ name text NOT NULL,
+ CONSTRAINT check_7e3b9eb41a CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_ae0dec3f61 CHECK ((char_length(external_url) <= 255))
+);
+
+CREATE SEQUENCE external_status_checks_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_status_checks_id_seq OWNED BY external_status_checks.id;
+
+CREATE TABLE external_status_checks_protected_branches (
+ id bigint NOT NULL,
+ external_status_check_id bigint NOT NULL,
+ protected_branch_id bigint NOT NULL
+);
+
+CREATE SEQUENCE external_status_checks_protected_branches_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_status_checks_protected_branches_id_seq OWNED BY external_status_checks_protected_branches.id;
+
CREATE TABLE feature_gates (
id integer NOT NULL,
feature_key character varying NOT NULL,
@@ -13484,9 +14834,9 @@ 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 integer NOT NULL,
+ job_artifact_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_path character varying NOT NULL,
- job_artifact_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ job_artifact_id bigint NOT NULL
);
CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq
@@ -14185,9 +15535,12 @@ ALTER SEQUENCE incident_management_escalation_policies_id_seq OWNED BY incident_
CREATE TABLE incident_management_escalation_rules (
id bigint NOT NULL,
policy_id bigint NOT NULL,
- oncall_schedule_id bigint NOT NULL,
+ oncall_schedule_id bigint,
status smallint NOT NULL,
- elapsed_time_seconds integer NOT NULL
+ elapsed_time_seconds integer NOT NULL,
+ is_removed boolean DEFAULT false NOT NULL,
+ user_id bigint,
+ CONSTRAINT escalation_rules_one_of_oncall_schedule_or_user CHECK ((num_nonnulls(oncall_schedule_id, user_id) = 1))
);
CREATE SEQUENCE incident_management_escalation_rules_id_seq
@@ -14199,6 +15552,26 @@ CREATE SEQUENCE incident_management_escalation_rules_id_seq
ALTER SEQUENCE incident_management_escalation_rules_id_seq OWNED BY incident_management_escalation_rules.id;
+CREATE TABLE incident_management_issuable_escalation_statuses (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ issue_id bigint NOT NULL,
+ policy_id bigint,
+ escalations_started_at timestamp with time zone,
+ resolved_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL
+);
+
+CREATE SEQUENCE incident_management_issuable_escalation_statuses_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_issuable_escalation_statuses_id_seq OWNED BY incident_management_issuable_escalation_statuses.id;
+
CREATE TABLE incident_management_oncall_participants (
id bigint NOT NULL,
oncall_rotation_id bigint NOT NULL,
@@ -14319,6 +15692,49 @@ CREATE SEQUENCE insights_id_seq
ALTER SEQUENCE insights_id_seq OWNED BY insights.id;
+CREATE TABLE integrations (
+ id integer NOT NULL,
+ type character varying,
+ project_id integer,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ active boolean DEFAULT false NOT NULL,
+ properties text,
+ template boolean DEFAULT false,
+ push_events boolean DEFAULT true,
+ issues_events boolean DEFAULT true,
+ merge_requests_events boolean DEFAULT true,
+ tag_push_events boolean DEFAULT true,
+ note_events boolean DEFAULT true NOT NULL,
+ category character varying DEFAULT 'common'::character varying NOT NULL,
+ wiki_page_events boolean DEFAULT true,
+ pipeline_events boolean DEFAULT false NOT NULL,
+ confidential_issues_events boolean DEFAULT true NOT NULL,
+ commit_events boolean DEFAULT true NOT NULL,
+ job_events boolean DEFAULT false NOT NULL,
+ confidential_note_events boolean DEFAULT true,
+ deployment_events boolean DEFAULT false NOT NULL,
+ comment_on_event_enabled boolean DEFAULT true NOT NULL,
+ instance boolean DEFAULT false NOT NULL,
+ comment_detail smallint,
+ inherit_from_id bigint,
+ alert_events boolean,
+ group_id bigint,
+ vulnerability_events boolean DEFAULT false NOT NULL,
+ type_new text,
+ CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255))
+);
+
+CREATE SEQUENCE integrations_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE integrations_id_seq OWNED BY integrations.id;
+
CREATE TABLE internal_ids (
id bigint NOT NULL,
project_id integer,
@@ -14390,7 +15806,9 @@ ALTER SEQUENCE issuable_severities_id_seq OWNED BY issuable_severities.id;
CREATE TABLE issuable_slas (
id bigint NOT NULL,
issue_id bigint NOT NULL,
- due_at timestamp with time zone NOT NULL
+ due_at timestamp with time zone NOT NULL,
+ label_applied boolean DEFAULT false NOT NULL,
+ issuable_closed boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE issuable_slas_id_seq
@@ -14538,7 +15956,9 @@ CREATE TABLE issues (
sprint_id bigint,
external_key character varying(255),
blocking_issues_count integer DEFAULT 0 NOT NULL,
- issue_type smallint DEFAULT 0 NOT NULL
+ issue_type smallint DEFAULT 0 NOT NULL,
+ upvotes_count integer DEFAULT 0 NOT NULL,
+ work_item_type_id bigint
);
CREATE SEQUENCE issues_id_seq
@@ -14865,7 +16285,8 @@ CREATE TABLE licenses (
data text NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- cloud boolean DEFAULT false
+ cloud boolean DEFAULT false,
+ last_synced_at timestamp with time zone
);
CREATE SEQUENCE licenses_id_seq
@@ -14939,7 +16360,8 @@ CREATE TABLE members (
requested_at timestamp without time zone,
expires_at date,
ldap boolean DEFAULT false NOT NULL,
- override boolean DEFAULT false NOT NULL
+ override boolean DEFAULT false NOT NULL,
+ invite_email_success boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE members_id_seq
@@ -14991,7 +16413,9 @@ CREATE TABLE merge_request_cleanup_schedules (
scheduled_at timestamp with time zone NOT NULL,
completed_at timestamp with time zone,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
+ updated_at timestamp with time zone NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ failed_count integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE merge_request_cleanup_schedules_merge_request_id_seq
@@ -15469,6 +16893,9 @@ CREATE TABLE namespace_settings (
lock_delayed_project_removal boolean DEFAULT false NOT NULL,
resource_access_token_creation_allowed boolean DEFAULT true NOT NULL,
prevent_sharing_groups_outside_hierarchy boolean DEFAULT false NOT NULL,
+ new_user_signups_cap integer,
+ setup_for_company boolean,
+ jobs_to_be_done smallint,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255))
);
@@ -16130,17 +17557,16 @@ CREATE TABLE packages_debian_group_distributions (
label text,
version text,
description text,
- encrypted_signing_keys text,
- encrypted_signing_keys_iv text,
file text,
file_signature text,
+ signed_file text,
+ signed_file_store smallint DEFAULT 1 NOT NULL,
+ CONSTRAINT check_0007e0bf61 CHECK ((char_length(signed_file) <= 255)),
CONSTRAINT check_310ac457b8 CHECK ((char_length(description) <= 255)),
CONSTRAINT check_3d6f87fc31 CHECK ((char_length(file_signature) <= 4096)),
CONSTRAINT check_3fdadf4a0c CHECK ((char_length(version) <= 255)),
CONSTRAINT check_590e18405a CHECK ((char_length(codename) <= 255)),
- CONSTRAINT check_9b90bc0f07 CHECK ((char_length(encrypted_signing_keys_iv) <= 255)),
CONSTRAINT check_b057cd840a CHECK ((char_length(origin) <= 255)),
- CONSTRAINT check_b811ec1218 CHECK ((char_length(encrypted_signing_keys) <= 2048)),
CONSTRAINT check_be5ed8d307 CHECK ((char_length(file) <= 255)),
CONSTRAINT check_d3244bfc0b CHECK ((char_length(label) <= 255)),
CONSTRAINT check_e7c928a24b CHECK ((char_length(suite) <= 255))
@@ -16256,20 +17682,19 @@ CREATE TABLE packages_debian_project_distributions (
label text,
version text,
description text,
- encrypted_signing_keys text,
- encrypted_signing_keys_iv text,
file text,
file_signature text,
+ signed_file text,
+ signed_file_store smallint DEFAULT 1 NOT NULL,
CONSTRAINT check_6177ccd4a6 CHECK ((char_length(origin) <= 255)),
CONSTRAINT check_6f6b55a4c4 CHECK ((char_length(label) <= 255)),
CONSTRAINT check_834dabadb6 CHECK ((char_length(codename) <= 255)),
CONSTRAINT check_96965792c2 CHECK ((char_length(version) <= 255)),
+ CONSTRAINT check_9e5e22b7ff CHECK ((char_length(signed_file) <= 255)),
CONSTRAINT check_a56ae58a17 CHECK ((char_length(suite) <= 255)),
CONSTRAINT check_a5a2ac6af2 CHECK ((char_length(file_signature) <= 4096)),
CONSTRAINT check_b93154339f CHECK ((char_length(description) <= 255)),
- CONSTRAINT check_c25603a25b CHECK ((char_length(encrypted_signing_keys) <= 2048)),
- CONSTRAINT check_cb4ac9599e CHECK ((char_length(file) <= 255)),
- CONSTRAINT check_d488f8cce3 CHECK ((char_length(encrypted_signing_keys_iv) <= 255))
+ CONSTRAINT check_cb4ac9599e CHECK ((char_length(file) <= 255))
);
CREATE SEQUENCE packages_debian_project_distributions_id_seq
@@ -16740,7 +18165,11 @@ CREATE TABLE plan_limits (
ci_registered_group_runners integer DEFAULT 1000 NOT NULL,
ci_registered_project_runners integer DEFAULT 1000 NOT NULL,
web_hook_calls integer DEFAULT 0 NOT NULL,
- ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL
+ ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL,
+ 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
);
CREATE SEQUENCE plan_limits_id_seq
@@ -16787,6 +18216,39 @@ CREATE SEQUENCE pool_repositories_id_seq
ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id;
+CREATE TABLE postgres_async_indexes (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ definition text NOT NULL,
+ table_name text NOT NULL,
+ CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
+ CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
+ CONSTRAINT check_e64ff4359e CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE postgres_async_indexes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE postgres_async_indexes_id_seq OWNED BY postgres_async_indexes.id;
+
+CREATE VIEW postgres_foreign_keys AS
+ SELECT pg_constraint.oid,
+ pg_constraint.conname AS name,
+ (((constrained_namespace.nspname)::text || '.'::text) || (constrained_table.relname)::text) AS constrained_table_identifier,
+ (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier
+ FROM ((((pg_constraint
+ JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid)))
+ JOIN pg_class referenced_table ON ((referenced_table.oid = pg_constraint.confrelid)))
+ JOIN pg_namespace constrained_namespace ON ((constrained_table.relnamespace = constrained_namespace.oid)))
+ JOIN pg_namespace referenced_namespace ON ((referenced_table.relnamespace = referenced_namespace.oid)))
+ WHERE (pg_constraint.contype = 'f'::"char");
+
CREATE VIEW postgres_index_bloat_estimates AS
SELECT (((relation_stats.nspname)::text || '.'::text) || (relation_stats.idxname)::text) AS identifier,
(
@@ -16900,23 +18362,25 @@ END AS attrelname
ORDER BY relation_stats.nspname, relation_stats.tblname, relation_stats.idxname;
CREATE VIEW postgres_indexes AS
- SELECT (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS identifier,
+ SELECT (((pg_namespace.nspname)::text || '.'::text) || (i.relname)::text) AS identifier,
pg_index.indexrelid,
pg_namespace.nspname AS schema,
- pg_class.relname AS name,
+ i.relname AS name,
pg_indexes.tablename,
+ a.amname AS type,
pg_index.indisunique AS "unique",
pg_index.indisvalid AS valid_index,
- pg_class.relispartition AS partitioned,
+ 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((pg_class.oid)::regclass) AS ondisk_size_bytes
- FROM (((pg_index
- JOIN pg_class ON ((pg_class.oid = pg_index.indexrelid)))
- JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)))
- JOIN pg_indexes ON ((pg_class.relname = pg_indexes.indexname)))
+ 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])));
CREATE VIEW postgres_partitioned_tables AS
@@ -17062,7 +18526,8 @@ CREATE TABLE project_ci_cd_settings (
merge_trains_enabled boolean DEFAULT false,
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
+ restrict_user_defined_variables boolean DEFAULT false NOT NULL,
+ job_token_scope_enabled boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -17075,9 +18540,24 @@ CREATE SEQUENCE project_ci_cd_settings_id_seq
ALTER SEQUENCE project_ci_cd_settings_id_seq OWNED BY project_ci_cd_settings.id;
+CREATE TABLE project_ci_feature_usages (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ feature smallint NOT NULL,
+ default_branch boolean DEFAULT false NOT NULL
+);
+
+CREATE SEQUENCE project_ci_feature_usages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_ci_feature_usages_id_seq OWNED BY project_ci_feature_usages.id;
+
CREATE TABLE project_compliance_framework_settings (
project_id bigint NOT NULL,
- framework smallint,
framework_id bigint,
CONSTRAINT check_d348de9e2d CHECK ((framework_id IS NOT NULL))
);
@@ -17150,7 +18630,8 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token character varying,
encrypted_token_iv character varying,
project_name character varying,
- organization_name character varying
+ organization_name character varying,
+ integrated boolean DEFAULT false NOT NULL
);
CREATE TABLE project_export_jobs (
@@ -17393,7 +18874,9 @@ CREATE TABLE project_settings (
cve_id_request_enabled boolean DEFAULT true NOT NULL,
has_vulnerabilities boolean DEFAULT false NOT NULL,
prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
- mr_default_target_self 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))
);
CREATE TABLE project_statistics (
@@ -17424,6 +18907,23 @@ CREATE SEQUENCE project_statistics_id_seq
ALTER SEQUENCE project_statistics_id_seq OWNED BY project_statistics.id;
+CREATE TABLE project_topics (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ topic_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE project_topics_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_topics_id_seq OWNED BY project_topics.id;
+
CREATE TABLE project_tracing_settings (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -17523,7 +19023,8 @@ CREATE TABLE projects (
marked_for_deletion_by_user_id integer,
remove_source_branch_after_merge boolean,
suggestion_commit_message character varying(255),
- autoclose_referenced_issues boolean
+ autoclose_referenced_issues boolean,
+ project_namespace_id bigint
);
CREATE SEQUENCE projects_id_seq
@@ -17764,7 +19265,7 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id;
CREATE TABLE push_event_payloads (
commit_count bigint NOT NULL,
- event_id integer NOT NULL,
+ event_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
action smallint NOT NULL,
ref_type smallint NOT NULL,
commit_from bytea,
@@ -17772,7 +19273,7 @@ CREATE TABLE push_event_payloads (
ref text,
commit_title character varying(70),
ref_count integer,
- event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ event_id bigint NOT NULL
);
CREATE TABLE push_rules (
@@ -17956,6 +19457,7 @@ CREATE TABLE requirements (
title_html text,
description text,
description_html text,
+ issue_id bigint,
CONSTRAINT check_785ae25b9d CHECK ((char_length(description) <= 10000))
);
@@ -17971,10 +19473,12 @@ ALTER SEQUENCE requirements_id_seq OWNED BY requirements.id;
CREATE TABLE requirements_management_test_reports (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
- requirement_id bigint NOT NULL,
+ requirement_id bigint,
author_id bigint,
state smallint NOT NULL,
- build_id bigint
+ build_id bigint,
+ issue_id bigint,
+ CONSTRAINT requirements_test_reports_requirement_id_xor_issue_id CHECK ((num_nonnulls(requirement_id, issue_id) = 1))
);
CREATE SEQUENCE requirements_management_test_reports_id_seq
@@ -18212,10 +19716,11 @@ CREATE TABLE security_findings (
scanner_id bigint NOT NULL,
severity smallint NOT NULL,
confidence smallint NOT NULL,
- project_fingerprint text NOT NULL,
+ project_fingerprint text,
deduplicated boolean DEFAULT false NOT NULL,
"position" integer,
uuid uuid,
+ overridden_uuid uuid,
CONSTRAINT check_b9508c6df8 CHECK ((char_length(project_fingerprint) <= 40))
);
@@ -18257,6 +19762,7 @@ CREATE TABLE security_orchestration_policy_rule_schedules (
user_id bigint NOT NULL,
policy_index integer NOT NULL,
cron text NOT NULL,
+ rule_index integer DEFAULT 0 NOT NULL,
CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255))
);
@@ -18277,7 +19783,9 @@ CREATE TABLE security_scans (
updated_at timestamp with time zone NOT NULL,
build_id bigint NOT NULL,
scan_type smallint NOT NULL,
- info jsonb DEFAULT '{}'::jsonb NOT NULL
+ info jsonb DEFAULT '{}'::jsonb NOT NULL,
+ project_id bigint,
+ pipeline_id bigint
);
CREATE SEQUENCE security_scans_id_seq
@@ -18365,49 +19873,10 @@ CREATE TABLE service_desk_settings (
project_id bigint NOT NULL,
issue_template_key character varying(255),
outgoing_name character varying(255),
- project_key character varying(255)
+ project_key character varying(255),
+ file_template_project_id bigint
);
-CREATE TABLE services (
- id integer NOT NULL,
- type character varying,
- project_id integer,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
- active boolean DEFAULT false NOT NULL,
- properties text,
- template boolean DEFAULT false,
- push_events boolean DEFAULT true,
- issues_events boolean DEFAULT true,
- merge_requests_events boolean DEFAULT true,
- tag_push_events boolean DEFAULT true,
- note_events boolean DEFAULT true NOT NULL,
- category character varying DEFAULT 'common'::character varying NOT NULL,
- wiki_page_events boolean DEFAULT true,
- pipeline_events boolean DEFAULT false NOT NULL,
- confidential_issues_events boolean DEFAULT true NOT NULL,
- commit_events boolean DEFAULT true NOT NULL,
- job_events boolean DEFAULT false NOT NULL,
- confidential_note_events boolean DEFAULT true,
- deployment_events boolean DEFAULT false NOT NULL,
- comment_on_event_enabled boolean DEFAULT true NOT NULL,
- instance boolean DEFAULT false NOT NULL,
- comment_detail smallint,
- inherit_from_id bigint,
- alert_events boolean,
- group_id bigint
-);
-
-CREATE SEQUENCE services_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE services_id_seq OWNED BY services.id;
-
CREATE TABLE shards (
id integer NOT NULL,
name character varying NOT NULL
@@ -18645,8 +20114,9 @@ ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id;
CREATE TABLE status_check_responses (
id bigint NOT NULL,
merge_request_id bigint NOT NULL,
- external_approval_rule_id bigint NOT NULL,
- sha bytea NOT NULL
+ external_approval_rule_id bigint,
+ sha bytea NOT NULL,
+ external_status_check_id bigint NOT NULL
);
CREATE SEQUENCE status_check_responses_id_seq
@@ -18761,16 +20231,16 @@ CREATE SEQUENCE system_note_metadata_id_seq
ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id;
CREATE TABLE taggings (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
tag_id integer,
- taggable_id integer,
+ taggable_id_convert_to_bigint integer,
taggable_type character varying,
tagger_id integer,
tagger_type character varying,
context character varying,
created_at timestamp without time zone,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- taggable_id_convert_to_bigint bigint
+ id bigint NOT NULL,
+ taggable_id bigint
);
CREATE SEQUENCE taggings_id_seq
@@ -18882,7 +20352,9 @@ CREATE TABLE timelogs (
merge_request_id integer,
spent_at timestamp with time zone,
note_id integer,
- project_id integer
+ project_id integer,
+ summary text,
+ CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255))
);
CREATE SEQUENCE timelogs_id_seq
@@ -18938,6 +20410,23 @@ CREATE SEQUENCE token_with_ivs_id_seq
ALTER SEQUENCE token_with_ivs_id_seq OWNED BY token_with_ivs.id;
+CREATE TABLE topics (
+ id bigint NOT NULL,
+ name text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE topics_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE topics_id_seq OWNED BY topics.id;
+
CREATE TABLE trending_projects (
id integer NOT NULL,
project_id integer NOT NULL
@@ -19106,8 +20595,12 @@ CREATE TABLE user_details (
cached_markdown_version integer,
provisioned_by_group_id bigint,
other_role text,
+ pronouns text,
+ pronunciation text,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
- CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100))
+ 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))
);
CREATE SEQUENCE user_details_user_id_seq
@@ -19124,6 +20617,23 @@ CREATE TABLE user_follow_users (
followee_id integer NOT NULL
);
+CREATE TABLE user_group_callouts (
+ id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ feature_name smallint NOT NULL,
+ dismissed_at timestamp with time zone
+);
+
+CREATE SEQUENCE user_group_callouts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE user_group_callouts_id_seq OWNED BY user_group_callouts.id;
+
CREATE TABLE user_highest_roles (
updated_at timestamp with time zone NOT NULL,
user_id bigint NOT NULL,
@@ -19423,7 +20933,9 @@ CREATE TABLE vulnerabilities (
confirmed_at timestamp with time zone,
dismissed_at timestamp with time zone,
dismissed_by_id bigint,
- resolved_on_default_branch boolean DEFAULT false NOT NULL
+ resolved_on_default_branch boolean DEFAULT false NOT NULL,
+ present_on_default_branch boolean DEFAULT true NOT NULL,
+ detected_at timestamp with time zone DEFAULT now()
);
CREATE SEQUENCE vulnerabilities_id_seq
@@ -19511,6 +21023,28 @@ CREATE SEQUENCE vulnerability_feedback_id_seq
ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id;
+CREATE TABLE vulnerability_finding_evidence_assets (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ type text,
+ name text,
+ url text,
+ CONSTRAINT check_5adf5d69de CHECK ((char_length(type) <= 2048)),
+ CONSTRAINT check_839f29d7ca CHECK ((char_length(name) <= 2048)),
+ CONSTRAINT check_9272d912c0 CHECK ((char_length(url) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_assets_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_assets_id_seq OWNED BY vulnerability_finding_evidence_assets.id;
+
CREATE TABLE vulnerability_finding_evidence_headers (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19536,10 +21070,11 @@ CREATE TABLE vulnerability_finding_evidence_requests (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
+ vulnerability_finding_evidence_id bigint,
method text,
url text,
body text,
+ vulnerability_finding_evidence_supporting_message_id bigint,
CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)),
CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)),
CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32))
@@ -19558,10 +21093,11 @@ CREATE TABLE vulnerability_finding_evidence_responses (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
+ vulnerability_finding_evidence_id bigint,
status_code integer,
reason_phrase text,
body text,
+ vulnerability_finding_evidence_supporting_message_id bigint,
CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)),
CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048))
);
@@ -19575,6 +21111,44 @@ CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq
ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id;
+CREATE TABLE vulnerability_finding_evidence_sources (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ name text,
+ url text,
+ CONSTRAINT check_0fe01298d6 CHECK ((char_length(url) <= 2048)),
+ CONSTRAINT check_86b537ba1a CHECK ((char_length(name) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_sources_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_sources_id_seq OWNED BY vulnerability_finding_evidence_sources.id;
+
+CREATE TABLE vulnerability_finding_evidence_supporting_messages (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ name text,
+ CONSTRAINT check_fa33b9ae85 CHECK ((char_length(name) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq OWNED BY vulnerability_finding_evidence_supporting_messages.id;
+
CREATE TABLE vulnerability_finding_evidences (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19648,6 +21222,27 @@ CREATE SEQUENCE vulnerability_findings_remediations_id_seq
ALTER SEQUENCE vulnerability_findings_remediations_id_seq OWNED BY vulnerability_findings_remediations.id;
+CREATE TABLE vulnerability_flags (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_occurrence_id bigint NOT NULL,
+ flag_type smallint DEFAULT 0 NOT NULL,
+ origin text NOT NULL,
+ description text NOT NULL,
+ CONSTRAINT check_45e743349f CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_49c1d00032 CHECK ((char_length(origin) <= 255))
+);
+
+CREATE SEQUENCE vulnerability_flags_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_flags_id_seq OWNED BY vulnerability_flags.id;
+
CREATE TABLE vulnerability_historical_statistics (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19769,6 +21364,7 @@ CREATE TABLE vulnerability_occurrences (
solution text,
cve text,
location jsonb,
+ detection_method smallint DEFAULT 0 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)),
@@ -19870,22 +21466,6 @@ CREATE SEQUENCE vulnerability_user_mentions_id_seq
ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id;
-CREATE TABLE web_hook_logs_archived (
- id integer 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,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
-);
-
CREATE TABLE web_hooks (
id integer NOT NULL,
project_id integer,
@@ -19991,6 +21571,30 @@ CREATE SEQUENCE wiki_page_slugs_id_seq
ALTER SEQUENCE wiki_page_slugs_id_seq OWNED BY wiki_page_slugs.id;
+CREATE TABLE work_item_types (
+ id bigint NOT NULL,
+ base_type smallint DEFAULT 0 NOT NULL,
+ cached_markdown_version integer,
+ name text NOT NULL,
+ description text,
+ description_html text,
+ icon_name text,
+ namespace_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_104d2410f6 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_fecb3a98d1 CHECK ((char_length(icon_name) <= 255))
+);
+
+CREATE SEQUENCE work_item_types_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE work_item_types_id_seq OWNED BY work_item_types.id;
+
CREATE TABLE x509_certificates (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -20049,6 +21653,30 @@ CREATE SEQUENCE x509_issuers_id_seq
ALTER SEQUENCE x509_issuers_id_seq OWNED BY x509_issuers.id;
+CREATE TABLE zentao_tracker_data (
+ id bigint NOT NULL,
+ integration_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ encrypted_url bytea,
+ encrypted_url_iv bytea,
+ encrypted_api_url bytea,
+ encrypted_api_url_iv bytea,
+ encrypted_zentao_product_xid bytea,
+ encrypted_zentao_product_xid_iv bytea,
+ encrypted_api_token bytea,
+ encrypted_api_token_iv bytea
+);
+
+CREATE SEQUENCE zentao_tracker_data_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE zentao_tracker_data_id_seq OWNED BY zentao_tracker_data.id;
+
CREATE TABLE zoom_meetings (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -20070,6 +21698,8 @@ 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_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_group_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);
@@ -20088,6 +21718,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER COLUMN id SET DE
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_value_streams_id_seq'::regclass);
+ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_stage_event_hashes_id_seq'::regclass);
+
ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass);
ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass);
@@ -20126,6 +21758,8 @@ ALTER TABLE ONLY atlassian_identities ALTER COLUMN user_id SET DEFAULT nextval('
ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_id_seq'::regclass);
+ALTER TABLE ONLY audit_events_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_external_audit_event_destinations_id_seq'::regclass);
+
ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass);
ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass);
@@ -20192,8 +21826,6 @@ ALTER TABLE ONLY ci_build_report_results ALTER COLUMN build_id SET DEFAULT nextv
ALTER TABLE ONLY ci_build_trace_chunks ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_chunks_id_seq'::regclass);
-ALTER TABLE ONLY ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_section_names_id_seq'::regclass);
-
ALTER TABLE ONLY ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass);
ALTER TABLE ONLY ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass);
@@ -20264,10 +21896,6 @@ ALTER TABLE ONLY ci_stages ALTER COLUMN id SET DEFAULT nextval('ci_stages_id_seq
ALTER TABLE ONLY ci_subscriptions_projects ALTER COLUMN id SET DEFAULT nextval('ci_subscriptions_projects_id_seq'::regclass);
-ALTER TABLE ONLY ci_test_case_failures ALTER COLUMN id SET DEFAULT nextval('ci_test_case_failures_id_seq'::regclass);
-
-ALTER TABLE ONLY ci_test_cases ALTER COLUMN id SET DEFAULT nextval('ci_test_cases_id_seq'::regclass);
-
ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_trigger_requests_id_seq'::regclass);
ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass);
@@ -20302,8 +21930,6 @@ ALTER TABLE ONLY clusters_applications_crossplane ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY clusters_applications_elastic_stacks ALTER COLUMN id SET DEFAULT nextval('clusters_applications_elastic_stacks_id_seq'::regclass);
-ALTER TABLE ONLY clusters_applications_fluentd ALTER COLUMN id SET DEFAULT nextval('clusters_applications_fluentd_id_seq'::regclass);
-
ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass);
ALTER TABLE ONLY clusters_applications_ingress ALTER COLUMN id SET DEFAULT nextval('clusters_applications_ingress_id_seq'::regclass);
@@ -20330,6 +21956,12 @@ ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issu
ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass);
+ALTER TABLE ONLY customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('customer_relations_contacts_id_seq'::regclass);
+
+ALTER TABLE ONLY customer_relations_organizations ALTER COLUMN id SET DEFAULT nextval('customer_relations_organizations_id_seq'::regclass);
+
+ALTER TABLE ONLY dast_profile_schedules ALTER COLUMN id SET DEFAULT nextval('dast_profile_schedules_id_seq'::regclass);
+
ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profiles_id_seq'::regclass);
ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass);
@@ -20344,6 +21976,8 @@ 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);
@@ -20366,6 +22000,8 @@ ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval(
ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass);
+ALTER TABLE ONLY detached_partitions ALTER COLUMN id SET DEFAULT nextval('detached_partitions_id_seq'::regclass);
+
ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_note_positions_id_seq'::regclass);
ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass);
@@ -20392,6 +22028,12 @@ ALTER TABLE ONLY epic_user_mentions ALTER COLUMN id SET DEFAULT nextval('epic_us
ALTER TABLE ONLY epics ALTER COLUMN id SET DEFAULT nextval('epics_id_seq'::regclass);
+ALTER TABLE ONLY error_tracking_client_keys ALTER COLUMN id SET DEFAULT nextval('error_tracking_client_keys_id_seq'::regclass);
+
+ALTER TABLE ONLY error_tracking_error_events ALTER COLUMN id SET DEFAULT nextval('error_tracking_error_events_id_seq'::regclass);
+
+ALTER TABLE ONLY error_tracking_errors ALTER COLUMN id SET DEFAULT nextval('error_tracking_errors_id_seq'::regclass);
+
ALTER TABLE ONLY events ALTER COLUMN id SET DEFAULT nextval('events_id_seq'::regclass);
ALTER TABLE ONLY evidences ALTER COLUMN id SET DEFAULT nextval('evidences_id_seq'::regclass);
@@ -20408,6 +22050,10 @@ ALTER TABLE ONLY external_approval_rules_protected_branches ALTER COLUMN id SET
ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass);
+ALTER TABLE ONLY external_status_checks ALTER COLUMN id SET DEFAULT nextval('external_status_checks_id_seq'::regclass);
+
+ALTER TABLE ONLY external_status_checks_protected_branches ALTER COLUMN id SET DEFAULT nextval('external_status_checks_protected_branches_id_seq'::regclass);
+
ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass);
ALTER TABLE ONLY features ALTER COLUMN id SET DEFAULT nextval('features_id_seq'::regclass);
@@ -20492,6 +22138,8 @@ ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEF
ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses ALTER COLUMN id SET DEFAULT nextval('incident_management_issuable_escalation_statuses_id_seq'::regclass);
+
ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass);
ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass);
@@ -20500,10 +22148,16 @@ ALTER TABLE ONLY incident_management_oncall_schedules ALTER COLUMN id SET DEFAUL
ALTER TABLE ONLY incident_management_oncall_shifts ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_shifts_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass);
+
+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 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);
+ALTER TABLE ONLY integrations ALTER COLUMN id SET DEFAULT nextval('integrations_id_seq'::regclass);
+
ALTER TABLE ONLY internal_ids ALTER COLUMN id SET DEFAULT nextval('internal_ids_id_seq'::regclass);
ALTER TABLE ONLY ip_restrictions ALTER COLUMN id SET DEFAULT nextval('ip_restrictions_id_seq'::regclass);
@@ -20700,6 +22354,8 @@ ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regcl
ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass);
+ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('postgres_async_indexes_id_seq'::regclass);
+
ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);
ALTER TABLE ONLY product_analytics_events_experimental ALTER COLUMN id SET DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass);
@@ -20712,6 +22368,8 @@ ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('projec
ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass);
+ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('project_ci_feature_usages_id_seq'::regclass);
+
ALTER TABLE ONLY project_compliance_framework_settings ALTER COLUMN project_id SET DEFAULT nextval('project_compliance_framework_settings_project_id_seq'::regclass);
ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('project_custom_attributes_id_seq'::regclass);
@@ -20740,6 +22398,8 @@ ALTER TABLE ONLY project_security_settings ALTER COLUMN project_id SET DEFAULT n
ALTER TABLE ONLY project_statistics ALTER COLUMN id SET DEFAULT nextval('project_statistics_id_seq'::regclass);
+ALTER TABLE ONLY project_topics ALTER COLUMN id SET DEFAULT nextval('project_topics_id_seq'::regclass);
+
ALTER TABLE ONLY project_tracing_settings ALTER COLUMN id SET DEFAULT nextval('project_tracing_settings_id_seq'::regclass);
ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass);
@@ -20820,8 +22480,6 @@ ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_no
ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass);
-ALTER TABLE ONLY services ALTER COLUMN id SET DEFAULT nextval('services_id_seq'::regclass);
-
ALTER TABLE ONLY shards ALTER COLUMN id SET DEFAULT nextval('shards_id_seq'::regclass);
ALTER TABLE ONLY slack_integrations ALTER COLUMN id SET DEFAULT nextval('slack_integrations_id_seq'::regclass);
@@ -20870,6 +22528,8 @@ ALTER TABLE ONLY todos ALTER COLUMN id SET DEFAULT nextval('todos_id_seq'::regcl
ALTER TABLE ONLY token_with_ivs ALTER COLUMN id SET DEFAULT nextval('token_with_ivs_id_seq'::regclass);
+ALTER TABLE ONLY topics ALTER COLUMN id SET DEFAULT nextval('topics_id_seq'::regclass);
+
ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending_projects_id_seq'::regclass);
ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass);
@@ -20888,6 +22548,8 @@ ALTER TABLE ONLY user_custom_attributes ALTER COLUMN id SET DEFAULT nextval('use
ALTER TABLE ONLY user_details ALTER COLUMN user_id SET DEFAULT nextval('user_details_user_id_seq'::regclass);
+ALTER TABLE ONLY user_group_callouts ALTER COLUMN id SET DEFAULT nextval('user_group_callouts_id_seq'::regclass);
+
ALTER TABLE ONLY user_permission_export_uploads ALTER COLUMN id SET DEFAULT nextval('user_permission_export_uploads_id_seq'::regclass);
ALTER TABLE ONLY user_preferences ALTER COLUMN id SET DEFAULT nextval('user_preferences_id_seq'::regclass);
@@ -20912,12 +22574,18 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT
ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_finding_evidence_assets ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_assets_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_finding_evidence_sources ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_sources_id_seq'::regclass);
+
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_supporting_messages_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass);
@@ -20926,6 +22594,8 @@ ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_flags ALTER COLUMN id SET DEFAULT nextval('vulnerability_flags_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_identifiers_id_seq'::regclass);
@@ -20956,12 +22626,16 @@ ALTER TABLE ONLY wiki_page_meta ALTER COLUMN id SET DEFAULT nextval('wiki_page_m
ALTER TABLE ONLY wiki_page_slugs ALTER COLUMN id SET DEFAULT nextval('wiki_page_slugs_id_seq'::regclass);
+ALTER TABLE ONLY work_item_types ALTER COLUMN id SET DEFAULT nextval('work_item_types_id_seq'::regclass);
+
ALTER TABLE ONLY x509_certificates ALTER COLUMN id SET DEFAULT nextval('x509_certificates_id_seq'::regclass);
ALTER TABLE ONLY x509_commit_signatures ALTER COLUMN id SET DEFAULT nextval('x509_commit_signatures_id_seq'::regclass);
ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_id_seq'::regclass);
+ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass);
+
ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass);
ALTER TABLE ONLY audit_events
@@ -20991,6 +22665,90 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306
ADD CONSTRAINT audit_events_202306_pkey PRIMARY KEY (id, created_at);
+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.incident_management_pending_alert_escalations_202211
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202211_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202212_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202301_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202302_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202303_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202304_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202305_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202306_pkey PRIMARY KEY (id, process_at);
+
+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_issue_escalations_202211
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202211_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202212_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202301_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202302_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202303_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202304_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202305_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202306_pkey PRIMARY KEY (id, process_at);
+
+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.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.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 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.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.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.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 web_hook_logs
ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at);
@@ -21018,6 +22776,207 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305
ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306
ADD CONSTRAINT web_hook_logs_202306_pkey PRIMARY KEY (id, created_at);
+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 analytics_cycle_analytics_issue_stage_events
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+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 product_analytics_events_experimental
ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id);
@@ -21216,6 +23175,9 @@ 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_group_authorizations
+ ADD CONSTRAINT agent_group_authorizations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY alert_management_alert_assignees
ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);
@@ -21243,6 +23205,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams
ADD CONSTRAINT analytics_cycle_analytics_project_value_streams_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes
+ ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY analytics_devops_adoption_segments
ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id);
@@ -21303,6 +23268,9 @@ ALTER TABLE ONLY approvers
ALTER TABLE ONLY atlassian_identities
ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id);
+ALTER TABLE ONLY audit_events_external_audit_event_destinations
+ ADD CONSTRAINT audit_events_external_audit_event_destinations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY authentication_events
ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id);
@@ -21318,6 +23286,9 @@ ALTER TABLE ONLY background_migration_jobs
ALTER TABLE ONLY badges
ADD CONSTRAINT badges_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY banned_users
+ ADD CONSTRAINT banned_users_pkey PRIMARY KEY (user_id);
+
ALTER TABLE ONLY batched_background_migration_jobs
ADD CONSTRAINT batched_background_migration_jobs_pkey PRIMARY KEY (id);
@@ -21417,10 +23388,10 @@ ALTER TABLE ONLY ci_build_report_results
ALTER TABLE ONLY ci_build_trace_chunks
ADD CONSTRAINT ci_build_trace_chunks_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY ci_build_trace_section_names
- ADD CONSTRAINT ci_build_trace_section_names_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT ci_build_trace_metadata_pkey PRIMARY KEY (build_id);
-ALTER TABLE ONLY ci_build_trace_sections
+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
@@ -21528,12 +23499,6 @@ ALTER TABLE ONLY ci_stages
ALTER TABLE ONLY ci_subscriptions_projects
ADD CONSTRAINT ci_subscriptions_projects_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY ci_test_case_failures
- ADD CONSTRAINT ci_test_case_failures_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY ci_test_cases
- ADD CONSTRAINT ci_test_cases_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY ci_trigger_requests
ADD CONSTRAINT ci_trigger_requests_pkey PRIMARY KEY (id);
@@ -21582,9 +23547,6 @@ ALTER TABLE ONLY clusters_applications_crossplane
ALTER TABLE ONLY clusters_applications_elastic_stacks
ADD CONSTRAINT clusters_applications_elastic_stacks_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY clusters_applications_fluentd
- ADD CONSTRAINT clusters_applications_fluentd_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY clusters_applications_helm
ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id);
@@ -21636,18 +23598,33 @@ ALTER TABLE ONLY csv_issue_imports
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY customer_relations_contacts
+ ADD CONSTRAINT customer_relations_contacts_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY customer_relations_organizations
+ ADD CONSTRAINT customer_relations_organizations_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT dast_profile_schedules_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY dast_profiles_pipelines
ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id);
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT dast_scanner_profiles_builds_pkey PRIMARY KEY (dast_scanner_profile_id, ci_build_id);
+
ALTER TABLE ONLY dast_scanner_profiles
ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id);
ALTER TABLE ONLY dast_site_profile_secret_variables
ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT dast_site_profiles_builds_pkey PRIMARY KEY (dast_site_profile_id, ci_build_id);
+
ALTER TABLE ONLY dast_site_profiles_pipelines
ADD CONSTRAINT dast_site_profiles_pipelines_pkey PRIMARY KEY (dast_site_profile_id, ci_pipeline_id);
@@ -21663,12 +23640,18 @@ 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);
ALTER TABLE ONLY dependency_proxy_group_settings
ADD CONSTRAINT dependency_proxy_group_settings_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies
+ ADD CONSTRAINT dependency_proxy_image_ttl_group_policies_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY dependency_proxy_manifests
ADD CONSTRAINT dependency_proxy_manifests_pkey PRIMARY KEY (id);
@@ -21702,6 +23685,9 @@ ALTER TABLE ONLY design_management_versions
ALTER TABLE ONLY design_user_mentions
ADD CONSTRAINT design_user_mentions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY detached_partitions
+ ADD CONSTRAINT detached_partitions_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id);
@@ -21747,6 +23733,15 @@ ALTER TABLE ONLY epic_user_mentions
ALTER TABLE ONLY epics
ADD CONSTRAINT epics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY error_tracking_client_keys
+ ADD CONSTRAINT error_tracking_client_keys_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY error_tracking_error_events
+ ADD CONSTRAINT error_tracking_error_events_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY error_tracking_errors
+ ADD CONSTRAINT error_tracking_errors_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY events
ADD CONSTRAINT events_pkey PRIMARY KEY (id);
@@ -21771,6 +23766,12 @@ ALTER TABLE ONLY external_approval_rules_protected_branches
ALTER TABLE ONLY external_pull_requests
ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY external_status_checks
+ ADD CONSTRAINT external_status_checks_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT external_status_checks_protected_branches_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY feature_gates
ADD CONSTRAINT feature_gates_pkey PRIMARY KEY (id);
@@ -21909,6 +23910,9 @@ ALTER TABLE ONLY incident_management_escalation_policies
ALTER TABLE ONLY incident_management_escalation_rules
ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT incident_management_issuable_escalation_statuses_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY incident_management_oncall_participants
ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id);
@@ -21927,6 +23931,9 @@ ALTER TABLE ONLY index_statuses
ALTER TABLE ONLY insights
ADD CONSTRAINT insights_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY integrations
+ ADD CONSTRAINT integrations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY internal_ids
ADD CONSTRAINT internal_ids_pkey PRIMARY KEY (id);
@@ -22278,6 +24285,9 @@ ALTER TABLE ONLY plans
ALTER TABLE ONLY pool_repositories
ADD CONSTRAINT pool_repositories_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY postgres_async_indexes
+ ADD CONSTRAINT postgres_async_indexes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY postgres_reindex_actions
ADD CONSTRAINT postgres_reindex_actions_pkey PRIMARY KEY (id);
@@ -22302,6 +24312,9 @@ ALTER TABLE ONLY project_auto_devops
ALTER TABLE ONLY project_ci_cd_settings
ADD CONSTRAINT project_ci_cd_settings_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_ci_feature_usages
+ ADD CONSTRAINT project_ci_feature_usages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT project_compliance_framework_settings_pkey PRIMARY KEY (project_id);
@@ -22362,6 +24375,9 @@ ALTER TABLE ONLY project_settings
ALTER TABLE ONLY project_statistics
ADD CONSTRAINT project_statistics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT project_topics_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_tracing_settings
ADD CONSTRAINT project_tracing_settings_pkey PRIMARY KEY (id);
@@ -22494,9 +24510,6 @@ ALTER TABLE ONLY serverless_domain_cluster
ALTER TABLE ONLY service_desk_settings
ADD CONSTRAINT service_desk_settings_pkey PRIMARY KEY (project_id);
-ALTER TABLE ONLY services
- ADD CONSTRAINT services_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY shards
ADD CONSTRAINT shards_pkey PRIMARY KEY (id);
@@ -22575,6 +24588,9 @@ ALTER TABLE ONLY todos
ALTER TABLE ONLY token_with_ivs
ADD CONSTRAINT token_with_ivs_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY topics
+ ADD CONSTRAINT topics_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY trending_projects
ADD CONSTRAINT trending_projects_pkey PRIMARY KEY (id);
@@ -22608,6 +24624,9 @@ ALTER TABLE ONLY user_details
ALTER TABLE ONLY user_follow_users
ADD CONSTRAINT user_follow_users_pkey PRIMARY KEY (follower_id, followee_id);
+ALTER TABLE ONLY user_group_callouts
+ ADD CONSTRAINT user_group_callouts_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY user_highest_roles
ADD CONSTRAINT user_highest_roles_pkey PRIMARY KEY (user_id);
@@ -22653,6 +24672,9 @@ ALTER TABLE ONLY vulnerability_external_issue_links
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_finding_evidence_assets
+ ADD CONSTRAINT vulnerability_finding_evidence_assets_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_finding_evidence_headers
ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id);
@@ -22662,6 +24684,12 @@ ALTER TABLE ONLY vulnerability_finding_evidence_requests
ALTER TABLE ONLY vulnerability_finding_evidence_responses
ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_finding_evidence_sources
+ ADD CONSTRAINT vulnerability_finding_evidence_sources_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
+ ADD CONSTRAINT vulnerability_finding_evidence_supporting_messages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id);
@@ -22674,6 +24702,9 @@ ALTER TABLE ONLY vulnerability_finding_signatures
ALTER TABLE ONLY vulnerability_findings_remediations
ADD CONSTRAINT vulnerability_findings_remediations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_flags
+ ADD CONSTRAINT vulnerability_flags_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_historical_statistics
ADD CONSTRAINT vulnerability_historical_statistics_pkey PRIMARY KEY (id);
@@ -22704,9 +24735,6 @@ ALTER TABLE ONLY vulnerability_statistics
ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT vulnerability_user_mentions_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY web_hook_logs_archived
- ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY web_hooks
ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id);
@@ -22719,6 +24747,9 @@ ALTER TABLE ONLY wiki_page_meta
ALTER TABLE ONLY wiki_page_slugs
ADD CONSTRAINT wiki_page_slugs_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY work_item_types
+ ADD CONSTRAINT work_item_types_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY x509_certificates
ADD CONSTRAINT x509_certificates_pkey PRIMARY KEY (id);
@@ -22728,6 +24759,9 @@ ALTER TABLE ONLY x509_commit_signatures
ALTER TABLE ONLY x509_issuers
ADD CONSTRAINT x509_issuers_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY zentao_tracker_data
+ ADD CONSTRAINT zentao_tracker_data_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY zoom_meetings
ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id);
@@ -22767,6 +24801,110 @@ CREATE INDEX audit_events_202306_created_at_author_id_idx ON gitlab_partitions_d
CREATE INDEX audit_events_202306_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
+CREATE INDEX audit_events_202307_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202307 USING btree (created_at, author_id);
+
+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 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 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_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 incident_management_pending_alert_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_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);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 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);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (alert_id);
+
+CREATE INDEX 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_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_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 incident_management_pending_issue_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_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);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 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);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 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);
@@ -22803,6 +24941,10 @@ CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partition
CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id);
+CREATE INDEX web_hook_logs_202307_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202307 USING btree (created_at, web_hook_id);
+
+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 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);
@@ -22947,30 +25089,46 @@ CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_r
CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation);
+CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING btree (automatic, duration_in_weeks, date((COALESCE(last_run_date, '1970-01-01'::date) + ((duration_in_weeks)::double precision * '7 days'::interval)))) WHERE (duration_in_weeks IS NOT NULL);
+
CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true);
-CREATE INDEX commit_id_and_note_id_index ON commit_user_mentions USING btree (commit_id, note_id);
+CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index ON commit_user_mentions USING btree (commit_id, note_id);
CREATE INDEX composer_cache_files_index_on_deleted_at ON packages_composer_cache_files USING btree (delete_at, id);
+CREATE UNIQUE INDEX dast_scanner_profiles_builds_on_ci_build_id ON dast_scanner_profiles_builds USING btree (ci_build_id);
+
+CREATE UNIQUE INDEX dast_site_profiles_builds_on_ci_build_id ON dast_site_profiles_builds USING btree (ci_build_id);
+
CREATE UNIQUE INDEX design_management_designs_versions_uniqueness ON design_management_designs_versions USING btree (design_id, version_id);
-CREATE INDEX design_user_mentions_on_design_id_and_note_id_index ON design_user_mentions USING btree (design_id, note_id);
+CREATE UNIQUE INDEX design_user_mentions_on_design_id_and_note_id_unique_index ON design_user_mentions USING btree (design_id, note_id);
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user_mentions USING btree (epic_id, note_id);
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL);
+CREATE INDEX finding_evidence_assets_on_finding_evidence_id ON vulnerability_finding_evidence_assets USING btree (vulnerability_finding_evidence_id);
+
CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id);
CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id);
CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id);
+CREATE INDEX finding_evidence_requests_on_supporting_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_supporting_message_id);
+
CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id);
+CREATE INDEX finding_evidence_responses_on_supporting_evidence_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_supporting_message_id);
+
+CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_finding_evidence_sources USING btree (vulnerability_finding_evidence_id);
+
+CREATE 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 INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
@@ -22979,6 +25137,8 @@ CREATE UNIQUE INDEX i_ci_job_token_project_scope_links_on_source_and_target_proj
CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id);
+CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time) WHERE (recorded_at >= end_time);
+
CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id);
CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1);
@@ -22987,7 +25147,7 @@ CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_e
CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON container_expiration_policies USING btree (project_id, next_run_at, enabled);
-CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, expiration_policy_started_at);
+CREATE INDEX idx_container_repos_on_exp_cleanup_status_project_id_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, project_id, expiration_policy_started_at);
CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace);
@@ -23005,6 +25165,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_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);
CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issues USING btree (project_id, created_at, id, state_id);
@@ -23051,6 +25213,10 @@ CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON ex
CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_name ON external_approval_rules USING btree (project_id, name);
+CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_external_url ON external_status_checks USING btree (project_id, external_url);
+
+CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_name ON external_status_checks USING btree (project_id, name);
+
CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id);
CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id);
@@ -23101,6 +25267,8 @@ CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON v
CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha);
+CREATE INDEX idx_vulnerabilities_partial_devops_adoption ON vulnerabilities USING btree (project_id, created_at) WHERE (state <> 1);
+
CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue ON vulnerability_external_issue_links USING btree (vulnerability_id, external_type, external_project_key, external_issue_key);
CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_link_type ON vulnerability_external_issue_links USING btree (vulnerability_id, link_type) WHERE (link_type = 1);
@@ -23111,6 +25279,10 @@ 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 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 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);
@@ -23253,12 +25425,12 @@ CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id);
CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id);
+CREATE UNIQUE INDEX index_batched_background_migrations_on_unique_configuration ON batched_background_migrations USING btree (job_class_name, table_name, column_name, job_arguments);
+
CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id);
CREATE INDEX index_batched_jobs_on_batched_migration_id_and_status ON batched_background_migration_jobs USING btree (batched_background_migration_id, status);
-CREATE INDEX index_batched_migrations_on_job_table_and_column_name ON batched_background_migrations USING btree (job_class_name, table_name, column_name);
-
CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id);
CREATE UNIQUE INDEX index_board_assignees_on_board_id_and_assignee_id ON board_assignees USING btree (board_id, assignee_id);
@@ -23325,6 +25497,8 @@ CREATE INDEX index_boards_epic_user_preferences_on_user_id ON boards_epic_user_p
CREATE INDEX index_boards_on_group_id ON boards USING btree (group_id);
+CREATE INDEX index_boards_on_iteration_cadence_id ON boards USING btree (iteration_cadence_id);
+
CREATE INDEX index_boards_on_iteration_id ON boards USING btree (iteration_id);
CREATE INDEX index_boards_on_milestone_id ON boards USING btree (milestone_id);
@@ -23335,7 +25509,7 @@ CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON bro
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 ON bulk_import_entities 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);
CREATE INDEX index_bulk_import_entities_on_namespace_id ON bulk_import_entities USING btree (namespace_id);
@@ -23365,11 +25539,7 @@ CREATE INDEX index_ci_build_report_results_on_project_id ON ci_build_report_resu
CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON ci_build_trace_chunks USING btree (build_id, chunk_index);
-CREATE UNIQUE INDEX index_ci_build_trace_section_names_on_project_id_and_name ON ci_build_trace_section_names USING btree (project_id, name);
-
-CREATE INDEX index_ci_build_trace_sections_on_project_id ON ci_build_trace_sections USING btree (project_id);
-
-CREATE INDEX index_ci_build_trace_sections_on_section_name_id ON ci_build_trace_sections USING btree (section_name_id);
+CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id);
CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id ON ci_builds_metadata USING btree (build_id);
@@ -23397,8 +25567,6 @@ CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING b
CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_builds USING btree (project_id) WHERE (((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text));
-CREATE INDEX index_ci_builds_on_protected ON ci_builds USING btree (protected);
-
CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at);
CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC);
@@ -23407,10 +25575,10 @@ CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id);
CREATE INDEX index_ci_builds_on_status_and_type_and_runner_id ON ci_builds USING btree (status, type, runner_id);
-CREATE UNIQUE INDEX index_ci_builds_on_token ON ci_builds USING btree (token);
-
CREATE UNIQUE INDEX index_ci_builds_on_token_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted IS NOT NULL);
+CREATE UNIQUE INDEX index_ci_builds_on_token_partial ON ci_builds USING btree (token) WHERE (token IS NOT NULL);
+
CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at);
CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);
@@ -23449,6 +25617,8 @@ CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts
CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store);
+CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23]));
+
CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type);
CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id);
@@ -23467,10 +25637,16 @@ CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON c
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);
+
CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USING btree (build_id);
+CREATE INDEX index_ci_pending_builds_on_namespace_id ON ci_pending_builds USING btree (namespace_id);
+
CREATE INDEX index_ci_pending_builds_on_project_id ON ci_pending_builds USING btree (project_id);
+CREATE INDEX index_ci_pending_builds_on_tag_ids ON ci_pending_builds USING btree (tag_ids) WHERE (cardinality(tag_ids) > 0);
+
CREATE INDEX index_ci_pipeline_artifacts_failed_verification ON ci_pipeline_artifacts USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
CREATE INDEX index_ci_pipeline_artifacts_needs_verification ON ci_pipeline_artifacts USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
@@ -23617,10 +25793,6 @@ CREATE INDEX index_ci_subscriptions_projects_on_upstream_project_id ON ci_subscr
CREATE UNIQUE INDEX index_ci_subscriptions_projects_unique_subscription ON ci_subscriptions_projects USING btree (downstream_project_id, upstream_project_id);
-CREATE INDEX index_ci_test_case_failures_on_build_id ON ci_test_case_failures USING btree (build_id);
-
-CREATE UNIQUE INDEX index_ci_test_cases_on_project_id_and_key_hash ON ci_test_cases USING btree (project_id, key_hash);
-
CREATE INDEX index_ci_trigger_requests_on_commit_id ON ci_trigger_requests USING btree (commit_id);
CREATE INDEX index_ci_trigger_requests_on_trigger_id_and_id ON ci_trigger_requests USING btree (trigger_id, id DESC);
@@ -23673,14 +25845,10 @@ CREATE UNIQUE INDEX index_clusters_applications_crossplane_on_cluster_id ON clus
CREATE UNIQUE INDEX index_clusters_applications_elastic_stacks_on_cluster_id ON clusters_applications_elastic_stacks USING btree (cluster_id);
-CREATE UNIQUE INDEX index_clusters_applications_fluentd_on_cluster_id ON clusters_applications_fluentd USING btree (cluster_id);
-
CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id);
CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON clusters_applications_ingress USING btree (cluster_id);
-CREATE INDEX index_clusters_applications_ingress_on_modsecurity ON clusters_applications_ingress USING btree (modsecurity_enabled, modsecurity_mode, cluster_id);
-
CREATE UNIQUE INDEX index_clusters_applications_jupyter_on_cluster_id ON clusters_applications_jupyter USING btree (cluster_id);
CREATE INDEX index_clusters_applications_jupyter_on_oauth_application_id ON clusters_applications_jupyter USING btree (oauth_application_id);
@@ -23711,6 +25879,8 @@ CREATE INDEX index_clusters_on_user_id ON clusters USING btree (user_id);
CREATE UNIQUE INDEX index_commit_user_mentions_on_note_id ON commit_user_mentions USING btree (note_id);
+CREATE INDEX index_compliance_frameworks_id_where_frameworks_not_null ON compliance_management_frameworks USING btree (id) WHERE (pipeline_configuration_full_path IS NOT NULL);
+
CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_composer_cache_files USING btree (id) WHERE (namespace_id IS NULL);
CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled);
@@ -23733,8 +25903,24 @@ CREATE INDEX index_custom_emoji_on_creator_id ON custom_emoji USING btree (creat
CREATE UNIQUE INDEX index_custom_emoji_on_namespace_id_and_name ON custom_emoji USING btree (namespace_id, name);
+CREATE INDEX index_customer_relations_contacts_on_group_id ON customer_relations_contacts USING btree (group_id);
+
+CREATE INDEX index_customer_relations_contacts_on_organization_id ON customer_relations_contacts USING btree (organization_id);
+
+CREATE UNIQUE INDEX index_customer_relations_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name));
+
+CREATE UNIQUE INDEX index_cycle_analytics_stage_event_hashes_on_hash_sha_256 ON analytics_cycle_analytics_stage_event_hashes USING btree (hash_sha256);
+
CREATE UNIQUE INDEX index_daily_build_group_report_results_unique_columns ON ci_daily_build_group_report_results USING btree (project_id, ref_path, date, group_name);
+CREATE INDEX index_dast_profile_schedules_active_next_run_at ON dast_profile_schedules USING btree (active, next_run_at);
+
+CREATE UNIQUE INDEX index_dast_profile_schedules_on_dast_profile_id ON dast_profile_schedules USING btree (dast_profile_id);
+
+CREATE INDEX index_dast_profile_schedules_on_project_id ON dast_profile_schedules USING btree (project_id);
+
+CREATE INDEX index_dast_profile_schedules_on_user_id ON dast_profile_schedules USING btree (user_id);
+
CREATE INDEX index_dast_profiles_on_dast_scanner_profile_id ON dast_profiles USING btree (dast_scanner_profile_id);
CREATE INDEX index_dast_profiles_on_dast_site_profile_id ON dast_profiles USING btree (dast_site_profile_id);
@@ -23751,6 +25937,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_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);
CREATE INDEX index_dast_site_validations_on_dast_site_token_id ON dast_site_validations USING btree (dast_site_token_id);
@@ -23761,6 +25949,12 @@ 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 INDEX index_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_trace_sections USING btree (project_id);
+
+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_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name);
CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id);
@@ -23889,6 +26083,8 @@ CREATE INDEX index_environments_on_project_id_and_tier ON environments USING btr
CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type);
+CREATE INDEX index_environments_on_state_and_auto_delete_at ON environments USING btree (auto_delete_at) WHERE ((auto_delete_at IS NOT NULL) AND ((state)::text = 'stopped'::text));
+
CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text));
CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id);
@@ -23939,6 +26135,28 @@ CREATE INDEX index_epics_on_start_date_sourcing_epic_id ON epics USING btree (st
CREATE INDEX index_epics_on_start_date_sourcing_milestone_id ON epics USING btree (start_date_sourcing_milestone_id);
+CREATE INDEX index_error_tracking_client_keys_on_project_id ON error_tracking_client_keys USING btree (project_id);
+
+CREATE INDEX index_error_tracking_error_events_on_error_id ON error_tracking_error_events USING btree (error_id);
+
+CREATE INDEX index_error_tracking_errors_on_project_id ON error_tracking_errors USING btree (project_id);
+
+CREATE INDEX index_esc_protected_branches_on_external_status_check_id ON external_status_checks_protected_branches USING btree (external_status_check_id);
+
+CREATE INDEX index_esc_protected_branches_on_protected_branch_id ON external_status_checks_protected_branches USING btree (protected_branch_id);
+
+CREATE UNIQUE INDEX index_escalation_rules_on_all_attributes ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds, user_id);
+
+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_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_and_id ON error_tracking_errors USING btree (project_id, status, id);
+
+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_events_on_action ON events USING btree (action);
CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at);
@@ -23977,6 +26195,8 @@ CREATE UNIQUE INDEX index_experiments_on_name ON experiments USING btree (name);
CREATE INDEX index_expired_and_not_notified_personal_access_tokens ON personal_access_tokens USING btree (id, expires_at) WHERE ((impersonation = false) AND (revoked = false) AND (expire_notification_delivered = false));
+CREATE UNIQUE INDEX index_external_audit_event_destinations_on_namespace_id ON audit_events_external_audit_event_destinations USING btree (namespace_id, destination_url);
+
CREATE UNIQUE INDEX index_external_pull_requests_on_project_and_branches ON external_pull_requests USING btree (project_id, source_branch, target_branch);
CREATE UNIQUE INDEX index_feature_flag_scopes_on_flag_id_and_environment_scope ON operations_feature_flag_scopes USING btree (feature_flag_id, environment_scope);
@@ -24133,16 +26353,24 @@ CREATE INDEX index_group_repository_storage_moves_on_group_id ON group_repositor
CREATE UNIQUE INDEX index_group_stages_on_group_id_group_value_stream_id_and_name ON analytics_cycle_analytics_group_stages USING btree (group_id, group_value_stream_id, name);
+CREATE INDEX index_group_stages_on_stage_event_hash_id ON analytics_cycle_analytics_group_stages USING btree (stage_event_hash_id);
+
+CREATE UNIQUE INDEX index_group_user_callouts_feature ON user_group_callouts USING btree (user_id, feature_name, group_id);
+
CREATE UNIQUE INDEX index_group_wiki_repositories_on_disk_path ON group_wiki_repositories USING btree (disk_path);
CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositories USING btree (shard_id);
+CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at);
+
CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active;
CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (saml_provider_id) WHERE (saml_provider_id IS NOT NULL);
CREATE INDEX index_identities_on_user_id ON identities USING btree (user_id);
+CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_management_issuable_escalation_statuses USING btree (policy_id);
+
CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid);
CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL);
@@ -24185,6 +26413,24 @@ CREATE INDEX index_insights_on_namespace_id ON insights USING btree (namespace_i
CREATE INDEX index_insights_on_project_id ON insights USING btree (project_id);
+CREATE INDEX index_integrations_on_inherit_from_id ON integrations USING btree (inherit_from_id);
+
+CREATE INDEX index_integrations_on_project_and_type_where_inherit_null ON integrations USING btree (project_id, type) WHERE (inherit_from_id IS NULL);
+
+CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_unique ON integrations USING btree (project_id, type);
+
+CREATE INDEX index_integrations_on_template ON integrations USING btree (template);
+
+CREATE INDEX index_integrations_on_type ON integrations USING btree (type);
+
+CREATE UNIQUE INDEX index_integrations_on_type_and_instance_partial ON integrations USING btree (type, instance) WHERE (instance = true);
+
+CREATE UNIQUE INDEX index_integrations_on_type_and_template_partial ON integrations USING btree (type, template) WHERE (template = true);
+
+CREATE INDEX index_integrations_on_type_id_when_active_and_project_id_not_nu ON integrations USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
+
+CREATE UNIQUE INDEX index_integrations_on_unique_group_id_and_type ON integrations USING btree (group_id, type);
+
CREATE INDEX index_internal_ids_on_namespace_id ON internal_ids USING btree (namespace_id);
CREATE INDEX index_internal_ids_on_project_id ON internal_ids USING btree (project_id);
@@ -24199,6 +26445,8 @@ CREATE INDEX index_issuable_metric_images_on_issue_id ON issuable_metric_images
CREATE UNIQUE INDEX index_issuable_severities_on_issue_id ON issuable_severities USING btree (issue_id);
+CREATE INDEX index_issuable_slas_on_due_at_id_label_applied_issuable_closed ON issuable_slas USING btree (due_at, id) WHERE ((label_applied = false) AND (issuable_closed = false));
+
CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree (issue_id);
CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id);
@@ -24249,6 +26497,10 @@ CREATE UNIQUE INDEX index_issues_on_project_id_and_external_key ON issues USING
CREATE UNIQUE INDEX index_issues_on_project_id_and_iid ON issues USING btree (project_id, iid);
+CREATE INDEX index_issues_on_project_id_and_state_id_and_created_at_and_id ON issues USING btree (project_id, state_id, created_at, id);
+
+CREATE INDEX index_issues_on_project_id_and_upvotes_count ON issues USING btree (project_id, upvotes_count);
+
CREATE INDEX index_issues_on_promoted_to_epic_id ON issues USING btree (promoted_to_epic_id) WHERE (promoted_to_epic_id IS NOT NULL);
CREATE INDEX index_issues_on_sprint_id ON issues USING btree (sprint_id);
@@ -24259,6 +26511,8 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at);
CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL);
+CREATE INDEX index_issues_on_work_item_type_id ON issues USING btree (work_item_type_id);
+
CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id);
CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key);
@@ -24275,6 +26529,8 @@ CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING bt
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_keys_on_expires_at_and_id ON keys USING btree (date(timezone('UTC'::text, expires_at)), id) WHERE (expiry_notification_delivered_at IS NULL);
+
CREATE UNIQUE INDEX index_keys_on_fingerprint ON keys USING btree (fingerprint);
CREATE INDEX index_keys_on_fingerprint_sha256 ON keys USING btree (fingerprint_sha256);
@@ -24369,6 +26625,8 @@ CREATE INDEX index_merge_request_blocks_on_blocked_merge_request_id ON merge_req
CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON merge_request_cleanup_schedules USING btree (merge_request_id);
+CREATE INDEX index_merge_request_cleanup_schedules_on_status ON merge_request_cleanup_schedules USING btree (status);
+
CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id);
CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email);
@@ -24459,6 +26717,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON
CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true));
+CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON merge_requests USING btree (target_project_id, updated_at, id);
+
CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title);
@@ -24485,6 +26745,8 @@ CREATE INDEX index_metrics_users_starred_dashboards_on_project_id ON metrics_use
CREATE INDEX index_migration_jobs_on_migration_id_and_finished_at ON batched_background_migration_jobs USING btree (batched_background_migration_id, finished_at);
+CREATE INDEX index_migration_jobs_on_migration_id_and_max_value ON batched_background_migration_jobs USING btree (batched_background_migration_id, max_value);
+
CREATE INDEX index_milestone_releases_on_release_id ON milestone_releases USING btree (release_id);
CREATE INDEX index_milestones_on_description_trigram ON milestones USING gin (description gin_trgm_ops);
@@ -24503,7 +26765,7 @@ CREATE INDEX index_mirror_data_non_scheduled_or_started ON project_mirror_data U
CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id);
-CREATE INDEX index_mr_cleanup_schedules_timestamps ON merge_request_cleanup_schedules USING btree (scheduled_at) WHERE (completed_at IS NULL);
+CREATE INDEX index_mr_cleanup_schedules_timestamps_status ON merge_request_cleanup_schedules USING btree (scheduled_at) WHERE ((completed_at IS NULL) AND (status = 0));
CREATE UNIQUE INDEX index_mr_context_commits_on_merge_request_id_and_sha ON merge_request_context_commits USING btree (merge_request_id, sha);
@@ -24627,8 +26889,6 @@ CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_esc
CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL));
-CREATE UNIQUE INDEX index_on_policy_schedule_status_elapsed_time_escalation_rules ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds);
-
CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON incident_management_escalation_policies USING btree (project_id, name);
CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text));
@@ -24723,6 +26983,8 @@ CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generi
CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 8);
+CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 11);
+
CREATE INDEX index_packages_package_file_build_infos_on_package_file_id ON packages_package_file_build_infos USING btree (package_file_id);
CREATE INDEX index_packages_package_file_build_infos_on_pipeline_id ON packages_package_file_build_infos USING btree (pipeline_id);
@@ -24815,6 +27077,8 @@ CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btre
CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id);
+CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_indexes USING btree (name);
+
CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier);
CREATE UNIQUE INDEX index_programming_languages_on_name ON programming_languages USING btree (name);
@@ -24825,12 +27089,12 @@ CREATE UNIQUE INDEX index_project_aliases_on_name ON project_aliases USING btree
CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree (project_id);
-CREATE INDEX index_project_authorizations_on_project_id ON project_authorizations USING btree (project_id);
-
CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id);
CREATE UNIQUE INDEX index_project_ci_cd_settings_on_project_id ON project_ci_cd_settings USING btree (project_id);
+CREATE UNIQUE INDEX index_project_ci_feature_usages_unique_columns ON project_ci_feature_usages USING btree (project_id, feature, default_branch);
+
CREATE INDEX index_project_compliance_framework_settings_on_framework_id ON project_compliance_framework_settings USING btree (framework_id);
CREATE INDEX index_project_compliance_framework_settings_on_project_id ON project_compliance_framework_settings USING btree (project_id);
@@ -24859,6 +27123,10 @@ CREATE UNIQUE INDEX index_project_features_on_project_id ON project_features USI
CREATE INDEX index_project_features_on_project_id_bal_20 ON project_features USING btree (project_id) WHERE (builds_access_level = 20);
+CREATE UNIQUE INDEX index_project_features_on_project_id_include_container_registry ON project_features USING btree (project_id) INCLUDE (container_registry_access_level);
+
+COMMENT ON INDEX index_project_features_on_project_id_include_container_registry IS 'Included column (container_registry_access_level) improves performance of the ContainerRepository.for_group_and_its_subgroups scope query';
+
CREATE INDEX index_project_features_on_project_id_ral_20 ON project_features USING btree (project_id) WHERE (repository_access_level = 20);
CREATE INDEX index_project_group_links_on_group_id ON project_group_links USING btree (group_id);
@@ -24897,6 +27165,8 @@ CREATE INDEX index_project_settings_on_project_id_partially ON project_settings
CREATE UNIQUE INDEX index_project_settings_on_push_rule_id ON project_settings USING btree (push_rule_id);
+CREATE INDEX index_project_stages_on_stage_event_hash_id ON analytics_cycle_analytics_project_stages USING btree (stage_event_hash_id);
+
CREATE INDEX index_project_statistics_on_namespace_id ON project_statistics USING btree (namespace_id);
CREATE INDEX index_project_statistics_on_packages_size_and_project_id ON project_statistics USING btree (packages_size, project_id);
@@ -24909,6 +27179,12 @@ CREATE INDEX index_project_statistics_on_storage_size_and_project_id ON project_
CREATE INDEX index_project_statistics_on_wiki_size_and_project_id ON project_statistics USING btree (wiki_size, project_id);
+CREATE INDEX index_project_topics_on_project_id ON project_topics USING btree (project_id);
+
+CREATE UNIQUE INDEX index_project_topics_on_project_id_and_topic_id ON project_topics USING btree (project_id, topic_id);
+
+CREATE INDEX index_project_topics_on_topic_id ON project_topics USING btree (topic_id);
+
CREATE UNIQUE INDEX index_project_tracing_settings_on_project_id ON project_tracing_settings USING btree (project_id);
CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false));
@@ -24989,6 +27265,8 @@ CREATE INDEX index_projects_on_pending_delete ON projects USING btree (pending_d
CREATE INDEX index_projects_on_pool_repository_id ON projects USING btree (pool_repository_id) WHERE (pool_repository_id IS NOT NULL);
+CREATE UNIQUE INDEX index_projects_on_project_namespace_id ON projects USING btree (project_namespace_id);
+
CREATE INDEX index_projects_on_repository_storage ON projects USING btree (repository_storage);
CREATE INDEX index_projects_on_runners_token ON projects USING btree (runners_token);
@@ -25093,12 +27371,16 @@ CREATE INDEX index_requirements_management_test_reports_on_author_id ON requirem
CREATE INDEX index_requirements_management_test_reports_on_build_id ON requirements_management_test_reports USING btree (build_id);
+CREATE INDEX index_requirements_management_test_reports_on_issue_id ON requirements_management_test_reports USING btree (issue_id);
+
CREATE INDEX index_requirements_management_test_reports_on_requirement_id ON requirements_management_test_reports USING btree (requirement_id);
CREATE INDEX index_requirements_on_author_id ON requirements USING btree (author_id);
CREATE INDEX index_requirements_on_created_at ON requirements USING btree (created_at);
+CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id);
+
CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id);
CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL);
@@ -25203,8 +27485,14 @@ CREATE INDEX index_security_findings_on_severity ON security_findings USING btre
CREATE UNIQUE INDEX index_security_findings_on_uuid_and_scan_id ON security_findings USING btree (uuid, scan_id);
+CREATE INDEX index_security_scans_on_created_at ON security_scans USING btree (created_at);
+
CREATE INDEX index_security_scans_on_date_created_at_and_id ON security_scans USING btree (date(timezone('UTC'::text, created_at)), id);
+CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree (pipeline_id);
+
+CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id);
+
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@@ -25221,23 +27509,7 @@ CREATE INDEX index_serverless_domain_cluster_on_pages_domain_id ON serverless_do
CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON projects USING btree (id, creator_id, created_at) WHERE (service_desk_enabled = true);
-CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id);
-
-CREATE INDEX index_services_on_project_and_type_where_inherit_null ON services USING btree (project_id, type) WHERE (inherit_from_id IS NULL);
-
-CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type);
-
-CREATE INDEX index_services_on_template ON services USING btree (template);
-
-CREATE INDEX index_services_on_type ON services USING btree (type);
-
-CREATE UNIQUE INDEX index_services_on_type_and_instance_partial ON services USING btree (type, instance) WHERE (instance = true);
-
-CREATE UNIQUE INDEX index_services_on_type_and_template_partial ON services USING btree (type, template) WHERE (template = true);
-
-CREATE INDEX index_services_on_type_id_when_active_and_project_id_not_null ON services USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
-
-CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING btree (group_id, type);
+CREATE INDEX index_service_desk_settings_on_file_template_project_id ON service_desk_settings USING btree (file_template_project_id);
CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name);
@@ -25329,6 +27601,8 @@ CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm
CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id);
+CREATE INDEX index_status_check_responses_on_external_status_check_id ON status_check_responses USING btree (external_status_check_id);
+
CREATE INDEX index_status_check_responses_on_merge_request_id ON status_check_responses USING btree (merge_request_id);
CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_page_published_incidents USING btree (issue_id);
@@ -25385,8 +27659,6 @@ CREATE UNIQUE INDEX index_terraform_states_on_project_id_and_name ON terraform_s
CREATE UNIQUE INDEX index_terraform_states_on_uuid ON terraform_states USING btree (uuid);
-CREATE UNIQUE INDEX index_test_case_failures_unique_columns ON ci_test_case_failures USING btree (test_case_id, failed_at DESC, build_id);
-
CREATE INDEX index_timelogs_on_issue_id ON timelogs USING btree (issue_id);
CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_request_id);
@@ -25423,14 +27695,20 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_plaintext_token ON token_with
CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING btree (hashed_token);
+CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name);
+
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);
CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree (user_id);
+CREATE UNIQUE INDEX index_uniq_im_issuable_escalation_statuses_on_issue_id ON incident_management_issuable_escalation_statuses USING btree (issue_id);
+
CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id);
+CREATE UNIQUE INDEX index_unique_project_authorizations_on_project_id_user_id ON project_authorizations USING btree (project_id, user_id);
+
CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC);
CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id);
@@ -25465,6 +27743,8 @@ CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING
CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id);
+CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id);
+
CREATE INDEX index_user_highest_roles_on_user_id_and_highest_access_level ON user_highest_roles USING btree (user_id, highest_access_level);
CREATE INDEX index_user_interacted_projects_on_user_id ON user_interacted_projects USING btree (user_id);
@@ -25599,6 +27879,10 @@ CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vuln
CREATE UNIQUE INDEX index_vulnerability_findings_remediations_on_unique_keys ON vulnerability_findings_remediations USING btree (vulnerability_occurrence_id, vulnerability_remediation_id);
+CREATE UNIQUE INDEX index_vulnerability_flags_on_unique_columns ON vulnerability_flags USING btree (vulnerability_occurrence_id, flag_type, origin);
+
+CREATE INDEX index_vulnerability_flags_on_vulnerability_occurrence_id ON vulnerability_flags USING btree (vulnerability_occurrence_id);
+
CREATE INDEX index_vulnerability_historical_statistics_on_date_and_id ON vulnerability_historical_statistics USING btree (date, id);
CREATE UNIQUE INDEX index_vulnerability_identifiers_on_project_id_and_fingerprint ON vulnerability_identifiers USING btree (project_id, fingerprint);
@@ -25643,10 +27927,6 @@ CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerabili
CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id);
-CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id);
-
-CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id);
-
CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHERE ((type)::text = 'GroupHook'::text);
CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id);
@@ -25681,6 +27961,8 @@ CREATE INDEX index_x509_commit_signatures_on_x509_certificate_id ON x509_commit_
CREATE INDEX index_x509_issuers_on_subject_key_identifier ON x509_issuers USING btree (subject_key_identifier);
+CREATE INDEX index_zentao_tracker_data_on_integration_id ON zentao_tracker_data USING btree (integration_id);
+
CREATE INDEX index_zoom_meetings_on_issue_id ON zoom_meetings USING btree (issue_id);
CREATE UNIQUE INDEX index_zoom_meetings_on_issue_id_and_issue_status ON zoom_meetings USING btree (issue_id, issue_status) WHERE (issue_status = 1);
@@ -25745,12 +28027,16 @@ CREATE INDEX tmp_index_ci_builds_lock_version ON ci_builds USING btree (id) WHER
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) 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_on_security_findings_scan_id ON security_findings USING btree (scan_id) WHERE (uuid 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 INDEX tmp_index_taggings_on_id_where_taggable_type_project ON taggings USING btree (id) WHERE ((taggable_type)::text = 'Project'::text);
+
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name);
@@ -25775,6 +28061,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 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;
ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_entity_id_entity_type_id_author_id_crea_idx;
@@ -25823,6 +28111,138 @@ 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_202306_pkey;
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307_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_202307_entity_id_entity_type_id_author_id_crea_idx;
+
+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 incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212_pkey;
+
+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 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 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 incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307_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;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx1;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx2;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx3;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx4;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx5;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx6;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx1;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx2;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx3;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx4;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx5;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx6;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx7;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_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_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 incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307_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;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx1;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx2;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx3;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx4;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx5;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx6;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx1;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx2;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx3;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx4;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx5;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx6;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx7;
+
ALTER INDEX index_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;
@@ -25835,6 +28255,18 @@ ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTIT
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 loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304_pkey;
+
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey;
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey;
@@ -25871,6 +28303,140 @@ 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_202306_web_hook_id_idx;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_pkey;
+
+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 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;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30_pkey;
+
+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_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;
@@ -26127,15 +28693,15 @@ 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 table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db();
-
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 trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934();
+CREATE TRIGGER trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_490d204c00b3();
+
+CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10();
@@ -26145,30 +28711,35 @@ CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipeli
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 ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6();
+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_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693();
-
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_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+
+CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+
+CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
-CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN (((old.type_new = 'Integrations::ExternalWiki'::text) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN (((new.active = true) AND (new.type_new = 'Integrations::ExternalWiki'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.type)::text = 'ExternalWikiService'::text) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_has_external_wiki_on_type_new_updated AFTER UPDATE OF type_new ON integrations FOR EACH ROW WHEN (((new.type_new = 'Integrations::ExternalWiki'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON services FOR EACH ROW WHEN (((new.active = true) AND ((new.type)::text = 'ExternalWikiService'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+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_has_external_wiki_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.type)::text = 'ExternalWikiService'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_type_new_on_insert AFTER INSERT ON integrations FOR EACH ROW EXECUTE FUNCTION integrations_set_type_new();
ALTER TABLE ONLY chat_names
- ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY deployments
+ ADD CONSTRAINT fk_009fd21147 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_013c9f36ca FOREIGN KEY (due_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
@@ -26176,15 +28747,18 @@ ALTER TABLE ONLY epics
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;
+
+ALTER TABLE ONLY service_desk_settings
+ ADD CONSTRAINT fk_03afb71f06 FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
+
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 ci_test_cases
- ADD CONSTRAINT fk_0526c30ded FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26212,9 +28786,6 @@ ALTER TABLE ONLY ci_unit_test_failures
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 status_check_responses
- ADD CONSTRAINT fk_116e7e7369 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY group_deletion_schedules
ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26260,6 +28831,9 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY geo_container_repository_updated_events
ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT fk_21d25cac1a FOREIGN KEY (trace_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY users_star_projects
ADD CONSTRAINT fk_22cd27ddfc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26281,8 +28855,8 @@ ALTER TABLE ONLY epics
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 ci_build_trace_sections
- ADD CONSTRAINT fk_264e112c66 FOREIGN KEY (section_name_id) REFERENCES ci_build_trace_section_names(id) ON DELETE CASCADE;
+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;
@@ -26290,6 +28864,12 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL;
+ALTER TABLE ONLY agent_group_authorizations
+ ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY ci_freeze_periods
+ ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY notes
ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL;
@@ -26299,6 +28879,9 @@ ALTER TABLE ONLY members
ALTER TABLE ONLY lfs_objects_projects
ADD CONSTRAINT fk_2eb33f7a78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID;
+ALTER TABLE ONLY analytics_cycle_analytics_group_stages
+ ADD CONSTRAINT fk_3078345d6d FOREIGN KEY (stage_event_hash_id) REFERENCES analytics_cycle_analytics_stage_event_hashes(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_30f2a831f4 FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
@@ -26314,6 +28897,9 @@ ALTER TABLE ONLY ci_group_variables
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT fk_34af9ab07a FOREIGN KEY (topic_id) REFERENCES topics(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY in_product_marketing_emails
ADD CONSTRAINT fk_35c9101b63 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26359,7 +28945,7 @@ 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 ci_build_trace_sections
+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 alert_management_alerts
@@ -26374,6 +28960,9 @@ ALTER TABLE ONLY dast_site_profiles_pipelines
ALTER TABLE ONLY terraform_states
ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY status_check_responses
+ ADD CONSTRAINT fk_55bd2abc83 FOREIGN KEY (external_status_check_id) REFERENCES external_status_checks(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_56067dcb44 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26383,6 +28972,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY deploy_keys_projects
ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT fk_5d46286ad3 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT fk_5e0c8d9154 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26398,6 +28990,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY dependency_proxy_group_settings
ADD CONSTRAINT fk_616ddd680a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_61d52aa0e7 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY events
ADD CONSTRAINT fk_61fbf6ca48 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26419,6 +29014,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_6cca0d8800 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY projects
ADD CONSTRAINT fk_6e5c14658a FOREIGN KEY (pool_repository_id) REFERENCES pool_repositories(id) ON DELETE SET NULL;
@@ -26428,7 +29026,10 @@ ALTER TABLE ONLY terraform_state_versions
ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
+ALTER TABLE ONLY projects
+ ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerabilities
@@ -26500,6 +29101,9 @@ ALTER TABLE ONLY experiment_subjects
ALTER TABLE ONLY merge_request_diffs
ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY requirements
+ ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26518,6 +29122,9 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY bulk_import_entities
ADD CONSTRAINT fk_88c725229f FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY requirements_management_test_reports
+ ADD CONSTRAINT fk_88f30752fc FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26539,6 +29146,9 @@ ALTER TABLE ONLY ci_pipeline_schedules
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT fk_94e80df60e FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT fk_94f7c8a81e FOREIGN KEY (comment_author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26605,6 +29215,9 @@ ALTER TABLE ONLY ci_pipelines
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT fk_a325505e99 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY jira_connect_subscriptions
ADD CONSTRAINT fk_a3c10bcf7d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26635,6 +29248,9 @@ ALTER TABLE ONLY alert_management_alerts
ALTER TABLE ONLY identities
ADD CONSTRAINT fk_aade90f0fc FOREIGN KEY (saml_provider_id) REFERENCES saml_providers(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards
+ ADD CONSTRAINT fk_ab0a250ff6 FOREIGN KEY (iteration_cadence_id) REFERENCES iterations_cadences(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;
@@ -26647,6 +29263,9 @@ ALTER TABLE ONLY ci_variables
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE;
@@ -26659,6 +29278,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 issues
+ ADD CONSTRAINT fk_b37be69be6 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id);
+
ALTER TABLE ONLY protected_tag_create_access_levels
ADD CONSTRAINT fk_b4eb82fe3c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26668,12 +29290,18 @@ ALTER TABLE ONLY bulk_import_entities
ALTER TABLE ONLY compliance_management_frameworks
ADD CONSTRAINT fk_b74c45b71f FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT fk_b7d788e813 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT fk_b7d881734a FOREIGN KEY (issue_id) REFERENCES issues(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;
+ALTER TABLE ONLY customer_relations_contacts
+ ADD CONSTRAINT fk_b91ddd9345 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_b9a3851b82 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26707,6 +29335,9 @@ ALTER TABLE ONLY packages_packages
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 vulnerability_exports
ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26728,6 +29359,9 @@ ALTER TABLE ONLY external_approval_rules_protected_branches
ALTER TABLE ONLY external_approval_rules_protected_branches
ADD CONSTRAINT fk_ca2ffb55e6 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT fk_cc0dcc36d1 FOREIGN KEY (external_status_check_id) REFERENCES external_status_checks(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_profiles_pipelines
ADD CONSTRAINT fk_cc206a8c13 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
@@ -26756,7 +29390,7 @@ ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY web_hooks
- ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
@@ -26764,9 +29398,6 @@ 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 ci_test_case_failures
- ADD CONSTRAINT fk_d69404d827 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26785,9 +29416,15 @@ ALTER TABLE ONLY todos
ALTER TABLE ONLY project_group_links
ADD CONSTRAINT fk_daa8cee94c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT fk_db13576296 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dependency_proxy_blobs
ADD CONSTRAINT fk_db58bbc5d7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_scans
+ ADD CONSTRAINT fk_dbc89265b9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26803,12 +29440,18 @@ ALTER TABLE ONLY ci_resources
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_builds_metadata
+ ADD CONSTRAINT fk_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY gitlab_subscriptions
ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT fk_e4c49200f8 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26836,7 +29479,7 @@ ALTER TABLE ONLY vulnerability_statistics
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
+ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY pages_domains
@@ -26893,6 +29536,9 @@ ALTER TABLE ONLY protected_tag_create_access_levels
ALTER TABLE ONLY ci_stages
ADD CONSTRAINT fk_fb57e6cc56 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_group_authorizations
+ ADD CONSTRAINT fk_fb70782616 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY system_note_metadata
ADD CONSTRAINT fk_fbd87415c9 FOREIGN KEY (description_version_id) REFERENCES description_versions(id) ON DELETE SET NULL;
@@ -26905,6 +29551,9 @@ ALTER TABLE ONLY ci_daily_build_group_report_results
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
+ALTER TABLE ONLY ci_pending_builds
+ ADD CONSTRAINT fk_fdc0137e4a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_import_data
ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26950,6 +29599,9 @@ ALTER TABLE ONLY incident_management_oncall_participants
ALTER TABLE ONLY events
ADD CONSTRAINT fk_rails_0434b48643 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_issue_escalations
+ ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ip_restrictions
ADD CONSTRAINT fk_rails_04a93778d5 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26986,6 +29638,9 @@ ALTER TABLE ONLY packages_conan_file_metadata
ALTER TABLE ONLY ci_build_pending_states
ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY audit_events_external_audit_event_destinations
+ ADD CONSTRAINT fk_rails_0bc80a4edc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY operations_user_lists
ADD CONSTRAINT fk_rails_0c716e079b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27083,7 +29738,7 @@ 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 services(id) ON DELETE CASCADE;
+ 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;
@@ -27109,6 +29764,9 @@ ALTER TABLE ONLY epic_user_mentions
ALTER TABLE ONLY approver_groups
ADD CONSTRAINT fk_rails_1cdcbd7723 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_ci_feature_usages
+ ADD CONSTRAINT fk_rails_1deedbf64b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards
ADD CONSTRAINT fk_rails_1e9a074a35 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -27118,6 +29776,9 @@ ALTER TABLE ONLY boards_epic_board_positions
ALTER TABLE ONLY geo_repository_created_events
ADD CONSTRAINT fk_rails_1f49e46a61 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks
+ ADD CONSTRAINT fk_rails_1f5a8aa809 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dora_daily_metrics
ADD CONSTRAINT fk_rails_1fd07aff6f FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
@@ -27130,6 +29791,9 @@ ALTER TABLE ONLY approval_merge_request_rules_groups
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT fk_rails_20976e6fd9 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
+ALTER TABLE ONLY work_item_types
+ ADD CONSTRAINT fk_rails_20f694a960 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY user_statuses
ADD CONSTRAINT fk_rails_2178592333 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27187,6 +29851,9 @@ ALTER TABLE ONLY dast_site_validations
ALTER TABLE ONLY vulnerability_findings_remediations
ADD CONSTRAINT fk_rails_28a8d0cf93 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT fk_rails_29abffe3b9 FOREIGN KEY (policy_id) REFERENCES incident_management_escalation_policies(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_29af06892a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -27196,6 +29863,9 @@ ALTER TABLE ONLY reviews
ALTER TABLE ONLY draft_notes
ADD CONSTRAINT fk_rails_2a8dac9901 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies
+ ADD CONSTRAINT fk_rails_2b1896d021 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY packages_tags
ADD CONSTRAINT fk_rails_2b18ae9256 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
@@ -27211,15 +29881,15 @@ ALTER TABLE ONLY packages_debian_group_component_files
ALTER TABLE ONLY boards_epic_board_labels
ADD CONSTRAINT fk_rails_2bedeb8799 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
+ALTER TABLE ONLY error_tracking_error_events
+ ADD CONSTRAINT fk_rails_2c096c0076 FOREIGN KEY (error_id) REFERENCES error_tracking_errors(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY onboarding_progresses
ADD CONSTRAINT fk_rails_2ccfd420cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_freeze_periods
- ADD CONSTRAINT fk_rails_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id);
-
ALTER TABLE ONLY issuable_severities
ADD CONSTRAINT fk_rails_2fbb74ad6d FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -27346,9 +30016,6 @@ ALTER TABLE ONLY security_orchestration_policy_configurations
ALTER TABLE ONLY ci_resources
ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE;
-ALTER TABLE ONLY clusters_applications_fluentd
- ADD CONSTRAINT fk_rails_4319b1dcd2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY batched_background_migration_jobs
ADD CONSTRAINT fk_rails_432153b86d FOREIGN KEY (batched_background_migration_id) REFERENCES batched_background_migrations(id) ON DELETE CASCADE;
@@ -27556,6 +30223,9 @@ ALTER TABLE ONLY status_page_published_incidents
ALTER TABLE ONLY deployment_clusters
ADD CONSTRAINT fk_rails_6359a164df FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_issue_escalations
+ ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY evidences
ADD CONSTRAINT fk_rails_6388b435a6 FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE;
@@ -27601,9 +30271,6 @@ ALTER TABLE ONLY operations_feature_flags_clients
ALTER TABLE ONLY namespace_admin_notes
ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY web_hook_logs_archived
- ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams
ADD CONSTRAINT fk_rails_669f4ba293 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27631,12 +30298,18 @@ ALTER TABLE ONLY plan_limits
ALTER TABLE ONLY operations_feature_flags_issues
ADD CONSTRAINT fk_rails_6a8856ca4f FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
+ALTER TABLE ONLY error_tracking_errors
+ ADD CONSTRAINT fk_rails_6b41f837ba FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_assets
+ ADD CONSTRAINT fk_rails_6edbbecba4 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT fk_rails_6f5294f16c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27674,7 +30347,7 @@ ALTER TABLE ONLY vulnerability_finding_evidence_requests
ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
ALTER TABLE ONLY slack_integrations
- ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT fk_rails_745925b412 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -27727,6 +30400,9 @@ ALTER TABLE ONLY terraform_states
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
+ ADD CONSTRAINT fk_rails_79e77f6c5c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY software_license_policies
ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE;
@@ -27757,6 +30433,9 @@ ALTER TABLE ONLY required_code_owners_sections
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY zentao_tracker_data
+ ADD CONSTRAINT fk_rails_84efda7be0 FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards_epic_user_preferences
ADD CONSTRAINT fk_rails_851fe1510a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27814,6 +30493,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY ci_pipeline_messages
ADD CONSTRAINT fk_rails_8d3b04e3e1 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_alert_escalations
+ ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_merge_request_rules_approved_approvers
ADD CONSTRAINT fk_rails_8dc94cff4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27847,6 +30529,9 @@ ALTER TABLE ONLY project_error_tracking_settings
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_responses
+ ADD CONSTRAINT fk_rails_929041a499 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_request_cleanup_schedules
ADD CONSTRAINT fk_rails_92dd0e705c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -27889,6 +30574,9 @@ ALTER TABLE ONLY board_project_recent_visits
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_98fe21e486 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL;
+ALTER TABLE ONLY error_tracking_client_keys
+ ADD CONSTRAINT fk_rails_99342d1d54 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY pages_deployments
ADD CONSTRAINT fk_rails_993b88f59a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27935,7 +30623,7 @@ ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT fk_rails_a18600f210 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY jira_tracker_data
- ADD CONSTRAINT fk_rails_a299066916 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_a299066916 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY protected_environments
ADD CONSTRAINT fk_rails_a354313d11 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27943,6 +30631,9 @@ ALTER TABLE ONLY protected_environments
ALTER TABLE ONLY fork_network_members
ADD CONSTRAINT fk_rails_a40860a1ca FOREIGN KEY (fork_network_id) REFERENCES fork_networks(id) ON DELETE CASCADE;
+ALTER TABLE ONLY customer_relations_organizations
+ ADD CONSTRAINT fk_rails_a48597902f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY operations_feature_flag_scopes
ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
@@ -27988,7 +30679,7 @@ 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 ci_build_trace_sections
+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
@@ -28006,6 +30697,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ALTER TABLE ONLY metrics_dashboard_annotations
ADD CONSTRAINT fk_rails_aeb11a7643 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT fk_rails_aebc78111f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY bulk_import_trackers
ADD CONSTRAINT fk_rails_aed566d3f3 FOREIGN KEY (bulk_import_entity_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE;
@@ -28187,7 +30881,7 @@ ALTER TABLE ONLY operations_strategies_user_lists
ADD CONSTRAINT fk_rails_ccb7e4bc0b FOREIGN KEY (user_list_id) REFERENCES operations_user_lists(id) ON DELETE CASCADE;
ALTER TABLE ONLY issue_tracker_data
- ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerability_finding_evidence_headers
ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE;
@@ -28198,6 +30892,9 @@ ALTER TABLE ONLY resource_milestone_events
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_cee126f66c FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_requests
+ ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY epic_metrics
ADD CONSTRAINT fk_rails_d071904753 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE;
@@ -28291,9 +30988,6 @@ 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 ci_builds_metadata
- ADD CONSTRAINT fk_rails_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(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;
@@ -28303,6 +30997,9 @@ ALTER TABLE ONLY clusters_integration_prometheus
ALTER TABLE ONLY vulnerability_occurrence_identifiers
ADD CONSTRAINT fk_rails_e4ef6d027c FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_flags
+ ADD CONSTRAINT fk_rails_e59393b48b FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT fk_rails_e59e868733 FOREIGN KEY (clusters_applications_knative_id) REFERENCES clusters_applications_knative(id) ON DELETE CASCADE;
@@ -28348,12 +31045,12 @@ ALTER TABLE ONLY vulnerability_issue_links
ALTER TABLE ONLY merge_request_blocks
ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_sources
+ ADD CONSTRAINT fk_rails_e9761bed4c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_test_case_failures
- ADD CONSTRAINT fk_rails_eab6349715 FOREIGN KEY (test_case_id) REFERENCES ci_test_cases(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY alert_management_alert_user_mentions
ADD CONSTRAINT fk_rails_eb2de0cdef FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
@@ -28414,9 +31111,15 @@ ALTER TABLE ONLY approval_project_rules_users
ALTER TABLE ONLY insights
ADD CONSTRAINT fk_rails_f36fda3932 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_alert_escalations
+ ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY board_group_recent_visits
ADD CONSTRAINT fk_rails_f410736518 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT fk_rails_f4c811fd28 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_f5827a7ccd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -28438,7 +31141,7 @@ 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 ci_build_trace_section_names
+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
@@ -28447,6 +31150,9 @@ ALTER TABLE ONLY merge_trains
ALTER TABLE ONLY ci_runner_namespaces
ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY banned_users
+ ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY requirements_management_test_reports
ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES requirements(id) ON DELETE CASCADE;
@@ -28465,6 +31171,12 @@ 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;
+
ALTER TABLE ONLY external_approval_rules
ADD CONSTRAINT fk_rails_fd4f9ac573 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -28483,8 +31195,8 @@ ALTER TABLE ONLY resource_label_events
ALTER TABLE ONLY ci_builds_metadata
ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
- ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(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;
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL;
diff --git a/db/migrate/20210603140302_add_pronouns_to_user_details.rb b/db/migrate/20210603140302_add_pronouns_to_user_details.rb
deleted file mode 100644
index f28d45bdf6f..00000000000
--- a/db/migrate/20210603140302_add_pronouns_to_user_details.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddPronounsToUserDetails < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210607050531_add_text_limit_to_user_details_pronouns
- with_lock_retries do
- add_column :user_details, :pronouns, :text, null: true
- end
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- with_lock_retries do
- remove_column :user_details, :pronouns
- end
- end
-end
diff --git a/db/migrate/20210603222333_remove_builds_email_service_from_services.rb b/db/migrate/20210603222333_remove_builds_email_service_from_services.rb
deleted file mode 100644
index 791b8b659af..00000000000
--- a/db/migrate/20210603222333_remove_builds_email_service_from_services.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBuildsEmailServiceFromServices < ActiveRecord::Migration[6.1]
- def up
- execute("DELETE from services WHERE type = 'BuildsEmailService'")
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210604032738_create_dast_site_profiles_builds.rb b/db/migrate/20210604032738_create_dast_site_profiles_builds.rb
deleted file mode 100644
index 6e653b36787..00000000000
--- a/db/migrate/20210604032738_create_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- def up
- table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Site Profiles and CI Builds' }
-
- create_table :dast_site_profiles_builds, primary_key: [:dast_site_profile_id, :ci_build_id], comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :dast_site_profile_id, null: false
- t.bigint :ci_build_id, null: false
-
- t.index :ci_build_id, unique: true, name: :dast_site_profiles_builds_on_ci_build_id
- end
- end
-
- def down
- drop_table :dast_site_profiles_builds
- end
-end
diff --git a/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb b/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb
deleted file mode 100644
index 6908da69e08..00000000000
--- a/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiBuildIdFkToDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_site_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_site_profiles_builds, column: :ci_build_id
- end
- end
-end
diff --git a/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb b/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb
deleted file mode 100644
index 58fe3090a4f..00000000000
--- a/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddDastSiteProfileIdFkToDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_site_profiles_builds, :dast_site_profiles, column: :dast_site_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_site_profiles_builds, column: :dast_site_profile_id
- end
- end
-end
diff --git a/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb b/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb
deleted file mode 100644
index 0fe3ada4c0d..00000000000
--- a/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- def up
- table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Scanner Profiles and CI Builds' }
-
- create_table :dast_scanner_profiles_builds, primary_key: [:dast_scanner_profile_id, :ci_build_id], comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :dast_scanner_profile_id, null: false
- t.bigint :ci_build_id, null: false
-
- t.index :ci_build_id, unique: true, name: :dast_scanner_profiles_builds_on_ci_build_id
- end
- end
-
- def down
- drop_table :dast_scanner_profiles_builds
- end
-end
diff --git a/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb b/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb
deleted file mode 100644
index cc495c749c5..00000000000
--- a/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiBuildIdFkToDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_scanner_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_scanner_profiles_builds, column: :ci_build_id
- end
- end
-end
diff --git a/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb b/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb
deleted file mode 100644
index 0c14c798da4..00000000000
--- a/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddDastScannerProfileIdFkToDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_scanner_profiles_builds, :dast_scanner_profiles, column: :dast_scanner_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_scanner_profiles_builds, column: :dast_scanner_profile_id
- end
- end
-end
diff --git a/db/migrate/20210604082145_create_external_status_checks_table.rb b/db/migrate/20210604082145_create_external_status_checks_table.rb
deleted file mode 100644
index c1ad3df6c9e..00000000000
--- a/db/migrate/20210604082145_create_external_status_checks_table.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-class CreateExternalStatusChecksTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :external_status_checks, if_not_exists: true do |t|
- t.references :project, foreign_key: { on_delete: :cascade }, null: false, index: false
- t.timestamps_with_timezone
- t.text :external_url, null: false
- t.text_limit :external_url, 255
- t.text :name, null: false
- t.text_limit :name, 255
-
- t.index([:project_id, :name],
- unique: true,
- name: 'idx_on_external_status_checks_project_id_name')
- t.index([:project_id, :external_url],
- unique: true,
- name: 'idx_on_external_status_checks_project_id_external_url')
- end
-
- create_table :external_status_checks_protected_branches do |t|
- t.bigint :external_status_check_id, null: false
- t.bigint :protected_branch_id, null: false
-
- t.index :external_status_check_id, name: 'index_esc_protected_branches_on_external_status_check_id'
- t.index :protected_branch_id, name: 'index_esc_protected_branches_on_protected_branch_id'
- end
- end
-
- def down
- with_lock_retries do
- drop_table :external_status_checks_protected_branches, force: :cascade, if_exists: true
- end
-
- with_lock_retries do
- drop_table :external_status_checks, force: :cascade, if_exists: true
- end
- end
-end
diff --git a/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb b/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb
deleted file mode 100644
index a12aef9455d..00000000000
--- a/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-class RenameStatusCheckResponsesApprovalRule < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- execute('DELETE FROM status_check_responses')
-
- unless column_exists?(:status_check_responses, :external_status_check_id)
- add_column :status_check_responses, :external_status_check_id, :bigint, null: false # rubocop:disable Rails/NotNullColumn
- end
-
- add_concurrent_foreign_key :status_check_responses, :external_status_checks, column: :external_status_check_id, on_delete: :cascade
- add_concurrent_foreign_key :status_check_responses, :merge_requests, column: :merge_request_id, on_delete: :cascade
-
- add_concurrent_index :status_check_responses, :external_status_check_id
-
- # Setting this to true so that we can remove the column in a future release once the column has been removed. It has been ignored in 14.0
- change_column_null :status_check_responses, :external_approval_rule_id, true
-
- with_lock_retries do
- remove_foreign_key :status_check_responses, :external_approval_rules
- end
- end
-
- def down
- change_column_null :status_check_responses, :external_approval_rule_id, false
- with_lock_retries do
- add_foreign_key :status_check_responses, :external_approval_rules
- end
- remove_column :status_check_responses, :external_status_check_id
- end
-end
diff --git a/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb b/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb
deleted file mode 100644
index 41c543e5deb..00000000000
--- a/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserDetailsPronouns < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_details, :pronouns, 50
- end
-
- def down
- remove_text_limit :user_details, :pronouns
- end
-end
diff --git a/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb b/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb
deleted file mode 100644
index 5357059f475..00000000000
--- a/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTemporaryIndexOnSecurityFindingsScanId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_index_on_security_findings_scan_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :security_findings, INDEX_NAME
- end
-
- def down
- add_concurrent_index :security_findings, :scan_id, where: 'uuid is null', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb b/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb
deleted file mode 100644
index 20b9e8d95ee..00000000000
--- a/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddJobTokenScopeEnabledToCiCdSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- end
- end
-end
diff --git a/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb b/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb
deleted file mode 100644
index 490a7f2e960..00000000000
--- a/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class InitializeConversionOfCiStagesToBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_stages
- COLUMNS = %i(id)
-
- def up
- initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-
- def down
- revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb b/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb
deleted file mode 100644
index 4a52600d4c7..00000000000
--- a/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCiStagesForBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = :ci_stages
- COLUMNS = %i(id)
-
- def up
- backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-
- def down
- revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/migrate/20210608103230_add_issue_id_to_test_report.rb b/db/migrate/20210608103230_add_issue_id_to_test_report.rb
deleted file mode 100644
index f4e723d0af8..00000000000
--- a/db/migrate/20210608103230_add_issue_id_to_test_report.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIdToTestReport < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :requirements_management_test_reports, :issue_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :requirements_management_test_reports, :issue_id
- end
- end
-end
diff --git a/db/migrate/20210608103235_add_issue_index_to_test_report.rb b/db/migrate/20210608103235_add_issue_index_to_test_report.rb
deleted file mode 100644
index 41f1970b2a9..00000000000
--- a/db/migrate/20210608103235_add_issue_index_to_test_report.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIndexToTestReport < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_requirements_management_test_reports_on_issue_id'
-
- def up
- add_concurrent_index :requirements_management_test_reports, :issue_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :requirements_management_test_reports, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210608110752_change_column_null_test_report_requirement.rb b/db/migrate/20210608110752_change_column_null_test_report_requirement.rb
deleted file mode 100644
index 44a614a34ce..00000000000
--- a/db/migrate/20210608110752_change_column_null_test_report_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeColumnNullTestReportRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TARGET_TABLE = :requirements_management_test_reports
-
- def up
- with_lock_retries do
- change_column_null TARGET_TABLE, :requirement_id, true
- end
- end
-
- def down
- # no-op as it's difficult to revert
- end
-end
diff --git a/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb b/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb
deleted file mode 100644
index e256bce6ae0..00000000000
--- a/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequirementTestReportsForeignKey < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_TABLE = :requirements_management_test_reports
- CONSTRAINT_NAME = 'requirements_test_reports_requirement_id_xor_issue_id'
-
- def up
- add_concurrent_foreign_key TARGET_TABLE, :issues, column: :issue_id
-
- add_check_constraint(TARGET_TABLE, 'num_nonnulls(requirement_id, issue_id) = 1', CONSTRAINT_NAME)
- end
-
- def down
- remove_check_constraint TARGET_TABLE, CONSTRAINT_NAME
-
- with_lock_retries do
- remove_foreign_key_if_exists(TARGET_TABLE, column: :issue_id)
- end
- end
-end
diff --git a/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb b/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb
deleted file mode 100644
index 28214aedce6..00000000000
--- a/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexForBatchedBackgroundMigrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = :batched_background_migrations
- INDEX_NAME = 'index_batched_background_migrations_on_unique_configuration'
- REDUNDANT_INDEX_NAME = 'index_batched_migrations_on_job_table_and_column_name'
-
- def up
- add_concurrent_index TABLE_NAME,
- %i[job_class_name table_name column_name job_arguments],
- unique: true,
- name: INDEX_NAME
-
- remove_concurrent_index_by_name TABLE_NAME, REDUNDANT_INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE_NAME,
- %i[job_class_name table_name column_name],
- name: REDUNDANT_INDEX_NAME
-
- remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb b/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb
deleted file mode 100644
index 406bbe2095f..00000000000
--- a/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddExpiryIdSshKeyNotificationIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_keys_on_expires_at_and_id'
-
- def up
- add_concurrent_index :keys,
- "date(timezone('UTC', expires_at)), id",
- where: 'expiry_notification_delivered_at IS NULL',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :keys, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb b/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb
deleted file mode 100644
index 461d5838aed..00000000000
--- a/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusCheckForeignKeyToExternalStatusCheckId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_status_checks_protected_branches, :external_status_checks, column: :external_status_check_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_status_checks_protected_branches, column: :external_status_check_id
- end
- end
-end
diff --git a/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb b/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb
deleted file mode 100644
index 6eeee60ec3a..00000000000
--- a/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusCheckForeignKeyToProtectedBranchId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_status_checks_protected_branches, :protected_branches, column: :protected_branch_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_status_checks_protected_branches, column: :protected_branch_id
- end
- end
-end
diff --git a/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb b/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb
deleted file mode 100644
index 026fa0d7043..00000000000
--- a/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddProtectedAttributeToPendingBuilds < ActiveRecord::Migration[6.1]
- def change
- add_column :ci_pending_builds, :protected, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb b/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb
deleted file mode 100644
index f0bcbe5e472..00000000000
--- a/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteLegacyOperationsFeatureFlags < ActiveRecord::Migration[6.1]
- LEGACY_FEATURE_FLAG_VERSION = 1
-
- def up
- execute("DELETE FROM operations_feature_flags WHERE version = #{LEGACY_FEATURE_FLAG_VERSION}")
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb b/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb
deleted file mode 100644
index ef2177fa9ce..00000000000
--- a/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddPagesFileEntriesToPlanLimits < ActiveRecord::Migration[6.1]
- def change
- add_column(:plan_limits, :pages_file_entries, :integer, default: 200_000, null: false)
- end
-end
diff --git a/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb b/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb
deleted file mode 100644
index ecd8bac22be..00000000000
--- a/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-class RebuildIndexForCadenceIterationsAutomation < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'cadence_create_iterations_automation'
-
- disable_ddl_transaction!
-
- def up
- return if index_exists_and_is_valid?
-
- remove_concurrent_index_by_name :iterations_cadences, INDEX_NAME
-
- disable_statement_timeout do
- execute(
- <<-SQL
- CREATE INDEX CONCURRENTLY #{INDEX_NAME} ON iterations_cadences
- USING BTREE(automatic, duration_in_weeks, (DATE ((COALESCE("iterations_cadences"."last_run_date", DATE('01-01-1970')) + "iterations_cadences"."duration_in_weeks" * INTERVAL '1 week'))))
- WHERE duration_in_weeks IS NOT NULL
- SQL
- )
- end
- end
-
- def down
- remove_concurrent_index_by_name :iterations_cadences, INDEX_NAME
- end
-
- def index_exists_and_is_valid?
- execute(
- <<-SQL
- SELECT identifier
- FROM postgres_indexes
- WHERE identifier LIKE '%#{INDEX_NAME}' AND valid_index=TRUE
- SQL
- ).any?
- end
-end
diff --git a/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb b/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb
deleted file mode 100644
index 0a9eb64a5fc..00000000000
--- a/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSastDast < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :sast_enabled_count, :integer
- add_column :analytics_devops_adoption_snapshots, :dast_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb b/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb
deleted file mode 100644
index cc37c5f1020..00000000000
--- a/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddDetectionMethodToVulnerabilitiesFinding < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerability_occurrences, :detection_method, :smallint, null: false, default: 0
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerability_occurrences, :detection_method
- end
- end
-end
diff --git a/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb b/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb
deleted file mode 100644
index 248fff6c42f..00000000000
--- a/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunningContainerScanningMaxSizeToPlanLimits < ActiveRecord::Migration[6.0]
- def change
- add_column :plan_limits, :ci_max_artifact_size_running_container_scanning, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb b/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb
deleted file mode 100644
index e6b7ba7616d..00000000000
--- a/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexForHelmPackages < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_helm'
- PACKAGE_TYPE_HELM = 11
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, where: "package_type = #{PACKAGE_TYPE_HELM}", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_packages, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210615064342_add_issue_id_to_requirement.rb b/db/migrate/20210615064342_add_issue_id_to_requirement.rb
deleted file mode 100644
index a6d85bd9d6e..00000000000
--- a/db/migrate/20210615064342_add_issue_id_to_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIdToRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :requirements, :issue_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :requirements, :issue_id
- end
- end
-end
diff --git a/db/migrate/20210616110748_add_issue_index_to_requirement.rb b/db/migrate/20210616110748_add_issue_index_to_requirement.rb
deleted file mode 100644
index 747ee3875dc..00000000000
--- a/db/migrate/20210616110748_add_issue_index_to_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIndexToRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_requirements_on_issue_id'
-
- def up
- add_concurrent_index :requirements, :issue_id, name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :requirements, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb b/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb
deleted file mode 100644
index ed851da9f31..00000000000
--- a/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueRequirementForeignKey < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_TABLE = :requirements
-
- def up
- add_concurrent_foreign_key TARGET_TABLE, :issues, column: :issue_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists(TARGET_TABLE, column: :issue_id)
- end
- end
-end
diff --git a/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb b/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb
deleted file mode 100644
index 7086b20c48f..00000000000
--- a/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimestampToSchemaMigration < ActiveRecord::Migration[6.1]
- def up
- # Add a nullable column with default null first
- add_column :schema_migrations, :finished_at, :timestamptz
-
- # Change default to NOW() for new records
- change_column_default :schema_migrations, :finished_at, -> { 'NOW()' }
- end
-
- def down
- remove_column :schema_migrations, :finished_at
- end
-end
diff --git a/db/migrate/20210616154808_remove_ci_build_protected_index.rb b/db/migrate/20210616154808_remove_ci_build_protected_index.rb
deleted file mode 100644
index 25a8d159c1e..00000000000
--- a/db/migrate/20210616154808_remove_ci_build_protected_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiBuildProtectedIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- INDEX_NAME = 'index_ci_builds_on_protected'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index :ci_builds, :protected, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :ci_builds, :protected, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb b/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb
deleted file mode 100644
index 8447ff79d12..00000000000
--- a/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddMailgunSettingsToApplicationSetting < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :encrypted_mailgun_signing_key, :binary
- add_column :application_settings, :encrypted_mailgun_signing_key_iv, :binary
-
- add_column :application_settings, :mailgun_events_enabled, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb b/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb
deleted file mode 100644
index 32249c9ed56..00000000000
--- a/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementPendingAlertEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- execute(<<~SQL)
-
- CREATE TABLE incident_management_pending_alert_escalations (
- id bigserial NOT NULL,
- rule_id bigint,
- alert_id bigint NOT NULL,
- schedule_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,
- status smallint NOT NULL,
- PRIMARY KEY (id, process_at)
- ) PARTITION BY RANGE (process_at);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id
- ON incident_management_pending_alert_escalations USING btree (alert_id);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id
- ON incident_management_pending_alert_escalations USING btree (rule_id);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_schedule_id
- ON incident_management_pending_alert_escalations USING btree (schedule_id);
-
- 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 incident_management_pending_alert_escalations ADD CONSTRAINT fk_rails_057c1e3d87
- FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE SET NULL;
-
- ALTER TABLE incident_management_pending_alert_escalations ADD CONSTRAINT fk_rails_8d8de95da9
- FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
- SQL
- end
- end
-
- def down
- with_lock_retries do
- drop_table :incident_management_pending_alert_escalations
- end
- end
-end
diff --git a/db/migrate/20210617161348_cascade_delete_freeze_periods.rb b/db/migrate/20210617161348_cascade_delete_freeze_periods.rb
deleted file mode 100644
index 90623b27920..00000000000
--- a/db/migrate/20210617161348_cascade_delete_freeze_periods.rb
+++ /dev/null
@@ -1,23 +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 CascadeDeleteFreezePeriods < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- OLD_PROJECT_FK = 'fk_rails_2e02bbd1a6'
- NEW_PROJECT_FK = 'fk_2e02bbd1a6'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :ci_freeze_periods, :projects, column: :project_id, on_delete: :cascade, name: NEW_PROJECT_FK
- remove_foreign_key_if_exists :ci_freeze_periods, :projects, column: :project_id, name: OLD_PROJECT_FK
- end
-
- def down
- add_concurrent_foreign_key :ci_freeze_periods, :projects, column: :project_id, on_delete: nil, name: OLD_PROJECT_FK
- remove_foreign_key_if_exists :ci_freeze_periods, :projects, column: :project_id, name: NEW_PROJECT_FK
- end
-end
diff --git a/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb b/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb
deleted file mode 100644
index 9eebc6feb14..00000000000
--- a/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateUsagePingSidekiqQueue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/SidekiqQueueMigrate
- def up
- sidekiq_queue_migrate 'cronjob:gitlab_usage_ping', to: 'cronjob:gitlab_service_ping'
- end
-
- def down
- sidekiq_queue_migrate 'cronjob:gitlab_service_ping', to: 'cronjob:gitlab_usage_ping'
- end
- # rubocop:enable Migration/SidekiqQueueMigrate
-end
diff --git a/db/migrate/20210621043337_rename_services_to_integrations.rb b/db/migrate/20210621043337_rename_services_to_integrations.rb
deleted file mode 100644
index 845c3c01a2a..00000000000
--- a/db/migrate/20210621043337_rename_services_to_integrations.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-# frozen_string_literal: true
-
-class RenameServicesToIntegrations < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- enable_lock_retries!
-
- # Function and trigger names match those migrated in:
- # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49916
- # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51852
-
- WIKI_FUNCTION_NAME = 'set_has_external_wiki'
- TRACKER_FUNCTION_NAME = 'set_has_external_issue_tracker'
-
- WIKI_TRIGGER_ON_INSERT_NAME = 'trigger_has_external_wiki_on_insert'
- WIKI_TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_wiki_on_update'
- WIKI_TRIGGER_ON_DELETE_NAME = 'trigger_has_external_wiki_on_delete'
-
- TRACKER_TRIGGER_ON_INSERT_NAME = 'trigger_has_external_issue_tracker_on_insert'
- TRACKER_TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_issue_tracker_on_update'
- TRACKER_TRIGGER_ON_DELETE_NAME = 'trigger_has_external_issue_tracker_on_delete'
-
- ALL_TRIGGERS = [
- WIKI_TRIGGER_ON_INSERT_NAME,
- WIKI_TRIGGER_ON_UPDATE_NAME,
- WIKI_TRIGGER_ON_DELETE_NAME,
- TRACKER_TRIGGER_ON_INSERT_NAME,
- TRACKER_TRIGGER_ON_UPDATE_NAME,
- TRACKER_TRIGGER_ON_DELETE_NAME
- ].freeze
-
- def up
- execute('LOCK services IN ACCESS EXCLUSIVE MODE')
-
- drop_all_triggers(:services)
-
- rename_table_safely(:services, :integrations)
-
- recreate_all_triggers(:integrations)
- end
-
- def down
- execute('LOCK integrations IN ACCESS EXCLUSIVE MODE')
-
- drop_all_triggers(:integrations)
-
- undo_rename_table_safely(:services, :integrations)
-
- recreate_all_triggers(:services)
- end
-
- private
-
- def drop_all_triggers(table_name)
- ALL_TRIGGERS.each do |trigger_name|
- drop_trigger(table_name, trigger_name)
- end
- end
-
- def recreate_all_triggers(table_name)
- wiki_create_insert_trigger(table_name)
- wiki_create_update_trigger(table_name)
- wiki_create_delete_trigger(table_name)
-
- tracker_replace_trigger_function(table_name)
-
- tracker_create_insert_trigger(table_name)
- tracker_create_update_trigger(table_name)
- tracker_create_delete_trigger(table_name)
- end
-
- def wiki_create_insert_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.active = TRUE AND NEW.type = 'ExternalWikiService' AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- def wiki_create_update_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.type = 'ExternalWikiService' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- def wiki_create_delete_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON #{table_name}
- FOR EACH ROW
- WHEN (OLD.type = 'ExternalWikiService' AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- # Using `replace: true` to rewrite the existing function
- def tracker_replace_trigger_function(table_name)
- create_trigger_function(TRACKER_FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE projects SET has_external_issue_tracker = (
- EXISTS
- (
- SELECT 1
- FROM #{table_name}
- 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;
- SQL
- end
- end
-
- def tracker_create_insert_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND NEW.active = TRUE AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-
- def tracker_create_update_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-
- def tracker_create_delete_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON #{table_name}
- FOR EACH ROW
- WHEN (OLD.category = 'issue_tracker' AND OLD.active = TRUE AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-end
diff --git a/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb b/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb
deleted file mode 100644
index 9dba663f6a7..00000000000
--- a/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RenameServicesIndexesToIntegrations < ActiveRecord::Migration[6.1]
- INDEXES = %w(
- project_and_type_where_inherit_null
- project_id_and_type_unique
- template
- type
- type_and_instance_partial
- type_and_template_partial
- type_id_when_active_and_project_id_not_null
- unique_group_id_and_type
- ).freeze
-
- def up
- INDEXES.each do |index|
- execute(<<~SQL)
- ALTER INDEX IF EXISTS "index_services_on_#{index}" RENAME TO "index_integrations_on_#{index}"
- SQL
- end
- end
-
- def down
- INDEXES.each do |index|
- execute(<<~SQL)
- ALTER INDEX IF EXISTS "index_integrations_on_#{index}" RENAME TO "index_services_on_#{index}"
- SQL
- end
- end
-end
diff --git a/db/migrate/20210621084632_add_summary_to_timelogs.rb b/db/migrate/20210621084632_add_summary_to_timelogs.rb
deleted file mode 100644
index 45fd7f1e0bc..00000000000
--- a/db/migrate/20210621084632_add_summary_to_timelogs.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddSummaryToTimelogs < ActiveRecord::Migration[6.1]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210621090030_add_text_limit_to_timelogs_summary
- def change
- add_column :timelogs, :summary, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb b/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb
deleted file mode 100644
index ac872afd3fa..00000000000
--- a/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToTimelogsSummary < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :timelogs, :summary, 255
- end
-
- def down
- remove_text_limit :timelogs, :summary
- end
-end
diff --git a/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb b/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb
deleted file mode 100644
index ae19a46b66f..00000000000
--- a/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotDependencyScanning < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :dependency_scanning_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb b/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb
deleted file mode 100644
index 03991cea41c..00000000000
--- a/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyForEnvironmentIdToEnvironments < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- # `validate: false` option is passed here, because validating the existing rows fails by the orphaned deployments,
- # which will be cleaned up in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64588.
- # The validation runs for only new records or updates, so that we can at least
- # stop creating orphaned rows.
- add_concurrent_foreign_key :deployments, :environments, column: :environment_id, on_delete: :cascade, validate: false
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :deployments, :environments
- end
- end
-end
diff --git a/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb b/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb
deleted file mode 100644
index 7a70f695039..00000000000
--- a/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddUsagePingFeaturesEnabledToApplicationSettings < ActiveRecord::Migration[6.1]
- def up
- add_column :application_settings, :usage_ping_features_enabled, :boolean, default: false, null: false
- end
-
- def down
- remove_column :application_settings, :usage_ping_features_enabled
- end
-end
diff --git a/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb b/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb
deleted file mode 100644
index d528c4c6967..00000000000
--- a/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPresentOnDefaultBranchToVulnerabilities < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerabilities, :present_on_default_branch, :boolean, default: true, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerabilities, :present_on_default_branch
- end
- end
-end
diff --git a/db/migrate/20210623133635_create_error_tracking_errors.rb b/db/migrate/20210623133635_create_error_tracking_errors.rb
deleted file mode 100644
index e26fbe8df86..00000000000
--- a/db/migrate/20210623133635_create_error_tracking_errors.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingErrors < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_errors do |t|
- t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade }
- t.text :name, null: false
- t.text :description, null: false
- t.text :actor, null: false
- t.datetime_with_timezone :first_seen_at, null: false, default: -> { 'NOW()' }
- t.datetime_with_timezone :last_seen_at, null: false, default: -> { 'NOW()' }
- t.text :platform
-
- t.text_limit :name, 255
- t.text_limit :description, 1024
- t.text_limit :actor, 255
- t.text_limit :platform, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_errors
- end
-end
diff --git a/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb b/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
deleted file mode 100644
index 81903230f43..00000000000
--- a/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToComplianceManagementFrameworksPipelineConfiguration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_compliance_frameworks_id_where_frameworks_not_null'
-
- def up
- add_concurrent_index :compliance_management_frameworks, :id, name: INDEX_NAME, where: 'pipeline_configuration_full_path IS NOT NULL'
- end
-
- def down
- remove_concurrent_index_by_name :compliance_management_frameworks, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb b/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb
deleted file mode 100644
index 6ca040dbfbc..00000000000
--- a/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionCoverageFuzzing < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :coverage_fuzzing_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb b/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb
deleted file mode 100644
index 085fccdc20f..00000000000
--- a/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddLastSyncedAtToLicenses < ActiveRecord::Migration[6.1]
- def change
- add_column :licenses, :last_synced_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210625094554_create_error_tracking_error_events.rb b/db/migrate/20210625094554_create_error_tracking_error_events.rb
deleted file mode 100644
index c1ed6d6ce6e..00000000000
--- a/db/migrate/20210625094554_create_error_tracking_error_events.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingErrorEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_error_events do |t|
- t.references :error,
- index: true,
- null: false,
- foreign_key: { on_delete: :cascade, to_table: :error_tracking_errors }
-
- t.text :description, null: false
- t.text :environment
- t.text :level
- t.datetime_with_timezone :occurred_at, null: false
- t.jsonb :payload, null: false, default: {}
-
- t.text_limit :description, 255
- t.text_limit :environment, 255
- t.text_limit :level, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_error_events
- end
-end
diff --git a/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb b/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb
deleted file mode 100644
index 322e6991d0b..00000000000
--- a/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddPlanLimitsMaxSizeClusterImageScanningColumn < ActiveRecord::Migration[6.0]
- def change
- add_column :plan_limits, :ci_max_artifact_size_cluster_image_scanning, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210628154900_create_detached_partitions_table.rb b/db/migrate/20210628154900_create_detached_partitions_table.rb
deleted file mode 100644
index cf31d71835a..00000000000
--- a/db/migrate/20210628154900_create_detached_partitions_table.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDetachedPartitionsTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :detached_partitions do |t|
- t.timestamps_with_timezone null: false
- t.datetime_with_timezone :drop_after, null: false
- t.text :table_name, null: false
-
- # Postgres identifier names can be up to 63 bytes
- # See https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
- t.text_limit :table_name, 63
- end
- end
-
- def down
- with_lock_retries do
- drop_table :detached_partitions
- end
- end
-end
diff --git a/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb b/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb
deleted file mode 100644
index 14b6b9efad3..00000000000
--- a/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AssociateExistingDastBuildsWithVariables < ActiveRecord::Migration[6.1]
- 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/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb b/db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb
deleted file mode 100644
index c84a42cbea4..00000000000
--- a/db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToBulkImportEntitiesOnBulkImportIdAndStatus < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NEW_INDEX_NAME = 'index_bulk_import_entities_on_bulk_import_id_and_status'
- OLD_INDEX_NAME = 'index_bulk_import_entities_on_bulk_import_id'
-
- def up
- add_concurrent_index :bulk_import_entities, [:bulk_import_id, :status], name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :bulk_import_entities, name: OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :bulk_import_entities, :bulk_import_id, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :bulk_import_entities, name: NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210630144339_add_invite_email_success_to_members.rb b/db/migrate/20210630144339_add_invite_email_success_to_members.rb
deleted file mode 100644
index 6c341ecb3f3..00000000000
--- a/db/migrate/20210630144339_add_invite_email_success_to_members.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddInviteEmailSuccessToMembers < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb b/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb
deleted file mode 100644
index 5df0f84ab78..00000000000
--- a/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddCustomersDotJwtSigningKeyToApplicationSettings < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :encrypted_customers_dot_jwt_signing_key, :binary
- add_column :application_settings, :encrypted_customers_dot_jwt_signing_key_iv, :binary
- end
-end
diff --git a/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb b/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb
deleted file mode 100644
index 703b2c7d0b8..00000000000
--- a/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class GenerateCustomersDotJwtSigningKey < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = 'application_settings'
-
- attr_encrypted :customers_dot_jwt_signing_key, {
- mode: :per_attribute_iv,
- key: Gitlab::Utils.ensure_utf8_size(Rails.application.secrets.db_key_base, bytes: 32.bytes),
- algorithm: 'aes-256-gcm',
- encode: true
- }
- end
-
- def up
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.find_each do |application_setting|
- application_setting.update(customers_dot_jwt_signing_key: OpenSSL::PKey::RSA.new(2048).to_pem)
- end
- end
-
- def down
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.find_each do |application_setting|
- application_setting.update_columns(encrypted_customers_dot_jwt_signing_key: nil, encrypted_customers_dot_jwt_signing_key_iv: nil)
- end
- end
-end
diff --git a/db/migrate/20210701111627_add_upvotes_count_to_issues.rb b/db/migrate/20210701111627_add_upvotes_count_to_issues.rb
deleted file mode 100644
index beefb186f37..00000000000
--- a/db/migrate/20210701111627_add_upvotes_count_to_issues.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpvotesCountToIssues < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :issues, :upvotes_count, :integer, default: 0, null: false
- end
- end
-
- def down
- remove_column :issues, :upvotes_count
- end
-end
diff --git a/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb b/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb
deleted file mode 100644
index 561c98c449c..00000000000
--- a/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiJobTraceSizeToPlanLimits < ActiveRecord::Migration[6.1]
- def change
- add_column(:plan_limits, :ci_jobs_trace_size_limit, :integer, default: 100, null: false)
- end
-end
diff --git a/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb b/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb
deleted file mode 100644
index e54d762fa75..00000000000
--- a/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectSettingsPreviousDefaultBranch < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210707173645_add_project_settings_previous_default_branch_text_limit
- def up
- with_lock_retries do
- add_column :project_settings, :previous_default_branch, :text
- end
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- with_lock_retries do
- remove_column :project_settings, :previous_default_branch
- end
- end
-end
diff --git a/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb b/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb
deleted file mode 100644
index a6983c2d599..00000000000
--- a/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class CreateContainerReposOnExpCleanupStatusProjectIdStartDateIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- OLD_INDEX_NAME = 'idx_container_repositories_on_exp_cleanup_status_and_start_date'
- NEW_INDEX_NAME = 'idx_container_repos_on_exp_cleanup_status_project_id_start_date'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :project_id, :expiration_policy_started_at], name: NEW_INDEX_NAME)
- remove_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :expiration_policy_started_at], name: OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :expiration_policy_started_at], name: OLD_INDEX_NAME)
- remove_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :project_id, :expiration_policy_started_at], name: NEW_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb b/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb
deleted file mode 100644
index 7f736bf2b87..00000000000
--- a/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddNewUserSignupsCapToNamespaceSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :namespace_settings, :new_user_signups_cap, :integer, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_settings, :new_user_signups_cap
- end
- end
-end
diff --git a/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb b/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb
deleted file mode 100644
index ea612100e5a..00000000000
--- a/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class InitializeConversionOfCiBuildsMetadataIdToBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_builds_metadata
- COLUMN = :id
-
- def up
- initialize_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
-
- def down
- revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
-end
diff --git a/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb b/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb
deleted file mode 100644
index b362fd930a3..00000000000
--- a/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddInstanceRunnersEnabledToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :ci_pending_builds, :instance_runners_enabled, :boolean, null: false, default: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_pending_builds, :instance_runners_enabled
- end
- end
-end
diff --git a/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb b/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb
deleted file mode 100644
index 26727b7ad7d..00000000000
--- a/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotsIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_analytics_devops_adoption_snapshots_finalized'
-
- def up
- add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :end_time], where: "recorded_at >= end_time", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb b/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb
deleted file mode 100644
index 866b16a6bb9..00000000000
--- a/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddRemainingCiMinutesToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column(:ci_pending_builds, :namespace_id, :bigint)
- add_column(:ci_pending_builds, :minutes_exceeded, :boolean, null: false, default: false)
- end
- end
-
- def down
- with_lock_retries do
- remove_column(:ci_pending_builds, :minutes_exceeded)
- remove_column(:ci_pending_builds, :namespace_id)
- end
- end
-end
diff --git a/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb b/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb
deleted file mode 100644
index 2a04850d905..00000000000
--- a/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddNamespaceForeignKeyToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
- INDEX_NAME = 'index_ci_pending_builds_on_namespace_id'
-
- def up
- add_concurrent_index(:ci_pending_builds, :namespace_id, name: INDEX_NAME)
- add_concurrent_foreign_key(:ci_pending_builds, :namespaces, column: :namespace_id, on_delete: :cascade)
- end
-
- def down
- remove_foreign_key_if_exists(:ci_pending_builds, column: :namespace_id)
- remove_concurrent_index_by_name(:ci_pending_builds, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb b/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb
deleted file mode 100644
index a2a3d74cd49..00000000000
--- a/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexTypeToPostgresIndexesView < ActiveRecord::Migration[6.1]
- 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
- 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) || (pg_class.relname)::text) AS identifier,
- pg_index.indexrelid,
- pg_namespace.nspname AS schema,
- pg_class.relname AS name,
- pg_indexes.tablename,
- pg_index.indisunique AS "unique",
- pg_index.indisvalid AS valid_index,
- pg_class.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((pg_class.oid)::regclass) AS ondisk_size_bytes
- FROM (((pg_index
- JOIN pg_class ON ((pg_class.oid = pg_index.indexrelid)))
- JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)))
- JOIN pg_indexes ON ((pg_class.relname = pg_indexes.indexname)))
- 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/20210706213537_add_premium_and_ultimate_plan_limits.rb b/db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb
deleted file mode 100644
index f78e37d645a..00000000000
--- a/db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class AddPremiumAndUltimatePlanLimits < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- class Plan < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- has_one :limits, class_name: 'PlanLimits'
- end
-
- class PlanLimits < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- belongs_to :plan
- end
-
- def copy_plan_limits(from_plan_name:, to_plan_name:)
- source_plan = Plan.find_by(name: from_plan_name)
- target_plan = Plan.find_by(name: to_plan_name)
- return unless source_plan && target_plan
- return unless source_plan.limits.present?
- return if target_plan.limits.present?
-
- limits = source_plan.limits.dup
- limits.plan = target_plan
- limits.save!
- end
-
- def up
- return unless Gitlab.com?
-
- copy_plan_limits(from_plan_name: 'gold', to_plan_name: 'ultimate')
- copy_plan_limits(from_plan_name: 'silver', to_plan_name: 'premium')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb b/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb
deleted file mode 100644
index 597e274cda2..00000000000
--- a/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToMergeRequestCleanupSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_merge_request_cleanup_schedules_on_status'
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:merge_request_cleanup_schedules, :status)
- add_column(:merge_request_cleanup_schedules, :status, :integer, limit: 2, default: 0, null: false)
- end
-
- add_concurrent_index(:merge_request_cleanup_schedules, :status, name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, INDEX_NAME)
-
- if column_exists?(:merge_request_cleanup_schedules, :status)
- remove_column(:merge_request_cleanup_schedules, :status)
- end
- end
-end
diff --git a/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb b/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb
deleted file mode 100644
index 229dc01fb87..00000000000
--- a/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTagsArrayToCiPendingBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :ci_pending_builds, :tag_ids, :integer, array: true, default: []
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_pending_builds, :tag_ids
- end
- end
-end
diff --git a/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb b/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb
deleted file mode 100644
index 90bc6fb82bd..00000000000
--- a/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceSources < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_sources do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_sources_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :name
- t.text :url
-
- t.text_limit :name, 2048
- t.text_limit :url, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_sources
- end
- end
-end
diff --git a/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb b/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb
deleted file mode 100644
index c138af486c1..00000000000
--- a/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilityEventsToIntegrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :integrations, :vulnerability_events, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb b/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb
deleted file mode 100644
index 57c71e6bc17..00000000000
--- a/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceAssets < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_assets do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_assets_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :type
- t.text :name
- t.text :url
-
- t.text_limit :type, 2048
- t.text_limit :name, 2048
- t.text_limit :url, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_assets
- end
- end
-end
diff --git a/db/migrate/20210707171554_create_vulnerability_flags.rb b/db/migrate/20210707171554_create_vulnerability_flags.rb
deleted file mode 100644
index bf33963b08f..00000000000
--- a/db/migrate/20210707171554_create_vulnerability_flags.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFlags < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- FALSE_POSITIVE_ENUM_VALUE = 0
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_flags do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_occurrence, null: false, foreign_key: { on_delete: :cascade }
-
- t.integer :flag_type, limit: 2, null: false, default: FALSE_POSITIVE_ENUM_VALUE
-
- t.text :origin, null: false
- t.text :description, null: false
-
- t.text_limit :origin, 255
- t.text_limit :description, 1024
- end
- end
-
- def down
- drop_table :vulnerability_flags
- end
-end
diff --git a/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb b/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb
deleted file mode 100644
index a6a83b00234..00000000000
--- a/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectSettingsPreviousDefaultBranchTextLimit < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :project_settings, :previous_default_branch, 4096
- end
-
- def down
- remove_text_limit :project_settings, :previous_default_branch
- end
-end
diff --git a/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb b/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb
deleted file mode 100644
index b9fc822a5a3..00000000000
--- a/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceSupportingMessages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_supporting_messages do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_supporting_messages_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :name
-
- t.text_limit :name, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_supporting_messages
- end
- end
-end
diff --git a/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb b/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb
deleted file mode 100644
index 70141f4844e..00000000000
--- a/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class RenameCiBuildsMetadataForeignKey < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_metadata'
- OLD_PREFIX = 'fk_rails_'
-
- def up
- with_lock_retries(raise_on_exhaustion: true) do
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id, prefix: 'fk_rails_'),
- concurrent_foreign_key_name(TABLE_NAME, :build_id)
- )
- end
- end
-
- def down
- with_lock_retries(raise_on_exhaustion: true) do
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id),
- concurrent_foreign_key_name(TABLE_NAME, :build_id, prefix: 'fk_rails_')
- )
- end
- end
-end
diff --git a/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb b/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb
deleted file mode 100644
index f613856a18c..00000000000
--- a/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddFailedCountToMergeRequestCleanupSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :merge_request_cleanup_schedules, :failed_count, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20210708124229_add_security_scans_created_at_index.rb b/db/migrate/20210708124229_add_security_scans_created_at_index.rb
deleted file mode 100644
index d2d1958f5b9..00000000000
--- a/db/migrate/20210708124229_add_security_scans_created_at_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityScansCreatedAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_security_scans_on_created_at'
-
- def up
- add_concurrent_index(:security_scans, :created_at, name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:security_scans, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210708131048_add_error_tracking_counter_cache.rb b/db/migrate/20210708131048_add_error_tracking_counter_cache.rb
deleted file mode 100644
index 3bf7e1e3688..00000000000
--- a/db/migrate/20210708131048_add_error_tracking_counter_cache.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddErrorTrackingCounterCache < ActiveRecord::Migration[6.1]
- def up
- add_column :error_tracking_errors, :events_count, :bigint, null: false, default: 0
- end
-
- def down
- remove_column :error_tracking_errors, :events_count
- end
-end
diff --git a/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb b/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb
deleted file mode 100644
index 82abfeb57f9..00000000000
--- a/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotNullConstraintFromTerms < ActiveRecord::Migration[6.1]
- def up
- change_column_null :application_setting_terms, :terms, true
- end
-
- def down
- change_column_null :application_setting_terms, :terms, false
- end
-end
diff --git a/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb b/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb
deleted file mode 100644
index a9175833dd7..00000000000
--- a/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddScannersColumnToApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :scanners, :text, array: true
- end
-
- def down
- remove_column :approval_project_rules, :scanners
- end
-end
diff --git a/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb b/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb
deleted file mode 100644
index 8240e968e7a..00000000000
--- a/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class IndexBatchedMigrationJobsByMaxValue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_migration_jobs_on_migration_id_and_max_value'
-
- def up
- add_concurrent_index :batched_background_migration_jobs, %i(batched_background_migration_id max_value), name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb b/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb
deleted file mode 100644
index fbd9f7baa61..00000000000
--- a/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDefaultJobTokenScopeEnabled < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-end
diff --git a/db/migrate/20210709221051_create_work_item_types.rb b/db/migrate/20210709221051_create_work_item_types.rb
deleted file mode 100644
index 749689811e0..00000000000
--- a/db/migrate/20210709221051_create_work_item_types.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class CreateWorkItemTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :work_item_types do |t|
- t.integer :base_type, limit: 2, default: 0, null: false
- t.integer :cached_markdown_version
- t.text :name, null: false
- t.text :description # rubocop:disable Migration/AddLimitToTextColumns
- t.text :description_html # rubocop:disable Migration/AddLimitToTextColumns
- t.text :icon_name, null: true
- t.references :namespace, foreign_key: { on_delete: :cascade }, index: false, null: true
- t.timestamps_with_timezone null: false
-
- t.text_limit :name, 255
- t.text_limit :icon_name, 255
- end
-
- add_concurrent_index :work_item_types,
- 'namespace_id, TRIM(BOTH FROM LOWER(name))',
- unique: true,
- name: :work_item_types_namespace_id_and_name_unique
- end
-
- def down
- with_lock_retries do
- drop_table :work_item_types
- end
- end
-end
diff --git a/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb b/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb
deleted file mode 100644
index 38292cd37c5..00000000000
--- a/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb
+++ /dev/null
@@ -1,31 +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 AddWorkItemTypeIdToIssue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:issues, :work_item_type_id)
- with_lock_retries do
- add_column :issues, :work_item_type_id, :bigint
- end
- end
-
- add_concurrent_index :issues, :work_item_type_id
- add_concurrent_foreign_key :issues, :work_item_types, column: :work_item_type_id, on_delete: nil
- end
-
- def down
- if foreign_key_exists?(:issues, :work_item_types)
- remove_foreign_key :issues, column: :work_item_type_id
- end
-
- with_lock_retries do
- remove_column :issues, :work_item_type_id
- end
- end
-end
diff --git a/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb b/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb
deleted file mode 100644
index 216d43dd62d..00000000000
--- a/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddLabelAppliedIssuableClosedToIssuableSla < ActiveRecord::Migration[6.1]
- def change
- add_column :issuable_slas, :label_applied, :boolean, default: false, null: false
- add_column :issuable_slas, :issuable_closed, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb b/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb
deleted file mode 100644
index a19d15d80a0..00000000000
--- a/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateMergeRequestCleanupSchedulesScheduledAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_mr_cleanup_schedules_timestamps_status'
- OLD_INDEX_NAME = 'index_mr_cleanup_schedules_timestamps'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:merge_request_cleanup_schedules, :scheduled_at, where: 'completed_at IS NULL AND status = 0', name: INDEX_NAME)
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, OLD_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, INDEX_NAME)
- add_concurrent_index(:merge_request_cleanup_schedules, :scheduled_at, where: 'completed_at IS NULL', name: OLD_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210713123345_create_dast_profile_schedule.rb b/db/migrate/20210713123345_create_dast_profile_schedule.rb
deleted file mode 100644
index ea660de572a..00000000000
--- a/db/migrate/20210713123345_create_dast_profile_schedule.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastProfileSchedule < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_profile_schedules_active_next_run_at'
-
- def up
- table_comment = {
- owner: 'group::dynamic analysis', description: 'Scheduling for scans using DAST Profiles'
- }
-
- create_table_with_constraints :dast_profile_schedules, comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :project_id, null: false
- t.bigint :dast_profile_id, null: false
- t.bigint :user_id
-
- t.datetime_with_timezone :next_run_at, null: false
- t.timestamps_with_timezone null: false
- t.boolean :active, default: true, null: false
- t.text :cron, null: false
- t.text_limit :cron, 255
-
- t.index %i[active next_run_at], name: INDEX_NAME
- t.index %i[project_id dast_profile_id], unique: true
- t.index :dast_profile_id
- t.index :user_id
- end
- end
-
- def down
- with_lock_retries do
- drop_table :dast_profile_schedules
- end
- end
-end
diff --git a/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb b/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb
deleted file mode 100644
index 74f24364177..00000000000
--- a/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionVulnerabilityManagementUsedCount < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :vulnerability_management_used_count, :integer
- end
-end
diff --git a/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb b/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb
deleted file mode 100644
index 27eb2691754..00000000000
--- a/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilitiesCreatedAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_vulnerabilities_partial_devops_adoption'
-
- def up
- add_concurrent_index :vulnerabilities, [:project_id, :created_at], where: 'state != 1', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210713211008_create_banned_users.rb b/db/migrate/20210713211008_create_banned_users.rb
deleted file mode 100644
index 7e5eb7f95b8..00000000000
--- a/db/migrate/20210713211008_create_banned_users.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBannedUsers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :banned_users, id: false do |t|
- t.timestamps_with_timezone null: false
- t.references :user, primary_key: true, default: nil, foreign_key: { on_delete: :cascade }, type: :bigint, index: false, null: false
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :banned_users
- end
- end
-end
diff --git a/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb b/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb
deleted file mode 100644
index f0b9addb5f2..00000000000
--- a/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNullConstraintFromSecurityFindings < ActiveRecord::Migration[6.1]
- def up
- change_column_null :security_findings, :project_fingerprint, true
- end
-
- def down
- # no-op, it can not be reverted due to existing records that might not be valid
- end
-end
diff --git a/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb b/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb
deleted file mode 100644
index 5931941a95e..00000000000
--- a/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexForLabelAppliedToIssuableSla < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issuable_slas_on_due_at_id_label_applied_issuable_closed'
-
- def up
- add_concurrent_index :issuable_slas, [:due_at, :id], name: INDEX_NAME, where: 'label_applied = FALSE AND issuable_closed = FALSE'
- end
-
- def down
- remove_concurrent_index_by_name :issuable_slas, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb b/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb
deleted file mode 100644
index fb18ac4e174..00000000000
--- a/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddDetectedAtToVulnerabilities < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerabilities, :detected_at, :datetime_with_timezone
- change_column_default :vulnerabilities, :detected_at, -> { 'NOW()' }
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerabilities, :detected_at
- end
- end
-end
diff --git a/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb b/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb
deleted file mode 100644
index c042a875f57..00000000000
--- a/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnDastProfile < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :dast_profiles, column: :dast_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :dast_profile_id
- end
- end
-end
diff --git a/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb b/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb
deleted file mode 100644
index 576cee090ff..00000000000
--- a/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnUser < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :users, column: :user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb b/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb
deleted file mode 100644
index cfc76c4a12c..00000000000
--- a/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20210716074555_revert_default_job_token_scope.rb b/db/migrate/20210716074555_revert_default_job_token_scope.rb
deleted file mode 100644
index d28f75605e4..00000000000
--- a/db/migrate/20210716074555_revert_default_job_token_scope.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RevertDefaultJobTokenScope < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- 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/20210719145532_add_foreign_keys_view.rb b/db/migrate/20210719145532_add_foreign_keys_view.rb
deleted file mode 100644
index 2d31371e782..00000000000
--- a/db/migrate/20210719145532_add_foreign_keys_view.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeysView < ActiveRecord::Migration[6.1]
- def up
- execute(<<~SQL)
- CREATE OR REPLACE VIEW postgres_foreign_keys AS
- SELECT
- pg_constraint.oid AS oid,
- pg_constraint.conname AS name,
- constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,
- referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier
- FROM pg_constraint
- INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid
- INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid
- INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid
- INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid
- WHERE contype = 'f';
- SQL
- end
-
- def down
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_foreign_keys
- SQL
- end
-end
diff --git a/db/migrate/20210719182944_add_request_response_to_supporing_message.rb b/db/migrate/20210719182944_add_request_response_to_supporing_message.rb
deleted file mode 100644
index a374361e88d..00000000000
--- a/db/migrate/20210719182944_add_request_response_to_supporing_message.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequestResponseToSupporingMessage < ActiveRecord::Migration[6.1]
- def change
- change_column_null(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_id, true)
- change_column_null(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_id, true)
-
- # rubocop: disable Migration/AddReference
- # Table is empty, so no need to use add_concurrent_foreign_key and add_concurrent_index
- add_reference(:vulnerability_finding_evidence_requests,
- :vulnerability_finding_evidence_supporting_message,
- index: { name: 'finding_evidence_requests_on_supporting_evidence_id' },
- foreign_key: { on_delete: :cascade })
- add_reference(:vulnerability_finding_evidence_responses,
- :vulnerability_finding_evidence_supporting_message,
- index: { name: 'finding_evidence_responses_on_supporting_evidence_id' },
- foreign_key: { on_delete: :cascade })
- # rubocop:enable Migration/AddReference
- end
-end
diff --git a/db/migrate/20210719192928_add_invite_email_success_to_member.rb b/db/migrate/20210719192928_add_invite_email_success_to_member.rb
deleted file mode 100644
index ad629483a82..00000000000
--- a/db/migrate/20210719192928_add_invite_email_success_to_member.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddInviteEmailSuccessToMember < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210720083432_change_application_setting_terms_not_null.rb b/db/migrate/20210720083432_change_application_setting_terms_not_null.rb
deleted file mode 100644
index 76dbbe68967..00000000000
--- a/db/migrate/20210720083432_change_application_setting_terms_not_null.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeApplicationSettingTermsNotNull < ActiveRecord::Migration[6.1]
- def up
- execute("UPDATE application_setting_terms SET terms = '' WHERE terms IS NULL")
- change_column_null :application_setting_terms, :terms, false
- end
-
- def down
- change_column_null :application_setting_terms, :terms, true
- end
-end
diff --git a/db/migrate/20210720130006_create_error_tracking_client_keys.rb b/db/migrate/20210720130006_create_error_tracking_client_keys.rb
deleted file mode 100644
index caea4a3d65b..00000000000
--- a/db/migrate/20210720130006_create_error_tracking_client_keys.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingClientKeys < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_client_keys do |t|
- t.references :project,
- index: true,
- null: false,
- foreign_key: { on_delete: :cascade }
-
- t.boolean :active, default: true, null: false
- t.text :public_key, null: false
- t.text_limit :public_key, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_client_keys
- end
-end
diff --git a/db/migrate/20210720140841_create_postgres_async_indexes_table.rb b/db/migrate/20210720140841_create_postgres_async_indexes_table.rb
deleted file mode 100644
index 99025149840..00000000000
--- a/db/migrate/20210720140841_create_postgres_async_indexes_table.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePostgresAsyncIndexesTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :postgres_async_indexes do |t|
- t.timestamps_with_timezone null: false
-
- t.text :name, null: false
- t.text :definition, null: false
- t.text :table_name, null: false
-
- t.text_limit :name, 63
- t.text_limit :definition, 2048
- t.text_limit :table_name, 63
-
- t.index :name, unique: true
- end
- end
-
- def down
- with_lock_retries do
- drop_table :postgres_async_indexes
- end
- end
-end
diff --git a/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb b/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb
deleted file mode 100644
index 7e4a785cb54..00000000000
--- a/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSignedFileToPackagesDebianProjectDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files
- def change
- add_column :packages_debian_project_distributions, :signed_file, :text
- add_column :packages_debian_project_distributions, :signed_file_store, :integer, limit: 2, default: 1, null: false
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb b/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb
deleted file mode 100644
index f27c158bed2..00000000000
--- a/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSignedFileToPackagesDebianGroupDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files
- def change
- add_column :packages_debian_group_distributions, :signed_file, :text
- add_column :packages_debian_group_distributions, :signed_file_store, :integer, limit: 2, default: 1, null: false
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb b/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb
deleted file mode 100644
index 77524a5b068..00000000000
--- a/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToPackagesDebianProjectDistributionsSignedFiles < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- add_text_limit :packages_debian_project_distributions, :signed_file, 255
- end
-
- def down
- remove_text_limit :packages_debian_project_distributions, :signed_file
- end
-end
diff --git a/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb b/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb
deleted file mode 100644
index ef203cb2ff7..00000000000
--- a/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToPackagesDebianGroupDistributionsSignedFiles < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- add_text_limit :packages_debian_group_distributions, :signed_file, 255
- end
-
- def down
- remove_text_limit :packages_debian_group_distributions, :signed_file
- end
-end
diff --git a/db/migrate/20210721134706_add_type_new_to_integrations.rb b/db/migrate/20210721134706_add_type_new_to_integrations.rb
deleted file mode 100644
index b43fb73436c..00000000000
--- a/db/migrate/20210721134706_add_type_new_to_integrations.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddTypeNewToIntegrations < ActiveRecord::Migration[6.1]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721134707_add_text_limit_to_integrations_type_new
- def change
- add_column :integrations, :type_new, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb b/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb
deleted file mode 100644
index 8fb98abad8c..00000000000
--- a/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :integrations, :type_new, 255
- end
-
- def down
- remove_text_limit :integrations, :type_new
- end
-end
diff --git a/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb b/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb
deleted file mode 100644
index 6b1f2aeba18..00000000000
--- a/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class AddTriggersToIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'integrations_set_type_new'
- TRIGGER_ON_INSERT_NAME = 'trigger_type_new_on_insert'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- # This list matches `Gitlab::Integrations::StiType::NAMESPACED_INTEGRATIONS`.
- #
- # If we add new integrations after this migration we can directly use the
- # correct class name in `type`, and don't need to add it to `NAMESPACED_INTEGRATIONS`.
- <<~SQL
- WITH mapping(old_type, new_type) AS (VALUES
- ('AsanaService', 'Integrations::Asana'),
- ('AssemblaService', 'Integrations::Assembla'),
- ('BambooService', 'Integrations::Bamboo'),
- ('BugzillaService', 'Integrations::Bugzilla'),
- ('BuildkiteService', 'Integrations::Buildkite'),
- ('CampfireService', 'Integrations::Campfire'),
- ('ConfluenceService', 'Integrations::Confluence'),
- ('CustomIssueTrackerService', 'Integrations::CustomIssueTracker'),
- ('DatadogService', 'Integrations::Datadog'),
- ('DiscordService', 'Integrations::Discord'),
- ('DroneCiService', 'Integrations::DroneCi'),
- ('EmailsOnPushService', 'Integrations::EmailsOnPush'),
- ('EwmService', 'Integrations::Ewm'),
- ('ExternalWikiService', 'Integrations::ExternalWiki'),
- ('FlowdockService', 'Integrations::Flowdock'),
- ('HangoutsChatService', 'Integrations::HangoutsChat'),
- ('IrkerService', 'Integrations::Irker'),
- ('JenkinsService', 'Integrations::Jenkins'),
- ('JiraService', 'Integrations::Jira'),
- ('MattermostService', 'Integrations::Mattermost'),
- ('MattermostSlashCommandsService', 'Integrations::MattermostSlashCommands'),
- ('MicrosoftTeamsService', 'Integrations::MicrosoftTeams'),
- ('MockCiService', 'Integrations::MockCi'),
- ('MockMonitoringService', 'Integrations::MockMonitoring'),
- ('PackagistService', 'Integrations::Packagist'),
- ('PipelinesEmailService', 'Integrations::PipelinesEmail'),
- ('PivotaltrackerService', 'Integrations::Pivotaltracker'),
- ('PrometheusService', 'Integrations::Prometheus'),
- ('PushoverService', 'Integrations::Pushover'),
- ('RedmineService', 'Integrations::Redmine'),
- ('SlackService', 'Integrations::Slack'),
- ('SlackSlashCommandsService', 'Integrations::SlackSlashCommands'),
- ('TeamcityService', 'Integrations::Teamcity'),
- ('UnifyCircuitService', 'Integrations::UnifyCircuit'),
- ('YoutrackService', 'Integrations::Youtrack'),
- ('WebexTeamsService', 'Integrations::WebexTeams'),
-
- -- EE-only integrations
- ('GithubService', 'Integrations::Github'),
- ('GitlabSlackApplicationService', 'Integrations::GitlabSlackApplication')
- )
-
- UPDATE integrations SET type_new = mapping.new_type
- FROM mapping
- WHERE integrations.id = NEW.id
- AND mapping.old_type = NEW.type;
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON integrations
- FOR EACH ROW
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:integrations, TRIGGER_ON_INSERT_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210721145029_add_state_to_members.rb b/db/migrate/20210721145029_add_state_to_members.rb
deleted file mode 100644
index d727c858374..00000000000
--- a/db/migrate/20210721145029_add_state_to_members.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateToMembers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb b/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb
deleted file mode 100644
index 00af9414ab7..00000000000
--- a/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddIsRemovedToEscalationRules < ActiveRecord::Migration[6.1]
- def change
- add_column :incident_management_escalation_rules, :is_removed, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb b/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb
deleted file mode 100644
index cf52a43435f..00000000000
--- a/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateEscalationRuleFkForPendingAlertEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- OLD_FOREIGN_KEY_CONSTRAINT = 'fk_rails_057c1e3d87'
-
- # Swap foreign key contrainst from ON DELETE SET NULL to ON DELETE CASCADE
- def up
- remove_foreign_key_if_exists :incident_management_pending_alert_escalations, :incident_management_escalation_rules, name: OLD_FOREIGN_KEY_CONSTRAINT
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_alert_escalations,
- :incident_management_escalation_rules,
- column: :rule_id
- end
-
- def down
- remove_foreign_key_if_exists :incident_management_pending_alert_escalations, :incident_management_escalation_rules, column: :rule_id
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_alert_escalations,
- :incident_management_escalation_rules,
- column: :rule_id,
- on_delete: :nullify,
- name: OLD_FOREIGN_KEY_CONSTRAINT
- end
-end
diff --git a/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb b/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb
deleted file mode 100644
index 89adaf89693..00000000000
--- a/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveScheduleAndStatusNullConstraintsFromPendingEscalationsAlert < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # In preparation of removal of these columns in 14.3.
- def up
- with_lock_retries do
- change_column_null :incident_management_pending_alert_escalations, :status, true
- change_column_null :incident_management_pending_alert_escalations, :schedule_id, true
- end
- end
-
- def down
- backfill_from_rules_and_disallow_column_null :status, value: :status
- backfill_from_rules_and_disallow_column_null :schedule_id, value: :oncall_schedule_id
- end
-
- private
-
- def backfill_from_rules_and_disallow_column_null(column, value:)
- with_lock_retries do
- execute <<~SQL
- UPDATE incident_management_pending_alert_escalations AS escalations
- SET #{column} = rules.#{value}
- FROM incident_management_escalation_rules AS rules
- WHERE rule_id = rules.id
- AND escalations.#{column} IS NULL
- SQL
-
- change_column_null :incident_management_pending_alert_escalations, column, false
- end
- end
-end
diff --git a/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb b/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb
deleted file mode 100644
index 3c0fa35d9c3..00000000000
--- a/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilityAmountColumnIntoApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :vulnerabilities_allowed, :integer, limit: 2
- end
-
- def down
- remove_column :approval_project_rules, :vulnerabilities_allowed
- end
-end
diff --git a/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb b/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
deleted file mode 100644
index 7146c6c9537..00000000000
--- a/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNullConstraintOnScheduleFromEscalationRules < ActiveRecord::Migration[6.1]
- def up
- change_column_null :incident_management_escalation_rules, :oncall_schedule_id, true
- end
-
- def down
- exec_query 'DELETE FROM incident_management_escalation_rules WHERE oncall_schedule_id IS NULL'
-
- change_column_null :incident_management_escalation_rules, :oncall_schedule_id, false
- end
-end
diff --git a/db/migrate/20210722074242_add_user_to_escalation_rules.rb b/db/migrate/20210722074242_add_user_to_escalation_rules.rb
deleted file mode 100644
index 061dd6194f7..00000000000
--- a/db/migrate/20210722074242_add_user_to_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :incident_management_escalation_rules, :user_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :incident_management_escalation_rules, :user_id
- end
- end
-end
diff --git a/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb b/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb
deleted file mode 100644
index 047149d6e7c..00000000000
--- a/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserIndexToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- USER_INDEX_NAME = 'index_escalation_rules_on_user'
- OLD_UNIQUE_INDEX_NAME = 'index_on_policy_schedule_status_elapsed_time_escalation_rules'
- NEW_UNIQUE_INDEX_NAME = 'index_escalation_rules_on_all_attributes'
-
- def up
- remove_concurrent_index_by_name :incident_management_escalation_rules, OLD_UNIQUE_INDEX_NAME
-
- add_concurrent_index :incident_management_escalation_rules, :user_id, name: USER_INDEX_NAME
- add_concurrent_index :incident_management_escalation_rules,
- [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds, :user_id],
- unique: true,
- name: NEW_UNIQUE_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :incident_management_escalation_rules, USER_INDEX_NAME
- remove_concurrent_index_by_name :incident_management_escalation_rules, NEW_UNIQUE_INDEX_NAME
-
- exec_query 'DELETE FROM incident_management_escalation_rules WHERE oncall_schedule_id IS NULL'
-
- add_concurrent_index :incident_management_escalation_rules,
- [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds],
- unique: true,
- name: OLD_UNIQUE_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb b/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb
deleted file mode 100644
index acdfc1ed835..00000000000
--- a/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserFkToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_escalation_rules, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :incident_management_escalation_rules, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb b/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb
deleted file mode 100644
index bd140e1da56..00000000000
--- a/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddXorCheckConstraintForEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'escalation_rules_one_of_oncall_schedule_or_user'
-
- def up
- add_check_constraint :incident_management_escalation_rules, 'num_nonnulls(oncall_schedule_id, user_id) = 1', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :incident_management_escalation_rules, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb b/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb
deleted file mode 100644
index 3f74f72454d..00000000000
--- a/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class DevopsAdoptionDropRedundantIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_SAST = 'index_ci_job_artifacts_sast_for_devops_adoption'
- INDEX_DAST = 'index_ci_job_artifacts_dast_for_devops_adoption'
-
- def up
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_SAST
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_DAST
- end
-
- def down
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 5", name: INDEX_SAST
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 8", name: INDEX_DAST
- end
-end
diff --git a/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb b/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb
deleted file mode 100644
index 974559239d7..00000000000
--- a/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class OperationsFeatureFlagsCorrectFlexibleRolloutValues < ActiveRecord::Migration[6.1]
- STICKINESS = { "USERID" => "userId", "RANDOM" => "random", "SESSIONID" => "sessionId", "DEFAULT" => "default" }.freeze
-
- def up
- STICKINESS.each do |before, after|
- update_statement = <<-SQL
- UPDATE operations_strategies
- SET parameters = parameters || jsonb_build_object('stickiness', '#{quote_string(after)}')
- WHERE name = 'flexibleRollout' AND parameters->>'stickiness' = '#{quote_string(before)}'
- SQL
-
- execute(update_statement)
- end
- end
-
- def down
- STICKINESS.each do |before, after|
- update_statement = <<-SQL
- UPDATE operations_strategies
- SET parameters = parameters || jsonb_build_object('stickiness', '#{quote_string(before)}')
- WHERE name = 'flexibleRollout' AND parameters->>'stickiness' = '#{quote_string(after)}'
- SQL
-
- execute(update_statement)
- end
- end
-end
diff --git a/db/migrate/20210722151951_add_columns_to_security_scans.rb b/db/migrate/20210722151951_add_columns_to_security_scans.rb
deleted file mode 100644
index 341cef057ce..00000000000
--- a/db/migrate/20210722151951_add_columns_to_security_scans.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddColumnsToSecurityScans < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :security_scans, :project_id, :bigint
- add_column :security_scans, :pipeline_id, :bigint
- end
- end
-
- def down
- with_lock_retries do
- remove_column :security_scans, :project_id, :bigint
- remove_column :security_scans, :pipeline_id, :bigint
- end
- end
-end
diff --git a/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb b/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb
deleted file mode 100644
index 4678aba2cff..00000000000
--- a/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddOverriddenUuidToSecurityFindings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :security_findings, :overridden_uuid, :uuid, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :security_findings, :overridden_uuid
- end
- end
-end
diff --git a/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb b/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb
deleted file mode 100644
index cfaff4d0304..00000000000
--- a/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexOnEnvironmentsAutoDeleteAt < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_environments_on_state_and_auto_delete_at'
-
- def up
- add_concurrent_index :environments,
- %i[auto_delete_at],
- where: "auto_delete_at IS NOT NULL AND state = 'stopped'",
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :environments, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb b/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb
deleted file mode 100644
index 5fd558e0c1b..00000000000
--- a/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddIntegratedToErrorTrackingSetting < ActiveRecord::Migration[6.1]
- def up
- add_column :project_error_tracking_settings, :integrated, :boolean, null: false, default: false
- end
-
- def down
- remove_column :project_error_tracking_settings, :integrated
- end
-end
diff --git a/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb b/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb
deleted file mode 100644
index bd17a9df5df..00000000000
--- a/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilitySeveritiesIntoApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :severity_levels, :text, array: true, null: false, default: []
- end
-
- def down
- remove_column :approval_project_rules, :severity_levels
- end
-end
diff --git a/db/migrate/20210728110654_add_status_to_error_tracking_error.rb b/db/migrate/20210728110654_add_status_to_error_tracking_error.rb
deleted file mode 100644
index 035f97dc963..00000000000
--- a/db/migrate/20210728110654_add_status_to_error_tracking_error.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToErrorTrackingError < ActiveRecord::Migration[6.1]
- def up
- add_column :error_tracking_errors, :status, :integer, null: false, default: 0, limit: 2
- end
-
- def down
- remove_column :error_tracking_errors, :status
- end
-end
diff --git a/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb b/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb
deleted file mode 100644
index 418097b92e5..00000000000
--- a/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkToSecurityScansColumns < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :security_scans, :project_id
- add_concurrent_foreign_key :security_scans, :projects, column: :project_id, on_delete: :cascade
-
- add_concurrent_index :security_scans, :pipeline_id
- end
-
- def down
- remove_foreign_key :security_scans, column: :project_id
- remove_concurrent_index_by_name :security_scans, name: 'index_security_scans_on_project_id'
-
- remove_concurrent_index_by_name :security_scans, name: 'index_security_scans_on_pipeline_id'
- end
-end
diff --git a/db/migrate/20210729061526_add_pronunciation_to_user_details.rb b/db/migrate/20210729061526_add_pronunciation_to_user_details.rb
deleted file mode 100644
index 6e0c8f1e808..00000000000
--- a/db/migrate/20210729061526_add_pronunciation_to_user_details.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddPronunciationToUserDetails < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210729061556_add_text_limit_to_user_details_pronunciation.rb
- with_lock_retries do
- add_column :user_details, :pronunciation, :text, null: true
- end
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- with_lock_retries do
- remove_column :user_details, :pronunciation
- end
- end
-end
diff --git a/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb b/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb
deleted file mode 100644
index 5466ee7bafa..00000000000
--- a/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserDetailsPronunciation < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_details, :pronunciation, 255
- end
-
- def down
- remove_text_limit :user_details, :pronunciation
- end
-end
diff --git a/db/migrate/20210729081351_create_topics.rb b/db/migrate/20210729081351_create_topics.rb
deleted file mode 100644
index 13ed2dc7ccc..00000000000
--- a/db/migrate/20210729081351_create_topics.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateTopics < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :topics do |t|
- t.text :name, null: false
- t.text_limit :name, 255
-
- t.index :name, unique: true
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- drop_table :topics
- end
- end
-end
diff --git a/db/migrate/20210729081739_create_project_topics.rb b/db/migrate/20210729081739_create_project_topics.rb
deleted file mode 100644
index cbb8842f653..00000000000
--- a/db/migrate/20210729081739_create_project_topics.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectTopics < ActiveRecord::Migration[6.1]
- def change
- create_table :project_topics do |t|
- t.bigint :project_id, null: false
- t.bigint :topic_id, null: false
-
- t.index :project_id
- t.index :topic_id
- t.index [:project_id, :topic_id], unique: true
-
- t.timestamps_with_timezone
- end
- end
-end
diff --git a/db/migrate/20210729123101_confirm_security_bot.rb b/db/migrate/20210729123101_confirm_security_bot.rb
deleted file mode 100644
index 2184cc4e193..00000000000
--- a/db/migrate/20210729123101_confirm_security_bot.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class ConfirmSecurityBot < ActiveRecord::Migration[6.0]
- class User < ActiveRecord::Base
- self.table_name = 'users'
- SECURITY_BOT_TYPE = 8
- end
-
- def up
- User.where(user_type: User::SECURITY_BOT_TYPE, confirmed_at: nil)
- .update_all(confirmed_at: Time.current)
- end
-
- # no-op
- # Security Bot should be always confirmed
- def down
- end
-end
diff --git a/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb b/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb
deleted file mode 100644
index 27cf5c60cf0..00000000000
--- a/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToProjectOnProjectTopic < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :project_topics, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :project_topics, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb b/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb
deleted file mode 100644
index 1ada08dca1a..00000000000
--- a/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToTopicOnProjectTopic < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :project_topics, :topics, column: :topic_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :project_topics, column: :topic_id
- end
- end
-end
diff --git a/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb b/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb
deleted file mode 100644
index 2193a698272..00000000000
--- a/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromCiTestCaseFailures < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = :ci_test_case_failures
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :build_id)
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :test_case_id)
- end
- end
-
- def down
- add_concurrent_foreign_key(TABLE_NAME, :ci_builds, column: :build_id, on_delete: :cascade)
- add_concurrent_foreign_key(TABLE_NAME, :ci_test_cases, column: :test_case_id, on_delete: :cascade)
- end
-end
diff --git a/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb b/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb
deleted file mode 100644
index 1d0a5f4fd64..00000000000
--- a/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromCiTestCases < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = :ci_test_cases
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :project_id)
- end
- end
-
- def down
- add_concurrent_foreign_key(TABLE_NAME, :projects, column: :project_id, on_delete: :cascade)
- end
-end
diff --git a/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb b/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
deleted file mode 100644
index b16904a3b47..00000000000
--- a/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementIssuableEscalationStatuses < ActiveRecord::Migration[6.1]
- ISSUE_IDX = 'index_uniq_im_issuable_escalation_statuses_on_issue_id'
- POLICY_IDX = 'index_im_issuable_escalation_statuses_on_policy_id'
-
- def change
- create_table :incident_management_issuable_escalation_statuses do |t|
- t.timestamps_with_timezone
-
- t.references :issue, foreign_key: { on_delete: :cascade }, index: { unique: true, name: ISSUE_IDX }, null: false
- t.references :policy, foreign_key: { to_table: :incident_management_escalation_policies, on_delete: :nullify }, index: { name: POLICY_IDX }
-
- t.datetime_with_timezone :escalations_started_at
- t.datetime_with_timezone :resolved_at
-
- t.integer :status, default: 0, null: false, limit: 2
- end
- end
-end
diff --git a/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb b/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb
deleted file mode 100644
index ad517fbbff0..00000000000
--- a/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsStageEventHashes < ActiveRecord::Migration[6.1]
- def change
- create_table :analytics_cycle_analytics_stage_event_hashes do |t|
- t.binary :hash_sha256
- t.index :hash_sha256, unique: true, name: 'index_cycle_analytics_stage_event_hashes_on_hash_sha_256'
- end
- end
-end
diff --git a/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb b/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb
deleted file mode 100644
index 2909df78a6a..00000000000
--- a/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddStageHashFkToProjectStages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:analytics_cycle_analytics_project_stages, :stage_event_hash_id)
- add_column :analytics_cycle_analytics_project_stages, :stage_event_hash_id, :bigint
- end
-
- add_concurrent_index :analytics_cycle_analytics_project_stages, :stage_event_hash_id, name: 'index_project_stages_on_stage_event_hash_id'
- add_concurrent_foreign_key :analytics_cycle_analytics_project_stages, :analytics_cycle_analytics_stage_event_hashes, column: :stage_event_hash_id, on_delete: :cascade
- end
-
- def down
- remove_column :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-end
diff --git a/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb b/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb
deleted file mode 100644
index 3cd53f2bb50..00000000000
--- a/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddStageHashFkToGroupStages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:analytics_cycle_analytics_group_stages, :stage_event_hash_id)
- add_column :analytics_cycle_analytics_group_stages, :stage_event_hash_id, :bigint
- end
-
- add_concurrent_index :analytics_cycle_analytics_group_stages, :stage_event_hash_id, name: 'index_group_stages_on_stage_event_hash_id'
- add_concurrent_foreign_key :analytics_cycle_analytics_group_stages, :analytics_cycle_analytics_stage_event_hashes, column: :stage_event_hash_id, on_delete: :cascade
- end
-
- def down
- remove_column :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- end
-end
diff --git a/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb b/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb
deleted file mode 100644
index 20a6fde96ff..00000000000
--- a/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementPendingIssueEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- execute(<<~SQL)
- CREATE TABLE incident_management_pending_issue_escalations (
- id bigserial 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,
- PRIMARY KEY (id, process_at)
- ) PARTITION BY RANGE (process_at);
-
- CREATE INDEX index_incident_management_pending_issue_escalations_on_issue_id
- ON incident_management_pending_issue_escalations USING btree (issue_id);
-
- CREATE INDEX index_incident_management_pending_issue_escalations_on_rule_id
- ON incident_management_pending_issue_escalations USING btree (rule_id);
- SQL
- end
- end
-
- def down
- with_lock_retries do
- drop_table :incident_management_pending_issue_escalations
- end
- end
-end
diff --git a/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb b/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb
deleted file mode 100644
index 38d72496484..00000000000
--- a/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToVulnerabilityFlagsTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_vulnerability_flags_on_unique_columns'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerability_flags, [:vulnerability_occurrence_id, :flag_type, :origin], name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_flags, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210804150320_create_base_work_item_types.rb b/db/migrate/20210804150320_create_base_work_item_types.rb
deleted file mode 100644
index 836264aae6e..00000000000
--- a/db/migrate/20210804150320_create_base_work_item_types.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBaseWorkItemTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- module WorkItem
- class Type < ActiveRecord::Base
- self.table_name = 'work_item_types'
-
- enum base_type: {
- issue: 0,
- incident: 1,
- test_case: 2,
- requirement: 3
- }
-
- validates :name, uniqueness: { case_sensitive: false, scope: [:namespace_id] }
- end
- end
-
- def up
- # create default types
- WorkItem::Type.create(name: 'Issue', namespace_id: nil, base_type: :issue, icon_name: 'issue-type-issue')
- WorkItem::Type.create(name: 'Incident', namespace_id: nil, base_type: :incident, icon_name: 'issue-type-incident')
- WorkItem::Type.create(name: 'Test Case', namespace_id: nil, base_type: :test_case, icon_name: 'issue-type-test-case')
- WorkItem::Type.create(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/20210804200114_create_customer_relations_organizations.rb b/db/migrate/20210804200114_create_customer_relations_organizations.rb
deleted file mode 100644
index 9936e97b9bf..00000000000
--- a/db/migrate/20210804200114_create_customer_relations_organizations.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCustomerRelationsOrganizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :customer_relations_organizations do |t|
- t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.integer :state, limit: 1, default: 1, null: false
- t.decimal :default_rate, precision: 18, scale: 2
- t.text :name, null: false
- t.text :description
-
- t.text_limit :name, 255
- t.text_limit :description, 1024
-
- t.index 'group_id, LOWER(name)', unique: true, name: :index_customer_relations_organizations_on_unique_name_per_group
- end
- end
-
- def down
- with_lock_retries do
- drop_table :customer_relations_organizations
- end
- end
-end
diff --git a/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb b/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb
deleted file mode 100644
index 66fcf485b2f..00000000000
--- a/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb
+++ /dev/null
@@ -1,20 +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 AddTmpIndexApprovalProjectRulesScanners < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'tmp_index_approval_project_rules_scanners'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :approval_project_rules, :scanners, name: INDEX_NAME, using: :gin, where: "scanners @> '{cluster_image_scanning}'"
- end
-
- def down
- remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb b/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb
deleted file mode 100644
index ea77e29d365..00000000000
--- a/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRuleIndexToSecurityOrchestrationPolicyRuleSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :security_orchestration_policy_rule_schedules, :rule_index, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb b/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb
deleted file mode 100644
index 34f8ec43a8f..00000000000
--- a/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPypiPackageRequestsForwardingToApplicationSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column(:application_settings, :pypi_package_requests_forwarding, :boolean, default: true, null: false)
- end
- end
-
- def down
- with_lock_retries do
- remove_column(:application_settings, :pypi_package_requests_forwarding)
- end
- end
-end
diff --git a/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb b/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb
deleted file mode 100644
index c9b17e3d5c5..00000000000
--- a/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddCadenceToDastProfileSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :dast_profile_schedules, :cadence, :jsonb, null: false, default: {}
- end
-end
diff --git a/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb b/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb
deleted file mode 100644
index 3c3eb507432..00000000000
--- a/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimezoneToDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- # We disable these cops here because adding the column is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Rails/NotNullColumn
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- unless column_exists?(:dast_profile_schedules, :timezone)
- add_column :dast_profile_schedules, :timezone, :text, null: false
- end
-
- add_text_limit :dast_profile_schedules, :timezone, 255
- end
-
- def down
- return unless column_exists?(:dast_profile_schedules, :timezone)
-
- remove_column :dast_profile_schedules, :timezone
- end
-end
diff --git a/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb b/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb
deleted file mode 100644
index 4eea5fd7e8c..00000000000
--- a/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStartsAtToDastProfileSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :dast_profile_schedules, :starts_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' }
- end
-end
diff --git a/db/migrate/20210809014850_create_agent_group_authorizations.rb b/db/migrate/20210809014850_create_agent_group_authorizations.rb
deleted file mode 100644
index 43d7e63e0a2..00000000000
--- a/db/migrate/20210809014850_create_agent_group_authorizations.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAgentGroupAuthorizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- create_table :agent_group_authorizations do |t|
- t.bigint :group_id, null: false
- t.bigint :agent_id, null: false
- t.jsonb :config, null: false
-
- t.index :group_id
- t.index [:agent_id, :group_id], unique: true
- end
- end
-end
diff --git a/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb b/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb
deleted file mode 100644
index 2a3a51d0ca9..00000000000
--- a/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddAgentGroupAuthorizationsForeignKeys < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :agent_group_authorizations, :namespaces, column: :group_id
- add_concurrent_foreign_key :agent_group_authorizations, :cluster_agents, column: :agent_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :agent_group_authorizations, column: :group_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_group_authorizations, column: :agent_id
- end
- end
-end
diff --git a/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb b/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb
deleted file mode 100644
index 76308e2ea8e..00000000000
--- a/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RenameTablesCiBuildTraceSection < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- # Shorten deprecated to dep to avoid 'Index name..too long'
- rename_table(:ci_build_trace_sections, :dep_ci_build_trace_sections)
- rename_table(:ci_build_trace_section_names, :dep_ci_build_trace_section_names)
- end
-end
diff --git a/db/migrate/20210811120204_create_customer_relations_contacts.rb b/db/migrate/20210811120204_create_customer_relations_contacts.rb
deleted file mode 100644
index 0c26ee0ef59..00000000000
--- a/db/migrate/20210811120204_create_customer_relations_contacts.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCustomerRelationsContacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :customer_relations_contacts do |t|
- t.bigint :group_id, null: false
- t.references :organization, index: true, null: true, foreign_key: { to_table: :customer_relations_organizations, on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.integer :state, limit: 1, default: 1, null: false
- t.text :phone
- t.text :first_name, null: false
- t.text :last_name, null: false
- t.text :email
- t.text :description
-
- t.text_limit :phone, 32
- t.text_limit :first_name, 255
- t.text_limit :last_name, 255
- t.text_limit :email, 255
- t.text_limit :description, 1024
- end
- end
-
- def down
- with_lock_retries do
- drop_table :customer_relations_contacts
- end
- end
-end
diff --git a/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb b/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
deleted file mode 100644
index cf51bca630a..00000000000
--- a/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToVulnerabilityFindingLinks < Gitlab::Database::Migration[1.0]
- # This migration has been moved to 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/migrate/20210812171704_create_project_ci_feature_usages.rb b/db/migrate/20210812171704_create_project_ci_feature_usages.rb
deleted file mode 100644
index 376512bcb44..00000000000
--- a/db/migrate/20210812171704_create_project_ci_feature_usages.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectCiFeatureUsages < ActiveRecord::Migration[6.1]
- def change
- create_table :project_ci_feature_usages do |t|
- t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false
- t.integer :feature, null: false, limit: 2
- t.boolean :default_branch, default: false, null: false
- t.index [:project_id, :feature, :default_branch], unique: true, name: 'index_project_ci_feature_usages_unique_columns'
- end
- end
-end
diff --git a/db/migrate/20210813101742_create_zentao_tracker_data.rb b/db/migrate/20210813101742_create_zentao_tracker_data.rb
deleted file mode 100644
index 93d9cde3371..00000000000
--- a/db/migrate/20210813101742_create_zentao_tracker_data.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateZentaoTrackerData < ActiveRecord::Migration[6.1]
- def change
- create_table :zentao_tracker_data do |t|
- t.references :integration, foreign_key: { on_delete: :cascade }, type: :bigint, index: true, null: false
- t.timestamps_with_timezone
- t.binary :encrypted_url
- t.binary :encrypted_url_iv
- t.binary :encrypted_api_url
- t.binary :encrypted_api_url_iv
- t.binary :encrypted_zentao_product_xid
- t.binary :encrypted_zentao_product_xid_iv
- t.binary :encrypted_api_token
- t.binary :encrypted_api_token_iv
- end
- end
-end
diff --git a/db/migrate/20210813111909_create_ci_build_trace_metadata.rb b/db/migrate/20210813111909_create_ci_build_trace_metadata.rb
deleted file mode 100644
index d8b7fd656e0..00000000000
--- a/db/migrate/20210813111909_create_ci_build_trace_metadata.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiBuildTraceMetadata < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :ci_build_trace_metadata, id: false, if_not_exists: true do |t|
- t.references :build,
- index: false,
- primary_key: true,
- default: nil,
- foreign_key: { to_table: :ci_builds, on_delete: :cascade },
- type: :bigint,
- null: false
-
- t.bigint :trace_artifact_id
- t.integer :archival_attempts, default: 0, null: false, limit: 2
- t.binary :checksum
- t.binary :remote_checksum
-
- t.index :trace_artifact_id
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :ci_build_trace_metadata, if_exists: true
- end
- end
-end
diff --git a/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb b/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb
deleted file mode 100644
index 58b2471a96a..00000000000
--- a/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateForeignKeyOnContactsGroupId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_customer_relations_contacts_on_group_id'
-
- def up
- add_concurrent_index :customer_relations_contacts, :group_id, name: INDEX_NAME
- add_concurrent_foreign_key :customer_relations_contacts, :namespaces, column: :group_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :customer_relations_contacts, column: :group_id
- end
-
- remove_concurrent_index_by_name :customer_relations_contacts, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb b/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb
deleted file mode 100644
index b7ea8545df1..00000000000
--- a/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,38 +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 AddUniqueIndexOnDastProfileToDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_profile_schedules_on_dast_profile_id'
- TABLE = :dast_profile_schedules
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- # rubocop: disable Migration/RemoveIndex
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, :dast_profile_id, name: INDEX_NAME
- end
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, :dast_profile_id, unique: true, name: INDEX_NAME
- end
- end
-
- def down
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, :dast_profile_id, name: INDEX_NAME
- end
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, :dast_profile_id
- end
- end
-end
diff --git a/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb b/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb
deleted file mode 100644
index d625ae6d13d..00000000000
--- a/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexContainingFaultyRegex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = "tmp_index_merge_requests_draft_and_status"
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :merge_requests, INDEX_NAME
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/migrate/20210816192041_add_invites_email_success_to_member.rb b/db/migrate/20210816192041_add_invites_email_success_to_member.rb
deleted file mode 100644
index 89f475b056c..00000000000
--- a/db/migrate/20210816192041_add_invites_email_success_to_member.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddInvitesEmailSuccessToMember < ActiveRecord::Migration[6.1]
- def up
- unless column_exists?(:members, :invite_email_success)
- add_column :members, :invite_email_success, :boolean, null: false, default: true
- end
- end
-
- def down
- remove_column :members, :invite_email_success
- end
-end
diff --git a/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb b/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb
deleted file mode 100644
index 032b15234d8..00000000000
--- a/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyFromCiBuildMetadataToCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :ci_build_trace_metadata,
- :ci_job_artifacts,
- column: :trace_artifact_id,
- on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :ci_build_trace_metadata, column: :trace_artifact_id
- end
- end
-end
diff --git a/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb b/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb
deleted file mode 100644
index e4b681d66fb..00000000000
--- a/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectIdNameVersionIdToNpmPackages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_installable_npm_pkgs_on_project_id_name_version_id'
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version, :id], where: 'package_type = 2 AND status = 0', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :packages_packages, [:project_id, :name, :version, :id], where: 'package_type = 2 AND status = 0', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210817172214_add_yaml_limits_application_setting.rb b/db/migrate/20210817172214_add_yaml_limits_application_setting.rb
deleted file mode 100644
index f502ef9825b..00000000000
--- a/db/migrate/20210817172214_add_yaml_limits_application_setting.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddYamlLimitsApplicationSetting < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :max_yaml_size_bytes, :bigint, default: 1.megabyte, null: false
- add_column :application_settings, :max_yaml_depth, :integer, default: 100, null: false
- end
-end
diff --git a/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb b/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
deleted file mode 100644
index 791c5b60e54..00000000000
--- a/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class IndexHistoricalDataOnRecordedAt < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_historical_data_on_recorded_at'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :historical_data, :recorded_at, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :historical_data, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb b/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb
deleted file mode 100644
index d9d05f2b737..00000000000
--- a/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueCommitDesignUserMentionIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- COMMIT_INDEX_NAME = 'commit_id_and_note_id_index'
- DESIGN_INDEX_NAME = 'design_user_mentions_on_design_id_and_note_id_index'
-
- COMMIT_UNIQUE_INDEX_NAME = 'commit_user_mentions_on_commit_id_and_note_id_unique_index'
- DESIGN_UNIQUE_INDEX_NAME = 'design_user_mentions_on_design_id_and_note_id_unique_index'
-
- def up
- add_concurrent_index :commit_user_mentions, [:commit_id, :note_id], unique: true, name: COMMIT_UNIQUE_INDEX_NAME
- add_concurrent_index :design_user_mentions, [:design_id, :note_id], unique: true, name: DESIGN_UNIQUE_INDEX_NAME
-
- remove_concurrent_index_by_name :commit_user_mentions, COMMIT_INDEX_NAME
- remove_concurrent_index_by_name :design_user_mentions, DESIGN_INDEX_NAME
- end
-
- def down
- add_concurrent_index :design_user_mentions, [:design_id, :note_id], name: DESIGN_INDEX_NAME
- add_concurrent_index :commit_user_mentions, [:commit_id, :note_id], name: COMMIT_INDEX_NAME
-
- remove_concurrent_index_by_name :design_user_mentions, DESIGN_UNIQUE_INDEX_NAME
- remove_concurrent_index_by_name :commit_user_mentions, COMMIT_UNIQUE_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb b/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb
deleted file mode 100644
index b50947a0a99..00000000000
--- a/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb
+++ /dev/null
@@ -1,30 +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 RemoveProjectProfileCompoundIndexFromDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :dast_profile_schedules
- INDEX_NAME = 'index_dast_profile_schedules_on_project_id_and_dast_profile_id'
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- # rubocop: disable Migration/RemoveIndex
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, %i[project_id dast_profile_id], name: INDEX_NAME
- end
- end
-
- def down
- execute('DELETE FROM dast_profile_schedules')
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, %i[project_id dast_profile_id], unique: true, name: INDEX_NAME
- end
- end
-end
diff --git a/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb b/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb
deleted file mode 100644
index 392b335ab45..00000000000
--- a/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb
+++ /dev/null
@@ -1,13 +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 AddIndexProjectIdOnDastProfileSchedule < ActiveRecord::Migration[6.1]
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- def change
- add_index :dast_profile_schedules, :project_id
- end
-end
diff --git a/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb b/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb
deleted file mode 100644
index 2999a6fd4f6..00000000000
--- a/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIntegrationsTriggerTypeNewOnInsert < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'integrations_set_type_new'
-
- def up
- # Update `type_new` dynamically based on `type`.
- #
- # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE integrations SET type_new = regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1')
- WHERE integrations.id = NEW.id;
- RETURN NULL;
- SQL
- end
- end
-
- def down
- # We initially went with this static mapping since we assumed that new integrations could
- # just use the correct class name directly in `type`, but this will complicate the data migration
- # since we plan to drop `type` at some point and replace it with `type_new`, so we still need
- # to keep this column filled for all records.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- WITH mapping(old_type, new_type) AS (VALUES
- ('AsanaService', 'Integrations::Asana'),
- ('AssemblaService', 'Integrations::Assembla'),
- ('BambooService', 'Integrations::Bamboo'),
- ('BugzillaService', 'Integrations::Bugzilla'),
- ('BuildkiteService', 'Integrations::Buildkite'),
- ('CampfireService', 'Integrations::Campfire'),
- ('ConfluenceService', 'Integrations::Confluence'),
- ('CustomIssueTrackerService', 'Integrations::CustomIssueTracker'),
- ('DatadogService', 'Integrations::Datadog'),
- ('DiscordService', 'Integrations::Discord'),
- ('DroneCiService', 'Integrations::DroneCi'),
- ('EmailsOnPushService', 'Integrations::EmailsOnPush'),
- ('EwmService', 'Integrations::Ewm'),
- ('ExternalWikiService', 'Integrations::ExternalWiki'),
- ('FlowdockService', 'Integrations::Flowdock'),
- ('HangoutsChatService', 'Integrations::HangoutsChat'),
- ('IrkerService', 'Integrations::Irker'),
- ('JenkinsService', 'Integrations::Jenkins'),
- ('JiraService', 'Integrations::Jira'),
- ('MattermostService', 'Integrations::Mattermost'),
- ('MattermostSlashCommandsService', 'Integrations::MattermostSlashCommands'),
- ('MicrosoftTeamsService', 'Integrations::MicrosoftTeams'),
- ('MockCiService', 'Integrations::MockCi'),
- ('MockMonitoringService', 'Integrations::MockMonitoring'),
- ('PackagistService', 'Integrations::Packagist'),
- ('PipelinesEmailService', 'Integrations::PipelinesEmail'),
- ('PivotaltrackerService', 'Integrations::Pivotaltracker'),
- ('PrometheusService', 'Integrations::Prometheus'),
- ('PushoverService', 'Integrations::Pushover'),
- ('RedmineService', 'Integrations::Redmine'),
- ('SlackService', 'Integrations::Slack'),
- ('SlackSlashCommandsService', 'Integrations::SlackSlashCommands'),
- ('TeamcityService', 'Integrations::Teamcity'),
- ('UnifyCircuitService', 'Integrations::UnifyCircuit'),
- ('YoutrackService', 'Integrations::Youtrack'),
- ('WebexTeamsService', 'Integrations::WebexTeams'),
-
- -- EE-only integrations
- ('GithubService', 'Integrations::Github'),
- ('GitlabSlackApplicationService', 'Integrations::GitlabSlackApplication')
- )
-
- UPDATE integrations SET type_new = mapping.new_type
- FROM mapping
- WHERE integrations.id = NEW.id
- AND mapping.old_type = NEW.type;
- RETURN NULL;
- SQL
- end
- end
-end
diff --git a/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb b/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb
deleted file mode 100644
index b8e00ed9db0..00000000000
--- a/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTagIdsIndexToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_pending_builds_on_tag_ids'
-
- def up
- add_concurrent_index(:ci_pending_builds, :tag_ids, name: INDEX_NAME, where: 'cardinality(tag_ids) > 0')
- end
-
- def down
- remove_concurrent_index_by_name(:ci_pending_builds, name: INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb b/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb
deleted file mode 100644
index 4cfd54ac348..00000000000
--- a/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddFileTemplateProjectToServiceDeskSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :service_desk_settings, :file_template_project_id, :bigint, null: true
- end
-end
diff --git a/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb b/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb
deleted file mode 100644
index cc8aeecd2b5..00000000000
--- a/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddFileTemplateProjectForeignKeyToServiceDeskSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_service_desk_settings_on_file_template_project_id'
-
- def up
- add_concurrent_index :service_desk_settings, :file_template_project_id, name: INDEX_NAME
- add_concurrent_foreign_key :service_desk_settings, :projects, column: :file_template_project_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :service_desk_settings, column: :file_template_project_id
- end
-
- remove_concurrent_index_by_name :service_desk_settings, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb b/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb
deleted file mode 100644
index 72d2755effa..00000000000
--- a/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddDefaultProjectApprovalRulesVulnAllowed < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- DEFAULT_VALUE = 0
-
- def up
- change_column_default :approval_project_rules, :vulnerabilities_allowed, DEFAULT_VALUE
-
- update_column_in_batches(:approval_project_rules, :vulnerabilities_allowed, DEFAULT_VALUE) do |table, query|
- query.where(table[:vulnerabilities_allowed].eq(nil))
- end
-
- change_column_null :approval_project_rules, :vulnerabilities_allowed, false
- end
-
- def down
- change_column_default :approval_project_rules, :vulnerabilities_allowed, nil
- change_column_null :approval_project_rules, :vulnerabilities_allowed, true
- end
-end
diff --git a/db/migrate/20210819120243_add_throttle_files_api_columns.rb b/db/migrate/20210819120243_add_throttle_files_api_columns.rb
deleted file mode 100644
index ace093c7b0c..00000000000
--- a/db/migrate/20210819120243_add_throttle_files_api_columns.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleFilesApiColumns < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :throttle_unauthenticated_files_api_requests_per_period, :integer, default: 125, null: false
- add_column :application_settings, :throttle_unauthenticated_files_api_period_in_seconds, :integer, default: 15, null: false
- add_column :application_settings, :throttle_authenticated_files_api_requests_per_period, :integer, default: 500, null: false
- add_column :application_settings, :throttle_authenticated_files_api_period_in_seconds, :integer, default: 15, null: false
-
- add_column :application_settings, :throttle_unauthenticated_files_api_enabled, :boolean, default: false, null: false
- add_column :application_settings, :throttle_authenticated_files_api_enabled, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb b/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb
deleted file mode 100644
index a60141991a6..00000000000
--- a/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTmpIndexApprovalProjectRulesScanners < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_approval_project_rules_scanners'
-
- def up
- remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME
- end
-
- def down
- add_concurrent_index :approval_project_rules, :scanners, name: INDEX_NAME, using: :gin, where: "scanners @> '{cluster_image_scanning}'"
- end
-end
diff --git a/db/migrate/20210819153805_set_default_job_token_scope_true.rb b/db/migrate/20210819153805_set_default_job_token_scope_true.rb
deleted file mode 100644
index 4536f664950..00000000000
--- a/db/migrate/20210819153805_set_default_job_token_scope_true.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class SetDefaultJobTokenScopeTrue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-end
diff --git a/db/migrate/20210819162047_add_columns_to_namespace_settings.rb b/db/migrate/20210819162047_add_columns_to_namespace_settings.rb
deleted file mode 100644
index f617990582a..00000000000
--- a/db/migrate/20210819162047_add_columns_to_namespace_settings.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddColumnsToNamespaceSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :namespace_settings, :setup_for_company, :boolean
- add_column :namespace_settings, :jobs_to_be_done, :smallint
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_settings, :setup_for_company
- remove_column :namespace_settings, :jobs_to_be_done
- end
- end
-end
diff --git a/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb b/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb
deleted file mode 100644
index bf0725a77a0..00000000000
--- a/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateExternalAuditEventDestinationsTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- create_table :audit_events_external_audit_event_destinations do |t|
- t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade }
- t.text :destination_url, null: false, limit: 255 # rubocop:disable Migration/AddLimitToTextColumns
- t.timestamps_with_timezone null: false
-
- t.index [:namespace_id, :destination_url], unique: true, name: 'index_external_audit_event_destinations_on_namespace_id'
- end
- end
-end
diff --git a/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb b/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb
deleted file mode 100644
index 9d5322de498..00000000000
--- a/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeysForPendingIssueEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_partitioned_foreign_key :incident_management_pending_issue_escalations,
- :incident_management_escalation_rules,
- column: :rule_id
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_issue_escalations,
- :issues,
- column: :issue_id
- end
-
- def down
- remove_foreign_key_if_exists :incident_management_pending_issue_escalations, :incident_management_escalation_rules, column: :rule_id
- remove_foreign_key_if_exists :incident_management_pending_issue_escalations, :issues, column: :issue_id
- end
-end
diff --git a/db/migrate/20210823172643_create_user_group_callout.rb b/db/migrate/20210823172643_create_user_group_callout.rb
deleted file mode 100644
index 72341c0b275..00000000000
--- a/db/migrate/20210823172643_create_user_group_callout.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CreateUserGroupCallout < ActiveRecord::Migration[6.1]
- def up
- create_table :user_group_callouts do |t|
- t.bigint :user_id, null: false
- t.bigint :group_id, null: false
- t.integer :feature_name, limit: 2, null: false
- t.datetime_with_timezone :dismissed_at
-
- t.index :group_id
- t.index [:user_id, :feature_name, :group_id], unique: true, name: 'index_group_user_callouts_feature'
- end
- end
-
- def down
- drop_table :user_group_callouts
- end
-end
diff --git a/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb b/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb
deleted file mode 100644
index 3bbd9c1259e..00000000000
--- a/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDependencyProxyImageTtlGroupPolicies < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :dependency_proxy_image_ttl_group_policies, id: false do |t|
- t.timestamps_with_timezone null: false
- t.references :group, primary_key: true, default: nil, index: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.integer :ttl, default: 90
- t.boolean :enabled, null: false, default: false
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :dependency_proxy_image_ttl_group_policies
- end
- end
-end
diff --git a/db/migrate/20210824055322_add_project_namespace_id_to_project.rb b/db/migrate/20210824055322_add_project_namespace_id_to_project.rb
deleted file mode 100644
index 9397ad4aab2..00000000000
--- a/db/migrate/20210824055322_add_project_namespace_id_to_project.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceIdToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- # This is being added to Projects as a replacement for Namespace
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/337099
- add_column :projects, :project_namespace_id, :bigint # rubocop: disable Migration/AddColumnsToWideTables
- end
- end
-
- def down
- with_lock_retries do
- remove_column :projects, :project_namespace_id
- end
- end
-end
diff --git a/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb b/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb
deleted file mode 100644
index 5c2391f68ed..00000000000
--- a/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimestampColumnsToCiBuildTraceMetadata < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_build_trace_metadata, :last_archival_attempt_at, :datetime_with_timezone
- add_column :ci_build_trace_metadata, :archived_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb b/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb
deleted file mode 100644
index 15b580af737..00000000000
--- a/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotificationLevelToCiNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_namespace_monthly_usages, :notification_level, :integer, limit: 2, default: 100, null: false
- end
-end
diff --git a/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb b/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb
deleted file mode 100644
index 4663cc513da..00000000000
--- a/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDescriptionLimitErrorTrackingEvent < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- remove_text_limit :error_tracking_error_events, :description
- add_text_limit :error_tracking_error_events, :description, 1024
- end
-
- def down
- remove_text_limit :error_tracking_error_events, :description
- add_text_limit :error_tracking_error_events, :description, 255
- end
-end
diff --git a/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb b/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb
deleted file mode 100644
index 2e89dfeacbf..00000000000
--- a/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsMergeRequestStageEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
- include Gitlab::Database::MigrationHelpers
-
- def up
- execute <<~SQL
- CREATE TABLE analytics_cycle_analytics_merge_request_stage_events (
- stage_event_hash_id bigint NOT NULL,
- merge_request_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, merge_request_id)
- ) PARTITION BY HASH (stage_event_hash_id)
- SQL
-
- create_hash_partitions :analytics_cycle_analytics_merge_request_stage_events, 32
- end
-
- def down
- drop_table :analytics_cycle_analytics_merge_request_stage_events
- end
-end
diff --git a/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb b/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb
deleted file mode 100644
index acc1d96bd23..00000000000
--- a/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsIssueStageEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
- include Gitlab::Database::MigrationHelpers
-
- def up
- 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
-
- def down
- drop_table :analytics_cycle_analytics_issue_stage_events
- end
-end
diff --git a/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb b/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb
deleted file mode 100644
index dc3270dc5a7..00000000000
--- a/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb
+++ /dev/null
@@ -1,10 +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 AddUserDeactivationEmailOptionToApplicationSettings < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :user_deactivation_emails_enabled, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb b/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb
deleted file mode 100644
index cbe7d08894e..00000000000
--- a/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddIterationCadenceIdToIssueBoards < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :boards, :iteration_cadence_id, :bigint
- end
-end
diff --git a/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb b/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb
deleted file mode 100644
index 2149265b4e7..00000000000
--- a/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddLockedToCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
- COLUMN_NAME = 'locked'
-
- def up
- with_lock_retries do
- add_column TABLE_NAME, COLUMN_NAME, :smallint, default: 2
- end
- end
-
- def down
- with_lock_retries do
- remove_column TABLE_NAME, COLUMN_NAME
- end
- end
-end
diff --git a/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb b/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb
deleted file mode 100644
index 5abea4393b4..00000000000
--- a/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateLooseForeignKeysDeletedRecords < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- 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
-
- def down
- drop_table :loose_foreign_keys_deleted_records
- end
-end
diff --git a/db/migrate/20210826124311_add_index_to_error_tracking_error.rb b/db/migrate/20210826124311_add_index_to_error_tracking_error.rb
deleted file mode 100644
index 5973331e487..00000000000
--- a/db/migrate/20210826124311_add_index_to_error_tracking_error.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToErrorTrackingError < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- 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'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :id], name: 'index_et_errors_on_project_id_and_status_and_id'
- end
-
- def down
- 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'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :id], name: 'index_et_errors_on_project_id_and_status_and_id'
- end
-end
diff --git a/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb b/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb
deleted file mode 100644
index 631cc27c8c0..00000000000
--- a/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class AddFunctionForInsertingDeletedRecords < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- 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
- (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
-
- def down
- drop_function(DELETED_RECORDS_INSERT_FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb b/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb
deleted file mode 100644
index 675da2ea41c..00000000000
--- a/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleUnauthenticatedApiColumns < ActiveRecord::Migration[6.1]
- def change
- # The defaults match those from the current `throttle_unauthenticated_*` columns
- add_column :application_settings, :throttle_unauthenticated_api_enabled, :boolean, default: false, null: false
- add_column :application_settings, :throttle_unauthenticated_api_requests_per_period, :integer, default: 3600, null: false
- add_column :application_settings, :throttle_unauthenticated_api_period_in_seconds, :integer, default: 3600, null: false
- end
-end
diff --git a/db/migrate/20210602155110_init_schema.rb b/db/migrate/20210826171758_init_schema.rb
index 971a3e0e2db..971a3e0e2db 100644
--- a/db/migrate/20210602155110_init_schema.rb
+++ b/db/migrate/20210826171758_init_schema.rb
diff --git a/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb b/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb
new file mode 100644
index 00000000000..31d09e5ee8a
--- /dev/null
+++ b/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddAttemptsAndLastErrorToPostgresAsyncIndexes < Gitlab::Database::Migration[2.1]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
+ def change
+ add_column :postgres_async_indexes, :attempts, :integer, null: false, default: 0
+ add_column :postgres_async_indexes, :last_error, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb b/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
new file mode 100644
index 00000000000..1cd51453fd2
--- /dev/null
+++ b/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToPostgresAsyncIndexesLastError < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :postgres_async_indexes, :last_error, 10_000
+ end
+
+ def down
+ remove_text_limit :postgres_async_indexes, :last_error
+ end
+end
diff --git a/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb b/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb
new file mode 100644
index 00000000000..b9c32f83411
--- /dev/null
+++ b/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CreatePostgresAsyncForeignKeyValidations < Gitlab::Database::Migration[2.1]
+ def change
+ create_table :postgres_async_foreign_key_validations, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.text :name, null: false, limit: 63
+ t.text :table_name, null: false, limit: 63
+ t.text :last_error, limit: 10_000
+
+ t.integer :attempts, null: false, default: 0
+
+ t.index :name, unique: true
+ end
+ end
+end
diff --git a/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb b/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb
deleted file mode 100644
index dfd2806fece..00000000000
--- a/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleLatestPipelineIdPopulation < ActiveRecord::Migration[6.1]
- def up
- # no-op: This migration has been marked as no-op and replaced by
- # `ReScheduleLatestPipelineIdPopulation` as we've found some problems.
- # For more information: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65280
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb b/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb
deleted file mode 100644
index b9b694012f2..00000000000
--- a/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleMergeRequestDiffUsersBackgroundMigration < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb b/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb
deleted file mode 100644
index 64d37054eb8..00000000000
--- a/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexForContainerRegistryAccessLevel < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX = 'index_project_features_on_project_id_include_container_registry'
-
- def up
- if index_exists_by_name?('project_features', INDEX)
- Gitlab::AppLogger.warn "Index not created because it already exists (this may be due to an aborted migration or similar): table_name: project_features, index_name: #{INDEX}"
- return
- end
-
- begin
- disable_statement_timeout do
- execute "CREATE UNIQUE INDEX CONCURRENTLY #{INDEX} ON project_features " \
- 'USING btree (project_id) INCLUDE (container_registry_access_level)'
- end
- rescue ActiveRecord::StatementInvalid => ex
- raise "The index #{INDEX} couldn't be added: #{ex.message}"
- end
-
- create_comment(
- 'INDEX',
- INDEX,
- 'Included column (container_registry_access_level) improves performance of the ContainerRepository.for_group_and_its_subgroups scope query'
- )
- end
-
- def down
- remove_concurrent_index_by_name('project_features', INDEX)
- end
-end
diff --git a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb b/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb
deleted file mode 100644
index 596b643e079..00000000000
--- a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-class DropNonPartitionedWebHookLogs < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- DOWNTIME = false
-
- def up
- drop_nonpartitioned_archive_table(:web_hook_logs)
- end
-
- def down
- execute(<<~SQL)
- CREATE TABLE web_hook_logs_archived (
- id integer 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,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
- );
-
- ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id);
-
- CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id);
- CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id);
-
- ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
- SQL
-
- with_lock_retries do
- create_trigger_to_sync_tables(:web_hook_logs, :web_hook_logs_archived, 'id')
- end
- end
-end
diff --git a/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb b/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb
deleted file mode 100644
index ed9a64c84ab..00000000000
--- a/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillDraftStatusOnMergeRequests < ActiveRecord::Migration[6.1]
- def up
- # noop
- #
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb b/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb
deleted file mode 100644
index 9d37180326f..00000000000
--- a/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveClustersApplicationsFluentdTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- drop_table :clusters_applications_fluentd
- end
-
- def down
- create_table :clusters_applications_fluentd do |t|
- t.integer :protocol, null: false, limit: 2
- t.integer :status, null: false
- t.integer :port, null: false
- t.references :cluster, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.string :version, null: false, limit: 255
- t.string :host, null: false, limit: 255
- t.boolean :cilium_log_enabled, default: true, null: false
- t.boolean :waf_log_enabled, default: true, null: false
- t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns
- end
- end
-end
diff --git a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb b/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
deleted file mode 100644
index 47a6e39e87a..00000000000
--- a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateProtectedAttributeToPendingBuilds < ActiveRecord::Migration[6.1]
- include ::Gitlab::Database::DynamicModelHelpers
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.dev_or_test_env? || Gitlab.com?
-
- each_batch_range('ci_pending_builds', connection: connection, of: 1000) do |min, max|
- execute <<~SQL
- UPDATE ci_pending_builds
- SET protected = true
- FROM ci_builds
- WHERE ci_pending_builds.build_id = ci_builds.id
- AND ci_builds.protected = true
- AND ci_pending_builds.id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # no op
- end
-end
diff --git a/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb b/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb
deleted file mode 100644
index 140bf7df4e6..00000000000
--- a/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToProtectedPendingBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_ci_pending_builds_id_on_protected_partial'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_pending_builds, :id, where: 'protected = true', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_pending_builds, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb b/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb
deleted file mode 100644
index f4827c0bbc0..00000000000
--- a/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class DisableExpirationPoliciesLinkedToNoContainerImages < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- BATCH_SIZE = 1000
-
- class ContainerExpirationPolicy < ActiveRecord::Base
- include ::EachBatch
- self.table_name = 'container_expiration_policies'
- end
-
- def up
- ContainerExpirationPolicy.where(enabled: true).each_batch(of: BATCH_SIZE) do |batch, _|
- sql = <<-SQL
- WITH batched_relation AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (#{batch.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
-
- def down
- # no-op
-
- # we can't accuretaly know which policies were previously enabled during `#up`
- end
-end
diff --git a/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb b/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb
deleted file mode 100644
index 45728ef26f5..00000000000
--- a/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class FixMissingTraversalIds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- ROOTS_MIGRATION = 'BackfillNamespaceTraversalIdsRoots'
- CHILDREN_MIGRATION = 'BackfillNamespaceTraversalIdsChildren'
- DOWNTIME = false
- BATCH_SIZE = 1_000
- SUB_BATCH_SIZE = 50
- DELAY_INTERVAL = 2.minutes
- ROOT_NS_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_root_namespaces'
- CHILD_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_child_namespaces'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, :id, where: "parent_id IS NULL AND traversal_ids = '{}'", name: ROOT_NS_INDEX_NAME
- add_concurrent_index :namespaces, :id, where: "parent_id IS NOT NULL AND traversal_ids = '{}'", name: CHILD_INDEX_NAME
-
- # Personal namespaces and top-level groups
- final_delay = queue_background_migration_jobs_by_range_at_intervals(
- ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots::Namespace.base_query.where("traversal_ids = '{}'"),
- ROOTS_MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- other_job_arguments: [SUB_BATCH_SIZE],
- track_jobs: true
- )
- final_delay += DELAY_INTERVAL
-
- # Subgroups
- queue_background_migration_jobs_by_range_at_intervals(
- ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren::Namespace.base_query.where("traversal_ids = '{}'"),
- CHILDREN_MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- initial_delay: final_delay,
- other_job_arguments: [SUB_BATCH_SIZE],
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, ROOT_NS_INDEX_NAME
- remove_concurrent_index_by_name :namespaces, CHILD_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb b/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb
deleted file mode 100644
index 9d40fe30ed6..00000000000
--- a/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSastDastIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_SAST = 'index_ci_job_artifacts_sast_for_devops_adoption'
- INDEX_DAST = 'index_ci_job_artifacts_dast_for_devops_adoption'
-
- def up
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 5", name: INDEX_SAST
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 8", name: INDEX_DAST
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_SAST
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_DAST
- end
-end
diff --git a/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb b/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb
deleted file mode 100644
index 818aea39762..00000000000
--- a/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class FixBatchedMigrationsOldFormatJobArguments < ActiveRecord::Migration[6.1]
- class BatchedMigration < ActiveRecord::Base
- self.table_name = 'batched_background_migrations'
- end
-
- def up
- # rubocop:disable Style/WordArray
- [
- ['events', 'id', ['id', 'id_convert_to_bigint'], [['id'], ['id_convert_to_bigint']]],
- ['push_event_payloads', 'event_id', ['event_id', 'event_id_convert_to_bigint'], [['event_id'], ['event_id_convert_to_bigint']]]
- ].each do |table_name, column_name, legacy_job_arguments, current_job_arguments|
- base_scope = BatchedMigration
- .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob', table_name: table_name, column_name: column_name)
- # rubocop:enable Style/WordArray
-
- # rubocop:disable Rails/WhereEquals
- base_scope
- .where('job_arguments = ?', Gitlab::Json.dump(legacy_job_arguments))
- .where('NOT EXISTS (?)', base_scope.select('1').where('job_arguments = ?', Gitlab::Json.dump(current_job_arguments)))
- .update_all(job_arguments: current_job_arguments)
- # rubocop:enable Rails/WhereEquals
- end
- end
-
- def down
- # No-op, there is no way to know were the existing record migrated from
- # legacy job arguments, or were using the current format from the start.
- # There is no reason to go back anyway.
- end
-end
diff --git a/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb b/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb
deleted file mode 100644
index 6e169a6f0e1..00000000000
--- a/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPartialIndexForCiBuildsToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NAME = 'index_ci_builds_on_token_partial'
-
- def up
- add_concurrent_index :ci_builds, :token, unique: true, where: 'token IS NOT NULL', name: NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_builds, NAME
- end
-end
diff --git a/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb b/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb
deleted file mode 100644
index 71fd61072ac..00000000000
--- a/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-#
-class AddCiArtifactsDevopsAdoptionIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NEW_INDEX = 'index_ci_job_artifacts_on_file_type_for_devops_adoption'
-
- def up
- add_concurrent_index :ci_job_artifacts, [:file_type, :project_id, :created_at], name: NEW_INDEX, where: 'file_type IN (5,6,8,23)'
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, NEW_INDEX
- end
-end
diff --git a/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb b/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb
deleted file mode 100644
index 498090c3ab9..00000000000
--- a/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class ReplaceProjectAuthorizationsProjectIdIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- OLD_INDEX_NAME = 'index_project_authorizations_on_project_id'
- NEW_INDEX_NAME = 'index_project_authorizations_on_project_id_user_id'
-
- def up
- add_concurrent_index(:project_authorizations, [:project_id, :user_id], name: NEW_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:project_authorizations, :project_id, name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, NEW_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb b/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb
deleted file mode 100644
index 0430c8447d9..00000000000
--- a/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class DropRemoveOnCloseFromLabels < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # Migration that adds column was reverted, but run in Gitlab SaaS stg and prod
- return unless column_exists?(:labels, :remove_on_close)
-
- with_lock_retries do
- remove_column :labels, :remove_on_close
- end
- end
-
- def down
- # No rollback as the original migration was reverted in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62056
- # up simply removes the column from envs where the original migration was run
- end
-end
diff --git a/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb b/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb
deleted file mode 100644
index 8d326036a68..00000000000
--- a/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class StealBackgroundJobsThatReferenceServices < ActiveRecord::Migration[6.1]
- def up
- Gitlab::BackgroundMigration.steal('BackfillJiraTrackerDeploymentType2')
- Gitlab::BackgroundMigration.steal('FixProjectsWithoutPrometheusService')
- Gitlab::BackgroundMigration.steal('MigrateIssueTrackersSensitiveData')
- Gitlab::BackgroundMigration.steal('RemoveDuplicateServices')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb b/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb
deleted file mode 100644
index 803a6fa0aca..00000000000
--- a/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeRenameServicesToIntegrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- finalize_table_rename(:services, :integrations)
- end
-
- def down
- undo_finalize_table_rename(:services, :integrations)
- end
-end
diff --git a/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb b/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb
deleted file mode 100644
index f37c446f66c..00000000000
--- a/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'push_event_payloads'
- INDEX_NAME = 'index_push_event_payloads_on_event_id_convert_to_bigint'
-
- def up
- return unless should_run?
-
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'event_id',
- job_arguments: [["event_id"], ["event_id_convert_to_bigint"]]
- )
-
- swap_columns
- end
-
- def down
- return unless should_run?
-
- swap_columns
- end
-
- private
-
- def should_run?
- Gitlab.dev_or_test_env? || Gitlab.com?
- end
-
- def swap_columns
- add_concurrent_index TABLE_NAME, :event_id_convert_to_bigint, unique: true, name: INDEX_NAME
-
- # Add a foreign key on `event_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_36c74129da)
- add_concurrent_foreign_key TABLE_NAME, :events, column: :event_id_convert_to_bigint, on_delete: :cascade
-
- with_lock_retries(raise_on_exhaustion: true) do
- # Swap column names
- temp_name = 'event_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id_convert_to_bigint)} TO #{quote_column_name(:event_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:event_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:event_id, :event_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :event_id, nil
- change_column_default TABLE_NAME, :event_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT push_event_payloads_pkey"
- rename_index TABLE_NAME, INDEX_NAME, 'push_event_payloads_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT push_event_payloads_pkey PRIMARY KEY USING INDEX push_event_payloads_pkey"
-
- # Drop original FK on the old int4 `event_id` (fk_36c74129da)
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :event_id)
- # We swapped the columns but the FK for event_id is still using the old name for the event_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :event_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :event_id)
- )
- end
- end
-end
diff --git a/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb b/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb
deleted file mode 100644
index 1f0bdfc5012..00000000000
--- a/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeEventsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'events'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["id"], ["id_convert_to_bigint"]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "events_pkey" PRIMARY KEY, btree (id)
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_events_on_id_convert_to_bigint'
- # This is to replace the existing "index_events_on_project_id_and_id" btree (project_id, id)
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], name: 'index_events_on_project_id_and_id_convert_to_bigint'
- # This is to replace the existing "index_events_on_project_id_and_id_desc_on_merged_action" btree (project_id, id DESC) WHERE action = 7
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], order: { id_convert_to_bigint: :desc },
- where: "action = 7", name: 'index_events_on_project_id_and_id_bigint_desc_on_merged_action'
-
- # Add a FK on `push_event_payloads(event_id)` to `id_convert_to_bigint`, the old FK (fk_36c74129da)
- # will be removed when events_pkey constraint is droppped.
- fk_event_id = concurrent_foreign_key_name(:push_event_payloads, :event_id)
- fk_event_id_tmp = "#{fk_event_id}_tmp"
- add_concurrent_foreign_key :push_event_payloads, TABLE_NAME,
- column: :event_id, target_column: :id_convert_to_bigint,
- name: fk_event_id_tmp, on_delete: :cascade, reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start.
- # Lock order should be
- # 1. events
- # 2. push_event_payloads
- # in order to match the order in EventCreateService#create_push_event,
- # and avoid deadlocks.
- execute "LOCK TABLE #{TABLE_NAME}, push_event_payloads IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE events_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('events_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT events_pkey CASCADE" # this will drop fk_36c74129da
- rename_index TABLE_NAME, 'index_events_on_id_convert_to_bigint', 'events_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT events_pkey PRIMARY KEY USING INDEX events_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_events_on_project_id_and_id'
- rename_index TABLE_NAME, 'index_events_on_project_id_and_id_convert_to_bigint', 'index_events_on_project_id_and_id'
- execute 'DROP INDEX index_events_on_project_id_and_id_desc_on_merged_action'
- rename_index TABLE_NAME, 'index_events_on_project_id_and_id_bigint_desc_on_merged_action', 'index_events_on_project_id_and_id_desc_on_merged_action'
-
- # Change the name of the temporary FK
- rename_constraint(:push_event_payloads, fk_event_id_tmp, fk_event_id)
- end
- end
-end
diff --git a/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb b/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb
deleted file mode 100644
index a38cb68ff08..00000000000
--- a/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleDeleteOrphanedDeployments < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION = 'DeleteOrphanedDeployments'
- BATCH_SIZE = 100_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- # no-op.
- # This background migration is rescheduled in 20210722010101_cleanup_delete_orphaned_deployments_background_migration.rb
- # with a smaller batch size, because the initial attempt caused
- # 80 failures out of 1639 batches (faiulre rate is 4.88%) due to statement timeouts,
- # that takes approx. 1 hour to perform a cleanup/sync migration.
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/335071#note_618380503 for more information.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb b/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
deleted file mode 100644
index 1176e704d0a..00000000000
--- a/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class ResetJobTokenScopeEnabled < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- # Irreversible
- end
-end
diff --git a/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb b/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb
deleted file mode 100644
index 371298aef62..00000000000
--- a/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDeprecatedModsecurityColumns < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_clusters_applications_ingress_on_modsecurity'
-
- def up
- remove_column :clusters_applications_ingress, :modsecurity_enabled if column_exists?(:clusters_applications_ingress, :modsecurity_enabled)
- remove_column :clusters_applications_ingress, :modsecurity_mode if column_exists?(:clusters_applications_ingress, :modsecurity_mode)
- end
-
- def down
- add_column :clusters_applications_ingress, :modsecurity_enabled, :boolean unless column_exists?(:clusters_applications_ingress, :modsecurity_enabled)
- add_column :clusters_applications_ingress, :modsecurity_mode, :smallint, null: false, default: 0 unless column_exists?(:clusters_applications_ingress, :modsecurity_mode)
-
- add_concurrent_index :clusters_applications_ingress, [:modsecurity_enabled, :modsecurity_mode, :cluster_id], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb b/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb
deleted file mode 100644
index cc26db924fe..00000000000
--- a/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class DropIndexOnCiBuildsForToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEXNAME = :index_ci_builds_on_token
-
- def up
- remove_concurrent_index_by_name :ci_builds, INDEXNAME
- end
-
- def down
- add_concurrent_index :ci_builds, :token, unique: true, name: INDEXNAME
- end
-end
diff --git a/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb b/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb
deleted file mode 100644
index 834a23a5c7a..00000000000
--- a/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-require Rails.root.join('db', 'post_migrate', '20210622041846_finalize_push_event_payloads_bigint_conversion')
-
-class MigratePushEventPayloadsEventIdBackToIntegerForGitlabCom < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- def up
- FinalizePushEventPayloadsBigintConversion.new.down
- end
-
- def down
- FinalizePushEventPayloadsBigintConversion.new.up
- end
-end
diff --git a/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb b/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb
deleted file mode 100644
index 89a39660a04..00000000000
--- a/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsNeedsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_build_needs'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_build_needs_on_build_id_and_name" UNIQUE, btree (build_id, name)
- add_concurrent_index TABLE_NAME, [:build_id_convert_to_bigint, :name], unique: true, name: 'index_ci_build_needs_on_build_id_convert_to_bigint_and_name'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_rails_3cf221d4ed)
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :build_id_convert_to_bigint, on_delete: :cascade,
- name: 'fk_rails_3cf221d4ed_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_build_needs_on_build_id_and_name'
- rename_index TABLE_NAME, 'index_ci_build_needs_on_build_id_convert_to_bigint_and_name', 'index_ci_build_needs_on_build_id_and_name'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_3cf221d4ed)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_3cf221d4ed'
- # We swapped the columns but the FK for buil_id is still using the temporary name for the buil_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_3cf221d4ed_tmp', 'fk_rails_3cf221d4ed')
- end
- end
-end
diff --git a/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb b/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb
deleted file mode 100644
index 0afc0bc1d08..00000000000
--- a/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIssuesUpvotesCount < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillUpvotesCountOnIssues'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 5_000
-
- def up
- scope = Issue.joins("INNER JOIN award_emoji e ON e.awardable_id = issues.id AND e.awardable_type = 'Issue' AND e.name = 'thumbsup'")
-
- queue_background_migration_jobs_by_range_at_intervals(
- scope,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb b/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb
deleted file mode 100644
index 776f1ad545d..00000000000
--- a/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsStageIdBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds'
-
- 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]]
- )
-
- swap_columns
- end
-
- def down
- swap_columns
- end
-
- private
-
- def swap_columns
- # Create a copy of the original column's index on the new column
- add_concurrent_index TABLE_NAME, :stage_id_convert_to_bigint, name: :index_ci_builds_on_converted_stage_id # rubocop:disable Migration/PreventIndexCreation
-
- # Create a copy of the original column's FK on the new column
- add_concurrent_foreign_key TABLE_NAME, :ci_stages, column: :stage_id_convert_to_bigint, on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- quoted_table_name = quote_table_name(TABLE_NAME)
- quoted_referenced_table_name = quote_table_name(:ci_stages)
-
- # Acquire locks up-front, not just to the build table but the FK's referenced table
- execute "LOCK TABLE #{quoted_referenced_table_name}, #{quoted_table_name} IN ACCESS EXCLUSIVE MODE"
-
- # Swap the column names of the two columns
- temporary_name = 'stage_id_tmp'
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:stage_id)} TO #{quote_column_name(temporary_name)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:stage_id_convert_to_bigint)} TO #{quote_column_name(:stage_id)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(temporary_name)} TO #{quote_column_name(:stage_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"
-
- # Remove the original column index, and rename the new column index to the original name
- execute 'DROP INDEX index_ci_builds_on_stage_id'
- rename_index TABLE_NAME, :index_ci_builds_on_converted_stage_id, :index_ci_builds_on_stage_id
-
- # Remove the original column foreign key, and rename the new column foreign key to the original name
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :stage_id)
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :stage_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :stage_id))
- end
- end
-end
diff --git a/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb b/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb
deleted file mode 100644
index a9f6d4ea2d9..00000000000
--- a/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCiBuildsMetadataIdForBigintConversion < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_builds_metadata
- COLUMN = :id
-
- def up
- backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100
- end
-
- def down
- revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN
- end
-end
diff --git a/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb b/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb
deleted file mode 100644
index 7224e84c1b3..00000000000
--- a/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCloudLicenseEnabledFromApplicationSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :application_settings, :cloud_license_enabled
- end
- end
-
- def down
- with_lock_retries do
- add_column :application_settings, :cloud_license_enabled, :boolean, null: false, default: false
- end
- end
-end
diff --git a/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb b/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb
deleted file mode 100644
index 65ec43930ea..00000000000
--- a/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpvotesCountIndexToIssues < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issues_on_project_id_and_upvotes_count'
-
- def up
- add_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb b/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb
deleted file mode 100644
index 73344ee061f..00000000000
--- a/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveFrameworkColumnFromComplianceManagementFrameworks < ActiveRecord::Migration[6.1]
- def change
- remove_column :project_compliance_framework_settings, :framework, :smallint
- end
-end
diff --git a/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb b/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb
deleted file mode 100644
index 255b64f9bc7..00000000000
--- a/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulation < ActiveRecord::Migration[6.1]
- def change
- # no-op: This migration has been marked as no-op and replaced by
- # `ReScheduleLatestPipelineIdPopulationWithLogging` as we've found some problems.
- # For more information: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66050
- end
-end
diff --git a/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb b/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb
deleted file mode 100644
index 11045348672..00000000000
--- a/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb
+++ /dev/null
@@ -1,84 +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 FinalizeCiJobArtifactsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_job_artifact_on_id_convert_to_bigint'
- # This is to replace the existing "index_ci_job_artifacts_for_terraform_reports" btree (project_id, id) where (file_type = 18)
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], name: 'index_ci_job_artifacts_for_terraform_reports_bigint', where: "file_type = 18"
- # This is to replace the existing "index_ci_job_artifacts_id_for_terraform_reports" btree (id) where (file_type = 18)
- add_concurrent_index TABLE_NAME, [:id_convert_to_bigint], name: 'index_ci_job_artifacts_id_for_terraform_reports_bigint', where: "file_type = 18"
-
- # Add a FK on `project_pages_metadata(artifacts_archive_id)` to `id_convert_to_bigint`, the old FK (fk_69366a119e)
- # will be removed when ci_job_artifacts_pkey constraint is droppped.
- fk_artifacts_archive_id = concurrent_foreign_key_name(:project_pages_metadata, :artifacts_archive_id)
- fk_artifacts_archive_id_tmp = "#{fk_artifacts_archive_id}_tmp"
- add_concurrent_foreign_key :project_pages_metadata, TABLE_NAME,
- column: :artifacts_archive_id, target_column: :id_convert_to_bigint,
- name: fk_artifacts_archive_id_tmp,
- on_delete: :nullify,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME}, project_pages_metadata IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :job_id], [:id_convert_to_bigint, :job_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_job_artifacts_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_job_artifacts_pkey CASCADE" # this will drop ci_job_artifacts_pkey primary key
- rename_index TABLE_NAME, 'index_ci_job_artifact_on_id_convert_to_bigint', 'ci_job_artifacts_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY USING INDEX ci_job_artifacts_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_ci_job_artifacts_for_terraform_reports'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_for_terraform_reports_bigint', 'index_ci_job_artifacts_for_terraform_reports'
- execute 'DROP INDEX index_ci_job_artifacts_id_for_terraform_reports'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_id_for_terraform_reports_bigint', 'index_ci_job_artifacts_id_for_terraform_reports'
-
- # Change the name of the temporary FK for project_pages_metadata(artifacts_archive_id) -> id
- rename_constraint(:project_pages_metadata, fk_artifacts_archive_id_tmp, fk_artifacts_archive_id)
- end
- end
-end
diff --git a/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb b/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb
deleted file mode 100644
index f3ce32ad9c8..00000000000
--- a/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb
+++ /dev/null
@@ -1,77 +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 FinalizeCiStagesBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_stages'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['id'], ['id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- # This will replace the existing ci_stages_pkey index for the primary key
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_stages_on_id_convert_to_bigint'
-
- # This will replace the existing ci_stages_on_pipeline_id_and_id index
- add_concurrent_index TABLE_NAME, [:pipeline_id, :id_convert_to_bigint],
- name: 'index_ci_stages_on_pipeline_id_and_id_convert_to_bigint',
- where: 'status in (0, 1, 2, 8, 9, 10)'
-
- # Add a foreign key on ci_builds(stage_id_convert_to_bigint), which we'll rename later. Give it the correct final name
- fk_stage_id = concurrent_foreign_key_name(:ci_builds, :stage_id)
- fk_stage_id_tmp = "#{fk_stage_id}_tmp"
- add_concurrent_foreign_key :ci_builds, :ci_stages, column: :stage_id,
- target_column: :id_convert_to_bigint,
- name: fk_stage_id_tmp,
- on_delete: :cascade,
- reverse_lock_order: true
-
- # Now it's time to do things in a transaction
- with_lock_retries(raise_on_exhaustion: true) do
- execute "LOCK TABLE #{TABLE_NAME}, ci_builds IN ACCESS EXCLUSIVE MODE"
-
- temp_name = quote_column_name('id_tmp')
- id_name = quote_column_name(:id)
- id_convert_to_bigint_name = quote_column_name(:id_convert_to_bigint)
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_name} TO #{temp_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_convert_to_bigint_name} TO #{id_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{id_convert_to_bigint_name}"
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE ci_stages_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_stages_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap pkey constraint
- # This will drop fk_3a9eaa254d (ci_builds(stage_id) references ci_stages(id))
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_stages_pkey CASCADE"
- rename_index TABLE_NAME, 'index_ci_stages_on_id_convert_to_bigint', 'ci_stages_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_stages_pkey PRIMARY KEY USING INDEX ci_stages_pkey"
-
- # Rename the other indexes
- execute "DROP INDEX index_ci_stages_on_pipeline_id_and_id"
- rename_index TABLE_NAME, 'index_ci_stages_on_pipeline_id_and_id_convert_to_bigint', 'index_ci_stages_on_pipeline_id_and_id'
-
- rename_constraint(:ci_builds, fk_stage_id_tmp, fk_stage_id)
- end
- end
-end
diff --git a/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb b/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb
deleted file mode 100644
index 3879c3c368a..00000000000
--- a/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsMetadataBigintConversion < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_metadata'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["id"], ["id_convert_to_bigint"]]
- )
-
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["build_id"], ["build_id_convert_to_bigint"]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # Indexes were pre-created on gitlab.com to avoid slowing down deployments
- #
- # rubocop:disable Migration/PreventIndexCreation
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_builds_metadata_on_id_convert_to_bigint'
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, where: 'has_exposed_artifacts IS TRUE', name: 'index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts'
- create_covering_index TABLE_NAME, 'index_ci_builds_metadata_on_build_id_int8_where_interruptible'
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, unique: true, name: 'index_ci_builds_metadata_on_build_id_convert_to_bigint'
- # rubocop:enable Migration/PreventIndexCreation
-
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- swap_column :id
- swap_column :build_id
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- execute "ALTER FUNCTION #{quote_table_name(Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint))} RESET ALL"
- execute "ALTER FUNCTION #{quote_table_name(Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint))} RESET ALL"
-
- # Swap defaults for PK
- execute "ALTER SEQUENCE ci_builds_metadata_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_builds_metadata_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap defaults for FK
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_builds_metadata_pkey CASCADE"
- rename_index TABLE_NAME, 'index_ci_builds_metadata_on_id_convert_to_bigint', 'ci_builds_metadata_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY USING INDEX ci_builds_metadata_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- swap_index 'index_ci_builds_metadata_on_build_id', 'index_ci_builds_metadata_on_build_id_convert_to_bigint'
- swap_index 'index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts', 'index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts'
- swap_index 'index_ci_builds_metadata_on_build_id_and_id_and_interruptible', 'index_ci_builds_metadata_on_build_id_int8_where_interruptible'
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- # Swap FK constraint
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :build_id)
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :build_id)
- )
- end
- end
-
- def swap_index(old, new)
- execute "DROP INDEX #{old}"
- rename_index TABLE_NAME, new, old
- end
-
- def swap_column(name)
- temp_name = "#{name}_tmp"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(name)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:"#{name}_convert_to_bigint")} TO #{quote_column_name(name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:"#{name}_convert_to_bigint")}"
- end
-
- def create_covering_index(table, name)
- return if index_exists_by_name?(table, name)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{name}
- ON #{table} (build_id_convert_to_bigint) INCLUDE (id_convert_to_bigint)
- WHERE interruptible = true
- SQL
- end
- end
-end
diff --git a/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb b/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb
deleted file mode 100644
index 53f13ca96d2..00000000000
--- a/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleMergeRequestDiffUsersBackgroundMigration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- # The number of rows to process in a single migration job.
- #
- # The minimum interval for background migrations is two minutes. On staging we
- # observed we can process roughly 20 000 rows in a minute. Based on the total
- # number of rows on staging, this translates to a total processing time of
- # roughly 14 days.
- #
- # By using a batch size of 40 000, we maintain a rate of roughly 20 000 rows
- # per minute, hopefully keeping the total migration time under two weeks;
- # instead of four weeks.
- BATCH_SIZE = 40_000
-
- MIGRATION_NAME = 'MigrateMergeRequestDiffCommitUsers'
-
- class MergeRequestDiff < ActiveRecord::Base
- self.table_name = 'merge_request_diffs'
- end
-
- def up
- start = MergeRequestDiff.minimum(:id).to_i
- max = MergeRequestDiff.maximum(:id).to_i
- delay = BackgroundMigrationWorker.minimum_interval
-
- Gitlab::Database::BackgroundMigrationJob
- .where(class_name: MIGRATION_NAME)
- .delete_all
-
- # The table merge_request_diff_commits contains _a lot_ of rows (roughly 400
- # 000 000 on staging). Iterating a table that large to determine job ranges
- # would take a while.
- #
- # To avoid that overhead, we simply schedule fixed ranges according to the
- # minimum and maximum IDs. The background migration in turn only processes
- # rows that actually exist.
- while start < max
- stop = start + BATCH_SIZE
-
- migrate_in(delay, MIGRATION_NAME, [start, stop])
-
- Gitlab::Database::BackgroundMigrationJob
- .create!(class_name: MIGRATION_NAME, arguments: [start, stop])
-
- delay += BackgroundMigrationWorker.minimum_interval
- start += BATCH_SIZE
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb b/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb
deleted file mode 100644
index aa812151164..00000000000
--- a/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion2 < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5256
- end
-
- def down
- # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5256
- end
-end
diff --git a/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb b/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb
deleted file mode 100644
index 34701d8ba46..00000000000
--- a/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-# When the `ci_sources_pipelines` table was first introduced in GitLab
-# 9.3 EE, the foreign key names generate for the table appeared to
-# have been calculated via a hash using the table name
-# `ci_pipeline_source_pipelines`. This led to a merge conflict and
-# confusion during a CE to EE merge in GitLab 10.0, which regenerated
-# the schema with the correct foreign key names.
-#
-# Hence anyone who installed GitLab prior to 10.0 may have been seeded
-# the database with stale, incorrect foreign key names.
-#
-# During the Great BigInt Conversion of 2021, several migrations
-# assumed that the foreign key `fk_be5624bf37` existed for
-# `ci_sources_pipeline`. However, older installations may have had the
-# correct foreign key under the name `fk_3f0c88d7dc`.
-#
-# To eliminate future confusion and migration failures, we now rename
-# the foreign key constraints and index to what they should be today.
-class FixCiSourcesPipelinesIndexNames < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_sources_pipelines'
-
- # GitLab 9.5.4: https://gitlab.com/gitlab-org/gitlab/-/blob/v9.5.4-ee/db/schema.rb#L2026-2030
- # GitLab 10.0: https://gitlab.com/gitlab-org/gitlab/-/blob/v10.0.0-ee/db/schema.rb#L2064-2068
- OLD_TO_NEW_FOREIGN_KEY_DEFS = {
- 'fk_3f0c88d7dc' => { table: :ci_builds, column: :source_job_id, name: 'fk_be5624bf37' },
- 'fk_b8c0fac459' => { table: :ci_pipelines, column: :pipeline_id, name: 'fk_e1bad85861' },
- 'fk_3a3e3cb83a' => { table: :ci_pipelines, column: :source_pipeline_id, name: 'fk_d4e29af7d7' },
- 'fk_8868d0f3e4' => { table: :projects, column: :source_project_id, name: 'fk_acd9737679' },
- 'fk_83b4346e48' => { table: :projects, name: 'fk_1e53c97c0a' }
- }
- OLD_INDEX_NAME = 'index_ci_pipeline_source_pipelines_on_source_job_id'
- NEW_INDEX_NAME = 'index_ci_sources_pipelines_on_source_job_id'
-
- def up
- OLD_TO_NEW_FOREIGN_KEY_DEFS.each do |old_name, entry|
- options = { column: entry[:column], name: old_name }.compact
-
- if foreign_key_exists?(TABLE_NAME, entry[:table], **options)
- rename_constraint(TABLE_NAME, old_name, entry[:name])
- end
- end
-
- if index_exists_by_name?(TABLE_NAME, OLD_INDEX_NAME)
- if index_exists_by_name?(TABLE_NAME, NEW_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
- else
- rename_index(TABLE_NAME, OLD_INDEX_NAME, NEW_INDEX_NAME)
- end
- end
- end
-
- # There's no reason to revert this change since it should apply on stale schemas
- def down; end
-end
diff --git a/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb b/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb
deleted file mode 100644
index 38b7852b320..00000000000
--- a/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiSourcesPipelinesBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_sources_pipelines'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['source_job_id'], ['source_job_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_sources_pipelines_on_source_job_id" btree (source_job_id)
- add_concurrent_index TABLE_NAME, :source_job_id_convert_to_bigint, name: 'index_ci_sources_pipelines_on_source_job_id_convert_to_bigint'
-
- # Add a foreign key on `source_job_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_be5624bf37)
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :source_job_id_convert_to_bigint, on_delete: :cascade,
- name: 'fk_be5624bf37_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'source_job_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:source_job_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:source_job_id_convert_to_bigint)} TO #{quote_column_name(:source_job_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:source_job_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:source_job_id, :source_job_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # No need to swap defaults, both columns have no default value
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_sources_pipelines_on_source_job_id'
- rename_index TABLE_NAME, 'index_ci_sources_pipelines_on_source_job_id_convert_to_bigint', 'index_ci_sources_pipelines_on_source_job_id'
-
- # Drop original FK on the old int4 `source_job_id` (fk_be5624bf37)
- remove_foreign_key TABLE_NAME, name: 'fk_be5624bf37'
- # We swapped the columns but the FK is still using the temporary name
- # So we have to also swap the FK name now that we dropped the other one
- rename_constraint(TABLE_NAME, 'fk_be5624bf37_tmp', 'fk_be5624bf37')
- end
- end
-end
diff --git a/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb b/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb
deleted file mode 100644
index 457e7826f38..00000000000
--- a/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulationWithLogging < ActiveRecord::Migration[6.1]
- def up
- # no-op: The content of the migration has been moved to
- # `ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes`.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb b/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb
deleted file mode 100644
index af17b35d47d..00000000000
--- a/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildTraceChunksBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_build_trace_chunks'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_build_trace_chunks_on_build_id_and_chunk_index" UNIQUE, btree (build_id, chunk_index)
- add_concurrent_index TABLE_NAME, [:build_id_convert_to_bigint, :chunk_index], unique: true, name: 'i_ci_build_trace_chunks_build_id_convert_to_bigint_chunk_index'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK ()
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade, name: 'fk_rails_1013b761f2_tmp'
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME}, ci_builds IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index'
- rename_index TABLE_NAME, 'i_ci_build_trace_chunks_build_id_convert_to_bigint_chunk_index', 'index_ci_build_trace_chunks_on_build_id_and_chunk_index'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_1013b761f2)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_1013b761f2'
- # We swapped the columns but the FK for buil_id is still using the temporary name for the build_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_1013b761f2_tmp', 'fk_rails_1013b761f2')
- end
- end
-end
diff --git a/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb b/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb
deleted file mode 100644
index 20118dbbac8..00000000000
--- a/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSeatLinkEnabledFromApplicationSettings < ActiveRecord::Migration[6.1]
- def up
- remove_column :application_settings, :seat_link_enabled
- end
-
- def down
- add_column :application_settings, :seat_link_enabled, :boolean, null: false, default: true
- end
-end
diff --git a/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb b/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb
deleted file mode 100644
index 076a238381e..00000000000
--- a/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSigningKeysFromPackagesDebianProjectDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- remove_column :packages_debian_project_distributions, :encrypted_signing_keys, :text
- remove_column :packages_debian_project_distributions, :encrypted_signing_keys_iv, :text
- end
-end
diff --git a/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb b/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb
deleted file mode 100644
index 4b751c06972..00000000000
--- a/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSigningKeysFromPackagesDebianGroupDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- remove_column :packages_debian_group_distributions, :encrypted_signing_keys, :text
- remove_column :packages_debian_group_distributions, :encrypted_signing_keys_iv, :text
- end
-end
diff --git a/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb b/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb
deleted file mode 100644
index 5d42fd4896d..00000000000
--- a/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-# frozen_string_literal: true
-
-class AddNonNullConstraintForEscalationRuleOnPendingAlertEscalations < ActiveRecord::Migration[6.1]
- ELAPSED_WHOLE_MINUTES_IN_SECONDS = <<~SQL
- ABS(ROUND(
- EXTRACT(EPOCH FROM (escalations.process_at - escalations.created_at))/60*60
- ))
- SQL
-
- INSERT_RULES_FOR_ESCALATIONS_WITHOUT_RULES = <<~SQL
- INSERT INTO incident_management_escalation_rules (policy_id, oncall_schedule_id, status, elapsed_time_seconds, is_removed)
- SELECT
- policies.id,
- schedule_id,
- status,
- #{ELAPSED_WHOLE_MINUTES_IN_SECONDS} AS elapsed_time_seconds,
- TRUE
- FROM incident_management_pending_alert_escalations AS escalations
- INNER JOIN incident_management_oncall_schedules AS schedules ON schedules.id = schedule_id
- INNER JOIN incident_management_escalation_policies AS policies ON policies.project_id = schedules.project_id
- WHERE rule_id IS NULL
- GROUP BY policies.id, schedule_id, status, elapsed_time_seconds
- ON CONFLICT DO NOTHING;
- SQL
-
- UPDATE_EMPTY_RULE_IDS = <<~SQL
- UPDATE incident_management_pending_alert_escalations AS escalations
- SET rule_id = rules.id
- FROM incident_management_pending_alert_escalations AS through_escalations
- INNER JOIN incident_management_oncall_schedules AS schedules ON schedules.id = through_escalations.schedule_id
- INNER JOIN incident_management_escalation_policies AS policies ON policies.project_id = schedules.project_id
- INNER JOIN incident_management_escalation_rules AS rules ON rules.policy_id = policies.id
- WHERE escalations.rule_id IS NULL
- AND rules.status = escalations.status
- AND rules.oncall_schedule_id = escalations.schedule_id
- AND rules.elapsed_time_seconds = #{ELAPSED_WHOLE_MINUTES_IN_SECONDS};
- SQL
-
- DELETE_LEFTOVER_ESCALATIONS_WITHOUT_RULES = 'DELETE FROM incident_management_pending_alert_escalations WHERE rule_id IS NULL;'
-
- # For each alert which has a pending escalation without a corresponding rule,
- # create a rule with the expected attributes for the project's policy.
- #
- # Deletes all escalations without rules/policy & adds non-null constraint for rule_id.
- def up
- exec_query INSERT_RULES_FOR_ESCALATIONS_WITHOUT_RULES
- exec_query UPDATE_EMPTY_RULE_IDS
- exec_query DELETE_LEFTOVER_ESCALATIONS_WITHOUT_RULES
-
- change_column_null :incident_management_pending_alert_escalations, :rule_id, false
- end
-
- def down
- change_column_null :incident_management_pending_alert_escalations, :rule_id, true
- end
-end
diff --git a/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb b/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb
deleted file mode 100644
index b0608f15ce1..00000000000
--- a/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleDeleteOrphanedDeployments < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'DeleteOrphanedDeployments'
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION)
- Gitlab::Database::BackgroundMigrationJob.for_migration_class(MIGRATION).delete_all
-
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('deployments'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb b/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb
deleted file mode 100644
index b611b51e3ff..00000000000
--- a/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIssuableSlasWhereIssueClosed < ActiveRecord::Migration[6.1]
- ISSUE_CLOSED_STATUS = 2
-
- class IssuableSla < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'issuable_slas'
-
- belongs_to :issue, class_name: 'Issue'
- end
-
- class Issue < ActiveRecord::Base
- self.table_name = 'issues'
-
- has_one :issuable_sla, class_name: 'IssuableSla'
- end
-
- def up
- IssuableSla.each_batch(of: 50) do |relation|
- relation.joins(:issue)
- .where(issues: { state_id: ISSUE_CLOSED_STATUS } )
- .update_all(issuable_closed: true)
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb b/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb
deleted file mode 100644
index c66c14d1900..00000000000
--- a/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdatedAtIndexOnMergeRequests < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_merge_requests_on_target_project_id_and_updated_at_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :merge_requests, [:target_project_id, :updated_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_requests, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
deleted file mode 100644
index 78ae4f23286..00000000000
--- a/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RevertBackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = :ci_build_trace_sections
- COLUMN = :build_id
-
- def up
- revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN, primary_key: COLUMN
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb b/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb
deleted file mode 100644
index 5bf6a9e7911..00000000000
--- a/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeConvertGeoJobArtifactDeletedEventsBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'geo_job_artifact_deleted_events'
- COLUMN_NAME = 'job_artifact_id'
- COLUMN_NAME_CONVERTED = "#{COLUMN_NAME}_convert_to_bigint"
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [[COLUMN_NAME], [COLUMN_NAME_CONVERTED]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- old_index_name = 'index_geo_job_artifact_deleted_events_on_job_artifact_id'
-
- bigint_index_name = 'index_geo_job_artifact_deleted_events_on_job_artifact_id_bigint'
- add_concurrent_index TABLE_NAME, COLUMN_NAME_CONVERTED, name: bigint_index_name
-
- with_lock_retries(raise_on_exhaustion: true) do
- execute("LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE")
-
- temp_name = quote_column_name("#{COLUMN_NAME}_tmp")
- old_column_name = quote_column_name(COLUMN_NAME)
- new_column_name = quote_column_name(COLUMN_NAME_CONVERTED)
-
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{old_column_name} TO #{temp_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{new_column_name} TO #{old_column_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{new_column_name}"
-
- change_column_default TABLE_NAME, COLUMN_NAME, nil
- change_column_default TABLE_NAME, COLUMN_NAME_CONVERTED, 0
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(COLUMN_NAME, COLUMN_NAME_CONVERTED)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- execute "DROP INDEX #{old_index_name}"
-
- rename_index TABLE_NAME, bigint_index_name, old_index_name
- end
- end
-end
diff --git a/db/post_migrate/20210727113447_backfill_integrations_type_new.rb b/db/post_migrate/20210727113447_backfill_integrations_type_new.rb
deleted file mode 100644
index 47238bae4d5..00000000000
--- a/db/post_migrate/20210727113447_backfill_integrations_type_new.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillIntegrationsTypeNew'
- INTERVAL = 2.minutes
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :integrations,
- :id,
- job_interval: INTERVAL
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :integrations, :id, [])
- end
-end
diff --git a/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb b/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
deleted file mode 100644
index d4ce1e7024f..00000000000
--- a/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUnusedColumnsFromElasticReindexingTasks < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- remove_column :elastic_reindexing_tasks, :documents_count, :integer
- remove_column :elastic_reindexing_tasks, :index_name_from, :text
- remove_column :elastic_reindexing_tasks, :index_name_to, :text
- remove_column :elastic_reindexing_tasks, :elastic_task, :text
- remove_column :elastic_reindexing_tasks, :documents_count_target, :integer
- end
-
- def down
- add_column :elastic_reindexing_tasks, :documents_count, :integer
- add_column :elastic_reindexing_tasks, :index_name_from, :text
- add_column :elastic_reindexing_tasks, :index_name_to, :text
- add_column :elastic_reindexing_tasks, :elastic_task, :text
- add_column :elastic_reindexing_tasks, :documents_count_target, :integer
-
- add_text_limit :elastic_reindexing_tasks, :index_name_from, 255
- add_text_limit :elastic_reindexing_tasks, :index_name_to, 255
- add_text_limit :elastic_reindexing_tasks, :elastic_task, 255
- end
-end
diff --git a/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb b/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb
deleted file mode 100644
index 8ec608453a0..00000000000
--- a/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 100
- MIGRATION = 'PopulateLatestPipelineIds'
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee?
-
- Gitlab::BackgroundMigration.steal(MIGRATION)
-
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::PopulateLatestPipelineIds::ProjectSetting.has_vulnerabilities_without_latest_pipeline_set,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- primary_column_name: 'project_id'
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb b/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb
deleted file mode 100644
index ad6676a1704..00000000000
--- a/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiTestCaseFailuresTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- drop_table :ci_test_case_failures
- end
-
- def down
- create_table :ci_test_case_failures do |t|
- t.datetime_with_timezone :failed_at
- t.bigint :test_case_id, null: false
- t.bigint :build_id, null: false
-
- t.index [:test_case_id, :failed_at, :build_id], name: 'index_test_case_failures_unique_columns', unique: true, order: { failed_at: :desc }
- t.index :build_id
- end
- end
-end
diff --git a/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb b/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb
deleted file mode 100644
index 2de1749721d..00000000000
--- a/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiTestCasesTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- drop_table :ci_test_cases
- end
-
- def down
- create_table_with_constraints :ci_test_cases do |t|
- t.bigint :project_id, null: false
- t.text :key_hash, null: false
- t.text_limit :key_hash, 64
-
- t.index [:project_id, :key_hash], unique: true
- end
- end
-end
diff --git a/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb b/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb
deleted file mode 100644
index 3102561a129..00000000000
--- a/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleExtractProjectTopicsIntoSeparateTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes
- MIGRATION = 'ExtractProjectTopicsIntoSeparateTable'
- INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project'
- INDEX_CONDITION = "taggable_type = 'Project'"
-
- disable_ddl_transaction!
-
- class Tagging < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'taggings'
- end
-
- def up
- # this index is used in 20210730104800_schedule_extract_project_topics_into_separate_table
- add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation
-
- queue_background_migration_jobs_by_range_at_intervals(
- Tagging.where(taggable_type: 'Project'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210730170823_schedule_security_setting_creation.rb b/db/post_migrate/20210730170823_schedule_security_setting_creation.rb
deleted file mode 100644
index cea7b976bf9..00000000000
--- a/db/post_migrate/20210730170823_schedule_security_setting_creation.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleSecuritySettingCreation < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'CreateSecuritySetting'
- BATCH_SIZE = 1000
- INTERVAL = 5.minutes.to_i
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee? # Security Settings available only in EE version
-
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('projects'),
- MIGRATION,
- INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- # We're adding data so no need for rollback
- def down
- end
-end
diff --git a/db/post_migrate/20210731132939_backfill_stage_event_hash.rb b/db/post_migrate/20210731132939_backfill_stage_event_hash.rb
deleted file mode 100644
index e4966cc0e6d..00000000000
--- a/db/post_migrate/20210731132939_backfill_stage_event_hash.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillStageEventHash < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- BATCH_SIZE = 100
- EVENT_ID_IDENTIFIER_MAPPING = {
- 1 => :issue_created,
- 2 => :issue_first_mentioned_in_commit,
- 3 => :issue_closed,
- 4 => :issue_first_added_to_board,
- 5 => :issue_first_associated_with_milestone,
- 7 => :issue_last_edited,
- 8 => :issue_label_added,
- 9 => :issue_label_removed,
- 10 => :issue_deployed_to_production,
- 100 => :merge_request_created,
- 101 => :merge_request_first_deployed_to_production,
- 102 => :merge_request_last_build_finished,
- 103 => :merge_request_last_build_started,
- 104 => :merge_request_merged,
- 105 => :merge_request_closed,
- 106 => :merge_request_last_edited,
- 107 => :merge_request_label_added,
- 108 => :merge_request_label_removed,
- 109 => :merge_request_first_commit_at,
- 1000 => :code_stage_start,
- 1001 => :issue_stage_end,
- 1002 => :plan_stage_start
- }.freeze
-
- LABEL_BASED_EVENTS = Set.new([8, 9, 107, 108]).freeze
-
- class GroupStage < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'analytics_cycle_analytics_group_stages'
- end
-
- class ProjectStage < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'analytics_cycle_analytics_project_stages'
- end
-
- class StageEventHash < ActiveRecord::Base
- self.table_name = 'analytics_cycle_analytics_stage_event_hashes'
- end
-
- def up
- GroupStage.reset_column_information
- ProjectStage.reset_column_information
- StageEventHash.reset_column_information
-
- update_stage_table(GroupStage)
- update_stage_table(ProjectStage)
-
- add_not_null_constraint :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- add_not_null_constraint :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-
- def down
- remove_not_null_constraint :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- remove_not_null_constraint :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-
- private
-
- def update_stage_table(klass)
- klass.each_batch(of: BATCH_SIZE) do |relation|
- klass.transaction do
- records = relation.where(stage_event_hash_id: nil).lock!.to_a # prevent concurrent modification (unlikely to happen)
- records = delete_invalid_records(records)
- next if records.empty?
-
- hashes_by_stage = records.index_with { |stage| calculate_stage_events_hash(stage) }
- hashes = hashes_by_stage.values.uniq
-
- StageEventHash.insert_all(hashes.map { |hash| { hash_sha256: hash } })
-
- stage_event_hashes_by_hash = StageEventHash.where(hash_sha256: hashes).index_by(&:hash_sha256)
- records.each do |stage|
- stage.update!(stage_event_hash_id: stage_event_hashes_by_hash[hashes_by_stage[stage]].id)
- end
- end
- end
- end
-
- def calculate_stage_events_hash(stage)
- start_event_hash = calculate_event_hash(stage.start_event_identifier, stage.start_event_label_id)
- end_event_hash = calculate_event_hash(stage.end_event_identifier, stage.end_event_label_id)
-
- Digest::SHA256.hexdigest("#{start_event_hash}-#{end_event_hash}")
- end
-
- def calculate_event_hash(event_identifier, label_id = nil)
- str = EVENT_ID_IDENTIFIER_MAPPING.fetch(event_identifier).to_s
- str << "-#{label_id}" if LABEL_BASED_EVENTS.include?(event_identifier)
-
- Digest::SHA256.hexdigest(str)
- end
-
- # Invalid records are safe to delete, since they are not working properly anyway
- def delete_invalid_records(records)
- to_be_deleted = records.select do |record|
- EVENT_ID_IDENTIFIER_MAPPING[record.start_event_identifier].nil? ||
- EVENT_ID_IDENTIFIER_MAPPING[record.end_event_identifier].nil?
- end
-
- to_be_deleted.each(&:delete)
- records - to_be_deleted
- end
-end
diff --git a/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb b/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb
deleted file mode 100644
index 289b77f0a5c..00000000000
--- a/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion3 < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'push_event_payloads'
- INDEX_NAME = 'index_push_event_payloads_on_event_id_convert_to_bigint'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'event_id',
- job_arguments: [["event_id"], ["event_id_convert_to_bigint"]]
- )
-
- return if already_swapped?
-
- swap_columns
- end
-
- def down
- swap_columns
- end
-
- private
-
- def already_swapped?
- push_event_payloads_columns = columns(TABLE_NAME)
- event_id = push_event_payloads_columns.find { |c| c.name == 'event_id' }
- event_id_convert_to_bigint = push_event_payloads_columns.find { |c| c.name == 'event_id_convert_to_bigint' }
-
- event_id.sql_type == 'bigint' && event_id_convert_to_bigint.sql_type == 'integer'
- end
-
- def swap_columns
- add_concurrent_index TABLE_NAME, :event_id_convert_to_bigint, unique: true, name: INDEX_NAME
-
- # Add a foreign key on `event_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_36c74129da)
- add_concurrent_foreign_key TABLE_NAME, :events, column: :event_id_convert_to_bigint,
- on_delete: :cascade, reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start.
- # Lock order should be
- # 1. events
- # 2. push_event_payloads
- # in order to match the order in EventCreateService#create_push_event,
- # and avoid deadlocks.
- execute "LOCK TABLE events, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'event_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id_convert_to_bigint)} TO #{quote_column_name(:event_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:event_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:event_id, :event_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :event_id, nil
- change_column_default TABLE_NAME, :event_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT push_event_payloads_pkey"
- rename_index TABLE_NAME, INDEX_NAME, 'push_event_payloads_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT push_event_payloads_pkey PRIMARY KEY USING INDEX push_event_payloads_pkey"
-
- # Drop original FK on the old int4 `event_id` (fk_36c74129da)
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :event_id)
- # We swapped the columns but the FK for event_id is still using the old name for the event_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :event_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :event_id)
- )
- end
- end
-end
diff --git a/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb b/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
deleted file mode 100644
index 318d9e8a218..00000000000
--- a/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexIssuesOnProjectIdAndStateIdAndCreatedAtAndId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_issues_on_project_id_and_state_id_and_created_at_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :issues, [:project_id, :state_id, :created_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issues, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb b/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb
deleted file mode 100644
index 067b7166cf3..00000000000
--- a/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeConvertDeploymentsBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'deployments'
- COLUMN_NAME = 'deployable_id'
- COLUMN_NAME_BIGINT = "#{COLUMN_NAME}_convert_to_bigint"
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [[COLUMN_NAME], [COLUMN_NAME_BIGINT]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- old_index_name = 'index_deployments_on_deployable_type_and_deployable_id'
- bigint_index_name = 'index_deployments_on_deployable_type_and_deployable_id_bigint'
- add_concurrent_index TABLE_NAME, ['deployable_type', COLUMN_NAME_BIGINT], name: bigint_index_name
-
- with_lock_retries(raise_on_exhaustion: true) do
- # Swap columns
- temp_name = "#{COLUMN_NAME}_tmp"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(COLUMN_NAME)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(COLUMN_NAME_BIGINT)} TO #{quote_column_name(COLUMN_NAME)}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(COLUMN_NAME_BIGINT)}"
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(COLUMN_NAME, COLUMN_NAME_BIGINT)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- execute "DROP INDEX #{old_index_name}"
- rename_index TABLE_NAME, bigint_index_name, old_index_name
- end
- end
-end
diff --git a/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb b/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb
deleted file mode 100644
index a2736a563c7..00000000000
--- a/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveClusterImageScanningFromApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- execute("update approval_project_rules set scanners = array_remove(scanners, 'cluster_image_scanning') where scanners @> '{cluster_image_scanning}'")
- end
-
- def down
- # nothing to do here
- end
-end
diff --git a/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb b/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb
deleted file mode 100644
index 81e73effe7b..00000000000
--- a/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiJobArtifactBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_job_artifacts, :id_convert_to_bigint, unique: true,
- name: :index_ci_job_artifact_on_id_convert_to_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:project_id, :id_convert_to_bigint],
- where: 'file_type = 18', name: :index_ci_job_artifacts_for_terraform_reports_bigint
-
- prepare_async_index :ci_job_artifacts, :id_convert_to_bigint,
- where: 'file_type = 18',
- name: :index_ci_job_artifacts_id_for_terraform_reports_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:expire_at, :job_id_convert_to_bigint],
- name: :index_ci_job_artifacts_on_expire_at_and_job_id_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:job_id_convert_to_bigint, :file_type],
- unique: true, name: :index_ci_job_artifacts_on_job_id_and_file_type_bigint
- end
-
- def down
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_on_job_id_and_file_type_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_on_expire_at_and_job_id_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_id_for_terraform_reports_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_for_terraform_reports_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifact_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb b/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb
deleted file mode 100644
index ab6691dea1f..00000000000
--- a/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForTaggingBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :taggings, :id_convert_to_bigint, unique: true,
- name: :index_taggings_on_id_convert_to_bigint
-
- prepare_async_index :taggings, [:taggable_id_convert_to_bigint, :taggable_type],
- name: :i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type
-
- prepare_async_index :taggings, [:taggable_id_convert_to_bigint, :taggable_type, :context],
- name: :i_taggings_on_taggable_bigint_and_taggable_type_and_context
-
- prepare_async_index :taggings, [:tag_id, :taggable_id_convert_to_bigint, :taggable_type, :context, :tagger_id, :tagger_type],
- unique: true, name: :taggings_idx_tmp
- end
-
- def down
- unprepare_async_index_by_name :taggings, :taggings_idx_tmp
-
- unprepare_async_index_by_name :taggings, :i_taggings_on_taggable_bigint_and_taggable_type_and_context
-
- unprepare_async_index_by_name :taggings, :i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type
-
- unprepare_async_index_by_name :taggings, :index_taggings_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb b/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb
deleted file mode 100644
index 16f3e87000c..00000000000
--- a/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiStageBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_stages, :id_convert_to_bigint, unique: true,
- name: :index_ci_stages_on_id_convert_to_bigint
-
- prepare_async_index :ci_stages, [:pipeline_id, :id_convert_to_bigint],
- where: 'status in (0, 1, 2, 8, 9, 10)',
- name: :index_ci_stages_on_pipeline_id_and_id_convert_to_bigint
- end
-
- def down
- unprepare_async_index_by_name :ci_stages,
- :index_ci_stages_on_pipeline_id_and_id_convert_to_bigint
-
- unprepare_async_index_by_name :ci_stages, :index_ci_stages_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb b/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb
deleted file mode 100644
index 5e18450f465..00000000000
--- a/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsRunnerSessionBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_runner_session'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, unique: true, name: 'index_ci_builds_runner_session_on_build_id_convert_to_bigint'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK ()
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade, name: 'fk_rails_70707857d3_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_builds_runner_session_on_build_id'
- rename_index TABLE_NAME, 'index_ci_builds_runner_session_on_build_id_convert_to_bigint', 'index_ci_builds_runner_session_on_build_id'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_70707857d3)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_70707857d3'
-
- # We swapped the columns but the FK for buil_id is still using the temporary name for the build_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_70707857d3_tmp', 'fk_rails_70707857d3')
- end
- end
-end
diff --git a/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb b/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb
deleted file mode 100644
index f27f61729a3..00000000000
--- a/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateTrialPlansCiDailyPipelineScheduleTriggers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- PREMIUM_TRIAL = 'premium_trial'
- ULTIMATE_TRIAL = 'ultimate_trial'
- EVERY_5_MINUTES = (1.day.in_minutes / 5).to_i
-
- class Plan < ActiveRecord::Base
- self.table_name = 'plans'
- self.inheritance_column = :_type_disabled
-
- has_one :limits, class_name: 'PlanLimits'
- end
-
- class PlanLimits < ActiveRecord::Base
- self.table_name = 'plan_limits'
- self.inheritance_column = :_type_disabled
-
- belongs_to :plan
- end
-
- def plan_limits_present?
- premium_trial_plan = Plan.find_by(name: PREMIUM_TRIAL)
- ultimate_trial_plan = Plan.find_by(name: ULTIMATE_TRIAL)
-
- premium_trial_plan && premium_trial_plan.limits && ultimate_trial_plan && ultimate_trial_plan.limits
- end
-
- def up
- return unless Gitlab.com?
-
- if plan_limits_present?
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', PREMIUM_TRIAL, EVERY_5_MINUTES)
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', ULTIMATE_TRIAL, EVERY_5_MINUTES)
- end
- end
-
- def down
- return unless Gitlab.com?
-
- if plan_limits_present?
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', PREMIUM_TRIAL, 0)
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', ULTIMATE_TRIAL, 0)
- end
- end
-end
diff --git a/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb b/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb
deleted file mode 100644
index 90bca79624d..00000000000
--- a/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillDraftColumnOnMergeRequestsRerun < ActiveRecord::Migration[6.1]
- def up
- # noop
- #
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb b/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb
deleted file mode 100644
index 5f094e48ed4..00000000000
--- a/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeTagginsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'taggings'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id taggable_id], %w[id_convert_to_bigint taggable_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # rubocop:disable Migration/PreventIndexCreation
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_taggings_on_id_convert_to_bigint'
-
- # This is to replace the existing "index_taggings_on_taggable_id_and_taggable_type" btree (taggable_id, taggable_type)
- add_concurrent_index TABLE_NAME, [:taggable_id_convert_to_bigint, :taggable_type], name: 'i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type'
-
- # This is to replace the existing "index_taggings_on_taggable_id_and_taggable_type_and_context" btree (taggable_id, taggable_type, context)
- add_concurrent_index TABLE_NAME, [:taggable_id_convert_to_bigint, :taggable_type, :context], name: 'i_taggings_on_taggable_bigint_and_taggable_type_and_context'
-
- # This is to replace the existing "taggings_idx" btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type)
- add_concurrent_index TABLE_NAME, [:tag_id, :taggable_id_convert_to_bigint, :taggable_type, :context, :tagger_id, :tagger_type], unique: true, name: 'taggings_idx_tmp'
-
- # This is to replace the existing "tmp_index_taggings_on_id_where_taggable_type_project" btree (id) WHERE taggable_type::text = 'Project'::text
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, where: "taggable_type = 'Project'", name: 'tmp_index_taggings_on_id_bigint_where_taggable_type_project'
- # rubocop:enable Migration/PreventIndexCreation
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'taggable_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:taggable_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:taggable_id_convert_to_bigint)} TO #{quote_column_name(:taggable_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:taggable_id_convert_to_bigint)}"
-
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :taggable_id], [:id_convert_to_bigint, :taggable_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE taggings_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('taggings_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT taggings_pkey CASCADE"
- rename_index TABLE_NAME, 'index_taggings_on_id_convert_to_bigint', 'taggings_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT taggings_pkey PRIMARY KEY USING INDEX taggings_pkey"
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX IF EXISTS index_taggings_on_taggable_id_and_taggable_type'
- rename_index TABLE_NAME, 'i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type', 'index_taggings_on_taggable_id_and_taggable_type'
- execute 'DROP INDEX IF EXISTS index_taggings_on_taggable_id_and_taggable_type_and_context'
- rename_index TABLE_NAME, 'i_taggings_on_taggable_bigint_and_taggable_type_and_context', 'index_taggings_on_taggable_id_and_taggable_type_and_context'
- execute 'DROP INDEX IF EXISTS taggings_idx'
- rename_index TABLE_NAME, 'taggings_idx_tmp', 'taggings_idx'
- execute 'DROP INDEX IF EXISTS tmp_index_taggings_on_id_where_taggable_type_project'
- rename_index TABLE_NAME, 'tmp_index_taggings_on_id_bigint_where_taggable_type_project', 'tmp_index_taggings_on_id_where_taggable_type_project'
- end
- end
-end
diff --git a/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb b/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb
deleted file mode 100644
index ddbafaf32a9..00000000000
--- a/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-class OrphanedInviteTokensCleanup < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_orphaned_invite_tokens'
-
- def up
- add_concurrent_index('members', :id, where: query_condition, name: TMP_INDEX_NAME)
-
- membership.where(query_condition).pluck(:id).each_slice(10) do |group|
- membership.where(id: group).where(query_condition).update_all(invite_token: nil)
- end
-
- remove_concurrent_index_by_name('members', TMP_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name('members', TMP_INDEX_NAME) if index_exists_by_name?('members', TMP_INDEX_NAME)
-
- # This migration is irreversible
- end
-
- private
-
- def membership
- @membership ||= define_batchable_model('members')
- end
-
- # We need to ensure we're comparing timestamp with time zones across
- # the board since that is an immutable comparison. Some database
- # schemas have a mix of timestamp without time zones and and timestamp
- # with time zones: https://gitlab.com/groups/gitlab-org/-/epics/2473
- def query_condition
- "invite_token IS NOT NULL and invite_accepted_at IS NOT NULL and #{timestamptz("invite_accepted_at")} < #{timestamptz("created_at")}"
- end
-
- def timestamptz(name)
- if column_type(name) == "timestamp without time zone"
- "TIMEZONE('UTC', #{name})"
- else
- name
- end
- end
-
- def column_type(name)
- membership.columns_hash[name].sql_type
- end
-end
diff --git a/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb b/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb
deleted file mode 100644
index 5cec6fa30b8..00000000000
--- a/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeJobIdConversionToBigintForCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_job_artifacts_on_expire_at_and_job_id" btree (expire_at, job_id)
- add_concurrent_index TABLE_NAME, [:expire_at, :job_id_convert_to_bigint], name: 'index_ci_job_artifacts_on_expire_at_and_job_id_bigint'
- # This is to replace the existing "index_ci_job_artifacts_on_job_id_and_file_type" btree (job_id, file_type)
- add_concurrent_index TABLE_NAME, [:job_id_convert_to_bigint, :file_type], name: 'index_ci_job_artifacts_on_job_id_and_file_type_bigint', unique: true
-
- # # Add a FK on `job_id_convert_to_bigint` to `ci_builds(id)`, the old FK (fk_rails_c5137cb2c1)
- # # is removed below since it won't be dropped automatically.
- fk_ci_builds_job_id = concurrent_foreign_key_name(TABLE_NAME, :job_id, prefix: 'fk_rails_')
- fk_ci_builds_job_id_tmp = "#{fk_ci_builds_job_id}_tmp"
-
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :job_id_convert_to_bigint,
- name: fk_ci_builds_job_id_tmp,
- on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
-
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- temp_name = 'job_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:job_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:job_id_convert_to_bigint)} TO #{quote_column_name(:job_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:job_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :job_id], [:id_convert_to_bigint, :job_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :job_id, nil
- change_column_default TABLE_NAME, :job_id_convert_to_bigint, 0
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_ci_job_artifacts_on_expire_at_and_job_id'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_on_expire_at_and_job_id_bigint', 'index_ci_job_artifacts_on_expire_at_and_job_id'
- execute 'DROP INDEX index_ci_job_artifacts_on_job_id_and_file_type'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_on_job_id_and_file_type_bigint', 'index_ci_job_artifacts_on_job_id_and_file_type'
-
- # Drop original FK on the old int4 `job_id` (fk_rails_c5137cb2c1)
- remove_foreign_key TABLE_NAME, name: fk_ci_builds_job_id
-
- # We swapped the columns but the FK for job_id is still using the temporary name for the job_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, fk_ci_builds_job_id_tmp, fk_ci_builds_job_id)
- end
- end
-end
diff --git a/db/post_migrate/20210811122206_update_external_project_bots.rb b/db/post_migrate/20210811122206_update_external_project_bots.rb
deleted file mode 100644
index dc2e3d316b0..00000000000
--- a/db/post_migrate/20210811122206_update_external_project_bots.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateExternalProjectBots < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- class User < ActiveRecord::Base
- self.table_name = 'users'
- end
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_update_external_project_bots'
-
- def up
- add_concurrent_index('users', 'id', name: TMP_INDEX_NAME, where: 'external = true')
-
- ids = ActiveRecord::Base.connection
- .execute("SELECT u.id FROM users u JOIN users u2 on u2.id = u.created_by_id WHERE u.user_type = 6 AND u2.external = true")
- .map { |result| result['id'] }
-
- ids.each_slice(10) do |group|
- UpdateExternalProjectBots::User.where(id: group).update_all(external: true)
- end
-
- 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)
-
- # This migration is irreversible
- end
-end
diff --git a/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb b/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb
deleted file mode 100644
index 106d1430dca..00000000000
--- a/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleCopyCiBuildsColumnsToSecurityScans < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op as we found an issue with bg migration, we fixed it and rescheduling it again.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb b/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb
deleted file mode 100644
index 1c2e2b52e8b..00000000000
--- a/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateProjectAuthorizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- BATCH_SIZE = 10_000
- OLD_INDEX_NAME = 'index_project_authorizations_on_project_id_user_id'
- INDEX_NAME = 'index_unique_project_authorizations_on_project_id_user_id'
-
- class ProjectAuthorization < ActiveRecord::Base
- self.table_name = 'project_authorizations'
- end
-
- disable_ddl_transaction!
-
- def up
- batch do |first_record, last_record|
- break if first_record.blank?
-
- # construct a range query where we filter records between the first and last records
- rows = ActiveRecord::Base.connection.execute <<~SQL
- SELECT user_id, project_id
- FROM project_authorizations
- WHERE
- #{start_condition(first_record)}
- #{end_condition(last_record)}
- GROUP BY user_id, project_id
- HAVING COUNT(*) > 1
- SQL
-
- rows.each do |row|
- deduplicate_item(row['project_id'], row['user_id'])
- end
- end
-
- add_concurrent_index :project_authorizations, [:project_id, :user_id], unique: true, name: INDEX_NAME
- remove_concurrent_index_by_name :project_authorizations, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index(:project_authorizations, [:project_id, :user_id], name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, INDEX_NAME)
- end
-
- private
-
- def start_condition(record)
- "(user_id, project_id) >= (#{Integer(record.user_id)}, #{Integer(record.project_id)})"
- end
-
- def end_condition(record)
- return "" unless record
-
- "AND (user_id, project_id) <= (#{Integer(record.user_id)}, #{Integer(record.project_id)})"
- end
-
- def batch(&block)
- order = Gitlab::Pagination::Keyset::Order.build(
- [
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'user_id',
- order_expression: ProjectAuthorization.arel_table[:user_id].asc,
- nullable: :not_nullable,
- distinct: false
- ),
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'project_id',
- order_expression: ProjectAuthorization.arel_table[:project_id].asc,
- nullable: :not_nullable,
- distinct: false
- ),
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'access_level',
- order_expression: ProjectAuthorization.arel_table[:access_level].asc,
- nullable: :not_nullable,
- distinct: true
- )
- ])
-
- scope = ProjectAuthorization.order(order)
- cursor = {}
- loop do
- current_scope = scope.dup
-
- relation = order.apply_cursor_conditions(current_scope, cursor)
- first_record = relation.take
- last_record = relation.offset(BATCH_SIZE).take
-
- yield first_record, last_record
-
- break if last_record.blank?
-
- cursor = order.cursor_attributes_for_node(last_record)
- end
- end
-
- def deduplicate_item(project_id, user_id)
- auth_records = ProjectAuthorization.where(project_id: project_id, user_id: user_id).order(access_level: :desc).to_a
-
- ActiveRecord::Base.transaction do
- # Keep the highest access level and destroy the rest.
- auth_records[1..].each do |record|
- ProjectAuthorization
- .where(
- project_id: record.project_id,
- user_id: record.user_id,
- access_level: record.access_level
- ).delete_all
- end
- end
- end
-end
diff --git a/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb b/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb
deleted file mode 100644
index 6b4c69efa2b..00000000000
--- a/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class ResetJobTokenScopeEnabledAgain < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb b/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb
deleted file mode 100644
index d11baae42e2..00000000000
--- a/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-class ReplaceExternalWikiTriggers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- def up
- replace_triggers('type_new', 'Integrations::ExternalWiki')
-
- # we need an extra trigger to handle when type_new is updated by the
- # `integrations_set_type_new` trigger.
- # This can be removed when this trigger has been removed.
- execute(<<~SQL.squish)
- CREATE TRIGGER #{trigger_name(:type_new_updated)}
- AFTER UPDATE OF type_new ON integrations FOR EACH ROW
- WHEN ((new.type_new)::text = 'Integrations::ExternalWiki'::text AND new.project_id IS NOT NULL)
- EXECUTE FUNCTION set_has_external_wiki();
- SQL
- end
-
- def down
- execute("DROP TRIGGER IF EXISTS #{trigger_name(:type_new_updated)} ON integrations;")
- replace_triggers('type', 'ExternalWikiService')
- end
-
- private
-
- def replace_triggers(column_name, value)
- triggers(column_name, value).each do |event, condition|
- trigger = trigger_name(event)
-
- # create duplicate trigger, using the defined condition
- execute(<<~SQL.squish)
- CREATE TRIGGER #{trigger}_new AFTER #{event.upcase} ON integrations FOR EACH ROW
- WHEN (#{condition})
- EXECUTE FUNCTION set_has_external_wiki();
- SQL
-
- # Swap the triggers in place, so that the new trigger has the canonical name
- execute("ALTER TRIGGER #{trigger} ON integrations RENAME TO #{trigger}_old;")
- execute("ALTER TRIGGER #{trigger}_new ON integrations RENAME TO #{trigger};")
-
- # remove the old, now redundant trigger
- execute("DROP TRIGGER IF EXISTS #{trigger}_old ON integrations;")
- end
- end
-
- def trigger_name(event)
- "trigger_has_external_wiki_on_#{event}"
- end
-
- def triggers(column_name, value)
- {
- delete: "#{matches_value('old', column_name, value)} AND #{project_not_null('old')}",
- insert: "(new.active = true) AND #{matches_value('new', column_name, value)} AND #{project_not_null('new')}",
- update: "#{matches_value('new', column_name, value)} AND (old.active <> new.active) AND #{project_not_null('new')}"
- }
- end
-
- def project_not_null(row)
- "(#{row}.project_id IS NOT NULL)"
- end
-
- def matches_value(row, column_name, value)
- "((#{row}.#{column_name})::text = '#{value}'::text)"
- end
-end
diff --git a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb b/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
deleted file mode 100644
index 0e6f1c50534..00000000000
--- a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences3 < ActiveRecord::Migration[6.0]
- def up
- # no-op
- # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb b/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb
deleted file mode 100644
index 074ba97da65..00000000000
--- a/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleCopyCiBuildsColumnsToSecurityScans2 < ActiveRecord::Migration[6.1]
- def up
- # no-op: Must have run before %"15.X" as it is not compatible with decomposed CI database
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb b/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb
deleted file mode 100644
index e1ed28f6826..00000000000
--- a/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForEventsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = 'events'
-
- def up
- prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true,
- name: :index_events_on_id_convert_to_bigint
-
- prepare_async_index TABLE_NAME, [:project_id, :id_convert_to_bigint],
- name: :index_events_on_project_id_and_id_convert_to_bigint
-
- prepare_async_index TABLE_NAME, [:project_id, :id_convert_to_bigint],
- order: { id_convert_to_bigint: :desc },
- where: 'action = 7', name: :index_events_on_project_id_and_id_bigint_desc_on_merged_action
- end
-
- def down
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_id_convert_to_bigint
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_project_id_and_id_convert_to_bigint
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_project_id_and_id_bigint_desc_on_merged_action
- end
-end
diff --git a/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb b/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb
deleted file mode 100644
index d86d49f4393..00000000000
--- a/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillProjectsWithCoverage < ActiveRecord::Migration[6.1]
- def up
- # noop
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb b/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb
deleted file mode 100644
index bbcee556020..00000000000
--- a/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryColumnsAndTriggersForCiBuildsRunnerSession < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = 'ci_builds_runner_session'
- 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/20210819183128_reset_severity_levels_to_new_default.rb b/db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb
deleted file mode 100644
index cdfd92ac0d7..00000000000
--- a/db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ResetSeverityLevelsToNewDefault < ActiveRecord::Migration[6.1]
- ALL_SEVERITY_LEVELS = 6 # ::Enums::Vulnerability::SEVERITY_LEVELS.count
-
- def up
- execute(<<~SQL.squish)
- UPDATE approval_project_rules
- SET severity_levels = '{unknown, high, critical}'
- WHERE array_length(severity_levels, 1) = #{ALL_SEVERITY_LEVELS};
- SQL
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb b/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb
deleted file mode 100644
index 7e893d62c28..00000000000
--- a/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class StealMergeRequestDiffCommitUsersMigration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- job = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class('MigrateMergeRequestDiffCommitUsers')
- .pending
- .last
-
- return unless job
-
- # We schedule in one hour so we don't end up running the migrations while a
- # deployment is still wrapping up. Not that that really matters, but it
- # prevents from too much happening during a deployment window.
- migrate_in(1.hour, 'StealMigrateMergeRequestDiffCommitUsers', job.arguments)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb b/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb
deleted file mode 100644
index 35cf3b55200..00000000000
--- a/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateDastSiteTokens < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- class DastSiteToken < ApplicationRecord
- self.table_name = 'dast_site_tokens'
- self.inheritance_column = :_type_disabled
-
- scope :duplicates, -> do
- all_duplicates = select(:project_id, :url)
- .distinct
- .group(:project_id, :url)
- .having('count(*) > 1')
- .pluck('array_agg(id) as ids')
-
- duplicate_ids = extract_duplicate_ids(all_duplicates)
-
- where(id: duplicate_ids)
- end
-
- def self.extract_duplicate_ids(duplicates)
- duplicates.flat_map { |ids| ids.first(ids.size - 1) }
- end
- end
-
- def up
- DastSiteToken.duplicates.delete_all
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb b/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb
deleted file mode 100644
index 42b25a192d5..00000000000
--- a/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryTriggerForCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = 'ci_job_artifacts'
- TEMPORARY_COLUMNS = %w(id_convert_to_bigint job_id_convert_to_bigint)
- MAIN_COLUMNS = %w(id job_id)
- TRIGGER = 'trigger_be1804f21693'
-
- # 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_COLUMNS, TEMPORARY_COLUMNS, trigger_name: TRIGGER)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb b/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
deleted file mode 100644
index 638361d0e83..00000000000
--- a/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAllowEditingCommitMessagesFromProjectSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- return unless column_exists?(:project_settings, :allow_editing_commit_messages)
-
- with_lock_retries do
- remove_column :project_settings, :allow_editing_commit_messages
- end
- end
-
- def down
- with_lock_retries do
- add_column :project_settings, :allow_editing_commit_messages, :boolean, default: false, null: false
- end
- end
-end
diff --git a/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb b/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
deleted file mode 100644
index d88a31fca7d..00000000000
--- a/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceIndexToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_projects_on_project_namespace_id'
-
- def up
- add_concurrent_index :projects, :project_namespace_id, name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :projects, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb b/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb
deleted file mode 100644
index 5cb42fd61a7..00000000000
--- a/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceForeignKeyToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_COLUMN = :project_namespace_id
-
- def up
- add_concurrent_foreign_key :projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
- end
- end
-end
diff --git a/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb b/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb
deleted file mode 100644
index bf95aa98295..00000000000
--- a/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareCiBuildsMetadataAndCiBuildAsyncIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_builds_metadata, :id_convert_to_bigint, unique: true,
- name: :index_ci_builds_metadata_on_id_convert_to_bigint
-
- prepare_async_index :ci_builds_metadata, :build_id_convert_to_bigint, unique: true,
- name: :index_ci_builds_metadata_on_build_id_convert_to_bigint
-
- prepare_async_index :ci_builds_metadata, :build_id_convert_to_bigint, where: 'has_exposed_artifacts IS TRUE',
- name: :index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts
-
- prepare_async_index_from_sql(:ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_where_interruptible, <<~SQL.squish)
- CREATE INDEX CONCURRENTLY "index_ci_builds_metadata_on_build_id_int8_where_interruptible"
- ON "ci_builds_metadata" ("build_id_convert_to_bigint") INCLUDE ("id_convert_to_bigint")
- WHERE interruptible = true
- SQL
-
- prepare_async_index :ci_builds, :id_convert_to_bigint, unique: true,
- name: :index_ci_builds_on_converted_id
- end
-
- def down
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_converted_id
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_where_interruptible
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_convert_to_bigint
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_id_convert_to_bigint
- 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/20210825150212_cleanup_remaining_orphan_invites.rb b/db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb
deleted file mode 100644
index d892e6897af..00000000000
--- a/db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupRemainingOrphanInvites < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_members_with_orphaned_invites'
-
- QUERY_CONDITION = "invite_token IS NOT NULL AND user_id IS NOT NULL"
-
- def up
- membership = define_batchable_model('members')
-
- add_concurrent_index :members, :id, where: QUERY_CONDITION, name: TMP_INDEX_NAME
-
- membership.where(QUERY_CONDITION).pluck(:id).each_slice(10) do |group|
- membership.where(id: group).where(QUERY_CONDITION).update_all(invite_token: nil)
- end
-
- remove_concurrent_index_by_name :members, TMP_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :members, TMP_INDEX_NAME if index_exists_by_name?(:members, TMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb b/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb
deleted file mode 100644
index 4d8e18ba8ed..00000000000
--- a/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateDastSiteTokensWithSameToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_site_token_on_token'
-
- # rubocop: disable Migration/AddIndex
- def up
- execute("WITH duplicate_tokens AS(
- SELECT id, rank() OVER (PARTITION BY token ORDER BY id) r FROM dast_site_tokens
- )
- DELETE FROM dast_site_tokens c USING duplicate_tokens t
- WHERE c.id = t.id AND t.r > 1;")
-
- add_index :dast_site_tokens, :token, name: INDEX_NAME, unique: true
- end
-
- # rubocop: disable Migration/RemoveIndex
- def down
- remove_index :dast_site_tokens, :token, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb b/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb
deleted file mode 100644
index eb879d9bc7a..00000000000
--- a/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkToIterationCadenceIdOnBoards < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_boards_on_iteration_cadence_id'
-
- def up
- add_concurrent_index :boards, :iteration_cadence_id, name: INDEX_NAME
- add_concurrent_foreign_key :boards, :iterations_cadences, column: :iteration_cadence_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :boards, column: :iteration_cadence_id
- end
- remove_concurrent_index_by_name :boards, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb b/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb
deleted file mode 100644
index 1f6650140d4..00000000000
--- a/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCadenceIdForBoardsScopedToIteration < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- BATCH_SIZE = 1000
- DELAY = 2.minutes.to_i
- MIGRATION = 'BackfillIterationCadenceIdForBoards'
-
- class MigrationBoard < ApplicationRecord
- include EachBatch
-
- self.table_name = 'boards'
- end
-
- def up
- schedule_backfill_group_boards
- schedule_backfill_project_boards
- end
-
- def down
- MigrationBoard.where.not(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['none', 'down', *range])
- end
- end
-
- private
-
- def schedule_backfill_project_boards
- MigrationBoard.where(iteration_id: -4).where.not(project_id: nil).where(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['project', 'up', *range])
- end
- end
-
- def schedule_backfill_group_boards
- MigrationBoard.where(iteration_id: -4).where.not(group_id: nil).where(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['group', 'up', *range])
- end
- end
-end
diff --git a/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb b/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
deleted file mode 100644
index e11bb25d83c..00000000000
--- a/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiJobArtifactsExpireAtUnlocked < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx'
-
- def up
- prepare_async_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb b/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb
deleted file mode 100644
index 7615931464b..00000000000
--- a/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-# Initialize the new `throttle_unauthenticated_api_*` columns with the current values
-# from the `throttle_unauthenticated_*` columns, which will now only apply to web requests.
-#
-# The columns for the unauthenticated web rate limit will be renamed later
-# in https://gitlab.com/gitlab-org/gitlab/-/issues/340031.
-class InitializeThrottleUnauthenticatedApiColumns < ActiveRecord::Migration[6.1]
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = :application_settings
- end
-
- def up
- ApplicationSetting.update_all(%q{
- throttle_unauthenticated_api_enabled = throttle_unauthenticated_enabled,
- throttle_unauthenticated_api_requests_per_period = throttle_unauthenticated_requests_per_period,
- throttle_unauthenticated_api_period_in_seconds = throttle_unauthenticated_period_in_seconds
- })
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb b/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..ae51e312fc4
--- /dev/null
+++ b/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ScheduleFkIndexToCiBuildTraceMetadataOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_build_trace_metadata_on_partition_id_build_id
+ TABLE_NAME = :ci_build_trace_metadata
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ prepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME, unique: true)
+ end
+
+ def down
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..c9eda410b34
--- /dev/null
+++ b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ScheduleFkIndexToCiJobArtifactsOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_job_artifacts_on_partition_id_job_id
+ TABLE_NAME = :ci_job_artifacts
+ COLUMNS = [:partition_id, :job_id]
+
+ def up
+ prepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/schema_migrations/20210602155110 b/db/schema_migrations/20210602155110
deleted file mode 100644
index 127375dc477..00000000000
--- a/db/schema_migrations/20210602155110
+++ /dev/null
@@ -1 +0,0 @@
-aa04d433e400ed3ec11e5d40ada72f122b1d8b7a82f8803d9206da5c94ec5ef9 \ No newline at end of file
diff --git a/db/schema_migrations/20210602164044 b/db/schema_migrations/20210602164044
deleted file mode 100644
index 4574aaf9cb9..00000000000
--- a/db/schema_migrations/20210602164044
+++ /dev/null
@@ -1 +0,0 @@
-6c617b919e6e0cba0bd62cc0d5056dcad3ebe1a9ce25102a288de5456cbaa6c3 \ No newline at end of file
diff --git a/db/schema_migrations/20210603140302 b/db/schema_migrations/20210603140302
deleted file mode 100644
index 346cf84c85c..00000000000
--- a/db/schema_migrations/20210603140302
+++ /dev/null
@@ -1 +0,0 @@
-5b58dbdcba08f6e56802aa58ba0d23e5353c1818a8d4d653d53dabaac4c0234c \ No newline at end of file
diff --git a/db/schema_migrations/20210603222333 b/db/schema_migrations/20210603222333
deleted file mode 100644
index 25b5055f17e..00000000000
--- a/db/schema_migrations/20210603222333
+++ /dev/null
@@ -1 +0,0 @@
-fb02e0fee2760dad203b54d81c342dbf1461b3010503cab05da1eb14ab5d33da \ No newline at end of file
diff --git a/db/schema_migrations/20210604032738 b/db/schema_migrations/20210604032738
deleted file mode 100644
index 1bd62357c71..00000000000
--- a/db/schema_migrations/20210604032738
+++ /dev/null
@@ -1 +0,0 @@
-fa373e98739d57d829273cfa9246137e2c151be67e97183c1dcdb288150aaeb5 \ No newline at end of file
diff --git a/db/schema_migrations/20210604034158 b/db/schema_migrations/20210604034158
deleted file mode 100644
index 06b04764628..00000000000
--- a/db/schema_migrations/20210604034158
+++ /dev/null
@@ -1 +0,0 @@
-c7cf4aad7637d793d1ace8fee02111bc9b0d2eea09efadb0fd616bc5c5e5550c \ No newline at end of file
diff --git a/db/schema_migrations/20210604034354 b/db/schema_migrations/20210604034354
deleted file mode 100644
index a76242b3412..00000000000
--- a/db/schema_migrations/20210604034354
+++ /dev/null
@@ -1 +0,0 @@
-da868be7c8edefc462110b5b36415870cc0c7c59dba1e3d514348011a9e70642 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051330 b/db/schema_migrations/20210604051330
deleted file mode 100644
index 74140921c2f..00000000000
--- a/db/schema_migrations/20210604051330
+++ /dev/null
@@ -1 +0,0 @@
-2d025932dca7a407968e14872ce053461e69550098ca089d4e6ece323d240927 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051742 b/db/schema_migrations/20210604051742
deleted file mode 100644
index 32ed06dafff..00000000000
--- a/db/schema_migrations/20210604051742
+++ /dev/null
@@ -1 +0,0 @@
-7529373266b6c9b179367d5fa8775f5e2ad600008957b3a821d689aec70c7407 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051917 b/db/schema_migrations/20210604051917
deleted file mode 100644
index 0034d9988e7..00000000000
--- a/db/schema_migrations/20210604051917
+++ /dev/null
@@ -1 +0,0 @@
-3818094a4470ff7d0c105c000655dac4205e8265f78df638df0e2ef3dc6deaf3 \ No newline at end of file
diff --git a/db/schema_migrations/20210604082145 b/db/schema_migrations/20210604082145
deleted file mode 100644
index 2c568f0f2b6..00000000000
--- a/db/schema_migrations/20210604082145
+++ /dev/null
@@ -1 +0,0 @@
-f4191b4b8ae7c282c0012f533a01ebe341d62cb0418e39ad543d06ed2dac63a4 \ No newline at end of file
diff --git a/db/schema_migrations/20210604085600 b/db/schema_migrations/20210604085600
deleted file mode 100644
index aa8b3120916..00000000000
--- a/db/schema_migrations/20210604085600
+++ /dev/null
@@ -1 +0,0 @@
-8b6e1c7bacf2cbc05ba94e3fea2ab20e30b78ccaa6833949c11f89d1bdec8110 \ No newline at end of file
diff --git a/db/schema_migrations/20210604133651 b/db/schema_migrations/20210604133651
deleted file mode 100644
index 7c6394cd470..00000000000
--- a/db/schema_migrations/20210604133651
+++ /dev/null
@@ -1 +0,0 @@
-0c01bb41113c468a602649b591e1fd2959a6e3190c835ef2e27351cf69f50fd5 \ No newline at end of file
diff --git a/db/schema_migrations/20210606143426 b/db/schema_migrations/20210606143426
deleted file mode 100644
index a8a2d7d784c..00000000000
--- a/db/schema_migrations/20210606143426
+++ /dev/null
@@ -1 +0,0 @@
-1f99d446428ddac2a0fa7d64bdce9fc300bf02e88c35cdb3d726c501641e721d \ No newline at end of file
diff --git a/db/schema_migrations/20210607050531 b/db/schema_migrations/20210607050531
deleted file mode 100644
index e69ab586f4d..00000000000
--- a/db/schema_migrations/20210607050531
+++ /dev/null
@@ -1 +0,0 @@
-77f24cb4756dfeef16ba48a189d3bf9352534f858446522bc49495b9295374a8 \ No newline at end of file
diff --git a/db/schema_migrations/20210607080044 b/db/schema_migrations/20210607080044
deleted file mode 100644
index 9ccf86d8194..00000000000
--- a/db/schema_migrations/20210607080044
+++ /dev/null
@@ -1 +0,0 @@
-88f16dc06371d320a1245de68aba5ed4ad7cd8f15c4e5898619a751840981072 \ No newline at end of file
diff --git a/db/schema_migrations/20210607154719 b/db/schema_migrations/20210607154719
deleted file mode 100644
index 0f7aab0fc39..00000000000
--- a/db/schema_migrations/20210607154719
+++ /dev/null
@@ -1 +0,0 @@
-dd6bf6ae4988e8e07247388554992d5100dedb2bd66e92c42a6bb144dc6b1937 \ No newline at end of file
diff --git a/db/schema_migrations/20210608072312 b/db/schema_migrations/20210608072312
deleted file mode 100644
index c0c052397b1..00000000000
--- a/db/schema_migrations/20210608072312
+++ /dev/null
@@ -1 +0,0 @@
-c395f52ee34cd758df87ba0f74f4528a189704498e133fa53f0dd3f6f31a77b3 \ No newline at end of file
diff --git a/db/schema_migrations/20210608072346 b/db/schema_migrations/20210608072346
deleted file mode 100644
index 6ca0ad0f471..00000000000
--- a/db/schema_migrations/20210608072346
+++ /dev/null
@@ -1 +0,0 @@
-9f8ff974adc7c20908cd423b2d3f69d8ec16b0fcbb8bfbdb9347a9ff3f3a007a \ No newline at end of file
diff --git a/db/schema_migrations/20210608103230 b/db/schema_migrations/20210608103230
deleted file mode 100644
index 541faa3aab7..00000000000
--- a/db/schema_migrations/20210608103230
+++ /dev/null
@@ -1 +0,0 @@
-12d8de65d287cf29fa2761264c42eb42e7fe2a5b36c279e623d93897503b5313 \ No newline at end of file
diff --git a/db/schema_migrations/20210608103235 b/db/schema_migrations/20210608103235
deleted file mode 100644
index 601c374e620..00000000000
--- a/db/schema_migrations/20210608103235
+++ /dev/null
@@ -1 +0,0 @@
-fc503b8e9672eb5638d2cb3468c8df4d9c0d998332909351121ace04d3f7214a \ No newline at end of file
diff --git a/db/schema_migrations/20210608110752 b/db/schema_migrations/20210608110752
deleted file mode 100644
index 5c4a1f16971..00000000000
--- a/db/schema_migrations/20210608110752
+++ /dev/null
@@ -1 +0,0 @@
-cbe4cff5937f3ba39a4aeeed78dcc6dc6ece212b01b16bfcd61ccf4a20427dcc \ No newline at end of file
diff --git a/db/schema_migrations/20210608110760 b/db/schema_migrations/20210608110760
deleted file mode 100644
index 46ace509e0d..00000000000
--- a/db/schema_migrations/20210608110760
+++ /dev/null
@@ -1 +0,0 @@
-b84505713afce3bf0673329a3a4eaf85a00d4f8948f56d43d365d6cc47ef629c \ No newline at end of file
diff --git a/db/schema_migrations/20210609013512 b/db/schema_migrations/20210609013512
deleted file mode 100644
index 52541965dde..00000000000
--- a/db/schema_migrations/20210609013512
+++ /dev/null
@@ -1 +0,0 @@
-ddd40d4fb063b3a728f4b9a214d6033f70ee3719ac769957f5295a0c5f62a5c0 \ No newline at end of file
diff --git a/db/schema_migrations/20210609090856 b/db/schema_migrations/20210609090856
deleted file mode 100644
index f0c3c25a01b..00000000000
--- a/db/schema_migrations/20210609090856
+++ /dev/null
@@ -1 +0,0 @@
-597e04c51bdad1900b2535c9d664c9e3a4d2a5879e657ef470bbc7ac461d3cca \ No newline at end of file
diff --git a/db/schema_migrations/20210609125005 b/db/schema_migrations/20210609125005
deleted file mode 100644
index 3e26956bdb8..00000000000
--- a/db/schema_migrations/20210609125005
+++ /dev/null
@@ -1 +0,0 @@
-de8468173d8a7499d03b84913cf071af8842a2f47d5f85908af20bf7c71dc96b \ No newline at end of file
diff --git a/db/schema_migrations/20210609192728 b/db/schema_migrations/20210609192728
deleted file mode 100644
index e39cbc077b4..00000000000
--- a/db/schema_migrations/20210609192728
+++ /dev/null
@@ -1 +0,0 @@
-b6c503eddc1c5e36957b59efc8fc5dd75da18104499667c3fcc435fcbd739af3 \ No newline at end of file
diff --git a/db/schema_migrations/20210609193101 b/db/schema_migrations/20210609193101
deleted file mode 100644
index 42fc6427247..00000000000
--- a/db/schema_migrations/20210609193101
+++ /dev/null
@@ -1 +0,0 @@
-09771c6f56e54a4d3dc0caab4891cbaf2a1d5685ccb1161d141ce38e44d6cfdb \ No newline at end of file
diff --git a/db/schema_migrations/20210609202501 b/db/schema_migrations/20210609202501
deleted file mode 100644
index ad71feddcfc..00000000000
--- a/db/schema_migrations/20210609202501
+++ /dev/null
@@ -1 +0,0 @@
-93f577e2fe2dcc0daafc4ff7e15a4511a2e9f86f05f9892f5c7625f11bfce3ae \ No newline at end of file
diff --git a/db/schema_migrations/20210610042700 b/db/schema_migrations/20210610042700
deleted file mode 100644
index ef0f3e34f48..00000000000
--- a/db/schema_migrations/20210610042700
+++ /dev/null
@@ -1 +0,0 @@
-f8b8276ed7e120b61f6748a328590a98f0e444e0d26bcb1a2b0daa54c3643acd \ No newline at end of file
diff --git a/db/schema_migrations/20210610102410 b/db/schema_migrations/20210610102410
deleted file mode 100644
index 1d6bb16209e..00000000000
--- a/db/schema_migrations/20210610102410
+++ /dev/null
@@ -1 +0,0 @@
-dab13c78f6f758c63be923277c0f31e4cce4e30f77a8dc2983a9bb1500a454f9 \ No newline at end of file
diff --git a/db/schema_migrations/20210610102413 b/db/schema_migrations/20210610102413
deleted file mode 100644
index d94b1623e24..00000000000
--- a/db/schema_migrations/20210610102413
+++ /dev/null
@@ -1 +0,0 @@
-ce21070d44a34081c6babd14e6a1b607bad5ed9047b18f4ef0beb64b5a2ce120 \ No newline at end of file
diff --git a/db/schema_migrations/20210610113229 b/db/schema_migrations/20210610113229
deleted file mode 100644
index 15d4d567534..00000000000
--- a/db/schema_migrations/20210610113229
+++ /dev/null
@@ -1 +0,0 @@
-3ad279a7c57e433a8ee349dabd2536c1de9055936b05c26b5469606067eb90d4 \ No newline at end of file
diff --git a/db/schema_migrations/20210610141711 b/db/schema_migrations/20210610141711
deleted file mode 100644
index 786ca655eeb..00000000000
--- a/db/schema_migrations/20210610141711
+++ /dev/null
@@ -1 +0,0 @@
-b8bfe0d67516f0fe71c166a616c2279fc9f45769c369d8ddd86e9705dbc55097 \ No newline at end of file
diff --git a/db/schema_migrations/20210610153556 b/db/schema_migrations/20210610153556
deleted file mode 100644
index 71b71a671c4..00000000000
--- a/db/schema_migrations/20210610153556
+++ /dev/null
@@ -1 +0,0 @@
-39ca841ce1de3faadee41fbb756d80c98efd853fbbffa7cb3f8f9de56752078b \ No newline at end of file
diff --git a/db/schema_migrations/20210611080951 b/db/schema_migrations/20210611080951
deleted file mode 100644
index ca33abde56c..00000000000
--- a/db/schema_migrations/20210611080951
+++ /dev/null
@@ -1 +0,0 @@
-95e4b697f5c5b18935b73bbeb0c42c96e3e5abde9e4f9e179d1a93a891a0694b \ No newline at end of file
diff --git a/db/schema_migrations/20210611082822 b/db/schema_migrations/20210611082822
deleted file mode 100644
index 474adb00646..00000000000
--- a/db/schema_migrations/20210611082822
+++ /dev/null
@@ -1 +0,0 @@
-28b31b6e8aba1b8feec2b9a29b5f91f7145431be5d8b9875bddb8183f89700f7 \ No newline at end of file
diff --git a/db/schema_migrations/20210611100359 b/db/schema_migrations/20210611100359
deleted file mode 100644
index 058f7c8ff4e..00000000000
--- a/db/schema_migrations/20210611100359
+++ /dev/null
@@ -1 +0,0 @@
-9429a8adca0bc85167f64e76d8d72b45d09d4303a01bd9c4ca39560bb4d89799 \ No newline at end of file
diff --git a/db/schema_migrations/20210611101034 b/db/schema_migrations/20210611101034
deleted file mode 100644
index 70712a32be1..00000000000
--- a/db/schema_migrations/20210611101034
+++ /dev/null
@@ -1 +0,0 @@
-a535348229ff5e9e3c5b530ded9407df9f4308fc4d9967106bf246d7267c2a48 \ No newline at end of file
diff --git a/db/schema_migrations/20210614124111 b/db/schema_migrations/20210614124111
deleted file mode 100644
index 25427277070..00000000000
--- a/db/schema_migrations/20210614124111
+++ /dev/null
@@ -1 +0,0 @@
-30c6316f3931075bd8b167e06af5d80b7ece65f428d1fa7602ab27b526bc8410 \ No newline at end of file
diff --git a/db/schema_migrations/20210614131002 b/db/schema_migrations/20210614131002
deleted file mode 100644
index 6d59a254365..00000000000
--- a/db/schema_migrations/20210614131002
+++ /dev/null
@@ -1 +0,0 @@
-dedf2f8d76f4131f34d61fe2c730f8b092ca46f8b35b08a76b7bc096c140aad1 \ No newline at end of file
diff --git a/db/schema_migrations/20210614142311 b/db/schema_migrations/20210614142311
deleted file mode 100644
index 69a2472990a..00000000000
--- a/db/schema_migrations/20210614142311
+++ /dev/null
@@ -1 +0,0 @@
-5dc0a4f91dc35b7720b20e89fa77374a0337c380b9234704e7d4143639e512f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210614143954 b/db/schema_migrations/20210614143954
deleted file mode 100644
index 7fd3ce9b49e..00000000000
--- a/db/schema_migrations/20210614143954
+++ /dev/null
@@ -1 +0,0 @@
-b958d65f1b3b43d7bcd2a703489132ba9a2ba1e0374d45533399355ce6be9365 \ No newline at end of file
diff --git a/db/schema_migrations/20210615064342 b/db/schema_migrations/20210615064342
deleted file mode 100644
index a126cd6258e..00000000000
--- a/db/schema_migrations/20210615064342
+++ /dev/null
@@ -1 +0,0 @@
-509f30d8772e24efc52c5aa12ebcde084f7ded8d228109bbbdda2f21d3235512 \ No newline at end of file
diff --git a/db/schema_migrations/20210615234935 b/db/schema_migrations/20210615234935
deleted file mode 100644
index 83e43f74a53..00000000000
--- a/db/schema_migrations/20210615234935
+++ /dev/null
@@ -1 +0,0 @@
-205336e95a6e3c9fa8c56fa67e66ef3023ba8c6cd4e6f3599160b74b3fbfaa3c \ No newline at end of file
diff --git a/db/schema_migrations/20210616110748 b/db/schema_migrations/20210616110748
deleted file mode 100644
index 06cab110a99..00000000000
--- a/db/schema_migrations/20210616110748
+++ /dev/null
@@ -1 +0,0 @@
-8207eb9917b4d02f39cd9e9eca9ec0e001266b25b3378f09e4e8c27ff22b6e73 \ No newline at end of file
diff --git a/db/schema_migrations/20210616111311 b/db/schema_migrations/20210616111311
deleted file mode 100644
index 070f9adfcda..00000000000
--- a/db/schema_migrations/20210616111311
+++ /dev/null
@@ -1 +0,0 @@
-fd014b505ecd162c232da23a10c34dc4b1f1dbe8fe357a0f20585479b25d50bc \ No newline at end of file
diff --git a/db/schema_migrations/20210616134905 b/db/schema_migrations/20210616134905
deleted file mode 100644
index 90658174989..00000000000
--- a/db/schema_migrations/20210616134905
+++ /dev/null
@@ -1 +0,0 @@
-52843d12ab18b92c71a334cf877682d9fae57632cf0ba14213dfc0543e39cf1b \ No newline at end of file
diff --git a/db/schema_migrations/20210616145254 b/db/schema_migrations/20210616145254
deleted file mode 100644
index e5d7553d883..00000000000
--- a/db/schema_migrations/20210616145254
+++ /dev/null
@@ -1 +0,0 @@
-525fbdd66dcabbf1e6d0430468600f86fbc3c00dcfdab1c5a052294d7d73de37 \ No newline at end of file
diff --git a/db/schema_migrations/20210616154808 b/db/schema_migrations/20210616154808
deleted file mode 100644
index be7d5811540..00000000000
--- a/db/schema_migrations/20210616154808
+++ /dev/null
@@ -1 +0,0 @@
-adfa07888317cb7f22062f5d23906bc01de579305acb3bb3384f18e3f581a87b \ No newline at end of file
diff --git a/db/schema_migrations/20210616185947 b/db/schema_migrations/20210616185947
deleted file mode 100644
index 30275f102dc..00000000000
--- a/db/schema_migrations/20210616185947
+++ /dev/null
@@ -1 +0,0 @@
-8d73f4b4b716176afe5a9b0ee3a4ef28bbbc2fe944a18fb66afa8cf8f763e8ac \ No newline at end of file
diff --git a/db/schema_migrations/20210617022324 b/db/schema_migrations/20210617022324
deleted file mode 100644
index 40bace34b4c..00000000000
--- a/db/schema_migrations/20210617022324
+++ /dev/null
@@ -1 +0,0 @@
-fa4f1ec80e7039e59d283dc6effd6904ca33c637d27c687d990822eb2f6198e5 \ No newline at end of file
diff --git a/db/schema_migrations/20210617161348 b/db/schema_migrations/20210617161348
deleted file mode 100644
index 238f969d304..00000000000
--- a/db/schema_migrations/20210617161348
+++ /dev/null
@@ -1 +0,0 @@
-3f73aa7d2cff11d00b330d88e76daaa058f82b7012da3c244f246da6e538921c \ No newline at end of file
diff --git a/db/schema_migrations/20210617180131 b/db/schema_migrations/20210617180131
deleted file mode 100644
index b44f82a3311..00000000000
--- a/db/schema_migrations/20210617180131
+++ /dev/null
@@ -1 +0,0 @@
-2adb38e71c6173350d1f98f3237b692e4f12c8a073115be23f3a713f69cde911 \ No newline at end of file
diff --git a/db/schema_migrations/20210621043337 b/db/schema_migrations/20210621043337
deleted file mode 100644
index 1dd6b0ac1dd..00000000000
--- a/db/schema_migrations/20210621043337
+++ /dev/null
@@ -1 +0,0 @@
-cfe35a1297c4a92c4b5e62757ed74c11ffd6f207777291c11b05a4e3cee91618 \ No newline at end of file
diff --git a/db/schema_migrations/20210621044000 b/db/schema_migrations/20210621044000
deleted file mode 100644
index 0b620576357..00000000000
--- a/db/schema_migrations/20210621044000
+++ /dev/null
@@ -1 +0,0 @@
-64babbed04b9e3bf59bb723b43e3c30730527f0e0e09906073b5bd9379067ab6 \ No newline at end of file
diff --git a/db/schema_migrations/20210621084632 b/db/schema_migrations/20210621084632
deleted file mode 100644
index 4ab2467fab0..00000000000
--- a/db/schema_migrations/20210621084632
+++ /dev/null
@@ -1 +0,0 @@
-fb5b54e29400836afb122cd38a2ae34abc1ff6dd800eadaba023220c51da6868 \ No newline at end of file
diff --git a/db/schema_migrations/20210621090030 b/db/schema_migrations/20210621090030
deleted file mode 100644
index c015bc6ec7f..00000000000
--- a/db/schema_migrations/20210621090030
+++ /dev/null
@@ -1 +0,0 @@
-5077a5c9cfe9b79506bb65d9dd02b745545a8586c198041bf7cbb945827c07cf \ No newline at end of file
diff --git a/db/schema_migrations/20210621091830 b/db/schema_migrations/20210621091830
deleted file mode 100644
index 89a505b0c9a..00000000000
--- a/db/schema_migrations/20210621091830
+++ /dev/null
@@ -1 +0,0 @@
-11450695142e5145e5cbf9077f259e28c908b794948be5c4b77e34465f6498aa \ No newline at end of file
diff --git a/db/schema_migrations/20210621111747 b/db/schema_migrations/20210621111747
deleted file mode 100644
index 728eb47b0ba..00000000000
--- a/db/schema_migrations/20210621111747
+++ /dev/null
@@ -1 +0,0 @@
-582a22626330e93e679a14eff2cdd85a5732f797fc1a6c94409d46cc5027c8ea \ No newline at end of file
diff --git a/db/schema_migrations/20210621155328 b/db/schema_migrations/20210621155328
deleted file mode 100644
index ba3dd235cee..00000000000
--- a/db/schema_migrations/20210621155328
+++ /dev/null
@@ -1 +0,0 @@
-d08fdc3da5fe1a7bf20af5fbe42438fc43ebdf1299c61159740df7644e4ea117 \ No newline at end of file
diff --git a/db/schema_migrations/20210621164210 b/db/schema_migrations/20210621164210
deleted file mode 100644
index 6855b8e42ee..00000000000
--- a/db/schema_migrations/20210621164210
+++ /dev/null
@@ -1 +0,0 @@
-b952f1e3fe2bfa680ba68b79637e0a2a1ee5b388cfa106db62521a663262b024 \ No newline at end of file
diff --git a/db/schema_migrations/20210621223000 b/db/schema_migrations/20210621223000
deleted file mode 100644
index 17f64d4b263..00000000000
--- a/db/schema_migrations/20210621223000
+++ /dev/null
@@ -1 +0,0 @@
-07d0de05b6a59ba0d1f464ae488f5ead812bc643984ac3dc662c78a02a978f7f \ No newline at end of file
diff --git a/db/schema_migrations/20210621223242 b/db/schema_migrations/20210621223242
deleted file mode 100644
index 9aa2562f30f..00000000000
--- a/db/schema_migrations/20210621223242
+++ /dev/null
@@ -1 +0,0 @@
-eeee178019c259a6fff85219490abf62f2694227cc2facf454d93e57c373833b \ No newline at end of file
diff --git a/db/schema_migrations/20210622041846 b/db/schema_migrations/20210622041846
deleted file mode 100644
index f16291b8424..00000000000
--- a/db/schema_migrations/20210622041846
+++ /dev/null
@@ -1 +0,0 @@
-750cda544df323be99452d53aaf39933c8584fc6754ece45263e131884d980d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210622045705 b/db/schema_migrations/20210622045705
deleted file mode 100644
index edf47a46a9d..00000000000
--- a/db/schema_migrations/20210622045705
+++ /dev/null
@@ -1 +0,0 @@
-8400d4497656a9f3f692528f9c0118e8898f2d4d5b0ebbaa55ebadea15628041 \ No newline at end of file
diff --git a/db/schema_migrations/20210622135221 b/db/schema_migrations/20210622135221
deleted file mode 100644
index eedd4d82b2c..00000000000
--- a/db/schema_migrations/20210622135221
+++ /dev/null
@@ -1 +0,0 @@
-e43889baa57ea2cd0b87ba98819408115955f6a6586b3275cf0a08bd79909c71 \ No newline at end of file
diff --git a/db/schema_migrations/20210622141148 b/db/schema_migrations/20210622141148
deleted file mode 100644
index ba693e271aa..00000000000
--- a/db/schema_migrations/20210622141148
+++ /dev/null
@@ -1 +0,0 @@
-432954295d6f3a2a45f3deef42b547ffe42501beaea4f376e1be51cf148de671 \ No newline at end of file
diff --git a/db/schema_migrations/20210623074226 b/db/schema_migrations/20210623074226
deleted file mode 100644
index 76d5cd41839..00000000000
--- a/db/schema_migrations/20210623074226
+++ /dev/null
@@ -1 +0,0 @@
-1a0df6210d9ee0e0229f3cdf3e95acaaa47ebf4ca31ac0fd9f57255115355f99 \ No newline at end of file
diff --git a/db/schema_migrations/20210623123722 b/db/schema_migrations/20210623123722
deleted file mode 100644
index f635c512d94..00000000000
--- a/db/schema_migrations/20210623123722
+++ /dev/null
@@ -1 +0,0 @@
-af58377b87f7e0fb4709637f96b24a4075322d0d8cf87dfaf5bf8e0f8a9372e0 \ No newline at end of file
diff --git a/db/schema_migrations/20210623133635 b/db/schema_migrations/20210623133635
deleted file mode 100644
index bd59fe90c62..00000000000
--- a/db/schema_migrations/20210623133635
+++ /dev/null
@@ -1 +0,0 @@
-1a930fec524c91c5d382c40514d0d1943e59514f5dbd8588595363c24819b8d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210623163342 b/db/schema_migrations/20210623163342
deleted file mode 100644
index f60112edd81..00000000000
--- a/db/schema_migrations/20210623163342
+++ /dev/null
@@ -1 +0,0 @@
-6732401a959a7a691b8729e2bfb38e010dd4da4cd04418aada22946c42fdd6dc \ No newline at end of file
diff --git a/db/schema_migrations/20210624112821 b/db/schema_migrations/20210624112821
deleted file mode 100644
index 86b0e9612e0..00000000000
--- a/db/schema_migrations/20210624112821
+++ /dev/null
@@ -1 +0,0 @@
-2fca5d3203b7bb766274fc333e9a2a267340142856bd23efaabb1cb2c1cb7cb7 \ No newline at end of file
diff --git a/db/schema_migrations/20210624180613 b/db/schema_migrations/20210624180613
deleted file mode 100644
index e7f4d25fc78..00000000000
--- a/db/schema_migrations/20210624180613
+++ /dev/null
@@ -1 +0,0 @@
-705c4cf981f1929f8e8e4d8a8a3c12613516d65e59c71ac79048224cd97c47cc \ No newline at end of file
diff --git a/db/schema_migrations/20210625094554 b/db/schema_migrations/20210625094554
deleted file mode 100644
index a20925101f8..00000000000
--- a/db/schema_migrations/20210625094554
+++ /dev/null
@@ -1 +0,0 @@
-df9e976b0f294284ad9e9b617da42310c83cb1acc6db6ea00ea93c49c2310a1c \ No newline at end of file
diff --git a/db/schema_migrations/20210627204936 b/db/schema_migrations/20210627204936
deleted file mode 100644
index abc39339816..00000000000
--- a/db/schema_migrations/20210627204936
+++ /dev/null
@@ -1 +0,0 @@
-b37bf7db9c00c8f54c0ccca2d418f1279e12ff7e5b71347966494dc5645eb648 \ No newline at end of file
diff --git a/db/schema_migrations/20210628124505 b/db/schema_migrations/20210628124505
deleted file mode 100644
index 478617f5506..00000000000
--- a/db/schema_migrations/20210628124505
+++ /dev/null
@@ -1 +0,0 @@
-7add197fec50d8da5bcdbca83115558480668c26ad3a3fefc4ab93c07f34f63a \ No newline at end of file
diff --git a/db/schema_migrations/20210628154900 b/db/schema_migrations/20210628154900
deleted file mode 100644
index 5c0b60872b5..00000000000
--- a/db/schema_migrations/20210628154900
+++ /dev/null
@@ -1 +0,0 @@
-136a375fbd7e1faf25e7f53e0677b8525811bd917892efa1430d204453bf2a1d \ No newline at end of file
diff --git a/db/schema_migrations/20210629031900 b/db/schema_migrations/20210629031900
deleted file mode 100644
index 5f4949c36de..00000000000
--- a/db/schema_migrations/20210629031900
+++ /dev/null
@@ -1 +0,0 @@
-4f20581b0d16157fbe984383417f0463d7e52252569480796aa3c73abf19c95f \ No newline at end of file
diff --git a/db/schema_migrations/20210629101712 b/db/schema_migrations/20210629101712
deleted file mode 100644
index 4b4a88bdfa3..00000000000
--- a/db/schema_migrations/20210629101712
+++ /dev/null
@@ -1 +0,0 @@
-28e448810fdf8bab4de44d45acac862e752f578b5b8fd77b885a385b9ef16b2d \ No newline at end of file
diff --git a/db/schema_migrations/20210629104933 b/db/schema_migrations/20210629104933
deleted file mode 100644
index 4c5a3fb0003..00000000000
--- a/db/schema_migrations/20210629104933
+++ /dev/null
@@ -1 +0,0 @@
-2ec44dfd0745fd155ab3ab52153688a8969641134a9cc0cc485dd698cc8fd2d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210629153519 b/db/schema_migrations/20210629153519
deleted file mode 100644
index 304ff5c9fa6..00000000000
--- a/db/schema_migrations/20210629153519
+++ /dev/null
@@ -1 +0,0 @@
-cba36a2e8bedd70f8ccaca47517314d0a3c75a9b8d90715a29919247aa686835 \ No newline at end of file
diff --git a/db/schema_migrations/20210630025020 b/db/schema_migrations/20210630025020
deleted file mode 100644
index 7808a7e3178..00000000000
--- a/db/schema_migrations/20210630025020
+++ /dev/null
@@ -1 +0,0 @@
-71ad8c8f2419721f8fdf6c6bbd1265c4a7ca277972c59319e155bc6dfc46aa48 \ No newline at end of file
diff --git a/db/schema_migrations/20210630144339 b/db/schema_migrations/20210630144339
deleted file mode 100644
index 5d91d60199c..00000000000
--- a/db/schema_migrations/20210630144339
+++ /dev/null
@@ -1 +0,0 @@
-8d1777941e1a4b5f9f8f5f5e3ae416d6d02aaee1174eff1f9b4b38a6cdf0103a \ No newline at end of file
diff --git a/db/schema_migrations/20210630222522 b/db/schema_migrations/20210630222522
deleted file mode 100644
index 737034eb132..00000000000
--- a/db/schema_migrations/20210630222522
+++ /dev/null
@@ -1 +0,0 @@
-6cd7654e53bb3dd75118dd399473c98e9953cbb28eaed7a4e3a232de38ca72d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210630224625 b/db/schema_migrations/20210630224625
deleted file mode 100644
index f6c7fccc41f..00000000000
--- a/db/schema_migrations/20210630224625
+++ /dev/null
@@ -1 +0,0 @@
-570edf634eba17e5c7d388fdf7103acb857e477374763205535e280f72050f71 \ No newline at end of file
diff --git a/db/schema_migrations/20210701033622 b/db/schema_migrations/20210701033622
deleted file mode 100644
index 40dcc68d424..00000000000
--- a/db/schema_migrations/20210701033622
+++ /dev/null
@@ -1 +0,0 @@
-e38d73441ddd7f6238a66ee86009c445ad6056f3e6872e7a6c72abe051294d7e \ No newline at end of file
diff --git a/db/schema_migrations/20210701111627 b/db/schema_migrations/20210701111627
deleted file mode 100644
index ca52a786a22..00000000000
--- a/db/schema_migrations/20210701111627
+++ /dev/null
@@ -1 +0,0 @@
-c2efdad12c3d0ec5371259baa91466137b827f513250e901842ab28e56c3de0a \ No newline at end of file
diff --git a/db/schema_migrations/20210701111909 b/db/schema_migrations/20210701111909
deleted file mode 100644
index ed6e2d56e8d..00000000000
--- a/db/schema_migrations/20210701111909
+++ /dev/null
@@ -1 +0,0 @@
-fdd7509fc88e563b65b487706cae1a64066a7ba7d4bd13d0414b8431c3ddfb68 \ No newline at end of file
diff --git a/db/schema_migrations/20210701141346 b/db/schema_migrations/20210701141346
deleted file mode 100644
index bbc8116361e..00000000000
--- a/db/schema_migrations/20210701141346
+++ /dev/null
@@ -1 +0,0 @@
-da16754bf484ba9a585f9de055f242dbee311d7cf7d0ce67c834ebaed61b96d4 \ No newline at end of file
diff --git a/db/schema_migrations/20210702124842 b/db/schema_migrations/20210702124842
deleted file mode 100644
index dbaeb88a6fd..00000000000
--- a/db/schema_migrations/20210702124842
+++ /dev/null
@@ -1 +0,0 @@
-8c4c92c4606cf406def47829ce16e903b3b2da00cbbdccfe6f0af5fa249be862 \ No newline at end of file
diff --git a/db/schema_migrations/20210705124128 b/db/schema_migrations/20210705124128
deleted file mode 100644
index 247378331e4..00000000000
--- a/db/schema_migrations/20210705124128
+++ /dev/null
@@ -1 +0,0 @@
-02aea8fe759614bc3aa751e023aa508963f8183366f6d6f518bbccc2d85ec1a1 \ No newline at end of file
diff --git a/db/schema_migrations/20210705130919 b/db/schema_migrations/20210705130919
deleted file mode 100644
index 9e0b9ffe69a..00000000000
--- a/db/schema_migrations/20210705130919
+++ /dev/null
@@ -1 +0,0 @@
-c33dd2c63d5a8c6e3c2f49e640b1780734b4bfca88378fac67ea5f5bd24fb2b4 \ No newline at end of file
diff --git a/db/schema_migrations/20210705132928 b/db/schema_migrations/20210705132928
deleted file mode 100644
index c1ef3ec3c1f..00000000000
--- a/db/schema_migrations/20210705132928
+++ /dev/null
@@ -1 +0,0 @@
-c66a42fc813846a09d4389a895a2d20ad48889d8ff45ab642e771b6792490623 \ No newline at end of file
diff --git a/db/schema_migrations/20210705142714 b/db/schema_migrations/20210705142714
deleted file mode 100644
index 7a64734b0e1..00000000000
--- a/db/schema_migrations/20210705142714
+++ /dev/null
@@ -1 +0,0 @@
-b47570ac9018a50206f239ffdafce2e672e6888a11a51e01f6d59d62a6a929af \ No newline at end of file
diff --git a/db/schema_migrations/20210705143150 b/db/schema_migrations/20210705143150
deleted file mode 100644
index 9c91d772a41..00000000000
--- a/db/schema_migrations/20210705143150
+++ /dev/null
@@ -1 +0,0 @@
-9240ebbc69525a5bc1732f5e0ee2903f2b40b8693f24fcb911e72b5ba943357e \ No newline at end of file
diff --git a/db/schema_migrations/20210705144657 b/db/schema_migrations/20210705144657
deleted file mode 100644
index 557dbdbd95c..00000000000
--- a/db/schema_migrations/20210705144657
+++ /dev/null
@@ -1 +0,0 @@
-9ba27b5e2599262846a06736db72fb0d31dc904e2ef4d167c1ee9530feb6367f \ No newline at end of file
diff --git a/db/schema_migrations/20210706084713 b/db/schema_migrations/20210706084713
deleted file mode 100644
index 7c87af30919..00000000000
--- a/db/schema_migrations/20210706084713
+++ /dev/null
@@ -1 +0,0 @@
-f69e3f50e4e5642a59e157a3c4a133090ec843b563e47198d560a54328176e56 \ No newline at end of file
diff --git a/db/schema_migrations/20210706112800 b/db/schema_migrations/20210706112800
deleted file mode 100644
index f1f00867472..00000000000
--- a/db/schema_migrations/20210706112800
+++ /dev/null
@@ -1 +0,0 @@
-5dd1596d0d6e6f5aa39cbf8a65be294650bead7a099cf50917b438cf75529257 \ No newline at end of file
diff --git a/db/schema_migrations/20210706115312 b/db/schema_migrations/20210706115312
deleted file mode 100644
index a1298418836..00000000000
--- a/db/schema_migrations/20210706115312
+++ /dev/null
@@ -1 +0,0 @@
-ac150e706b115849aa3802ae7b8e07d983e89eb637c48582c64948cbc7d7163d \ No newline at end of file
diff --git a/db/schema_migrations/20210706120847 b/db/schema_migrations/20210706120847
deleted file mode 100644
index 329e5650dd0..00000000000
--- a/db/schema_migrations/20210706120847
+++ /dev/null
@@ -1 +0,0 @@
-0fffffc44c32a936760424541e183b1a41938750d4e10da9dd76c2a09094a07b \ No newline at end of file
diff --git a/db/schema_migrations/20210706142819 b/db/schema_migrations/20210706142819
deleted file mode 100644
index 193c6ba1d56..00000000000
--- a/db/schema_migrations/20210706142819
+++ /dev/null
@@ -1 +0,0 @@
-ed0daff7120cbdba2f0e9ca1f2e40c11114bb2c7db4543903d16891ffbbba3f8 \ No newline at end of file
diff --git a/db/schema_migrations/20210706151154 b/db/schema_migrations/20210706151154
deleted file mode 100644
index 32534755d69..00000000000
--- a/db/schema_migrations/20210706151154
+++ /dev/null
@@ -1 +0,0 @@
-fc330cf9875a423db87748e84c574f2208e164945b56361a563f2085d324f610 \ No newline at end of file
diff --git a/db/schema_migrations/20210706151446 b/db/schema_migrations/20210706151446
deleted file mode 100644
index 3d5d381b2a5..00000000000
--- a/db/schema_migrations/20210706151446
+++ /dev/null
@@ -1 +0,0 @@
-4400cd95cf149a7abc759ca412b0d87c81bc405719999ce60502869d21d17aaa \ No newline at end of file
diff --git a/db/schema_migrations/20210706152139 b/db/schema_migrations/20210706152139
deleted file mode 100644
index 81339dc1d81..00000000000
--- a/db/schema_migrations/20210706152139
+++ /dev/null
@@ -1 +0,0 @@
-45ec2dd6113d112050a1ac062064950fa18b3b5903a9fd60234e9e9fa48c7070 \ No newline at end of file
diff --git a/db/schema_migrations/20210706212710 b/db/schema_migrations/20210706212710
deleted file mode 100644
index 7a4e6df37a4..00000000000
--- a/db/schema_migrations/20210706212710
+++ /dev/null
@@ -1 +0,0 @@
-33162af4ef99c32d3c5b38479e407d4911a8d3dce53407dbee6e5745c8e945ae \ No newline at end of file
diff --git a/db/schema_migrations/20210706213537 b/db/schema_migrations/20210706213537
deleted file mode 100644
index fa621773ee7..00000000000
--- a/db/schema_migrations/20210706213537
+++ /dev/null
@@ -1 +0,0 @@
-150463cef309e6bf69240c258dc8aede53b846a08a7e2d668ee0429709022554 \ No newline at end of file
diff --git a/db/schema_migrations/20210707095545 b/db/schema_migrations/20210707095545
deleted file mode 100644
index 83255c22622..00000000000
--- a/db/schema_migrations/20210707095545
+++ /dev/null
@@ -1 +0,0 @@
-98d4deaf0564119c1ee44d76d3a30bff1a0fceb7cab67c5dbef576faef62ddf5 \ No newline at end of file
diff --git a/db/schema_migrations/20210707113056 b/db/schema_migrations/20210707113056
deleted file mode 100644
index 3526caf8109..00000000000
--- a/db/schema_migrations/20210707113056
+++ /dev/null
@@ -1 +0,0 @@
-837b9a56114c63064379cf276a3c7e2bbe845af9022a542c4fcec94a25062017 \ No newline at end of file
diff --git a/db/schema_migrations/20210707151536 b/db/schema_migrations/20210707151536
deleted file mode 100644
index feea256b2ac..00000000000
--- a/db/schema_migrations/20210707151536
+++ /dev/null
@@ -1 +0,0 @@
-4fc688d17e374faf806a25635e05b053228ac201b94920d4f3b3810329a6552c \ No newline at end of file
diff --git a/db/schema_migrations/20210707163659 b/db/schema_migrations/20210707163659
deleted file mode 100644
index e0c33c79a85..00000000000
--- a/db/schema_migrations/20210707163659
+++ /dev/null
@@ -1 +0,0 @@
-ac14aa49830a3af9a1445c0c7680f5660247a8104c8e4c1ae542c4b368f7c9bf \ No newline at end of file
diff --git a/db/schema_migrations/20210707171536 b/db/schema_migrations/20210707171536
deleted file mode 100644
index dd78b254a67..00000000000
--- a/db/schema_migrations/20210707171536
+++ /dev/null
@@ -1 +0,0 @@
-ee8576a7dec8e0657a3976422f74202e3f89c9a72aae64f0f75398d0c6ff5b97 \ No newline at end of file
diff --git a/db/schema_migrations/20210707171554 b/db/schema_migrations/20210707171554
deleted file mode 100644
index ef6f174f734..00000000000
--- a/db/schema_migrations/20210707171554
+++ /dev/null
@@ -1 +0,0 @@
-5f2acbd5ed9132ad6c11cf4be34061decde2f3c602ef319331454b424e6b4344 \ No newline at end of file
diff --git a/db/schema_migrations/20210707173645 b/db/schema_migrations/20210707173645
deleted file mode 100644
index 0cc2386b4ef..00000000000
--- a/db/schema_migrations/20210707173645
+++ /dev/null
@@ -1 +0,0 @@
-e440dac0e14df7309c84e72b98ed6373c712901dc66310a474979e0fce7dc59c \ No newline at end of file
diff --git a/db/schema_migrations/20210707181536 b/db/schema_migrations/20210707181536
deleted file mode 100644
index 7bbdcc9a1d0..00000000000
--- a/db/schema_migrations/20210707181536
+++ /dev/null
@@ -1 +0,0 @@
-0c25d19d03bce4f145eca271c852aad6a8327821a8f5ff0aa2f0286f4a65b328 \ No newline at end of file
diff --git a/db/schema_migrations/20210707210916 b/db/schema_migrations/20210707210916
deleted file mode 100644
index e3c0f8fe783..00000000000
--- a/db/schema_migrations/20210707210916
+++ /dev/null
@@ -1 +0,0 @@
-0681e068672621fbaa513cadd86e6137709413bb370ae9d416fc562b19f11ff6 \ No newline at end of file
diff --git a/db/schema_migrations/20210708011425 b/db/schema_migrations/20210708011425
deleted file mode 100644
index 33e28f436ce..00000000000
--- a/db/schema_migrations/20210708011425
+++ /dev/null
@@ -1 +0,0 @@
-e3f4424daaba173f607dbae7c84b4f6070126d262e7e9808c6a90e64648e10ed \ No newline at end of file
diff --git a/db/schema_migrations/20210708011426 b/db/schema_migrations/20210708011426
deleted file mode 100644
index abb2743928c..00000000000
--- a/db/schema_migrations/20210708011426
+++ /dev/null
@@ -1 +0,0 @@
-b48556968cbff2e3aff65236b313ed8a626af4a08b1cad06723b74a99b678895 \ No newline at end of file
diff --git a/db/schema_migrations/20210708063032 b/db/schema_migrations/20210708063032
deleted file mode 100644
index 9d3271bdd91..00000000000
--- a/db/schema_migrations/20210708063032
+++ /dev/null
@@ -1 +0,0 @@
-77f6db1d2aeebdefd76c96966da6c9e4ce5da2c92a42f6ac2398b35fa21c680f \ No newline at end of file
diff --git a/db/schema_migrations/20210708124229 b/db/schema_migrations/20210708124229
deleted file mode 100644
index 29cf5b8986f..00000000000
--- a/db/schema_migrations/20210708124229
+++ /dev/null
@@ -1 +0,0 @@
-18f7a9a0e9f0b331028951adf2bf6ca9a9fc4a62872f5307ee9d74761ae06deb \ No newline at end of file
diff --git a/db/schema_migrations/20210708130419 b/db/schema_migrations/20210708130419
deleted file mode 100644
index b20db5b17c2..00000000000
--- a/db/schema_migrations/20210708130419
+++ /dev/null
@@ -1 +0,0 @@
-8545d6575c9dacec6796882677c4403cf3559430518e8709bf390f20717413d7 \ No newline at end of file
diff --git a/db/schema_migrations/20210708131048 b/db/schema_migrations/20210708131048
deleted file mode 100644
index f61978d8e0f..00000000000
--- a/db/schema_migrations/20210708131048
+++ /dev/null
@@ -1 +0,0 @@
-ed0c0dc015e7c3457248303b8b478c8d259d6a800a2bfed8b05b1f976b6794a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210708134446 b/db/schema_migrations/20210708134446
deleted file mode 100644
index 9ec3b2182df..00000000000
--- a/db/schema_migrations/20210708134446
+++ /dev/null
@@ -1 +0,0 @@
-1367865e22f6129fa69f3c86dc72b88a9af0479a41f2029a446464aeeed9c18e \ No newline at end of file
diff --git a/db/schema_migrations/20210708202548 b/db/schema_migrations/20210708202548
deleted file mode 100644
index 286bcb07786..00000000000
--- a/db/schema_migrations/20210708202548
+++ /dev/null
@@ -1 +0,0 @@
-e2d7e54330f586bf31d953455b2ebac1fc9b6b24058a1cc7b277bc819ebf232a \ No newline at end of file
diff --git a/db/schema_migrations/20210709024048 b/db/schema_migrations/20210709024048
deleted file mode 100644
index 52e089cd5a7..00000000000
--- a/db/schema_migrations/20210709024048
+++ /dev/null
@@ -1 +0,0 @@
-d35079b6d6ed38ce8f212a09e684988f7499d456d28f70b6178914b1b17eee5b \ No newline at end of file
diff --git a/db/schema_migrations/20210709085759 b/db/schema_migrations/20210709085759
deleted file mode 100644
index 4546b090e42..00000000000
--- a/db/schema_migrations/20210709085759
+++ /dev/null
@@ -1 +0,0 @@
-4216604d14b4ccc652ba423a95ee9bd15646b3553903dc4b79497871f5384492 \ No newline at end of file
diff --git a/db/schema_migrations/20210709132707 b/db/schema_migrations/20210709132707
deleted file mode 100644
index 04ba096a692..00000000000
--- a/db/schema_migrations/20210709132707
+++ /dev/null
@@ -1 +0,0 @@
-e0a2de69a3c9d616b87207b764e33fa3326627e065f28fc200c1414f08ee9fff \ No newline at end of file
diff --git a/db/schema_migrations/20210709221051 b/db/schema_migrations/20210709221051
deleted file mode 100644
index 1c2f47e20ad..00000000000
--- a/db/schema_migrations/20210709221051
+++ /dev/null
@@ -1 +0,0 @@
-7847339fb7b143845e2715b15505016dc8e6de3fbd2c5cb4bae55da4f25a5a5f \ No newline at end of file
diff --git a/db/schema_migrations/20210709221659 b/db/schema_migrations/20210709221659
deleted file mode 100644
index f6626986920..00000000000
--- a/db/schema_migrations/20210709221659
+++ /dev/null
@@ -1 +0,0 @@
-5bec34d517f3f2bbb9735f73fb5641512c9f5286ee5d7a59b17c976dd1459347 \ No newline at end of file
diff --git a/db/schema_migrations/20210712052519 b/db/schema_migrations/20210712052519
deleted file mode 100644
index 3c0874b338f..00000000000
--- a/db/schema_migrations/20210712052519
+++ /dev/null
@@ -1 +0,0 @@
-f3959b7a6f7ac95019f2f85c6383ddd11294562e94936ef3b5704bd4de7c5910 \ No newline at end of file
diff --git a/db/schema_migrations/20210713042000 b/db/schema_migrations/20210713042000
deleted file mode 100644
index ed775d6e188..00000000000
--- a/db/schema_migrations/20210713042000
+++ /dev/null
@@ -1 +0,0 @@
-ede336cca4f5d692fb9fccb60db7846a917d887412a10699e818a6caf0ef6a45 \ No newline at end of file
diff --git a/db/schema_migrations/20210713042153 b/db/schema_migrations/20210713042153
deleted file mode 100644
index fca0fe62d73..00000000000
--- a/db/schema_migrations/20210713042153
+++ /dev/null
@@ -1 +0,0 @@
-95aa786acfbd53f1e819e49c6c6ec703d609396f2cc04a5791d1ffc77800dc72 \ No newline at end of file
diff --git a/db/schema_migrations/20210713070842 b/db/schema_migrations/20210713070842
deleted file mode 100644
index 857dea1627e..00000000000
--- a/db/schema_migrations/20210713070842
+++ /dev/null
@@ -1 +0,0 @@
-2899d954a199fa52bf6ab4beca5f22dcb9f9f0312e658f1307d1a7355394f1bb \ No newline at end of file
diff --git a/db/schema_migrations/20210713075117 b/db/schema_migrations/20210713075117
deleted file mode 100644
index 2525886b176..00000000000
--- a/db/schema_migrations/20210713075117
+++ /dev/null
@@ -1 +0,0 @@
-9a8cbcf6ddbdd4379320ed747faed9beb0c2104eb89e61b349432b1f0346a4b5 \ No newline at end of file
diff --git a/db/schema_migrations/20210713123345 b/db/schema_migrations/20210713123345
deleted file mode 100644
index f145ecc3d6b..00000000000
--- a/db/schema_migrations/20210713123345
+++ /dev/null
@@ -1 +0,0 @@
-d1226fdefe839aae4c7425924058e1944f883824c43a299b154bb6873d6c3855 \ No newline at end of file
diff --git a/db/schema_migrations/20210713135152 b/db/schema_migrations/20210713135152
deleted file mode 100644
index a1ba4e939e9..00000000000
--- a/db/schema_migrations/20210713135152
+++ /dev/null
@@ -1 +0,0 @@
-d7f8f7f5d8a6cf03d500825ef43234c69f7ad36908c0bade337591b05985c2fe \ No newline at end of file
diff --git a/db/schema_migrations/20210713144637 b/db/schema_migrations/20210713144637
deleted file mode 100644
index ebc122e0275..00000000000
--- a/db/schema_migrations/20210713144637
+++ /dev/null
@@ -1 +0,0 @@
-699ac7f8b9253920271686c497b57521bf4b0d26c802ca2a57447e4929cd147f \ No newline at end of file
diff --git a/db/schema_migrations/20210713211008 b/db/schema_migrations/20210713211008
deleted file mode 100644
index 75ccad3e348..00000000000
--- a/db/schema_migrations/20210713211008
+++ /dev/null
@@ -1 +0,0 @@
-f66d8f3bc32996fe7743cc98cfb96fedd86784d38c8debb5143b7adabdfebd18 \ No newline at end of file
diff --git a/db/schema_migrations/20210713223941 b/db/schema_migrations/20210713223941
deleted file mode 100644
index 6b0ebf6de5d..00000000000
--- a/db/schema_migrations/20210713223941
+++ /dev/null
@@ -1 +0,0 @@
-a97ac46a042b7f049f27db4f4916b8b0dbf527ba3c34fc9cc577da7807a88d32 \ No newline at end of file
diff --git a/db/schema_migrations/20210714015537 b/db/schema_migrations/20210714015537
deleted file mode 100644
index eb1c88e29a0..00000000000
--- a/db/schema_migrations/20210714015537
+++ /dev/null
@@ -1 +0,0 @@
-2f6441a5d5e3c4aad6b88c3944436dab213b7eeb2f35453657ffac8c0733efc1 \ No newline at end of file
diff --git a/db/schema_migrations/20210714043818 b/db/schema_migrations/20210714043818
deleted file mode 100644
index 21c46a2608f..00000000000
--- a/db/schema_migrations/20210714043818
+++ /dev/null
@@ -1 +0,0 @@
-344736284dc18b5f7516ec2062bef99b2444ae31720691e56b4e8687d5566b31 \ No newline at end of file
diff --git a/db/schema_migrations/20210714120600 b/db/schema_migrations/20210714120600
deleted file mode 100644
index e698300671b..00000000000
--- a/db/schema_migrations/20210714120600
+++ /dev/null
@@ -1 +0,0 @@
-de9167bc4f9e2b68b257a7ff81636d5dbb6d73ff81672fdf1c73adadf5707bea \ No newline at end of file
diff --git a/db/schema_migrations/20210715074359 b/db/schema_migrations/20210715074359
deleted file mode 100644
index 35cbbf55463..00000000000
--- a/db/schema_migrations/20210715074359
+++ /dev/null
@@ -1 +0,0 @@
-7bc0654a97f85100df93b9dbbbdab374873f6d3d379a4393f718bad923b064ba \ No newline at end of file
diff --git a/db/schema_migrations/20210715074933 b/db/schema_migrations/20210715074933
deleted file mode 100644
index 721e9d8d32c..00000000000
--- a/db/schema_migrations/20210715074933
+++ /dev/null
@@ -1 +0,0 @@
-e29240947b2e0e6fa7c91643c5d1a2efa02ec062b5ccdffdf382dff993ab6225 \ No newline at end of file
diff --git a/db/schema_migrations/20210715075203 b/db/schema_migrations/20210715075203
deleted file mode 100644
index d123de45c42..00000000000
--- a/db/schema_migrations/20210715075203
+++ /dev/null
@@ -1 +0,0 @@
-9d29f4d776031e90cb42122146f65bb13e8778d223467a83dc311f4adab31565 \ No newline at end of file
diff --git a/db/schema_migrations/20210716074555 b/db/schema_migrations/20210716074555
deleted file mode 100644
index f079b199ca5..00000000000
--- a/db/schema_migrations/20210716074555
+++ /dev/null
@@ -1 +0,0 @@
-5cf415013b50c46fde5f12702c3f5bae808848a82eb57bfa38764947fc672ad9 \ No newline at end of file
diff --git a/db/schema_migrations/20210719145532 b/db/schema_migrations/20210719145532
deleted file mode 100644
index a9afd7a18ed..00000000000
--- a/db/schema_migrations/20210719145532
+++ /dev/null
@@ -1 +0,0 @@
-5e088e5109b50d8f4fadd37a0382d7dc4ce856a851ec2b97f8d5d868c3cb19fd \ No newline at end of file
diff --git a/db/schema_migrations/20210719182944 b/db/schema_migrations/20210719182944
deleted file mode 100644
index 37213ace8d9..00000000000
--- a/db/schema_migrations/20210719182944
+++ /dev/null
@@ -1 +0,0 @@
-9320dcd2a5bed122310aefd630f9c406a25b22767dba3bf118a30df044c2d6a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210719192928 b/db/schema_migrations/20210719192928
deleted file mode 100644
index b15de2220ed..00000000000
--- a/db/schema_migrations/20210719192928
+++ /dev/null
@@ -1 +0,0 @@
-eed403573697ac7f454ce47d6e4ab3561a10a62177caaaea40d5d70953068175 \ No newline at end of file
diff --git a/db/schema_migrations/20210720083432 b/db/schema_migrations/20210720083432
deleted file mode 100644
index 44c8b4ae689..00000000000
--- a/db/schema_migrations/20210720083432
+++ /dev/null
@@ -1 +0,0 @@
-6096780be4fae007485f150a019fc4555153e4b22b893d5fe29be36834d970a9 \ No newline at end of file
diff --git a/db/schema_migrations/20210720130006 b/db/schema_migrations/20210720130006
deleted file mode 100644
index c55eb9a283e..00000000000
--- a/db/schema_migrations/20210720130006
+++ /dev/null
@@ -1 +0,0 @@
-03d86d635c54b53bd540443f0a911d4f0ae59ec3494be23952490c5df70dd28c \ No newline at end of file
diff --git a/db/schema_migrations/20210720140841 b/db/schema_migrations/20210720140841
deleted file mode 100644
index ecb20e55d1c..00000000000
--- a/db/schema_migrations/20210720140841
+++ /dev/null
@@ -1 +0,0 @@
-1ef66bdf4a1c61d9a1e0e632d8728f86769ac727d43971e897284272e9f53581 \ No newline at end of file
diff --git a/db/schema_migrations/20210721122840 b/db/schema_migrations/20210721122840
deleted file mode 100644
index 375a03adc3d..00000000000
--- a/db/schema_migrations/20210721122840
+++ /dev/null
@@ -1 +0,0 @@
-483ef6f8ef379f39ecff32853c777c12c59d2858f061879c375ff6d429396167 \ No newline at end of file
diff --git a/db/schema_migrations/20210721125525 b/db/schema_migrations/20210721125525
deleted file mode 100644
index fa11899d7b4..00000000000
--- a/db/schema_migrations/20210721125525
+++ /dev/null
@@ -1 +0,0 @@
-8ffb00b1a86fb1f9574b3811f88a65a1478f64cf59dc99a3324e04c4f4f0c7dd \ No newline at end of file
diff --git a/db/schema_migrations/20210721125545 b/db/schema_migrations/20210721125545
deleted file mode 100644
index 372de21e151..00000000000
--- a/db/schema_migrations/20210721125545
+++ /dev/null
@@ -1 +0,0 @@
-8b43136ea6df74ad379537e28392c43770ecd8586eff8e830c52e65976f6978a \ No newline at end of file
diff --git a/db/schema_migrations/20210721125620 b/db/schema_migrations/20210721125620
deleted file mode 100644
index 4b72ac24379..00000000000
--- a/db/schema_migrations/20210721125620
+++ /dev/null
@@ -1 +0,0 @@
-fa27f8e932f47946a67b2e739a978573e5f375ac0b1058ee79353e22d514755d \ No newline at end of file
diff --git a/db/schema_migrations/20210721125637 b/db/schema_migrations/20210721125637
deleted file mode 100644
index dd4b29fdf1c..00000000000
--- a/db/schema_migrations/20210721125637
+++ /dev/null
@@ -1 +0,0 @@
-40f99f3c05290fe967cac6c1b90d913decacb491e1253fb166d4dd06363dd38b \ No newline at end of file
diff --git a/db/schema_migrations/20210721125804 b/db/schema_migrations/20210721125804
deleted file mode 100644
index 41756d62a7f..00000000000
--- a/db/schema_migrations/20210721125804
+++ /dev/null
@@ -1 +0,0 @@
-5c6cc14f49d8fa9d0f0610eab731f93f874d6e9b5e3d49d5a127830241528488 \ No newline at end of file
diff --git a/db/schema_migrations/20210721125820 b/db/schema_migrations/20210721125820
deleted file mode 100644
index 0c281f8587a..00000000000
--- a/db/schema_migrations/20210721125820
+++ /dev/null
@@ -1 +0,0 @@
-7cba2fedb94fb5dc7fa5b796c6a93d2c5c8b57aee64b294e0c20dde07bf5253a \ No newline at end of file
diff --git a/db/schema_migrations/20210721134706 b/db/schema_migrations/20210721134706
deleted file mode 100644
index c250f5661a9..00000000000
--- a/db/schema_migrations/20210721134706
+++ /dev/null
@@ -1 +0,0 @@
-e6c8fd913f591fed24072e9b0032b47dbb1165f2c1cf50ed01cfcd5f7da32cba \ No newline at end of file
diff --git a/db/schema_migrations/20210721134707 b/db/schema_migrations/20210721134707
deleted file mode 100644
index 4c25899474c..00000000000
--- a/db/schema_migrations/20210721134707
+++ /dev/null
@@ -1 +0,0 @@
-a795dad532a5ed2a645e49e586c6fb73167e9ae38843cf5cbcf37cf8661b765a \ No newline at end of file
diff --git a/db/schema_migrations/20210721135638 b/db/schema_migrations/20210721135638
deleted file mode 100644
index 3ca020593d2..00000000000
--- a/db/schema_migrations/20210721135638
+++ /dev/null
@@ -1 +0,0 @@
-a4219ce93f790ec372991adca4b1cc5c0410d57e92817082344b11758ca5ae93 \ No newline at end of file
diff --git a/db/schema_migrations/20210721145029 b/db/schema_migrations/20210721145029
deleted file mode 100644
index 2c28570b609..00000000000
--- a/db/schema_migrations/20210721145029
+++ /dev/null
@@ -1 +0,0 @@
-1585d2912058ce3a9225233c23707a3679a3f8df2078c71b5cc48f28b7bb9392 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174411 b/db/schema_migrations/20210721174411
deleted file mode 100644
index eae69e34afc..00000000000
--- a/db/schema_migrations/20210721174411
+++ /dev/null
@@ -1 +0,0 @@
-ac95292b2ab05f17ed13cb8e95ace0660e6dc82e33d6ef1cccd02890abf6c739 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174441 b/db/schema_migrations/20210721174441
deleted file mode 100644
index 473e3b4c55a..00000000000
--- a/db/schema_migrations/20210721174441
+++ /dev/null
@@ -1 +0,0 @@
-9f3a39b11f250f64e4e6b8623279604c1dba14330f45c26840f6e0b46f7d48a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174453 b/db/schema_migrations/20210721174453
deleted file mode 100644
index 3fe95971491..00000000000
--- a/db/schema_migrations/20210721174453
+++ /dev/null
@@ -1 +0,0 @@
-7b20c623b58982ba5d228902c6da6d10245edf3874ece9b02d58e8560d2d5d96 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174521 b/db/schema_migrations/20210721174521
deleted file mode 100644
index 03887b9c738..00000000000
--- a/db/schema_migrations/20210721174521
+++ /dev/null
@@ -1 +0,0 @@
-f16b563bbfa15b97143e82d2a1e78e9d9805d13e02e3a0845369d4ce3204b3cc \ No newline at end of file
diff --git a/db/schema_migrations/20210721211602 b/db/schema_migrations/20210721211602
deleted file mode 100644
index bf96fc31ea5..00000000000
--- a/db/schema_migrations/20210721211602
+++ /dev/null
@@ -1 +0,0 @@
-ee3e6377478302f41aa06f2278f38a9dde2f325318b4f2eba1007abb1dd1099c \ No newline at end of file
diff --git a/db/schema_migrations/20210722010101 b/db/schema_migrations/20210722010101
deleted file mode 100644
index ed0b98e6d1a..00000000000
--- a/db/schema_migrations/20210722010101
+++ /dev/null
@@ -1 +0,0 @@
-bbd39849499d16f92a5129506a87a6b253f209200bcb3a63c2432862c4b78aae \ No newline at end of file
diff --git a/db/schema_migrations/20210722042939 b/db/schema_migrations/20210722042939
deleted file mode 100644
index fe5a3820bf9..00000000000
--- a/db/schema_migrations/20210722042939
+++ /dev/null
@@ -1 +0,0 @@
-dd3b35b87c2f015895d807ede2521c9672fb41ec7a3b0b1a2f7abdc009950b6e \ No newline at end of file
diff --git a/db/schema_migrations/20210722055217 b/db/schema_migrations/20210722055217
deleted file mode 100644
index 45d62ce852c..00000000000
--- a/db/schema_migrations/20210722055217
+++ /dev/null
@@ -1 +0,0 @@
-bd934c20443d5a044caa9e92389018291ffb2bf60b8ca54d9baca4a0e70caf28 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074220 b/db/schema_migrations/20210722074220
deleted file mode 100644
index d0bc4133883..00000000000
--- a/db/schema_migrations/20210722074220
+++ /dev/null
@@ -1 +0,0 @@
-cf276b9aa97fc7857499e1b103a8e09eda329a4db92d0e653cc6f7128987be39 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074242 b/db/schema_migrations/20210722074242
deleted file mode 100644
index 2fc61b36ed2..00000000000
--- a/db/schema_migrations/20210722074242
+++ /dev/null
@@ -1 +0,0 @@
-5c6aff5b43a1e81e84a42f008a8a1ab90c77ee450884aa1ecc86bce551424f43 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074256 b/db/schema_migrations/20210722074256
deleted file mode 100644
index cedf6a7419b..00000000000
--- a/db/schema_migrations/20210722074256
+++ /dev/null
@@ -1 +0,0 @@
-d49b1f48c2fa1cac8d7793f8bb025792f4bb85eed787ba3abdbaa4647523b70a \ No newline at end of file
diff --git a/db/schema_migrations/20210722074309 b/db/schema_migrations/20210722074309
deleted file mode 100644
index 27b1bb9e493..00000000000
--- a/db/schema_migrations/20210722074309
+++ /dev/null
@@ -1 +0,0 @@
-eab0f8488b0122ec6c5625c66ebcbd221579bdd9cc2cf670d1f26181709f23b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074339 b/db/schema_migrations/20210722074339
deleted file mode 100644
index dc269e54868..00000000000
--- a/db/schema_migrations/20210722074339
+++ /dev/null
@@ -1 +0,0 @@
-a7a6697d86b71d59104af35a9d7d6f3caebf4ee1252e4f3e52133afb3f642e48 \ No newline at end of file
diff --git a/db/schema_migrations/20210722110515 b/db/schema_migrations/20210722110515
deleted file mode 100644
index 1e4791fc2f9..00000000000
--- a/db/schema_migrations/20210722110515
+++ /dev/null
@@ -1 +0,0 @@
-c9057cb28d2576551eafe78998023742018fa8351f2e550b7e35832a5509d21c \ No newline at end of file
diff --git a/db/schema_migrations/20210722132844 b/db/schema_migrations/20210722132844
deleted file mode 100644
index 7367cb1c13e..00000000000
--- a/db/schema_migrations/20210722132844
+++ /dev/null
@@ -1 +0,0 @@
-b4dfa045ec38a15d46288acc271a3ae93fed85b8605ab11640d9bbcfbd5b94cf \ No newline at end of file
diff --git a/db/schema_migrations/20210722150102 b/db/schema_migrations/20210722150102
deleted file mode 100644
index 42f6cfb3b7e..00000000000
--- a/db/schema_migrations/20210722150102
+++ /dev/null
@@ -1 +0,0 @@
-cea8e51f6917be9ad43280fba9f8e7d9b9db1f508e249d9f5df792e43c0b8313 \ No newline at end of file
diff --git a/db/schema_migrations/20210722151951 b/db/schema_migrations/20210722151951
deleted file mode 100644
index a5e6a8c0963..00000000000
--- a/db/schema_migrations/20210722151951
+++ /dev/null
@@ -1 +0,0 @@
-7289fb2a65c1210a352991fae7fac0c8e1129a33c166d0dad6f2aed98cb672a6 \ No newline at end of file
diff --git a/db/schema_migrations/20210722155635 b/db/schema_migrations/20210722155635
deleted file mode 100644
index d131ff9016e..00000000000
--- a/db/schema_migrations/20210722155635
+++ /dev/null
@@ -1 +0,0 @@
-d98c54e5ec60fc0ee1c008160118f6f0c45eb801932d4d3abcd26aba33ebdea6 \ No newline at end of file
diff --git a/db/schema_migrations/20210722210041 b/db/schema_migrations/20210722210041
deleted file mode 100644
index 09dbff3b4c2..00000000000
--- a/db/schema_migrations/20210722210041
+++ /dev/null
@@ -1 +0,0 @@
-253a3520f05e252b6e6bbb3ef5f8af6c374c897ffa736c89fbea3089fdfa8fc4 \ No newline at end of file
diff --git a/db/schema_migrations/20210723173132 b/db/schema_migrations/20210723173132
deleted file mode 100644
index 3199fb547d5..00000000000
--- a/db/schema_migrations/20210723173132
+++ /dev/null
@@ -1 +0,0 @@
-b64ba2a9ee42497aa9f60ca76f4925076cb77e73fd79bb9b10362cd48d11252b \ No newline at end of file
diff --git a/db/schema_migrations/20210726134950 b/db/schema_migrations/20210726134950
deleted file mode 100644
index 73f298e04a7..00000000000
--- a/db/schema_migrations/20210726134950
+++ /dev/null
@@ -1 +0,0 @@
-d989534193566d90f1d4d61a0a588f3204670b67e049e875011a06b32ffd941a \ No newline at end of file
diff --git a/db/schema_migrations/20210726202748 b/db/schema_migrations/20210726202748
deleted file mode 100644
index 390847c8a07..00000000000
--- a/db/schema_migrations/20210726202748
+++ /dev/null
@@ -1 +0,0 @@
-378e12c3c7c49e294ab4ab792151af8e3829cc6f38295d5faa0995ad16f3f934 \ No newline at end of file
diff --git a/db/schema_migrations/20210727113447 b/db/schema_migrations/20210727113447
deleted file mode 100644
index 236022f5af3..00000000000
--- a/db/schema_migrations/20210727113447
+++ /dev/null
@@ -1 +0,0 @@
-19e23131949e6056ea9837231fac6a2307fb52a8287eb34cc6e89eed11d52849 \ No newline at end of file
diff --git a/db/schema_migrations/20210727175201 b/db/schema_migrations/20210727175201
deleted file mode 100644
index 78dae022e6b..00000000000
--- a/db/schema_migrations/20210727175201
+++ /dev/null
@@ -1 +0,0 @@
-c7ae79084b802723a24064cb700b6cdc9a23011d3fed45457799c1ae7aa19ce6 \ No newline at end of file
diff --git a/db/schema_migrations/20210728110654 b/db/schema_migrations/20210728110654
deleted file mode 100644
index 3dd51a29bb7..00000000000
--- a/db/schema_migrations/20210728110654
+++ /dev/null
@@ -1 +0,0 @@
-8c317e202b9fb5fc3733325fd2447f65283c3752fcb314033f5d3b2b28484f71 \ No newline at end of file
diff --git a/db/schema_migrations/20210728174349 b/db/schema_migrations/20210728174349
deleted file mode 100644
index 59035edce30..00000000000
--- a/db/schema_migrations/20210728174349
+++ /dev/null
@@ -1 +0,0 @@
-3a56c903333f13e9e3d39e5b65a3b70fdcfbf967cdac8bff348dfb71c0fde520 \ No newline at end of file
diff --git a/db/schema_migrations/20210729061526 b/db/schema_migrations/20210729061526
deleted file mode 100644
index a56a4b4b245..00000000000
--- a/db/schema_migrations/20210729061526
+++ /dev/null
@@ -1 +0,0 @@
-5c71f4176ecf8f422e948c2c2ecb1e6662494def11e06d7d0071d73f379770f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210729061556 b/db/schema_migrations/20210729061556
deleted file mode 100644
index 3b39a351328..00000000000
--- a/db/schema_migrations/20210729061556
+++ /dev/null
@@ -1 +0,0 @@
-75be4e92b482c9003485658c42ba1e94a2d5c6a5a0653c8a27c5983fafd1d6a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210729081351 b/db/schema_migrations/20210729081351
deleted file mode 100644
index 1f397457443..00000000000
--- a/db/schema_migrations/20210729081351
+++ /dev/null
@@ -1 +0,0 @@
-17463867a8c14981386256dc90169fb879e1921d65eccca53eae576d49fba49d \ No newline at end of file
diff --git a/db/schema_migrations/20210729081739 b/db/schema_migrations/20210729081739
deleted file mode 100644
index 2215c7d7e66..00000000000
--- a/db/schema_migrations/20210729081739
+++ /dev/null
@@ -1 +0,0 @@
-af7963d27bda6ef85fb5b5a06ecf1de14f21829eecdaf13e763aa9a6ffc2e83c \ No newline at end of file
diff --git a/db/schema_migrations/20210729123101 b/db/schema_migrations/20210729123101
deleted file mode 100644
index 77f5bfba94e..00000000000
--- a/db/schema_migrations/20210729123101
+++ /dev/null
@@ -1 +0,0 @@
-8522eaf951d87de04aea82fe8e1a9577e6665c8d08245282239476e49b02bc7d \ No newline at end of file
diff --git a/db/schema_migrations/20210729125641 b/db/schema_migrations/20210729125641
deleted file mode 100644
index e5ee4127656..00000000000
--- a/db/schema_migrations/20210729125641
+++ /dev/null
@@ -1 +0,0 @@
-b7bc495d010e0640b1145ca55f47696047fd4360d2dfc9a3da7941ab62840132 \ No newline at end of file
diff --git a/db/schema_migrations/20210729125659 b/db/schema_migrations/20210729125659
deleted file mode 100644
index 64c8cd0aeef..00000000000
--- a/db/schema_migrations/20210729125659
+++ /dev/null
@@ -1 +0,0 @@
-5826e87b2ce13d4951e9b8e774c87c29c6e0a0954a85d60ec68155f2c5cf3ccc \ No newline at end of file
diff --git a/db/schema_migrations/20210729161242 b/db/schema_migrations/20210729161242
deleted file mode 100644
index 38769ac4ff0..00000000000
--- a/db/schema_migrations/20210729161242
+++ /dev/null
@@ -1 +0,0 @@
-22a64ce9a8cbebd2024908cc74cc92a50fb6ccaa1580ebea3be60d3659c48fa0 \ No newline at end of file
diff --git a/db/schema_migrations/20210729163312 b/db/schema_migrations/20210729163312
deleted file mode 100644
index 2c888f6786f..00000000000
--- a/db/schema_migrations/20210729163312
+++ /dev/null
@@ -1 +0,0 @@
-94978b93b1590cb2cfd9536a44a8817aa485a35d5372dfed31041261f5e12406 \ No newline at end of file
diff --git a/db/schema_migrations/20210729192148 b/db/schema_migrations/20210729192148
deleted file mode 100644
index 8cf650a223a..00000000000
--- a/db/schema_migrations/20210729192148
+++ /dev/null
@@ -1 +0,0 @@
-6ed7827f6f911dbb40637ac056298877b709fb7356bc9ee3a366cceb48268646 \ No newline at end of file
diff --git a/db/schema_migrations/20210729192959 b/db/schema_migrations/20210729192959
deleted file mode 100644
index df4f4ed2c71..00000000000
--- a/db/schema_migrations/20210729192959
+++ /dev/null
@@ -1 +0,0 @@
-3cb0c88fddfec66c0d89c4c1f34d0538be88a44f2039e6c542c5282b293ce019 \ No newline at end of file
diff --git a/db/schema_migrations/20210729193056 b/db/schema_migrations/20210729193056
deleted file mode 100644
index fea83eb2750..00000000000
--- a/db/schema_migrations/20210729193056
+++ /dev/null
@@ -1 +0,0 @@
-d983a765482b368bd7a238b3b75fc9b0a45310f295953ea053ee4c42785e8684 \ No newline at end of file
diff --git a/db/schema_migrations/20210729202143 b/db/schema_migrations/20210729202143
deleted file mode 100644
index c817508eb5f..00000000000
--- a/db/schema_migrations/20210729202143
+++ /dev/null
@@ -1 +0,0 @@
-ce20c699d6e6d6baf812c926dde08485764faa2fdeb8af14808670bf692aab00 \ No newline at end of file
diff --git a/db/schema_migrations/20210730101609 b/db/schema_migrations/20210730101609
deleted file mode 100644
index f3522b194b2..00000000000
--- a/db/schema_migrations/20210730101609
+++ /dev/null
@@ -1 +0,0 @@
-f819eaed7e387f18f066180cbf9d0849b3e38db95bbf3e8487d3bc58d9b489ae \ No newline at end of file
diff --git a/db/schema_migrations/20210730102952 b/db/schema_migrations/20210730102952
deleted file mode 100644
index a21008671c2..00000000000
--- a/db/schema_migrations/20210730102952
+++ /dev/null
@@ -1 +0,0 @@
-cb97b869bfb0b76dd0684aca1f40c86e7c1c9c9a0d52684830115288088e8066 \ No newline at end of file
diff --git a/db/schema_migrations/20210730103808 b/db/schema_migrations/20210730103808
deleted file mode 100644
index 6467a981cbb..00000000000
--- a/db/schema_migrations/20210730103808
+++ /dev/null
@@ -1 +0,0 @@
-5c104ffdb64943aa4828a9b961c8f9141dfd2ae861cea7116722d2b0d4598957 \ No newline at end of file
diff --git a/db/schema_migrations/20210730104800 b/db/schema_migrations/20210730104800
deleted file mode 100644
index d8e2986e946..00000000000
--- a/db/schema_migrations/20210730104800
+++ /dev/null
@@ -1 +0,0 @@
-7764c058665015707aff6e25ccbf60d4a329c67c16106b2ef523862ef82298b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210730170823 b/db/schema_migrations/20210730170823
deleted file mode 100644
index d1822fde24b..00000000000
--- a/db/schema_migrations/20210730170823
+++ /dev/null
@@ -1 +0,0 @@
-33b260626d65347a80240ffdce5f9e2abfc578e8151ed41f1ca9b16ef2654853 \ No newline at end of file
diff --git a/db/schema_migrations/20210730194555 b/db/schema_migrations/20210730194555
deleted file mode 100644
index 5b2a142779d..00000000000
--- a/db/schema_migrations/20210730194555
+++ /dev/null
@@ -1 +0,0 @@
-2d0399beca58815197487d310318ed1cb3d8e85671d55581a6256ceac7667b43 \ No newline at end of file
diff --git a/db/schema_migrations/20210731132939 b/db/schema_migrations/20210731132939
deleted file mode 100644
index f032b0fadad..00000000000
--- a/db/schema_migrations/20210731132939
+++ /dev/null
@@ -1 +0,0 @@
-97d968bba0eb2bf6faa19de8a3e4fe93dc03a623b623dc802ab0fe0a4afb0370 \ No newline at end of file
diff --git a/db/schema_migrations/20210802043253 b/db/schema_migrations/20210802043253
deleted file mode 100644
index a8017b11b8a..00000000000
--- a/db/schema_migrations/20210802043253
+++ /dev/null
@@ -1 +0,0 @@
-b844c7c56019fc984c2604ae11f6ee9eb587806b5c78e4beea4dda93e384f9b2 \ No newline at end of file
diff --git a/db/schema_migrations/20210802112233 b/db/schema_migrations/20210802112233
deleted file mode 100644
index 68626f9398b..00000000000
--- a/db/schema_migrations/20210802112233
+++ /dev/null
@@ -1 +0,0 @@
-1b55c50a9ba085ae7a0552da4985755c67eafb74e76b06590179803b4b215f81 \ No newline at end of file
diff --git a/db/schema_migrations/20210802131812 b/db/schema_migrations/20210802131812
deleted file mode 100644
index ef533ba9abd..00000000000
--- a/db/schema_migrations/20210802131812
+++ /dev/null
@@ -1 +0,0 @@
-a686e5df8b1528fa4d8d1c7b65b234837443d0cc249d08a38694f83263bb0532 \ No newline at end of file
diff --git a/db/schema_migrations/20210803110920 b/db/schema_migrations/20210803110920
deleted file mode 100644
index 69ba671ea7b..00000000000
--- a/db/schema_migrations/20210803110920
+++ /dev/null
@@ -1 +0,0 @@
-529cf86e09b5aa9015b604e73827cb21e92ced401f30dfb281115a506596bd4e \ No newline at end of file
diff --git a/db/schema_migrations/20210804150320 b/db/schema_migrations/20210804150320
deleted file mode 100644
index 336fec35970..00000000000
--- a/db/schema_migrations/20210804150320
+++ /dev/null
@@ -1 +0,0 @@
-53d4f6ca18602b25af631a25dee7b0ebf9cb98e7a4f8cd87830f939bc13bb893 \ No newline at end of file
diff --git a/db/schema_migrations/20210804150624 b/db/schema_migrations/20210804150624
deleted file mode 100644
index 135519b6b93..00000000000
--- a/db/schema_migrations/20210804150624
+++ /dev/null
@@ -1 +0,0 @@
-52e71aa3ec92473006b37e9319797133356f7747b91c32b09a746e183501655f \ No newline at end of file
diff --git a/db/schema_migrations/20210804151444 b/db/schema_migrations/20210804151444
deleted file mode 100644
index 0d633c3da36..00000000000
--- a/db/schema_migrations/20210804151444
+++ /dev/null
@@ -1 +0,0 @@
-4a6676e9185a99070751c91c71a7a9e6a845426d68567abf80a2e414251e5805 \ No newline at end of file
diff --git a/db/schema_migrations/20210804153307 b/db/schema_migrations/20210804153307
deleted file mode 100644
index ae7baaa4cf4..00000000000
--- a/db/schema_migrations/20210804153307
+++ /dev/null
@@ -1 +0,0 @@
-d73756410c7f37662c50bb05c372e6ac32ba81f232c07debcd42d1f679eb74ef \ No newline at end of file
diff --git a/db/schema_migrations/20210804154407 b/db/schema_migrations/20210804154407
deleted file mode 100644
index dc0e40c7117..00000000000
--- a/db/schema_migrations/20210804154407
+++ /dev/null
@@ -1 +0,0 @@
-ab7ee98704e844de4a3ba3ae14ea64dd46539e63d49c7c7e0d67ed03ebc3bbd4 \ No newline at end of file
diff --git a/db/schema_migrations/20210804200114 b/db/schema_migrations/20210804200114
deleted file mode 100644
index b4ac42657ba..00000000000
--- a/db/schema_migrations/20210804200114
+++ /dev/null
@@ -1 +0,0 @@
-db62fb6413db4be5e1013bccf16b0c3a66c9aaf9f3d646f42442be16c511af5f \ No newline at end of file
diff --git a/db/schema_migrations/20210804202057 b/db/schema_migrations/20210804202057
deleted file mode 100644
index dd592038d11..00000000000
--- a/db/schema_migrations/20210804202057
+++ /dev/null
@@ -1 +0,0 @@
-48f140728fede7cf38469c8dfcb5480b4f2b8e29af4b1edd5d38024548493c2d \ No newline at end of file
diff --git a/db/schema_migrations/20210805085706 b/db/schema_migrations/20210805085706
deleted file mode 100644
index b41a68968ec..00000000000
--- a/db/schema_migrations/20210805085706
+++ /dev/null
@@ -1 +0,0 @@
-ec968f1f9fcc5a3551664e74726e1c65b327128e2388e1357ae6d0cf6f05fb95 \ No newline at end of file
diff --git a/db/schema_migrations/20210805131510 b/db/schema_migrations/20210805131510
deleted file mode 100644
index a80524552b9..00000000000
--- a/db/schema_migrations/20210805131510
+++ /dev/null
@@ -1 +0,0 @@
-ee6dc82719ecfbdf58d2c76589f328bed9e1a4455f4c593ae45ae7b2afc62602 \ No newline at end of file
diff --git a/db/schema_migrations/20210805192450 b/db/schema_migrations/20210805192450
deleted file mode 100644
index 1b9ae3880e0..00000000000
--- a/db/schema_migrations/20210805192450
+++ /dev/null
@@ -1 +0,0 @@
-a63f878d89269eb8a2a3cc3b0c81d700861031a079a4a69b56d45d73c4c7946e \ No newline at end of file
diff --git a/db/schema_migrations/20210806011811 b/db/schema_migrations/20210806011811
deleted file mode 100644
index 7b8317bec10..00000000000
--- a/db/schema_migrations/20210806011811
+++ /dev/null
@@ -1 +0,0 @@
-e4f4f3c91cdb8ce8b1fa6c2bd0bb1fb1a8c0dedbb78c20bbaef6e36bfa9551c4 \ No newline at end of file
diff --git a/db/schema_migrations/20210806131706 b/db/schema_migrations/20210806131706
deleted file mode 100644
index 78be9905398..00000000000
--- a/db/schema_migrations/20210806131706
+++ /dev/null
@@ -1 +0,0 @@
-2539e3e09682f1d7a0902b495a140151a5debef40623348d3cc552d4ba00722f \ No newline at end of file
diff --git a/db/schema_migrations/20210806152104 b/db/schema_migrations/20210806152104
deleted file mode 100644
index a8bdc0615d5..00000000000
--- a/db/schema_migrations/20210806152104
+++ /dev/null
@@ -1 +0,0 @@
-1bdbcc6ef5ccf7a2bfb1f9571885e218e230a81b632a2d993302bd87432963f3 \ No newline at end of file
diff --git a/db/schema_migrations/20210807101446 b/db/schema_migrations/20210807101446
deleted file mode 100644
index 0b6d526429f..00000000000
--- a/db/schema_migrations/20210807101446
+++ /dev/null
@@ -1 +0,0 @@
-30e1463616c60b92afb28bbb76e3c55830a385af6df0e60e16ed96d9e75943b9 \ No newline at end of file
diff --git a/db/schema_migrations/20210807101621 b/db/schema_migrations/20210807101621
deleted file mode 100644
index ab053cf4cbc..00000000000
--- a/db/schema_migrations/20210807101621
+++ /dev/null
@@ -1 +0,0 @@
-7e9b39914ade766357751953a4981225dbae7e5d371d4824af61b01af70f46ae \ No newline at end of file
diff --git a/db/schema_migrations/20210807102004 b/db/schema_migrations/20210807102004
deleted file mode 100644
index e63485435f8..00000000000
--- a/db/schema_migrations/20210807102004
+++ /dev/null
@@ -1 +0,0 @@
-a2454f9fca3b1cedf7a0f2288b69abe799fe1f9ff4e2fe26d2cadfdddea73a83 \ No newline at end of file
diff --git a/db/schema_migrations/20210809014850 b/db/schema_migrations/20210809014850
deleted file mode 100644
index 541d397d169..00000000000
--- a/db/schema_migrations/20210809014850
+++ /dev/null
@@ -1 +0,0 @@
-6f67e2bba5f42d48a9b21f8ab4d9abf4495ef7e0226ea903d51e77eed85ad0cb \ No newline at end of file
diff --git a/db/schema_migrations/20210809014918 b/db/schema_migrations/20210809014918
deleted file mode 100644
index 099f032c76a..00000000000
--- a/db/schema_migrations/20210809014918
+++ /dev/null
@@ -1 +0,0 @@
-d282a027d03920a53d49444f54745ab7d2c8bcccc485ac9407ff9dbbef77981f \ No newline at end of file
diff --git a/db/schema_migrations/20210809123658 b/db/schema_migrations/20210809123658
deleted file mode 100644
index 0db44d3c8f5..00000000000
--- a/db/schema_migrations/20210809123658
+++ /dev/null
@@ -1 +0,0 @@
-f4a1963c8f21b8c767766c3a18037bae223efce8452c87f570cf9789d6f666d6 \ No newline at end of file
diff --git a/db/schema_migrations/20210809143931 b/db/schema_migrations/20210809143931
deleted file mode 100644
index 294c62d54d8..00000000000
--- a/db/schema_migrations/20210809143931
+++ /dev/null
@@ -1 +0,0 @@
-37cac2c3c5c5c22a34e0a77733c5330a32101090ac47b46260123c3362a9e36f \ No newline at end of file
diff --git a/db/schema_migrations/20210809194250 b/db/schema_migrations/20210809194250
deleted file mode 100644
index c70e543e20e..00000000000
--- a/db/schema_migrations/20210809194250
+++ /dev/null
@@ -1 +0,0 @@
-35475ad862d713055a90af508dba393834ce8aa60eb1abf46b8f9698c2d42276 \ No newline at end of file
diff --git a/db/schema_migrations/20210811120204 b/db/schema_migrations/20210811120204
deleted file mode 100644
index 1802d357900..00000000000
--- a/db/schema_migrations/20210811120204
+++ /dev/null
@@ -1 +0,0 @@
-77d80801402f18e69d17a9f120445fe14d05cec3a93a08341abf89ae81cda5b9 \ No newline at end of file
diff --git a/db/schema_migrations/20210811122206 b/db/schema_migrations/20210811122206
deleted file mode 100644
index 3bb2799461a..00000000000
--- a/db/schema_migrations/20210811122206
+++ /dev/null
@@ -1 +0,0 @@
-f6f5e081672fb42adde980fa12f696f5d8fd11921ee52c1472b3d745bb11a5ff \ No newline at end of file
diff --git a/db/schema_migrations/20210811193033 b/db/schema_migrations/20210811193033
deleted file mode 100644
index 0d97d5a238a..00000000000
--- a/db/schema_migrations/20210811193033
+++ /dev/null
@@ -1 +0,0 @@
-a7e259fa72dfdfa40137d278499d6b63b84f939f46936c0f4ed289ed152d9356 \ No newline at end of file
diff --git a/db/schema_migrations/20210811214811 b/db/schema_migrations/20210811214811
deleted file mode 100644
index b34641b6b44..00000000000
--- a/db/schema_migrations/20210811214811
+++ /dev/null
@@ -1 +0,0 @@
-9e66aa8fc5e2a32ce0857f7ef77e906424bdf86c49643dfc71ed1a2e353b2095 \ No newline at end of file
diff --git a/db/schema_migrations/20210812013042 b/db/schema_migrations/20210812013042
deleted file mode 100644
index fee1a2b268a..00000000000
--- a/db/schema_migrations/20210812013042
+++ /dev/null
@@ -1 +0,0 @@
-0af6e6e56967cef9d1160dbfd95456428337843d893307c69505e1a2d3c2074a \ No newline at end of file
diff --git a/db/schema_migrations/20210812145010 b/db/schema_migrations/20210812145010
deleted file mode 100644
index 0a00afc3c70..00000000000
--- a/db/schema_migrations/20210812145010
+++ /dev/null
@@ -1 +0,0 @@
-24c49a12b6624c8e215e8a0c16b1bc9acc1875e68d3727fc3904b9e2eee1d319 \ No newline at end of file
diff --git a/db/schema_migrations/20210812171704 b/db/schema_migrations/20210812171704
deleted file mode 100644
index 2471f7cdd38..00000000000
--- a/db/schema_migrations/20210812171704
+++ /dev/null
@@ -1 +0,0 @@
-7c62c47ebad110a343c1f9834ae34bd0fa2bad763025da06f911e127a7380542 \ No newline at end of file
diff --git a/db/schema_migrations/20210813101742 b/db/schema_migrations/20210813101742
deleted file mode 100644
index f711612a8dc..00000000000
--- a/db/schema_migrations/20210813101742
+++ /dev/null
@@ -1 +0,0 @@
-4401423fc602a6d5df95857282bb84851fa99ddeb6c3d1ce4614f12c1dc4ec87 \ No newline at end of file
diff --git a/db/schema_migrations/20210813111909 b/db/schema_migrations/20210813111909
deleted file mode 100644
index c6073d273da..00000000000
--- a/db/schema_migrations/20210813111909
+++ /dev/null
@@ -1 +0,0 @@
-78ea79c2157acb8a0b29afb4d2f3de6965fb0ea885b5d5f939f22ccda1d53b1e \ No newline at end of file
diff --git a/db/schema_migrations/20210813131313 b/db/schema_migrations/20210813131313
deleted file mode 100644
index abb03783efe..00000000000
--- a/db/schema_migrations/20210813131313
+++ /dev/null
@@ -1 +0,0 @@
-5ab51c1fb5bde22123f2d55f6422de0d8d0a84b7a98ce3146cbf491475c97b66 \ No newline at end of file
diff --git a/db/schema_migrations/20210813151908 b/db/schema_migrations/20210813151908
deleted file mode 100644
index b2d1602658b..00000000000
--- a/db/schema_migrations/20210813151908
+++ /dev/null
@@ -1 +0,0 @@
-fdb6dd20c1cd5feaf0efd8eb94a4d61fc4812f1142572433ae397cd5f27bf603 \ No newline at end of file
diff --git a/db/schema_migrations/20210813195518 b/db/schema_migrations/20210813195518
deleted file mode 100644
index d64dd04d05b..00000000000
--- a/db/schema_migrations/20210813195518
+++ /dev/null
@@ -1 +0,0 @@
-848e0201709b3608e76308e9d610e2a4e48ab665c7d8b52f3d23f0a215df58ff \ No newline at end of file
diff --git a/db/schema_migrations/20210816095826 b/db/schema_migrations/20210816095826
deleted file mode 100644
index 079a83fae8f..00000000000
--- a/db/schema_migrations/20210816095826
+++ /dev/null
@@ -1 +0,0 @@
-d1ad234656f49861d2ca7694d23116e930bba597fca32b1015db698cc23bdc1c \ No newline at end of file
diff --git a/db/schema_migrations/20210816161107 b/db/schema_migrations/20210816161107
deleted file mode 100644
index 1b8ab5265b7..00000000000
--- a/db/schema_migrations/20210816161107
+++ /dev/null
@@ -1 +0,0 @@
-1e4d0b062c8e43b1af37c6cf869f9c173248d7bf5451b4aa5468d48c1004b97c \ No newline at end of file
diff --git a/db/schema_migrations/20210816183304 b/db/schema_migrations/20210816183304
deleted file mode 100644
index eebc52f99d7..00000000000
--- a/db/schema_migrations/20210816183304
+++ /dev/null
@@ -1 +0,0 @@
-08fed4e3269629304c5036361c237f4c9b860c26212b155869773296a79df01a \ No newline at end of file
diff --git a/db/schema_migrations/20210816192041 b/db/schema_migrations/20210816192041
deleted file mode 100644
index d60da5dda39..00000000000
--- a/db/schema_migrations/20210816192041
+++ /dev/null
@@ -1 +0,0 @@
-7d069706b4379685cfe85a5c65444d139f6f93578ff6ff66759e0a694e119bb4 \ No newline at end of file
diff --git a/db/schema_migrations/20210817024335 b/db/schema_migrations/20210817024335
deleted file mode 100644
index 019ec0a26b7..00000000000
--- a/db/schema_migrations/20210817024335
+++ /dev/null
@@ -1 +0,0 @@
-360bb1c16c93d7a6564ed70fa2dea4212e1fd00d101cfdc9017b54f67eae797d \ No newline at end of file
diff --git a/db/schema_migrations/20210817084338 b/db/schema_migrations/20210817084338
deleted file mode 100644
index ca7219b7ea6..00000000000
--- a/db/schema_migrations/20210817084338
+++ /dev/null
@@ -1 +0,0 @@
-e301e1be82c96e62bba0f958c54dda4633b28553246d4c576d6de33cd33e0a50 \ No newline at end of file
diff --git a/db/schema_migrations/20210817130415 b/db/schema_migrations/20210817130415
deleted file mode 100644
index e8481cb4019..00000000000
--- a/db/schema_migrations/20210817130415
+++ /dev/null
@@ -1 +0,0 @@
-8c1ec0dfc043861377786bd7731a1a1f994d6f03833f4dcc2ba94ab1ddc83acf \ No newline at end of file
diff --git a/db/schema_migrations/20210817172214 b/db/schema_migrations/20210817172214
deleted file mode 100644
index 5e334c7d690..00000000000
--- a/db/schema_migrations/20210817172214
+++ /dev/null
@@ -1 +0,0 @@
-d6dd6ce802beeea380e0eb1c564f6a5cbc6d30cb3488a3cb91935e1302a4c387 \ No newline at end of file
diff --git a/db/schema_migrations/20210818034001 b/db/schema_migrations/20210818034001
deleted file mode 100644
index e20a891b5f1..00000000000
--- a/db/schema_migrations/20210818034001
+++ /dev/null
@@ -1 +0,0 @@
-ebf0c2a7b0563dafa562136a0758baf631db92c0ce33f7200da24092f1eb2930 \ No newline at end of file
diff --git a/db/schema_migrations/20210818055357 b/db/schema_migrations/20210818055357
deleted file mode 100644
index 1557aa0ac3e..00000000000
--- a/db/schema_migrations/20210818055357
+++ /dev/null
@@ -1 +0,0 @@
-1092a16d742b08ef2ef5f74bdaa92bb5f9cedbdb1161ab71abe501c39b164689 \ No newline at end of file
diff --git a/db/schema_migrations/20210818061156 b/db/schema_migrations/20210818061156
deleted file mode 100644
index fba5486b2a8..00000000000
--- a/db/schema_migrations/20210818061156
+++ /dev/null
@@ -1 +0,0 @@
-23becdc9ad558882f4ce42e76391cdc2f760322a09c998082465fcb6d29dfeb5 \ No newline at end of file
diff --git a/db/schema_migrations/20210818115613 b/db/schema_migrations/20210818115613
deleted file mode 100644
index efe76d3a46a..00000000000
--- a/db/schema_migrations/20210818115613
+++ /dev/null
@@ -1 +0,0 @@
-9c5114dac05e90c15567bb3274f20f03a82f9e4d73d5c72d89c26bc9d742cc35 \ No newline at end of file
diff --git a/db/schema_migrations/20210818175949 b/db/schema_migrations/20210818175949
deleted file mode 100644
index 8e316d2dd9c..00000000000
--- a/db/schema_migrations/20210818175949
+++ /dev/null
@@ -1 +0,0 @@
-0d04487e59b783f0aa88ddd4f79716ae570ba87528b15bd07400aa4b1cef92c1 \ No newline at end of file
diff --git a/db/schema_migrations/20210818185548 b/db/schema_migrations/20210818185548
deleted file mode 100644
index 42826826512..00000000000
--- a/db/schema_migrations/20210818185548
+++ /dev/null
@@ -1 +0,0 @@
-88ca485c8513df96b1f1aec1585c385223dc53889e547db42b509b0cd1bea9b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210818185845 b/db/schema_migrations/20210818185845
deleted file mode 100644
index 7ed2204aeb6..00000000000
--- a/db/schema_migrations/20210818185845
+++ /dev/null
@@ -1 +0,0 @@
-dc8ca347fb0c87e1a66389fd9f37fa9702f8bd53237ada40192bb0a875dbe940 \ No newline at end of file
diff --git a/db/schema_migrations/20210818193008 b/db/schema_migrations/20210818193008
deleted file mode 100644
index aef60a5ab5b..00000000000
--- a/db/schema_migrations/20210818193008
+++ /dev/null
@@ -1 +0,0 @@
-d24d10134d661728dbe688da2b90da55c584627ca764a6cc4604631f8a5fa334 \ No newline at end of file
diff --git a/db/schema_migrations/20210818200455 b/db/schema_migrations/20210818200455
deleted file mode 100644
index c476ef5b488..00000000000
--- a/db/schema_migrations/20210818200455
+++ /dev/null
@@ -1 +0,0 @@
-25eb43de74e7eb158718b19d8cea5da2540507e96fcbe47d4829fa806e773308 \ No newline at end of file
diff --git a/db/schema_migrations/20210818220234 b/db/schema_migrations/20210818220234
deleted file mode 100644
index e32f27029cf..00000000000
--- a/db/schema_migrations/20210818220234
+++ /dev/null
@@ -1 +0,0 @@
-8d247218468ad383d1a8a2dc67d5e7e67ddad2a33a38203a41e49c4c018adc7e \ No newline at end of file
diff --git a/db/schema_migrations/20210819120243 b/db/schema_migrations/20210819120243
deleted file mode 100644
index e31d0ca6414..00000000000
--- a/db/schema_migrations/20210819120243
+++ /dev/null
@@ -1 +0,0 @@
-5c74d34171ed9129ffbb3efe5417da1ba857cd729837544e58074debd5afca88 \ No newline at end of file
diff --git a/db/schema_migrations/20210819145000 b/db/schema_migrations/20210819145000
deleted file mode 100644
index 56301031459..00000000000
--- a/db/schema_migrations/20210819145000
+++ /dev/null
@@ -1 +0,0 @@
-a73a33d30af332c8c01cd9d55618a1b84bc9074ffe4d06fd72c8eb37cd264954 \ No newline at end of file
diff --git a/db/schema_migrations/20210819152723 b/db/schema_migrations/20210819152723
deleted file mode 100644
index b5f4d2795f7..00000000000
--- a/db/schema_migrations/20210819152723
+++ /dev/null
@@ -1 +0,0 @@
-b311fdb0a6e0e10ca3c67b9b2c3d920f8e735f0fd8398fdaa25853e14f88ae97 \ No newline at end of file
diff --git a/db/schema_migrations/20210819153805 b/db/schema_migrations/20210819153805
deleted file mode 100644
index fe0d1dcfd69..00000000000
--- a/db/schema_migrations/20210819153805
+++ /dev/null
@@ -1 +0,0 @@
-195d2444bf9d5113ee589b1accdbf04efbc7fb84c2ead4deed3985b254345e07 \ No newline at end of file
diff --git a/db/schema_migrations/20210819162047 b/db/schema_migrations/20210819162047
deleted file mode 100644
index c50e07543da..00000000000
--- a/db/schema_migrations/20210819162047
+++ /dev/null
@@ -1 +0,0 @@
-5a02c5a24bb4c7cb63da2e5cc53ff89461f328d0092bb4bb6589223dc4bdae8c \ No newline at end of file
diff --git a/db/schema_migrations/20210819183128 b/db/schema_migrations/20210819183128
deleted file mode 100644
index 84b8b3780e3..00000000000
--- a/db/schema_migrations/20210819183128
+++ /dev/null
@@ -1 +0,0 @@
-d57791945f0d21da90a5b1d75db9add6c7e916ad3c13df2522c7d71d572baa47 \ No newline at end of file
diff --git a/db/schema_migrations/20210819185500 b/db/schema_migrations/20210819185500
deleted file mode 100644
index 1f92c1d81a9..00000000000
--- a/db/schema_migrations/20210819185500
+++ /dev/null
@@ -1 +0,0 @@
-eab87cb4abfad7542fcff7c25d984e4a7588c824a13b379cb16c87d0c077cfbb \ No newline at end of file
diff --git a/db/schema_migrations/20210820171834 b/db/schema_migrations/20210820171834
deleted file mode 100644
index be62c2b9a63..00000000000
--- a/db/schema_migrations/20210820171834
+++ /dev/null
@@ -1 +0,0 @@
-892a71a3f6fdeb20cb2837a426d6d0931c756f8bf3d647e520a72a0bb6f78309 \ No newline at end of file
diff --git a/db/schema_migrations/20210823113259 b/db/schema_migrations/20210823113259
deleted file mode 100644
index 79f416332d8..00000000000
--- a/db/schema_migrations/20210823113259
+++ /dev/null
@@ -1 +0,0 @@
-06b44a856fc970f52b19ad8eeb38f885182003eff50ef1524ecf30887f4664d9 \ No newline at end of file
diff --git a/db/schema_migrations/20210823132600 b/db/schema_migrations/20210823132600
deleted file mode 100644
index 85ab3b55ee4..00000000000
--- a/db/schema_migrations/20210823132600
+++ /dev/null
@@ -1 +0,0 @@
-7324c3803c910338261556c65cae5d0827e78b77890386e402e056d480c3486b \ No newline at end of file
diff --git a/db/schema_migrations/20210823142036 b/db/schema_migrations/20210823142036
deleted file mode 100644
index ec24927dfcf..00000000000
--- a/db/schema_migrations/20210823142036
+++ /dev/null
@@ -1 +0,0 @@
-874ed71410406d10ade9c834d1374b039effd9e88514d327d04275e11e837ffb \ No newline at end of file
diff --git a/db/schema_migrations/20210823172643 b/db/schema_migrations/20210823172643
deleted file mode 100644
index e89e11bb544..00000000000
--- a/db/schema_migrations/20210823172643
+++ /dev/null
@@ -1 +0,0 @@
-e6570f8ee366431b17b34051b9d0dcf2aff6216f8d65b3b6eec5be5666fed229 \ No newline at end of file
diff --git a/db/schema_migrations/20210823193234 b/db/schema_migrations/20210823193234
deleted file mode 100644
index d47f1ec567a..00000000000
--- a/db/schema_migrations/20210823193234
+++ /dev/null
@@ -1 +0,0 @@
-b85ef326056bb152d527e34b49caa3c40ee8685c3b14654992246c6adf082f8c \ No newline at end of file
diff --git a/db/schema_migrations/20210823213417 b/db/schema_migrations/20210823213417
deleted file mode 100644
index bcd41f479e6..00000000000
--- a/db/schema_migrations/20210823213417
+++ /dev/null
@@ -1 +0,0 @@
-62496310640493bf9b7f0e1cbe91b170542da3250a1cf482f5e0237d0e8847b1 \ No newline at end of file
diff --git a/db/schema_migrations/20210824055322 b/db/schema_migrations/20210824055322
deleted file mode 100644
index ed3925f8ac5..00000000000
--- a/db/schema_migrations/20210824055322
+++ /dev/null
@@ -1 +0,0 @@
-abd298ec9e6d9016c05032504d9ff0de7af9c6a031e0eacb041f29e59e82f289 \ No newline at end of file
diff --git a/db/schema_migrations/20210824102624 b/db/schema_migrations/20210824102624
deleted file mode 100644
index c736c84f8f8..00000000000
--- a/db/schema_migrations/20210824102624
+++ /dev/null
@@ -1 +0,0 @@
-f1fc9e062f5100db6a549fffa2fcd78d8eb6854cea388a6ac7addf4f6f232920 \ No newline at end of file
diff --git a/db/schema_migrations/20210824102750 b/db/schema_migrations/20210824102750
deleted file mode 100644
index 520c8365d41..00000000000
--- a/db/schema_migrations/20210824102750
+++ /dev/null
@@ -1 +0,0 @@
-cc99eb2b40ee88d4d6df07253f599deb26be2fca7b941c5cecb2f8fb7ff3641d \ No newline at end of file
diff --git a/db/schema_migrations/20210824105038 b/db/schema_migrations/20210824105038
deleted file mode 100644
index 24772827b3b..00000000000
--- a/db/schema_migrations/20210824105038
+++ /dev/null
@@ -1 +0,0 @@
-9fe4e2a3d5c50507220ac8363a9f7975ca1fc87575ee0c2ba8948c6d9bcd7019 \ No newline at end of file
diff --git a/db/schema_migrations/20210824160459 b/db/schema_migrations/20210824160459
deleted file mode 100644
index afab14f962c..00000000000
--- a/db/schema_migrations/20210824160459
+++ /dev/null
@@ -1 +0,0 @@
-39924743a04ba01cb85eed5ef88762a6a3e29c56f397a59632ba43e0ccec40b3 \ No newline at end of file
diff --git a/db/schema_migrations/20210824174615 b/db/schema_migrations/20210824174615
deleted file mode 100644
index 56160c801f1..00000000000
--- a/db/schema_migrations/20210824174615
+++ /dev/null
@@ -1 +0,0 @@
-830cf08352b0d1f0c7f08ea67107466ea1d6a478c6f47d5e19f0ffa6c57f5641 \ No newline at end of file
diff --git a/db/schema_migrations/20210825104558 b/db/schema_migrations/20210825104558
deleted file mode 100644
index 3457bbf1ace..00000000000
--- a/db/schema_migrations/20210825104558
+++ /dev/null
@@ -1 +0,0 @@
-ab678fb5e8ddf7e6dc84f36248440e94953d7c85ee6a50f4e5c06f32c6ee66ec \ No newline at end of file
diff --git a/db/schema_migrations/20210825104656 b/db/schema_migrations/20210825104656
deleted file mode 100644
index 9f91a3c364f..00000000000
--- a/db/schema_migrations/20210825104656
+++ /dev/null
@@ -1 +0,0 @@
-c15d736eb441503d321e1bf377edd204aa1b5822ed697cce2934ff87eca441a9 \ No newline at end of file
diff --git a/db/schema_migrations/20210825110016 b/db/schema_migrations/20210825110016
deleted file mode 100644
index 8c1b11653f1..00000000000
--- a/db/schema_migrations/20210825110016
+++ /dev/null
@@ -1 +0,0 @@
-e9e8444056a114d471f60156ec1e5a96082c7922604f1926c0256eb17986c484 \ No newline at end of file
diff --git a/db/schema_migrations/20210825150212 b/db/schema_migrations/20210825150212
deleted file mode 100644
index bdd83542199..00000000000
--- a/db/schema_migrations/20210825150212
+++ /dev/null
@@ -1 +0,0 @@
-5dc6a4f9ecbd705bf8361c65b29931cde94968084e8ae7945a27acdcbd6475c8 \ No newline at end of file
diff --git a/db/schema_migrations/20210825182303 b/db/schema_migrations/20210825182303
deleted file mode 100644
index af9dc177a72..00000000000
--- a/db/schema_migrations/20210825182303
+++ /dev/null
@@ -1 +0,0 @@
-a7f4911fcb9ab939a6e5e9a6e5e927fd6828ff062324d8483d78c8f8a4ded4e6 \ No newline at end of file
diff --git a/db/schema_migrations/20210825190458 b/db/schema_migrations/20210825190458
deleted file mode 100644
index e03c12e4284..00000000000
--- a/db/schema_migrations/20210825190458
+++ /dev/null
@@ -1 +0,0 @@
-43d152f4235a07111a401be7b52a527571be04861c71381c311d6a48c8574dc9 \ No newline at end of file
diff --git a/db/schema_migrations/20210825193448 b/db/schema_migrations/20210825193448
deleted file mode 100644
index b62b45b61ae..00000000000
--- a/db/schema_migrations/20210825193448
+++ /dev/null
@@ -1 +0,0 @@
-d9c7cc7721b28cbd442bf40255ecfbd20d0abf4cd31631c150ebdc05c76062be \ No newline at end of file
diff --git a/db/schema_migrations/20210825193548 b/db/schema_migrations/20210825193548
deleted file mode 100644
index 0255e6719ef..00000000000
--- a/db/schema_migrations/20210825193548
+++ /dev/null
@@ -1 +0,0 @@
-b97b77aef61db2e51106ac090f5511a67fa85be8f3741f618fe03c8c03ecd88c \ No newline at end of file
diff --git a/db/schema_migrations/20210825193652 b/db/schema_migrations/20210825193652
deleted file mode 100644
index 0ecca0962dc..00000000000
--- a/db/schema_migrations/20210825193652
+++ /dev/null
@@ -1 +0,0 @@
-fd7aef11635bc4c5d6b9346dbed90f6c114da7b7a33744083e8610f3850e4736 \ No newline at end of file
diff --git a/db/schema_migrations/20210826110839 b/db/schema_migrations/20210826110839
deleted file mode 100644
index 165141ef852..00000000000
--- a/db/schema_migrations/20210826110839
+++ /dev/null
@@ -1 +0,0 @@
-72b64ddbaf86eb296fe49fd38bea759d5247414142fe1cd11aee7e1d6171e142 \ No newline at end of file
diff --git a/db/schema_migrations/20210826120834 b/db/schema_migrations/20210826120834
deleted file mode 100644
index ebbdb86049c..00000000000
--- a/db/schema_migrations/20210826120834
+++ /dev/null
@@ -1 +0,0 @@
-a8cd5165815a2f1e6b825ea3ee2a9bde88c1790f6ebe92296bee6a9a892b83f2 \ No newline at end of file
diff --git a/db/schema_migrations/20210826122748 b/db/schema_migrations/20210826122748
deleted file mode 100644
index e6d87674da3..00000000000
--- a/db/schema_migrations/20210826122748
+++ /dev/null
@@ -1 +0,0 @@
-a1290cc671c487a7c24bfdb02c564d656a6606258e680e65ed108e3a28de10ca \ No newline at end of file
diff --git a/db/schema_migrations/20210826124311 b/db/schema_migrations/20210826124311
deleted file mode 100644
index c63d85f13b7..00000000000
--- a/db/schema_migrations/20210826124311
+++ /dev/null
@@ -1 +0,0 @@
-2cad14b3b7cb4f958a26cb6d4e76380338b745cc90c2e31c521614ea277c4ee9 \ No newline at end of file
diff --git a/db/schema_migrations/20210826145509 b/db/schema_migrations/20210826145509
deleted file mode 100644
index 9f93b675b12..00000000000
--- a/db/schema_migrations/20210826145509
+++ /dev/null
@@ -1 +0,0 @@
-661b2f03f2387f0d49cbb11c333ad29c6af5caed1f43e860fa0f263f8e7371c2 \ No newline at end of file
diff --git a/db/schema_migrations/20210826170902 b/db/schema_migrations/20210826170902
deleted file mode 100644
index f20877de3a5..00000000000
--- a/db/schema_migrations/20210826170902
+++ /dev/null
@@ -1 +0,0 @@
-97536098a2d3b127c6e6b9c079d10d272552dc9064f6b23fb92482baffaac7db \ No newline at end of file
diff --git a/db/schema_migrations/20230130125541 b/db/schema_migrations/20230130125541
new file mode 100644
index 00000000000..126cf47bb09
--- /dev/null
+++ b/db/schema_migrations/20230130125541
@@ -0,0 +1 @@
+a0efe869fb89bd1118bb19184ad47459d8eac8ac517f1fac80eebc7c7da387fc \ No newline at end of file
diff --git a/db/schema_migrations/20230130130624 b/db/schema_migrations/20230130130624
new file mode 100644
index 00000000000..f52a61e9450
--- /dev/null
+++ b/db/schema_migrations/20230130130624
@@ -0,0 +1 @@
+b56a8f0b3c32f29567a28fe2d21a41757365e16eb4cb98639c1ca288656491db \ No newline at end of file
diff --git a/db/schema_migrations/20230206143851 b/db/schema_migrations/20230206143851
new file mode 100644
index 00000000000..52c7753a7ac
--- /dev/null
+++ b/db/schema_migrations/20230206143851
@@ -0,0 +1 @@
+08ba891bbf1342addac1197cbbb13c539ba865928082c72b469c8fae26154728 \ No newline at end of file
diff --git a/db/schema_migrations/20230207143602 b/db/schema_migrations/20230207143602
new file mode 100644
index 00000000000..f7b6b5c106b
--- /dev/null
+++ b/db/schema_migrations/20230207143602
@@ -0,0 +1 @@
+5a74e84b0cb956fcd04d85cac572694788aef1a41b43280ad9fd911cb314ef8c \ No newline at end of file
diff --git a/db/schema_migrations/20230207143844 b/db/schema_migrations/20230207143844
new file mode 100644
index 00000000000..380ad3ec54d
--- /dev/null
+++ b/db/schema_migrations/20230207143844
@@ -0,0 +1 @@
+a2df7a3f9f3020294538a282f1ef8d365ac28026e7653c03a2bb1ec5c873f464 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 3827afa0a1a..204b2d4f40a 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -19811,6 +19811,28 @@ CREATE SEQUENCE pool_repositories_id_seq
ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id;
+CREATE TABLE postgres_async_foreign_key_validations (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ table_name text NOT NULL,
+ last_error text,
+ attempts integer DEFAULT 0 NOT NULL,
+ CONSTRAINT check_536a40afbf CHECK ((char_length(last_error) <= 10000)),
+ CONSTRAINT check_74fb7c8e57 CHECK ((char_length(name) <= 63)),
+ CONSTRAINT check_cd435d6301 CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE postgres_async_foreign_key_validations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE postgres_async_foreign_key_validations_id_seq OWNED BY postgres_async_foreign_key_validations.id;
+
CREATE TABLE postgres_async_indexes (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19818,7 +19840,10 @@ CREATE TABLE postgres_async_indexes (
name text NOT NULL,
definition text NOT NULL,
table_name text NOT NULL,
+ attempts integer DEFAULT 0 NOT NULL,
+ last_error text,
CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
+ CONSTRAINT check_45dc23c315 CHECK ((char_length(last_error) <= 10000)),
CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
CONSTRAINT check_e64ff4359e CHECK ((char_length(table_name) <= 63))
);
@@ -24723,6 +24748,8 @@ ALTER TABLE ONLY pm_packages ALTER COLUMN id SET DEFAULT nextval('pm_packages_id
ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass);
+ALTER TABLE ONLY postgres_async_foreign_key_validations ALTER COLUMN id SET DEFAULT nextval('postgres_async_foreign_key_validations_id_seq'::regclass);
+
ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('postgres_async_indexes_id_seq'::regclass);
ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);
@@ -26955,6 +26982,9 @@ ALTER TABLE ONLY pm_packages
ALTER TABLE ONLY pool_repositories
ADD CONSTRAINT pool_repositories_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY postgres_async_foreign_key_validations
+ ADD CONSTRAINT postgres_async_foreign_key_validations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY postgres_async_indexes
ADD CONSTRAINT postgres_async_indexes_pkey PRIMARY KEY (id);
@@ -30907,6 +30937,8 @@ CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btre
CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id);
+CREATE UNIQUE INDEX index_postgres_async_foreign_key_validations_on_name ON postgres_async_foreign_key_validations USING btree (name);
+
CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_indexes USING btree (name);
CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier);
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 83626d921f8..9bf303234f4 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -9111,28 +9111,28 @@ The edge type for [`ProductAnalyticsDashboard`](#productanalyticsdashboard).
| <a id="productanalyticsdashboardedgecursor"></a>`cursor` | [`String!`](#string) | A cursor for use in pagination. |
| <a id="productanalyticsdashboardedgenode"></a>`node` | [`ProductAnalyticsDashboard`](#productanalyticsdashboard) | The item at the end of the edge. |
-#### `ProductAnalyticsDashboardWidgetConnection`
+#### `ProductAnalyticsDashboardPanelConnection`
-The connection type for [`ProductAnalyticsDashboardWidget`](#productanalyticsdashboardwidget).
+The connection type for [`ProductAnalyticsDashboardPanel`](#productanalyticsdashboardpanel).
##### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
-| <a id="productanalyticsdashboardwidgetconnectionedges"></a>`edges` | [`[ProductAnalyticsDashboardWidgetEdge]`](#productanalyticsdashboardwidgetedge) | A list of edges. |
-| <a id="productanalyticsdashboardwidgetconnectionnodes"></a>`nodes` | [`[ProductAnalyticsDashboardWidget]`](#productanalyticsdashboardwidget) | A list of nodes. |
-| <a id="productanalyticsdashboardwidgetconnectionpageinfo"></a>`pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. |
+| <a id="productanalyticsdashboardpanelconnectionedges"></a>`edges` | [`[ProductAnalyticsDashboardPanelEdge]`](#productanalyticsdashboardpaneledge) | A list of edges. |
+| <a id="productanalyticsdashboardpanelconnectionnodes"></a>`nodes` | [`[ProductAnalyticsDashboardPanel]`](#productanalyticsdashboardpanel) | A list of nodes. |
+| <a id="productanalyticsdashboardpanelconnectionpageinfo"></a>`pageInfo` | [`PageInfo!`](#pageinfo) | Information to aid in pagination. |
-#### `ProductAnalyticsDashboardWidgetEdge`
+#### `ProductAnalyticsDashboardPanelEdge`
-The edge type for [`ProductAnalyticsDashboardWidget`](#productanalyticsdashboardwidget).
+The edge type for [`ProductAnalyticsDashboardPanel`](#productanalyticsdashboardpanel).
##### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
-| <a id="productanalyticsdashboardwidgetedgecursor"></a>`cursor` | [`String!`](#string) | A cursor for use in pagination. |
-| <a id="productanalyticsdashboardwidgetedgenode"></a>`node` | [`ProductAnalyticsDashboardWidget`](#productanalyticsdashboardwidget) | The item at the end of the edge. |
+| <a id="productanalyticsdashboardpaneledgecursor"></a>`cursor` | [`String!`](#string) | A cursor for use in pagination. |
+| <a id="productanalyticsdashboardpaneledgenode"></a>`node` | [`ProductAnalyticsDashboardPanel`](#productanalyticsdashboardpanel) | The item at the end of the edge. |
#### `ProjectConnection`
@@ -17552,32 +17552,32 @@ Represents a product analytics dashboard.
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="productanalyticsdashboarddescription"></a>`description` | [`String`](#string) | Description of the dashboard. |
+| <a id="productanalyticsdashboardpanels"></a>`panels` | [`ProductAnalyticsDashboardPanelConnection!`](#productanalyticsdashboardpanelconnection) | Panels shown on the dashboard. (see [Connections](#connections)) |
| <a id="productanalyticsdashboardtitle"></a>`title` | [`String!`](#string) | Title of the dashboard. |
-| <a id="productanalyticsdashboardwidgets"></a>`widgets` | [`ProductAnalyticsDashboardWidgetConnection!`](#productanalyticsdashboardwidgetconnection) | Widgets shown on the dashboard. (see [Connections](#connections)) |
-### `ProductAnalyticsDashboardVisualization`
+### `ProductAnalyticsDashboardPanel`
-Represents a product analytics dashboard visualization.
+Represents a product analytics dashboard panel.
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
-| <a id="productanalyticsdashboardvisualizationdata"></a>`data` | [`JSON!`](#json) | Data of the visualization. |
-| <a id="productanalyticsdashboardvisualizationoptions"></a>`options` | [`JSON!`](#json) | Options of the visualization. |
-| <a id="productanalyticsdashboardvisualizationtype"></a>`type` | [`String!`](#string) | Type of the visualization. |
+| <a id="productanalyticsdashboardpanelgridattributes"></a>`gridAttributes` | [`JSON`](#json) | Description of the position and size of the panel. |
+| <a id="productanalyticsdashboardpaneltitle"></a>`title` | [`String!`](#string) | Title of the panel. |
+| <a id="productanalyticsdashboardpanelvisualization"></a>`visualization` | [`ProductAnalyticsDashboardVisualization!`](#productanalyticsdashboardvisualization) | Visualization of the panel. |
-### `ProductAnalyticsDashboardWidget`
+### `ProductAnalyticsDashboardVisualization`
-Represents a product analytics dashboard widget.
+Represents a product analytics dashboard visualization.
#### Fields
| Name | Type | Description |
| ---- | ---- | ----------- |
-| <a id="productanalyticsdashboardwidgetgridattributes"></a>`gridAttributes` | [`JSON`](#json) | Description of the position and size of the widget. |
-| <a id="productanalyticsdashboardwidgettitle"></a>`title` | [`String!`](#string) | Title of the widget. |
-| <a id="productanalyticsdashboardwidgetvisualization"></a>`visualization` | [`ProductAnalyticsDashboardVisualization!`](#productanalyticsdashboardvisualization) | Visualization of the widget. |
+| <a id="productanalyticsdashboardvisualizationdata"></a>`data` | [`JSON!`](#json) | Data of the visualization. |
+| <a id="productanalyticsdashboardvisualizationoptions"></a>`options` | [`JSON!`](#json) | Options of the visualization. |
+| <a id="productanalyticsdashboardvisualizationtype"></a>`type` | [`String!`](#string) | Type of the visualization. |
### `Project`
diff --git a/doc/api/projects.md b/doc/api/projects.md
index d53c515bfbe..529e86d2c94 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -207,6 +207,7 @@ When the user is authenticated and `simple` is not set this returns something li
"security_and_compliance_access_level": "private",
"emails_disabled": null,
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 1,
"import_status": "none",
@@ -391,6 +392,7 @@ GET /users/:user_id/projects
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
@@ -502,6 +504,7 @@ GET /users/:user_id/projects
"archived": false,
"avatar_url": null,
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
@@ -653,6 +656,7 @@ Example response:
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
@@ -757,6 +761,7 @@ Example response:
"archived": false,
"avatar_url": null,
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
@@ -916,6 +921,7 @@ GET /projects/:id
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
@@ -1287,6 +1293,7 @@ curl --request POST --header "PRIVATE-TOKEN: <your-token>" \
| `resolve_outdated_diff_discussions` | boolean | **{dotted-circle}** No | Automatically resolve merge request diffs discussions on lines changed with a push. |
| `security_and_compliance_access_level` | string | **{dotted-circle}** No | (GitLab 14.9 and later) Security and compliance access level. One of `disabled`, `private`, or `enabled`. |
| `shared_runners_enabled` | boolean | **{dotted-circle}** No | Enable shared runners for this project. |
+| `group_runners_enabled` | boolean | **{dotted-circle}** No | Enable group runners for this project. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `squash_option` | string | **{dotted-circle}** No | One of `never`, `always`, `default_on`, or `default_off`. |
@@ -1371,6 +1378,7 @@ POST /projects/user/:user_id
| `resolve_outdated_diff_discussions` | boolean | **{dotted-circle}** No | Automatically resolve merge request diffs discussions on lines changed with a push. |
| `security_and_compliance_access_level` | string | **{dotted-circle}** No | (GitLab 14.9 and later) Security and compliance access level. One of `disabled`, `private`, or `enabled`. |
| `shared_runners_enabled` | boolean | **{dotted-circle}** No | Enable shared runners for this project. |
+| `group_runners_enabled` | boolean | **{dotted-circle}** No | Enable group runners for this project. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `issue_branch_template` | string | **{dotted-circle}** No | Template used to suggest names for [branches created from issues](../user/project/merge_requests/creating_merge_requests.md#from-an-issue). _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21243) in GitLab 15.6.)_ |
@@ -1481,6 +1489,7 @@ Supported attributes:
| `security_and_compliance_access_level` | string | **{dotted-circle}** No | (GitLab 14.9 and later) Security and compliance access level. One of `disabled`, `private`, or `enabled`. |
| `service_desk_enabled` | boolean | **{dotted-circle}** No | Enable or disable Service Desk feature. |
| `shared_runners_enabled` | boolean | **{dotted-circle}** No | Enable shared runners for this project. |
+| `group_runners_enabled` | boolean | **{dotted-circle}** No | Enable group runners for this project. |
| `snippets_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, or `enabled`. |
| `snippets_enabled` | boolean | **{dotted-circle}** No | _(Deprecated)_ Enable snippets for this project. Use `snippets_access_level` instead. |
| `issue_branch_template` | string | **{dotted-circle}** No | Template used to suggest names for [branches created from issues](../user/project/merge_requests/creating_merge_requests.md#from-an-issue). _([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/21243) in GitLab 15.6.)_ |
@@ -1600,6 +1609,7 @@ Example responses:
"archived": true,
"avatar_url": "http://example.com/uploads/project/avatar/3/uploads/avatar.png",
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 1,
"public_jobs": true,
@@ -1707,6 +1717,7 @@ Example response:
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 1,
"public_jobs": true,
@@ -1812,6 +1823,7 @@ Example response:
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"public_jobs": true,
@@ -2008,6 +2020,7 @@ Example response:
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
@@ -2136,6 +2149,7 @@ Example response:
"source_url": "http://www.gnu.org/licenses/lgpl-3.0.txt"
},
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8bc4a7a29eb76ea83cf79e4908c2b",
@@ -2819,6 +2833,7 @@ Example response:
"security_and_compliance_access_level": "enabled",
"emails_disabled": null,
"shared_runners_enabled": true,
+ "group_runners_enabled": true,
"lfs_enabled": true,
"creator_id": 2,
"import_status": "none",
diff --git a/doc/api/runners.md b/doc/api/runners.md
index 4f39eac0c7d..f791d727a51 100644
--- a/doc/api/runners.md
+++ b/doc/api/runners.md
@@ -739,9 +739,10 @@ Validates authentication credentials for a registered runner.
POST /runners/verify
```
-| Attribute | Type | Required | Description |
-|-------------|---------|----------|-------------------------------------------------------------------------------|
-| `token` | string | yes | The runner's [authentication token](#registration-and-authentication-tokens). |
+| Attribute | Type | Required | Description |
+|-------------|---------|----------|------------------------------------------------------------------------------------------------|
+| `token` | string | yes | The runner's [authentication token](#registration-and-authentication-tokens). |
+| `system_id` | string | no | The runner's system identifier. This attribute is required if the `token` starts with `glrt-`. |
```shell
curl --request POST "https://gitlab.example.com/api/v4/runners/verify" \
diff --git a/doc/architecture/blueprints/search/code_search_with_zoekt.md b/doc/architecture/blueprints/search/code_search_with_zoekt.md
new file mode 100644
index 00000000000..d0d347f1ff4
--- /dev/null
+++ b/doc/architecture/blueprints/search/code_search_with_zoekt.md
@@ -0,0 +1,305 @@
+---
+status: ongoing
+creation-date: "2022-12-28"
+authors: [ "@dgruzd", "@DylanGriffith" ]
+coach: "@DylanGriffith"
+approvers: [ "@joshlambert", "@changzhengliu" ]
+owning-stage: "~devops::enablement"
+participating-stages: []
+---
+
+# Use Zoekt For code search
+
+## Summary
+
+We will be implementing an additional code search functionality in GitLab that
+is backed by [Zoekt](https://github.com/sourcegraph/zoekt), an open source
+search engine that is specifically designed for code search. Zoekt will be used as
+an API by GitLab and remain an implementation detail while the user interface
+in GitLab will not change much except for some new features made available by
+Zoekt.
+
+This will be rolled out in phases to ensure that the system will actually meet
+our scaling and cost expectations and will run alongside code search backed by
+Elasticsearch until we can be sure it is a viable replacement. The first step
+will be making it available for `gitlab-org` for internal and expanding
+customer by customer based on customer interest.
+
+## Motivation
+
+GitLab code search functionality today is backed by Elasticsearch.
+Elasticsearch has proven useful for other types of search (issues, merge
+requests, comments and so-on) but is by design not a good choice for code
+search where users expect matches to be precise (ie. no false positives) and
+flexible (e.g. support
+[substring matching](https://gitlab.com/gitlab-org/gitlab/-/issues/325234)
+and
+[regexes](https://gitlab.com/gitlab-org/gitlab/-/issues/4175)). We have
+[investigated our options](https://gitlab.com/groups/gitlab-org/-/epics/7404)
+and [Zoekt](https://github.com/sourcegraph/zoekt) is pretty much the only well
+maintained open source technology that is suited to code search. Based on our
+research we believe it will be better to adopt a well maintained open source
+database than attempt to build our own. This is mostly due to the fact that our
+research indicates that the fundamental architecture of Zoekt is what we would
+implement again if we tried to implement something ourselves.
+
+Our
+[early benchmarking](https://gitlab.com/gitlab-org/gitlab/-/issues/370832#note_1183611955)
+suggests that Zoekt will be viable at our scale, but we feel strongly
+that investing in building a beta integration with Zoekt and rolling it out
+group by group on GitLab.com will provide better insights into scalability and
+cost than more accurate benchmarking efforts. It will also be relatively low
+risk as it will be rolled out internally first and later rolled out to
+customers that wish to participate in the trial.
+
+### Goals
+
+The main goals of this integration will be to implement the following highly
+requested improvements to code search:
+
+1. [Exact match (substring match) code searches in Advanced Search](https://gitlab.com/gitlab-org/gitlab/-/issues/325234)
+1. [Support regular expressions with Advanced Global Search](https://gitlab.com/gitlab-org/gitlab/-/issues/4175)
+1. [Support multiple line matches in the same file](https://gitlab.com/gitlab-org/gitlab/-/issues/668)
+
+The initial phases of the rollout will be designed to catch and resolve scaling
+or infrastructure cost issues as early as possible so that we can pivot early
+before investing too much in this technology if it is not suitable.
+
+### Non-Goals
+
+The following are not goals initially but could theoretically be built upon
+this solution:
+
+1. Improving security scanning features by having access to quickly perform
+ regex scans across many repositories
+1. Saving money on our search infrastructure - this may be possible with
+ further optimizations, but initial estimates suggest the cost is similar
+1. AI/ML features of search used to predict what users might be interested in
+ finding
+1. Code Intelligence and Navigation - likely code intelligence and navigation
+ features should be built on structured data rather than a trigram index but
+ regex based searches (using Zoekt) may be a suitable fallback for code which
+ does not have structured metadata enabled or dynamic languages where static
+ analysis is not very accurate. Zoekt in particular may not be well suited
+ initially, despite existing symbol extraction using ctags, because ctags
+ symbols may not contain enough data for accurate navigation and Zoekt
+ doesn't undersand dependencies which would be necessary for cross-project
+ navigation.
+
+## Proposal
+
+An
+[initial implementation of a Zoekt integration](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105049)
+was created to demonstrate the feasibility of using Zoekt as a drop-in
+replacement for Elasticsearch code searches. This blueprint will extend on all
+the details needed to provide a minimum viable change as well steps needed to
+scale this to a larger customer rollout on GitLab.com.
+
+## Design and implementation details
+
+### User Experience
+
+When a user performs an advanced search on a group or project that is part
+of the Zoekt rollout we will present a toggle somewhere in the UI to change
+to "precise search" (or some other UX TBD) which switches them from
+Elasticsearch to Zoekt. Early user feedback will help us assess the best way
+to present these choices to users and ultimately we will want to remove the
+Elasticsearch option if we find Zoekt is a suitable long term option.
+
+### Indexing
+
+Similar to our Elasticsearch integration, GitLab will notify Zoekt every time
+there are updates to a repository. Zoekt, unlike Elasticsearch, is designed to
+clone and index Git repositories so we will simply notify Zoekt of the URL of
+the repository that has changed and it will update its local copy of the Git
+repo and then update its local index files. The Zoekt side of this logic will
+be implemented in a new server-side indexing endpoint we add to Zoekt which is
+currently in
+[an open Pull request](https://github.com/sourcegraph/zoekt/pull/496).
+While the details of
+this pull request are still being debated, we may choose to deploy a fork with
+the functionality we need, but our strongest intention is not to maintain a
+fork of Zoekt and the maintainers have already expressed they are open to this
+new functionality.
+
+The rails side of the integration will be a Sidekiq worker that is scheduled
+every time there is an update to a repository and it will simply call this
+`/index` endpoint in Zoekt. This will also need to generate a one-time token
+that can allow Zoekt to clone a private repository.
+
+```mermaid
+sequenceDiagram
+ participant user as User
+ participant gitlab_git as GitLab Git
+ participant gitlab_sidekiq as GitLab Sidekiq
+ participant zoekt as Zoekt
+ user->>gitlab_git: git push git@gitlab.com:gitlab-org/gitlab.git
+ gitlab_git->>gitlab_sidekiq: ZoektIndexerWorker.perform_async(278964)
+ gitlab_sidekiq->>zoekt: POST /index {"RepoUrl":"https://zoekt:SECRET_TOKEN@gitlab.com/gitlab-org/gitlab.git","RepoId":278964}'
+ zoekt->>gitlab_git: git clone https://zoekt:SECRET_TOKEN@gitlab.com/gitlab-org/gitlab.git
+```
+
+The Sidekiq worker can leverage de-duplication based on the `project_id`.
+
+Zoekt supports indexing multiple projects we'll likely need to, eventually,
+allow a way for users to configure additional branches (beyond the default
+branch) and this will need to be sent to Zoekt. We will need to decide if these
+branch lists are sent every time we index the project or only when they change
+configuration.
+
+There may be race conditions with multiple Zoekt processes indexing the same
+repo at the same time. For this reason we should implement a locking mechanism
+somewhere to ensure we are only indexing 1 project in 1 place at a time. We
+could make use of the same Redis locking we use for indexing projects in
+Elasticsearch.
+
+### Searching
+
+Searching will be implemented using the `/api/search` functionality in
+Zoekt. There is also
+[an open PR to fix this endpoint in Zoekt](https://github.com/sourcegraph/zoekt/pull/506),
+and again we may consider working from a fork until this is fixed. GitLab will
+prepend all searches with the appropriate filter for repositories based on the
+user's search context (group or project) in the same way we do for
+Elasticsearch. For Zoekt this will be implemented as a query string regex that
+matches all the searched repositories.
+
+### Zoekt infrastructure
+
+Each Zoekt node will need to run a
+[zoekt-dynamic-indexserver](https://github.com/sourcegraph/zoekt/pull/496) and
+a
+[zoekt-webserver](https://github.com/sourcegraph/zoekt/blob/main/cmd/zoekt-webserver/main.go).
+These are both webservers with different responsibilities. Considering that the
+Zoekt indexing process needs to keep a full clone of the bare repo
+([unless we come up with a better option](https://gitlab.com/gitlab-org/gitlab/-/issues/384722))
+these bare repos will be stored on spinning disks to save space. These are only
+used as an intermediate step to generate the actual `.zoekt` index files which
+will be stored on an SSD for fast searches. These web servers need to run on
+the same node as they access the same files. The `zoekt-dynamic-indexserver` is
+responsible for writing the `.zoekt` index files. The `zoekt-webserver` is
+responsible for responding to searches that it performs by reading these
+`.zoekt` index files.
+
+### Rollout strategy
+
+Initially Zoekt code search will only be available to `gitlab-org`. After that
+we'll start rolling it out to specific customers that have requested better
+code search experience. As we learn about scaling and make improvements we will
+gradually roll it out to all licensed groups on GitLab.com. We will use a
+similar approach to Elasticsearch for keeping track of which groups are indexed
+and which are not. This will be based on a new table `zoekt_indexed_namespaces`
+with a `namespace_id` reference. We will only allow rolling out to top level
+namespaces to simplify the logic of checking for all layers of group
+inheritance. Once we've rolled out to all licensed groups we'll enable logic to
+automatically enroll newly licensed groups. This table also may be a place to
+store per-namespace sharding and replication data as described below.
+
+### Sharding and replication strategy
+
+Zoekt does not have any inbuilt sharding, and we expect that we'll need
+multiple Zoekt servers to reach the scale to provide search functionality to
+all of GitLab licensed customers.
+
+There are 2 clear ways to implement sharding:
+
+1. Build it on top of, or in front of Zoekt, as an independent component. Building
+ all the complexities of a distributed database into Zoekt is not likely to
+ be a good direction for the project so most likely this would be an
+ independent piece of infrastructure that proxied requests to the correct
+ shard.
+1. Manage the shards inside GitLab. This would be an application layer in
+ GitLab which chooses the correct shard to send indexing and search requests
+ to.
+
+Likewise, there are a few ways to implement replication:
+
+1. Server-side where Zoekt replicas are aware of other Zoekt replicas and they
+ stream updates from some primary to remain in sync
+1. Client-side replication where clients send indexing requests to all replicas
+ and search requests to any replica
+
+We plan to implement sharding inside GitLab application but replication may be
+best served at the level of the filesystem of Zoekt servers rather than sending
+duplicated updates from GitLab to all replicas. This could be some process on
+Zoekt servers that monitors for changes to the `.zoekt` files in a specific
+directory and syncs those updates to the replicas. This will need to be
+slightly more sophisticated than `rsync` because the files are constantly
+changing and files may be getting deleted while the sync is happening so we
+would want to be syncing the updates in batches somehow without slowing down
+indexing.
+
+Implementing sharding in GitLab simplifies the additional infrastructure
+components that need to be deployed and allows more flexibility to control our
+rollout to many customers alongside our rollout of multiple shards.
+
+Implementing syncing from primary -> replica on Zoekt nodes at the filesystem
+level optimizes that overall resource usage. We only need to sync the index
+files to replicas as the bare repo is just a cache. This saves on:
+
+1. Disk space on replicas
+1. CPU usage on replicas as it does not need to rebuild the index
+1. Load on Gitaly to clone the repos
+
+We plan to defer the implementation of these high availability aspects until
+later, but a preliminary plan would be:
+
+1. GitLab is configured with a pool of Zoekt servers
+1. GitLab assigns groups randomly a Zoekt primary server
+1. There will also be Zoekt replica servers
+1. Periodically Zoekt primary servers will sync their `.zoekt` index files to
+ their respective replicas
+1. There will need to be some process by which to promote a replica to a
+ primary if the primary is having issues. We will be using Consul for
+ keeping track of which is the primary and which are the replicas.
+1. When indexing a project GitLab will queue a Sidekiq job to update the index
+ on the primary
+1. When searching we will randomly select one of the Zoekt primaries or replica
+ servers for the group being searched. We don't care which is "more up to
+ date" as code search will be "eventually consistent" and all reads may read
+ slightly out of date indexes. We will have a target of maximum latency of
+ index updates and may consider removing nodes from rotation if they are too
+ far out of date.
+1. We will shard everything by top level group as this ensures group search can
+ always search a single Zoekt server. Aggregation may be possible for global
+ searches at some point in future if this turns out to be important. Smaller
+ self-managed instances may use a single Zoekt server allowing global
+ searches to work without any aggregation being implemented. Depending on our
+ largest group sizes and scaling limitations of a single node Zoekt server we
+ may consider implementing an approach where a group can be assigned multiple
+ shards.
+
+The downside of the chosen path will be added complexity of managing all these
+Zoekt servers from GitLab when compared with a "proxy" layer outside of GitLab
+that is managing all of these shards. We will consider this decision a work in
+progress and reassess if it turns out to add too much complexity to GitLab.
+
+#### Sharding proposal using GitLab `::Zoekt::Shard` model
+
+This is already implemented as the `::Zoekt::IndexedNamespace`
+implements a many-to-many relationship between namespaces and shards.
+
+#### Replication and service discovery using Consul
+
+If we plan to replicate at the Zoekt node level as described above we need to
+change our data model to use a one-to-many relationship from `zoekt_shards ->
+namespaces`. This means making the `namespace_id` column unique in
+`zoekt_indexed_namespaces`. Then we need to implement a service discovery
+approach where the `index_url` always points at a primary Zoekt node and the
+`search_url` is a DNS record with N replicas and the primary. We then choose
+randomly from `search_url` records when searching.
+
+### Iterations
+
+1. Make available for `gitlab-org`
+1. Improve monitoring
+1. Improve performance
+1. Make available for select customers
+1. Implement sharding
+1. Implement replication
+1. Make available to many more licensed groups
+1. Implement automatic (re)balancing of shards
+1. Estimate costs for rolling out to all licensed groups and decide if it's worth it or if we need to optimize further or adjust our plan
+1. Rollout to all licensed groups
+1. Improve performance
+1. Assess costs and decide whether we should roll out to all free customers
diff --git a/doc/development/fe_guide/customizable_dashboards.md b/doc/development/fe_guide/customizable_dashboards.md
index 62dd974cccb..26c73b26126 100644
--- a/doc/development/fe_guide/customizable_dashboards.md
+++ b/doc/development/fe_guide/customizable_dashboards.md
@@ -19,7 +19,7 @@ To use customizable dashboards:
1. Create your dashboard component.
1. Render an instance of `CustomizableDashboard`.
-1. Pass a list of widgets to render.
+1. Pass a list of panels to render.
For example, a customizable dashboard for users over time:
@@ -35,10 +35,10 @@ export default {
},
data() {
return {
- widgets: [
+ panels: [
{
- component: 'CubeLineChart', // The name of the widget component.
- title: s__('ProductAnalytics|Users / Time'), // The title shown on the widget component.
+ component: 'CubeLineChart', // The name of the panel component.
+ title: s__('ProductAnalytics|Users / Time'), // The title shown on the panel component.
// Gridstack settings based upon https://github.com/gridstack/gridstack.js/tree/master/doc#item-options.
// All values are grid row/column numbers up to 12.
// We use the default 12 column grid https://github.com/gridstack/gridstack.js#change-grid-columns.
@@ -50,17 +50,17 @@ export default {
xPos: 0,
yPos: 0,
},
- // Options that are used to set bespoke values for each widget.
- // Available customizations are determined by the widget itself.
+ // Options that are used to set bespoke values for each panel.
+ // Available customizations are determined by the panel itself.
customizations: {},
- // Chart options defined by the charting library being used by the widget.
+ // Chart options defined by the charting library being used by the panel.
chartOptions: {
xAxis: { name: __('Time'), type: 'time' },
yAxis: { name: __('Counts') },
},
- // The data for the widget.
- // This could be imported or in this case, a query passed to be used by the widgets API.
- // Each widget type determines how it handles this property.
+ // The data for the panel.
+ // This could be imported or in this case, a query passed to be used by the panels API.
+ // Each panel type determines how it handles this property.
data: {
query: {
users: {
@@ -78,20 +78,20 @@ export default {
<template>
<h1>{{ s__('ProductAnalytics|Analytics dashboard') }}</h1>
- <customizable-dashboard :widgets="widgets" />
+ <customizable-dashboard :panels="panels" />
</template>
```
-The widgets data can be retrieved from a file or API request, or imported through HTML data attributes.
+The panels data can be retrieved from a file or API request, or imported through HTML data attributes.
-For each widget, a `component` is defined. Each `component` is a component declaration and should be included in
-[`vue_shared/components/customizable_dashboard/widgets_base.vue`](https://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/assets/javascripts/vue_shared/components/customizable_dashboard/widgets_base.vue)
+For each panel, a `component` is defined. Each `component` is a component declaration and should be included in
+[`vue_shared/components/customizable_dashboard/panels_base.vue`](https://gitlab.com/gitlab-org/gitlab/blob/master/ee/app/assets/javascripts/vue_shared/components/customizable_dashboard/panels_base.vue)
as a dynamic import, to keep the memory usage down until it is used.
For example:
```javascript
components: {
- CubeLineChart: () => import('ee/product_analytics/dashboards/components/widgets/cube_line_chart.vue')
+ CubeLineChart: () => import('ee/product_analytics/dashboards/components/panels/cube_line_chart.vue')
}
```
diff --git a/doc/user/application_security/vulnerability_report/index.md b/doc/user/application_security/vulnerability_report/index.md
index 58607ac4727..e6353264f39 100644
--- a/doc/user/application_security/vulnerability_report/index.md
+++ b/doc/user/application_security/vulnerability_report/index.md
@@ -202,7 +202,7 @@ Fields included are:
- Other identifiers
- Detected At
- Location
-- Activity
+- Activity: Returns `true` if the vulnerability is resolved on the default branch, and `false` if not.
- Comments
NOTE:
diff --git a/lib/api/ci/helpers/runner.rb b/lib/api/ci/helpers/runner.rb
index be4d82bc500..fddbfa735e3 100644
--- a/lib/api/ci/helpers/runner.rb
+++ b/lib/api/ci/helpers/runner.rb
@@ -23,10 +23,17 @@ module API
return get_runner_ip unless params['info'].present?
attributes_for_keys(%w(name version revision platform architecture executor), params['info'])
+ .merge(get_system_id_from_request)
.merge(get_runner_config_from_request)
.merge(get_runner_ip)
end
+ def get_system_id_from_request
+ return { system_id: params[:system_id] } if params.include?(:system_id)
+
+ {}
+ end
+
def get_runner_ip
{ ip_address: ip_address }
end
@@ -43,6 +50,15 @@ module API
end
end
+ def current_runner_machine
+ return if Feature.disabled?(:create_runner_machine)
+ return unless params[:system_id]
+
+ strong_memoize(:current_runner_machine) do
+ current_runner.ensure_machine(machine_xid: params[:system_id]) { |m| m.contacted_at = Time.current }
+ end
+ end
+
def track_runner_authentication
if current_runner
metrics.increment_runner_authentication_success_counter(runner_type: current_runner.runner_type)
diff --git a/lib/api/ci/runner.rb b/lib/api/ci/runner.rb
index 6b4394114df..ebe66f0a7be 100644
--- a/lib/api/ci/runner.rb
+++ b/lib/api/ci/runner.rb
@@ -115,6 +115,7 @@ module API
end
params do
requires :token, type: String, desc: %q(Runner's authentication token)
+ optional :system_id, type: String, desc: %q(Runner's system identifier)
optional :last_update, type: String, desc: %q(Runner's queue last_update token)
optional :info, type: Hash, desc: %q(Runner's metadata) do
optional :name, type: String, desc: %q(Runner's name)
@@ -166,7 +167,7 @@ module API
end
new_update = current_runner.ensure_runner_queue_value
- result = ::Ci::RegisterJobService.new(current_runner).execute(runner_params)
+ result = ::Ci::RegisterJobService.new(current_runner, current_runner_machine).execute(runner_params)
if result.valid?
if result.build_json
diff --git a/lib/api/entities/project.rb b/lib/api/entities/project.rb
index 37be6903d8b..fcb7ddb9567 100644
--- a/lib/api/entities/project.rb
+++ b/lib/api/entities/project.rb
@@ -88,6 +88,7 @@ module API
expose :emails_disabled, documentation: { type: 'boolean' }
expose :shared_runners_enabled, documentation: { type: 'boolean' }
+ expose :group_runners_enabled, documentation: { type: 'boolean' }
expose :lfs_enabled?, as: :lfs_enabled, documentation: { type: 'boolean' }
expose :creator_id, documentation: { type: 'integer', example: 1 }
expose :forked_from_project, using: Entities::BasicProjectDetails, if: ->(project, options) do
diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb
index 820ad2e9b33..2700ea90d59 100644
--- a/lib/api/helpers/projects_helpers.rb
+++ b/lib/api/helpers/projects_helpers.rb
@@ -48,6 +48,7 @@ module API
optional :warn_about_potentially_unwanted_characters, type: Boolean, desc: 'Warn about Potentially Unwanted Characters'
optional :enforce_auth_checks_on_uploads, type: Boolean, desc: 'Enforce auth check on uploads'
optional :shared_runners_enabled, type: Boolean, desc: 'Flag indication if shared runners are enabled for that project'
+ optional :group_runners_enabled, type: Boolean, desc: 'Flag indication if group runners are enabled for that project'
optional :resolve_outdated_diff_discussions, type: Boolean, desc: 'Automatically resolve merge request diff threads on lines changed with a push'
optional :remove_source_branch_after_merge, type: Boolean, desc: 'Remove the source branch by default after merge'
optional :container_registry_enabled, type: Boolean, desc: 'Deprecated: Use :container_registry_access_level instead. Flag indication if the container registry is enabled for that project'
@@ -170,6 +171,7 @@ module API
:security_and_compliance_access_level,
:squash_option,
:shared_runners_enabled,
+ :group_runners_enabled,
:snippets_access_level,
:tag_list,
:topics,
diff --git a/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2.rb b/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2.rb
deleted file mode 100644
index 669e5338dd1..00000000000
--- a/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-# Based on https://community.developer.atlassian.com/t/get-rest-api-3-filter-search/29459/2,
-# it's enough at the moment to simply notice if the url is from `atlassian.net`
-module Gitlab
- module BackgroundMigration
- # Backfill the deployment_type in jira_tracker_data table
- class BackfillJiraTrackerDeploymentType2
- # Migration only version of jira_tracker_data table
- class JiraTrackerDataTemp < ApplicationRecord
- self.table_name = 'jira_tracker_data'
-
- def self.encryption_options
- {
- key: Settings.attr_encrypted_db_key_base_32,
- encode: true,
- mode: :per_attribute_iv,
- algorithm: 'aes-256-gcm'
- }
- end
-
- attr_encrypted :url, encryption_options
- attr_encrypted :api_url, encryption_options
-
- enum deployment_type: { unknown: 0, server: 1, cloud: 2 }, _prefix: :deployment
- end
-
- # Migration only version of services table
- class JiraServiceTemp < ApplicationRecord
- self.table_name = 'services'
- self.inheritance_column = :_type_disabled
- end
-
- def perform(start_id, stop_id)
- @server_ids = []
- @cloud_ids = []
-
- JiraTrackerDataTemp
- .where(id: start_id..stop_id, deployment_type: 0)
- .each do |jira_tracker_data|
- collect_deployment_type(jira_tracker_data)
- end
-
- unless cloud_ids.empty?
- JiraTrackerDataTemp.where(id: cloud_ids)
- .update_all(deployment_type: JiraTrackerDataTemp.deployment_types[:cloud])
- end
-
- unless server_ids.empty?
- JiraTrackerDataTemp.where(id: server_ids)
- .update_all(deployment_type: JiraTrackerDataTemp.deployment_types[:server])
- end
-
- mark_jobs_as_succeeded(start_id, stop_id)
- end
-
- private
-
- attr_reader :server_ids, :cloud_ids
-
- def client_url(jira_tracker_data)
- jira_tracker_data.api_url.presence || jira_tracker_data.url.presence
- end
-
- def server_type(url)
- url.downcase.include?('.atlassian.net') ? :cloud : :server
- end
-
- def collect_deployment_type(jira_tracker_data)
- url = client_url(jira_tracker_data)
- return unless url
-
- case server_type(url)
- when :cloud
- cloud_ids << jira_tracker_data.id
- else
- server_ids << jira_tracker_data.id
- end
- end
-
- def mark_jobs_as_succeeded(*arguments)
- Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(self.class.name.demodulize, arguments)
- end
- end
- end
-end
diff --git a/lib/gitlab/ci/variables/builder.rb b/lib/gitlab/ci/variables/builder.rb
index 8e18d57b724..89d681c418d 100644
--- a/lib/gitlab/ci/variables/builder.rb
+++ b/lib/gitlab/ci/variables/builder.rb
@@ -8,6 +8,7 @@ module Gitlab
def initialize(pipeline)
@pipeline = pipeline
+ @pipeline_variables_builder = Builder::Pipeline.new(pipeline)
@instance_variables_builder = Builder::Instance.new
@project_variables_builder = Builder::Project.new(project)
@group_variables_builder = Builder::Group.new(project&.group)
@@ -18,7 +19,7 @@ module Gitlab
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.concat(predefined_variables(job))
variables.concat(project.predefined_variables)
- variables.concat(pipeline.predefined_variables)
+ variables.concat(pipeline_variables_builder.predefined_variables)
variables.concat(job.runner.predefined_variables) if job.runnable? && job.runner
variables.concat(kubernetes_variables(environment: environment, job: job))
variables.concat(job.yaml_variables)
@@ -38,7 +39,7 @@ module Gitlab
break variables unless project
variables.concat(project.predefined_variables)
- variables.concat(pipeline.predefined_variables)
+ variables.concat(pipeline_variables_builder.predefined_variables)
variables.concat(secret_instance_variables)
variables.concat(secret_group_variables(environment: nil))
variables.concat(secret_project_variables(environment: nil))
@@ -117,6 +118,7 @@ module Gitlab
private
attr_reader :pipeline
+ attr_reader :pipeline_variables_builder
attr_reader :instance_variables_builder
attr_reader :project_variables_builder
attr_reader :group_variables_builder
diff --git a/lib/gitlab/ci/variables/builder/pipeline.rb b/lib/gitlab/ci/variables/builder/pipeline.rb
new file mode 100644
index 00000000000..96d6f1673b9
--- /dev/null
+++ b/lib/gitlab/ci/variables/builder/pipeline.rb
@@ -0,0 +1,120 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Ci
+ module Variables
+ class Builder
+ class Pipeline
+ include Gitlab::Utils::StrongMemoize
+
+ def initialize(pipeline)
+ @pipeline = pipeline
+ end
+
+ def predefined_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables.append(key: 'CI_PIPELINE_IID', value: pipeline.iid.to_s)
+ variables.append(key: 'CI_PIPELINE_SOURCE', value: pipeline.source.to_s)
+ variables.append(key: 'CI_PIPELINE_CREATED_AT', value: pipeline.created_at&.iso8601)
+
+ variables.concat(predefined_commit_variables) if pipeline.sha.present?
+ variables.concat(predefined_commit_tag_variables) if pipeline.tag?
+ variables.concat(predefined_merge_request_variables) if pipeline.merge_request?
+
+ if pipeline.open_merge_requests_refs.any?
+ variables.append(key: 'CI_OPEN_MERGE_REQUESTS', value: pipeline.open_merge_requests_refs.join(','))
+ end
+
+ variables.append(key: 'CI_GITLAB_FIPS_MODE', value: 'true') if Gitlab::FIPS.enabled?
+
+ variables.append(key: 'CI_KUBERNETES_ACTIVE', value: 'true') if pipeline.has_kubernetes_active?
+ variables.append(key: 'CI_DEPLOY_FREEZE', value: 'true') if pipeline.freeze_period?
+
+ if pipeline.external_pull_request_event? && pipeline.external_pull_request
+ variables.concat(pipeline.external_pull_request.predefined_variables)
+ end
+ end
+ end
+
+ private
+
+ attr_reader :pipeline
+
+ def predefined_commit_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ next variables unless pipeline.sha.present?
+
+ variables.append(key: 'CI_COMMIT_SHA', value: pipeline.sha)
+ variables.append(key: 'CI_COMMIT_SHORT_SHA', value: pipeline.short_sha)
+ variables.append(key: 'CI_COMMIT_BEFORE_SHA', value: pipeline.before_sha)
+ variables.append(key: 'CI_COMMIT_REF_NAME', value: pipeline.source_ref)
+ variables.append(key: 'CI_COMMIT_REF_SLUG', value: pipeline.source_ref_slug)
+ variables.append(key: 'CI_COMMIT_BRANCH', value: pipeline.ref) if pipeline.branch?
+ variables.append(key: 'CI_COMMIT_MESSAGE', value: pipeline.git_commit_message.to_s)
+ variables.append(key: 'CI_COMMIT_TITLE', value: pipeline.git_commit_full_title.to_s)
+ variables.append(key: 'CI_COMMIT_DESCRIPTION', value: pipeline.git_commit_description.to_s)
+ variables.append(key: 'CI_COMMIT_REF_PROTECTED', value: (!!pipeline.protected_ref?).to_s)
+ variables.append(key: 'CI_COMMIT_TIMESTAMP', value: pipeline.git_commit_timestamp.to_s)
+ variables.append(key: 'CI_COMMIT_AUTHOR', value: pipeline.git_author_full_text.to_s)
+
+ variables.concat(legacy_predefined_commit_variables)
+ end
+ end
+ strong_memoize_attr :predefined_commit_variables
+
+ def legacy_predefined_commit_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables.append(key: 'CI_BUILD_REF', value: pipeline.sha)
+ variables.append(key: 'CI_BUILD_BEFORE_SHA', value: pipeline.before_sha)
+ variables.append(key: 'CI_BUILD_REF_NAME', value: pipeline.source_ref)
+ variables.append(key: 'CI_BUILD_REF_SLUG', value: pipeline.source_ref_slug)
+ end
+ end
+ strong_memoize_attr :legacy_predefined_commit_variables
+
+ def predefined_commit_tag_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ git_tag = pipeline.project.repository.find_tag(pipeline.ref)
+
+ next variables unless git_tag
+
+ variables.append(key: 'CI_COMMIT_TAG', value: pipeline.ref)
+ variables.append(key: 'CI_COMMIT_TAG_MESSAGE', value: git_tag.message)
+
+ variables.concat(legacy_predefined_commit_tag_variables)
+ end
+ end
+ strong_memoize_attr :predefined_commit_tag_variables
+
+ def legacy_predefined_commit_tag_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables.append(key: 'CI_BUILD_TAG', value: pipeline.ref)
+ end
+ end
+ strong_memoize_attr :legacy_predefined_commit_tag_variables
+
+ def predefined_merge_request_variables
+ Gitlab::Ci::Variables::Collection.new.tap do |variables|
+ variables.append(key: 'CI_MERGE_REQUEST_EVENT_TYPE', value: pipeline.merge_request_event_type.to_s)
+ variables.append(key: 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA', value: pipeline.source_sha.to_s)
+ variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA', value: pipeline.target_sha.to_s)
+
+ if merge_request_diff.present?
+ variables.append(key: 'CI_MERGE_REQUEST_DIFF_ID', value: merge_request_diff.id.to_s)
+ variables.append(key: 'CI_MERGE_REQUEST_DIFF_BASE_SHA', value: merge_request_diff.base_commit_sha)
+ end
+
+ variables.concat(pipeline.merge_request.predefined_variables)
+ end
+ end
+ strong_memoize_attr :predefined_merge_request_variables
+
+ def merge_request_diff
+ pipeline.merge_request_diff
+ end
+ strong_memoize_attr :merge_request_diff
+ end
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb b/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb
new file mode 100644
index 00000000000..76403f9a643
--- /dev/null
+++ b/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Database
+ module AsyncForeignKeys
+ class PostgresAsyncForeignKeyValidation < SharedModel
+ self.table_name = 'postgres_async_foreign_key_validations'
+
+ MAX_IDENTIFIER_LENGTH = Gitlab::Database::MigrationHelpers::MAX_IDENTIFIER_NAME_LENGTH
+ MAX_LAST_ERROR_LENGTH = 10_000
+
+ validates :name, presence: true, uniqueness: true, length: { maximum: MAX_IDENTIFIER_LENGTH }
+ validates :table_name, presence: true, length: { maximum: MAX_IDENTIFIER_LENGTH }
+ validates :last_error, length: { maximum: MAX_LAST_ERROR_LENGTH }
+
+ scope :ordered, -> { order(attempts: :asc, id: :asc) }
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/database/async_indexes.rb b/lib/gitlab/database/async_indexes.rb
index 6f301a66803..581c7e7ff94 100644
--- a/lib/gitlab/database/async_indexes.rb
+++ b/lib/gitlab/database/async_indexes.rb
@@ -16,6 +16,15 @@ module Gitlab
IndexDestructor.new(async_index).perform
end
end
+
+ def self.execute_pending_actions!(how_many: DEFAULT_INDEXES_PER_INVOCATION)
+ queue_ids = PostgresAsyncIndex.ordered.limit(how_many).pluck(:id)
+ removal_actions = PostgresAsyncIndex.where(id: queue_ids).to_drop.ordered
+ creation_actions = PostgresAsyncIndex.where(id: queue_ids).to_create.ordered
+
+ removal_actions.each { |async_index| IndexDestructor.new(async_index).perform }
+ creation_actions.each { |async_index| IndexCreator.new(async_index).perform }
+ end
end
end
end
diff --git a/lib/gitlab/database/async_indexes/index_base.rb b/lib/gitlab/database/async_indexes/index_base.rb
new file mode 100644
index 00000000000..2891618e978
--- /dev/null
+++ b/lib/gitlab/database/async_indexes/index_base.rb
@@ -0,0 +1,90 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Database
+ module AsyncIndexes
+ class IndexBase
+ include IndexingExclusiveLeaseGuard
+ extend ::Gitlab::Utils::Override
+
+ TIMEOUT_PER_ACTION = 1.day
+
+ def initialize(async_index)
+ @async_index = async_index
+ end
+
+ def perform
+ try_obtain_lease do
+ if preconditions_met?
+ log_index_info("Starting async index #{action_type}")
+ execute_action_with_error_handling
+ log_index_info("Finished async index #{action_type}")
+ else
+ log_index_info(skip_log_message)
+ async_index.destroy!
+ end
+ end
+ end
+
+ private
+
+ attr_reader :async_index
+
+ delegate :connection, to: :async_index
+
+ def preconditions_met?
+ raise NotImplementedError, 'must implement preconditions_met?'
+ end
+
+ def action_type
+ raise NotImplementedError, 'must implement action_type'
+ end
+
+ def execute_action_with_error_handling
+ around_execution { execute_action }
+ rescue StandardError => error
+ async_index.handle_exception!(error)
+
+ Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error)
+ Gitlab::AppLogger.error(message: error.message, **logging_options)
+ end
+
+ def around_execution
+ yield
+ end
+
+ def execute_action
+ connection.execute(async_index.definition)
+ async_index.destroy!
+ end
+
+ def index_exists?
+ connection.indexes(async_index.table_name).any? do |index|
+ index.name == async_index.name
+ end
+ end
+
+ def lease_timeout
+ TIMEOUT_PER_ACTION
+ end
+
+ def log_index_info(message)
+ Gitlab::AppLogger.info(message: message, **logging_options)
+ end
+
+ def skip_log_message
+ "Skipping index #{action_type} since preconditions are not met. " \
+ "The queuing entry will be deleted"
+ end
+
+ def logging_options
+ {
+ table_name: async_index.table_name,
+ index_name: async_index.name,
+ class: self.class.name.to_s
+ }
+ end
+ end
+ end
+ end
+end
diff --git a/lib/gitlab/database/async_indexes/index_creator.rb b/lib/gitlab/database/async_indexes/index_creator.rb
index 3ae2bb7b3e5..c5f4c5f30ad 100644
--- a/lib/gitlab/database/async_indexes/index_creator.rb
+++ b/lib/gitlab/database/async_indexes/index_creator.rb
@@ -3,48 +3,24 @@
module Gitlab
module Database
module AsyncIndexes
- class IndexCreator
- include IndexingExclusiveLeaseGuard
-
- TIMEOUT_PER_ACTION = 1.day
+ class IndexCreator < AsyncIndexes::IndexBase
STATEMENT_TIMEOUT = 20.hours
- def initialize(async_index)
- @async_index = async_index
- end
-
- def perform
- try_obtain_lease do
- if index_exists?
- log_index_info('Skipping index creation as the index exists')
- else
- log_index_info('Creating async index')
-
- set_statement_timeout do
- connection.execute(async_index.definition)
- end
-
- log_index_info('Finished creating async index')
- end
-
- async_index.destroy
- end
- end
-
private
- attr_reader :async_index
-
- def index_exists?
- connection.indexes(async_index.table_name).any? { |index| index.name == async_index.name }
+ override :preconditions_met?
+ def preconditions_met?
+ !index_exists?
end
- def connection
- @connection ||= async_index.connection
+ override :action_type
+ def action_type
+ 'creation'
end
- def lease_timeout
- TIMEOUT_PER_ACTION
+ override :around_execution
+ def around_execution(&block)
+ set_statement_timeout(&block)
end
def set_statement_timeout
@@ -53,10 +29,6 @@ module Gitlab
ensure
connection.execute('RESET statement_timeout')
end
-
- def log_index_info(message)
- Gitlab::AppLogger.info(message: message, table_name: async_index.table_name, index_name: async_index.name)
- end
end
end
end
diff --git a/lib/gitlab/database/async_indexes/index_destructor.rb b/lib/gitlab/database/async_indexes/index_destructor.rb
index 66955df9d04..5596e099cb6 100644
--- a/lib/gitlab/database/async_indexes/index_destructor.rb
+++ b/lib/gitlab/database/async_indexes/index_destructor.rb
@@ -3,58 +3,29 @@
module Gitlab
module Database
module AsyncIndexes
- class IndexDestructor
- include IndexingExclusiveLeaseGuard
-
- TIMEOUT_PER_ACTION = 1.day
-
- def initialize(async_index)
- @async_index = async_index
- end
-
- def perform
- try_obtain_lease do
- if !index_exists?
- log_index_info('Skipping dropping as the index does not exist')
- else
- log_index_info('Dropping async index')
-
- retries = Gitlab::Database::WithLockRetriesOutsideTransaction.new(
- connection: connection,
- timing_configuration: Gitlab::Database::Reindexing::REMOVE_INDEX_RETRY_CONFIG,
- klass: self.class,
- logger: Gitlab::AppLogger
- )
-
- retries.run(raise_on_exhaustion: false) do
- connection.execute(async_index.definition)
- end
-
- log_index_info('Finished dropping async index')
- end
-
- async_index.destroy
- end
- end
-
+ class IndexDestructor < AsyncIndexes::IndexBase
private
- attr_reader :async_index
-
- def index_exists?
- connection.indexes(async_index.table_name).any? { |index| index.name == async_index.name }
+ override :preconditions_met?
+ def preconditions_met?
+ index_exists?
end
- def connection
- @connection ||= async_index.connection
+ override :action_type
+ def action_type
+ 'removal'
end
- def lease_timeout
- TIMEOUT_PER_ACTION
- end
+ override :around_execution
+ def around_execution(&block)
+ retries = Gitlab::Database::WithLockRetriesOutsideTransaction.new(
+ connection: connection,
+ timing_configuration: Gitlab::Database::Reindexing::REMOVE_INDEX_RETRY_CONFIG,
+ klass: self.class,
+ logger: Gitlab::AppLogger
+ )
- def log_index_info(message)
- Gitlab::AppLogger.info(message: message, table_name: async_index.table_name, index_name: async_index.name)
+ retries.run(raise_on_exhaustion: false, &block)
end
end
end
diff --git a/lib/gitlab/database/async_indexes/migration_helpers.rb b/lib/gitlab/database/async_indexes/migration_helpers.rb
index c8f6761534c..f459c43e0ee 100644
--- a/lib/gitlab/database/async_indexes/migration_helpers.rb
+++ b/lib/gitlab/database/async_indexes/migration_helpers.rb
@@ -22,7 +22,7 @@ module Gitlab
return unless async_index_creation_available?
PostgresAsyncIndex.find_by(name: index_name).try do |async_index|
- async_index.destroy
+ async_index.destroy!
end
end
diff --git a/lib/gitlab/database/async_indexes/postgres_async_index.rb b/lib/gitlab/database/async_indexes/postgres_async_index.rb
index dc932482d40..94ff4a69c62 100644
--- a/lib/gitlab/database/async_indexes/postgres_async_index.rb
+++ b/lib/gitlab/database/async_indexes/postgres_async_index.rb
@@ -8,17 +8,37 @@ module Gitlab
MAX_IDENTIFIER_LENGTH = Gitlab::Database::MigrationHelpers::MAX_IDENTIFIER_NAME_LENGTH
MAX_DEFINITION_LENGTH = 2048
+ MAX_LAST_ERROR_LENGTH = 10_000
validates :name, presence: true, length: { maximum: MAX_IDENTIFIER_LENGTH }
validates :table_name, presence: true, length: { maximum: MAX_IDENTIFIER_LENGTH }
validates :definition, presence: true, length: { maximum: MAX_DEFINITION_LENGTH }
+ validates :last_error, length: { maximum: MAX_LAST_ERROR_LENGTH },
+ if: ->(index) { index.respond_to?(:last_error) }
scope :to_create, -> { where("definition ILIKE 'CREATE%'") }
scope :to_drop, -> { where("definition ILIKE 'DROP%'") }
+ scope :ordered, -> { order(attempts: :asc, id: :asc) }
def to_s
definition
end
+
+ def handle_exception!(error)
+ transaction do
+ increment!(:attempts)
+ update!(last_error: format_last_error(error))
+ end
+ end
+
+ private
+
+ def format_last_error(error)
+ [error.message]
+ .concat(error.backtrace)
+ .join("\n")
+ .truncate(MAX_LAST_ERROR_LENGTH)
+ end
end
end
end
diff --git a/lib/gitlab/database/load_balancing/sticking.rb b/lib/gitlab/database/load_balancing/sticking.rb
index 8e5dc98e96e..f5cb83e398a 100644
--- a/lib/gitlab/database/load_balancing/sticking.rb
+++ b/lib/gitlab/database/load_balancing/sticking.rb
@@ -121,19 +121,19 @@ module Gitlab
end
def unstick(namespace, id)
- Gitlab::Redis::SharedState.with do |redis|
+ with_redis do |redis|
redis.del(redis_key_for(namespace, id))
end
end
def set_write_location_for(namespace, id, location)
- Gitlab::Redis::SharedState.with do |redis|
+ with_redis do |redis|
redis.set(redis_key_for(namespace, id), location, ex: EXPIRATION)
end
end
def last_write_location_for(namespace, id)
- Gitlab::Redis::SharedState.with do |redis|
+ with_redis do |redis|
redis.get(redis_key_for(namespace, id))
end
end
@@ -143,6 +143,12 @@ module Gitlab
"database-load-balancing/write-location/#{name}/#{namespace}/#{id}"
end
+
+ private
+
+ def with_redis(&block)
+ Gitlab::Redis::DbLoadBalancing.with(&block)
+ end
end
end
end
diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb
index fff086c38a8..4d15022cca5 100644
--- a/lib/gitlab/redis.rb
+++ b/lib/gitlab/redis.rb
@@ -9,6 +9,7 @@ module Gitlab
# config/initializers/7_redis.rb, instrumented, and used in health- & readiness checks.
ALL_CLASSES = [
Gitlab::Redis::Cache,
+ Gitlab::Redis::DbLoadBalancing,
Gitlab::Redis::Queues,
Gitlab::Redis::RateLimiting,
Gitlab::Redis::RepositoryCache,
diff --git a/lib/gitlab/redis/db_load_balancing.rb b/lib/gitlab/redis/db_load_balancing.rb
new file mode 100644
index 00000000000..01276445611
--- /dev/null
+++ b/lib/gitlab/redis/db_load_balancing.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+module Gitlab
+ module Redis
+ class DbLoadBalancing < ::Gitlab::Redis::Wrapper
+ class << self
+ # The data we store on DbLoadBalancing used to be stored on SharedState.
+ def config_fallback
+ SharedState
+ end
+
+ private
+
+ def redis
+ primary_store = ::Redis.new(params)
+ secondary_store = ::Redis.new(config_fallback.params)
+
+ MultiStore.new(primary_store, secondary_store, store_name)
+ end
+ end
+ end
+ end
+end
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake
index 5757db30b2d..dd4fbc7c8f6 100644
--- a/lib/tasks/gitlab/db.rake
+++ b/lib/tasks/gitlab/db.rake
@@ -283,6 +283,36 @@ namespace :gitlab do
end
end
+ namespace :execute_async_index_operations do
+ each_database(databases) do |database_name|
+ task database_name, [:pick] => :environment do |_, args|
+ args.with_defaults(pick: 2)
+
+ if Feature.disabled?(:database_async_index_operations, type: :ops)
+ puts <<~NOTE.color(:yellow)
+ Note: database async index operations feature is currently disabled.
+
+ Enable with: Feature.enable(:database_async_index_operations)
+ NOTE
+ exit
+ end
+
+ Gitlab::Database::EachDatabase.each_database_connection(only: database_name) do
+ Gitlab::Database::AsyncIndexes.execute_pending_actions!(how_many: args[:pick].to_i)
+ end
+ end
+ end
+
+ task :all, [:pick] => :environment do |_, args|
+ default_pick = Gitlab.dev_or_test_env? ? 1000 : 2
+ args.with_defaults(pick: default_pick)
+
+ each_database(databases) do |database_name|
+ Rake::Task["gitlab:db:execute_async_index_operations:#{database_name}"].invoke(args[:pick])
+ end
+ end
+ end
+
desc 'Check if there have been user additions to the database'
task active: :environment do
if ActiveRecord::Base.connection.migration_context.needs_migration?
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 570f6e10598..a4f3abb69e8 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -23943,7 +23943,7 @@ msgstr ""
msgid "JiraService|Automatically transitions Jira issues to the \"Done\" category. %{linkStart}Learn more%{linkEnd}"
msgstr ""
-msgid "JiraService|Base URL of the Jira instance."
+msgid "JiraService|Base URL of the Jira instance"
msgstr ""
msgid "JiraService|Change GitLab version"
@@ -23997,7 +23997,7 @@ msgstr ""
msgid "JiraService|IDs must be a list of numbers that can be split with , or ;"
msgstr ""
-msgid "JiraService|If different from Web URL."
+msgid "JiraService|If different from the Web URL"
msgstr ""
msgid "JiraService|In order to complete the set up, you’ll need to complete a few steps in GitLab."
@@ -24030,6 +24030,9 @@ msgstr ""
msgid "JiraService|Open Jira"
msgstr ""
+msgid "JiraService|Password for the server version or an API token for the cloud version"
+msgstr ""
+
msgid "JiraService|Password or API token"
msgstr ""
@@ -24060,16 +24063,13 @@ msgstr ""
msgid "JiraService|Use Jira as this project's issue tracker."
msgstr ""
-msgid "JiraService|Use a password for server version and an API token for cloud version."
-msgstr ""
-
-msgid "JiraService|Use a username for server version and an email for cloud version."
+msgid "JiraService|Use custom transitions"
msgstr ""
-msgid "JiraService|Use custom transitions"
+msgid "JiraService|Username for the server version or an email for the cloud version"
msgstr ""
-msgid "JiraService|Username or Email"
+msgid "JiraService|Username or email"
msgstr ""
msgid "JiraService|Using Jira for issue tracking?"
@@ -32231,7 +32231,7 @@ msgstr ""
msgid "ProductAnalytics|All pages"
msgstr ""
-msgid "ProductAnalytics|An error occured while loading the %{widgetTitle} widget."
+msgid "ProductAnalytics|An error occured while loading the %{panelTitle} panel."
msgstr ""
msgid "ProductAnalytics|An error occurred while fetching data. Refresh the page to try again."
@@ -32330,7 +32330,7 @@ msgstr ""
msgid "ProductAnalytics|Measuring"
msgstr ""
-msgid "ProductAnalytics|New Analytics Widget Title"
+msgid "ProductAnalytics|New Analytics Panel Title"
msgstr ""
msgid "ProductAnalytics|OS"
@@ -32357,6 +32357,9 @@ msgstr ""
msgid "ProductAnalytics|Pages"
msgstr ""
+msgid "ProductAnalytics|Panel"
+msgstr ""
+
msgid "ProductAnalytics|Product analytics dashboards"
msgstr ""
@@ -32393,9 +32396,6 @@ msgstr ""
msgid "ProductAnalytics|What do you want to measure?"
msgstr ""
-msgid "ProductAnalytics|Widget"
-msgstr ""
-
msgid "Productivity"
msgstr ""
@@ -37961,6 +37961,9 @@ msgstr ""
msgid "SecurityOrchestration| or "
msgstr ""
+msgid "SecurityOrchestration| that is %{licenseState} and is"
+msgstr ""
+
msgid "SecurityOrchestration|%{agent} for %{namespaces}"
msgstr ""
@@ -37970,6 +37973,9 @@ msgstr ""
msgid "SecurityOrchestration|%{branches} branch"
msgstr ""
+msgid "SecurityOrchestration|%{licenses} and %{lastLicense}"
+msgstr ""
+
msgid "SecurityOrchestration|%{scannerStart}%{scanner}%{scannerEnd}"
msgstr ""
@@ -38123,6 +38129,9 @@ msgstr ""
msgid "SecurityOrchestration|License Scan"
msgstr ""
+msgid "SecurityOrchestration|License scanner finds any license %{matching} %{licenses}%{detection} in an open merge request targeting %{branches}."
+msgstr ""
+
msgid "SecurityOrchestration|New policy"
msgstr ""
diff --git a/package.json b/package.json
index bb57680aa23..1953edd068d 100644
--- a/package.json
+++ b/package.json
@@ -57,7 +57,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.2.0",
"@gitlab/svgs": "3.18.0",
- "@gitlab/ui": "54.2.3",
+ "@gitlab/ui": "55.0.1",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20230120231236",
"@rails/actioncable": "6.1.4-7",
diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping
index 3493e0f4d2b..872f8dae86e 100755
--- a/scripts/verify-tff-mapping
+++ b/scripts/verify-tff-mapping
@@ -78,8 +78,8 @@ tests = [
{
explanation: 'Migration should map to its non-timestamped spec',
- source: 'db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb',
- expected: ['spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb']
+ source: 'db/migrate/20221014034338_populate_releases_access_level_from_repository.rb',
+ expected: ['spec/migrations/populate_releases_access_level_from_repository_spec.rb']
},
{
diff --git a/spec/factories/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb b/spec/factories/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb
new file mode 100644
index 00000000000..a61b5cde7a0
--- /dev/null
+++ b/spec/factories/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :postgres_async_foreign_key_validation,
+ class: 'Gitlab::Database::AsyncForeignKeys::PostgresAsyncForeignKeyValidation' do
+ sequence(:name) { |n| "fk_users_id_#{n}" }
+ table_name { "users" }
+ end
+end
diff --git a/spec/frontend/vue_shared/components/source_viewer/highlight_util_spec.js b/spec/frontend/vue_shared/components/source_viewer/highlight_util_spec.js
index 4a995e2fde1..d2dd4afe09e 100644
--- a/spec/frontend/vue_shared/components/source_viewer/highlight_util_spec.js
+++ b/spec/frontend/vue_shared/components/source_viewer/highlight_util_spec.js
@@ -1,15 +1,10 @@
-import hljs from 'highlight.js/lib/core';
-import languageLoader from '~/content_editor/services/highlight_js_language_loader';
+import hljs from 'highlight.js';
import { registerPlugins } from '~/vue_shared/components/source_viewer/plugins/index';
import { highlight } from '~/vue_shared/components/source_viewer/workers/highlight_utils';
+import { LINES_PER_CHUNK, NEWLINE } from '~/vue_shared/components/source_viewer/constants';
-jest.mock('highlight.js/lib/core', () => ({
- highlight: jest.fn().mockReturnValue({}),
- registerLanguage: jest.fn(),
-}));
-
-jest.mock('~/content_editor/services/highlight_js_language_loader', () => ({
- javascript: jest.fn().mockReturnValue({ default: jest.fn() }),
+jest.mock('highlight.js', () => ({
+ highlight: jest.fn().mockReturnValue({ value: 'highlighted content' }),
}));
jest.mock('~/vue_shared/components/source_viewer/plugins/index', () => ({
@@ -17,28 +12,61 @@ jest.mock('~/vue_shared/components/source_viewer/plugins/index', () => ({
}));
const fileType = 'text';
-const content = 'function test() { return true };';
+const rawContent = 'function test() { return true }; \n // newline';
+const highlightedContent = 'highlighted content';
const language = 'javascript';
describe('Highlight utility', () => {
- beforeEach(() => highlight(fileType, content, language));
-
- it('loads the language', () => {
- expect(languageLoader.javascript).toHaveBeenCalled();
- });
+ beforeEach(() => highlight(fileType, rawContent, language));
it('registers the plugins', () => {
expect(registerPlugins).toHaveBeenCalled();
});
- it('registers the language', () => {
- expect(hljs.registerLanguage).toHaveBeenCalledWith(
- language,
- languageLoader[language]().default,
+ it('highlights the content', () => {
+ expect(hljs.highlight).toHaveBeenCalledWith(rawContent, { language });
+ });
+
+ it('splits the content into chunks', () => {
+ const contentArray = Array.from({ length: 140 }, () => 'newline'); // simulate 140 lines of code
+
+ const chunks = [
+ {
+ language,
+ highlightedContent,
+ rawContent: contentArray.slice(0, 70).join(NEWLINE), // first 70 lines
+ startingFrom: 0,
+ totalLines: LINES_PER_CHUNK,
+ },
+ {
+ language,
+ highlightedContent: '',
+ rawContent: contentArray.slice(70, 140).join(NEWLINE), // last 70 lines
+ startingFrom: 70,
+ totalLines: LINES_PER_CHUNK,
+ },
+ ];
+
+ expect(highlight(fileType, contentArray.join(NEWLINE), language)).toEqual(
+ expect.arrayContaining(chunks),
);
});
+});
- it('highlights the content', () => {
- expect(hljs.highlight).toHaveBeenCalledWith(content, { language });
+describe('unsupported languages', () => {
+ const unsupportedLanguage = 'some_unsupported_language';
+
+ beforeEach(() => highlight(fileType, rawContent, unsupportedLanguage));
+
+ it('does not register plugins', () => {
+ expect(registerPlugins).not.toHaveBeenCalled();
+ });
+
+ it('does not attempt to highlight the content', () => {
+ expect(hljs.highlight).not.toHaveBeenCalled();
+ });
+
+ it('does not return a result', () => {
+ expect(highlight(fileType, rawContent, unsupportedLanguage)).toBe(undefined);
});
});
diff --git a/spec/lib/api/ci/helpers/runner_helpers_spec.rb b/spec/lib/api/ci/helpers/runner_helpers_spec.rb
index d32f7e4f0be..c36c8d23e88 100644
--- a/spec/lib/api/ci/helpers/runner_helpers_spec.rb
+++ b/spec/lib/api/ci/helpers/runner_helpers_spec.rb
@@ -34,6 +34,7 @@ RSpec.describe API::Ci::Helpers::Runner, feature_category: :runner do
context 'when runner info is present' do
let(:name) { 'runner' }
+ let(:system_id) { 's_c2d22f638c25' }
let(:version) { '1.2.3' }
let(:revision) { '10.0' }
let(:platform) { 'test' }
@@ -42,6 +43,7 @@ RSpec.describe API::Ci::Helpers::Runner, feature_category: :runner do
let(:config) { { 'gpus' => 'all' } }
let(:runner_params) do
{
+ system_id: system_id,
'info' =>
{
'name' => name,
@@ -59,7 +61,10 @@ RSpec.describe API::Ci::Helpers::Runner, feature_category: :runner do
subject(:details) { runner_helper.get_runner_details_from_request }
it 'extracts the runner details', :aggregate_failures do
- expect(details.keys).to match_array(%w(name version revision platform architecture executor config ip_address))
+ expect(details.keys).to match_array(
+ %w(system_id name version revision platform architecture executor config ip_address)
+ )
+ expect(details['system_id']).to eq(system_id)
expect(details['name']).to eq(name)
expect(details['version']).to eq(version)
expect(details['revision']).to eq(revision)
diff --git a/spec/lib/api/ci/helpers/runner_spec.rb b/spec/lib/api/ci/helpers/runner_spec.rb
index 6801d16d13e..b5046bb9983 100644
--- a/spec/lib/api/ci/helpers/runner_spec.rb
+++ b/spec/lib/api/ci/helpers/runner_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe API::Ci::Helpers::Runner do
allow(helper).to receive(:env).and_return({})
end
- describe '#current_job' do
+ describe '#current_job', feature_category: :continuous_integration do
let(:build) { create(:ci_build, :running) }
it 'handles sticking of a build when a build ID is specified' do
@@ -38,7 +38,7 @@ RSpec.describe API::Ci::Helpers::Runner do
end
end
- describe '#current_runner' do
+ describe '#current_runner', feature_category: :runner do
let(:runner) { create(:ci_runner, token: 'foo') }
it 'handles sticking of a runner if a token is specified' do
@@ -67,7 +67,73 @@ RSpec.describe API::Ci::Helpers::Runner do
end
end
- describe '#track_runner_authentication', :prometheus do
+ describe '#current_runner_machine', :freeze_time, feature_category: :runner_fleet do
+ let(:runner) { create(:ci_runner, token: 'foo') }
+ let(:runner_machine) { create(:ci_runner_machine, runner: runner, machine_xid: 'bar', contacted_at: 1.hour.ago) }
+
+ subject(:current_runner_machine) { helper.current_runner_machine }
+
+ context 'with create_runner_machine FF enabled' do
+ before do
+ stub_feature_flags(create_runner_machine: true)
+ end
+
+ it 'does not return runner machine if no system_id specified' do
+ allow(helper).to receive(:params).and_return(token: runner.token)
+
+ is_expected.to be_nil
+ end
+
+ context 'when runner machine already exists' do
+ before do
+ allow(helper).to receive(:params).and_return(token: runner.token, system_id: runner_machine.machine_xid)
+ end
+
+ it { is_expected.to eq(runner_machine) }
+
+ it 'does not update the contacted_at field' do
+ expect(current_runner_machine.contacted_at).to eq 1.hour.ago
+ end
+ end
+
+ it 'creates a new runner machine if one could be not be found', :aggregate_failures do
+ allow(helper).to receive(:params).and_return(token: runner.token, system_id: 'new_system_id')
+
+ expect { current_runner_machine }.to change { Ci::RunnerMachine.count }.by(1)
+
+ expect(current_runner_machine).not_to be_nil
+ expect(current_runner_machine.machine_xid).to eq('new_system_id')
+ expect(current_runner_machine.contacted_at).to eq(Time.current)
+ expect(current_runner_machine.runner).to eq(runner)
+ end
+ end
+
+ context 'with create_runner_machine FF disabled' do
+ before do
+ stub_feature_flags(create_runner_machine: false)
+ end
+
+ it 'does not return runner machine if no system_id specified' do
+ allow(helper).to receive(:params).and_return(token: runner.token)
+
+ is_expected.to be_nil
+ end
+
+ context 'when runner machine can not be found' do
+ before do
+ allow(helper).to receive(:params).and_return(token: runner.token, system_id: 'new_system_id')
+ end
+
+ it 'does not create a new runner machine', :aggregate_failures do
+ expect { current_runner_machine }.not_to change { Ci::RunnerMachine.count }
+
+ expect(current_runner_machine).to be_nil
+ end
+ end
+ end
+ end
+
+ describe '#track_runner_authentication', :prometheus, feature_category: :runner do
subject { helper.track_runner_authentication }
let(:runner) { create(:ci_runner, token: 'foo') }
diff --git a/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb b/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb
deleted file mode 100644
index 96adea03d43..00000000000
--- a/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::BackfillJiraTrackerDeploymentType2, :migration, schema: 20210602155110 do
- let!(:jira_integration_temp) { described_class::JiraServiceTemp }
- let!(:jira_tracker_data_temp) { described_class::JiraTrackerDataTemp }
- let!(:atlassian_host) { 'https://api.atlassian.net' }
- let!(:mixedcase_host) { 'https://api.AtlassiaN.nEt' }
- let!(:server_host) { 'https://my.server.net' }
-
- let(:jira_integration) { jira_integration_temp.create!(type: 'JiraService', active: true, category: 'issue_tracker') }
-
- subject { described_class.new }
-
- def create_tracker_data(options = {})
- jira_tracker_data_temp.create!({ service_id: jira_integration.id }.merge(options))
- end
-
- describe '#perform' do
- context do
- it 'ignores if deployment already set' do
- tracker_data = create_tracker_data(url: atlassian_host, deployment_type: 'server')
-
- expect(subject).not_to receive(:collect_deployment_type)
-
- subject.perform(tracker_data.id, tracker_data.id)
-
- expect(tracker_data.reload.deployment_type).to eq 'server'
- end
-
- it 'ignores if no url is set' do
- tracker_data = create_tracker_data(deployment_type: 'unknown')
-
- expect(subject).to receive(:collect_deployment_type)
-
- subject.perform(tracker_data.id, tracker_data.id)
-
- expect(tracker_data.reload.deployment_type).to eq 'unknown'
- end
- end
-
- context 'when tracker is valid' do
- let!(:tracker_1) { create_tracker_data(url: atlassian_host, deployment_type: 0) }
- let!(:tracker_2) { create_tracker_data(url: mixedcase_host, deployment_type: 0) }
- let!(:tracker_3) { create_tracker_data(url: server_host, deployment_type: 0) }
- let!(:tracker_4) { create_tracker_data(api_url: server_host, deployment_type: 0) }
- let!(:tracker_nextbatch) { create_tracker_data(api_url: atlassian_host, deployment_type: 0) }
-
- it 'sets the proper deployment_type', :aggregate_failures do
- subject.perform(tracker_1.id, tracker_4.id)
-
- expect(tracker_1.reload.deployment_cloud?).to be_truthy
- expect(tracker_2.reload.deployment_cloud?).to be_truthy
- expect(tracker_3.reload.deployment_server?).to be_truthy
- expect(tracker_4.reload.deployment_server?).to be_truthy
- expect(tracker_nextbatch.reload.deployment_unknown?).to be_truthy
- end
- end
-
- it_behaves_like 'marks background migration job records' do
- let(:arguments) { [1, 4] }
- 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
index 15956d2ea80..876eb070745 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren, :migration, schema: 20210602155110 do
+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) }
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
index 019c6d54068..ad9b54608c6 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots, :migration, schema: 20210602155110 do
+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) }
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 456d0165fe6..80fd86e90bb 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: 20210602155110,
+RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migration, schema: 20210826171758,
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
index b084e3fe885..7142aea3ab2 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillUpvotesCountOnIssues, schema: 20210701111909 do
+RSpec.describe Gitlab::BackgroundMigration::BackfillUpvotesCountOnIssues, schema: 20210826171758 do
let(:award_emoji) { table(:award_emoji) }
let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') }
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
index 0d9d9eb929c..5ffe665f0ad 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::CleanupOrphanedLfsObjectsProjects, schema: 20210602155110 do
+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) }
diff --git a/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb b/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb
index c4039b85459..8f058c875a2 100644
--- a/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb
+++ b/spec/lib/gitlab/background_migration/delete_orphaned_deployments_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedDeployments, :migration, schema: 20210617161348 do
+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) }
@@ -10,17 +10,14 @@ RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedDeployments, :migratio
before do
create_deployment!(environment.id, project.id)
- create_deployment!(non_existing_record_id, project.id)
end
it 'deletes only orphaned deployments' do
expect(valid_deployments.pluck(:id)).not_to be_empty
- expect(orphaned_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
- expect(orphaned_deployments.pluck(:id)).to be_empty
end
it 'marks jobs as done' do
@@ -29,15 +26,9 @@ RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedDeployments, :migratio
arguments: [table(:deployments).minimum(:id), table(:deployments).minimum(:id)]
)
- second_job = background_migration_jobs.create!(
- class_name: 'DeleteOrphanedDeployments',
- arguments: [table(:deployments).maximum(:id), table(:deployments).maximum(:id)]
- )
-
subject.perform(table(:deployments).minimum(:id), table(:deployments).minimum(:id))
expect(first_job.reload.status).to eq(Gitlab::Database::BackgroundMigrationJob.statuses[:succeeded])
- expect(second_job.reload.status).to eq(Gitlab::Database::BackgroundMigrationJob.statuses[:pending])
end
private
diff --git a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb b/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb
index 66e16b16270..8f3ef44e00c 100644
--- a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb
+++ b/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::DropInvalidVulnerabilities, schema: 20210602155110 do
+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) }
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
index 51a09d50a19..586e75ffb37 100644
--- 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
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::BackgroundMigration::ExtractProjectTopicsIntoSeparateTable,
- :suppress_gitlab_schemas_validate_connection, schema: 20210730104800 do
+ :suppress_gitlab_schemas_validate_connection, schema: 20210826171758 do
it 'correctly extracts project topics into separate table' do
namespaces = table(:namespaces)
projects = table(:projects)
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
index 4d7c836cff4..b252df4ecff 100644
--- 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
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Gitlab::BackgroundMigration::MigrateProjectTaggingsContextFromTagsToTopics,
- :suppress_gitlab_schemas_validate_connection, schema: 20210602155110 do
+ :suppress_gitlab_schemas_validate_connection, schema: 20210826171758 do
it 'correctly migrates project taggings context from tags to topics' do
taggings = table(:taggings)
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 fe45eaac3b7..08fde0d0ff4 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: 20210602155110 do
+RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20210826171758 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
index cafddb6aeaf..71cf58a933f 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210602155110 do
+RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210826171758 do
let(:enabled) { 20 }
let(:disabled) { 0 }
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
index 7261758e010..b8c3bf8f3ac 100644
--- a/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb
+++ b/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::UpdateTimelogsProjectId, schema: 20210602155110 do
+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) }
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
index 4599491b580..f16ae489b78 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::UpdateUsersWhereTwoFactorAuthRequiredFromGroup, :migration, schema: 20210602155110 do
+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) }
diff --git a/spec/lib/gitlab/ci/variables/builder/pipeline_spec.rb b/spec/lib/gitlab/ci/variables/builder/pipeline_spec.rb
new file mode 100644
index 00000000000..a5365ae53b8
--- /dev/null
+++ b/spec/lib/gitlab/ci/variables/builder/pipeline_spec.rb
@@ -0,0 +1,336 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::Ci::Variables::Builder::Pipeline, feature_category: :pipeline_authoring do
+ let_it_be(:project) { create_default(:project, :repository, create_tag: 'test').freeze }
+ let_it_be(:user) { create(:user) }
+
+ let(:pipeline) { build(:ci_empty_pipeline, :created, project: project) }
+
+ describe '#predefined_variables' do
+ subject { described_class.new(pipeline).predefined_variables }
+
+ it 'includes all predefined variables in a valid order' do
+ keys = subject.pluck(:key)
+
+ expect(keys).to contain_exactly(*%w[
+ CI_PIPELINE_IID
+ CI_PIPELINE_SOURCE
+ CI_PIPELINE_CREATED_AT
+ CI_COMMIT_SHA
+ CI_COMMIT_SHORT_SHA
+ CI_COMMIT_BEFORE_SHA
+ CI_COMMIT_REF_NAME
+ CI_COMMIT_REF_SLUG
+ CI_COMMIT_BRANCH
+ CI_COMMIT_MESSAGE
+ CI_COMMIT_TITLE
+ CI_COMMIT_DESCRIPTION
+ CI_COMMIT_REF_PROTECTED
+ CI_COMMIT_TIMESTAMP
+ CI_COMMIT_AUTHOR
+ CI_BUILD_REF
+ CI_BUILD_BEFORE_SHA
+ CI_BUILD_REF_NAME
+ CI_BUILD_REF_SLUG
+ ])
+ end
+
+ context 'when the pipeline is running for a tag' do
+ let(:pipeline) { build(:ci_empty_pipeline, :created, project: project, ref: 'test', tag: true) }
+
+ it 'includes all predefined variables in a valid order' do
+ keys = subject.pluck(:key)
+
+ expect(keys).to contain_exactly(*%w[
+ CI_PIPELINE_IID
+ CI_PIPELINE_SOURCE
+ CI_PIPELINE_CREATED_AT
+ CI_COMMIT_SHA
+ CI_COMMIT_SHORT_SHA
+ CI_COMMIT_BEFORE_SHA
+ CI_COMMIT_REF_NAME
+ CI_COMMIT_REF_SLUG
+ CI_COMMIT_MESSAGE
+ CI_COMMIT_TITLE
+ CI_COMMIT_DESCRIPTION
+ CI_COMMIT_REF_PROTECTED
+ CI_COMMIT_TIMESTAMP
+ CI_COMMIT_AUTHOR
+ CI_BUILD_REF
+ CI_BUILD_BEFORE_SHA
+ CI_BUILD_REF_NAME
+ CI_BUILD_REF_SLUG
+ CI_COMMIT_TAG
+ CI_COMMIT_TAG_MESSAGE
+ CI_BUILD_TAG
+ ])
+ end
+ end
+
+ context 'when merge request is present' do
+ let_it_be(:assignees) { create_list(:user, 2) }
+ let_it_be(:milestone) { create(:milestone, project: project) }
+ let_it_be(:labels) { create_list(:label, 2) }
+
+ let(:merge_request) do
+ create(:merge_request, :simple,
+ source_project: project,
+ target_project: project,
+ assignees: assignees,
+ milestone: milestone,
+ labels: labels)
+ end
+
+ context 'when pipeline for merge request is created' do
+ let(:pipeline) do
+ create(:ci_pipeline, :detached_merge_request_pipeline,
+ ci_ref_presence: false,
+ user: user,
+ merge_request: merge_request)
+ end
+
+ before do
+ project.add_developer(user)
+ end
+
+ it 'exposes merge request pipeline variables' do
+ expect(subject.to_hash)
+ .to include(
+ 'CI_MERGE_REQUEST_ID' => merge_request.id.to_s,
+ 'CI_MERGE_REQUEST_IID' => merge_request.iid.to_s,
+ 'CI_MERGE_REQUEST_REF_PATH' => merge_request.ref_path.to_s,
+ 'CI_MERGE_REQUEST_PROJECT_ID' => merge_request.project.id.to_s,
+ 'CI_MERGE_REQUEST_PROJECT_PATH' => merge_request.project.full_path,
+ 'CI_MERGE_REQUEST_PROJECT_URL' => merge_request.project.web_url,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME' => merge_request.target_branch.to_s,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED' => ProtectedBranch.protected?(
+ merge_request.target_project,
+ merge_request.target_branch
+ ).to_s,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA' => '',
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_ID' => merge_request.source_project.id.to_s,
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_PATH' => merge_request.source_project.full_path,
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_URL' => merge_request.source_project.web_url,
+ 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s,
+ 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => '',
+ 'CI_MERGE_REQUEST_TITLE' => merge_request.title,
+ 'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list,
+ 'CI_MERGE_REQUEST_MILESTONE' => milestone.title,
+ 'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','),
+ 'CI_MERGE_REQUEST_EVENT_TYPE' => 'detached',
+ 'CI_OPEN_MERGE_REQUESTS' => merge_request.to_reference(full: true))
+ end
+
+ it 'exposes diff variables' do
+ expect(subject.to_hash)
+ .to include(
+ 'CI_MERGE_REQUEST_DIFF_ID' => merge_request.merge_request_diff.id.to_s,
+ 'CI_MERGE_REQUEST_DIFF_BASE_SHA' => merge_request.merge_request_diff.base_commit_sha)
+ end
+
+ context 'without assignee' do
+ let(:assignees) { [] }
+
+ it 'does not expose assignee variable' do
+ expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_ASSIGNEES')
+ end
+ end
+
+ context 'without milestone' do
+ let(:milestone) { nil }
+
+ it 'does not expose milestone variable' do
+ expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_MILESTONE')
+ end
+ end
+
+ context 'without labels' do
+ let(:labels) { [] }
+
+ it 'does not expose labels variable' do
+ expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_LABELS')
+ end
+ end
+ end
+
+ context 'when pipeline on branch is created' do
+ let(:pipeline) do
+ create(:ci_pipeline, project: project, user: user, ref: 'feature')
+ end
+
+ context 'when a merge request is created' do
+ before do
+ merge_request
+ end
+
+ context 'when user has access to project' do
+ before do
+ project.add_developer(user)
+ end
+
+ it 'merge request references are returned matching the pipeline' do
+ expect(subject.to_hash).to include(
+ 'CI_OPEN_MERGE_REQUESTS' => merge_request.to_reference(full: true))
+ end
+ end
+
+ context 'when user does not have access to project' do
+ it 'CI_OPEN_MERGE_REQUESTS is not returned' do
+ expect(subject.to_hash).not_to have_key('CI_OPEN_MERGE_REQUESTS')
+ end
+ end
+ end
+
+ context 'when no a merge request is created' do
+ it 'CI_OPEN_MERGE_REQUESTS is not returned' do
+ expect(subject.to_hash).not_to have_key('CI_OPEN_MERGE_REQUESTS')
+ end
+ end
+ end
+
+ context 'with merged results' do
+ let(:pipeline) do
+ create(:ci_pipeline, :merged_result_pipeline, merge_request: merge_request)
+ end
+
+ it 'exposes merge request pipeline variables' do
+ expect(subject.to_hash)
+ .to include(
+ 'CI_MERGE_REQUEST_ID' => merge_request.id.to_s,
+ 'CI_MERGE_REQUEST_IID' => merge_request.iid.to_s,
+ 'CI_MERGE_REQUEST_REF_PATH' => merge_request.ref_path.to_s,
+ 'CI_MERGE_REQUEST_PROJECT_ID' => merge_request.project.id.to_s,
+ 'CI_MERGE_REQUEST_PROJECT_PATH' => merge_request.project.full_path,
+ 'CI_MERGE_REQUEST_PROJECT_URL' => merge_request.project.web_url,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME' => merge_request.target_branch.to_s,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED' => ProtectedBranch.protected?(
+ merge_request.target_project,
+ merge_request.target_branch
+ ).to_s,
+ 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA' => merge_request.target_branch_sha,
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_ID' => merge_request.source_project.id.to_s,
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_PATH' => merge_request.source_project.full_path,
+ 'CI_MERGE_REQUEST_SOURCE_PROJECT_URL' => merge_request.source_project.web_url,
+ 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s,
+ 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => merge_request.source_branch_sha,
+ 'CI_MERGE_REQUEST_TITLE' => merge_request.title,
+ 'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list,
+ 'CI_MERGE_REQUEST_MILESTONE' => milestone.title,
+ 'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','),
+ 'CI_MERGE_REQUEST_EVENT_TYPE' => 'merged_result')
+ end
+
+ it 'exposes diff variables' do
+ expect(subject.to_hash)
+ .to include(
+ 'CI_MERGE_REQUEST_DIFF_ID' => merge_request.merge_request_diff.id.to_s,
+ 'CI_MERGE_REQUEST_DIFF_BASE_SHA' => merge_request.merge_request_diff.base_commit_sha)
+ end
+ end
+ end
+
+ context 'when source is external pull request' do
+ let(:pipeline) do
+ create(:ci_pipeline, source: :external_pull_request_event, external_pull_request: pull_request)
+ end
+
+ let(:pull_request) { create(:external_pull_request, project: project) }
+
+ it 'exposes external pull request pipeline variables' do
+ expect(subject.to_hash)
+ .to include(
+ 'CI_EXTERNAL_PULL_REQUEST_IID' => pull_request.pull_request_iid.to_s,
+ 'CI_EXTERNAL_PULL_REQUEST_SOURCE_REPOSITORY' => pull_request.source_repository,
+ 'CI_EXTERNAL_PULL_REQUEST_TARGET_REPOSITORY' => pull_request.target_repository,
+ 'CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_SHA' => pull_request.source_sha,
+ 'CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA' => pull_request.target_sha,
+ 'CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_NAME' => pull_request.source_branch,
+ 'CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME' => pull_request.target_branch
+ )
+ end
+ end
+
+ describe 'variable CI_KUBERNETES_ACTIVE' do
+ context 'when pipeline.has_kubernetes_active? is true' do
+ before do
+ allow(pipeline).to receive(:has_kubernetes_active?).and_return(true)
+ end
+
+ it "is included with value 'true'" do
+ expect(subject.to_hash).to include('CI_KUBERNETES_ACTIVE' => 'true')
+ end
+ end
+
+ context 'when pipeline.has_kubernetes_active? is false' do
+ before do
+ allow(pipeline).to receive(:has_kubernetes_active?).and_return(false)
+ end
+
+ it 'is not included' do
+ expect(subject.to_hash).not_to have_key('CI_KUBERNETES_ACTIVE')
+ end
+ end
+ end
+
+ describe 'variable CI_GITLAB_FIPS_MODE' do
+ context 'when FIPS flag is enabled' do
+ before do
+ allow(Gitlab::FIPS).to receive(:enabled?).and_return(true)
+ end
+
+ it "is included with value 'true'" do
+ expect(subject.to_hash).to include('CI_GITLAB_FIPS_MODE' => 'true')
+ end
+ end
+
+ context 'when FIPS flag is disabled' do
+ before do
+ allow(Gitlab::FIPS).to receive(:enabled?).and_return(false)
+ end
+
+ it 'is not included' do
+ expect(subject.to_hash).not_to have_key('CI_GITLAB_FIPS_MODE')
+ end
+ end
+ end
+
+ context 'when tag is not found' do
+ let(:pipeline) do
+ create(:ci_pipeline, project: project, ref: 'not_found_tag', tag: true)
+ end
+
+ it 'does not expose tag variables' do
+ expect(subject.to_hash.keys)
+ .not_to include(
+ 'CI_COMMIT_TAG',
+ 'CI_COMMIT_TAG_MESSAGE',
+ 'CI_BUILD_TAG'
+ )
+ end
+ end
+
+ context 'without a commit' do
+ let(:pipeline) { build(:ci_empty_pipeline, :created, sha: nil) }
+
+ it 'does not expose commit variables' do
+ expect(subject.to_hash.keys)
+ .not_to include(
+ 'CI_COMMIT_SHA',
+ 'CI_COMMIT_SHORT_SHA',
+ 'CI_COMMIT_BEFORE_SHA',
+ 'CI_COMMIT_REF_NAME',
+ 'CI_COMMIT_REF_SLUG',
+ 'CI_COMMIT_BRANCH',
+ 'CI_COMMIT_TAG',
+ 'CI_COMMIT_MESSAGE',
+ 'CI_COMMIT_TITLE',
+ 'CI_COMMIT_DESCRIPTION',
+ 'CI_COMMIT_REF_PROTECTED',
+ 'CI_COMMIT_TIMESTAMP',
+ 'CI_COMMIT_AUTHOR')
+ end
+ end
+ end
+end
diff --git a/spec/lib/gitlab/ci/variables/builder_spec.rb b/spec/lib/gitlab/ci/variables/builder_spec.rb
index 5aa752ee429..bbd3dc54e6a 100644
--- a/spec/lib/gitlab/ci/variables/builder_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder_spec.rb
@@ -166,8 +166,14 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache, featur
end
before do
+ pipeline_variables_builder = double(
+ ::Gitlab::Ci::Variables::Builder::Pipeline,
+ predefined_variables: [var('C', 3), var('D', 3)]
+ )
+
allow(builder).to receive(:predefined_variables) { [var('A', 1), var('B', 1)] }
allow(pipeline.project).to receive(:predefined_variables) { [var('B', 2), var('C', 2)] }
+ allow(builder).to receive(:pipeline_variables_builder) { pipeline_variables_builder }
allow(pipeline).to receive(:predefined_variables) { [var('C', 3), var('D', 3)] }
allow(job).to receive(:runner) { double(predefined_variables: [var('D', 4), var('E', 4)]) }
allow(builder).to receive(:kubernetes_variables) { [var('E', 5), var('F', 5)] }
@@ -635,8 +641,13 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache, featur
end
before do
+ pipeline_variables_builder = double(
+ ::Gitlab::Ci::Variables::Builder::Pipeline,
+ predefined_variables: [var('B', 2), var('C', 2)]
+ )
+
allow(pipeline.project).to receive(:predefined_variables) { [var('A', 1), var('B', 1)] }
- allow(pipeline).to receive(:predefined_variables) { [var('B', 2), var('C', 2)] }
+ allow(builder).to receive(:pipeline_variables_builder) { pipeline_variables_builder }
allow(builder).to receive(:secret_instance_variables) { [var('C', 3), var('D', 3)] }
allow(builder).to receive(:secret_group_variables) { [var('D', 4), var('E', 4)] }
allow(builder).to receive(:secret_project_variables) { [var('E', 5), var('F', 5)] }
diff --git a/spec/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation_spec.rb b/spec/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation_spec.rb
new file mode 100644
index 00000000000..23313387400
--- /dev/null
+++ b/spec/lib/gitlab/database/async_foreign_keys/postgres_async_foreign_key_validation_spec.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::Database::AsyncForeignKeys::PostgresAsyncForeignKeyValidation, type: :model,
+ feature_category: :database do
+ it { is_expected.to be_a Gitlab::Database::SharedModel }
+
+ describe 'validations' do
+ let_it_be(:fk_validation) { create(:postgres_async_foreign_key_validation) }
+ let(:identifier_limit) { described_class::MAX_IDENTIFIER_LENGTH }
+ let(:last_error_limit) { described_class::MAX_LAST_ERROR_LENGTH }
+
+ subject { fk_validation }
+
+ it { is_expected.to validate_presence_of(:name) }
+ it { is_expected.to validate_uniqueness_of(:name) }
+ it { is_expected.to validate_length_of(:name).is_at_most(identifier_limit) }
+ it { is_expected.to validate_presence_of(:table_name) }
+ it { is_expected.to validate_length_of(:table_name).is_at_most(identifier_limit) }
+ it { is_expected.to validate_length_of(:last_error).is_at_most(last_error_limit) }
+ end
+
+ describe 'scopes' do
+ let!(:failed_validation) { create(:postgres_async_foreign_key_validation, attempts: 1) }
+ let!(:new_validation) { create(:postgres_async_foreign_key_validation) }
+
+ describe '.ordered' do
+ subject { described_class.ordered }
+
+ it { is_expected.to eq([new_validation, failed_validation]) }
+ end
+ end
+end
diff --git a/spec/lib/gitlab/database/async_indexes/index_base_spec.rb b/spec/lib/gitlab/database/async_indexes/index_base_spec.rb
new file mode 100644
index 00000000000..a4c9e2c2880
--- /dev/null
+++ b/spec/lib/gitlab/database/async_indexes/index_base_spec.rb
@@ -0,0 +1,88 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::Database::AsyncIndexes::IndexBase, feature_category: :database do
+ include ExclusiveLeaseHelpers
+
+ describe '#perform' do
+ subject { described_class.new(async_index) }
+
+ let(:async_index) { create(:postgres_async_index) }
+
+ let(:model) { Gitlab::Database.database_base_models[Gitlab::Database::PRIMARY_DATABASE_NAME] }
+ let(:connection) { model.connection }
+
+ let!(:lease) { stub_exclusive_lease(lease_key, :uuid, timeout: lease_timeout) }
+ let(:lease_key) { "gitlab/database/indexing/actions/#{Gitlab::Database::PRIMARY_DATABASE_NAME}" }
+ let(:lease_timeout) { described_class::TIMEOUT_PER_ACTION }
+
+ around do |example|
+ Gitlab::Database::SharedModel.using_connection(connection) do
+ example.run
+ end
+ end
+
+ describe '#preconditions_met?' do
+ it 'raises errors if preconditions is not defined' do
+ expect { subject.perform }.to raise_error NotImplementedError, 'must implement preconditions_met?'
+ end
+ end
+
+ describe '#action_type' do
+ before do
+ allow(subject).to receive(:preconditions_met?).and_return(true)
+ end
+
+ it 'raises errors if action_type is not defined' do
+ expect { subject.perform }.to raise_error NotImplementedError, 'must implement action_type'
+ end
+ end
+
+ context 'with error handling' do
+ before do
+ allow(subject).to receive(:preconditions_met?).and_return(true)
+ allow(subject).to receive(:action_type).and_return('test')
+ allow(async_index.connection).to receive(:execute).and_call_original
+
+ allow(async_index.connection)
+ .to receive(:execute)
+ .with(async_index.definition)
+ .and_raise(ActiveRecord::StatementInvalid)
+ end
+
+ context 'on production' do
+ before do
+ allow(Gitlab::ErrorTracking).to receive(:should_raise_for_dev?).and_return(false)
+ end
+
+ it 'increases execution attempts' do
+ expect { subject.perform }.to change { async_index.attempts }.by(1)
+
+ expect(async_index.last_error).to be_present
+ expect(async_index).not_to be_destroyed
+ end
+
+ it 'logs an error message including the index_name' do
+ expect(Gitlab::AppLogger)
+ .to receive(:error)
+ .with(a_hash_including(:message, :index_name))
+ .and_call_original
+
+ subject.perform
+ end
+ end
+
+ context 'on development' do
+ it 'also raises errors' do
+ expect { subject.perform }
+ .to raise_error(ActiveRecord::StatementInvalid)
+ .and change { async_index.attempts }.by(1)
+
+ expect(async_index.last_error).to be_present
+ expect(async_index).not_to be_destroyed
+ end
+ end
+ end
+ end
+end
diff --git a/spec/lib/gitlab/database/async_indexes/index_creator_spec.rb b/spec/lib/gitlab/database/async_indexes/index_creator_spec.rb
index 207aedd1a38..f980e458f14 100644
--- a/spec/lib/gitlab/database/async_indexes/index_creator_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes/index_creator_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::AsyncIndexes::IndexCreator do
+RSpec.describe Gitlab::Database::AsyncIndexes::IndexCreator, feature_category: :database do
include ExclusiveLeaseHelpers
describe '#perform' do
@@ -35,6 +35,24 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexCreator do
subject.perform
end
+
+ it 'removes the index preparation record from postgres_async_indexes' do
+ expect(async_index).to receive(:destroy!).and_call_original
+
+ expect { subject.perform }.to change { index_model.count }.by(-1)
+ end
+
+ it 'logs an appropriate message' do
+ expected_message = 'Skipping index creation since preconditions are not met. The queuing entry will be deleted'
+
+ allow(Gitlab::AppLogger).to receive(:info).and_call_original
+
+ subject.perform
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: expected_message))
+ end
end
it 'creates the index while controlling statement timeout' do
@@ -47,7 +65,7 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexCreator do
end
it 'removes the index preparation record from postgres_async_indexes' do
- expect(async_index).to receive(:destroy).and_call_original
+ expect(async_index).to receive(:destroy!).and_call_original
expect { subject.perform }.to change { index_model.count }.by(-1)
end
@@ -55,9 +73,23 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexCreator do
it 'skips logic if not able to acquire exclusive lease' do
expect(lease).to receive(:try_obtain).ordered.and_return(false)
expect(connection).not_to receive(:execute).with(/CREATE INDEX/)
- expect(async_index).not_to receive(:destroy)
+ expect(async_index).not_to receive(:destroy!)
expect { subject.perform }.not_to change { index_model.count }
end
+
+ it 'logs messages around execution' do
+ allow(Gitlab::AppLogger).to receive(:info).and_call_original
+
+ subject.perform
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: 'Starting async index creation'))
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: 'Finished async index creation'))
+ end
end
end
diff --git a/spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb b/spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb
index 11039ad4f7e..c70acf53dc2 100644
--- a/spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes/index_destructor_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::AsyncIndexes::IndexDestructor do
+RSpec.describe Gitlab::Database::AsyncIndexes::IndexDestructor, feature_category: :database do
include ExclusiveLeaseHelpers
describe '#perform' do
@@ -39,6 +39,24 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexDestructor do
subject.perform
end
+
+ it 'removes the index preparation record from postgres_async_indexes' do
+ expect(async_index).to receive(:destroy!).and_call_original
+
+ expect { subject.perform }.to change { index_model.count }.by(-1)
+ end
+
+ it 'logs an appropriate message' do
+ expected_message = 'Skipping index removal since preconditions are not met. The queuing entry will be deleted'
+
+ allow(Gitlab::AppLogger).to receive(:info).and_call_original
+
+ subject.perform
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: expected_message))
+ end
end
it 'creates the index while controlling lock timeout' do
@@ -53,7 +71,7 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexDestructor do
end
it 'removes the index preparation record from postgres_async_indexes' do
- expect(async_index).to receive(:destroy).and_call_original
+ expect(async_index).to receive(:destroy!).and_call_original
expect { subject.perform }.to change { index_model.count }.by(-1)
end
@@ -61,9 +79,23 @@ RSpec.describe Gitlab::Database::AsyncIndexes::IndexDestructor do
it 'skips logic if not able to acquire exclusive lease' do
expect(lease).to receive(:try_obtain).ordered.and_return(false)
expect(connection).not_to receive(:execute).with(/DROP INDEX/)
- expect(async_index).not_to receive(:destroy)
+ expect(async_index).not_to receive(:destroy!)
expect { subject.perform }.not_to change { index_model.count }
end
+
+ it 'logs messages around execution' do
+ allow(Gitlab::AppLogger).to receive(:info).and_call_original
+
+ subject.perform
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: 'Starting async index removal'))
+
+ expect(Gitlab::AppLogger)
+ .to have_received(:info)
+ .with(a_hash_including(message: 'Finished async index removal'))
+ end
end
end
diff --git a/spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb b/spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb
index 52f5e37eff2..7c5c368fcb5 100644
--- a/spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes/migration_helpers_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::AsyncIndexes::MigrationHelpers do
+RSpec.describe Gitlab::Database::AsyncIndexes::MigrationHelpers, feature_category: :database do
let(:migration) { ActiveRecord::Migration.new.extend(described_class) }
let(:index_model) { Gitlab::Database::AsyncIndexes::PostgresAsyncIndex }
let(:connection) { ApplicationRecord.connection }
diff --git a/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb b/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
index 806d57af4b3..5e9d4f78a4a 100644
--- a/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes/postgres_async_index_spec.rb
@@ -2,12 +2,13 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::AsyncIndexes::PostgresAsyncIndex, type: :model do
+RSpec.describe Gitlab::Database::AsyncIndexes::PostgresAsyncIndex, type: :model, feature_category: :database do
it { is_expected.to be_a Gitlab::Database::SharedModel }
describe 'validations' do
let(:identifier_limit) { described_class::MAX_IDENTIFIER_LENGTH }
let(:definition_limit) { described_class::MAX_DEFINITION_LENGTH }
+ let(:last_error_limit) { described_class::MAX_LAST_ERROR_LENGTH }
it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_length_of(:name).is_at_most(identifier_limit) }
@@ -15,11 +16,12 @@ RSpec.describe Gitlab::Database::AsyncIndexes::PostgresAsyncIndex, type: :model
it { is_expected.to validate_length_of(:table_name).is_at_most(identifier_limit) }
it { is_expected.to validate_presence_of(:definition) }
it { is_expected.to validate_length_of(:definition).is_at_most(definition_limit) }
+ it { is_expected.to validate_length_of(:last_error).is_at_most(last_error_limit) }
end
describe 'scopes' do
- let!(:async_index_creation) { create(:postgres_async_index) }
- let!(:async_index_destruction) { create(:postgres_async_index, :with_drop) }
+ let_it_be(:async_index_creation) { create(:postgres_async_index) }
+ let_it_be(:async_index_destruction) { create(:postgres_async_index, :with_drop) }
describe '.to_create' do
subject { described_class.to_create }
@@ -32,5 +34,33 @@ RSpec.describe Gitlab::Database::AsyncIndexes::PostgresAsyncIndex, type: :model
it { is_expected.to contain_exactly(async_index_destruction) }
end
+
+ describe '.ordered' do
+ before do
+ async_index_creation.update!(attempts: 3)
+ end
+
+ subject { described_class.ordered.limit(1) }
+
+ it { is_expected.to contain_exactly(async_index_destruction) }
+ end
+ end
+
+ describe '#handle_exception!' do
+ let_it_be_with_reload(:async_index_creation) { create(:postgres_async_index) }
+
+ let(:error) { instance_double(StandardError, message: 'Oups', backtrace: %w[this that]) }
+
+ subject { async_index_creation.handle_exception!(error) }
+
+ it 'increases the attempts number' do
+ expect { subject }.to change { async_index_creation.reload.attempts }.by(1)
+ end
+
+ it 'saves error details' do
+ subject
+
+ expect(async_index_creation.reload.last_error).to eq("Oups\nthis\nthat")
+ end
end
end
diff --git a/spec/lib/gitlab/database/async_indexes_spec.rb b/spec/lib/gitlab/database/async_indexes_spec.rb
index 8a5509f892f..c6991bf4e06 100644
--- a/spec/lib/gitlab/database/async_indexes_spec.rb
+++ b/spec/lib/gitlab/database/async_indexes_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::AsyncIndexes do
+RSpec.describe Gitlab::Database::AsyncIndexes, feature_category: :database do
describe '.create_pending_indexes!' do
subject { described_class.create_pending_indexes! }
@@ -11,9 +11,9 @@ RSpec.describe Gitlab::Database::AsyncIndexes do
end
it 'takes 2 pending indexes and creates those' do
- Gitlab::Database::AsyncIndexes::PostgresAsyncIndex.to_create.order(:id).limit(2).each do |index|
- creator = double('index creator')
- expect(Gitlab::Database::AsyncIndexes::IndexCreator).to receive(:new).with(index).and_return(creator)
+ indexes = described_class::PostgresAsyncIndex.to_create.order(:id).limit(2).to_a
+
+ expect_next_instances_of(described_class::IndexCreator, 2, indexes) do |creator|
expect(creator).to receive(:perform)
end
@@ -29,13 +29,56 @@ RSpec.describe Gitlab::Database::AsyncIndexes do
end
it 'takes 2 pending indexes and destroys those' do
- Gitlab::Database::AsyncIndexes::PostgresAsyncIndex.to_drop.order(:id).limit(2).each do |index|
- destructor = double('index destructor')
- expect(Gitlab::Database::AsyncIndexes::IndexDestructor).to receive(:new).with(index).and_return(destructor)
+ indexes = described_class::PostgresAsyncIndex.to_drop.order(:id).limit(2).to_a
+
+ expect_next_instances_of(described_class::IndexDestructor, 2, indexes) do |destructor|
expect(destructor).to receive(:perform)
end
subject
end
end
+
+ describe '.execute_pending_actions!' do
+ subject { described_class.execute_pending_actions!(how_many: how_many) }
+
+ let_it_be(:failed_creation_entry) { create(:postgres_async_index, attempts: 5) }
+ let_it_be(:failed_removal_entry) { create(:postgres_async_index, :with_drop, attempts: 1) }
+ let_it_be(:creation_entry) { create(:postgres_async_index) }
+ let_it_be(:removal_entry) { create(:postgres_async_index, :with_drop) }
+
+ context 'with one entry' do
+ let(:how_many) { 1 }
+
+ it 'executes instructions ordered by attempts and ids' do
+ expect { subject }
+ .to change { queued_entries_exist?(creation_entry) }.to(false)
+ .and change { described_class::PostgresAsyncIndex.count }.by(-how_many)
+ end
+ end
+
+ context 'with two entries' do
+ let(:how_many) { 2 }
+
+ it 'executes instructions ordered by attempts' do
+ expect { subject }
+ .to change { queued_entries_exist?(creation_entry, removal_entry) }.to(false)
+ .and change { described_class::PostgresAsyncIndex.count }.by(-how_many)
+ end
+ end
+
+ context 'when the budget allows more instructions' do
+ let(:how_many) { 3 }
+
+ it 'retries failed attempts' do
+ expect { subject }
+ .to change { queued_entries_exist?(creation_entry, removal_entry, failed_removal_entry) }.to(false)
+ .and change { described_class::PostgresAsyncIndex.count }.by(-how_many)
+ end
+ end
+
+ def queued_entries_exist?(*records)
+ described_class::PostgresAsyncIndex.where(id: records).exists?
+ end
+ end
end
diff --git a/spec/lib/gitlab/database/load_balancing/sticking_spec.rb b/spec/lib/gitlab/database/load_balancing/sticking_spec.rb
index 1e316c55786..ff31a5cd6cb 100644
--- a/spec/lib/gitlab/database/load_balancing/sticking_spec.rb
+++ b/spec/lib/gitlab/database/load_balancing/sticking_spec.rb
@@ -11,304 +11,319 @@ RSpec.describe Gitlab::Database::LoadBalancing::Sticking, :redis do
Gitlab::Database::LoadBalancing::Session.clear_session
end
- describe '#stick_or_unstick_request' do
- it 'sticks or unsticks a single object and updates the Rack environment' do
- expect(sticking)
- .to receive(:unstick_or_continue_sticking)
- .with(:user, 42)
-
- env = {}
-
- sticking.stick_or_unstick_request(env, :user, 42)
-
- expect(env[Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT].to_a)
- .to eq([[sticking, :user, 42]])
+ shared_examples 'sticking' do
+ before do
+ allow(ActiveRecord::Base.load_balancer)
+ .to receive(:primary_write_location)
+ .and_return('foo')
end
- it 'sticks or unsticks multiple objects and updates the Rack environment' do
- expect(sticking)
- .to receive(:unstick_or_continue_sticking)
- .with(:user, 42)
- .ordered
+ it 'sticks an entity to the primary', :aggregate_failures do
+ allow(ActiveRecord::Base.load_balancer)
+ .to receive(:primary_only?)
+ .and_return(false)
- expect(sticking)
- .to receive(:unstick_or_continue_sticking)
- .with(:runner, '123456789')
- .ordered
+ ids.each do |id|
+ expect(sticking)
+ .to receive(:set_write_location_for)
+ .with(:user, id, 'foo')
+ end
- env = {}
+ expect(Gitlab::Database::LoadBalancing::Session.current)
+ .to receive(:use_primary!)
- sticking.stick_or_unstick_request(env, :user, 42)
- sticking.stick_or_unstick_request(env, :runner, '123456789')
+ subject
+ end
- expect(env[Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT].to_a).to eq(
- [
- [sticking, :user, 42],
- [sticking, :runner,
- '123456789']
- ])
+ it 'does not update the write location when no replicas are used' do
+ expect(sticking).not_to receive(:set_write_location_for)
+
+ subject
end
end
- describe '#stick_if_necessary' do
- it 'does not stick if no write was performed' do
- allow(Gitlab::Database::LoadBalancing::Session.current)
- .to receive(:performed_write?)
- .and_return(false)
+ shared_examples 'tracking status in redis' do
+ describe '#stick_or_unstick_request' do
+ it 'sticks or unsticks a single object and updates the Rack environment' do
+ expect(sticking)
+ .to receive(:unstick_or_continue_sticking)
+ .with(:user, 42)
- expect(sticking).not_to receive(:stick)
+ env = {}
- sticking.stick_if_necessary(:user, 42)
- end
+ sticking.stick_or_unstick_request(env, :user, 42)
- it 'sticks to the primary if a write was performed' do
- allow(Gitlab::Database::LoadBalancing::Session.current)
- .to receive(:performed_write?)
- .and_return(true)
+ expect(env[Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT].to_a)
+ .to eq([[sticking, :user, 42]])
+ end
- expect(sticking)
- .to receive(:stick)
- .with(:user, 42)
+ it 'sticks or unsticks multiple objects and updates the Rack environment' do
+ expect(sticking)
+ .to receive(:unstick_or_continue_sticking)
+ .with(:user, 42)
+ .ordered
- sticking.stick_if_necessary(:user, 42)
- end
- end
+ expect(sticking)
+ .to receive(:unstick_or_continue_sticking)
+ .with(:runner, '123456789')
+ .ordered
- describe '#all_caught_up?' do
- let(:lb) { ActiveRecord::Base.load_balancer }
- let(:last_write_location) { 'foo' }
+ env = {}
- before do
- allow(ActiveSupport::Notifications).to receive(:instrument).and_call_original
+ sticking.stick_or_unstick_request(env, :user, 42)
+ sticking.stick_or_unstick_request(env, :runner, '123456789')
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:user, 42)
- .and_return(last_write_location)
+ expect(env[Gitlab::Database::LoadBalancing::RackMiddleware::STICK_OBJECT].to_a).to eq(
+ [
+ [sticking, :user, 42],
+ [sticking, :runner,
+ '123456789']
+ ])
+ end
end
- context 'when no write location could be found' do
- let(:last_write_location) { nil }
+ describe '#stick_if_necessary' do
+ it 'does not stick if no write was performed' do
+ allow(Gitlab::Database::LoadBalancing::Session.current)
+ .to receive(:performed_write?)
+ .and_return(false)
- it 'returns true' do
- expect(lb).not_to receive(:select_up_to_date_host)
+ expect(sticking).not_to receive(:stick)
- expect(sticking.all_caught_up?(:user, 42)).to eq(true)
+ sticking.stick_if_necessary(:user, 42)
end
- end
- context 'when all secondaries have caught up' do
- before do
- allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(true)
- end
+ it 'sticks to the primary if a write was performed' do
+ allow(Gitlab::Database::LoadBalancing::Session.current)
+ .to receive(:performed_write?)
+ .and_return(true)
- it 'returns true, and unsticks' do
expect(sticking)
- .to receive(:unstick)
+ .to receive(:stick)
.with(:user, 42)
- expect(sticking.all_caught_up?(:user, 42)).to eq(true)
- end
-
- it 'notifies with the proper event payload' do
- expect(ActiveSupport::Notifications)
- .to receive(:instrument)
- .with('caught_up_replica_pick.load_balancing', { result: true })
- .and_call_original
-
- sticking.all_caught_up?(:user, 42)
+ sticking.stick_if_necessary(:user, 42)
end
end
- context 'when the secondaries have not yet caught up' do
+ describe '#all_caught_up?' do
+ let(:lb) { ActiveRecord::Base.load_balancer }
+ let(:last_write_location) { 'foo' }
+
before do
- allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(false)
- end
+ allow(ActiveSupport::Notifications).to receive(:instrument).and_call_original
- it 'returns false' do
- expect(sticking.all_caught_up?(:user, 42)).to eq(false)
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:user, 42)
+ .and_return(last_write_location)
end
- it 'notifies with the proper event payload' do
- expect(ActiveSupport::Notifications)
- .to receive(:instrument)
- .with('caught_up_replica_pick.load_balancing', { result: false })
- .and_call_original
+ context 'when no write location could be found' do
+ let(:last_write_location) { nil }
+
+ it 'returns true' do
+ expect(lb).not_to receive(:select_up_to_date_host)
- sticking.all_caught_up?(:user, 42)
+ expect(sticking.all_caught_up?(:user, 42)).to eq(true)
+ end
end
- end
- end
- describe '#unstick_or_continue_sticking' do
- let(:lb) { ActiveRecord::Base.load_balancer }
+ context 'when all secondaries have caught up' do
+ before do
+ allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(true)
+ end
- it 'simply returns if no write location could be found' do
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:user, 42)
- .and_return(nil)
+ it 'returns true, and unsticks' do
+ expect(sticking)
+ .to receive(:unstick)
+ .with(:user, 42)
- expect(lb).not_to receive(:select_up_to_date_host)
+ expect(sticking.all_caught_up?(:user, 42)).to eq(true)
+ end
- sticking.unstick_or_continue_sticking(:user, 42)
- end
+ it 'notifies with the proper event payload' do
+ expect(ActiveSupport::Notifications)
+ .to receive(:instrument)
+ .with('caught_up_replica_pick.load_balancing', { result: true })
+ .and_call_original
- it 'unsticks if all secondaries have caught up' do
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:user, 42)
- .and_return('foo')
+ sticking.all_caught_up?(:user, 42)
+ end
+ end
- allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(true)
+ context 'when the secondaries have not yet caught up' do
+ before do
+ allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(false)
+ end
- expect(sticking)
- .to receive(:unstick)
- .with(:user, 42)
+ it 'returns false' do
+ expect(sticking.all_caught_up?(:user, 42)).to eq(false)
+ end
- sticking.unstick_or_continue_sticking(:user, 42)
+ it 'notifies with the proper event payload' do
+ expect(ActiveSupport::Notifications)
+ .to receive(:instrument)
+ .with('caught_up_replica_pick.load_balancing', { result: false })
+ .and_call_original
+
+ sticking.all_caught_up?(:user, 42)
+ end
+ end
end
- it 'continues using the primary if the secondaries have not yet caught up' do
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:user, 42)
- .and_return('foo')
+ describe '#unstick_or_continue_sticking' do
+ let(:lb) { ActiveRecord::Base.load_balancer }
- allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(false)
+ it 'simply returns if no write location could be found' do
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:user, 42)
+ .and_return(nil)
- expect(Gitlab::Database::LoadBalancing::Session.current)
- .to receive(:use_primary!)
+ expect(lb).not_to receive(:select_up_to_date_host)
- sticking.unstick_or_continue_sticking(:user, 42)
- end
- end
+ sticking.unstick_or_continue_sticking(:user, 42)
+ end
- RSpec.shared_examples 'sticking' do
- before do
- allow(ActiveRecord::Base.load_balancer)
- .to receive(:primary_write_location)
- .and_return('foo')
- end
+ it 'unsticks if all secondaries have caught up' do
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:user, 42)
+ .and_return('foo')
- it 'sticks an entity to the primary', :aggregate_failures do
- allow(ActiveRecord::Base.load_balancer)
- .to receive(:primary_only?)
- .and_return(false)
+ allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(true)
- ids.each do |id|
expect(sticking)
- .to receive(:set_write_location_for)
- .with(:user, id, 'foo')
+ .to receive(:unstick)
+ .with(:user, 42)
+
+ sticking.unstick_or_continue_sticking(:user, 42)
end
- expect(Gitlab::Database::LoadBalancing::Session.current)
- .to receive(:use_primary!)
+ it 'continues using the primary if the secondaries have not yet caught up' do
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:user, 42)
+ .and_return('foo')
- subject
- end
+ allow(lb).to receive(:select_up_to_date_host).with('foo').and_return(false)
- it 'does not update the write location when no replicas are used' do
- expect(sticking).not_to receive(:set_write_location_for)
+ expect(Gitlab::Database::LoadBalancing::Session.current)
+ .to receive(:use_primary!)
- subject
+ sticking.unstick_or_continue_sticking(:user, 42)
+ end
end
- end
- describe '#stick' do
- it_behaves_like 'sticking' do
- let(:ids) { [42] }
- subject { sticking.stick(:user, ids.first) }
+ describe '#stick' do
+ it_behaves_like 'sticking' do
+ let(:ids) { [42] }
+ subject { sticking.stick(:user, ids.first) }
+ end
end
- end
- describe '#bulk_stick' do
- it_behaves_like 'sticking' do
- let(:ids) { [42, 43] }
- subject { sticking.bulk_stick(:user, ids) }
+ describe '#bulk_stick' do
+ it_behaves_like 'sticking' do
+ let(:ids) { [42, 43] }
+ subject { sticking.bulk_stick(:user, ids) }
+ end
end
- end
- describe '#mark_primary_write_location' do
- it 'updates the write location with the load balancer' do
- allow(ActiveRecord::Base.load_balancer)
- .to receive(:primary_write_location)
- .and_return('foo')
+ describe '#mark_primary_write_location' do
+ it 'updates the write location with the load balancer' do
+ allow(ActiveRecord::Base.load_balancer)
+ .to receive(:primary_write_location)
+ .and_return('foo')
- allow(ActiveRecord::Base.load_balancer)
- .to receive(:primary_only?)
- .and_return(false)
+ allow(ActiveRecord::Base.load_balancer)
+ .to receive(:primary_only?)
+ .and_return(false)
+
+ expect(sticking)
+ .to receive(:set_write_location_for)
+ .with(:user, 42, 'foo')
+
+ sticking.mark_primary_write_location(:user, 42)
+ end
- expect(sticking)
- .to receive(:set_write_location_for)
- .with(:user, 42, 'foo')
+ it 'does nothing when no replicas are used' do
+ expect(sticking).not_to receive(:set_write_location_for)
- sticking.mark_primary_write_location(:user, 42)
+ sticking.mark_primary_write_location(:user, 42)
+ end
end
- it 'does nothing when no replicas are used' do
- expect(sticking).not_to receive(:set_write_location_for)
+ describe '#unstick' do
+ it 'removes the sticking data from Redis' do
+ sticking.set_write_location_for(:user, 4, 'foo')
+ sticking.unstick(:user, 4)
- sticking.mark_primary_write_location(:user, 42)
+ expect(sticking.last_write_location_for(:user, 4)).to be_nil
+ end
end
- end
- describe '#unstick' do
- it 'removes the sticking data from Redis' do
- sticking.set_write_location_for(:user, 4, 'foo')
- sticking.unstick(:user, 4)
+ describe '#last_write_location_for' do
+ it 'returns the last WAL write location for a user' do
+ sticking.set_write_location_for(:user, 4, 'foo')
- expect(sticking.last_write_location_for(:user, 4)).to be_nil
+ expect(sticking.last_write_location_for(:user, 4)).to eq('foo')
+ end
end
- end
- describe '#last_write_location_for' do
- it 'returns the last WAL write location for a user' do
- sticking.set_write_location_for(:user, 4, 'foo')
+ describe '#select_caught_up_replicas' do
+ let(:lb) { ActiveRecord::Base.load_balancer }
+
+ context 'with no write location' do
+ before do
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:project, 42)
+ .and_return(nil)
+ end
+
+ it 'returns false and does not try to find caught up hosts' do
+ expect(lb).not_to receive(:select_up_to_date_host)
+ expect(sticking.select_caught_up_replicas(:project, 42)).to be false
+ end
+ end
- expect(sticking.last_write_location_for(:user, 4)).to eq('foo')
+ context 'with write location' do
+ before do
+ allow(sticking)
+ .to receive(:last_write_location_for)
+ .with(:project, 42)
+ .and_return('foo')
+ end
+
+ it 'returns true, selects hosts, and unsticks if any secondary has caught up' do
+ expect(lb).to receive(:select_up_to_date_host).and_return(true)
+ expect(sticking)
+ .to receive(:unstick)
+ .with(:project, 42)
+ expect(sticking.select_caught_up_replicas(:project, 42)).to be true
+ end
+ end
end
end
- describe '#redis_key_for' do
- it 'returns a String' do
- expect(sticking.redis_key_for(:user, 42))
- .to eq('database-load-balancing/write-location/main/user/42')
- end
+ context 'with multi-store feature flags turned on' do
+ it_behaves_like 'tracking status in redis'
end
- describe '#select_caught_up_replicas' do
- let(:lb) { ActiveRecord::Base.load_balancer }
-
- context 'with no write location' do
- before do
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:project, 42)
- .and_return(nil)
- end
-
- it 'returns false and does not try to find caught up hosts' do
- expect(lb).not_to receive(:select_up_to_date_host)
- expect(sticking.select_caught_up_replicas(:project, 42)).to be false
- end
+ context 'when both multi-store feature flags are off' do
+ before do
+ stub_feature_flags(use_primary_and_secondary_stores_for_db_load_balancing: false)
+ stub_feature_flags(use_primary_store_as_default_for_db_load_balancing: false)
end
- context 'with write location' do
- before do
- allow(sticking)
- .to receive(:last_write_location_for)
- .with(:project, 42)
- .and_return('foo')
- end
+ it_behaves_like 'tracking status in redis'
+ end
- it 'returns true, selects hosts, and unsticks if any secondary has caught up' do
- expect(lb).to receive(:select_up_to_date_host).and_return(true)
- expect(sticking)
- .to receive(:unstick)
- .with(:project, 42)
- expect(sticking.select_caught_up_replicas(:project, 42)).to be true
- end
+ describe '#redis_key_for' do
+ it 'returns a String' do
+ expect(sticking.redis_key_for(:user, 42))
+ .to eq('database-load-balancing/write-location/main/user/42')
end
end
end
diff --git a/spec/lib/gitlab/redis/db_load_balancing_spec.rb b/spec/lib/gitlab/redis/db_load_balancing_spec.rb
new file mode 100644
index 00000000000..d633413ddec
--- /dev/null
+++ b/spec/lib/gitlab/redis/db_load_balancing_spec.rb
@@ -0,0 +1,52 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Gitlab::Redis::DbLoadBalancing, feature_category: :scalability do
+ include_examples "redis_new_instance_shared_examples", 'db_load_balancing', Gitlab::Redis::SharedState
+ include_examples "redis_shared_examples"
+
+ describe '#pool' do
+ let(:config_new_format_host) { "spec/fixtures/config/redis_new_format_host.yml" }
+ let(:config_new_format_socket) { "spec/fixtures/config/redis_new_format_socket.yml" }
+
+ subject { described_class.pool }
+
+ before do
+ allow(described_class).to receive(:config_file_name).and_return(config_new_format_host)
+
+ # Override rails root to avoid having our fixtures overwritten by `redis.yml` if it exists
+ allow(Gitlab::Redis::SharedState).to receive(:rails_root).and_return(mktmpdir)
+ allow(Gitlab::Redis::SharedState).to receive(:config_file_name).and_return(config_new_format_socket)
+ end
+
+ around do |example|
+ clear_pool
+ example.run
+ ensure
+ clear_pool
+ end
+
+ it 'instantiates an instance of MultiStore' do
+ subject.with do |redis_instance|
+ expect(redis_instance).to be_instance_of(::Gitlab::Redis::MultiStore)
+
+ expect(redis_instance.primary_store.connection[:id]).to eq("redis://test-host:6379/99")
+ expect(redis_instance.secondary_store.connection[:id]).to eq("unix:///path/to/redis.sock/0")
+
+ expect(redis_instance.instance_name).to eq('DbLoadBalancing')
+ end
+ end
+
+ it_behaves_like 'multi store feature flags', :use_primary_and_secondary_stores_for_db_load_balancing,
+ :use_primary_store_as_default_for_db_load_balancing
+ end
+
+ describe '#raw_config_hash' do
+ it 'has a legacy default URL' do
+ expect(subject).to receive(:fetch_config).and_return(false)
+
+ expect(subject.send(:raw_config_hash)).to eq(url: 'redis://localhost:6382')
+ end
+ end
+end
diff --git a/spec/migrations/20210603222333_remove_builds_email_service_from_services_spec.rb b/spec/migrations/20210603222333_remove_builds_email_service_from_services_spec.rb
deleted file mode 100644
index 706e0b14492..00000000000
--- a/spec/migrations/20210603222333_remove_builds_email_service_from_services_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RemoveBuildsEmailServiceFromServices, feature_category: :navigation do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:services) { table(:services) }
- let(:namespace) { namespaces.create!(name: 'foo', path: 'bar') }
- let(:project) { projects.create!(namespace_id: namespace.id) }
-
- it 'correctly deletes `BuildsEmailService` services' do
- services.create!(project_id: project.id, type: 'BuildsEmailService')
- services.create!(project_id: project.id, type: 'OtherService')
-
- expect(services.all.pluck(:type)).to match_array %w[BuildsEmailService OtherService]
-
- migrate!
-
- expect(services.all.pluck(:type)).to eq %w[OtherService]
- end
-end
diff --git a/spec/migrations/20210610153556_delete_legacy_operations_feature_flags_spec.rb b/spec/migrations/20210610153556_delete_legacy_operations_feature_flags_spec.rb
deleted file mode 100644
index 300c43b9133..00000000000
--- a/spec/migrations/20210610153556_delete_legacy_operations_feature_flags_spec.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe DeleteLegacyOperationsFeatureFlags, feature_category: :feature_flags do
- let(:namespace) { table(:namespaces).create!(name: 'foo', path: 'bar') }
- let(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let(:issue) { table(:issues).create!(id: 123, project_id: project.id) }
- let(:operations_feature_flags) { table(:operations_feature_flags) }
- let(:operations_feature_flag_scopes) { table(:operations_feature_flag_scopes) }
- let(:operations_strategies) { table(:operations_strategies) }
- let(:operations_scopes) { table(:operations_scopes) }
- let(:operations_feature_flags_issues) { table(:operations_feature_flags_issues) }
-
- it 'correctly deletes legacy feature flags' do
- # Legacy version of a feature flag - dropped support in GitLab 14.0.
- legacy_flag = operations_feature_flags.create!(project_id: project.id, version: 1, name: 'flag_a', active: true, iid: 1)
- operations_feature_flag_scopes.create!(feature_flag_id: legacy_flag.id, active: true)
- operations_feature_flags_issues.create!(feature_flag_id: legacy_flag.id, issue_id: issue.id)
- # New version of a feature flag.
- new_flag = operations_feature_flags.create!(project_id: project.id, version: 2, name: 'flag_b', active: true, iid: 2)
- new_strategy = operations_strategies.create!(feature_flag_id: new_flag.id, name: 'default')
- operations_scopes.create!(strategy_id: new_strategy.id, environment_scope: '*')
- operations_feature_flags_issues.create!(feature_flag_id: new_flag.id, issue_id: issue.id)
-
- expect(operations_feature_flags.all.pluck(:version)).to contain_exactly(1, 2)
- expect(operations_feature_flag_scopes.count).to eq(1)
- expect(operations_strategies.count).to eq(1)
- expect(operations_scopes.count).to eq(1)
- expect(operations_feature_flags_issues.all.pluck(:feature_flag_id)).to contain_exactly(legacy_flag.id, new_flag.id)
-
- migrate!
-
- # Legacy flag is deleted.
- expect(operations_feature_flags.all.pluck(:version)).to contain_exactly(2)
- # The associated entries of the legacy flag are deleted too.
- expect(operations_feature_flag_scopes.count).to eq(0)
- # The associated entries of the new flag stay instact.
- expect(operations_strategies.count).to eq(1)
- expect(operations_scopes.count).to eq(1)
- expect(operations_feature_flags_issues.all.pluck(:feature_flag_id)).to contain_exactly(new_flag.id)
- end
-end
diff --git a/spec/migrations/2021061716138_cascade_delete_freeze_periods_spec.rb b/spec/migrations/2021061716138_cascade_delete_freeze_periods_spec.rb
deleted file mode 100644
index baa5fd7efbd..00000000000
--- a/spec/migrations/2021061716138_cascade_delete_freeze_periods_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe CascadeDeleteFreezePeriods, :suppress_gitlab_schemas_validate_connection, feature_category: :continuous_delivery do
- let(:namespace) { table(:namespaces).create!(name: 'deploy_freeze', path: 'deploy_freeze') }
- let(:project) { table(:projects).create!(id: 1, namespace_id: namespace.id) }
- let(:freeze_periods) { table(:ci_freeze_periods) }
-
- describe "#up" do
- it 'allows for a project to be deleted' do
- freeze_periods.create!(id: 1, project_id: project.id, freeze_start: '5 * * * *', freeze_end: '6 * * * *', cron_timezone: 'UTC')
- migrate!
-
- project.delete
-
- expect(freeze_periods.where(project_id: project.id).count).to be_zero
- end
- end
-end
diff --git a/spec/migrations/20210708130419_reschedule_merge_request_diff_users_background_migration_spec.rb b/spec/migrations/20210708130419_reschedule_merge_request_diff_users_background_migration_spec.rb
deleted file mode 100644
index 0f202129e82..00000000000
--- a/spec/migrations/20210708130419_reschedule_merge_request_diff_users_background_migration_spec.rb
+++ /dev/null
@@ -1,76 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RescheduleMergeRequestDiffUsersBackgroundMigration,
- :migration, feature_category: :code_review_workflow do
- let(:migration) { described_class.new }
-
- describe '#up' do
- before do
- allow(described_class::MergeRequestDiff)
- .to receive(:minimum)
- .with(:id)
- .and_return(42)
-
- allow(described_class::MergeRequestDiff)
- .to receive(:maximum)
- .with(:id)
- .and_return(85_123)
- end
-
- it 'deletes existing background migration job records' do
- args = [150_000, 300_000]
-
- Gitlab::Database::BackgroundMigrationJob
- .create!(class_name: described_class::MIGRATION_NAME, arguments: args)
-
- migration.up
-
- found = Gitlab::Database::BackgroundMigrationJob
- .where(class_name: described_class::MIGRATION_NAME, arguments: args)
- .count
-
- expect(found).to eq(0)
- end
-
- it 'schedules the migrations in batches' do
- expect(migration)
- .to receive(:migrate_in)
- .ordered
- .with(2.minutes.to_i, described_class::MIGRATION_NAME, [42, 40_042])
-
- expect(migration)
- .to receive(:migrate_in)
- .ordered
- .with(4.minutes.to_i, described_class::MIGRATION_NAME, [40_042, 80_042])
-
- expect(migration)
- .to receive(:migrate_in)
- .ordered
- .with(6.minutes.to_i, described_class::MIGRATION_NAME, [80_042, 120_042])
-
- migration.up
- end
-
- it 'creates rows to track the background migration jobs' do
- expect(Gitlab::Database::BackgroundMigrationJob)
- .to receive(:create!)
- .ordered
- .with(class_name: described_class::MIGRATION_NAME, arguments: [42, 40_042])
-
- expect(Gitlab::Database::BackgroundMigrationJob)
- .to receive(:create!)
- .ordered
- .with(class_name: described_class::MIGRATION_NAME, arguments: [40_042, 80_042])
-
- expect(Gitlab::Database::BackgroundMigrationJob)
- .to receive(:create!)
- .ordered
- .with(class_name: described_class::MIGRATION_NAME, arguments: [80_042, 120_042])
-
- migration.up
- end
- end
-end
diff --git a/spec/migrations/20210713042000_fix_ci_sources_pipelines_index_names_spec.rb b/spec/migrations/20210713042000_fix_ci_sources_pipelines_index_names_spec.rb
deleted file mode 100644
index 6761b69aed5..00000000000
--- a/spec/migrations/20210713042000_fix_ci_sources_pipelines_index_names_spec.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe FixCiSourcesPipelinesIndexNames, :migration, feature_category: :continuous_integration do
- def validate_foreign_keys_and_index!
- aggregate_failures do
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_be5624bf37')).to be_truthy
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_pipelines, column: :pipeline_id, name: 'fk_e1bad85861')).to be_truthy
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_pipelines, column: :source_pipeline_id, name: 'fk_d4e29af7d7')).to be_truthy
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :projects, column: :source_project_id, name: 'fk_acd9737679')).to be_truthy
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :projects, name: 'fk_1e53c97c0a')).to be_truthy
- expect(subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id_convert_to_bigint, name: 'fk_be5624bf37_tmp')).to be_falsey
-
- expect(subject.index_exists_by_name?(:ci_sources_pipelines, described_class::NEW_INDEX_NAME)).to be_truthy
- expect(subject.index_exists_by_name?(:ci_sources_pipelines, described_class::OLD_INDEX_NAME)).to be_falsey
- end
- end
-
- it 'existing foreign keys and indexes are untouched' do
- validate_foreign_keys_and_index!
-
- migrate!
-
- validate_foreign_keys_and_index!
- end
-
- context 'with a legacy (pre-GitLab 10.0) foreign key' do
- let(:old_foreign_keys) { described_class::OLD_TO_NEW_FOREIGN_KEY_DEFS.keys }
- let(:new_foreign_keys) { described_class::OLD_TO_NEW_FOREIGN_KEY_DEFS.values.map { |entry| entry[:name] } }
-
- before do
- new_foreign_keys.each { |name| subject.remove_foreign_key_if_exists(:ci_sources_pipelines, name: name) }
-
- # GitLab 9.5.4: https://gitlab.com/gitlab-org/gitlab/-/blob/v9.5.4-ee/db/schema.rb#L2026-2030
- subject.add_foreign_key(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc', on_delete: :cascade)
- subject.add_foreign_key(:ci_sources_pipelines, :ci_pipelines, column: :pipeline_id, name: "fk_b8c0fac459", on_delete: :cascade)
- subject.add_foreign_key(:ci_sources_pipelines, :ci_pipelines, column: :source_pipeline_id, name: "fk_3a3e3cb83a", on_delete: :cascade)
- subject.add_foreign_key(:ci_sources_pipelines, :projects, column: :source_project_id, name: "fk_8868d0f3e4", on_delete: :cascade)
- subject.add_foreign_key(:ci_sources_pipelines, :projects, name: "fk_83b4346e48", on_delete: :cascade)
-
- # https://gitlab.com/gitlab-org/gitlab/-/blob/v9.5.4-ee/db/schema.rb#L443
- subject.add_index "ci_sources_pipelines", ["source_job_id"], name: described_class::OLD_INDEX_NAME, using: :btree
- end
-
- context 'when new index already exists' do
- it 'corrects foreign key constraints and drops old index' do
- expect { migrate! }.to change { subject.foreign_key_exists?(:ci_sources_pipelines, :ci_builds, column: :source_job_id, name: 'fk_3f0c88d7dc') }.from(true).to(false)
-
- validate_foreign_keys_and_index!
- end
- end
-
- context 'when new index does not exist' do
- before do
- subject.remove_index("ci_sources_pipelines", name: described_class::NEW_INDEX_NAME)
- end
-
- it 'drops the old index' do
- expect { migrate! }.to change { subject.index_exists_by_name?(:ci_sources_pipelines, described_class::OLD_INDEX_NAME) }.from(true).to(false)
-
- validate_foreign_keys_and_index!
- end
- end
- end
-end
diff --git a/spec/migrations/20210722042939_update_issuable_slas_where_issue_closed_spec.rb b/spec/migrations/20210722042939_update_issuable_slas_where_issue_closed_spec.rb
deleted file mode 100644
index 5674efbf187..00000000000
--- a/spec/migrations/20210722042939_update_issuable_slas_where_issue_closed_spec.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe UpdateIssuableSlasWhereIssueClosed, :migration, feature_category: :team_planning do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:issues) { table(:issues) }
- let(:issuable_slas) { table(:issuable_slas) }
- let(:issue_params) { { title: 'title', project_id: project.id } }
- let(:issue_closed_state) { 2 }
-
- let!(:namespace) { namespaces.create!(name: 'foo', path: 'foo') }
- let!(:project) { projects.create!(namespace_id: namespace.id) }
- let!(:issue_open) { issues.create!(issue_params) }
- let!(:issue_closed) { issues.create!(issue_params.merge(state_id: issue_closed_state)) }
-
- let!(:issuable_sla_open_issue) { issuable_slas.create!(issue_id: issue_open.id, due_at: Time.now) }
- let!(:issuable_sla_closed_issue) { issuable_slas.create!(issue_id: issue_closed.id, due_at: Time.now) }
-
- it 'sets the issuable_closed attribute to false' do
- expect(issuable_sla_open_issue.issuable_closed).to eq(false)
- expect(issuable_sla_closed_issue.issuable_closed).to eq(false)
-
- migrate!
-
- expect(issuable_sla_open_issue.reload.issuable_closed).to eq(false)
- expect(issuable_sla_closed_issue.reload.issuable_closed).to eq(true)
- end
-end
diff --git a/spec/migrations/20210722150102_operations_feature_flags_correct_flexible_rollout_values_spec.rb b/spec/migrations/20210722150102_operations_feature_flags_correct_flexible_rollout_values_spec.rb
deleted file mode 100644
index 098dd647b27..00000000000
--- a/spec/migrations/20210722150102_operations_feature_flags_correct_flexible_rollout_values_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe OperationsFeatureFlagsCorrectFlexibleRolloutValues, :migration, feature_category: :feature_flags do
- let!(:strategies) { table(:operations_strategies) }
-
- let(:namespace) { table(:namespaces).create!(name: 'feature_flag', path: 'feature_flag') }
- let(:project) { table(:projects).create!(namespace_id: namespace.id) }
- let(:feature_flag) { table(:operations_feature_flags).create!(project_id: project.id, active: true, name: 'foo', iid: 1) }
-
- describe "#up" do
- described_class::STICKINESS.each do |old, new|
- it "corrects parameters for flexible rollout stickiness #{old}" do
- reversible_migration do |migration|
- parameters = { groupId: "default", rollout: "100", stickiness: old }
- strategy = create_strategy(parameters)
-
- migration.before -> {
- expect(strategy.reload.parameters).to eq({ "groupId" => "default", "rollout" => "100", "stickiness" => old })
- }
-
- migration.after -> {
- expect(strategy.reload.parameters).to eq({ "groupId" => "default", "rollout" => "100", "stickiness" => new })
- }
- end
- end
- end
-
- it 'ignores other strategies' do
- reversible_migration do |migration|
- parameters = { "groupId" => "default", "rollout" => "100", "stickiness" => "USERID" }
- strategy = create_strategy(parameters, name: 'default')
-
- migration.before -> {
- expect(strategy.reload.parameters).to eq(parameters)
- }
-
- migration.after -> {
- expect(strategy.reload.parameters).to eq(parameters)
- }
- end
- end
-
- it 'ignores other stickiness' do
- reversible_migration do |migration|
- parameters = { "groupId" => "default", "rollout" => "100", "stickiness" => "FOO" }
- strategy = create_strategy(parameters)
-
- migration.before -> {
- expect(strategy.reload.parameters).to eq(parameters)
- }
-
- migration.after -> {
- expect(strategy.reload.parameters).to eq(parameters)
- }
- end
- end
- end
-
- def create_strategy(params, name: 'flexibleRollout')
- strategies.create!(name: name, parameters: params, feature_flag_id: feature_flag.id)
- end
-end
diff --git a/spec/migrations/20210804150320_create_base_work_item_types_spec.rb b/spec/migrations/20210804150320_create_base_work_item_types_spec.rb
deleted file mode 100644
index e7f76eb0ae0..00000000000
--- a/spec/migrations/20210804150320_create_base_work_item_types_spec.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe CreateBaseWorkItemTypes, :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
-
- # We use append_after to make sure this runs after the schema was reset to its latest state
- 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 'creates default data' do
- # Need to delete all as base types are seeded before entire test suite
- work_item_types.delete_all
-
- 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
- }
-
- 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
diff --git a/spec/migrations/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers_spec.rb b/spec/migrations/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers_spec.rb
deleted file mode 100644
index d18673db757..00000000000
--- a/spec/migrations/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers_spec.rb
+++ /dev/null
@@ -1,137 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe UpdateTrialPlansCiDailyPipelineScheduleTriggers, :migration, feature_category: :purchase do
- let!(:plans) { table(:plans) }
- let!(:plan_limits) { table(:plan_limits) }
- let!(:premium_trial_plan) { plans.create!(name: 'premium_trial', title: 'Premium Trial') }
- let!(:ultimate_trial_plan) { plans.create!(name: 'ultimate_trial', title: 'Ultimate Trial') }
-
- describe '#up' do
- let!(:premium_trial_plan_limits) { plan_limits.create!(plan_id: premium_trial_plan.id, ci_daily_pipeline_schedule_triggers: 0) }
- let!(:ultimate_trial_plan_limits) { plan_limits.create!(plan_id: ultimate_trial_plan.id, ci_daily_pipeline_schedule_triggers: 0) }
-
- context 'when the environment is dev or com' do
- before do
- allow(Gitlab).to receive(:com?).and_return(true)
- end
-
- it 'sets the trial plan limits for ci_daily_pipeline_schedule_triggers' do
- disable_migrations_output { migrate! }
-
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
-
- it 'does not change the plan limits if the ultimate trial plan is missing' do
- ultimate_trial_plan.destroy!
-
- expect { disable_migrations_output { migrate! } }.not_to change { plan_limits.count }
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
-
- it 'does not change the plan limits if the ultimate trial plan limits is missing' do
- ultimate_trial_plan_limits.destroy!
-
- expect { disable_migrations_output { migrate! } }.not_to change { plan_limits.count }
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
-
- it 'does not change the plan limits if the premium trial plan is missing' do
- premium_trial_plan.destroy!
-
- expect { disable_migrations_output { migrate! } }.not_to change { plan_limits.count }
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
-
- it 'does not change the plan limits if the premium trial plan limits is missing' do
- premium_trial_plan_limits.destroy!
-
- expect { disable_migrations_output { migrate! } }.not_to change { plan_limits.count }
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
- end
-
- context 'when the environment is anything other than dev or com' do
- before do
- allow(Gitlab).to receive(:com?).and_return(false)
- end
-
- it 'does not update the plan limits' do
- disable_migrations_output { migrate! }
-
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
- end
- end
-
- describe '#down' do
- let!(:premium_trial_plan_limits) { plan_limits.create!(plan_id: premium_trial_plan.id, ci_daily_pipeline_schedule_triggers: 288) }
- let!(:ultimate_trial_plan_limits) { plan_limits.create!(plan_id: ultimate_trial_plan.id, ci_daily_pipeline_schedule_triggers: 288) }
-
- context 'when the environment is dev or com' do
- before do
- allow(Gitlab).to receive(:com?).and_return(true)
- end
-
- it 'sets the trial plan limits ci_daily_pipeline_schedule_triggers to zero' do
- migrate_down!
-
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(0)
- end
-
- it 'does not change the plan limits if the ultimate trial plan is missing' do
- ultimate_trial_plan.destroy!
-
- expect { migrate_down! }.not_to change { plan_limits.count }
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
-
- it 'does not change the plan limits if the ultimate trial plan limits is missing' do
- ultimate_trial_plan_limits.destroy!
-
- expect { migrate_down! }.not_to change { plan_limits.count }
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
-
- it 'does not change the plan limits if the premium trial plan is missing' do
- premium_trial_plan.destroy!
-
- expect { migrate_down! }.not_to change { plan_limits.count }
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
-
- it 'does not change the plan limits if the premium trial plan limits is missing' do
- premium_trial_plan_limits.destroy!
-
- expect { migrate_down! }.not_to change { plan_limits.count }
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
- end
-
- context 'when the environment is anything other than dev or com' do
- before do
- allow(Gitlab).to receive(:com?).and_return(false)
- end
-
- it 'does not change the ultimate trial plan limits' do
- migrate_down!
-
- expect(ultimate_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- expect(premium_trial_plan_limits.reload.ci_daily_pipeline_schedule_triggers).to eq(288)
- end
- end
- end
-
- def migrate_down!
- disable_migrations_output do
- migrate!
- described_class.new.down
- end
- end
-end
diff --git a/spec/migrations/20210811122206_update_external_project_bots_spec.rb b/spec/migrations/20210811122206_update_external_project_bots_spec.rb
deleted file mode 100644
index b18239f4fd5..00000000000
--- a/spec/migrations/20210811122206_update_external_project_bots_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe UpdateExternalProjectBots, :migration, feature_category: :user_profile do
- def create_user(**extra_options)
- defaults = { projects_limit: 0, email: "#{extra_options[:username]}@example.com" }
-
- table(:users).create!(defaults.merge(extra_options))
- end
-
- it 'sets bot users as external if were created by external users' do
- internal_user = create_user(username: 'foo')
- external_user = create_user(username: 'bar', external: true)
-
- internal_project_bot = create_user(username: 'foo2', user_type: 6, created_by_id: internal_user.id, external: false)
- external_project_bot = create_user(username: 'bar2', user_type: 6, created_by_id: external_user.id, external: false)
-
- migrate!
-
- expect(table(:users).find(internal_project_bot.id).external).to eq false
- expect(table(:users).find(external_project_bot.id).external).to eq true
- end
-end
diff --git a/spec/migrations/20210812013042_remove_duplicate_project_authorizations_spec.rb b/spec/migrations/20210812013042_remove_duplicate_project_authorizations_spec.rb
deleted file mode 100644
index fcc2e1657d0..00000000000
--- a/spec/migrations/20210812013042_remove_duplicate_project_authorizations_spec.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!('remove_duplicate_project_authorizations')
-
-RSpec.describe RemoveDuplicateProjectAuthorizations, :migration, feature_category: :authentication_and_authorization do
- let(:users) { table(:users) }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:project_authorizations) { table(:project_authorizations) }
-
- let!(:user_1) { users.create! email: 'user1@example.com', projects_limit: 0 }
- let!(:user_2) { users.create! email: 'user2@example.com', projects_limit: 0 }
- let!(:namespace_1) { namespaces.create! name: 'namespace 1', path: 'namespace1' }
- let!(:namespace_2) { namespaces.create! name: 'namespace 2', path: 'namespace2' }
- let!(:project_1) { projects.create! namespace_id: namespace_1.id }
- let!(:project_2) { projects.create! namespace_id: namespace_2.id }
-
- before do
- stub_const("#{described_class.name}::BATCH_SIZE", 2)
- end
-
- describe '#up' do
- subject { migrate! }
-
- context 'User with multiple projects' do
- before do
- project_authorizations.create! project_id: project_1.id, user_id: user_1.id, access_level: Gitlab::Access::DEVELOPER
- project_authorizations.create! project_id: project_2.id, user_id: user_1.id, access_level: Gitlab::Access::DEVELOPER
- end
-
- it { expect { subject }.not_to change { ProjectAuthorization.count } }
- end
-
- context 'Project with multiple users' do
- before do
- project_authorizations.create! project_id: project_1.id, user_id: user_1.id, access_level: Gitlab::Access::DEVELOPER
- project_authorizations.create! project_id: project_1.id, user_id: user_2.id, access_level: Gitlab::Access::DEVELOPER
- end
-
- it { expect { subject }.not_to change { ProjectAuthorization.count } }
- end
-
- context 'Same project and user but different access level' do
- before do
- project_authorizations.create! project_id: project_1.id, user_id: user_1.id, access_level: Gitlab::Access::DEVELOPER
- project_authorizations.create! project_id: project_1.id, user_id: user_1.id, access_level: Gitlab::Access::MAINTAINER
- project_authorizations.create! project_id: project_1.id, user_id: user_1.id, access_level: Gitlab::Access::REPORTER
- end
-
- it { expect { subject }.to change { ProjectAuthorization.count }.from(3).to(1) }
-
- it 'retains the highest access level' do
- subject
-
- all_records = ProjectAuthorization.all.to_a
- expect(all_records.count).to eq 1
- expect(all_records.first.access_level).to eq Gitlab::Access::MAINTAINER
- end
- end
- end
-end
diff --git a/spec/migrations/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session_spec.rb b/spec/migrations/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session_spec.rb
deleted file mode 100644
index e48f933ad5f..00000000000
--- a/spec/migrations/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropTemporaryColumnsAndTriggersForCiBuildsRunnerSession, :migration, feature_category: :runner do
- let(:ci_builds_runner_session_table) { table(:ci_builds_runner_session) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(ci_builds_runner_session_table.column_names).to include('build_id_convert_to_bigint')
- }
-
- migration.after -> {
- ci_builds_runner_session_table.reset_column_information
- expect(ci_builds_runner_session_table.column_names).not_to include('build_id_convert_to_bigint')
- }
- end
- end
-end
diff --git a/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb b/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb
deleted file mode 100644
index a6c892db131..00000000000
--- a/spec/migrations/add_default_project_approval_rules_vuln_allowed_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AddDefaultProjectApprovalRulesVulnAllowed, feature_category: :source_code_management do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') }
- let(:project) { projects.create!(name: 'project', path: 'project', namespace_id: namespace.id) }
- let(:approval_project_rules) { table(:approval_project_rules) }
-
- it 'updates records when vulnerabilities_allowed is nil' do
- records_to_migrate = 10
-
- records_to_migrate.times do |i|
- approval_project_rules.create!(name: "rule #{i}", project_id: project.id)
- end
-
- expect { migrate! }
- .to change { approval_project_rules.where(vulnerabilities_allowed: nil).count }
- .from(records_to_migrate)
- .to(0)
- end
-
- it 'defaults vulnerabilities_allowed to 0' do
- approval_project_rule = approval_project_rules.create!(name: "new rule", project_id: project.id)
-
- expect(approval_project_rule.vulnerabilities_allowed).to be_nil
-
- migrate!
-
- expect(approval_project_rule.reload.vulnerabilities_allowed).to eq(0)
- end
-end
diff --git a/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb b/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb
deleted file mode 100644
index 670541128a0..00000000000
--- a/spec/migrations/add_premium_and_ultimate_plan_limits_spec.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddPremiumAndUltimatePlanLimits, :migration, feature_category: :purchase do
- shared_examples_for 'a migration that does not alter plans or plan limits' do
- it do
- expect { migrate! }.not_to change {
- [
- AddPremiumAndUltimatePlanLimits::Plan.count,
- AddPremiumAndUltimatePlanLimits::PlanLimits.count
- ]
- }
- end
- end
-
- describe '#up' do
- context 'when not .com?' do
- before do
- allow(Gitlab).to receive(:com?).and_return false
- end
-
- it_behaves_like 'a migration that does not alter plans or plan limits'
- end
-
- context 'when .com?' do
- before do
- allow(Gitlab).to receive(:com?).and_return true
- end
-
- context 'when source plan does not exist' do
- it_behaves_like 'a migration that does not alter plans or plan limits'
- end
-
- context 'when target plan does not exist' do
- before do
- table(:plans).create!(name: 'silver', title: 'Silver')
- table(:plans).create!(name: 'gold', title: 'Gold')
- end
-
- it_behaves_like 'a migration that does not alter plans or plan limits'
- end
-
- context 'when source and target plans exist' do
- let!(:silver) { table(:plans).create!(name: 'silver', title: 'Silver') }
- let!(:gold) { table(:plans).create!(name: 'gold', title: 'Gold') }
- let!(:premium) { table(:plans).create!(name: 'premium', title: 'Premium') }
- let!(:ultimate) { table(:plans).create!(name: 'ultimate', title: 'Ultimate') }
-
- let!(:silver_limits) { table(:plan_limits).create!(plan_id: silver.id, storage_size_limit: 111) }
- let!(:gold_limits) { table(:plan_limits).create!(plan_id: gold.id, storage_size_limit: 222) }
-
- context 'when target has plan limits' do
- before do
- table(:plan_limits).create!(plan_id: premium.id, storage_size_limit: 999)
- table(:plan_limits).create!(plan_id: ultimate.id, storage_size_limit: 999)
- end
-
- it 'does not overwrite the limits' do
- expect { migrate! }.not_to change {
- [
- AddPremiumAndUltimatePlanLimits::Plan.count,
- AddPremiumAndUltimatePlanLimits::PlanLimits.pluck(:id, :storage_size_limit).sort
- ]
- }
- end
- end
-
- context 'when target has no plan limits' do
- it 'creates plan limits from the source plan' do
- migrate!
-
- expect(AddPremiumAndUltimatePlanLimits::PlanLimits.pluck(:plan_id, :storage_size_limit))
- .to match_array(
- [
- [silver.id, silver_limits.storage_size_limit],
- [gold.id, gold_limits.storage_size_limit],
- [premium.id, silver_limits.storage_size_limit],
- [ultimate.id, gold_limits.storage_size_limit]
- ])
- end
- end
- end
- end
- end
-end
diff --git a/spec/migrations/add_triggers_to_integrations_type_new_spec.rb b/spec/migrations/add_triggers_to_integrations_type_new_spec.rb
deleted file mode 100644
index 4fa5fe31d2b..00000000000
--- a/spec/migrations/add_triggers_to_integrations_type_new_spec.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddTriggersToIntegrationsTypeNew, feature_category: :purchase do
- let(:migration) { described_class.new }
- let(:integrations) { table(:integrations) }
-
- # This matches Gitlab::Integrations::StiType at the time the trigger was added
- let(:namespaced_integrations) do
- %w[
- Asana Assembla Bamboo Bugzilla Buildkite Campfire Confluence CustomIssueTracker Datadog
- Discord DroneCi EmailsOnPush Ewm ExternalWiki Flowdock HangoutsChat Irker Jenkins Jira Mattermost
- MattermostSlashCommands MicrosoftTeams MockCi MockMonitoring Packagist PipelinesEmail Pivotaltracker
- Prometheus Pushover Redmine Slack SlackSlashCommands Teamcity UnifyCircuit WebexTeams Youtrack
-
- Github GitlabSlackApplication
- ]
- end
-
- describe '#up' do
- before do
- migrate!
- end
-
- describe 'INSERT trigger' do
- it 'sets `type_new` to the transformed `type` class name' do
- namespaced_integrations.each do |type|
- integration = integrations.create!(type: "#{type}Service")
-
- expect(integration.reload).to have_attributes(
- type: "#{type}Service",
- type_new: "Integrations::#{type}"
- )
- end
- end
-
- it 'ignores types that are not namespaced' do
- # We don't actually have any integrations without namespaces,
- # but we can abuse one of the integration base classes.
- integration = integrations.create!(type: 'BaseIssueTracker')
-
- expect(integration.reload).to have_attributes(
- type: 'BaseIssueTracker',
- type_new: nil
- )
- end
-
- it 'ignores types that are unknown' do
- integration = integrations.create!(type: 'FooBar')
-
- expect(integration.reload).to have_attributes(
- type: 'FooBar',
- type_new: nil
- )
- end
- end
- end
-
- describe '#down' do
- before do
- migration.up
- migration.down
- end
-
- it 'drops the INSERT trigger' do
- integration = integrations.create!(type: 'JiraService')
-
- expect(integration.reload).to have_attributes(
- type: 'JiraService',
- type_new: nil
- )
- end
- end
-end
diff --git a/spec/migrations/add_upvotes_count_index_to_issues_spec.rb b/spec/migrations/add_upvotes_count_index_to_issues_spec.rb
deleted file mode 100644
index 0012b8a0b96..00000000000
--- a/spec/migrations/add_upvotes_count_index_to_issues_spec.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AddUpvotesCountIndexToIssues, feature_category: :team_planning do
- let(:migration_instance) { described_class.new }
-
- describe '#up' do
- it 'adds index' do
- expect { migrate! }.to change { migration_instance.index_exists?(:issues, [:project_id, :upvotes_count], name: described_class::INDEX_NAME) }.from(false).to(true)
- end
- end
-
- describe '#down' do
- it 'removes index' do
- migrate!
-
- expect { schema_migrate_down! }.to change { migration_instance.index_exists?(:issues, [:project_id, :upvotes_count], name: described_class::INDEX_NAME) }.from(true).to(false)
- end
- end
-end
diff --git a/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb b/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb
deleted file mode 100644
index 67d215c781b..00000000000
--- a/spec/migrations/associate_existing_dast_builds_with_variables_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AssociateExistingDastBuildsWithVariables, feature_category: :dynamic_application_security_testing do
- it 'is a no-op' do
- migrate!
- end
-end
diff --git a/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb b/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb
deleted file mode 100644
index a9500b9f942..00000000000
--- a/spec/migrations/backfill_cadence_id_for_boards_scoped_to_iteration_spec.rb
+++ /dev/null
@@ -1,108 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe BackfillCadenceIdForBoardsScopedToIteration, :migration, feature_category: :team_planning do
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
- let(:iterations_cadences) { table(:iterations_cadences) }
- let(:boards) { table(:boards) }
-
- let!(:group) { namespaces.create!(name: 'group1', path: 'group1', type: 'Group') }
- let!(:cadence) { iterations_cadences.create!(title: 'group cadence', group_id: group.id, start_date: Time.current) }
- let!(:project) { projects.create!(name: 'gitlab1', path: 'gitlab1', namespace_id: group.id, visibility_level: 0) }
- let!(:project_board1) { boards.create!(name: 'Project Dev1', project_id: project.id) }
- let!(:project_board2) { boards.create!(name: 'Project Dev2', project_id: project.id, iteration_id: -4) }
- let!(:project_board3) { boards.create!(name: 'Project Dev3', project_id: project.id, iteration_id: -4) }
- let!(:project_board4) { boards.create!(name: 'Project Dev4', project_id: project.id, iteration_id: -4) }
-
- let!(:group_board1) { boards.create!(name: 'Group Dev1', group_id: group.id) }
- let!(:group_board2) { boards.create!(name: 'Group Dev2', group_id: group.id, iteration_id: -4) }
- let!(:group_board3) { boards.create!(name: 'Group Dev3', group_id: group.id, iteration_id: -4) }
- let!(:group_board4) { boards.create!(name: 'Group Dev4', group_id: group.id, iteration_id: -4) }
-
- describe '#up' do
- it 'schedules background migrations' do
- Sidekiq::Testing.fake! do
- freeze_time do
- described_class.new.up
-
- migration = described_class::MIGRATION
-
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'group', 'up', group_board2.id, group_board4.id)
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'project', 'up', project_board2.id, project_board4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq 2
- end
- end
- end
-
- context 'in batches' do
- before do
- stub_const('BackfillCadenceIdForBoardsScopedToIteration::BATCH_SIZE', 2)
- end
-
- it 'schedules background migrations' do
- Sidekiq::Testing.fake! do
- freeze_time do
- described_class.new.up
-
- migration = described_class::MIGRATION
-
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'group', 'up', group_board2.id, group_board3.id)
- expect(migration).to be_scheduled_delayed_migration(4.minutes, 'group', 'up', group_board4.id, group_board4.id)
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'project', 'up', project_board2.id, project_board3.id)
- expect(migration).to be_scheduled_delayed_migration(4.minutes, 'project', 'up', project_board4.id, project_board4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq 4
- end
- end
- end
- end
- end
-
- describe '#down' do
- let!(:project_board1) { boards.create!(name: 'Project Dev1', project_id: project.id) }
- let!(:project_board2) { boards.create!(name: 'Project Dev2', project_id: project.id, iteration_cadence_id: cadence.id) }
- let!(:project_board3) { boards.create!(name: 'Project Dev3', project_id: project.id, iteration_id: -4, iteration_cadence_id: cadence.id) }
- let!(:project_board4) { boards.create!(name: 'Project Dev4', project_id: project.id, iteration_id: -4, iteration_cadence_id: cadence.id) }
-
- let!(:group_board1) { boards.create!(name: 'Group Dev1', group_id: group.id) }
- let!(:group_board2) { boards.create!(name: 'Group Dev2', group_id: group.id, iteration_cadence_id: cadence.id) }
- let!(:group_board3) { boards.create!(name: 'Group Dev3', group_id: group.id, iteration_id: -4, iteration_cadence_id: cadence.id) }
- let!(:group_board4) { boards.create!(name: 'Group Dev4', group_id: group.id, iteration_id: -4, iteration_cadence_id: cadence.id) }
-
- it 'schedules background migrations' do
- Sidekiq::Testing.fake! do
- freeze_time do
- described_class.new.down
-
- migration = described_class::MIGRATION
-
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'none', 'down', project_board2.id, group_board4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq 1
- end
- end
- end
-
- context 'in batches' do
- before do
- stub_const('BackfillCadenceIdForBoardsScopedToIteration::BATCH_SIZE', 2)
- end
-
- it 'schedules background migrations' do
- Sidekiq::Testing.fake! do
- freeze_time do
- described_class.new.down
-
- migration = described_class::MIGRATION
-
- expect(migration).to be_scheduled_delayed_migration(2.minutes, 'none', 'down', project_board2.id, project_board3.id)
- expect(migration).to be_scheduled_delayed_migration(4.minutes, 'none', 'down', project_board4.id, group_board2.id)
- expect(migration).to be_scheduled_delayed_migration(6.minutes, 'none', 'down', group_board3.id, group_board4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq 3
- end
- end
- end
- end
- end
-end
diff --git a/spec/migrations/backfill_integrations_type_new_spec.rb b/spec/migrations/backfill_integrations_type_new_spec.rb
deleted file mode 100644
index 79519c4439a..00000000000
--- a/spec/migrations/backfill_integrations_type_new_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe BackfillIntegrationsTypeNew, feature_category: :integrations do
- let!(:migration) { described_class::MIGRATION }
- let!(:integrations) { table(:integrations) }
-
- before do
- integrations.create!(id: 1)
- integrations.create!(id: 2)
- integrations.create!(id: 3)
- integrations.create!(id: 4)
- integrations.create!(id: 5)
- end
-
- describe '#up' do
- it 'schedules background jobs for each batch of integrations' do
- migrate!
-
- expect(migration).to have_scheduled_batched_migration(
- table_name: :integrations,
- 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/backfill_issues_upvotes_count_spec.rb b/spec/migrations/backfill_issues_upvotes_count_spec.rb
deleted file mode 100644
index b8687595b35..00000000000
--- a/spec/migrations/backfill_issues_upvotes_count_spec.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe BackfillIssuesUpvotesCount, feature_category: :team_planning do
- let(:migration) { described_class.new }
- let(:issues) { table(:issues) }
- let(:award_emoji) { table(:award_emoji) }
-
- let!(:issue1) { issues.create! }
- let!(:issue2) { issues.create! }
- let!(:issue3) { issues.create! }
- let!(:issue4) { issues.create! }
- let!(:issue4_without_thumbsup) { issues.create! }
-
- let!(:award_emoji1) { award_emoji.create!( name: 'thumbsup', awardable_type: 'Issue', awardable_id: issue1.id) }
- let!(:award_emoji2) { award_emoji.create!( name: 'thumbsup', awardable_type: 'Issue', awardable_id: issue2.id) }
- let!(:award_emoji3) { award_emoji.create!( name: 'thumbsup', awardable_type: 'Issue', awardable_id: issue3.id) }
- let!(:award_emoji4) { award_emoji.create!( name: 'thumbsup', awardable_type: 'Issue', awardable_id: issue4.id) }
-
- it 'correctly schedules background migrations', :aggregate_failures do
- stub_const("#{described_class.name}::BATCH_SIZE", 2)
-
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(described_class::MIGRATION).to be_scheduled_migration(issue1.id, issue2.id)
- expect(described_class::MIGRATION).to be_scheduled_migration(issue3.id, issue4.id)
- expect(BackgroundMigrationWorker.jobs.size).to eq(2)
- end
- end
- end
-end
diff --git a/spec/migrations/backfill_stage_event_hash_spec.rb b/spec/migrations/backfill_stage_event_hash_spec.rb
deleted file mode 100644
index 399a9c4dfde..00000000000
--- a/spec/migrations/backfill_stage_event_hash_spec.rb
+++ /dev/null
@@ -1,103 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe BackfillStageEventHash, schema: 20210730103808, feature_category: :value_stream_management do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:labels) { table(:labels) }
- let(:group_stages) { table(:analytics_cycle_analytics_group_stages) }
- let(:project_stages) { table(:analytics_cycle_analytics_project_stages) }
- let(:group_value_streams) { table(:analytics_cycle_analytics_group_value_streams) }
- let(:project_value_streams) { table(:analytics_cycle_analytics_project_value_streams) }
- let(:stage_event_hashes) { table(:analytics_cycle_analytics_stage_event_hashes) }
-
- let(:issue_created) { 1 }
- let(:issue_closed) { 3 }
- let(:issue_label_removed) { 9 }
- let(:unknown_stage_event) { -1 }
-
- let(:namespace) { namespaces.create!(name: 'ns', path: 'ns', type: 'Group') }
- let(:project) { projects.create!(name: 'project', path: 'project', namespace_id: namespace.id) }
- let(:group_label) { labels.create!(title: 'label', type: 'GroupLabel', group_id: namespace.id) }
- let(:group_value_stream) { group_value_streams.create!(name: 'group vs', group_id: namespace.id) }
- let(:project_value_stream) { project_value_streams.create!(name: 'project vs', project_id: project.id) }
-
- let(:group_stage_1) do
- group_stages.create!(
- name: 'stage 1',
- group_id: namespace.id,
- start_event_identifier: issue_created,
- end_event_identifier: issue_closed,
- group_value_stream_id: group_value_stream.id
- )
- end
-
- let(:group_stage_2) do
- group_stages.create!(
- name: 'stage 2',
- group_id: namespace.id,
- start_event_identifier: issue_created,
- end_event_identifier: issue_label_removed,
- end_event_label_id: group_label.id,
- group_value_stream_id: group_value_stream.id
- )
- end
-
- let(:project_stage_1) do
- project_stages.create!(
- name: 'stage 1',
- project_id: project.id,
- start_event_identifier: issue_created,
- end_event_identifier: issue_closed,
- project_value_stream_id: project_value_stream.id
- )
- end
-
- let(:invalid_group_stage) do
- group_stages.create!(
- name: 'stage 3',
- group_id: namespace.id,
- start_event_identifier: issue_created,
- end_event_identifier: unknown_stage_event,
- group_value_stream_id: group_value_stream.id
- )
- end
-
- describe '#up' do
- it 'populates stage_event_hash_id column' do
- group_stage_1
- group_stage_2
- project_stage_1
-
- migrate!
-
- group_stage_1.reload
- group_stage_2.reload
- project_stage_1.reload
-
- expect(group_stage_1.stage_event_hash_id).not_to be_nil
- expect(group_stage_2.stage_event_hash_id).not_to be_nil
- expect(project_stage_1.stage_event_hash_id).not_to be_nil
-
- expect(stage_event_hashes.count).to eq(2) # group_stage_1 and project_stage_1 has the same hash
- end
-
- it 'runs without problem without stages' do
- expect { migrate! }.not_to raise_error
- end
-
- context 'when invalid event identifier is discovered' do
- it 'removes the stage' do
- group_stage_1
- invalid_group_stage
-
- expect { migrate! }.not_to change { group_stage_1 }
-
- expect(group_stages.find_by_id(invalid_group_stage.id)).to eq(nil)
- end
- end
- end
-end
diff --git a/spec/migrations/cleanup_remaining_orphan_invites_spec.rb b/spec/migrations/cleanup_remaining_orphan_invites_spec.rb
deleted file mode 100644
index 598030c99a0..00000000000
--- a/spec/migrations/cleanup_remaining_orphan_invites_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe CleanupRemainingOrphanInvites, :migration, feature_category: :subgroups do
- def create_member(**extra_attributes)
- defaults = {
- access_level: 10,
- source_id: 1,
- source_type: "Project",
- notification_level: 0,
- type: 'ProjectMember'
- }
-
- table(:members).create!(defaults.merge(extra_attributes))
- end
-
- def create_user(**extra_attributes)
- defaults = { projects_limit: 0 }
- table(:users).create!(defaults.merge(extra_attributes))
- end
-
- describe '#up', :aggregate_failures do
- it 'removes invite tokens for accepted records' do
- record1 = create_member(invite_token: 'foo', user_id: nil)
- record2 = create_member(invite_token: 'foo2', user_id: create_user(username: 'foo', email: 'foo@example.com').id)
- record3 = create_member(invite_token: nil, user_id: create_user(username: 'bar', email: 'bar@example.com').id)
-
- migrate!
-
- expect(table(:members).find(record1.id).invite_token).to eq 'foo'
- expect(table(:members).find(record2.id).invite_token).to eq nil
- expect(table(:members).find(record3.id).invite_token).to eq nil
- end
- end
-end
diff --git a/spec/migrations/confirm_security_bot_spec.rb b/spec/migrations/confirm_security_bot_spec.rb
deleted file mode 100644
index 55053c29233..00000000000
--- a/spec/migrations/confirm_security_bot_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ConfirmSecurityBot, :migration, feature_category: :user_profile do
- let(:users) { table(:users) }
-
- let(:user_type) { 8 }
-
- context 'when bot is not created' do
- it 'skips migration' do
- migrate!
-
- bot = users.find_by(user_type: user_type)
-
- expect(bot).to be_nil
- end
- end
-
- context 'when bot is confirmed' do
- let(:bot) { table(:users).create!(user_type: user_type, confirmed_at: Time.current, projects_limit: 1) }
-
- it 'skips migration' do
- expect { migrate! }.not_to change { bot.reload.confirmed_at }
- end
- end
-
- context 'when bot is not confirmed' do
- let(:bot) { table(:users).create!(user_type: user_type, projects_limit: 1) }
-
- it 'update confirmed_at' do
- freeze_time do
- expect { migrate! }.to change { bot.reload.confirmed_at }.from(nil).to(Time.current)
- end
- end
- end
-end
diff --git a/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb b/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb
deleted file mode 100644
index 1d948257fcc..00000000000
--- a/spec/migrations/disable_expiration_policies_linked_to_no_container_images_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe DisableExpirationPoliciesLinkedToNoContainerImages, feature_category: :container_registry do
- 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!(:project) { projects.create!(id: 1, namespace_id: namespace.id, name: 'gitlab1') }
- let!(:container_expiration_policy) { container_expiration_policies.create!(project_id: project.id, enabled: true) }
-
- before do
- projects.create!(id: 2, namespace_id: namespace.id, name: 'gitlab2')
- container_expiration_policies.create!(project_id: 2, enabled: true)
- container_repositories.create!(id: 1, project_id: 2, name: 'image2')
-
- projects.create!(id: 3, namespace_id: namespace.id, name: 'gitlab3')
- container_expiration_policies.create!(project_id: 3, enabled: false)
- container_repositories.create!(id: 2, project_id: 3, name: 'image3')
- end
-
- it 'correctly disable expiration policies linked to no container images' do
- expect(enabled_policies.count).to eq 2
- expect(disabled_policies.count).to eq 1
- expect(container_expiration_policy.enabled).to eq true
-
- migrate!
-
- expect(enabled_policies.count).to eq 1
- expect(disabled_policies.count).to eq 2
- expect(container_expiration_policy.reload.enabled).to eq false
- 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/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb b/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb
deleted file mode 100644
index 7c03ed2c870..00000000000
--- a/spec/migrations/fix_batched_migrations_old_format_job_arguments_spec.rb
+++ /dev/null
@@ -1,63 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-# rubocop:disable Style/WordArray
-RSpec.describe FixBatchedMigrationsOldFormatJobArguments, feature_category: :user_profile do
- let(:batched_background_migrations) { table(:batched_background_migrations) }
-
- context 'when migrations with legacy job arguments exists' do
- it 'updates job arguments to current format' do
- legacy_events_migration = create_batched_migration('events', 'id', ['id', 'id_convert_to_bigint'])
- legacy_push_event_payloads_migration = create_batched_migration('push_event_payloads', 'event_id', ['event_id', 'event_id_convert_to_bigint'])
-
- migrate!
-
- expect(legacy_events_migration.reload.job_arguments).to eq([['id'], ['id_convert_to_bigint']])
- expect(legacy_push_event_payloads_migration.reload.job_arguments).to eq([['event_id'], ['event_id_convert_to_bigint']])
- end
- end
-
- context 'when only migrations with current job arguments exists' do
- it 'updates nothing' do
- events_migration = create_batched_migration('events', 'id', [['id'], ['id_convert_to_bigint']])
- push_event_payloads_migration = create_batched_migration('push_event_payloads', 'event_id', [['event_id'], ['event_id_convert_to_bigint']])
-
- migrate!
-
- expect(events_migration.reload.job_arguments).to eq([['id'], ['id_convert_to_bigint']])
- expect(push_event_payloads_migration.reload.job_arguments).to eq([['event_id'], ['event_id_convert_to_bigint']])
- end
- end
-
- context 'when migrations with both legacy and current job arguments exist' do
- it 'updates nothing' do
- legacy_events_migration = create_batched_migration('events', 'id', ['id', 'id_convert_to_bigint'])
- events_migration = create_batched_migration('events', 'id', [['id'], ['id_convert_to_bigint']])
- legacy_push_event_payloads_migration = create_batched_migration('push_event_payloads', 'event_id', ['event_id', 'event_id_convert_to_bigint'])
- push_event_payloads_migration = create_batched_migration('push_event_payloads', 'event_id', [['event_id'], ['event_id_convert_to_bigint']])
-
- migrate!
-
- expect(legacy_events_migration.reload.job_arguments).to eq(['id', 'id_convert_to_bigint'])
- expect(events_migration.reload.job_arguments).to eq([['id'], ['id_convert_to_bigint']])
- expect(legacy_push_event_payloads_migration.reload.job_arguments).to eq(['event_id', 'event_id_convert_to_bigint'])
- expect(push_event_payloads_migration.reload.job_arguments).to eq([['event_id'], ['event_id_convert_to_bigint']])
- end
- end
-
- def create_batched_migration(table_name, column_name, job_arguments)
- batched_background_migrations.create!(
- max_value: 10,
- batch_size: 10,
- sub_batch_size: 10,
- interval: 1,
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: table_name,
- column_name: column_name,
- job_arguments: job_arguments
- )
- end
-end
-# rubocop:enable Style/WordArray
diff --git a/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb b/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb
deleted file mode 100644
index 1385b67b607..00000000000
--- a/spec/migrations/generate_customers_dot_jwt_signing_key_spec.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe GenerateCustomersDotJwtSigningKey, feature_category: :customersdot_application do
- let(:application_settings) do
- Class.new(ActiveRecord::Base) do
- self.table_name = 'application_settings'
-
- attr_encrypted :customers_dot_jwt_signing_key, {
- mode: :per_attribute_iv,
- key: Gitlab::Utils.ensure_utf8_size(Rails.application.secrets.db_key_base, bytes: 32.bytes),
- algorithm: 'aes-256-gcm',
- encode: true
- }
- end
- end
-
- it 'generates JWT signing key' do
- application_settings.create!
-
- reversible_migration do |migration|
- migration.before -> {
- settings = application_settings.first
-
- expect(settings.customers_dot_jwt_signing_key).to be_nil
- expect(settings.encrypted_customers_dot_jwt_signing_key).to be_nil
- expect(settings.encrypted_customers_dot_jwt_signing_key_iv).to be_nil
- }
-
- migration.after -> {
- settings = application_settings.first
-
- expect(settings.encrypted_customers_dot_jwt_signing_key).to be_present
- expect(settings.encrypted_customers_dot_jwt_signing_key_iv).to be_present
- expect { OpenSSL::PKey::RSA.new(settings.customers_dot_jwt_signing_key) }.not_to raise_error
- }
- end
- end
-end
diff --git a/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb b/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb
deleted file mode 100644
index 2f62147da9d..00000000000
--- a/spec/migrations/migrate_protected_attribute_to_pending_builds_spec.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe MigrateProtectedAttributeToPendingBuilds, :suppress_gitlab_schemas_validate_connection,
-feature_category: :continuous_integration do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:queue) { table(:ci_pending_builds) }
- let(:builds) { table(:ci_builds) }
-
- before do
- namespaces.create!(id: 123, name: 'sample', path: 'sample')
- projects.create!(id: 123, name: 'sample', path: 'sample', namespace_id: 123)
-
- builds.create!(id: 1, project_id: 123, status: 'pending', protected: false, type: 'Ci::Build')
- builds.create!(id: 2, project_id: 123, status: 'pending', protected: true, type: 'Ci::Build')
- builds.create!(id: 3, project_id: 123, status: 'pending', protected: false, type: 'Ci::Build')
- builds.create!(id: 4, project_id: 123, status: 'pending', protected: true, type: 'Ci::Bridge')
- builds.create!(id: 5, project_id: 123, status: 'success', protected: true, type: 'Ci::Build')
-
- queue.create!(id: 1, project_id: 123, build_id: 1)
- queue.create!(id: 2, project_id: 123, build_id: 2)
- queue.create!(id: 3, project_id: 123, build_id: 3)
- end
-
- it 'updates entries that should be protected' do
- migrate!
-
- expect(queue.where(protected: true).count).to eq 1
- expect(queue.find_by(protected: true).id).to eq 2
- end
-end
diff --git a/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb b/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb
deleted file mode 100644
index 56f47fca864..00000000000
--- a/spec/migrations/orphaned_invite_tokens_cleanup_spec.rb
+++ /dev/null
@@ -1,50 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe OrphanedInviteTokensCleanup, :migration, feature_category: :subgroups do
- def create_member(**extra_attributes)
- defaults = {
- access_level: 10,
- source_id: 1,
- source_type: "Project",
- notification_level: 0,
- type: 'ProjectMember'
- }
-
- table(:members).create!(defaults.merge(extra_attributes))
- end
-
- shared_examples 'removes orphaned invite tokens' do
- it 'removes invite tokens for accepted records with invite_accepted_at < created_at' do
- record1 = create_member(invite_token: 'foo', invite_accepted_at: 1.day.ago, created_at: 1.hour.ago)
- record2 = create_member(invite_token: 'foo2', invite_accepted_at: nil, created_at: 1.hour.ago)
- record3 = create_member(invite_token: 'foo3', invite_accepted_at: 1.day.ago, created_at: 1.year.ago)
-
- migrate!
-
- expect(table(:members).find(record1.id).invite_token).to eq nil
- expect(table(:members).find(record2.id).invite_token).to eq 'foo2'
- expect(table(:members).find(record3.id).invite_token).to eq 'foo3'
- end
- end
-
- describe '#up', :aggregate_failures do
- it_behaves_like 'removes orphaned invite tokens'
- end
-
- context 'when there is a mix of timestamptz and timestamp types' do
- around do |example|
- ActiveRecord::Base.connection.execute "ALTER TABLE members alter created_at type timestamp with time zone"
-
- example.run
-
- ActiveRecord::Base.connection.execute "ALTER TABLE members alter created_at type timestamp without time zone"
- end
-
- describe '#up', :aggregate_failures do
- it_behaves_like 'removes orphaned invite tokens'
- end
- end
-end
diff --git a/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb b/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb
deleted file mode 100644
index 5ebe6787f15..00000000000
--- a/spec/migrations/re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types_spec.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes,
- :suppress_gitlab_schemas_validate_connection, feature_category: :vulnerability_management do
- let(:namespaces) { table(:namespaces) }
- let(:pipelines) { table(:ci_pipelines) }
- let(:projects) { table(:projects) }
- let(:project_settings) { table(:project_settings) }
- let(:vulnerability_statistics) { table(:vulnerability_statistics) }
-
- let(:letter_grade_a) { 0 }
-
- let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') }
- let(:project_1) { projects.create!(namespace_id: namespace.id, name: 'Foo 1') }
- let(:project_2) { projects.create!(namespace_id: namespace.id, name: 'Foo 2') }
- let(:project_3) { projects.create!(namespace_id: namespace.id, name: 'Foo 3') }
- let(:project_4) { projects.create!(namespace_id: namespace.id, name: 'Foo 4') }
-
- before do
- project_settings.create!(project_id: project_1.id, has_vulnerabilities: true)
- project_settings.create!(project_id: project_2.id, has_vulnerabilities: true)
- project_settings.create!(project_id: project_3.id)
- project_settings.create!(project_id: project_4.id, has_vulnerabilities: true)
-
- pipeline = pipelines.create!(project_id: project_2.id, ref: 'master', sha: 'adf43c3a')
-
- vulnerability_statistics.create!(project_id: project_2.id, letter_grade: letter_grade_a, latest_pipeline_id: pipeline.id)
- vulnerability_statistics.create!(project_id: project_4.id, letter_grade: letter_grade_a)
-
- allow(Gitlab).to receive(:ee?).and_return(is_ee?)
- stub_const("#{described_class.name}::BATCH_SIZE", 1)
- end
-
- around do |example|
- freeze_time { example.run }
- end
-
- context 'when the installation is FOSS' do
- let(:is_ee?) { false }
-
- it 'does not schedule any background job' do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to be(0)
- end
- end
-
- context 'when the installation is EE' do
- let(:is_ee?) { true }
-
- it 'schedules the background jobs' do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to be(2)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(described_class::DELAY_INTERVAL, project_1.id, project_1.id)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2 * described_class::DELAY_INTERVAL, project_4.id, project_4.id)
- end
- end
-end
diff --git a/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb b/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb
deleted file mode 100644
index 2b21dc3b67f..00000000000
--- a/spec/migrations/remove_duplicate_dast_site_tokens_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RemoveDuplicateDastSiteTokens, feature_category: :dynamic_application_security_testing do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:dast_site_tokens) { table(:dast_site_tokens) }
- let!(:namespace) { namespaces.create!(id: 1, name: 'group', path: 'group') }
- let!(:project1) { projects.create!(id: 1, namespace_id: namespace.id, path: 'project1') }
- # create non duplicate dast site token
- let!(:dast_site_token1) { dast_site_tokens.create!(project_id: project1.id, url: 'https://gitlab.com', token: SecureRandom.uuid) }
-
- context 'when duplicate dast site tokens exists' do
- # create duplicate dast site token
- let!(:duplicate_url) { 'https://about.gitlab.com' }
-
- let!(:project2) { projects.create!(id: 2, namespace_id: namespace.id, path: 'project2') }
- let!(:dast_site_token2) { dast_site_tokens.create!(project_id: project2.id, url: duplicate_url, token: SecureRandom.uuid) }
- let!(:dast_site_token3) { dast_site_tokens.create!(project_id: project2.id, url: 'https://temp_url.com', token: SecureRandom.uuid) }
- let!(:dast_site_token4) { dast_site_tokens.create!(project_id: project2.id, url: 'https://other_temp_url.com', token: SecureRandom.uuid) }
-
- before 'update URL to bypass uniqueness validation' do
- dast_site_tokens.where(project_id: 2).update_all(url: duplicate_url)
- end
-
- describe 'migration up' do
- it 'does remove duplicated dast site tokens' do
- expect(dast_site_tokens.count).to eq(4)
- expect(dast_site_tokens.where(project_id: 2, url: duplicate_url).size).to eq(3)
-
- migrate!
-
- expect(dast_site_tokens.count).to eq(2)
- expect(dast_site_tokens.where(project_id: 2, url: duplicate_url).size).to eq(1)
- end
- end
- end
-
- context 'when duplicate dast site tokens does not exists' do
- before do
- dast_site_tokens.create!(project_id: 1, url: 'https://about.gitlab.com/handbook', token: SecureRandom.uuid)
- end
-
- describe 'migration up' do
- it 'does remove duplicated dast site tokens' do
- expect { migrate! }.not_to change(dast_site_tokens, :count)
- end
- end
- end
-end
diff --git a/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb b/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb
deleted file mode 100644
index 6cc25b74d02..00000000000
--- a/spec/migrations/remove_duplicate_dast_site_tokens_with_same_token_spec.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RemoveDuplicateDastSiteTokensWithSameToken, feature_category: :dynamic_application_security_testing do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:dast_site_tokens) { table(:dast_site_tokens) }
- let!(:namespace) { namespaces.create!(id: 1, name: 'group', path: 'group') }
- let!(:project1) { projects.create!(id: 1, namespace_id: namespace.id, path: 'project1') }
- # create non duplicate dast site token
- let!(:dast_site_token1) { dast_site_tokens.create!(project_id: project1.id, url: 'https://gitlab.com', token: SecureRandom.uuid) }
-
- context 'when duplicate dast site tokens exists' do
- # create duplicate dast site token
- let!(:duplicate_token) { 'duplicate_token' }
- let!(:other_duplicate_token) { 'other_duplicate_token' }
-
- let!(:project2) { projects.create!(id: 2, namespace_id: namespace.id, path: 'project2') }
- let!(:dast_site_token2) { dast_site_tokens.create!(project_id: project2.id, url: 'https://gitlab2.com', token: duplicate_token) }
- let!(:dast_site_token3) { dast_site_tokens.create!(project_id: project2.id, url: 'https://gitlab3.com', token: duplicate_token) }
- let!(:dast_site_token4) { dast_site_tokens.create!(project_id: project2.id, url: 'https://gitlab4.com', token: duplicate_token) }
-
- let!(:project3) { projects.create!(id: 3, namespace_id: namespace.id, path: 'project3') }
- let!(:dast_site_token5) { dast_site_tokens.create!(project_id: project3.id, url: 'https://gitlab2.com', token: other_duplicate_token) }
- let!(:dast_site_token6) { dast_site_tokens.create!(project_id: project3.id, url: 'https://gitlab3.com', token: other_duplicate_token) }
- let!(:dast_site_token7) { dast_site_tokens.create!(project_id: project3.id, url: 'https://gitlab4.com', token: other_duplicate_token) }
-
- describe 'migration up' do
- it 'does remove duplicated dast site tokens with the same token' do
- expect(dast_site_tokens.count).to eq(7)
- expect(dast_site_tokens.where(token: duplicate_token).size).to eq(3)
-
- migrate!
-
- expect(dast_site_tokens.count).to eq(3)
- expect(dast_site_tokens.where(token: duplicate_token).size).to eq(1)
- end
- end
- end
-
- context 'when duplicate dast site tokens do not exist' do
- let!(:dast_site_token5) { dast_site_tokens.create!(project_id: 1, url: 'https://gitlab5.com', token: SecureRandom.uuid) }
-
- describe 'migration up' do
- it 'does not remove any dast site tokens' do
- expect { migrate! }.not_to change(dast_site_tokens, :count)
- end
- end
- end
-end
diff --git a/spec/migrations/rename_services_to_integrations_spec.rb b/spec/migrations/rename_services_to_integrations_spec.rb
deleted file mode 100644
index a90b0bfabd2..00000000000
--- a/spec/migrations/rename_services_to_integrations_spec.rb
+++ /dev/null
@@ -1,255 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RenameServicesToIntegrations, feature_category: :integrations do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:integrations) { table(:integrations) }
- let(:services) { table(:services) }
-
- before do
- @namespace = namespaces.create!(name: 'foo', path: 'foo')
- @project = projects.create!(namespace_id: @namespace.id)
- end
-
- RSpec.shared_examples 'a table (or view) with triggers' do
- describe 'INSERT tracker trigger' do
- it 'sets `has_external_issue_tracker` to true when active `issue_tracker` is inserted' do
- expect do
- subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- end.to change { @project.reload.has_external_issue_tracker }.to(true)
- end
-
- it 'does not set `has_external_issue_tracker` to true when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
-
- expect do
- subject.create!(category: 'issue_tracker', active: true, project_id: different_project.id)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not set `has_external_issue_tracker` to true when inactive `issue_tracker` is inserted' do
- expect do
- subject.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not set `has_external_issue_tracker` to true when a non-`issue tracker` active integration is inserted' do
- expect do
- subject.create!(category: 'my_type', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-
- describe 'UPDATE tracker trigger' do
- it 'sets `has_external_issue_tracker` to true when `issue_tracker` is made active' do
- integration = subject.create!(category: 'issue_tracker', active: false, project_id: @project.id)
-
- expect do
- integration.update!(active: true)
- end.to change { @project.reload.has_external_issue_tracker }.to(true)
- end
-
- it 'sets `has_external_issue_tracker` to false when `issue_tracker` is made inactive' do
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.update!(active: false)
- end.to change { @project.reload.has_external_issue_tracker }.to(false)
- end
-
- it 'sets `has_external_issue_tracker` to false when `issue_tracker` is made inactive, and an inactive `issue_tracker` exists' do
- subject.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.update!(active: false)
- end.to change { @project.reload.has_external_issue_tracker }.to(false)
- end
-
- it 'does not change `has_external_issue_tracker` when `issue_tracker` is made inactive, if an active `issue_tracker` exists' do
- subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.update!(active: false)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not change `has_external_issue_tracker` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- integration = subject.create!(category: 'issue_tracker', active: false, project_id: different_project.id)
-
- expect do
- integration.update!(active: true)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-
- describe 'DELETE tracker trigger' do
- it 'sets `has_external_issue_tracker` to false when `issue_tracker` is deleted' do
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.delete
- end.to change { @project.reload.has_external_issue_tracker }.to(false)
- end
-
- it 'sets `has_external_issue_tracker` to false when `issue_tracker` is deleted, if an inactive `issue_tracker` still exists' do
- subject.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.delete
- end.to change { @project.reload.has_external_issue_tracker }.to(false)
- end
-
- it 'does not change `has_external_issue_tracker` when `issue_tracker` is deleted, if an active `issue_tracker` still exists' do
- subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- integration.delete
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not change `has_external_issue_tracker` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- integration = subject.create!(category: 'issue_tracker', active: true, project_id: different_project.id)
-
- expect do
- integration.delete
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-
- describe 'INSERT wiki trigger' do
- it 'sets `has_external_wiki` to true when active `ExternalWikiService` is inserted' do
- expect do
- subject.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
- end.to change { @project.reload.has_external_wiki }.to(true)
- end
-
- it 'does not set `has_external_wiki` to true when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
-
- expect do
- subject.create!(type: 'ExternalWikiService', active: true, project_id: different_project.id)
- end.not_to change { @project.reload.has_external_wiki }
- end
-
- it 'does not set `has_external_wiki` to true when inactive `ExternalWikiService` is inserted' do
- expect do
- subject.create!(type: 'ExternalWikiService', active: false, project_id: @project.id)
- end.not_to change { @project.reload.has_external_wiki }
- end
-
- it 'does not set `has_external_wiki` to true when active other integration is inserted' do
- expect do
- subject.create!(type: 'MyService', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
-
- describe 'UPDATE wiki trigger' do
- it 'sets `has_external_wiki` to true when `ExternalWikiService` is made active' do
- integration = subject.create!(type: 'ExternalWikiService', active: false, project_id: @project.id)
-
- expect do
- integration.update!(active: true)
- end.to change { @project.reload.has_external_wiki }.to(true)
- end
-
- it 'sets `has_external_wiki` to false when `ExternalWikiService` is made inactive' do
- integration = subject.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
-
- expect do
- integration.update!(active: false)
- end.to change { @project.reload.has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- integration = subject.create!(type: 'ExternalWikiService', active: false, project_id: different_project.id)
-
- expect do
- integration.update!(active: true)
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
-
- describe 'DELETE wiki trigger' do
- it 'sets `has_external_wiki` to false when `ExternalWikiService` is deleted' do
- integration = subject.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
-
- expect do
- integration.delete
- end.to change { @project.reload.has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- integration = subject.create!(type: 'ExternalWikiService', active: true, project_id: different_project.id)
-
- expect do
- integration.delete
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
- end
-
- RSpec.shared_examples 'a table (or view) without triggers' do
- specify do
- number_of_triggers = ActiveRecord::Base.connection
- .execute("SELECT count(*) FROM information_schema.triggers WHERE event_object_table = '#{subject.table_name}'")
- .first['count']
-
- expect(number_of_triggers).to eq(0)
- end
- end
-
- describe '#up' do
- before do
- # LOCK TABLE statements must be in a transaction
- ActiveRecord::Base.transaction { migrate! }
- end
-
- context 'the integrations table' do
- subject { integrations }
-
- it_behaves_like 'a table (or view) with triggers'
- end
-
- context 'the services table' do
- subject { services }
-
- it_behaves_like 'a table (or view) without triggers'
- end
- end
-
- describe '#down' do
- before do
- # LOCK TABLE statements must be in a transaction
- ActiveRecord::Base.transaction do
- migration.up
- migration.down
- end
- end
-
- context 'the services table' do
- subject { services }
-
- it_behaves_like 'a table (or view) with triggers'
- end
-
- context 'the integrations table' do
- subject { integrations }
-
- it_behaves_like 'a table (or view) without triggers'
- end
- end
-end
diff --git a/spec/migrations/replace_external_wiki_triggers_spec.rb b/spec/migrations/replace_external_wiki_triggers_spec.rb
deleted file mode 100644
index c2bc5c44c77..00000000000
--- a/spec/migrations/replace_external_wiki_triggers_spec.rb
+++ /dev/null
@@ -1,132 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe ReplaceExternalWikiTriggers, feature_category: :integrations do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:integrations) { table(:integrations) }
-
- before do
- @namespace = namespaces.create!(name: 'foo', path: 'foo')
- @project = projects.create!(namespace_id: @namespace.id)
- end
-
- def create_external_wiki_integration(**attrs)
- attrs.merge!(type_info)
-
- integrations.create!(**attrs)
- end
-
- def has_external_wiki
- !!@project.reload.has_external_wiki
- end
-
- shared_examples 'external wiki triggers' do
- describe 'INSERT trigger' do
- it 'sets `has_external_wiki` to true when active external wiki integration is inserted' do
- expect do
- create_external_wiki_integration(active: true, project_id: @project.id)
- end.to change { has_external_wiki }.to(true)
- end
-
- it 'does not set `has_external_wiki` to true when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
-
- expect do
- create_external_wiki_integration(active: true, project_id: different_project.id)
- end.not_to change { has_external_wiki }
- end
-
- it 'does not set `has_external_wiki` to true when inactive external wiki integration is inserted' do
- expect do
- create_external_wiki_integration(active: false, project_id: @project.id)
- end.not_to change { has_external_wiki }
- end
-
- it 'does not set `has_external_wiki` to true when active other service is inserted' do
- expect do
- integrations.create!(type_new: 'Integrations::MyService', type: 'MyService', active: true, project_id: @project.id)
- end.not_to change { has_external_wiki }
- end
- end
-
- describe 'UPDATE trigger' do
- it 'sets `has_external_wiki` to true when `ExternalWikiService` is made active' do
- service = create_external_wiki_integration(active: false, project_id: @project.id)
-
- expect do
- service.update!(active: true)
- end.to change { has_external_wiki }.to(true)
- end
-
- it 'sets `has_external_wiki` to false when integration is made inactive' do
- service = create_external_wiki_integration(active: true, project_id: @project.id)
-
- expect do
- service.update!(active: false)
- end.to change { has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = create_external_wiki_integration(active: false, project_id: different_project.id)
-
- expect do
- service.update!(active: true)
- end.not_to change { has_external_wiki }
- end
- end
-
- describe 'DELETE trigger' do
- it 'sets `has_external_wiki` to false when integration is deleted' do
- service = create_external_wiki_integration(active: true, project_id: @project.id)
-
- expect do
- service.delete
- end.to change { has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when integration is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = create_external_wiki_integration(active: true, project_id: different_project.id)
-
- expect do
- service.delete
- end.not_to change { has_external_wiki }
- end
- end
- end
-
- describe '#up' do
- before do
- migrate!
- end
-
- context 'when integrations are created with the new STI value' do
- let(:type_info) { { type_new: 'Integrations::ExternalWiki' } }
-
- it_behaves_like 'external wiki triggers'
- end
-
- context 'when integrations are created with the old STI value' do
- let(:type_info) { { type: 'ExternalWikiService' } }
-
- it_behaves_like 'external wiki triggers'
- end
- end
-
- describe '#down' do
- before do
- migration.up
- migration.down
- end
-
- let(:type_info) { { type: 'ExternalWikiService' } }
-
- it_behaves_like 'external wiki triggers'
- end
-end
diff --git a/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb b/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb
deleted file mode 100644
index bbc4494837a..00000000000
--- a/spec/migrations/reschedule_delete_orphaned_deployments_spec.rb
+++ /dev/null
@@ -1,74 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RescheduleDeleteOrphanedDeployments, :sidekiq, schema: 20210617161348,
- feature_category: :continuous_delivery 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)
- create_deployment!(environment.id, project.id)
- create_deployment!(environment.id, project.id)
- create_deployment!(non_existing_record_id, project.id)
- create_deployment!(non_existing_record_id, project.id)
- create_deployment!(non_existing_record_id, project.id)
- create_deployment!(non_existing_record_id, project.id)
-
- stub_const("#{described_class}::BATCH_SIZE", 1)
- end
-
- it 'steal existing background migration jobs' do
- expect(Gitlab::BackgroundMigration).to receive(:steal).with('DeleteOrphanedDeployments')
-
- migrate!
- end
-
- it 'cleans up background migration jobs tracking records' do
- old_successful_job = background_migration_jobs.create!(
- class_name: 'DeleteOrphanedDeployments',
- status: Gitlab::Database::BackgroundMigrationJob.statuses[:succeeded],
- arguments: [table(:deployments).minimum(:id), table(:deployments).minimum(:id)]
- )
-
- old_pending_job = background_migration_jobs.create!(
- class_name: 'DeleteOrphanedDeployments',
- status: Gitlab::Database::BackgroundMigrationJob.statuses[:pending],
- arguments: [table(:deployments).maximum(:id), table(:deployments).maximum(:id)]
- )
-
- migrate!
-
- expect { old_successful_job.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { old_pending_job.reload }.to raise_error(ActiveRecord::RecordNotFound)
- end
-
- it 'schedules DeleteOrphanedDeployments background jobs' do
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(7)
- table(:deployments).find_each do |deployment|
- expect(described_class::MIGRATION).to be_scheduled_migration(deployment.id, deployment.id)
- end
- end
- end
- 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/migrations/reset_job_token_scope_enabled_again_spec.rb b/spec/migrations/reset_job_token_scope_enabled_again_spec.rb
deleted file mode 100644
index 9f1180b6e24..00000000000
--- a/spec/migrations/reset_job_token_scope_enabled_again_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe ResetJobTokenScopeEnabledAgain, feature_category: :continuous_integration do
- let(:settings) { table(:project_ci_cd_settings) }
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
- let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') }
- let(:project_1) { projects.create!(name: 'proj-1', path: 'gitlab-org', namespace_id: namespace.id) }
- let(:project_2) { projects.create!(name: 'proj-2', path: 'gitlab-org', namespace_id: namespace.id) }
-
- before do
- settings.create!(id: 1, project_id: project_1.id, job_token_scope_enabled: true)
- settings.create!(id: 2, project_id: project_2.id, job_token_scope_enabled: false)
- end
-
- it 'migrates job_token_scope_enabled to be always false' do
- expect { migrate! }
- .to change { settings.where(job_token_scope_enabled: false).count }
- .from(1).to(2)
- end
-end
diff --git a/spec/migrations/reset_job_token_scope_enabled_spec.rb b/spec/migrations/reset_job_token_scope_enabled_spec.rb
deleted file mode 100644
index 4ce9078246a..00000000000
--- a/spec/migrations/reset_job_token_scope_enabled_spec.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe ResetJobTokenScopeEnabled, feature_category: :continuous_integration do
- let(:settings) { table(:project_ci_cd_settings) }
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
- let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') }
- let(:project_1) { projects.create!(name: 'proj-1', path: 'gitlab-org', namespace_id: namespace.id) }
- let(:project_2) { projects.create!(name: 'proj-2', path: 'gitlab-org', namespace_id: namespace.id) }
-
- before do
- settings.create!(id: 1, project_id: project_1.id, job_token_scope_enabled: true)
- settings.create!(id: 2, project_id: project_2.id, job_token_scope_enabled: false)
- end
-
- it 'migrates job_token_scope_enabled to be always false' do
- expect { migrate! }
- .to change { settings.where(job_token_scope_enabled: false).count }
- .from(1).to(2)
- end
-end
diff --git a/spec/migrations/reset_severity_levels_to_new_default_spec.rb b/spec/migrations/reset_severity_levels_to_new_default_spec.rb
deleted file mode 100644
index 83e57b852a0..00000000000
--- a/spec/migrations/reset_severity_levels_to_new_default_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe ResetSeverityLevelsToNewDefault, feature_category: :source_code_management do
- let(:approval_project_rules) { table(:approval_project_rules) }
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
- let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') }
- let(:project) { projects.create!(name: 'project', path: 'project', namespace_id: namespace.id) }
- let(:approval_project_rule) { approval_project_rules.create!(name: 'rule', project_id: project.id, severity_levels: severity_levels) }
-
- context 'without having all severity levels selected' do
- let(:severity_levels) { ['high'] }
-
- it 'does not change severity_levels' do
- expect(approval_project_rule.severity_levels).to eq(severity_levels)
- expect { migrate! }.not_to change { approval_project_rule.reload.severity_levels }
- end
- end
-
- context 'with all scanners selected' do
- let(:severity_levels) { ::Enums::Vulnerability::SEVERITY_LEVELS.keys }
- let(:default_levels) { %w(unknown high critical) }
-
- it 'changes severity_levels to the default value' do
- expect(approval_project_rule.severity_levels).to eq(severity_levels)
- expect { migrate! }.to change { approval_project_rule.reload.severity_levels }.from(severity_levels).to(default_levels)
- end
- end
-end
diff --git a/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb b/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb
deleted file mode 100644
index 63678a094a7..00000000000
--- a/spec/migrations/schedule_copy_ci_builds_columns_to_security_scans2_spec.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ScheduleCopyCiBuildsColumnsToSecurityScans2, feature_category: :dependency_scanning do
- it 'is a no-op' do
- migrate!
- end
-end
diff --git a/spec/migrations/schedule_security_setting_creation_spec.rb b/spec/migrations/schedule_security_setting_creation_spec.rb
deleted file mode 100644
index edabb2a2299..00000000000
--- a/spec/migrations/schedule_security_setting_creation_spec.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe ScheduleSecuritySettingCreation, :sidekiq, feature_category: :projects do
- describe '#up' do
- let(:projects) { table(:projects) }
- let(:namespaces) { table(:namespaces) }
-
- context 'for EE version' do
- before do
- stub_const("#{described_class.name}::BATCH_SIZE", 2)
- allow(Gitlab).to receive(:ee?).and_return(true)
- end
-
- it 'schedules background migration job' do
- namespace = namespaces.create!(name: 'test', path: 'test')
- projects.create!(id: 12, namespace_id: namespace.id, name: 'red', path: 'red')
- projects.create!(id: 13, namespace_id: namespace.id, name: 'green', path: 'green')
- projects.create!(id: 14, namespace_id: namespace.id, name: 'blue', path: 'blue')
-
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(described_class::MIGRATION)
- .to be_scheduled_delayed_migration(5.minutes, 12, 13)
-
- expect(described_class::MIGRATION)
- .to be_scheduled_delayed_migration(10.minutes, 14, 14)
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(2)
- end
- end
- end
- end
-
- context 'for FOSS version' do
- before do
- allow(Gitlab).to receive(:ee?).and_return(false)
- end
-
- it 'does not schedule any jobs' do
- namespace = namespaces.create!(name: 'test', path: 'test')
- projects.create!(id: 12, namespace_id: namespace.id, name: 'red', path: 'red')
-
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(0)
- end
- end
- end
- end
- end
-end
diff --git a/spec/migrations/set_default_job_token_scope_true_spec.rb b/spec/migrations/set_default_job_token_scope_true_spec.rb
deleted file mode 100644
index 25f4f07e15a..00000000000
--- a/spec/migrations/set_default_job_token_scope_true_spec.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe SetDefaultJobTokenScopeTrue, schema: 20210819153805, feature_category: :continuous_integration do
- let(:ci_cd_settings) { table(:project_ci_cd_settings) }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
-
- let(:namespace) { namespaces.create!(name: 'test', path: 'path', type: 'Group') }
- let(:project) { projects.create!(namespace_id: namespace.id) }
-
- describe '#up' do
- it 'sets the job_token_scope_enabled default to true' do
- described_class.new.up
-
- settings = ci_cd_settings.create!(project_id: project.id)
-
- expect(settings.job_token_scope_enabled).to be_truthy
- end
- end
-
- describe '#down' do
- it 'sets the job_token_scope_enabled default to false' do
- described_class.new.down
-
- settings = ci_cd_settings.create!(project_id: project.id)
-
- expect(settings.job_token_scope_enabled).to be_falsey
- end
- end
-end
diff --git a/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb b/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb
deleted file mode 100644
index d2cd7a6980d..00000000000
--- a/spec/migrations/steal_merge_request_diff_commit_users_migration_spec.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe StealMergeRequestDiffCommitUsersMigration, :migration, feature_category: :source_code_management do
- let(:migration) { described_class.new }
-
- describe '#up' do
- it 'schedules a job if there are pending jobs' do
- Gitlab::Database::BackgroundMigrationJob.create!(
- class_name: 'MigrateMergeRequestDiffCommitUsers',
- arguments: [10, 20]
- )
-
- expect(migration)
- .to receive(:migrate_in)
- .with(1.hour, 'StealMigrateMergeRequestDiffCommitUsers', [10, 20])
-
- migration.up
- end
-
- it 'does not schedule any jobs when all jobs have been completed' do
- expect(migration).not_to receive(:migrate_in)
-
- migration.up
- end
- end
-end
diff --git a/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb b/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb
deleted file mode 100644
index efc051d9a68..00000000000
--- a/spec/migrations/update_integrations_trigger_type_new_on_insert_spec.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe UpdateIntegrationsTriggerTypeNewOnInsert, feature_category: :integrations do
- let(:migration) { described_class.new }
- let(:integrations) { table(:integrations) }
-
- shared_examples 'transforms known types' do
- # This matches Gitlab::Integrations::StiType at the time the original trigger
- # was added in db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb
- let(:namespaced_integrations) do
- %w[
- Asana Assembla Bamboo Bugzilla Buildkite Campfire Confluence CustomIssueTracker Datadog
- Discord DroneCi EmailsOnPush Ewm ExternalWiki Flowdock HangoutsChat Irker Jenkins Jira Mattermost
- MattermostSlashCommands MicrosoftTeams MockCi MockMonitoring Packagist PipelinesEmail Pivotaltracker
- Prometheus Pushover Redmine Slack SlackSlashCommands Teamcity UnifyCircuit WebexTeams Youtrack
-
- Github GitlabSlackApplication
- ]
- end
-
- it 'sets `type_new` to the transformed `type` class name' do
- namespaced_integrations.each do |type|
- integration = integrations.create!(type: "#{type}Service")
-
- expect(integration.reload).to have_attributes(
- type: "#{type}Service",
- type_new: "Integrations::#{type}"
- )
- end
- end
- end
-
- describe '#up' do
- before do
- migrate!
- end
-
- describe 'INSERT trigger with dynamic mapping' do
- it_behaves_like 'transforms known types'
-
- it 'transforms unknown types if it ends in "Service"' do
- integration = integrations.create!(type: 'AcmeService')
-
- expect(integration.reload).to have_attributes(
- type: 'AcmeService',
- type_new: 'Integrations::Acme'
- )
- end
-
- it 'ignores "Service" occurring elsewhere in the type' do
- integration = integrations.create!(type: 'ServiceAcmeService')
-
- expect(integration.reload).to have_attributes(
- type: 'ServiceAcmeService',
- type_new: 'Integrations::ServiceAcme'
- )
- end
-
- it 'copies unknown types if it does not end with "Service"' do
- integration = integrations.create!(type: 'Integrations::Acme')
-
- expect(integration.reload).to have_attributes(
- type: 'Integrations::Acme',
- type_new: 'Integrations::Acme'
- )
- end
- end
- end
-
- describe '#down' do
- before do
- migration.up
- migration.down
- end
-
- describe 'INSERT trigger with static mapping' do
- it_behaves_like 'transforms known types'
-
- it 'ignores types that are already namespaced' do
- integration = integrations.create!(type: 'Integrations::Asana')
-
- expect(integration.reload).to have_attributes(
- type: 'Integrations::Asana',
- type_new: nil
- )
- end
-
- it 'ignores types that are unknown' do
- integration = integrations.create!(type: 'FooBar')
-
- expect(integration.reload).to have_attributes(
- type: 'FooBar',
- type_new: nil
- )
- end
- end
- end
-end
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 2b0791323ff..9faa4a98c07 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -2873,7 +2873,13 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def
before do
allow_next_instance_of(Gitlab::Ci::Variables::Builder) do |builder|
+ pipeline_variables_builder = double(
+ ::Gitlab::Ci::Variables::Builder::Pipeline,
+ predefined_variables: [pipeline_pre_var]
+ )
+
allow(builder).to receive(:predefined_variables) { [build_pre_var] }
+ allow(builder).to receive(:pipeline_variables_builder) { pipeline_variables_builder }
end
allow(build).to receive(:yaml_variables) { [build_yaml_var] }
@@ -2886,9 +2892,6 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def
.to receive(:predefined_variables) { [project_pre_var] }
project.variables.create!(key: 'secret', value: 'value')
-
- allow(build.pipeline)
- .to receive(:predefined_variables).and_return([pipeline_pre_var])
end
it 'returns variables in order depending on resource hierarchy' do
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 4a59f8d8efc..61422978df7 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -1070,296 +1070,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep, feature_category:
end
end
- describe '#predefined_variables' do
- subject { pipeline.predefined_variables }
-
- let(:pipeline) { build(:ci_empty_pipeline, :created) }
-
- it 'includes all predefined variables in a valid order' do
- keys = subject.map { |variable| variable[:key] }
-
- expect(keys).to eq %w[
- CI_PIPELINE_IID
- CI_PIPELINE_SOURCE
- CI_PIPELINE_CREATED_AT
- CI_COMMIT_SHA
- CI_COMMIT_SHORT_SHA
- CI_COMMIT_BEFORE_SHA
- CI_COMMIT_REF_NAME
- CI_COMMIT_REF_SLUG
- CI_COMMIT_BRANCH
- CI_COMMIT_MESSAGE
- CI_COMMIT_TITLE
- CI_COMMIT_DESCRIPTION
- CI_COMMIT_REF_PROTECTED
- CI_COMMIT_TIMESTAMP
- CI_COMMIT_AUTHOR
- CI_BUILD_REF
- CI_BUILD_BEFORE_SHA
- CI_BUILD_REF_NAME
- CI_BUILD_REF_SLUG
- ]
- end
-
- context 'when merge request is present' do
- let_it_be(:assignees) { create_list(:user, 2) }
- let_it_be(:milestone) { create(:milestone, project: project) }
- let_it_be(:labels) { create_list(:label, 2) }
-
- let(:merge_request) do
- create(:merge_request, :simple,
- source_project: project,
- target_project: project,
- assignees: assignees,
- milestone: milestone,
- labels: labels)
- end
-
- context 'when pipeline for merge request is created' do
- let(:pipeline) do
- create(:ci_pipeline, :detached_merge_request_pipeline,
- ci_ref_presence: false,
- user: user,
- merge_request: merge_request)
- end
-
- before do
- project.add_developer(user)
- end
-
- it 'exposes merge request pipeline variables' do
- expect(subject.to_hash)
- .to include(
- 'CI_MERGE_REQUEST_ID' => merge_request.id.to_s,
- 'CI_MERGE_REQUEST_IID' => merge_request.iid.to_s,
- 'CI_MERGE_REQUEST_REF_PATH' => merge_request.ref_path.to_s,
- 'CI_MERGE_REQUEST_PROJECT_ID' => merge_request.project.id.to_s,
- 'CI_MERGE_REQUEST_PROJECT_PATH' => merge_request.project.full_path,
- 'CI_MERGE_REQUEST_PROJECT_URL' => merge_request.project.web_url,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME' => merge_request.target_branch.to_s,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED' => ProtectedBranch.protected?(merge_request.target_project, merge_request.target_branch).to_s,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA' => '',
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_ID' => merge_request.source_project.id.to_s,
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_PATH' => merge_request.source_project.full_path,
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_URL' => merge_request.source_project.web_url,
- 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s,
- 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => '',
- 'CI_MERGE_REQUEST_TITLE' => merge_request.title,
- 'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list,
- 'CI_MERGE_REQUEST_MILESTONE' => milestone.title,
- 'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','),
- 'CI_MERGE_REQUEST_EVENT_TYPE' => 'detached',
- 'CI_OPEN_MERGE_REQUESTS' => merge_request.to_reference(full: true))
- end
-
- it 'exposes diff variables' do
- expect(subject.to_hash)
- .to include(
- 'CI_MERGE_REQUEST_DIFF_ID' => merge_request.merge_request_diff.id.to_s,
- 'CI_MERGE_REQUEST_DIFF_BASE_SHA' => merge_request.merge_request_diff.base_commit_sha)
- end
-
- context 'without assignee' do
- let(:assignees) { [] }
-
- it 'does not expose assignee variable' do
- expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_ASSIGNEES')
- end
- end
-
- context 'without milestone' do
- let(:milestone) { nil }
-
- it 'does not expose milestone variable' do
- expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_MILESTONE')
- end
- end
-
- context 'without labels' do
- let(:labels) { [] }
-
- it 'does not expose labels variable' do
- expect(subject.to_hash.keys).not_to include('CI_MERGE_REQUEST_LABELS')
- end
- end
- end
-
- context 'when pipeline on branch is created' do
- let(:pipeline) do
- create(:ci_pipeline, project: project, user: user, ref: 'feature')
- end
-
- context 'when a merge request is created' do
- before do
- merge_request
- end
-
- context 'when user has access to project' do
- before do
- project.add_developer(user)
- end
-
- it 'merge request references are returned matching the pipeline' do
- expect(subject.to_hash).to include(
- 'CI_OPEN_MERGE_REQUESTS' => merge_request.to_reference(full: true))
- end
- end
-
- context 'when user does not have access to project' do
- it 'CI_OPEN_MERGE_REQUESTS is not returned' do
- expect(subject.to_hash).not_to have_key('CI_OPEN_MERGE_REQUESTS')
- end
- end
- end
-
- context 'when no a merge request is created' do
- it 'CI_OPEN_MERGE_REQUESTS is not returned' do
- expect(subject.to_hash).not_to have_key('CI_OPEN_MERGE_REQUESTS')
- end
- end
- end
-
- context 'with merged results' do
- let(:pipeline) do
- create(:ci_pipeline, :merged_result_pipeline, merge_request: merge_request)
- end
-
- it 'exposes merge request pipeline variables' do
- expect(subject.to_hash)
- .to include(
- 'CI_MERGE_REQUEST_ID' => merge_request.id.to_s,
- 'CI_MERGE_REQUEST_IID' => merge_request.iid.to_s,
- 'CI_MERGE_REQUEST_REF_PATH' => merge_request.ref_path.to_s,
- 'CI_MERGE_REQUEST_PROJECT_ID' => merge_request.project.id.to_s,
- 'CI_MERGE_REQUEST_PROJECT_PATH' => merge_request.project.full_path,
- 'CI_MERGE_REQUEST_PROJECT_URL' => merge_request.project.web_url,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME' => merge_request.target_branch.to_s,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_PROTECTED' => ProtectedBranch.protected?(merge_request.target_project, merge_request.target_branch).to_s,
- 'CI_MERGE_REQUEST_TARGET_BRANCH_SHA' => merge_request.target_branch_sha,
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_ID' => merge_request.source_project.id.to_s,
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_PATH' => merge_request.source_project.full_path,
- 'CI_MERGE_REQUEST_SOURCE_PROJECT_URL' => merge_request.source_project.web_url,
- 'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s,
- 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => merge_request.source_branch_sha,
- 'CI_MERGE_REQUEST_TITLE' => merge_request.title,
- 'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list,
- 'CI_MERGE_REQUEST_MILESTONE' => milestone.title,
- 'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','),
- 'CI_MERGE_REQUEST_EVENT_TYPE' => 'merged_result')
- end
-
- it 'exposes diff variables' do
- expect(subject.to_hash)
- .to include(
- 'CI_MERGE_REQUEST_DIFF_ID' => merge_request.merge_request_diff.id.to_s,
- 'CI_MERGE_REQUEST_DIFF_BASE_SHA' => merge_request.merge_request_diff.base_commit_sha)
- end
- end
- end
-
- context 'when source is external pull request' do
- let(:pipeline) do
- create(:ci_pipeline, source: :external_pull_request_event, external_pull_request: pull_request)
- end
-
- let(:pull_request) { create(:external_pull_request, project: project) }
-
- it 'exposes external pull request pipeline variables' do
- expect(subject.to_hash)
- .to include(
- 'CI_EXTERNAL_PULL_REQUEST_IID' => pull_request.pull_request_iid.to_s,
- 'CI_EXTERNAL_PULL_REQUEST_SOURCE_REPOSITORY' => pull_request.source_repository,
- 'CI_EXTERNAL_PULL_REQUEST_TARGET_REPOSITORY' => pull_request.target_repository,
- 'CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_SHA' => pull_request.source_sha,
- 'CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_SHA' => pull_request.target_sha,
- 'CI_EXTERNAL_PULL_REQUEST_SOURCE_BRANCH_NAME' => pull_request.source_branch,
- 'CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME' => pull_request.target_branch
- )
- end
- end
-
- describe 'variable CI_KUBERNETES_ACTIVE' do
- context 'when pipeline.has_kubernetes_active? is true' do
- before do
- allow(pipeline).to receive(:has_kubernetes_active?).and_return(true)
- end
-
- it "is included with value 'true'" do
- expect(subject.to_hash).to include('CI_KUBERNETES_ACTIVE' => 'true')
- end
- end
-
- context 'when pipeline.has_kubernetes_active? is false' do
- before do
- allow(pipeline).to receive(:has_kubernetes_active?).and_return(false)
- end
-
- it 'is not included' do
- expect(subject.to_hash).not_to have_key('CI_KUBERNETES_ACTIVE')
- end
- end
- end
-
- describe 'variable CI_GITLAB_FIPS_MODE' do
- context 'when FIPS flag is enabled' do
- before do
- allow(Gitlab::FIPS).to receive(:enabled?).and_return(true)
- end
-
- it "is included with value 'true'" do
- expect(subject.to_hash).to include('CI_GITLAB_FIPS_MODE' => 'true')
- end
- end
-
- context 'when FIPS flag is disabled' do
- before do
- allow(Gitlab::FIPS).to receive(:enabled?).and_return(false)
- end
-
- it 'is not included' do
- expect(subject.to_hash).not_to have_key('CI_GITLAB_FIPS_MODE')
- end
- end
- end
-
- context 'when tag is not found' do
- let(:pipeline) do
- create(:ci_pipeline, project: project, ref: 'not_found_tag', tag: true)
- end
-
- it 'does not expose tag variables' do
- expect(subject.to_hash.keys)
- .not_to include(
- 'CI_COMMIT_TAG',
- 'CI_COMMIT_TAG_MESSAGE',
- 'CI_BUILD_TAG'
- )
- end
- end
-
- context 'without a commit' do
- let(:pipeline) { build(:ci_empty_pipeline, :created, sha: nil) }
-
- it 'does not expose commit variables' do
- expect(subject.to_hash.keys)
- .not_to include(
- 'CI_COMMIT_SHA',
- 'CI_COMMIT_SHORT_SHA',
- 'CI_COMMIT_BEFORE_SHA',
- 'CI_COMMIT_REF_NAME',
- 'CI_COMMIT_REF_SLUG',
- 'CI_COMMIT_BRANCH',
- 'CI_COMMIT_TAG',
- 'CI_COMMIT_MESSAGE',
- 'CI_COMMIT_TITLE',
- 'CI_COMMIT_DESCRIPTION',
- 'CI_COMMIT_REF_PROTECTED',
- 'CI_COMMIT_TIMESTAMP',
- 'CI_COMMIT_AUTHOR')
- end
- end
- end
-
describe '#protected_ref?' do
let(:pipeline) { build(:ci_empty_pipeline, :created) }
@@ -5664,6 +5374,34 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep, feature_category:
end
end
+ describe '#merge_request_diff' do
+ context 'when the pipeline has no merge request' do
+ it 'is nil' do
+ pipeline = build(:ci_empty_pipeline)
+
+ expect(pipeline.merge_request_diff).to be_nil
+ end
+ end
+
+ context 'when the pipeline has a merge request' do
+ context 'when the pipeline is a merged result pipeline' do
+ it 'returns the diff for the source sha' do
+ pipeline = create(:ci_pipeline, :merged_result_pipeline)
+
+ expect(pipeline.merge_request_diff.head_commit_sha).to eq(pipeline.source_sha)
+ end
+ end
+
+ context 'when the pipeline is not a merged result pipeline' do
+ it 'returns the diff for the pipeline sha' do
+ pipeline = create(:ci_pipeline, merge_request: create(:merge_request))
+
+ expect(pipeline.merge_request_diff.head_commit_sha).to eq(pipeline.sha)
+ end
+ end
+ end
+ end
+
describe 'partitioning' do
let(:pipeline) { build(:ci_pipeline, partition_id: nil) }
diff --git a/spec/requests/api/ci/runner/jobs_request_post_spec.rb b/spec/requests/api/ci/runner/jobs_request_post_spec.rb
index d15bc9d2dd5..c11381fe448 100644
--- a/spec/requests/api/ci/runner/jobs_request_post_spec.rb
+++ b/spec/requests/api/ci/runner/jobs_request_post_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state, feature_category: :runner do
+RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state, feature_category: :continuous_integration do
include StubGitlabCalls
include RedisHelpers
include WorkhorseHelpers
@@ -119,6 +119,32 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state, feature_catego
end
end
+ context 'when system_id parameter is specified' do
+ subject(:request) { request_job(**args) }
+
+ context 'when ci_runner_machines with same machine_xid does not exist' do
+ let(:args) { { system_id: 's_some_system_id' } }
+
+ it 'creates respective ci_runner_machines record', :freeze_time do
+ expect { request }.to change { runner.runner_machines.reload.count }.from(0).to(1)
+
+ machine = runner.runner_machines.last
+ expect(machine.machine_xid).to eq args[:system_id]
+ expect(machine.runner).to eq runner
+ expect(machine.contacted_at).to eq Time.current
+ end
+ end
+
+ context 'when ci_runner_machines with same machine_xid already exists' do
+ let(:args) { { system_id: 's_existing_system_id' } }
+ let!(:runner_machine) { create(:ci_runner_machine, runner: runner, machine_xid: args[:system_id]) }
+
+ it 'does not create new ci_runner_machines record' do
+ expect { request }.not_to change { Ci::RunnerMachine.count }
+ end
+ end
+ end
+
context 'when jobs are finished' do
before do
job.success
diff --git a/spec/requests/api/graphql/mutations/ci/pipeline_schedule_play_spec.rb b/spec/requests/api/graphql/mutations/ci/pipeline_schedule_play_spec.rb
index 4c0635c8640..9161304cfc3 100644
--- a/spec/requests/api/graphql/mutations/ci/pipeline_schedule_play_spec.rb
+++ b/spec/requests/api/graphql/mutations/ci/pipeline_schedule_play_spec.rb
@@ -68,7 +68,7 @@ RSpec.describe 'PipelineSchedulePlay', feature_category: :continuous_integration
it do
expect(RunPipelineScheduleWorker)
.to receive(:perform_async)
- .with(pipeline_schedule.id, user.id, next_run_scheduled: true).and_return(nil)
+ .with(pipeline_schedule.id, user.id).and_return(nil)
post_graphql_mutation(mutation, current_user: user)
@@ -102,7 +102,7 @@ RSpec.describe 'PipelineSchedulePlay', feature_category: :continuous_integration
it do
expect(RunPipelineScheduleWorker)
.to receive(:perform_async)
- .with(pipeline_schedule.id, user.id, next_run_scheduled: true).and_return(nil)
+ .with(pipeline_schedule.id, user.id).and_return(nil)
post_graphql_mutation(mutation, current_user: user)
diff --git a/spec/requests/api/project_attributes.yml b/spec/requests/api/project_attributes.yml
index 3fdb737ea5c..66cca8fbe56 100644
--- a/spec/requests/api/project_attributes.yml
+++ b/spec/requests/api/project_attributes.yml
@@ -90,7 +90,6 @@ ci_cd_settings:
unexposed_attributes:
- id
- project_id
- - group_runners_enabled
- merge_trains_enabled
- merge_pipelines_enabled
- auto_rollback_enabled
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 1c8aec878ea..b86aa04439e 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -2442,6 +2442,7 @@ RSpec.describe API::Projects, feature_category: :projects do
expect(json_response['created_at']).to be_present
expect(json_response['last_activity_at']).to be_present
expect(json_response['shared_runners_enabled']).to be_present
+ expect(json_response['group_runners_enabled']).to be_present
expect(json_response['creator_id']).to be_present
expect(json_response['namespace']).to be_present
expect(json_response['avatar_url']).to be_nil
@@ -2546,6 +2547,7 @@ RSpec.describe API::Projects, feature_category: :projects do
expect(json_response['created_at']).to be_present
expect(json_response['last_activity_at']).to be_present
expect(json_response['shared_runners_enabled']).to be_present
+ expect(json_response['group_runners_enabled']).to be_present
expect(json_response['creator_id']).to be_present
expect(json_response['namespace']).to be_present
expect(json_response['import_status']).to be_present
diff --git a/spec/serializers/integrations/field_entity_spec.rb b/spec/serializers/integrations/field_entity_spec.rb
index 4212a1ee6a2..1ca1545c11a 100644
--- a/spec/serializers/integrations/field_entity_spec.rb
+++ b/spec/serializers/integrations/field_entity_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Integrations::FieldEntity do
+RSpec.describe Integrations::FieldEntity, feature_category: :integrations do
let(:request) { EntityRequest.new(integration: integration) }
subject { described_class.new(field, request: request, integration: integration).as_json }
@@ -23,9 +23,9 @@ RSpec.describe Integrations::FieldEntity do
section: 'connection',
type: 'text',
name: 'username',
- title: 'Username or Email',
+ title: 'Username or email',
placeholder: nil,
- help: 'Use a username for server version and an email for cloud version.',
+ help: 'Username for the server version or an email for the cloud version',
required: true,
choices: nil,
value: 'jira_username',
diff --git a/spec/services/ci/pipeline_schedule_service_spec.rb b/spec/services/ci/pipeline_schedule_service_spec.rb
index 4f20a4389ca..8896d8ace30 100644
--- a/spec/services/ci/pipeline_schedule_service_spec.rb
+++ b/spec/services/ci/pipeline_schedule_service_spec.rb
@@ -21,7 +21,7 @@ RSpec.describe Ci::PipelineScheduleService, feature_category: :continuous_integr
it 'runs RunPipelineScheduleWorker' do
expect(RunPipelineScheduleWorker)
- .to receive(:perform_async).with(schedule.id, schedule.owner.id, next_run_scheduled: true)
+ .to receive(:perform_async).with(schedule.id, schedule.owner.id)
subject
end
@@ -43,7 +43,7 @@ RSpec.describe Ci::PipelineScheduleService, feature_category: :continuous_integr
it 'does not run RunPipelineScheduleWorker' do
expect(RunPipelineScheduleWorker)
- .not_to receive(:perform_async).with(schedule.id, schedule.owner.id, next_run_scheduled: true)
+ .not_to receive(:perform_async).with(schedule.id, schedule.owner.id)
subject
end
diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb
index f834bc2674b..9183df359b4 100644
--- a/spec/services/ci/register_job_service_spec.rb
+++ b/spec/services/ci/register_job_service_spec.rb
@@ -3,795 +3,830 @@
require 'spec_helper'
module Ci
- RSpec.describe RegisterJobService do
+ RSpec.describe RegisterJobService, feature_category: :continuous_integration do
let_it_be(:group) { create(:group) }
let_it_be_with_reload(:project) { create(:project, group: group, shared_runners_enabled: false, group_runners_enabled: false) }
let_it_be_with_reload(:pipeline) { create(:ci_pipeline, project: project) }
- let!(:shared_runner) { create(:ci_runner, :instance) }
+ let_it_be(:shared_runner) { create(:ci_runner, :instance) }
let!(:project_runner) { create(:ci_runner, :project, projects: [project]) }
let!(:group_runner) { create(:ci_runner, :group, groups: [group]) }
let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
describe '#execute' do
- subject { described_class.new(shared_runner).execute }
+ subject(:execute) { described_class.new(runner, runner_machine).execute }
+
+ context 'with runner_machine specified' do
+ let(:runner) { project_runner }
+ let!(:runner_machine) { create(:ci_runner_machine, runner: project_runner) }
- context 'checks database loadbalancing stickiness' do
before do
- project.update!(shared_runners_enabled: false)
+ pending_job.update!(tag_list: ["linux"])
+ pending_job.reload
+ pending_job.create_queuing_entry!
+ project_runner.update!(tag_list: ["linux"])
end
- it 'result is valid if replica did caught-up', :aggregate_failures do
- expect(ApplicationRecord.sticking).to receive(:all_caught_up?)
- .with(:runner, shared_runner.id) { true }
+ it 'sets runner_machine on job' do
+ expect { execute }.to change { pending_job.reload.runner_machine }.from(nil).to(runner_machine)
- expect(subject).to be_valid
- expect(subject.build).to be_nil
- expect(subject.build_json).to be_nil
+ expect(execute.build).to eq(pending_job)
end
+ end
- it 'result is invalid if replica did not caught-up', :aggregate_failures do
- expect(ApplicationRecord.sticking).to receive(:all_caught_up?)
- .with(:runner, shared_runner.id) { false }
+ context 'with no runner machine' do
+ let(:runner_machine) { nil }
- expect(subject).not_to be_valid
- expect(subject.build).to be_nil
- expect(subject.build_json).to be_nil
- end
- end
+ context 'checks database loadbalancing stickiness' do
+ let(:runner) { shared_runner }
- shared_examples 'handles runner assignment' do
- context 'runner follow tag list' do
- it "picks build with the same tag" do
- pending_job.update!(tag_list: ["linux"])
- pending_job.reload
- pending_job.create_queuing_entry!
- project_runner.update!(tag_list: ["linux"])
- expect(execute(project_runner)).to eq(pending_job)
+ before do
+ project.update!(shared_runners_enabled: false)
end
- it "does not pick build with different tag" do
- pending_job.update!(tag_list: ["linux"])
- pending_job.reload
- pending_job.create_queuing_entry!
- project_runner.update!(tag_list: ["win32"])
- expect(execute(project_runner)).to be_falsey
- end
+ it 'result is valid if replica did caught-up', :aggregate_failures do
+ expect(ApplicationRecord.sticking).to receive(:all_caught_up?).with(:runner, runner.id) { true }
- it "picks build without tag" do
- expect(execute(project_runner)).to eq(pending_job)
+ expect(execute).to be_valid
+ expect(execute.build).to be_nil
+ expect(execute.build_json).to be_nil
end
- it "does not pick build with tag" do
- pending_job.update!(tag_list: ["linux"])
- pending_job.reload
- pending_job.create_queuing_entry!
- expect(execute(project_runner)).to be_falsey
- end
+ it 'result is invalid if replica did not caught-up', :aggregate_failures do
+ expect(ApplicationRecord.sticking).to receive(:all_caught_up?)
+ .with(:runner, shared_runner.id) { false }
- it "pick build without tag" do
- project_runner.update!(tag_list: ["win32"])
- expect(execute(project_runner)).to eq(pending_job)
+ expect(subject).not_to be_valid
+ expect(subject.build).to be_nil
+ expect(subject.build_json).to be_nil
end
end
- context 'deleted projects' do
- before do
- project.update!(pending_delete: true)
- end
+ shared_examples 'handles runner assignment' do
+ context 'runner follow tag list' do
+ it "picks build with the same tag" do
+ pending_job.update!(tag_list: ["linux"])
+ pending_job.reload
+ pending_job.create_queuing_entry!
+ project_runner.update!(tag_list: ["linux"])
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
- context 'for shared runners' do
- before do
- project.update!(shared_runners_enabled: true)
+ it "does not pick build with different tag" do
+ pending_job.update!(tag_list: ["linux"])
+ pending_job.reload
+ pending_job.create_queuing_entry!
+ project_runner.update!(tag_list: ["win32"])
+ expect(build_on(project_runner)).to be_falsey
end
- it 'does not pick a build' do
- expect(execute(shared_runner)).to be_nil
+ it "picks build without tag" do
+ expect(build_on(project_runner)).to eq(pending_job)
end
- end
- context 'for project runner' do
- it 'does not pick a build' do
- expect(execute(project_runner)).to be_nil
- expect(pending_job.reload).to be_failed
- expect(pending_job.queuing_entry).to be_nil
+ it "does not pick build with tag" do
+ pending_job.update!(tag_list: ["linux"])
+ pending_job.reload
+ pending_job.create_queuing_entry!
+ expect(build_on(project_runner)).to be_falsey
end
- end
- end
- context 'allow shared runners' do
- before do
- project.update!(shared_runners_enabled: true)
- pipeline.reload
- pending_job.reload
- pending_job.create_queuing_entry!
+ it "pick build without tag" do
+ project_runner.update!(tag_list: ["win32"])
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
- context 'when build owner has been blocked' do
- let(:user) { create(:user, :blocked) }
-
+ context 'deleted projects' do
before do
- pending_job.update!(user: user)
+ project.update!(pending_delete: true)
end
- it 'does not pick the build and drops the build' do
- expect(execute(shared_runner)).to be_falsey
+ context 'for shared runners' do
+ before do
+ project.update!(shared_runners_enabled: true)
+ end
- expect(pending_job.reload).to be_user_blocked
+ it 'does not pick a build' do
+ expect(build_on(shared_runner)).to be_nil
+ end
+ end
+
+ context 'for project runner' do
+ it 'does not pick a build' do
+ expect(build_on(project_runner)).to be_nil
+ expect(pending_job.reload).to be_failed
+ expect(pending_job.queuing_entry).to be_nil
+ end
end
end
- context 'for multiple builds' do
- let!(:project2) { create :project, shared_runners_enabled: true }
- let!(:pipeline2) { create :ci_pipeline, project: project2 }
- let!(:project3) { create :project, shared_runners_enabled: true }
- let!(:pipeline3) { create :ci_pipeline, project: project3 }
- let!(:build1_project1) { pending_job }
- let!(:build2_project1) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- let!(:build3_project1) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- let!(:build1_project2) { create(:ci_build, :pending, :queued, pipeline: pipeline2) }
- let!(:build2_project2) { create(:ci_build, :pending, :queued, pipeline: pipeline2) }
- let!(:build1_project3) { create(:ci_build, :pending, :queued, pipeline: pipeline3) }
-
- it 'picks builds one-by-one' do
- expect(Ci::Build).to receive(:find).with(pending_job.id).and_call_original
-
- expect(execute(shared_runner)).to eq(build1_project1)
- end
-
- context 'when using fair scheduling' do
- context 'when all builds are pending' do
- it 'prefers projects without builds first' do
- # it gets for one build from each of the projects
- expect(execute(shared_runner)).to eq(build1_project1)
- expect(execute(shared_runner)).to eq(build1_project2)
- expect(execute(shared_runner)).to eq(build1_project3)
-
- # then it gets a second build from each of the projects
- expect(execute(shared_runner)).to eq(build2_project1)
- expect(execute(shared_runner)).to eq(build2_project2)
-
- # in the end the third build
- expect(execute(shared_runner)).to eq(build3_project1)
- end
+ context 'allow shared runners' do
+ before do
+ project.update!(shared_runners_enabled: true)
+ pipeline.reload
+ pending_job.reload
+ pending_job.create_queuing_entry!
+ end
+
+ context 'when build owner has been blocked' do
+ let(:user) { create(:user, :blocked) }
+
+ before do
+ pending_job.update!(user: user)
end
- context 'when some builds transition to success' do
- it 'equalises number of running builds' do
- # after finishing the first build for project 1, get a second build from the same project
- expect(execute(shared_runner)).to eq(build1_project1)
- build1_project1.reload.success
- expect(execute(shared_runner)).to eq(build2_project1)
+ it 'does not pick the build and drops the build' do
+ expect(build_on(shared_runner)).to be_falsey
- expect(execute(shared_runner)).to eq(build1_project2)
- build1_project2.reload.success
- expect(execute(shared_runner)).to eq(build2_project2)
- expect(execute(shared_runner)).to eq(build1_project3)
- expect(execute(shared_runner)).to eq(build3_project1)
- end
+ expect(pending_job.reload).to be_user_blocked
end
end
- context 'when using DEFCON mode that disables fair scheduling' do
- before do
- stub_feature_flags(ci_queueing_disaster_recovery_disable_fair_scheduling: true)
- end
-
- context 'when all builds are pending' do
- it 'returns builds in order of creation (FIFO)' do
- # it gets for one build from each of the projects
- expect(execute(shared_runner)).to eq(build1_project1)
- expect(execute(shared_runner)).to eq(build2_project1)
- expect(execute(shared_runner)).to eq(build3_project1)
- expect(execute(shared_runner)).to eq(build1_project2)
- expect(execute(shared_runner)).to eq(build2_project2)
- expect(execute(shared_runner)).to eq(build1_project3)
+ context 'for multiple builds' do
+ let!(:project2) { create :project, shared_runners_enabled: true }
+ let!(:pipeline2) { create :ci_pipeline, project: project2 }
+ let!(:project3) { create :project, shared_runners_enabled: true }
+ let!(:pipeline3) { create :ci_pipeline, project: project3 }
+ let!(:build1_project1) { pending_job }
+ let!(:build2_project1) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ let!(:build3_project1) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ let!(:build1_project2) { create(:ci_build, :pending, :queued, pipeline: pipeline2) }
+ let!(:build2_project2) { create(:ci_build, :pending, :queued, pipeline: pipeline2) }
+ let!(:build1_project3) { create(:ci_build, :pending, :queued, pipeline: pipeline3) }
+
+ it 'picks builds one-by-one' do
+ expect(Ci::Build).to receive(:find).with(pending_job.id).and_call_original
+
+ expect(build_on(shared_runner)).to eq(build1_project1)
+ end
+
+ context 'when using fair scheduling' do
+ context 'when all builds are pending' do
+ it 'prefers projects without builds first' do
+ # it gets for one build from each of the projects
+ expect(build_on(shared_runner)).to eq(build1_project1)
+ expect(build_on(shared_runner)).to eq(build1_project2)
+ expect(build_on(shared_runner)).to eq(build1_project3)
+
+ # then it gets a second build from each of the projects
+ expect(build_on(shared_runner)).to eq(build2_project1)
+ expect(build_on(shared_runner)).to eq(build2_project2)
+
+ # in the end the third build
+ expect(build_on(shared_runner)).to eq(build3_project1)
+ end
+ end
+
+ context 'when some builds transition to success' do
+ it 'equalises number of running builds' do
+ # after finishing the first build for project 1, get a second build from the same project
+ expect(build_on(shared_runner)).to eq(build1_project1)
+ build1_project1.reload.success
+ expect(build_on(shared_runner)).to eq(build2_project1)
+
+ expect(build_on(shared_runner)).to eq(build1_project2)
+ build1_project2.reload.success
+ expect(build_on(shared_runner)).to eq(build2_project2)
+ expect(build_on(shared_runner)).to eq(build1_project3)
+ expect(build_on(shared_runner)).to eq(build3_project1)
+ end
end
end
- context 'when some builds transition to success' do
- it 'returns builds in order of creation (FIFO)' do
- expect(execute(shared_runner)).to eq(build1_project1)
- build1_project1.reload.success
- expect(execute(shared_runner)).to eq(build2_project1)
+ context 'when using DEFCON mode that disables fair scheduling' do
+ before do
+ stub_feature_flags(ci_queueing_disaster_recovery_disable_fair_scheduling: true)
+ end
+
+ context 'when all builds are pending' do
+ it 'returns builds in order of creation (FIFO)' do
+ # it gets for one build from each of the projects
+ expect(build_on(shared_runner)).to eq(build1_project1)
+ expect(build_on(shared_runner)).to eq(build2_project1)
+ expect(build_on(shared_runner)).to eq(build3_project1)
+ expect(build_on(shared_runner)).to eq(build1_project2)
+ expect(build_on(shared_runner)).to eq(build2_project2)
+ expect(build_on(shared_runner)).to eq(build1_project3)
+ end
+ end
- expect(execute(shared_runner)).to eq(build3_project1)
- build2_project1.reload.success
- expect(execute(shared_runner)).to eq(build1_project2)
- expect(execute(shared_runner)).to eq(build2_project2)
- expect(execute(shared_runner)).to eq(build1_project3)
+ context 'when some builds transition to success' do
+ it 'returns builds in order of creation (FIFO)' do
+ expect(build_on(shared_runner)).to eq(build1_project1)
+ build1_project1.reload.success
+ expect(build_on(shared_runner)).to eq(build2_project1)
+
+ expect(build_on(shared_runner)).to eq(build3_project1)
+ build2_project1.reload.success
+ expect(build_on(shared_runner)).to eq(build1_project2)
+ expect(build_on(shared_runner)).to eq(build2_project2)
+ expect(build_on(shared_runner)).to eq(build1_project3)
+ end
end
end
end
- end
- context 'shared runner' do
- let(:response) { described_class.new(shared_runner).execute }
- let(:build) { response.build }
+ context 'shared runner' do
+ let(:response) { described_class.new(shared_runner, nil).execute }
+ let(:build) { response.build }
- it { expect(build).to be_kind_of(Build) }
- it { expect(build).to be_valid }
- it { expect(build).to be_running }
- it { expect(build.runner).to eq(shared_runner) }
- it { expect(Gitlab::Json.parse(response.build_json)['id']).to eq(build.id) }
- end
+ it { expect(build).to be_kind_of(Build) }
+ it { expect(build).to be_valid }
+ it { expect(build).to be_running }
+ it { expect(build.runner).to eq(shared_runner) }
+ it { expect(Gitlab::Json.parse(response.build_json)['id']).to eq(build.id) }
+ end
- context 'project runner' do
- let(:build) { execute(project_runner) }
+ context 'project runner' do
+ let(:build) { build_on(project_runner) }
- it { expect(build).to be_kind_of(Build) }
- it { expect(build).to be_valid }
- it { expect(build).to be_running }
- it { expect(build.runner).to eq(project_runner) }
+ it { expect(build).to be_kind_of(Build) }
+ it { expect(build).to be_valid }
+ it { expect(build).to be_running }
+ it { expect(build.runner).to eq(project_runner) }
+ end
end
- end
- context 'disallow shared runners' do
- before do
- project.update!(shared_runners_enabled: false)
- end
+ context 'disallow shared runners' do
+ before do
+ project.update!(shared_runners_enabled: false)
+ end
- context 'shared runner' do
- let(:build) { execute(shared_runner) }
+ context 'shared runner' do
+ let(:build) { build_on(shared_runner) }
- it { expect(build).to be_nil }
- end
+ it { expect(build).to be_nil }
+ end
- context 'project runner' do
- let(:build) { execute(project_runner) }
+ context 'project runner' do
+ let(:build) { build_on(project_runner) }
- it { expect(build).to be_kind_of(Build) }
- it { expect(build).to be_valid }
- it { expect(build).to be_running }
- it { expect(build.runner).to eq(project_runner) }
+ it { expect(build).to be_kind_of(Build) }
+ it { expect(build).to be_valid }
+ it { expect(build).to be_running }
+ it { expect(build.runner).to eq(project_runner) }
+ end
end
- end
- context 'disallow when builds are disabled' do
- before do
- project.update!(shared_runners_enabled: true, group_runners_enabled: true)
- project.project_feature.update_attribute(:builds_access_level, ProjectFeature::DISABLED)
+ context 'disallow when builds are disabled' do
+ before do
+ project.update!(shared_runners_enabled: true, group_runners_enabled: true)
+ project.project_feature.update_attribute(:builds_access_level, ProjectFeature::DISABLED)
- pending_job.reload.create_queuing_entry!
- end
+ pending_job.reload.create_queuing_entry!
+ end
- context 'and uses shared runner' do
- let(:build) { execute(shared_runner) }
+ context 'and uses shared runner' do
+ let(:build) { build_on(shared_runner) }
- it { expect(build).to be_nil }
- end
+ it { expect(build).to be_nil }
+ end
- context 'and uses group runner' do
- let(:build) { execute(group_runner) }
+ context 'and uses group runner' do
+ let(:build) { build_on(group_runner) }
- it { expect(build).to be_nil }
- end
+ it { expect(build).to be_nil }
+ end
- context 'and uses project runner' do
- let(:build) { execute(project_runner) }
+ context 'and uses project runner' do
+ let(:build) { build_on(project_runner) }
- it 'does not pick a build' do
- expect(build).to be_nil
- expect(pending_job.reload).to be_failed
- expect(pending_job.queuing_entry).to be_nil
+ it 'does not pick a build' do
+ expect(build).to be_nil
+ expect(pending_job.reload).to be_failed
+ expect(pending_job.queuing_entry).to be_nil
+ end
end
end
- end
- context 'allow group runners' do
- before do
- project.update!(group_runners_enabled: true)
- end
+ context 'allow group runners' do
+ before do
+ project.update!(group_runners_enabled: true)
+ end
- context 'for multiple builds' do
- let!(:project2) { create(:project, group_runners_enabled: true, group: group) }
- let!(:pipeline2) { create(:ci_pipeline, project: project2) }
- let!(:project3) { create(:project, group_runners_enabled: true, group: group) }
- let!(:pipeline3) { create(:ci_pipeline, project: project3) }
+ context 'for multiple builds' do
+ let!(:project2) { create(:project, group_runners_enabled: true, group: group) }
+ let!(:pipeline2) { create(:ci_pipeline, project: project2) }
+ let!(:project3) { create(:project, group_runners_enabled: true, group: group) }
+ let!(:pipeline3) { create(:ci_pipeline, project: project3) }
- let!(:build1_project1) { pending_job }
- let!(:build2_project1) { create(:ci_build, :queued, pipeline: pipeline) }
- let!(:build3_project1) { create(:ci_build, :queued, pipeline: pipeline) }
- let!(:build1_project2) { create(:ci_build, :queued, pipeline: pipeline2) }
- let!(:build2_project2) { create(:ci_build, :queued, pipeline: pipeline2) }
- let!(:build1_project3) { create(:ci_build, :queued, pipeline: pipeline3) }
+ let!(:build1_project1) { pending_job }
+ let!(:build2_project1) { create(:ci_build, :queued, pipeline: pipeline) }
+ let!(:build3_project1) { create(:ci_build, :queued, pipeline: pipeline) }
+ let!(:build1_project2) { create(:ci_build, :queued, pipeline: pipeline2) }
+ let!(:build2_project2) { create(:ci_build, :queued, pipeline: pipeline2) }
+ let!(:build1_project3) { create(:ci_build, :queued, pipeline: pipeline3) }
- # these shouldn't influence the scheduling
- let!(:unrelated_group) { create(:group) }
- let!(:unrelated_project) { create(:project, group_runners_enabled: true, group: unrelated_group) }
- let!(:unrelated_pipeline) { create(:ci_pipeline, project: unrelated_project) }
- let!(:build1_unrelated_project) { create(:ci_build, :pending, :queued, pipeline: unrelated_pipeline) }
- let!(:unrelated_group_runner) { create(:ci_runner, :group, groups: [unrelated_group]) }
+ # these shouldn't influence the scheduling
+ let!(:unrelated_group) { create(:group) }
+ let!(:unrelated_project) { create(:project, group_runners_enabled: true, group: unrelated_group) }
+ let!(:unrelated_pipeline) { create(:ci_pipeline, project: unrelated_project) }
+ let!(:build1_unrelated_project) { create(:ci_build, :pending, :queued, pipeline: unrelated_pipeline) }
+ let!(:unrelated_group_runner) { create(:ci_runner, :group, groups: [unrelated_group]) }
- it 'does not consider builds from other group runners' do
- queue = ::Ci::Queue::BuildQueueService.new(group_runner)
+ it 'does not consider builds from other group runners' do
+ queue = ::Ci::Queue::BuildQueueService.new(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 6
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 6
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 5
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 5
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 4
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 4
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 3
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 3
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 2
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 2
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 1
- execute(group_runner)
+ expect(queue.builds_for_group_runner.size).to eq 1
+ build_on(group_runner)
- expect(queue.builds_for_group_runner.size).to eq 0
- expect(execute(group_runner)).to be_nil
+ expect(queue.builds_for_group_runner.size).to eq 0
+ expect(build_on(group_runner)).to be_nil
+ end
end
- end
- context 'group runner' do
- let(:build) { execute(group_runner) }
+ context 'group runner' do
+ let(:build) { build_on(group_runner) }
- it { expect(build).to be_kind_of(Build) }
- it { expect(build).to be_valid }
- it { expect(build).to be_running }
- it { expect(build.runner).to eq(group_runner) }
+ it { expect(build).to be_kind_of(Build) }
+ it { expect(build).to be_valid }
+ it { expect(build).to be_running }
+ it { expect(build.runner).to eq(group_runner) }
+ end
end
- end
- context 'disallow group runners' do
- before do
- project.update!(group_runners_enabled: false)
+ context 'disallow group runners' do
+ before do
+ project.update!(group_runners_enabled: false)
- pending_job.reload.create_queuing_entry!
- end
+ pending_job.reload.create_queuing_entry!
+ end
- context 'group runner' do
- let(:build) { execute(group_runner) }
+ context 'group runner' do
+ let(:build) { build_on(group_runner) }
- it { expect(build).to be_nil }
+ it { expect(build).to be_nil }
+ end
end
- end
- context 'when first build is stalled' do
- before do
- allow_any_instance_of(Ci::RegisterJobService).to receive(:assign_runner!).and_call_original
- allow_any_instance_of(Ci::RegisterJobService).to receive(:assign_runner!)
- .with(pending_job, anything).and_raise(ActiveRecord::StaleObjectError)
- end
+ context 'when first build is stalled' do
+ before do
+ allow_any_instance_of(Ci::RegisterJobService).to receive(:assign_runner!).and_call_original
+ allow_any_instance_of(Ci::RegisterJobService).to receive(:assign_runner!)
+ .with(pending_job, anything).and_raise(ActiveRecord::StaleObjectError)
+ end
- subject { described_class.new(project_runner).execute }
+ subject { described_class.new(project_runner, nil).execute }
- context 'with multiple builds are in queue' do
- let!(:other_build) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'with multiple builds are in queue' do
+ let!(:other_build) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- before do
- allow_any_instance_of(::Ci::Queue::BuildQueueService)
- .to receive(:execute)
- .and_return(Ci::Build.where(id: [pending_job, other_build]).pluck(:id))
- end
+ before do
+ allow_any_instance_of(::Ci::Queue::BuildQueueService)
+ .to receive(:execute)
+ .and_return(Ci::Build.where(id: [pending_job, other_build]).pluck(:id))
+ end
- it "receives second build from the queue" do
- expect(subject).to be_valid
- expect(subject.build).to eq(other_build)
+ it "receives second build from the queue" do
+ expect(subject).to be_valid
+ expect(subject.build).to eq(other_build)
+ end
end
- end
- context 'when single build is in queue' do
- before do
- allow_any_instance_of(::Ci::Queue::BuildQueueService)
- .to receive(:execute)
- .and_return(Ci::Build.where(id: pending_job).pluck(:id))
- end
+ context 'when single build is in queue' do
+ before do
+ allow_any_instance_of(::Ci::Queue::BuildQueueService)
+ .to receive(:execute)
+ .and_return(Ci::Build.where(id: pending_job).pluck(:id))
+ end
- it "does not receive any valid result" do
- expect(subject).not_to be_valid
+ it "does not receive any valid result" do
+ expect(subject).not_to be_valid
+ end
end
- end
- context 'when there is no build in queue' do
- before do
- allow_any_instance_of(::Ci::Queue::BuildQueueService)
- .to receive(:execute)
- .and_return([])
- end
+ context 'when there is no build in queue' do
+ before do
+ allow_any_instance_of(::Ci::Queue::BuildQueueService)
+ .to receive(:execute)
+ .and_return([])
+ end
- it "does not receive builds but result is valid" do
- expect(subject).to be_valid
- expect(subject.build).to be_nil
+ it "does not receive builds but result is valid" do
+ expect(subject).to be_valid
+ expect(subject.build).to be_nil
+ end
end
end
- end
- context 'when access_level of runner is not_protected' do
- let!(:project_runner) { create(:ci_runner, :project, projects: [project]) }
+ context 'when access_level of runner is not_protected' do
+ let!(:project_runner) { create(:ci_runner, :project, projects: [project]) }
- context 'when a job is protected' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) }
+ context 'when a job is protected' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) }
- it 'picks the job' do
- expect(execute(project_runner)).to eq(pending_job)
+ it 'picks the job' do
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
- end
- context 'when a job is unprotected' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'when a job is unprotected' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- it 'picks the job' do
- expect(execute(project_runner)).to eq(pending_job)
+ it 'picks the job' do
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
- end
- context 'when protected attribute of a job is nil' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'when protected attribute of a job is nil' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- before do
- pending_job.update_attribute(:protected, nil)
- end
+ before do
+ pending_job.update_attribute(:protected, nil)
+ end
- it 'picks the job' do
- expect(execute(project_runner)).to eq(pending_job)
+ it 'picks the job' do
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
end
- end
- context 'when access_level of runner is ref_protected' do
- let!(:project_runner) { create(:ci_runner, :project, :ref_protected, projects: [project]) }
+ context 'when access_level of runner is ref_protected' do
+ let!(:project_runner) { create(:ci_runner, :project, :ref_protected, projects: [project]) }
- context 'when a job is protected' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) }
+ context 'when a job is protected' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) }
- it 'picks the job' do
- expect(execute(project_runner)).to eq(pending_job)
+ it 'picks the job' do
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
- end
- context 'when a job is unprotected' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'when a job is unprotected' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- it 'does not pick the job' do
- expect(execute(project_runner)).to be_nil
+ it 'does not pick the job' do
+ expect(build_on(project_runner)).to be_nil
+ end
end
- end
- context 'when protected attribute of a job is nil' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'when protected attribute of a job is nil' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
- before do
- pending_job.update_attribute(:protected, nil)
- end
+ before do
+ pending_job.update_attribute(:protected, nil)
+ end
- it 'does not pick the job' do
- expect(execute(project_runner)).to be_nil
+ it 'does not pick the job' do
+ expect(build_on(project_runner)).to be_nil
+ end
end
end
- end
- context 'runner feature set is verified' do
- let(:options) { { artifacts: { reports: { junit: "junit.xml" } } } }
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, options: options) }
+ context 'runner feature set is verified' do
+ let(:options) { { artifacts: { reports: { junit: "junit.xml" } } } }
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, options: options) }
- subject { execute(project_runner, params) }
+ subject { build_on(project_runner, params: params) }
- context 'when feature is missing by runner' do
- let(:params) { {} }
+ context 'when feature is missing by runner' do
+ let(:params) { {} }
- it 'does not pick the build and drops the build' do
- expect(subject).to be_nil
- expect(pending_job.reload).to be_failed
- expect(pending_job).to be_runner_unsupported
+ it 'does not pick the build and drops the build' do
+ expect(subject).to be_nil
+ expect(pending_job.reload).to be_failed
+ expect(pending_job).to be_runner_unsupported
+ end
end
- end
- context 'when feature is supported by runner' do
- let(:params) do
- { info: { features: { upload_multiple_artifacts: true } } }
- end
+ context 'when feature is supported by runner' do
+ let(:params) do
+ { info: { features: { upload_multiple_artifacts: true } } }
+ end
- it 'does pick job' do
- expect(subject).not_to be_nil
+ it 'does pick job' do
+ expect(subject).not_to be_nil
+ end
end
end
- end
-
- context 'when "dependencies" keyword is specified' do
- let!(:pre_stage_job) do
- create(:ci_build, :success, :artifacts, pipeline: pipeline, name: 'test', stage_idx: 0)
- end
- let!(:pending_job) do
- create(:ci_build, :pending, :queued,
- pipeline: pipeline, stage_idx: 1,
- options: { script: ["bash"], dependencies: dependencies })
- end
+ context 'when "dependencies" keyword is specified' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, :artifacts, pipeline: pipeline, name: 'test', stage_idx: 0)
+ end
- let(:dependencies) { %w[test] }
+ let!(:pending_job) do
+ create(:ci_build, :pending, :queued,
+ pipeline: pipeline, stage_idx: 1,
+ options: { script: ["bash"], dependencies: dependencies })
+ end
- subject { execute(project_runner) }
+ let(:dependencies) { %w[test] }
- it 'picks a build with a dependency' do
- picked_build = execute(project_runner)
+ subject { build_on(project_runner) }
- expect(picked_build).to be_present
- end
+ it 'picks a build with a dependency' do
+ picked_build = build_on(project_runner)
- context 'when there are multiple dependencies with artifacts' do
- let!(:pre_stage_job_second) do
- create(:ci_build, :success, :artifacts, pipeline: pipeline, name: 'deploy', stage_idx: 0)
+ expect(picked_build).to be_present
end
- let(:dependencies) { %w[test deploy] }
-
- it 'logs build artifacts size' do
- execute(project_runner)
-
- artifacts_size = [pre_stage_job, pre_stage_job_second].sum do |job|
- job.job_artifacts_archive.size
+ context 'when there are multiple dependencies with artifacts' do
+ let!(:pre_stage_job_second) do
+ create(:ci_build, :success, :artifacts, pipeline: pipeline, name: 'deploy', stage_idx: 0)
end
- expect(artifacts_size).to eq 107464 * 2
- expect(Gitlab::ApplicationContext.current).to include({
- 'meta.artifacts_dependencies_size' => artifacts_size,
- 'meta.artifacts_dependencies_count' => 2
- })
- end
- end
+ let(:dependencies) { %w[test deploy] }
- shared_examples 'not pick' do
- it 'does not pick the build and drops the build' do
- expect(subject).to be_nil
- expect(pending_job.reload).to be_failed
- expect(pending_job).to be_missing_dependency_failure
- end
- end
+ it 'logs build artifacts size' do
+ build_on(project_runner)
- shared_examples 'validation is active' do
- context 'when depended job has not been completed yet' do
- let!(:pre_stage_job) { create(:ci_build, :pending, :queued, :manual, pipeline: pipeline, name: 'test', stage_idx: 0) }
+ artifacts_size = [pre_stage_job, pre_stage_job_second].sum do |job|
+ job.job_artifacts_archive.size
+ end
- it { is_expected.to eq(pending_job) }
+ expect(artifacts_size).to eq 107464 * 2
+ expect(Gitlab::ApplicationContext.current).to include({
+ 'meta.artifacts_dependencies_size' => artifacts_size,
+ 'meta.artifacts_dependencies_count' => 2
+ })
+ end
end
- context 'when artifacts of depended job has been expired' do
- let!(:pre_stage_job) { create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0) }
+ shared_examples 'not pick' do
+ it 'does not pick the build and drops the build' do
+ expect(subject).to be_nil
+ expect(pending_job.reload).to be_failed
+ expect(pending_job).to be_missing_dependency_failure
+ end
+ end
- context 'when the pipeline is locked' do
- before do
- pipeline.artifacts_locked!
+ shared_examples 'validation is active' do
+ context 'when depended job has not been completed yet' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :pending, :queued, :manual, pipeline: pipeline, name: 'test', stage_idx: 0)
end
it { is_expected.to eq(pending_job) }
end
- context 'when the pipeline is unlocked' do
- before do
- pipeline.unlocked!
+ context 'when artifacts of depended job has been expired' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0)
end
- it_behaves_like 'not pick'
+ context 'when the pipeline is locked' do
+ before do
+ pipeline.artifacts_locked!
+ end
+
+ it { is_expected.to eq(pending_job) }
+ end
+
+ context 'when the pipeline is unlocked' do
+ before do
+ pipeline.unlocked!
+ end
+
+ it_behaves_like 'not pick'
+ end
end
- end
- context 'when artifacts of depended job has been erased' do
- let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0, erased_at: 1.minute.ago) }
+ context 'when artifacts of depended job has been erased' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0, erased_at: 1.minute.ago)
+ end
- it_behaves_like 'not pick'
- end
+ it_behaves_like 'not pick'
+ end
- context 'when job object is staled' do
- let!(:pre_stage_job) { create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0) }
+ context 'when job object is staled' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0)
+ end
- before do
- pipeline.unlocked!
+ before do
+ pipeline.unlocked!
- allow_next_instance_of(Ci::Build) do |build|
- expect(build).to receive(:drop!)
- .and_raise(ActiveRecord::StaleObjectError.new(pending_job, :drop!))
+ allow_next_instance_of(Ci::Build) do |build|
+ expect(build).to receive(:drop!)
+ .and_raise(ActiveRecord::StaleObjectError.new(pending_job, :drop!))
+ end
end
- end
- it 'does not drop nor pick' do
- expect(subject).to be_nil
+ it 'does not drop nor pick' do
+ expect(subject).to be_nil
+ end
end
end
- end
- shared_examples 'validation is not active' do
- context 'when depended job has not been completed yet' do
- let!(:pre_stage_job) { create(:ci_build, :pending, :queued, :manual, pipeline: pipeline, name: 'test', stage_idx: 0) }
+ shared_examples 'validation is not active' do
+ context 'when depended job has not been completed yet' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :pending, :queued, :manual, pipeline: pipeline, name: 'test', stage_idx: 0)
+ end
- it { expect(subject).to eq(pending_job) }
- end
+ it { expect(subject).to eq(pending_job) }
+ end
- context 'when artifacts of depended job has been expired' do
- let!(:pre_stage_job) { create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0) }
+ context 'when artifacts of depended job has been expired' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, :expired, pipeline: pipeline, name: 'test', stage_idx: 0)
+ end
- it { expect(subject).to eq(pending_job) }
- end
+ it { expect(subject).to eq(pending_job) }
+ end
- context 'when artifacts of depended job has been erased' do
- let!(:pre_stage_job) { create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0, erased_at: 1.minute.ago) }
+ context 'when artifacts of depended job has been erased' do
+ let!(:pre_stage_job) do
+ create(:ci_build, :success, pipeline: pipeline, name: 'test', stage_idx: 0, erased_at: 1.minute.ago)
+ end
- it { expect(subject).to eq(pending_job) }
+ it { expect(subject).to eq(pending_job) }
+ end
end
- end
- it_behaves_like 'validation is active'
- end
+ it_behaves_like 'validation is active'
+ end
- context 'when build is degenerated' do
- let!(:pending_job) { create(:ci_build, :pending, :queued, :degenerated, pipeline: pipeline) }
+ context 'when build is degenerated' do
+ let!(:pending_job) { create(:ci_build, :pending, :queued, :degenerated, pipeline: pipeline) }
- subject { execute(project_runner, {}) }
+ subject { build_on(project_runner) }
- it 'does not pick the build and drops the build' do
- expect(subject).to be_nil
+ it 'does not pick the build and drops the build' do
+ expect(subject).to be_nil
- pending_job.reload
- expect(pending_job).to be_failed
- expect(pending_job).to be_archived_failure
+ pending_job.reload
+ expect(pending_job).to be_failed
+ expect(pending_job).to be_archived_failure
+ end
end
- end
- context 'when build has data integrity problem' do
- let!(:pending_job) do
- create(:ci_build, :pending, :queued, pipeline: pipeline)
- end
+ context 'when build has data integrity problem' do
+ let!(:pending_job) do
+ create(:ci_build, :pending, :queued, pipeline: pipeline)
+ end
- before do
- pending_job.update_columns(options: "string")
- end
+ before do
+ pending_job.update_columns(options: "string")
+ end
- subject { execute(project_runner, {}) }
+ subject { build_on(project_runner) }
- it 'does drop the build and logs both failures' do
- expect(Gitlab::ErrorTracking).to receive(:track_exception)
- .with(anything, a_hash_including(build_id: pending_job.id))
- .twice
- .and_call_original
+ it 'does drop the build and logs both failures' do
+ expect(Gitlab::ErrorTracking).to receive(:track_exception)
+ .with(anything, a_hash_including(build_id: pending_job.id))
+ .twice
+ .and_call_original
- expect(subject).to be_nil
+ expect(subject).to be_nil
- pending_job.reload
- expect(pending_job).to be_failed
- expect(pending_job).to be_data_integrity_failure
+ pending_job.reload
+ expect(pending_job).to be_failed
+ expect(pending_job).to be_data_integrity_failure
+ end
end
- end
- context 'when build fails to be run!' do
- let!(:pending_job) do
- create(:ci_build, :pending, :queued, pipeline: pipeline)
- end
+ context 'when build fails to be run!' do
+ let!(:pending_job) do
+ create(:ci_build, :pending, :queued, pipeline: pipeline)
+ end
- before do
- expect_any_instance_of(Ci::Build).to receive(:run!)
- .and_raise(RuntimeError, 'scheduler error')
- end
+ before do
+ expect_any_instance_of(Ci::Build).to receive(:run!)
+ .and_raise(RuntimeError, 'scheduler error')
+ end
- subject { execute(project_runner, {}) }
+ subject { build_on(project_runner) }
- it 'does drop the build and logs failure' do
- expect(Gitlab::ErrorTracking).to receive(:track_exception)
- .with(anything, a_hash_including(build_id: pending_job.id))
- .once
- .and_call_original
+ it 'does drop the build and logs failure' do
+ expect(Gitlab::ErrorTracking).to receive(:track_exception)
+ .with(anything, a_hash_including(build_id: pending_job.id))
+ .once
+ .and_call_original
- expect(subject).to be_nil
+ expect(subject).to be_nil
- pending_job.reload
- expect(pending_job).to be_failed
- expect(pending_job).to be_scheduler_failure
+ pending_job.reload
+ expect(pending_job).to be_failed
+ expect(pending_job).to be_scheduler_failure
+ end
end
- end
- context 'when an exception is raised during a persistent ref creation' do
- before do
- allow_any_instance_of(Ci::PersistentRef).to receive(:exist?) { false }
- allow_any_instance_of(Ci::PersistentRef).to receive(:create_ref) { raise ArgumentError }
- end
+ context 'when an exception is raised during a persistent ref creation' do
+ before do
+ allow_any_instance_of(Ci::PersistentRef).to receive(:exist?) { false }
+ allow_any_instance_of(Ci::PersistentRef).to receive(:create_ref) { raise ArgumentError }
+ end
- subject { execute(project_runner, {}) }
+ subject { build_on(project_runner) }
- it 'picks the build' do
- expect(subject).to eq(pending_job)
+ it 'picks the build' do
+ expect(subject).to eq(pending_job)
- pending_job.reload
- expect(pending_job).to be_running
- end
- end
-
- context 'when only some builds can be matched by runner' do
- let!(:project_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[matching]) }
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[matching]) }
-
- before do
- # create additional matching and non-matching jobs
- create_list(:ci_build, 2, :pending, :queued, pipeline: pipeline, tag_list: %w[matching])
- create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[non-matching])
+ pending_job.reload
+ expect(pending_job).to be_running
+ end
end
- it 'observes queue size of only matching jobs' do
- # pending_job + 2 x matching ones
- expect(Gitlab::Ci::Queue::Metrics.queue_size_total).to receive(:observe)
- .with({ runner_type: project_runner.runner_type }, 3)
+ context 'when only some builds can be matched by runner' do
+ let!(:project_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[matching]) }
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[matching]) }
- expect(execute(project_runner)).to eq(pending_job)
- end
+ before do
+ # create additional matching and non-matching jobs
+ create_list(:ci_build, 2, :pending, :queued, pipeline: pipeline, tag_list: %w[matching])
+ create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[non-matching])
+ end
- it 'observes queue processing time by the runner type' do
- expect(Gitlab::Ci::Queue::Metrics.queue_iteration_duration_seconds)
- .to receive(:observe)
- .with({ runner_type: project_runner.runner_type }, anything)
+ it 'observes queue size of only matching jobs' do
+ # pending_job + 2 x matching ones
+ expect(Gitlab::Ci::Queue::Metrics.queue_size_total).to receive(:observe)
+ .with({ runner_type: project_runner.runner_type }, 3)
- expect(Gitlab::Ci::Queue::Metrics.queue_retrieval_duration_seconds)
- .to receive(:observe)
- .with({ runner_type: project_runner.runner_type }, anything)
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
- expect(execute(project_runner)).to eq(pending_job)
- end
- end
+ it 'observes queue processing time by the runner type' do
+ expect(Gitlab::Ci::Queue::Metrics.queue_iteration_duration_seconds)
+ .to receive(:observe)
+ .with({ runner_type: project_runner.runner_type }, anything)
- context 'when ci_register_job_temporary_lock is enabled' do
- before do
- stub_feature_flags(ci_register_job_temporary_lock: true)
+ expect(Gitlab::Ci::Queue::Metrics.queue_retrieval_duration_seconds)
+ .to receive(:observe)
+ .with({ runner_type: project_runner.runner_type }, anything)
- allow(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
+ expect(build_on(project_runner)).to eq(pending_job)
+ end
end
- context 'when a build is temporarily locked' do
- let(:service) { described_class.new(project_runner) }
-
+ context 'when ci_register_job_temporary_lock is enabled' do
before do
- service.send(:acquire_temporary_lock, pending_job.id)
- end
-
- it 'skips this build and marks queue as invalid' do
- expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
- .with(operation: :queue_iteration)
- expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
- .with(operation: :build_temporary_locked)
+ stub_feature_flags(ci_register_job_temporary_lock: true)
- expect(service.execute).not_to be_valid
+ allow(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
end
- context 'when there is another build in queue' do
- let!(:next_pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+ context 'when a build is temporarily locked' do
+ let(:service) { described_class.new(project_runner, nil) }
- it 'skips this build and picks another build' do
+ before do
+ service.send(:acquire_temporary_lock, pending_job.id)
+ end
+
+ it 'skips this build and marks queue as invalid' do
expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
- .with(operation: :queue_iteration).twice
+ .with(operation: :queue_iteration)
expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
.with(operation: :build_temporary_locked)
- result = service.execute
+ expect(service.execute).not_to be_valid
+ end
+
+ context 'when there is another build in queue' do
+ let!(:next_pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) }
+
+ it 'skips this build and picks another build' do
+ expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
+ .with(operation: :queue_iteration).twice
+ expect(Gitlab::Ci::Queue::Metrics.queue_operations_total).to receive(:increment)
+ .with(operation: :build_temporary_locked)
- expect(result.build).to eq(next_pending_job)
- expect(result).to be_valid
+ result = service.execute
+
+ expect(result.build).to eq(next_pending_job)
+ expect(result).to be_valid
+ end
end
end
end
end
- end
-
- context 'when using pending builds table' do
- include_examples 'handles runner assignment'
- context 'when a conflicting data is stored in denormalized table' do
- let!(:project_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[conflict]) }
- let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[conflict]) }
+ context 'when using pending builds table' do
+ include_examples 'handles runner assignment'
- before do
- pending_job.update_column(:status, :running)
- end
+ context 'when a conflicting data is stored in denormalized table' do
+ let!(:runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[conflict]) }
+ let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[conflict]) }
- it 'removes queuing entry upon build assignment attempt' do
- expect(pending_job.reload).to be_running
- expect(pending_job.queuing_entry).to be_present
+ before do
+ pending_job.update_column(:status, :running)
+ end
- result = described_class.new(project_runner).execute
+ it 'removes queuing entry upon build assignment attempt' do
+ expect(pending_job.reload).to be_running
+ expect(pending_job.queuing_entry).to be_present
- expect(result).not_to be_valid
- expect(pending_job.reload.queuing_entry).not_to be_present
+ expect(execute).not_to be_valid
+ expect(pending_job.reload.queuing_entry).not_to be_present
+ end
end
end
end
@@ -807,11 +842,11 @@ module Ci
# Stub tested metrics
allow(Gitlab::Ci::Queue::Metrics)
.to receive(:attempt_counter)
- .and_return(attempt_counter)
+ .and_return(attempt_counter)
allow(Gitlab::Ci::Queue::Metrics)
.to receive(:job_queue_duration_seconds)
- .and_return(job_queue_duration_seconds)
+ .and_return(job_queue_duration_seconds)
project.update!(shared_runners_enabled: true)
pending_job.update!(created_at: current_time - 3600, queued_at: current_time - 1800)
@@ -822,7 +857,7 @@ module Ci
allow(job_queue_duration_seconds).to receive(:observe)
expect(attempt_counter).to receive(:increment)
- execute(runner)
+ build_on(runner)
end
end
@@ -834,7 +869,7 @@ module Ci
jobs_running_for_project: expected_jobs_running_for_project_first_job,
shard: expected_shard }, 1800)
- execute(runner)
+ build_on(runner)
end
context 'when project already has running jobs' do
@@ -854,7 +889,7 @@ module Ci
jobs_running_for_project: expected_jobs_running_for_project_third_job,
shard: expected_shard }, 1800)
- execute(runner)
+ build_on(runner)
end
end
end
@@ -913,7 +948,7 @@ module Ci
allow(attempt_counter).to receive(:increment)
expect(job_queue_duration_seconds).not_to receive(:observe)
- execute(runner)
+ build_on(runner)
end
end
end
@@ -933,12 +968,12 @@ module Ci
it 'present sets runner session configuration in the build' do
runner_session_params = { session: { 'url' => 'https://example.com' } }
- expect(execute(project_runner, runner_session_params).runner_session.attributes)
+ expect(build_on(project_runner, params: runner_session_params).runner_session.attributes)
.to include(runner_session_params[:session])
end
it 'not present it does not configure the runner session' do
- expect(execute(project_runner).runner_session).to be_nil
+ expect(build_on(project_runner).runner_session).to be_nil
end
end
@@ -954,7 +989,7 @@ module Ci
it 'returns 409 conflict' do
expect(Ci::Build.pending.unstarted.count).to eq 3
- result = described_class.new(project_runner).execute
+ result = described_class.new(project_runner, nil).execute
expect(result).not_to be_valid
expect(result.build).to be_nil
@@ -962,8 +997,8 @@ module Ci
end
end
- def execute(runner, params = {})
- described_class.new(runner).execute(params).build
+ def build_on(runner, runner_machine: nil, params: {})
+ described_class.new(runner, runner_machine).execute(params).build
end
end
end
diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb
index 16e20cad662..748f062948f 100644
--- a/spec/tasks/gitlab/db_rake_spec.rb
+++ b/spec/tasks/gitlab/db_rake_spec.rb
@@ -724,6 +724,80 @@ RSpec.describe 'gitlab:db namespace rake task', :silence_stdout, feature_categor
end
end
+ describe 'execute_async_index_operations' do
+ before do
+ skip_if_multiple_databases_not_setup
+ end
+
+ it 'delegates ci task to Gitlab::Database::AsyncIndexes' do
+ expect(Gitlab::Database::AsyncIndexes).to receive(:execute_pending_actions!).with(how_many: 2)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:ci')
+ end
+
+ it 'delegates ci task to Gitlab::Database::AsyncIndexes with specified argument' do
+ expect(Gitlab::Database::AsyncIndexes).to receive(:execute_pending_actions!).with(how_many: 5)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:ci', '[5]')
+ end
+
+ it 'delegates main task to Gitlab::Database::AsyncIndexes' do
+ expect(Gitlab::Database::AsyncIndexes).to receive(:execute_pending_actions!).with(how_many: 2)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:main')
+ end
+
+ it 'delegates main task to Gitlab::Database::AsyncIndexes with specified argument' do
+ expect(Gitlab::Database::AsyncIndexes).to receive(:execute_pending_actions!).with(how_many: 7)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:main', '[7]')
+ end
+
+ it 'delegates all task to every database with higher default for dev' do
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:ci']).to receive(:invoke).with(1000)
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:main']).to receive(:invoke).with(1000)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:all')
+ end
+
+ it 'delegates all task to every database with lower default for prod' do
+ allow(Gitlab).to receive(:dev_or_test_env?).and_return(false)
+
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:ci']).to receive(:invoke).with(2)
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:main']).to receive(:invoke).with(2)
+
+ run_rake_task('gitlab:db:execute_async_index_operations:all')
+ end
+
+ it 'delegates all task to every database with specified argument' do
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:ci']).to receive(:invoke).with('50')
+ expect(Rake::Task['gitlab:db:execute_async_index_operations:main']).to receive(:invoke).with('50')
+
+ run_rake_task('gitlab:db:execute_async_index_operations:all', '[50]')
+ end
+
+ context 'when feature is not enabled' do
+ it 'is a no-op' do
+ stub_feature_flags(database_async_index_operations: false)
+
+ expect(Gitlab::Database::AsyncIndexes).not_to receive(:execute_pending_actions!)
+
+ expect { run_rake_task('gitlab:db:execute_async_index_operations:main') }.to raise_error(SystemExit)
+ end
+ end
+
+ context 'with geo configured' do
+ before do
+ skip_unless_geo_configured
+ end
+
+ it 'does not create a task for the geo database' do
+ expect { run_rake_task('gitlab:db:execute_async_index_operations:geo') }
+ .to raise_error(/Don't know how to build task 'gitlab:db:execute_async_index_operations:geo'/)
+ end
+ end
+ end
+
describe 'active' do
using RSpec::Parameterized::TableSyntax
diff --git a/spec/views/notify/user_deactivated_email.html.haml_spec.rb b/spec/views/notify/user_deactivated_email.html.haml_spec.rb
new file mode 100644
index 00000000000..25d18e37cb9
--- /dev/null
+++ b/spec/views/notify/user_deactivated_email.html.haml_spec.rb
@@ -0,0 +1,56 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'notify/user_deactivated_email.html.haml', feature_category: :user_management do
+ let(:name) { 'John Smith' }
+
+ before do
+ assign(:name, name)
+ end
+
+ it "displays the user's name" do
+ render
+
+ expect(rendered).to have_content(/^Hello John Smith,/)
+ end
+
+ context 'when additional text setting is set' do
+ before do
+ allow(Gitlab::CurrentSettings).to receive(:deactivation_email_additional_text)
+ .and_return('So long and thanks for all the fish!')
+ end
+
+ context 'when additional text feature flag is enabled' do
+ it 'displays the additional text' do
+ render
+
+ expect(rendered).to have_content(/So long and thanks for all the fish!$/)
+ end
+ end
+
+ context 'when additional text feature flag is disabled' do
+ before do
+ stub_feature_flags(deactivation_email_additional_text: false)
+ end
+
+ it 'does not display the additional text' do
+ render
+
+ expect(rendered).to have_content(/Please contact your GitLab administrator if you think this is an error\.$/)
+ end
+ end
+ end
+
+ context 'when additional text setting is not set' do
+ before do
+ allow(Gitlab::CurrentSettings).to receive(:deactivation_email_additional_text).and_return('')
+ end
+
+ it 'does not display any additional text' do
+ render
+
+ expect(rendered).to have_content(/Please contact your GitLab administrator if you think this is an error\.$/)
+ end
+ end
+end
diff --git a/spec/views/notify/user_deactivated_email.text.erb_spec.rb b/spec/views/notify/user_deactivated_email.text.erb_spec.rb
new file mode 100644
index 00000000000..8cf56816b92
--- /dev/null
+++ b/spec/views/notify/user_deactivated_email.text.erb_spec.rb
@@ -0,0 +1,58 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'notify/user_deactivated_email.text.erb', feature_category: :user_management do
+ let(:name) { 'John Smith' }
+
+ before do
+ assign(:name, name)
+ end
+
+ it_behaves_like 'renders plain text email correctly'
+
+ it "displays the user's name" do
+ render
+
+ expect(rendered).to have_content(/^Hello John Smith,/)
+ end
+
+ context 'when additional text setting is set' do
+ before do
+ allow(Gitlab::CurrentSettings).to receive(:deactivation_email_additional_text)
+ .and_return('So long and thanks for all the fish!')
+ end
+
+ context 'when additional text feature flag is enabled' do
+ it 'displays the additional text' do
+ render
+
+ expect(rendered).to have_content(/So long and thanks for all the fish!$/)
+ end
+ end
+
+ context 'when additional text feature flag is disabled' do
+ before do
+ stub_feature_flags(deactivation_email_additional_text: false)
+ end
+
+ it 'does not display the additional text' do
+ render
+
+ expect(rendered).to have_content(/Please contact your GitLab administrator if you think this is an error\.$/)
+ end
+ end
+ end
+
+ context 'when additional text setting is not set' do
+ before do
+ allow(Gitlab::CurrentSettings).to receive(:deactivation_email_additional_text).and_return('')
+ end
+
+ it 'does not display any additional text' do
+ render
+
+ expect(rendered).to have_content(/Please contact your GitLab administrator if you think this is an error\.$/)
+ end
+ end
+end
diff --git a/spec/workers/run_pipeline_schedule_worker_spec.rb b/spec/workers/run_pipeline_schedule_worker_spec.rb
index 7ad15e1923d..377333b39e8 100644
--- a/spec/workers/run_pipeline_schedule_worker_spec.rb
+++ b/spec/workers/run_pipeline_schedule_worker_spec.rb
@@ -55,6 +55,7 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
describe "#run_pipeline_schedule" do
let(:create_pipeline_service) { instance_double(Ci::CreatePipelineService, execute: service_response) }
let(:service_response) { instance_double(ServiceResponse, payload: pipeline, error?: false) }
+ let(:pipeline) { instance_double(Ci::Pipeline, persisted?: true) }
context 'when pipeline can be created' do
before do
@@ -64,8 +65,6 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
end
context "when pipeline is persisted" do
- let(:pipeline) { instance_double(Ci::Pipeline, persisted?: true) }
-
it "returns the service response" do
expect(worker.perform(pipeline_schedule.id, user.id)).to eq(service_response)
end
@@ -76,8 +75,8 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
expect(worker.perform(pipeline_schedule.id, user.id)).to eq(service_response)
end
- it "changes the next_run_at" do
- expect { worker.perform(pipeline_schedule.id, user.id) }.to change { pipeline_schedule.reload.next_run_at }.by(1.day)
+ it "does not change the next_run_at" do
+ expect { worker.perform(pipeline_schedule.id, user.id) }.not_to change { pipeline_schedule.reload.next_run_at }
end
context 'when feature flag ci_use_run_pipeline_schedule_worker is disabled' do
@@ -90,19 +89,19 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
end
end
- context 'when next_run_scheduled option is given as true' do
+ context 'when scheduling option is given as true' do
it "returns the service response" do
- expect(worker.perform(pipeline_schedule.id, user.id, 'next_run_scheduled' => true)).to eq(service_response)
+ expect(worker.perform(pipeline_schedule.id, user.id, scheduling: true)).to eq(service_response)
end
it "does not log errors" do
expect(worker).not_to receive(:log_extra_metadata_on_done)
- expect(worker.perform(pipeline_schedule.id, user.id, 'next_run_scheduled' => true)).to eq(service_response)
+ expect(worker.perform(pipeline_schedule.id, user.id, scheduling: true)).to eq(service_response)
end
- it "does not change the next_run_at" do
- expect { worker.perform(pipeline_schedule.id, user.id, 'next_run_scheduled' => true) }.not_to change { pipeline_schedule.reload.next_run_at }
+ it "changes the next_run_at" do
+ expect { worker.perform(pipeline_schedule.id, user.id, scheduling: true) }.to change { pipeline_schedule.reload.next_run_at }.by(1.day)
end
context 'when feature flag ci_use_run_pipeline_schedule_worker is disabled' do
@@ -111,7 +110,7 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
end
it 'does not change the next_run_at' do
- expect { worker.perform(pipeline_schedule.id, user.id, 'next_run_scheduled' => true) }.not_to change { pipeline_schedule.reload.next_run_at }
+ expect { worker.perform(pipeline_schedule.id, user.id, scheduling: true) }.not_to change { pipeline_schedule.reload.next_run_at }
end
end
end
@@ -143,8 +142,9 @@ RSpec.describe RunPipelineScheduleWorker, feature_category: :continuous_integrat
expect { worker.perform(pipeline_schedule.id, user.id) }.to not_change { pipeline_schedule.reload.next_run_at }
end
- it 'does not create a pipeline' do
- expect(Ci::CreatePipelineService).not_to receive(:new)
+ it 'creates a pipeline' do
+ expect(Ci::CreatePipelineService).to receive(:new).with(project, user, ref: pipeline_schedule.ref).and_return(create_pipeline_service)
+ expect(create_pipeline_service).to receive(:execute).with(:schedule, ignore_skip_ci: true, save_on_errors: false, schedule: pipeline_schedule).and_return(service_response)
worker.perform(pipeline_schedule.id, user.id)
end
diff --git a/yarn.lock b/yarn.lock
index f97643431a5..495ce755cb2 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1347,10 +1347,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.18.0.tgz#d89364feb42404a35824a54d518b51af8c1e900f"
integrity sha512-ni9TmhusXpt/3k/DZzovMEUeB/6UTXiDpuujI8HDBqR4Mwlah6FBco5ZfolkW6YjFL0YvtcLWhnwZA0iM3hfMw==
-"@gitlab/ui@54.2.3":
- version "54.2.3"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-54.2.3.tgz#8fbaa7de24d326094a6f2a509e38fe6a58bbc17a"
- integrity sha512-cQcdO9nHRlgMcz661soOeTJWXEM8lADPxxFuMubkxJfRZcknhdR4RrSiHxQxZT05l2tfCpd7L6yt07r1bCIgLw==
+"@gitlab/ui@55.0.1":
+ version "55.0.1"
+ resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-55.0.1.tgz#3d5c22b864d64435eff01fb39e4edb6e1b8a0432"
+ integrity sha512-vPwmGhc73HTSBGoMi4jL+Wf11w/1o62pwXuYSYNOs2xis1xMLJiaPBGXNKDFliC5AaRDXAIxCiC5CMJZH3qXMg==
dependencies:
"@popperjs/core" "^2.11.2"
bootstrap-vue "2.20.1"