summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-20 09:16:11 +0000
commitedaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch)
tree11f143effbfeba52329fb7afbd05e6e2a3790241 /db
parentd8a5691316400a0f7ec4f83832698f1988eb27c1 (diff)
downloadgitlab-ce-76a9e64d004e0c02c35b8165ca38d005afb5e823.tar.gz
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/18_abuse_reports.rb2
-rw-r--r--db/fixtures/development/31_terraform_state.rb26
-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/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb18
-rw-r--r--db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb7
-rw-r--r--db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb7
-rw-r--r--db/migrate/20211210025754_alter_constraint_of_phone.rb17
-rw-r--r--db/migrate/20211210031721_change_user_details_phone_text_limit.rb15
-rw-r--r--db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb13
-rw-r--r--db/migrate/20211213154259_add_status_to_packages_package_files.rb7
-rw-r--r--db/migrate/20211213154704_add_status_index_to_packages_package_files.rb15
-rw-r--r--db/migrate/20211215182006_update_application_settings_protected_paths.rb58
-rw-r--r--db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb10
-rw-r--r--db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb13
-rw-r--r--db/migrate/20211216135651_add_index_to_cluster_agent_id.rb16
-rw-r--r--db/migrate/20211216220939_add_group_crm_settings.rb13
-rw-r--r--db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb19
-rw-r--r--db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb15
-rw-r--r--db/migrate/20211223125921_add_temp_index_to_members_state.rb16
-rw-r--r--db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb13
-rw-r--r--db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb15
-rw-r--r--db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb15
-rw-r--r--db/migrate/20220105121325_add_route_namespace_reference.rb13
-rw-r--r--db/migrate/20220106141756_remove_lock_version_indexes.rb23
-rw-r--r--db/migrate/20220106230629_add_registry_migration_application_settings.rb15
-rw-r--r--db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb19
-rw-r--r--db/migrate/20220107091629_add_route_namespace_index.rb19
-rw-r--r--db/migrate/20220107165036_remove_note_id_index.rb16
-rw-r--r--db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb17
-rw-r--r--db/migrate/20220110170953_create_ci_secure_files.rb19
-rw-r--r--db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb12
-rw-r--r--db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb13
-rw-r--r--db/migrate/20220111200254_remove_index_from_merge_requests.rb15
-rw-r--r--db/migrate/20220112115413_add_requires_verification_to_user_details.rb9
-rw-r--r--db/migrate/20220112205111_create_security_training_providers.rb14
-rw-r--r--db/migrate/20220112232037_add_member_namespace_reference.rb13
-rw-r--r--db/migrate/20220112232605_add_member_namespace_index.rb19
-rw-r--r--db/migrate/20220113125401_create_security_trainings.rb18
-rw-r--r--db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb15
-rw-r--r--db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb15
-rw-r--r--db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb13
-rw-r--r--db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb9
-rw-r--r--db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb11
-rw-r--r--db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb9
-rw-r--r--db/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/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb29
-rw-r--r--db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb22
-rw-r--r--db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb10
-rw-r--r--db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb26
-rw-r--r--db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb28
-rw-r--r--db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb59
-rw-r--r--db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb15
-rw-r--r--db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb16
-rw-r--r--db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb28
-rw-r--r--db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb57
-rw-r--r--db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb71
-rw-r--r--db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb23
-rw-r--r--db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb23
-rw-r--r--db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb16
-rw-r--r--db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb25
-rw-r--r--db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb15
-rw-r--r--db/post_migrate/20211210140629_encrypt_static_object_token.rb22
-rw-r--r--db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb26
-rw-r--r--db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb41
-rw-r--r--db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb14
-rw-r--r--db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb20
-rw-r--r--db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb28
-rw-r--r--db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb15
-rw-r--r--db/post_migrate/20211220123956_update_invalid_member_states.rb21
-rw-r--r--db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb15
-rw-r--r--db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb17
-rw-r--r--db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb15
-rw-r--r--db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb17
-rw-r--r--db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb17
-rw-r--r--db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb17
-rw-r--r--db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb17
-rw-r--r--db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb17
-rw-r--r--db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb17
-rw-r--r--db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb23
-rw-r--r--db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb18
-rw-r--r--db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb15
-rw-r--r--db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb14
-rw-r--r--db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb15
-rw-r--r--db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb17
-rw-r--r--db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb23
-rw-r--r--db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb16
-rw-r--r--db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb15
-rw-r--r--db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb15
-rw-r--r--db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb15
-rw-r--r--db/post_migrate/20220114105525_add_index_on_projects_path.rb17
-rw-r--r--db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb16
-rw-r--r--db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb17
-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--db/schema_migrations/202108111930331
-rw-r--r--db/schema_migrations/202110261243361
-rw-r--r--db/schema_migrations/202111231619061
-rw-r--r--db/schema_migrations/202112061612711
-rw-r--r--db/schema_migrations/202112061626011
-rw-r--r--db/schema_migrations/202112070817081
-rw-r--r--db/schema_migrations/202112071253311
-rw-r--r--db/schema_migrations/202112071353311
-rw-r--r--db/schema_migrations/202112071735101
-rw-r--r--db/schema_migrations/202112071735111
-rw-r--r--db/schema_migrations/202112081222001
-rw-r--r--db/schema_migrations/202112081222011
-rw-r--r--db/schema_migrations/202112092038201
-rw-r--r--db/schema_migrations/202112092038211
-rw-r--r--db/schema_migrations/202112092300421
-rw-r--r--db/schema_migrations/202112100257541
-rw-r--r--db/schema_migrations/202112100317211
-rw-r--r--db/schema_migrations/202112101400001
-rw-r--r--db/schema_migrations/202112101406291
-rw-r--r--db/schema_migrations/202112131423441
-rw-r--r--db/schema_migrations/202112131542591
-rw-r--r--db/schema_migrations/202112131547041
-rw-r--r--db/schema_migrations/202112140125071
-rw-r--r--db/schema_migrations/202112151820061
-rw-r--r--db/schema_migrations/202112161331071
-rw-r--r--db/schema_migrations/202112161341341
-rw-r--r--db/schema_migrations/202112161356511
-rw-r--r--db/schema_migrations/202112162209391
-rw-r--r--db/schema_migrations/202112170507531
-rw-r--r--db/schema_migrations/202112171200001
-rw-r--r--db/schema_migrations/202112171459231
-rw-r--r--db/schema_migrations/202112171743311
-rw-r--r--db/schema_migrations/202112200647571
-rw-r--r--db/schema_migrations/202112201204021
-rw-r--r--db/schema_migrations/202112201239561
-rw-r--r--db/schema_migrations/202112201745041
-rw-r--r--db/schema_migrations/202112231259211
-rw-r--r--db/schema_migrations/202112241129371
-rw-r--r--db/schema_migrations/202112241145391
-rw-r--r--db/schema_migrations/202112290236541
-rw-r--r--db/schema_migrations/202112301125171
-rw-r--r--db/schema_migrations/202112301130311
-rw-r--r--db/schema_migrations/202201040600491
-rw-r--r--db/schema_migrations/202201041744451
-rw-r--r--db/schema_migrations/202201050205141
-rw-r--r--db/schema_migrations/202201051213251
-rw-r--r--db/schema_migrations/202201061417561
-rw-r--r--db/schema_migrations/202201062306291
-rw-r--r--db/schema_migrations/202201062307121
-rw-r--r--db/schema_migrations/202201062315181
-rw-r--r--db/schema_migrations/202201062334591
-rw-r--r--db/schema_migrations/202201062356261
-rw-r--r--db/schema_migrations/202201070916291
-rw-r--r--db/schema_migrations/202201071650361
-rw-r--r--db/schema_migrations/202201091330061
-rw-r--r--db/schema_migrations/202201091344551
-rw-r--r--db/schema_migrations/202201101709531
-rw-r--r--db/schema_migrations/202201101710491
-rw-r--r--db/schema_migrations/202201102249131
-rw-r--r--db/schema_migrations/202201102314201
-rw-r--r--db/schema_migrations/202201102331551
-rw-r--r--db/schema_migrations/202201110027561
-rw-r--r--db/schema_migrations/202201110238521
-rw-r--r--db/schema_migrations/202201110950061
-rw-r--r--db/schema_migrations/202201110950071
-rw-r--r--db/schema_migrations/202201111023141
-rw-r--r--db/schema_migrations/202201112002541
-rw-r--r--db/schema_migrations/202201112215161
-rw-r--r--db/schema_migrations/202201120159401
-rw-r--r--db/schema_migrations/202201120905561
-rw-r--r--db/schema_migrations/202201121154131
-rw-r--r--db/schema_migrations/202201122051111
-rw-r--r--db/schema_migrations/202201122306421
-rw-r--r--db/schema_migrations/202201122320371
-rw-r--r--db/schema_migrations/202201122326051
-rw-r--r--db/schema_migrations/202201122327231
-rw-r--r--db/schema_migrations/202201130133191
-rw-r--r--db/schema_migrations/202201130144381
-rw-r--r--db/schema_migrations/202201130158301
-rw-r--r--db/schema_migrations/202201130355191
-rw-r--r--db/schema_migrations/202201130404471
-rw-r--r--db/schema_migrations/202201131254011
-rw-r--r--db/schema_migrations/202201141055251
-rw-r--r--db/schema_migrations/202201141319501
-rw-r--r--db/schema_migrations/202201161758511
-rw-r--r--db/schema_migrations/202201172259361
-rw-r--r--db/schema_migrations/202201181419501
-rw-r--r--db/schema_migrations/202201181558461
-rw-r--r--db/schema_migrations/202201181558471
-rw-r--r--db/schema_migrations/202201181558481
-rw-r--r--db/schema_migrations/202201191417361
-rw-r--r--db/structure.sql492
552 files changed, 2945 insertions, 4797 deletions
diff --git a/db/fixtures/development/18_abuse_reports.rb b/db/fixtures/development/18_abuse_reports.rb
index 88d2f784852..b06beca35e9 100644
--- a/db/fixtures/development/18_abuse_reports.rb
+++ b/db/fixtures/development/18_abuse_reports.rb
@@ -11,7 +11,7 @@ module Db
name: FFaker::Name.name,
email: FFaker::Internet.email,
confirmed_at: DateTime.now,
- password: '12345678'
+ password: Gitlab::Password.test_default
)
::AbuseReport.create(reporter: ::User.take, user: reported_user, message: 'User sends spam')
diff --git a/db/fixtures/development/31_terraform_state.rb b/db/fixtures/development/31_terraform_state.rb
new file mode 100644
index 00000000000..76f9c270f72
--- /dev/null
+++ b/db/fixtures/development/31_terraform_state.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+TERRAFORM_FILE_VERSION = 1
+
+# Create sample terraform states in existing projects
+Gitlab::Seeder.quiet do
+ tfdata = {terraform_version: '0.14.1'}.to_json
+
+ Project.not_mass_generated.find_each do |project|
+ # Create as the project's creator
+ user = project.creator
+ # Set a build job source, if one exists for the project
+ build = project.builds.last
+
+ remote_state_handler = ::Terraform::RemoteStateHandler.new(project, user, name: project.path, lock_id: nil)
+
+ remote_state_handler.handle_with_lock do |state|
+ # Upload a file if a version does not already exist
+ state.update_file!(CarrierWaveStringFile.new(tfdata), version: TERRAFORM_FILE_VERSION, build: build) if state.latest_version.nil?
+ end
+
+ # rubocop:disable Rails/Output
+ print '.'
+ # rubocop:enable Rails/Output
+ end
+end
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/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb b/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
new file mode 100644
index 00000000000..1bcee89ae57
--- /dev/null
+++ b/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddUniqueIndexToVulnerabilityFindingLinks < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ NAME_URL_INDEX_NAME = 'finding_link_name_url_idx'
+ URL_INDEX_NAME = 'finding_link_url_idx'
+
+ def up
+ add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], unique: true, name: NAME_URL_INDEX_NAME
+ add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], unique: true, where: 'name is null', name: URL_INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], name: NAME_URL_INDEX_NAME
+ remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], name: URL_INDEX_NAME
+ end
+end
diff --git a/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb b/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb
new file mode 100644
index 00000000000..90e68f6a0ac
--- /dev/null
+++ b/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddArchiveTraceEventsToIntegrations < Gitlab::Database::Migration[1.0]
+ def change
+ add_column :integrations, :archive_trace_events, :boolean, null: false, default: false
+ end
+end
diff --git a/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb b/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb
new file mode 100644
index 00000000000..596c82eb209
--- /dev/null
+++ b/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddStatusToClusterAgentTokens < Gitlab::Database::Migration[1.0]
+ def change
+ add_column :cluster_agent_tokens, :status, :smallint, null: false, default: 0
+ end
+end
diff --git a/db/migrate/20211210025754_alter_constraint_of_phone.rb b/db/migrate/20211210025754_alter_constraint_of_phone.rb
new file mode 100644
index 00000000000..1644fbe9000
--- /dev/null
+++ b/db/migrate/20211210025754_alter_constraint_of_phone.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AlterConstraintOfPhone < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length')
+ remove_check_constraint(:verification_codes, constraint_phone)
+ add_check_constraint(:verification_codes, 'char_length(phone) <= 50', constraint_phone)
+ end
+
+ def down
+ constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length')
+ remove_check_constraint(:verification_codes, constraint_phone)
+ add_check_constraint(:verification_codes, 'char_length(phone) <= 32', constraint_phone)
+ end
+end
diff --git a/db/migrate/20211210031721_change_user_details_phone_text_limit.rb b/db/migrate/20211210031721_change_user_details_phone_text_limit.rb
new file mode 100644
index 00000000000..5432f6d3d24
--- /dev/null
+++ b/db/migrate/20211210031721_change_user_details_phone_text_limit.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class ChangeUserDetailsPhoneTextLimit < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ remove_text_limit :user_details, :phone
+ add_text_limit :user_details, :phone, 50
+ end
+
+ def down
+ remove_text_limit :user_details, :phone
+ add_text_limit :user_details, :phone, 32
+ end
+end
diff --git a/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb b/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb
new file mode 100644
index 00000000000..ac7027bf082
--- /dev/null
+++ b/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddSettingsUserEmailLookupLimit < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_column :application_settings, :user_email_lookup_limit, :integer, null: false, default: 60
+ end
+
+ def down
+ remove_column :application_settings, :user_email_lookup_limit
+ end
+end
diff --git a/db/migrate/20211213154259_add_status_to_packages_package_files.rb b/db/migrate/20211213154259_add_status_to_packages_package_files.rb
new file mode 100644
index 00000000000..38ea069a30b
--- /dev/null
+++ b/db/migrate/20211213154259_add_status_to_packages_package_files.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddStatusToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
+ def change
+ add_column :packages_package_files, :status, :smallint, default: 0, null: false
+ end
+end
diff --git a/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb b/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb
new file mode 100644
index 00000000000..7067e3efa6c
--- /dev/null
+++ b/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddStatusIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_packages_package_files_on_package_id_status_and_id'
+
+ def up
+ add_concurrent_index :packages_package_files, [:package_id, :status, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20211215182006_update_application_settings_protected_paths.rb b/db/migrate/20211215182006_update_application_settings_protected_paths.rb
new file mode 100644
index 00000000000..f1c1dde55e0
--- /dev/null
+++ b/db/migrate/20211215182006_update_application_settings_protected_paths.rb
@@ -0,0 +1,58 @@
+# frozen_string_literal: true
+
+class UpdateApplicationSettingsProtectedPaths < Gitlab::Database::Migration[1.0]
+ REMOVE_PROTECTED_PATHS = [
+ '/oauth/authorize',
+ '/oauth/token'
+ ].freeze
+
+ NEW_DEFAULT_PROTECTED_PATHS = [
+ '/users/password',
+ '/users/sign_in',
+ '/api/v3/session.json',
+ '/api/v3/session',
+ '/api/v4/session.json',
+ '/api/v4/session',
+ '/users',
+ '/users/confirmation',
+ '/unsubscribes/',
+ '/import/github/personal_access_token',
+ '/admin/session'
+ ].freeze
+
+ OLD_DEFAULT_PROTECTED_PATHS = (NEW_DEFAULT_PROTECTED_PATHS + REMOVE_PROTECTED_PATHS).freeze
+
+ class ApplicationSetting < ActiveRecord::Base
+ self.table_name = 'application_settings'
+ end
+
+ def up
+ change_column_default(:application_settings, :protected_paths, NEW_DEFAULT_PROTECTED_PATHS)
+
+ ApplicationSetting.reset_column_information
+
+ ApplicationSetting.where.not(protected_paths: nil).each do |application_setting|
+ paths_to_remove = application_setting.protected_paths & REMOVE_PROTECTED_PATHS
+
+ next if paths_to_remove.empty?
+
+ updated_protected_paths = application_setting.protected_paths - paths_to_remove
+ application_setting.update!(protected_paths: updated_protected_paths)
+ end
+ end
+
+ def down
+ change_column_default(:application_settings, :protected_paths, OLD_DEFAULT_PROTECTED_PATHS)
+
+ ApplicationSetting.reset_column_information
+
+ ApplicationSetting.where.not(protected_paths: nil).each do |application_setting|
+ paths_to_add = REMOVE_PROTECTED_PATHS - application_setting.protected_paths
+
+ next if paths_to_add.empty?
+
+ updated_protected_paths = application_setting.protected_paths + paths_to_add
+ application_setting.update!(protected_paths: updated_protected_paths)
+ end
+ end
+end
diff --git a/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb b/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb
new file mode 100644
index 00000000000..0bbd5c25df4
--- /dev/null
+++ b/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class AddClusterAgentIdToVulnerabilityReads < Gitlab::Database::Migration[1.0]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
+ def change
+ add_column :vulnerability_reads, :cluster_agent_id, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb b/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
new file mode 100644
index 00000000000..f4776ff10a4
--- /dev/null
+++ b/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToVulnerabilityReadsClusterAgentId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :vulnerability_reads, :cluster_agent_id, 10
+ end
+
+ def down
+ remove_text_limit :vulnerability_reads, :cluster_agent_id
+ end
+end
diff --git a/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb b/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb
new file mode 100644
index 00000000000..05928083823
--- /dev/null
+++ b/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddIndexToClusterAgentId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = "index_vulnerability_reads_on_cluster_agent_id"
+ CLUSTER_IMAGE_SCANNING_REPORT_TYPE = 7
+
+ def up
+ add_concurrent_index :vulnerability_reads, :cluster_agent_id, where: "report_type = #{CLUSTER_IMAGE_SCANNING_REPORT_TYPE}", name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20211216220939_add_group_crm_settings.rb b/db/migrate/20211216220939_add_group_crm_settings.rb
new file mode 100644
index 00000000000..e931aa3709b
--- /dev/null
+++ b/db/migrate/20211216220939_add_group_crm_settings.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddGroupCrmSettings < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ create_table :group_crm_settings, id: false do |t|
+ t.references :group, primary_key: true, foreign_key: { to_table: :namespaces, on_delete: :cascade }
+ t.timestamps_with_timezone
+ t.boolean :enabled, null: false, default: false
+ end
+ end
+end
diff --git a/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb b/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb
new file mode 100644
index 00000000000..fa81fa512ae
--- /dev/null
+++ b/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveArtifactsArchiveIdForeignKeyFromProjectPagesMetadata < Gitlab::Database::Migration[1.0]
+ CONSTRAINT_NAME = 'fk_69366a119e'
+
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ execute('lock table ci_job_artifacts, project_pages_metadata in access exclusive mode')
+
+ remove_foreign_key :project_pages_metadata, to_table: :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :project_pages_metadata, :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb b/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb
new file mode 100644
index 00000000000..cf9f2511176
--- /dev/null
+++ b/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddSecureScanningActionsToOnboardingProgresses < Gitlab::Database::Migration[1.0]
+ def change
+ change_table(:onboarding_progresses, bulk: true) do |t|
+ t.column :secure_dependency_scanning_run_at, :datetime_with_timezone
+ t.column :secure_container_scanning_run_at, :datetime_with_timezone
+ t.column :secure_dast_run_at, :datetime_with_timezone
+ t.column :secure_secret_detection_run_at, :datetime_with_timezone
+ t.column :secure_coverage_fuzzing_run_at, :datetime_with_timezone
+ t.column :secure_cluster_image_scanning_run_at, :datetime_with_timezone
+ t.column :secure_api_fuzzing_run_at, :datetime_with_timezone
+ end
+ end
+end
diff --git a/db/migrate/20211223125921_add_temp_index_to_members_state.rb b/db/migrate/20211223125921_add_temp_index_to_members_state.rb
new file mode 100644
index 00000000000..7dd2ec1a8aa
--- /dev/null
+++ b/db/migrate/20211223125921_add_temp_index_to_members_state.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddTempIndexToMembersState < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'tmp_index_members_on_state'
+
+ def up
+ # Temporary index to be removed in 14.9 https://gitlab.com/gitlab-org/gitlab/-/issues/349960
+ add_concurrent_index :members, :state, name: INDEX_NAME, where: 'state = 2'
+ end
+
+ def down
+ remove_concurrent_index_by_name :members, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb b/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb
new file mode 100644
index 00000000000..cb58033361f
--- /dev/null
+++ b/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddPackagesCleanupPackageFileWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ add_column :application_settings,
+ :packages_cleanup_package_file_worker_capacity,
+ :smallint,
+ default: 2,
+ null: false
+ end
+end
diff --git a/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb b/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb
new file mode 100644
index 00000000000..3a40540a1e1
--- /dev/null
+++ b/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddPackagesCleanupPackageFileWorkerCapacityCheckConstraintToAppSettings < Gitlab::Database::Migration[1.0]
+ CONSTRAINT_NAME = 'app_settings_p_cleanup_package_file_worker_capacity_positive'
+
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint :application_settings, 'packages_cleanup_package_file_worker_capacity >= 0', CONSTRAINT_NAME
+ end
+
+ def down
+ remove_check_constraint :application_settings, CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
new file mode 100644
index 00000000000..2cef570966b
--- /dev/null
+++ b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddCiRunnersIndexOnActiveState < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_runners_on_active'
+
+ def up
+ add_concurrent_index :ci_runners, [:active, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :ci_runners, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220105121325_add_route_namespace_reference.rb b/db/migrate/20220105121325_add_route_namespace_reference.rb
new file mode 100644
index 00000000000..77bd0530b8a
--- /dev/null
+++ b/db/migrate/20220105121325_add_route_namespace_reference.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddRouteNamespaceReference < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def up
+ add_column :routes, :namespace_id, :bigint unless column_exists?(:routes, :namespace_id)
+ end
+
+ def down
+ remove_column :routes, :namespace_id if column_exists?(:routes, :namespace_id)
+ end
+end
diff --git a/db/migrate/20220106141756_remove_lock_version_indexes.rb b/db/migrate/20220106141756_remove_lock_version_indexes.rb
new file mode 100644
index 00000000000..382f20dfc73
--- /dev/null
+++ b/db/migrate/20220106141756_remove_lock_version_indexes.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveLockVersionIndexes < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEXES = {
+ issues: 'index_issues_on_lock_version',
+ merge_requests: 'index_merge_requests_on_lock_version',
+ epics: 'index_epics_on_lock_version'
+ }
+
+ def up
+ INDEXES.each do |table, index_name|
+ remove_concurrent_index_by_name table, index_name
+ end
+ end
+
+ def down
+ INDEXES.each do |table, index_name|
+ add_concurrent_index table, :lock_version, where: "lock_version IS NULL", name: index_name
+ end
+ end
+end
diff --git a/db/migrate/20220106230629_add_registry_migration_application_settings.rb b/db/migrate/20220106230629_add_registry_migration_application_settings.rb
new file mode 100644
index 00000000000..191443de6eb
--- /dev/null
+++ b/db/migrate/20220106230629_add_registry_migration_application_settings.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddRegistryMigrationApplicationSettings < Gitlab::Database::Migration[1.0]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
+ def change
+ add_column :application_settings, :container_registry_import_max_tags_count, :integer, default: 100, null: false
+ add_column :application_settings, :container_registry_import_max_retries, :integer, default: 3, null: false
+ add_column :application_settings, :container_registry_import_start_max_retries, :integer, default: 50, null: false
+ add_column :application_settings, :container_registry_import_max_step_duration, :integer, default: 5.minutes, null: false
+ add_column :application_settings, :container_registry_import_target_plan, :text, default: 'free', null: false
+ add_column :application_settings, :container_registry_import_created_before, :datetime_with_timezone, default: '2022-01-23 00:00:00', null: false
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb b/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb
new file mode 100644
index 00000000000..76dccbe785f
--- /dev/null
+++ b/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddMigrationColumnsToContainerRepositories < Gitlab::Database::Migration[1.0]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
+ def change
+ add_column :container_repositories, :migration_pre_import_started_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_pre_import_done_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_import_started_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_import_done_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_aborted_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_skipped_at, :datetime_with_timezone
+ add_column :container_repositories, :migration_retries_count, :integer, default: 0, null: false
+ add_column :container_repositories, :migration_skipped_reason, :smallint
+ add_column :container_repositories, :migration_state, :text, default: 'default', null: false
+ add_column :container_repositories, :migration_aborted_in_state, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20220107091629_add_route_namespace_index.rb b/db/migrate/20220107091629_add_route_namespace_index.rb
new file mode 100644
index 00000000000..bc1044a24da
--- /dev/null
+++ b/db/migrate/20220107091629_add_route_namespace_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddRouteNamespaceIndex < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+ INDEX_NAME = 'index_routes_on_namespace_id'
+
+ def up
+ add_concurrent_index :routes, :namespace_id, unique: true, name: INDEX_NAME
+ add_concurrent_foreign_key :routes, :namespaces, column: :namespace_id, on_delete: :nullify, reverse_lock_order: true
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :routes, column: :namespace_id
+ end
+
+ remove_concurrent_index_by_name :routes, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220107165036_remove_note_id_index.rb b/db/migrate/20220107165036_remove_note_id_index.rb
new file mode 100644
index 00000000000..15b4a3caf78
--- /dev/null
+++ b/db/migrate/20220107165036_remove_note_id_index.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveNoteIdIndex < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ TABLE = :suggestions
+ INDEX_NAME = 'index_suggestions_on_note_id'
+
+ def up
+ remove_concurrent_index_by_name TABLE, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index TABLE, :note_id, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb b/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb
new file mode 100644
index 00000000000..abbd54ff19b
--- /dev/null
+++ b/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveCiPipelinesLockVersionIndex < Gitlab::Database::Migration[1.0]
+ TABLE = :ci_pipelines
+ INDEX_NAME = 'tmp_index_ci_pipelines_lock_version'
+ COLUMN = :id
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220110170953_create_ci_secure_files.rb b/db/migrate/20220110170953_create_ci_secure_files.rb
new file mode 100644
index 00000000000..1498a2d0212
--- /dev/null
+++ b/db/migrate/20220110170953_create_ci_secure_files.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class CreateCiSecureFiles < Gitlab::Database::Migration[1.0]
+ def up
+ create_table :ci_secure_files do |t|
+ t.bigint :project_id, index: true, null: false
+ t.timestamps_with_timezone null: false
+ t.integer :file_store, limit: 2, null: false, default: 1
+ t.integer :permissions, null: false, default: 0, limit: 2
+ t.text :name, null: false, limit: 255
+ t.text :file, null: false, limit: 255
+ t.binary :checksum, null: false
+ end
+ end
+
+ def down
+ drop_table :ci_secure_files, if_exists: true
+ end
+end
diff --git a/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb
new file mode 100644
index 00000000000..969774983c4
--- /dev/null
+++ b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddMaintainerNoteToCiRunners < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
+ add_column :ci_runners, :maintainer_note, :text
+ # rubocop:enable Migration/AddLimitToTextColumns
+ end
+end
diff --git a/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
new file mode 100644
index 00000000000..0a0a4171306
--- /dev/null
+++ b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToCiRunnersMaintainerNote < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :ci_runners, :maintainer_note, 255
+ end
+
+ def down
+ remove_text_limit :ci_runners, :maintainer_note
+ end
+end
diff --git a/db/migrate/20220111200254_remove_index_from_merge_requests.rb b/db/migrate/20220111200254_remove_index_from_merge_requests.rb
new file mode 100644
index 00000000000..0ac6019ad5e
--- /dev/null
+++ b/db/migrate/20220111200254_remove_index_from_merge_requests.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveIndexFromMergeRequests < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_merge_requests_on_title'
+
+ def up
+ remove_concurrent_index :merge_requests, :title, name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :merge_requests, :title, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220112115413_add_requires_verification_to_user_details.rb b/db/migrate/20220112115413_add_requires_verification_to_user_details.rb
new file mode 100644
index 00000000000..01fe4f1d5cf
--- /dev/null
+++ b/db/migrate/20220112115413_add_requires_verification_to_user_details.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddRequiresVerificationToUserDetails < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ add_column :user_details, :requires_credit_card_verification, :boolean, null: false, default: false
+ end
+end
diff --git a/db/migrate/20220112205111_create_security_training_providers.rb b/db/migrate/20220112205111_create_security_training_providers.rb
new file mode 100644
index 00000000000..afddec6a134
--- /dev/null
+++ b/db/migrate/20220112205111_create_security_training_providers.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class CreateSecurityTrainingProviders < Gitlab::Database::Migration[1.0]
+ def change
+ create_table :security_training_providers do |t|
+ t.text :name, limit: 256, null: false
+ t.text :description, limit: 512
+ t.text :url, limit: 512, null: false
+ t.text :logo_url, limit: 512
+
+ t.timestamps_with_timezone null: false
+ end
+ end
+end
diff --git a/db/migrate/20220112232037_add_member_namespace_reference.rb b/db/migrate/20220112232037_add_member_namespace_reference.rb
new file mode 100644
index 00000000000..d67ea09a78c
--- /dev/null
+++ b/db/migrate/20220112232037_add_member_namespace_reference.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddMemberNamespaceReference < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def up
+ add_column :members, :member_namespace_id, :bigint unless column_exists?(:members, :member_namespace_id)
+ end
+
+ def down
+ remove_column :members, :member_namespace_id if column_exists?(:members, :member_namespace_id)
+ end
+end
diff --git a/db/migrate/20220112232605_add_member_namespace_index.rb b/db/migrate/20220112232605_add_member_namespace_index.rb
new file mode 100644
index 00000000000..ba32df53ae7
--- /dev/null
+++ b/db/migrate/20220112232605_add_member_namespace_index.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddMemberNamespaceIndex < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+ INDEX_NAME = 'index_members_on_member_namespace_id'
+
+ def up
+ add_concurrent_index :members, :member_namespace_id, unique: false, name: INDEX_NAME
+ add_concurrent_foreign_key :members, :namespaces, column: :member_namespace_id, on_delete: :nullify, reverse_lock_order: true
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :members, column: :member_namespace_id
+ end
+
+ remove_concurrent_index_by_name :members, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220113125401_create_security_trainings.rb b/db/migrate/20220113125401_create_security_trainings.rb
new file mode 100644
index 00000000000..6924c7bd189
--- /dev/null
+++ b/db/migrate/20220113125401_create_security_trainings.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateSecurityTrainings < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ create_table :security_trainings do |t|
+ t.references :project, null: false, foreign_key: { on_delete: :cascade }
+ t.references :provider, null: false, foreign_key: { to_table: :security_training_providers, on_delete: :cascade }
+ t.boolean :is_primary, default: false, null: false
+
+ t.timestamps_with_timezone null: false
+
+ # Guarantee that there will be only one primary per project
+ t.index :project_id, name: 'index_security_trainings_on_unique_project_id', unique: true, where: 'is_primary IS TRUE'
+ end
+ end
+end
diff --git a/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb b/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb
new file mode 100644
index 00000000000..948edea1138
--- /dev/null
+++ b/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddStatusOnlyIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_packages_package_files_on_status'
+
+ def up
+ add_concurrent_index :packages_package_files, :status, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME
+ end
+end
diff --git a/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb b/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
new file mode 100644
index 00000000000..91c0612716b
--- /dev/null
+++ b/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddTextLimitsToContainerRepositoriesMigrationColumns < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :container_repositories, :migration_state, 255
+ add_text_limit :container_repositories, :migration_aborted_in_state, 255
+ end
+
+ def down
+ remove_text_limit :container_repositories, :migration_state
+ remove_text_limit :container_repositories, :migration_aborted_in_state
+ end
+end
diff --git a/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb b/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
new file mode 100644
index 00000000000..c7247d03423
--- /dev/null
+++ b/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToContainerRegistryImportTargetPlan < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :application_settings, :container_registry_import_target_plan, 255
+ end
+
+ def down
+ remove_text_limit :application_settings, :container_registry_import_target_plan
+ end
+end
diff --git a/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb b/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb
new file mode 100644
index 00000000000..32ca8a5fb12
--- /dev/null
+++ b/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddRunnerTokenExpirationIntervalSettingsToApplicationSettings < Gitlab::Database::Migration[1.0]
+ def change
+ [:runner_token_expiration_interval, :group_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field|
+ add_column :application_settings, field, :integer
+ end
+ end
+end
diff --git a/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb b/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb
new file mode 100644
index 00000000000..7b83cb2dd55
--- /dev/null
+++ b/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddRunnerTokenExpirationIntervalSettingsToNamespaceSettings < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ [:runner_token_expiration_interval, :subgroup_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field|
+ add_column :namespace_settings, field, :integer
+ end
+ end
+end
diff --git a/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb b/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb
new file mode 100644
index 00000000000..ef959171828
--- /dev/null
+++ b/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddRunnerTokenExpirationIntervalSettingsToProjectSettings < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ add_column :project_ci_cd_settings, :runner_token_expiration_interval, :integer
+ end
+end
diff --git a/db/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/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb b/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb
index 96eea2d5d77..0e85fb40a36 100644
--- a/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb
+++ b/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb
@@ -1,34 +1,9 @@
# frozen_string_literal: true
class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences2 < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 2_500
-
- disable_ddl_transaction!
-
- class VulnerabilitiesFinding < ActiveRecord::Base
- include ::EachBatch
- self.inheritance_column = :_type_disabled
-
- self.table_name = "vulnerability_occurrences"
- end
-
def up
- # Make sure that RemoveDuplicateVulnerabilitiesFindings has finished running
- # so that we don't run into duplicate UUID issues
- Gitlab::BackgroundMigration.steal('RemoveDuplicateVulnerabilitiesFindings')
-
- say "Scheduling #{MIGRATION} jobs"
- queue_background_migration_jobs_by_range_at_intervals(
- VulnerabilitiesFinding,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
+ # no-op
+ # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
end
def down
diff --git a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb b/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
index c59c71708ca..0e6f1c50534 100644
--- a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
+++ b/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
@@ -1,27 +1,9 @@
# frozen_string_literal: true
class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences3 < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 2_500
-
- disable_ddl_transaction!
-
def up
- # Make sure that RemoveDuplicateVulnerabilitiesFindings has finished running
- # so that we don't run into duplicate UUID issues
- Gitlab::BackgroundMigration.steal('RemoveDuplicateVulnerabilitiesFindings')
-
- say "Scheduling #{MIGRATION} jobs"
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('vulnerability_occurrences'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
+ # no-op
+ # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
end
def down
diff --git a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
index 88351b3007a..c03c379dcc0 100644
--- a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
+++ b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
@@ -1,15 +1,9 @@
# frozen_string_literal: true
class ReschedulePendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0]
- MIGRATION = "RecalculateVulnerabilitiesOccurrencesUuid"
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
def up
- delete_queued_jobs(MIGRATION)
-
- requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL)
+ # no-op
+ # no replacement because we will reschedule this for the whole table
end
def down
diff --git a/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb b/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb
new file mode 100644
index 00000000000..599342e83e3
--- /dev/null
+++ b/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class CleanupAfterDropInvalidSecurityFindings < Gitlab::Database::Migration[1.0]
+ MIGRATION = "DropInvalidSecurityFindings"
+ INDEX_NAME = "tmp_index_uuid_is_null"
+
+ disable_ddl_transaction!
+
+ def up
+ # Make sure all jobs scheduled by
+ # db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb
+ # are finished
+ finalize_background_migration(MIGRATION)
+ # Created by db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb
+ remove_concurrent_index_by_name :security_findings, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index(
+ :security_findings,
+ :id,
+ where: "uuid IS NULL",
+ name: INDEX_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb b/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb
new file mode 100644
index 00000000000..0e370dfc5f8
--- /dev/null
+++ b/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class AddIndexesForPrimaryEmailCleanupMigration < Gitlab::Database::Migration[1.0]
+ USERS_INDEX = :index_users_on_id_for_primary_email_migration
+ EMAIL_INDEX = :index_emails_on_email_user_id
+
+ disable_ddl_transaction!
+
+ def up
+ unless index_exists_by_name?(:users, USERS_INDEX)
+
+ disable_statement_timeout do
+ execute <<~SQL
+ CREATE INDEX CONCURRENTLY #{USERS_INDEX}
+ ON users (id) INCLUDE (email, confirmed_at)
+ WHERE confirmed_at IS NOT NULL
+ SQL
+ end
+ end
+
+ add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
+ end
+
+ def down
+ remove_concurrent_index_by_name :users, USERS_INDEX
+ remove_concurrent_index_by_name :emails, EMAIL_INDEX
+ end
+end
diff --git a/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb b/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb
new file mode 100644
index 00000000000..14f6c751e4d
--- /dev/null
+++ b/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb
@@ -0,0 +1,59 @@
+# frozen_string_literal: true
+
+class CleanupAfterAddPrimaryEmailToEmailsIfUserConfirmed < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ MIGRATION_NAME = 'AddPrimaryEmailToEmailsIfUserConfirmed'
+ BATCH_SIZE = 10_000
+
+ # Stubbed class to access the User table
+ class User < ActiveRecord::Base
+ include ::EachBatch
+
+ self.table_name = 'users'
+ self.inheritance_column = :_type_disabled
+
+ scope :confirmed, -> { where.not(confirmed_at: nil) }
+
+ has_many :emails
+ end
+
+ # Stubbed class to access the Emails table
+ class Email < ActiveRecord::Base
+ self.table_name = 'emails'
+ self.inheritance_column = :_type_disabled
+
+ belongs_to :user
+ end
+
+ def up
+ finalize_background_migration(MIGRATION_NAME)
+
+ # Select confirmed users that do not have their primary email in the emails table,
+ # and create the email record. There should be none if the background migration
+ # completed, but in case there is any leftover, we deal with it synchronously.
+ not_exists_condition = 'NOT EXISTS (SELECT 1 FROM emails WHERE emails.email = users.email AND emails.user_id = users.id)'
+
+ User.confirmed.each_batch(of: BATCH_SIZE) do |user_batch|
+ user_batch.select(:id, :email, :confirmed_at).where(not_exists_condition).each do |user|
+ current_time = Time.now.utc
+
+ begin
+ Email.create(
+ user_id: user.id,
+ email: user.email,
+ confirmed_at: user.confirmed_at,
+ created_at: current_time,
+ updated_at: current_time
+ )
+ rescue StandardError => error
+ Gitlab::AppLogger.error("Could not add primary email #{user.email} to emails for user with ID #{user.id} due to #{error}")
+ end
+ end
+ end
+ end
+
+ def down
+ # Intentionally left blank
+ end
+end
diff --git a/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb
new file mode 100644
index 00000000000..959bf61a6cc
--- /dev/null
+++ b/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type'
+
+ def up
+ add_concurrent_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
new file mode 100644
index 00000000000..cc37f2dc65d
--- /dev/null
+++ b/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0]
+ MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid'
+
+ def up
+ delete_job_tracking(
+ MIGRATION_NAME,
+ status: %w[pending succeeded]
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb b/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
new file mode 100644
index 00000000000..13abf8b5540
--- /dev/null
+++ b/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences4 < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
+ DELAY_INTERVAL = 2.minutes.to_i
+ BATCH_SIZE = 2_500
+
+ disable_ddl_transaction!
+
+ def up
+ # Make sure the migration removing Findings with attributes for which UUID would be identical
+ # has finished
+ # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74008
+ Gitlab::BackgroundMigration.steal('RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings')
+
+ queue_background_migration_jobs_by_range_at_intervals(
+ define_batchable_model('vulnerability_occurrences'),
+ MIGRATION,
+ DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ track_jobs: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb b/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
new file mode 100644
index 00000000000..eaf07abe29d
--- /dev/null
+++ b/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+class RemoveExtraFindingEvidenceTablesForeignKeys < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences
+ remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests
+ remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses
+ remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences
+ remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages
+ remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences
+ remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages
+ remove_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences
+ remove_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences
+ end
+ end
+
+ def down
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences, on_delete: :cascade
+ end
+
+ with_lock_retries do
+ add_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences, on_delete: :cascade
+ end
+ end
+end
diff --git a/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb b/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
new file mode 100644
index 00000000000..9a246a8c707
--- /dev/null
+++ b/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb
@@ -0,0 +1,71 @@
+# frozen_string_literal: true
+
+class RemoveExtraFindingEvidenceTables < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ drop_table :vulnerability_finding_evidence_assets, if_exists: true
+ drop_table :vulnerability_finding_evidence_headers, if_exists: true
+ drop_table :vulnerability_finding_evidence_requests, if_exists: true
+ drop_table :vulnerability_finding_evidence_responses, if_exists: true
+ drop_table :vulnerability_finding_evidence_sources, if_exists: true
+ drop_table :vulnerability_finding_evidence_supporting_messages, if_exists: true
+ end
+ end
+
+ def down
+ create_table :vulnerability_finding_evidence_assets, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_assets_on_finding_evidence_id' }, null: false
+ t.text :type, limit: 2048
+ t.text :name, limit: 2048
+ t.text :url, limit: 2048
+ end
+
+ create_table :vulnerability_finding_evidence_sources, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_sources_on_finding_evidence_id' }, null: false
+ t.text :name, limit: 2048
+ t.text :url, limit: 2048
+ end
+
+ create_table :vulnerability_finding_evidence_supporting_messages, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_supporting_messages_on_finding_evidence_id' }, null: false
+ t.text :name, limit: 2048
+ end
+
+ create_table :vulnerability_finding_evidence_requests, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_requests_on_finding_evidence_id' }, null: true
+ t.text :method, limit: 32
+ t.text :url, limit: 2048
+ t.text :body, limit: 2048
+ t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_requests_on_supporting_evidence_id' }, null: true
+ end
+
+ create_table :vulnerability_finding_evidence_responses, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_responses_on_finding_evidences_id' }, null: true
+ t.integer :status_code
+ t.text :reason_phrase, limit: 2048
+ t.text :body, limit: 2048
+ t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_responses_on_supporting_evidence_id' }, null: true
+ end
+
+ create_table :vulnerability_finding_evidence_headers, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.references :vulnerability_finding_evidence_request, index: { name: 'finding_evidence_header_on_finding_evidence_request_id' }, null: true
+ t.references :vulnerability_finding_evidence_response, index: { name: 'finding_evidence_header_on_finding_evidence_response_id' }, null: true
+ t.text :name, null: false, limit: 255
+ t.text :value, null: false, limit: 8192
+ end
+ end
+end
diff --git a/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb b/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb
new file mode 100644
index 00000000000..3d39148f402
--- /dev/null
+++ b/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ScheduleBackfillCiNamespaceMirrors < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'BackfillCiNamespaceMirrors'
+ BATCH_SIZE = 10_000
+ DELAY_INTERVAL = 2.minutes
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(
+ Gitlab::BackgroundMigration::BackfillCiNamespaceMirrors::Namespace.base_query,
+ MIGRATION,
+ DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ track_jobs: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb b/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb
new file mode 100644
index 00000000000..5678ee9f292
--- /dev/null
+++ b/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ScheduleBackfillCiProjectMirrors < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'BackfillCiProjectMirrors'
+ BATCH_SIZE = 10_000
+ DELAY_INTERVAL = 2.minutes
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(
+ Gitlab::BackgroundMigration::BackfillCiProjectMirrors::Project.base_query,
+ MIGRATION,
+ DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ track_jobs: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb b/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb
new file mode 100644
index 00000000000..07a2c079511
--- /dev/null
+++ b/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+class AddTmpIndexOnReportType < Gitlab::Database::Migration[1.0]
+ # Temporary index to perform migration fixing invalid vulnerability_occurrences.raw_metadata rows
+ # Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/349605
+ INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb b/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb
new file mode 100644
index 00000000000..757cbf60d4d
--- /dev/null
+++ b/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+class ConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0]
+ MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata
+ MODEL_CLASS = MIGRATION_CLASS::Finding
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 500
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(
+ MODEL_CLASS.by_api_report_types,
+ MIGRATION_CLASS,
+ DELAY_INTERVAL,
+ batch_size: BATCH_SIZE
+ )
+ end
+
+ def down
+ # no-op
+
+ # up fixes invalid data by updating columns in-place.
+ # It is a backwards-compatible change, and reversing it in a downgrade would not be desirable.
+ end
+end
diff --git a/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb b/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb
new file mode 100644
index 00000000000..54997dc4cc4
--- /dev/null
+++ b/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddTemporaryStaticObjectTokenIndex < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_users_with_static_object_token'
+
+ def up
+ add_concurrent_index :users, :id, where: "static_object_token IS NOT NULL AND static_object_token_encrypted IS NULL", name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index :users, :id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211210140629_encrypt_static_object_token.rb b/db/post_migrate/20211210140629_encrypt_static_object_token.rb
new file mode 100644
index 00000000000..fe4db9fc14c
--- /dev/null
+++ b/db/post_migrate/20211210140629_encrypt_static_object_token.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class EncryptStaticObjectToken < Gitlab::Database::Migration[1.0]
+ BATCH_SIZE = 10_000
+ MIGRATION = 'EncryptStaticObjectToken'
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(
+ define_batchable_model('users').where.not(static_object_token: nil).where(static_object_token_encrypted: nil),
+ MIGRATION,
+ 2.minutes,
+ batch_size: BATCH_SIZE,
+ track_jobs: true
+ )
+ end
+
+ def down
+ # no ops
+ end
+end
diff --git a/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb b/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
new file mode 100644
index 00000000000..7f0168be1a4
--- /dev/null
+++ b/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'BackfillIncidentIssueEscalationStatuses'
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 20_000
+
+ disable_ddl_transaction!
+
+ class Issue < ActiveRecord::Base
+ include EachBatch
+
+ self.table_name = 'issues'
+ end
+
+ def up
+ relation = Issue.all
+
+ queue_background_migration_jobs_by_range_at_intervals(
+ relation, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE, track_jobs: true)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb
new file mode 100644
index 00000000000..310a49a667e
--- /dev/null
+++ b/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb
@@ -0,0 +1,41 @@
+# frozen_string_literal: true
+
+class ModifyKubernetesResourceLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ OLD_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_cluster_id'
+ OLD_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id'
+
+ NEW_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_cluster_id'
+ NEW_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_agent_id'
+
+ def up
+ add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'cluster_id')",
+ using: 'GIN',
+ where: 'report_type = 7',
+ name: NEW_CLUSTER_ID_INDEX_NAME
+
+ add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'agent_id')",
+ using: 'GIN',
+ where: 'report_type = 7',
+ name: NEW_AGENT_ID_INDEX_NAME
+
+ remove_concurrent_index_by_name :vulnerability_occurrences, OLD_CLUSTER_ID_INDEX_NAME
+ remove_concurrent_index_by_name :vulnerability_occurrences, OLD_AGENT_ID_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :vulnerability_occurrences, "(location -> 'cluster_id')",
+ using: 'GIN',
+ where: 'report_type = 7',
+ name: OLD_CLUSTER_ID_INDEX_NAME
+
+ add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')",
+ using: 'GIN',
+ where: 'report_type = 7',
+ name: OLD_AGENT_ID_INDEX_NAME
+
+ remove_concurrent_index_by_name :vulnerability_occurrences, NEW_CLUSTER_ID_INDEX_NAME
+ remove_concurrent_index_by_name :vulnerability_occurrences, NEW_AGENT_ID_INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb
new file mode 100644
index 00000000000..a05d68279c3
--- /dev/null
+++ b/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddIndexToEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0]
+ # no-op
+ # see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77436
+
+ def up
+ # no-op
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb b/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb
new file mode 100644
index 00000000000..316209ae1f4
--- /dev/null
+++ b/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class MarkRecalculateFindingSignaturesAsCompleted < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid'
+
+ def up
+ # Only run migration for Gitlab.com
+ return unless ::Gitlab.com?
+
+ # In previous migration marking jobs as successful was missed
+ Gitlab::Database::BackgroundMigrationJob
+ .for_migration_class(MIGRATION)
+ .pending
+ .update_all(status: :succeeded)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb b/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb
new file mode 100644
index 00000000000..1d61aec401e
--- /dev/null
+++ b/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class DropTemporaryIndexesForPrimaryEmailMigration < Gitlab::Database::Migration[1.0]
+ USERS_INDEX = :index_users_on_id_for_primary_email_migration
+ EMAIL_INDEX = :index_emails_on_email_user_id
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :users, USERS_INDEX
+ remove_concurrent_index_by_name :emails, EMAIL_INDEX
+ end
+
+ def down
+ unless index_exists_by_name?(:users, USERS_INDEX)
+
+ disable_statement_timeout do
+ execute <<~SQL
+ CREATE INDEX CONCURRENTLY #{USERS_INDEX}
+ ON users (id) INCLUDE (email, confirmed_at)
+ WHERE confirmed_at IS NOT NULL
+ SQL
+ end
+ end
+
+ add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX
+ end
+end
diff --git a/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb b/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb
new file mode 100644
index 00000000000..c98d3d05f2f
--- /dev/null
+++ b/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexOnCiPipelinesUserIdIdFailureReason < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified'
+
+ def up
+ add_concurrent_index :ci_pipelines, [:user_id, :id], order: { id: :desc }, where: 'failure_reason = 3', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211220123956_update_invalid_member_states.rb b/db/post_migrate/20211220123956_update_invalid_member_states.rb
new file mode 100644
index 00000000000..5da100f0ec2
--- /dev/null
+++ b/db/post_migrate/20211220123956_update_invalid_member_states.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class UpdateInvalidMemberStates < Gitlab::Database::Migration[1.0]
+ class Member < ActiveRecord::Base
+ include EachBatch
+
+ self.table_name = 'members'
+
+ scope :in_invalid_state, -> { where(state: 2) }
+ end
+
+ def up
+ Member.in_invalid_state.each_batch do |relation|
+ relation.update_all(state: 0)
+ end
+ end
+
+ def down
+ # no-op as we don't need to revert any changed records
+ end
+end
diff --git a/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb
new file mode 100644
index 00000000000..5338cab3871
--- /dev/null
+++ b/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddAsyncIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type'
+
+ def up
+ prepare_async_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index_by_name :ci_job_artifacts, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb
new file mode 100644
index 00000000000..2215a49e286
--- /dev/null
+++ b/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveIndexEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0]
+ INDEX_NAME = 'index_events_on_author_id_and_action_and_id'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :events, name: INDEX_NAME
+ end
+
+ def down
+ # no-op
+ # The index had been added in the same milestone.
+ # Adding back the index takes a long time and should not be needed.
+ end
+end
diff --git a/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb b/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb
new file mode 100644
index 00000000000..e4cdc9add39
--- /dev/null
+++ b/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddIndexToEventsOnAuthorIdAndId < Gitlab::Database::Migration[1.0]
+ INDEX_NAME = 'index_events_on_author_id_and_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :events, [:author_id, :id], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :events, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb b/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb
new file mode 100644
index 00000000000..9be81e00b50
--- /dev/null
+++ b/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveForeignKeyCiGroupVariablesGroupId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_33ae4d58d8'
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_group_variables, :namespaces, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :ci_group_variables, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb b/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb
new file mode 100644
index 00000000000..b072d5616f5
--- /dev/null
+++ b/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveCiMinutesAdditionalPacksNamespaceIdForeignKeyConstraint < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_rails_e0e0c4e4b1'
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_minutes_additional_packs, :namespaces, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :ci_minutes_additional_packs, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb b/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb
new file mode 100644
index 00000000000..ece20f8095d
--- /dev/null
+++ b/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_fd1858fefd'
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :namespaces, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :ci_daily_build_group_report_results, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb b/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb
new file mode 100644
index 00000000000..1304f19708e
--- /dev/null
+++ b/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveForeignKeyCiPendingBuildsNamespaceId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_fdc0137e4a'
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_pending_builds, :namespaces, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :ci_pending_builds, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb b/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb
new file mode 100644
index 00000000000..61ca066401e
--- /dev/null
+++ b/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveForeignKeyCiRunnerNamespacesNamespaceId < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_rails_f9d9ed3308'
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_runner_namespaces, :namespaces, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key :ci_runner_namespaces, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb b/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb
new file mode 100644
index 00000000000..06be8edd707
--- /dev/null
+++ b/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIdxVulnerabilityOccurrencesDedupAgain < Gitlab::Database::Migration[1.0]
+ TABLE = :vulnerability_occurrences
+ INDEX_NAME = 'index_vulnerability_occurrences_deduplication'
+ COLUMNS = %i[project_id report_type project_fingerprint]
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME
+ end
+
+ def down
+ # nothing to do here
+ end
+end
diff --git a/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb b/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb
new file mode 100644
index 00000000000..dae93e1636d
--- /dev/null
+++ b/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class SchedulePopulateTestReportsIssueId < Gitlab::Database::Migration[1.0]
+ MIGRATION = 'PopulateTestReportsIssueId'
+ DELAY_INTERVAL = 2.minutes.to_i
+ BATCH_SIZE = 30
+
+ disable_ddl_transaction!
+
+ def up
+ queue_background_migration_jobs_by_range_at_intervals(
+ define_batchable_model('requirements_management_test_reports').where(issue_id: nil),
+ MIGRATION,
+ DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ track_jobs: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb
new file mode 100644
index 00000000000..d91cd3b43ef
--- /dev/null
+++ b/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveDastScannerProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_e4c49200f8'
+
+ def up
+ with_lock_retries do
+ execute('LOCK ci_builds, dast_scanner_profiles_builds IN ACCESS EXCLUSIVE MODE')
+ remove_foreign_key_if_exists(:dast_scanner_profiles_builds, :ci_builds, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:dast_scanner_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
+ end
+end
diff --git a/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb b/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb
new file mode 100644
index 00000000000..dd8c6de4aaf
--- /dev/null
+++ b/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveRequirementsManagementTestReportsBuildIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_rails_e67d085910'
+
+ def up
+ with_lock_retries do
+ execute('LOCK ci_builds, requirements_management_test_reports IN ACCESS EXCLUSIVE MODE')
+ remove_foreign_key_if_exists(:requirements_management_test_reports, :ci_builds, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:requirements_management_test_reports, :ci_builds, column: :build_id, on_delete: :nullify, name: CONSTRAINT_NAME)
+ end
+end
diff --git a/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb
new file mode 100644
index 00000000000..00d8a39216b
--- /dev/null
+++ b/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveDastSiteProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_a325505e99'
+
+ def up
+ with_lock_retries do
+ execute('LOCK ci_builds, dast_site_profiles_builds IN ACCESS EXCLUSIVE MODE')
+ remove_foreign_key_if_exists(:dast_site_profiles_builds, :ci_builds, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:dast_site_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
+ end
+end
diff --git a/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb b/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb
new file mode 100644
index 00000000000..20782664f63
--- /dev/null
+++ b/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveSecurityScansBuildIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = 'fk_rails_4ef1e6b4c6'
+
+ def up
+ with_lock_retries do
+ execute('LOCK ci_builds, security_scans IN ACCESS EXCLUSIVE MODE')
+ remove_foreign_key_if_exists(:security_scans, :ci_builds, name: CONSTRAINT_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:security_scans, :ci_builds, column: :build_id, on_delete: :cascade, name: CONSTRAINT_NAME)
+ end
+end
diff --git a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
new file mode 100644
index 00000000000..6de0f9424e8
--- /dev/null
+++ b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class IndexClusterAgentTokensOnStatus < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_cluster_agent_tokens_on_agent_id_status_last_used_at'
+
+ def up
+ add_concurrent_index :cluster_agent_tokens, 'agent_id, status, last_used_at DESC NULLS LAST', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb b/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb
new file mode 100644
index 00000000000..795ec24f3bd
--- /dev/null
+++ b/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class TruncateCiMirrorTables < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ execute('TRUNCATE TABLE ci_namespace_mirrors')
+ execute('TRUNCATE TABLE ci_project_mirrors')
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb b/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb
new file mode 100644
index 00000000000..bc17c125ba7
--- /dev/null
+++ b/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiPendingBuildsFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb b/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb
new file mode 100644
index 00000000000..79d864e2c2a
--- /dev/null
+++ b/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiRunningBuildsFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ execute('LOCK projects, ci_running_builds IN ACCESS EXCLUSIVE MODE')
+
+ remove_foreign_key_if_exists(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
new file mode 100644
index 00000000000..d786c9d846a
--- /dev/null
+++ b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveCascadeDeleteFromProjectNamespaceForeignKey < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ TARGET_COLUMN = :project_namespace_id
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
+ end
+
+ add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :nullify)
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
+ end
+
+ add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade)
+ end
+end
diff --git a/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
new file mode 100644
index 00000000000..9ad90a3a7a0
--- /dev/null
+++ b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiUnitTestsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb b/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb
new file mode 100644
index 00000000000..ad7cf2a20c9
--- /dev/null
+++ b/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ execute('LOCK projects, ci_daily_build_group_report_results IN ACCESS EXCLUSIVE MODE')
+ remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb b/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb
new file mode 100644
index 00000000000..13cfacdc223
--- /dev/null
+++ b/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiFreezePeriodsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb b/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb
new file mode 100644
index 00000000000..e86dd015493
--- /dev/null
+++ b/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiResourceGroupsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_resource_groups, :projects, name: "fk_774722d144")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_resource_groups, :projects, name: "fk_774722d144", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb b/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb
new file mode 100644
index 00000000000..3d2753bf9bf
--- /dev/null
+++ b/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiBuildReportResultsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_build_report_results, :projects, name: "fk_rails_056d298d48")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_build_report_results, :projects, name: "fk_rails_056d298d48", column: :project_id, target_column: :id, on_delete: "cascade")
+ end
+end
diff --git a/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb b/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
new file mode 100644
index 00000000000..966286a6730
--- /dev/null
+++ b/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveUsersCiJobTokenProjectScopeLinksAddedByIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce", column: :added_by_id, target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb b/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb
new file mode 100644
index 00000000000..2e5d4cfd22e
--- /dev/null
+++ b/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveUsersCiPipelineSchedulesOwnerIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2", column: :owner_id, target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20220114105525_add_index_on_projects_path.rb b/db/post_migrate/20220114105525_add_index_on_projects_path.rb
new file mode 100644
index 00000000000..cef38f91b21
--- /dev/null
+++ b/db/post_migrate/20220114105525_add_index_on_projects_path.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexOnProjectsPath < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ TABLE = :projects
+ INDEX_NAME = 'index_on_projects_path'
+ COLUMN = :path
+
+ def up
+ add_concurrent_index TABLE, COLUMN, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index TABLE, COLUMN, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb b/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb
new file mode 100644
index 00000000000..1ea89609926
--- /dev/null
+++ b/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddAuthorIndexToDesignManagementVersions < Gitlab::Database::Migration[1.0]
+ TABLE = :design_management_versions
+ INDEX_NAME = 'index_design_management_versions_on_author_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index TABLE, :author_id, where: 'author_id IS NOT NULL', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index TABLE, :author_id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb b/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb
new file mode 100644
index 00000000000..59a003c8f8d
--- /dev/null
+++ b/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveProjectsCiPipelineArtifactsProjectIdFk < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ execute('LOCK projects, ci_pipeline_artifacts IN ACCESS EXCLUSIVE MODE')
+
+ remove_foreign_key_if_exists(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6", column: :project_id, target_column: :id, on_delete: :cascade)
+ end
+end
diff --git a/db/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/db/schema_migrations/20210811193033 b/db/schema_migrations/20210811193033
new file mode 100644
index 00000000000..0d97d5a238a
--- /dev/null
+++ b/db/schema_migrations/20210811193033
@@ -0,0 +1 @@
+a7e259fa72dfdfa40137d278499d6b63b84f939f46936c0f4ed289ed152d9356 \ No newline at end of file
diff --git a/db/schema_migrations/20211026124336 b/db/schema_migrations/20211026124336
new file mode 100644
index 00000000000..dc6663e81a8
--- /dev/null
+++ b/db/schema_migrations/20211026124336
@@ -0,0 +1 @@
+a6807d2c17c4efdc759f39101856d7a082ae4d531ca3ced525de10e3de808b9d \ No newline at end of file
diff --git a/db/schema_migrations/20211123161906 b/db/schema_migrations/20211123161906
new file mode 100644
index 00000000000..1370811b3af
--- /dev/null
+++ b/db/schema_migrations/20211123161906
@@ -0,0 +1 @@
+46767d804bde08ad4a076f20436652f980eb935a79b2ad30b4735b956be69a7a \ No newline at end of file
diff --git a/db/schema_migrations/20211206161271 b/db/schema_migrations/20211206161271
new file mode 100644
index 00000000000..8a2561eec24
--- /dev/null
+++ b/db/schema_migrations/20211206161271
@@ -0,0 +1 @@
+fa4a39c3bea70d31e8144f8830ef0353f22a7a663a891d9043e79f362058fbde \ No newline at end of file
diff --git a/db/schema_migrations/20211206162601 b/db/schema_migrations/20211206162601
new file mode 100644
index 00000000000..5e19e21507d
--- /dev/null
+++ b/db/schema_migrations/20211206162601
@@ -0,0 +1 @@
+529c7ea38bbaa0c29491c2dfdb654a4a6adba93122d9bc23d6632526ff7fdb05 \ No newline at end of file
diff --git a/db/schema_migrations/20211207081708 b/db/schema_migrations/20211207081708
new file mode 100644
index 00000000000..b2fbb704451
--- /dev/null
+++ b/db/schema_migrations/20211207081708
@@ -0,0 +1 @@
+e26065e63eca51e4138b6e9f07e9ec1ee45838afa82c5832849e360375beeae2 \ No newline at end of file
diff --git a/db/schema_migrations/20211207125331 b/db/schema_migrations/20211207125331
new file mode 100644
index 00000000000..833d5d0a383
--- /dev/null
+++ b/db/schema_migrations/20211207125331
@@ -0,0 +1 @@
+5ead867b7609248f702771078849c48c0558f5fe9a3021fbb32e4f9174af653a \ No newline at end of file
diff --git a/db/schema_migrations/20211207135331 b/db/schema_migrations/20211207135331
new file mode 100644
index 00000000000..b4085490cc8
--- /dev/null
+++ b/db/schema_migrations/20211207135331
@@ -0,0 +1 @@
+3d9dcab49ee409da8c1ab398101041092e566b06a7bb2764db49a9201a0e5f0c \ No newline at end of file
diff --git a/db/schema_migrations/20211207173510 b/db/schema_migrations/20211207173510
new file mode 100644
index 00000000000..09474e1c643
--- /dev/null
+++ b/db/schema_migrations/20211207173510
@@ -0,0 +1 @@
+0a4ac9de84b8351f39e549904d9e661648b496e6e3183c4ff5eb22b70d5ba7e9 \ No newline at end of file
diff --git a/db/schema_migrations/20211207173511 b/db/schema_migrations/20211207173511
new file mode 100644
index 00000000000..93b44c20390
--- /dev/null
+++ b/db/schema_migrations/20211207173511
@@ -0,0 +1 @@
+8f41f45c5ef23eafae2e67951497b5752f4b30ecf73ae3c08f61febfa4fb17be \ No newline at end of file
diff --git a/db/schema_migrations/20211208122200 b/db/schema_migrations/20211208122200
new file mode 100644
index 00000000000..1e4910d3a3c
--- /dev/null
+++ b/db/schema_migrations/20211208122200
@@ -0,0 +1 @@
+8dec4379f34773e979cf6b33ba608185827c37b1a95c74d6472b7562c16d6110 \ No newline at end of file
diff --git a/db/schema_migrations/20211208122201 b/db/schema_migrations/20211208122201
new file mode 100644
index 00000000000..fb770a6d5fd
--- /dev/null
+++ b/db/schema_migrations/20211208122201
@@ -0,0 +1 @@
+f58ccb07fa67ede2a50fa5ff6bddbe4bb89a622e84786fc4bfb404c11b9dbab4 \ No newline at end of file
diff --git a/db/schema_migrations/20211209203820 b/db/schema_migrations/20211209203820
new file mode 100644
index 00000000000..cdff024b597
--- /dev/null
+++ b/db/schema_migrations/20211209203820
@@ -0,0 +1 @@
+c501bc857cef21a8657508e9a286feb3c6f5db873247707e051a8702b1e80e79 \ No newline at end of file
diff --git a/db/schema_migrations/20211209203821 b/db/schema_migrations/20211209203821
new file mode 100644
index 00000000000..890d3db0b3a
--- /dev/null
+++ b/db/schema_migrations/20211209203821
@@ -0,0 +1 @@
+4e8e0917bcfcadf288425e82eeb3747d775bb301017a9b320b694cd43ed0d60a \ No newline at end of file
diff --git a/db/schema_migrations/20211209230042 b/db/schema_migrations/20211209230042
new file mode 100644
index 00000000000..818734c1330
--- /dev/null
+++ b/db/schema_migrations/20211209230042
@@ -0,0 +1 @@
+907fafc18fa515fff8f716f6464263ccc8a9b6e5ead36f30b05089100fd71b6b \ No newline at end of file
diff --git a/db/schema_migrations/20211210025754 b/db/schema_migrations/20211210025754
new file mode 100644
index 00000000000..f2fd6e506b8
--- /dev/null
+++ b/db/schema_migrations/20211210025754
@@ -0,0 +1 @@
+d39b46bfd4bdf81cd4969190d08dce2260b4f476564a2e6c3e05d69b87c1c6df \ No newline at end of file
diff --git a/db/schema_migrations/20211210031721 b/db/schema_migrations/20211210031721
new file mode 100644
index 00000000000..57bbcccd347
--- /dev/null
+++ b/db/schema_migrations/20211210031721
@@ -0,0 +1 @@
+6d62200480e46b356fe07eeb2c99b0fb441dadd00faf30079722c617facab7cc \ No newline at end of file
diff --git a/db/schema_migrations/20211210140000 b/db/schema_migrations/20211210140000
new file mode 100644
index 00000000000..b64d8251d69
--- /dev/null
+++ b/db/schema_migrations/20211210140000
@@ -0,0 +1 @@
+f02c1b7412d2bb6d8a20639704ad55cdbcc14bfccf0509b659c3ef9614bcfa2b \ No newline at end of file
diff --git a/db/schema_migrations/20211210140629 b/db/schema_migrations/20211210140629
new file mode 100644
index 00000000000..ad631461d87
--- /dev/null
+++ b/db/schema_migrations/20211210140629
@@ -0,0 +1 @@
+7940b0f692b62bcabbe98440082e2245fd28caba2c9e052e85e82acea0a98d23 \ No newline at end of file
diff --git a/db/schema_migrations/20211213142344 b/db/schema_migrations/20211213142344
new file mode 100644
index 00000000000..2bcbb15c218
--- /dev/null
+++ b/db/schema_migrations/20211213142344
@@ -0,0 +1 @@
+837539e12be12830d388bc6142622412b40ac061c397504eac03033a08f01e72 \ No newline at end of file
diff --git a/db/schema_migrations/20211213154259 b/db/schema_migrations/20211213154259
new file mode 100644
index 00000000000..0555d0c6600
--- /dev/null
+++ b/db/schema_migrations/20211213154259
@@ -0,0 +1 @@
+fccb1d6c7ac4e31cecaf7bc2e23f13f6c8147a3820cbd996a545a5b01cc03865 \ No newline at end of file
diff --git a/db/schema_migrations/20211213154704 b/db/schema_migrations/20211213154704
new file mode 100644
index 00000000000..0d9ba6457ba
--- /dev/null
+++ b/db/schema_migrations/20211213154704
@@ -0,0 +1 @@
+deec24bae35829454a09d4e97478c0b57d5f80e3271f96b2554b1ab10dc84d7f \ No newline at end of file
diff --git a/db/schema_migrations/20211214012507 b/db/schema_migrations/20211214012507
new file mode 100644
index 00000000000..7bac6c6d8c5
--- /dev/null
+++ b/db/schema_migrations/20211214012507
@@ -0,0 +1 @@
+a7aa1ffccce785d365720309e3773f167075a9d06805eea941e6cd47bc918471 \ No newline at end of file
diff --git a/db/schema_migrations/20211215182006 b/db/schema_migrations/20211215182006
new file mode 100644
index 00000000000..480a1e2369b
--- /dev/null
+++ b/db/schema_migrations/20211215182006
@@ -0,0 +1 @@
+ead2a1b13438514bb97bea3f1656f9bac352a8c733d9f808b2405685bce91e00 \ No newline at end of file
diff --git a/db/schema_migrations/20211216133107 b/db/schema_migrations/20211216133107
new file mode 100644
index 00000000000..c841207fffc
--- /dev/null
+++ b/db/schema_migrations/20211216133107
@@ -0,0 +1 @@
+a0c3a9746250aa67ffa8d05486fb6997c8d839b8bce7e870c0415c25600c5434 \ No newline at end of file
diff --git a/db/schema_migrations/20211216134134 b/db/schema_migrations/20211216134134
new file mode 100644
index 00000000000..09c3a59cc98
--- /dev/null
+++ b/db/schema_migrations/20211216134134
@@ -0,0 +1 @@
+c53a1e4405187620929b8fc6877786cb713d13218f7385d1b9b3daaf6072fa05 \ No newline at end of file
diff --git a/db/schema_migrations/20211216135651 b/db/schema_migrations/20211216135651
new file mode 100644
index 00000000000..a94bdb329f1
--- /dev/null
+++ b/db/schema_migrations/20211216135651
@@ -0,0 +1 @@
+9b733363587957b4044bc6806dfbb9632ec7f5f6ffc8c82280e025012b8acb5a \ No newline at end of file
diff --git a/db/schema_migrations/20211216220939 b/db/schema_migrations/20211216220939
new file mode 100644
index 00000000000..3fe48da6ca2
--- /dev/null
+++ b/db/schema_migrations/20211216220939
@@ -0,0 +1 @@
+649cf0eb794904457b230c1240d2bea8a6e80b00dbf6b2d25b95c66247460aa4 \ No newline at end of file
diff --git a/db/schema_migrations/20211217050753 b/db/schema_migrations/20211217050753
new file mode 100644
index 00000000000..bfc571acab1
--- /dev/null
+++ b/db/schema_migrations/20211217050753
@@ -0,0 +1 @@
+fe5cbf928d45d506132078678cf70264f01190cfe581628a5038d77f68a52961 \ No newline at end of file
diff --git a/db/schema_migrations/20211217120000 b/db/schema_migrations/20211217120000
new file mode 100644
index 00000000000..d4efb66b985
--- /dev/null
+++ b/db/schema_migrations/20211217120000
@@ -0,0 +1 @@
+d4360d6057602ec1f5e6e9d11c93cfbb16d878e9ecd4d5bfb1bed1c01e14c7a3 \ No newline at end of file
diff --git a/db/schema_migrations/20211217145923 b/db/schema_migrations/20211217145923
new file mode 100644
index 00000000000..8a94da00fc8
--- /dev/null
+++ b/db/schema_migrations/20211217145923
@@ -0,0 +1 @@
+2e35347592530f2a73e1cd75871438e29d277a206f621989e2c897fc587b6f5d \ No newline at end of file
diff --git a/db/schema_migrations/20211217174331 b/db/schema_migrations/20211217174331
new file mode 100644
index 00000000000..32657e28f96
--- /dev/null
+++ b/db/schema_migrations/20211217174331
@@ -0,0 +1 @@
+649360f4069aac4784f4d039015f8dda3f4bae28e8132f841e25b48f034a392e \ No newline at end of file
diff --git a/db/schema_migrations/20211220064757 b/db/schema_migrations/20211220064757
new file mode 100644
index 00000000000..675596f1ce6
--- /dev/null
+++ b/db/schema_migrations/20211220064757
@@ -0,0 +1 @@
+34bfe07fff59a415540ca2c5c96b33dc9030c15b2ffbb30cb7deedeb939ae132 \ No newline at end of file
diff --git a/db/schema_migrations/20211220120402 b/db/schema_migrations/20211220120402
new file mode 100644
index 00000000000..c2bb4f8da7e
--- /dev/null
+++ b/db/schema_migrations/20211220120402
@@ -0,0 +1 @@
+157128732c321577b7fa7a1b3d252ff70a2a62b34cd1e6edea59da4e632a1755 \ No newline at end of file
diff --git a/db/schema_migrations/20211220123956 b/db/schema_migrations/20211220123956
new file mode 100644
index 00000000000..291fdc306b5
--- /dev/null
+++ b/db/schema_migrations/20211220123956
@@ -0,0 +1 @@
+088d17a1f55522c48e69ec78717b39b8c7538474a9263621bba1fa0280a27ad7 \ No newline at end of file
diff --git a/db/schema_migrations/20211220174504 b/db/schema_migrations/20211220174504
new file mode 100644
index 00000000000..ed8f5f35efc
--- /dev/null
+++ b/db/schema_migrations/20211220174504
@@ -0,0 +1 @@
+80c1ad5815ef68ab1a7d63566d478683b3f9a5169ed15ecd6f44f7f542d40dc8 \ No newline at end of file
diff --git a/db/schema_migrations/20211223125921 b/db/schema_migrations/20211223125921
new file mode 100644
index 00000000000..b4e3a1583df
--- /dev/null
+++ b/db/schema_migrations/20211223125921
@@ -0,0 +1 @@
+e08c1634376ed78b78c4a54d874bed66c1ce40c7c509b67cfda00d1a8657f127 \ No newline at end of file
diff --git a/db/schema_migrations/20211224112937 b/db/schema_migrations/20211224112937
new file mode 100644
index 00000000000..98296f9a270
--- /dev/null
+++ b/db/schema_migrations/20211224112937
@@ -0,0 +1 @@
+3709c5c229e45ff0f594d6291d0b2b9a167b3bf4f5b29158b9abdac333a638b8 \ No newline at end of file
diff --git a/db/schema_migrations/20211224114539 b/db/schema_migrations/20211224114539
new file mode 100644
index 00000000000..2d7494e4291
--- /dev/null
+++ b/db/schema_migrations/20211224114539
@@ -0,0 +1 @@
+f4ac776ec4213d6fcd07ccfa913f51e1386ff212bf47d27817b24b501a78443b \ No newline at end of file
diff --git a/db/schema_migrations/20211229023654 b/db/schema_migrations/20211229023654
new file mode 100644
index 00000000000..f34b188c5d3
--- /dev/null
+++ b/db/schema_migrations/20211229023654
@@ -0,0 +1 @@
+8019915a00f62c137ee48c860c888e9d43f7253a5ea1a684ba2abe8bbe8016df \ No newline at end of file
diff --git a/db/schema_migrations/20211230112517 b/db/schema_migrations/20211230112517
new file mode 100644
index 00000000000..bd22204d82d
--- /dev/null
+++ b/db/schema_migrations/20211230112517
@@ -0,0 +1 @@
+32c4b0ad5b52b8990b4c0ab6e832d503be6fc802a30aa2de20c7d3ced7f04c36 \ No newline at end of file
diff --git a/db/schema_migrations/20211230113031 b/db/schema_migrations/20211230113031
new file mode 100644
index 00000000000..2f5b81768c8
--- /dev/null
+++ b/db/schema_migrations/20211230113031
@@ -0,0 +1 @@
+54201f4273226ed92ff0ed991fdba09c1108fccb764e6b9903e9f01e6acced1a \ No newline at end of file
diff --git a/db/schema_migrations/20220104060049 b/db/schema_migrations/20220104060049
new file mode 100644
index 00000000000..83c36018d73
--- /dev/null
+++ b/db/schema_migrations/20220104060049
@@ -0,0 +1 @@
+fa87b087b576d320f94028444a082b920870a2554209808849f9f3f42ead83c4 \ No newline at end of file
diff --git a/db/schema_migrations/20220104174445 b/db/schema_migrations/20220104174445
new file mode 100644
index 00000000000..fffb27113e2
--- /dev/null
+++ b/db/schema_migrations/20220104174445
@@ -0,0 +1 @@
+5e5e41ee4c8dc9c3fe791470862d15b8d213fcc931ef8b80937bdb5f5db20aed \ No newline at end of file
diff --git a/db/schema_migrations/20220105020514 b/db/schema_migrations/20220105020514
new file mode 100644
index 00000000000..4ad9266c7c0
--- /dev/null
+++ b/db/schema_migrations/20220105020514
@@ -0,0 +1 @@
+301c2f09f48aa3e34c2f679628a9542b4babc589e3d20e9ccf84a9209f5841ee \ No newline at end of file
diff --git a/db/schema_migrations/20220105121325 b/db/schema_migrations/20220105121325
new file mode 100644
index 00000000000..384616aba7f
--- /dev/null
+++ b/db/schema_migrations/20220105121325
@@ -0,0 +1 @@
+27ca3977a7569e98271eeb2bd224be1cfe5452ab3778665325b89bf966e07942 \ No newline at end of file
diff --git a/db/schema_migrations/20220106141756 b/db/schema_migrations/20220106141756
new file mode 100644
index 00000000000..7718a41500b
--- /dev/null
+++ b/db/schema_migrations/20220106141756
@@ -0,0 +1 @@
+cedca81a6dc1562cf0ed5f17217c52420a1cb9a74acece8d67eb1bcb948a7181 \ No newline at end of file
diff --git a/db/schema_migrations/20220106230629 b/db/schema_migrations/20220106230629
new file mode 100644
index 00000000000..e8751a6616c
--- /dev/null
+++ b/db/schema_migrations/20220106230629
@@ -0,0 +1 @@
+675d8f7bf77ddb860e707c25811d4eaaac1173c9fe62ce96c2708f0bbd0f4d48 \ No newline at end of file
diff --git a/db/schema_migrations/20220106230712 b/db/schema_migrations/20220106230712
new file mode 100644
index 00000000000..589b65d423c
--- /dev/null
+++ b/db/schema_migrations/20220106230712
@@ -0,0 +1 @@
+672b51ca014d208f971efe698edb8a8b32f541bf9d21a7f555c53f749ee936a4 \ No newline at end of file
diff --git a/db/schema_migrations/20220106231518 b/db/schema_migrations/20220106231518
new file mode 100644
index 00000000000..f7deaaa68b6
--- /dev/null
+++ b/db/schema_migrations/20220106231518
@@ -0,0 +1 @@
+aafb52337688e8b57712872f6f7e8e67da132406b244df5e11a736b01e23354f \ No newline at end of file
diff --git a/db/schema_migrations/20220106233459 b/db/schema_migrations/20220106233459
new file mode 100644
index 00000000000..2911e79d843
--- /dev/null
+++ b/db/schema_migrations/20220106233459
@@ -0,0 +1 @@
+fc44084057c5fd30f0e7918b4f856a60409f08ad1eb5c3fbc2d8ad5bad7f1ffd \ No newline at end of file
diff --git a/db/schema_migrations/20220106235626 b/db/schema_migrations/20220106235626
new file mode 100644
index 00000000000..d8d8e3b20d7
--- /dev/null
+++ b/db/schema_migrations/20220106235626
@@ -0,0 +1 @@
+34f966723cae63e831f7fc9d965cda90f1fd7bca522fc58e78a0de4b959a47a2 \ No newline at end of file
diff --git a/db/schema_migrations/20220107091629 b/db/schema_migrations/20220107091629
new file mode 100644
index 00000000000..a14f97d77eb
--- /dev/null
+++ b/db/schema_migrations/20220107091629
@@ -0,0 +1 @@
+ef1a7c5f7b10640a0ddc669528dcdb02fd2525d716562f928578e8902a07a832 \ No newline at end of file
diff --git a/db/schema_migrations/20220107165036 b/db/schema_migrations/20220107165036
new file mode 100644
index 00000000000..bab28284d04
--- /dev/null
+++ b/db/schema_migrations/20220107165036
@@ -0,0 +1 @@
+72639ba84675a6687864ef4cb6f02d0429124d7deb9ce9f3c8e255591e2f0a8d \ No newline at end of file
diff --git a/db/schema_migrations/20220109133006 b/db/schema_migrations/20220109133006
new file mode 100644
index 00000000000..e74845e2254
--- /dev/null
+++ b/db/schema_migrations/20220109133006
@@ -0,0 +1 @@
+192fc0b934c7d52e431a0ce7524a51beb24fa004a940e6b0675e36b0da143891 \ No newline at end of file
diff --git a/db/schema_migrations/20220109134455 b/db/schema_migrations/20220109134455
new file mode 100644
index 00000000000..7a4762e240e
--- /dev/null
+++ b/db/schema_migrations/20220109134455
@@ -0,0 +1 @@
+fee092680e22e579ea51f776d11bbfd6a49b936e4ab776760a153ce613e7a0cd \ No newline at end of file
diff --git a/db/schema_migrations/20220110170953 b/db/schema_migrations/20220110170953
new file mode 100644
index 00000000000..d4c2aa5fcf2
--- /dev/null
+++ b/db/schema_migrations/20220110170953
@@ -0,0 +1 @@
+da1c6f2db7cee1e4cb8b477d1892fa7206a95157a84864ad3d6022ab6cffbd1f \ No newline at end of file
diff --git a/db/schema_migrations/20220110171049 b/db/schema_migrations/20220110171049
new file mode 100644
index 00000000000..ab39a1afb25
--- /dev/null
+++ b/db/schema_migrations/20220110171049
@@ -0,0 +1 @@
+55ad00b1cf70f5d1a3f033efccf64c2c273ad03f65823a2281869849571ab35b \ No newline at end of file
diff --git a/db/schema_migrations/20220110224913 b/db/schema_migrations/20220110224913
new file mode 100644
index 00000000000..653324d1060
--- /dev/null
+++ b/db/schema_migrations/20220110224913
@@ -0,0 +1 @@
+d8b206e26f6dd7e9d5f2b2d8cc5ce2e2bbe2d8d33317948f8cf110fe41872a5d \ No newline at end of file
diff --git a/db/schema_migrations/20220110231420 b/db/schema_migrations/20220110231420
new file mode 100644
index 00000000000..b46bcdfd802
--- /dev/null
+++ b/db/schema_migrations/20220110231420
@@ -0,0 +1 @@
+768f97a38c0b741f7de99082ce7c8efb1578ac6600c3af4b30019bc987968bc9 \ No newline at end of file
diff --git a/db/schema_migrations/20220110233155 b/db/schema_migrations/20220110233155
new file mode 100644
index 00000000000..9301c7a2a7a
--- /dev/null
+++ b/db/schema_migrations/20220110233155
@@ -0,0 +1 @@
+e7d9d79ffb8989ab39fe719217f22736244df70c2b1461ef5a1a3f1e74e43870 \ No newline at end of file
diff --git a/db/schema_migrations/20220111002756 b/db/schema_migrations/20220111002756
new file mode 100644
index 00000000000..ca619e3eaf4
--- /dev/null
+++ b/db/schema_migrations/20220111002756
@@ -0,0 +1 @@
+34759cbf09171f6057b87af791f5e9f3045ac5e06558147436ba32e276f40a19 \ No newline at end of file
diff --git a/db/schema_migrations/20220111023852 b/db/schema_migrations/20220111023852
new file mode 100644
index 00000000000..15ab0470662
--- /dev/null
+++ b/db/schema_migrations/20220111023852
@@ -0,0 +1 @@
+fdb6e193748f9933aa3ae60fab41960e06d4edf271048fc5f6c9c465d30a8334 \ No newline at end of file
diff --git a/db/schema_migrations/20220111095006 b/db/schema_migrations/20220111095006
new file mode 100644
index 00000000000..b5fed6279f1
--- /dev/null
+++ b/db/schema_migrations/20220111095006
@@ -0,0 +1 @@
+0bc00cc8a5fa7cafa665ec113a4d0d1384c5acde37dfdf53ab1f5a2e1d6acb02 \ No newline at end of file
diff --git a/db/schema_migrations/20220111095007 b/db/schema_migrations/20220111095007
new file mode 100644
index 00000000000..77c70f8bccf
--- /dev/null
+++ b/db/schema_migrations/20220111095007
@@ -0,0 +1 @@
+65259b0e71c1883b81c61354325cfeeade0013b55af8901bf707f2a94ee3a46a \ No newline at end of file
diff --git a/db/schema_migrations/20220111102314 b/db/schema_migrations/20220111102314
new file mode 100644
index 00000000000..95c172c3587
--- /dev/null
+++ b/db/schema_migrations/20220111102314
@@ -0,0 +1 @@
+69c20daf6a23346288e516df3e70120819d76dcb5fe2b1b51af416349311820b \ No newline at end of file
diff --git a/db/schema_migrations/20220111200254 b/db/schema_migrations/20220111200254
new file mode 100644
index 00000000000..36ce3ad56f0
--- /dev/null
+++ b/db/schema_migrations/20220111200254
@@ -0,0 +1 @@
+72c7e04b1a34154c894f93da800c15c717c3340d34729577538d539881d2e8ca \ No newline at end of file
diff --git a/db/schema_migrations/20220111221516 b/db/schema_migrations/20220111221516
new file mode 100644
index 00000000000..b0c747f8e8a
--- /dev/null
+++ b/db/schema_migrations/20220111221516
@@ -0,0 +1 @@
+0cb120b0036b3f472edb57fcb8a52877d399edf8ff1f416ce76497d6aa8265d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112015940 b/db/schema_migrations/20220112015940
new file mode 100644
index 00000000000..0d012793ba0
--- /dev/null
+++ b/db/schema_migrations/20220112015940
@@ -0,0 +1 @@
+e4417c3367115d6adba023e18657d8aecd476b8d1c4227c73e06f97d05af07ad \ No newline at end of file
diff --git a/db/schema_migrations/20220112090556 b/db/schema_migrations/20220112090556
new file mode 100644
index 00000000000..12ffaeffe00
--- /dev/null
+++ b/db/schema_migrations/20220112090556
@@ -0,0 +1 @@
+e78e11a47017c67130fe88fa538578553b7015c18cf222b5e7fb7f503254dc6d \ No newline at end of file
diff --git a/db/schema_migrations/20220112115413 b/db/schema_migrations/20220112115413
new file mode 100644
index 00000000000..9c8c653f69b
--- /dev/null
+++ b/db/schema_migrations/20220112115413
@@ -0,0 +1 @@
+1199adba4c13e9234eabadefeb55ed3cfb19e9d5a87c07b90d438e4f48a973f7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112205111 b/db/schema_migrations/20220112205111
new file mode 100644
index 00000000000..a2d2d42271e
--- /dev/null
+++ b/db/schema_migrations/20220112205111
@@ -0,0 +1 @@
+65d9a1d63e90dfc336d0c69503c0899259fda773bc68a330782c206ac0fc48fd \ No newline at end of file
diff --git a/db/schema_migrations/20220112230642 b/db/schema_migrations/20220112230642
new file mode 100644
index 00000000000..c2d8e1d0a6e
--- /dev/null
+++ b/db/schema_migrations/20220112230642
@@ -0,0 +1 @@
+c528730414c1dcda5d312f03d4e37a0dbb51ebb0b0b87ada786cf686c358daa7 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232037 b/db/schema_migrations/20220112232037
new file mode 100644
index 00000000000..83267de0489
--- /dev/null
+++ b/db/schema_migrations/20220112232037
@@ -0,0 +1 @@
+775ac42ad194bd0175a6925e1c2e83c11d57a8d4430ad08a70e3d5275ca2e709 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232605 b/db/schema_migrations/20220112232605
new file mode 100644
index 00000000000..fb5809b543e
--- /dev/null
+++ b/db/schema_migrations/20220112232605
@@ -0,0 +1 @@
+4813b55e933564851f2fec9a2fa5900409eff226fec34ae0be1895307f603904 \ No newline at end of file
diff --git a/db/schema_migrations/20220112232723 b/db/schema_migrations/20220112232723
new file mode 100644
index 00000000000..2dc2a592980
--- /dev/null
+++ b/db/schema_migrations/20220112232723
@@ -0,0 +1 @@
+cbea97a0d067939ba9d713489448cb6e0cc45b2bbd2c717ecf521493cc39d568 \ No newline at end of file
diff --git a/db/schema_migrations/20220113013319 b/db/schema_migrations/20220113013319
new file mode 100644
index 00000000000..0dc31b95004
--- /dev/null
+++ b/db/schema_migrations/20220113013319
@@ -0,0 +1 @@
+ccfbbbe52b27833453f867c4d7093187d21dbbfebe054b366ff010c54de50974 \ No newline at end of file
diff --git a/db/schema_migrations/20220113014438 b/db/schema_migrations/20220113014438
new file mode 100644
index 00000000000..936c801bafe
--- /dev/null
+++ b/db/schema_migrations/20220113014438
@@ -0,0 +1 @@
+08d8a5a605058598a2f033bbd461518c502fb3da8627240c5d66f887b43f3ac3 \ No newline at end of file
diff --git a/db/schema_migrations/20220113015830 b/db/schema_migrations/20220113015830
new file mode 100644
index 00000000000..a4897410077
--- /dev/null
+++ b/db/schema_migrations/20220113015830
@@ -0,0 +1 @@
+774a5ff616663d6d0e002bd04d33747982de10b02cbb9ad7d8abfe0b26a2b441 \ No newline at end of file
diff --git a/db/schema_migrations/20220113035519 b/db/schema_migrations/20220113035519
new file mode 100644
index 00000000000..eb908ae8982
--- /dev/null
+++ b/db/schema_migrations/20220113035519
@@ -0,0 +1 @@
+4a90811aace678528b75171868fb178ab885d5aac885048e8eacecaf8b0ee374 \ No newline at end of file
diff --git a/db/schema_migrations/20220113040447 b/db/schema_migrations/20220113040447
new file mode 100644
index 00000000000..465b51678f7
--- /dev/null
+++ b/db/schema_migrations/20220113040447
@@ -0,0 +1 @@
+983e5522b2798ca0d17ca3fd848f527b12afdbdd1482a2d420c4c6ce4fa2c9c4 \ No newline at end of file
diff --git a/db/schema_migrations/20220113125401 b/db/schema_migrations/20220113125401
new file mode 100644
index 00000000000..7241e2e29c7
--- /dev/null
+++ b/db/schema_migrations/20220113125401
@@ -0,0 +1 @@
+afe57b6b1b8b10e0e26d7f499b25adc5aef9f7c52af644d6a260f0ed3aab16d5 \ No newline at end of file
diff --git a/db/schema_migrations/20220114105525 b/db/schema_migrations/20220114105525
new file mode 100644
index 00000000000..728820cbaf0
--- /dev/null
+++ b/db/schema_migrations/20220114105525
@@ -0,0 +1 @@
+c9c7e8ff40fd3863095bb927f1aea27fecd5ca77dfc284a7673310e3501476c8 \ No newline at end of file
diff --git a/db/schema_migrations/20220114131950 b/db/schema_migrations/20220114131950
new file mode 100644
index 00000000000..ca1e1033d9b
--- /dev/null
+++ b/db/schema_migrations/20220114131950
@@ -0,0 +1 @@
+f427f4c0d75308f7c97685e10e27a735dcf284714acd49659f62a6f7752234ef \ No newline at end of file
diff --git a/db/schema_migrations/20220116175851 b/db/schema_migrations/20220116175851
new file mode 100644
index 00000000000..47c21071440
--- /dev/null
+++ b/db/schema_migrations/20220116175851
@@ -0,0 +1 @@
+3fa0d827ab8051d270a13ae5facb1560a87f9f4fef81368b9fbb5d6291948721 \ No newline at end of file
diff --git a/db/schema_migrations/20220117225936 b/db/schema_migrations/20220117225936
new file mode 100644
index 00000000000..7ced75915e4
--- /dev/null
+++ b/db/schema_migrations/20220117225936
@@ -0,0 +1 @@
+484eaf2ce1df1e2915b7ea8a5c9f4e044957c25d1ccf5841f24c75791d1a1a13 \ No newline at end of file
diff --git a/db/schema_migrations/20220118141950 b/db/schema_migrations/20220118141950
new file mode 100644
index 00000000000..7c6549a1e60
--- /dev/null
+++ b/db/schema_migrations/20220118141950
@@ -0,0 +1 @@
+a4131f86bc415f0c1897e3b975494806ffc5a834dca2b39c998c6a406e695e15 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155846 b/db/schema_migrations/20220118155846
new file mode 100644
index 00000000000..b5247cb3743
--- /dev/null
+++ b/db/schema_migrations/20220118155846
@@ -0,0 +1 @@
+88935eee0781ee1faaf52e3bc89dc5c490c2095d6ccf83e4fd4186641507c173 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155847 b/db/schema_migrations/20220118155847
new file mode 100644
index 00000000000..caa0dfc5901
--- /dev/null
+++ b/db/schema_migrations/20220118155847
@@ -0,0 +1 @@
+aa73b04aa355111564cdc7adb036a2030a28fbb3b524c3b3dbb8248e27b845d7 \ No newline at end of file
diff --git a/db/schema_migrations/20220118155848 b/db/schema_migrations/20220118155848
new file mode 100644
index 00000000000..bf3205b5dda
--- /dev/null
+++ b/db/schema_migrations/20220118155848
@@ -0,0 +1 @@
+4d5adffe1a3e835d6d23f6bd9634993c778fef23d134552d54b003af2a3ff4da \ No newline at end of file
diff --git a/db/schema_migrations/20220119141736 b/db/schema_migrations/20220119141736
new file mode 100644
index 00000000000..431ed37ea5c
--- /dev/null
+++ b/db/schema_migrations/20220119141736
@@ -0,0 +1 @@
+faa30b386af9adf3e9f54a0e8e2880310490e4dc1378eae68b346872d0bb8bfd \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 716b3e89be1..fff600c392a 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -166,7 +166,7 @@ CREATE TABLE verification_codes (
phone text NOT NULL,
CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)),
CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)),
- CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32))
+ CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50))
)
PARTITION BY RANGE (created_at);
@@ -10298,7 +10298,7 @@ CREATE TABLE application_settings (
throttle_protected_paths_enabled boolean DEFAULT false NOT NULL,
throttle_protected_paths_requests_per_period integer DEFAULT 10 NOT NULL,
throttle_protected_paths_period_in_seconds integer DEFAULT 60 NOT NULL,
- protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session,/oauth/authorize,/oauth/token}'::character varying[],
+ protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session}'::character varying[],
throttle_incident_management_notification_enabled boolean DEFAULT false NOT NULL,
throttle_incident_management_notification_period_in_seconds integer DEFAULT 3600,
throttle_incident_management_notification_per_period integer DEFAULT 3600,
@@ -10481,15 +10481,28 @@ CREATE TABLE application_settings (
max_ssh_key_lifetime integer,
static_objects_external_storage_auth_token_encrypted text,
future_subscriptions jsonb DEFAULT '[]'::jsonb NOT NULL,
+ user_email_lookup_limit integer DEFAULT 60 NOT NULL,
+ packages_cleanup_package_file_worker_capacity smallint DEFAULT 2 NOT NULL,
+ container_registry_import_max_tags_count integer DEFAULT 100 NOT NULL,
+ container_registry_import_max_retries integer DEFAULT 3 NOT NULL,
+ container_registry_import_start_max_retries integer DEFAULT 50 NOT NULL,
+ container_registry_import_max_step_duration integer DEFAULT 300 NOT NULL,
+ container_registry_import_target_plan text DEFAULT 'free'::text NOT NULL,
+ container_registry_import_created_before timestamp with time zone DEFAULT '2022-01-23 00:00:00+00'::timestamp with time zone NOT NULL,
+ runner_token_expiration_interval integer,
+ group_runner_token_expiration_interval integer,
+ project_runner_token_expiration_interval integer,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),
CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)),
+ CONSTRAINT app_settings_p_cleanup_package_file_worker_capacity_positive CHECK ((packages_cleanup_package_file_worker_capacity >= 0)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)),
CONSTRAINT app_settings_yaml_max_size_positive CHECK ((max_yaml_size_bytes > 0)),
CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)),
CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)),
CONSTRAINT check_32710817e9 CHECK ((char_length(static_objects_external_storage_auth_token_encrypted) <= 255)),
+ CONSTRAINT check_3559645ae5 CHECK ((char_length(container_registry_import_target_plan) <= 255)),
CONSTRAINT check_3def0f1829 CHECK ((char_length(sentry_clientside_dsn) <= 255)),
CONSTRAINT check_4f8b811780 CHECK ((char_length(sentry_dsn) <= 255)),
CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)),
@@ -12176,7 +12189,9 @@ CREATE TABLE ci_runners (
public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL,
private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
config jsonb DEFAULT '{}'::jsonb NOT NULL,
- executor_type smallint
+ executor_type smallint,
+ maintainer_note text,
+ CONSTRAINT check_56f5ea8804 CHECK ((char_length(maintainer_note) <= 255))
);
CREATE SEQUENCE ci_runners_id_seq
@@ -12206,6 +12221,29 @@ CREATE SEQUENCE ci_running_builds_id_seq
ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id;
+CREATE TABLE ci_secure_files (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ file_store smallint DEFAULT 1 NOT NULL,
+ permissions smallint DEFAULT 0 NOT NULL,
+ name text NOT NULL,
+ file text NOT NULL,
+ checksum bytea NOT NULL,
+ CONSTRAINT check_320790634d CHECK ((char_length(file) <= 255)),
+ CONSTRAINT check_402c7b4a56 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE ci_secure_files_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE ci_secure_files_id_seq OWNED BY ci_secure_files.id;
+
CREATE TABLE ci_sources_pipelines (
id integer NOT NULL,
project_id integer,
@@ -12383,6 +12421,7 @@ CREATE TABLE cluster_agent_tokens (
description text,
name text,
last_used_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)),
CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)),
CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)),
@@ -12878,7 +12917,19 @@ CREATE TABLE container_repositories (
status smallint,
expiration_policy_started_at timestamp with time zone,
expiration_policy_cleanup_status smallint DEFAULT 0 NOT NULL,
- expiration_policy_completed_at timestamp with time zone
+ expiration_policy_completed_at timestamp with time zone,
+ migration_pre_import_started_at timestamp with time zone,
+ migration_pre_import_done_at timestamp with time zone,
+ migration_import_started_at timestamp with time zone,
+ migration_import_done_at timestamp with time zone,
+ migration_aborted_at timestamp with time zone,
+ migration_skipped_at timestamp with time zone,
+ migration_retries_count integer DEFAULT 0 NOT NULL,
+ migration_skipped_reason smallint,
+ migration_state text DEFAULT 'default'::text NOT NULL,
+ migration_aborted_in_state text,
+ CONSTRAINT check_13c58fe73a CHECK ((char_length(migration_state) <= 255)),
+ CONSTRAINT check_97f0249439 CHECK ((char_length(migration_aborted_in_state) <= 255))
);
CREATE SEQUENCE container_repositories_id_seq
@@ -14711,6 +14762,22 @@ CREATE SEQUENCE grafana_integrations_id_seq
ALTER SEQUENCE grafana_integrations_id_seq OWNED BY grafana_integrations.id;
+CREATE TABLE group_crm_settings (
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ enabled boolean DEFAULT false NOT NULL
+);
+
+CREATE SEQUENCE group_crm_settings_group_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE group_crm_settings_group_id_seq OWNED BY group_crm_settings.group_id;
+
CREATE TABLE group_custom_attributes (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -15228,6 +15295,7 @@ CREATE TABLE integrations (
group_id bigint,
type_new text,
vulnerability_events boolean DEFAULT false NOT NULL,
+ archive_trace_events boolean DEFAULT false NOT NULL,
CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255))
);
@@ -15936,7 +16004,8 @@ CREATE TABLE members (
ldap boolean DEFAULT false NOT NULL,
override boolean DEFAULT false NOT NULL,
state smallint DEFAULT 0,
- invite_email_success boolean DEFAULT true NOT NULL
+ invite_email_success boolean DEFAULT true NOT NULL,
+ member_namespace_id bigint
);
CREATE SEQUENCE members_id_seq
@@ -16458,6 +16527,9 @@ CREATE TABLE namespace_settings (
new_user_signups_cap integer,
setup_for_company boolean,
jobs_to_be_done smallint,
+ runner_token_expiration_interval integer,
+ subgroup_runner_token_expiration_interval integer,
+ project_runner_token_expiration_interval integer,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255))
);
@@ -16760,7 +16832,14 @@ CREATE TABLE onboarding_progresses (
issue_auto_closed_at timestamp with time zone,
repository_imported_at timestamp with time zone,
repository_mirrored_at timestamp with time zone,
- issue_created_at timestamp with time zone
+ issue_created_at timestamp with time zone,
+ secure_dependency_scanning_run_at timestamp with time zone,
+ secure_container_scanning_run_at timestamp with time zone,
+ secure_dast_run_at timestamp with time zone,
+ secure_secret_detection_run_at timestamp with time zone,
+ secure_coverage_fuzzing_run_at timestamp with time zone,
+ secure_cluster_image_scanning_run_at timestamp with time zone,
+ secure_api_fuzzing_run_at timestamp with time zone
);
CREATE SEQUENCE onboarding_progresses_id_seq
@@ -17400,6 +17479,7 @@ CREATE TABLE packages_package_files (
verification_checksum bytea,
verification_state smallint DEFAULT 0 NOT NULL,
verification_started_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_4c5e6bb0b3 CHECK ((file_store IS NOT NULL))
);
@@ -18114,7 +18194,8 @@ CREATE TABLE project_ci_cd_settings (
auto_rollback_enabled boolean DEFAULT false NOT NULL,
keep_latest_artifact boolean DEFAULT true NOT NULL,
restrict_user_defined_variables boolean DEFAULT false NOT NULL,
- job_token_scope_enabled boolean DEFAULT false NOT NULL
+ job_token_scope_enabled boolean DEFAULT false NOT NULL,
+ runner_token_expiration_interval integer
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -19210,7 +19291,8 @@ CREATE TABLE routes (
path character varying NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- name character varying
+ name character varying,
+ namespace_id bigint
);
CREATE SEQUENCE routes_id_seq
@@ -19393,6 +19475,47 @@ CREATE SEQUENCE security_scans_id_seq
ALTER SEQUENCE security_scans_id_seq OWNED BY security_scans.id;
+CREATE TABLE security_training_providers (
+ id bigint NOT NULL,
+ name text NOT NULL,
+ description text,
+ url text NOT NULL,
+ logo_url text,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_544b3dc935 CHECK ((char_length(url) <= 512)),
+ CONSTRAINT check_6fe222f071 CHECK ((char_length(logo_url) <= 512)),
+ CONSTRAINT check_a8ff21ced5 CHECK ((char_length(description) <= 512)),
+ CONSTRAINT check_dae433eed6 CHECK ((char_length(name) <= 256))
+);
+
+CREATE SEQUENCE security_training_providers_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE security_training_providers_id_seq OWNED BY security_training_providers.id;
+
+CREATE TABLE security_trainings (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ provider_id bigint NOT NULL,
+ is_primary boolean DEFAULT false NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE security_trainings_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE security_trainings_id_seq OWNED BY security_trainings.id;
+
CREATE TABLE self_managed_prometheus_alert_events (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -20204,8 +20327,9 @@ CREATE TABLE user_details (
pronunciation text,
registration_objective smallint,
phone text,
+ requires_credit_card_verification boolean DEFAULT false NOT NULL,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
- CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)),
+ CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 50)),
CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100)),
CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)),
CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255))
@@ -20630,132 +20754,6 @@ CREATE SEQUENCE vulnerability_feedback_id_seq
ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id;
-CREATE TABLE vulnerability_finding_evidence_assets (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- type text,
- name text,
- url text,
- CONSTRAINT check_5adf5d69de CHECK ((char_length(type) <= 2048)),
- CONSTRAINT check_839f29d7ca CHECK ((char_length(name) <= 2048)),
- CONSTRAINT check_9272d912c0 CHECK ((char_length(url) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_assets_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_assets_id_seq OWNED BY vulnerability_finding_evidence_assets.id;
-
-CREATE TABLE vulnerability_finding_evidence_headers (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_request_id bigint,
- vulnerability_finding_evidence_response_id bigint,
- name text NOT NULL,
- value text NOT NULL,
- CONSTRAINT check_01d21e8d92 CHECK ((char_length(name) <= 255)),
- CONSTRAINT check_3f9011f903 CHECK ((char_length(value) <= 8192))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_headers_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_headers_id_seq OWNED BY vulnerability_finding_evidence_headers.id;
-
-CREATE TABLE vulnerability_finding_evidence_requests (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint,
- method text,
- url text,
- body text,
- vulnerability_finding_evidence_supporting_message_id bigint,
- CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)),
- CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)),
- CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_requests_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_requests_id_seq OWNED BY vulnerability_finding_evidence_requests.id;
-
-CREATE TABLE vulnerability_finding_evidence_responses (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint,
- status_code integer,
- reason_phrase text,
- body text,
- vulnerability_finding_evidence_supporting_message_id bigint,
- CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)),
- CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id;
-
-CREATE TABLE vulnerability_finding_evidence_sources (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- name text,
- url text,
- CONSTRAINT check_0fe01298d6 CHECK ((char_length(url) <= 2048)),
- CONSTRAINT check_86b537ba1a CHECK ((char_length(name) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_sources_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_sources_id_seq OWNED BY vulnerability_finding_evidence_sources.id;
-
-CREATE TABLE vulnerability_finding_evidence_supporting_messages (
- id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
- name text,
- CONSTRAINT check_fa33b9ae85 CHECK ((char_length(name) <= 2048))
-);
-
-CREATE SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq OWNED BY vulnerability_finding_evidence_supporting_messages.id;
-
CREATE TABLE vulnerability_finding_evidences (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -21001,7 +20999,9 @@ CREATE TABLE vulnerability_reads (
resolved_on_default_branch boolean DEFAULT false NOT NULL,
uuid uuid NOT NULL,
location_image text,
- CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048))
+ cluster_agent_id text,
+ CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)),
+ CONSTRAINT check_a105eb825a CHECK ((char_length(cluster_agent_id) <= 10))
);
CREATE SEQUENCE vulnerability_reads_id_seq
@@ -21535,6 +21535,8 @@ ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_s
ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass);
+ALTER TABLE ONLY ci_secure_files ALTER COLUMN id SET DEFAULT nextval('ci_secure_files_id_seq'::regclass);
+
ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass);
ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass);
@@ -21759,6 +21761,8 @@ ALTER TABLE ONLY gpg_signatures ALTER COLUMN id SET DEFAULT nextval('gpg_signatu
ALTER TABLE ONLY grafana_integrations ALTER COLUMN id SET DEFAULT nextval('grafana_integrations_id_seq'::regclass);
+ALTER TABLE ONLY group_crm_settings ALTER COLUMN group_id SET DEFAULT nextval('group_crm_settings_group_id_seq'::regclass);
+
ALTER TABLE ONLY group_custom_attributes ALTER COLUMN id SET DEFAULT nextval('group_custom_attributes_id_seq'::regclass);
ALTER TABLE ONLY group_deploy_keys ALTER COLUMN id SET DEFAULT nextval('group_deploy_keys_id_seq'::regclass);
@@ -22141,6 +22145,10 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SE
ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass);
+ALTER TABLE ONLY security_training_providers ALTER COLUMN id SET DEFAULT nextval('security_training_providers_id_seq'::regclass);
+
+ALTER TABLE ONLY security_trainings ALTER COLUMN id SET DEFAULT nextval('security_trainings_id_seq'::regclass);
+
ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass);
ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass);
@@ -22243,18 +22251,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT
ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass);
-ALTER TABLE ONLY vulnerability_finding_evidence_assets ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_assets_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_sources ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_sources_id_seq'::regclass);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_supporting_messages_id_seq'::regclass);
-
ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass);
@@ -23035,6 +23031,9 @@ ALTER TABLE ONLY ci_runners
ALTER TABLE ONLY ci_running_builds
ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_secure_files
+ ADD CONSTRAINT ci_secure_files_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id);
@@ -23407,6 +23406,9 @@ ALTER TABLE ONLY gpg_signatures
ALTER TABLE ONLY grafana_integrations
ADD CONSTRAINT grafana_integrations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY group_crm_settings
+ ADD CONSTRAINT group_crm_settings_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY group_custom_attributes
ADD CONSTRAINT group_custom_attributes_pkey PRIMARY KEY (id);
@@ -24088,6 +24090,12 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules
ALTER TABLE ONLY security_scans
ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY security_training_providers
+ ADD CONSTRAINT security_training_providers_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT security_trainings_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY self_managed_prometheus_alert_events
ADD CONSTRAINT self_managed_prometheus_alert_events_pkey PRIMARY KEY (id);
@@ -24274,24 +24282,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY vulnerability_finding_evidence_assets
- ADD CONSTRAINT vulnerability_finding_evidence_assets_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT vulnerability_finding_evidence_requests_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_sources
- ADD CONSTRAINT vulnerability_finding_evidence_sources_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
- ADD CONSTRAINT vulnerability_finding_evidence_supporting_messages_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id);
@@ -25071,25 +25061,11 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL);
-CREATE INDEX finding_evidence_assets_on_finding_evidence_id ON vulnerability_finding_evidence_assets USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id);
-
-CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id);
-
-CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_requests_on_supporting_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_supporting_message_id);
-
-CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id);
-
-CREATE INDEX finding_evidence_responses_on_supporting_evidence_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_supporting_message_id);
-
-CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_finding_evidence_sources USING btree (vulnerability_finding_evidence_id);
+CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
-CREATE INDEX finding_evidence_supporting_messages_on_finding_evidence_id ON vulnerability_finding_evidence_supporting_messages USING btree (vulnerability_finding_evidence_id);
+CREATE UNIQUE INDEX finding_link_name_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, name, url);
-CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
+CREATE UNIQUE INDEX finding_link_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, url) WHERE (name IS NULL);
CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
@@ -25599,6 +25575,8 @@ CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btre
CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23]));
+CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_file_type ON ci_job_artifacts USING btree (project_id, file_type, id);
+
CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type);
CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id);
@@ -25705,6 +25683,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipel
CREATE INDEX index_ci_pipelines_on_user_id_and_id_and_cancelable_status ON ci_pipelines USING btree (user_id, id) WHERE ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('waiting_for_resource'::character varying)::text, ('preparing'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text, ('scheduled'::character varying)::text]));
+CREATE INDEX index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified ON ci_pipelines USING btree (user_id, id DESC) WHERE (failure_reason = 3);
+
CREATE INDEX index_ci_project_mirrors_on_namespace_id ON ci_project_mirrors USING btree (namespace_id);
CREATE UNIQUE INDEX index_ci_project_mirrors_on_project_id ON ci_project_mirrors USING btree (project_id);
@@ -25727,6 +25707,8 @@ CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING
CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id);
+CREATE INDEX index_ci_runners_on_active ON ci_runners USING btree (active, id);
+
CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC);
CREATE INDEX index_ci_runners_on_contacted_at_and_id_where_inactive ON ci_runners USING btree (contacted_at DESC, id DESC) WHERE (active = false);
@@ -25755,6 +25737,8 @@ CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING bt
CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id);
+CREATE INDEX index_ci_secure_files_on_project_id ON ci_secure_files USING btree (project_id);
+
CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id);
CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id);
@@ -25801,6 +25785,8 @@ CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_sco
CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST);
+CREATE INDEX index_cluster_agent_tokens_on_agent_id_status_last_used_at ON cluster_agent_tokens USING btree (agent_id, status, last_used_at DESC NULLS LAST);
+
CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id);
CREATE UNIQUE INDEX index_cluster_agent_tokens_on_token_encrypted ON cluster_agent_tokens USING btree (token_encrypted);
@@ -26179,6 +26165,8 @@ CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (aut
CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events USING btree (author_id, created_at) WHERE ((target_type)::text = 'MergeRequest'::text);
+CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_id, id);
+
CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone);
CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL);
@@ -26331,6 +26319,8 @@ CREATE INDEX index_grafana_integrations_on_enabled ON grafana_integrations USING
CREATE INDEX index_grafana_integrations_on_project_id ON grafana_integrations USING btree (project_id);
+CREATE INDEX index_group_crm_settings_on_group_id ON group_crm_settings USING btree (group_id);
+
CREATE UNIQUE INDEX index_group_custom_attributes_on_group_id_and_key ON group_custom_attributes USING btree (group_id, key);
CREATE INDEX index_group_custom_attributes_on_key_and_value ON group_custom_attributes USING btree (key, value);
@@ -26659,6 +26649,8 @@ CREATE INDEX index_members_on_invite_email ON members USING btree (invite_email)
CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite_token);
+CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member_namespace_id);
+
CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at);
CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type);
@@ -26775,8 +26767,6 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON
CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
-CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title);
-
CREATE INDEX index_merge_requests_on_title_trigram ON merge_requests USING gin (title gin_trgm_ops);
CREATE INDEX index_merge_requests_on_tp_id_and_merge_commit_sha_and_id ON merge_requests USING btree (target_project_id, merge_commit_sha, id);
@@ -26953,6 +26943,8 @@ CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON inciden
CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text));
+CREATE INDEX index_on_projects_path ON projects USING btree (path);
+
CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text));
CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text));
@@ -27053,6 +27045,10 @@ CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON package
CREATE INDEX index_packages_package_files_on_package_id_id ON packages_package_files USING btree (package_id, id);
+CREATE INDEX index_packages_package_files_on_package_id_status_and_id ON packages_package_files USING btree (package_id, status, id);
+
+CREATE INDEX index_packages_package_files_on_status ON packages_package_files USING btree (status);
+
CREATE INDEX index_packages_package_files_on_verification_state ON packages_package_files USING btree (verification_state);
CREATE INDEX index_packages_packages_on_creator_id ON packages_packages USING btree (creator_id);
@@ -27525,6 +27521,8 @@ CREATE INDEX index_reviews_on_project_id ON reviews USING btree (project_id);
CREATE INDEX index_route_on_name_trigram ON routes USING gin (name gin_trgm_ops);
+CREATE UNIQUE INDEX index_routes_on_namespace_id ON routes USING btree (namespace_id);
+
CREATE UNIQUE INDEX index_routes_on_path ON routes USING btree (path);
CREATE INDEX index_routes_on_path_text_pattern_ops ON routes USING btree (path varchar_pattern_ops);
@@ -27571,6 +27569,12 @@ CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree (
CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id);
+CREATE INDEX index_security_trainings_on_project_id ON security_trainings USING btree (project_id);
+
+CREATE INDEX index_security_trainings_on_provider_id ON security_trainings USING btree (provider_id);
+
+CREATE UNIQUE INDEX index_security_trainings_on_unique_project_id ON security_trainings USING btree (project_id) WHERE (is_primary IS TRUE);
+
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@@ -27919,6 +27923,8 @@ CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USIN
CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users_star_projects USING btree (user_id, project_id);
+CREATE INDEX index_users_with_static_object_token ON users USING btree (id) WHERE ((static_object_token IS NOT NULL) AND (static_object_token_encrypted IS NULL));
+
CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON ONLY verification_codes USING btree (visitor_id_code, phone, created_at);
COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index';
@@ -28005,11 +28011,11 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu
CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text));
-CREATE INDEX index_vulnerability_occurrences_on_location_agent_id ON vulnerability_occurrences USING gin (((location -> 'agent_id'::text))) WHERE (report_type = 7);
+CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7]));
-CREATE INDEX index_vulnerability_occurrences_on_location_cluster_id ON vulnerability_occurrences USING gin (((location -> 'cluster_id'::text))) WHERE (report_type = 7);
+CREATE INDEX index_vulnerability_occurrences_on_location_k8s_agent_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'agent_id'::text))) WHERE (report_type = 7);
-CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7]));
+CREATE INDEX index_vulnerability_occurrences_on_location_k8s_cluster_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'cluster_id'::text))) WHERE (report_type = 7);
CREATE INDEX index_vulnerability_occurrences_on_migrated_to_new_structure ON vulnerability_occurrences USING btree (migrated_to_new_structure, id);
@@ -28025,6 +28031,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occ
CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id);
+CREATE INDEX index_vulnerability_reads_on_cluster_agent_id ON vulnerability_reads USING btree (cluster_agent_id) WHERE (report_type = 7);
+
CREATE INDEX index_vulnerability_reads_on_location_image ON vulnerability_reads USING btree (location_image) WHERE (report_type = ANY (ARRAY[2, 7]));
CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USING btree (scanner_id);
@@ -28147,6 +28155,10 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree
CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id);
+CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99]));
+
+CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2);
+
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[]));
CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[]));
@@ -28155,8 +28167,6 @@ CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USIN
CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
-CREATE INDEX tmp_index_uuid_is_null ON security_findings USING btree (id) WHERE (uuid IS NULL);
-
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name);
@@ -29287,9 +29297,6 @@ ALTER TABLE ONLY agent_group_authorizations
ALTER TABLE ONLY deployment_approvals
ADD CONSTRAINT fk_2d060dfc73 FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_freeze_periods
- ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY notes
ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL;
@@ -29311,9 +29318,6 @@ ALTER TABLE ONLY approvals
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_group_variables
- ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
@@ -29437,8 +29441,8 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL;
-ALTER TABLE ONLY project_pages_metadata
- ADD CONSTRAINT fk_69366a119e FOREIGN KEY (artifacts_archive_id) REFERENCES ci_job_artifacts(id) ON DELETE SET NULL;
+ALTER TABLE ONLY routes
+ ADD CONSTRAINT fk_679ff8213d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY application_settings
ADD CONSTRAINT fk_693b8795e4 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
@@ -29465,7 +29469,7 @@ ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY projects
- ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29488,9 +29492,6 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY oauth_openid_requests
ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_resource_groups
- ADD CONSTRAINT fk_774722d144 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY users
ADD CONSTRAINT fk_789cd90b35 FOREIGN KEY (accepted_term_id) REFERENCES application_setting_terms(id) ON DELETE CASCADE;
@@ -29503,9 +29504,6 @@ ALTER TABLE ONLY analytics_devops_adoption_snapshots
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_unit_tests
- ADD CONSTRAINT fk_7a8fabf0a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY protected_branches
ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -29641,9 +29639,6 @@ ALTER TABLE ONLY protected_environments
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_schedules
- ADD CONSTRAINT fk_9ea99f58d2 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_9ffc86a3d9 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
@@ -29659,9 +29654,6 @@ ALTER TABLE ONLY ci_builds
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_a23be95014 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dast_site_profiles_builds
- ADD CONSTRAINT fk_a325505e99 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY bulk_import_entities
ADD CONSTRAINT fk_a44ff95be5 FOREIGN KEY (parent_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE;
@@ -29683,6 +29675,9 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT fk_aa76ef30e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY members
+ ADD CONSTRAINT fk_aa82dcc1c6 FOREIGN KEY (member_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY alert_management_alerts
ADD CONSTRAINT fk_aad61aedca FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL;
@@ -29914,9 +29909,6 @@ ALTER TABLE ONLY gitlab_subscriptions
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY dast_scanner_profiles_builds
- ADD CONSTRAINT fk_e4c49200f8 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -30013,15 +30005,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;
-ALTER TABLE ONLY ci_pending_builds
- ADD CONSTRAINT fk_fdc0137e4a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_import_data
ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -30076,12 +30062,6 @@ ALTER TABLE ONLY ip_restrictions
ALTER TABLE ONLY terraform_state_versions
ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_report_results
- ADD CONSTRAINT fk_rails_056d298d48 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_daily_build_group_report_results
- ADD CONSTRAINT fk_rails_0667f7608c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY ci_subscriptions_projects
ADD CONSTRAINT fk_rails_0818751483 FOREIGN KEY (downstream_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -30268,9 +30248,6 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY saml_group_links
ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT fk_rails_2390a09723 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
@@ -30379,9 +30356,6 @@ ALTER TABLE ONLY metrics_dashboard_annotations
ALTER TABLE ONLY wiki_page_slugs
ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_job_token_project_scope_links
- ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY board_labels
ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
@@ -30502,15 +30476,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY user_custom_attributes
ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pending_builds
- ADD CONSTRAINT fk_rails_480669c3b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY upcoming_reconciliations
ADD CONSTRAINT fk_rails_497b4938ac FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_pipeline_artifacts
- ADD CONSTRAINT fk_rails_4a70390ca6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY ci_job_token_project_scope_links
ADD CONSTRAINT fk_rails_4b2ee3290b FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -30547,9 +30515,6 @@ ALTER TABLE ONLY geo_repository_renamed_events
ALTER TABLE ONLY aws_roles
ADD CONSTRAINT fk_rails_4ed56f4720 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY security_scans
- ADD CONSTRAINT fk_rails_4ef1e6b4c6 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY packages_debian_publications
ADD CONSTRAINT fk_rails_4fc8ebd03e FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE;
@@ -30727,9 +30692,6 @@ ALTER TABLE ONLY vulnerability_findings_remediations
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_6830c13ac1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT fk_rails_683b8e000c FOREIGN KEY (vulnerability_finding_evidence_response_id) REFERENCES vulnerability_finding_evidence_responses(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY geo_hashed_storage_migrated_events
ADD CONSTRAINT fk_rails_687ed7d7c5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -30751,9 +30713,6 @@ ALTER TABLE ONLY prometheus_alerts
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_assets
- ADD CONSTRAINT fk_rails_6edbbecba4 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT fk_rails_6f5294f16c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -30784,9 +30743,6 @@ ALTER TABLE ONLY dast_scanner_profiles
ALTER TABLE ONLY vulnerability_historical_statistics
ADD CONSTRAINT fk_rails_72b73ed023 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY slack_integrations
ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -30802,6 +30758,9 @@ ALTER TABLE ONLY dast_site_profiles
ALTER TABLE ONLY merge_request_context_commit_diff_files
ADD CONSTRAINT fk_rails_74a00a1787 FOREIGN KEY (merge_request_context_commit_id) REFERENCES merge_request_context_commits(id) ON DELETE CASCADE;
+ALTER TABLE ONLY group_crm_settings
+ ADD CONSTRAINT fk_rails_74fdf2f13d FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY clusters_applications_ingress
ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
@@ -30841,9 +30800,6 @@ ALTER TABLE ONLY terraform_states
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
- ADD CONSTRAINT fk_rails_79e77f6c5c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY software_license_policies
ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE;
@@ -30874,6 +30830,9 @@ ALTER TABLE ONLY required_code_owners_sections
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT fk_rails_84c7951d72 FOREIGN KEY (provider_id) REFERENCES security_training_providers(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY zentao_tracker_data
ADD CONSTRAINT fk_rails_84efda7be0 FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE;
@@ -30970,9 +30929,6 @@ ALTER TABLE ONLY project_error_tracking_settings
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_responses
- ADD CONSTRAINT fk_rails_929041a499 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY merge_request_cleanup_schedules
ADD CONSTRAINT fk_rails_92dd0e705c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -31333,18 +31289,12 @@ ALTER TABLE ONLY operations_strategies_user_lists
ALTER TABLE ONLY issue_tracker_data
ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_headers
- ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY resource_milestone_events
ADD CONSTRAINT fk_rails_cedf8cce4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_cee126f66c FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_requests
- ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY upload_states
ADD CONSTRAINT fk_rails_d00f153613 FOREIGN KEY (upload_id) REFERENCES uploads(id) ON DELETE CASCADE;
@@ -31399,9 +31349,6 @@ ALTER TABLE ONLY issues_prometheus_alert_events
ALTER TABLE ONLY board_user_preferences
ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_running_builds
- ADD CONSTRAINT fk_rails_dc1d0801e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY vulnerability_occurrence_pipelines
ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
@@ -31429,9 +31376,6 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ALTER TABLE ONLY bulk_import_export_uploads
ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_minutes_additional_packs
- ADD CONSTRAINT fk_rails_e0e0c4e4b1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY label_priorities
ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
@@ -31471,9 +31415,6 @@ ALTER TABLE ONLY approval_merge_request_rule_sources
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id) ON DELETE CASCADE;
-ALTER TABLE ONLY requirements_management_test_reports
- ADD CONSTRAINT fk_rails_e67d085910 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_rails_e6d7c24d1b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -31501,9 +31442,6 @@ ALTER TABLE ONLY vulnerability_issue_links
ALTER TABLE ONLY merge_request_blocks
ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY vulnerability_finding_evidence_sources
- ADD CONSTRAINT fk_rails_e9761bed4c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
@@ -31594,15 +31532,15 @@ ALTER TABLE ONLY internal_ids
ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id) REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_trainings
+ ADD CONSTRAINT fk_rails_f80240fae0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests_closing_issues
ADD CONSTRAINT fk_rails_f8540692be FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_trains
ADD CONSTRAINT fk_rails_f90820cb08 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_runner_namespaces
- ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY banned_users
ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;