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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab/ci/frontend.gitlab-ci.yml5
-rw-r--r--.gitlab/ci/rails.gitlab-ci.yml2
-rw-r--r--.rubocop_todo/style/open_struct_use.yml2
-rw-r--r--app/assets/javascripts/branches/branches_delete_modal.js53
-rw-r--r--app/assets/javascripts/clusters/agents/components/show.vue4
-rw-r--r--app/assets/javascripts/pages/projects/branches/index/index.js2
-rw-r--r--app/assets/javascripts/runner/admin_runners/admin_runners_app.vue70
-rw-r--r--app/assets/javascripts/runner/admin_runners/index.js17
-rw-r--r--app/assets/javascripts/runner/graphql/get_runners_count.query.graphql10
-rw-r--r--app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue6
-rw-r--r--app/helpers/ci/runners_helper.rb8
-rw-r--r--app/models/customer_relations/contact.rb4
-rw-r--r--app/models/customer_relations/issue_contact.rb8
-rw-r--r--app/services/issues/set_crm_contacts_service.rb2
-rw-r--r--app/services/projects/overwrite_project_service.rb4
-rw-r--r--app/views/projects/branches/_branch.html.haml36
-rw-r--r--app/views/projects/branches/_delete_protected_modal.html.haml42
-rw-r--r--app/views/projects/branches/index.html.haml4
-rw-r--r--config/feature_flags/development/delete_branch_confirmation_modals.yml8
-rw-r--r--db/init_structure.sql1078
-rw-r--r--db/migrate/20201211145950_add_bloat_estimate_to_reindex_action.rb9
-rw-r--r--db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb19
-rw-r--r--db/migrate/20201214032220_add_has_external_wiki_trigger.rb52
-rw-r--r--db/migrate/20201214084105_add_expiration_policy_completed_at_to_container_repositories.rb12
-rw-r--r--db/migrate/20201214111858_add_container_registry_cleanup_tags_service_max_list_size_to_application_settings.rb11
-rw-r--r--db/migrate/20201214112752_add_app_settings_container_reg_cleanup_tags_service_max_list_size_constraint.rb19
-rw-r--r--db/migrate/20201214113729_add_custom_mapping_columns_to_http_integrations.rb10
-rw-r--r--db/migrate/20201214184020_add_epic_board_list.rb33
-rw-r--r--db/migrate/20201215084652_delete_mock_deployment_service_records.rb15
-rw-r--r--db/migrate/20201215132151_change_unique_index_on_security_findings.rb36
-rw-r--r--db/migrate/20201215205404_create_namespace_package_settings.rb25
-rw-r--r--db/migrate/20201216151616_add_squash_commit_sha_index.rb22
-rw-r--r--db/migrate/20201216154457_add_devops_adoption_snapshot_range_end.rb11
-rw-r--r--db/migrate/20201217070530_add_group_merge_request_approval_settings.rb24
-rw-r--r--db/migrate/20201217111448_change_pages_deployment_size_to_bigint.rb17
-rw-r--r--db/migrate/20201217132603_create_elastic_reindexing_subtasks.rb56
-rw-r--r--db/migrate/20201218194311_create_admin_notes.rb21
-rw-r--r--db/migrate/20201221124036_add_devops_snapshot_index.rb19
-rw-r--r--db/migrate/20201221213415_change_clusters_helm_major_version_default_to_3.rb9
-rw-r--r--db/migrate/20201221225303_add_service_desk_reply_to_is_not_null_index_on_issues.rb11
-rw-r--r--db/migrate/20201222151823_update_trusted_apps_to_confidential.rb23
-rw-r--r--db/migrate/20201223114050_add_restrict_user_defined_variables_to_project_settings.rb19
-rw-r--r--db/migrate/20201224144948_migrate_coverage_report_worker.rb15
-rw-r--r--db/migrate/20201228110136_create_iterations_cadence.rb29
-rw-r--r--db/migrate/20201228110238_add_iterations_cadence_to_sprints.rb22
-rw-r--r--db/migrate/20201228184500_add_dismissal_reason_into_vulnerability_feedback_table.rb13
-rw-r--r--db/migrate/20201229105948_add_invisible_captcha_enabled_to_settings.rb9
-rw-r--r--db/migrate/20201230161206_add_rate_limiting_response_text_to_application_settings.rb12
-rw-r--r--db/migrate/20201230180202_create_onboarding_progress.rb36
-rw-r--r--db/migrate/20210101110640_set_limit_for_rate_limiting_response_text.rb16
-rw-r--r--db/migrate/20210102164121_drop_temporary_index_on_ci_builds.rb19
-rw-r--r--db/migrate/20210104163218_add_epic_board_position_index.rb18
-rw-r--r--db/migrate/20210105052034_rename_asset_proxy_whitelist_on_application_settings.rb21
-rw-r--r--db/migrate/20210105153342_add_entity_columns_to_vulnerability_occurrences.rb16
-rw-r--r--db/migrate/20210105154321_add_text_limit_to_vulnerability_occurrences_entity_columns.rb23
-rw-r--r--db/migrate/20210106061254_add_unique_index_for_golang_packages.rb20
-rw-r--r--db/migrate/20210106153021_drop_tmp_index_on_emails.rb20
-rw-r--r--db/migrate/20210106155209_add_merge_request_diff_commit_trailers.rb22
-rw-r--r--db/migrate/20210106191305_rename_indexes_on_git_lab_com.rb57
-rw-r--r--db/migrate/20210106225424_add_keep_latest_artifacts_to_application_settings.rb11
-rw-r--r--db/migrate/20210107105306_add_diff_type_to_merge_request_diffs.rb31
-rw-r--r--db/migrate/20210107154615_add_merge_request_context_commit_trailers.rb12
-rw-r--r--db/migrate/20210108161039_update_max_import_size_default.rb9
-rw-r--r--db/migrate/20210111051045_create_dast_profiles.rb35
-rw-r--r--db/migrate/20210111053308_add_project_fk_for_dast_profile.rb19
-rw-r--r--db/migrate/20210111075104_add_temporary_index_on_security_findings_scan_id.rb18
-rw-r--r--db/migrate/20210112084512_drop_tmp_index_on_emails_again.rb18
-rw-r--r--db/migrate/20210112202949_create_composer_cache_file.rb34
-rw-r--r--db/migrate/20210113224909_add_pipeline_configuration_full_path_to_compliance_pipeline.rb16
-rw-r--r--db/migrate/20210113231532_add_converted_at_to_experiment_subjects.rb9
-rw-r--r--db/migrate/20210113231546_add_context_to_experiment_subjects.rb9
-rw-r--r--db/migrate/20210114033715_remove_group_id_title_index.rb20
-rw-r--r--db/migrate/20210114142443_add_indexes_to_onboarding_progresses.rb27
-rw-r--r--db/migrate/20210115090452_create_group_repository_storage_move.rb34
-rw-r--r--db/migrate/20210117210226_add_has_external_issue_tracker_trigger.rb61
-rw-r--r--db/migrate/20210118111307_add_enforce_ssh_key_expiration_to_application_settings.rb9
-rw-r--r--db/migrate/20210119153801_add_proxy_settings_to_jira_tracker_data.rb16
-rw-r--r--db/migrate/20210119162812_add_text_limit_to_compliance_pipeline_configuration_full_path.rb17
-rw-r--r--db/migrate/20210120180956_extend_index_on_ci_builds_metadata.rb40
-rw-r--r--db/migrate/20210120221743_delete_oauth_applications_tmp_index.rb18
-rw-r--r--db/migrate/20210121093618_remove_repository_read_only_to_groups.rb23
-rw-r--r--db/migrate/20210121100038_add_devops_adoption_group_segment.rb18
-rw-r--r--db/migrate/20210121121102_optional_devops_adoption_segment_name.rb24
-rw-r--r--db/migrate/20210122073805_add_repository_read_only_to_namespace_settings.rb19
-rw-r--r--db/migrate/20210122153259_add_state_to_merge_request_reviewers.rb11
-rw-r--r--db/migrate/20210122155158_add_pipeline_step_to_bulk_imports_failures.rb25
-rw-r--r--db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb17
-rw-r--r--db/migrate/20210126030249_add_security_dashboard_access_level_into_project_features.rb20
-rw-r--r--db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb19
-rw-r--r--db/migrate/20210126092102_remove_index_services_project_id_and_type.rb20
-rw-r--r--db/migrate/20210126233608_add_rubygems_max_file_size_to_plan_limits.rb9
-rw-r--r--db/migrate/20210127052226_add_subgroup_events_to_web_hooks.rb9
-rw-r--r--db/migrate/20210127143025_add_oldest_merge_requests_index.rb13
-rw-r--r--db/migrate/20210127152613_add_iterations_cadence_date_range_constraint.rb30
-rw-r--r--db/migrate/20210127202613_remove_iteration_group_date_range_constraint.rb30
-rw-r--r--db/migrate/20210128044930_add_git_two_factor_session_expiry_to_application_settings.rb9
-rw-r--r--db/migrate/20210128101707_add_prevent_merge_without_jira_issue_to_project_settings.rb18
-rw-r--r--db/migrate/20210128114526_add_auto_delete_at_to_environments.rb19
-rw-r--r--db/migrate/20210128140157_add_content_type_to_dependency_proxy_manifests.rb12
-rw-r--r--db/migrate/20210128140232_add_text_limit_to_dependency_proxy_manifests_content_type.rb16
-rw-r--r--db/migrate/20210128152830_create_ci_namespace_monthly_usage.rb30
-rw-r--r--db/migrate/20210128172149_create_background_migration_tracking_tables.rb59
-rw-r--r--db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb24
-rw-r--r--db/migrate/20210201034649_add_active_periods_to_on_call_rotations.rb10
-rw-r--r--db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb59
-rw-r--r--db/migrate/20210203002331_drop_backup_label_index.rb19
-rw-r--r--db/migrate/20210203092540_remove_has_external_wiki_constraint.rb20
-rw-r--r--db/migrate/20210203092549_restore_has_external_wiki_default_value.rb31
-rw-r--r--db/migrate/20210203221631_create_packages_rubygems_metadata.rb69
-rw-r--r--db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb19
-rw-r--r--db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb19
-rw-r--r--db/migrate/20210204152257_add_status_to_packages_packages.rb9
-rw-r--r--db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb9
-rw-r--r--db/migrate/20210205084357_create_ci_project_monthly_usage.rb29
-rw-r--r--db/migrate/20210205134213_add_creator_id_to_custom_emoji.rb23
-rw-r--r--db/migrate/20210205143926_remove_namespace_id_foreign_key_on_namespace_onboarding_actions.rb19
-rw-r--r--db/migrate/20210205213915_remove_foreign_keys_from_alerts_service_data.rb19
-rw-r--r--db/migrate/20210208103243_add_issue_created_at_to_onboarding_progress.rb9
-rw-r--r--db/migrate/20210208125050_add_status_expires_at_to_user_statuses.rb19
-rw-r--r--db/migrate/20210208125248_add_index_on_user_statuses_status_expires_at.rb18
-rw-r--r--db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb20
-rw-r--r--db/migrate/20210208161207_add_notes_create_limit_to_application_settings.rb9
-rw-r--r--db/migrate/20210208200914_add_ends_at_to_oncall_rotations.rb9
-rw-r--r--db/migrate/20210209110019_create_external_approval_rules.rb44
-rw-r--r--db/migrate/20210209160510_create_security_orchestration_policy_configurations.rb25
-rw-r--r--db/migrate/20210209171525_add_status_index_to_packages_packages.rb19
-rw-r--r--db/migrate/20210209232508_add_markdown_surround_selection_to_user_preferences.rb21
-rw-r--r--db/migrate/20210210210232_add_notes_create_limit_allowlist_to_application_settings.rb9
-rw-r--r--db/migrate/20210211195543_add_created_by_user_for_cluster_agent_token.rb28
-rw-r--r--db/migrate/20210212153934_make_the_geo_oauth_application_trusted_by_default.rb20
-rw-r--r--db/migrate/20210212163231_add_merge_when_pipeline_succeeds_to_notification_settings.rb12
-rw-r--r--db/migrate/20210214201118_add_delayed_project_removal_to_namespace_settings.rb9
-rw-r--r--db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb18
-rw-r--r--db/migrate/20210215172449_remove_artifact_expiry_temp_index.rb18
-rw-r--r--db/migrate/20210216122140_add_in_product_marketing_emails_enabled_setting.rb9
-rw-r--r--db/migrate/20210216135504_add_created_by_to_cluster_agent.rb27
-rw-r--r--db/migrate/20210216193620_add_description_to_cluster_token.rb21
-rw-r--r--db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb21
-rw-r--r--db/migrate/20210217101901_create_epic_list_user_preferences.rb20
-rw-r--r--db/migrate/20210218040814_add_environment_scope_to_group_variables.rb45
-rw-r--r--db/migrate/20210218142626_change_finding_fingerprint_enum.rb15
-rw-r--r--db/migrate/20210218144056_add_sprints_start_date_not_null_check_constraint.rb17
-rw-r--r--db/migrate/20210218144656_add_sprints_due_date_not_null_check_constraint.rb17
-rw-r--r--db/migrate/20210219100137_add_creator_foreign_key_to_custom_emoji.rb23
-rw-r--r--db/migrate/20210219111040_add_epic_issue_composite_index.rb18
-rw-r--r--db/migrate/20210219211845_add_version_usage_data_id_to_raw_usage_data.rb9
-rw-r--r--db/migrate/20210222030537_add_is_removed_to_oncall_participant.rb19
-rw-r--r--db/migrate/20210222042745_add_is_removed_index_to_oncall_participant.rb21
-rw-r--r--db/migrate/20210222070356_add_storage_size_to_namespace_statistics.rb19
-rw-r--r--db/migrate/20210222070413_add_wiki_size_to_namespace_statistics.rb19
-rw-r--r--db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb19
-rw-r--r--db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb19
-rw-r--r--db/migrate/20210222105120_add_container_registry_access_level.rb25
-rw-r--r--db/migrate/20210223053451_add_branch_name_to_dast_profile.rb23
-rw-r--r--db/migrate/20210223132934_add_foreign_key_to_external_approval_rules.rb18
-rw-r--r--db/migrate/20210223133116_add_foreign_key_to_external_approval_rules_protected_branches.rb18
-rw-r--r--db/migrate/20210223230600_update_rubygems_metadata_metadata.rb19
-rw-r--r--db/migrate/20210224132547_add_null_constraint_to_terraform_state_name.rb11
-rw-r--r--db/migrate/20210224133337_add_name_field_to_cluster_agent_token.rb12
-rw-r--r--db/migrate/20210224161552_add_jira_issue_transition_automatic_to_jira_tracker_data.rb9
-rw-r--r--db/migrate/20210225090801_create_dora_daily_metrics.rb31
-rw-r--r--db/migrate/20210225135533_limit_cluster_token_size.rb17
-rw-r--r--db/migrate/20210225153522_add_allow_force_push_to_protected_branches.rb19
-rw-r--r--db/migrate/20210301150451_add_tier_to_environments.rb19
-rw-r--r--db/migrate/20210301193412_add_optional_to_ci_build_needs.rb19
-rw-r--r--db/migrate/20210301200601_rename_asset_proxy_allowlist_on_application_settings.rb29
-rw-r--r--db/migrate/20210301200959_init_schema.rb (renamed from db/migrate/20181228175414_init_schema.rb)0
-rw-r--r--db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb25
-rw-r--r--db/post_migrate/20201216185336_add_devops_adoption_snapshot_not_null.rb31
-rw-r--r--db/post_migrate/20201217112249_change_pages_deployment_size_to_bigint_cleanup.rb17
-rw-r--r--db/post_migrate/20201223012231_reindex_ci_pipelines_on_schedule_id_and_id.rb21
-rw-r--r--db/post_migrate/20201231133921_schedule_set_default_iteration_cadences.rb26
-rw-r--r--db/post_migrate/20210105030125_cleanup_projects_with_bad_has_external_wiki_data.rb88
-rw-r--r--db/post_migrate/20210105052229_clean_up_asset_proxy_whitelist_rename_on_application_settings.rb19
-rw-r--r--db/post_migrate/20210105103649_delete_column_group_id_on_compliance_framework.rb9
-rw-r--r--db/post_migrate/20210107194543_remove_alerts_service_records.rb19
-rw-r--r--db/post_migrate/20210111075105_schedule_uuid_population_for_security_findings.rb20
-rw-r--r--db/post_migrate/20210111075206_schedule_uuid_population_for_security_findings2.rb34
-rw-r--r--db/post_migrate/20210112143418_remove_duplicate_services2.rb29
-rw-r--r--db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb22
-rw-r--r--db/post_migrate/20210115220610_schedule_artifact_expiry_backfill.rb48
-rw-r--r--db/post_migrate/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value.rb34
-rw-r--r--db/post_migrate/20210203143131_migrate_existing_devops_segments_to_groups.rb15
-rw-r--r--db/post_migrate/20210205104425_add_new_post_eoa_plans.rb14
-rw-r--r--db/post_migrate/20210205144537_remove_namespace_onboarding_actions_table.rb23
-rw-r--r--db/post_migrate/20210205174154_remove_bad_dependency_proxy_manifests.rb15
-rw-r--r--db/post_migrate/20210205213933_drop_alerts_service_data.rb26
-rw-r--r--db/post_migrate/20210205214003_remove_alerts_service_records_again.rb19
-rw-r--r--db/post_migrate/20210210093901_backfill_updated_at_after_repository_storage_move.rb34
-rw-r--r--db/post_migrate/20210210221006_cleanup_projects_with_bad_has_external_issue_tracker_data.rb84
-rw-r--r--db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb28
-rw-r--r--db/post_migrate/20210215144909_migrate_usage_trends_sidekiq_queue.rb19
-rw-r--r--db/post_migrate/20210217100728_move_create_release_evidence_queue_out_of_cronjob_namespace.rb16
-rw-r--r--db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb36
-rw-r--r--db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb22
-rw-r--r--db/post_migrate/20210219102900_reschedule_set_default_iteration_cadences.rb30
-rw-r--r--db/post_migrate/20210222185538_remove_backup_labels_foreign_keys.rb21
-rw-r--r--db/post_migrate/20210222192144_remove_backup_labels_table.rb36
-rw-r--r--db/post_migrate/20210224150506_reschedule_artifact_expiry_backfill.rb44
-rw-r--r--db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb28
-rw-r--r--db/post_migrate/20210226141517_dedup_issue_metrics.rb71
-rw-r--r--db/post_migrate/20210301200959_clean_up_asset_proxy_allowlist_rename_on_application_settings.rb21
-rw-r--r--db/schema_migrations/201812281754141
-rw-r--r--db/schema_migrations/202012110906341
-rw-r--r--db/schema_migrations/202012111459501
-rw-r--r--db/schema_migrations/202012140000001
-rw-r--r--db/schema_migrations/202012140322201
-rw-r--r--db/schema_migrations/202012140841051
-rw-r--r--db/schema_migrations/202012141118581
-rw-r--r--db/schema_migrations/202012141127521
-rw-r--r--db/schema_migrations/202012141137291
-rw-r--r--db/schema_migrations/202012141840201
-rw-r--r--db/schema_migrations/202012150846521
-rw-r--r--db/schema_migrations/202012151321511
-rw-r--r--db/schema_migrations/202012152054041
-rw-r--r--db/schema_migrations/202012161516161
-rw-r--r--db/schema_migrations/202012161544571
-rw-r--r--db/schema_migrations/202012161853361
-rw-r--r--db/schema_migrations/202012170705301
-rw-r--r--db/schema_migrations/202012171114481
-rw-r--r--db/schema_migrations/202012171122491
-rw-r--r--db/schema_migrations/202012171326031
-rw-r--r--db/schema_migrations/202012181943111
-rw-r--r--db/schema_migrations/202012211240361
-rw-r--r--db/schema_migrations/202012212134151
-rw-r--r--db/schema_migrations/202012212253031
-rw-r--r--db/schema_migrations/202012221518231
-rw-r--r--db/schema_migrations/202012230122311
-rw-r--r--db/schema_migrations/202012231140501
-rw-r--r--db/schema_migrations/202012241449481
-rw-r--r--db/schema_migrations/202012281101361
-rw-r--r--db/schema_migrations/202012281102381
-rw-r--r--db/schema_migrations/202012281845001
-rw-r--r--db/schema_migrations/202012291059481
-rw-r--r--db/schema_migrations/202012301612061
-rw-r--r--db/schema_migrations/202012301802021
-rw-r--r--db/schema_migrations/202012311339211
-rw-r--r--db/schema_migrations/202101011106401
-rw-r--r--db/schema_migrations/202101021641211
-rw-r--r--db/schema_migrations/202101041632181
-rw-r--r--db/schema_migrations/202101050301251
-rw-r--r--db/schema_migrations/202101050520341
-rw-r--r--db/schema_migrations/202101050522291
-rw-r--r--db/schema_migrations/202101051036491
-rw-r--r--db/schema_migrations/202101051533421
-rw-r--r--db/schema_migrations/202101051543211
-rw-r--r--db/schema_migrations/202101060612541
-rw-r--r--db/schema_migrations/202101061530211
-rw-r--r--db/schema_migrations/202101061552091
-rw-r--r--db/schema_migrations/202101061913051
-rw-r--r--db/schema_migrations/202101062254241
-rw-r--r--db/schema_migrations/202101071053061
-rw-r--r--db/schema_migrations/202101071546151
-rw-r--r--db/schema_migrations/202101071945431
-rw-r--r--db/schema_migrations/202101081610391
-rw-r--r--db/schema_migrations/202101110510451
-rw-r--r--db/schema_migrations/202101110533081
-rw-r--r--db/schema_migrations/202101110751041
-rw-r--r--db/schema_migrations/202101110751051
-rw-r--r--db/schema_migrations/202101110752061
-rw-r--r--db/schema_migrations/202101120845121
-rw-r--r--db/schema_migrations/202101121434181
-rw-r--r--db/schema_migrations/202101122029491
-rw-r--r--db/schema_migrations/202101132249091
-rw-r--r--db/schema_migrations/202101132315321
-rw-r--r--db/schema_migrations/202101132315461
-rw-r--r--db/schema_migrations/202101140337151
-rw-r--r--db/schema_migrations/202101141424431
-rw-r--r--db/schema_migrations/202101150904521
-rw-r--r--db/schema_migrations/202101152158541
-rw-r--r--db/schema_migrations/202101152206101
-rw-r--r--db/schema_migrations/202101172102261
-rw-r--r--db/schema_migrations/202101181113071
-rw-r--r--db/schema_migrations/202101191223541
-rw-r--r--db/schema_migrations/202101191538011
-rw-r--r--db/schema_migrations/202101191628121
-rw-r--r--db/schema_migrations/202101201809561
-rw-r--r--db/schema_migrations/202101202217431
-rw-r--r--db/schema_migrations/202101210936181
-rw-r--r--db/schema_migrations/202101211000381
-rw-r--r--db/schema_migrations/202101211211021
-rw-r--r--db/schema_migrations/202101220738051
-rw-r--r--db/schema_migrations/202101221532591
-rw-r--r--db/schema_migrations/202101221551581
-rw-r--r--db/schema_migrations/202101251054101
-rw-r--r--db/schema_migrations/202101260302491
-rw-r--r--db/schema_migrations/202101260917131
-rw-r--r--db/schema_migrations/202101260921021
-rw-r--r--db/schema_migrations/202101262336081
-rw-r--r--db/schema_migrations/202101270522261
-rw-r--r--db/schema_migrations/202101271430251
-rw-r--r--db/schema_migrations/202101271526131
-rw-r--r--db/schema_migrations/202101272026131
-rw-r--r--db/schema_migrations/202101280449301
-rw-r--r--db/schema_migrations/202101281017071
-rw-r--r--db/schema_migrations/202101281145261
-rw-r--r--db/schema_migrations/202101281401571
-rw-r--r--db/schema_migrations/202101281402321
-rw-r--r--db/schema_migrations/202101281528301
-rw-r--r--db/schema_migrations/202101281721491
-rw-r--r--db/schema_migrations/202101292252441
-rw-r--r--db/schema_migrations/202102010346491
-rw-r--r--db/schema_migrations/202102011404341
-rw-r--r--db/schema_migrations/202102030023311
-rw-r--r--db/schema_migrations/202102030925401
-rw-r--r--db/schema_migrations/202102030925491
-rw-r--r--db/schema_migrations/202102031431311
-rw-r--r--db/schema_migrations/202102032216311
-rw-r--r--db/schema_migrations/202102032226201
-rw-r--r--db/schema_migrations/202102032235511
-rw-r--r--db/schema_migrations/202102041522571
-rw-r--r--db/schema_migrations/202102042128501
-rw-r--r--db/schema_migrations/202102050843571
-rw-r--r--db/schema_migrations/202102051044251
-rw-r--r--db/schema_migrations/202102051342131
-rw-r--r--db/schema_migrations/202102051439261
-rw-r--r--db/schema_migrations/202102051445371
-rw-r--r--db/schema_migrations/202102051741541
-rw-r--r--db/schema_migrations/202102052139151
-rw-r--r--db/schema_migrations/202102052139331
-rw-r--r--db/schema_migrations/202102052140031
-rw-r--r--db/schema_migrations/202102081032431
-rw-r--r--db/schema_migrations/202102081250501
-rw-r--r--db/schema_migrations/202102081252481
-rw-r--r--db/schema_migrations/202102081441341
-rw-r--r--db/schema_migrations/202102081612071
-rw-r--r--db/schema_migrations/202102082009141
-rw-r--r--db/schema_migrations/202102091100191
-rw-r--r--db/schema_migrations/202102091605101
-rw-r--r--db/schema_migrations/202102091715251
-rw-r--r--db/schema_migrations/202102092325081
-rw-r--r--db/schema_migrations/202102100939011
-rw-r--r--db/schema_migrations/202102102102321
-rw-r--r--db/schema_migrations/202102102210061
-rw-r--r--db/schema_migrations/202102111955431
-rw-r--r--db/schema_migrations/202102121539341
-rw-r--r--db/schema_migrations/202102121632311
-rw-r--r--db/schema_migrations/202102142011181
-rw-r--r--db/schema_migrations/202102142051551
-rw-r--r--db/schema_migrations/202102150953281
-rw-r--r--db/schema_migrations/202102151449091
-rw-r--r--db/schema_migrations/202102151724491
-rw-r--r--db/schema_migrations/202102161221401
-rw-r--r--db/schema_migrations/202102161355041
-rw-r--r--db/schema_migrations/202102161936201
-rw-r--r--db/schema_migrations/202102162233351
-rw-r--r--db/schema_migrations/202102171007281
-rw-r--r--db/schema_migrations/202102171019011
-rw-r--r--db/schema_migrations/202102180408141
-rw-r--r--db/schema_migrations/202102181054311
-rw-r--r--db/schema_migrations/202102181105521
-rw-r--r--db/schema_migrations/202102181426261
-rw-r--r--db/schema_migrations/202102181440561
-rw-r--r--db/schema_migrations/202102181446561
-rw-r--r--db/schema_migrations/202102191001371
-rw-r--r--db/schema_migrations/202102191029001
-rw-r--r--db/schema_migrations/202102191110401
-rw-r--r--db/schema_migrations/202102192118451
-rw-r--r--db/schema_migrations/202102220305371
-rw-r--r--db/schema_migrations/202102220427451
-rw-r--r--db/schema_migrations/202102220703561
-rw-r--r--db/schema_migrations/202102220704131
-rw-r--r--db/schema_migrations/202102220855291
-rw-r--r--db/schema_migrations/202102220855511
-rw-r--r--db/schema_migrations/202102221051201
-rw-r--r--db/schema_migrations/202102221855381
-rw-r--r--db/schema_migrations/202102221921441
-rw-r--r--db/schema_migrations/202102230534511
-rw-r--r--db/schema_migrations/202102231329341
-rw-r--r--db/schema_migrations/202102231331161
-rw-r--r--db/schema_migrations/202102232306001
-rw-r--r--db/schema_migrations/202102241325471
-rw-r--r--db/schema_migrations/202102241333371
-rw-r--r--db/schema_migrations/202102241505061
-rw-r--r--db/schema_migrations/202102241615521
-rw-r--r--db/schema_migrations/202102250908011
-rw-r--r--db/schema_migrations/202102251355331
-rw-r--r--db/schema_migrations/202102251535221
-rw-r--r--db/schema_migrations/202102261208511
-rw-r--r--db/schema_migrations/202102261415171
-rw-r--r--db/schema_migrations/202103011504511
-rw-r--r--db/schema_migrations/202103011934121
-rw-r--r--db/schema_migrations/202103012006011
-rw-r--r--doc/api/runners.md23
-rw-r--r--doc/tutorials/index.md124
-rw-r--r--doc/user/analytics/issue_analytics.md4
-rw-r--r--doc/user/analytics/repository_analytics.md16
-rw-r--r--doc/user/analytics/value_stream_analytics.md51
-rw-r--r--doc/user/group/issues_analytics/index.md9
-rw-r--r--doc/user/group/repositories_analytics/index.md2
-rw-r--r--doc/user/group/value_stream_analytics/index.md52
-rw-r--r--lib/api/ci/runner.rb3
-rw-r--r--lib/gitlab/background_migration/migrate_legacy_artifacts.rb130
-rw-r--r--lib/gitlab/background_migration/remove_duplicate_services.rb58
-rw-r--r--locale/gitlab.pot42
-rw-r--r--package.json3
-rw-r--r--qa/.confiner/quarantine.yml15
-rw-r--r--qa/Gemfile2
-rw-r--r--qa/Gemfile.lock8
-rw-r--r--qa/qa/page/project/branches/show.rb1
-rw-r--r--qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb260
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb (renamed from qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb)0
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb57
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb73
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb96
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb77
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb2
-rw-r--r--spec/features/admin/admin_runners_spec.rb89
-rw-r--r--spec/features/projects/branches/user_deletes_branch_spec.rb24
-rw-r--r--spec/features/projects/branches_spec.rb20
-rw-r--r--spec/features/projects/environments/environment_spec.rb18
-rw-r--r--spec/features/protected_branches_spec.rb41
-rw-r--r--spec/frontend/branches/branches_delete_modal_spec.js40
-rw-r--r--spec/frontend/fixtures/runner.rb19
-rw-r--r--spec/frontend/runner/admin_runners/admin_runners_app_spec.js34
-rw-r--r--spec/frontend/runner/mock_data.js2
-rw-r--r--spec/frontend/vue_shared/issuable/list/components/issuable_tabs_spec.js5
-rw-r--r--spec/frontend/vue_shared/issuable/list/mock_data.js2
-rw-r--r--spec/helpers/ci/runners_helper_spec.rb6
-rw-r--r--spec/lib/gitlab/background_migration/backfill_artifact_expiry_date_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/backfill_project_updated_at_after_repository_storage_move_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb158
-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/populate_finding_uuid_for_vulnerability_feedback_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/populate_issue_email_participants_spec.rb2
-rw-r--r--spec/lib/gitlab/background_migration/remove_duplicate_services_spec.rb121
-rw-r--r--spec/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer_spec.rb2
-rw-r--r--spec/migrations/20210112143418_remove_duplicate_services2_spec.rb52
-rw-r--r--spec/migrations/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value_spec.rb30
-rw-r--r--spec/migrations/20210205174154_remove_bad_dependency_proxy_manifests_spec.rb28
-rw-r--r--spec/migrations/20210210093901_backfill_updated_at_after_repository_storage_move_spec.rb47
-rw-r--r--spec/migrations/20210218040814_add_environment_scope_to_group_variables_spec.rb46
-rw-r--r--spec/migrations/20210226141517_dedup_issue_metrics_spec.rb66
-rw-r--r--spec/migrations/add_has_external_issue_tracker_trigger_spec.rb164
-rw-r--r--spec/migrations/add_has_external_wiki_trigger_spec.rb128
-rw-r--r--spec/migrations/add_new_post_eoa_plans_spec.rb32
-rw-r--r--spec/migrations/cleanup_projects_with_bad_has_external_issue_tracker_data_spec.rb94
-rw-r--r--spec/migrations/cleanup_projects_with_bad_has_external_wiki_data_spec.rb89
-rw-r--r--spec/migrations/drop_alerts_service_data_spec.rb21
-rw-r--r--spec/migrations/migrate_delayed_project_removal_from_namespaces_to_namespace_settings_spec.rb30
-rw-r--r--spec/migrations/remove_alerts_service_records_again_spec.rb23
-rw-r--r--spec/migrations/remove_alerts_service_records_spec.rb30
-rw-r--r--spec/migrations/reschedule_artifact_expiry_backfill_spec.rb38
-rw-r--r--spec/migrations/schedule_migrate_pages_to_zip_storage_spec.rb2
-rw-r--r--spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb37
-rw-r--r--spec/models/customer_relations/contact_spec.rb13
-rw-r--r--spec/models/customer_relations/issue_contact_spec.rb21
-rw-r--r--spec/models/user_spec.rb2
-rw-r--r--spec/presenters/packages/nuget/search_results_presenter_spec.rb4
-rw-r--r--spec/requests/api/ci/runner/runners_post_spec.rb2
-rw-r--r--spec/requests/api/graphql/mutations/issues/set_crm_contacts_spec.rb183
-rw-r--r--spec/support/database/cross-database-modification-allowlist.yml1
455 files changed, 1798 insertions, 6746 deletions
diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml
index ea4ae3b0492..1dd5285e0ae 100644
--- a/.gitlab/ci/frontend.gitlab-ci.yml
+++ b/.gitlab/ci/frontend.gitlab-ci.yml
@@ -306,6 +306,11 @@ qa-frontend-node:latest:
- .qa-frontend-node
- .frontend:rules:qa-frontend-node-latest
image: ${GITLAB_DEPENDENCY_PROXY}node:latest
+ # This is a workaround for https://github.com/webpack/webpack/issues/14532 until
+ # we can upgrade to Webpack 5 and switch to SHA256: https://gitlab.com/gitlab-org/gitlab/-/issues/350120
+ script:
+ - *yarn-install
+ - run_timed_command "retry yarn run webpack-prod-node-latest"
webpack-dev-server:
extends:
diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml
index 5ba4d08e317..1d2f94b616d 100644
--- a/.gitlab/ci/rails.gitlab-ci.yml
+++ b/.gitlab/ci/rails.gitlab-ci.yml
@@ -346,7 +346,7 @@ rspec fast_spec_helper minimal:
db:rollback:
extends: .db-job-base
script:
- - scripts/db_tasks db:migrate VERSION=20181228175414
+ - scripts/db_tasks db:migrate VERSION=20210301200959
- scripts/db_tasks db:migrate SKIP_SCHEMA_VERSION_CHECK=true
db:rollback decomposed:
diff --git a/.rubocop_todo/style/open_struct_use.yml b/.rubocop_todo/style/open_struct_use.yml
index c04493fe3bb..ed4a53f2894 100644
--- a/.rubocop_todo/style/open_struct_use.yml
+++ b/.rubocop_todo/style/open_struct_use.yml
@@ -32,8 +32,6 @@ Style/OpenStructUse:
- spec/lib/gitlab/quick_actions/command_definition_spec.rb
- spec/models/design_management/design_action_spec.rb
- spec/models/design_management/design_at_version_spec.rb
- - spec/models/user_spec.rb
- - spec/presenters/packages/nuget/search_results_presenter_spec.rb
- spec/services/packages/nuget/metadata_extraction_service_spec.rb
- spec/services/projects/import_service_spec.rb
- spec/services/system_note_service_spec.rb
diff --git a/app/assets/javascripts/branches/branches_delete_modal.js b/app/assets/javascripts/branches/branches_delete_modal.js
deleted file mode 100644
index f4c3fa185d8..00000000000
--- a/app/assets/javascripts/branches/branches_delete_modal.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import $ from 'jquery';
-
-const MODAL_SELECTOR = '#modal-delete-branch';
-
-class DeleteModal {
- constructor() {
- this.$modal = $(MODAL_SELECTOR);
- this.$toggleBtns = $(`[data-target="${MODAL_SELECTOR}"]`);
- this.$branchName = $('.js-branch-name', this.$modal);
- this.$confirmInput = $('.js-delete-branch-input', this.$modal);
- this.$deleteBtn = $('.js-delete-branch', this.$modal);
- this.$notMerged = $('.js-not-merged', this.$modal);
- this.bindEvents();
- }
-
- bindEvents() {
- this.$toggleBtns.on('click', this.setModalData.bind(this));
- this.$confirmInput.on('input', this.setDeleteDisabled.bind(this));
- this.$deleteBtn.on('click', this.setDisableDeleteButton.bind(this));
- }
-
- setModalData(e) {
- const branchData = e.currentTarget.dataset;
- this.branchName = branchData.branchName || '';
- this.deletePath = branchData.deletePath || '';
- this.isMerged = Boolean(branchData.isMerged);
- this.updateModal();
- }
-
- setDeleteDisabled(e) {
- this.$deleteBtn.attr('disabled', e.currentTarget.value !== this.branchName);
- }
-
- setDisableDeleteButton(e) {
- if (this.$deleteBtn.is('[disabled]')) {
- e.preventDefault();
- e.stopPropagation();
- return false;
- }
-
- return true;
- }
-
- updateModal() {
- this.$branchName.text(this.branchName);
- this.$confirmInput.val('');
- this.$deleteBtn.attr('href', this.deletePath);
- this.$deleteBtn.attr('disabled', true);
- this.$notMerged.toggleClass('hidden', this.isMerged);
- }
-}
-
-export default DeleteModal;
diff --git a/app/assets/javascripts/clusters/agents/components/show.vue b/app/assets/javascripts/clusters/agents/components/show.vue
index da455c6fd87..a53bba6992d 100644
--- a/app/assets/javascripts/clusters/agents/components/show.vue
+++ b/app/assets/javascripts/clusters/agents/components/show.vue
@@ -122,12 +122,12 @@ export default {
</p>
<gl-tabs sync-active-tab-with-query-params lazy>
- <slot name="ee-security-tab" :cluster-agent-id="clusterAgent.id"></slot>
-
<gl-tab :title="$options.i18n.activity" query-param-value="activity">
<activity-events :agent-name="agentName" :project-path="projectPath" />
</gl-tab>
+ <slot name="ee-security-tab" :cluster-agent-id="clusterAgent.id"></slot>
+
<gl-tab query-param-value="tokens">
<template #title>
<span data-testid="cluster-agent-token-count">
diff --git a/app/assets/javascripts/pages/projects/branches/index/index.js b/app/assets/javascripts/pages/projects/branches/index/index.js
index 97dc76908af..d279c4cbb08 100644
--- a/app/assets/javascripts/pages/projects/branches/index/index.js
+++ b/app/assets/javascripts/pages/projects/branches/index/index.js
@@ -1,13 +1,11 @@
import initDeprecatedRemoveRowBehavior from '~/behaviors/deprecated_remove_row_behavior';
import AjaxLoadingSpinner from '~/branches/ajax_loading_spinner';
import BranchSortDropdown from '~/branches/branch_sort_dropdown';
-import DeleteModal from '~/branches/branches_delete_modal';
import initDiverganceGraph from '~/branches/divergence_graph';
import initDeleteBranchButton from '~/branches/init_delete_branch_button';
import initDeleteBranchModal from '~/branches/init_delete_branch_modal';
AjaxLoadingSpinner.init();
-new DeleteModal(); // eslint-disable-line no-new
const { divergingCountsEndpoint, defaultBranch } = document.querySelector(
'.js-branch-list',
diff --git a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue
index 2bb4ae7d34e..69b3e543ed5 100644
--- a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue
+++ b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue
@@ -22,6 +22,7 @@ import {
I18N_FETCH_ERROR,
} from '../constants';
import getRunnersQuery from '../graphql/get_runners.query.graphql';
+import getRunnersCountQuery from '../graphql/get_runners_count.query.graphql';
import {
fromUrlQueryToSearch,
fromSearchToUrl,
@@ -29,6 +30,17 @@ import {
} from '../runner_search_utils';
import { captureException } from '../sentry_utils';
+const runnersCountSmartQuery = {
+ query: getRunnersCountQuery,
+ fetchPolicy: fetchPolicies.CACHE_AND_NETWORK,
+ update(data) {
+ return data?.runners?.count;
+ },
+ error(error) {
+ this.reportToSentry(error);
+ },
+};
+
export default {
name: 'AdminRunnersApp',
components: {
@@ -51,22 +63,6 @@ export default {
type: String,
required: true,
},
- allRunnersCount: {
- type: String,
- required: true,
- },
- instanceRunnersCount: {
- type: String,
- required: true,
- },
- groupRunnersCount: {
- type: String,
- required: true,
- },
- projectRunnersCount: {
- type: String,
- required: true,
- },
},
data() {
return {
@@ -100,11 +96,49 @@ export default {
this.reportToSentry(error);
},
},
+ allRunnersCount: {
+ ...runnersCountSmartQuery,
+ variables() {
+ return this.countVariables;
+ },
+ },
+ instanceRunnersCount: {
+ ...runnersCountSmartQuery,
+ variables() {
+ return {
+ ...this.countVariables,
+ type: INSTANCE_TYPE,
+ };
+ },
+ },
+ groupRunnersCount: {
+ ...runnersCountSmartQuery,
+ variables() {
+ return {
+ ...this.countVariables,
+ type: GROUP_TYPE,
+ };
+ },
+ },
+ projectRunnersCount: {
+ ...runnersCountSmartQuery,
+ variables() {
+ return {
+ ...this.countVariables,
+ type: PROJECT_TYPE,
+ };
+ },
+ },
},
computed: {
variables() {
return fromSearchToVariables(this.search);
},
+ countVariables() {
+ // Exclude pagination variables, leave only filters variables
+ const { sort, before, last, after, first, ...countVariables } = this.variables;
+ return countVariables;
+ },
runnersLoading() {
return this.$apollo.queries.runners.loading;
},
@@ -125,7 +159,7 @@ export default {
search: {
deep: true,
handler() {
- // TODO Implement back button reponse using onpopstate
+ // TODO Implement back button response using onpopstate
updateHistory({
url: fromSearchToUrl(this.search),
title: document.title,
@@ -174,7 +208,7 @@ export default {
>
<template #title="{ tab }">
{{ tab.title }}
- <gl-badge v-if="tabCount(tab)" class="gl-ml-1" size="sm">
+ <gl-badge v-if="typeof tabCount(tab) == 'number'" class="gl-ml-1" size="sm">
{{ tabCount(tab) }}
</gl-badge>
</template>
diff --git a/app/assets/javascripts/runner/admin_runners/index.js b/app/assets/javascripts/runner/admin_runners/index.js
index 1fdbf7542c5..5ca87aa7a68 100644
--- a/app/assets/javascripts/runner/admin_runners/index.js
+++ b/app/assets/javascripts/runner/admin_runners/index.js
@@ -27,16 +27,7 @@ export const initAdminRunners = (selector = '#js-admin-runners') => {
// TODO `activeRunnersCount` should be implemented using a GraphQL API
// https://gitlab.com/gitlab-org/gitlab/-/issues/333806
- const {
- runnerInstallHelpPage,
- registrationToken,
-
- activeRunnersCount,
- allRunnersCount,
- instanceRunnersCount,
- groupRunnersCount,
- projectRunnersCount,
- } = el.dataset;
+ const { runnerInstallHelpPage, registrationToken, activeRunnersCount } = el.dataset;
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
@@ -53,13 +44,9 @@ export const initAdminRunners = (selector = '#js-admin-runners') => {
props: {
registrationToken,
- // All runner counts are returned as formatted
+ // Runner counts are returned as formatted
// strings, we do not use `parseInt`.
activeRunnersCount,
- allRunnersCount,
- instanceRunnersCount,
- groupRunnersCount,
- projectRunnersCount,
},
});
},
diff --git a/app/assets/javascripts/runner/graphql/get_runners_count.query.graphql b/app/assets/javascripts/runner/graphql/get_runners_count.query.graphql
new file mode 100644
index 00000000000..181a4495cae
--- /dev/null
+++ b/app/assets/javascripts/runner/graphql/get_runners_count.query.graphql
@@ -0,0 +1,10 @@
+query getRunnersCount(
+ $status: CiRunnerStatus
+ $type: CiRunnerType
+ $tagList: [String!]
+ $search: String
+) {
+ runners(status: $status, type: $type, tagList: $tagList, search: $search) {
+ count
+ }
+}
diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue
index 3ff87ba3c4f..9bf54e98cc4 100644
--- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue
+++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_tabs.vue
@@ -1,5 +1,6 @@
<script>
import { GlTabs, GlTab, GlBadge } from '@gitlab/ui';
+import { formatNumber } from '~/locale';
export default {
components: {
@@ -29,6 +30,9 @@ export default {
isTabCountNumeric(tab) {
return Number.isInteger(this.tabCounts[tab.name]);
},
+ formatNumber(count) {
+ return formatNumber(count);
+ },
},
};
</script>
@@ -55,7 +59,7 @@ export default {
size="sm"
class="gl-tab-counter-badge"
>
- {{ tabCounts[tab.name] }}
+ {{ formatNumber(tabCounts[tab.name]) }}
</gl-badge>
</template>
</gl-tab>
diff --git a/app/helpers/ci/runners_helper.rb b/app/helpers/ci/runners_helper.rb
index ab2b4fe5a23..fb75a3e15d6 100644
--- a/app/helpers/ci/runners_helper.rb
+++ b/app/helpers/ci/runners_helper.rb
@@ -67,12 +67,8 @@ module Ci
runner_install_help_page: 'https://docs.gitlab.com/runner/install/',
registration_token: Gitlab::CurrentSettings.runners_registration_token,
- # All runner counts are returned as formatted strings
- active_runners_count: Ci::Runner.online.count.to_s,
- all_runners_count: limited_counter_with_delimiter(Ci::Runner),
- instance_runners_count: limited_counter_with_delimiter(Ci::Runner.instance_type),
- group_runners_count: limited_counter_with_delimiter(Ci::Runner.group_type),
- project_runners_count: limited_counter_with_delimiter(Ci::Runner.project_type)
+ # Runner counts are returned as formatted strings
+ active_runners_count: Ci::Runner.online.count.to_s
}
end
diff --git a/app/models/customer_relations/contact.rb b/app/models/customer_relations/contact.rb
index 01ed620baf9..168f1c48a6c 100644
--- a/app/models/customer_relations/contact.rb
+++ b/app/models/customer_relations/contact.rb
@@ -26,10 +26,10 @@ class CustomerRelations::Contact < ApplicationRecord
validate :validate_email_format
validate :unique_email_for_group_hierarchy
- def self.find_ids_by_emails(group_id, emails)
+ def self.find_ids_by_emails(group, emails)
raise ArgumentError, "Cannot lookup more than #{MAX_PLUCK} emails" if emails.length > MAX_PLUCK
- where(group_id: group_id, email: emails)
+ where(group_id: group.self_and_ancestor_ids, email: emails)
.pluck(:id)
end
diff --git a/app/models/customer_relations/issue_contact.rb b/app/models/customer_relations/issue_contact.rb
index 78f662b6a58..89dac6bad22 100644
--- a/app/models/customer_relations/issue_contact.rb
+++ b/app/models/customer_relations/issue_contact.rb
@@ -6,7 +6,7 @@ class CustomerRelations::IssueContact < ApplicationRecord
belongs_to :issue, optional: false, inverse_of: :customer_relations_contacts
belongs_to :contact, optional: false, inverse_of: :issue_contacts
- validate :contact_belongs_to_issue_group
+ validate :contact_belongs_to_issue_group_or_ancestor
def self.find_contact_ids_by_emails(issue_id, emails)
raise ArgumentError, "Cannot lookup more than #{MAX_PLUCK} emails" if emails.length > MAX_PLUCK
@@ -18,11 +18,11 @@ class CustomerRelations::IssueContact < ApplicationRecord
private
- def contact_belongs_to_issue_group
+ def contact_belongs_to_issue_group_or_ancestor
return unless contact&.group_id
return unless issue&.project&.namespace_id
- return if contact.group_id == issue.project.namespace_id
+ return if issue.project.group&.self_and_ancestor_ids&.include?(contact.group_id)
- errors.add(:base, _('The contact does not belong to the same group as the issue'))
+ errors.add(:base, _('The contact does not belong to the issue group or an ancestor'))
end
end
diff --git a/app/services/issues/set_crm_contacts_service.rb b/app/services/issues/set_crm_contacts_service.rb
index c435ab81b4d..947d46f0809 100644
--- a/app/services/issues/set_crm_contacts_service.rb
+++ b/app/services/issues/set_crm_contacts_service.rb
@@ -48,7 +48,7 @@ module Issues
end
def add_by_email
- contact_ids = ::CustomerRelations::Contact.find_ids_by_emails(project_group.id, params[:add_emails])
+ contact_ids = ::CustomerRelations::Contact.find_ids_by_emails(project_group, params[:add_emails])
add_by_id(contact_ids)
end
diff --git a/app/services/projects/overwrite_project_service.rb b/app/services/projects/overwrite_project_service.rb
index 2612001eb95..c58fba33b2a 100644
--- a/app/services/projects/overwrite_project_service.rb
+++ b/app/services/projects/overwrite_project_service.rb
@@ -11,7 +11,9 @@ module Projects
move_before_destroy_relationships(source_project)
# Reset is required in order to get the proper
# uncached fork network method calls value.
- destroy_old_project(source_project.reset)
+ ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/340256') do
+ destroy_old_project(source_project.reset)
+ end
rename_project(source_project.name, source_project.path)
@project
diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml
index 9ecd184e2a3..f5e61c010cc 100644
--- a/app/views/projects/branches/_branch.html.haml
+++ b/app/views/projects/branches/_branch.html.haml
@@ -45,38 +45,4 @@
= render 'projects/buttons/download', project: @project, ref: branch.name, pipeline: @refs_pipelines[branch.name], class: 'gl-vertical-align-top'
- - if Feature.enabled?(:delete_branch_confirmation_modals, @project, default_enabled: :yaml)
- = render 'projects/branches/delete_branch_modal_button', project: @project, branch: branch, merged: merged
-
- - elsif can?(current_user, :push_code, @project)
- - if branch.name == @project.repository.root_ref
- - delete_default_branch_tooltip = s_('Branches|The default branch cannot be deleted')
- %span.gl-display-inline-block.has-tooltip{ title: delete_default_branch_tooltip }
- %button{ class: 'gl-button btn btn-default btn-icon disabled', disabled: true, 'aria-label' => delete_default_branch_tooltip }
- = sprite_icon('remove', css_class: 'gl-button-icon gl-icon')
- - elsif protected_branch?(@project, branch)
- - if can?(current_user, :push_to_delete_protected_branch, @project)
- - delete_protected_branch_tooltip = s_('Branches|Delete protected branch')
- %button{ class: 'gl-button btn btn-default btn-icon has-tooltip',
- title: delete_protected_branch_tooltip,
- 'aria-label' => delete_protected_branch_tooltip,
- data: { toggle: 'modal',
- target: '#modal-delete-branch',
- delete_path: project_branch_path(@project, branch.name),
- branch_name: branch.name,
- is_merged: ('true' if merged) } }
- = sprite_icon('remove', css_class: 'gl-button-icon gl-icon')
- - else
- - delete_protected_branch_disabled_tooltip = s_('Branches|Only a project maintainer or owner can delete a protected branch')
- %span.has-tooltip{ title: delete_protected_branch_disabled_tooltip }
- %button{ class: 'gl-button btn btn-default btn-icon disabled', disabled: true, 'aria-label' => delete_protected_branch_disabled_tooltip, data: { testid: 'remove-protected-branch' } }
- = sprite_icon('remove', css_class: 'gl-button-icon gl-icon')
- - else
- = link_to project_branch_path(@project, branch.name),
- class: 'gl-button btn btn-default btn-icon js-remove-row qa-remove-btn js-ajax-loading-spinner has-tooltip',
- title: s_('Branches|Delete branch'),
- method: :delete,
- data: { confirm: s_("Branches|Deleting the '%{branch_name}' branch cannot be undone. Are you sure?") % { branch_name: branch.name } },
- remote: true,
- 'aria-label' => s_('Branches|Delete branch') do
- = sprite_icon('remove', css_class: 'gl-button-icon gl-icon')
+ = render 'projects/branches/delete_branch_modal_button', project: @project, branch: branch, merged: merged
diff --git a/app/views/projects/branches/_delete_protected_modal.html.haml b/app/views/projects/branches/_delete_protected_modal.html.haml
deleted file mode 100644
index 2b45b4eddcc..00000000000
--- a/app/views/projects/branches/_delete_protected_modal.html.haml
+++ /dev/null
@@ -1,42 +0,0 @@
-#modal-delete-branch.modal{ tabindex: -1 }
- .modal-dialog
- .modal-content
- .modal-header
- %h3.page-title
- - title_branch_name = capture do
- %span.js-branch-name.ref-name>[branch name]
- = s_("Branches|Delete protected branch '%{branch_name}'?").html_safe % { branch_name: title_branch_name }
- %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') }
- %span{ "aria-hidden": "true" } &times;
-
- .modal-body
- %p
- - branch_name = capture do
- %strong.js-branch-name.ref-name>[branch name]
- = s_('Branches|You’re about to permanently delete the protected branch %{branch_name}.').html_safe % { branch_name: branch_name }
- %p.js-not-merged
- - default_branch = capture do
- %span.ref-name= @repository.root_ref
- = s_('Branches|This branch hasn’t been merged into %{default_branch}.').html_safe % { default_branch: default_branch }
- = s_('Branches|To avoid data loss, consider merging this branch before deleting it.')
- %p
- - delete_protected_branch = capture do
- %strong
- = s_('Branches|Delete protected branch')
- = s_('Branches|Once you confirm and press %{delete_protected_branch}, it cannot be undone or recovered.').html_safe % { delete_protected_branch: delete_protected_branch }
- %p
- - branch_name_confirmation = capture do
- %kbd.js-branch-name [branch name]
- %strong
- = s_('Branches|To confirm, type %{branch_name_confirmation}:').html_safe % { branch_name_confirmation: branch_name_confirmation }
-
- .form-group
- = text_field_tag 'delete_branch_input', '', class: 'form-control js-delete-branch-input'
-
- .modal-footer
- %button.gl-button.btn.btn-default{ data: { dismiss: 'modal' } } Cancel
- = link_to s_('Branches|Delete protected branch'), '',
- class: "gl-button btn btn-danger js-delete-branch",
- title: s_('Branches|Delete branch'),
- method: :delete,
- 'aria-label' => s_('Branches|Delete branch')
diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml
index 1c543d47ecf..2121d15643c 100644
--- a/app/views/projects/branches/index.html.haml
+++ b/app/views/projects/branches/index.html.haml
@@ -50,7 +50,5 @@
.nothing-here-block
= s_('Branches|No branches to show')
-- if Feature.enabled?(:delete_branch_confirmation_modals, @project, default_enabled: :yaml) && can?(current_user, :push_code, @project)
+- if can?(current_user, :push_code, @project)
.js-delete-branch-modal
-- elsif can?(current_user, :push_code, @project)
- = render 'projects/branches/delete_protected_modal'
diff --git a/config/feature_flags/development/delete_branch_confirmation_modals.yml b/config/feature_flags/development/delete_branch_confirmation_modals.yml
deleted file mode 100644
index 9959d8fe8e2..00000000000
--- a/config/feature_flags/development/delete_branch_confirmation_modals.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: delete_branch_confirmation_modals
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56782
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/329052
-milestone: '14.3'
-type: development
-group: group::expansion
-default_enabled: true
diff --git a/db/init_structure.sql b/db/init_structure.sql
index d3f576a7b89..913b495b6fd 100644
--- a/db/init_structure.sql
+++ b/db/init_structure.sql
@@ -10,6 +10,37 @@ CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
+CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE projects SET has_external_issue_tracker = (
+ EXISTS
+ (
+ SELECT 1
+ FROM services
+ 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;
+
+END
+$$;
+
+CREATE FUNCTION set_has_external_wiki() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE)
+WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
+RETURN NULL;
+
+END
+$$;
+
CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -63,24 +94,6 @@ $$;
COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration: table sync for audit_events table';
-CREATE TABLE audit_events (
- id bigint 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_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
- CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
-)
-PARTITION BY RANGE (created_at);
-
CREATE TABLE product_analytics_events_experimental (
id bigint NOT NULL,
project_id integer NOT NULL,
@@ -8836,6 +8849,8 @@ CREATE TABLE alert_management_http_integrations (
encrypted_token_iv text NOT NULL,
endpoint_identifier text NOT NULL,
name text NOT NULL,
+ payload_example jsonb DEFAULT '{}'::jsonb NOT NULL,
+ payload_attribute_mapping jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT check_286943b636 CHECK ((char_length(encrypted_token_iv) <= 255)),
CONSTRAINT check_392143ccf4 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_e270820180 CHECK ((char_length(endpoint_identifier) <= 255)),
@@ -8851,24 +8866,6 @@ CREATE SEQUENCE alert_management_http_integrations_id_seq
ALTER SEQUENCE alert_management_http_integrations_id_seq OWNED BY alert_management_http_integrations.id;
-CREATE TABLE alerts_service_data (
- id bigint NOT NULL,
- service_id integer NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- encrypted_token character varying(255),
- encrypted_token_iv character varying(255)
-);
-
-CREATE SEQUENCE alerts_service_data_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE alerts_service_data_id_seq OWNED BY alerts_service_data.id;
-
CREATE TABLE allowed_email_domains (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -8974,10 +8971,11 @@ ALTER SEQUENCE analytics_devops_adoption_segment_selections_id_seq OWNED BY anal
CREATE TABLE analytics_devops_adoption_segments (
id bigint NOT NULL,
- name text NOT NULL,
+ name text,
last_recorded_at timestamp with time zone,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
+ namespace_id integer,
CONSTRAINT check_4be7a006fd CHECK ((char_length(name) <= 255))
);
@@ -9000,7 +8998,8 @@ CREATE TABLE analytics_devops_adoption_snapshots (
runner_configured boolean NOT NULL,
pipeline_succeeded boolean NOT NULL,
deploy_succeeded boolean NOT NULL,
- security_scan_succeeded boolean NOT NULL
+ security_scan_succeeded boolean NOT NULL,
+ end_time timestamp with time zone NOT NULL
);
CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq
@@ -9216,7 +9215,6 @@ CREATE TABLE application_settings (
local_markdown_version integer DEFAULT 0 NOT NULL,
asset_proxy_enabled boolean DEFAULT false NOT NULL,
asset_proxy_url character varying,
- asset_proxy_whitelist text,
encrypted_asset_proxy_secret_key text,
encrypted_asset_proxy_secret_key_iv character varying,
lets_encrypt_notification_email character varying,
@@ -9327,7 +9325,7 @@ CREATE TABLE application_settings (
spam_check_endpoint_enabled boolean DEFAULT false NOT NULL,
elasticsearch_pause_indexing boolean DEFAULT false NOT NULL,
repository_storages_weighted jsonb DEFAULT '{}'::jsonb NOT NULL,
- max_import_size integer DEFAULT 50 NOT NULL,
+ max_import_size integer DEFAULT 0 NOT NULL,
enforce_pat_expiration boolean DEFAULT true NOT NULL,
compliance_frameworks smallint[] DEFAULT '{}'::smallint[] NOT NULL,
notify_on_unknown_sign_in boolean DEFAULT true NOT NULL,
@@ -9375,12 +9373,24 @@ CREATE TABLE application_settings (
personal_access_token_prefix text,
kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL,
disable_feed_token boolean DEFAULT false NOT NULL,
+ container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 NOT NULL,
+ invisible_captcha_enabled boolean DEFAULT false NOT NULL,
+ rate_limiting_response_text text,
+ keep_latest_artifact boolean DEFAULT true NOT NULL,
+ enforce_ssh_key_expiration boolean DEFAULT false NOT NULL,
+ git_two_factor_session_expiry integer DEFAULT 15 NOT NULL,
+ notes_create_limit integer DEFAULT 300 NOT NULL,
+ notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL,
+ in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL,
+ asset_proxy_whitelist text,
+ CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)),
CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)),
CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)),
CONSTRAINT check_57123c9593 CHECK ((char_length(help_page_documentation_base_url) <= 255)),
CONSTRAINT check_718b4458ae CHECK ((char_length(personal_access_token_prefix) <= 20)),
+ CONSTRAINT check_7227fad848 CHECK ((char_length(rate_limiting_response_text) <= 255)),
CONSTRAINT check_85a39b68ff CHECK ((char_length(encrypted_ci_jwt_signing_key_iv) <= 255)),
CONSTRAINT check_9a719834eb CHECK ((char_length(secret_detection_token_revocation_url) <= 255)),
CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)),
@@ -9621,6 +9631,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 (
+ id bigint 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_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255))
+)
+PARTITION BY RANGE (created_at);
+
CREATE TABLE audit_events_archived (
id integer NOT NULL,
author_id integer NOT NULL,
@@ -9720,23 +9748,6 @@ CREATE SEQUENCE background_migration_jobs_id_seq
ALTER SEQUENCE background_migration_jobs_id_seq OWNED BY background_migration_jobs.id;
-CREATE TABLE backup_labels (
- id integer NOT NULL,
- title character varying,
- color character varying,
- project_id integer,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
- template boolean DEFAULT false,
- description character varying,
- description_html text,
- type character varying,
- group_id integer,
- cached_markdown_version integer,
- restore_action integer,
- new_title character varying
-);
-
CREATE TABLE badges (
id integer NOT NULL,
link_url character varying NOT NULL,
@@ -9759,6 +9770,64 @@ CREATE SEQUENCE badges_id_seq
ALTER SEQUENCE badges_id_seq OWNED BY badges.id;
+CREATE TABLE batched_background_migration_jobs (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ started_at timestamp with time zone,
+ finished_at timestamp with time zone,
+ batched_background_migration_id bigint NOT NULL,
+ min_value bigint NOT NULL,
+ max_value bigint NOT NULL,
+ batch_size integer NOT NULL,
+ sub_batch_size integer NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ attempts smallint DEFAULT 0 NOT NULL
+);
+
+CREATE SEQUENCE batched_background_migration_jobs_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE batched_background_migration_jobs_id_seq OWNED BY batched_background_migration_jobs.id;
+
+CREATE TABLE batched_background_migrations (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ min_value bigint DEFAULT 1 NOT NULL,
+ max_value bigint NOT NULL,
+ batch_size integer NOT NULL,
+ sub_batch_size integer NOT NULL,
+ "interval" smallint NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ job_class_name text NOT NULL,
+ batch_class_name text DEFAULT 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy'::text NOT NULL,
+ table_name text NOT NULL,
+ column_name text NOT NULL,
+ job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL,
+ CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)),
+ CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)),
+ CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)),
+ CONSTRAINT check_e6c75b1e29 CHECK ((char_length(job_class_name) <= 100)),
+ CONSTRAINT check_fe10674721 CHECK ((char_length(batch_class_name) <= 100)),
+ CONSTRAINT check_max_value_in_range CHECK ((max_value >= min_value)),
+ CONSTRAINT check_positive_min_value CHECK ((min_value > 0)),
+ CONSTRAINT check_positive_sub_batch_size CHECK ((sub_batch_size > 0))
+);
+
+CREATE SEQUENCE batched_background_migrations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE batched_background_migrations_id_seq OWNED BY batched_background_migrations.id;
+
CREATE TABLE board_assignees (
id integer NOT NULL,
board_id integer NOT NULL,
@@ -9912,6 +9981,44 @@ CREATE SEQUENCE boards_epic_boards_id_seq
ALTER SEQUENCE boards_epic_boards_id_seq OWNED BY boards_epic_boards.id;
+CREATE TABLE boards_epic_list_user_preferences (
+ id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ epic_list_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ collapsed boolean DEFAULT false NOT NULL
+);
+
+CREATE SEQUENCE boards_epic_list_user_preferences_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE boards_epic_list_user_preferences_id_seq OWNED BY boards_epic_list_user_preferences.id;
+
+CREATE TABLE boards_epic_lists (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ epic_board_id bigint NOT NULL,
+ label_id bigint,
+ "position" integer,
+ list_type smallint DEFAULT 1 NOT NULL,
+ CONSTRAINT boards_epic_lists_position_constraint CHECK (((list_type <> 1) OR (("position" IS NOT NULL) AND ("position" >= 0))))
+);
+
+CREATE SEQUENCE boards_epic_lists_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE boards_epic_lists_id_seq OWNED BY boards_epic_lists.id;
+
CREATE TABLE boards_epic_user_preferences (
id bigint NOT NULL,
board_id bigint NOT NULL,
@@ -10022,8 +10129,10 @@ CREATE TABLE bulk_import_failures (
exception_class text NOT NULL,
exception_message text NOT NULL,
correlation_id_value text,
+ pipeline_step text,
CONSTRAINT check_053d65c7a4 CHECK ((char_length(pipeline_class) <= 255)),
CONSTRAINT check_6eca8f972e CHECK ((char_length(exception_message) <= 255)),
+ CONSTRAINT check_721a422375 CHECK ((char_length(pipeline_step) <= 255)),
CONSTRAINT check_c7dba8398e CHECK ((char_length(exception_class) <= 255)),
CONSTRAINT check_e787285882 CHECK ((char_length(correlation_id_value) <= 255))
);
@@ -10121,7 +10230,8 @@ CREATE TABLE ci_build_needs (
id integer NOT NULL,
build_id integer NOT NULL,
name text NOT NULL,
- artifacts boolean DEFAULT true NOT NULL
+ artifacts boolean DEFAULT true NOT NULL,
+ optional boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE ci_build_needs_id_seq
@@ -10225,7 +10335,6 @@ CREATE TABLE ci_builds (
runner_id integer,
coverage double precision,
commit_id integer,
- commands text,
name character varying,
options text,
allow_failure boolean DEFAULT false NOT NULL,
@@ -10238,14 +10347,11 @@ CREATE TABLE ci_builds (
type character varying,
target_url character varying,
description character varying,
- artifacts_file text,
project_id integer,
- artifacts_metadata text,
erased_by_id integer,
erased_at timestamp without time zone,
artifacts_expire_at timestamp without time zone,
environment character varying,
- artifacts_size bigint,
"when" character varying,
yaml_variables text,
queued_at timestamp without time zone,
@@ -10255,8 +10361,6 @@ CREATE TABLE ci_builds (
auto_canceled_by_id integer,
retried boolean,
stage_id integer,
- artifacts_file_store integer,
- artifacts_metadata_store integer,
protected boolean,
failure_reason integer,
scheduled_at timestamp with time zone,
@@ -10328,7 +10432,8 @@ CREATE TABLE ci_daily_build_group_report_results (
ref_path text NOT NULL,
group_name text NOT NULL,
data jsonb NOT NULL,
- default_branch boolean DEFAULT false NOT NULL
+ default_branch boolean DEFAULT false NOT NULL,
+ group_id bigint
);
CREATE SEQUENCE ci_daily_build_group_report_results_id_seq
@@ -10392,7 +10497,8 @@ CREATE TABLE ci_group_variables (
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
masked boolean DEFAULT false NOT NULL,
- variable_type smallint DEFAULT 1 NOT NULL
+ variable_type smallint DEFAULT 1 NOT NULL,
+ environment_scope text DEFAULT '*'::text NOT NULL
);
CREATE SEQUENCE ci_group_variables_id_seq
@@ -10473,6 +10579,24 @@ CREATE SEQUENCE ci_job_variables_id_seq
ALTER SEQUENCE ci_job_variables_id_seq OWNED BY ci_job_variables.id;
+CREATE TABLE ci_namespace_monthly_usages (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ date date NOT NULL,
+ additional_amount_available integer DEFAULT 0 NOT NULL,
+ amount_used numeric(18,2) DEFAULT 0.0 NOT NULL,
+ CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
+);
+
+CREATE SEQUENCE ci_namespace_monthly_usages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_namespace_monthly_usages_id_seq OWNED BY ci_namespace_monthly_usages.id;
+
CREATE TABLE ci_pipeline_artifacts (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -10673,6 +10797,23 @@ CREATE SEQUENCE ci_platform_metrics_id_seq
ALTER SEQUENCE ci_platform_metrics_id_seq OWNED BY ci_platform_metrics.id;
+CREATE TABLE ci_project_monthly_usages (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ date date NOT NULL,
+ amount_used numeric(18,2) DEFAULT 0.0 NOT NULL,
+ CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
+);
+
+CREATE SEQUENCE ci_project_monthly_usages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_project_monthly_usages_id_seq OWNED BY ci_project_monthly_usages.id;
+
CREATE TABLE ci_refs (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -10766,7 +10907,6 @@ CREATE TABLE ci_runners (
description character varying,
contacted_at timestamp without time zone,
active boolean DEFAULT true NOT NULL,
- is_shared boolean DEFAULT false,
name character varying,
version character varying,
revision character varying,
@@ -10966,6 +11106,11 @@ CREATE TABLE cluster_agent_tokens (
updated_at timestamp with time zone NOT NULL,
agent_id bigint NOT NULL,
token_encrypted text NOT NULL,
+ created_by_user_id bigint,
+ description text,
+ name text,
+ CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)),
CONSTRAINT check_c60daed227 CHECK ((char_length(token_encrypted) <= 255))
);
@@ -10984,6 +11129,7 @@ CREATE TABLE cluster_agents (
updated_at timestamp with time zone NOT NULL,
project_id bigint NOT NULL,
name text NOT NULL,
+ created_by_user_id bigint,
CONSTRAINT check_3498369510 CHECK ((char_length(name) <= 255))
);
@@ -11134,7 +11280,7 @@ CREATE TABLE clusters (
cleanup_status smallint DEFAULT 1 NOT NULL,
cleanup_status_reason text,
management_project_id integer,
- helm_major_version integer DEFAULT 2 NOT NULL
+ helm_major_version integer DEFAULT 3 NOT NULL
);
CREATE TABLE clusters_applications_cert_managers (
@@ -11433,15 +11579,16 @@ ALTER SEQUENCE commit_user_mentions_id_seq OWNED BY commit_user_mentions.id;
CREATE TABLE compliance_management_frameworks (
id bigint NOT NULL,
- group_id bigint,
name text NOT NULL,
description text NOT NULL,
color text NOT NULL,
namespace_id integer NOT NULL,
regulated boolean DEFAULT true NOT NULL,
+ pipeline_configuration_full_path text,
CONSTRAINT check_08cd34b2c2 CHECK ((char_length(color) <= 10)),
CONSTRAINT check_1617e0b87e CHECK ((char_length(description) <= 255)),
- CONSTRAINT check_ab00bc2193 CHECK ((char_length(name) <= 255))
+ CONSTRAINT check_ab00bc2193 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_e7a9972435 CHECK ((char_length(pipeline_configuration_full_path) <= 255))
);
CREATE SEQUENCE compliance_management_frameworks_id_seq
@@ -11475,7 +11622,8 @@ CREATE TABLE container_repositories (
updated_at timestamp without time zone NOT NULL,
status smallint,
expiration_policy_started_at timestamp with time zone,
- expiration_policy_cleanup_status smallint DEFAULT 0 NOT NULL
+ expiration_policy_cleanup_status smallint DEFAULT 0 NOT NULL,
+ expiration_policy_completed_at timestamp with time zone
);
CREATE SEQUENCE container_repositories_id_seq
@@ -11559,6 +11707,7 @@ CREATE TABLE custom_emoji (
name text NOT NULL,
file text NOT NULL,
external boolean DEFAULT true NOT NULL,
+ creator_id bigint NOT NULL,
CONSTRAINT check_8c586dd507 CHECK ((char_length(name) <= 36)),
CONSTRAINT check_dd5d60f1fb CHECK ((char_length(file) <= 255))
);
@@ -11572,6 +11721,32 @@ CREATE SEQUENCE custom_emoji_id_seq
ALTER SEQUENCE custom_emoji_id_seq OWNED BY custom_emoji.id;
+CREATE TABLE dast_profiles (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ dast_site_profile_id bigint NOT NULL,
+ dast_scanner_profile_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ description text NOT NULL,
+ branch_name text,
+ CONSTRAINT check_5fcf73bf61 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_6c9d775949 CHECK ((char_length(branch_name) <= 255)),
+ CONSTRAINT check_c34e505c24 CHECK ((char_length(description) <= 255))
+);
+
+COMMENT ON TABLE dast_profiles IS '{"owner":"group::dynamic analysis","description":"Profile used to run a DAST on-demand scan"}';
+
+CREATE SEQUENCE dast_profiles_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dast_profiles_id_seq OWNED BY dast_profiles.id;
+
CREATE TABLE dast_scanner_profiles (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -11730,7 +11905,9 @@ CREATE TABLE dependency_proxy_manifests (
file_name text NOT NULL,
file text NOT NULL,
digest text NOT NULL,
+ content_type text,
CONSTRAINT check_079b293a7b CHECK ((char_length(file) <= 255)),
+ CONSTRAINT check_167a9a8a91 CHECK ((char_length(content_type) <= 255)),
CONSTRAINT check_c579e3f586 CHECK ((char_length(file_name) <= 255)),
CONSTRAINT check_f5d9996bf1 CHECK ((char_length(digest) <= 255))
);
@@ -11947,6 +12124,25 @@ CREATE SEQUENCE diff_note_positions_id_seq
ALTER SEQUENCE diff_note_positions_id_seq OWNED BY diff_note_positions.id;
+CREATE TABLE dora_daily_metrics (
+ id bigint NOT NULL,
+ environment_id bigint NOT NULL,
+ date date NOT NULL,
+ deployment_frequency integer,
+ lead_time_for_changes_in_seconds integer,
+ CONSTRAINT dora_daily_metrics_deployment_frequency_positive CHECK ((deployment_frequency >= 0)),
+ CONSTRAINT dora_daily_metrics_lead_time_for_changes_in_seconds_positive CHECK ((lead_time_for_changes_in_seconds >= 0))
+);
+
+CREATE SEQUENCE dora_daily_metrics_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dora_daily_metrics_id_seq OWNED BY dora_daily_metrics.id;
+
CREATE TABLE draft_notes (
id bigint NOT NULL,
merge_request_id integer NOT NULL,
@@ -11969,6 +12165,32 @@ CREATE SEQUENCE draft_notes_id_seq
ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id;
+CREATE TABLE elastic_reindexing_subtasks (
+ id bigint NOT NULL,
+ elastic_reindexing_task_id bigint NOT NULL,
+ alias_name text NOT NULL,
+ index_name_from text NOT NULL,
+ index_name_to text NOT NULL,
+ elastic_task text NOT NULL,
+ documents_count_target integer,
+ documents_count integer,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_4910adc798 CHECK ((char_length(elastic_task) <= 255)),
+ CONSTRAINT check_88f56216a4 CHECK ((char_length(alias_name) <= 255)),
+ CONSTRAINT check_a1fbd9faa9 CHECK ((char_length(index_name_from) <= 255)),
+ CONSTRAINT check_f456494bd8 CHECK ((char_length(index_name_to) <= 255))
+);
+
+CREATE SEQUENCE elastic_reindexing_subtasks_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE elastic_reindexing_subtasks_id_seq OWNED BY elastic_reindexing_subtasks.id;
+
CREATE TABLE elastic_reindexing_tasks (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12040,7 +12262,9 @@ CREATE TABLE environments (
environment_type character varying,
state character varying DEFAULT 'available'::character varying NOT NULL,
slug character varying NOT NULL,
- auto_stop_at timestamp with time zone
+ auto_stop_at timestamp with time zone,
+ auto_delete_at timestamp with time zone,
+ tier smallint
);
CREATE SEQUENCE environments_id_seq
@@ -12203,6 +12427,8 @@ CREATE TABLE experiment_subjects (
variant smallint DEFAULT 0 NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
+ converted_at timestamp with time zone,
+ context jsonb DEFAULT '{}'::jsonb NOT NULL,
CONSTRAINT chk_has_one_subject CHECK ((num_nonnulls(user_id, group_id, project_id) = 1))
);
@@ -12250,6 +12476,41 @@ CREATE SEQUENCE experiments_id_seq
ALTER SEQUENCE experiments_id_seq OWNED BY experiments.id;
+CREATE TABLE external_approval_rules (
+ 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_1c64b53ea5 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_b634ca168d CHECK ((char_length(external_url) <= 255))
+);
+
+CREATE SEQUENCE external_approval_rules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_approval_rules_id_seq OWNED BY external_approval_rules.id;
+
+CREATE TABLE external_approval_rules_protected_branches (
+ id bigint NOT NULL,
+ external_approval_rule_id bigint NOT NULL,
+ protected_branch_id bigint NOT NULL
+);
+
+CREATE SEQUENCE external_approval_rules_protected_branches_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_approval_rules_protected_branches_id_seq OWNED BY external_approval_rules_protected_branches.id;
+
CREATE TABLE external_pull_requests (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12990,6 +13251,34 @@ CREATE SEQUENCE group_import_states_group_id_seq
ALTER SEQUENCE group_import_states_group_id_seq OWNED BY group_import_states.group_id;
+CREATE TABLE group_merge_request_approval_settings (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ group_id bigint NOT NULL,
+ allow_author_approval boolean DEFAULT false NOT NULL
+);
+
+CREATE TABLE group_repository_storage_moves (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ group_id bigint NOT NULL,
+ state smallint DEFAULT 1 NOT NULL,
+ source_storage_name text NOT NULL,
+ destination_storage_name text NOT NULL,
+ CONSTRAINT group_repository_storage_moves_destination_storage_name CHECK ((char_length(destination_storage_name) <= 255)),
+ CONSTRAINT group_repository_storage_moves_source_storage_name CHECK ((char_length(source_storage_name) <= 255))
+);
+
+CREATE SEQUENCE group_repository_storage_moves_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE group_repository_storage_moves_id_seq OWNED BY group_repository_storage_moves.id;
+
CREATE TABLE group_wiki_repositories (
shard_id bigint NOT NULL,
group_id bigint NOT NULL,
@@ -13085,7 +13374,8 @@ CREATE TABLE incident_management_oncall_participants (
oncall_rotation_id bigint NOT NULL,
user_id bigint NOT NULL,
color_palette smallint NOT NULL,
- color_weight smallint NOT NULL
+ color_weight smallint NOT NULL,
+ is_removed boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE incident_management_oncall_participants_id_seq
@@ -13106,6 +13396,9 @@ CREATE TABLE incident_management_oncall_rotations (
length_unit smallint NOT NULL,
starts_at timestamp with time zone NOT NULL,
name text NOT NULL,
+ active_period_start time without time zone,
+ active_period_end time without time zone,
+ ends_at timestamp with time zone,
CONSTRAINT check_5209fb5d02 CHECK ((char_length(name) <= 200))
);
@@ -13442,6 +13735,30 @@ CREATE TABLE issues_self_managed_prometheus_alert_events (
updated_at timestamp with time zone NOT NULL
);
+CREATE TABLE iterations_cadences (
+ 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,
+ start_date date NOT NULL,
+ last_run_date date,
+ duration_in_weeks integer,
+ iterations_in_advance integer,
+ active boolean DEFAULT true NOT NULL,
+ automatic boolean DEFAULT true NOT NULL,
+ title text NOT NULL,
+ CONSTRAINT check_fedff82d3b CHECK ((char_length(title) <= 255))
+);
+
+CREATE SEQUENCE iterations_cadences_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE iterations_cadences_id_seq OWNED BY iterations_cadences.id;
+
CREATE TABLE jira_connect_installations (
id bigint NOT NULL,
client_key character varying,
@@ -13525,6 +13842,15 @@ CREATE TABLE jira_tracker_data (
deployment_type smallint DEFAULT 0 NOT NULL,
vulnerabilities_issuetype text,
vulnerabilities_enabled boolean DEFAULT false NOT NULL,
+ encrypted_proxy_address text,
+ encrypted_proxy_address_iv text,
+ encrypted_proxy_port text,
+ encrypted_proxy_port_iv text,
+ encrypted_proxy_username text,
+ encrypted_proxy_username_iv text,
+ encrypted_proxy_password text,
+ encrypted_proxy_password_iv text,
+ jira_issue_transition_automatic boolean DEFAULT false NOT NULL,
CONSTRAINT check_0bf84b76e9 CHECK ((char_length(vulnerabilities_issuetype) <= 255)),
CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255))
);
@@ -13874,7 +14200,8 @@ CREATE TABLE merge_request_context_commits (
author_email text,
committer_name text,
committer_email text,
- message text
+ message text,
+ trailers jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE SEQUENCE merge_request_context_commits_id_seq
@@ -13896,7 +14223,8 @@ CREATE TABLE merge_request_diff_commits (
author_email text,
committer_name text,
committer_email text,
- message text
+ message text,
+ trailers jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE TABLE merge_request_diff_details (
@@ -13951,6 +14279,7 @@ CREATE TABLE merge_request_diffs (
stored_externally boolean,
files_count smallint,
sorted boolean DEFAULT false NOT NULL,
+ diff_type smallint DEFAULT 1 NOT NULL,
CONSTRAINT check_93ee616ac9 CHECK ((external_diff_store IS NOT NULL))
);
@@ -14005,7 +14334,8 @@ CREATE TABLE merge_request_reviewers (
id bigint NOT NULL,
user_id bigint NOT NULL,
merge_request_id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL
+ created_at timestamp with time zone NOT NULL,
+ state smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE merge_request_reviewers_id_seq
@@ -14069,7 +14399,7 @@ CREATE TABLE merge_requests (
merge_jid character varying,
discussion_locked boolean,
latest_merge_request_diff_id integer,
- allow_maintainer_to_push boolean,
+ allow_maintainer_to_push boolean DEFAULT true,
squash boolean DEFAULT false NOT NULL,
state_id smallint DEFAULT 1 NOT NULL,
approvals_before_merge integer,
@@ -14201,6 +14531,24 @@ CREATE SEQUENCE milestones_id_seq
ALTER SEQUENCE milestones_id_seq OWNED BY milestones.id;
+CREATE TABLE namespace_admin_notes (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ namespace_id bigint NOT NULL,
+ note text,
+ CONSTRAINT check_e9d2e71b5d CHECK ((char_length(note) <= 1000))
+);
+
+CREATE SEQUENCE namespace_admin_notes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE namespace_admin_notes_id_seq OWNED BY namespace_admin_notes.id;
+
CREATE TABLE namespace_aggregation_schedules (
namespace_id integer NOT NULL
);
@@ -14222,22 +14570,13 @@ CREATE TABLE namespace_limits (
temporary_storage_increase_ends_on date
);
-CREATE TABLE namespace_onboarding_actions (
- id bigint NOT NULL,
+CREATE TABLE namespace_package_settings (
namespace_id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- action smallint NOT NULL
+ maven_duplicates_allowed boolean DEFAULT true NOT NULL,
+ maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL,
+ CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255))
);
-CREATE SEQUENCE namespace_onboarding_actions_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE namespace_onboarding_actions_id_seq OWNED BY namespace_onboarding_actions.id;
-
CREATE TABLE namespace_root_storage_statistics (
namespace_id integer NOT NULL,
updated_at timestamp with time zone NOT NULL,
@@ -14269,6 +14608,8 @@ CREATE TABLE namespace_settings (
prevent_forking_outside_group boolean DEFAULT false NOT NULL,
allow_mfa_for_subgroups boolean DEFAULT true NOT NULL,
default_branch_name text,
+ repository_read_only boolean DEFAULT false NOT NULL,
+ delayed_project_removal boolean DEFAULT false NOT NULL,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255))
);
@@ -14276,7 +14617,9 @@ CREATE TABLE namespace_statistics (
id integer NOT NULL,
namespace_id integer NOT NULL,
shared_runners_seconds integer DEFAULT 0 NOT NULL,
- shared_runners_seconds_last_reset timestamp without time zone
+ shared_runners_seconds_last_reset timestamp without time zone,
+ storage_size bigint DEFAULT 0 NOT NULL,
+ wiki_size bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE namespace_statistics_id_seq
@@ -14440,7 +14783,8 @@ CREATE TABLE notification_settings (
new_release boolean,
fixed_pipeline boolean,
moved_project boolean DEFAULT true NOT NULL,
- change_reviewer_merge_request boolean
+ change_reviewer_merge_request boolean,
+ merge_when_pipeline_succeeds boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE notification_settings_id_seq
@@ -14542,6 +14886,37 @@ CREATE SEQUENCE oauth_openid_requests_id_seq
ALTER SEQUENCE oauth_openid_requests_id_seq OWNED BY oauth_openid_requests.id;
+CREATE TABLE onboarding_progresses (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ git_pull_at timestamp with time zone,
+ git_write_at timestamp with time zone,
+ merge_request_created_at timestamp with time zone,
+ pipeline_created_at timestamp with time zone,
+ user_added_at timestamp with time zone,
+ trial_started_at timestamp with time zone,
+ subscription_created_at timestamp with time zone,
+ required_mr_approvals_enabled_at timestamp with time zone,
+ code_owners_enabled_at timestamp with time zone,
+ scoped_label_created_at timestamp with time zone,
+ security_scan_enabled_at timestamp with time zone,
+ issue_auto_closed_at timestamp with time zone,
+ repository_imported_at timestamp with time zone,
+ repository_mirrored_at timestamp with time zone,
+ issue_created_at timestamp with time zone
+);
+
+CREATE SEQUENCE onboarding_progresses_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE onboarding_progresses_id_seq OWNED BY onboarding_progresses.id;
+
CREATE TABLE open_project_tracker_data (
id bigint NOT NULL,
service_id integer NOT NULL,
@@ -14716,6 +15091,27 @@ CREATE SEQUENCE packages_build_infos_id_seq
ALTER SEQUENCE packages_build_infos_id_seq OWNED BY packages_build_infos.id;
+CREATE TABLE packages_composer_cache_files (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ delete_at timestamp with time zone,
+ namespace_id integer,
+ file_store smallint DEFAULT 1 NOT NULL,
+ file text NOT NULL,
+ file_sha256 bytea NOT NULL,
+ CONSTRAINT check_84f5ba81f5 CHECK ((char_length(file) <= 255))
+);
+
+CREATE SEQUENCE packages_composer_cache_files_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE packages_composer_cache_files_id_seq OWNED BY packages_composer_cache_files.id;
+
CREATE TABLE packages_composer_metadata (
package_id bigint NOT NULL,
target_sha bytea NOT NULL,
@@ -15132,7 +15528,8 @@ CREATE TABLE packages_packages (
name character varying NOT NULL,
version character varying,
package_type smallint NOT NULL,
- creator_id integer
+ creator_id integer,
+ status smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE packages_packages_id_seq
@@ -15151,6 +15548,58 @@ CREATE TABLE packages_pypi_metadata (
CONSTRAINT check_379019d5da CHECK ((char_length(required_python) <= 255))
);
+CREATE TABLE packages_rubygems_metadata (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ package_id bigint NOT NULL,
+ authors text,
+ files text,
+ summary text,
+ description text,
+ email text,
+ homepage text,
+ licenses text,
+ metadata text,
+ author text,
+ bindir text,
+ cert_chain text,
+ executables text,
+ extensions text,
+ extra_rdoc_files text,
+ platform text,
+ post_install_message text,
+ rdoc_options text,
+ require_paths text,
+ required_ruby_version text,
+ required_rubygems_version text,
+ requirements text,
+ rubygems_version text,
+ signing_key text,
+ CONSTRAINT check_0154a18c82 CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_22814c771b CHECK ((char_length(email) <= 255)),
+ CONSTRAINT check_242293030e CHECK ((char_length(extensions) <= 255)),
+ CONSTRAINT check_27619a7922 CHECK ((char_length(rubygems_version) <= 255)),
+ CONSTRAINT check_3d1b6f3a39 CHECK ((char_length(post_install_message) <= 255)),
+ CONSTRAINT check_545f7606f9 CHECK ((char_length(required_rubygems_version) <= 255)),
+ CONSTRAINT check_5988451714 CHECK ((char_length(executables) <= 255)),
+ CONSTRAINT check_5f9c84ea17 CHECK ((char_length(platform) <= 255)),
+ CONSTRAINT check_64f1cecf05 CHECK ((char_length(requirements) <= 255)),
+ CONSTRAINT check_6ac7043c50 CHECK ((char_length(extra_rdoc_files) <= 255)),
+ CONSTRAINT check_6ff3abe325 CHECK ((char_length(cert_chain) <= 255)),
+ CONSTRAINT check_7cb01436df CHECK ((char_length(licenses) <= 255)),
+ CONSTRAINT check_8be21d92e7 CHECK ((char_length(summary) <= 1024)),
+ CONSTRAINT check_946cb96acb CHECK ((char_length(homepage) <= 255)),
+ CONSTRAINT check_9824fc9efc CHECK ((char_length(bindir) <= 255)),
+ CONSTRAINT check_994b68eb64 CHECK ((char_length(authors) <= 255)),
+ CONSTRAINT check_9d42fa48ae CHECK ((char_length(signing_key) <= 255)),
+ CONSTRAINT check_b0f4f8c853 CHECK ((char_length(files) <= 255)),
+ CONSTRAINT check_b7b296b420 CHECK ((char_length(author) <= 255)),
+ CONSTRAINT check_bf16b21a47 CHECK ((char_length(rdoc_options) <= 255)),
+ CONSTRAINT check_ca641a3354 CHECK ((char_length(required_ruby_version) <= 255)),
+ CONSTRAINT check_ea02f4800f CHECK ((char_length(metadata) <= 30000)),
+ CONSTRAINT check_f76bad1a9a CHECK ((char_length(require_paths) <= 255))
+);
+
CREATE TABLE packages_tags (
id bigint NOT NULL,
package_id integer NOT NULL,
@@ -15175,10 +15624,11 @@ CREATE TABLE pages_deployments (
project_id bigint NOT NULL,
ci_build_id bigint,
file_store smallint NOT NULL,
- size integer NOT NULL,
file text NOT NULL,
file_count integer NOT NULL,
file_sha256 bytea NOT NULL,
+ size bigint,
+ CONSTRAINT check_5f9132a958 CHECK ((size IS NOT NULL)),
CONSTRAINT check_f0fe8032dd CHECK ((char_length(file) <= 255))
);
@@ -15366,7 +15816,8 @@ CREATE TABLE plan_limits (
ci_max_artifact_size_api_fuzzing integer DEFAULT 0 NOT NULL,
daily_invites integer DEFAULT 0 NOT NULL,
ci_pipeline_deployments integer DEFAULT 500 NOT NULL,
- pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL
+ pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL,
+ rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL
);
CREATE SEQUENCE plan_limits_id_seq
@@ -15595,6 +16046,7 @@ CREATE TABLE postgres_reindex_actions (
ondisk_size_bytes_end bigint,
state smallint DEFAULT 0 NOT NULL,
index_identifier text NOT NULL,
+ bloat_estimate_bytes_start bigint,
CONSTRAINT check_f12527622c CHECK ((char_length(index_identifier) <= 255))
);
@@ -15686,7 +16138,8 @@ CREATE TABLE project_ci_cd_settings (
forward_deployment_enabled boolean,
merge_trains_enabled boolean DEFAULT false,
auto_rollback_enabled boolean DEFAULT false NOT NULL,
- keep_latest_artifact boolean DEFAULT true NOT NULL
+ keep_latest_artifact boolean DEFAULT true NOT NULL,
+ restrict_user_defined_variables boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -15817,7 +16270,9 @@ CREATE TABLE project_features (
metrics_dashboard_access_level integer,
analytics_access_level integer DEFAULT 20 NOT NULL,
requirements_access_level integer DEFAULT 20 NOT NULL,
- operations_access_level integer DEFAULT 20 NOT NULL
+ operations_access_level integer DEFAULT 20 NOT NULL,
+ security_and_compliance_access_level integer DEFAULT 10 NOT NULL,
+ container_registry_access_level integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE project_features_id_seq
@@ -16013,7 +16468,8 @@ CREATE TABLE project_settings (
squash_option smallint DEFAULT 3,
has_confluence boolean DEFAULT false NOT NULL,
cve_id_request_enabled boolean DEFAULT true NOT NULL,
- has_vulnerabilities boolean DEFAULT false NOT NULL
+ has_vulnerabilities boolean DEFAULT false NOT NULL,
+ prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL
);
CREATE TABLE project_statistics (
@@ -16290,7 +16746,8 @@ CREATE TABLE protected_branches (
name character varying NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- code_owner_approval_required boolean DEFAULT false NOT NULL
+ code_owner_approval_required boolean DEFAULT false NOT NULL,
+ allow_force_push boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE protected_branches_id_seq
@@ -16429,7 +16886,8 @@ CREATE TABLE raw_usage_data (
updated_at timestamp with time zone NOT NULL,
recorded_at timestamp with time zone NOT NULL,
sent_at timestamp with time zone,
- payload jsonb NOT NULL
+ payload jsonb NOT NULL,
+ version_usage_data_id_value bigint
);
CREATE SEQUENCE raw_usage_data_id_seq
@@ -16842,6 +17300,25 @@ CREATE SEQUENCE security_findings_id_seq
ALTER SEQUENCE security_findings_id_seq OWNED BY security_findings.id;
+CREATE TABLE security_orchestration_policy_configurations (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ security_policy_management_project_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}';
+
+CREATE SEQUENCE security_orchestration_policy_configurations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE security_orchestration_policy_configurations_id_seq OWNED BY security_orchestration_policy_configurations.id;
+
CREATE TABLE security_scans (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -17196,6 +17673,7 @@ CREATE TABLE sprints (
description text,
description_html text,
state_enum smallint DEFAULT 1 NOT NULL,
+ iterations_cadence_id integer,
CONSTRAINT sprints_must_belong_to_project_or_group CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))),
CONSTRAINT sprints_title CHECK ((char_length(title) <= 255))
);
@@ -17406,7 +17884,7 @@ CREATE TABLE terraform_states (
locked_at timestamp with time zone,
locked_by_user_id bigint,
uuid character varying(32) NOT NULL,
- name character varying(255),
+ name character varying(255) NOT NULL,
versioning_enabled boolean DEFAULT true NOT NULL
);
@@ -17703,7 +18181,8 @@ CREATE TABLE user_preferences (
tab_width smallint,
experience_level smallint,
view_diffs_file_by_file boolean DEFAULT false NOT NULL,
- gitpod_enabled boolean DEFAULT false NOT NULL
+ gitpod_enabled boolean DEFAULT false NOT NULL,
+ markdown_surround_selection boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE user_preferences_id_seq
@@ -17722,7 +18201,8 @@ CREATE TABLE user_statuses (
emoji character varying DEFAULT 'speech_balloon'::character varying NOT NULL,
message character varying(100),
message_html character varying,
- availability smallint DEFAULT 0 NOT NULL
+ availability smallint DEFAULT 0 NOT NULL,
+ clear_status_at timestamp with time zone
);
CREATE SEQUENCE user_statuses_user_id_seq
@@ -18018,7 +18498,8 @@ CREATE TABLE vulnerability_feedback (
comment_author_id integer,
comment text,
comment_timestamp timestamp with time zone,
- finding_uuid uuid
+ finding_uuid uuid,
+ dismissal_reason smallint
);
CREATE SEQUENCE vulnerability_feedback_id_seq
@@ -18036,7 +18517,7 @@ CREATE TABLE vulnerability_finding_fingerprints (
finding_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- algorithm_type integer NOT NULL,
+ algorithm_type smallint NOT NULL,
fingerprint_sha256 bytea NOT NULL
);
@@ -18201,7 +18682,16 @@ CREATE TABLE vulnerability_occurrences (
metadata_version character varying NOT NULL,
raw_metadata text NOT NULL,
vulnerability_id bigint,
- details jsonb DEFAULT '{}'::jsonb NOT NULL
+ details jsonb DEFAULT '{}'::jsonb NOT NULL,
+ description text,
+ message text,
+ solution text,
+ cve text,
+ location jsonb,
+ CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)),
+ CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)),
+ CONSTRAINT check_df6dd20219 CHECK ((char_length(message) <= 3000)),
+ CONSTRAINT check_f602da68dd CHECK ((char_length(cve) <= 48400))
);
CREATE SEQUENCE vulnerability_occurrences_id_seq
@@ -18352,7 +18842,8 @@ CREATE TABLE web_hooks (
deployment_events boolean DEFAULT false NOT NULL,
feature_flag_events boolean DEFAULT false NOT NULL,
releases_events boolean DEFAULT false NOT NULL,
- member_events boolean DEFAULT false NOT NULL
+ member_events boolean DEFAULT false NOT NULL,
+ subgroup_events boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE web_hooks_id_seq
@@ -18512,8 +19003,6 @@ ALTER TABLE ONLY alert_management_alerts ALTER COLUMN id SET DEFAULT nextval('al
ALTER TABLE ONLY alert_management_http_integrations ALTER COLUMN id SET DEFAULT nextval('alert_management_http_integrations_id_seq'::regclass);
-ALTER TABLE ONLY alerts_service_data ALTER COLUMN id SET DEFAULT nextval('alerts_service_data_id_seq'::regclass);
-
ALTER TABLE ONLY allowed_email_domains ALTER COLUMN id SET DEFAULT nextval('allowed_email_domains_id_seq'::regclass);
ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_group_stages_id_seq'::regclass);
@@ -18570,6 +19059,10 @@ ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('
ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass);
+ALTER TABLE ONLY batched_background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_jobs_id_seq'::regclass);
+
+ALTER TABLE ONLY batched_background_migrations ALTER COLUMN id SET DEFAULT nextval('batched_background_migrations_id_seq'::regclass);
+
ALTER TABLE ONLY board_assignees ALTER COLUMN id SET DEFAULT nextval('board_assignees_id_seq'::regclass);
ALTER TABLE ONLY board_group_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_group_recent_visits_id_seq'::regclass);
@@ -18588,6 +19081,10 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval
ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass);
+ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass);
+
+ALTER TABLE ONLY boards_epic_lists ALTER COLUMN id SET DEFAULT nextval('boards_epic_lists_id_seq'::regclass);
+
ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_user_preferences_id_seq'::regclass);
ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass);
@@ -18636,6 +19133,8 @@ ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_ar
ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_variables_id_seq'::regclass);
+ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass);
+
ALTER TABLE ONLY ci_pipeline_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_artifacts_id_seq'::regclass);
ALTER TABLE ONLY ci_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass);
@@ -18654,6 +19153,8 @@ ALTER TABLE ONLY ci_pipelines_config ALTER COLUMN pipeline_id SET DEFAULT nextva
ALTER TABLE ONLY ci_platform_metrics ALTER COLUMN id SET DEFAULT nextval('ci_platform_metrics_id_seq'::regclass);
+ALTER TABLE ONLY ci_project_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_project_monthly_usages_id_seq'::regclass);
+
ALTER TABLE ONLY ci_refs ALTER COLUMN id SET DEFAULT nextval('ci_refs_id_seq'::regclass);
ALTER TABLE ONLY ci_resource_groups ALTER COLUMN id SET DEFAULT nextval('ci_resource_groups_id_seq'::regclass);
@@ -18736,6 +19237,8 @@ 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 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);
ALTER TABLE ONLY dast_site_profiles ALTER COLUMN id SET DEFAULT nextval('dast_site_profiles_id_seq'::regclass);
@@ -18770,8 +19273,12 @@ ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('desig
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);
+
ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass);
+ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass);
+
ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass);
ALTER TABLE ONLY emails ALTER COLUMN id SET DEFAULT nextval('emails_id_seq'::regclass);
@@ -18796,6 +19303,10 @@ ALTER TABLE ONLY experiment_users ALTER COLUMN id SET DEFAULT nextval('experimen
ALTER TABLE ONLY experiments ALTER COLUMN id SET DEFAULT nextval('experiments_id_seq'::regclass);
+ALTER TABLE ONLY external_approval_rules ALTER COLUMN id SET DEFAULT nextval('external_approval_rules_id_seq'::regclass);
+
+ALTER TABLE ONLY external_approval_rules_protected_branches ALTER COLUMN id SET DEFAULT nextval('external_approval_rules_protected_branches_id_seq'::regclass);
+
ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass);
ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass);
@@ -18866,6 +19377,8 @@ ALTER TABLE ONLY group_group_links ALTER COLUMN id SET DEFAULT nextval('group_gr
ALTER TABLE ONLY group_import_states ALTER COLUMN group_id SET DEFAULT nextval('group_import_states_group_id_seq'::regclass);
+ALTER TABLE ONLY group_repository_storage_moves ALTER COLUMN id SET DEFAULT nextval('group_repository_storage_moves_id_seq'::regclass);
+
ALTER TABLE ONLY historical_data ALTER COLUMN id SET DEFAULT nextval('historical_data_id_seq'::regclass);
ALTER TABLE ONLY identities ALTER COLUMN id SET DEFAULT nextval('identities_id_seq'::regclass);
@@ -18908,6 +19421,8 @@ ALTER TABLE ONLY issue_user_mentions ALTER COLUMN id SET DEFAULT nextval('issue_
ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass);
+ALTER TABLE ONLY iterations_cadences ALTER COLUMN id SET DEFAULT nextval('iterations_cadences_id_seq'::regclass);
+
ALTER TABLE ONLY jira_connect_installations ALTER COLUMN id SET DEFAULT nextval('jira_connect_installations_id_seq'::regclass);
ALTER TABLE ONLY jira_connect_subscriptions ALTER COLUMN id SET DEFAULT nextval('jira_connect_subscriptions_id_seq'::regclass);
@@ -18970,9 +19485,9 @@ ALTER TABLE ONLY metrics_users_starred_dashboards ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY milestones ALTER COLUMN id SET DEFAULT nextval('milestones_id_seq'::regclass);
-ALTER TABLE ONLY namespace_aggregation_schedules ALTER COLUMN namespace_id SET DEFAULT nextval('namespace_aggregation_schedules_namespace_id_seq'::regclass);
+ALTER TABLE ONLY namespace_admin_notes ALTER COLUMN id SET DEFAULT nextval('namespace_admin_notes_id_seq'::regclass);
-ALTER TABLE ONLY namespace_onboarding_actions ALTER COLUMN id SET DEFAULT nextval('namespace_onboarding_actions_id_seq'::regclass);
+ALTER TABLE ONLY namespace_aggregation_schedules ALTER COLUMN namespace_id SET DEFAULT nextval('namespace_aggregation_schedules_namespace_id_seq'::regclass);
ALTER TABLE ONLY namespace_root_storage_statistics ALTER COLUMN namespace_id SET DEFAULT nextval('namespace_root_storage_statistics_namespace_id_seq'::regclass);
@@ -18994,6 +19509,8 @@ ALTER TABLE ONLY oauth_applications ALTER COLUMN id SET DEFAULT nextval('oauth_a
ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oauth_openid_requests_id_seq'::regclass);
+ALTER TABLE ONLY onboarding_progresses ALTER COLUMN id SET DEFAULT nextval('onboarding_progresses_id_seq'::regclass);
+
ALTER TABLE ONLY open_project_tracker_data ALTER COLUMN id SET DEFAULT nextval('open_project_tracker_data_id_seq'::regclass);
ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass);
@@ -19014,6 +19531,8 @@ ALTER TABLE ONLY operations_user_lists ALTER COLUMN id SET DEFAULT nextval('oper
ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass);
+ALTER TABLE ONLY packages_composer_cache_files ALTER COLUMN id SET DEFAULT nextval('packages_composer_cache_files_id_seq'::regclass);
+
ALTER TABLE ONLY packages_conan_file_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_file_metadata_id_seq'::regclass);
ALTER TABLE ONLY packages_conan_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_metadata_id_seq'::regclass);
@@ -19178,6 +19697,8 @@ ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('s
ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security_findings_id_seq'::regclass);
+ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass);
+
ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass);
ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass);
@@ -19528,9 +20049,6 @@ ALTER TABLE ONLY alert_management_alerts
ALTER TABLE ONLY alert_management_http_integrations
ADD CONSTRAINT alert_management_http_integrations_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY alerts_service_data
- ADD CONSTRAINT alerts_service_data_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY allowed_email_domains
ADD CONSTRAINT allowed_email_domains_pkey PRIMARY KEY (id);
@@ -19624,12 +20142,15 @@ ALTER TABLE ONLY aws_roles
ALTER TABLE ONLY background_migration_jobs
ADD CONSTRAINT background_migration_jobs_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY backup_labels
- ADD CONSTRAINT backup_labels_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY badges
ADD CONSTRAINT badges_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY batched_background_migration_jobs
+ ADD CONSTRAINT batched_background_migration_jobs_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY batched_background_migrations
+ ADD CONSTRAINT batched_background_migrations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY board_assignees
ADD CONSTRAINT board_assignees_pkey PRIMARY KEY (id);
@@ -19654,6 +20175,12 @@ ALTER TABLE ONLY boards_epic_board_positions
ALTER TABLE ONLY boards_epic_boards
ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY boards_epic_list_user_preferences
+ ADD CONSTRAINT boards_epic_list_user_preferences_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY boards_epic_lists
+ ADD CONSTRAINT boards_epic_lists_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY boards_epic_user_preferences
ADD CONSTRAINT boards_epic_user_preferences_pkey PRIMARY KEY (id);
@@ -19687,9 +20214,15 @@ ALTER TABLE ONLY chat_teams
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
+ALTER TABLE sprints
+ ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID;
+
ALTER TABLE group_import_states
ADD CONSTRAINT check_cda75c7c3f CHECK ((user_id IS NOT NULL)) NOT VALID;
+ALTER TABLE sprints
+ ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID;
+
ALTER TABLE ONLY ci_build_needs
ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id);
@@ -19738,6 +20271,9 @@ ALTER TABLE ONLY ci_job_artifacts
ALTER TABLE ONLY ci_job_variables
ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_namespace_monthly_usages
+ ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_pipeline_artifacts
ADD CONSTRAINT ci_pipeline_artifacts_pkey PRIMARY KEY (id);
@@ -19765,6 +20301,9 @@ ALTER TABLE ONLY ci_pipelines
ALTER TABLE ONLY ci_platform_metrics
ADD CONSTRAINT ci_platform_metrics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_project_monthly_usages
+ ADD CONSTRAINT ci_project_monthly_usages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_refs
ADD CONSTRAINT ci_refs_pkey PRIMARY KEY (id);
@@ -19891,6 +20430,9 @@ ALTER TABLE ONLY csv_issue_imports
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_profiles
+ ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY dast_scanner_profiles
ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id);
@@ -19948,9 +20490,15 @@ ALTER TABLE ONLY design_user_mentions
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dora_daily_metrics
+ ADD CONSTRAINT dora_daily_metrics_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY draft_notes
ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY elastic_reindexing_subtasks
+ ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY elastic_reindexing_tasks
ADD CONSTRAINT elastic_reindexing_tasks_pkey PRIMARY KEY (id);
@@ -19993,6 +20541,12 @@ ALTER TABLE ONLY experiment_users
ALTER TABLE ONLY experiments
ADD CONSTRAINT experiments_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY external_approval_rules
+ ADD CONSTRAINT external_approval_rules_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY external_approval_rules_protected_branches
+ ADD CONSTRAINT external_approval_rules_protected_branches_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY external_pull_requests
ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id);
@@ -20101,6 +20655,12 @@ ALTER TABLE ONLY group_group_links
ALTER TABLE ONLY group_import_states
ADD CONSTRAINT group_import_states_pkey PRIMARY KEY (group_id);
+ALTER TABLE ONLY group_merge_request_approval_settings
+ ADD CONSTRAINT group_merge_request_approval_settings_pkey PRIMARY KEY (group_id);
+
+ALTER TABLE ONLY group_repository_storage_moves
+ ADD CONSTRAINT group_repository_storage_moves_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY group_wiki_repositories
ADD CONSTRAINT group_wiki_repositories_pkey PRIMARY KEY (group_id);
@@ -20180,11 +20740,14 @@ ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT issues_self_managed_prometheus_alert_events_pkey PRIMARY KEY (issue_id, self_managed_prometheus_alert_event_id);
ALTER TABLE ONLY sprints
- ADD CONSTRAINT iteration_start_and_due_daterange_group_id_constraint EXCLUDE USING gist (group_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL));
+ ADD CONSTRAINT iteration_start_and_due_date_iterations_cadence_id_constraint EXCLUDE USING gist (iterations_cadence_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL));
ALTER TABLE ONLY sprints
ADD CONSTRAINT iteration_start_and_due_daterange_project_id_constraint EXCLUDE USING gist (project_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((project_id IS NOT NULL));
+ALTER TABLE ONLY iterations_cadences
+ ADD CONSTRAINT iterations_cadences_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY jira_connect_installations
ADD CONSTRAINT jira_connect_installations_pkey PRIMARY KEY (id);
@@ -20290,14 +20853,17 @@ ALTER TABLE ONLY milestone_releases
ALTER TABLE ONLY milestones
ADD CONSTRAINT milestones_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY namespace_admin_notes
+ ADD CONSTRAINT namespace_admin_notes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY namespace_aggregation_schedules
ADD CONSTRAINT namespace_aggregation_schedules_pkey PRIMARY KEY (namespace_id);
ALTER TABLE ONLY namespace_limits
ADD CONSTRAINT namespace_limits_pkey PRIMARY KEY (namespace_id);
-ALTER TABLE ONLY namespace_onboarding_actions
- ADD CONSTRAINT namespace_onboarding_actions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY namespace_package_settings
+ ADD CONSTRAINT namespace_package_settings_pkey PRIMARY KEY (namespace_id);
ALTER TABLE ONLY namespace_root_storage_statistics
ADD CONSTRAINT namespace_root_storage_statistics_pkey PRIMARY KEY (namespace_id);
@@ -20332,6 +20898,9 @@ ALTER TABLE ONLY oauth_applications
ALTER TABLE ONLY oauth_openid_requests
ADD CONSTRAINT oauth_openid_requests_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY onboarding_progresses
+ ADD CONSTRAINT onboarding_progresses_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY open_project_tracker_data
ADD CONSTRAINT open_project_tracker_data_pkey PRIMARY KEY (id);
@@ -20362,6 +20931,9 @@ ALTER TABLE ONLY operations_user_lists
ALTER TABLE ONLY packages_build_infos
ADD CONSTRAINT packages_build_infos_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY packages_composer_cache_files
+ ADD CONSTRAINT packages_composer_cache_files_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY packages_composer_metadata
ADD CONSTRAINT packages_composer_metadata_pkey PRIMARY KEY (package_id);
@@ -20431,6 +21003,9 @@ ALTER TABLE ONLY packages_packages
ALTER TABLE ONLY packages_pypi_metadata
ADD CONSTRAINT packages_pypi_metadata_pkey PRIMARY KEY (package_id);
+ALTER TABLE ONLY packages_rubygems_metadata
+ ADD CONSTRAINT packages_rubygems_metadata_pkey PRIMARY KEY (package_id);
+
ALTER TABLE ONLY packages_tags
ADD CONSTRAINT packages_tags_pkey PRIMARY KEY (id);
@@ -20653,6 +21228,9 @@ ALTER TABLE ONLY scim_oauth_access_tokens
ALTER TABLE ONLY security_findings
ADD CONSTRAINT security_findings_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY security_orchestration_policy_configurations
+ ADD CONSTRAINT security_orchestration_policy_configurations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY security_scans
ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id);
@@ -21033,20 +21611,6 @@ CREATE UNIQUE INDEX any_approver_project_rule_type_unique_index ON approval_proj
CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id);
-CREATE UNIQUE INDEX backup_labels_group_id_project_id_title_idx ON backup_labels USING btree (group_id, project_id, title);
-
-CREATE INDEX backup_labels_group_id_title_idx ON backup_labels USING btree (group_id, title) WHERE (project_id = NULL::integer);
-
-CREATE INDEX backup_labels_project_id_idx ON backup_labels USING btree (project_id);
-
-CREATE INDEX backup_labels_project_id_title_idx ON backup_labels USING btree (project_id, title) WHERE (group_id = NULL::integer);
-
-CREATE INDEX backup_labels_template_idx ON backup_labels USING btree (template) WHERE template;
-
-CREATE INDEX backup_labels_title_idx ON backup_labels USING btree (title);
-
-CREATE INDEX backup_labels_type_project_id_idx ON backup_labels USING btree (type, project_id);
-
CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation);
CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
@@ -21055,6 +21619,8 @@ CREATE INDEX code_owner_approval_required ON protected_branches USING btree (pro
CREATE INDEX commit_id_and_note_id_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 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);
@@ -21063,8 +21629,6 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL);
-CREATE INDEX expired_artifacts_temp_index ON ci_job_artifacts USING btree (id, created_at) WHERE ((expire_at IS NULL) AND (created_at < '2020-06-22 02:00:00+02'::timestamp with time zone));
-
CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at);
@@ -21079,6 +21643,8 @@ CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON
CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace);
+CREATE INDEX idx_eaprpb_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (external_approval_rule_id);
+
CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_merge_requests USING btree (environment_id, merge_request_id);
CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id);
@@ -21119,7 +21685,9 @@ CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_c
CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name);
-CREATE INDEX idx_on_issues_where_service_desk_reply_to_is_not_null ON issues USING btree (id) WHERE (service_desk_reply_to IS NOT NULL);
+CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url);
+
+CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_name ON external_approval_rules USING btree (project_id, name);
CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id);
@@ -21149,6 +21717,8 @@ CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_true ON pro
CREATE INDEX idx_projects_on_repository_storage_last_repository_updated_at ON projects USING btree (id, repository_storage, last_repository_updated_at);
+CREATE UNIQUE INDEX idx_protected_branch_id_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (protected_branch_id, external_approval_rule_id);
+
CREATE INDEX idx_repository_states_on_last_repository_verification_ran_at ON project_repository_states USING btree (project_id, last_repository_verification_ran_at) WHERE ((repository_verification_checksum IS NOT NULL) AND (last_repository_verification_failure IS NULL));
CREATE INDEX idx_repository_states_on_last_wiki_verification_ran_at ON project_repository_states USING btree (project_id, last_wiki_verification_ran_at) WHERE ((wiki_verification_checksum IS NOT NULL) AND (last_wiki_verification_failure IS NULL));
@@ -21201,8 +21771,6 @@ CREATE UNIQUE INDEX index_alert_user_mentions_on_alert_id_and_note_id ON alert_m
CREATE UNIQUE INDEX index_alert_user_mentions_on_note_id ON alert_management_alert_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL);
-CREATE INDEX index_alerts_service_data_on_service_id ON alerts_service_data USING btree (service_id);
-
CREATE INDEX index_allowed_email_domains_on_group_id ON allowed_email_domains USING btree (group_id);
CREATE INDEX index_analytics_ca_group_stages_on_end_event_label_id ON analytics_cycle_analytics_group_stages USING btree (end_event_label_id);
@@ -21229,7 +21797,7 @@ CREATE INDEX index_analytics_ca_project_stages_on_start_event_label_id ON analyt
CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true);
-CREATE UNIQUE INDEX index_analytics_devops_adoption_segments_on_name ON analytics_devops_adoption_segments USING btree (name);
+CREATE UNIQUE INDEX index_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id);
CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id);
@@ -21323,6 +21891,10 @@ CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id);
CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id);
+CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id);
+
+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);
@@ -21361,8 +21933,18 @@ CREATE UNIQUE INDEX index_boards_epic_board_positions_on_epic_board_id_and_epic_
CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_positions USING btree (epic_id);
+CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON boards_epic_board_positions USING btree (epic_board_id, epic_id, relative_position);
+
CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id);
+CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id);
+
+CREATE INDEX index_boards_epic_lists_on_epic_board_id ON boards_epic_lists USING btree (epic_board_id);
+
+CREATE UNIQUE INDEX index_boards_epic_lists_on_epic_board_id_and_label_id ON boards_epic_lists USING btree (epic_board_id, label_id) WHERE (list_type = 1);
+
+CREATE INDEX index_boards_epic_lists_on_label_id ON boards_epic_lists USING btree (label_id);
+
CREATE INDEX index_boards_epic_user_preferences_on_board_id ON boards_epic_user_preferences USING btree (board_id);
CREATE UNIQUE INDEX index_boards_epic_user_preferences_on_board_user_epic_unique ON boards_epic_user_preferences USING btree (board_id, user_id, epic_id);
@@ -21421,12 +22003,10 @@ CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id ON ci_builds_metadata U
CREATE INDEX index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts ON ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE);
-CREATE INDEX index_ci_builds_metadata_on_build_id_and_interruptible ON ci_builds_metadata USING btree (build_id) WHERE (interruptible = true);
+CREATE INDEX index_ci_builds_metadata_on_build_id_and_id_and_interruptible ON ci_builds_metadata USING btree (build_id) INCLUDE (id) WHERE (interruptible = true);
CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id);
-CREATE INDEX index_ci_builds_on_artifacts_expire_at ON ci_builds USING btree (artifacts_expire_at) WHERE (artifacts_file <> ''::text);
-
CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id);
CREATE INDEX index_ci_builds_on_commit_id_and_stage_idx_and_created_at ON ci_builds USING btree (commit_id, stage_idx, created_at);
@@ -21471,6 +22051,8 @@ CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_
CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id);
+CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id);
+
CREATE INDEX index_ci_daily_build_group_report_results_on_last_pipeline_id ON ci_daily_build_group_report_results USING btree (last_pipeline_id);
CREATE INDEX index_ci_daily_build_group_report_results_on_project_and_date ON ci_daily_build_group_report_results USING btree (project_id, date DESC) WHERE ((default_branch = true) AND ((data -> 'coverage'::text) IS NOT NULL));
@@ -21479,7 +22061,7 @@ CREATE INDEX index_ci_deleted_objects_on_pick_up_at ON ci_deleted_objects USING
CREATE INDEX index_ci_freeze_periods_on_project_id ON ci_freeze_periods USING btree (project_id);
-CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key ON ci_group_variables USING btree (group_id, key);
+CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment ON ci_group_variables USING btree (group_id, key, environment_scope);
CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key);
@@ -21501,6 +22083,8 @@ CREATE INDEX index_ci_job_variables_on_job_id ON ci_job_variables USING btree (j
CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables USING btree (key, job_id);
+CREATE UNIQUE INDEX index_ci_namespace_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date);
+
CREATE INDEX index_ci_pipeline_artifacts_on_expire_at ON ci_pipeline_artifacts USING btree (expire_at);
CREATE INDEX index_ci_pipeline_artifacts_on_pipeline_id ON ci_pipeline_artifacts USING btree (pipeline_id);
@@ -21537,7 +22121,7 @@ CREATE INDEX index_ci_pipelines_on_external_pull_request_id ON ci_pipelines USIN
CREATE INDEX index_ci_pipelines_on_merge_request_id ON ci_pipelines USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL);
-CREATE INDEX index_ci_pipelines_on_pipeline_schedule_id ON ci_pipelines USING btree (pipeline_schedule_id);
+CREATE INDEX index_ci_pipelines_on_pipeline_schedule_id_and_id ON ci_pipelines USING btree (pipeline_schedule_id, id);
CREATE INDEX index_ci_pipelines_on_project_id_and_id_desc ON ci_pipelines USING btree (project_id, id DESC);
@@ -21565,6 +22149,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_config_source ON c
CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipelines USING btree (user_id, created_at, source);
+CREATE UNIQUE INDEX index_ci_project_monthly_usages_on_project_id_and_date ON ci_project_monthly_usages USING btree (project_id, date);
+
CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_path ON ci_refs USING btree (project_id, ref_path);
CREATE UNIQUE INDEX index_ci_resource_groups_on_project_id_and_key ON ci_resource_groups USING btree (project_id, key);
@@ -21583,8 +22169,6 @@ CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING b
CREATE INDEX index_ci_runners_on_contacted_at ON ci_runners USING btree (contacted_at);
-CREATE INDEX index_ci_runners_on_is_shared ON ci_runners USING btree (is_shared);
-
CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked);
CREATE INDEX index_ci_runners_on_runner_type ON ci_runners USING btree (runner_type);
@@ -21637,8 +22221,12 @@ CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_sco
CREATE INDEX index_cluster_agent_tokens_on_agent_id ON cluster_agent_tokens USING btree (agent_id);
+CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id);
+
CREATE UNIQUE INDEX index_cluster_agent_tokens_on_token_encrypted ON cluster_agent_tokens USING btree (token_encrypted);
+CREATE INDEX index_cluster_agents_on_created_by_user_id ON cluster_agents USING btree (created_by_user_id);
+
CREATE UNIQUE INDEX index_cluster_agents_on_project_id_and_name ON cluster_agents USING btree (project_id, name);
CREATE UNIQUE INDEX index_cluster_groups_on_cluster_id_and_group_id ON cluster_groups USING btree (cluster_id, group_id);
@@ -21705,6 +22293,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_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);
CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id);
@@ -21721,10 +22311,18 @@ CREATE INDEX index_csv_issue_imports_on_project_id ON csv_issue_imports USING bt
CREATE INDEX index_csv_issue_imports_on_user_id ON csv_issue_imports USING btree (user_id);
+CREATE INDEX index_custom_emoji_on_creator_id ON custom_emoji USING btree (creator_id);
+
CREATE UNIQUE INDEX index_custom_emoji_on_namespace_id_and_name ON custom_emoji USING btree (namespace_id, name);
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_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);
+
+CREATE UNIQUE INDEX index_dast_profiles_on_project_id_and_name ON dast_profiles USING btree (project_id, name);
+
CREATE UNIQUE INDEX index_dast_scanner_profiles_on_project_id_and_name ON dast_scanner_profiles USING btree (project_id, name);
CREATE INDEX index_dast_site_profiles_on_dast_site_id ON dast_site_profiles USING btree (dast_site_id);
@@ -21827,12 +22425,16 @@ CREATE UNIQUE INDEX index_design_user_mentions_on_note_id ON design_user_mention
CREATE UNIQUE INDEX index_diff_note_positions_on_note_id_and_diff_type ON diff_note_positions USING btree (note_id, diff_type);
+CREATE UNIQUE INDEX index_dora_daily_metrics_on_environment_id_and_date ON dora_daily_metrics USING btree (environment_id, date);
+
CREATE INDEX index_draft_notes_on_author_id ON draft_notes USING btree (author_id);
CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (discussion_id);
CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id);
+CREATE INDEX index_elastic_reindexing_subtasks_on_elastic_reindexing_task_id ON elastic_reindexing_subtasks USING btree (elastic_reindexing_task_id);
+
CREATE UNIQUE INDEX index_elastic_reindexing_tasks_on_in_progress ON elastic_reindexing_tasks USING btree (in_progress) WHERE in_progress;
CREATE INDEX index_elastic_reindexing_tasks_on_state ON elastic_reindexing_tasks USING btree (state);
@@ -21857,8 +22459,12 @@ CREATE INDEX index_environments_on_project_id_state_environment_type ON environm
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);
+
CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id);
+CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id);
+
CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id);
CREATE INDEX index_epic_metrics ON epic_metrics USING btree (epic_id);
@@ -22091,6 +22697,8 @@ CREATE INDEX index_group_import_states_on_group_id ON group_import_states USING
CREATE INDEX index_group_import_states_on_user_id ON group_import_states USING btree (user_id) WHERE (user_id IS NOT NULL);
+CREATE INDEX index_group_repository_storage_moves_on_group_id ON group_repository_storage_moves USING btree (group_id);
+
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 UNIQUE INDEX index_group_wiki_repositories_on_disk_path ON group_wiki_repositories USING btree (disk_path);
@@ -22121,12 +22729,12 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI
CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL);
-CREATE INDEX index_inc_mgmnt_oncall_participants_on_oncall_rotation_id ON incident_management_oncall_participants USING btree (oncall_rotation_id);
-
CREATE INDEX index_inc_mgmnt_oncall_participants_on_oncall_user_id ON incident_management_oncall_participants USING btree (user_id);
CREATE UNIQUE INDEX index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id ON incident_management_oncall_participants USING btree (user_id, oncall_rotation_id);
+CREATE INDEX index_inc_mgmnt_oncall_pcpnt_on_oncall_rotation_id_is_removed ON incident_management_oncall_participants USING btree (oncall_rotation_id, is_removed);
+
CREATE UNIQUE INDEX index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_id ON incident_management_oncall_rotations USING btree (oncall_schedule_id, id);
CREATE UNIQUE INDEX index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_name ON incident_management_oncall_rotations USING btree (oncall_schedule_id, name);
@@ -22135,8 +22743,6 @@ CREATE INDEX index_incident_management_oncall_schedules_on_project_id ON inciden
CREATE INDEX index_incident_management_oncall_shifts_on_participant_id ON incident_management_oncall_shifts USING btree (participant_id);
-CREATE INDEX index_incident_management_oncall_shifts_on_rotation_id ON incident_management_oncall_shifts USING btree (rotation_id);
-
CREATE UNIQUE INDEX index_index_statuses_on_project_id ON index_statuses USING btree (project_id);
CREATE INDEX index_insights_on_namespace_id ON insights USING btree (namespace_id);
@@ -22169,8 +22775,6 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links
CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id);
-CREATE INDEX index_issue_metrics ON issue_metrics USING btree (issue_id);
-
CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at);
CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count);
@@ -22219,6 +22823,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_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);
CREATE INDEX index_jira_connect_subscriptions_on_namespace_id ON jira_connect_subscriptions USING btree (namespace_id);
@@ -22257,8 +22863,6 @@ CREATE UNIQUE INDEX index_labels_on_group_id_and_project_id_and_title ON labels
CREATE UNIQUE INDEX index_labels_on_group_id_and_title_unique ON labels USING btree (group_id, title) WHERE (project_id IS NULL);
-CREATE INDEX index_labels_on_group_id_and_title_with_null_project_id ON labels USING btree (group_id, title) WHERE (project_id IS NULL);
-
CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id);
CREATE UNIQUE INDEX index_labels_on_project_id_and_title_unique ON labels USING btree (project_id, title) WHERE (group_id IS NULL);
@@ -22337,6 +22941,8 @@ CREATE INDEX index_merge_request_diffs_on_external_diff_store ON merge_request_d
CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON merge_request_diffs USING btree (merge_request_id, id);
+CREATE UNIQUE INDEX index_merge_request_diffs_on_unique_merge_request_id ON merge_request_diffs USING btree (merge_request_id) WHERE (diff_type = 2);
+
CREATE INDEX index_merge_request_metrics_on_first_deployed_to_production_at ON merge_request_metrics USING btree (first_deployed_to_production_at);
CREATE INDEX index_merge_request_metrics_on_latest_closed_at ON merge_request_metrics USING btree (latest_closed_at) WHERE (latest_closed_at IS NOT NULL);
@@ -22397,6 +23003,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON m
CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text);
+CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON merge_requests USING btree (target_project_id, squash_commit_sha);
+
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_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
@@ -22449,9 +23057,9 @@ CREATE INDEX index_mr_metrics_on_target_project_id_merged_at_nulls_last ON merge
CREATE INDEX index_mr_metrics_on_target_project_id_merged_at_time_to_merge ON merge_request_metrics USING btree (target_project_id, merged_at, created_at) WHERE (merged_at > created_at);
-CREATE UNIQUE INDEX index_namespace_aggregation_schedules_on_namespace_id ON namespace_aggregation_schedules USING btree (namespace_id);
+CREATE INDEX index_namespace_admin_notes_on_namespace_id ON namespace_admin_notes USING btree (namespace_id);
-CREATE INDEX index_namespace_onboarding_actions_on_namespace_id ON namespace_onboarding_actions USING btree (namespace_id);
+CREATE UNIQUE INDEX index_namespace_aggregation_schedules_on_namespace_id ON namespace_aggregation_schedules USING btree (namespace_id);
CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON namespace_root_storage_statistics USING btree (namespace_id);
@@ -22549,6 +23157,10 @@ CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON a
CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type);
+CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id);
+
+COMMENT ON INDEX index_on_merge_requests_for_latest_diffs IS 'Index used to efficiently obtain the oldest merge request for a commit SHA';
+
CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((name)::text));
CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text));
@@ -22563,6 +23175,8 @@ CREATE UNIQUE INDEX index_on_segment_selections_project_id_segment_id ON analyti
CREATE INDEX index_on_segment_selections_segment_id ON analytics_devops_adoption_segment_selections USING btree (segment_id);
+CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time);
+
CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at);
CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text));
@@ -22571,6 +23185,18 @@ CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username
CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text));
+CREATE INDEX index_onboarding_progresses_for_create_track ON onboarding_progresses USING btree (created_at) WHERE (git_write_at IS NULL);
+
+CREATE INDEX index_onboarding_progresses_for_team_track ON onboarding_progresses USING btree (GREATEST(git_write_at, pipeline_created_at, trial_started_at)) WHERE ((git_write_at IS NOT NULL) AND (pipeline_created_at IS NOT NULL) AND (trial_started_at IS NOT NULL) AND (user_added_at IS NULL));
+
+CREATE INDEX index_onboarding_progresses_for_trial_track ON onboarding_progresses USING btree (GREATEST(git_write_at, pipeline_created_at)) WHERE ((git_write_at IS NOT NULL) AND (pipeline_created_at IS NOT NULL) AND (trial_started_at IS NULL));
+
+CREATE INDEX index_onboarding_progresses_for_verify_track ON onboarding_progresses USING btree (git_write_at) WHERE ((git_write_at IS NOT NULL) AND (pipeline_created_at IS NULL));
+
+CREATE UNIQUE INDEX index_onboarding_progresses_on_namespace_id ON onboarding_progresses USING btree (namespace_id);
+
+CREATE INDEX index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at ON incident_management_oncall_shifts USING btree (rotation_id, starts_at, ends_at);
+
CREATE INDEX index_open_project_tracker_data_on_service_id ON open_project_tracker_data USING btree (service_id);
CREATE INDEX index_operations_feature_flags_issues_on_issue_id ON operations_feature_flags_issues USING btree (issue_id);
@@ -22595,6 +23221,8 @@ CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list
CREATE INDEX index_packages_build_infos_on_pipeline_id ON packages_build_infos USING btree (pipeline_id);
+CREATE UNIQUE INDEX index_packages_composer_cache_namespace_and_sha ON packages_composer_cache_files USING btree (namespace_id, file_sha256);
+
CREATE UNIQUE INDEX index_packages_composer_metadata_on_package_id_and_target_sha ON packages_composer_metadata USING btree (package_id, target_sha);
CREATE UNIQUE INDEX index_packages_conan_file_metadata_on_package_file_id ON packages_conan_file_metadata USING btree (package_file_id);
@@ -22629,6 +23257,8 @@ CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_
CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 7);
+CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 8);
+
CREATE 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);
@@ -22649,6 +23279,8 @@ CREATE INDEX index_packages_packages_on_project_id_and_created_at ON packages_pa
CREATE INDEX index_packages_packages_on_project_id_and_package_type ON packages_packages USING btree (project_id, package_type);
+CREATE INDEX index_packages_packages_on_project_id_and_status ON packages_packages USING btree (project_id, status);
+
CREATE INDEX index_packages_packages_on_project_id_and_version ON packages_packages USING btree (project_id, version);
CREATE INDEX index_packages_project_id_name_partial_for_nuget ON packages_packages USING btree (project_id, name) WHERE (((name)::text <> 'NuGet.Temporary.Package'::text) AND (version IS NOT NULL) AND (package_type = 4));
@@ -23101,7 +23733,7 @@ CREATE INDEX index_security_findings_on_scanner_id ON security_findings USING bt
CREATE INDEX index_security_findings_on_severity ON security_findings USING btree (severity);
-CREATE UNIQUE INDEX index_security_findings_on_uuid ON security_findings USING btree (uuid);
+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_date_created_at_and_id ON security_scans USING btree (date(timezone('UTC'::text, created_at)), id);
@@ -23123,7 +23755,7 @@ CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON
CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id);
-CREATE INDEX index_services_on_project_id_and_type ON services USING btree (project_id, type);
+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);
@@ -23187,6 +23819,12 @@ CREATE INDEX index_software_licenses_on_spdx_identifier ON software_licenses USI
CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses USING btree (name);
+CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id);
+
+CREATE UNIQUE INDEX index_sop_configs_on_security_policy_management_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id);
+
+CREATE INDEX index_sprints_iterations_cadence_id ON sprints USING btree (iterations_cadence_id);
+
CREATE INDEX index_sprints_on_description_trigram ON sprints USING gin (description gin_trgm_ops);
CREATE INDEX index_sprints_on_due_date ON sprints USING btree (due_date);
@@ -23291,6 +23929,8 @@ CREATE INDEX index_u2f_registrations_on_key_handle ON u2f_registrations USING bt
CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree (user_id);
+CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id);
+
CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum);
CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type);
@@ -23329,6 +23969,8 @@ CREATE INDEX index_user_preferences_on_gitpod_enabled ON user_preferences USING
CREATE UNIQUE INDEX index_user_preferences_on_user_id ON user_preferences USING btree (user_id);
+CREATE INDEX index_user_statuses_on_clear_status_at_not_null ON user_statuses USING btree (clear_status_at) WHERE (clear_status_at IS NOT NULL);
+
CREATE INDEX index_user_statuses_on_user_id ON user_statuses USING btree (user_id);
CREATE UNIQUE INDEX index_user_synced_attributes_metadata_on_user_id ON user_synced_attributes_metadata USING btree (user_id);
@@ -23577,17 +24219,17 @@ CREATE INDEX temporary_index_vulnerabilities_on_id ON vulnerabilities USING btre
CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id);
-CREATE INDEX tmp_build_stage_position_index ON ci_builds USING btree (stage_id, stage_idx) WHERE (stage_idx IS NOT NULL);
-
CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id);
+CREATE INDEX tmp_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true);
+
CREATE INDEX tmp_index_ci_builds_lock_version ON ci_builds USING btree (id) WHERE (lock_version IS NULL);
CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL);
CREATE INDEX tmp_index_ci_stages_lock_version ON ci_stages USING btree (id) WHERE (lock_version IS NULL);
-CREATE INDEX tmp_index_for_email_unconfirmation_migration ON emails USING btree (id) WHERE (confirmed_at IS NOT 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_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
@@ -23873,6 +24515,18 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p
CREATE TRIGGER table_sync_trigger_ee39a25f9d AFTER INSERT OR DELETE OR UPDATE ON audit_events FOR EACH ROW EXECUTE FUNCTION table_sync_function_2be879775d();
+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_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_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_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_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 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();
+
ALTER TABLE ONLY chat_names
ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
@@ -24014,6 +24668,9 @@ ALTER TABLE ONLY namespaces
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY sprints
+ ADD CONSTRAINT fk_365d1db505 FOREIGN KEY (iterations_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY push_event_payloads
ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE;
@@ -24119,6 +24776,9 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY index_statuses
ADD CONSTRAINT fk_74b2492545 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY cluster_agent_tokens
+ ADD CONSTRAINT fk_75008f3553 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_76bc5f5455 FOREIGN KEY (resolved_by_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -24149,9 +24809,6 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY labels
ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY backup_labels
- ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE;
@@ -24224,6 +24881,9 @@ ALTER TABLE ONLY milestones
ALTER TABLE ONLY vulnerabilities
ADD CONSTRAINT fk_959d40ad0a FOREIGN KEY (confirmed_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY boards_epic_list_user_preferences
+ ADD CONSTRAINT fk_95eac55851 FOREIGN KEY (epic_list_id) REFERENCES boards_epic_lists(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_964370041d FOREIGN KEY (usage_stats_set_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -24290,6 +24950,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_aa5798e761 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY dast_profiles
+ ADD CONSTRAINT fk_aa76ef30e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_aad61aedca FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL;
@@ -24380,6 +25043,12 @@ ALTER TABLE ONLY issues
ALTER TABLE ONLY issue_links
ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_approval_rules_protected_branches
+ ADD CONSTRAINT fk_c9a037a926 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE;
+
+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 experiment_subjects
ADD CONSTRAINT fk_ccc28f8ceb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -24389,6 +25058,9 @@ ALTER TABLE ONLY todos
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_cff7185ad2 FOREIGN KEY (reset_checksum_event_id) REFERENCES geo_reset_checksum_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY custom_emoji
+ ADD CONSTRAINT fk_custom_emoji_creator_id FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY bulk_import_entities
ADD CONSTRAINT fk_d06d023c30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -24521,6 +25193,15 @@ ALTER TABLE ONLY ci_pipeline_variables
ALTER TABLE ONLY design_management_designs_versions
ADD CONSTRAINT fk_f4d25ba00c FOREIGN KEY (version_id) REFERENCES design_management_versions(id) ON DELETE CASCADE;
+ALTER TABLE ONLY analytics_devops_adoption_segments
+ ADD CONSTRAINT fk_f5aa768998 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY boards_epic_list_user_preferences
+ ADD CONSTRAINT fk_f5f2fe5c1f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY cluster_agents
+ ADD CONSTRAINT fk_f7d43dee13 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY protected_tag_create_access_levels
ADD CONSTRAINT fk_f7dfda8c51 FOREIGN KEY (protected_tag_id) REFERENCES protected_tags(id) ON DELETE CASCADE;
@@ -24533,6 +25214,9 @@ ALTER TABLE ONLY system_note_metadata
ALTER TABLE ONLY vulnerability_remediations
ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_daily_build_group_report_results
+ ADD CONSTRAINT fk_fd1858fefd FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
@@ -24605,6 +25289,9 @@ ALTER TABLE ONLY user_interacted_projects
ALTER TABLE ONLY trending_projects
ADD CONSTRAINT fk_rails_09feecd872 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_orchestration_policy_configurations
+ ADD CONSTRAINT fk_rails_0a22dcd52d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_deploy_tokens
ADD CONSTRAINT fk_rails_0aca134388 FOREIGN KEY (deploy_token_id) REFERENCES deploy_tokens(id) ON DELETE CASCADE;
@@ -24632,6 +25319,9 @@ ALTER TABLE ONLY user_synced_attributes_metadata
ALTER TABLE ONLY project_authorizations
ADD CONSTRAINT fk_rails_0f84bb11f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards_epic_lists
+ ADD CONSTRAINT fk_rails_0f9c7f646f FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issue_email_participants
ADD CONSTRAINT fk_rails_0fdfd8b811 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -24740,6 +25430,12 @@ 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 dora_daily_metrics
+ ADD CONSTRAINT fk_rails_1fd07aff6f FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY boards_epic_lists
+ ADD CONSTRAINT fk_rails_1fe6b54909 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_merge_request_rules_groups
ADD CONSTRAINT fk_rails_2020a7124a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -24761,6 +25457,9 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY saml_group_links
ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profiles
+ ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY group_custom_attributes
ADD CONSTRAINT fk_rails_246e0db83a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -24815,6 +25514,9 @@ 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 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;
@@ -24869,6 +25571,9 @@ ALTER TABLE ONLY merge_request_blocks
ALTER TABLE ONLY merge_request_reviewers
ADD CONSTRAINT fk_rails_3704a66140 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY group_merge_request_approval_settings
+ ADD CONSTRAINT fk_rails_37b6b4cdba FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_3829e49b66 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -24932,12 +25637,18 @@ ALTER TABLE ONLY epic_issues
ALTER TABLE ONLY ci_refs
ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_orchestration_policy_configurations
+ ADD CONSTRAINT fk_rails_42ed6c25ec FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE RESTRICT;
+
ALTER TABLE ONLY ci_resources
ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE;
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;
+
ALTER TABLE ONLY operations_strategies_user_lists
ADD CONSTRAINT fk_rails_43241e8d29 FOREIGN KEY (strategy_id) REFERENCES operations_strategies(id) ON DELETE CASCADE;
@@ -24953,9 +25664,6 @@ ALTER TABLE ONLY merge_request_assignees
ALTER TABLE ONLY packages_dependency_links
ADD CONSTRAINT fk_rails_4437bf4070 FOREIGN KEY (dependency_id) REFERENCES packages_dependencies(id) ON DELETE CASCADE;
-ALTER TABLE ONLY namespace_onboarding_actions
- ADD CONSTRAINT fk_rails_4504f6875a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_auto_devops
ADD CONSTRAINT fk_rails_45436b12b2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25028,6 +25736,9 @@ ALTER TABLE ONLY resource_iteration_events
ALTER TABLE ONLY status_page_settings
ADD CONSTRAINT fk_rails_506e5ba391 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_project_monthly_usages
+ ADD CONSTRAINT fk_rails_508bcd4aa6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_repository_storage_moves
ADD CONSTRAINT fk_rails_5106dbd44a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25172,6 +25883,9 @@ ALTER TABLE ONLY approval_merge_request_rules_approved_approvers
ALTER TABLE ONLY operations_feature_flags_clients
ADD CONSTRAINT fk_rails_6650ed902c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+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
ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
@@ -25412,12 +26126,18 @@ ALTER TABLE ONLY scim_identities
ALTER TABLE ONLY packages_debian_project_distributions
ADD CONSTRAINT fk_rails_94b95e1f84 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY packages_rubygems_metadata
+ ADD CONSTRAINT fk_rails_95a3f5ce78 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY packages_pypi_metadata
ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
ALTER TABLE ONLY packages_dependency_links
ADD CONSTRAINT fk_rails_96ef1c00d3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
+ALTER TABLE ONLY group_repository_storage_moves
+ ADD CONSTRAINT fk_rails_982bb5daf1 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY resource_label_events
ADD CONSTRAINT fk_rails_9851a00031 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -25583,8 +26303,8 @@ ALTER TABLE ONLY namespace_aggregation_schedules
ALTER TABLE ONLY approval_project_rules_protected_branches
ADD CONSTRAINT fk_rails_b7567b031b FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
-ALTER TABLE ONLY alerts_service_data
- ADD CONSTRAINT fk_rails_b93215a42c FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ALTER TABLE ONLY packages_composer_cache_files
+ ADD CONSTRAINT fk_rails_b82cea43a0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY merge_trains
ADD CONSTRAINT fk_rails_b9d67af01d FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25637,9 +26357,6 @@ ALTER TABLE ONLY serverless_domain_cluster
ALTER TABLE ONLY labels
ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY backup_labels
- ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_feature_usages
ADD CONSTRAINT fk_rails_c22a50024b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25823,6 +26540,9 @@ ALTER TABLE ONLY merge_request_metrics
ALTER TABLE ONLY draft_notes
ADD CONSTRAINT fk_rails_e753681674 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY namespace_package_settings
+ ADD CONSTRAINT fk_rails_e773444769 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_site_tokens
ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25850,6 +26570,12 @@ ALTER TABLE ONLY alert_management_alert_user_mentions
ALTER TABLE ONLY snippet_statistics
ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE;
+ALTER TABLE ONLY iterations_cadences
+ ADD CONSTRAINT fk_rails_ece400c55a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY dast_profiles
+ ADD CONSTRAINT fk_rails_ed1e66fbbf FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_security_settings
ADD CONSTRAINT fk_rails_ed4abe1338 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -25883,6 +26609,9 @@ ALTER TABLE ONLY requirements
ALTER TABLE ONLY snippet_repositories
ADD CONSTRAINT fk_rails_f21f899728 FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT;
+ALTER TABLE ONLY elastic_reindexing_subtasks
+ ADD CONSTRAINT fk_rails_f2cc190164 FOREIGN KEY (elastic_reindexing_task_id) REFERENCES elastic_reindexing_tasks(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_pipeline_chat_data
ADD CONSTRAINT fk_rails_f300456b63 FOREIGN KEY (chat_name_id) REFERENCES chat_names(id) ON DELETE CASCADE;
@@ -25946,6 +26675,9 @@ 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 ONLY external_approval_rules
+ ADD CONSTRAINT fk_rails_fd4f9ac573 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY experiment_users
ADD CONSTRAINT fk_rails_fd805f771a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
diff --git a/db/migrate/20201211145950_add_bloat_estimate_to_reindex_action.rb b/db/migrate/20201211145950_add_bloat_estimate_to_reindex_action.rb
deleted file mode 100644
index 894cee92284..00000000000
--- a/db/migrate/20201211145950_add_bloat_estimate_to_reindex_action.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddBloatEstimateToReindexAction < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :postgres_reindex_actions, :bloat_estimate_bytes_start, :bigint
- end
-end
diff --git a/db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb b/db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb
deleted file mode 100644
index 47eec16807b..00000000000
--- a/db/migrate/20201214000000_change_mr_allow_maintainer_to_push_default.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeMrAllowMaintainerToPushDefault < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- change_column_default :merge_requests, :allow_maintainer_to_push, from: nil, to: true
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :merge_requests, :allow_maintainer_to_push, from: true, to: nil
- end
- end
-end
diff --git a/db/migrate/20201214032220_add_has_external_wiki_trigger.rb b/db/migrate/20201214032220_add_has_external_wiki_trigger.rb
deleted file mode 100644
index c77b887d509..00000000000
--- a/db/migrate/20201214032220_add_has_external_wiki_trigger.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-class AddHasExternalWikiTrigger < ActiveRecord::Migration[6.0]
- include Gitlab::Database::SchemaHelpers
-
- DOWNTIME = false
- FUNCTION_NAME = 'set_has_external_wiki'
- TRIGGER_ON_INSERT_NAME = 'trigger_has_external_wiki_on_insert'
- TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_wiki_on_update'
- TRIGGER_ON_DELETE_NAME = 'trigger_has_external_wiki_on_delete'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE)
- WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON services
- FOR EACH ROW
- WHEN (NEW.active = TRUE AND NEW.type = 'ExternalWikiService' AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON services
- FOR EACH ROW
- WHEN (NEW.type = 'ExternalWikiService' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON services
- FOR EACH ROW
- WHEN (OLD.type = 'ExternalWikiService' AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:services, TRIGGER_ON_INSERT_NAME)
- drop_trigger(:services, TRIGGER_ON_UPDATE_NAME)
- drop_trigger(:services, TRIGGER_ON_DELETE_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20201214084105_add_expiration_policy_completed_at_to_container_repositories.rb b/db/migrate/20201214084105_add_expiration_policy_completed_at_to_container_repositories.rb
deleted file mode 100644
index 9e1f21068c2..00000000000
--- a/db/migrate/20201214084105_add_expiration_policy_completed_at_to_container_repositories.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-class AddExpirationPolicyCompletedAtToContainerRepositories < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- add_column(:container_repositories, :expiration_policy_completed_at, :datetime_with_timezone)
- end
-
- def down
- remove_column(:container_repositories, :expiration_policy_completed_at)
- end
-end
diff --git a/db/migrate/20201214111858_add_container_registry_cleanup_tags_service_max_list_size_to_application_settings.rb b/db/migrate/20201214111858_add_container_registry_cleanup_tags_service_max_list_size_to_application_settings.rb
deleted file mode 100644
index 312220914c1..00000000000
--- a/db/migrate/20201214111858_add_container_registry_cleanup_tags_service_max_list_size_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddContainerRegistryCleanupTagsServiceMaxListSizeToApplicationSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def change
- add_column(:application_settings, :container_registry_cleanup_tags_service_max_list_size, :integer, default: 200, null: false)
- end
-end
diff --git a/db/migrate/20201214112752_add_app_settings_container_reg_cleanup_tags_service_max_list_size_constraint.rb b/db/migrate/20201214112752_add_app_settings_container_reg_cleanup_tags_service_max_list_size_constraint.rb
deleted file mode 100644
index 935dd641b4c..00000000000
--- a/db/migrate/20201214112752_add_app_settings_container_reg_cleanup_tags_service_max_list_size_constraint.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddAppSettingsContainerRegCleanupTagsServiceMaxListSizeConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- CONSTRAINT_NAME = 'app_settings_container_reg_cleanup_tags_max_list_size_positive'
-
- disable_ddl_transaction!
-
- def up
- add_check_constraint :application_settings, 'container_registry_cleanup_tags_service_max_list_size >= 0', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :application_settings, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20201214113729_add_custom_mapping_columns_to_http_integrations.rb b/db/migrate/20201214113729_add_custom_mapping_columns_to_http_integrations.rb
deleted file mode 100644
index dbad28280ac..00000000000
--- a/db/migrate/20201214113729_add_custom_mapping_columns_to_http_integrations.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddCustomMappingColumnsToHttpIntegrations < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :alert_management_http_integrations, :payload_example, :jsonb, null: false, default: {}
- add_column :alert_management_http_integrations, :payload_attribute_mapping, :jsonb, null: false, default: {}
- end
-end
diff --git a/db/migrate/20201214184020_add_epic_board_list.rb b/db/migrate/20201214184020_add_epic_board_list.rb
deleted file mode 100644
index 9c4e3280754..00000000000
--- a/db/migrate/20201214184020_add_epic_board_list.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicBoardList < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- unless table_exists?(:boards_epic_lists)
- with_lock_retries do
- create_table :boards_epic_lists do |t|
- t.timestamps_with_timezone
- t.references :epic_board, index: true, foreign_key: { to_table: :boards_epic_boards, on_delete: :cascade }, null: false
- t.references :label, index: true, foreign_key: { on_delete: :cascade }
- t.integer :position
- t.integer :list_type, default: 1, limit: 2, null: false
-
- t.index [:epic_board_id, :label_id], unique: true, where: 'list_type = 1', name: 'index_boards_epic_lists_on_epic_board_id_and_label_id'
- end
- end
- end
-
- add_check_constraint :boards_epic_lists, '(list_type <> 1) OR ("position" IS NOT NULL AND "position" >= 0)', 'boards_epic_lists_position_constraint'
- end
-
- def down
- with_lock_retries do
- drop_table :boards_epic_lists
- end
- end
-end
diff --git a/db/migrate/20201215084652_delete_mock_deployment_service_records.rb b/db/migrate/20201215084652_delete_mock_deployment_service_records.rb
deleted file mode 100644
index 6c601a5e852..00000000000
--- a/db/migrate/20201215084652_delete_mock_deployment_service_records.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteMockDeploymentServiceRecords < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- if Rails.env.development?
- execute("DELETE FROM services WHERE type = 'MockDeploymentService'")
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20201215132151_change_unique_index_on_security_findings.rb b/db/migrate/20201215132151_change_unique_index_on_security_findings.rb
deleted file mode 100644
index fe474ef3991..00000000000
--- a/db/migrate/20201215132151_change_unique_index_on_security_findings.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeUniqueIndexOnSecurityFindings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- OLD_INDEX_NAME = 'index_security_findings_on_uuid'
- NEW_INDEX_NAME = 'index_security_findings_on_uuid_and_scan_id'
-
- disable_ddl_transaction!
-
- class SecurityFinding < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'security_findings'
- end
-
- def up
- add_concurrent_index :security_findings, [:uuid, :scan_id], unique: true, name: NEW_INDEX_NAME
-
- remove_concurrent_index_by_name :security_findings, OLD_INDEX_NAME
- end
-
- def down
- # It is very unlikely that we rollback this migration but just in case if we have to,
- # we have to clear the table because there can be multiple records with the same UUID
- # which would break the creation of unique index on the `uuid` column.
- # We choose clearing the table because just removing the duplicated records would
- # cause data inconsistencies.
- SecurityFinding.each_batch(of: 10000) { |relation| relation.delete_all }
-
- add_concurrent_index :security_findings, :uuid, unique: true, name: OLD_INDEX_NAME
-
- remove_concurrent_index_by_name :security_findings, NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20201215205404_create_namespace_package_settings.rb b/db/migrate/20201215205404_create_namespace_package_settings.rb
deleted file mode 100644
index d74b99597ce..00000000000
--- a/db/migrate/20201215205404_create_namespace_package_settings.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class CreateNamespacePackageSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- create_table :namespace_package_settings, if_not_exists: true, id: false do |t|
- t.references :namespace, primary_key: true, index: false, default: nil, foreign_key: { to_table: :namespaces, on_delete: :cascade }, type: :bigint
- t.boolean :maven_duplicates_allowed, null: false, default: true
- t.text :maven_duplicate_exception_regex, null: false, default: ''
- end
- end
-
- add_text_limit :namespace_package_settings, :maven_duplicate_exception_regex, 255
- end
-
- def down
- drop_table :namespace_package_settings
- end
-end
diff --git a/db/migrate/20201216151616_add_squash_commit_sha_index.rb b/db/migrate/20201216151616_add_squash_commit_sha_index.rb
deleted file mode 100644
index ac6d3fda2d2..00000000000
--- a/db/migrate/20201216151616_add_squash_commit_sha_index.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddSquashCommitShaIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = "index_merge_requests_on_target_project_id_and_squash_commit_sha"
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :merge_requests,
- [:target_project_id, :squash_commit_sha],
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :merge_requests,
- [:target_project_id, :squash_commit_sha],
- name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20201216154457_add_devops_adoption_snapshot_range_end.rb b/db/migrate/20201216154457_add_devops_adoption_snapshot_range_end.rb
deleted file mode 100644
index ada1bd9b346..00000000000
--- a/db/migrate/20201216154457_add_devops_adoption_snapshot_range_end.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotRangeEnd < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def change
- add_column :analytics_devops_adoption_snapshots, :end_time, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20201217070530_add_group_merge_request_approval_settings.rb b/db/migrate/20201217070530_add_group_merge_request_approval_settings.rb
deleted file mode 100644
index dba9e6e440f..00000000000
--- a/db/migrate/20201217070530_add_group_merge_request_approval_settings.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupMergeRequestApprovalSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- create_table :group_merge_request_approval_settings, id: false do |t|
- t.timestamps_with_timezone null: false
- t.references :group, references: :namespaces, primary_key: true, default: nil, index: false,
- foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.boolean :allow_author_approval, null: false, default: false
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :group_merge_request_approval_settings
- end
- end
-end
diff --git a/db/migrate/20201217111448_change_pages_deployment_size_to_bigint.rb b/db/migrate/20201217111448_change_pages_deployment_size_to_bigint.rb
deleted file mode 100644
index 75420166b87..00000000000
--- a/db/migrate/20201217111448_change_pages_deployment_size_to_bigint.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangePagesDeploymentSizeToBigint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- change_column_type_concurrently :pages_deployments, :size, :bigint
- end
-
- def down
- undo_change_column_type_concurrently :pages_deployments, :size
- end
-end
diff --git a/db/migrate/20201217132603_create_elastic_reindexing_subtasks.rb b/db/migrate/20201217132603_create_elastic_reindexing_subtasks.rb
deleted file mode 100644
index db084b885c2..00000000000
--- a/db/migrate/20201217132603_create_elastic_reindexing_subtasks.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-# frozen_string_literal: true
-
-class CreateElasticReindexingSubtasks < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- class ReindexingTask < ActiveRecord::Base
- self.table_name = 'elastic_reindexing_tasks'
- end
-
- class ReindexingSubtask < ActiveRecord::Base
- self.table_name = 'elastic_reindexing_subtasks'
- end
-
- def up
- unless table_exists?(:elastic_reindexing_subtasks)
- create_table :elastic_reindexing_subtasks do |t|
- t.references :elastic_reindexing_task, foreign_key: { on_delete: :cascade }, null: false
- t.text :alias_name, null: false
- t.text :index_name_from, null: false
- t.text :index_name_to, null: false
- t.text :elastic_task, null: false
- t.integer :documents_count_target
- t.integer :documents_count
- t.timestamps_with_timezone null: false
- end
- end
-
- add_text_limit :elastic_reindexing_subtasks, :index_name_from, 255
- add_text_limit :elastic_reindexing_subtasks, :index_name_to, 255
- add_text_limit :elastic_reindexing_subtasks, :elastic_task, 255
- add_text_limit :elastic_reindexing_subtasks, :alias_name, 255
-
- ReindexingTask.find_each do |task|
- next if task.index_name_from.blank? || task.index_name_to.blank? || task.elastic_task.blank?
- next if ReindexingSubtask.where(elastic_reindexing_task_id: task.id).exists?
-
- ReindexingSubtask.create(
- elastic_reindexing_task_id: task.id,
- documents_count_target: task.documents_count_target,
- documents_count: task.documents_count,
- alias_name: 'gitlab-production',
- index_name_from: task.index_name_from,
- index_name_to: task.index_name_to,
- elastic_task: task.elastic_task
- )
- end
- end
-
- def down
- drop_table :elastic_reindexing_subtasks
- end
-end
diff --git a/db/migrate/20201218194311_create_admin_notes.rb b/db/migrate/20201218194311_create_admin_notes.rb
deleted file mode 100644
index 32f5818cdfb..00000000000
--- a/db/migrate/20201218194311_create_admin_notes.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAdminNotes < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- create_table_with_constraints :namespace_admin_notes do |t|
- t.timestamps_with_timezone
- t.references :namespace, null: false, foreign_key: { on_delete: :cascade }
- t.text :note
-
- t.text_limit :note, 1000
- end
- end
-
- def down
- drop_table :namespace_admin_notes
- end
-end
diff --git a/db/migrate/20201221124036_add_devops_snapshot_index.rb b/db/migrate/20201221124036_add_devops_snapshot_index.rb
deleted file mode 100644
index 85001e9abcf..00000000000
--- a/db/migrate/20201221124036_add_devops_snapshot_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsSnapshotIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_on_snapshots_segment_id_end_time'
-
- def up
- add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :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/20201221213415_change_clusters_helm_major_version_default_to_3.rb b/db/migrate/20201221213415_change_clusters_helm_major_version_default_to_3.rb
deleted file mode 100644
index baec0da208b..00000000000
--- a/db/migrate/20201221213415_change_clusters_helm_major_version_default_to_3.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeClustersHelmMajorVersionDefaultTo3 < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- change_column_default(:clusters, :helm_major_version, from: 2, to: 3)
- end
-end
diff --git a/db/migrate/20201221225303_add_service_desk_reply_to_is_not_null_index_on_issues.rb b/db/migrate/20201221225303_add_service_desk_reply_to_is_not_null_index_on_issues.rb
deleted file mode 100644
index 7643fc107aa..00000000000
--- a/db/migrate/20201221225303_add_service_desk_reply_to_is_not_null_index_on_issues.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddServiceDeskReplyToIsNotNullIndexOnIssues < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- # no-op, the migration's version number was lowered to be executed earlier than db/post_migrate/20201128210234_schedule_populate_issue_email_participants.rb
- #
- # The new migration is located here: db/migrate/20201128210000_add_service_desk_reply_to_is_not_null_index_on_issues_fix.rb
- end
-end
diff --git a/db/migrate/20201222151823_update_trusted_apps_to_confidential.rb b/db/migrate/20201222151823_update_trusted_apps_to_confidential.rb
deleted file mode 100644
index bcb94c65125..00000000000
--- a/db/migrate/20201222151823_update_trusted_apps_to_confidential.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateTrustedAppsToConfidential < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_index_oauth_applications_on_id_where_trusted'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :oauth_applications, :id, where: 'trusted = true', name: INDEX_NAME
-
- execute('UPDATE oauth_applications SET confidential = true WHERE trusted = true')
- end
-
- def down
- # We won't be able to tell which trusted applications weren't confidential before the migration
- # and setting all trusted applications are not confidential would introduce security issues
-
- remove_concurrent_index_by_name :oauth_applications, INDEX_NAME
- end
-end
diff --git a/db/migrate/20201223114050_add_restrict_user_defined_variables_to_project_settings.rb b/db/migrate/20201223114050_add_restrict_user_defined_variables_to_project_settings.rb
deleted file mode 100644
index d04c6981bf9..00000000000
--- a/db/migrate/20201223114050_add_restrict_user_defined_variables_to_project_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddRestrictUserDefinedVariablesToProjectSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :project_ci_cd_settings, :restrict_user_defined_variables, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_ci_cd_settings, :restrict_user_defined_variables
- end
- end
-end
diff --git a/db/migrate/20201224144948_migrate_coverage_report_worker.rb b/db/migrate/20201224144948_migrate_coverage_report_worker.rb
deleted file mode 100644
index 8580a15c256..00000000000
--- a/db/migrate/20201224144948_migrate_coverage_report_worker.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateCoverageReportWorker < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- sidekiq_queue_migrate 'ci_pipelines_create_artifact', to: 'ci_pipeline_artifacts_coverage_report' # rubocop:disable Migration/SidekiqQueueMigrate
- end
-
- def down
- sidekiq_queue_migrate 'ci_pipeline_artifacts_coverage_report', to: 'ci_pipelines_create_artifact' # rubocop:disable Migration/SidekiqQueueMigrate
- end
-end
diff --git a/db/migrate/20201228110136_create_iterations_cadence.rb b/db/migrate/20201228110136_create_iterations_cadence.rb
deleted file mode 100644
index 95601ab4b29..00000000000
--- a/db/migrate/20201228110136_create_iterations_cadence.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIterationsCadence < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :iterations_cadences do |t|
- t.references :group, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.date :start_date, null: false
- t.date :last_run_date
- t.integer :duration_in_weeks
- t.integer :iterations_in_advance
- t.boolean :active, default: true, null: false
- t.boolean :automatic, default: true, null: false
- t.text :title, null: false
-
- t.text_limit :title, 255
- end
- end
-
- def down
- drop_table :iterations_cadences if table_exists?(:iterations_cadences)
- end
-end
diff --git a/db/migrate/20201228110238_add_iterations_cadence_to_sprints.rb b/db/migrate/20201228110238_add_iterations_cadence_to_sprints.rb
deleted file mode 100644
index 9d9026a265b..00000000000
--- a/db/migrate/20201228110238_add_iterations_cadence_to_sprints.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddIterationsCadenceToSprints < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_sprints_iterations_cadence_id'
-
- def up
- add_column :sprints, :iterations_cadence_id, :integer unless column_exists?(:sprints, :iterations_cadence_id)
-
- add_concurrent_index :sprints, :iterations_cadence_id, name: INDEX_NAME
- add_concurrent_foreign_key :sprints, :iterations_cadences, column: :iterations_cadence_id, on_delete: :cascade
- end
-
- def down
- remove_column :sprints, :iterations_cadence_id if column_exists?(:sprints, :iterations_cadence_id)
- end
-end
diff --git a/db/migrate/20201228184500_add_dismissal_reason_into_vulnerability_feedback_table.rb b/db/migrate/20201228184500_add_dismissal_reason_into_vulnerability_feedback_table.rb
deleted file mode 100644
index 92484aced4e..00000000000
--- a/db/migrate/20201228184500_add_dismissal_reason_into_vulnerability_feedback_table.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddDismissalReasonIntoVulnerabilityFeedbackTable < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- add_column :vulnerability_feedback, :dismissal_reason, :smallint
- end
-
- def down
- remove_column :vulnerability_feedback, :dismissal_reason
- end
-end
diff --git a/db/migrate/20201229105948_add_invisible_captcha_enabled_to_settings.rb b/db/migrate/20201229105948_add_invisible_captcha_enabled_to_settings.rb
deleted file mode 100644
index 025fcba0729..00000000000
--- a/db/migrate/20201229105948_add_invisible_captcha_enabled_to_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddInvisibleCaptchaEnabledToSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :invisible_captcha_enabled, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20201230161206_add_rate_limiting_response_text_to_application_settings.rb b/db/migrate/20201230161206_add_rate_limiting_response_text_to_application_settings.rb
deleted file mode 100644
index 647455f5f88..00000000000
--- a/db/migrate/20201230161206_add_rate_limiting_response_text_to_application_settings.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class AddRateLimitingResponseTextToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210101110640_set_limit_for_rate_limiting_response_text
- def change
- add_column :application_settings, :rate_limiting_response_text, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20201230180202_create_onboarding_progress.rb b/db/migrate/20201230180202_create_onboarding_progress.rb
deleted file mode 100644
index b9fe64eb19d..00000000000
--- a/db/migrate/20201230180202_create_onboarding_progress.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class CreateOnboardingProgress < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- create_table :onboarding_progresses do |t|
- t.references :namespace, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.datetime_with_timezone :git_pull_at
- t.datetime_with_timezone :git_write_at
- t.datetime_with_timezone :merge_request_created_at
- t.datetime_with_timezone :pipeline_created_at
- t.datetime_with_timezone :user_added_at
- t.datetime_with_timezone :trial_started_at
- t.datetime_with_timezone :subscription_created_at
- t.datetime_with_timezone :required_mr_approvals_enabled_at
- t.datetime_with_timezone :code_owners_enabled_at
- t.datetime_with_timezone :scoped_label_created_at
- t.datetime_with_timezone :security_scan_enabled_at
- t.datetime_with_timezone :issue_auto_closed_at
- t.datetime_with_timezone :repository_imported_at
- t.datetime_with_timezone :repository_mirrored_at
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :onboarding_progresses
- end
- end
-end
diff --git a/db/migrate/20210101110640_set_limit_for_rate_limiting_response_text.rb b/db/migrate/20210101110640_set_limit_for_rate_limiting_response_text.rb
deleted file mode 100644
index b72f2ae7d70..00000000000
--- a/db/migrate/20210101110640_set_limit_for_rate_limiting_response_text.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class SetLimitForRateLimitingResponseText < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :application_settings, :rate_limiting_response_text, 255
- end
-
- def down
- remove_text_limit :application_settings, :rate_limiting_response_text
- end
-end
diff --git a/db/migrate/20210102164121_drop_temporary_index_on_ci_builds.rb b/db/migrate/20210102164121_drop_temporary_index_on_ci_builds.rb
deleted file mode 100644
index 9c99414792e..00000000000
--- a/db/migrate/20210102164121_drop_temporary_index_on_ci_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryIndexOnCiBuilds < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX = 'tmp_build_stage_position_index'
-
- def up
- remove_concurrent_index_by_name :ci_builds, INDEX
- end
-
- def down
- add_concurrent_index :ci_builds, [:stage_id, :stage_idx], where: 'stage_idx IS NOT NULL', name: INDEX
- end
-end
diff --git a/db/migrate/20210104163218_add_epic_board_position_index.rb b/db/migrate/20210104163218_add_epic_board_position_index.rb
deleted file mode 100644
index 32c829f0288..00000000000
--- a/db/migrate/20210104163218_add_epic_board_position_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicBoardPositionIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_boards_epic_board_positions_on_scoped_relative_position'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :boards_epic_board_positions, [:epic_board_id, :epic_id, :relative_position], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :boards_epic_board_positions, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210105052034_rename_asset_proxy_whitelist_on_application_settings.rb b/db/migrate/20210105052034_rename_asset_proxy_whitelist_on_application_settings.rb
deleted file mode 100644
index cdfbd368070..00000000000
--- a/db/migrate/20210105052034_rename_asset_proxy_whitelist_on_application_settings.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RenameAssetProxyWhitelistOnApplicationSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers::V2
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- rename_column_concurrently :application_settings,
- :asset_proxy_whitelist,
- :asset_proxy_allowlist
- end
-
- def down
- undo_rename_column_concurrently :application_settings,
- :asset_proxy_whitelist,
- :asset_proxy_allowlist
- end
-end
diff --git a/db/migrate/20210105153342_add_entity_columns_to_vulnerability_occurrences.rb b/db/migrate/20210105153342_add_entity_columns_to_vulnerability_occurrences.rb
deleted file mode 100644
index 3b5ffff7645..00000000000
--- a/db/migrate/20210105153342_add_entity_columns_to_vulnerability_occurrences.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddEntityColumnsToVulnerabilityOccurrences < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20200501000002_add_text_limit_to_sprints_extended_title
- def change
- add_column :vulnerability_occurrences, :description, :text
- add_column :vulnerability_occurrences, :message, :text
- add_column :vulnerability_occurrences, :solution, :text
- add_column :vulnerability_occurrences, :cve, :text
- add_column :vulnerability_occurrences, :location, :jsonb
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210105154321_add_text_limit_to_vulnerability_occurrences_entity_columns.rb b/db/migrate/20210105154321_add_text_limit_to_vulnerability_occurrences_entity_columns.rb
deleted file mode 100644
index c2e138303d8..00000000000
--- a/db/migrate/20210105154321_add_text_limit_to_vulnerability_occurrences_entity_columns.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToVulnerabilityOccurrencesEntityColumns < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :vulnerability_occurrences, :description, 15000
- add_text_limit :vulnerability_occurrences, :message, 3000
- add_text_limit :vulnerability_occurrences, :solution, 7000
- add_text_limit :vulnerability_occurrences, :cve, 48400
- end
-
- def down
- remove_text_limit :vulnerability_occurrences, :description
- remove_text_limit :vulnerability_occurrences, :message
- remove_text_limit :vulnerability_occurrences, :solution
- remove_text_limit :vulnerability_occurrences, :cve
- end
-end
diff --git a/db/migrate/20210106061254_add_unique_index_for_golang_packages.rb b/db/migrate/20210106061254_add_unique_index_for_golang_packages.rb
deleted file mode 100644
index 44237699fda..00000000000
--- a/db/migrate/20210106061254_add_unique_index_for_golang_packages.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexForGolangPackages < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_golang'
- PACKAGE_TYPE_GOLANG = 8
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, where: "package_type = #{PACKAGE_TYPE_GOLANG}", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name(:packages_packages, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210106153021_drop_tmp_index_on_emails.rb b/db/migrate/20210106153021_drop_tmp_index_on_emails.rb
deleted file mode 100644
index 94b4a5437af..00000000000
--- a/db/migrate/20210106153021_drop_tmp_index_on_emails.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class DropTmpIndexOnEmails < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- EMAIL_INDEX_NAME = 'tmp_index_for_email_unconfirmation_migration'
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal('WrongfullyConfirmedEmailUnconfirmer')
-
- remove_concurrent_index_by_name(:emails, EMAIL_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:emails, :id, where: 'confirmed_at IS NOT NULL', name: EMAIL_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210106155209_add_merge_request_diff_commit_trailers.rb b/db/migrate/20210106155209_add_merge_request_diff_commit_trailers.rb
deleted file mode 100644
index 906efa58bcd..00000000000
--- a/db/migrate/20210106155209_add_merge_request_diff_commit_trailers.rb
+++ /dev/null
@@ -1,22 +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 AddMergeRequestDiffCommitTrailers < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :merge_request_diff_commits, :trailers, :jsonb, default: {}, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :merge_request_diff_commits, :trailers
- end
- end
-end
diff --git a/db/migrate/20210106191305_rename_indexes_on_git_lab_com.rb b/db/migrate/20210106191305_rename_indexes_on_git_lab_com.rb
deleted file mode 100644
index 5238192e1d1..00000000000
--- a/db/migrate/20210106191305_rename_indexes_on_git_lab_com.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-# This migration aligns an existing database schema with what we actually expect
-# and fixes inconsistencies with index names and similar issues.
-#
-# This is intended for GitLab.com, but can be run on any instance.
-class RenameIndexesOnGitLabCom < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- rename_index_if_exists :ldap_group_links, 'ldap_groups_pkey', 'ldap_group_links_pkey'
-
- # Removes unique constraint, add unique index instead
- replace_unique_constraint_with_index :emails, :email, 'emails_email_key', 'index_emails_on_email'
- replace_unique_constraint_with_index :users, :confirmation_token, 'users_confirmation_token_key', 'index_users_on_confirmation_token'
- replace_unique_constraint_with_index :users, :reset_password_token, 'users_reset_password_token_key', 'index_users_on_reset_password_token'
- replace_unique_constraint_with_index :users, :email, 'users_email_key', 'index_users_on_email'
-
- upgrade_to_primary_key(:schema_migrations, :version, 'schema_migrations_version_key', 'schema_migrations_pkey')
- end
-
- def down
- # no-op
- end
-
- private
-
- def replace_unique_constraint_with_index(table, columns, old_name, new_name)
- return unless index_exists_by_name?(table, old_name)
-
- add_concurrent_index table, columns, unique: true, name: new_name
- execute "ALTER TABLE #{quote_table_name(table)} DROP CONSTRAINT #{quote_table_name(old_name)}"
- end
-
- def rename_index_if_exists(table, old_name, new_name)
- return unless index_exists_by_name?(table, old_name)
- return if index_exists_by_name?(table, new_name)
-
- with_lock_retries do
- rename_index table, old_name, new_name
- end
- end
-
- def upgrade_to_primary_key(table, column, old_name, new_name)
- return unless index_exists_by_name?(table, old_name)
- return if index_exists_by_name?(table, new_name)
-
- return if primary_key(table)
-
- execute "ALTER TABLE #{quote_table_name(table)} ADD CONSTRAINT #{new_name} PRIMARY KEY (#{column})"
- execute "ALTER TABLE #{quote_table_name(table)} DROP CONSTRAINT #{old_name}"
- end
-end
diff --git a/db/migrate/20210106225424_add_keep_latest_artifacts_to_application_settings.rb b/db/migrate/20210106225424_add_keep_latest_artifacts_to_application_settings.rb
deleted file mode 100644
index 884159ddedb..00000000000
--- a/db/migrate/20210106225424_add_keep_latest_artifacts_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddKeepLatestArtifactsToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- # This is named keep_latest_artifact for consistency with the project level setting but
- # turning it on keeps all (multiple) artifacts on the latest pipeline per ref
- add_column :application_settings, :keep_latest_artifact, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20210107105306_add_diff_type_to_merge_request_diffs.rb b/db/migrate/20210107105306_add_diff_type_to_merge_request_diffs.rb
deleted file mode 100644
index 0b9b5e93054..00000000000
--- a/db/migrate/20210107105306_add_diff_type_to_merge_request_diffs.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class AddDiffTypeToMergeRequestDiffs < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- UNIQUE_INDEX_NAME = 'index_merge_request_diffs_on_unique_merge_request_id'
-
- def up
- unless column_exists?(:merge_request_diffs, :diff_type)
- with_lock_retries do
- add_column :merge_request_diffs, :diff_type, :integer, null: false, limit: 2, default: 1
- end
- end
-
- add_concurrent_index :merge_request_diffs, :merge_request_id, unique: true, where: 'diff_type = 2', name: UNIQUE_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name(:merge_request_diffs, UNIQUE_INDEX_NAME)
-
- if column_exists?(:merge_request_diffs, :diff_type)
- with_lock_retries do
- remove_column :merge_request_diffs, :diff_type
- end
- end
- end
-end
diff --git a/db/migrate/20210107154615_add_merge_request_context_commit_trailers.rb b/db/migrate/20210107154615_add_merge_request_context_commit_trailers.rb
deleted file mode 100644
index e7bd7c2ea56..00000000000
--- a/db/migrate/20210107154615_add_merge_request_context_commit_trailers.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddMergeRequestContextCommitTrailers < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :merge_request_context_commits, :trailers, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/migrate/20210108161039_update_max_import_size_default.rb b/db/migrate/20210108161039_update_max_import_size_default.rb
deleted file mode 100644
index 5f0591b2766..00000000000
--- a/db/migrate/20210108161039_update_max_import_size_default.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateMaxImportSizeDefault < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- change_column_default(:application_settings, :max_import_size, from: 50, to: 0)
- end
-end
diff --git a/db/migrate/20210111051045_create_dast_profiles.rb b/db/migrate/20210111051045_create_dast_profiles.rb
deleted file mode 100644
index f2667e1222e..00000000000
--- a/db/migrate/20210111051045_create_dast_profiles.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastProfiles < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- table_comment = { owner: 'group::dynamic analysis', description: 'Profile used to run a DAST on-demand scan' }
-
- create_table_with_constraints :dast_profiles, comment: table_comment.to_json do |t| # rubocop:disable Migration/AddLimitToTextColumns
- t.references :project, null: false, foreign_key: false, index: false
- t.references :dast_site_profile, null: false, foreign_key: { on_delete: :cascade }
- t.references :dast_scanner_profile, null: false, foreign_key: { on_delete: :cascade }
-
- t.timestamps_with_timezone
-
- # rubocop:disable Migration/AddLimitToTextColumns
- t.text :name, null: false
- t.text :description, null: false
- # rubocop:enable Migration/AddLimitToTextColumns
-
- t.index [:project_id, :name], unique: true
-
- t.text_limit :name, 255
- t.text_limit :description, 255
- end
- end
-
- def down
- with_lock_retries do
- drop_table :dast_profiles
- end
- end
-end
diff --git a/db/migrate/20210111053308_add_project_fk_for_dast_profile.rb b/db/migrate/20210111053308_add_project_fk_for_dast_profile.rb
deleted file mode 100644
index 5dc057b5f70..00000000000
--- a/db/migrate/20210111053308_add_project_fk_for_dast_profile.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectFkForDastProfile < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profiles, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_profiles, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20210111075104_add_temporary_index_on_security_findings_scan_id.rb b/db/migrate/20210111075104_add_temporary_index_on_security_findings_scan_id.rb
deleted file mode 100644
index a8f4e130f07..00000000000
--- a/db/migrate/20210111075104_add_temporary_index_on_security_findings_scan_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddTemporaryIndexOnSecurityFindingsScanId < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_index_on_security_findings_scan_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :security_findings, :scan_id, where: 'uuid is null', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :security_findings, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210112084512_drop_tmp_index_on_emails_again.rb b/db/migrate/20210112084512_drop_tmp_index_on_emails_again.rb
deleted file mode 100644
index 6c2f9cbcb32..00000000000
--- a/db/migrate/20210112084512_drop_tmp_index_on_emails_again.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class DropTmpIndexOnEmailsAgain < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- EMAIL_INDEX_NAME = 'tmp_index_for_email_unconfirmation_migration'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name(:emails, EMAIL_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:emails, :id, where: 'confirmed_at IS NOT NULL', name: EMAIL_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210112202949_create_composer_cache_file.rb b/db/migrate/20210112202949_create_composer_cache_file.rb
deleted file mode 100644
index b1c2a1608dd..00000000000
--- a/db/migrate/20210112202949_create_composer_cache_file.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class CreateComposerCacheFile < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- create_table_with_constraints :packages_composer_cache_files do |t|
- t.timestamps_with_timezone
-
- # record can be deleted after `delete_at`
- t.datetime_with_timezone :delete_at
-
- # which namespace it belongs to
- t.integer :namespace_id, null: true
-
- # file storage related fields
- t.integer :file_store, limit: 2, null: false, default: 1
- t.text :file, null: false
- t.binary :file_sha256, null: false
-
- t.index [:namespace_id, :file_sha256], name: "index_packages_composer_cache_namespace_and_sha", using: :btree, unique: true
- t.foreign_key :namespaces, column: :namespace_id, on_delete: :nullify
-
- t.text_limit :file, 255
- end
- end
-
- def down
- drop_table :packages_composer_cache_files
- end
-end
diff --git a/db/migrate/20210113224909_add_pipeline_configuration_full_path_to_compliance_pipeline.rb b/db/migrate/20210113224909_add_pipeline_configuration_full_path_to_compliance_pipeline.rb
deleted file mode 100644
index 408d0579031..00000000000
--- a/db/migrate/20210113224909_add_pipeline_configuration_full_path_to_compliance_pipeline.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddPipelineConfigurationFullPathToCompliancePipeline < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210119162812_add_text_limit_to_compliance_pipeline_configuration_full_path.rb
- def up
- add_column :compliance_management_frameworks, :pipeline_configuration_full_path, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- remove_column :compliance_management_frameworks, :pipeline_configuration_full_path
- end
-end
diff --git a/db/migrate/20210113231532_add_converted_at_to_experiment_subjects.rb b/db/migrate/20210113231532_add_converted_at_to_experiment_subjects.rb
deleted file mode 100644
index 25571b25af9..00000000000
--- a/db/migrate/20210113231532_add_converted_at_to_experiment_subjects.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddConvertedAtToExperimentSubjects < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :experiment_subjects, :converted_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210113231546_add_context_to_experiment_subjects.rb b/db/migrate/20210113231546_add_context_to_experiment_subjects.rb
deleted file mode 100644
index 7fac45e9952..00000000000
--- a/db/migrate/20210113231546_add_context_to_experiment_subjects.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddContextToExperimentSubjects < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :experiment_subjects, :context, :jsonb, default: {}, null: false
- end
-end
diff --git a/db/migrate/20210114033715_remove_group_id_title_index.rb b/db/migrate/20210114033715_remove_group_id_title_index.rb
deleted file mode 100644
index 8d63da3d400..00000000000
--- a/db/migrate/20210114033715_remove_group_id_title_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveGroupIdTitleIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_labels_on_group_id_and_title_with_null_project_id'
- LABELS_TABLE = :labels
-
- def up
- remove_concurrent_index_by_name LABELS_TABLE, INDEX_NAME
- end
-
- def down
- add_concurrent_index LABELS_TABLE, [:group_id, :title], where: 'project_id IS NULL', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210114142443_add_indexes_to_onboarding_progresses.rb b/db/migrate/20210114142443_add_indexes_to_onboarding_progresses.rb
deleted file mode 100644
index 39964047e7f..00000000000
--- a/db/migrate/20210114142443_add_indexes_to_onboarding_progresses.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexesToOnboardingProgresses < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- CREATE_TRACK_INDEX_NAME = 'index_onboarding_progresses_for_create_track'
- VERIFY_TRACK_INDEX_NAME = 'index_onboarding_progresses_for_verify_track'
- TRIAL_TRACK_INDEX_NAME = 'index_onboarding_progresses_for_trial_track'
- TEAM_TRACK_INDEX_NAME = 'index_onboarding_progresses_for_team_track'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :onboarding_progresses, :created_at, where: 'git_write_at IS NULL', name: CREATE_TRACK_INDEX_NAME
- add_concurrent_index :onboarding_progresses, :git_write_at, where: 'git_write_at IS NOT NULL AND pipeline_created_at IS NULL', name: VERIFY_TRACK_INDEX_NAME
- add_concurrent_index :onboarding_progresses, 'GREATEST(git_write_at, pipeline_created_at)', where: 'git_write_at IS NOT NULL AND pipeline_created_at IS NOT NULL AND trial_started_at IS NULL', name: TRIAL_TRACK_INDEX_NAME
- add_concurrent_index :onboarding_progresses, 'GREATEST(git_write_at, pipeline_created_at, trial_started_at)', where: 'git_write_at IS NOT NULL AND pipeline_created_at IS NOT NULL AND trial_started_at IS NOT NULL AND user_added_at IS NULL', name: TEAM_TRACK_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :onboarding_progresses, CREATE_TRACK_INDEX_NAME
- remove_concurrent_index_by_name :onboarding_progresses, VERIFY_TRACK_INDEX_NAME
- remove_concurrent_index_by_name :onboarding_progresses, TRIAL_TRACK_INDEX_NAME
- remove_concurrent_index_by_name :onboarding_progresses, TEAM_TRACK_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210115090452_create_group_repository_storage_move.rb b/db/migrate/20210115090452_create_group_repository_storage_move.rb
deleted file mode 100644
index bd168dce5ac..00000000000
--- a/db/migrate/20210115090452_create_group_repository_storage_move.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class CreateGroupRepositoryStorageMove < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- unless table_exists?(:group_repository_storage_moves)
- with_lock_retries do
- create_table :group_repository_storage_moves do |t|
- t.timestamps_with_timezone
- t.references :group, references: :namespace, column: :group_id, index: true, null: false
- t.integer :state, limit: 2, default: 1, null: false
- t.text :source_storage_name, null: false
- t.text :destination_storage_name, null: false
-
- t.foreign_key :namespaces, column: :group_id, on_delete: :cascade
- end
- end
- end
-
- add_text_limit(:group_repository_storage_moves, :source_storage_name, 255, constraint_name: 'group_repository_storage_moves_source_storage_name')
- add_text_limit(:group_repository_storage_moves, :destination_storage_name, 255, constraint_name: 'group_repository_storage_moves_destination_storage_name')
- end
-
- def down
- with_lock_retries do
- drop_table :group_repository_storage_moves
- end
- end
-end
diff --git a/db/migrate/20210117210226_add_has_external_issue_tracker_trigger.rb b/db/migrate/20210117210226_add_has_external_issue_tracker_trigger.rb
deleted file mode 100644
index 20fe0ee0fd1..00000000000
--- a/db/migrate/20210117210226_add_has_external_issue_tracker_trigger.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-# frozen_string_literal: true
-
-class AddHasExternalIssueTrackerTrigger < ActiveRecord::Migration[6.0]
- include Gitlab::Database::SchemaHelpers
-
- DOWNTIME = false
- FUNCTION_NAME = 'set_has_external_issue_tracker'
- TRIGGER_ON_INSERT_NAME = 'trigger_has_external_issue_tracker_on_insert'
- TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_issue_tracker_on_update'
- TRIGGER_ON_DELETE_NAME = 'trigger_has_external_issue_tracker_on_delete'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE projects SET has_external_issue_tracker = (
- EXISTS
- (
- SELECT 1
- FROM services
- 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
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON services
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND NEW.active = TRUE AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON services
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON services
- FOR EACH ROW
- WHEN (OLD.category = 'issue_tracker' AND OLD.active = TRUE AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:services, TRIGGER_ON_INSERT_NAME)
- drop_trigger(:services, TRIGGER_ON_UPDATE_NAME)
- drop_trigger(:services, TRIGGER_ON_DELETE_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210118111307_add_enforce_ssh_key_expiration_to_application_settings.rb b/db/migrate/20210118111307_add_enforce_ssh_key_expiration_to_application_settings.rb
deleted file mode 100644
index fd1ed4f207b..00000000000
--- a/db/migrate/20210118111307_add_enforce_ssh_key_expiration_to_application_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddEnforceSshKeyExpirationToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :enforce_ssh_key_expiration, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210119153801_add_proxy_settings_to_jira_tracker_data.rb b/db/migrate/20210119153801_add_proxy_settings_to_jira_tracker_data.rb
deleted file mode 100644
index 237ea25554d..00000000000
--- a/db/migrate/20210119153801_add_proxy_settings_to_jira_tracker_data.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddProxySettingsToJiraTrackerData < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :jira_tracker_data, :encrypted_proxy_address, :text
- add_column :jira_tracker_data, :encrypted_proxy_address_iv, :text
- add_column :jira_tracker_data, :encrypted_proxy_port, :text
- add_column :jira_tracker_data, :encrypted_proxy_port_iv, :text
- add_column :jira_tracker_data, :encrypted_proxy_username, :text
- add_column :jira_tracker_data, :encrypted_proxy_username_iv, :text
- add_column :jira_tracker_data, :encrypted_proxy_password, :text
- add_column :jira_tracker_data, :encrypted_proxy_password_iv, :text
- end
-end
diff --git a/db/migrate/20210119162812_add_text_limit_to_compliance_pipeline_configuration_full_path.rb b/db/migrate/20210119162812_add_text_limit_to_compliance_pipeline_configuration_full_path.rb
deleted file mode 100644
index 2958dc8d0ec..00000000000
--- a/db/migrate/20210119162812_add_text_limit_to_compliance_pipeline_configuration_full_path.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToCompliancePipelineConfigurationFullPath < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :compliance_management_frameworks, :pipeline_configuration_full_path, 255
- end
-
- def down
- remove_text_limit :compliance_management_frameworks, :pipeline_configuration_full_path
- end
-end
diff --git a/db/migrate/20210120180956_extend_index_on_ci_builds_metadata.rb b/db/migrate/20210120180956_extend_index_on_ci_builds_metadata.rb
deleted file mode 100644
index 421a2fac1ae..00000000000
--- a/db/migrate/20210120180956_extend_index_on_ci_builds_metadata.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class ExtendIndexOnCiBuildsMetadata < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- OLD_INDEX = :index_ci_builds_metadata_on_build_id_and_interruptible
- NEW_INDEX = :index_ci_builds_metadata_on_build_id_and_id_and_interruptible
-
- TABLE = :ci_builds_metadata
-
- def up
- create_covering_index(TABLE, NEW_INDEX)
-
- remove_concurrent_index_by_name TABLE, OLD_INDEX
- end
-
- def down
- add_concurrent_index TABLE, :build_id, where: 'interruptible = true', name: OLD_INDEX
-
- remove_concurrent_index_by_name TABLE, NEW_INDEX
- end
-
- private
-
- 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) INCLUDE (id)
- WHERE interruptible = true
- SQL
- end
- end
-end
diff --git a/db/migrate/20210120221743_delete_oauth_applications_tmp_index.rb b/db/migrate/20210120221743_delete_oauth_applications_tmp_index.rb
deleted file mode 100644
index d29e63ba5da..00000000000
--- a/db/migrate/20210120221743_delete_oauth_applications_tmp_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteOauthApplicationsTmpIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_index_oauth_applications_on_id_where_trusted'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :oauth_applications, INDEX_NAME
- end
-
- def down
- add_concurrent_index :oauth_applications, :id, where: 'trusted = true', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb b/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb
deleted file mode 100644
index 0b353ba5d88..00000000000
--- a/db/migrate/20210121093618_remove_repository_read_only_to_groups.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveRepositoryReadOnlyToGroups < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- if column_exists?(:namespaces, :repository_read_only)
- with_lock_retries do
- remove_column :namespaces, :repository_read_only # rubocop:disable Migration/RemoveColumn
- end
- end
- end
-
- def down
- unless column_exists?(:namespaces, :repository_read_only)
- with_lock_retries do
- add_column :namespaces, :repository_read_only, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
- end
- end
- end
-end
diff --git a/db/migrate/20210121100038_add_devops_adoption_group_segment.rb b/db/migrate/20210121100038_add_devops_adoption_group_segment.rb
deleted file mode 100644
index 619657e7f56..00000000000
--- a/db/migrate/20210121100038_add_devops_adoption_group_segment.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionGroupSegment < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_column :analytics_devops_adoption_segments, :namespace_id, :integer, if_not_exists: true
- add_concurrent_index :analytics_devops_adoption_segments, :namespace_id, unique: true
- end
-
- def down
- remove_column :analytics_devops_adoption_segments, :namespace_id
- end
-end
diff --git a/db/migrate/20210121121102_optional_devops_adoption_segment_name.rb b/db/migrate/20210121121102_optional_devops_adoption_segment_name.rb
deleted file mode 100644
index d7fda093cfc..00000000000
--- a/db/migrate/20210121121102_optional_devops_adoption_segment_name.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class OptionalDevopsAdoptionSegmentName < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_analytics_devops_adoption_segments_on_name'
-
- def up
- change_column_null :analytics_devops_adoption_segments, :name, true
- remove_concurrent_index_by_name :analytics_devops_adoption_segments, INDEX_NAME
- end
-
- def down
- transaction do
- execute "DELETE FROM analytics_devops_adoption_segments WHERE name IS NULL"
- change_column_null :analytics_devops_adoption_segments, :name, false
- end
- add_concurrent_index :analytics_devops_adoption_segments, :name, unique: true, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210122073805_add_repository_read_only_to_namespace_settings.rb b/db/migrate/20210122073805_add_repository_read_only_to_namespace_settings.rb
deleted file mode 100644
index f6479bdb3a4..00000000000
--- a/db/migrate/20210122073805_add_repository_read_only_to_namespace_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddRepositoryReadOnlyToNamespaceSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :namespace_settings, :repository_read_only, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_settings, :repository_read_only
- end
- end
-end
diff --git a/db/migrate/20210122153259_add_state_to_merge_request_reviewers.rb b/db/migrate/20210122153259_add_state_to_merge_request_reviewers.rb
deleted file mode 100644
index dd0c98615f7..00000000000
--- a/db/migrate/20210122153259_add_state_to_merge_request_reviewers.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateToMergeRequestReviewers < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- REVIEW_DEFAULT_STATE = 0
-
- def change
- add_column :merge_request_reviewers, :state, :smallint, default: REVIEW_DEFAULT_STATE, null: false
- end
-end
diff --git a/db/migrate/20210122155158_add_pipeline_step_to_bulk_imports_failures.rb b/db/migrate/20210122155158_add_pipeline_step_to_bulk_imports_failures.rb
deleted file mode 100644
index 749e0b16eaf..00000000000
--- a/db/migrate/20210122155158_add_pipeline_step_to_bulk_imports_failures.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddPipelineStepToBulkImportsFailures < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:bulk_import_failures, :pipeline_step, :text)
- with_lock_retries do
- add_column :bulk_import_failures, :pipeline_step, :text
- end
- end
-
- add_text_limit :bulk_import_failures, :pipeline_step, 255
- end
-
- def down
- with_lock_retries do
- remove_column :bulk_import_failures, :pipeline_step
- end
- end
-end
diff --git a/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb b/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb
deleted file mode 100644
index c7c18ae69d0..00000000000
--- a/db/migrate/20210125105410_add_devops_adoption_segment_namespace_fk.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSegmentNamespaceFk < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :namespace_id
- end
-
- def down
- remove_foreign_key_if_exists :analytics_devops_adoption_segments, :namespaces, column: :namespace_id
- end
-end
diff --git a/db/migrate/20210126030249_add_security_dashboard_access_level_into_project_features.rb b/db/migrate/20210126030249_add_security_dashboard_access_level_into_project_features.rb
deleted file mode 100644
index cd325747282..00000000000
--- a/db/migrate/20210126030249_add_security_dashboard_access_level_into_project_features.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityDashboardAccessLevelIntoProjectFeatures < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- PRIVATE_ACCESS_LEVEL = 10
-
- def up
- with_lock_retries do
- add_column :project_features, :security_and_compliance_access_level, :integer, default: PRIVATE_ACCESS_LEVEL, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_features, :security_and_compliance_access_level
- end
- end
-end
diff --git a/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb b/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb
deleted file mode 100644
index 272dca70a8b..00000000000
--- a/db/migrate/20210126091713_add_unique_index_services_project_id_and_type.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexServicesProjectIdAndType < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_services_on_project_id_and_type_unique'
-
- def up
- add_concurrent_index :services, [:project_id, :type], name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :services, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb b/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb
deleted file mode 100644
index 49780d03b7b..00000000000
--- a/db/migrate/20210126092102_remove_index_services_project_id_and_type.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexServicesProjectIdAndType < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_services_on_project_id_and_type'
-
- # Replaced by the index added in 20210126091713_add_unique_index_services_project_id_and_type.rb
- def up
- remove_concurrent_index_by_name :services, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :services, [:project_id, :type], name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210126233608_add_rubygems_max_file_size_to_plan_limits.rb b/db/migrate/20210126233608_add_rubygems_max_file_size_to_plan_limits.rb
deleted file mode 100644
index e0e7e773d17..00000000000
--- a/db/migrate/20210126233608_add_rubygems_max_file_size_to_plan_limits.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddRubygemsMaxFileSizeToPlanLimits < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :plan_limits, :rubygems_max_file_size, :bigint, default: 3.gigabytes, null: false
- end
-end
diff --git a/db/migrate/20210127052226_add_subgroup_events_to_web_hooks.rb b/db/migrate/20210127052226_add_subgroup_events_to_web_hooks.rb
deleted file mode 100644
index fe2b2ef412d..00000000000
--- a/db/migrate/20210127052226_add_subgroup_events_to_web_hooks.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddSubgroupEventsToWebHooks < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :web_hooks, :subgroup_events, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210127143025_add_oldest_merge_requests_index.rb b/db/migrate/20210127143025_add_oldest_merge_requests_index.rb
deleted file mode 100644
index c25e12d89af..00000000000
--- a/db/migrate/20210127143025_add_oldest_merge_requests_index.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddOldestMergeRequestsIndex < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- # replaced by db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb
- end
-
- def down
- # replaced by db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb
- end
-end
diff --git a/db/migrate/20210127152613_add_iterations_cadence_date_range_constraint.rb b/db/migrate/20210127152613_add_iterations_cadence_date_range_constraint.rb
deleted file mode 100644
index 95ecd167076..00000000000
--- a/db/migrate/20210127152613_add_iterations_cadence_date_range_constraint.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class AddIterationsCadenceDateRangeConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- execute <<~SQL
- ALTER TABLE sprints
- ADD CONSTRAINT iteration_start_and_due_date_iterations_cadence_id_constraint
- EXCLUDE USING gist
- ( iterations_cadence_id WITH =,
- daterange(start_date, due_date, '[]') WITH &&
- )
- WHERE (group_id IS NOT NULL)
- SQL
- end
- end
-
- def down
- with_lock_retries do
- execute <<~SQL
- ALTER TABLE sprints
- DROP CONSTRAINT IF EXISTS iteration_start_and_due_date_iterations_cadence_id_constraint
- SQL
- end
- end
-end
diff --git a/db/migrate/20210127202613_remove_iteration_group_date_range_constraint.rb b/db/migrate/20210127202613_remove_iteration_group_date_range_constraint.rb
deleted file mode 100644
index e6c5eb1b411..00000000000
--- a/db/migrate/20210127202613_remove_iteration_group_date_range_constraint.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIterationGroupDateRangeConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- execute <<~SQL
- ALTER TABLE sprints
- DROP CONSTRAINT IF EXISTS iteration_start_and_due_daterange_group_id_constraint
- SQL
- end
- end
-
- def down
- with_lock_retries do
- execute <<~SQL
- ALTER TABLE sprints
- ADD CONSTRAINT iteration_start_and_due_daterange_group_id_constraint
- EXCLUDE USING gist
- ( group_id WITH =,
- daterange(start_date, due_date, '[]') WITH &&
- )
- WHERE (group_id IS NOT NULL)
- SQL
- end
- end
-end
diff --git a/db/migrate/20210128044930_add_git_two_factor_session_expiry_to_application_settings.rb b/db/migrate/20210128044930_add_git_two_factor_session_expiry_to_application_settings.rb
deleted file mode 100644
index 77a1dd2131b..00000000000
--- a/db/migrate/20210128044930_add_git_two_factor_session_expiry_to_application_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddGitTwoFactorSessionExpiryToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :git_two_factor_session_expiry, :integer, default: 15, null: false
- end
-end
diff --git a/db/migrate/20210128101707_add_prevent_merge_without_jira_issue_to_project_settings.rb b/db/migrate/20210128101707_add_prevent_merge_without_jira_issue_to_project_settings.rb
deleted file mode 100644
index 18f186294f1..00000000000
--- a/db/migrate/20210128101707_add_prevent_merge_without_jira_issue_to_project_settings.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddPreventMergeWithoutJiraIssueToProjectSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :project_settings, :prevent_merge_without_jira_issue, :boolean, null: false, default: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_settings, :prevent_merge_without_jira_issue
- end
- end
-end
diff --git a/db/migrate/20210128114526_add_auto_delete_at_to_environments.rb b/db/migrate/20210128114526_add_auto_delete_at_to_environments.rb
deleted file mode 100644
index 8f89c2f2ad0..00000000000
--- a/db/migrate/20210128114526_add_auto_delete_at_to_environments.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddAutoDeleteAtToEnvironments < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :environments, :auto_delete_at, :datetime_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- remove_column :environments, :auto_delete_at
- end
- end
-end
diff --git a/db/migrate/20210128140157_add_content_type_to_dependency_proxy_manifests.rb b/db/migrate/20210128140157_add_content_type_to_dependency_proxy_manifests.rb
deleted file mode 100644
index d016e3c20e2..00000000000
--- a/db/migrate/20210128140157_add_content_type_to_dependency_proxy_manifests.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class AddContentTypeToDependencyProxyManifests < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210128140232_add_text_limit_to_dependency_proxy_manifests_content_type.rb
- def change
- add_column :dependency_proxy_manifests, :content_type, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210128140232_add_text_limit_to_dependency_proxy_manifests_content_type.rb b/db/migrate/20210128140232_add_text_limit_to_dependency_proxy_manifests_content_type.rb
deleted file mode 100644
index 035e4795ce0..00000000000
--- a/db/migrate/20210128140232_add_text_limit_to_dependency_proxy_manifests_content_type.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToDependencyProxyManifestsContentType < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :dependency_proxy_manifests, :content_type, 255
- end
-
- def down
- remove_text_limit :dependency_proxy_manifests, :content_type
- end
-end
diff --git a/db/migrate/20210128152830_create_ci_namespace_monthly_usage.rb b/db/migrate/20210128152830_create_ci_namespace_monthly_usage.rb
deleted file mode 100644
index d6ee057a56b..00000000000
--- a/db/migrate/20210128152830_create_ci_namespace_monthly_usage.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiNamespaceMonthlyUsage < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- create_table :ci_namespace_monthly_usages, if_not_exists: true do |t|
- t.references :namespace, index: false, null: false
- t.date :date, null: false
- t.integer :additional_amount_available, null: false, default: 0
- t.decimal :amount_used, null: false, default: 0.0, precision: 18, scale: 2
-
- t.index [:namespace_id, :date], unique: true
- end
- end
-
- add_check_constraint :ci_namespace_monthly_usages, "(date = date_trunc('month', date))", 'ci_namespace_monthly_usages_year_month_constraint'
- end
-
- def down
- with_lock_retries do
- drop_table :ci_namespace_monthly_usages
- end
- end
-end
diff --git a/db/migrate/20210128172149_create_background_migration_tracking_tables.rb b/db/migrate/20210128172149_create_background_migration_tracking_tables.rb
deleted file mode 100644
index 767bd8737a3..00000000000
--- a/db/migrate/20210128172149_create_background_migration_tracking_tables.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBackgroundMigrationTrackingTables < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def change
- create_table_with_constraints :batched_background_migrations do |t|
- t.timestamps_with_timezone
- t.bigint :min_value, null: false, default: 1
- t.bigint :max_value, null: false
- t.integer :batch_size, null: false
- t.integer :sub_batch_size, null: false
- t.integer :interval, limit: 2, null: false
- t.integer :status, limit: 2, null: false, default: 0
- t.text :job_class_name, null: false
- t.text :batch_class_name, null: false,
- default: 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy'
- t.text :table_name, null: false
- t.text :column_name, null: false
- t.jsonb :job_arguments, null: false, default: '[]'
-
- t.text_limit :job_class_name, 100
- t.text_limit :batch_class_name, 100
- t.text_limit :table_name, 63
- t.text_limit :column_name, 63
-
- t.check_constraint :check_positive_min_value, 'min_value > 0'
- t.check_constraint :check_max_value_in_range, 'max_value >= min_value'
-
- t.check_constraint :check_positive_sub_batch_size, 'sub_batch_size > 0'
- t.check_constraint :check_batch_size_in_range, 'batch_size >= sub_batch_size'
-
- t.index %i[job_class_name table_name column_name], name: :index_batched_migrations_on_job_table_and_column_name
- end
-
- create_table :batched_background_migration_jobs do |t|
- t.timestamps_with_timezone
- t.datetime_with_timezone :started_at
- t.datetime_with_timezone :finished_at
- t.references :batched_background_migration, null: false, index: false, foreign_key: { on_delete: :cascade }
- t.bigint :min_value, null: false
- t.bigint :max_value, null: false
- t.integer :batch_size, null: false
- t.integer :sub_batch_size, null: false
- t.integer :status, limit: 2, null: false, default: 0
- t.integer :attempts, limit: 2, null: false, default: 0
-
- t.index [:batched_background_migration_id, :id], name: :index_batched_jobs_by_batched_migration_id_and_id
- end
- end
-
- def down
- drop_table :batched_background_migration_jobs
-
- drop_table :batched_background_migrations
- end
-end
diff --git a/db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb b/db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb
deleted file mode 100644
index 8285aceb24a..00000000000
--- a/db/migrate/20210129225244_add_index_to_oncall_shfts_on_starts_at_and_ends_at.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToOncallShftsOnStartsAtAndEndsAt < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- NEW_NAME = 'index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at'
- OLD_NAME = 'index_incident_management_oncall_shifts_on_rotation_id'
-
- def up
- add_concurrent_index :incident_management_oncall_shifts, %i[rotation_id starts_at ends_at], name: NEW_NAME
-
- remove_concurrent_index_by_name :incident_management_oncall_shifts, OLD_NAME
- end
-
- def down
- add_concurrent_index :incident_management_oncall_shifts, :rotation_id, name: OLD_NAME
-
- remove_concurrent_index_by_name :incident_management_oncall_shifts, NEW_NAME
- end
-end
diff --git a/db/migrate/20210201034649_add_active_periods_to_on_call_rotations.rb b/db/migrate/20210201034649_add_active_periods_to_on_call_rotations.rb
deleted file mode 100644
index 714187f60e0..00000000000
--- a/db/migrate/20210201034649_add_active_periods_to_on_call_rotations.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddActivePeriodsToOnCallRotations < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :incident_management_oncall_rotations, :active_period_start, :time, null: true
- add_column :incident_management_oncall_rotations, :active_period_end, :time, null: true
- end
-end
diff --git a/db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb b/db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb
deleted file mode 100644
index a3fed9e576a..00000000000
--- a/db/migrate/20210201140434_add_oldest_merge_requests_index_again.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-class AddOldestMergeRequestsIndexAgain < ActiveRecord::Migration[6.0]
- include Gitlab::Database::SchemaHelpers
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- DOWNTIME = false
-
- INDEX = 'index_on_merge_requests_for_latest_diffs'
-
- def up
- execute "DROP INDEX CONCURRENTLY #{INDEX}" if invalid_index?
-
- return if index_exists_by_name?('merge_requests', INDEX)
-
- begin
- disable_statement_timeout do
- execute "CREATE INDEX CONCURRENTLY #{INDEX} ON merge_requests " \
- 'USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id)'
- end
- rescue ActiveRecord::StatementInvalid => ex
- # Due to https://github.com/lfittl/pg_query/issues/184, if the CREATE
- # INDEX statement fails, we trigger a separate error due to the Gem not
- # supporting the INCLUDE syntax.
- #
- # To work around this, we raise a custom error instead, as these won't
- # have a query context injected.
- raise "The index #{INDEX} couldn't be added: #{ex.message}"
- end
-
- create_comment(
- 'INDEX',
- INDEX,
- 'Index used to efficiently obtain the oldest merge request for a commit SHA'
- )
- end
-
- def down
- return unless index_exists_by_name?('merge_requests', INDEX)
-
- disable_statement_timeout do
- execute "DROP INDEX CONCURRENTLY #{INDEX}"
- end
- end
-
- def invalid_index?
- result = execute(<<~SQL)
- SELECT pg_class.relname
- FROM pg_class, pg_index
- WHERE pg_index.indisvalid = false
- AND pg_index.indexrelid = pg_class.oid
- AND pg_class.relname = '#{INDEX}';
- SQL
-
- result.values.any?
- end
-end
diff --git a/db/migrate/20210203002331_drop_backup_label_index.rb b/db/migrate/20210203002331_drop_backup_label_index.rb
deleted file mode 100644
index 430d2d0fb79..00000000000
--- a/db/migrate/20210203002331_drop_backup_label_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class DropBackupLabelIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'backup_labels_project_id_title_idx'
-
- def up
- remove_concurrent_index_by_name(:backup_labels, name: INDEX_NAME)
- end
-
- def down
- add_concurrent_index :backup_labels, [:project_id, :title], name: INDEX_NAME, unique: true, where: 'group_id = NULL::integer'
- end
-end
diff --git a/db/migrate/20210203092540_remove_has_external_wiki_constraint.rb b/db/migrate/20210203092540_remove_has_external_wiki_constraint.rb
deleted file mode 100644
index 80b0cc11685..00000000000
--- a/db/migrate/20210203092540_remove_has_external_wiki_constraint.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveHasExternalWikiConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- # This reverts the following migration: add_not_null_constraint :projects, :has_external_wiki, validate: false
- if check_not_null_constraint_exists?(:projects, :has_external_wiki)
- remove_not_null_constraint :projects, :has_external_wiki
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210203092549_restore_has_external_wiki_default_value.rb b/db/migrate/20210203092549_restore_has_external_wiki_default_value.rb
deleted file mode 100644
index 37111b370a5..00000000000
--- a/db/migrate/20210203092549_restore_has_external_wiki_default_value.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class RestoreHasExternalWikiDefaultValue < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- class TmpProject < ActiveRecord::Base
- self.table_name = 'projects'
- end
-
- # This reverts the following migration: change_column_default(:projects, :has_external_wiki, from: nil, to: false)
- # We only change the column when the current default value is false
- def up
- # Find out the current default value
- column = TmpProject.columns.find { |c| c.name == 'has_external_wiki' }
- return unless column
-
- if column.default == 'false'
- with_lock_retries do
- change_column_default(:projects, :has_external_wiki, from: false, to: nil)
- end
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210203221631_create_packages_rubygems_metadata.rb b/db/migrate/20210203221631_create_packages_rubygems_metadata.rb
deleted file mode 100644
index f4ad5abf7e5..00000000000
--- a/db/migrate/20210203221631_create_packages_rubygems_metadata.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePackagesRubygemsMetadata < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- create_table_with_constraints :packages_rubygems_metadata, id: false do |t|
- t.timestamps_with_timezone
- t.references :package, primary_key: true, index: false, default: nil, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint
- t.text :authors
- t.text :files
- t.text :summary
-
- t.text :description
- t.text :email
- t.text :homepage
- t.text :licenses
- t.text :metadata
-
- t.text :author
- t.text :bindir
- t.text :cert_chain
- t.text :executables
- t.text :extensions
- t.text :extra_rdoc_files
- t.text :platform
- t.text :post_install_message
- t.text :rdoc_options
- t.text :require_paths
- t.text :required_ruby_version
- t.text :required_rubygems_version
- t.text :requirements
- t.text :rubygems_version
- t.text :signing_key
-
- t.text_limit :authors, 255
- t.text_limit :files, 255
- t.text_limit :summary, 1024
-
- t.text_limit :description, 1024
- t.text_limit :email, 255
- t.text_limit :homepage, 255
- t.text_limit :licenses, 255
- t.text_limit :metadata, 255
-
- t.text_limit :author, 255
- t.text_limit :bindir, 255
- t.text_limit :cert_chain, 255
- t.text_limit :executables, 255
- t.text_limit :extensions, 255
- t.text_limit :extra_rdoc_files, 255
- t.text_limit :platform, 255
- t.text_limit :post_install_message, 255
- t.text_limit :rdoc_options, 255
- t.text_limit :require_paths, 255
- t.text_limit :required_ruby_version, 255
- t.text_limit :required_rubygems_version, 255
- t.text_limit :requirements, 255
- t.text_limit :rubygems_version, 255
- t.text_limit :signing_key, 255
- end
- end
-
- def down
- drop_table :packages_rubygems_metadata
- end
-end
diff --git a/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb b/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb
deleted file mode 100644
index 9c6a27812a5..00000000000
--- a/db/migrate/20210203222620_add_expired_index_to_composer_cache_files.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddExpiredIndexToComposerCacheFiles < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'composer_cache_files_index_on_deleted_at'
-
- def up
- add_concurrent_index :packages_composer_cache_files, [:delete_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb b/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
deleted file mode 100644
index e2853977e5f..00000000000
--- a/db/migrate/20210203223551_add_orphan_index_to_composer_cache_files.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddOrphanIndexToComposerCacheFiles < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_composer_cache_files_where_namespace_id_is_null'
-
- def up
- add_concurrent_index :packages_composer_cache_files, :id, name: INDEX_NAME, where: 'namespace_id IS NULL'
- end
-
- def down
- remove_concurrent_index_by_name :packages_composer_cache_files, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210204152257_add_status_to_packages_packages.rb b/db/migrate/20210204152257_add_status_to_packages_packages.rb
deleted file mode 100644
index 4fd441048c6..00000000000
--- a/db/migrate/20210204152257_add_status_to_packages_packages.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToPackagesPackages < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :packages_packages, :status, :smallint, default: 0, null: false
- end
-end
diff --git a/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb b/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb
deleted file mode 100644
index ba0464f5ad6..00000000000
--- a/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddGroupIdToCiDailyBuildGroupReportResults < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column(:ci_daily_build_group_report_results, :group_id, :bigint)
- end
-end
diff --git a/db/migrate/20210205084357_create_ci_project_monthly_usage.rb b/db/migrate/20210205084357_create_ci_project_monthly_usage.rb
deleted file mode 100644
index c91bfa5ee1c..00000000000
--- a/db/migrate/20210205084357_create_ci_project_monthly_usage.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiProjectMonthlyUsage < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- create_table :ci_project_monthly_usages, if_not_exists: true do |t|
- t.references :project, foreign_key: { on_delete: :cascade }, index: false, null: false
- t.date :date, null: false
- t.decimal :amount_used, null: false, default: 0.0, precision: 18, scale: 2
-
- t.index [:project_id, :date], unique: true
- end
- end
-
- add_check_constraint :ci_project_monthly_usages, "(date = date_trunc('month', date))", 'ci_project_monthly_usages_year_month_constraint'
- end
-
- def down
- with_lock_retries do
- drop_table :ci_project_monthly_usages
- end
- end
-end
diff --git a/db/migrate/20210205134213_add_creator_id_to_custom_emoji.rb b/db/migrate/20210205134213_add_creator_id_to_custom_emoji.rb
deleted file mode 100644
index c01335767a8..00000000000
--- a/db/migrate/20210205134213_add_creator_id_to_custom_emoji.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatorIdToCustomEmoji < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- # Custom Emoji is at the moment behind a default-disabled feature flag. It
- # will be unlikely there are any records in this table, but to able to
- # ensure a not-null constraint delete any existing rows.
- # Roll-out issue: https://gitlab.com/gitlab-org/gitlab/-/issues/231317
- execute 'DELETE FROM custom_emoji'
-
- add_reference :custom_emoji, # rubocop:disable Migration/AddReference
- :creator,
- index: true,
- null: false, # rubocop:disable Rails/NotNullColumn
- foreign_key: false # FK is added in 20210219100137
- end
-
- def down
- remove_reference :custom_emoji, :creator
- end
-end
diff --git a/db/migrate/20210205143926_remove_namespace_id_foreign_key_on_namespace_onboarding_actions.rb b/db/migrate/20210205143926_remove_namespace_id_foreign_key_on_namespace_onboarding_actions.rb
deleted file mode 100644
index 6fe66430dd0..00000000000
--- a/db/migrate/20210205143926_remove_namespace_id_foreign_key_on_namespace_onboarding_actions.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNamespaceIdForeignKeyOnNamespaceOnboardingActions < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- remove_foreign_key :namespace_onboarding_actions, :namespaces
- end
- end
-
- def down
- with_lock_retries do
- add_foreign_key :namespace_onboarding_actions, :namespaces, on_delete: :cascade
- end
- end
-end
diff --git a/db/migrate/20210205213915_remove_foreign_keys_from_alerts_service_data.rb b/db/migrate/20210205213915_remove_foreign_keys_from_alerts_service_data.rb
deleted file mode 100644
index 1d539f783b4..00000000000
--- a/db/migrate/20210205213915_remove_foreign_keys_from_alerts_service_data.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromAlertsServiceData < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists :alerts_service_data, column: :service_id
- end
- end
-
- def down
- with_lock_retries do
- add_foreign_key :alerts_service_data, :services, column: :service_id, on_delete: :cascade
- end
- end
-end
diff --git a/db/migrate/20210208103243_add_issue_created_at_to_onboarding_progress.rb b/db/migrate/20210208103243_add_issue_created_at_to_onboarding_progress.rb
deleted file mode 100644
index e8318ecd929..00000000000
--- a/db/migrate/20210208103243_add_issue_created_at_to_onboarding_progress.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueCreatedAtToOnboardingProgress < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :onboarding_progresses, :issue_created_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210208125050_add_status_expires_at_to_user_statuses.rb b/db/migrate/20210208125050_add_status_expires_at_to_user_statuses.rb
deleted file mode 100644
index 3ec1f6014a8..00000000000
--- a/db/migrate/20210208125050_add_status_expires_at_to_user_statuses.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusExpiresAtToUserStatuses < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column(:user_statuses, :clear_status_at, :datetime_with_timezone, null: true)
- end
- end
-
- def down
- with_lock_retries do
- remove_column(:user_statuses, :clear_status_at)
- end
- end
-end
diff --git a/db/migrate/20210208125248_add_index_on_user_statuses_status_expires_at.rb b/db/migrate/20210208125248_add_index_on_user_statuses_status_expires_at.rb
deleted file mode 100644
index 98f3449c2e8..00000000000
--- a/db/migrate/20210208125248_add_index_on_user_statuses_status_expires_at.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexOnUserStatusesStatusExpiresAt < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_user_statuses_on_clear_status_at_not_null'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:user_statuses, :clear_status_at, name: INDEX_NAME, where: 'clear_status_at IS NOT NULL')
- end
-
- def down
- remove_concurrent_index_by_name(:user_statuses, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb b/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb
deleted file mode 100644
index 422d8174043..00000000000
--- a/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexGroupIdToCiDailyBuildGroupReportResults < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_ci_daily_build_group_report_results_on_group_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:ci_daily_build_group_report_results, :group_id, name: INDEX_NAME)
- add_concurrent_foreign_key(:ci_daily_build_group_report_results, :namespaces, column: :group_id)
- end
-
- def down
- remove_foreign_key_if_exists(:ci_daily_build_group_report_results, column: :group_id)
- remove_concurrent_index_by_name(:ci_daily_build_group_report_results, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210208161207_add_notes_create_limit_to_application_settings.rb b/db/migrate/20210208161207_add_notes_create_limit_to_application_settings.rb
deleted file mode 100644
index 4468da77e6c..00000000000
--- a/db/migrate/20210208161207_add_notes_create_limit_to_application_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotesCreateLimitToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :notes_create_limit, :integer, default: 300, null: false
- end
-end
diff --git a/db/migrate/20210208200914_add_ends_at_to_oncall_rotations.rb b/db/migrate/20210208200914_add_ends_at_to_oncall_rotations.rb
deleted file mode 100644
index 5cd179c9a80..00000000000
--- a/db/migrate/20210208200914_add_ends_at_to_oncall_rotations.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddEndsAtToOncallRotations < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :incident_management_oncall_rotations, :ends_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210209110019_create_external_approval_rules.rb b/db/migrate/20210209110019_create_external_approval_rules.rb
deleted file mode 100644
index 5d6780ec412..00000000000
--- a/db/migrate/20210209110019_create_external_approval_rules.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-class CreateExternalApprovalRules < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- DOWNTIME = false
-
- def up
- create_table_with_constraints :external_approval_rules, 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_approval_rules_project_id_name')
- t.index([:project_id, :external_url],
- unique: true,
- name: 'idx_on_external_approval_rules_project_id_external_url')
- end
-
- create_table :external_approval_rules_protected_branches do |t|
- t.bigint :external_approval_rule_id, null: false, index: { name: 'idx_eaprpb_external_approval_rule_id' }
- t.bigint :protected_branch_id, null: false
- t.index([:protected_branch_id, :external_approval_rule_id],
- unique: true,
- name: 'idx_protected_branch_id_external_approval_rule_id')
- end
- end
-
- def down
- with_lock_retries do
- drop_table :external_approval_rules_protected_branches, force: :cascade, if_exists: true
- end
-
- with_lock_retries do
- drop_table :external_approval_rules, force: :cascade, if_exists: true
- end
- end
-end
diff --git a/db/migrate/20210209160510_create_security_orchestration_policy_configurations.rb b/db/migrate/20210209160510_create_security_orchestration_policy_configurations.rb
deleted file mode 100644
index 896593c803f..00000000000
--- a/db/migrate/20210209160510_create_security_orchestration_policy_configurations.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class CreateSecurityOrchestrationPolicyConfigurations < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_PREFIX = 'index_sop_configs_'
-
- def up
- table_comment = { owner: 'group::container security', description: 'Configuration used to store relationship between project and security policy repository' }
-
- create_table_with_constraints :security_orchestration_policy_configurations, comment: table_comment.to_json do |t|
- t.references :project, null: false, foreign_key: { to_table: :projects, on_delete: :cascade }, index: { name: INDEX_PREFIX + 'on_project_id', unique: true }
- t.references :security_policy_management_project, null: false, foreign_key: { to_table: :projects, on_delete: :restrict }, index: { name: INDEX_PREFIX + 'on_security_policy_management_project_id', unique: true }
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- drop_table :security_orchestration_policy_configurations, force: :cascade
- end
- end
-end
diff --git a/db/migrate/20210209171525_add_status_index_to_packages_packages.rb b/db/migrate/20210209171525_add_status_index_to_packages_packages.rb
deleted file mode 100644
index cb956165d6e..00000000000
--- a/db/migrate/20210209171525_add_status_index_to_packages_packages.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusIndexToPackagesPackages < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_packages_packages_on_project_id_and_status'
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :status], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_packages, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210209232508_add_markdown_surround_selection_to_user_preferences.rb b/db/migrate/20210209232508_add_markdown_surround_selection_to_user_preferences.rb
deleted file mode 100644
index c4063a55d18..00000000000
--- a/db/migrate/20210209232508_add_markdown_surround_selection_to_user_preferences.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddMarkdownSurroundSelectionToUserPreferences < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :user_preferences, :markdown_surround_selection, :boolean, default: true, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :user_preferences, :markdown_surround_selection, :boolean
- end
- end
-end
diff --git a/db/migrate/20210210210232_add_notes_create_limit_allowlist_to_application_settings.rb b/db/migrate/20210210210232_add_notes_create_limit_allowlist_to_application_settings.rb
deleted file mode 100644
index 56feed3688c..00000000000
--- a/db/migrate/20210210210232_add_notes_create_limit_allowlist_to_application_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotesCreateLimitAllowlistToApplicationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :notes_create_limit_allowlist, :text, array: true, default: [], null: false
- end
-end
diff --git a/db/migrate/20210211195543_add_created_by_user_for_cluster_agent_token.rb b/db/migrate/20210211195543_add_created_by_user_for_cluster_agent_token.rb
deleted file mode 100644
index 94dc8192037..00000000000
--- a/db/migrate/20210211195543_add_created_by_user_for_cluster_agent_token.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatedByUserForClusterAgentToken < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_cluster_agent_tokens_on_created_by_user_id'
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:cluster_agent_tokens, :created_by_user_id)
- add_column :cluster_agent_tokens, :created_by_user_id, :bigint
- end
-
- add_concurrent_index :cluster_agent_tokens, :created_by_user_id, name: INDEX_NAME
- add_concurrent_foreign_key :cluster_agent_tokens, :users, column: :created_by_user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :cluster_agent_tokens, :users, column: :created_by_user_id
- end
-
- remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME
- remove_column :cluster_agent_tokens, :created_by_user_id
- end
-end
diff --git a/db/migrate/20210212153934_make_the_geo_oauth_application_trusted_by_default.rb b/db/migrate/20210212153934_make_the_geo_oauth_application_trusted_by_default.rb
deleted file mode 100644
index ab0343887e4..00000000000
--- a/db/migrate/20210212153934_make_the_geo_oauth_application_trusted_by_default.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class MakeTheGeoOauthApplicationTrustedByDefault < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- execute(<<-SQL.squish)
- UPDATE oauth_applications
- SET confidential = true, trusted = true
- WHERE id IN (SELECT oauth_application_id FROM geo_nodes);
- SQL
- end
-
- def down
- # We won't be able to tell which trusted applications weren't
- # confidential before the migration and setting all trusted
- # applications are not confidential would introduce security
- # issues.
- end
-end
diff --git a/db/migrate/20210212163231_add_merge_when_pipeline_succeeds_to_notification_settings.rb b/db/migrate/20210212163231_add_merge_when_pipeline_succeeds_to_notification_settings.rb
deleted file mode 100644
index 08d0a99436e..00000000000
--- a/db/migrate/20210212163231_add_merge_when_pipeline_succeeds_to_notification_settings.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddMergeWhenPipelineSucceedsToNotificationSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :notification_settings, :merge_when_pipeline_succeeds, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210214201118_add_delayed_project_removal_to_namespace_settings.rb b/db/migrate/20210214201118_add_delayed_project_removal_to_namespace_settings.rb
deleted file mode 100644
index 1c6e0b0c27c..00000000000
--- a/db/migrate/20210214201118_add_delayed_project_removal_to_namespace_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddDelayedProjectRemovalToNamespaceSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :namespace_settings, :delayed_project_removal, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb b/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb
deleted file mode 100644
index 8d09a5c9269..00000000000
--- a/db/migrate/20210214205155_add_index_to_namespaces_delayed_project_removal.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToNamespacesDelayedProjectRemoval < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_idx_on_namespaces_delayed_project_removal'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, :id, name: INDEX_NAME, where: 'delayed_project_removal = TRUE'
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210215172449_remove_artifact_expiry_temp_index.rb b/db/migrate/20210215172449_remove_artifact_expiry_temp_index.rb
deleted file mode 100644
index 1e6619731a2..00000000000
--- a/db/migrate/20210215172449_remove_artifact_expiry_temp_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveArtifactExpiryTempIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'expired_artifacts_temp_index'
- INDEX_CONDITION = "expire_at IS NULL AND date(created_at AT TIME ZONE 'UTC') < '2020-06-22'::date"
-
- def up
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- end
-
- def down
- add_concurrent_index(:ci_job_artifacts, %i(id created_at), where: INDEX_CONDITION, name: INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210216122140_add_in_product_marketing_emails_enabled_setting.rb b/db/migrate/20210216122140_add_in_product_marketing_emails_enabled_setting.rb
deleted file mode 100644
index 5813b1b5f33..00000000000
--- a/db/migrate/20210216122140_add_in_product_marketing_emails_enabled_setting.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddInProductMarketingEmailsEnabledSetting < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :in_product_marketing_emails_enabled, :boolean, null: false, default: true
- end
-end
diff --git a/db/migrate/20210216135504_add_created_by_to_cluster_agent.rb b/db/migrate/20210216135504_add_created_by_to_cluster_agent.rb
deleted file mode 100644
index fd679a1c525..00000000000
--- a/db/migrate/20210216135504_add_created_by_to_cluster_agent.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatedByToClusterAgent < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_cluster_agents_on_created_by_user_id'
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:cluster_agents, :created_by_user_id)
- with_lock_retries do
- add_column :cluster_agents, :created_by_user_id, :bigint
- end
- end
-
- add_concurrent_index :cluster_agents, :created_by_user_id, name: INDEX_NAME
- add_concurrent_foreign_key :cluster_agents, :users, column: :created_by_user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_column :cluster_agents, :created_by_user_id
- end
- end
-end
diff --git a/db/migrate/20210216193620_add_description_to_cluster_token.rb b/db/migrate/20210216193620_add_description_to_cluster_token.rb
deleted file mode 100644
index 67f7c6bd522..00000000000
--- a/db/migrate/20210216193620_add_description_to_cluster_token.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddDescriptionToClusterToken < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:cluster_agent_tokens, :description)
- add_column :cluster_agent_tokens, :description, :text
- end
-
- add_text_limit :cluster_agent_tokens, :description, 1024
- end
-
- def down
- remove_column :cluster_agent_tokens, :description
- end
-end
diff --git a/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb b/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb
deleted file mode 100644
index 5224b6f7031..00000000000
--- a/db/migrate/20210216223335_remove_index_on_issues_where_service_desk_reply_to_is_not_null.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexOnIssuesWhereServiceDeskReplyToIsNotNull < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- INDEX_TABLE = :issues
- INDEX_NAME = 'idx_on_issues_where_service_desk_reply_to_is_not_null'
-
- def up
- Gitlab::BackgroundMigration.steal('PopulateIssueEmailParticipants')
- remove_concurrent_index_by_name INDEX_TABLE, INDEX_NAME
- end
-
- def down
- add_concurrent_index(INDEX_TABLE, [:id], name: INDEX_NAME, where: 'service_desk_reply_to IS NOT NULL')
- end
-end
diff --git a/db/migrate/20210217101901_create_epic_list_user_preferences.rb b/db/migrate/20210217101901_create_epic_list_user_preferences.rb
deleted file mode 100644
index 5aacea1938d..00000000000
--- a/db/migrate/20210217101901_create_epic_list_user_preferences.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateEpicListUserPreferences < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- create_table :boards_epic_list_user_preferences do |t|
- t.bigint :user_id, null: false
- t.bigint :epic_list_id, index: true, null: false
- t.timestamps_with_timezone null: false
- t.boolean :collapsed, null: false, default: false
- end
-
- add_index :boards_epic_list_user_preferences, [:user_id, :epic_list_id], unique: true, name: 'index_epic_board_list_preferences_on_user_and_list'
- end
-
- def down
- drop_table :boards_epic_list_user_preferences
- end
-end
diff --git a/db/migrate/20210218040814_add_environment_scope_to_group_variables.rb b/db/migrate/20210218040814_add_environment_scope_to_group_variables.rb
deleted file mode 100644
index 5cc41f570aa..00000000000
--- a/db/migrate/20210218040814_add_environment_scope_to_group_variables.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-class AddEnvironmentScopeToGroupVariables < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- OLD_INDEX = 'index_ci_group_variables_on_group_id_and_key'
- NEW_INDEX = 'index_ci_group_variables_on_group_id_and_key_and_environment'
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:ci_group_variables, :environment_scope)
- # rubocop:disable Migration/AddLimitToTextColumns
- # Added in 20210305013509_add_text_limit_to_group_ci_variables_environment_scope
- add_column :ci_group_variables, :environment_scope, :text, null: false, default: '*'
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- add_concurrent_index :ci_group_variables, [:group_id, :key, :environment_scope], unique: true, name: NEW_INDEX
- remove_concurrent_index_by_name :ci_group_variables, OLD_INDEX
- end
-
- def down
- remove_duplicates!
-
- add_concurrent_index :ci_group_variables, [:group_id, :key], unique: true, name: OLD_INDEX
- remove_concurrent_index_by_name :ci_group_variables, NEW_INDEX
-
- remove_column :ci_group_variables, :environment_scope
- end
-
- private
-
- def remove_duplicates!
- execute <<-SQL
- DELETE FROM ci_group_variables
- WHERE id NOT IN (
- SELECT MIN(id)
- FROM ci_group_variables
- GROUP BY group_id, key
- )
- SQL
- end
-end
diff --git a/db/migrate/20210218142626_change_finding_fingerprint_enum.rb b/db/migrate/20210218142626_change_finding_fingerprint_enum.rb
deleted file mode 100644
index 615509e0c04..00000000000
--- a/db/migrate/20210218142626_change_finding_fingerprint_enum.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeFindingFingerprintEnum < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- change_column :vulnerability_finding_fingerprints, :algorithm_type, :integer, limit: 2
- end
-
- def down
- change_column :vulnerability_finding_fingerprints, :algorithm_type, :integer
- end
-end
diff --git a/db/migrate/20210218144056_add_sprints_start_date_not_null_check_constraint.rb b/db/migrate/20210218144056_add_sprints_start_date_not_null_check_constraint.rb
deleted file mode 100644
index 243080f49b2..00000000000
--- a/db/migrate/20210218144056_add_sprints_start_date_not_null_check_constraint.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddSprintsStartDateNotNullCheckConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_not_null_constraint(:sprints, :start_date, validate: false)
- end
-
- def down
- remove_not_null_constraint(:sprints, :start_date)
- end
-end
diff --git a/db/migrate/20210218144656_add_sprints_due_date_not_null_check_constraint.rb b/db/migrate/20210218144656_add_sprints_due_date_not_null_check_constraint.rb
deleted file mode 100644
index 9f3ed6fd13a..00000000000
--- a/db/migrate/20210218144656_add_sprints_due_date_not_null_check_constraint.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddSprintsDueDateNotNullCheckConstraint < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_not_null_constraint(:sprints, :due_date, validate: false)
- end
-
- def down
- remove_not_null_constraint(:sprints, :due_date)
- end
-end
diff --git a/db/migrate/20210219100137_add_creator_foreign_key_to_custom_emoji.rb b/db/migrate/20210219100137_add_creator_foreign_key_to_custom_emoji.rb
deleted file mode 100644
index a954ba5ba3b..00000000000
--- a/db/migrate/20210219100137_add_creator_foreign_key_to_custom_emoji.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddCreatorForeignKeyToCustomEmoji < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- FK_NAME = 'fk_custom_emoji_creator_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :custom_emoji, :users,
- on_delete: :cascade,
- column: :creator_id,
- name: FK_NAME
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :custom_emoji, name: FK_NAME
- end
- end
-end
diff --git a/db/migrate/20210219111040_add_epic_issue_composite_index.rb b/db/migrate/20210219111040_add_epic_issue_composite_index.rb
deleted file mode 100644
index f1344baf0c7..00000000000
--- a/db/migrate/20210219111040_add_epic_issue_composite_index.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicIssueCompositeIndex < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_epic_issues_on_epic_id_and_issue_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :epic_issues, [:epic_id, :issue_id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :epic_issues, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210219211845_add_version_usage_data_id_to_raw_usage_data.rb b/db/migrate/20210219211845_add_version_usage_data_id_to_raw_usage_data.rb
deleted file mode 100644
index 1b49fdd98bd..00000000000
--- a/db/migrate/20210219211845_add_version_usage_data_id_to_raw_usage_data.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddVersionUsageDataIdToRawUsageData < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :raw_usage_data, :version_usage_data_id_value, :bigint
- end
-end
diff --git a/db/migrate/20210222030537_add_is_removed_to_oncall_participant.rb b/db/migrate/20210222030537_add_is_removed_to_oncall_participant.rb
deleted file mode 100644
index 83b81a067ab..00000000000
--- a/db/migrate/20210222030537_add_is_removed_to_oncall_participant.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddIsRemovedToOncallParticipant < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :incident_management_oncall_participants, :is_removed, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :incident_management_oncall_participants, :is_removed
- end
- end
-end
diff --git a/db/migrate/20210222042745_add_is_removed_index_to_oncall_participant.rb b/db/migrate/20210222042745_add_is_removed_index_to_oncall_participant.rb
deleted file mode 100644
index cfa9b1b89c9..00000000000
--- a/db/migrate/20210222042745_add_is_removed_index_to_oncall_participant.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddIsRemovedIndexToOncallParticipant < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- DOWNTIME = false
- EXISTING_INDEX_NAME = 'index_inc_mgmnt_oncall_participants_on_oncall_rotation_id'
- NEW_INDEX_NAME = 'index_inc_mgmnt_oncall_pcpnt_on_oncall_rotation_id_is_removed'
-
- def up
- add_concurrent_index :incident_management_oncall_participants, [:oncall_rotation_id, :is_removed], name: NEW_INDEX_NAME
- remove_concurrent_index_by_name(:incident_management_oncall_participants, EXISTING_INDEX_NAME)
- end
-
- def down
- add_concurrent_index :incident_management_oncall_participants, :oncall_rotation_id, name: EXISTING_INDEX_NAME
- remove_concurrent_index_by_name(:incident_management_oncall_participants, NEW_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210222070356_add_storage_size_to_namespace_statistics.rb b/db/migrate/20210222070356_add_storage_size_to_namespace_statistics.rb
deleted file mode 100644
index 838c22382c6..00000000000
--- a/db/migrate/20210222070356_add_storage_size_to_namespace_statistics.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddStorageSizeToNamespaceStatistics < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :namespace_statistics, :storage_size, :bigint, default: 0, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_statistics, :storage_size
- end
- end
-end
diff --git a/db/migrate/20210222070413_add_wiki_size_to_namespace_statistics.rb b/db/migrate/20210222070413_add_wiki_size_to_namespace_statistics.rb
deleted file mode 100644
index 9e6ced9fd64..00000000000
--- a/db/migrate/20210222070413_add_wiki_size_to_namespace_statistics.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddWikiSizeToNamespaceStatistics < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :namespace_statistics, :wiki_size, :bigint, default: 0, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_statistics, :wiki_size
- end
- end
-end
diff --git a/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb b/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb
deleted file mode 100644
index 52de892a177..00000000000
--- a/db/migrate/20210222085529_add_epic_board_user_preference_user_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicBoardUserPreferenceUserFk < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :boards_epic_list_user_preferences, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :boards_epic_list_user_preferences, :users
- end
- end
-end
diff --git a/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb b/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb
deleted file mode 100644
index 3f62036b899..00000000000
--- a/db/migrate/20210222085551_add_epic_board_user_preference_epic_list_fk.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddEpicBoardUserPreferenceEpicListFk < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :boards_epic_list_user_preferences, :boards_epic_lists, column: :epic_list_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :boards_epic_list_user_preferences, :boards_epic_lists
- end
- end
-end
diff --git a/db/migrate/20210222105120_add_container_registry_access_level.rb b/db/migrate/20210222105120_add_container_registry_access_level.rb
deleted file mode 100644
index 2324866b0ef..00000000000
--- a/db/migrate/20210222105120_add_container_registry_access_level.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddContainerRegistryAccessLevel < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column(
- :project_features,
- :container_registry_access_level,
- :integer,
- default: 0, # ProjectFeature::DISABLED value
- null: false
- )
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_features, :container_registry_access_level
- end
- end
-end
diff --git a/db/migrate/20210223053451_add_branch_name_to_dast_profile.rb b/db/migrate/20210223053451_add_branch_name_to_dast_profile.rb
deleted file mode 100644
index 311e809103f..00000000000
--- a/db/migrate/20210223053451_add_branch_name_to_dast_profile.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddBranchNameToDastProfile < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :dast_profiles, :branch_name, :text
- end
-
- add_text_limit :dast_profiles, :branch_name, 255
- end
-
- def down
- with_lock_retries do
- remove_column :dast_profiles, :branch_name
- end
- end
-end
diff --git a/db/migrate/20210223132934_add_foreign_key_to_external_approval_rules.rb b/db/migrate/20210223132934_add_foreign_key_to_external_approval_rules.rb
deleted file mode 100644
index b5f04672813..00000000000
--- a/db/migrate/20210223132934_add_foreign_key_to_external_approval_rules.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToExternalApprovalRules < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_approval_rules_protected_branches, :external_approval_rules, column: :external_approval_rule_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_approval_rules_protected_branches, column: :external_approval_rule_id
- end
- end
-end
diff --git a/db/migrate/20210223133116_add_foreign_key_to_external_approval_rules_protected_branches.rb b/db/migrate/20210223133116_add_foreign_key_to_external_approval_rules_protected_branches.rb
deleted file mode 100644
index ad51f765d8a..00000000000
--- a/db/migrate/20210223133116_add_foreign_key_to_external_approval_rules_protected_branches.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToExternalApprovalRulesProtectedBranches < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_approval_rules_protected_branches, :protected_branches, column: :protected_branch_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_approval_rules_protected_branches, column: :protected_branch_id
- end
- end
-end
diff --git a/db/migrate/20210223230600_update_rubygems_metadata_metadata.rb b/db/migrate/20210223230600_update_rubygems_metadata_metadata.rb
deleted file mode 100644
index 39e79be301e..00000000000
--- a/db/migrate/20210223230600_update_rubygems_metadata_metadata.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateRubygemsMetadataMetadata < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- remove_text_limit :packages_rubygems_metadata, :metadata
- add_text_limit :packages_rubygems_metadata, :metadata, 30000
- end
-
- def down
- remove_text_limit :packages_rubygems_metadata, :metadata
- add_text_limit :packages_rubygems_metadata, :metadata, 255, validate: false
- end
-end
diff --git a/db/migrate/20210224132547_add_null_constraint_to_terraform_state_name.rb b/db/migrate/20210224132547_add_null_constraint_to_terraform_state_name.rb
deleted file mode 100644
index d9f23311cf5..00000000000
--- a/db/migrate/20210224132547_add_null_constraint_to_terraform_state_name.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddNullConstraintToTerraformStateName < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def change
- change_column_null :terraform_states, :name, false
- end
-end
diff --git a/db/migrate/20210224133337_add_name_field_to_cluster_agent_token.rb b/db/migrate/20210224133337_add_name_field_to_cluster_agent_token.rb
deleted file mode 100644
index 2cec37f8477..00000000000
--- a/db/migrate/20210224133337_add_name_field_to_cluster_agent_token.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class AddNameFieldToClusterAgentToken < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in LimitClusterTokenSize
- def change
- add_column :cluster_agent_tokens, :name, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210224161552_add_jira_issue_transition_automatic_to_jira_tracker_data.rb b/db/migrate/20210224161552_add_jira_issue_transition_automatic_to_jira_tracker_data.rb
deleted file mode 100644
index 6c788b9d554..00000000000
--- a/db/migrate/20210224161552_add_jira_issue_transition_automatic_to_jira_tracker_data.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddJiraIssueTransitionAutomaticToJiraTrackerData < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- add_column :jira_tracker_data, :jira_issue_transition_automatic, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210225090801_create_dora_daily_metrics.rb b/db/migrate/20210225090801_create_dora_daily_metrics.rb
deleted file mode 100644
index 65c1dbc23e4..00000000000
--- a/db/migrate/20210225090801_create_dora_daily_metrics.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDoraDailyMetrics < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- create_table :dora_daily_metrics, if_not_exists: true do |t|
- t.references :environment, null: false, foreign_key: { on_delete: :cascade }, index: false
- t.date :date, null: false
- t.integer :deployment_frequency
- t.integer :lead_time_for_changes_in_seconds
-
- t.index [:environment_id, :date], unique: true
- end
- end
-
- add_check_constraint :dora_daily_metrics, "deployment_frequency >= 0", 'dora_daily_metrics_deployment_frequency_positive'
- add_check_constraint :dora_daily_metrics, "lead_time_for_changes_in_seconds >= 0", 'dora_daily_metrics_lead_time_for_changes_in_seconds_positive'
- end
-
- def down
- with_lock_retries do
- drop_table :dora_daily_metrics
- end
- end
-end
diff --git a/db/migrate/20210225135533_limit_cluster_token_size.rb b/db/migrate/20210225135533_limit_cluster_token_size.rb
deleted file mode 100644
index 6a1b6b7b4e8..00000000000
--- a/db/migrate/20210225135533_limit_cluster_token_size.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class LimitClusterTokenSize < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :cluster_agent_tokens, :name, 255
- end
-
- def down
- remove_text_limit :cluster_agent_tokens, :name
- end
-end
diff --git a/db/migrate/20210225153522_add_allow_force_push_to_protected_branches.rb b/db/migrate/20210225153522_add_allow_force_push_to_protected_branches.rb
deleted file mode 100644
index 92a15cb45dd..00000000000
--- a/db/migrate/20210225153522_add_allow_force_push_to_protected_branches.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddAllowForcePushToProtectedBranches < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :protected_branches, :allow_force_push, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :protected_branches, :allow_force_push
- end
- end
-end
diff --git a/db/migrate/20210301150451_add_tier_to_environments.rb b/db/migrate/20210301150451_add_tier_to_environments.rb
deleted file mode 100644
index 28592dd2bf6..00000000000
--- a/db/migrate/20210301150451_add_tier_to_environments.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddTierToEnvironments < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :environments, :tier, :smallint
- end
- end
-
- def down
- with_lock_retries do
- remove_column :environments, :tier
- end
- end
-end
diff --git a/db/migrate/20210301193412_add_optional_to_ci_build_needs.rb b/db/migrate/20210301193412_add_optional_to_ci_build_needs.rb
deleted file mode 100644
index 2c6e85f930d..00000000000
--- a/db/migrate/20210301193412_add_optional_to_ci_build_needs.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddOptionalToCiBuildNeeds < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- add_column :ci_build_needs, :optional, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_build_needs, :optional
- end
- end
-end
diff --git a/db/migrate/20210301200601_rename_asset_proxy_allowlist_on_application_settings.rb b/db/migrate/20210301200601_rename_asset_proxy_allowlist_on_application_settings.rb
deleted file mode 100644
index 8ac334fc6a4..00000000000
--- a/db/migrate/20210301200601_rename_asset_proxy_allowlist_on_application_settings.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class RenameAssetProxyAllowlistOnApplicationSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers::V2
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- cleanup_concurrent_column_rename :application_settings,
- :asset_proxy_whitelist,
- :asset_proxy_allowlist
-
- rename_column_concurrently :application_settings,
- :asset_proxy_allowlist,
- :asset_proxy_whitelist
- end
-
- def down
- undo_rename_column_concurrently :application_settings,
- :asset_proxy_allowlist,
- :asset_proxy_whitelist
-
- undo_cleanup_concurrent_column_rename :application_settings,
- :asset_proxy_whitelist,
- :asset_proxy_allowlist
- end
-end
diff --git a/db/migrate/20181228175414_init_schema.rb b/db/migrate/20210301200959_init_schema.rb
index df68927d79a..df68927d79a 100644
--- a/db/migrate/20181228175414_init_schema.rb
+++ b/db/migrate/20210301200959_init_schema.rb
diff --git a/db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb b/db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb
deleted file mode 100644
index 3ecb48dab0f..00000000000
--- a/db/post_migrate/20201211090634_schedule_populate_finding_uuid_for_vulnerability_feedback.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class SchedulePopulateFindingUuidForVulnerabilityFeedback < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION_CLASS = 'PopulateFindingUuidForVulnerabilityFeedback'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 1000
-
- disable_ddl_transaction!
-
- def up
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::PopulateFindingUuidForVulnerabilityFeedback::VulnerabilityFeedback,
- MIGRATION_CLASS,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20201216185336_add_devops_adoption_snapshot_not_null.rb b/db/post_migrate/20201216185336_add_devops_adoption_snapshot_not_null.rb
deleted file mode 100644
index 1bb3c57f3cd..00000000000
--- a/db/post_migrate/20201216185336_add_devops_adoption_snapshot_not_null.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotNotNull < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- execute(
- <<~SQL
- LOCK TABLE analytics_devops_adoption_snapshots IN ACCESS EXCLUSIVE MODE;
-
- UPDATE analytics_devops_adoption_snapshots SET end_time = date_trunc('month', recorded_at) - interval '1 millisecond';
-
- ALTER TABLE analytics_devops_adoption_snapshots ALTER COLUMN end_time SET NOT NULL;
- SQL
- )
- end
- end
-
- def down
- with_lock_retries do
- execute(<<~SQL)
- ALTER TABLE analytics_devops_adoption_snapshots ALTER COLUMN end_time DROP NOT NULL;
- SQL
- end
- end
-end
diff --git a/db/post_migrate/20201217112249_change_pages_deployment_size_to_bigint_cleanup.rb b/db/post_migrate/20201217112249_change_pages_deployment_size_to_bigint_cleanup.rb
deleted file mode 100644
index 4ed29ba61f9..00000000000
--- a/db/post_migrate/20201217112249_change_pages_deployment_size_to_bigint_cleanup.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangePagesDeploymentSizeToBigintCleanup < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- cleanup_concurrent_column_type_change :pages_deployments, :size
- end
-
- def down
- undo_cleanup_concurrent_column_type_change :pages_deployments, :size, :integer, limit: 4
- end
-end
diff --git a/db/post_migrate/20201223012231_reindex_ci_pipelines_on_schedule_id_and_id.rb b/db/post_migrate/20201223012231_reindex_ci_pipelines_on_schedule_id_and_id.rb
deleted file mode 100644
index 9ed1aea911a..00000000000
--- a/db/post_migrate/20201223012231_reindex_ci_pipelines_on_schedule_id_and_id.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class ReindexCiPipelinesOnScheduleIdAndId < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- OLD_INDEX_NAME = 'index_ci_pipelines_on_pipeline_schedule_id'
- NEW_INDEX_NAME = 'index_ci_pipelines_on_pipeline_schedule_id_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_pipelines, [:pipeline_schedule_id, :id], name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :ci_pipelines, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :ci_pipelines, :pipeline_schedule_id, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :ci_pipelines, NEW_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20201231133921_schedule_set_default_iteration_cadences.rb b/db/post_migrate/20201231133921_schedule_set_default_iteration_cadences.rb
deleted file mode 100644
index 32645430e19..00000000000
--- a/db/post_migrate/20201231133921_schedule_set_default_iteration_cadences.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleSetDefaultIterationCadences < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes.to_i
- MIGRATION_CLASS = 'SetDefaultIterationCadences'
-
- class Iteration < ActiveRecord::Base # rubocop:disable Style/Documentation
- include EachBatch
-
- self.table_name = 'sprints'
- end
-
- disable_ddl_transaction!
-
- def up
- # Do nothing, rescheduling migration: 20210219102900_reschedule_set_default_iteration_cadences.rb
- end
-
- def down
- # Not needed
- end
-end
diff --git a/db/post_migrate/20210105030125_cleanup_projects_with_bad_has_external_wiki_data.rb b/db/post_migrate/20210105030125_cleanup_projects_with_bad_has_external_wiki_data.rb
deleted file mode 100644
index bc90a5f48ea..00000000000
--- a/db/post_migrate/20210105030125_cleanup_projects_with_bad_has_external_wiki_data.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupProjectsWithBadHasExternalWikiData < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- TMP_INDEX_NAME = 'tmp_index_projects_on_id_where_has_external_wiki_is_true'
- BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- class Service < ActiveRecord::Base
- include EachBatch
- belongs_to :project
-
- self.table_name = 'services'
- self.inheritance_column = :_type_disabled
- end
-
- class Project < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'projects'
- end
-
- def up
- update_projects_with_active_external_wikis
- update_projects_without_active_external_wikis
- end
-
- def down
- # no-op : can't go back to incorrect data
- end
-
- private
-
- def update_projects_with_active_external_wikis
- # 11 projects are scoped in this query on GitLab.com.
- scope = Service.where(active: true, type: 'ExternalWikiService').where.not(project_id: nil)
-
- scope.each_batch(of: BATCH_SIZE) do |relation|
- scope_with_projects = relation
- .joins(:project)
- .select('project_id')
- .merge(Project.where(has_external_wiki: false).where(pending_delete: false).where(archived: false))
-
- execute(<<~SQL)
- WITH project_ids_to_update (id) AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- #{scope_with_projects.to_sql}
- )
- UPDATE projects SET has_external_wiki = true WHERE id IN (SELECT id FROM project_ids_to_update)
- SQL
- end
- end
-
- def update_projects_without_active_external_wikis
- # Add a temporary index to speed up the scoping of projects.
- index_where = <<~SQL
- (
- "projects"."has_external_wiki" = TRUE
- )
- AND "projects"."pending_delete" = FALSE
- AND "projects"."archived" = FALSE
- SQL
-
- add_concurrent_index(:projects, :id, where: index_where, name: TMP_INDEX_NAME)
-
- services_sub_query = Service
- .select('1')
- .where('services.project_id = projects.id')
- .where(type: 'ExternalWikiService')
- .where(active: true)
-
- # 322 projects are scoped in this query on GitLab.com.
- Project.where(index_where).each_batch(of: BATCH_SIZE) do |relation|
- relation_with_exists_query = relation.where('NOT EXISTS (?)', services_sub_query)
- execute(<<~SQL)
- WITH project_ids_to_update (id) AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- #{relation_with_exists_query.select(:id).to_sql}
- )
- UPDATE projects SET has_external_wiki = false WHERE id IN (SELECT id FROM project_ids_to_update)
- SQL
- end
-
- # Drop the temporary index.
- remove_concurrent_index_by_name(:projects, TMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210105052229_clean_up_asset_proxy_whitelist_rename_on_application_settings.rb b/db/post_migrate/20210105052229_clean_up_asset_proxy_whitelist_rename_on_application_settings.rb
deleted file mode 100644
index 87f391e240d..00000000000
--- a/db/post_migrate/20210105052229_clean_up_asset_proxy_whitelist_rename_on_application_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CleanUpAssetProxyWhitelistRenameOnApplicationSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers::V2
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- # This migration has been made a no-op in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56352
- # because to revert the rename in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55419 we need
- # to cleanup the triggers on the `asset_proxy_allowlist` column. As such, this migration would do nothing.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210105103649_delete_column_group_id_on_compliance_framework.rb b/db/post_migrate/20210105103649_delete_column_group_id_on_compliance_framework.rb
deleted file mode 100644
index b13d2fe2d0a..00000000000
--- a/db/post_migrate/20210105103649_delete_column_group_id_on_compliance_framework.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteColumnGroupIdOnComplianceFramework < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def change
- remove_column :compliance_management_frameworks, :group_id, :bigint
- end
-end
diff --git a/db/post_migrate/20210107194543_remove_alerts_service_records.rb b/db/post_migrate/20210107194543_remove_alerts_service_records.rb
deleted file mode 100644
index 51a2f96ac7f..00000000000
--- a/db/post_migrate/20210107194543_remove_alerts_service_records.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAlertsServiceRecords < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- class Service < ActiveRecord::Base
- self.table_name = 'services'
- end
-
- def up
- Service.delete_by(type: 'AlertsService')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210111075105_schedule_uuid_population_for_security_findings.rb b/db/post_migrate/20210111075105_schedule_uuid_population_for_security_findings.rb
deleted file mode 100644
index 43cfb27b94c..00000000000
--- a/db/post_migrate/20210111075105_schedule_uuid_population_for_security_findings.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleUuidPopulationForSecurityFindings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION_CLASS = 'PopulateUuidsForSecurityFindings'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 25
-
- disable_ddl_transaction!
-
- def up
- # no-op, replaced by 20210111075206_schedule_uuid_population_for_security_findings2.rb
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210111075206_schedule_uuid_population_for_security_findings2.rb b/db/post_migrate/20210111075206_schedule_uuid_population_for_security_findings2.rb
deleted file mode 100644
index 00569581ca4..00000000000
--- a/db/post_migrate/20210111075206_schedule_uuid_population_for_security_findings2.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-# This replaces the previous post-deployment migration 20210111075105_schedule_uuid_population_for_security_findings.rb,
-# we have to run this again due to a bug in how we were receiving the arguments in the background migration.
-class ScheduleUuidPopulationForSecurityFindings2 < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION_CLASS = 'PopulateUuidsForSecurityFindings'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 25
-
- disable_ddl_transaction!
-
- def up
- ::Gitlab::BackgroundMigration.steal(MIGRATION_CLASS) do |job|
- job.delete
-
- false
- end
-
- Gitlab::BackgroundMigration::PopulateUuidsForSecurityFindings.security_findings.each_batch(column: :scan_id, of: BATCH_SIZE) do |batch, index|
- migrate_in(
- DELAY_INTERVAL * index,
- MIGRATION_CLASS,
- batch.pluck(:scan_id)
- )
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210112143418_remove_duplicate_services2.rb b/db/post_migrate/20210112143418_remove_duplicate_services2.rb
deleted file mode 100644
index 83d92a78473..00000000000
--- a/db/post_migrate/20210112143418_remove_duplicate_services2.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-# This replaces the previous post-deployment migration 20201207165956_remove_duplicate_services_spec.rb,
-# we have to run this again due to a bug in how we were receiving the arguments in the background migration.
-class RemoveDuplicateServices2 < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INTERVAL = 2.minutes
- BATCH_SIZE = 5_000
- MIGRATION = 'RemoveDuplicateServices'
-
- disable_ddl_transaction!
-
- def up
- project_ids_with_duplicates = Gitlab::BackgroundMigration::RemoveDuplicateServices::Service.project_ids_with_duplicates
-
- project_ids_with_duplicates.each_batch(of: BATCH_SIZE, column: :project_id) do |batch, index|
- migrate_in(
- INTERVAL * index,
- MIGRATION,
- batch.pluck(:project_id)
- )
- end
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb b/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb
deleted file mode 100644
index 8a03a90a1c5..00000000000
--- a/db/post_migrate/20210115215854_cancel_artifact_expiry_backfill.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CancelArtifactExpiryBackfill < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION = 'BackfillArtifactExpiryDate'
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION) do |job|
- job.delete
-
- false
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210115220610_schedule_artifact_expiry_backfill.rb b/db/post_migrate/20210115220610_schedule_artifact_expiry_backfill.rb
deleted file mode 100644
index 4f49e8b75af..00000000000
--- a/db/post_migrate/20210115220610_schedule_artifact_expiry_backfill.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleArtifactExpiryBackfill < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION = 'BackfillArtifactExpiryDate'
- SWITCH_DATE = Date.new(2020, 06, 22).freeze
- INDEX_NAME = 'expired_artifacts_temp_index'
- OLD_INDEX_CONDITION = "expire_at IS NULL AND created_at < '#{SWITCH_DATE}'"
- INDEX_CONDITION = "expire_at IS NULL AND date(created_at AT TIME ZONE 'UTC') < '2020-06-22'::date"
-
- disable_ddl_transaction!
-
- class JobArtifact < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'ci_job_artifacts'
-
- scope :without_expiry_date, -> { where(expire_at: nil) }
- scope :before_switch, -> { where("date(created_at AT TIME ZONE 'UTC') < ?::date", SWITCH_DATE) }
- end
-
- def up
- # Create temporary index for expired artifacts
- # Needs to be removed in a later migration
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- add_concurrent_index(:ci_job_artifacts, %i(id created_at), where: INDEX_CONDITION, name: INDEX_NAME)
-
- queue_background_migration_jobs_by_range_at_intervals(
- JobArtifact.without_expiry_date.before_switch,
- MIGRATION,
- 2.minutes,
- batch_size: 200_000
- )
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
- add_concurrent_index(:ci_job_artifacts, %i(id created_at), where: OLD_INDEX_CONDITION, name: INDEX_NAME)
-
- Gitlab::BackgroundMigration.steal(MIGRATION) do |job|
- job.delete
-
- false
- end
- end
-end
diff --git a/db/post_migrate/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value.rb b/db/post_migrate/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value.rb
deleted file mode 100644
index 132d72e180b..00000000000
--- a/db/post_migrate/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class AlterVsaIssueFirstMentionedInCommitValue < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS = 2
- ISSUE_FIRST_MENTIONED_IN_COMMIT_EE = 6
-
- class GroupStage < ActiveRecord::Base
- self.table_name = 'analytics_cycle_analytics_group_stages'
-
- include EachBatch
- end
-
- def up
- GroupStage.each_batch(of: 100) do |relation|
- relation
- .where(start_event_identifier: ISSUE_FIRST_MENTIONED_IN_COMMIT_EE)
- .update_all(start_event_identifier: ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS)
-
- relation
- .where(end_event_identifier: ISSUE_FIRST_MENTIONED_IN_COMMIT_EE)
- .update_all(end_event_identifier: ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS)
- end
- end
-
- def down
- # rollback is not needed, the identifier "6" is the same as identifier "2" on the application level
- end
-end
diff --git a/db/post_migrate/20210203143131_migrate_existing_devops_segments_to_groups.rb b/db/post_migrate/20210203143131_migrate_existing_devops_segments_to_groups.rb
deleted file mode 100644
index 5267e0fd658..00000000000
--- a/db/post_migrate/20210203143131_migrate_existing_devops_segments_to_groups.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-# Data migration to migrate multi-selection segments into separate segments.
-# Both tables involved are pretty-low traffic and the number
-# of records in DB cannot exceed 400
-class MigrateExistingDevopsSegmentsToGroups < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- Gitlab::BackgroundMigration::MigrateDevopsSegmentsToGroups.new.perform
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20210205104425_add_new_post_eoa_plans.rb b/db/post_migrate/20210205104425_add_new_post_eoa_plans.rb
deleted file mode 100644
index d1a5afbd314..00000000000
--- a/db/post_migrate/20210205104425_add_new_post_eoa_plans.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddNewPostEoaPlans < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- execute "INSERT INTO plans (name, title, created_at, updated_at) VALUES ('premium', 'Premium (Formerly Silver)', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)"
- execute "INSERT INTO plans (name, title, created_at, updated_at) VALUES ('ultimate', 'Ultimate (Formerly Gold)', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)"
- end
-
- def down
- execute "DELETE FROM plans WHERE name IN ('premium', 'ultimate')"
- end
-end
diff --git a/db/post_migrate/20210205144537_remove_namespace_onboarding_actions_table.rb b/db/post_migrate/20210205144537_remove_namespace_onboarding_actions_table.rb
deleted file mode 100644
index 210b1d7822c..00000000000
--- a/db/post_migrate/20210205144537_remove_namespace_onboarding_actions_table.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNamespaceOnboardingActionsTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- drop_table :namespace_onboarding_actions
- end
- end
-
- def down
- with_lock_retries do
- create_table :namespace_onboarding_actions do |t|
- t.references :namespace, index: true, null: false
- t.datetime_with_timezone :created_at, null: false
- t.integer :action, limit: 2, null: false
- end
- end
- end
-end
diff --git a/db/post_migrate/20210205174154_remove_bad_dependency_proxy_manifests.rb b/db/post_migrate/20210205174154_remove_bad_dependency_proxy_manifests.rb
deleted file mode 100644
index eb302fb7009..00000000000
--- a/db/post_migrate/20210205174154_remove_bad_dependency_proxy_manifests.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBadDependencyProxyManifests < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- # We run destroy on each record because we need the callback to remove
- # the underlying files
- DependencyProxy::Manifest.where.not(content_type: nil).destroy_all # rubocop:disable Cop/DestroyAll
- end
-
- def down
- # no op
- end
-end
diff --git a/db/post_migrate/20210205213933_drop_alerts_service_data.rb b/db/post_migrate/20210205213933_drop_alerts_service_data.rb
deleted file mode 100644
index 6ad6c90290e..00000000000
--- a/db/post_migrate/20210205213933_drop_alerts_service_data.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class DropAlertsServiceData < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- def up
- with_lock_retries do
- drop_table :alerts_service_data
- end
- end
-
- # rubocop:disable Migration/PreventStrings
- def down
- with_lock_retries do
- create_table :alerts_service_data do |t|
- t.bigint :service_id, null: false
- t.timestamps_with_timezone
- t.string :encrypted_token, limit: 255
- t.string :encrypted_token_iv, limit: 255
- end
- end
- end
- # rubocop:enable Migration/PreventStrings
-end
diff --git a/db/post_migrate/20210205214003_remove_alerts_service_records_again.rb b/db/post_migrate/20210205214003_remove_alerts_service_records_again.rb
deleted file mode 100644
index aabc6fc00cd..00000000000
--- a/db/post_migrate/20210205214003_remove_alerts_service_records_again.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAlertsServiceRecordsAgain < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- class Service < ActiveRecord::Base
- self.table_name = 'services'
- end
-
- def up
- Service.delete_by(type: 'AlertsService')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210210093901_backfill_updated_at_after_repository_storage_move.rb b/db/post_migrate/20210210093901_backfill_updated_at_after_repository_storage_move.rb
deleted file mode 100644
index efd0eeb9d47..00000000000
--- a/db/post_migrate/20210210093901_backfill_updated_at_after_repository_storage_move.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillUpdatedAtAfterRepositoryStorageMove < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 10_000
- INTERVAL = 2.minutes
- MIGRATION_CLASS = 'BackfillProjectUpdatedAtAfterRepositoryStorageMove'
-
- disable_ddl_transaction!
-
- class RepositoryStorageMove < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'project_repository_storage_moves'
- end
-
- def up
- RepositoryStorageMove.reset_column_information
-
- RepositoryStorageMove.select(:project_id).distinct.each_batch(of: BATCH_SIZE, column: :project_id) do |batch, index|
- migrate_in(
- INTERVAL * index,
- MIGRATION_CLASS,
- batch.pluck(:project_id)
- )
- end
- end
-
- def down
- # No-op
- end
-end
diff --git a/db/post_migrate/20210210221006_cleanup_projects_with_bad_has_external_issue_tracker_data.rb b/db/post_migrate/20210210221006_cleanup_projects_with_bad_has_external_issue_tracker_data.rb
deleted file mode 100644
index 7b17faeb4b4..00000000000
--- a/db/post_migrate/20210210221006_cleanup_projects_with_bad_has_external_issue_tracker_data.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupProjectsWithBadHasExternalIssueTrackerData < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- TMP_INDEX_NAME = 'tmp_idx_projects_on_id_where_has_external_issue_tracker_is_true'
- BATCH_SIZE = 100
-
- disable_ddl_transaction!
-
- class Service < ActiveRecord::Base
- include EachBatch
- belongs_to :project
-
- self.table_name = 'services'
- self.inheritance_column = :_type_disabled
- end
-
- class Project < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'projects'
- end
-
- def up
- update_projects_with_active_external_issue_trackers
- update_projects_without_active_external_issue_trackers
- end
-
- def down
- # no-op : can't go back to incorrect data
- end
-
- private
-
- def update_projects_with_active_external_issue_trackers
- scope = Service.where(active: true, category: 'issue_tracker').where.not(project_id: nil).distinct(:project_id)
-
- scope.each_batch(of: BATCH_SIZE) do |relation|
- scope_with_projects = relation
- .joins(:project)
- .select('project_id')
- .merge(Project.where(has_external_issue_tracker: false).where(pending_delete: false))
-
- execute(<<~SQL)
- WITH project_ids_to_update (id) AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- #{scope_with_projects.to_sql}
- )
- UPDATE projects SET has_external_issue_tracker = true WHERE id IN (SELECT id FROM project_ids_to_update)
- SQL
- end
- end
-
- def update_projects_without_active_external_issue_trackers
- # Add a temporary index to speed up the scoping of projects.
- index_where = <<~SQL
- "projects"."has_external_issue_tracker" = TRUE
- AND "projects"."pending_delete" = FALSE
- SQL
-
- add_concurrent_index(:projects, :id, where: index_where, name: TMP_INDEX_NAME)
-
- services_sub_query = Service
- .select('1')
- .where('services.project_id = projects.id')
- .where(category: 'issue_tracker')
- .where(active: true)
-
- # 322 projects are scoped in this query on GitLab.com.
- Project.where(index_where).each_batch(of: BATCH_SIZE) do |relation|
- relation_with_exists_query = relation.where('NOT EXISTS (?)', services_sub_query)
- execute(<<~SQL)
- WITH project_ids_to_update (id) AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (
- #{relation_with_exists_query.select(:id).to_sql}
- )
- UPDATE projects SET has_external_issue_tracker = false WHERE id IN (SELECT id FROM project_ids_to_update)
- SQL
- end
-
- # Drop the temporary index.
- remove_concurrent_index_by_name(:projects, TMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb b/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
deleted file mode 100644
index 12e156d3b8a..00000000000
--- a/db/post_migrate/20210215095328_migrate_delayed_project_removal_from_namespaces_to_namespace_settings.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateDelayedProjectRemovalFromNamespacesToNamespaceSettings < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- class Namespace < ActiveRecord::Base
- self.table_name = 'namespaces'
-
- include ::EachBatch
- end
-
- def up
- Namespace.select(:id).where(delayed_project_removal: true).each_batch do |batch|
- values = batch.map { |record| "(#{record.id}, TRUE, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)" }
-
- execute <<-EOF.strip_heredoc
- INSERT INTO namespace_settings (namespace_id, delayed_project_removal, created_at, updated_at)
- VALUES #{values.join(', ')}
- ON CONFLICT (namespace_id) DO UPDATE
- SET delayed_project_removal = TRUE
- EOF
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210215144909_migrate_usage_trends_sidekiq_queue.rb b/db/post_migrate/20210215144909_migrate_usage_trends_sidekiq_queue.rb
deleted file mode 100644
index 3e6eabfba97..00000000000
--- a/db/post_migrate/20210215144909_migrate_usage_trends_sidekiq_queue.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateUsageTrendsSidekiqQueue < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- sidekiq_queue_migrate 'cronjob:analytics_instance_statistics_count_job_trigger', to: 'cronjob:analytics_usage_trends_count_job_trigger'
- sidekiq_queue_migrate 'analytics_instance_statistics_counter_job', to: 'analytics_usage_trends_counter_job'
- end
-
- def down
- sidekiq_queue_migrate 'cronjob:analytics_usage_trends_count_job_trigger', to: 'cronjob:analytics_instance_statistics_count_job_trigger'
- sidekiq_queue_migrate 'analytics_usage_trends_counter_job', to: 'analytics_instance_statistics_counter_job'
- end
-end
diff --git a/db/post_migrate/20210217100728_move_create_release_evidence_queue_out_of_cronjob_namespace.rb b/db/post_migrate/20210217100728_move_create_release_evidence_queue_out_of_cronjob_namespace.rb
deleted file mode 100644
index 22bead87dc1..00000000000
--- a/db/post_migrate/20210217100728_move_create_release_evidence_queue_out_of_cronjob_namespace.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class MoveCreateReleaseEvidenceQueueOutOfCronjobNamespace < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- # Set this constant to true if this migration requires downtime.
- DOWNTIME = false
-
- def up
- sidekiq_queue_migrate 'cronjob:releases_create_evidence', to: 'releases_create_evidence'
- end
-
- def down
- sidekiq_queue_migrate 'releases_create_evidence', to: 'cronjob:releases_create_evidence'
- end
-end
diff --git a/db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb b/db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb
deleted file mode 100644
index 6fa7a15a90d..00000000000
--- a/db/post_migrate/20210218105431_remove_deprecated_ci_builds_columns.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDeprecatedCiBuildsColumns < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- # Set this constant to true if this migration requires downtime.
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :ci_builds, :artifacts_file
- remove_column :ci_builds, :artifacts_file_store
- remove_column :ci_builds, :artifacts_metadata
- remove_column :ci_builds, :artifacts_metadata_store
- remove_column :ci_builds, :artifacts_size
- remove_column :ci_builds, :commands
- end
- end
-
- def down
- # rubocop:disable Migration/AddColumnsToWideTables
- with_lock_retries do
- add_column :ci_builds, :artifacts_file, :text
- add_column :ci_builds, :artifacts_file_store, :integer
- add_column :ci_builds, :artifacts_metadata, :text
- add_column :ci_builds, :artifacts_metadata_store, :integer
- add_column :ci_builds, :artifacts_size, :bigint
- add_column :ci_builds, :commands, :text
- end
- # rubocop:enable Migration/AddColumnsToWideTables
-
- add_concurrent_index :ci_builds, :artifacts_expire_at, where: "artifacts_file <> ''::text", name: 'index_ci_builds_on_artifacts_expire_at'
- end
-end
diff --git a/db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb b/db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb
deleted file mode 100644
index 06fd900590b..00000000000
--- a/db/post_migrate/20210218110552_remove_deprecated_ci_runner_column.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDeprecatedCiRunnerColumn < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- # Set this constant to true if this migration requires downtime.
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :ci_runners, :is_shared
- end
- end
-
- def down
- add_column :ci_runners, :is_shared, :boolean, default: false unless column_exists?(:ci_runners, :is_shared)
-
- add_concurrent_index :ci_runners, :is_shared
- end
-end
diff --git a/db/post_migrate/20210219102900_reschedule_set_default_iteration_cadences.rb b/db/post_migrate/20210219102900_reschedule_set_default_iteration_cadences.rb
deleted file mode 100644
index 6c7b46737aa..00000000000
--- a/db/post_migrate/20210219102900_reschedule_set_default_iteration_cadences.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleSetDefaultIterationCadences < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes.to_i
- MIGRATION_CLASS = 'SetDefaultIterationCadences'
-
- class Iteration < ActiveRecord::Base # rubocop:disable Style/Documentation
- include EachBatch
-
- self.table_name = 'sprints'
- end
-
- disable_ddl_transaction!
-
- def up
- Iteration.select(:group_id).distinct.each_batch(of: BATCH_SIZE, column: :group_id) do |batch, index|
- group_ids = batch.pluck(:group_id)
-
- migrate_in(index * DELAY_INTERVAL, MIGRATION_CLASS, group_ids)
- end
- end
-
- def down
- # Not needed
- end
-end
diff --git a/db/post_migrate/20210222185538_remove_backup_labels_foreign_keys.rb b/db/post_migrate/20210222185538_remove_backup_labels_foreign_keys.rb
deleted file mode 100644
index 614ec4875d6..00000000000
--- a/db/post_migrate/20210222185538_remove_backup_labels_foreign_keys.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBackupLabelsForeignKeys < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(:backup_labels, :projects)
- remove_foreign_key_if_exists(:backup_labels, :namespaces)
- end
- end
-
- def down
- add_concurrent_foreign_key(:backup_labels, :projects, column: :project_id, on_delete: :cascade)
- add_concurrent_foreign_key(:backup_labels, :namespaces, column: :group_id, on_delete: :cascade)
- end
-end
diff --git a/db/post_migrate/20210222192144_remove_backup_labels_table.rb b/db/post_migrate/20210222192144_remove_backup_labels_table.rb
deleted file mode 100644
index 1208c3c970f..00000000000
--- a/db/post_migrate/20210222192144_remove_backup_labels_table.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBackupLabelsTable < ActiveRecord::Migration[6.0]
- DOWNTIME = false
-
- def up
- drop_table :backup_labels
- end
-
- def down
- create_table :backup_labels, id: false do |t|
- t.integer :id, null: false
- t.string :title
- t.string :color
- t.integer :project_id
- t.timestamps null: true # rubocop:disable Migration/Timestamps
- t.boolean :template, default: false
- t.string :description
- t.text :description_html
- t.string :type
- t.integer :group_id
- t.integer :cached_markdown_version
- t.integer :restore_action
- t.string :new_title
- end
-
- execute 'ALTER TABLE backup_labels ADD PRIMARY KEY (id)'
-
- add_index :backup_labels, [:group_id, :project_id, :title], name: 'backup_labels_group_id_project_id_title_idx', unique: true
- add_index :backup_labels, [:group_id, :title], where: 'project_id = NULL::integer', name: 'backup_labels_group_id_title_idx'
- add_index :backup_labels, :project_id, name: 'backup_labels_project_id_idx'
- add_index :backup_labels, :template, name: 'backup_labels_template_idx', where: 'template'
- add_index :backup_labels, :title, name: 'backup_labels_title_idx'
- add_index :backup_labels, [:type, :project_id], name: 'backup_labels_type_project_id_idx'
- end
-end
diff --git a/db/post_migrate/20210224150506_reschedule_artifact_expiry_backfill.rb b/db/post_migrate/20210224150506_reschedule_artifact_expiry_backfill.rb
deleted file mode 100644
index 2c0fe405490..00000000000
--- a/db/post_migrate/20210224150506_reschedule_artifact_expiry_backfill.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleArtifactExpiryBackfill < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION = 'BackfillArtifactExpiryDate'
- SWITCH_DATE = Date.new(2020, 06, 22).freeze
-
- disable_ddl_transaction!
-
- class JobArtifact < ActiveRecord::Base
- include EachBatch
-
- self.inheritance_column = :_type_disabled
- self.table_name = 'ci_job_artifacts'
-
- scope :without_expiry_date, -> { where(expire_at: nil) }
- scope :before_switch, -> { where("date(created_at AT TIME ZONE 'UTC') < ?::date", SWITCH_DATE) }
- end
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION) do |job|
- job.delete
-
- false
- end
-
- queue_background_migration_jobs_by_range_at_intervals(
- JobArtifact.without_expiry_date.before_switch,
- MIGRATION,
- 2.minutes,
- batch_size: 200_000
- )
- end
-
- def down
- Gitlab::BackgroundMigration.steal(MIGRATION) do |job|
- job.delete
-
- false
- end
- end
-end
diff --git a/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb b/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
deleted file mode 100644
index fce31110866..00000000000
--- a/db/post_migrate/20210226120851_move_container_registry_enabled_to_project_features.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class MoveContainerRegistryEnabledToProjectFeatures < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- BATCH_SIZE = 50_000
- MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature'
-
- disable_ddl_transaction!
-
- class Project < ActiveRecord::Base
- include EachBatch
- self.table_name = 'projects'
- end
-
- def up
- # no-op
- # Superceded by db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb
-
- # queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210226141517_dedup_issue_metrics.rb b/db/post_migrate/20210226141517_dedup_issue_metrics.rb
deleted file mode 100644
index 8228d509e07..00000000000
--- a/db/post_migrate/20210226141517_dedup_issue_metrics.rb
+++ /dev/null
@@ -1,71 +0,0 @@
-# frozen_string_literal: true
-
-class DedupIssueMetrics < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- TMP_INDEX_NAME = 'tmp_unique_issue_metrics_by_issue_id'
- OLD_INDEX_NAME = 'index_issue_metrics'
- INDEX_NAME = 'index_unique_issue_metrics_issue_id'
- BATCH_SIZE = 1_000
-
- disable_ddl_transaction!
-
- class IssueMetrics < ActiveRecord::Base
- self.table_name = 'issue_metrics'
-
- include EachBatch
- end
-
- def up
- IssueMetrics.reset_column_information
-
- last_metrics_record_id = IssueMetrics.maximum(:id) || 0
-
- # This index will disallow further duplicates while we're deduplicating the data.
- add_concurrent_index(:issue_metrics, :issue_id, where: "id > #{Integer(last_metrics_record_id)}", unique: true, name: TMP_INDEX_NAME)
-
- IssueMetrics.each_batch(of: BATCH_SIZE) do |relation|
- duplicated_issue_ids = IssueMetrics
- .where(issue_id: relation.select(:issue_id))
- .select(:issue_id)
- .group(:issue_id)
- .having('COUNT(issue_metrics.issue_id) > 1')
- .pluck(:issue_id)
-
- duplicated_issue_ids.each do |issue_id|
- deduplicate_item(issue_id)
- end
- end
-
- add_concurrent_index(:issue_metrics, :issue_id, unique: true, name: INDEX_NAME)
- remove_concurrent_index_by_name(:issue_metrics, TMP_INDEX_NAME)
- remove_concurrent_index_by_name(:issue_metrics, OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:issue_metrics, :issue_id, name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(:issue_metrics, TMP_INDEX_NAME)
- remove_concurrent_index_by_name(:issue_metrics, INDEX_NAME)
- end
-
- private
-
- def deduplicate_item(issue_id)
- issue_metrics_records = IssueMetrics.where(issue_id: issue_id).order(updated_at: :asc).to_a
-
- attributes = {}
- issue_metrics_records.each do |issue_metrics_record|
- params = issue_metrics_record.attributes.except('id')
- attributes.merge!(params.compact)
- end
-
- ActiveRecord::Base.transaction do
- record_to_keep = issue_metrics_records.pop
- records_to_delete = issue_metrics_records
-
- IssueMetrics.where(id: records_to_delete.map(&:id)).delete_all
- record_to_keep.update!(attributes)
- end
- end
-end
diff --git a/db/post_migrate/20210301200959_clean_up_asset_proxy_allowlist_rename_on_application_settings.rb b/db/post_migrate/20210301200959_clean_up_asset_proxy_allowlist_rename_on_application_settings.rb
deleted file mode 100644
index d0b372b84f0..00000000000
--- a/db/post_migrate/20210301200959_clean_up_asset_proxy_allowlist_rename_on_application_settings.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class CleanUpAssetProxyAllowlistRenameOnApplicationSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers::V2
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- cleanup_concurrent_column_rename :application_settings,
- :asset_proxy_allowlist,
- :asset_proxy_whitelist
- end
-
- def down
- undo_cleanup_concurrent_column_rename :application_settings,
- :asset_proxy_allowlist,
- :asset_proxy_whitelist
- end
-end
diff --git a/db/schema_migrations/20181228175414 b/db/schema_migrations/20181228175414
deleted file mode 100644
index 4b17d9331e1..00000000000
--- a/db/schema_migrations/20181228175414
+++ /dev/null
@@ -1 +0,0 @@
-789496127df650700b043e55cf1198f778d4f290f320c629905e242f2d0b0664 \ No newline at end of file
diff --git a/db/schema_migrations/20201211090634 b/db/schema_migrations/20201211090634
deleted file mode 100644
index 0c11b8f85fb..00000000000
--- a/db/schema_migrations/20201211090634
+++ /dev/null
@@ -1 +0,0 @@
-5117b71950bec3c6c746eaf4851c111a335bf2280075ddc2c73b60a30e23d907 \ No newline at end of file
diff --git a/db/schema_migrations/20201211145950 b/db/schema_migrations/20201211145950
deleted file mode 100644
index f3c3687bc4f..00000000000
--- a/db/schema_migrations/20201211145950
+++ /dev/null
@@ -1 +0,0 @@
-ecf6b392f35bb0ef905144a4605bcb927ce767240e47ec3b0653a94139b987bd \ No newline at end of file
diff --git a/db/schema_migrations/20201214000000 b/db/schema_migrations/20201214000000
deleted file mode 100644
index 420b3f2768a..00000000000
--- a/db/schema_migrations/20201214000000
+++ /dev/null
@@ -1 +0,0 @@
-58f2bd74adf8b4ef616c8f341053dbeaa8116430a0f4493cbf5f8456d7f4b907 \ No newline at end of file
diff --git a/db/schema_migrations/20201214032220 b/db/schema_migrations/20201214032220
deleted file mode 100644
index ec14b260583..00000000000
--- a/db/schema_migrations/20201214032220
+++ /dev/null
@@ -1 +0,0 @@
-db23b5315386ad5d5fec5a14958769cc1e62a0a89ec3246edb9fc024607e917b \ No newline at end of file
diff --git a/db/schema_migrations/20201214084105 b/db/schema_migrations/20201214084105
deleted file mode 100644
index 1b5eb10e48e..00000000000
--- a/db/schema_migrations/20201214084105
+++ /dev/null
@@ -1 +0,0 @@
-e991bf621a2eb047903f796256ee65b781e5dd34aff12449f2347480bf7791a7 \ No newline at end of file
diff --git a/db/schema_migrations/20201214111858 b/db/schema_migrations/20201214111858
deleted file mode 100644
index 7d97a34eadf..00000000000
--- a/db/schema_migrations/20201214111858
+++ /dev/null
@@ -1 +0,0 @@
-e3eb306d7956e396f038f07a20c674929fc4aae3e188b24e1087305b3fea8b4d \ No newline at end of file
diff --git a/db/schema_migrations/20201214112752 b/db/schema_migrations/20201214112752
deleted file mode 100644
index af432649dea..00000000000
--- a/db/schema_migrations/20201214112752
+++ /dev/null
@@ -1 +0,0 @@
-59906a3528499dd9c0b4c30088539299c08383ad3b36be8c862a7cc9ef1d50b2 \ No newline at end of file
diff --git a/db/schema_migrations/20201214113729 b/db/schema_migrations/20201214113729
deleted file mode 100644
index 56bc2113a34..00000000000
--- a/db/schema_migrations/20201214113729
+++ /dev/null
@@ -1 +0,0 @@
-9c2f6c75126172d4876db33cfd814f974a381df97a23aec21f2550ec288946c2 \ No newline at end of file
diff --git a/db/schema_migrations/20201214184020 b/db/schema_migrations/20201214184020
deleted file mode 100644
index 5cf5065b251..00000000000
--- a/db/schema_migrations/20201214184020
+++ /dev/null
@@ -1 +0,0 @@
-adce3c714064991e93f8a587da3d5892c47dbc14963fa49638ebbbf8b5489359 \ No newline at end of file
diff --git a/db/schema_migrations/20201215084652 b/db/schema_migrations/20201215084652
deleted file mode 100644
index 1b0cab62c8b..00000000000
--- a/db/schema_migrations/20201215084652
+++ /dev/null
@@ -1 +0,0 @@
-8aa288d8f4a02030528e096c3aa4e109c57f4ca2515442ca0bfb3463cf9ff609 \ No newline at end of file
diff --git a/db/schema_migrations/20201215132151 b/db/schema_migrations/20201215132151
deleted file mode 100644
index e051fb91e12..00000000000
--- a/db/schema_migrations/20201215132151
+++ /dev/null
@@ -1 +0,0 @@
-916f29e6ab89551fd785c3a8584c24b72d9002ada30d159e9ff826cb247199b5 \ No newline at end of file
diff --git a/db/schema_migrations/20201215205404 b/db/schema_migrations/20201215205404
deleted file mode 100644
index 147ede2064d..00000000000
--- a/db/schema_migrations/20201215205404
+++ /dev/null
@@ -1 +0,0 @@
-b54cf8b75c5882f2dfca74b218a9eeac766ff65233d43de865717d3ab8c7a217 \ No newline at end of file
diff --git a/db/schema_migrations/20201216151616 b/db/schema_migrations/20201216151616
deleted file mode 100644
index a8b27610716..00000000000
--- a/db/schema_migrations/20201216151616
+++ /dev/null
@@ -1 +0,0 @@
-f1c6927431895c6ce03fe7e0be30fcd0a1f4ccfeac8277ee0662d7434b97d257 \ No newline at end of file
diff --git a/db/schema_migrations/20201216154457 b/db/schema_migrations/20201216154457
deleted file mode 100644
index 773218ff906..00000000000
--- a/db/schema_migrations/20201216154457
+++ /dev/null
@@ -1 +0,0 @@
-c878874bbb9bf2314b90c1328d6e27846fe71513ba1ce688a262d36761b66665 \ No newline at end of file
diff --git a/db/schema_migrations/20201216185336 b/db/schema_migrations/20201216185336
deleted file mode 100644
index 376429a2141..00000000000
--- a/db/schema_migrations/20201216185336
+++ /dev/null
@@ -1 +0,0 @@
-3647e8b944aedeb58c41d9b3f08c8fb657fab231b0ff25c276f6d2aaa2ea93ae \ No newline at end of file
diff --git a/db/schema_migrations/20201217070530 b/db/schema_migrations/20201217070530
deleted file mode 100644
index c09f3b03e3b..00000000000
--- a/db/schema_migrations/20201217070530
+++ /dev/null
@@ -1 +0,0 @@
-59e40a24e8422e64bc85c4d54e6da923512017bac6a167350affeff241046e9f \ No newline at end of file
diff --git a/db/schema_migrations/20201217111448 b/db/schema_migrations/20201217111448
deleted file mode 100644
index 02526b55a3d..00000000000
--- a/db/schema_migrations/20201217111448
+++ /dev/null
@@ -1 +0,0 @@
-32330327aa8db01b5bc2c533af5387e77ad3dc0c34eacaac16a793df75634ce6 \ No newline at end of file
diff --git a/db/schema_migrations/20201217112249 b/db/schema_migrations/20201217112249
deleted file mode 100644
index b5b280bbf07..00000000000
--- a/db/schema_migrations/20201217112249
+++ /dev/null
@@ -1 +0,0 @@
-938aa97919e5a15143a72f33bebb27e501d5ef7cc53cf4e7debe9dee398b7255 \ No newline at end of file
diff --git a/db/schema_migrations/20201217132603 b/db/schema_migrations/20201217132603
deleted file mode 100644
index d1db386cbf5..00000000000
--- a/db/schema_migrations/20201217132603
+++ /dev/null
@@ -1 +0,0 @@
-164bcc838beb7d51775f8b813b92d3ec7080d4c7937d6ad16cf973131b45359e \ No newline at end of file
diff --git a/db/schema_migrations/20201218194311 b/db/schema_migrations/20201218194311
deleted file mode 100644
index f9beba74a8c..00000000000
--- a/db/schema_migrations/20201218194311
+++ /dev/null
@@ -1 +0,0 @@
-7c33bd30af66ebb9a837c72e2ced107f015d4a22c7b6393554a9299bf3907cc0 \ No newline at end of file
diff --git a/db/schema_migrations/20201221124036 b/db/schema_migrations/20201221124036
deleted file mode 100644
index 7a1049a7dd0..00000000000
--- a/db/schema_migrations/20201221124036
+++ /dev/null
@@ -1 +0,0 @@
-15517956f3b5d7ce2c05d196a34881fa169df7b1bf5ccf0dbfbee74fb3143ba7 \ No newline at end of file
diff --git a/db/schema_migrations/20201221213415 b/db/schema_migrations/20201221213415
deleted file mode 100644
index 74df483ac70..00000000000
--- a/db/schema_migrations/20201221213415
+++ /dev/null
@@ -1 +0,0 @@
-8c123da6a380524c7269ffc67ea0e533a415d3c6eddf96cee4025ea152fc7582 \ No newline at end of file
diff --git a/db/schema_migrations/20201221225303 b/db/schema_migrations/20201221225303
deleted file mode 100644
index d1824217b99..00000000000
--- a/db/schema_migrations/20201221225303
+++ /dev/null
@@ -1 +0,0 @@
-06dcd1a1f4bc0598357d48d9a0e838d9af1cf078234f2aabaa53ff9df01d2c17 \ No newline at end of file
diff --git a/db/schema_migrations/20201222151823 b/db/schema_migrations/20201222151823
deleted file mode 100644
index 914e96473a0..00000000000
--- a/db/schema_migrations/20201222151823
+++ /dev/null
@@ -1 +0,0 @@
-d3af120a74b4c55345ac7fb524395251cd3c1b3cd9685f711196a134f427845c \ No newline at end of file
diff --git a/db/schema_migrations/20201223012231 b/db/schema_migrations/20201223012231
deleted file mode 100644
index 77813ca0655..00000000000
--- a/db/schema_migrations/20201223012231
+++ /dev/null
@@ -1 +0,0 @@
-e845a6704ac92881926cca56bf7fb01c6252f1fe2b2d94fc9d6548144126d6a5 \ No newline at end of file
diff --git a/db/schema_migrations/20201223114050 b/db/schema_migrations/20201223114050
deleted file mode 100644
index 25ac0eac211..00000000000
--- a/db/schema_migrations/20201223114050
+++ /dev/null
@@ -1 +0,0 @@
-35acb5bbabfd12f97c988776aafa6ff380e2cbe2267e856b8f439f7102a6fbf2 \ No newline at end of file
diff --git a/db/schema_migrations/20201224144948 b/db/schema_migrations/20201224144948
deleted file mode 100644
index 84e2816433c..00000000000
--- a/db/schema_migrations/20201224144948
+++ /dev/null
@@ -1 +0,0 @@
-a83762c788d4ec007a26da386dc36bce16b60f5642ed3e6405482acfebefc1be \ No newline at end of file
diff --git a/db/schema_migrations/20201228110136 b/db/schema_migrations/20201228110136
deleted file mode 100644
index 51496856ff9..00000000000
--- a/db/schema_migrations/20201228110136
+++ /dev/null
@@ -1 +0,0 @@
-6488e3542276042f302d79533e3e84c43a4ef471535137bcef11e73a0e4d961f \ No newline at end of file
diff --git a/db/schema_migrations/20201228110238 b/db/schema_migrations/20201228110238
deleted file mode 100644
index 300b53bacee..00000000000
--- a/db/schema_migrations/20201228110238
+++ /dev/null
@@ -1 +0,0 @@
-7be98c4f62df9fd837f7a547916dd5481c0b4da2d4fc6680b104b2a998be1eed \ No newline at end of file
diff --git a/db/schema_migrations/20201228184500 b/db/schema_migrations/20201228184500
deleted file mode 100644
index c6168e775b2..00000000000
--- a/db/schema_migrations/20201228184500
+++ /dev/null
@@ -1 +0,0 @@
-9018fed4aab19642fafee3e50bf41be422fc3f8256d0b5d78c8a70fc96f4090f \ No newline at end of file
diff --git a/db/schema_migrations/20201229105948 b/db/schema_migrations/20201229105948
deleted file mode 100644
index 73da30d5392..00000000000
--- a/db/schema_migrations/20201229105948
+++ /dev/null
@@ -1 +0,0 @@
-cf391e617ef16f70c0daa4584959d36eda4b29c7e211f3f90ad74b4ebbc7ebbd \ No newline at end of file
diff --git a/db/schema_migrations/20201230161206 b/db/schema_migrations/20201230161206
deleted file mode 100644
index 594ca5ea890..00000000000
--- a/db/schema_migrations/20201230161206
+++ /dev/null
@@ -1 +0,0 @@
-b3fcc73c6b61469d770e9eb9a14c88bb86398db4ab4b6dc5283718a147db0ac0 \ No newline at end of file
diff --git a/db/schema_migrations/20201230180202 b/db/schema_migrations/20201230180202
deleted file mode 100644
index 62a0e277a55..00000000000
--- a/db/schema_migrations/20201230180202
+++ /dev/null
@@ -1 +0,0 @@
-c2766b50914c6b4d8c96fb958cdfb67f0d29e40df45654c35d62792c272e3d5a \ No newline at end of file
diff --git a/db/schema_migrations/20201231133921 b/db/schema_migrations/20201231133921
deleted file mode 100644
index 40f792eac8f..00000000000
--- a/db/schema_migrations/20201231133921
+++ /dev/null
@@ -1 +0,0 @@
-26bf4abb73a53f71fbcb8b5cd1ae1e1539ec59e7052b3bbed95ab1de3fda3de7 \ No newline at end of file
diff --git a/db/schema_migrations/20210101110640 b/db/schema_migrations/20210101110640
deleted file mode 100644
index e21e6768e7b..00000000000
--- a/db/schema_migrations/20210101110640
+++ /dev/null
@@ -1 +0,0 @@
-8aac4108b658a7a0646ec230dc2568cb51fea0535b13dfba8b8c9e6edb401d07 \ No newline at end of file
diff --git a/db/schema_migrations/20210102164121 b/db/schema_migrations/20210102164121
deleted file mode 100644
index 87f9b9e17f4..00000000000
--- a/db/schema_migrations/20210102164121
+++ /dev/null
@@ -1 +0,0 @@
-d15dc3e57f050f037dd6b6b2b1efdafee49bf411580e35a7b4dbe14868c41e13 \ No newline at end of file
diff --git a/db/schema_migrations/20210104163218 b/db/schema_migrations/20210104163218
deleted file mode 100644
index c58a142f92e..00000000000
--- a/db/schema_migrations/20210104163218
+++ /dev/null
@@ -1 +0,0 @@
-37aa0564d2ade1cab56a669facccbaaf08e4d9856c7a4cc120968d33cff161bd \ No newline at end of file
diff --git a/db/schema_migrations/20210105030125 b/db/schema_migrations/20210105030125
deleted file mode 100644
index d2495a23b63..00000000000
--- a/db/schema_migrations/20210105030125
+++ /dev/null
@@ -1 +0,0 @@
-c5a780e5b5e62043fb04e77ebf89f7d04dfc9bfdc70df8d89c16a3f3fd960ea3 \ No newline at end of file
diff --git a/db/schema_migrations/20210105052034 b/db/schema_migrations/20210105052034
deleted file mode 100644
index d2c1eacddf6..00000000000
--- a/db/schema_migrations/20210105052034
+++ /dev/null
@@ -1 +0,0 @@
-4eef64fb237f783cdb07e012356d48a4ec9afc349721de1c53cf3def95e83858 \ No newline at end of file
diff --git a/db/schema_migrations/20210105052229 b/db/schema_migrations/20210105052229
deleted file mode 100644
index 19b7f359482..00000000000
--- a/db/schema_migrations/20210105052229
+++ /dev/null
@@ -1 +0,0 @@
-ef994f0c65154825906fb0952b9b3073f4cb0692f01c90280edf06a4ea2ec339 \ No newline at end of file
diff --git a/db/schema_migrations/20210105103649 b/db/schema_migrations/20210105103649
deleted file mode 100644
index 9b00aa2524c..00000000000
--- a/db/schema_migrations/20210105103649
+++ /dev/null
@@ -1 +0,0 @@
-0a318fbcf54860d9fe8b3e8372e10331d2b52df738e621f4b0eec5fd4f255739 \ No newline at end of file
diff --git a/db/schema_migrations/20210105153342 b/db/schema_migrations/20210105153342
deleted file mode 100644
index cb970b9b3cc..00000000000
--- a/db/schema_migrations/20210105153342
+++ /dev/null
@@ -1 +0,0 @@
-7a252c5d76c1e71421c3aa3e01584cdeeec6a5002ba6ef0824674c64f92e2764 \ No newline at end of file
diff --git a/db/schema_migrations/20210105154321 b/db/schema_migrations/20210105154321
deleted file mode 100644
index 2f7f2477526..00000000000
--- a/db/schema_migrations/20210105154321
+++ /dev/null
@@ -1 +0,0 @@
-9327676097c49bb1a221d79dd351ad8c57a434f19e32f49951c0d6d655c2fa4e \ No newline at end of file
diff --git a/db/schema_migrations/20210106061254 b/db/schema_migrations/20210106061254
deleted file mode 100644
index 3780e444cd3..00000000000
--- a/db/schema_migrations/20210106061254
+++ /dev/null
@@ -1 +0,0 @@
-f4c81be1168dc8dc3eaadbc9b0d46cfd5aefa0b9e4d61fa8276bbc4f59216da8 \ No newline at end of file
diff --git a/db/schema_migrations/20210106153021 b/db/schema_migrations/20210106153021
deleted file mode 100644
index a00c59a8534..00000000000
--- a/db/schema_migrations/20210106153021
+++ /dev/null
@@ -1 +0,0 @@
-71e005116082a59e40194fe5f9a500e31d67a011500d12aeecd59cb64d611848 \ No newline at end of file
diff --git a/db/schema_migrations/20210106155209 b/db/schema_migrations/20210106155209
deleted file mode 100644
index 10dde1cf874..00000000000
--- a/db/schema_migrations/20210106155209
+++ /dev/null
@@ -1 +0,0 @@
-4aeff45663a9f5a41a8dd92298afb4b0b57aa6f190f4648455df2fa1e39e174f \ No newline at end of file
diff --git a/db/schema_migrations/20210106191305 b/db/schema_migrations/20210106191305
deleted file mode 100644
index 5fd79e227e6..00000000000
--- a/db/schema_migrations/20210106191305
+++ /dev/null
@@ -1 +0,0 @@
-938977d6379e484a53857304c339a024c32d8b71c2175574a72314e461d67e3b \ No newline at end of file
diff --git a/db/schema_migrations/20210106225424 b/db/schema_migrations/20210106225424
deleted file mode 100644
index 84878ee30f4..00000000000
--- a/db/schema_migrations/20210106225424
+++ /dev/null
@@ -1 +0,0 @@
-a0561e52982756aded22563e833ab8005b4f45b84c81e872dd8c7188aeb84434 \ No newline at end of file
diff --git a/db/schema_migrations/20210107105306 b/db/schema_migrations/20210107105306
deleted file mode 100644
index fe66a041837..00000000000
--- a/db/schema_migrations/20210107105306
+++ /dev/null
@@ -1 +0,0 @@
-f76ce27a82f4773dcda324d79cc93a044f21317dbb9fdff035879502b5752da3 \ No newline at end of file
diff --git a/db/schema_migrations/20210107154615 b/db/schema_migrations/20210107154615
deleted file mode 100644
index f8b6f97d3fe..00000000000
--- a/db/schema_migrations/20210107154615
+++ /dev/null
@@ -1 +0,0 @@
-3e867ceefcab4f043b89d3c04e6e0a1182423039e1a9245e611128efe77c0e88 \ No newline at end of file
diff --git a/db/schema_migrations/20210107194543 b/db/schema_migrations/20210107194543
deleted file mode 100644
index 997bdd98b5a..00000000000
--- a/db/schema_migrations/20210107194543
+++ /dev/null
@@ -1 +0,0 @@
-d72cf1c88a060ccadd9f90cbef5ae7d4ea6a4416a6263d11a870e01b02d1f935 \ No newline at end of file
diff --git a/db/schema_migrations/20210108161039 b/db/schema_migrations/20210108161039
deleted file mode 100644
index d60bab2ec5a..00000000000
--- a/db/schema_migrations/20210108161039
+++ /dev/null
@@ -1 +0,0 @@
-7888a82e3bbc1f4c78badcbe8335ac823ebdedec843a9d90f91cf0d5c169a191 \ No newline at end of file
diff --git a/db/schema_migrations/20210111051045 b/db/schema_migrations/20210111051045
deleted file mode 100644
index 842c164fc20..00000000000
--- a/db/schema_migrations/20210111051045
+++ /dev/null
@@ -1 +0,0 @@
-6075e469081fcca124c0c4b485071a086545b502c398314cca05052765072caf \ No newline at end of file
diff --git a/db/schema_migrations/20210111053308 b/db/schema_migrations/20210111053308
deleted file mode 100644
index b7968a03c32..00000000000
--- a/db/schema_migrations/20210111053308
+++ /dev/null
@@ -1 +0,0 @@
-a98ca25378df3fc798b6ae361b3a47b697f6b853796975221329db023cb98466 \ No newline at end of file
diff --git a/db/schema_migrations/20210111075104 b/db/schema_migrations/20210111075104
deleted file mode 100644
index f0d8f6da529..00000000000
--- a/db/schema_migrations/20210111075104
+++ /dev/null
@@ -1 +0,0 @@
-3568bda1b43710880c8bfe2777d346aba1172217c27b5e690e7151aec9da2288 \ No newline at end of file
diff --git a/db/schema_migrations/20210111075105 b/db/schema_migrations/20210111075105
deleted file mode 100644
index d058560ead2..00000000000
--- a/db/schema_migrations/20210111075105
+++ /dev/null
@@ -1 +0,0 @@
-d48f5e042f3f919041f0c93e6492bcf56c19f4268d4819bd231ddffe70ba7c6b \ No newline at end of file
diff --git a/db/schema_migrations/20210111075206 b/db/schema_migrations/20210111075206
deleted file mode 100644
index 369c5316124..00000000000
--- a/db/schema_migrations/20210111075206
+++ /dev/null
@@ -1 +0,0 @@
-9da5955d9f71d671a41e6d03f76f87370d6e67b6853707adb164f7ffa8c75082 \ No newline at end of file
diff --git a/db/schema_migrations/20210112084512 b/db/schema_migrations/20210112084512
deleted file mode 100644
index 3091c8e2542..00000000000
--- a/db/schema_migrations/20210112084512
+++ /dev/null
@@ -1 +0,0 @@
-e8e26d49a8292e31ef0ea88a0262f0386b8deda83658ea4de7d464d79c5428e4 \ No newline at end of file
diff --git a/db/schema_migrations/20210112143418 b/db/schema_migrations/20210112143418
deleted file mode 100644
index 3183c8cf220..00000000000
--- a/db/schema_migrations/20210112143418
+++ /dev/null
@@ -1 +0,0 @@
-05d45e25ab9ef1565c04ca6515e0b01f2f98c5e98b1eeb09fa9dd43ebbe3c4d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210112202949 b/db/schema_migrations/20210112202949
deleted file mode 100644
index 5926b701b1a..00000000000
--- a/db/schema_migrations/20210112202949
+++ /dev/null
@@ -1 +0,0 @@
-56595e67e9e78a9558e6874d75bdcc295b89ab0096d1b37e4d9366e1574d241c \ No newline at end of file
diff --git a/db/schema_migrations/20210113224909 b/db/schema_migrations/20210113224909
deleted file mode 100644
index ab03538f520..00000000000
--- a/db/schema_migrations/20210113224909
+++ /dev/null
@@ -1 +0,0 @@
-e6841491cd7d2cc015fd628f5c14270720d59cbb17b7efb160937963f074f5c2 \ No newline at end of file
diff --git a/db/schema_migrations/20210113231532 b/db/schema_migrations/20210113231532
deleted file mode 100644
index eb39ac161ba..00000000000
--- a/db/schema_migrations/20210113231532
+++ /dev/null
@@ -1 +0,0 @@
-1a430ce6d137ee896cbd37bb822ccd18c9e87204b765b1192928dd82efb28602 \ No newline at end of file
diff --git a/db/schema_migrations/20210113231546 b/db/schema_migrations/20210113231546
deleted file mode 100644
index 3286727b72c..00000000000
--- a/db/schema_migrations/20210113231546
+++ /dev/null
@@ -1 +0,0 @@
-5d7bbf376acbf5679d111866e70b69eebba26a487a9e7d6bd571f15dc423e3e3 \ No newline at end of file
diff --git a/db/schema_migrations/20210114033715 b/db/schema_migrations/20210114033715
deleted file mode 100644
index 6d25bd971e2..00000000000
--- a/db/schema_migrations/20210114033715
+++ /dev/null
@@ -1 +0,0 @@
-69aae8d967fdb8af816a969fd818ed325b8d780b4faaa205c78a66c5d533ab2a \ No newline at end of file
diff --git a/db/schema_migrations/20210114142443 b/db/schema_migrations/20210114142443
deleted file mode 100644
index d4e771a56f5..00000000000
--- a/db/schema_migrations/20210114142443
+++ /dev/null
@@ -1 +0,0 @@
-7ef5cb1f167c133c67fc98c0abe929516ec700179747d3353d19cf8219ebd0ef \ No newline at end of file
diff --git a/db/schema_migrations/20210115090452 b/db/schema_migrations/20210115090452
deleted file mode 100644
index 92c5574e71f..00000000000
--- a/db/schema_migrations/20210115090452
+++ /dev/null
@@ -1 +0,0 @@
-5415850ae27c507fd8b1df20951e25b42352f4f9ec8e1402019533170edabdb8 \ No newline at end of file
diff --git a/db/schema_migrations/20210115215854 b/db/schema_migrations/20210115215854
deleted file mode 100644
index c27de41ad0a..00000000000
--- a/db/schema_migrations/20210115215854
+++ /dev/null
@@ -1 +0,0 @@
-cb846ce5f6270cfdc543c3d4ad3e861b2a92445b952ee8f0a02f4171b9792411 \ No newline at end of file
diff --git a/db/schema_migrations/20210115220610 b/db/schema_migrations/20210115220610
deleted file mode 100644
index 002c37e54ec..00000000000
--- a/db/schema_migrations/20210115220610
+++ /dev/null
@@ -1 +0,0 @@
-541a6626d3afd4fd421fd59fe5eb8ab7764952ae780c83c3805fd4a29e3f42fb \ No newline at end of file
diff --git a/db/schema_migrations/20210117210226 b/db/schema_migrations/20210117210226
deleted file mode 100644
index a68f7f6d93e..00000000000
--- a/db/schema_migrations/20210117210226
+++ /dev/null
@@ -1 +0,0 @@
-c0d22d00d52a516347930e1a36f350113c0949214925176f08ceed81999746bd \ No newline at end of file
diff --git a/db/schema_migrations/20210118111307 b/db/schema_migrations/20210118111307
deleted file mode 100644
index 036d909f5ad..00000000000
--- a/db/schema_migrations/20210118111307
+++ /dev/null
@@ -1 +0,0 @@
-f33cc3eebc9197db381d81150a140582e30905d3964d6fb444caad6c9eff1b31 \ No newline at end of file
diff --git a/db/schema_migrations/20210119122354 b/db/schema_migrations/20210119122354
deleted file mode 100644
index a17b2dab2df..00000000000
--- a/db/schema_migrations/20210119122354
+++ /dev/null
@@ -1 +0,0 @@
-e8264993f6503268cd99e8ca26ccdc0e986f31a2818b9bbef2a9cef36191e686 \ No newline at end of file
diff --git a/db/schema_migrations/20210119153801 b/db/schema_migrations/20210119153801
deleted file mode 100644
index f84f7ad1d48..00000000000
--- a/db/schema_migrations/20210119153801
+++ /dev/null
@@ -1 +0,0 @@
-c8b5485f158fdec0ab6813e4014713786dfa231b901e77ea610a873d03f8f0f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210119162812 b/db/schema_migrations/20210119162812
deleted file mode 100644
index dfbf33a9fcf..00000000000
--- a/db/schema_migrations/20210119162812
+++ /dev/null
@@ -1 +0,0 @@
-cd7643fc762d8b9236ef5ac7cc285ffbd29f1953178b9b6e129082efd7b9e07b \ No newline at end of file
diff --git a/db/schema_migrations/20210120180956 b/db/schema_migrations/20210120180956
deleted file mode 100644
index 395c9c09df9..00000000000
--- a/db/schema_migrations/20210120180956
+++ /dev/null
@@ -1 +0,0 @@
-897815c347f04093da5eba420e95b6310454bd493412914e60a296bd710ebde1 \ No newline at end of file
diff --git a/db/schema_migrations/20210120221743 b/db/schema_migrations/20210120221743
deleted file mode 100644
index ce54788b86c..00000000000
--- a/db/schema_migrations/20210120221743
+++ /dev/null
@@ -1 +0,0 @@
-4bf1d277affdfa9ee772d69cb713f49f257140fb58c40bc8659d563b4cc3de29 \ No newline at end of file
diff --git a/db/schema_migrations/20210121093618 b/db/schema_migrations/20210121093618
deleted file mode 100644
index f12566f1aa9..00000000000
--- a/db/schema_migrations/20210121093618
+++ /dev/null
@@ -1 +0,0 @@
-e2be30f71b2a4a410b21e57ee53c3b54cf0214a08bc65cd92b2cb4b93bde9451 \ No newline at end of file
diff --git a/db/schema_migrations/20210121100038 b/db/schema_migrations/20210121100038
deleted file mode 100644
index 0f9379ff019..00000000000
--- a/db/schema_migrations/20210121100038
+++ /dev/null
@@ -1 +0,0 @@
-12a5eba74f0bb5b63cddd32d32009ad073e638a9defb40eeee5c16f559ebe951 \ No newline at end of file
diff --git a/db/schema_migrations/20210121121102 b/db/schema_migrations/20210121121102
deleted file mode 100644
index 6bce3892276..00000000000
--- a/db/schema_migrations/20210121121102
+++ /dev/null
@@ -1 +0,0 @@
-359231b3f18a2c1e56ffba4872a51d01fd4ca834ef722e1133a5a9f01e4271e9 \ No newline at end of file
diff --git a/db/schema_migrations/20210122073805 b/db/schema_migrations/20210122073805
deleted file mode 100644
index 322c90eb820..00000000000
--- a/db/schema_migrations/20210122073805
+++ /dev/null
@@ -1 +0,0 @@
-f5231b1eec17ea1a67f2d2f4ca759314afb85b2c8fb431e3303d530d44bdb1ef \ No newline at end of file
diff --git a/db/schema_migrations/20210122153259 b/db/schema_migrations/20210122153259
deleted file mode 100644
index 887f0ac4a5c..00000000000
--- a/db/schema_migrations/20210122153259
+++ /dev/null
@@ -1 +0,0 @@
-4c697cc183a000ee8c18b516e4b1d77d0f8d2d3d7abe11121f2240a60c03216c \ No newline at end of file
diff --git a/db/schema_migrations/20210122155158 b/db/schema_migrations/20210122155158
deleted file mode 100644
index f521f910346..00000000000
--- a/db/schema_migrations/20210122155158
+++ /dev/null
@@ -1 +0,0 @@
-5f326f101ff06993e9160b0486d24d615abd6d5027b375e422f776181ad8a193 \ No newline at end of file
diff --git a/db/schema_migrations/20210125105410 b/db/schema_migrations/20210125105410
deleted file mode 100644
index d685894bd8a..00000000000
--- a/db/schema_migrations/20210125105410
+++ /dev/null
@@ -1 +0,0 @@
-0c80fa1c88f67ef34bbfab52b1b75eadc4a6f07557986f0fbe4ffd83e20df52a \ No newline at end of file
diff --git a/db/schema_migrations/20210126030249 b/db/schema_migrations/20210126030249
deleted file mode 100644
index 068f5eeb9c5..00000000000
--- a/db/schema_migrations/20210126030249
+++ /dev/null
@@ -1 +0,0 @@
-b5c219d1b1443ddf482f26d8280a1c7318456affce3ad57a082eb8f9efc32206 \ No newline at end of file
diff --git a/db/schema_migrations/20210126091713 b/db/schema_migrations/20210126091713
deleted file mode 100644
index b75636bd437..00000000000
--- a/db/schema_migrations/20210126091713
+++ /dev/null
@@ -1 +0,0 @@
-3906739d07514e6e59f79a4a81d28859a2481614a299c95ec1b1d9825a07ec64 \ No newline at end of file
diff --git a/db/schema_migrations/20210126092102 b/db/schema_migrations/20210126092102
deleted file mode 100644
index 803643389f6..00000000000
--- a/db/schema_migrations/20210126092102
+++ /dev/null
@@ -1 +0,0 @@
-124c5ae1a1ccade5dec01f72b726e03febc8f56411d7d8990f976bb2a9516037 \ No newline at end of file
diff --git a/db/schema_migrations/20210126233608 b/db/schema_migrations/20210126233608
deleted file mode 100644
index adab3a3f365..00000000000
--- a/db/schema_migrations/20210126233608
+++ /dev/null
@@ -1 +0,0 @@
-4105ae45742c2eda67fe5c54256732e55555ab7832e4cbf0fcb041599c23bd29 \ No newline at end of file
diff --git a/db/schema_migrations/20210127052226 b/db/schema_migrations/20210127052226
deleted file mode 100644
index ca7d44edff8..00000000000
--- a/db/schema_migrations/20210127052226
+++ /dev/null
@@ -1 +0,0 @@
-e978687e9b27db5288862ea85053f3fc04a8e841702b16ca17c01398a86654d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210127143025 b/db/schema_migrations/20210127143025
deleted file mode 100644
index a4875304c0b..00000000000
--- a/db/schema_migrations/20210127143025
+++ /dev/null
@@ -1 +0,0 @@
-c173ba86340efe39977f1b319d1ebcead634e3bfe819a30e230fb4f81766f28a \ No newline at end of file
diff --git a/db/schema_migrations/20210127152613 b/db/schema_migrations/20210127152613
deleted file mode 100644
index f5d42ea2bc5..00000000000
--- a/db/schema_migrations/20210127152613
+++ /dev/null
@@ -1 +0,0 @@
-32f636ffad4d2c6a002129d6e3eaeaf5d8f420dcc1273665129dc4d23f2e0dbe \ No newline at end of file
diff --git a/db/schema_migrations/20210127202613 b/db/schema_migrations/20210127202613
deleted file mode 100644
index 42d38d4c1d7..00000000000
--- a/db/schema_migrations/20210127202613
+++ /dev/null
@@ -1 +0,0 @@
-951f46f88c1b07505e0b560e802a8bd701db7d379342d97b0bff3ad90e81fb02 \ No newline at end of file
diff --git a/db/schema_migrations/20210128044930 b/db/schema_migrations/20210128044930
deleted file mode 100644
index 4965cd9a9c6..00000000000
--- a/db/schema_migrations/20210128044930
+++ /dev/null
@@ -1 +0,0 @@
-6164ef91c60bd614310cbda6ad8ab1a205cae17c4d037fafa89eaf95d06323e4 \ No newline at end of file
diff --git a/db/schema_migrations/20210128101707 b/db/schema_migrations/20210128101707
deleted file mode 100644
index f10f080c1df..00000000000
--- a/db/schema_migrations/20210128101707
+++ /dev/null
@@ -1 +0,0 @@
-ae84fa35fcc5a0780d86887294a32e250d2ac13dcf607750f834df5828e5bece \ No newline at end of file
diff --git a/db/schema_migrations/20210128114526 b/db/schema_migrations/20210128114526
deleted file mode 100644
index 107c86913ba..00000000000
--- a/db/schema_migrations/20210128114526
+++ /dev/null
@@ -1 +0,0 @@
-ad83205a0203427ccad1c25933e28cf13ebfb0274865ce5f0f2d578e84bb07a3 \ No newline at end of file
diff --git a/db/schema_migrations/20210128140157 b/db/schema_migrations/20210128140157
deleted file mode 100644
index 2b71db39920..00000000000
--- a/db/schema_migrations/20210128140157
+++ /dev/null
@@ -1 +0,0 @@
-0fa84b2038f33e27e549bdb3eb137e1813f604b6e81abc67a49a54d3e1e4bcf5 \ No newline at end of file
diff --git a/db/schema_migrations/20210128140232 b/db/schema_migrations/20210128140232
deleted file mode 100644
index ee335323fce..00000000000
--- a/db/schema_migrations/20210128140232
+++ /dev/null
@@ -1 +0,0 @@
-93f337364eb5ca5c67f4d4767d1aee9972bfe0596c89f006317dd6103558e35c \ No newline at end of file
diff --git a/db/schema_migrations/20210128152830 b/db/schema_migrations/20210128152830
deleted file mode 100644
index 36d3de788eb..00000000000
--- a/db/schema_migrations/20210128152830
+++ /dev/null
@@ -1 +0,0 @@
-932509d18f1cfdfa09f1565e4ac2f197b7ca792263ff5da3e5b712fae7279925 \ No newline at end of file
diff --git a/db/schema_migrations/20210128172149 b/db/schema_migrations/20210128172149
deleted file mode 100644
index cc0e050be3e..00000000000
--- a/db/schema_migrations/20210128172149
+++ /dev/null
@@ -1 +0,0 @@
-1cf1305ad5eaaef51f99f057b8a2e81731d69a6d02629c0c9a7d94dfdecbea47 \ No newline at end of file
diff --git a/db/schema_migrations/20210129225244 b/db/schema_migrations/20210129225244
deleted file mode 100644
index 1b05096b07f..00000000000
--- a/db/schema_migrations/20210129225244
+++ /dev/null
@@ -1 +0,0 @@
-6cb54c71a9835ec1b3cf801a19c2cd385d224e0438c7924b6a29d298ecebe8a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210201034649 b/db/schema_migrations/20210201034649
deleted file mode 100644
index 5cc99ebc893..00000000000
--- a/db/schema_migrations/20210201034649
+++ /dev/null
@@ -1 +0,0 @@
-e5492820a8618d5599429ece04ea941e869c84c22d213d536644bcefc5775363 \ No newline at end of file
diff --git a/db/schema_migrations/20210201140434 b/db/schema_migrations/20210201140434
deleted file mode 100644
index 00671276b1c..00000000000
--- a/db/schema_migrations/20210201140434
+++ /dev/null
@@ -1 +0,0 @@
-71220cfc36215f6c22d22d1fb0b74389e90c58733214b5fa36dcb8da0377a120 \ No newline at end of file
diff --git a/db/schema_migrations/20210203002331 b/db/schema_migrations/20210203002331
deleted file mode 100644
index f1ed6bf23f6..00000000000
--- a/db/schema_migrations/20210203002331
+++ /dev/null
@@ -1 +0,0 @@
-b8a19b2ebf648a1b79a488a7a2847f6a392e594464c1ba0ae96f274f583559e3 \ No newline at end of file
diff --git a/db/schema_migrations/20210203092540 b/db/schema_migrations/20210203092540
deleted file mode 100644
index 12367417d44..00000000000
--- a/db/schema_migrations/20210203092540
+++ /dev/null
@@ -1 +0,0 @@
-fa0b69df96069dd29971f69a51ce4eb691480904c5693fa480f6daa83b042e77 \ No newline at end of file
diff --git a/db/schema_migrations/20210203092549 b/db/schema_migrations/20210203092549
deleted file mode 100644
index 967b0d3acc7..00000000000
--- a/db/schema_migrations/20210203092549
+++ /dev/null
@@ -1 +0,0 @@
-096d13548e156a13b9ccdbb39ed83b3be7ef64a57df5daea2e3cd870f3e2b448 \ No newline at end of file
diff --git a/db/schema_migrations/20210203143131 b/db/schema_migrations/20210203143131
deleted file mode 100644
index 6b318f8c219..00000000000
--- a/db/schema_migrations/20210203143131
+++ /dev/null
@@ -1 +0,0 @@
-1f05176d9f6a88e9d740000084b7c9f5c72c61a59dbe1f68f43b3b5606ecd9d8 \ No newline at end of file
diff --git a/db/schema_migrations/20210203221631 b/db/schema_migrations/20210203221631
deleted file mode 100644
index ed9efcd2b5f..00000000000
--- a/db/schema_migrations/20210203221631
+++ /dev/null
@@ -1 +0,0 @@
-ec6832ba26fca8d8427383cd0189765191a0a7f17bb78d61b900c5b541d5725e \ No newline at end of file
diff --git a/db/schema_migrations/20210203222620 b/db/schema_migrations/20210203222620
deleted file mode 100644
index 2c8c3ffc111..00000000000
--- a/db/schema_migrations/20210203222620
+++ /dev/null
@@ -1 +0,0 @@
-6d3250533b72c6aa307570d386725fa3ebe1ec49c36edc0f7d6dc8a1d5092826 \ No newline at end of file
diff --git a/db/schema_migrations/20210203223551 b/db/schema_migrations/20210203223551
deleted file mode 100644
index 53b3a9f65aa..00000000000
--- a/db/schema_migrations/20210203223551
+++ /dev/null
@@ -1 +0,0 @@
-4ccf450bbc9061edae81cabcfafd9360f1f57cfd25af3ad016fbbb344f9fe694 \ No newline at end of file
diff --git a/db/schema_migrations/20210204152257 b/db/schema_migrations/20210204152257
deleted file mode 100644
index c98d4637d05..00000000000
--- a/db/schema_migrations/20210204152257
+++ /dev/null
@@ -1 +0,0 @@
-cb9f4b4e627cbc163653fc01c0542ef0ce87139b376c55bbaa4d7ab23e9b8973 \ No newline at end of file
diff --git a/db/schema_migrations/20210204212850 b/db/schema_migrations/20210204212850
deleted file mode 100644
index ffa4ca8393e..00000000000
--- a/db/schema_migrations/20210204212850
+++ /dev/null
@@ -1 +0,0 @@
-2a40acf9a3ac2716120388cfe79be13130e4587286d215596e9c75097af1e436 \ No newline at end of file
diff --git a/db/schema_migrations/20210205084357 b/db/schema_migrations/20210205084357
deleted file mode 100644
index 6babb782c70..00000000000
--- a/db/schema_migrations/20210205084357
+++ /dev/null
@@ -1 +0,0 @@
-5bd622f36126b06c7c585ee14a8140750843d36092e79b6cc35b62c06afb1178 \ No newline at end of file
diff --git a/db/schema_migrations/20210205104425 b/db/schema_migrations/20210205104425
deleted file mode 100644
index c51f201b5a6..00000000000
--- a/db/schema_migrations/20210205104425
+++ /dev/null
@@ -1 +0,0 @@
-4df2229fca7652cb836c867b621da91f1194899c50bb0a8be2fbae58f29dc788 \ No newline at end of file
diff --git a/db/schema_migrations/20210205134213 b/db/schema_migrations/20210205134213
deleted file mode 100644
index bc2525e85cd..00000000000
--- a/db/schema_migrations/20210205134213
+++ /dev/null
@@ -1 +0,0 @@
-7c368cad497ccfd86c6a92e2edfec1d2a16879eb749184b1d20c5ab4c702b974 \ No newline at end of file
diff --git a/db/schema_migrations/20210205143926 b/db/schema_migrations/20210205143926
deleted file mode 100644
index 00a8c3528a7..00000000000
--- a/db/schema_migrations/20210205143926
+++ /dev/null
@@ -1 +0,0 @@
-cdf55e9f2b1b9c375920198a438d29fe3c9ab7147f3c670b0d66b11d499573d9 \ No newline at end of file
diff --git a/db/schema_migrations/20210205144537 b/db/schema_migrations/20210205144537
deleted file mode 100644
index 6ca27521248..00000000000
--- a/db/schema_migrations/20210205144537
+++ /dev/null
@@ -1 +0,0 @@
-d9cfb7515805e642c562b8be58b6cd482c24e62e76245db35a7d91b25c327d8d \ No newline at end of file
diff --git a/db/schema_migrations/20210205174154 b/db/schema_migrations/20210205174154
deleted file mode 100644
index fc8c4b6cff1..00000000000
--- a/db/schema_migrations/20210205174154
+++ /dev/null
@@ -1 +0,0 @@
-483d1b4a24086fa57efe7f3b3fa872cf793352f80aba5c25614f07eafa2d30c5 \ No newline at end of file
diff --git a/db/schema_migrations/20210205213915 b/db/schema_migrations/20210205213915
deleted file mode 100644
index 5849abd1d03..00000000000
--- a/db/schema_migrations/20210205213915
+++ /dev/null
@@ -1 +0,0 @@
-c7c2936062f4a7c764938453fb28dc2f461a06f0a21cc74b1750edbde9398fa1 \ No newline at end of file
diff --git a/db/schema_migrations/20210205213933 b/db/schema_migrations/20210205213933
deleted file mode 100644
index f3ebb2672c7..00000000000
--- a/db/schema_migrations/20210205213933
+++ /dev/null
@@ -1 +0,0 @@
-caec7f6c66a0277561f650ae513fedaba581ab35bb238351eccccfef1132d118 \ No newline at end of file
diff --git a/db/schema_migrations/20210205214003 b/db/schema_migrations/20210205214003
deleted file mode 100644
index 4d1ea7570f5..00000000000
--- a/db/schema_migrations/20210205214003
+++ /dev/null
@@ -1 +0,0 @@
-6ca08c885fddccd3c82fc8651d20140655b65019e56f9c6136e92140401386d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210208103243 b/db/schema_migrations/20210208103243
deleted file mode 100644
index c251beb4b2f..00000000000
--- a/db/schema_migrations/20210208103243
+++ /dev/null
@@ -1 +0,0 @@
-039962e291f9adde52379cac8f8278aa1b339d973fb33ae40ea7d8dc3e113fb6 \ No newline at end of file
diff --git a/db/schema_migrations/20210208125050 b/db/schema_migrations/20210208125050
deleted file mode 100644
index 35877cfc029..00000000000
--- a/db/schema_migrations/20210208125050
+++ /dev/null
@@ -1 +0,0 @@
-b9200d6c754f7c450ba0c718171806e8f4f9720d870e532f4800640ca707f24f \ No newline at end of file
diff --git a/db/schema_migrations/20210208125248 b/db/schema_migrations/20210208125248
deleted file mode 100644
index 91d5c4bb950..00000000000
--- a/db/schema_migrations/20210208125248
+++ /dev/null
@@ -1 +0,0 @@
-3a7fb1b7959f09b9ba464253a72d52bcb744e7f78aac4f44e1d9201fa3c8387d \ No newline at end of file
diff --git a/db/schema_migrations/20210208144134 b/db/schema_migrations/20210208144134
deleted file mode 100644
index 1afe893eba0..00000000000
--- a/db/schema_migrations/20210208144134
+++ /dev/null
@@ -1 +0,0 @@
-845636d8a0c6e9b6b39194cb44ffeceea3464023c22fadb2a4da44fed5dd973f \ No newline at end of file
diff --git a/db/schema_migrations/20210208161207 b/db/schema_migrations/20210208161207
deleted file mode 100644
index 7064a636822..00000000000
--- a/db/schema_migrations/20210208161207
+++ /dev/null
@@ -1 +0,0 @@
-818fcf0f0fec9d2833b091ef380005a2d485486522fb63e2a7b2fd01dbf1ff79 \ No newline at end of file
diff --git a/db/schema_migrations/20210208200914 b/db/schema_migrations/20210208200914
deleted file mode 100644
index 10a98a3d6e2..00000000000
--- a/db/schema_migrations/20210208200914
+++ /dev/null
@@ -1 +0,0 @@
-e7a0121e8e21acd356daa882d8fe83242f4db180915dd0f3c25835c6c664ce0b \ No newline at end of file
diff --git a/db/schema_migrations/20210209110019 b/db/schema_migrations/20210209110019
deleted file mode 100644
index d11e6e5a167..00000000000
--- a/db/schema_migrations/20210209110019
+++ /dev/null
@@ -1 +0,0 @@
-a24354264df3c12411af040903d26faf298f06a7334ef118f87b3e88b683b326 \ No newline at end of file
diff --git a/db/schema_migrations/20210209160510 b/db/schema_migrations/20210209160510
deleted file mode 100644
index 3aa90658d4e..00000000000
--- a/db/schema_migrations/20210209160510
+++ /dev/null
@@ -1 +0,0 @@
-601d67a2911c461881064ec18a2246ef9e5b2835eb0fdf40e701c9360e19eca4 \ No newline at end of file
diff --git a/db/schema_migrations/20210209171525 b/db/schema_migrations/20210209171525
deleted file mode 100644
index 0c421b99a39..00000000000
--- a/db/schema_migrations/20210209171525
+++ /dev/null
@@ -1 +0,0 @@
-5c661c453922181b350b8551d9a8f9b097e568459a2c2d128e41d9aefb026ab5 \ No newline at end of file
diff --git a/db/schema_migrations/20210209232508 b/db/schema_migrations/20210209232508
deleted file mode 100644
index d424fff0469..00000000000
--- a/db/schema_migrations/20210209232508
+++ /dev/null
@@ -1 +0,0 @@
-484751de711e873e0f0f22d5951e36bf60d4826ebc95afa45e4f6cdaa0e3c024 \ No newline at end of file
diff --git a/db/schema_migrations/20210210093901 b/db/schema_migrations/20210210093901
deleted file mode 100644
index c1bbb93de21..00000000000
--- a/db/schema_migrations/20210210093901
+++ /dev/null
@@ -1 +0,0 @@
-961c147e9c8e35eac5b8dd33f879582e173b7f6e31659b2d00989bc38afc6f5a \ No newline at end of file
diff --git a/db/schema_migrations/20210210210232 b/db/schema_migrations/20210210210232
deleted file mode 100644
index 96f31a2adef..00000000000
--- a/db/schema_migrations/20210210210232
+++ /dev/null
@@ -1 +0,0 @@
-e1bd58eeaf63caf473680a8c4b7269cc63e7c0d6e8d4e71636608e10c9731c85 \ No newline at end of file
diff --git a/db/schema_migrations/20210210221006 b/db/schema_migrations/20210210221006
deleted file mode 100644
index 5292b5c0dce..00000000000
--- a/db/schema_migrations/20210210221006
+++ /dev/null
@@ -1 +0,0 @@
-1ff1256d2deac0a1545ef7db30d8ba7969265d6c2df62f6bd20f9f1721a482cb \ No newline at end of file
diff --git a/db/schema_migrations/20210211195543 b/db/schema_migrations/20210211195543
deleted file mode 100644
index 7f15ca21d36..00000000000
--- a/db/schema_migrations/20210211195543
+++ /dev/null
@@ -1 +0,0 @@
-484338ddc83bfb44523d08da92ac7f5b9d13e1a66ad1c9c3f7590f91fc9305c0 \ No newline at end of file
diff --git a/db/schema_migrations/20210212153934 b/db/schema_migrations/20210212153934
deleted file mode 100644
index 28ef55d012c..00000000000
--- a/db/schema_migrations/20210212153934
+++ /dev/null
@@ -1 +0,0 @@
-233a976aab340f16ed1c896963580fb66f4c9b4dee6a34f9536a62a4f7688792 \ No newline at end of file
diff --git a/db/schema_migrations/20210212163231 b/db/schema_migrations/20210212163231
deleted file mode 100644
index e0ba3d83bf5..00000000000
--- a/db/schema_migrations/20210212163231
+++ /dev/null
@@ -1 +0,0 @@
-4c6061f6ab1cb9e070a3ae87d44caf12d2c110a6033f0b33898b4b7ea7e37055 \ No newline at end of file
diff --git a/db/schema_migrations/20210214201118 b/db/schema_migrations/20210214201118
deleted file mode 100644
index 9551d2ddf50..00000000000
--- a/db/schema_migrations/20210214201118
+++ /dev/null
@@ -1 +0,0 @@
-8c1da1c7edba16993da93d9075ad2a3624b8c12ccf73a241e1a166014a99e254 \ No newline at end of file
diff --git a/db/schema_migrations/20210214205155 b/db/schema_migrations/20210214205155
deleted file mode 100644
index 583d7ca1167..00000000000
--- a/db/schema_migrations/20210214205155
+++ /dev/null
@@ -1 +0,0 @@
-7678d97de752e7a9a571d80febc74eb44c699c7b1967690d9a2391036caea5d2 \ No newline at end of file
diff --git a/db/schema_migrations/20210215095328 b/db/schema_migrations/20210215095328
deleted file mode 100644
index b360aaf4ad8..00000000000
--- a/db/schema_migrations/20210215095328
+++ /dev/null
@@ -1 +0,0 @@
-25820a3d060826a082565f12a3ac96deafbbde750f5756d71e34d14801ec6148 \ No newline at end of file
diff --git a/db/schema_migrations/20210215144909 b/db/schema_migrations/20210215144909
deleted file mode 100644
index 02939e3dba5..00000000000
--- a/db/schema_migrations/20210215144909
+++ /dev/null
@@ -1 +0,0 @@
-2965d990ec9cf2edd610b063686f9a1d9de4c38bcba3c8439a18159812d529d4 \ No newline at end of file
diff --git a/db/schema_migrations/20210215172449 b/db/schema_migrations/20210215172449
deleted file mode 100644
index 5b310d80d6a..00000000000
--- a/db/schema_migrations/20210215172449
+++ /dev/null
@@ -1 +0,0 @@
-f72f0a31bca545d2528030019695b03e0858d7ae9a0fb32d407c25580731fa6b \ No newline at end of file
diff --git a/db/schema_migrations/20210216122140 b/db/schema_migrations/20210216122140
deleted file mode 100644
index 2d2faca6b19..00000000000
--- a/db/schema_migrations/20210216122140
+++ /dev/null
@@ -1 +0,0 @@
-0aa6f7385cf13c2b0ee9b7d2a51b63dd208feccffecee8f08ea3d183ebb5ffb4 \ No newline at end of file
diff --git a/db/schema_migrations/20210216135504 b/db/schema_migrations/20210216135504
deleted file mode 100644
index 99cda90b2ee..00000000000
--- a/db/schema_migrations/20210216135504
+++ /dev/null
@@ -1 +0,0 @@
-8c676b4142db828b1d2d5dc6bd891eb929d12ab13e9073693ab7d830bcea599a \ No newline at end of file
diff --git a/db/schema_migrations/20210216193620 b/db/schema_migrations/20210216193620
deleted file mode 100644
index 6c8e8d4c1c4..00000000000
--- a/db/schema_migrations/20210216193620
+++ /dev/null
@@ -1 +0,0 @@
-3587ba61d003385ea63ce900c1dd1c2bd1f2386abd921615b50421f1b798f553 \ No newline at end of file
diff --git a/db/schema_migrations/20210216223335 b/db/schema_migrations/20210216223335
deleted file mode 100644
index a086aaa8c91..00000000000
--- a/db/schema_migrations/20210216223335
+++ /dev/null
@@ -1 +0,0 @@
-52bf190bdb219366c790a5b7c081bfb383543498780cc95a25eafcecea036426 \ No newline at end of file
diff --git a/db/schema_migrations/20210217100728 b/db/schema_migrations/20210217100728
deleted file mode 100644
index 6027a27f8c2..00000000000
--- a/db/schema_migrations/20210217100728
+++ /dev/null
@@ -1 +0,0 @@
-281ea05a95785b7f1d2d805bf8fe071c0fa59425eb01b46eeb69ad21f5650e29 \ No newline at end of file
diff --git a/db/schema_migrations/20210217101901 b/db/schema_migrations/20210217101901
deleted file mode 100644
index f4c38be26e0..00000000000
--- a/db/schema_migrations/20210217101901
+++ /dev/null
@@ -1 +0,0 @@
-909aee5ed0ad447fec425f7252fc6dbec827a66ff720620bae1bf3a32536cb96 \ No newline at end of file
diff --git a/db/schema_migrations/20210218040814 b/db/schema_migrations/20210218040814
deleted file mode 100644
index 3c55d951c14..00000000000
--- a/db/schema_migrations/20210218040814
+++ /dev/null
@@ -1 +0,0 @@
-6fe34be82f9aee6cbdb729a67d1d4ac0702c8d9774a038bfd4fd9d9cb28b1a2b \ No newline at end of file
diff --git a/db/schema_migrations/20210218105431 b/db/schema_migrations/20210218105431
deleted file mode 100644
index 35dda4ac6f6..00000000000
--- a/db/schema_migrations/20210218105431
+++ /dev/null
@@ -1 +0,0 @@
-b5ff5aeb9cef243165d9c40db7211f61a632edb6a189c09112ef069d267bf64d \ No newline at end of file
diff --git a/db/schema_migrations/20210218110552 b/db/schema_migrations/20210218110552
deleted file mode 100644
index 5fb325bdfb5..00000000000
--- a/db/schema_migrations/20210218110552
+++ /dev/null
@@ -1 +0,0 @@
-7631c82f9762e643a4da9c03f3870ab1c97fae93da4975219d9ab7cd629720ec \ No newline at end of file
diff --git a/db/schema_migrations/20210218142626 b/db/schema_migrations/20210218142626
deleted file mode 100644
index e23a8139ffb..00000000000
--- a/db/schema_migrations/20210218142626
+++ /dev/null
@@ -1 +0,0 @@
-063c97800eec5bfc7f6879dbe559fa39952295d5ba947cf44ad03ac23212e924 \ No newline at end of file
diff --git a/db/schema_migrations/20210218144056 b/db/schema_migrations/20210218144056
deleted file mode 100644
index 566015ad8be..00000000000
--- a/db/schema_migrations/20210218144056
+++ /dev/null
@@ -1 +0,0 @@
-545747e86481c74832a6df55764ab97ecfefc4446df9cc2366a8ce9d9c400ea4 \ No newline at end of file
diff --git a/db/schema_migrations/20210218144656 b/db/schema_migrations/20210218144656
deleted file mode 100644
index 622877a279e..00000000000
--- a/db/schema_migrations/20210218144656
+++ /dev/null
@@ -1 +0,0 @@
-91969bfc791cd7bc78b940aa6fed345b13a3186db0b89828428b798aa4f7949e \ No newline at end of file
diff --git a/db/schema_migrations/20210219100137 b/db/schema_migrations/20210219100137
deleted file mode 100644
index c573c4fde5f..00000000000
--- a/db/schema_migrations/20210219100137
+++ /dev/null
@@ -1 +0,0 @@
-be2ddc15e16d7d59bd050a60faaa0b6941d94ba7c47a88be473bcf3a17bb2763 \ No newline at end of file
diff --git a/db/schema_migrations/20210219102900 b/db/schema_migrations/20210219102900
deleted file mode 100644
index b0a730c4361..00000000000
--- a/db/schema_migrations/20210219102900
+++ /dev/null
@@ -1 +0,0 @@
-42e06332b279aaac7044243df0a8bd5525025db7d8c22bc474c0874e85f525f5 \ No newline at end of file
diff --git a/db/schema_migrations/20210219111040 b/db/schema_migrations/20210219111040
deleted file mode 100644
index a006ece2f6c..00000000000
--- a/db/schema_migrations/20210219111040
+++ /dev/null
@@ -1 +0,0 @@
-546802f93f64e346b066438e78ace5d2dc54de8a5f6234c2d01296a239cfe74c \ No newline at end of file
diff --git a/db/schema_migrations/20210219211845 b/db/schema_migrations/20210219211845
deleted file mode 100644
index ad45eee91b5..00000000000
--- a/db/schema_migrations/20210219211845
+++ /dev/null
@@ -1 +0,0 @@
-b58f2853d7a2d9a821198f69c5913d290404a4961410dd66d256eefc7ecf1026 \ No newline at end of file
diff --git a/db/schema_migrations/20210222030537 b/db/schema_migrations/20210222030537
deleted file mode 100644
index ad30eb19333..00000000000
--- a/db/schema_migrations/20210222030537
+++ /dev/null
@@ -1 +0,0 @@
-44b0e2b3e32e45fb557a5c9c41f69de94a5d41bad43267f00090b9c527b2b1e1 \ No newline at end of file
diff --git a/db/schema_migrations/20210222042745 b/db/schema_migrations/20210222042745
deleted file mode 100644
index 306b8401e65..00000000000
--- a/db/schema_migrations/20210222042745
+++ /dev/null
@@ -1 +0,0 @@
-88bbd8cbc4398c3c05a834c4d8d36ee55aca9d698da3cf3c1df0afe916bc051f \ No newline at end of file
diff --git a/db/schema_migrations/20210222070356 b/db/schema_migrations/20210222070356
deleted file mode 100644
index 256bb771dde..00000000000
--- a/db/schema_migrations/20210222070356
+++ /dev/null
@@ -1 +0,0 @@
-2aa618cdbb6e55c3af1fa144ae3f3bd0d9d5400706db337301d2d165ba789ef0 \ No newline at end of file
diff --git a/db/schema_migrations/20210222070413 b/db/schema_migrations/20210222070413
deleted file mode 100644
index f1ba0c51922..00000000000
--- a/db/schema_migrations/20210222070413
+++ /dev/null
@@ -1 +0,0 @@
-e13856c6f65d86dae9a3268f91189bb90af236c555d2f645c6ba4c600c996cba \ No newline at end of file
diff --git a/db/schema_migrations/20210222085529 b/db/schema_migrations/20210222085529
deleted file mode 100644
index 63f47781b3b..00000000000
--- a/db/schema_migrations/20210222085529
+++ /dev/null
@@ -1 +0,0 @@
-858cd59ea324e3653801055c7f3fae2152b04ac175945a59faa00d67ae7fa223 \ No newline at end of file
diff --git a/db/schema_migrations/20210222085551 b/db/schema_migrations/20210222085551
deleted file mode 100644
index f0ba3562c3a..00000000000
--- a/db/schema_migrations/20210222085551
+++ /dev/null
@@ -1 +0,0 @@
-9e6f99ed0c3d4d76a8c290308805cabf84aa7e5fb6dc2b06d973d9d8726fc4d8 \ No newline at end of file
diff --git a/db/schema_migrations/20210222105120 b/db/schema_migrations/20210222105120
deleted file mode 100644
index 768aea442f5..00000000000
--- a/db/schema_migrations/20210222105120
+++ /dev/null
@@ -1 +0,0 @@
-4da0131929bf59dd4a72bf05a889063df7978f8b5782e5f3b27d466302dc44b6 \ No newline at end of file
diff --git a/db/schema_migrations/20210222185538 b/db/schema_migrations/20210222185538
deleted file mode 100644
index 20229c9be20..00000000000
--- a/db/schema_migrations/20210222185538
+++ /dev/null
@@ -1 +0,0 @@
-0bccf1ff356a4b9c08d472e8b63070b497f331c2dfaded1bdb2cf01860df8903 \ No newline at end of file
diff --git a/db/schema_migrations/20210222192144 b/db/schema_migrations/20210222192144
deleted file mode 100644
index b53b1668a1f..00000000000
--- a/db/schema_migrations/20210222192144
+++ /dev/null
@@ -1 +0,0 @@
-b2508d46edbfbba24df65731f6e285886acbb6352a900dd1c6a985a686252ef0 \ No newline at end of file
diff --git a/db/schema_migrations/20210223053451 b/db/schema_migrations/20210223053451
deleted file mode 100644
index ad40bb0fa71..00000000000
--- a/db/schema_migrations/20210223053451
+++ /dev/null
@@ -1 +0,0 @@
-1266bf92f23a42d96778bf546534882f03d2388f22640e4cfaa2a9a1aad19093 \ No newline at end of file
diff --git a/db/schema_migrations/20210223132934 b/db/schema_migrations/20210223132934
deleted file mode 100644
index 6e2b0696bad..00000000000
--- a/db/schema_migrations/20210223132934
+++ /dev/null
@@ -1 +0,0 @@
-99ee6773319af0fa7a1dfef92f67cc95141c892bf7adcf500d46adc1ebd4c70f \ No newline at end of file
diff --git a/db/schema_migrations/20210223133116 b/db/schema_migrations/20210223133116
deleted file mode 100644
index 235053e8fe8..00000000000
--- a/db/schema_migrations/20210223133116
+++ /dev/null
@@ -1 +0,0 @@
-991041c8d3092175165834a988eb32141e49d7785cda756c8a78170b4af6db64 \ No newline at end of file
diff --git a/db/schema_migrations/20210223230600 b/db/schema_migrations/20210223230600
deleted file mode 100644
index be6e0621771..00000000000
--- a/db/schema_migrations/20210223230600
+++ /dev/null
@@ -1 +0,0 @@
-18d64af208338baec9d56a6ac9d7fc35aaeb79d3f8036d3cf5bcc72879827299 \ No newline at end of file
diff --git a/db/schema_migrations/20210224132547 b/db/schema_migrations/20210224132547
deleted file mode 100644
index f38b394f082..00000000000
--- a/db/schema_migrations/20210224132547
+++ /dev/null
@@ -1 +0,0 @@
-ac0f71b427be1fb583474e352ce9468a1270c6e67fa40f9071751a0485f21160 \ No newline at end of file
diff --git a/db/schema_migrations/20210224133337 b/db/schema_migrations/20210224133337
deleted file mode 100644
index d5dafb9fb56..00000000000
--- a/db/schema_migrations/20210224133337
+++ /dev/null
@@ -1 +0,0 @@
-964e9f88018b2ab72fd370f6a8dccde218cfd4ffa3ccedf4f142ab341f5e858f \ No newline at end of file
diff --git a/db/schema_migrations/20210224150506 b/db/schema_migrations/20210224150506
deleted file mode 100644
index 672b2f53a46..00000000000
--- a/db/schema_migrations/20210224150506
+++ /dev/null
@@ -1 +0,0 @@
-cc9f56a872cf5e9084e863adc599545754594fb03f30f18433923e0429986e39 \ No newline at end of file
diff --git a/db/schema_migrations/20210224161552 b/db/schema_migrations/20210224161552
deleted file mode 100644
index 1fd37a69dd3..00000000000
--- a/db/schema_migrations/20210224161552
+++ /dev/null
@@ -1 +0,0 @@
-328e095123eb0b8822342b0d4a338d42265ca8eafbcadcc7e15628e9d02c863d \ No newline at end of file
diff --git a/db/schema_migrations/20210225090801 b/db/schema_migrations/20210225090801
deleted file mode 100644
index 364623d6634..00000000000
--- a/db/schema_migrations/20210225090801
+++ /dev/null
@@ -1 +0,0 @@
-65f27401a76856d6cb284078204bb1b80797fa344e1a4ef3d9638c296f2d72d7 \ No newline at end of file
diff --git a/db/schema_migrations/20210225135533 b/db/schema_migrations/20210225135533
deleted file mode 100644
index e7c24096aac..00000000000
--- a/db/schema_migrations/20210225135533
+++ /dev/null
@@ -1 +0,0 @@
-526174bd42327e0212b15ffbad99541887de1dec35cc4c592d4f02065026b3ca \ No newline at end of file
diff --git a/db/schema_migrations/20210225153522 b/db/schema_migrations/20210225153522
deleted file mode 100644
index 6c985a2ed14..00000000000
--- a/db/schema_migrations/20210225153522
+++ /dev/null
@@ -1 +0,0 @@
-ec071087de45291ae8fc0d6d6e778d16a7411a934e4a301f62890061abcaed4c \ No newline at end of file
diff --git a/db/schema_migrations/20210226120851 b/db/schema_migrations/20210226120851
deleted file mode 100644
index f03c7b332be..00000000000
--- a/db/schema_migrations/20210226120851
+++ /dev/null
@@ -1 +0,0 @@
-ced4e314f2653ff56a946d334b4cb12085825b8d21ceea42cb686bef688b714c \ No newline at end of file
diff --git a/db/schema_migrations/20210226141517 b/db/schema_migrations/20210226141517
deleted file mode 100644
index 00c57cbe827..00000000000
--- a/db/schema_migrations/20210226141517
+++ /dev/null
@@ -1 +0,0 @@
-400dd521f5c462afdcb3c556815f840e916df7576a6d6dd301fe5a49a1fe6011 \ No newline at end of file
diff --git a/db/schema_migrations/20210301150451 b/db/schema_migrations/20210301150451
deleted file mode 100644
index 1d644ccb62e..00000000000
--- a/db/schema_migrations/20210301150451
+++ /dev/null
@@ -1 +0,0 @@
-6c52ab55814241b37014949976c4f3a0c63bea0a4f9a301735cc9f4c509f433d \ No newline at end of file
diff --git a/db/schema_migrations/20210301193412 b/db/schema_migrations/20210301193412
deleted file mode 100644
index 7e5616b210f..00000000000
--- a/db/schema_migrations/20210301193412
+++ /dev/null
@@ -1 +0,0 @@
-2929e4796e85fa6cf8b5950fb57295ae87c48c914d0a71123a29d579d797d636 \ No newline at end of file
diff --git a/db/schema_migrations/20210301200601 b/db/schema_migrations/20210301200601
deleted file mode 100644
index 13907f9de8b..00000000000
--- a/db/schema_migrations/20210301200601
+++ /dev/null
@@ -1 +0,0 @@
-21ae7ea7cbf1d34c7b9dc300a641eaf975ed1e33f5bc519494cd37c4a661bec8 \ No newline at end of file
diff --git a/doc/api/runners.md b/doc/api/runners.md
index 5e84080ecb5..e53062ce074 100644
--- a/doc/api/runners.md
+++ b/doc/api/runners.md
@@ -573,17 +573,18 @@ Register a new runner for the instance.
POST /runners
```
-| Attribute | Type | Required | Description |
-|--------------|---------|----------|---------------------|
-| `token` | string | yes | [Registration token](#registration-and-authentication-tokens). |
-| `description`| string | no | Runner's description|
-| `info` | hash | no | Runner's metadata. You can include `name`, `version`, `revision`, `platform`, and `architecture`, but only `version` is displayed in the Admin area of the UI. |
-| `active` | boolean | no | Whether the runner is active |
-| `locked` | boolean | no | Whether the runner should be locked for current project |
-| `run_untagged` | boolean | no | Whether the runner should handle untagged jobs |
-| `tag_list` | string array | no | List of runner's tags |
-| `access_level` | string | no | The access_level of the runner; `not_protected` or `ref_protected` |
-| `maximum_timeout` | integer | no | Maximum timeout set when this runner handles the job |
+| Attribute | Type | Required | Description |
+|-------------------|----------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `token` | string | yes | [Registration token](#registration-and-authentication-tokens). |
+| `description` | string | no | Runner's description |
+| `info` | hash | no | Runner's metadata. You can include `name`, `version`, `revision`, `platform`, and `architecture`, but only `version` is displayed in the Admin area of the UI. |
+| `active` | boolean | no | Whether the runner is active |
+| `locked` | boolean | no | Whether the runner should be locked for current project |
+| `run_untagged` | boolean | no | Whether the runner should handle untagged jobs |
+| `tag_list` | string array | no | List of runner's tags |
+| `access_level` | string | no | The access_level of the runner; `not_protected` or `ref_protected` |
+| `maximum_timeout` | integer | no | Maximum timeout set when this runner handles the job |
+| `maintainer_note` | string | no | Free-form maintainer notes for the runner (255 characters) |
```shell
curl --request POST "https://gitlab.example.com/api/v4/runners" \
diff --git a/doc/tutorials/index.md b/doc/tutorials/index.md
new file mode 100644
index 00000000000..fd414d2259e
--- /dev/null
+++ b/doc/tutorials/index.md
@@ -0,0 +1,124 @@
+---
+stage: none
+group: unassigned
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
+---
+
+# Get started with GitLab tutorials
+
+These tutorials can help you learn how to use GitLab.
+
+## Find your way around GitLab
+
+Get to know the features of GitLab and where to find them so you can get up
+and running quickly.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [GitLab 101](https://gitlab.edcast.com/pathways/copy-of-gitlab-certification) | Learn the basics of GitLab in this certification course. | **{star}** |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Use GitLab for DevOps](https://www.youtube.com/watch?v=7q9Y1Cv-ib0) (12m 34s) | Use GitLab through the entire DevOps lifecycle, from planning to monitoring. | **{star}** |
+| [It's all connected in GitLab](https://about.gitlab.com/blog/2016/03/08/gitlab-tutorial-its-all-connected/) | Learn how to cross-link and reference your work. | **{star}** |
+| [Use Markdown at GitLab](../user/markdown.md) | GitLab Flavored Markdown (GFM) is used in many areas of GitLab, for example, in merge requests. | **{star}** |
+| [GitLab 201](https://gitlab.edcast.com/pathways/ECL-44010cf6-7a9c-4b9b-b684-fa08508a3252) | Go beyond the basics to learn more about using GitLab for your work. | |
+| Learn GitLab project | You might already have the **Learn GitLab** project, which has tutorial-style issues to help you learn GitLab. If not, download [this export file](https://gitlab.com/gitlab-org/gitlab/-/blob/master/vendor/project_templates/learn_gitlab_ultimate.tar.gz) and [import it to a new project](../user/project/settings/import_export.md#import-a-project-and-its-data). | |
+| [Productivity tips](https://about.gitlab.com/blog/2021/02/18/improve-your-gitlab-productivity-with-these-10-tips/) | Get tips to help make you a productive GitLab user. | |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Structure a multi-team organization](https://www.youtube.com/watch?v=KmASFwSap7c) (37m 37s) | Learn to use issues, milestones, epics, labels, and more to plan and manage your work. | |
+
+## Use Git
+
+GitLab is a Git-based platform, so understanding Git is important to get
+the most out of GitLab.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Start using Git on the command line](../gitlab-basics/start-using-git.md) | Learn how to set up Git, clone repositories, and work with branches. | **{star}** |
+| [Git cheat sheet](https://about.gitlab.com/images/press/git-cheat-sheet.pdf) | Download a PDF of common Git commands. | |
+
+## Plan your work in projects
+
+Your work takes place in a project, from creating code, to planning,
+collaborating, and more.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Create a project from a template](https://gitlab.com/projects/new#create_from_template) | For hands-on learning, select **Sample GitLab Project** and create a project with example issues and merge requests. | **{star}** |
+| [Migrate to GitLab](../user/project/import/index.md) | If you are coming to GitLab from another platform, you can import or convert your projects. | |
+
+## Use CI/CD pipelines
+
+CI/CD pipelines are used to automatically build, test, and deploy your code.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Get started: Create a pipeline](../ci/quick_start/index.md) | Create a `.gitlab-ci.yml` file and start a pipeline. | **{star}** |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Get started: Learn about CI/CD](https://www.youtube.com/watch?v=sIegJaLy2ug) (9m 02s) | Learn about the `.gitlab-ci.yml` file and how it's used. | **{star}** |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [CI deep dive](https://www.youtube.com/watch?v=ZVUbmVac-m8&list=PL05JrBw4t0KorkxIFgZGnzzxjZRCGROt_&index=27) (22m 51s) | Take a closer look at pipelines and continuous integration concepts. | |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [CD deep dive](https://www.youtube.com/watch?v=Cn0rzND-Yjw&list=PL05JrBw4t0KorkxIFgZGnzzxjZRCGROt_&index=10) (47m 54s) | Learn about deploying in GitLab. | |
+| [Set up CI/CD in the cloud](../ci/examples/index.md#cicd-in-the-cloud) | Learn how to set up CI/CD in different cloud-based environments. | |
+| [Find CI/CD examples and templates](../ci/examples/index.md#cicd-examples) | Use these examples and templates to set up CI/CD for your use case. | |
+| <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [Understand CI/CD rules](https://www.youtube.com/watch?v=QjQc-zeL16Q) (8m 56s) | Learn more about how to use CI/CD rules. | |
+
+## Configure your applications and infrastructure
+
+Use GitLab configuration features to reduce the effort needed to
+configure the infrastructure for your application.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Connect with a Kubernetes cluster](https://about.gitlab.com/blog/2021/11/18/gitops-with-gitlab-connecting-the-cluster/) | Connect a Kubernetes cluster with GitLab for pull and push based deployments and security integrations. | |
+| [Use Auto DevOps to deploy an application](../topics/autodevops/quick_start_guide.md) | Deploy an application to Google Kubernetes Engine (GKE). | |
+
+## Publish a static website
+
+Use GitLab Pages to publish a static website directly from your project.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Create a Pages website from a CI/CD template](../user/project/pages/getting_started/pages_ci_cd_template.md) | Quickly generate a Pages website for your project using a CI/CD template for a popular Static Site Generator (SSG). | **{star}** |
+| [Create a Pages website from scratch](../user/project/pages/getting_started/pages_from_scratch.md) | Create all the components of a Pages website from a blank project. | |
+
+## Secure your application
+
+GitLab can check your application for security vulnerabilities.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Set up dependency scanning](https://about.gitlab.com/blog/2021/01/14/try-dependency-scanning/) | Try out dependency scanning, which checks for known vulnerabilities in dependencies. | **{star}** |
+
+## Work with a self-managed instance
+
+If you're an administrator of a self-managed instance of GitLab, these tutorials
+can help you manage and configure your instance.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Install GitLab](../install/index.md) | Install GitLab according to your requirements.| |
+| [Get started administering GitLab](../administration/get_started.md) | Configure your organization and its authentication, then secure, monitor, and back up GitLab. | |
+| [Secure your instance](https://about.gitlab.com/blog/2020/05/20/gitlab-instance-security-best-practices/) | Implement security features for your instance. | |
+
+## Integrate with GitLab
+
+GitLab [integrates](../integration/index.md) with a number of third-party services,
+enabling you to work with those services directly from GitLab.
+
+| Topic | Description | Good for beginners |
+|-------|-------------|--------------------|
+| [Integrate with Jira](https://about.gitlab.com/blog/2021/04/12/gitlab-jira-integration-selfmanaged/) | Configure the Jira integration, so you can work with Jira issues from GitLab. | |
+| [Integrate with Gitpod](https://about.gitlab.com/blog/2021/07/19/teams-gitpod-integration-gitlab-speed-up-development/) | Integrate with Gitpod, to help speed up your development. | |
+
+## Find more tutorial content
+
+If you're learning about GitLab, here are some ways you can find more tutorial
+content:
+
+- Find learning tracks and certification options at [GitLab Learn](https://about.gitlab.com/learn/).
+ GitLab learning platform login required (email and password for non-GitLab team members).
+ For more information, see [First time login details](https://about.gitlab.com/handbook/people-group/learning-and-development/gitlab-learn/user/#first-time-login-to-gitlab-learn).
+
+- Find recent tutorials on the GitLab blog by [searching by the `tutorial` tag](https://about.gitlab.com/blog/tags.html#tutorial).
+
+- Browse the **Learn@GitLab** [playlist on YouTube](https://www.youtube.com/playlist?list=PLFGfElNsQthYDx0A_FaNNfUm9NHsK6zED)
+ to find video tutorials.
+
+If you find an article, video, or other resource that would be a
+great addition to this page, add it in a [merge request](../development/documentation/index.md).
diff --git a/doc/user/analytics/issue_analytics.md b/doc/user/analytics/issue_analytics.md
index af7307eab39..6aa2f594532 100644
--- a/doc/user/analytics/issue_analytics.md
+++ b/doc/user/analytics/issue_analytics.md
@@ -5,11 +5,11 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Issue Analytics **(PREMIUM)**
+# Issue analytics for projects **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196561) in GitLab 12.9.
-Issue Analytics is a bar graph which illustrates the number of issues created each month.
+Issue analytics is a bar graph which illustrates the number of issues created each month.
The default time span is 13 months, which includes the current month, and the 12 months
prior.
diff --git a/doc/user/analytics/repository_analytics.md b/doc/user/analytics/repository_analytics.md
index 040796dfdd4..42b3e96c340 100644
--- a/doc/user/analytics/repository_analytics.md
+++ b/doc/user/analytics/repository_analytics.md
@@ -4,9 +4,9 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Repository Analytics **(FREE)**
+# Repository analytics **(FREE)**
-Use Repository Analytics to view information about a project's Git repository:
+Use repository analytics to view information about a project's Git repository:
- Programming languages used in the repository.
- Code coverage history from last 3 months ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/33743) in GitLab 13.1).
@@ -15,24 +15,24 @@ Use Repository Analytics to view information about a project's Git repository:
- Commits per weekday.
- Commits per day hour (UTC).
-Repository Analytics is part of [GitLab Community Edition](https://gitlab.com/gitlab-org/gitlab-foss). It's available to anyone who has permission to clone the repository.
+Repository analytics is part of [GitLab Community Edition](https://gitlab.com/gitlab-org/gitlab-foss). It's available to anyone who has permission to clone the repository.
-Repository Analytics requires:
+Repository analytics requires:
- An initialized Git repository.
- At least one commit in the default branch (`master` by default).
NOTE:
-Without a Git commit in the default branch, the menu item won't be visible.
+Without a Git commit in the default branch, the menu item isn't visible.
Commits in a project's [wiki](../project/wiki/index.md#track-wiki-events) are not included in the analysis.
-## View Repository Analytics
+## View repository analytics
-To review Repository Analytics for a project:
+To review repository analytics for a project:
1. On the top bar, select **Menu > Projects** and find your project.
1. On the left sidebar, select **Analytics > Repository**.
-## How Repository Analytics chart data is updated
+## How repository analytics chart data is updated
Data in the charts are queued. Background workers update the charts 10 minutes after each commit in the default branch. Depending on the size of the GitLab installation, it may take longer for data to refresh due to variations in the size of background job queues.
diff --git a/doc/user/analytics/value_stream_analytics.md b/doc/user/analytics/value_stream_analytics.md
index cb6b2e49f60..6bad374c371 100644
--- a/doc/user/analytics/value_stream_analytics.md
+++ b/doc/user/analytics/value_stream_analytics.md
@@ -4,31 +4,34 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Value Stream Analytics **(FREE)**
+# Value stream analytics for projects **(FREE)**
-> - Introduced as Cycle Analytics prior to GitLab 12.3 at the project level.
+> - Introduced as cycle analytics prior to GitLab 12.3 at the project level.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/12077) in GitLab Premium 12.3 at the group level.
-> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23427) from Cycle Analytics to Value Stream Analytics in GitLab 12.8.
+> - [Renamed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23427) from cycle analytics to value stream analytics in GitLab 12.8.
-Value Stream Analytics measures the time spent to go from an
+Value stream analytics measures the time spent to go from an
[idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab)
-(also known as cycle time) for each of your projects or groups. Value Stream Analytics displays the median time
+(also known as cycle time) for each of your projects or groups. Value stream analytics displays the median time
spent in each stage defined in the process.
-You can use Value Stream Analytics to determine the velocity of a given
+You can use value stream analytics to determine the velocity of a given
project. It points to bottlenecks in the development process, enabling management
to uncover, triage, and identify the root cause of slowdowns in the software development life cycle.
-For information about how to contribute to the development of Value Stream Analytics, see our [contributor documentation](../../development/value_stream_analytics.md).
+For information about how to contribute to the development of value stream analytics, see our [contributor documentation](../../development/value_stream_analytics.md).
-Project-level Value Stream Analytics is available by using **Project > Analytics > Value Stream**.
+To access value stream analytics for a project:
+
+1. On the top bar, select **Menu > Projects** and find your project.
+1. On the left sidebar, select **Analytics > Value stream**.
NOTE:
-[Group-level Value Stream Analytics](../group/value_stream_analytics) is also available.
+[Value stream analytics for groups](../group/value_stream_analytics) is also available.
## Default stages
-The stages tracked by Value Stream Analytics by default represent the [GitLab flow](../../topics/gitlab_flow.md). You can customize these stages in group-level Value Stream Analytics.
+The stages tracked by value stream analytics by default represent the [GitLab flow](../../topics/gitlab_flow.md). You can customize these stages in value stream analytics for groups.
- **Issue** (Tracker)
- Time to schedule an issue (by milestone or by adding it to an issue board)
@@ -43,7 +46,7 @@ The stages tracked by Value Stream Analytics by default represent the [GitLab fl
- **Staging** (Continuous Deployment)
- Time between merging and deploying to production
-## Filter Value Stream Analytics data
+## Filter value stream analytics data
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/326701) in GitLab 14.3
@@ -60,7 +63,7 @@ To filter results:
1. Select a parameter.
1. Select a value. To find a value in the list, enter the value name.
-![Value stream analytics filter bar](img/project_vsa_filter_v14_3.png "Active filter bar for a project's Value Stream Analytics")
+![Value stream analytics filter bar](img/project_vsa_filter_v14_3.png "Active filter bar for a project's value stream analytics")
### Date ranges
@@ -72,7 +75,7 @@ from the date picker (default: last 30 days).
> Sorting the stage table [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/335974) in GitLab 14.4.
-![Value Stream Analytics Stage table](img/project_vsa_stage_table_v14_4.png "Project VSA stage table")
+![Value stream analytics stage table](img/project_vsa_stage_table_v14_4.png "Project VSA stage table")
The stage table shows a list of related workflow items for the selected stage. This can include:
@@ -108,18 +111,18 @@ The **Time** metrics near the top of the page are measured as follows:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/337256) in GitLab 11.3.
-Value Stream Analytics exposes two deployment related metrics near the top of the page:
+Value stream analytics exposes two deployment related metrics near the top of the page:
- **Deploys:** The number of successful deployments in the date range.
- **Deployment Frequency:** The average number of successful deployments.
The deployment metrics calculation uses the same method as the
-[group-level Value Stream Analytics](../group/value_stream_analytics/index.md#how-metrics-are-measured).
+[value stream analytics for groups](../group/value_stream_analytics/index.md#how-metrics-are-measured).
Both of them are based on the [DORA API](../../api/dora/metrics.md#devops-research-and-assessment-dora-key-metrics-api).
## How the stages are measured
-Value Stream Analytics uses start events and end events to measure the time that an issue or merge request spends in each stage.
+Value stream analytics uses start events and end events to measure the time that an issue or merge request spends in each stage.
For example, a stage might start when one label is added to an issue and end when another label is added.
Items aren't included in the stage time calculation if they have not reached the end event.
@@ -143,7 +146,7 @@ How this works:
1. For the remaining pairs, review information needed for stages, including
issue creation date and merge request merge time.
-In short, the Value Stream Analytics dashboard tracks data related to [GitLab flow](../../topics/gitlab_flow.md). It does not include data for:
+In short, the value stream analytics dashboard tracks data related to [GitLab flow](../../topics/gitlab_flow.md). It does not include data for:
- Merge requests that do not close an issue.
- Issues that do not include labels present in the issue board.
@@ -152,7 +155,7 @@ In short, the Value Stream Analytics dashboard tracks data related to [GitLab fl
## How the production environment is identified
-Value Stream Analytics identifies production environments based on the
+Value stream analytics identifies production environments based on the
[deployment tier of environments](../../ci/environments/index.md#deployment-tier-of-environments).
## Example workflow
@@ -197,12 +200,12 @@ More information:
the cycle. The time is included in the **Review** process, as every merge request should be
tested.
- The previous example illustrates only one cycle of the multiple stages. Value
- Stream Analytics, on its dashboard, shows the calculated median elapsed time
+ stream analytics, on its dashboard, shows the calculated median elapsed time
for these issues.
## Permissions
-The permissions for the project-level Value Stream Analytics dashboard include:
+The permissions for the value stream analytics for projects dashboard include:
| Project type | Permissions |
|--------------|---------------------------------------|
@@ -214,8 +217,8 @@ You can [read more about permissions](../../user/permissions.md) in general.
## More resources
-Learn more about Value Stream Analytics with the following resources:
+Learn more about value stream analytics with the following resources:
-- [Value Stream Analytics feature page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
-- [Value Stream Analytics feature preview](https://about.gitlab.com/blog/2016/09/16/feature-preview-introducing-cycle-analytics/).
-- [Value Stream Analytics feature highlight](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/).
+- [Value stream analytics feature page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
+- [Value stream analytics feature preview](https://about.gitlab.com/blog/2016/09/16/feature-preview-introducing-cycle-analytics/).
+- [Value stream analytics feature highlight](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/).
diff --git a/doc/user/group/issues_analytics/index.md b/doc/user/group/issues_analytics/index.md
index ac5df6b052f..62337dabcc0 100644
--- a/doc/user/group/issues_analytics/index.md
+++ b/doc/user/group/issues_analytics/index.md
@@ -5,15 +5,18 @@ group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Issue Analytics **(PREMIUM)**
+# Issue analytics for groups **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7478) in GitLab 11.5.
-Issue Analytics is a bar graph which illustrates the number of issues created each month.
+Issue analytics is a bar graph which illustrates the number of issues created each month.
The default time span is 13 months, which includes the current month, and the 12 months
prior.
-To access the chart, navigate to your group sidebar and select **{chart}** **Analytics > Issue Analytics**.
+To access the chart:
+
+1. On the top bar, select **Menu > Groups** and find your group.
+1. On the left sidebar, select **Analytics > Issue Analytics**.
Hover over each bar to see the total number of issues.
diff --git a/doc/user/group/repositories_analytics/index.md b/doc/user/group/repositories_analytics/index.md
index c6cd763355b..763b8eb1ae3 100644
--- a/doc/user/group/repositories_analytics/index.md
+++ b/doc/user/group/repositories_analytics/index.md
@@ -5,7 +5,7 @@ group: Testing
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Repositories Analytics **(PREMIUM)**
+# Repositories analytics for groups **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/215104) in GitLab 13.4.
diff --git a/doc/user/group/value_stream_analytics/index.md b/doc/user/group/value_stream_analytics/index.md
index b91e258b04a..8e212afcb13 100644
--- a/doc/user/group/value_stream_analytics/index.md
+++ b/doc/user/group/value_stream_analytics/index.md
@@ -5,34 +5,35 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
---
-# Value Stream Analytics **(PREMIUM)**
+# Value stream analytics for groups **(PREMIUM)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196455) in GitLab 12.9 for groups.
-Value Stream Analytics measures the time spent to go from an
+Value stream analytics measures the time spent to go from an
[idea to production](https://about.gitlab.com/blog/2016/08/05/continuous-integration-delivery-and-deployment-with-gitlab/#from-idea-to-production-with-gitlab)
-(also known as cycle time) for each of your projects or groups. Value Stream Analytics displays the median time
+(also known as cycle time) for each of your projects or groups. Value stream analytics displays the median time
spent in each stage defined in the process.
-Value Stream Analytics can help you quickly determine the velocity of a given
+Value stream analytics can help you quickly determine the velocity of a given
group. It points to bottlenecks in the development process, enabling management
to uncover, triage, and identify the root cause of slowdowns in the software development life cycle.
-For information on how to contribute to the development of Value Stream Analytics, see our [contributor documentation](../../../development/value_stream_analytics.md).
+For information on how to contribute to the development of value stream analytics, see our [contributor documentation](../../../development/value_stream_analytics.md).
-To view group-level Value Stream Analytics:
+To view value stream analytics for groups:
1. On the top bar, select **Menu > Groups** and find your group.
1. On the left sidebar, select **Analytics > Value stream**.
-Value Stream Analytics at the group level includes data for the selected group and its subgroups.
+Value stream analytics at the group level includes data for the selected group and its subgroups.
NOTE:
-[Project-level Value Stream Analytics](../../analytics/value_stream_analytics.md) is also available.
+[Value stream analytics for projects](../../analytics/value_stream_analytics.md) is also available.
## Default stages
-The stages tracked by Value Stream Analytics by default represent the [GitLab flow](../../../topics/gitlab_flow.md). These stages can be customized in Group Level Value Stream Analytics.
+The stages tracked by value stream analytics by default represent the [GitLab flow](../../../topics/gitlab_flow.md).
+These stages can be customized in value stream analytics for groups.
- **Issue** (Tracker)
- Time to schedule an issue (by milestone or by adding it to an issue board)
@@ -100,8 +101,7 @@ sole discretion of GitLab Inc.
## How metrics are measured
-> DORA API-based deployment metrics for group-level Value Stream Analytics were
-> [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/337256) from GitLab Ultimate to GitLab Premium in 14.3.
+> DORA API-based deployment metrics for value stream analytics for groups were [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/337256) from GitLab Ultimate to GitLab Premium in 14.3.
The "Time" metrics near the top of the page are measured as follows:
@@ -134,11 +134,11 @@ You can learn more about these metrics in our [analytics definitions](../../anal
## How the stages are measured
-Value Stream Analytics measures each stage from its start event to its end event.
+Value stream analytics measures each stage from its start event to its end event.
For example, a stage might start when one label is added to an issue, and end when another label is added.
-Value Stream Analytics excludes work in progress, meaning it ignores any items that have not reached the end event.
+Value stream analytics excludes work in progress, meaning it ignores any items that have not reached the end event.
-Each stage of Value Stream Analytics is further described in the table below.
+Each stage of value stream analytics is further described in the table below.
| **Stage** | **Description** |
| --------- | --------------- |
@@ -162,7 +162,7 @@ How this works, behind the scenes:
and so on.
To sum up, anything that doesn't follow [GitLab flow](../../../topics/gitlab_flow.md) is not tracked and the
-Value Stream Analytics dashboard does not present any data for:
+value stream analytics dashboard does not present any data for:
- Merge requests that do not close an issue.
- Issues not labeled with a label present in the issue board or for issues not assigned a milestone.
@@ -170,7 +170,7 @@ Value Stream Analytics dashboard does not present any data for:
## How the production environment is identified
-Value Stream Analytics identifies production environments by looking for project
+Value stream analytics identifies production environments by looking for project
[environments](../../../ci/yaml/index.md#environment) with a name matching any of these patterns:
- `prod` or `prod/*`
@@ -228,7 +228,7 @@ A few notes:
tested).
- The example above was just **one cycle** of the seven stages. Add multiple
cycles, calculate their median time and the result is what the dashboard of
- Value Stream Analytics is showing.
+ value stream analytics is showing.
## Custom value streams
@@ -236,7 +236,7 @@ A few notes:
The default stages are designed to work straight out of the box, but they might not be suitable for
all teams. Different teams use different approaches to building software, so some teams might want
-to customize their Value Stream Analytics.
+to customize their value stream analytics.
GitLab allows users to create multiple value streams, hide default stages and create custom stages
that align better to their development workflow.
@@ -272,7 +272,7 @@ Hovering over a stage item displays a popover with the following information:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/321438) in GitLab 13.11.
-![Value Stream Analytics Overview](img/vsa_overview_stage_v13_11.png "VSA overview")
+![Value stream analytics overview](img/vsa_overview_stage_v13_11.png "VSA overview")
The stream overview provides access to key metrics and charts summarizing all the stages in the value stream
based on selected filters.
@@ -288,7 +288,7 @@ Shown metrics and charts includes:
> Sorting the stage table [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/301082) in GitLab 13.12.
-![Value Stream Analytics Stage table](img/vsa_stage_table_v13_12.png "VSA stage table")
+![Value stream analytics stage table](img/vsa_stage_table_v13_12.png "VSA stage table")
The stage table shows a list of related workflow items for the selected stage. This can include:
@@ -378,7 +378,7 @@ In this example, we'd like to measure times for deployment from a staging enviro
- When the code is deployed to staging, the `workflow::staging` label is added to the merge request.
- When the code is deployed to production, the `workflow::production` label is added to the merge request.
-![Label Based Value Stream Analytics Stage](img/vsa_label_based_stage_v14_0.png "Creating a label based Value Stream Analytics Stage")
+![Label-based value stream analytics stage](img/vsa_label_based_stage_v14_0.png "Creating a label-based value stream analytics stage")
### Editing a value stream
@@ -443,14 +443,14 @@ select up to a total of 15 labels.
## Permissions
-To access Group-level Value Stream Analytics, users must have at least the Reporter role.
+To access value stream analytics for groups, users must have at least the Reporter role.
You can [read more about permissions](../../permissions.md) in general.
## More resources
-Learn more about Value Stream Analytics in the following resources:
+Learn more about value stream analytics in the following resources:
-- [Value Stream Analytics feature page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
-- [Value Stream Analytics feature preview](https://about.gitlab.com/blog/2016/09/16/feature-preview-introducing-cycle-analytics/).
-- [Value Stream Analytics feature highlight](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/).
+- [Value stream analytics feature page](https://about.gitlab.com/stages-devops-lifecycle/value-stream-analytics/).
+- [Value stream analytics feature preview](https://about.gitlab.com/blog/2016/09/16/feature-preview-introducing-cycle-analytics/).
+- [Value stream analytics feature highlight](https://about.gitlab.com/blog/2016/09/21/cycle-analytics-feature-highlight/).
diff --git a/lib/api/ci/runner.rb b/lib/api/ci/runner.rb
index 5b996433584..fef6a7891c2 100644
--- a/lib/api/ci/runner.rb
+++ b/lib/api/ci/runner.rb
@@ -15,6 +15,7 @@ module API
params do
requires :token, type: String, desc: 'Registration token'
optional :description, type: String, desc: %q(Runner's description)
+ optional :maintainer_note, type: String, desc: %q(Runner's maintainer notes)
optional :info, type: Hash, desc: %q(Runner's metadata)
optional :active, type: Boolean, desc: 'Should Runner be active'
optional :locked, type: Boolean, desc: 'Should Runner be locked for current project'
@@ -25,7 +26,7 @@ module API
optional :maximum_timeout, type: Integer, desc: 'Maximum timeout set when this Runner will handle the job'
end
post '/', feature_category: :runner do
- attributes = attributes_for_keys([:description, :active, :locked, :run_untagged, :tag_list, :access_level, :maximum_timeout])
+ attributes = attributes_for_keys(%i[description maintainer_note active locked run_untagged tag_list access_level maximum_timeout])
.merge(get_runner_details_from_request)
@runner = ::Ci::RegisterRunnerService.new.execute(params[:token], attributes)
diff --git a/lib/gitlab/background_migration/migrate_legacy_artifacts.rb b/lib/gitlab/background_migration/migrate_legacy_artifacts.rb
deleted file mode 100644
index 23d99274232..00000000000
--- a/lib/gitlab/background_migration/migrate_legacy_artifacts.rb
+++ /dev/null
@@ -1,130 +0,0 @@
-# frozen_string_literal: true
-# rubocop:disable Metrics/ClassLength
-
-module Gitlab
- module BackgroundMigration
- ##
- # The class to migrate job artifacts from `ci_builds` to `ci_job_artifacts`
- class MigrateLegacyArtifacts
- FILE_LOCAL_STORE = 1 # equal to ObjectStorage::Store::LOCAL
- ARCHIVE_FILE_TYPE = 1 # equal to Ci::JobArtifact.file_types['archive']
- METADATA_FILE_TYPE = 2 # equal to Ci::JobArtifact.file_types['metadata']
- LEGACY_PATH_FILE_LOCATION = 1 # equal to Ci::JobArtifact.file_location['legacy_path']
-
- def perform(start_id, stop_id)
- ActiveRecord::Base.transaction do
- insert_archives(start_id, stop_id)
- insert_metadatas(start_id, stop_id)
- delete_legacy_artifacts(start_id, stop_id)
- end
- end
-
- private
-
- def insert_archives(start_id, stop_id)
- ActiveRecord::Base.connection.execute <<~SQL
- INSERT INTO
- ci_job_artifacts (
- project_id,
- job_id,
- expire_at,
- file_location,
- created_at,
- updated_at,
- file,
- size,
- file_store,
- file_type
- )
- SELECT
- project_id,
- id,
- artifacts_expire_at #{add_missing_db_timezone},
- #{LEGACY_PATH_FILE_LOCATION},
- created_at #{add_missing_db_timezone},
- created_at #{add_missing_db_timezone},
- artifacts_file,
- artifacts_size,
- COALESCE(artifacts_file_store, #{FILE_LOCAL_STORE}),
- #{ARCHIVE_FILE_TYPE}
- FROM
- ci_builds
- WHERE
- id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
- AND artifacts_file <> ''
- AND NOT EXISTS (
- SELECT
- 1
- FROM
- ci_job_artifacts
- WHERE
- ci_builds.id = ci_job_artifacts.job_id
- AND ci_job_artifacts.file_type = #{ARCHIVE_FILE_TYPE})
- SQL
- end
-
- def insert_metadatas(start_id, stop_id)
- ActiveRecord::Base.connection.execute <<~SQL
- INSERT INTO
- ci_job_artifacts (
- project_id,
- job_id,
- expire_at,
- file_location,
- created_at,
- updated_at,
- file,
- size,
- file_store,
- file_type
- )
- SELECT
- project_id,
- id,
- artifacts_expire_at #{add_missing_db_timezone},
- #{LEGACY_PATH_FILE_LOCATION},
- created_at #{add_missing_db_timezone},
- created_at #{add_missing_db_timezone},
- artifacts_metadata,
- NULL,
- COALESCE(artifacts_metadata_store, #{FILE_LOCAL_STORE}),
- #{METADATA_FILE_TYPE}
- FROM
- ci_builds
- WHERE
- id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
- AND artifacts_file <> ''
- AND artifacts_metadata <> ''
- AND NOT EXISTS (
- SELECT
- 1
- FROM
- ci_job_artifacts
- WHERE
- ci_builds.id = ci_job_artifacts.job_id
- AND ci_job_artifacts.file_type = #{METADATA_FILE_TYPE})
- SQL
- end
-
- def delete_legacy_artifacts(start_id, stop_id)
- ActiveRecord::Base.connection.execute <<~SQL
- UPDATE
- ci_builds
- SET
- artifacts_file = NULL,
- artifacts_file_store = NULL,
- artifacts_size = NULL,
- artifacts_metadata = NULL,
- artifacts_metadata_store = NULL
- WHERE
- id BETWEEN #{start_id.to_i} AND #{stop_id.to_i}
- AND artifacts_file <> ''
- SQL
- end
-
- def add_missing_db_timezone
- 'at time zone \'UTC\''
- end
- end
- end
-end
diff --git a/lib/gitlab/background_migration/remove_duplicate_services.rb b/lib/gitlab/background_migration/remove_duplicate_services.rb
deleted file mode 100644
index 59fb9143a72..00000000000
--- a/lib/gitlab/background_migration/remove_duplicate_services.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- module BackgroundMigration
- # Remove duplicated service records with the same project and type.
- # These were created in the past for unknown reasons, and should be blocked
- # now by the uniqueness validation in the Service model.
- class RemoveDuplicateServices
- # See app/models/service
- class Service < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'services'
- self.inheritance_column = :_type_disabled
-
- scope :project_ids_with_duplicates, -> do
- select(:project_id)
- .distinct
- .where.not(project_id: nil)
- .group(:project_id, :type)
- .having('count(*) > 1')
- end
-
- scope :types_with_duplicates, -> (project_ids) do
- select(:project_id, :type)
- .where(project_id: project_ids)
- .group(:project_id, :type)
- .having('count(*) > 1')
- end
- end
-
- def perform(*project_ids)
- types_with_duplicates = Service.types_with_duplicates(project_ids).pluck(:project_id, :type)
-
- types_with_duplicates.each do |project_id, type|
- remove_duplicates(project_id, type)
- end
- end
-
- private
-
- def remove_duplicates(project_id, type)
- scope = Service.where(project_id: project_id, type: type)
-
- # Build a subquery to determine which service record is actually in use,
- # by querying for it without specifying an order.
- #
- # This should match the record returned by `Project#find_service`,
- # and the `has_one` service associations on `Project`.
- correct_service = scope.select(:id).limit(1)
-
- # Delete all other services with the same `project_id` and `type`
- duplicate_services = scope.where.not(id: correct_service)
- duplicate_services.delete_all
- end
- end
- end
-end
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index c12c26c6075..f1f85c3e19b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -5943,18 +5943,12 @@ msgstr ""
msgid "Branches|Delete protected branch"
msgstr ""
-msgid "Branches|Delete protected branch '%{branch_name}'?"
-msgstr ""
-
msgid "Branches|Delete protected branch. Are you ABSOLUTELY SURE?"
msgstr ""
msgid "Branches|Deleting the %{strongStart}%{branchName}%{strongEnd} branch cannot be undone. Are you sure?"
msgstr ""
-msgid "Branches|Deleting the '%{branch_name}' branch cannot be undone. Are you sure?"
-msgstr ""
-
msgid "Branches|Deleting the merged branches cannot be undone. Are you sure?"
msgstr ""
@@ -5970,9 +5964,6 @@ msgstr ""
msgid "Branches|No branches to show"
msgstr ""
-msgid "Branches|Once you confirm and press %{delete_protected_branch}, it cannot be undone or recovered."
-msgstr ""
-
msgid "Branches|Once you confirm and press %{strongStart}%{buttonText},%{strongEnd} it cannot be undone or recovered."
msgstr ""
@@ -6021,15 +6012,6 @@ msgstr ""
msgid "Branches|This branch hasn’t been merged into %{defaultBranchName}. To avoid data loss, consider merging this branch before deleting it."
msgstr ""
-msgid "Branches|This branch hasn’t been merged into %{default_branch}."
-msgstr ""
-
-msgid "Branches|To avoid data loss, consider merging this branch before deleting it."
-msgstr ""
-
-msgid "Branches|To confirm, type %{branch_name_confirmation}:"
-msgstr ""
-
msgid "Branches|To discard the local changes and overwrite the branch with the upstream version, delete it here and choose 'Update Now' above."
msgstr ""
@@ -6048,9 +6030,6 @@ msgstr ""
msgid "Branches|You're about to permanently delete the protected branch %{strongStart}%{branchName}.%{strongEnd}"
msgstr ""
-msgid "Branches|You’re about to permanently delete the protected branch %{branch_name}."
-msgstr ""
-
msgid "Branches|diverged from upstream"
msgstr ""
@@ -23352,10 +23331,10 @@ msgstr ""
msgid "NamespaceStorageSize|push to your repository, create pipelines, create issues or add comments. To reduce storage capacity, delete unused repositories, artifacts, wikis, issues, and pipelines."
msgstr ""
-msgid "NamespaceUserCap|Pending users must be reviewed and approved by a group owner. Learn more about %{user_caps_link_start}User Caps%{link_end} and %{users_pending_approval_link_start}Users Pending Approval%{link_end}."
+msgid "NamespaceUserCap|Pending users must be reviewed and approved by a group owner. Learn more about %{user_caps_link_start}user caps%{link_end} and %{users_pending_approval_link_start}users pending approval%{link_end}."
msgstr ""
-msgid "NamespaceUserCap|View pending user approvals"
+msgid "NamespaceUserCap|View pending approvals"
msgstr ""
msgid "NamespaceUserCap|Your group has reached its billable member limit"
@@ -35367,7 +35346,7 @@ msgstr ""
msgid "The connection will time out after %{timeout}. For repositories that take longer, use a clone/push combination."
msgstr ""
-msgid "The contact does not belong to the same group as the issue"
+msgid "The contact does not belong to the issue group or an ancestor"
msgstr ""
msgid "The content editor may change the markdown formatting style of the document, which may not match your original markdown style."
@@ -39554,6 +39533,9 @@ msgstr ""
msgid "Vulnerability|Actual received response is the one received when this fault was detected"
msgstr ""
+msgid "Vulnerability|Add another identifier"
+msgstr ""
+
msgid "Vulnerability|Additional Info"
msgstr ""
@@ -39596,6 +39578,9 @@ msgstr ""
msgid "Vulnerability|Download"
msgstr ""
+msgid "Vulnerability|Enter the associated CVE or CWE entries for this vulnerability."
+msgstr ""
+
msgid "Vulnerability|Evidence"
msgstr ""
@@ -39614,6 +39599,12 @@ msgstr ""
msgid "Vulnerability|Identifier"
msgstr ""
+msgid "Vulnerability|Identifier URL"
+msgstr ""
+
+msgid "Vulnerability|Identifier code"
+msgstr ""
+
msgid "Vulnerability|Identifiers"
msgstr ""
@@ -39638,6 +39629,9 @@ msgstr ""
msgid "Vulnerability|Project"
msgstr ""
+msgid "Vulnerability|Remove identifier row"
+msgstr ""
+
msgid "Vulnerability|Reproduction Assets"
msgstr ""
diff --git a/package.json b/package.json
index 84d7b88cd42..878e2991485 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,8 @@
"stylelint-create-utility-map": "node scripts/frontend/stylelint/stylelint-utility-map.js",
"webpack": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.config.js",
"webpack-vendor": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.vendor.config.js",
- "webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=3584\" NODE_ENV=production webpack --config config/webpack.config.js"
+ "webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=3584\" NODE_ENV=production webpack --config config/webpack.config.js",
+ "webpack-prod-node-latest": "NODE_OPTIONS=\"--max-old-space-size=3584 --openssl-legacy-provider\" NODE_ENV=production webpack --config config/webpack.config.js"
},
"dependencies": {
"@babel/core": "^7.10.1",
diff --git a/qa/.confiner/quarantine.yml b/qa/.confiner/quarantine.yml
new file mode 100644
index 00000000000..6534d72525d
--- /dev/null
+++ b/qa/.confiner/quarantine.yml
@@ -0,0 +1,15 @@
+- name: Quarantine E2E tests that fail consistently
+ plugin:
+ name: gitlab # https://gitlab.com/gitlab-org/quality/confiner/-/blob/main/doc/plugins/gitlab.md
+ args:
+ threshold: 3 # 3 failures
+ private_token: $QA_GITLAB_CI_TOKEN
+ project_id: gitlab-org/gitlab-qa-mirror # https://gitlab.com/gitlab-org/gitlab-qa-mirror/
+ target_project: gitlab-org/gitlab
+ failure_issue_labels: QA,Quality
+ failure_issue_prefix: "Failure in "
+ pwd: qa # E2E specs reside in the qa subdirectory
+ timeout: 30
+ ref: master
+ actions:
+ - quarantine
diff --git a/qa/Gemfile b/qa/Gemfile
index a7f1571d7f9..c07f9dc96a7 100644
--- a/qa/Gemfile
+++ b/qa/Gemfile
@@ -29,6 +29,8 @@ gem 'terminal-table', '~> 3.0.0', require: false
gem 'slack-notifier', '~> 2.4', require: false
gem 'fog-google', '~> 1.17', require: false
+gem 'confiner', '~> 0.2'
+
gem 'chemlab', '~> 0.9'
gem 'chemlab-library-www-gitlab-com', '~> 0.1'
diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock
index 8666deb3db1..3e85a33f2a2 100644
--- a/qa/Gemfile.lock
+++ b/qa/Gemfile.lock
@@ -57,6 +57,9 @@ GEM
adamantium (~> 0.2.0)
equalizer (~> 0.0.9)
concurrent-ruby (1.1.9)
+ confiner (0.2.1)
+ gitlab (>= 4.17)
+ zeitwerk (~> 2.5.1)
declarative (0.0.20)
deprecation_toolkit (1.5.1)
activesupport (>= 4.2)
@@ -186,7 +189,7 @@ GEM
method_source (0.9.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
- mime-types-data (3.2021.1115)
+ mime-types-data (3.2022.0105)
mini_mime (1.1.0)
mini_portile2 (2.6.1)
minitest (5.15.0)
@@ -312,7 +315,7 @@ GEM
webrick (1.7.0)
xpath (3.2.0)
nokogiri (~> 1.8)
- zeitwerk (2.5.2)
+ zeitwerk (2.5.3)
PLATFORMS
ruby
@@ -325,6 +328,7 @@ DEPENDENCIES
capybara-screenshot (~> 1.0.23)
chemlab (~> 0.9)
chemlab-library-www-gitlab-com (~> 0.1)
+ confiner (~> 0.2)
deprecation_toolkit (~> 1.5.1)
faker (~> 2.19, >= 2.19.0)
fog-google (~> 1.17)
diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb
index afec0e27a0b..a19fcf8ec6e 100644
--- a/qa/qa/page/project/branches/show.rb
+++ b/qa/qa/page/project/branches/show.rb
@@ -14,7 +14,6 @@ module QA
end
view 'app/views/projects/branches/_branch.html.haml' do
- element :remove_btn
element :branch_name
end
diff --git a/qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb b/qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
deleted file mode 100644
index 53d96e13d5e..00000000000
--- a/qa/qa/specs/features/api/1_manage/bulk_import_project_spec.rb
+++ /dev/null
@@ -1,260 +0,0 @@
-# frozen_string_literal: true
-
-module QA
- # run only base UI validation on staging because test requires top level group creation which is problematic
- # on staging environment
- RSpec.describe 'Manage', :requires_admin, except: { subdomain: :staging } do
- describe 'Gitlab migration', quarantine: {
- only: { job: 'praefect-parallel' },
- type: :investigating,
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
- } do
- let(:source_project_with_readme) { false }
- let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } }
- let(:admin_api_client) { Runtime::API::Client.as_admin }
- let(:user) do
- Resource::User.fabricate_via_api! do |usr|
- usr.api_client = admin_api_client
- usr.hard_delete_on_api_removal = true
- end
- end
-
- let(:api_client) { Runtime::API::Client.new(user: user) }
-
- let(:sandbox) do
- Resource::Sandbox.fabricate_via_api! do |group|
- group.api_client = admin_api_client
- end
- end
-
- let(:source_group) do
- Resource::Sandbox.fabricate_via_api! do |group|
- group.api_client = api_client
- group.path = "source-group-for-import-#{SecureRandom.hex(4)}"
- end
- end
-
- let(:source_project) do
- Resource::Project.fabricate_via_api! do |project|
- project.api_client = api_client
- project.group = source_group
- project.initialize_with_readme = source_project_with_readme
- end
- end
-
- let(:imported_group) do
- Resource::BulkImportGroup.fabricate_via_api! do |group|
- group.api_client = api_client
- group.sandbox = sandbox
- group.source_group_path = source_group.path
- end
- end
-
- let(:imported_projects) { imported_group.reload!.projects }
- let(:imported_project) { imported_projects.first }
-
- let(:import_failures) do
- imported_group.import_details.sum([]) { |details| details[:failures] }
- end
-
- def expect_import_finished
- imported_group # trigger import
-
- expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
- expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
- end
-
- before do
- Runtime::Feature.enable(:bulk_import_projects)
-
- sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
- source_project # fabricate source group and project
- end
-
- after do |example|
- # Checking for failures in the test currently makes test very flaky
- # Just log in case of failure until cause of network errors is found
- Runtime::Logger.warn("Import failures: #{import_failures}") if example.exception && !import_failures.empty?
-
- user.remove_via_api!
- ensure
- Runtime::Feature.disable(:bulk_import_projects)
- end
-
- context 'with project' do
- it(
- 'successfully imports project',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347610'
- ) do
- expect_import_finished
-
- expect(imported_projects.first).to eq(source_project)
- end
- end
-
- context 'with project issues' do
- let!(:source_issue) do
- Resource::Issue.fabricate_via_api! do |issue|
- issue.api_client = api_client
- issue.project = source_project
- issue.labels = %w[label_one label_two]
- end
- end
-
- let!(:source_comment) { source_issue.add_comment(body: 'This is a test comment!') }
-
- let(:imported_issues) { imported_projects.first.issues }
-
- let(:imported_issue) do
- issue = imported_issues.first
- Resource::Issue.init do |resource|
- resource.api_client = api_client
- resource.project = imported_projects.first
- resource.iid = issue[:iid]
- end
- end
-
- let(:imported_comments) { imported_issue.comments }
-
- it(
- 'successfully imports issue',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347608'
- ) do
- expect_import_finished
-
- aggregate_failures do
- expect(imported_issues.count).to eq(1)
- expect(imported_issue).to eq(source_issue.reload!)
-
- expect(imported_comments.count).to eq(1)
- expect(imported_comments.first[:body]).to include(source_comment[:body])
- end
- end
- end
-
- context 'with repository' do
- let(:source_project_with_readme) { true }
- let(:source_commits) { source_project.commits.map { |c| c.except(:web_url) } }
- let(:source_tags) do
- source_project.repository_tags.tap do |tags|
- tags.each { |t| t[:commit].delete(:web_url) }
- end
- end
-
- let(:source_branches) do
- source_project.repository_branches.tap do |branches|
- branches.each do |b|
- b.delete(:web_url)
- b[:commit].delete(:web_url)
- end
- end
- end
-
- let(:imported_commits) { imported_project.commits.map { |c| c.except(:web_url) } }
- let(:imported_tags) do
- imported_project.repository_tags.tap do |tags|
- tags.each { |t| t[:commit].delete(:web_url) }
- end
- end
-
- let(:imported_branches) do
- imported_project.repository_branches.tap do |branches|
- branches.each do |b|
- b.delete(:web_url)
- b[:commit].delete(:web_url)
- end
- end
- end
-
- before do
- source_project.create_repository_branch('test-branch')
- source_project.create_repository_tag('v0.0.1')
- end
-
- it(
- 'successfully imports repository',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347570'
- ) do
- aggregate_failures do
- expect_import_finished
-
- expect(imported_commits).to match_array(source_commits)
- expect(imported_tags).to match_array(source_tags)
- expect(imported_branches).to match_array(source_branches)
- end
- end
- end
-
- context 'with wiki' do
- before do
- source_project.create_wiki_page(title: 'Import test project wiki', content: 'Wiki content')
- end
-
- it(
- 'successfully imports project wiki',
- testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347567'
- ) do
- expect_import_finished
-
- expect(imported_projects.first.wikis).to eq(source_project.wikis)
- end
- end
-
- context 'with merge request' do
- let!(:source_project_with_readme) { true }
-
- let!(:other_user) do
- Resource::User
- .fabricate_via_api! { |usr| usr.api_client = admin_api_client }
- .tap do |usr|
- usr.set_public_email
- source_project.add_member(usr, Resource::Members::AccessLevel::MAINTAINER)
- end
- end
-
- let!(:source_mr) do
- Resource::MergeRequest.fabricate_via_api! do |mr|
- mr.project = source_project
- mr.api_client = Runtime::API::Client.new(user: other_user)
- end
- end
-
- let!(:source_comment) { source_mr.add_comment('This is a test comment!') }
-
- let(:imported_mrs) { imported_project.merge_requests }
- let(:imported_mr_comments) { imported_mr.comments }
-
- let(:imported_mr) do
- Resource::MergeRequest.init do |mr|
- mr.project = imported_project
- mr.iid = imported_mrs.first[:iid]
- mr.api_client = api_client
- end
- end
-
- after do
- other_user.remove_via_api!
- end
-
- it(
- 'successfully imports merge request',
- tesecase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348478'
- ) do
- expect_import_finished
-
- aggregate_failures do
- expect(imported_mrs.count).to eq(1)
- # TODO: remove custom comparison after member migration is implemented
- # https://gitlab.com/gitlab-org/gitlab/-/issues/341886
- expect(imported_mr.comparable.except(:author)).to eq(source_mr.reload!.comparable.except(:author))
-
- expect(imported_mr_comments.count).to eq(1)
- expect(imported_mr_comments.first[:body]).to include(source_comment[:body])
- # Comment will have mention of original user since members are not migrated yet
- expect(imported_mr_comments.first[:body]).to include(other_user.name)
- end
- end
- end
- end
- end
-end
diff --git a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
index 799a5f7eaf2..799a5f7eaf2 100644
--- a/qa/qa/specs/features/api/1_manage/bulk_import_group_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb
new file mode 100644
index 00000000000..fe2e3c76ea3
--- /dev/null
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+require_relative 'gitlab_project_migration_common'
+
+module QA
+ # run only base UI validation on staging because test requires top level group creation which is problematic
+ # on staging environment
+ RSpec.describe 'Manage', :requires_admin, except: { subdomain: :staging } do
+ describe 'Gitlab migration', quarantine: {
+ only: { job: 'praefect' },
+ type: :investigating,
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
+ } do
+ include_context 'with gitlab project migration'
+
+ context 'with project issues' do
+ let!(:source_issue) do
+ Resource::Issue.fabricate_via_api! do |issue|
+ issue.api_client = api_client
+ issue.project = source_project
+ issue.labels = %w[label_one label_two]
+ end
+ end
+
+ let!(:source_comment) { source_issue.add_comment(body: 'This is a test comment!') }
+
+ let(:imported_issues) { imported_projects.first.issues }
+
+ let(:imported_issue) do
+ issue = imported_issues.first
+ Resource::Issue.init do |resource|
+ resource.api_client = api_client
+ resource.project = imported_projects.first
+ resource.iid = issue[:iid]
+ end
+ end
+
+ let(:imported_comments) { imported_issue.comments }
+
+ it(
+ 'successfully imports issue',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347608'
+ ) do
+ expect_import_finished
+
+ aggregate_failures do
+ expect(imported_issues.count).to eq(1)
+ expect(imported_issue).to eq(source_issue.reload!)
+
+ expect(imported_comments.count).to eq(1)
+ expect(imported_comments.first[:body]).to include(source_comment[:body])
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb
new file mode 100644
index 00000000000..287623aef55
--- /dev/null
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb
@@ -0,0 +1,73 @@
+# frozen_string_literal: true
+
+require_relative 'gitlab_project_migration_common'
+
+module QA
+ # run only base UI validation on staging because test requires top level group creation which is problematic
+ # on staging environment
+ RSpec.describe 'Manage', :requires_admin, except: { subdomain: :staging } do
+ describe 'Gitlab migration', quarantine: {
+ only: { job: 'praefect' },
+ type: :investigating,
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
+ } do
+ include_context 'with gitlab project migration'
+
+ context 'with merge request' do
+ let!(:source_project_with_readme) { true }
+
+ let!(:other_user) do
+ Resource::User
+ .fabricate_via_api! { |usr| usr.api_client = admin_api_client }
+ .tap do |usr|
+ usr.set_public_email
+ source_project.add_member(usr, Resource::Members::AccessLevel::MAINTAINER)
+ end
+ end
+
+ let!(:source_mr) do
+ Resource::MergeRequest.fabricate_via_api! do |mr|
+ mr.project = source_project
+ mr.api_client = Runtime::API::Client.new(user: other_user)
+ end
+ end
+
+ let!(:source_comment) { source_mr.add_comment('This is a test comment!') }
+
+ let(:imported_mrs) { imported_project.merge_requests }
+ let(:imported_mr_comments) { imported_mr.comments }
+
+ let(:imported_mr) do
+ Resource::MergeRequest.init do |mr|
+ mr.project = imported_project
+ mr.iid = imported_mrs.first[:iid]
+ mr.api_client = api_client
+ end
+ end
+
+ after do
+ other_user.remove_via_api!
+ end
+
+ it(
+ 'successfully imports merge request',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348478'
+ ) do
+ expect_import_finished
+
+ aggregate_failures do
+ expect(imported_mrs.count).to eq(1)
+ # TODO: remove custom comparison after member migration is implemented
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/341886
+ expect(imported_mr.comparable.except(:author)).to eq(source_mr.reload!.comparable.except(:author))
+
+ expect(imported_mr_comments.count).to eq(1)
+ expect(imported_mr_comments.first[:body]).to include(source_comment[:body])
+ # Comment will have mention of original user since members are not migrated yet
+ expect(imported_mr_comments.first[:body]).to include(other_user.name)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb
new file mode 100644
index 00000000000..b8f4f9d1016
--- /dev/null
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb
@@ -0,0 +1,96 @@
+# frozen_string_literal: true
+
+require_relative 'gitlab_project_migration_common'
+
+module QA
+ # run only base UI validation on staging because test requires top level group creation which is problematic
+ # on staging environment
+ RSpec.describe 'Manage', :requires_admin, except: { subdomain: :staging } do
+ describe 'Gitlab migration', quarantine: {
+ only: { job: 'praefect' },
+ type: :investigating,
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
+ } do
+ include_context 'with gitlab project migration'
+
+ context 'with uninitialized project' do
+ it(
+ 'successfully imports project',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347610'
+ ) do
+ expect_import_finished
+
+ expect(imported_projects.first).to eq(source_project)
+ end
+ end
+
+ context 'with repository' do
+ let(:source_project_with_readme) { true }
+ let(:source_commits) { source_project.commits.map { |c| c.except(:web_url) } }
+ let(:source_tags) do
+ source_project.repository_tags.tap do |tags|
+ tags.each { |t| t[:commit].delete(:web_url) }
+ end
+ end
+
+ let(:source_branches) do
+ source_project.repository_branches.tap do |branches|
+ branches.each do |b|
+ b.delete(:web_url)
+ b[:commit].delete(:web_url)
+ end
+ end
+ end
+
+ let(:imported_commits) { imported_project.commits.map { |c| c.except(:web_url) } }
+ let(:imported_tags) do
+ imported_project.repository_tags.tap do |tags|
+ tags.each { |t| t[:commit].delete(:web_url) }
+ end
+ end
+
+ let(:imported_branches) do
+ imported_project.repository_branches.tap do |branches|
+ branches.each do |b|
+ b.delete(:web_url)
+ b[:commit].delete(:web_url)
+ end
+ end
+ end
+
+ before do
+ source_project.create_repository_branch('test-branch')
+ source_project.create_repository_tag('v0.0.1')
+ end
+
+ it(
+ 'successfully imports repository',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347570'
+ ) do
+ aggregate_failures do
+ expect_import_finished
+
+ expect(imported_commits).to match_array(source_commits)
+ expect(imported_tags).to match_array(source_tags)
+ expect(imported_branches).to match_array(source_branches)
+ end
+ end
+ end
+
+ context 'with wiki' do
+ before do
+ source_project.create_wiki_page(title: 'Import test project wiki', content: 'Wiki content')
+ end
+
+ it(
+ 'successfully imports project wiki',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347567'
+ ) do
+ expect_import_finished
+
+ expect(imported_projects.first.wikis).to eq(source_project.wikis)
+ end
+ end
+ end
+ end
+end
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
new file mode 100644
index 00000000000..c6f3c9a626f
--- /dev/null
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
@@ -0,0 +1,77 @@
+# frozen_string_literal: true
+
+module QA
+ RSpec.shared_context 'with gitlab project migration' do
+ let(:source_project_with_readme) { false }
+ let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } }
+ let(:admin_api_client) { Runtime::API::Client.as_admin }
+ let(:user) do
+ Resource::User.fabricate_via_api! do |usr|
+ usr.api_client = admin_api_client
+ usr.hard_delete_on_api_removal = true
+ end
+ end
+
+ let(:api_client) { Runtime::API::Client.new(user: user) }
+
+ let(:sandbox) do
+ Resource::Sandbox.fabricate_via_api! do |group|
+ group.api_client = admin_api_client
+ end
+ end
+
+ let(:source_group) do
+ Resource::Sandbox.fabricate_via_api! do |group|
+ group.api_client = api_client
+ group.path = "source-group-for-import-#{SecureRandom.hex(4)}"
+ end
+ end
+
+ let(:source_project) do
+ Resource::Project.fabricate_via_api! do |project|
+ project.api_client = api_client
+ project.group = source_group
+ project.initialize_with_readme = source_project_with_readme
+ end
+ end
+
+ let(:imported_group) do
+ Resource::BulkImportGroup.fabricate_via_api! do |group|
+ group.api_client = api_client
+ group.sandbox = sandbox
+ group.source_group_path = source_group.path
+ end
+ end
+
+ let(:imported_projects) { imported_group.reload!.projects }
+ let(:imported_project) { imported_projects.first }
+
+ let(:import_failures) do
+ imported_group.import_details.sum([]) { |details| details[:failures] }
+ end
+
+ def expect_import_finished
+ imported_group # trigger import
+
+ expect { imported_group.import_status }.to eventually_eq('finished').within(import_wait_duration)
+ expect(imported_projects.count).to eq(1), 'Expected to have 1 imported project'
+ end
+
+ before do
+ Runtime::Feature.enable(:bulk_import_projects)
+
+ sandbox.add_member(user, Resource::Members::AccessLevel::MAINTAINER)
+ source_project # fabricate source group and project
+ end
+
+ after do |example|
+ # Checking for failures in the test currently makes test very flaky
+ # Just log in case of failure until cause of network errors is found
+ Runtime::Logger.warn("Import failures: #{import_failures}") if example.exception && !import_failures.empty?
+
+ user.remove_via_api!
+ ensure
+ Runtime::Feature.disable(:bulk_import_projects)
+ end
+ end
+end
diff --git a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
index a98925eab98..0bd470fcb77 100644
--- a/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
+++ b/qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
@@ -24,8 +24,6 @@ module QA
proj.initialize_with_readme = true
end
- Runtime::Feature.enable(:delete_branch_confirmation_modals, project: project)
-
master_branch = project.default_branch
Git::Repository.perform do |repository|
diff --git a/spec/features/admin/admin_runners_spec.rb b/spec/features/admin/admin_runners_spec.rb
index 2319eebaefc..15ccb096328 100644
--- a/spec/features/admin/admin_runners_spec.rb
+++ b/spec/features/admin/admin_runners_spec.rb
@@ -131,6 +131,9 @@ RSpec.describe "Admin Runners" do
it 'shows correct runner when description matches' do
input_filtered_search_keys('runner-foo')
+ expect(page).to have_link('All 1')
+ expect(page).to have_link('Instance 1')
+
expect(page).to have_content("runner-foo")
expect(page).not_to have_content("runner-bar")
end
@@ -138,73 +141,76 @@ RSpec.describe "Admin Runners" do
it 'shows no runner when description does not match' do
input_filtered_search_keys('runner-baz')
+ expect(page).to have_link('All 0')
+ expect(page).to have_link('Instance 0')
+
expect(page).to have_text 'No runners found'
end
end
describe 'filter by status' do
- it 'shows correct runner when status matches' do
- create(:ci_runner, :instance, description: 'runner-active', active: true)
- create(:ci_runner, :instance, description: 'runner-paused', active: false)
+ let!(:never_contacted) { create(:ci_runner, :instance, description: 'runner-never-contacted', contacted_at: nil) }
+
+ before do
+ create(:ci_runner, :instance, description: 'runner-1', contacted_at: Time.now)
+ create(:ci_runner, :instance, description: 'runner-2', contacted_at: Time.now)
+ create(:ci_runner, :instance, description: 'runner-paused', active: false, contacted_at: Time.now)
visit admin_runners_path
+ end
- expect(page).to have_content 'runner-active'
+ it 'shows all runners' do
+ expect(page).to have_content 'runner-1'
+ expect(page).to have_content 'runner-2'
expect(page).to have_content 'runner-paused'
+ expect(page).to have_content 'runner-never-contacted'
+ expect(page).to have_link('All 4')
+ end
+
+ it 'shows correct runner when status matches' do
input_filtered_search_filter_is_only('Status', 'Active')
- expect(page).to have_content 'runner-active'
+ expect(page).to have_link('All 3')
+
+ expect(page).to have_content 'runner-1'
+ expect(page).to have_content 'runner-2'
+ expect(page).to have_content 'runner-never-contacted'
expect(page).not_to have_content 'runner-paused'
end
it 'shows no runner when status does not match' do
- create(:ci_runner, :instance, description: 'runner-active', active: true)
- create(:ci_runner, :instance, description: 'runner-paused', active: false)
-
- visit admin_runners_path
+ input_filtered_search_filter_is_only('Status', 'Stale')
- input_filtered_search_filter_is_only('Status', 'Online')
-
- expect(page).not_to have_content 'runner-active'
- expect(page).not_to have_content 'runner-paused'
+ expect(page).to have_link('All 0')
expect(page).to have_text 'No runners found'
end
it 'shows correct runner when status is selected and search term is entered' do
- create(:ci_runner, :instance, description: 'runner-a-1', active: true)
- create(:ci_runner, :instance, description: 'runner-a-2', active: false)
- create(:ci_runner, :instance, description: 'runner-b-1', active: true)
-
- visit admin_runners_path
-
input_filtered_search_filter_is_only('Status', 'Active')
+ input_filtered_search_keys('runner-1')
- expect(page).to have_content 'runner-a-1'
- expect(page).to have_content 'runner-b-1'
- expect(page).not_to have_content 'runner-a-2'
-
- input_filtered_search_keys('runner-a')
+ expect(page).to have_link('All 1')
- expect(page).to have_content 'runner-a-1'
- expect(page).not_to have_content 'runner-b-1'
- expect(page).not_to have_content 'runner-a-2'
+ expect(page).to have_content 'runner-1'
+ expect(page).not_to have_content 'runner-2'
+ expect(page).not_to have_content 'runner-never-contacted'
+ expect(page).not_to have_content 'runner-paused'
end
it 'shows correct runner when status filter is entered' do
- never_connected = create(:ci_runner, :instance, description: 'runner-never-contacted', contacted_at: nil)
- create(:ci_runner, :instance, description: 'runner-contacted', contacted_at: Time.now)
-
- visit admin_runners_path
-
# use the string "Never" to avoid using space and trigger an early selection
input_filtered_search_filter_is_only('Status', 'Never')
+ expect(page).to have_link('All 1')
+
+ expect(page).not_to have_content 'runner-1'
+ expect(page).not_to have_content 'runner-2'
+ expect(page).not_to have_content 'runner-paused'
expect(page).to have_content 'runner-never-contacted'
- expect(page).not_to have_content 'runner-contacted'
- within "[data-testid='runner-row-#{never_connected.id}']" do
+ within "[data-testid='runner-row-#{never_contacted.id}']" do
expect(page).to have_selector '.badge', text: 'never contacted'
end
end
@@ -219,6 +225,10 @@ RSpec.describe "Admin Runners" do
it '"All" tab is selected by default' do
visit admin_runners_path
+ expect(page).to have_link('All 2')
+ expect(page).to have_link('Group 1')
+ expect(page).to have_link('Project 1')
+
page.within('[data-testid="runner-type-tabs"]') do
expect(page).to have_link('All', class: 'active')
end
@@ -380,6 +390,13 @@ RSpec.describe "Admin Runners" do
expect(page).to have_text "Online Runners 0"
expect(page).to have_text 'No runners found'
end
+
+ it 'shows tabs with total counts equal to 0' do
+ expect(page).to have_link('All 0')
+ expect(page).to have_link('Instance 0')
+ expect(page).to have_link('Group 0')
+ expect(page).to have_link('Project 0')
+ end
end
context "when visiting outdated URLs" do
@@ -581,6 +598,8 @@ RSpec.describe "Admin Runners" do
page.find('input').send_keys(search_term)
click_on 'Search'
end
+
+ wait_for_requests
end
def input_filtered_search_filter_is_only(filter, value)
@@ -597,5 +616,7 @@ RSpec.describe "Admin Runners" do
click_on 'Search'
end
+
+ wait_for_requests
end
end
diff --git a/spec/features/projects/branches/user_deletes_branch_spec.rb b/spec/features/projects/branches/user_deletes_branch_spec.rb
index 8fc5c3d2e1b..0d08e7ea10d 100644
--- a/spec/features/projects/branches/user_deletes_branch_spec.rb
+++ b/spec/features/projects/branches/user_deletes_branch_spec.rb
@@ -32,28 +32,4 @@ RSpec.describe "User deletes branch", :js do
expect(page).to have_content('Branch was deleted')
end
-
- context 'when the feature flag :delete_branch_confirmation_modals is disabled' do
- before do
- stub_feature_flags(bootstrap_confirmation_modals: false)
- stub_feature_flags(delete_branch_confirmation_modals: false)
- end
-
- it "deletes branch" do
- visit(project_branches_path(project))
-
- branch_search = find('input[data-testid="branch-search"]')
-
- branch_search.set('improve/awesome')
- branch_search.native.send_keys(:enter)
-
- page.within(".js-branch-improve\\/awesome") do
- accept_alert { click_link(title: 'Delete branch') }
- end
-
- wait_for_requests
-
- expect(page).to have_css(".js-branch-improve\\/awesome", visible: :hidden)
- end
- end
end
diff --git a/spec/features/projects/branches_spec.rb b/spec/features/projects/branches_spec.rb
index 2725c6a91be..6d05e553cc7 100644
--- a/spec/features/projects/branches_spec.rb
+++ b/spec/features/projects/branches_spec.rb
@@ -175,26 +175,6 @@ RSpec.describe 'Branches' do
expect(page).not_to have_content('fix')
expect(all('.all-branches').last).to have_selector('li', count: 0)
end
-
- context 'when the delete_branch_confirmation_modals feature flag is disabled' do
- it 'removes branch after confirmation', :js do
- stub_feature_flags(delete_branch_confirmation_modals: false)
- stub_feature_flags(bootstrap_confirmation_modals: false)
-
- visit project_branches_filtered_path(project, state: 'all')
-
- search_for_branch('fix')
-
- expect(page).to have_content('fix')
- expect(find('.all-branches')).to have_selector('li', count: 1)
- accept_confirm do
- within('.js-branch-item', match: :first) { click_link(title: 'Delete branch') }
- end
-
- expect(page).not_to have_content('fix')
- expect(find('.all-branches')).to have_selector('li', count: 0)
- end
- end
end
context 'on project with 0 branch' do
diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb
index bcbf2f46f79..d88ff5c1aa5 100644
--- a/spec/features/projects/environments/environment_spec.rb
+++ b/spec/features/projects/environments/environment_spec.rb
@@ -342,24 +342,6 @@ RSpec.describe 'Environment' do
expect(page).not_to have_button('Stop')
end
- context 'when the feature flag :delete_branch_confirmation_modals is disabled' do
- before do
- stub_feature_flags(delete_branch_confirmation_modals: false)
- end
-
- it 'user deletes the branch with running environment' do
- visit project_branches_filtered_path(project, state: 'all', search: 'feature')
-
- remove_branch_with_hooks(project, user, 'feature') do
- within('.js-branch-feature') { click_link(title: 'Delete branch') }
- end
-
- visit_environment(environment)
-
- expect(page).not_to have_button('Stop')
- end
- end
-
##
# This is a workaround for problem described in #24543
#
diff --git a/spec/features/protected_branches_spec.rb b/spec/features/protected_branches_spec.rb
index 15ec11c256f..4278efc5a8f 100644
--- a/spec/features/protected_branches_spec.rb
+++ b/spec/features/protected_branches_spec.rb
@@ -29,21 +29,6 @@ RSpec.describe 'Protected Branches', :js do
expect(page).to have_button('Only a project maintainer or owner can delete a protected branch', disabled: true)
end
-
- context 'when feature flag :delete_branch_confirmation_modals is disabled' do
- before do
- stub_feature_flags(delete_branch_confirmation_modals: false)
- end
-
- it 'does not allow developer to remove protected branch' do
- visit project_branches_path(project)
-
- find('input[data-testid="branch-search"]').set('fix')
- find('input[data-testid="branch-search"]').native.send_keys(:enter)
-
- expect(page).to have_selector('button[data-testid="remove-protected-branch"][disabled]')
- end
- end
end
end
@@ -79,32 +64,6 @@ RSpec.describe 'Protected Branches', :js do
expect(page).to have_content('No branches to show')
end
-
- context 'when the feature flag :delete_branch_confirmation_modals is disabled' do
- before do
- stub_feature_flags(delete_branch_confirmation_modals: false)
- end
-
- it 'removes branch after modal confirmation' do
- visit project_branches_path(project)
-
- find('input[data-testid="branch-search"]').set('fix')
- find('input[data-testid="branch-search"]').native.send_keys(:enter)
-
- expect(page).to have_content('fix')
- expect(find('.all-branches')).to have_selector('li', count: 1)
- page.find('[data-target="#modal-delete-branch"]').click
-
- expect(page).to have_css('.js-delete-branch[disabled]')
- fill_in 'delete_branch_input', with: 'fix'
- click_link 'Delete protected branch'
-
- find('input[data-testid="branch-search"]').set('fix')
- find('input[data-testid="branch-search"]').native.send_keys(:enter)
-
- expect(page).to have_content('No branches to show')
- end
- end
end
end
diff --git a/spec/frontend/branches/branches_delete_modal_spec.js b/spec/frontend/branches/branches_delete_modal_spec.js
deleted file mode 100644
index 8b10cca7a11..00000000000
--- a/spec/frontend/branches/branches_delete_modal_spec.js
+++ /dev/null
@@ -1,40 +0,0 @@
-import $ from 'jquery';
-import DeleteModal from '~/branches/branches_delete_modal';
-
-describe('branches delete modal', () => {
- describe('setDisableDeleteButton', () => {
- let submitSpy;
- let $deleteButton;
-
- beforeEach(() => {
- setFixtures(`
- <div id="modal-delete-branch">
- <form>
- <button type="submit" class="js-delete-branch">Delete</button>
- </form>
- </div>
- `);
- $deleteButton = $('.js-delete-branch');
- submitSpy = jest.fn((event) => event.preventDefault());
- $('#modal-delete-branch form').on('submit', submitSpy);
- // eslint-disable-next-line no-new
- new DeleteModal();
- });
-
- it('does not submit if button is disabled', () => {
- $deleteButton.attr('disabled', true);
-
- $deleteButton.click();
-
- expect(submitSpy).not.toHaveBeenCalled();
- });
-
- it('submits if button is not disabled', () => {
- $deleteButton.attr('disabled', false);
-
- $deleteButton.click();
-
- expect(submitSpy).toHaveBeenCalled();
- });
- });
-});
diff --git a/spec/frontend/fixtures/runner.rb b/spec/frontend/fixtures/runner.rb
index fa150fbf57c..b5dd3576e8b 100644
--- a/spec/frontend/fixtures/runner.rb
+++ b/spec/frontend/fixtures/runner.rb
@@ -50,6 +50,25 @@ RSpec.describe 'Runner (JavaScript fixtures)' do
end
describe GraphQL::Query, type: :request do
+ get_runners_count_query_name = 'get_runners_count.query.graphql'
+
+ before do
+ sign_in(admin)
+ enable_admin_mode!(admin)
+ end
+
+ let_it_be(:query) do
+ get_graphql_query_as_string("#{query_path}#{get_runners_count_query_name}")
+ end
+
+ it "#{fixtures_path}#{get_runners_count_query_name}.json" do
+ post_graphql(query, current_user: admin, variables: {})
+
+ expect_graphql_errors_to_be_empty
+ end
+ end
+
+ describe GraphQL::Query, type: :request do
get_runner_query_name = 'get_runner.query.graphql'
before do
diff --git a/spec/frontend/runner/admin_runners/admin_runners_app_spec.js b/spec/frontend/runner/admin_runners/admin_runners_app_spec.js
index 19c3a4b8e3c..d33cac4b632 100644
--- a/spec/frontend/runner/admin_runners/admin_runners_app_spec.js
+++ b/spec/frontend/runner/admin_runners/admin_runners_app_spec.js
@@ -22,23 +22,22 @@ import {
CREATED_DESC,
DEFAULT_SORT,
INSTANCE_TYPE,
+ GROUP_TYPE,
+ PROJECT_TYPE,
PARAM_KEY_STATUS,
PARAM_KEY_TAG,
STATUS_ACTIVE,
RUNNER_PAGE_SIZE,
} from '~/runner/constants';
import getRunnersQuery from '~/runner/graphql/get_runners.query.graphql';
+import getRunnersCountQuery from '~/runner/graphql/get_runners_count.query.graphql';
import { captureException } from '~/runner/sentry_utils';
import FilteredSearch from '~/vue_shared/components/filtered_search_bar/filtered_search_bar_root.vue';
-import { runnersData, runnersDataPaginated } from '../mock_data';
+import { runnersData, runnersCountData, runnersDataPaginated } from '../mock_data';
const mockRegistrationToken = 'MOCK_REGISTRATION_TOKEN';
const mockActiveRunnersCount = '2';
-const mockAllRunnersCount = '6';
-const mockInstanceRunnersCount = '3';
-const mockGroupRunnersCount = '2';
-const mockProjectRunnersCount = '1';
jest.mock('~/flash');
jest.mock('~/runner/sentry_utils');
@@ -53,6 +52,7 @@ localVue.use(VueApollo);
describe('AdminRunnersApp', () => {
let wrapper;
let mockRunnersQuery;
+ let mockRunnersCountQuery;
const findRegistrationDropdown = () => wrapper.findComponent(RegistrationDropdown);
const findRunnerTypeTabs = () => wrapper.findComponent(RunnerTypeTabs);
@@ -65,7 +65,10 @@ describe('AdminRunnersApp', () => {
const findFilteredSearch = () => wrapper.findComponent(FilteredSearch);
const createComponent = ({ props = {}, mountFn = shallowMount } = {}) => {
- const handlers = [[getRunnersQuery, mockRunnersQuery]];
+ const handlers = [
+ [getRunnersQuery, mockRunnersQuery],
+ [getRunnersCountQuery, mockRunnersCountQuery],
+ ];
wrapper = mountFn(AdminRunnersApp, {
localVue,
@@ -73,10 +76,6 @@ describe('AdminRunnersApp', () => {
propsData: {
registrationToken: mockRegistrationToken,
activeRunnersCount: mockActiveRunnersCount,
- allRunnersCount: mockAllRunnersCount,
- instanceRunnersCount: mockInstanceRunnersCount,
- groupRunnersCount: mockGroupRunnersCount,
- projectRunnersCount: mockProjectRunnersCount,
...props,
},
});
@@ -86,6 +85,19 @@ describe('AdminRunnersApp', () => {
setWindowLocation('/admin/runners');
mockRunnersQuery = jest.fn().mockResolvedValue(runnersData);
+ mockRunnersCountQuery = jest.fn().mockImplementation(({ type }) => {
+ const mockResponse = {
+ [INSTANCE_TYPE]: 3,
+ [GROUP_TYPE]: 2,
+ [PROJECT_TYPE]: 1,
+ };
+ if (mockResponse[type]) {
+ return Promise.resolve({
+ data: { runners: { count: mockResponse[type] } },
+ });
+ }
+ return Promise.resolve(runnersCountData);
+ });
createComponent();
await waitForPromises();
});
@@ -101,7 +113,7 @@ describe('AdminRunnersApp', () => {
await waitForPromises();
expect(findRunnerTypeTabs().text()).toMatchInterpolatedText(
- `All ${mockAllRunnersCount} Instance ${mockInstanceRunnersCount} Group ${mockGroupRunnersCount} Project ${mockProjectRunnersCount}`,
+ `All ${runnersCountData.data.runners.count} Instance 3 Group 2 Project 1`,
);
});
diff --git a/spec/frontend/runner/mock_data.js b/spec/frontend/runner/mock_data.js
index b8d0f1273c7..d4f265b2d7b 100644
--- a/spec/frontend/runner/mock_data.js
+++ b/spec/frontend/runner/mock_data.js
@@ -2,6 +2,7 @@
// Admin queries
import runnersData from 'test_fixtures/graphql/runner/get_runners.query.graphql.json';
+import runnersCountData from 'test_fixtures/graphql/runner/get_runners_count.query.graphql.json';
import runnersDataPaginated from 'test_fixtures/graphql/runner/get_runners.query.graphql.paginated.json';
import runnerData from 'test_fixtures/graphql/runner/get_runner.query.graphql.json';
@@ -11,6 +12,7 @@ import groupRunnersDataPaginated from 'test_fixtures/graphql/runner/get_group_ru
export {
runnerData,
+ runnersCountData,
runnersDataPaginated,
runnersData,
groupRunnersData,
diff --git a/spec/frontend/vue_shared/issuable/list/components/issuable_tabs_spec.js b/spec/frontend/vue_shared/issuable/list/components/issuable_tabs_spec.js
index 8c22b67bdbe..5723e2da586 100644
--- a/spec/frontend/vue_shared/issuable/list/components/issuable_tabs_spec.js
+++ b/spec/frontend/vue_shared/issuable/list/components/issuable_tabs_spec.js
@@ -1,5 +1,6 @@
import { GlTab, GlBadge } from '@gitlab/ui';
import { mount } from '@vue/test-utils';
+import { setLanguage } from 'helpers/locale_helper';
import IssuableTabs from '~/vue_shared/issuable/list/components/issuable_tabs.vue';
@@ -27,10 +28,12 @@ describe('IssuableTabs', () => {
let wrapper;
beforeEach(() => {
+ setLanguage('en');
wrapper = createComponent();
});
afterEach(() => {
+ setLanguage(null);
wrapper.destroy();
});
@@ -71,7 +74,7 @@ describe('IssuableTabs', () => {
// Does not render `All` badge since it has an undefined count
expect(badges).toHaveLength(2);
- expect(badges.at(0).text()).toBe(`${mockIssuableListProps.tabCounts.opened}`);
+ expect(badges.at(0).text()).toBe('5,000');
expect(badges.at(1).text()).toBe(`${mockIssuableListProps.tabCounts.closed}`);
});
diff --git a/spec/frontend/vue_shared/issuable/list/mock_data.js b/spec/frontend/vue_shared/issuable/list/mock_data.js
index e2fa99f7cc9..cfc7937b412 100644
--- a/spec/frontend/vue_shared/issuable/list/mock_data.js
+++ b/spec/frontend/vue_shared/issuable/list/mock_data.js
@@ -133,7 +133,7 @@ export const mockTabs = [
];
export const mockTabCounts = {
- opened: 5,
+ opened: 5000,
closed: 0,
all: undefined,
};
diff --git a/spec/helpers/ci/runners_helper_spec.rb b/spec/helpers/ci/runners_helper_spec.rb
index 6a8db943e46..9694c7cb4b7 100644
--- a/spec/helpers/ci/runners_helper_spec.rb
+++ b/spec/helpers/ci/runners_helper_spec.rb
@@ -80,11 +80,7 @@ RSpec.describe Ci::RunnersHelper do
expect(helper.admin_runners_data_attributes).to eq({
runner_install_help_page: 'https://docs.gitlab.com/runner/install/',
registration_token: Gitlab::CurrentSettings.runners_registration_token,
- active_runners_count: '0',
- all_runners_count: '2',
- instance_runners_count: '1',
- group_runners_count: '0',
- project_runners_count: '1'
+ active_runners_count: '0'
})
end
end
diff --git a/spec/lib/gitlab/background_migration/backfill_artifact_expiry_date_spec.rb b/spec/lib/gitlab/background_migration/backfill_artifact_expiry_date_spec.rb
index 6ab1e3ecd70..f5d2224747a 100644
--- a/spec/lib/gitlab/background_migration/backfill_artifact_expiry_date_spec.rb
+++ b/spec/lib/gitlab/background_migration/backfill_artifact_expiry_date_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillArtifactExpiryDate, :migration, schema: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::BackfillArtifactExpiryDate, :migration, schema: 20210301200959 do
subject(:perform) { migration.perform(1, 99) }
let(:migration) { described_class.new }
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
index 446d62bbd2a..65f5f8368df 100644
--- 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
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillJiraTrackerDeploymentType2, :migration, schema: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::BackfillJiraTrackerDeploymentType2, :migration, schema: 20210301200959 do
let_it_be(:jira_integration_temp) { described_class::JiraServiceTemp }
let_it_be(:jira_tracker_data_temp) { described_class::JiraTrackerDataTemp }
let_it_be(:atlassian_host) { 'https://api.atlassian.net' }
diff --git a/spec/lib/gitlab/background_migration/backfill_project_updated_at_after_repository_storage_move_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_updated_at_after_repository_storage_move_spec.rb
index 708e5e21dbe..ed44b819a97 100644
--- a/spec/lib/gitlab/background_migration/backfill_project_updated_at_after_repository_storage_move_spec.rb
+++ b/spec/lib/gitlab/background_migration/backfill_project_updated_at_after_repository_storage_move_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::BackfillProjectUpdatedAtAfterRepositoryStorageMove, :migration, schema: 20210210093901 do
+RSpec.describe Gitlab::BackgroundMigration::BackfillProjectUpdatedAtAfterRepositoryStorageMove, :migration, schema: 20210301200959 do
let(:projects) { table(:projects) }
let(:project_repository_storage_moves) { table(:project_repository_storage_moves) }
let(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
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 b83dc6fff7a..5b6722a3384 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: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::DropInvalidVulnerabilities, schema: 20210301200959 do
let_it_be(:background_migration_jobs) { table(:background_migration_jobs) }
let_it_be(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
let_it_be(:users) { table(:users) }
diff --git a/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb b/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb
deleted file mode 100644
index 5c93e69b5e5..00000000000
--- a/spec/lib/gitlab/background_migration/migrate_legacy_artifacts_spec.rb
+++ /dev/null
@@ -1,158 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::MigrateLegacyArtifacts, schema: 20210210093901 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:pipelines) { table(:ci_pipelines) }
- let(:jobs) { table(:ci_builds) }
- let(:job_artifacts) { table(:ci_job_artifacts) }
-
- subject { described_class.new.perform(*range) }
-
- context 'when a pipeline exists' do
- let!(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') }
- let!(:project) { projects.create!(name: 'gitlab', path: 'gitlab-ce', namespace_id: namespace.id) }
- let!(:pipeline) { pipelines.create!(project_id: project.id, ref: 'master', sha: 'adf43c3a') }
-
- context 'when a legacy artifacts exists' do
- let(:artifacts_expire_at) { 1.day.since.to_s }
- let(:file_store) { ::ObjectStorage::Store::REMOTE }
-
- let!(:job) do
- jobs.create!(
- commit_id: pipeline.id,
- project_id: project.id,
- status: :success,
- **artifacts_archive_attributes,
- **artifacts_metadata_attributes)
- end
-
- let(:artifacts_archive_attributes) do
- {
- artifacts_file: 'archive.zip',
- artifacts_file_store: file_store,
- artifacts_size: 123,
- artifacts_expire_at: artifacts_expire_at
- }
- end
-
- let(:artifacts_metadata_attributes) do
- {
- artifacts_metadata: 'metadata.gz',
- artifacts_metadata_store: file_store
- }
- end
-
- it 'has legacy artifacts' do
- expect(jobs.pluck('artifacts_file, artifacts_file_store, artifacts_size, artifacts_expire_at')).to eq([artifacts_archive_attributes.values])
- expect(jobs.pluck('artifacts_metadata, artifacts_metadata_store')).to eq([artifacts_metadata_attributes.values])
- end
-
- it 'does not have new artifacts yet' do
- expect(job_artifacts.count).to be_zero
- end
-
- context 'when the record exists inside of the range of a background migration' do
- let(:range) { [job.id, job.id] }
-
- it 'migrates a legacy artifact to ci_job_artifacts table' do
- expect { subject }.to change { job_artifacts.count }.by(2)
-
- expect(job_artifacts.order(:id).pluck('project_id, job_id, file_type, file_store, size, expire_at, file, file_sha256, file_location'))
- .to eq([[project.id,
- job.id,
- described_class::ARCHIVE_FILE_TYPE,
- file_store,
- artifacts_archive_attributes[:artifacts_size],
- artifacts_expire_at,
- 'archive.zip',
- nil,
- described_class::LEGACY_PATH_FILE_LOCATION],
- [project.id,
- job.id,
- described_class::METADATA_FILE_TYPE,
- file_store,
- nil,
- artifacts_expire_at,
- 'metadata.gz',
- nil,
- described_class::LEGACY_PATH_FILE_LOCATION]])
-
- expect(jobs.pluck('artifacts_file, artifacts_file_store, artifacts_size, artifacts_expire_at')).to eq([[nil, nil, nil, artifacts_expire_at]])
- expect(jobs.pluck('artifacts_metadata, artifacts_metadata_store')).to eq([[nil, nil]])
- end
-
- context 'when file_store is nil' do
- let(:file_store) { nil }
-
- it 'has nullified file_store in all legacy artifacts' do
- expect(jobs.pluck('artifacts_file_store, artifacts_metadata_store')).to eq([[nil, nil]])
- end
-
- it 'fills file_store by the value of local file store' do
- subject
-
- expect(job_artifacts.pluck('file_store')).to all(eq(::ObjectStorage::Store::LOCAL))
- end
- end
-
- context 'when new artifacts has already existed' do
- context 'when only archive.zip existed' do
- before do
- job_artifacts.create!(project_id: project.id, job_id: job.id, file_type: described_class::ARCHIVE_FILE_TYPE, size: 999, file: 'archive.zip')
- end
-
- it 'had archive.zip already' do
- expect(job_artifacts.exists?(job_id: job.id, file_type: described_class::ARCHIVE_FILE_TYPE)).to be_truthy
- end
-
- it 'migrates metadata' do
- expect { subject }.to change { job_artifacts.count }.by(1)
-
- expect(job_artifacts.exists?(job_id: job.id, file_type: described_class::METADATA_FILE_TYPE)).to be_truthy
- end
- end
-
- context 'when both archive and metadata existed' do
- before do
- job_artifacts.create!(project_id: project.id, job_id: job.id, file_type: described_class::ARCHIVE_FILE_TYPE, size: 999, file: 'archive.zip')
- job_artifacts.create!(project_id: project.id, job_id: job.id, file_type: described_class::METADATA_FILE_TYPE, size: 999, file: 'metadata.zip')
- end
-
- it 'does not migrate' do
- expect { subject }.not_to change { job_artifacts.count }
- end
- end
- end
- end
-
- context 'when the record exists outside of the range of a background migration' do
- let(:range) { [job.id + 1, job.id + 1] }
-
- it 'does not migrate' do
- expect { subject }.not_to change { job_artifacts.count }
- end
- end
- end
-
- context 'when the job does not have legacy artifacts' do
- let!(:job) { jobs.create!(commit_id: pipeline.id, project_id: project.id, status: :success) }
-
- it 'does not have the legacy artifacts in database' do
- expect(jobs.count).to eq(1)
- expect(jobs.pluck('artifacts_file, artifacts_file_store, artifacts_size, artifacts_expire_at')).to eq([[nil, nil, nil, nil]])
- expect(jobs.pluck('artifacts_metadata, artifacts_metadata_store')).to eq([[nil, nil]])
- end
-
- context 'when the record exists inside of the range of a background migration' do
- let(:range) { [job.id, job.id] }
-
- it 'does not migrate' do
- expect { subject }.not_to change { job_artifacts.count }
- end
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb b/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb
index ab183d01357..fc957a7c425 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: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20210301200959 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 b34a57f51f1..79b5567f5b3 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: 2021_02_26_120851 do
+RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210301200959 do
let(:enabled) { 20 }
let(:disabled) { 0 }
diff --git a/spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb b/spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
index 25006e663ab..68fe8f39f59 100644
--- a/spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_finding_uuid_for_vulnerability_feedback_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::PopulateFindingUuidForVulnerabilityFeedback, schema: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::PopulateFindingUuidForVulnerabilityFeedback, schema: 20210301200959 do
let(:namespaces) { table(:namespaces) }
let(:projects) { table(:projects) }
let(:users) { table(:users) }
diff --git a/spec/lib/gitlab/background_migration/populate_issue_email_participants_spec.rb b/spec/lib/gitlab/background_migration/populate_issue_email_participants_spec.rb
index a03a11489b5..b00eb185b34 100644
--- a/spec/lib/gitlab/background_migration/populate_issue_email_participants_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_issue_email_participants_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::PopulateIssueEmailParticipants, schema: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::PopulateIssueEmailParticipants, schema: 20210301200959 do
let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') }
let!(:project) { table(:projects).create!(id: 1, namespace_id: namespace.id) }
let!(:issue1) { table(:issues).create!(id: 1, project_id: project.id, service_desk_reply_to: "a@gitlab.com") }
diff --git a/spec/lib/gitlab/background_migration/remove_duplicate_services_spec.rb b/spec/lib/gitlab/background_migration/remove_duplicate_services_spec.rb
deleted file mode 100644
index afcdaaf1cb8..00000000000
--- a/spec/lib/gitlab/background_migration/remove_duplicate_services_spec.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::BackgroundMigration::RemoveDuplicateServices, :migration, schema: 20181228175414 do
- let_it_be(:users) { table(:users) }
- let_it_be(:namespaces) { table(:namespaces) }
- let_it_be(:projects) { table(:projects) }
- let_it_be(:services) { table(:services) }
-
- let_it_be(:alerts_service_data) { table(:alerts_service_data) }
- let_it_be(:chat_names) { table(:chat_names) }
- let_it_be(:issue_tracker_data) { table(:issue_tracker_data) }
- let_it_be(:jira_tracker_data) { table(:jira_tracker_data) }
- let_it_be(:open_project_tracker_data) { table(:open_project_tracker_data) }
- let_it_be(:slack_integrations) { table(:slack_integrations) }
- let_it_be(:web_hooks) { table(:web_hooks) }
-
- let_it_be(:data_tables) do
- [alerts_service_data, chat_names, issue_tracker_data, jira_tracker_data, open_project_tracker_data, slack_integrations, web_hooks]
- end
-
- let!(:user) { users.create!(id: 1, projects_limit: 100) }
- let!(:namespace) { namespaces.create!(id: 1, name: 'group', path: 'group') }
-
- # project without duplicate services
- let!(:project1) { projects.create!(id: 1, namespace_id: namespace.id) }
- let!(:service1) { services.create!(id: 1, project_id: project1.id, type: 'AsanaService') }
- let!(:service2) { services.create!(id: 2, project_id: project1.id, type: 'JiraService') }
- let!(:service3) { services.create!(id: 3, project_id: project1.id, type: 'SlackService') }
-
- # project with duplicate services
- let!(:project2) { projects.create!(id: 2, namespace_id: namespace.id) }
- let!(:service4) { services.create!(id: 4, project_id: project2.id, type: 'AsanaService') }
- let!(:service5) { services.create!(id: 5, project_id: project2.id, type: 'JiraService') }
- let!(:service6) { services.create!(id: 6, project_id: project2.id, type: 'JiraService') }
- let!(:service7) { services.create!(id: 7, project_id: project2.id, type: 'SlackService') }
- let!(:service8) { services.create!(id: 8, project_id: project2.id, type: 'SlackService') }
- let!(:service9) { services.create!(id: 9, project_id: project2.id, type: 'SlackService') }
-
- # project with duplicate services and dependant records
- let!(:project3) { projects.create!(id: 3, namespace_id: namespace.id) }
- let!(:service10) { services.create!(id: 10, project_id: project3.id, type: 'AlertsService') }
- let!(:service11) { services.create!(id: 11, project_id: project3.id, type: 'AlertsService') }
- let!(:service12) { services.create!(id: 12, project_id: project3.id, type: 'SlashCommandsService') }
- let!(:service13) { services.create!(id: 13, project_id: project3.id, type: 'SlashCommandsService') }
- let!(:service14) { services.create!(id: 14, project_id: project3.id, type: 'IssueTrackerService') }
- let!(:service15) { services.create!(id: 15, project_id: project3.id, type: 'IssueTrackerService') }
- let!(:service16) { services.create!(id: 16, project_id: project3.id, type: 'JiraService') }
- let!(:service17) { services.create!(id: 17, project_id: project3.id, type: 'JiraService') }
- let!(:service18) { services.create!(id: 18, project_id: project3.id, type: 'OpenProjectService') }
- let!(:service19) { services.create!(id: 19, project_id: project3.id, type: 'OpenProjectService') }
- let!(:service20) { services.create!(id: 20, project_id: project3.id, type: 'SlackService') }
- let!(:service21) { services.create!(id: 21, project_id: project3.id, type: 'SlackService') }
- let!(:dependant_records) do
- alerts_service_data.create!(id: 1, service_id: service10.id)
- alerts_service_data.create!(id: 2, service_id: service11.id)
- chat_names.create!(id: 1, service_id: service12.id, user_id: user.id, team_id: 'team1', chat_id: 'chat1')
- chat_names.create!(id: 2, service_id: service13.id, user_id: user.id, team_id: 'team2', chat_id: 'chat2')
- issue_tracker_data.create!(id: 1, service_id: service14.id)
- issue_tracker_data.create!(id: 2, service_id: service15.id)
- jira_tracker_data.create!(id: 1, service_id: service16.id)
- jira_tracker_data.create!(id: 2, service_id: service17.id)
- open_project_tracker_data.create!(id: 1, service_id: service18.id)
- open_project_tracker_data.create!(id: 2, service_id: service19.id)
- slack_integrations.create!(id: 1, service_id: service20.id, user_id: user.id, team_id: 'team1', team_name: 'team1', alias: 'alias1')
- slack_integrations.create!(id: 2, service_id: service21.id, user_id: user.id, team_id: 'team2', team_name: 'team2', alias: 'alias2')
- web_hooks.create!(id: 1, service_id: service20.id)
- web_hooks.create!(id: 2, service_id: service21.id)
- end
-
- # project without services
- let!(:project4) { projects.create!(id: 4, namespace_id: namespace.id) }
-
- it 'removes duplicate services and dependant records' do
- # Determine which services we expect to keep
- expected_services = projects.pluck(:id).each_with_object({}) do |project_id, map|
- project_services = services.where(project_id: project_id)
- types = project_services.distinct.pluck(:type)
-
- map[project_id] = types.map { |type| project_services.where(type: type).take!.id }
- end
-
- expect do
- subject.perform(project2.id, project3.id)
- end.to change { services.count }.from(21).to(12)
-
- services1 = services.where(project_id: project1.id)
- expect(services1.count).to be(3)
- expect(services1.pluck(:type)).to contain_exactly('AsanaService', 'JiraService', 'SlackService')
- expect(services1.pluck(:id)).to contain_exactly(*expected_services[project1.id])
-
- services2 = services.where(project_id: project2.id)
- expect(services2.count).to be(3)
- expect(services2.pluck(:type)).to contain_exactly('AsanaService', 'JiraService', 'SlackService')
- expect(services2.pluck(:id)).to contain_exactly(*expected_services[project2.id])
-
- services3 = services.where(project_id: project3.id)
- expect(services3.count).to be(6)
- expect(services3.pluck(:type)).to contain_exactly('AlertsService', 'SlashCommandsService', 'IssueTrackerService', 'JiraService', 'OpenProjectService', 'SlackService')
- expect(services3.pluck(:id)).to contain_exactly(*expected_services[project3.id])
-
- kept_services = expected_services.values.flatten
- data_tables.each do |table|
- expect(table.count).to be(1)
- expect(kept_services).to include(table.pluck(:service_id).first)
- end
- end
-
- it 'does not delete services without duplicates' do
- expect do
- subject.perform(project1.id, project4.id)
- end.not_to change { services.count }
- end
-
- it 'only deletes duplicate services for the current batch' do
- expect do
- subject.perform(project2.id)
- end.to change { services.count }.by(-3)
- end
-end
diff --git a/spec/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer_spec.rb b/spec/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer_spec.rb
index 5c197526a55..17fe25c7f71 100644
--- a/spec/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer_spec.rb
+++ b/spec/lib/gitlab/background_migration/wrongfully_confirmed_email_unconfirmer_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::WrongfullyConfirmedEmailUnconfirmer, schema: 20181228175414 do
+RSpec.describe Gitlab::BackgroundMigration::WrongfullyConfirmedEmailUnconfirmer, schema: 20210301200959 do
let(:users) { table(:users) }
let(:emails) { table(:emails) }
let(:user_synced_attributes_metadata) { table(:user_synced_attributes_metadata) }
diff --git a/spec/migrations/20210112143418_remove_duplicate_services2_spec.rb b/spec/migrations/20210112143418_remove_duplicate_services2_spec.rb
deleted file mode 100644
index b8dc4d7c8ae..00000000000
--- a/spec/migrations/20210112143418_remove_duplicate_services2_spec.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RemoveDuplicateServices2 do
- let_it_be(:namespaces) { table(:namespaces) }
- let_it_be(:projects) { table(:projects) }
- let_it_be(:services) { table(:services) }
-
- describe '#up' do
- before do
- stub_const("#{described_class}::BATCH_SIZE", 2)
-
- namespaces.create!(id: 1, name: 'group', path: 'group')
-
- projects.create!(id: 1, namespace_id: 1) # duplicate services
- projects.create!(id: 2, namespace_id: 1) # normal services
- projects.create!(id: 3, namespace_id: 1) # no services
- projects.create!(id: 4, namespace_id: 1) # duplicate services
- projects.create!(id: 5, namespace_id: 1) # duplicate services
-
- services.create!(id: 1, project_id: 1, type: 'JiraService')
- services.create!(id: 2, project_id: 1, type: 'JiraService')
- services.create!(id: 3, project_id: 2, type: 'JiraService')
- services.create!(id: 4, project_id: 4, type: 'AsanaService')
- services.create!(id: 5, project_id: 4, type: 'AsanaService')
- services.create!(id: 6, project_id: 4, type: 'JiraService')
- services.create!(id: 7, project_id: 4, type: 'JiraService')
- services.create!(id: 8, project_id: 4, type: 'SlackService')
- services.create!(id: 9, project_id: 4, type: 'SlackService')
- services.create!(id: 10, project_id: 5, type: 'JiraService')
- services.create!(id: 11, project_id: 5, type: 'JiraService')
-
- # Services without a project_id should be ignored
- services.create!(id: 12, type: 'JiraService')
- services.create!(id: 13, type: 'JiraService')
- end
-
- it 'schedules background jobs for all projects with duplicate services' do
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(2)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, 1, 4)
- expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, 5)
- end
- end
- end
- end
-end
diff --git a/spec/migrations/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value_spec.rb b/spec/migrations/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value_spec.rb
deleted file mode 100644
index e07b5a48909..00000000000
--- a/spec/migrations/20210119122354_alter_vsa_issue_first_mentioned_in_commit_value_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AlterVsaIssueFirstMentionedInCommitValue, schema: 20210114033715 do
- let(:group_stages) { table(:analytics_cycle_analytics_group_stages) }
- let(:value_streams) { table(:analytics_cycle_analytics_group_value_streams) }
- let(:namespaces) { table(:namespaces) }
-
- let(:namespace) { namespaces.create!(id: 1, name: 'group', path: 'group') }
- let(:value_stream) { value_streams.create!(name: 'test', group_id: namespace.id) }
-
- let!(:stage_1) { group_stages.create!(group_value_stream_id: value_stream.id, group_id: namespace.id, name: 'stage 1', start_event_identifier: described_class::ISSUE_FIRST_MENTIONED_IN_COMMIT_EE, end_event_identifier: 1) }
- let!(:stage_2) { group_stages.create!(group_value_stream_id: value_stream.id, group_id: namespace.id, name: 'stage 2', start_event_identifier: 2, end_event_identifier: described_class::ISSUE_FIRST_MENTIONED_IN_COMMIT_EE) }
- let!(:stage_3) { group_stages.create!(group_value_stream_id: value_stream.id, group_id: namespace.id, name: 'stage 3', start_event_identifier: described_class::ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS, end_event_identifier: 3) }
-
- describe '#up' do
- it 'changes the EE specific identifier values to the FOSS version' do
- migrate!
-
- expect(stage_1.reload.start_event_identifier).to eq(described_class::ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS)
- expect(stage_2.reload.end_event_identifier).to eq(described_class::ISSUE_FIRST_MENTIONED_IN_COMMIT_FOSS)
- end
-
- it 'does not change irrelevant records' do
- expect { migrate! }.not_to change { stage_3.reload }
- end
- end
-end
diff --git a/spec/migrations/20210205174154_remove_bad_dependency_proxy_manifests_spec.rb b/spec/migrations/20210205174154_remove_bad_dependency_proxy_manifests_spec.rb
deleted file mode 100644
index 97438062458..00000000000
--- a/spec/migrations/20210205174154_remove_bad_dependency_proxy_manifests_spec.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RemoveBadDependencyProxyManifests, schema: 20210128140157 do
- let_it_be(:namespaces) { table(:namespaces) }
- let_it_be(:dependency_proxy_manifests) { table(:dependency_proxy_manifests) }
- let_it_be(:group) { namespaces.create!(type: 'Group', name: 'test', path: 'test') }
-
- let_it_be(:dependency_proxy_manifest_with_content_type) do
- dependency_proxy_manifests.create!(group_id: group.id, file: 'foo', file_name: 'foo', digest: 'asdf1234', content_type: 'content-type' )
- end
-
- let_it_be(:dependency_proxy_manifest_without_content_type) do
- dependency_proxy_manifests.create!(group_id: group.id, file: 'bar', file_name: 'bar', digest: 'fdsa6789')
- end
-
- it 'removes the dependency_proxy_manifests with a content_type', :aggregate_failures do
- expect(dependency_proxy_manifest_with_content_type).to be_present
- expect(dependency_proxy_manifest_without_content_type).to be_present
-
- expect { migrate! }.to change { dependency_proxy_manifests.count }.from(2).to(1)
-
- expect(dependency_proxy_manifests.where.not(content_type: nil)).to be_empty
- expect(dependency_proxy_manifest_without_content_type.reload).to be_present
- end
-end
diff --git a/spec/migrations/20210210093901_backfill_updated_at_after_repository_storage_move_spec.rb b/spec/migrations/20210210093901_backfill_updated_at_after_repository_storage_move_spec.rb
deleted file mode 100644
index 4a31d36e2bc..00000000000
--- a/spec/migrations/20210210093901_backfill_updated_at_after_repository_storage_move_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe BackfillUpdatedAtAfterRepositoryStorageMove, :sidekiq do
- let_it_be(:projects) { table(:projects) }
- let_it_be(:project_repository_storage_moves) { table(:project_repository_storage_moves) }
- let_it_be(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') }
-
- describe '#up' do
- it 'schedules background jobs for all distinct projects in batches' do
- stub_const("#{described_class}::BATCH_SIZE", 3)
-
- project_1 = projects.create!(id: 1, namespace_id: namespace.id)
- project_2 = projects.create!(id: 2, namespace_id: namespace.id)
- project_3 = projects.create!(id: 3, namespace_id: namespace.id)
- project_4 = projects.create!(id: 4, namespace_id: namespace.id)
- project_5 = projects.create!(id: 5, namespace_id: namespace.id)
- project_6 = projects.create!(id: 6, namespace_id: namespace.id)
- project_7 = projects.create!(id: 7, namespace_id: namespace.id)
- projects.create!(id: 8, namespace_id: namespace.id)
-
- project_repository_storage_moves.create!(id: 1, project_id: project_1.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 2, project_id: project_1.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 3, project_id: project_2.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 4, project_id: project_3.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 5, project_id: project_3.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 6, project_id: project_4.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 7, project_id: project_4.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 8, project_id: project_5.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 9, project_id: project_6.id, source_storage_name: 'default', destination_storage_name: 'default')
- project_repository_storage_moves.create!(id: 10, project_id: project_7.id, source_storage_name: 'default', destination_storage_name: 'default')
-
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(3)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(2.minutes, 1, 2, 3)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(4.minutes, 4, 5, 6)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(6.minutes, 7)
- end
- end
- end
- end
-end
diff --git a/spec/migrations/20210218040814_add_environment_scope_to_group_variables_spec.rb b/spec/migrations/20210218040814_add_environment_scope_to_group_variables_spec.rb
deleted file mode 100644
index 039ce53cac4..00000000000
--- a/spec/migrations/20210218040814_add_environment_scope_to_group_variables_spec.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe AddEnvironmentScopeToGroupVariables do
- let(:migration) { described_class.new }
- let(:ci_group_variables) { table(:ci_group_variables) }
- let(:group) { table(:namespaces).create!(name: 'group', path: 'group') }
-
- def create_variable!(group, key:, environment_scope: '*')
- table(:ci_group_variables).create!(
- group_id: group.id,
- key: key,
- environment_scope: environment_scope
- )
- end
-
- describe '#down' do
- context 'group has variables with duplicate keys' do
- it 'deletes all but the first record' do
- migration.up
-
- remaining_variable = create_variable!(group, key: 'key')
- create_variable!(group, key: 'key', environment_scope: 'staging')
- create_variable!(group, key: 'key', environment_scope: 'production')
-
- migration.down
-
- expect(ci_group_variables.pluck(:id)).to eq [remaining_variable.id]
- end
- end
-
- context 'group does not have variables with duplicate keys' do
- it 'does not delete any records' do
- migration.up
-
- create_variable!(group, key: 'key')
- create_variable!(group, key: 'staging')
- create_variable!(group, key: 'production')
-
- expect { migration.down }.not_to change { ci_group_variables.count }
- end
- end
- end
-end
diff --git a/spec/migrations/20210226141517_dedup_issue_metrics_spec.rb b/spec/migrations/20210226141517_dedup_issue_metrics_spec.rb
deleted file mode 100644
index 1b57bf0431f..00000000000
--- a/spec/migrations/20210226141517_dedup_issue_metrics_spec.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DedupIssueMetrics, :migration, schema: 20210205104425 do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:issues) { table(:issues) }
- let(:metrics) { table(:issue_metrics) }
- let(:issue_params) { { title: 'title', project_id: project.id } }
-
- let!(:namespace) { namespaces.create!(name: 'foo', path: 'foo') }
- let!(:project) { projects.create!(namespace_id: namespace.id) }
- let!(:issue_1) { issues.create!(issue_params) }
- let!(:issue_2) { issues.create!(issue_params) }
- let!(:issue_3) { issues.create!(issue_params) }
-
- let!(:duplicated_metrics_1) { metrics.create!(issue_id: issue_1.id, first_mentioned_in_commit_at: 1.day.ago, first_added_to_board_at: 5.days.ago, updated_at: 2.months.ago) }
- let!(:duplicated_metrics_2) { metrics.create!(issue_id: issue_1.id, first_mentioned_in_commit_at: Time.now, first_associated_with_milestone_at: Time.now, updated_at: 1.month.ago) }
-
- let!(:duplicated_metrics_3) { metrics.create!(issue_id: issue_3.id, first_mentioned_in_commit_at: 1.day.ago, updated_at: 2.months.ago) }
- let!(:duplicated_metrics_4) { metrics.create!(issue_id: issue_3.id, first_added_to_board_at: 1.day.ago, updated_at: 1.month.ago) }
-
- let!(:non_duplicated_metrics) { metrics.create!(issue_id: issue_2.id, first_added_to_board_at: 2.days.ago) }
-
- it 'deduplicates issue_metrics table' do
- expect { migrate! }.to change { metrics.count }.from(5).to(3)
- end
-
- it 'merges `duplicated_metrics_1` with `duplicated_metrics_2`' do
- migrate!
-
- expect(metrics.where(id: duplicated_metrics_1.id)).not_to exist
-
- merged_metrics = metrics.find_by(id: duplicated_metrics_2.id)
-
- expect(merged_metrics).to be_present
- expect(merged_metrics.first_mentioned_in_commit_at).to be_like_time(duplicated_metrics_2.first_mentioned_in_commit_at)
- expect(merged_metrics.first_added_to_board_at).to be_like_time(duplicated_metrics_1.first_added_to_board_at)
- end
-
- it 'merges `duplicated_metrics_3` with `duplicated_metrics_4`' do
- migrate!
-
- expect(metrics.where(id: duplicated_metrics_3.id)).not_to exist
-
- merged_metrics = metrics.find_by(id: duplicated_metrics_4.id)
-
- expect(merged_metrics).to be_present
- expect(merged_metrics.first_mentioned_in_commit_at).to be_like_time(duplicated_metrics_3.first_mentioned_in_commit_at)
- expect(merged_metrics.first_added_to_board_at).to be_like_time(duplicated_metrics_4.first_added_to_board_at)
- end
-
- it 'does not change non duplicated records' do
- expect { migrate! }.not_to change { non_duplicated_metrics.reload.attributes }
- end
-
- it 'does nothing when there are no metrics' do
- metrics.delete_all
-
- migrate!
-
- expect(metrics.count).to eq(0)
- end
-end
diff --git a/spec/migrations/add_has_external_issue_tracker_trigger_spec.rb b/spec/migrations/add_has_external_issue_tracker_trigger_spec.rb
deleted file mode 100644
index 72983c7cfbf..00000000000
--- a/spec/migrations/add_has_external_issue_tracker_trigger_spec.rb
+++ /dev/null
@@ -1,164 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddHasExternalIssueTrackerTrigger do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:services) { table(:services) }
-
- before do
- @namespace = namespaces.create!(name: 'foo', path: 'foo')
- @project = projects.create!(namespace_id: @namespace.id)
- end
-
- describe '#up' do
- before do
- migrate!
- end
-
- describe 'INSERT trigger' do
- it 'sets `has_external_issue_tracker` to true when active `issue_tracker` is inserted' do
- expect do
- services.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 service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
-
- expect do
- services.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
- services.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 service is inserted' do
- expect do
- services.create!(category: 'my_type', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-
- describe 'UPDATE trigger' do
- it 'sets `has_external_issue_tracker` to true when `issue_tracker` is made active' do
- service = services.create!(category: 'issue_tracker', active: false, project_id: @project.id)
-
- expect do
- service.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
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.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
- services.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.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
- services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.update!(active: false)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not change `has_external_issue_tracker` when service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = services.create!(category: 'issue_tracker', active: false, project_id: different_project.id)
-
- expect do
- service.update!(active: true)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-
- describe 'DELETE trigger' do
- it 'sets `has_external_issue_tracker` to false when `issue_tracker` is deleted' do
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.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
- services.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.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
- services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
-
- expect do
- service.delete
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'does not change `has_external_issue_tracker` when service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = services.create!(category: 'issue_tracker', active: true, project_id: different_project.id)
-
- expect do
- service.delete
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
- end
-
- describe '#down' do
- before do
- migration.up
- migration.down
- end
-
- it 'drops the INSERT trigger' do
- expect do
- services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'drops the UPDATE trigger' do
- service = services.create!(category: 'issue_tracker', active: false, project_id: @project.id)
- @project.update!(has_external_issue_tracker: false)
-
- expect do
- service.update!(active: true)
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
-
- it 'drops the DELETE trigger' do
- service = services.create!(category: 'issue_tracker', active: true, project_id: @project.id)
- @project.update!(has_external_issue_tracker: true)
-
- expect do
- service.delete
- end.not_to change { @project.reload.has_external_issue_tracker }
- end
- end
-end
diff --git a/spec/migrations/add_has_external_wiki_trigger_spec.rb b/spec/migrations/add_has_external_wiki_trigger_spec.rb
deleted file mode 100644
index 10c6888c87e..00000000000
--- a/spec/migrations/add_has_external_wiki_trigger_spec.rb
+++ /dev/null
@@ -1,128 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddHasExternalWikiTrigger do
- let(:migration) { described_class.new }
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:services) { table(:services) }
-
- before do
- @namespace = namespaces.create!(name: 'foo', path: 'foo')
- @project = projects.create!(namespace_id: @namespace.id)
- end
-
- describe '#up' do
- before do
- migrate!
- end
-
- describe 'INSERT trigger' do
- it 'sets `has_external_wiki` to true when active `ExternalWikiService` is inserted' do
- expect do
- services.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 service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
-
- expect do
- services.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
- services.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 service is inserted' do
- expect do
- services.create!(type: 'MyService', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
-
- describe 'UPDATE trigger' do
- it 'sets `has_external_wiki` to true when `ExternalWikiService` is made active' do
- service = services.create!(type: 'ExternalWikiService', active: false, project_id: @project.id)
-
- expect do
- service.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
- service = services.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
-
- expect do
- service.update!(active: false)
- end.to change { @project.reload.has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = services.create!(type: 'ExternalWikiService', active: false, project_id: different_project.id)
-
- expect do
- service.update!(active: true)
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
-
- describe 'DELETE trigger' do
- it 'sets `has_external_wiki` to false when `ExternalWikiService` is deleted' do
- service = services.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
-
- expect do
- service.delete
- end.to change { @project.reload.has_external_wiki }.to(false)
- end
-
- it 'does not change `has_external_wiki` when service is for a different project' do
- different_project = projects.create!(namespace_id: @namespace.id)
- service = services.create!(type: 'ExternalWikiService', active: true, project_id: different_project.id)
-
- expect do
- service.delete
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
- end
-
- describe '#down' do
- before do
- migration.up
- migration.down
- end
-
- it 'drops the INSERT trigger' do
- expect do
- services.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
- end.not_to change { @project.reload.has_external_wiki }
- end
-
- it 'drops the UPDATE trigger' do
- service = services.create!(type: 'ExternalWikiService', active: false, project_id: @project.id)
- @project.update!(has_external_wiki: false)
-
- expect do
- service.update!(active: true)
- end.not_to change { @project.reload.has_external_wiki }
- end
-
- it 'drops the DELETE trigger' do
- service = services.create!(type: 'ExternalWikiService', active: true, project_id: @project.id)
- @project.update!(has_external_wiki: true)
-
- expect do
- service.delete
- end.not_to change { @project.reload.has_external_wiki }
- end
- end
-end
diff --git a/spec/migrations/add_new_post_eoa_plans_spec.rb b/spec/migrations/add_new_post_eoa_plans_spec.rb
deleted file mode 100644
index 02360d5a12d..00000000000
--- a/spec/migrations/add_new_post_eoa_plans_spec.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe AddNewPostEoaPlans do
- let(:plans) { table(:plans) }
-
- subject(:migration) { described_class.new }
-
- describe '#up' do
- it 'creates the two new records' do
- expect { migration.up }.to change { plans.count }.by(2)
-
- new_plans = plans.last(2)
- expect(new_plans.map(&:name)).to contain_exactly('premium', 'ultimate')
- end
- end
-
- describe '#down' do
- it 'removes these two new records' do
- plans.create!(name: 'premium', title: 'Premium (Formerly Silver)')
- plans.create!(name: 'ultimate', title: 'Ultimate (Formerly Gold)')
-
- expect { migration.down }.to change { plans.count }.by(-2)
-
- expect(plans.find_by(name: 'premium')).to be_nil
- expect(plans.find_by(name: 'ultimate')).to be_nil
- end
- end
-end
diff --git a/spec/migrations/cleanup_projects_with_bad_has_external_issue_tracker_data_spec.rb b/spec/migrations/cleanup_projects_with_bad_has_external_issue_tracker_data_spec.rb
deleted file mode 100644
index 8aedd1f9607..00000000000
--- a/spec/migrations/cleanup_projects_with_bad_has_external_issue_tracker_data_spec.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe CleanupProjectsWithBadHasExternalIssueTrackerData, :migration do
- let(:namespace) { table(:namespaces).create!(name: 'foo', path: 'bar') }
- let(:projects) { table(:projects) }
- let(:services) { table(:services) }
-
- def create_projects!(num)
- Array.new(num) do
- projects.create!(namespace_id: namespace.id)
- end
- end
-
- def create_active_external_issue_tracker_integrations!(*projects)
- projects.each do |project|
- services.create!(category: 'issue_tracker', project_id: project.id, active: true)
- end
- end
-
- def create_disabled_external_issue_tracker_integrations!(*projects)
- projects.each do |project|
- services.create!(category: 'issue_tracker', project_id: project.id, active: false)
- end
- end
-
- def create_active_other_integrations!(*projects)
- projects.each do |project|
- services.create!(category: 'not_an_issue_tracker', project_id: project.id, active: true)
- end
- end
-
- it 'sets `projects.has_external_issue_tracker` correctly' do
- allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false)
-
- project_with_an_external_issue_tracker_1,
- project_with_an_external_issue_tracker_2,
- project_with_only_a_disabled_external_issue_tracker_1,
- project_with_only_a_disabled_external_issue_tracker_2,
- project_without_any_external_issue_trackers_1,
- project_without_any_external_issue_trackers_2 = create_projects!(6)
-
- create_active_external_issue_tracker_integrations!(
- project_with_an_external_issue_tracker_1,
- project_with_an_external_issue_tracker_2
- )
-
- create_disabled_external_issue_tracker_integrations!(
- project_with_an_external_issue_tracker_1,
- project_with_an_external_issue_tracker_2,
- project_with_only_a_disabled_external_issue_tracker_1,
- project_with_only_a_disabled_external_issue_tracker_2
- )
-
- create_active_other_integrations!(
- project_with_an_external_issue_tracker_1,
- project_with_an_external_issue_tracker_2,
- project_without_any_external_issue_trackers_1,
- project_without_any_external_issue_trackers_2
- )
-
- # PG triggers on the services table added in
- # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51852 will have set
- # the `has_external_issue_tracker` columns to correct data when the services
- # records were created above.
- #
- # We set the `has_external_issue_tracker` columns for projects to incorrect
- # data manually below to emulate projects in a state before the PG
- # triggers were added.
- project_with_an_external_issue_tracker_2.update!(has_external_issue_tracker: false)
- project_with_only_a_disabled_external_issue_tracker_2.update!(has_external_issue_tracker: true)
- project_without_any_external_issue_trackers_2.update!(has_external_issue_tracker: true)
-
- migrate!
-
- expected_true = [
- project_with_an_external_issue_tracker_1,
- project_with_an_external_issue_tracker_2
- ].each(&:reload).map(&:has_external_issue_tracker)
-
- expected_not_true = [
- project_without_any_external_issue_trackers_1,
- project_without_any_external_issue_trackers_2,
- project_with_only_a_disabled_external_issue_tracker_1,
- project_with_only_a_disabled_external_issue_tracker_2
- ].each(&:reload).map(&:has_external_issue_tracker)
-
- expect(expected_true).to all(eq(true))
- expect(expected_not_true).to all(be_falsey)
- end
-end
diff --git a/spec/migrations/cleanup_projects_with_bad_has_external_wiki_data_spec.rb b/spec/migrations/cleanup_projects_with_bad_has_external_wiki_data_spec.rb
deleted file mode 100644
index ee1f718849f..00000000000
--- a/spec/migrations/cleanup_projects_with_bad_has_external_wiki_data_spec.rb
+++ /dev/null
@@ -1,89 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe CleanupProjectsWithBadHasExternalWikiData, :migration do
- let(:namespace) { table(:namespaces).create!(name: 'foo', path: 'bar') }
- let(:projects) { table(:projects) }
- let(:services) { table(:services) }
-
- def create_projects!(num)
- Array.new(num) do
- projects.create!(namespace_id: namespace.id)
- end
- end
-
- def create_active_external_wiki_integrations!(*projects)
- projects.each do |project|
- services.create!(type: 'ExternalWikiService', project_id: project.id, active: true)
- end
- end
-
- def create_disabled_external_wiki_integrations!(*projects)
- projects.each do |project|
- services.create!(type: 'ExternalWikiService', project_id: project.id, active: false)
- end
- end
-
- def create_active_other_integrations!(*projects)
- projects.each do |project|
- services.create!(type: 'NotAnExternalWikiService', project_id: project.id, active: true)
- end
- end
-
- it 'sets `projects.has_external_wiki` correctly' do
- allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false)
-
- project_with_external_wiki_1,
- project_with_external_wiki_2,
- project_with_disabled_external_wiki_1,
- project_with_disabled_external_wiki_2,
- project_without_external_wiki_1,
- project_without_external_wiki_2 = create_projects!(6)
-
- create_active_external_wiki_integrations!(
- project_with_external_wiki_1,
- project_with_external_wiki_2
- )
-
- create_disabled_external_wiki_integrations!(
- project_with_disabled_external_wiki_1,
- project_with_disabled_external_wiki_2
- )
-
- create_active_other_integrations!(
- project_without_external_wiki_1,
- project_without_external_wiki_2
- )
-
- # PG triggers on the services table added in a previous migration
- # will have set the `has_external_wiki` columns to correct data when
- # the services records were created above.
- #
- # We set the `has_external_wiki` columns for projects to incorrect
- # data manually below to emulate projects in a state before the PG
- # triggers were added.
- project_with_external_wiki_2.update!(has_external_wiki: false)
- project_with_disabled_external_wiki_2.update!(has_external_wiki: true)
- project_without_external_wiki_2.update!(has_external_wiki: true)
-
- migrate!
-
- expected_true = [
- project_with_external_wiki_1,
- project_with_external_wiki_2
- ].each(&:reload).map(&:has_external_wiki)
-
- expected_not_true = [
- project_without_external_wiki_1,
- project_without_external_wiki_2,
- project_with_disabled_external_wiki_1,
- project_with_disabled_external_wiki_2
- ].each(&:reload).map(&:has_external_wiki)
-
- expect(expected_true).to all(eq(true))
- expect(expected_not_true).to all(be_falsey)
- end
-end
diff --git a/spec/migrations/drop_alerts_service_data_spec.rb b/spec/migrations/drop_alerts_service_data_spec.rb
deleted file mode 100644
index 06382132952..00000000000
--- a/spec/migrations/drop_alerts_service_data_spec.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe DropAlertsServiceData do
- let_it_be(:alerts_service_data) { table(:alerts_service_data) }
-
- it 'correctly migrates up and down' do
- reversible_migration do |migration|
- migration.before -> {
- expect(alerts_service_data.create!(service_id: 1)).to be_a alerts_service_data
- }
-
- migration.after -> {
- expect { alerts_service_data.create!(service_id: 1) }
- .to raise_error(ActiveRecord::StatementInvalid, /UndefinedTable/)
- }
- end
- end
-end
diff --git a/spec/migrations/migrate_delayed_project_removal_from_namespaces_to_namespace_settings_spec.rb b/spec/migrations/migrate_delayed_project_removal_from_namespaces_to_namespace_settings_spec.rb
deleted file mode 100644
index 0f45cc842ef..00000000000
--- a/spec/migrations/migrate_delayed_project_removal_from_namespaces_to_namespace_settings_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe MigrateDelayedProjectRemovalFromNamespacesToNamespaceSettings, :migration do
- let(:namespaces) { table(:namespaces) }
- let(:namespace_settings) { table(:namespace_settings) }
-
- let!(:namespace_wo_settings) { namespaces.create!(name: generate(:name), path: generate(:name), delayed_project_removal: true) }
- let!(:namespace_wo_settings_delay_false) { namespaces.create!(name: generate(:name), path: generate(:name), delayed_project_removal: false) }
- let!(:namespace_w_settings_delay_true) { namespaces.create!(name: generate(:name), path: generate(:name), delayed_project_removal: true) }
- let!(:namespace_w_settings_delay_false) { namespaces.create!(name: generate(:name), path: generate(:name), delayed_project_removal: false) }
-
- let!(:namespace_settings_delay_true) { namespace_settings.create!(namespace_id: namespace_w_settings_delay_true.id, delayed_project_removal: false, created_at: DateTime.now, updated_at: DateTime.now) }
- let!(:namespace_settings_delay_false) { namespace_settings.create!(namespace_id: namespace_w_settings_delay_false.id, delayed_project_removal: false, created_at: DateTime.now, updated_at: DateTime.now) }
-
- it 'migrates delayed_project_removal to namespace_settings' do
- disable_migrations_output { migrate! }
-
- expect(namespace_settings.count).to eq(3)
-
- expect(namespace_settings.find_by(namespace_id: namespace_wo_settings.id).delayed_project_removal).to eq(true)
- expect(namespace_settings.find_by(namespace_id: namespace_wo_settings_delay_false.id)).to be_nil
-
- expect(namespace_settings_delay_true.reload.delayed_project_removal).to eq(true)
- expect(namespace_settings_delay_false.reload.delayed_project_removal).to eq(false)
- end
-end
diff --git a/spec/migrations/remove_alerts_service_records_again_spec.rb b/spec/migrations/remove_alerts_service_records_again_spec.rb
deleted file mode 100644
index 94d3e957b6a..00000000000
--- a/spec/migrations/remove_alerts_service_records_again_spec.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RemoveAlertsServiceRecordsAgain do
- let(:services) { table(:services) }
-
- before do
- 5.times { services.create!(type: 'AlertsService') }
- services.create!(type: 'SomeOtherType')
- end
-
- it 'removes services records of type AlertsService and corresponding data', :aggregate_failures do
- expect(services.count).to eq(6)
-
- migrate!
-
- expect(services.count).to eq(1)
- expect(services.first.type).to eq('SomeOtherType')
- expect(services.where(type: 'AlertsService')).to be_empty
- end
-end
diff --git a/spec/migrations/remove_alerts_service_records_spec.rb b/spec/migrations/remove_alerts_service_records_spec.rb
deleted file mode 100644
index 83f440f8e17..00000000000
--- a/spec/migrations/remove_alerts_service_records_spec.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe RemoveAlertsServiceRecords do
- let(:services) { table(:services) }
- let(:alerts_service_data) { table(:alerts_service_data) }
-
- before do
- 5.times do
- service = services.create!(type: 'AlertsService')
- alerts_service_data.create!(service_id: service.id)
- end
-
- services.create!(type: 'SomeOtherType')
- end
-
- it 'removes services records of type AlertsService and corresponding data', :aggregate_failures do
- expect(services.count).to eq(6)
- expect(alerts_service_data.count).to eq(5)
-
- migrate!
-
- expect(services.count).to eq(1)
- expect(services.first.type).to eq('SomeOtherType')
- expect(services.where(type: 'AlertsService')).to be_empty
- expect(alerts_service_data.all).to be_empty
- end
-end
diff --git a/spec/migrations/reschedule_artifact_expiry_backfill_spec.rb b/spec/migrations/reschedule_artifact_expiry_backfill_spec.rb
deleted file mode 100644
index c06ce3d5bea..00000000000
--- a/spec/migrations/reschedule_artifact_expiry_backfill_spec.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-require_migration!
-
-RSpec.describe RescheduleArtifactExpiryBackfill, :migration do
- let(:migration_class) { Gitlab::BackgroundMigration::BackfillArtifactExpiryDate }
- let(:migration_name) { migration_class.to_s.demodulize }
-
- before do
- table(:namespaces).create!(id: 123, name: 'test_namespace', path: 'test_namespace')
- table(:projects).create!(id: 123, name: 'sample_project', path: 'sample_project', namespace_id: 123)
- end
-
- it 'correctly schedules background migrations' do
- first_artifact = create_artifact(job_id: 0, expire_at: nil, created_at: Date.new(2020, 06, 21))
- second_artifact = create_artifact(job_id: 1, expire_at: nil, created_at: Date.new(2020, 06, 21))
- create_artifact(job_id: 2, expire_at: Date.yesterday, created_at: Date.new(2020, 06, 21))
- create_artifact(job_id: 3, expire_at: nil, created_at: Date.new(2020, 06, 23))
-
- Sidekiq::Testing.fake! do
- freeze_time do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to eq(1)
- expect(migration_name).to be_scheduled_migration_with_multiple_args(first_artifact.id, second_artifact.id)
- end
- end
- end
-
- private
-
- def create_artifact(params)
- table(:ci_builds).create!(id: params[:job_id], project_id: 123)
- table(:ci_job_artifacts).create!(project_id: 123, file_type: 1, **params)
- end
-end
diff --git a/spec/migrations/schedule_migrate_pages_to_zip_storage_spec.rb b/spec/migrations/schedule_migrate_pages_to_zip_storage_spec.rb
index 29e4cf05c2b..52bbd5b4f6e 100644
--- a/spec/migrations/schedule_migrate_pages_to_zip_storage_spec.rb
+++ b/spec/migrations/schedule_migrate_pages_to_zip_storage_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
require_migration!
-RSpec.describe ScheduleMigratePagesToZipStorage, :sidekiq_might_not_need_inline, schema: 20201231133921 do
+RSpec.describe ScheduleMigratePagesToZipStorage, :sidekiq_might_not_need_inline, schema: 20210301200959 do
let(:migration_class) { described_class::MIGRATION }
let(:migration_name) { migration_class.to_s.demodulize }
diff --git a/spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb b/spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb
deleted file mode 100644
index d8bdefd5546..00000000000
--- a/spec/migrations/schedule_populate_finding_uuid_for_vulnerability_feedback_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-require_migration!
-
-RSpec.describe SchedulePopulateFindingUuidForVulnerabilityFeedback do
- let(:namespaces) { table(:namespaces) }
- let(:projects) { table(:projects) }
- let(:users) { table(:users) }
- let(:vulnerability_feedback) { table(:vulnerability_feedback) }
-
- let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') }
- let(:project) { projects.create!(namespace_id: namespace.id, name: 'foo') }
- let(:user) { users.create!(username: 'john.doe', projects_limit: 1) }
-
- let(:common_feedback_params) { { feedback_type: 0, category: 0, project_id: project.id, author_id: user.id } }
- let!(:feedback_1) { vulnerability_feedback.create!(**common_feedback_params, project_fingerprint: 'foo') }
- let!(:feedback_2) { vulnerability_feedback.create!(**common_feedback_params, project_fingerprint: 'bar') }
- let!(:feedback_3) { vulnerability_feedback.create!(**common_feedback_params, project_fingerprint: 'zoo', finding_uuid: SecureRandom.uuid) }
-
- around do |example|
- freeze_time { Sidekiq::Testing.fake! { example.run } }
- end
-
- before do
- stub_const("#{described_class.name}::BATCH_SIZE", 1)
- end
-
- it 'schedules the background jobs', :aggregate_failures do
- migrate!
-
- expect(BackgroundMigrationWorker.jobs.size).to be(3)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(2.minutes, feedback_1.id, feedback_1.id)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(4.minutes, feedback_2.id, feedback_2.id)
- expect(described_class::MIGRATION_CLASS).to be_scheduled_delayed_migration(6.minutes, feedback_3.id, feedback_3.id)
- end
-end
diff --git a/spec/models/customer_relations/contact_spec.rb b/spec/models/customer_relations/contact_spec.rb
index 860dcb1f4d7..1225f9d089b 100644
--- a/spec/models/customer_relations/contact_spec.rb
+++ b/spec/models/customer_relations/contact_spec.rb
@@ -75,20 +75,27 @@ RSpec.describe CustomerRelations::Contact, type: :model do
let_it_be(:other_contacts) { create_list(:contact, 2) }
it 'returns ids of contacts from group' do
- contact_ids = described_class.find_ids_by_emails(group.id, group_contacts.pluck(:email))
+ contact_ids = described_class.find_ids_by_emails(group, group_contacts.pluck(:email))
+
+ expect(contact_ids).to match_array(group_contacts.pluck(:id))
+ end
+
+ it 'returns ids of contacts from parent group' do
+ subgroup = create(:group, parent: group)
+ contact_ids = described_class.find_ids_by_emails(subgroup, group_contacts.pluck(:email))
expect(contact_ids).to match_array(group_contacts.pluck(:id))
end
it 'does not return ids of contacts from other groups' do
- contact_ids = described_class.find_ids_by_emails(group.id, other_contacts.pluck(:email))
+ contact_ids = described_class.find_ids_by_emails(group, other_contacts.pluck(:email))
expect(contact_ids).to be_empty
end
it 'raises ArgumentError when called with too many emails' do
too_many_emails = described_class::MAX_PLUCK + 1
- expect { described_class.find_ids_by_emails(group.id, Array(0..too_many_emails)) }.to raise_error(ArgumentError)
+ expect { described_class.find_ids_by_emails(group, Array(0..too_many_emails)) }.to raise_error(ArgumentError)
end
end
end
diff --git a/spec/models/customer_relations/issue_contact_spec.rb b/spec/models/customer_relations/issue_contact_spec.rb
index 474455a9884..c6373fddbfb 100644
--- a/spec/models/customer_relations/issue_contact_spec.rb
+++ b/spec/models/customer_relations/issue_contact_spec.rb
@@ -5,7 +5,8 @@ require 'spec_helper'
RSpec.describe CustomerRelations::IssueContact do
let_it_be(:issue_contact, reload: true) { create(:issue_customer_relations_contact) }
let_it_be(:group) { create(:group) }
- let_it_be(:project) { create(:project, group: group) }
+ let_it_be(:subgroup) { create(:group, parent: group) }
+ let_it_be(:project) { create(:project, group: subgroup) }
let_it_be(:issue) { create(:issue, project: project) }
subject { issue_contact }
@@ -33,17 +34,29 @@ RSpec.describe CustomerRelations::IssueContact do
end
it 'builds using the same group', :aggregate_failures do
- expect(for_issue.contact.group).to eq(group)
+ expect(for_issue.contact.group).to eq(subgroup)
expect(for_contact.issue.project.group).to eq(group)
end
end
describe 'validation' do
- let(:built) { build(:issue_customer_relations_contact, issue: create(:issue), contact: create(:contact)) }
+ it 'fails when the contact group does not belong to the issue group or ancestors' do
+ built = build(:issue_customer_relations_contact, issue: create(:issue), contact: create(:contact))
- it 'fails when the contact group does not match the issue group' do
expect(built).not_to be_valid
end
+
+ it 'succeeds when the contact group is the same as the issue group' do
+ built = build(:issue_customer_relations_contact, issue: create(:issue, project: project), contact: create(:contact, group: subgroup))
+
+ expect(built).to be_valid
+ end
+
+ it 'succeeds when the contact group is an ancestor of the issue group' do
+ built = build(:issue_customer_relations_contact, issue: create(:issue, project: project), contact: create(:contact, group: group))
+
+ expect(built).to be_valid
+ end
end
describe '#self.find_contact_ids_by_emails' do
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 0d4ae19a890..674aca0a37b 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -1398,7 +1398,7 @@ RSpec.describe User do
end
describe '#update_tracked_fields!', :clean_gitlab_redis_shared_state do
- let(:request) { OpenStruct.new(remote_ip: "127.0.0.1") }
+ let(:request) { double('request', remote_ip: "127.0.0.1") }
let(:user) { create(:user) }
it 'writes trackable attributes' do
diff --git a/spec/presenters/packages/nuget/search_results_presenter_spec.rb b/spec/presenters/packages/nuget/search_results_presenter_spec.rb
index 39ec7251dfd..745914c6c43 100644
--- a/spec/presenters/packages/nuget/search_results_presenter_spec.rb
+++ b/spec/presenters/packages/nuget/search_results_presenter_spec.rb
@@ -9,9 +9,9 @@ RSpec.describe Packages::Nuget::SearchResultsPresenter do
let_it_be(:tag2) { create(:packages_tag, package: package_a, name: 'tag2') }
let_it_be(:packages_b) { create_list(:nuget_package, 5, project: project, name: 'DummyPackageB') }
let_it_be(:packages_c) { create_list(:nuget_package, 5, project: project, name: 'DummyPackageC') }
- let_it_be(:search_results) { OpenStruct.new(total_count: 3, results: [package_a, packages_b, packages_c].flatten) }
- let_it_be(:presenter) { described_class.new(search_results) }
+ let(:search_results) { double('search_results', total_count: 3, results: [package_a, packages_b, packages_c].flatten) }
+ let(:presenter) { described_class.new(search_results) }
let(:total_count) { presenter.total_count }
let(:data) { presenter.data }
diff --git a/spec/requests/api/ci/runner/runners_post_spec.rb b/spec/requests/api/ci/runner/runners_post_spec.rb
index 1a7dd6d76cd..530b601add9 100644
--- a/spec/requests/api/ci/runner/runners_post_spec.rb
+++ b/spec/requests/api/ci/runner/runners_post_spec.rb
@@ -30,6 +30,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
post api('/runners'), params: {
token: 'valid token',
description: 'server.hostname',
+ maintainer_note: 'Some maintainer notes',
run_untagged: false,
tag_list: 'tag1, tag2',
locked: true,
@@ -45,6 +46,7 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
allow_next_instance_of(::Ci::RegisterRunnerService) do |service|
expected_params = {
description: 'server.hostname',
+ maintainer_note: 'Some maintainer notes',
run_untagged: false,
tag_list: %w(tag1 tag2),
locked: true,
diff --git a/spec/requests/api/graphql/mutations/issues/set_crm_contacts_spec.rb b/spec/requests/api/graphql/mutations/issues/set_crm_contacts_spec.rb
index 62bb665274d..79d687a2bdb 100644
--- a/spec/requests/api/graphql/mutations/issues/set_crm_contacts_spec.rb
+++ b/spec/requests/api/graphql/mutations/issues/set_crm_contacts_spec.rb
@@ -7,12 +7,17 @@ RSpec.describe 'Setting issues crm contacts' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group, :crm_enabled) }
- let_it_be(:project) { create(:project, group: group) }
- let_it_be(:contacts) { create_list(:contact, 4, group: group) }
+ let_it_be(:subgroup) { create(:group, :crm_enabled, parent: group) }
+ let_it_be(:project) { create(:project, group: subgroup) }
+ let_it_be(:group_contacts) { create_list(:contact, 4, group: group) }
+ let_it_be(:subgroup_contacts) { create_list(:contact, 4, group: subgroup) }
let(:issue) { create(:issue, project: project) }
let(:operation_mode) { Types::MutationOperationModeEnum.default_mode }
- let(:contact_ids) { [global_id_of(contacts[1]), global_id_of(contacts[2])] }
+ let(:contacts) { subgroup_contacts }
+ let(:initial_contacts) { contacts[0..1] }
+ let(:mutation_contacts) { contacts[1..2] }
+ let(:contact_ids) { contact_global_ids(mutation_contacts) }
let(:does_not_exist_or_no_permission) { "The resource that you are attempting to access does not exist or you don't have permission to perform this action" }
let(:mutation) do
@@ -42,127 +47,141 @@ RSpec.describe 'Setting issues crm contacts' do
graphql_mutation_response(:issue_set_crm_contacts)
end
- context 'when the feature is enabled' do
- before do
- create(:issue_customer_relations_contact, issue: issue, contact: contacts[0])
- create(:issue_customer_relations_contact, issue: issue, contact: contacts[1])
- end
+ def contact_global_ids(contacts)
+ contacts.map { |contact| global_id_of(contact) }
+ end
- context 'when the user has no permission' do
- it 'returns expected error' do
- error = Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR
+ before do
+ initial_contacts.each { |contact| create(:issue_customer_relations_contact, issue: issue, contact: contact) }
+ end
+
+ shared_examples 'successful mutation' do
+ context 'replace' do
+ it 'updates the issue with correct contacts' do
post_graphql_mutation(mutation, current_user: user)
- expect(graphql_errors).to include(a_hash_including('message' => error))
+ expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
+ .to match_array(contact_global_ids(mutation_contacts))
end
end
- context 'when the user has permission' do
- before do
- group.add_reporter(user)
+ context 'append' do
+ let(:mutation_contacts) { [contacts[3]] }
+ let(:operation_mode) { Types::MutationOperationModeEnum.enum[:append] }
+
+ it 'updates the issue with correct contacts' do
+ post_graphql_mutation(mutation, current_user: user)
+
+ expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
+ .to match_array(contact_global_ids(initial_contacts + mutation_contacts))
end
+ end
- context 'when the feature is disabled' do
- before do
- stub_feature_flags(customer_relations: false)
- end
+ context 'remove' do
+ let(:mutation_contacts) { [contacts[0]] }
+ let(:operation_mode) { Types::MutationOperationModeEnum.enum[:remove] }
- it 'raises expected error' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'updates the issue with correct contacts' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_errors).to include(a_hash_including('message' => 'Feature disabled'))
- end
+ expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
+ .to match_array(contact_global_ids(initial_contacts - mutation_contacts))
end
+ end
+ end
+
+ context 'when the user has no permission' do
+ it 'returns expected error' do
+ error = Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR
+ post_graphql_mutation(mutation, current_user: user)
- context 'replace' do
- it 'updates the issue with correct contacts' do
- post_graphql_mutation(mutation, current_user: user)
+ expect(graphql_errors).to include(a_hash_including('message' => error))
+ end
+ end
- expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
- .to match_array([global_id_of(contacts[1]), global_id_of(contacts[2])])
- end
- end
+ context 'when the user has permission' do
+ before do
+ group.add_reporter(user)
+ end
- context 'append' do
- let(:contact_ids) { [global_id_of(contacts[3])] }
- let(:operation_mode) { Types::MutationOperationModeEnum.enum[:append] }
+ context 'when the feature is disabled' do
+ before do
+ stub_feature_flags(customer_relations: false)
+ end
- it 'updates the issue with correct contacts' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'raises expected error' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
- .to match_array([global_id_of(contacts[0]), global_id_of(contacts[1]), global_id_of(contacts[3])])
- end
+ expect(graphql_errors).to include(a_hash_including('message' => 'Feature disabled'))
end
+ end
- context 'remove' do
- let(:contact_ids) { [global_id_of(contacts[0])] }
- let(:operation_mode) { Types::MutationOperationModeEnum.enum[:remove] }
+ context 'with issue group contacts' do
+ let(:contacts) { subgroup_contacts }
- it 'updates the issue with correct contacts' do
- post_graphql_mutation(mutation, current_user: user)
+ it_behaves_like 'successful mutation'
+ end
- expect(graphql_data_at(:issue_set_crm_contacts, :issue, :customer_relations_contacts, :nodes, :id))
- .to match_array([global_id_of(contacts[1])])
- end
- end
+ context 'with issue ancestor group contacts' do
+ it_behaves_like 'successful mutation'
+ end
- context 'when the contact does not exist' do
- let(:contact_ids) { ["gid://gitlab/CustomerRelations::Contact/#{non_existing_record_id}"] }
+ context 'when the contact does not exist' do
+ let(:contact_ids) { ["gid://gitlab/CustomerRelations::Contact/#{non_existing_record_id}"] }
- it 'returns expected error' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'returns expected error' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_data_at(:issue_set_crm_contacts, :errors))
- .to match_array(["Issue customer relations contacts #{non_existing_record_id}: #{does_not_exist_or_no_permission}"])
- end
+ expect(graphql_data_at(:issue_set_crm_contacts, :errors))
+ .to match_array(["Issue customer relations contacts #{non_existing_record_id}: #{does_not_exist_or_no_permission}"])
end
+ end
- context 'when the contact belongs to a different group' do
- let(:group2) { create(:group, :crm_enabled) }
- let(:contact) { create(:contact, group: group2) }
- let(:contact_ids) { [global_id_of(contact)] }
+ context 'when the contact belongs to a different group' do
+ let(:group2) { create(:group, :crm_enabled) }
+ let(:contact) { create(:contact, group: group2) }
+ let(:contact_ids) { [global_id_of(contact)] }
- before do
- group2.add_reporter(user)
- end
+ before do
+ group2.add_reporter(user)
+ end
- it 'returns expected error' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'returns expected error' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_data_at(:issue_set_crm_contacts, :errors))
- .to match_array(["Issue customer relations contacts #{contact.id}: #{does_not_exist_or_no_permission}"])
- end
+ expect(graphql_data_at(:issue_set_crm_contacts, :errors))
+ .to match_array(["Issue customer relations contacts #{contact.id}: #{does_not_exist_or_no_permission}"])
end
+ end
- context 'when attempting to add more than 6' do
- let(:operation_mode) { Types::MutationOperationModeEnum.enum[:append] }
- let(:gid) { global_id_of(contacts[0]) }
- let(:contact_ids) { [gid, gid, gid, gid, gid, gid, gid] }
+ context 'when attempting to add more than 6' do
+ let(:operation_mode) { Types::MutationOperationModeEnum.enum[:append] }
+ let(:gid) { global_id_of(contacts[0]) }
+ let(:contact_ids) { [gid, gid, gid, gid, gid, gid, gid] }
- it 'returns expected error' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'returns expected error' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_data_at(:issue_set_crm_contacts, :errors))
- .to match_array(["You can only add up to 6 contacts at one time"])
- end
+ expect(graphql_data_at(:issue_set_crm_contacts, :errors))
+ .to match_array(["You can only add up to 6 contacts at one time"])
end
+ end
- context 'when trying to remove non-existent contact' do
- let(:operation_mode) { Types::MutationOperationModeEnum.enum[:remove] }
- let(:contact_ids) { ["gid://gitlab/CustomerRelations::Contact/#{non_existing_record_id}"] }
+ context 'when trying to remove non-existent contact' do
+ let(:operation_mode) { Types::MutationOperationModeEnum.enum[:remove] }
+ let(:contact_ids) { ["gid://gitlab/CustomerRelations::Contact/#{non_existing_record_id}"] }
- it 'raises expected error' do
- post_graphql_mutation(mutation, current_user: user)
+ it 'raises expected error' do
+ post_graphql_mutation(mutation, current_user: user)
- expect(graphql_data_at(:issue_set_crm_contacts, :errors)).to be_empty
- end
+ expect(graphql_data_at(:issue_set_crm_contacts, :errors)).to be_empty
end
end
end
context 'when crm_enabled is false' do
let(:issue) { create(:issue) }
+ let(:initial_contacts) { [] }
it 'raises expected error' do
issue.project.add_reporter(user)
diff --git a/spec/support/database/cross-database-modification-allowlist.yml b/spec/support/database/cross-database-modification-allowlist.yml
index 51804862a43..91a4bff22c5 100644
--- a/spec/support/database/cross-database-modification-allowlist.yml
+++ b/spec/support/database/cross-database-modification-allowlist.yml
@@ -8,4 +8,3 @@
- "./spec/models/clusters/applications/runner_spec.rb"
- "./spec/requests/api/commits_spec.rb"
- "./spec/services/ci/retry_build_service_spec.rb"
-- "./spec/services/projects/overwrite_project_service_spec.rb"