summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/docs/postgres_async_foreign_key_validations.yml11
-rw-r--r--db/init_structure.sql3572
-rw-r--r--db/migrate/20210603140302_add_pronouns_to_user_details.rb20
-rw-r--r--db/migrate/20210603222333_remove_builds_email_service_from_services.rb11
-rw-r--r--db/migrate/20210604032738_create_dast_site_profiles_builds.rb18
-rw-r--r--db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb19
-rw-r--r--db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb19
-rw-r--r--db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb18
-rw-r--r--db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb19
-rw-r--r--db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb19
-rw-r--r--db/migrate/20210604082145_create_external_status_checks_table.rb42
-rw-r--r--db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb34
-rw-r--r--db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb15
-rw-r--r--db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb18
-rw-r--r--db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb17
-rw-r--r--db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb16
-rw-r--r--db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb18
-rw-r--r--db/migrate/20210608103230_add_issue_id_to_test_report.rb17
-rw-r--r--db/migrate/20210608103235_add_issue_index_to_test_report.rb17
-rw-r--r--db/migrate/20210608110752_change_column_null_test_report_requirement.rb17
-rw-r--r--db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb24
-rw-r--r--db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb28
-rw-r--r--db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb20
-rw-r--r--db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb17
-rw-r--r--db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb17
-rw-r--r--db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb7
-rw-r--r--db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb13
-rw-r--r--db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb7
-rw-r--r--db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb39
-rw-r--r--db/migrate/20210611101034_add_devops_adoption_sast_dast.rb8
-rw-r--r--db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb17
-rw-r--r--db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb7
-rw-r--r--db/migrate/20210614143954_add_unique_index_for_helm_packages.rb18
-rw-r--r--db/migrate/20210615064342_add_issue_id_to_requirement.rb17
-rw-r--r--db/migrate/20210616110748_add_issue_index_to_requirement.rb17
-rw-r--r--db/migrate/20210616111311_add_issue_requirement_foreign_key.rb19
-rw-r--r--db/migrate/20210616134905_add_timestamp_to_schema_migration.rb15
-rw-r--r--db/migrate/20210616154808_remove_ci_build_protected_index.rb19
-rw-r--r--db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb10
-rw-r--r--db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb48
-rw-r--r--db/migrate/20210617161348_cascade_delete_freeze_periods.rb23
-rw-r--r--db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb15
-rw-r--r--db/migrate/20210621043337_rename_services_to_integrations.rb151
-rw-r--r--db/migrate/20210621044000_rename_services_indexes_to_integrations.rb30
-rw-r--r--db/migrate/20210621084632_add_summary_to_timelogs.rb10
-rw-r--r--db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb15
-rw-r--r--db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb7
-rw-r--r--db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb21
-rw-r--r--db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb11
-rw-r--r--db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb17
-rw-r--r--db/migrate/20210623133635_create_error_tracking_errors.rb28
-rw-r--r--db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb17
-rw-r--r--db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb7
-rw-r--r--db/migrate/20210624180613_add_last_synced_at_to_licenses.rb7
-rw-r--r--db/migrate/20210625094554_create_error_tracking_error_events.rb30
-rw-r--r--db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb7
-rw-r--r--db/migrate/20210628154900_create_detached_partitions_table.rb23
-rw-r--r--db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb11
-rw-r--r--db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb20
-rw-r--r--db/migrate/20210630144339_add_invite_email_success_to_members.rb11
-rw-r--r--db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb10
-rw-r--r--db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb32
-rw-r--r--db/migrate/20210701111627_add_upvotes_count_to_issues.rb15
-rw-r--r--db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb7
-rw-r--r--db/migrate/20210705124128_add_project_settings_previous_default_branch.rb20
-rw-r--r--db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb24
-rw-r--r--db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb17
-rw-r--r--db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb16
-rw-r--r--db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb19
-rw-r--r--db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb17
-rw-r--r--db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb21
-rw-r--r--db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb18
-rw-r--r--db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb57
-rw-r--r--db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb40
-rw-r--r--db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb25
-rw-r--r--db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb17
-rw-r--r--db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb26
-rw-r--r--db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb9
-rw-r--r--db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb28
-rw-r--r--db/migrate/20210707171554_create_vulnerability_flags.rb30
-rw-r--r--db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb15
-rw-r--r--db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb26
-rw-r--r--db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb28
-rw-r--r--db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb9
-rw-r--r--db/migrate/20210708124229_add_security_scans_created_at_index.rb17
-rw-r--r--db/migrate/20210708131048_add_error_tracking_counter_cache.rb11
-rw-r--r--db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb11
-rw-r--r--db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb11
-rw-r--r--db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb17
-rw-r--r--db/migrate/20210709132707_change_default_job_token_scope_enabled.rb17
-rw-r--r--db/migrate/20210709221051_create_work_item_types.rb34
-rw-r--r--db/migrate/20210709221659_add_work_item_type_id_to_issue.rb31
-rw-r--r--db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb8
-rw-r--r--db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb20
-rw-r--r--db/migrate/20210713123345_create_dast_profile_schedule.rb36
-rw-r--r--db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb7
-rw-r--r--db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb17
-rw-r--r--db/migrate/20210713211008_create_banned_users.rb20
-rw-r--r--db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb11
-rw-r--r--db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb17
-rw-r--r--db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb18
-rw-r--r--db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb17
-rw-r--r--db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb17
-rw-r--r--db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb17
-rw-r--r--db/migrate/20210716074555_revert_default_job_token_scope.rb17
-rw-r--r--db/migrate/20210719145532_add_foreign_keys_view.rb26
-rw-r--r--db/migrate/20210719182944_add_request_response_to_supporing_message.rb20
-rw-r--r--db/migrate/20210719192928_add_invite_email_success_to_member.rb11
-rw-r--r--db/migrate/20210720083432_change_application_setting_terms_not_null.rb12
-rw-r--r--db/migrate/20210720130006_create_error_tracking_client_keys.rb24
-rw-r--r--db/migrate/20210720140841_create_postgres_async_indexes_table.rb27
-rw-r--r--db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb13
-rw-r--r--db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb13
-rw-r--r--db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb14
-rw-r--r--db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb14
-rw-r--r--db/migrate/20210721134706_add_type_new_to_integrations.rb10
-rw-r--r--db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb15
-rw-r--r--db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb79
-rw-r--r--db/migrate/20210721145029_add_state_to_members.rb13
-rw-r--r--db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb7
-rw-r--r--db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb29
-rw-r--r--db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb34
-rw-r--r--db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb13
-rw-r--r--db/migrate/20210722074242_add_user_to_escalation_rules.rb17
-rw-r--r--db/migrate/20210722074256_add_user_index_to_escalation_rules.rb33
-rw-r--r--db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb17
-rw-r--r--db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb17
-rw-r--r--db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb20
-rw-r--r--db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb29
-rw-r--r--db/migrate/20210722151951_add_columns_to_security_scans.rb21
-rw-r--r--db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb17
-rw-r--r--db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb20
-rw-r--r--db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb11
-rw-r--r--db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb11
-rw-r--r--db/migrate/20210728110654_add_status_to_error_tracking_error.rb11
-rw-r--r--db/migrate/20210728174349_add_fk_to_security_scans_columns.rb21
-rw-r--r--db/migrate/20210729061526_add_pronunciation_to_user_details.rb20
-rw-r--r--db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb15
-rw-r--r--db/migrate/20210729081351_create_topics.rb22
-rw-r--r--db/migrate/20210729081739_create_project_topics.rb16
-rw-r--r--db/migrate/20210729123101_confirm_security_bot.rb18
-rw-r--r--db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb17
-rw-r--r--db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb17
-rw-r--r--db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb24
-rw-r--r--db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb19
-rw-r--r--db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb20
-rw-r--r--db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb10
-rw-r--r--db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb20
-rw-r--r--db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb20
-rw-r--r--db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb33
-rw-r--r--db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb17
-rw-r--r--db/migrate/20210804150320_create_base_work_item_types.rb35
-rw-r--r--db/migrate/20210804200114_create_customer_relations_organizations.rb27
-rw-r--r--db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb20
-rw-r--r--db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb7
-rw-r--r--db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb17
-rw-r--r--db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb7
-rw-r--r--db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb26
-rw-r--r--db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb7
-rw-r--r--db/migrate/20210809014850_create_agent_group_authorizations.rb16
-rw-r--r--db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb22
-rw-r--r--db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb11
-rw-r--r--db/migrate/20210811120204_create_customer_relations_contacts.rb31
-rw-r--r--db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb14
-rw-r--r--db/migrate/20210812171704_create_project_ci_feature_usages.rb12
-rw-r--r--db/migrate/20210813101742_create_zentao_tracker_data.rb18
-rw-r--r--db/migrate/20210813111909_create_ci_build_trace_metadata.rb32
-rw-r--r--db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb22
-rw-r--r--db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb38
-rw-r--r--db/migrate/20210816161107_remove_index_containing_faulty_regex.rb18
-rw-r--r--db/migrate/20210816192041_add_invites_email_success_to_member.rb13
-rw-r--r--db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb20
-rw-r--r--db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb17
-rw-r--r--db/migrate/20210817172214_add_yaml_limits_application_setting.rb10
-rw-r--r--db/migrate/20210818034001_index_historical_data_on_recorded_at.rb17
-rw-r--r--db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb29
-rw-r--r--db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb30
-rw-r--r--db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb13
-rw-r--r--db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb79
-rw-r--r--db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb17
-rw-r--r--db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb9
-rw-r--r--db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb22
-rw-r--r--db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb24
-rw-r--r--db/migrate/20210819120243_add_throttle_files_api_columns.rb13
-rw-r--r--db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb17
-rw-r--r--db/migrate/20210819153805_set_default_job_token_scope_true.rb17
-rw-r--r--db/migrate/20210819162047_add_columns_to_namespace_settings.rb21
-rw-r--r--db/migrate/20210819185500_create_external_audit_event_destinations_table.rb15
-rw-r--r--db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb22
-rw-r--r--db/migrate/20210823172643_create_user_group_callout.rb19
-rw-r--r--db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb22
-rw-r--r--db/migrate/20210824055322_add_project_namespace_id_to_project.rb21
-rw-r--r--db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb8
-rw-r--r--db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb7
-rw-r--r--db/migrate/20210825104558_change_description_limit_error_tracking_event.rb17
-rw-r--r--db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb28
-rw-r--r--db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb28
-rw-r--r--db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb10
-rw-r--r--db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb9
-rw-r--r--db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb22
-rw-r--r--db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb26
-rw-r--r--db/migrate/20210826124311_add_index_to_error_tracking_error.rb23
-rw-r--r--db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb27
-rw-r--r--db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb10
-rw-r--r--db/migrate/20210826171758_init_schema.rb (renamed from db/migrate/20210602155110_init_schema.rb)0
-rw-r--r--db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb11
-rw-r--r--db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb13
-rw-r--r--db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb17
-rw-r--r--db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb13
-rw-r--r--db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb11
-rw-r--r--db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb36
-rw-r--r--db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb43
-rw-r--r--db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb13
-rw-r--r--db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb26
-rw-r--r--db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb26
-rw-r--r--db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb17
-rw-r--r--db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb32
-rw-r--r--db/post_migrate/20210611080951_fix_missing_traversal_ids.rb48
-rw-r--r--db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb20
-rw-r--r--db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb32
-rw-r--r--db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb17
-rw-r--r--db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb17
-rw-r--r--db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb20
-rw-r--r--db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb19
-rw-r--r--db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb14
-rw-r--r--db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb13
-rw-r--r--db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb75
-rw-r--r--db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb86
-rw-r--r--db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb25
-rw-r--r--db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb16
-rw-r--r--db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb21
-rw-r--r--db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb17
-rw-r--r--db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb15
-rw-r--r--db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb69
-rw-r--r--db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb26
-rw-r--r--db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb65
-rw-r--r--db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb18
-rw-r--r--db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb19
-rw-r--r--db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb17
-rw-r--r--db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb7
-rw-r--r--db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb9
-rw-r--r--db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb84
-rw-r--r--db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb77
-rw-r--r--db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb113
-rw-r--r--db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb58
-rw-r--r--db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb13
-rw-r--r--db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb59
-rw-r--r--db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb12
-rw-r--r--db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb11
-rw-r--r--db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb10
-rw-r--r--db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb10
-rw-r--r--db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb56
-rw-r--r--db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb28
-rw-r--r--db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb31
-rw-r--r--db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb17
-rw-r--r--db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb18
-rw-r--r--db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb55
-rw-r--r--db/post_migrate/20210727113447_backfill_integrations_type_new.rb23
-rw-r--r--db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb27
-rw-r--r--db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb30
-rw-r--r--db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb24
-rw-r--r--db/post_migrate/20210729193056_drop_ci_test_cases_table.rb23
-rw-r--r--db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb37
-rw-r--r--db/post_migrate/20210730170823_schedule_security_setting_creation.rb26
-rw-r--r--db/post_migrate/20210731132939_backfill_stage_event_hash.rb115
-rw-r--r--db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb87
-rw-r--r--db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb18
-rw-r--r--db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb45
-rw-r--r--db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb11
-rw-r--r--db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb38
-rw-r--r--db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb29
-rw-r--r--db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb21
-rw-r--r--db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb67
-rw-r--r--db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb48
-rw-r--r--db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb13
-rw-r--r--db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb88
-rw-r--r--db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb51
-rw-r--r--db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb79
-rw-r--r--db/post_migrate/20210811122206_update_external_project_bots.rb33
-rw-r--r--db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb13
-rw-r--r--db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb112
-rw-r--r--db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb16
-rw-r--r--db/post_migrate/20210813151908_replace_external_wiki_triggers.rb66
-rw-r--r--db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb12
-rw-r--r--db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb11
-rw-r--r--db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb25
-rw-r--r--db/post_migrate/20210818185845_backfill_projects_with_coverage.rb11
-rw-r--r--db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb28
-rw-r--r--db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb17
-rw-r--r--db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb28
-rw-r--r--db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb33
-rw-r--r--db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb30
-rw-r--r--db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb19
-rw-r--r--db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb17
-rw-r--r--db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb19
-rw-r--r--db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb55
-rw-r--r--db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb27
-rw-r--r--db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb23
-rw-r--r--db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb19
-rw-r--r--db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb49
-rw-r--r--db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb16
-rw-r--r--db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb23
-rw-r--r--db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb17
-rw-r--r--db/schema_migrations/202106021551101
-rw-r--r--db/schema_migrations/202106021640441
-rw-r--r--db/schema_migrations/202106031403021
-rw-r--r--db/schema_migrations/202106032223331
-rw-r--r--db/schema_migrations/202106040327381
-rw-r--r--db/schema_migrations/202106040341581
-rw-r--r--db/schema_migrations/202106040343541
-rw-r--r--db/schema_migrations/202106040513301
-rw-r--r--db/schema_migrations/202106040517421
-rw-r--r--db/schema_migrations/202106040519171
-rw-r--r--db/schema_migrations/202106040821451
-rw-r--r--db/schema_migrations/202106040856001
-rw-r--r--db/schema_migrations/202106041336511
-rw-r--r--db/schema_migrations/202106061434261
-rw-r--r--db/schema_migrations/202106070505311
-rw-r--r--db/schema_migrations/202106070800441
-rw-r--r--db/schema_migrations/202106071547191
-rw-r--r--db/schema_migrations/202106080723121
-rw-r--r--db/schema_migrations/202106080723461
-rw-r--r--db/schema_migrations/202106081032301
-rw-r--r--db/schema_migrations/202106081032351
-rw-r--r--db/schema_migrations/202106081107521
-rw-r--r--db/schema_migrations/202106081107601
-rw-r--r--db/schema_migrations/202106090135121
-rw-r--r--db/schema_migrations/202106090908561
-rw-r--r--db/schema_migrations/202106091250051
-rw-r--r--db/schema_migrations/202106091927281
-rw-r--r--db/schema_migrations/202106091931011
-rw-r--r--db/schema_migrations/202106092025011
-rw-r--r--db/schema_migrations/202106100427001
-rw-r--r--db/schema_migrations/202106101024101
-rw-r--r--db/schema_migrations/202106101024131
-rw-r--r--db/schema_migrations/202106101132291
-rw-r--r--db/schema_migrations/202106101417111
-rw-r--r--db/schema_migrations/202106101535561
-rw-r--r--db/schema_migrations/202106110809511
-rw-r--r--db/schema_migrations/202106110828221
-rw-r--r--db/schema_migrations/202106111003591
-rw-r--r--db/schema_migrations/202106111010341
-rw-r--r--db/schema_migrations/202106141241111
-rw-r--r--db/schema_migrations/202106141310021
-rw-r--r--db/schema_migrations/202106141423111
-rw-r--r--db/schema_migrations/202106141439541
-rw-r--r--db/schema_migrations/202106150643421
-rw-r--r--db/schema_migrations/202106152349351
-rw-r--r--db/schema_migrations/202106161107481
-rw-r--r--db/schema_migrations/202106161113111
-rw-r--r--db/schema_migrations/202106161349051
-rw-r--r--db/schema_migrations/202106161452541
-rw-r--r--db/schema_migrations/202106161548081
-rw-r--r--db/schema_migrations/202106161859471
-rw-r--r--db/schema_migrations/202106170223241
-rw-r--r--db/schema_migrations/202106171613481
-rw-r--r--db/schema_migrations/202106171801311
-rw-r--r--db/schema_migrations/202106210433371
-rw-r--r--db/schema_migrations/202106210440001
-rw-r--r--db/schema_migrations/202106210846321
-rw-r--r--db/schema_migrations/202106210900301
-rw-r--r--db/schema_migrations/202106210918301
-rw-r--r--db/schema_migrations/202106211117471
-rw-r--r--db/schema_migrations/202106211553281
-rw-r--r--db/schema_migrations/202106211642101
-rw-r--r--db/schema_migrations/202106212230001
-rw-r--r--db/schema_migrations/202106212232421
-rw-r--r--db/schema_migrations/202106220418461
-rw-r--r--db/schema_migrations/202106220457051
-rw-r--r--db/schema_migrations/202106221352211
-rw-r--r--db/schema_migrations/202106221411481
-rw-r--r--db/schema_migrations/202106230742261
-rw-r--r--db/schema_migrations/202106231237221
-rw-r--r--db/schema_migrations/202106231336351
-rw-r--r--db/schema_migrations/202106231633421
-rw-r--r--db/schema_migrations/202106241128211
-rw-r--r--db/schema_migrations/202106241806131
-rw-r--r--db/schema_migrations/202106250945541
-rw-r--r--db/schema_migrations/202106272049361
-rw-r--r--db/schema_migrations/202106281245051
-rw-r--r--db/schema_migrations/202106281549001
-rw-r--r--db/schema_migrations/202106290319001
-rw-r--r--db/schema_migrations/202106291017121
-rw-r--r--db/schema_migrations/202106291049331
-rw-r--r--db/schema_migrations/202106291535191
-rw-r--r--db/schema_migrations/202106300250201
-rw-r--r--db/schema_migrations/202106301443391
-rw-r--r--db/schema_migrations/202106302225221
-rw-r--r--db/schema_migrations/202106302246251
-rw-r--r--db/schema_migrations/202107010336221
-rw-r--r--db/schema_migrations/202107011116271
-rw-r--r--db/schema_migrations/202107011119091
-rw-r--r--db/schema_migrations/202107011413461
-rw-r--r--db/schema_migrations/202107021248421
-rw-r--r--db/schema_migrations/202107051241281
-rw-r--r--db/schema_migrations/202107051309191
-rw-r--r--db/schema_migrations/202107051329281
-rw-r--r--db/schema_migrations/202107051427141
-rw-r--r--db/schema_migrations/202107051431501
-rw-r--r--db/schema_migrations/202107051446571
-rw-r--r--db/schema_migrations/202107060847131
-rw-r--r--db/schema_migrations/202107061128001
-rw-r--r--db/schema_migrations/202107061153121
-rw-r--r--db/schema_migrations/202107061208471
-rw-r--r--db/schema_migrations/202107061428191
-rw-r--r--db/schema_migrations/202107061511541
-rw-r--r--db/schema_migrations/202107061514461
-rw-r--r--db/schema_migrations/202107061521391
-rw-r--r--db/schema_migrations/202107062127101
-rw-r--r--db/schema_migrations/202107062135371
-rw-r--r--db/schema_migrations/202107070955451
-rw-r--r--db/schema_migrations/202107071130561
-rw-r--r--db/schema_migrations/202107071515361
-rw-r--r--db/schema_migrations/202107071636591
-rw-r--r--db/schema_migrations/202107071715361
-rw-r--r--db/schema_migrations/202107071715541
-rw-r--r--db/schema_migrations/202107071736451
-rw-r--r--db/schema_migrations/202107071815361
-rw-r--r--db/schema_migrations/202107072109161
-rw-r--r--db/schema_migrations/202107080114251
-rw-r--r--db/schema_migrations/202107080114261
-rw-r--r--db/schema_migrations/202107080630321
-rw-r--r--db/schema_migrations/202107081242291
-rw-r--r--db/schema_migrations/202107081304191
-rw-r--r--db/schema_migrations/202107081310481
-rw-r--r--db/schema_migrations/202107081344461
-rw-r--r--db/schema_migrations/202107082025481
-rw-r--r--db/schema_migrations/202107090240481
-rw-r--r--db/schema_migrations/202107090857591
-rw-r--r--db/schema_migrations/202107091327071
-rw-r--r--db/schema_migrations/202107092210511
-rw-r--r--db/schema_migrations/202107092216591
-rw-r--r--db/schema_migrations/202107120525191
-rw-r--r--db/schema_migrations/202107130420001
-rw-r--r--db/schema_migrations/202107130421531
-rw-r--r--db/schema_migrations/202107130708421
-rw-r--r--db/schema_migrations/202107130751171
-rw-r--r--db/schema_migrations/202107131233451
-rw-r--r--db/schema_migrations/202107131351521
-rw-r--r--db/schema_migrations/202107131446371
-rw-r--r--db/schema_migrations/202107132110081
-rw-r--r--db/schema_migrations/202107132239411
-rw-r--r--db/schema_migrations/202107140155371
-rw-r--r--db/schema_migrations/202107140438181
-rw-r--r--db/schema_migrations/202107141206001
-rw-r--r--db/schema_migrations/202107150743591
-rw-r--r--db/schema_migrations/202107150749331
-rw-r--r--db/schema_migrations/202107150752031
-rw-r--r--db/schema_migrations/202107160745551
-rw-r--r--db/schema_migrations/202107191455321
-rw-r--r--db/schema_migrations/202107191829441
-rw-r--r--db/schema_migrations/202107191929281
-rw-r--r--db/schema_migrations/202107200834321
-rw-r--r--db/schema_migrations/202107201300061
-rw-r--r--db/schema_migrations/202107201408411
-rw-r--r--db/schema_migrations/202107211228401
-rw-r--r--db/schema_migrations/202107211255251
-rw-r--r--db/schema_migrations/202107211255451
-rw-r--r--db/schema_migrations/202107211256201
-rw-r--r--db/schema_migrations/202107211256371
-rw-r--r--db/schema_migrations/202107211258041
-rw-r--r--db/schema_migrations/202107211258201
-rw-r--r--db/schema_migrations/202107211347061
-rw-r--r--db/schema_migrations/202107211347071
-rw-r--r--db/schema_migrations/202107211356381
-rw-r--r--db/schema_migrations/202107211450291
-rw-r--r--db/schema_migrations/202107211744111
-rw-r--r--db/schema_migrations/202107211744411
-rw-r--r--db/schema_migrations/202107211744531
-rw-r--r--db/schema_migrations/202107211745211
-rw-r--r--db/schema_migrations/202107212116021
-rw-r--r--db/schema_migrations/202107220101011
-rw-r--r--db/schema_migrations/202107220429391
-rw-r--r--db/schema_migrations/202107220552171
-rw-r--r--db/schema_migrations/202107220742201
-rw-r--r--db/schema_migrations/202107220742421
-rw-r--r--db/schema_migrations/202107220742561
-rw-r--r--db/schema_migrations/202107220743091
-rw-r--r--db/schema_migrations/202107220743391
-rw-r--r--db/schema_migrations/202107221105151
-rw-r--r--db/schema_migrations/202107221328441
-rw-r--r--db/schema_migrations/202107221501021
-rw-r--r--db/schema_migrations/202107221519511
-rw-r--r--db/schema_migrations/202107221556351
-rw-r--r--db/schema_migrations/202107222100411
-rw-r--r--db/schema_migrations/202107231731321
-rw-r--r--db/schema_migrations/202107261349501
-rw-r--r--db/schema_migrations/202107262027481
-rw-r--r--db/schema_migrations/202107271134471
-rw-r--r--db/schema_migrations/202107271752011
-rw-r--r--db/schema_migrations/202107281106541
-rw-r--r--db/schema_migrations/202107281743491
-rw-r--r--db/schema_migrations/202107290615261
-rw-r--r--db/schema_migrations/202107290615561
-rw-r--r--db/schema_migrations/202107290813511
-rw-r--r--db/schema_migrations/202107290817391
-rw-r--r--db/schema_migrations/202107291231011
-rw-r--r--db/schema_migrations/202107291256411
-rw-r--r--db/schema_migrations/202107291256591
-rw-r--r--db/schema_migrations/202107291612421
-rw-r--r--db/schema_migrations/202107291633121
-rw-r--r--db/schema_migrations/202107291921481
-rw-r--r--db/schema_migrations/202107291929591
-rw-r--r--db/schema_migrations/202107291930561
-rw-r--r--db/schema_migrations/202107292021431
-rw-r--r--db/schema_migrations/202107301016091
-rw-r--r--db/schema_migrations/202107301029521
-rw-r--r--db/schema_migrations/202107301038081
-rw-r--r--db/schema_migrations/202107301048001
-rw-r--r--db/schema_migrations/202107301708231
-rw-r--r--db/schema_migrations/202107301945551
-rw-r--r--db/schema_migrations/202107311329391
-rw-r--r--db/schema_migrations/202108020432531
-rw-r--r--db/schema_migrations/202108021122331
-rw-r--r--db/schema_migrations/202108021318121
-rw-r--r--db/schema_migrations/202108031109201
-rw-r--r--db/schema_migrations/202108041503201
-rw-r--r--db/schema_migrations/202108041506241
-rw-r--r--db/schema_migrations/202108041514441
-rw-r--r--db/schema_migrations/202108041533071
-rw-r--r--db/schema_migrations/202108041544071
-rw-r--r--db/schema_migrations/202108042001141
-rw-r--r--db/schema_migrations/202108042020571
-rw-r--r--db/schema_migrations/202108050857061
-rw-r--r--db/schema_migrations/202108051315101
-rw-r--r--db/schema_migrations/202108051924501
-rw-r--r--db/schema_migrations/202108060118111
-rw-r--r--db/schema_migrations/202108061317061
-rw-r--r--db/schema_migrations/202108061521041
-rw-r--r--db/schema_migrations/202108071014461
-rw-r--r--db/schema_migrations/202108071016211
-rw-r--r--db/schema_migrations/202108071020041
-rw-r--r--db/schema_migrations/202108090148501
-rw-r--r--db/schema_migrations/202108090149181
-rw-r--r--db/schema_migrations/202108091236581
-rw-r--r--db/schema_migrations/202108091439311
-rw-r--r--db/schema_migrations/202108091942501
-rw-r--r--db/schema_migrations/202108111202041
-rw-r--r--db/schema_migrations/202108111222061
-rw-r--r--db/schema_migrations/202108111930331
-rw-r--r--db/schema_migrations/202108112148111
-rw-r--r--db/schema_migrations/202108120130421
-rw-r--r--db/schema_migrations/202108121450101
-rw-r--r--db/schema_migrations/202108121717041
-rw-r--r--db/schema_migrations/202108131017421
-rw-r--r--db/schema_migrations/202108131119091
-rw-r--r--db/schema_migrations/202108131313131
-rw-r--r--db/schema_migrations/202108131519081
-rw-r--r--db/schema_migrations/202108131955181
-rw-r--r--db/schema_migrations/202108160958261
-rw-r--r--db/schema_migrations/202108161611071
-rw-r--r--db/schema_migrations/202108161833041
-rw-r--r--db/schema_migrations/202108161920411
-rw-r--r--db/schema_migrations/202108170243351
-rw-r--r--db/schema_migrations/202108170843381
-rw-r--r--db/schema_migrations/202108171304151
-rw-r--r--db/schema_migrations/202108171722141
-rw-r--r--db/schema_migrations/202108180340011
-rw-r--r--db/schema_migrations/202108180553571
-rw-r--r--db/schema_migrations/202108180611561
-rw-r--r--db/schema_migrations/202108181156131
-rw-r--r--db/schema_migrations/202108181759491
-rw-r--r--db/schema_migrations/202108181855481
-rw-r--r--db/schema_migrations/202108181858451
-rw-r--r--db/schema_migrations/202108181930081
-rw-r--r--db/schema_migrations/202108182004551
-rw-r--r--db/schema_migrations/202108182202341
-rw-r--r--db/schema_migrations/202108191202431
-rw-r--r--db/schema_migrations/202108191450001
-rw-r--r--db/schema_migrations/202108191527231
-rw-r--r--db/schema_migrations/202108191538051
-rw-r--r--db/schema_migrations/202108191620471
-rw-r--r--db/schema_migrations/202108191831281
-rw-r--r--db/schema_migrations/202108191855001
-rw-r--r--db/schema_migrations/202108201718341
-rw-r--r--db/schema_migrations/202108231132591
-rw-r--r--db/schema_migrations/202108231326001
-rw-r--r--db/schema_migrations/202108231420361
-rw-r--r--db/schema_migrations/202108231726431
-rw-r--r--db/schema_migrations/202108231932341
-rw-r--r--db/schema_migrations/202108232134171
-rw-r--r--db/schema_migrations/202108240553221
-rw-r--r--db/schema_migrations/202108241026241
-rw-r--r--db/schema_migrations/202108241027501
-rw-r--r--db/schema_migrations/202108241050381
-rw-r--r--db/schema_migrations/202108241604591
-rw-r--r--db/schema_migrations/202108241746151
-rw-r--r--db/schema_migrations/202108251045581
-rw-r--r--db/schema_migrations/202108251046561
-rw-r--r--db/schema_migrations/202108251100161
-rw-r--r--db/schema_migrations/202108251502121
-rw-r--r--db/schema_migrations/202108251823031
-rw-r--r--db/schema_migrations/202108251904581
-rw-r--r--db/schema_migrations/202108251934481
-rw-r--r--db/schema_migrations/202108251935481
-rw-r--r--db/schema_migrations/202108251936521
-rw-r--r--db/schema_migrations/202108261108391
-rw-r--r--db/schema_migrations/202108261208341
-rw-r--r--db/schema_migrations/202108261227481
-rw-r--r--db/schema_migrations/202108261243111
-rw-r--r--db/schema_migrations/202108261455091
-rw-r--r--db/schema_migrations/202108261709021
-rw-r--r--db/schema_migrations/202301301255411
-rw-r--r--db/schema_migrations/202301301306241
-rw-r--r--db/schema_migrations/202302061438511
-rw-r--r--db/schema_migrations/202302071436021
-rw-r--r--db/schema_migrations/202302071438441
-rw-r--r--db/structure.sql32
612 files changed, 3265 insertions, 8078 deletions
diff --git a/db/docs/postgres_async_foreign_key_validations.yml b/db/docs/postgres_async_foreign_key_validations.yml
new file mode 100644
index 00000000000..0b9608a3ace
--- /dev/null
+++ b/db/docs/postgres_async_foreign_key_validations.yml
@@ -0,0 +1,11 @@
+---
+table_name: postgres_async_foreign_key_validations
+classes:
+- Gitlab::Database::AsyncForeignKeys::PostgresAsyncForeignKeyValidation
+feature_categories:
+- database
+description: >-
+ Contains a queue-like structure for database foreign key validations scheduled to be executed asynchronously.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111293
+milestone: '15.9'
+gitlab_schema: gitlab_shared
diff --git a/db/init_structure.sql b/db/init_structure.sql
index 00f06078426..2b952381952 100644
--- a/db/init_structure.sql
+++ b/db/init_structure.sql
@@ -10,6 +10,30 @@ CREATE EXTENSION IF NOT EXISTS btree_gist;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
+CREATE FUNCTION insert_into_loose_foreign_keys_deleted_records() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ INSERT INTO loose_foreign_keys_deleted_records
+ (deleted_table_name, deleted_table_primary_key_value)
+ SELECT TG_TABLE_NAME, old_table.id FROM old_table
+ ON CONFLICT DO NOTHING;
+
+ RETURN NULL;
+END
+$$;
+
+CREATE FUNCTION integrations_set_type_new() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1')
+WHERE integrations.id = NEW.id;
+RETURN NULL;
+
+END
+$$;
+
CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -18,7 +42,7 @@ UPDATE projects SET has_external_issue_tracker = (
EXISTS
(
SELECT 1
- FROM services
+ FROM integrations
WHERE project_id = COALESCE(NEW.project_id, OLD.project_id)
AND active = TRUE
AND category = 'issue_tracker'
@@ -41,62 +65,6 @@ RETURN NULL;
END
$$;
-CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
-IF (TG_OP = 'DELETE') THEN
- DELETE FROM web_hook_logs_archived where id = OLD.id;
-ELSIF (TG_OP = 'UPDATE') THEN
- UPDATE web_hook_logs_archived
- SET web_hook_id = NEW.web_hook_id,
- trigger = NEW.trigger,
- url = NEW.url,
- request_headers = NEW.request_headers,
- request_data = NEW.request_data,
- response_headers = NEW.response_headers,
- response_body = NEW.response_body,
- response_status = NEW.response_status,
- execution_duration = NEW.execution_duration,
- internal_error_message = NEW.internal_error_message,
- created_at = NEW.created_at,
- updated_at = NEW.updated_at
- WHERE web_hook_logs_archived.id = NEW.id;
-ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO web_hook_logs_archived (id,
- web_hook_id,
- trigger,
- url,
- request_headers,
- request_data,
- response_headers,
- response_body,
- response_status,
- execution_duration,
- internal_error_message,
- created_at,
- updated_at)
- VALUES (NEW.id,
- NEW.web_hook_id,
- NEW.trigger,
- NEW.url,
- NEW.request_headers,
- NEW.request_data,
- NEW.response_headers,
- NEW.response_body,
- NEW.response_status,
- NEW.execution_duration,
- NEW.internal_error_message,
- NEW.created_at,
- NEW.updated_at);
-END IF;
-RETURN NULL;
-
-END
-$$;
-
-COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table';
-
CREATE FUNCTION trigger_07c94931164e() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -125,11 +93,20 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger
+CREATE FUNCTION trigger_490d204c00b3() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
- NEW."build_id_convert_to_bigint" := NEW."build_id";
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_542d6c2ad72e() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
RETURN NEW;
END;
$$;
@@ -189,16 +166,6 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_be1804f21693() RETURNS trigger
- LANGUAGE plpgsql
- AS $$
-BEGIN
- NEW."id_convert_to_bigint" := NEW."id";
- NEW."job_id_convert_to_bigint" := NEW."job_id";
- RETURN NEW;
-END;
-$$;
-
CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -407,6 +374,320 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 (
);
ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 (
+ id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL,
+ author_id integer NOT NULL,
+ entity_id integer NOT NULL,
+ entity_type character varying NOT NULL,
+ details text,
+ ip_address inet,
+ author_name text,
+ target_details text,
+ entity_path text,
+ created_at timestamp without time zone NOT NULL,
+ target_type text,
+ target_id bigint,
+ CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)),
+ CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)),
+ CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)),
+ CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500))
+);
+ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
+
+CREATE TABLE incident_management_pending_alert_escalations (
+ id bigint NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+)
+PARTITION BY RANGE (process_at);
+
+CREATE SEQUENCE incident_management_pending_alert_escalations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_pending_alert_escalations_id_seq OWNED BY incident_management_pending_alert_escalations.id;
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 FOR VALUES FROM ('2022-10-31 19:00:00-05') TO ('2022-11-30 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 (
+ id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ alert_id bigint NOT NULL,
+ schedule_id bigint,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ status smallint
+);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+
+CREATE TABLE incident_management_pending_issue_escalations (
+ id bigint NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+)
+PARTITION BY RANGE (process_at);
+
+CREATE SEQUENCE incident_management_pending_issue_escalations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_pending_issue_escalations_id_seq OWNED BY incident_management_pending_issue_escalations.id;
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 FOR VALUES FROM ('2022-10-31 19:00:00-05') TO ('2022-11-30 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 (
+ id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL,
+ rule_id bigint NOT NULL,
+ issue_id bigint NOT NULL,
+ process_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05');
+
+CREATE TABLE loose_foreign_keys_deleted_records (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+)
+PARTITION BY RANGE (created_at);
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000 FOR VALUES FROM (MINVALUE) TO ('2022-11-30 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 FOR VALUES FROM ('2022-11-30 18:00:00-06') TO ('2022-12-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05');
+
+CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304 (
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ deleted_table_name text NOT NULL,
+ deleted_table_primary_key_value bigint NOT NULL,
+ CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63))
+);
+ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05');
+
CREATE TABLE web_hook_logs (
id bigint NOT NULL,
web_hook_id integer NOT NULL,
@@ -570,6 +851,815 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 (
);
ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00');
+CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 (
+ id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL,
+ web_hook_id integer NOT NULL,
+ trigger character varying,
+ url character varying,
+ request_headers text,
+ request_data text,
+ response_headers text,
+ response_body text,
+ response_status character varying,
+ execution_duration double precision,
+ internal_error_message character varying,
+ updated_at timestamp without time zone NOT NULL,
+ created_at timestamp without time zone NOT NULL
+);
+ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307 FOR VALUES FROM ('2023-07-01 00:00:00') TO ('2023-08-01 00:00:00');
+
+CREATE TABLE analytics_cycle_analytics_issue_stage_events (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+)
+PARTITION BY HASH (stage_event_hash_id);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 (
+ stage_event_hash_id integer NOT NULL,
+ issue_id integer NOT NULL,
+ group_id integer NOT NULL,
+ project_id integer NOT NULL,
+ milestone_id integer,
+ author_id integer,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);
+
+CREATE TABLE analytics_cycle_analytics_merge_request_stage_events (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+)
+PARTITION BY HASH (stage_event_hash_id);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30);
+
+CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 (
+ stage_event_hash_id bigint NOT NULL,
+ merge_request_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ milestone_id bigint,
+ author_id bigint,
+ start_event_timestamp timestamp with time zone NOT NULL,
+ end_event_timestamp timestamp with time zone
+);
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31);
+
CREATE TABLE product_analytics_events_experimental (
id bigint NOT NULL,
project_id integer NOT NULL,
@@ -9245,6 +10335,22 @@ CREATE SEQUENCE abuse_reports_id_seq
ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id;
+CREATE TABLE agent_group_authorizations (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ agent_id bigint NOT NULL,
+ config jsonb NOT NULL
+);
+
+CREATE SEQUENCE agent_group_authorizations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE agent_group_authorizations_id_seq OWNED BY agent_group_authorizations.id;
+
CREATE TABLE alert_management_alert_assignees (
id bigint NOT NULL,
user_id bigint NOT NULL,
@@ -9372,7 +10478,9 @@ CREATE TABLE analytics_cycle_analytics_group_stages (
hidden boolean DEFAULT false NOT NULL,
custom boolean DEFAULT true NOT NULL,
name character varying(255) NOT NULL,
- group_value_stream_id bigint NOT NULL
+ group_value_stream_id bigint NOT NULL,
+ stage_event_hash_id bigint,
+ CONSTRAINT check_e6bd4271b5 CHECK ((stage_event_hash_id IS NOT NULL))
);
CREATE SEQUENCE analytics_cycle_analytics_group_stages_id_seq
@@ -9415,7 +10523,9 @@ CREATE TABLE analytics_cycle_analytics_project_stages (
hidden boolean DEFAULT false NOT NULL,
custom boolean DEFAULT true NOT NULL,
name character varying(255) NOT NULL,
- project_value_stream_id bigint NOT NULL
+ project_value_stream_id bigint NOT NULL,
+ stage_event_hash_id bigint,
+ CONSTRAINT check_8f6019de1e CHECK ((stage_event_hash_id IS NOT NULL))
);
CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq
@@ -9445,6 +10555,20 @@ CREATE SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq
ALTER SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq OWNED BY analytics_cycle_analytics_project_value_streams.id;
+CREATE TABLE analytics_cycle_analytics_stage_event_hashes (
+ id bigint NOT NULL,
+ hash_sha256 bytea
+);
+
+CREATE SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY analytics_cycle_analytics_stage_event_hashes.id;
+
CREATE TABLE analytics_devops_adoption_segments (
id bigint NOT NULL,
last_recorded_at timestamp with time zone,
@@ -9478,6 +10602,11 @@ CREATE TABLE analytics_devops_adoption_snapshots (
total_projects_count integer,
code_owners_used_count integer,
namespace_id integer,
+ sast_enabled_count integer,
+ dast_enabled_count integer,
+ dependency_scanning_enabled_count integer,
+ coverage_fuzzing_enabled_count integer,
+ vulnerability_management_used_count integer,
CONSTRAINT check_3f472de131 CHECK ((namespace_id IS NOT NULL))
);
@@ -9794,7 +10923,6 @@ CREATE TABLE application_settings (
npm_package_requests_forwarding boolean DEFAULT true NOT NULL,
push_rule_id bigint,
issues_create_limit integer DEFAULT 0 NOT NULL,
- seat_link_enabled boolean DEFAULT true NOT NULL,
container_expiration_policies_enable_historic_entries boolean DEFAULT false NOT NULL,
group_owners_can_manage_default_branch_protection boolean DEFAULT true NOT NULL,
container_registry_vendor text DEFAULT ''::text NOT NULL,
@@ -9848,7 +10976,6 @@ CREATE TABLE application_settings (
secret_detection_revocation_token_types_url text,
encrypted_cloud_license_auth_token text,
encrypted_cloud_license_auth_token_iv text,
- cloud_license_enabled boolean DEFAULT false NOT NULL,
personal_access_token_prefix text,
kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL,
disable_feed_token boolean DEFAULT false NOT NULL,
@@ -9886,6 +11013,25 @@ CREATE TABLE application_settings (
floc_enabled boolean DEFAULT false NOT NULL,
diff_max_lines integer DEFAULT 50000 NOT NULL,
diff_max_files integer DEFAULT 1000 NOT NULL,
+ encrypted_mailgun_signing_key bytea,
+ encrypted_mailgun_signing_key_iv bytea,
+ mailgun_events_enabled boolean DEFAULT false NOT NULL,
+ usage_ping_features_enabled boolean DEFAULT false NOT NULL,
+ encrypted_customers_dot_jwt_signing_key bytea,
+ encrypted_customers_dot_jwt_signing_key_iv bytea,
+ pypi_package_requests_forwarding boolean DEFAULT true NOT NULL,
+ max_yaml_size_bytes bigint DEFAULT 1048576 NOT NULL,
+ max_yaml_depth integer DEFAULT 100 NOT NULL,
+ throttle_unauthenticated_files_api_requests_per_period integer DEFAULT 125 NOT NULL,
+ throttle_unauthenticated_files_api_period_in_seconds integer DEFAULT 15 NOT NULL,
+ throttle_authenticated_files_api_requests_per_period integer DEFAULT 500 NOT NULL,
+ throttle_authenticated_files_api_period_in_seconds integer DEFAULT 15 NOT NULL,
+ throttle_unauthenticated_files_api_enabled boolean DEFAULT false NOT NULL,
+ throttle_authenticated_files_api_enabled boolean DEFAULT false NOT NULL,
+ user_deactivation_emails_enabled boolean DEFAULT true NOT NULL,
+ throttle_unauthenticated_api_enabled boolean DEFAULT false NOT NULL,
+ throttle_unauthenticated_api_requests_per_period integer DEFAULT 3600 NOT NULL,
+ throttle_unauthenticated_api_period_in_seconds integer DEFAULT 3600 NOT NULL,
CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)),
CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)),
CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)),
@@ -10007,7 +11153,10 @@ CREATE TABLE approval_project_rules (
project_id integer NOT NULL,
approvals_required smallint DEFAULT 0 NOT NULL,
name character varying NOT NULL,
- rule_type smallint DEFAULT 0 NOT NULL
+ rule_type smallint DEFAULT 0 NOT NULL,
+ scanners text[],
+ vulnerabilities_allowed smallint DEFAULT 0 NOT NULL,
+ severity_levels text[] DEFAULT '{}'::text[] NOT NULL
);
CREATE TABLE approval_project_rules_groups (
@@ -10136,6 +11285,24 @@ CREATE SEQUENCE atlassian_identities_user_id_seq
ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id;
+CREATE TABLE audit_events_external_audit_event_destinations (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ destination_url text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255))
+);
+
+CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE audit_events_external_audit_event_destinations_id_seq OWNED BY audit_events_external_audit_event_destinations.id;
+
CREATE TABLE authentication_events (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -10228,6 +11395,12 @@ CREATE SEQUENCE badges_id_seq
ALTER SEQUENCE badges_id_seq OWNED BY badges.id;
+CREATE TABLE banned_users (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ user_id bigint NOT NULL
+);
+
CREATE TABLE batched_background_migration_jobs (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -10387,7 +11560,8 @@ CREATE TABLE boards (
name character varying DEFAULT 'Development'::character varying NOT NULL,
hide_backlog_list boolean DEFAULT false NOT NULL,
hide_closed_list boolean DEFAULT false NOT NULL,
- iteration_id bigint
+ iteration_id bigint,
+ iteration_cadence_id bigint
);
CREATE TABLE boards_epic_board_labels (
@@ -10753,11 +11927,11 @@ ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id;
CREATE TABLE ci_build_needs (
id integer NOT NULL,
- build_id integer NOT NULL,
+ build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
name text NOT NULL,
artifacts boolean DEFAULT true NOT NULL,
optional boolean DEFAULT false NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_build_needs_id_seq
@@ -10807,13 +11981,13 @@ ALTER SEQUENCE ci_build_report_results_build_id_seq OWNED BY ci_build_report_res
CREATE TABLE ci_build_trace_chunks (
id bigint NOT NULL,
- build_id integer NOT NULL,
+ build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
chunk_index integer NOT NULL,
data_store integer NOT NULL,
raw_data bytea,
checksum bytea,
lock_version integer DEFAULT 0 NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_build_trace_chunks_id_seq
@@ -10825,31 +11999,14 @@ CREATE SEQUENCE ci_build_trace_chunks_id_seq
ALTER SEQUENCE ci_build_trace_chunks_id_seq OWNED BY ci_build_trace_chunks.id;
-CREATE TABLE ci_build_trace_section_names (
- id integer NOT NULL,
- project_id integer NOT NULL,
- name character varying NOT NULL
-);
-
-CREATE SEQUENCE ci_build_trace_section_names_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_build_trace_section_names_id_seq OWNED BY ci_build_trace_section_names.id;
-
-CREATE TABLE ci_build_trace_sections (
- project_id integer NOT NULL,
- date_start timestamp with time zone NOT NULL,
- date_end timestamp with time zone NOT NULL,
- byte_start bigint NOT NULL,
- byte_end bigint NOT NULL,
- build_id integer NOT NULL,
- section_name_id integer NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+CREATE TABLE ci_build_trace_metadata (
+ build_id bigint NOT NULL,
+ trace_artifact_id bigint,
+ archival_attempts smallint DEFAULT 0 NOT NULL,
+ checksum bytea,
+ remote_checksum bytea,
+ last_archival_attempt_at timestamp with time zone,
+ archived_at timestamp with time zone
);
CREATE TABLE ci_builds (
@@ -10888,7 +12045,7 @@ CREATE TABLE ci_builds (
coverage_regex character varying,
auto_canceled_by_id integer,
retried boolean,
- stage_id integer,
+ stage_id_convert_to_bigint integer,
protected boolean,
failure_reason integer,
scheduled_at timestamp with time zone,
@@ -10899,7 +12056,7 @@ CREATE TABLE ci_builds (
waiting_for_resource_at timestamp with time zone,
scheduling_type smallint,
id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- stage_id_convert_to_bigint bigint
+ stage_id bigint
);
CREATE SEQUENCE ci_builds_id_seq
@@ -10913,8 +12070,8 @@ CREATE SEQUENCE ci_builds_id_seq
ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id;
CREATE TABLE ci_builds_metadata (
- id integer NOT NULL,
- build_id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
+ build_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
timeout integer,
timeout_source integer DEFAULT 1 NOT NULL,
@@ -10925,7 +12082,8 @@ CREATE TABLE ci_builds_metadata (
environment_auto_stop_in character varying(255),
expanded_environment_name character varying(255),
secrets jsonb DEFAULT '{}'::jsonb NOT NULL,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL,
+ id bigint NOT NULL
);
CREATE SEQUENCE ci_builds_metadata_id_seq
@@ -10940,11 +12098,10 @@ ALTER SEQUENCE ci_builds_metadata_id_seq OWNED BY ci_builds_metadata.id;
CREATE TABLE ci_builds_runner_session (
id bigint NOT NULL,
- build_id integer NOT NULL,
url character varying NOT NULL,
certificate character varying,
"authorization" character varying,
- build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ build_id bigint NOT NULL
);
CREATE SEQUENCE ci_builds_runner_session_id_seq
@@ -11067,9 +12224,9 @@ CREATE SEQUENCE ci_instance_variables_id_seq
ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id;
CREATE TABLE ci_job_artifacts (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer NOT NULL,
- job_id integer NOT NULL,
+ job_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_type integer NOT NULL,
size bigint,
created_at timestamp with time zone NOT NULL,
@@ -11080,8 +12237,9 @@ CREATE TABLE ci_job_artifacts (
file_sha256 bytea,
file_format smallint,
file_location smallint,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- job_id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ id bigint NOT NULL,
+ job_id bigint NOT NULL,
+ locked smallint DEFAULT 2,
CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL))
);
@@ -11157,6 +12315,7 @@ CREATE TABLE ci_namespace_monthly_usages (
date date NOT NULL,
additional_amount_available integer DEFAULT 0 NOT NULL,
amount_used numeric(18,2) DEFAULT 0.0 NOT NULL,
+ notification_level smallint DEFAULT 100 NOT NULL,
CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
);
@@ -11173,7 +12332,12 @@ CREATE TABLE ci_pending_builds (
id bigint NOT NULL,
build_id bigint NOT NULL,
project_id bigint NOT NULL,
- created_at timestamp with time zone DEFAULT now() NOT NULL
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ protected boolean DEFAULT false NOT NULL,
+ instance_runners_enabled boolean DEFAULT false NOT NULL,
+ namespace_id bigint,
+ minutes_exceeded boolean DEFAULT false NOT NULL,
+ tag_ids integer[] DEFAULT '{}'::integer[]
);
CREATE SEQUENCE ci_pending_builds_id_seq
@@ -11553,9 +12717,9 @@ CREATE TABLE ci_sources_pipelines (
project_id integer,
pipeline_id integer,
source_project_id integer,
- source_job_id integer,
+ source_job_id_convert_to_bigint integer,
source_pipeline_id integer,
- source_job_id_convert_to_bigint bigint
+ source_job_id bigint
);
CREATE SEQUENCE ci_sources_pipelines_id_seq
@@ -11584,7 +12748,7 @@ CREATE SEQUENCE ci_sources_projects_id_seq
ALTER SEQUENCE ci_sources_projects_id_seq OWNED BY ci_sources_projects.id;
CREATE TABLE ci_stages (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
pipeline_id integer,
created_at timestamp without time zone,
@@ -11592,7 +12756,8 @@ CREATE TABLE ci_stages (
name character varying,
status integer,
lock_version integer DEFAULT 0,
- "position" integer
+ "position" integer,
+ id bigint NOT NULL
);
CREATE SEQUENCE ci_stages_id_seq
@@ -11620,38 +12785,6 @@ CREATE SEQUENCE ci_subscriptions_projects_id_seq
ALTER SEQUENCE ci_subscriptions_projects_id_seq OWNED BY ci_subscriptions_projects.id;
-CREATE TABLE ci_test_case_failures (
- id bigint NOT NULL,
- failed_at timestamp with time zone,
- test_case_id bigint NOT NULL,
- build_id bigint NOT NULL
-);
-
-CREATE SEQUENCE ci_test_case_failures_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_test_case_failures_id_seq OWNED BY ci_test_case_failures.id;
-
-CREATE TABLE ci_test_cases (
- id bigint NOT NULL,
- project_id bigint NOT NULL,
- key_hash text NOT NULL,
- CONSTRAINT check_dd3c5d1c15 CHECK ((char_length(key_hash) <= 64))
-);
-
-CREATE SEQUENCE ci_test_cases_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE ci_test_cases_id_seq OWNED BY ci_test_cases.id;
-
CREATE TABLE ci_trigger_requests (
id integer NOT NULL,
trigger_id integer NOT NULL,
@@ -12015,30 +13148,6 @@ CREATE SEQUENCE clusters_applications_elastic_stacks_id_seq
ALTER SEQUENCE clusters_applications_elastic_stacks_id_seq OWNED BY clusters_applications_elastic_stacks.id;
-CREATE TABLE clusters_applications_fluentd (
- id bigint NOT NULL,
- protocol smallint NOT NULL,
- status integer NOT NULL,
- port integer NOT NULL,
- cluster_id bigint NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- version character varying(255) NOT NULL,
- host character varying(255) NOT NULL,
- status_reason text,
- waf_log_enabled boolean DEFAULT true NOT NULL,
- cilium_log_enabled boolean DEFAULT true NOT NULL
-);
-
-CREATE SEQUENCE clusters_applications_fluentd_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE clusters_applications_fluentd_id_seq OWNED BY clusters_applications_fluentd.id;
-
CREATE TABLE clusters_applications_helm (
id integer NOT NULL,
cluster_id integer NOT NULL,
@@ -12073,9 +13182,7 @@ CREATE TABLE clusters_applications_ingress (
cluster_ip character varying,
status_reason text,
external_ip character varying,
- external_hostname character varying,
- modsecurity_enabled boolean,
- modsecurity_mode smallint DEFAULT 0 NOT NULL
+ external_hostname character varying
);
CREATE SEQUENCE clusters_applications_ingress_id_seq
@@ -12393,6 +13500,84 @@ CREATE SEQUENCE custom_emoji_id_seq
ALTER SEQUENCE custom_emoji_id_seq OWNED BY custom_emoji.id;
+CREATE TABLE customer_relations_contacts (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ organization_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ state smallint DEFAULT 1 NOT NULL,
+ phone text,
+ first_name text NOT NULL,
+ last_name text NOT NULL,
+ email text,
+ description text,
+ CONSTRAINT check_1195f4c929 CHECK ((char_length(first_name) <= 255)),
+ CONSTRAINT check_40c70da037 CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_cd2d67c484 CHECK ((char_length(last_name) <= 255)),
+ CONSTRAINT check_f4b7f78c89 CHECK ((char_length(phone) <= 32)),
+ CONSTRAINT check_fc0adabf60 CHECK ((char_length(email) <= 255))
+);
+
+CREATE SEQUENCE customer_relations_contacts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE customer_relations_contacts_id_seq OWNED BY customer_relations_contacts.id;
+
+CREATE TABLE customer_relations_organizations (
+ id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ state smallint DEFAULT 1 NOT NULL,
+ default_rate numeric(18,2),
+ name text NOT NULL,
+ description text,
+ CONSTRAINT check_2ba9ef1c4c CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_e476b6058e CHECK ((char_length(description) <= 1024))
+);
+
+CREATE SEQUENCE customer_relations_organizations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE customer_relations_organizations_id_seq OWNED BY customer_relations_organizations.id;
+
+CREATE TABLE dast_profile_schedules (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ dast_profile_id bigint NOT NULL,
+ user_id bigint,
+ next_run_at timestamp with time zone NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ cron text NOT NULL,
+ cadence jsonb DEFAULT '{}'::jsonb NOT NULL,
+ timezone text NOT NULL,
+ starts_at timestamp with time zone DEFAULT now() NOT NULL,
+ CONSTRAINT check_86531ea73f CHECK ((char_length(cron) <= 255)),
+ CONSTRAINT check_be4d1c3af1 CHECK ((char_length(timezone) <= 255))
+);
+
+COMMENT ON TABLE dast_profile_schedules IS '{"owner":"group::dynamic analysis","description":"Scheduling for scans using DAST Profiles"}';
+
+CREATE SEQUENCE dast_profile_schedules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dast_profile_schedules_id_seq OWNED BY dast_profile_schedules.id;
+
CREATE TABLE dast_profiles (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -12440,6 +13625,13 @@ CREATE TABLE dast_scanner_profiles (
CONSTRAINT check_568568fabf CHECK ((char_length(name) <= 255))
);
+CREATE TABLE dast_scanner_profiles_builds (
+ dast_scanner_profile_id bigint NOT NULL,
+ ci_build_id bigint NOT NULL
+);
+
+COMMENT ON TABLE dast_scanner_profiles_builds IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Scanner Profiles and CI Builds"}';
+
CREATE SEQUENCE dast_scanner_profiles_id_seq
START WITH 1
INCREMENT BY 1
@@ -12495,6 +13687,13 @@ CREATE TABLE dast_site_profiles (
CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255))
);
+CREATE TABLE dast_site_profiles_builds (
+ dast_site_profile_id bigint NOT NULL,
+ ci_build_id bigint NOT NULL
+);
+
+COMMENT ON TABLE dast_site_profiles_builds IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Site Profiles and CI Builds"}';
+
CREATE SEQUENCE dast_site_profiles_id_seq
START WITH 1
INCREMENT BY 1
@@ -12578,6 +13777,33 @@ CREATE SEQUENCE dast_sites_id_seq
ALTER SEQUENCE dast_sites_id_seq OWNED BY dast_sites.id;
+CREATE TABLE dep_ci_build_trace_section_names (
+ id integer NOT NULL,
+ project_id integer NOT NULL,
+ name character varying NOT NULL
+);
+
+CREATE SEQUENCE dep_ci_build_trace_section_names_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dep_ci_build_trace_section_names_id_seq OWNED BY dep_ci_build_trace_section_names.id;
+
+CREATE TABLE dep_ci_build_trace_sections (
+ project_id integer NOT NULL,
+ date_start timestamp with time zone NOT NULL,
+ date_end timestamp with time zone NOT NULL,
+ byte_start bigint NOT NULL,
+ byte_end bigint NOT NULL,
+ build_id integer NOT NULL,
+ section_name_id integer NOT NULL,
+ build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+);
+
CREATE TABLE dependency_proxy_blobs (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12617,6 +13843,14 @@ CREATE SEQUENCE dependency_proxy_group_settings_id_seq
ALTER SEQUENCE dependency_proxy_group_settings_id_seq OWNED BY dependency_proxy_group_settings.id;
+CREATE TABLE dependency_proxy_image_ttl_group_policies (
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ group_id bigint NOT NULL,
+ ttl integer DEFAULT 90,
+ enabled boolean DEFAULT false NOT NULL
+);
+
CREATE TABLE dependency_proxy_manifests (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -12710,7 +13944,7 @@ CREATE TABLE deployments (
tag boolean NOT NULL,
sha character varying NOT NULL,
user_id integer,
- deployable_id integer,
+ deployable_id_convert_to_bigint integer,
deployable_type character varying,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@@ -12718,7 +13952,7 @@ CREATE TABLE deployments (
finished_at timestamp with time zone,
status smallint NOT NULL,
cluster_id integer,
- deployable_id_convert_to_bigint bigint
+ deployable_id bigint
);
CREATE SEQUENCE deployments_id_seq
@@ -12823,6 +14057,24 @@ CREATE SEQUENCE design_user_mentions_id_seq
ALTER SEQUENCE design_user_mentions_id_seq OWNED BY design_user_mentions.id;
+CREATE TABLE detached_partitions (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ drop_after timestamp with time zone NOT NULL,
+ table_name text NOT NULL,
+ CONSTRAINT check_aecee24ba3 CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE detached_partitions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE detached_partitions_id_seq OWNED BY detached_partitions.id;
+
CREATE TABLE diff_note_positions (
id bigint NOT NULL,
note_id bigint NOT NULL,
@@ -12958,21 +14210,13 @@ CREATE TABLE elastic_reindexing_tasks (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- documents_count integer,
state smallint DEFAULT 0 NOT NULL,
in_progress boolean DEFAULT true NOT NULL,
- index_name_from text,
- index_name_to text,
- elastic_task text,
error_message text,
- documents_count_target integer,
delete_original_index_at timestamp with time zone,
max_slices_running smallint DEFAULT 60 NOT NULL,
slice_multiplier smallint DEFAULT 2 NOT NULL,
- CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)),
- CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)),
- CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)),
- CONSTRAINT check_942e5aae53 CHECK ((char_length(elastic_task) <= 255))
+ CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255))
);
CREATE SEQUENCE elastic_reindexing_tasks_id_seq
@@ -13141,8 +14385,79 @@ CREATE SEQUENCE epics_id_seq
ALTER SEQUENCE epics_id_seq OWNED BY epics.id;
+CREATE TABLE error_tracking_client_keys (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ active boolean DEFAULT true NOT NULL,
+ public_key text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_840b719790 CHECK ((char_length(public_key) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_client_keys_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_client_keys_id_seq OWNED BY error_tracking_client_keys.id;
+
+CREATE TABLE error_tracking_error_events (
+ id bigint NOT NULL,
+ error_id bigint NOT NULL,
+ description text NOT NULL,
+ environment text,
+ level text,
+ occurred_at timestamp with time zone NOT NULL,
+ payload jsonb DEFAULT '{}'::jsonb NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_92ecc3077b CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_c67d5b8007 CHECK ((char_length(level) <= 255)),
+ CONSTRAINT check_f4b52474ad CHECK ((char_length(environment) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_error_events_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_error_events_id_seq OWNED BY error_tracking_error_events.id;
+
+CREATE TABLE error_tracking_errors (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ name text NOT NULL,
+ description text NOT NULL,
+ actor text NOT NULL,
+ first_seen_at timestamp with time zone DEFAULT now() NOT NULL,
+ last_seen_at timestamp with time zone DEFAULT now() NOT NULL,
+ platform text,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ events_count bigint DEFAULT 0 NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ CONSTRAINT check_18a758e537 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_b5cb4d3888 CHECK ((char_length(actor) <= 255)),
+ CONSTRAINT check_c739788b12 CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_fe99886883 CHECK ((char_length(platform) <= 255))
+);
+
+CREATE SEQUENCE error_tracking_errors_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE error_tracking_errors_id_seq OWNED BY error_tracking_errors.id;
+
CREATE TABLE events (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
project_id integer,
author_id integer NOT NULL,
target_id integer,
@@ -13152,7 +14467,7 @@ CREATE TABLE events (
target_type character varying,
group_id bigint,
fingerprint bytea,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
+ id bigint NOT NULL,
CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128))
);
@@ -13301,6 +14616,41 @@ CREATE SEQUENCE external_pull_requests_id_seq
ALTER SEQUENCE external_pull_requests_id_seq OWNED BY external_pull_requests.id;
+CREATE TABLE external_status_checks (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ external_url text NOT NULL,
+ name text NOT NULL,
+ CONSTRAINT check_7e3b9eb41a CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_ae0dec3f61 CHECK ((char_length(external_url) <= 255))
+);
+
+CREATE SEQUENCE external_status_checks_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_status_checks_id_seq OWNED BY external_status_checks.id;
+
+CREATE TABLE external_status_checks_protected_branches (
+ id bigint NOT NULL,
+ external_status_check_id bigint NOT NULL,
+ protected_branch_id bigint NOT NULL
+);
+
+CREATE SEQUENCE external_status_checks_protected_branches_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE external_status_checks_protected_branches_id_seq OWNED BY external_status_checks_protected_branches.id;
+
CREATE TABLE feature_gates (
id integer NOT NULL,
feature_key character varying NOT NULL,
@@ -13484,9 +14834,9 @@ ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_sto
CREATE TABLE geo_job_artifact_deleted_events (
id bigint NOT NULL,
- job_artifact_id integer NOT NULL,
+ job_artifact_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
file_path character varying NOT NULL,
- job_artifact_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ job_artifact_id bigint NOT NULL
);
CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq
@@ -14185,9 +15535,12 @@ ALTER SEQUENCE incident_management_escalation_policies_id_seq OWNED BY incident_
CREATE TABLE incident_management_escalation_rules (
id bigint NOT NULL,
policy_id bigint NOT NULL,
- oncall_schedule_id bigint NOT NULL,
+ oncall_schedule_id bigint,
status smallint NOT NULL,
- elapsed_time_seconds integer NOT NULL
+ elapsed_time_seconds integer NOT NULL,
+ is_removed boolean DEFAULT false NOT NULL,
+ user_id bigint,
+ CONSTRAINT escalation_rules_one_of_oncall_schedule_or_user CHECK ((num_nonnulls(oncall_schedule_id, user_id) = 1))
);
CREATE SEQUENCE incident_management_escalation_rules_id_seq
@@ -14199,6 +15552,26 @@ CREATE SEQUENCE incident_management_escalation_rules_id_seq
ALTER SEQUENCE incident_management_escalation_rules_id_seq OWNED BY incident_management_escalation_rules.id;
+CREATE TABLE incident_management_issuable_escalation_statuses (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ issue_id bigint NOT NULL,
+ policy_id bigint,
+ escalations_started_at timestamp with time zone,
+ resolved_at timestamp with time zone,
+ status smallint DEFAULT 0 NOT NULL
+);
+
+CREATE SEQUENCE incident_management_issuable_escalation_statuses_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE incident_management_issuable_escalation_statuses_id_seq OWNED BY incident_management_issuable_escalation_statuses.id;
+
CREATE TABLE incident_management_oncall_participants (
id bigint NOT NULL,
oncall_rotation_id bigint NOT NULL,
@@ -14319,6 +15692,49 @@ CREATE SEQUENCE insights_id_seq
ALTER SEQUENCE insights_id_seq OWNED BY insights.id;
+CREATE TABLE integrations (
+ id integer NOT NULL,
+ type character varying,
+ project_id integer,
+ created_at timestamp without time zone,
+ updated_at timestamp without time zone,
+ active boolean DEFAULT false NOT NULL,
+ properties text,
+ template boolean DEFAULT false,
+ push_events boolean DEFAULT true,
+ issues_events boolean DEFAULT true,
+ merge_requests_events boolean DEFAULT true,
+ tag_push_events boolean DEFAULT true,
+ note_events boolean DEFAULT true NOT NULL,
+ category character varying DEFAULT 'common'::character varying NOT NULL,
+ wiki_page_events boolean DEFAULT true,
+ pipeline_events boolean DEFAULT false NOT NULL,
+ confidential_issues_events boolean DEFAULT true NOT NULL,
+ commit_events boolean DEFAULT true NOT NULL,
+ job_events boolean DEFAULT false NOT NULL,
+ confidential_note_events boolean DEFAULT true,
+ deployment_events boolean DEFAULT false NOT NULL,
+ comment_on_event_enabled boolean DEFAULT true NOT NULL,
+ instance boolean DEFAULT false NOT NULL,
+ comment_detail smallint,
+ inherit_from_id bigint,
+ alert_events boolean,
+ group_id bigint,
+ vulnerability_events boolean DEFAULT false NOT NULL,
+ type_new text,
+ CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255))
+);
+
+CREATE SEQUENCE integrations_id_seq
+ AS integer
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE integrations_id_seq OWNED BY integrations.id;
+
CREATE TABLE internal_ids (
id bigint NOT NULL,
project_id integer,
@@ -14390,7 +15806,9 @@ ALTER SEQUENCE issuable_severities_id_seq OWNED BY issuable_severities.id;
CREATE TABLE issuable_slas (
id bigint NOT NULL,
issue_id bigint NOT NULL,
- due_at timestamp with time zone NOT NULL
+ due_at timestamp with time zone NOT NULL,
+ label_applied boolean DEFAULT false NOT NULL,
+ issuable_closed boolean DEFAULT false NOT NULL
);
CREATE SEQUENCE issuable_slas_id_seq
@@ -14538,7 +15956,9 @@ CREATE TABLE issues (
sprint_id bigint,
external_key character varying(255),
blocking_issues_count integer DEFAULT 0 NOT NULL,
- issue_type smallint DEFAULT 0 NOT NULL
+ issue_type smallint DEFAULT 0 NOT NULL,
+ upvotes_count integer DEFAULT 0 NOT NULL,
+ work_item_type_id bigint
);
CREATE SEQUENCE issues_id_seq
@@ -14865,7 +16285,8 @@ CREATE TABLE licenses (
data text NOT NULL,
created_at timestamp without time zone,
updated_at timestamp without time zone,
- cloud boolean DEFAULT false
+ cloud boolean DEFAULT false,
+ last_synced_at timestamp with time zone
);
CREATE SEQUENCE licenses_id_seq
@@ -14939,7 +16360,8 @@ CREATE TABLE members (
requested_at timestamp without time zone,
expires_at date,
ldap boolean DEFAULT false NOT NULL,
- override boolean DEFAULT false NOT NULL
+ override boolean DEFAULT false NOT NULL,
+ invite_email_success boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE members_id_seq
@@ -14991,7 +16413,9 @@ CREATE TABLE merge_request_cleanup_schedules (
scheduled_at timestamp with time zone NOT NULL,
completed_at timestamp with time zone,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
+ updated_at timestamp with time zone NOT NULL,
+ status smallint DEFAULT 0 NOT NULL,
+ failed_count integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE merge_request_cleanup_schedules_merge_request_id_seq
@@ -15469,6 +16893,9 @@ CREATE TABLE namespace_settings (
lock_delayed_project_removal boolean DEFAULT false NOT NULL,
resource_access_token_creation_allowed boolean DEFAULT true NOT NULL,
prevent_sharing_groups_outside_hierarchy boolean DEFAULT false NOT NULL,
+ new_user_signups_cap integer,
+ setup_for_company boolean,
+ jobs_to_be_done smallint,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255))
);
@@ -16130,17 +17557,16 @@ CREATE TABLE packages_debian_group_distributions (
label text,
version text,
description text,
- encrypted_signing_keys text,
- encrypted_signing_keys_iv text,
file text,
file_signature text,
+ signed_file text,
+ signed_file_store smallint DEFAULT 1 NOT NULL,
+ CONSTRAINT check_0007e0bf61 CHECK ((char_length(signed_file) <= 255)),
CONSTRAINT check_310ac457b8 CHECK ((char_length(description) <= 255)),
CONSTRAINT check_3d6f87fc31 CHECK ((char_length(file_signature) <= 4096)),
CONSTRAINT check_3fdadf4a0c CHECK ((char_length(version) <= 255)),
CONSTRAINT check_590e18405a CHECK ((char_length(codename) <= 255)),
- CONSTRAINT check_9b90bc0f07 CHECK ((char_length(encrypted_signing_keys_iv) <= 255)),
CONSTRAINT check_b057cd840a CHECK ((char_length(origin) <= 255)),
- CONSTRAINT check_b811ec1218 CHECK ((char_length(encrypted_signing_keys) <= 2048)),
CONSTRAINT check_be5ed8d307 CHECK ((char_length(file) <= 255)),
CONSTRAINT check_d3244bfc0b CHECK ((char_length(label) <= 255)),
CONSTRAINT check_e7c928a24b CHECK ((char_length(suite) <= 255))
@@ -16256,20 +17682,19 @@ CREATE TABLE packages_debian_project_distributions (
label text,
version text,
description text,
- encrypted_signing_keys text,
- encrypted_signing_keys_iv text,
file text,
file_signature text,
+ signed_file text,
+ signed_file_store smallint DEFAULT 1 NOT NULL,
CONSTRAINT check_6177ccd4a6 CHECK ((char_length(origin) <= 255)),
CONSTRAINT check_6f6b55a4c4 CHECK ((char_length(label) <= 255)),
CONSTRAINT check_834dabadb6 CHECK ((char_length(codename) <= 255)),
CONSTRAINT check_96965792c2 CHECK ((char_length(version) <= 255)),
+ CONSTRAINT check_9e5e22b7ff CHECK ((char_length(signed_file) <= 255)),
CONSTRAINT check_a56ae58a17 CHECK ((char_length(suite) <= 255)),
CONSTRAINT check_a5a2ac6af2 CHECK ((char_length(file_signature) <= 4096)),
CONSTRAINT check_b93154339f CHECK ((char_length(description) <= 255)),
- CONSTRAINT check_c25603a25b CHECK ((char_length(encrypted_signing_keys) <= 2048)),
- CONSTRAINT check_cb4ac9599e CHECK ((char_length(file) <= 255)),
- CONSTRAINT check_d488f8cce3 CHECK ((char_length(encrypted_signing_keys_iv) <= 255))
+ CONSTRAINT check_cb4ac9599e CHECK ((char_length(file) <= 255))
);
CREATE SEQUENCE packages_debian_project_distributions_id_seq
@@ -16740,7 +18165,11 @@ CREATE TABLE plan_limits (
ci_registered_group_runners integer DEFAULT 1000 NOT NULL,
ci_registered_project_runners integer DEFAULT 1000 NOT NULL,
web_hook_calls integer DEFAULT 0 NOT NULL,
- ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL
+ ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL,
+ pages_file_entries integer DEFAULT 200000 NOT NULL,
+ ci_max_artifact_size_running_container_scanning integer DEFAULT 0 NOT NULL,
+ ci_max_artifact_size_cluster_image_scanning integer DEFAULT 0 NOT NULL,
+ ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL
);
CREATE SEQUENCE plan_limits_id_seq
@@ -16787,6 +18216,39 @@ CREATE SEQUENCE pool_repositories_id_seq
ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id;
+CREATE TABLE postgres_async_indexes (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ definition text NOT NULL,
+ table_name text NOT NULL,
+ CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
+ CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
+ CONSTRAINT check_e64ff4359e CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE postgres_async_indexes_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE postgres_async_indexes_id_seq OWNED BY postgres_async_indexes.id;
+
+CREATE VIEW postgres_foreign_keys AS
+ SELECT pg_constraint.oid,
+ pg_constraint.conname AS name,
+ (((constrained_namespace.nspname)::text || '.'::text) || (constrained_table.relname)::text) AS constrained_table_identifier,
+ (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier
+ FROM ((((pg_constraint
+ JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid)))
+ JOIN pg_class referenced_table ON ((referenced_table.oid = pg_constraint.confrelid)))
+ JOIN pg_namespace constrained_namespace ON ((constrained_table.relnamespace = constrained_namespace.oid)))
+ JOIN pg_namespace referenced_namespace ON ((referenced_table.relnamespace = referenced_namespace.oid)))
+ WHERE (pg_constraint.contype = 'f'::"char");
+
CREATE VIEW postgres_index_bloat_estimates AS
SELECT (((relation_stats.nspname)::text || '.'::text) || (relation_stats.idxname)::text) AS identifier,
(
@@ -16900,23 +18362,25 @@ END AS attrelname
ORDER BY relation_stats.nspname, relation_stats.tblname, relation_stats.idxname;
CREATE VIEW postgres_indexes AS
- SELECT (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS identifier,
+ SELECT (((pg_namespace.nspname)::text || '.'::text) || (i.relname)::text) AS identifier,
pg_index.indexrelid,
pg_namespace.nspname AS schema,
- pg_class.relname AS name,
+ i.relname AS name,
pg_indexes.tablename,
+ a.amname AS type,
pg_index.indisunique AS "unique",
pg_index.indisvalid AS valid_index,
- pg_class.relispartition AS partitioned,
+ i.relispartition AS partitioned,
pg_index.indisexclusion AS exclusion,
(pg_index.indexprs IS NOT NULL) AS expression,
(pg_index.indpred IS NOT NULL) AS partial,
pg_indexes.indexdef AS definition,
- pg_relation_size((pg_class.oid)::regclass) AS ondisk_size_bytes
- FROM (((pg_index
- JOIN pg_class ON ((pg_class.oid = pg_index.indexrelid)))
- JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)))
- JOIN pg_indexes ON ((pg_class.relname = pg_indexes.indexname)))
+ pg_relation_size((i.oid)::regclass) AS ondisk_size_bytes
+ FROM ((((pg_index
+ JOIN pg_class i ON ((i.oid = pg_index.indexrelid)))
+ JOIN pg_namespace ON ((i.relnamespace = pg_namespace.oid)))
+ JOIN pg_indexes ON ((i.relname = pg_indexes.indexname)))
+ JOIN pg_am a ON ((i.relam = a.oid)))
WHERE ((pg_namespace.nspname <> 'pg_catalog'::name) AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));
CREATE VIEW postgres_partitioned_tables AS
@@ -17062,7 +18526,8 @@ CREATE TABLE project_ci_cd_settings (
merge_trains_enabled boolean DEFAULT false,
auto_rollback_enabled boolean DEFAULT false NOT NULL,
keep_latest_artifact boolean DEFAULT true NOT NULL,
- restrict_user_defined_variables boolean DEFAULT false NOT NULL
+ restrict_user_defined_variables boolean DEFAULT false NOT NULL,
+ job_token_scope_enabled boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -17075,9 +18540,24 @@ CREATE SEQUENCE project_ci_cd_settings_id_seq
ALTER SEQUENCE project_ci_cd_settings_id_seq OWNED BY project_ci_cd_settings.id;
+CREATE TABLE project_ci_feature_usages (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ feature smallint NOT NULL,
+ default_branch boolean DEFAULT false NOT NULL
+);
+
+CREATE SEQUENCE project_ci_feature_usages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_ci_feature_usages_id_seq OWNED BY project_ci_feature_usages.id;
+
CREATE TABLE project_compliance_framework_settings (
project_id bigint NOT NULL,
- framework smallint,
framework_id bigint,
CONSTRAINT check_d348de9e2d CHECK ((framework_id IS NOT NULL))
);
@@ -17150,7 +18630,8 @@ CREATE TABLE project_error_tracking_settings (
encrypted_token character varying,
encrypted_token_iv character varying,
project_name character varying,
- organization_name character varying
+ organization_name character varying,
+ integrated boolean DEFAULT false NOT NULL
);
CREATE TABLE project_export_jobs (
@@ -17393,7 +18874,9 @@ CREATE TABLE project_settings (
cve_id_request_enabled boolean DEFAULT true NOT NULL,
has_vulnerabilities boolean DEFAULT false NOT NULL,
prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL,
- mr_default_target_self boolean DEFAULT false NOT NULL
+ mr_default_target_self boolean DEFAULT false NOT NULL,
+ previous_default_branch text,
+ CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096))
);
CREATE TABLE project_statistics (
@@ -17424,6 +18907,23 @@ CREATE SEQUENCE project_statistics_id_seq
ALTER SEQUENCE project_statistics_id_seq OWNED BY project_statistics.id;
+CREATE TABLE project_topics (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ topic_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE project_topics_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_topics_id_seq OWNED BY project_topics.id;
+
CREATE TABLE project_tracing_settings (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -17523,7 +19023,8 @@ CREATE TABLE projects (
marked_for_deletion_by_user_id integer,
remove_source_branch_after_merge boolean,
suggestion_commit_message character varying(255),
- autoclose_referenced_issues boolean
+ autoclose_referenced_issues boolean,
+ project_namespace_id bigint
);
CREATE SEQUENCE projects_id_seq
@@ -17764,7 +19265,7 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id;
CREATE TABLE push_event_payloads (
commit_count bigint NOT NULL,
- event_id integer NOT NULL,
+ event_id_convert_to_bigint integer DEFAULT 0 NOT NULL,
action smallint NOT NULL,
ref_type smallint NOT NULL,
commit_from bytea,
@@ -17772,7 +19273,7 @@ CREATE TABLE push_event_payloads (
ref text,
commit_title character varying(70),
ref_count integer,
- event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
+ event_id bigint NOT NULL
);
CREATE TABLE push_rules (
@@ -17956,6 +19457,7 @@ CREATE TABLE requirements (
title_html text,
description text,
description_html text,
+ issue_id bigint,
CONSTRAINT check_785ae25b9d CHECK ((char_length(description) <= 10000))
);
@@ -17971,10 +19473,12 @@ ALTER SEQUENCE requirements_id_seq OWNED BY requirements.id;
CREATE TABLE requirements_management_test_reports (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
- requirement_id bigint NOT NULL,
+ requirement_id bigint,
author_id bigint,
state smallint NOT NULL,
- build_id bigint
+ build_id bigint,
+ issue_id bigint,
+ CONSTRAINT requirements_test_reports_requirement_id_xor_issue_id CHECK ((num_nonnulls(requirement_id, issue_id) = 1))
);
CREATE SEQUENCE requirements_management_test_reports_id_seq
@@ -18212,10 +19716,11 @@ CREATE TABLE security_findings (
scanner_id bigint NOT NULL,
severity smallint NOT NULL,
confidence smallint NOT NULL,
- project_fingerprint text NOT NULL,
+ project_fingerprint text,
deduplicated boolean DEFAULT false NOT NULL,
"position" integer,
uuid uuid,
+ overridden_uuid uuid,
CONSTRAINT check_b9508c6df8 CHECK ((char_length(project_fingerprint) <= 40))
);
@@ -18257,6 +19762,7 @@ CREATE TABLE security_orchestration_policy_rule_schedules (
user_id bigint NOT NULL,
policy_index integer NOT NULL,
cron text NOT NULL,
+ rule_index integer DEFAULT 0 NOT NULL,
CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255))
);
@@ -18277,7 +19783,9 @@ CREATE TABLE security_scans (
updated_at timestamp with time zone NOT NULL,
build_id bigint NOT NULL,
scan_type smallint NOT NULL,
- info jsonb DEFAULT '{}'::jsonb NOT NULL
+ info jsonb DEFAULT '{}'::jsonb NOT NULL,
+ project_id bigint,
+ pipeline_id bigint
);
CREATE SEQUENCE security_scans_id_seq
@@ -18365,49 +19873,10 @@ CREATE TABLE service_desk_settings (
project_id bigint NOT NULL,
issue_template_key character varying(255),
outgoing_name character varying(255),
- project_key character varying(255)
+ project_key character varying(255),
+ file_template_project_id bigint
);
-CREATE TABLE services (
- id integer NOT NULL,
- type character varying,
- project_id integer,
- created_at timestamp without time zone,
- updated_at timestamp without time zone,
- active boolean DEFAULT false NOT NULL,
- properties text,
- template boolean DEFAULT false,
- push_events boolean DEFAULT true,
- issues_events boolean DEFAULT true,
- merge_requests_events boolean DEFAULT true,
- tag_push_events boolean DEFAULT true,
- note_events boolean DEFAULT true NOT NULL,
- category character varying DEFAULT 'common'::character varying NOT NULL,
- wiki_page_events boolean DEFAULT true,
- pipeline_events boolean DEFAULT false NOT NULL,
- confidential_issues_events boolean DEFAULT true NOT NULL,
- commit_events boolean DEFAULT true NOT NULL,
- job_events boolean DEFAULT false NOT NULL,
- confidential_note_events boolean DEFAULT true,
- deployment_events boolean DEFAULT false NOT NULL,
- comment_on_event_enabled boolean DEFAULT true NOT NULL,
- instance boolean DEFAULT false NOT NULL,
- comment_detail smallint,
- inherit_from_id bigint,
- alert_events boolean,
- group_id bigint
-);
-
-CREATE SEQUENCE services_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
-
-ALTER SEQUENCE services_id_seq OWNED BY services.id;
-
CREATE TABLE shards (
id integer NOT NULL,
name character varying NOT NULL
@@ -18645,8 +20114,9 @@ ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id;
CREATE TABLE status_check_responses (
id bigint NOT NULL,
merge_request_id bigint NOT NULL,
- external_approval_rule_id bigint NOT NULL,
- sha bytea NOT NULL
+ external_approval_rule_id bigint,
+ sha bytea NOT NULL,
+ external_status_check_id bigint NOT NULL
);
CREATE SEQUENCE status_check_responses_id_seq
@@ -18761,16 +20231,16 @@ CREATE SEQUENCE system_note_metadata_id_seq
ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id;
CREATE TABLE taggings (
- id integer NOT NULL,
+ id_convert_to_bigint integer DEFAULT 0 NOT NULL,
tag_id integer,
- taggable_id integer,
+ taggable_id_convert_to_bigint integer,
taggable_type character varying,
tagger_id integer,
tagger_type character varying,
context character varying,
created_at timestamp without time zone,
- id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
- taggable_id_convert_to_bigint bigint
+ id bigint NOT NULL,
+ taggable_id bigint
);
CREATE SEQUENCE taggings_id_seq
@@ -18882,7 +20352,9 @@ CREATE TABLE timelogs (
merge_request_id integer,
spent_at timestamp with time zone,
note_id integer,
- project_id integer
+ project_id integer,
+ summary text,
+ CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255))
);
CREATE SEQUENCE timelogs_id_seq
@@ -18938,6 +20410,23 @@ CREATE SEQUENCE token_with_ivs_id_seq
ALTER SEQUENCE token_with_ivs_id_seq OWNED BY token_with_ivs.id;
+CREATE TABLE topics (
+ id bigint NOT NULL,
+ name text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE topics_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE topics_id_seq OWNED BY topics.id;
+
CREATE TABLE trending_projects (
id integer NOT NULL,
project_id integer NOT NULL
@@ -19106,8 +20595,12 @@ CREATE TABLE user_details (
cached_markdown_version integer,
provisioned_by_group_id bigint,
other_role text,
+ pronouns text,
+ pronunciation text,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
- CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100))
+ CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100)),
+ CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)),
+ CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255))
);
CREATE SEQUENCE user_details_user_id_seq
@@ -19124,6 +20617,23 @@ CREATE TABLE user_follow_users (
followee_id integer NOT NULL
);
+CREATE TABLE user_group_callouts (
+ id bigint NOT NULL,
+ user_id bigint NOT NULL,
+ group_id bigint NOT NULL,
+ feature_name smallint NOT NULL,
+ dismissed_at timestamp with time zone
+);
+
+CREATE SEQUENCE user_group_callouts_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE user_group_callouts_id_seq OWNED BY user_group_callouts.id;
+
CREATE TABLE user_highest_roles (
updated_at timestamp with time zone NOT NULL,
user_id bigint NOT NULL,
@@ -19423,7 +20933,9 @@ CREATE TABLE vulnerabilities (
confirmed_at timestamp with time zone,
dismissed_at timestamp with time zone,
dismissed_by_id bigint,
- resolved_on_default_branch boolean DEFAULT false NOT NULL
+ resolved_on_default_branch boolean DEFAULT false NOT NULL,
+ present_on_default_branch boolean DEFAULT true NOT NULL,
+ detected_at timestamp with time zone DEFAULT now()
);
CREATE SEQUENCE vulnerabilities_id_seq
@@ -19511,6 +21023,28 @@ CREATE SEQUENCE vulnerability_feedback_id_seq
ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id;
+CREATE TABLE vulnerability_finding_evidence_assets (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ type text,
+ name text,
+ url text,
+ CONSTRAINT check_5adf5d69de CHECK ((char_length(type) <= 2048)),
+ CONSTRAINT check_839f29d7ca CHECK ((char_length(name) <= 2048)),
+ CONSTRAINT check_9272d912c0 CHECK ((char_length(url) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_assets_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_assets_id_seq OWNED BY vulnerability_finding_evidence_assets.id;
+
CREATE TABLE vulnerability_finding_evidence_headers (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19536,10 +21070,11 @@ CREATE TABLE vulnerability_finding_evidence_requests (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
+ vulnerability_finding_evidence_id bigint,
method text,
url text,
body text,
+ vulnerability_finding_evidence_supporting_message_id bigint,
CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)),
CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)),
CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32))
@@ -19558,10 +21093,11 @@ CREATE TABLE vulnerability_finding_evidence_responses (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- vulnerability_finding_evidence_id bigint NOT NULL,
+ vulnerability_finding_evidence_id bigint,
status_code integer,
reason_phrase text,
body text,
+ vulnerability_finding_evidence_supporting_message_id bigint,
CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)),
CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048))
);
@@ -19575,6 +21111,44 @@ CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq
ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id;
+CREATE TABLE vulnerability_finding_evidence_sources (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ name text,
+ url text,
+ CONSTRAINT check_0fe01298d6 CHECK ((char_length(url) <= 2048)),
+ CONSTRAINT check_86b537ba1a CHECK ((char_length(name) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_sources_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_sources_id_seq OWNED BY vulnerability_finding_evidence_sources.id;
+
+CREATE TABLE vulnerability_finding_evidence_supporting_messages (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_finding_evidence_id bigint NOT NULL,
+ name text,
+ CONSTRAINT check_fa33b9ae85 CHECK ((char_length(name) <= 2048))
+);
+
+CREATE SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq OWNED BY vulnerability_finding_evidence_supporting_messages.id;
+
CREATE TABLE vulnerability_finding_evidences (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19648,6 +21222,27 @@ CREATE SEQUENCE vulnerability_findings_remediations_id_seq
ALTER SEQUENCE vulnerability_findings_remediations_id_seq OWNED BY vulnerability_findings_remediations.id;
+CREATE TABLE vulnerability_flags (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ vulnerability_occurrence_id bigint NOT NULL,
+ flag_type smallint DEFAULT 0 NOT NULL,
+ origin text NOT NULL,
+ description text NOT NULL,
+ CONSTRAINT check_45e743349f CHECK ((char_length(description) <= 1024)),
+ CONSTRAINT check_49c1d00032 CHECK ((char_length(origin) <= 255))
+);
+
+CREATE SEQUENCE vulnerability_flags_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE vulnerability_flags_id_seq OWNED BY vulnerability_flags.id;
+
CREATE TABLE vulnerability_historical_statistics (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19769,6 +21364,7 @@ CREATE TABLE vulnerability_occurrences (
solution text,
cve text,
location jsonb,
+ detection_method smallint DEFAULT 0 NOT NULL,
CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)),
CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)),
CONSTRAINT check_df6dd20219 CHECK ((char_length(message) <= 3000)),
@@ -19870,22 +21466,6 @@ CREATE SEQUENCE vulnerability_user_mentions_id_seq
ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id;
-CREATE TABLE web_hook_logs_archived (
- id integer NOT NULL,
- web_hook_id integer NOT NULL,
- trigger character varying,
- url character varying,
- request_headers text,
- request_data text,
- response_headers text,
- response_body text,
- response_status character varying,
- execution_duration double precision,
- internal_error_message character varying,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
-);
-
CREATE TABLE web_hooks (
id integer NOT NULL,
project_id integer,
@@ -19991,6 +21571,30 @@ CREATE SEQUENCE wiki_page_slugs_id_seq
ALTER SEQUENCE wiki_page_slugs_id_seq OWNED BY wiki_page_slugs.id;
+CREATE TABLE work_item_types (
+ id bigint NOT NULL,
+ base_type smallint DEFAULT 0 NOT NULL,
+ cached_markdown_version integer,
+ name text NOT NULL,
+ description text,
+ description_html text,
+ icon_name text,
+ namespace_id bigint,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_104d2410f6 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_fecb3a98d1 CHECK ((char_length(icon_name) <= 255))
+);
+
+CREATE SEQUENCE work_item_types_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE work_item_types_id_seq OWNED BY work_item_types.id;
+
CREATE TABLE x509_certificates (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -20049,6 +21653,30 @@ CREATE SEQUENCE x509_issuers_id_seq
ALTER SEQUENCE x509_issuers_id_seq OWNED BY x509_issuers.id;
+CREATE TABLE zentao_tracker_data (
+ id bigint NOT NULL,
+ integration_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ encrypted_url bytea,
+ encrypted_url_iv bytea,
+ encrypted_api_url bytea,
+ encrypted_api_url_iv bytea,
+ encrypted_zentao_product_xid bytea,
+ encrypted_zentao_product_xid_iv bytea,
+ encrypted_api_token bytea,
+ encrypted_api_token_iv bytea
+);
+
+CREATE SEQUENCE zentao_tracker_data_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE zentao_tracker_data_id_seq OWNED BY zentao_tracker_data.id;
+
CREATE TABLE zoom_meetings (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -20070,6 +21698,8 @@ ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id;
ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass);
+ALTER TABLE ONLY agent_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_group_authorizations_id_seq'::regclass);
+
ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass);
ALTER TABLE ONLY alert_management_alert_user_mentions ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_user_mentions_id_seq'::regclass);
@@ -20088,6 +21718,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER COLUMN id SET DE
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_value_streams_id_seq'::regclass);
+ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_stage_event_hashes_id_seq'::regclass);
+
ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass);
ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass);
@@ -20126,6 +21758,8 @@ ALTER TABLE ONLY atlassian_identities ALTER COLUMN user_id SET DEFAULT nextval('
ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_id_seq'::regclass);
+ALTER TABLE ONLY audit_events_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_external_audit_event_destinations_id_seq'::regclass);
+
ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass);
ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass);
@@ -20192,8 +21826,6 @@ ALTER TABLE ONLY ci_build_report_results ALTER COLUMN build_id SET DEFAULT nextv
ALTER TABLE ONLY ci_build_trace_chunks ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_chunks_id_seq'::regclass);
-ALTER TABLE ONLY ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_section_names_id_seq'::regclass);
-
ALTER TABLE ONLY ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass);
ALTER TABLE ONLY ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass);
@@ -20264,10 +21896,6 @@ ALTER TABLE ONLY ci_stages ALTER COLUMN id SET DEFAULT nextval('ci_stages_id_seq
ALTER TABLE ONLY ci_subscriptions_projects ALTER COLUMN id SET DEFAULT nextval('ci_subscriptions_projects_id_seq'::regclass);
-ALTER TABLE ONLY ci_test_case_failures ALTER COLUMN id SET DEFAULT nextval('ci_test_case_failures_id_seq'::regclass);
-
-ALTER TABLE ONLY ci_test_cases ALTER COLUMN id SET DEFAULT nextval('ci_test_cases_id_seq'::regclass);
-
ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_trigger_requests_id_seq'::regclass);
ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass);
@@ -20302,8 +21930,6 @@ ALTER TABLE ONLY clusters_applications_crossplane ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY clusters_applications_elastic_stacks ALTER COLUMN id SET DEFAULT nextval('clusters_applications_elastic_stacks_id_seq'::regclass);
-ALTER TABLE ONLY clusters_applications_fluentd ALTER COLUMN id SET DEFAULT nextval('clusters_applications_fluentd_id_seq'::regclass);
-
ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass);
ALTER TABLE ONLY clusters_applications_ingress ALTER COLUMN id SET DEFAULT nextval('clusters_applications_ingress_id_seq'::regclass);
@@ -20330,6 +21956,12 @@ ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issu
ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass);
+ALTER TABLE ONLY customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('customer_relations_contacts_id_seq'::regclass);
+
+ALTER TABLE ONLY customer_relations_organizations ALTER COLUMN id SET DEFAULT nextval('customer_relations_organizations_id_seq'::regclass);
+
+ALTER TABLE ONLY dast_profile_schedules ALTER COLUMN id SET DEFAULT nextval('dast_profile_schedules_id_seq'::regclass);
+
ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profiles_id_seq'::regclass);
ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass);
@@ -20344,6 +21976,8 @@ ALTER TABLE ONLY dast_site_validations ALTER COLUMN id SET DEFAULT nextval('dast
ALTER TABLE ONLY dast_sites ALTER COLUMN id SET DEFAULT nextval('dast_sites_id_seq'::regclass);
+ALTER TABLE ONLY dep_ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('dep_ci_build_trace_section_names_id_seq'::regclass);
+
ALTER TABLE ONLY dependency_proxy_blobs ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_blobs_id_seq'::regclass);
ALTER TABLE ONLY dependency_proxy_group_settings ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_group_settings_id_seq'::regclass);
@@ -20366,6 +22000,8 @@ ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval(
ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass);
+ALTER TABLE ONLY detached_partitions ALTER COLUMN id SET DEFAULT nextval('detached_partitions_id_seq'::regclass);
+
ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_note_positions_id_seq'::regclass);
ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass);
@@ -20392,6 +22028,12 @@ ALTER TABLE ONLY epic_user_mentions ALTER COLUMN id SET DEFAULT nextval('epic_us
ALTER TABLE ONLY epics ALTER COLUMN id SET DEFAULT nextval('epics_id_seq'::regclass);
+ALTER TABLE ONLY error_tracking_client_keys ALTER COLUMN id SET DEFAULT nextval('error_tracking_client_keys_id_seq'::regclass);
+
+ALTER TABLE ONLY error_tracking_error_events ALTER COLUMN id SET DEFAULT nextval('error_tracking_error_events_id_seq'::regclass);
+
+ALTER TABLE ONLY error_tracking_errors ALTER COLUMN id SET DEFAULT nextval('error_tracking_errors_id_seq'::regclass);
+
ALTER TABLE ONLY events ALTER COLUMN id SET DEFAULT nextval('events_id_seq'::regclass);
ALTER TABLE ONLY evidences ALTER COLUMN id SET DEFAULT nextval('evidences_id_seq'::regclass);
@@ -20408,6 +22050,10 @@ ALTER TABLE ONLY external_approval_rules_protected_branches ALTER COLUMN id SET
ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass);
+ALTER TABLE ONLY external_status_checks ALTER COLUMN id SET DEFAULT nextval('external_status_checks_id_seq'::regclass);
+
+ALTER TABLE ONLY external_status_checks_protected_branches ALTER COLUMN id SET DEFAULT nextval('external_status_checks_protected_branches_id_seq'::regclass);
+
ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass);
ALTER TABLE ONLY features ALTER COLUMN id SET DEFAULT nextval('features_id_seq'::regclass);
@@ -20492,6 +22138,8 @@ ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEF
ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses ALTER COLUMN id SET DEFAULT nextval('incident_management_issuable_escalation_statuses_id_seq'::regclass);
+
ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass);
ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass);
@@ -20500,10 +22148,16 @@ ALTER TABLE ONLY incident_management_oncall_schedules ALTER COLUMN id SET DEFAUL
ALTER TABLE ONLY incident_management_oncall_shifts ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_shifts_id_seq'::regclass);
+ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass);
+
+ALTER TABLE ONLY incident_management_pending_issue_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass);
+
ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass);
ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass);
+ALTER TABLE ONLY integrations ALTER COLUMN id SET DEFAULT nextval('integrations_id_seq'::regclass);
+
ALTER TABLE ONLY internal_ids ALTER COLUMN id SET DEFAULT nextval('internal_ids_id_seq'::regclass);
ALTER TABLE ONLY ip_restrictions ALTER COLUMN id SET DEFAULT nextval('ip_restrictions_id_seq'::regclass);
@@ -20700,6 +22354,8 @@ ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regcl
ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass);
+ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('postgres_async_indexes_id_seq'::regclass);
+
ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);
ALTER TABLE ONLY product_analytics_events_experimental ALTER COLUMN id SET DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass);
@@ -20712,6 +22368,8 @@ ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('projec
ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass);
+ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('project_ci_feature_usages_id_seq'::regclass);
+
ALTER TABLE ONLY project_compliance_framework_settings ALTER COLUMN project_id SET DEFAULT nextval('project_compliance_framework_settings_project_id_seq'::regclass);
ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('project_custom_attributes_id_seq'::regclass);
@@ -20740,6 +22398,8 @@ ALTER TABLE ONLY project_security_settings ALTER COLUMN project_id SET DEFAULT n
ALTER TABLE ONLY project_statistics ALTER COLUMN id SET DEFAULT nextval('project_statistics_id_seq'::regclass);
+ALTER TABLE ONLY project_topics ALTER COLUMN id SET DEFAULT nextval('project_topics_id_seq'::regclass);
+
ALTER TABLE ONLY project_tracing_settings ALTER COLUMN id SET DEFAULT nextval('project_tracing_settings_id_seq'::regclass);
ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass);
@@ -20820,8 +22480,6 @@ ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_no
ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass);
-ALTER TABLE ONLY services ALTER COLUMN id SET DEFAULT nextval('services_id_seq'::regclass);
-
ALTER TABLE ONLY shards ALTER COLUMN id SET DEFAULT nextval('shards_id_seq'::regclass);
ALTER TABLE ONLY slack_integrations ALTER COLUMN id SET DEFAULT nextval('slack_integrations_id_seq'::regclass);
@@ -20870,6 +22528,8 @@ ALTER TABLE ONLY todos ALTER COLUMN id SET DEFAULT nextval('todos_id_seq'::regcl
ALTER TABLE ONLY token_with_ivs ALTER COLUMN id SET DEFAULT nextval('token_with_ivs_id_seq'::regclass);
+ALTER TABLE ONLY topics ALTER COLUMN id SET DEFAULT nextval('topics_id_seq'::regclass);
+
ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending_projects_id_seq'::regclass);
ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass);
@@ -20888,6 +22548,8 @@ ALTER TABLE ONLY user_custom_attributes ALTER COLUMN id SET DEFAULT nextval('use
ALTER TABLE ONLY user_details ALTER COLUMN user_id SET DEFAULT nextval('user_details_user_id_seq'::regclass);
+ALTER TABLE ONLY user_group_callouts ALTER COLUMN id SET DEFAULT nextval('user_group_callouts_id_seq'::regclass);
+
ALTER TABLE ONLY user_permission_export_uploads ALTER COLUMN id SET DEFAULT nextval('user_permission_export_uploads_id_seq'::regclass);
ALTER TABLE ONLY user_preferences ALTER COLUMN id SET DEFAULT nextval('user_preferences_id_seq'::regclass);
@@ -20912,12 +22574,18 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT
ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_finding_evidence_assets ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_assets_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_finding_evidence_sources ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_sources_id_seq'::regclass);
+
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_supporting_messages_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass);
@@ -20926,6 +22594,8 @@ ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT ne
ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass);
+ALTER TABLE ONLY vulnerability_flags ALTER COLUMN id SET DEFAULT nextval('vulnerability_flags_id_seq'::regclass);
+
ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass);
ALTER TABLE ONLY vulnerability_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_identifiers_id_seq'::regclass);
@@ -20956,12 +22626,16 @@ ALTER TABLE ONLY wiki_page_meta ALTER COLUMN id SET DEFAULT nextval('wiki_page_m
ALTER TABLE ONLY wiki_page_slugs ALTER COLUMN id SET DEFAULT nextval('wiki_page_slugs_id_seq'::regclass);
+ALTER TABLE ONLY work_item_types ALTER COLUMN id SET DEFAULT nextval('work_item_types_id_seq'::regclass);
+
ALTER TABLE ONLY x509_certificates ALTER COLUMN id SET DEFAULT nextval('x509_certificates_id_seq'::regclass);
ALTER TABLE ONLY x509_commit_signatures ALTER COLUMN id SET DEFAULT nextval('x509_commit_signatures_id_seq'::regclass);
ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_id_seq'::regclass);
+ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass);
+
ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass);
ALTER TABLE ONLY audit_events
@@ -20991,6 +22665,90 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305
ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306
ADD CONSTRAINT audit_events_202306_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202307
+ ADD CONSTRAINT audit_events_202307_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY incident_management_pending_alert_escalations
+ ADD CONSTRAINT incident_management_pending_alert_escalations_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202211_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202212_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202301_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202302_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202303_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202304_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202305_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202306_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307
+ ADD CONSTRAINT incident_management_pending_alert_escalations_202307_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY incident_management_pending_issue_escalations
+ ADD CONSTRAINT incident_management_pending_issue_escalations_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202211_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202212_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202301_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202302_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202303_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202304_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202305_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202306_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307
+ ADD CONSTRAINT incident_management_pending_issue_escalations_202307_pkey PRIMARY KEY (id, process_at);
+
+ALTER TABLE ONLY loose_foreign_keys_deleted_records
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_000000_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_202212_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_202301_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_202302_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_202303_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
+ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304
+ ADD CONSTRAINT loose_foreign_keys_deleted_records_202304_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value);
+
ALTER TABLE ONLY web_hook_logs
ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at);
@@ -21018,6 +22776,207 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305
ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306
ADD CONSTRAINT web_hook_logs_202306_pkey PRIMARY KEY (id, created_at);
+ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202307
+ ADD CONSTRAINT web_hook_logs_202307_pkey PRIMARY KEY (id, created_at);
+
+ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31
+ ADD CONSTRAINT analytics_cycle_analytics_issue_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, issue_id);
+
+ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_00_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_01_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_02_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_03_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_04_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_05_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_06_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_07_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_08_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_09_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_10_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_11_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_12_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_13_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_14_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_15_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_16_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_17_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_18_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_19_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_20_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_21_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_22_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_23_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_24_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_25_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_26_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_27_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_28_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_29_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_30_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
+ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31
+ ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id);
+
ALTER TABLE ONLY product_analytics_events_experimental
ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id);
@@ -21216,6 +23175,9 @@ ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_
ALTER TABLE ONLY abuse_reports
ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY agent_group_authorizations
+ ADD CONSTRAINT agent_group_authorizations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY alert_management_alert_assignees
ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);
@@ -21243,6 +23205,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams
ADD CONSTRAINT analytics_cycle_analytics_project_value_streams_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes
+ ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY analytics_devops_adoption_segments
ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id);
@@ -21303,6 +23268,9 @@ ALTER TABLE ONLY approvers
ALTER TABLE ONLY atlassian_identities
ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id);
+ALTER TABLE ONLY audit_events_external_audit_event_destinations
+ ADD CONSTRAINT audit_events_external_audit_event_destinations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY authentication_events
ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id);
@@ -21318,6 +23286,9 @@ ALTER TABLE ONLY background_migration_jobs
ALTER TABLE ONLY badges
ADD CONSTRAINT badges_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY banned_users
+ ADD CONSTRAINT banned_users_pkey PRIMARY KEY (user_id);
+
ALTER TABLE ONLY batched_background_migration_jobs
ADD CONSTRAINT batched_background_migration_jobs_pkey PRIMARY KEY (id);
@@ -21417,10 +23388,10 @@ ALTER TABLE ONLY ci_build_report_results
ALTER TABLE ONLY ci_build_trace_chunks
ADD CONSTRAINT ci_build_trace_chunks_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY ci_build_trace_section_names
- ADD CONSTRAINT ci_build_trace_section_names_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT ci_build_trace_metadata_pkey PRIMARY KEY (build_id);
-ALTER TABLE ONLY ci_build_trace_sections
+ALTER TABLE ONLY dep_ci_build_trace_sections
ADD CONSTRAINT ci_build_trace_sections_pkey PRIMARY KEY (build_id, section_name_id);
ALTER TABLE ONLY ci_builds_metadata
@@ -21528,12 +23499,6 @@ ALTER TABLE ONLY ci_stages
ALTER TABLE ONLY ci_subscriptions_projects
ADD CONSTRAINT ci_subscriptions_projects_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY ci_test_case_failures
- ADD CONSTRAINT ci_test_case_failures_pkey PRIMARY KEY (id);
-
-ALTER TABLE ONLY ci_test_cases
- ADD CONSTRAINT ci_test_cases_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY ci_trigger_requests
ADD CONSTRAINT ci_trigger_requests_pkey PRIMARY KEY (id);
@@ -21582,9 +23547,6 @@ ALTER TABLE ONLY clusters_applications_crossplane
ALTER TABLE ONLY clusters_applications_elastic_stacks
ADD CONSTRAINT clusters_applications_elastic_stacks_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY clusters_applications_fluentd
- ADD CONSTRAINT clusters_applications_fluentd_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY clusters_applications_helm
ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id);
@@ -21636,18 +23598,33 @@ ALTER TABLE ONLY csv_issue_imports
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY customer_relations_contacts
+ ADD CONSTRAINT customer_relations_contacts_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY customer_relations_organizations
+ ADD CONSTRAINT customer_relations_organizations_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT dast_profile_schedules_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY dast_profiles_pipelines
ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id);
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT dast_scanner_profiles_builds_pkey PRIMARY KEY (dast_scanner_profile_id, ci_build_id);
+
ALTER TABLE ONLY dast_scanner_profiles
ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id);
ALTER TABLE ONLY dast_site_profile_secret_variables
ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT dast_site_profiles_builds_pkey PRIMARY KEY (dast_site_profile_id, ci_build_id);
+
ALTER TABLE ONLY dast_site_profiles_pipelines
ADD CONSTRAINT dast_site_profiles_pipelines_pkey PRIMARY KEY (dast_site_profile_id, ci_pipeline_id);
@@ -21663,12 +23640,18 @@ ALTER TABLE ONLY dast_site_validations
ALTER TABLE ONLY dast_sites
ADD CONSTRAINT dast_sites_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dep_ci_build_trace_section_names
+ ADD CONSTRAINT dep_ci_build_trace_section_names_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY dependency_proxy_blobs
ADD CONSTRAINT dependency_proxy_blobs_pkey PRIMARY KEY (id);
ALTER TABLE ONLY dependency_proxy_group_settings
ADD CONSTRAINT dependency_proxy_group_settings_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies
+ ADD CONSTRAINT dependency_proxy_image_ttl_group_policies_pkey PRIMARY KEY (group_id);
+
ALTER TABLE ONLY dependency_proxy_manifests
ADD CONSTRAINT dependency_proxy_manifests_pkey PRIMARY KEY (id);
@@ -21702,6 +23685,9 @@ ALTER TABLE ONLY design_management_versions
ALTER TABLE ONLY design_user_mentions
ADD CONSTRAINT design_user_mentions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY detached_partitions
+ ADD CONSTRAINT detached_partitions_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id);
@@ -21747,6 +23733,15 @@ ALTER TABLE ONLY epic_user_mentions
ALTER TABLE ONLY epics
ADD CONSTRAINT epics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY error_tracking_client_keys
+ ADD CONSTRAINT error_tracking_client_keys_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY error_tracking_error_events
+ ADD CONSTRAINT error_tracking_error_events_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY error_tracking_errors
+ ADD CONSTRAINT error_tracking_errors_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY events
ADD CONSTRAINT events_pkey PRIMARY KEY (id);
@@ -21771,6 +23766,12 @@ ALTER TABLE ONLY external_approval_rules_protected_branches
ALTER TABLE ONLY external_pull_requests
ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY external_status_checks
+ ADD CONSTRAINT external_status_checks_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT external_status_checks_protected_branches_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY feature_gates
ADD CONSTRAINT feature_gates_pkey PRIMARY KEY (id);
@@ -21909,6 +23910,9 @@ ALTER TABLE ONLY incident_management_escalation_policies
ALTER TABLE ONLY incident_management_escalation_rules
ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT incident_management_issuable_escalation_statuses_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY incident_management_oncall_participants
ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id);
@@ -21927,6 +23931,9 @@ ALTER TABLE ONLY index_statuses
ALTER TABLE ONLY insights
ADD CONSTRAINT insights_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY integrations
+ ADD CONSTRAINT integrations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY internal_ids
ADD CONSTRAINT internal_ids_pkey PRIMARY KEY (id);
@@ -22278,6 +24285,9 @@ ALTER TABLE ONLY plans
ALTER TABLE ONLY pool_repositories
ADD CONSTRAINT pool_repositories_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY postgres_async_indexes
+ ADD CONSTRAINT postgres_async_indexes_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY postgres_reindex_actions
ADD CONSTRAINT postgres_reindex_actions_pkey PRIMARY KEY (id);
@@ -22302,6 +24312,9 @@ ALTER TABLE ONLY project_auto_devops
ALTER TABLE ONLY project_ci_cd_settings
ADD CONSTRAINT project_ci_cd_settings_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_ci_feature_usages
+ ADD CONSTRAINT project_ci_feature_usages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT project_compliance_framework_settings_pkey PRIMARY KEY (project_id);
@@ -22362,6 +24375,9 @@ ALTER TABLE ONLY project_settings
ALTER TABLE ONLY project_statistics
ADD CONSTRAINT project_statistics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT project_topics_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_tracing_settings
ADD CONSTRAINT project_tracing_settings_pkey PRIMARY KEY (id);
@@ -22494,9 +24510,6 @@ ALTER TABLE ONLY serverless_domain_cluster
ALTER TABLE ONLY service_desk_settings
ADD CONSTRAINT service_desk_settings_pkey PRIMARY KEY (project_id);
-ALTER TABLE ONLY services
- ADD CONSTRAINT services_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY shards
ADD CONSTRAINT shards_pkey PRIMARY KEY (id);
@@ -22575,6 +24588,9 @@ ALTER TABLE ONLY todos
ALTER TABLE ONLY token_with_ivs
ADD CONSTRAINT token_with_ivs_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY topics
+ ADD CONSTRAINT topics_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY trending_projects
ADD CONSTRAINT trending_projects_pkey PRIMARY KEY (id);
@@ -22608,6 +24624,9 @@ ALTER TABLE ONLY user_details
ALTER TABLE ONLY user_follow_users
ADD CONSTRAINT user_follow_users_pkey PRIMARY KEY (follower_id, followee_id);
+ALTER TABLE ONLY user_group_callouts
+ ADD CONSTRAINT user_group_callouts_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY user_highest_roles
ADD CONSTRAINT user_highest_roles_pkey PRIMARY KEY (user_id);
@@ -22653,6 +24672,9 @@ ALTER TABLE ONLY vulnerability_external_issue_links
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_finding_evidence_assets
+ ADD CONSTRAINT vulnerability_finding_evidence_assets_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_finding_evidence_headers
ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id);
@@ -22662,6 +24684,12 @@ ALTER TABLE ONLY vulnerability_finding_evidence_requests
ALTER TABLE ONLY vulnerability_finding_evidence_responses
ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_finding_evidence_sources
+ ADD CONSTRAINT vulnerability_finding_evidence_sources_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
+ ADD CONSTRAINT vulnerability_finding_evidence_supporting_messages_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id);
@@ -22674,6 +24702,9 @@ ALTER TABLE ONLY vulnerability_finding_signatures
ALTER TABLE ONLY vulnerability_findings_remediations
ADD CONSTRAINT vulnerability_findings_remediations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY vulnerability_flags
+ ADD CONSTRAINT vulnerability_flags_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY vulnerability_historical_statistics
ADD CONSTRAINT vulnerability_historical_statistics_pkey PRIMARY KEY (id);
@@ -22704,9 +24735,6 @@ ALTER TABLE ONLY vulnerability_statistics
ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT vulnerability_user_mentions_pkey PRIMARY KEY (id);
-ALTER TABLE ONLY web_hook_logs_archived
- ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id);
-
ALTER TABLE ONLY web_hooks
ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id);
@@ -22719,6 +24747,9 @@ ALTER TABLE ONLY wiki_page_meta
ALTER TABLE ONLY wiki_page_slugs
ADD CONSTRAINT wiki_page_slugs_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY work_item_types
+ ADD CONSTRAINT work_item_types_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY x509_certificates
ADD CONSTRAINT x509_certificates_pkey PRIMARY KEY (id);
@@ -22728,6 +24759,9 @@ ALTER TABLE ONLY x509_commit_signatures
ALTER TABLE ONLY x509_issuers
ADD CONSTRAINT x509_issuers_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY zentao_tracker_data
+ ADD CONSTRAINT zentao_tracker_data_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY zoom_meetings
ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id);
@@ -22767,6 +24801,110 @@ CREATE INDEX audit_events_202306_created_at_author_id_idx ON gitlab_partitions_d
CREATE INDEX audit_events_202306_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
+CREATE INDEX audit_events_202307_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202307 USING btree (created_at, author_id);
+
+CREATE INDEX audit_events_202307_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202307 USING btree (entity_id, entity_type, id DESC, author_id, created_at);
+
+CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id ON ONLY incident_management_pending_alert_escalations USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_20221_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (rule_id);
+
+CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id ON ONLY incident_management_pending_alert_escalations USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2022_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2022_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_alert_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (alert_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (alert_id);
+
+CREATE INDEX index_incident_management_pending_alert_escalations_on_schedule ON ONLY incident_management_pending_alert_escalations USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations_2_schedule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 USING btree (schedule_id);
+
+CREATE INDEX incident_management_pending_alert_escalations__schedule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 USING btree (schedule_id);
+
+CREATE INDEX index_incident_management_pending_issue_escalations_on_rule_id ON ONLY incident_management_pending_issue_escalations USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_20221_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 USING btree (rule_id);
+
+CREATE INDEX index_incident_management_pending_issue_escalations_on_issue_id ON ONLY incident_management_pending_issue_escalations USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2022_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2022_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_issue_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (rule_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx1 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx2 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx3 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx4 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx5 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 USING btree (issue_id);
+
+CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 USING btree (issue_id);
+
CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id);
CREATE INDEX index_1554dc6f11 ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (web_hook_id);
@@ -22803,6 +24941,10 @@ CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partition
CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id);
+CREATE INDEX web_hook_logs_202307_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202307 USING btree (created_at, web_hook_id);
+
+CREATE INDEX web_hook_logs_202307_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202307 USING btree (web_hook_id);
+
CREATE INDEX index_product_analytics_events_experimental_project_and_time ON ONLY product_analytics_events_experimental USING btree (project_id, collector_tstamp);
CREATE INDEX product_analytics_events_expe_project_id_collector_tstamp_idx10 ON gitlab_partitions_static.product_analytics_events_experimental_10 USING btree (project_id, collector_tstamp);
@@ -22947,30 +25089,46 @@ CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_r
CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation);
+CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING btree (automatic, duration_in_weeks, date((COALESCE(last_run_date, '1970-01-01'::date) + ((duration_in_weeks)::double precision * '7 days'::interval)))) WHERE (duration_in_weeks IS NOT NULL);
+
CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text);
CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true);
-CREATE INDEX commit_id_and_note_id_index ON commit_user_mentions USING btree (commit_id, note_id);
+CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index ON commit_user_mentions USING btree (commit_id, note_id);
CREATE INDEX composer_cache_files_index_on_deleted_at ON packages_composer_cache_files USING btree (delete_at, id);
+CREATE UNIQUE INDEX dast_scanner_profiles_builds_on_ci_build_id ON dast_scanner_profiles_builds USING btree (ci_build_id);
+
+CREATE UNIQUE INDEX dast_site_profiles_builds_on_ci_build_id ON dast_site_profiles_builds USING btree (ci_build_id);
+
CREATE UNIQUE INDEX design_management_designs_versions_uniqueness ON design_management_designs_versions USING btree (design_id, version_id);
-CREATE INDEX design_user_mentions_on_design_id_and_note_id_index ON design_user_mentions USING btree (design_id, note_id);
+CREATE UNIQUE INDEX design_user_mentions_on_design_id_and_note_id_unique_index ON design_user_mentions USING btree (design_id, note_id);
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user_mentions USING btree (epic_id, note_id);
CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL);
+CREATE INDEX finding_evidence_assets_on_finding_evidence_id ON vulnerability_finding_evidence_assets USING btree (vulnerability_finding_evidence_id);
+
CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id);
CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id);
CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id);
+CREATE INDEX finding_evidence_requests_on_supporting_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_supporting_message_id);
+
CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id);
+CREATE INDEX finding_evidence_responses_on_supporting_evidence_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_supporting_message_id);
+
+CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_finding_evidence_sources USING btree (vulnerability_finding_evidence_id);
+
+CREATE INDEX finding_evidence_supporting_messages_on_finding_evidence_id ON vulnerability_finding_evidence_supporting_messages USING btree (vulnerability_finding_evidence_id);
+
CREATE INDEX finding_evidences_on_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id);
CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id);
@@ -22979,6 +25137,8 @@ CREATE UNIQUE INDEX i_ci_job_token_project_scope_links_on_source_and_target_proj
CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id);
+CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time) WHERE (recorded_at >= end_time);
+
CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id);
CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1);
@@ -22987,7 +25147,7 @@ CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_e
CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON container_expiration_policies USING btree (project_id, next_run_at, enabled);
-CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, expiration_policy_started_at);
+CREATE INDEX idx_container_repos_on_exp_cleanup_status_project_id_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, project_id, expiration_policy_started_at);
CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace);
@@ -23005,6 +25165,8 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_me
CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id);
+CREATE INDEX idx_installable_npm_pkgs_on_project_id_name_version_id ON packages_packages USING btree (project_id, name, version, id) WHERE ((package_type = 2) AND (status = 0));
+
CREATE INDEX idx_issues_on_health_status_not_null ON issues USING btree (health_status) WHERE (health_status IS NOT NULL);
CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issues USING btree (project_id, created_at, id, state_id);
@@ -23051,6 +25213,10 @@ CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON ex
CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_name ON external_approval_rules USING btree (project_id, name);
+CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_external_url ON external_status_checks USING btree (project_id, external_url);
+
+CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_name ON external_status_checks USING btree (project_id, name);
+
CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id);
CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id);
@@ -23101,6 +25267,8 @@ CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON v
CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha);
+CREATE INDEX idx_vulnerabilities_partial_devops_adoption ON vulnerabilities USING btree (project_id, created_at) WHERE (state <> 1);
+
CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue ON vulnerability_external_issue_links USING btree (vulnerability_id, external_type, external_project_key, external_issue_key);
CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_link_type ON vulnerability_external_issue_links USING btree (vulnerability_id, link_type) WHERE (link_type = 1);
@@ -23111,6 +25279,10 @@ CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_link_t
CREATE INDEX index_abuse_reports_on_user_id ON abuse_reports USING btree (user_id);
+CREATE UNIQUE INDEX index_agent_group_authorizations_on_agent_id_and_group_id ON agent_group_authorizations USING btree (agent_id, group_id);
+
+CREATE INDEX index_agent_group_authorizations_on_group_id ON agent_group_authorizations USING btree (group_id);
+
CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assignees USING btree (alert_id);
CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id);
@@ -23253,12 +25425,12 @@ CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id);
CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id);
+CREATE UNIQUE INDEX index_batched_background_migrations_on_unique_configuration ON batched_background_migrations USING btree (job_class_name, table_name, column_name, job_arguments);
+
CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id);
CREATE INDEX index_batched_jobs_on_batched_migration_id_and_status ON batched_background_migration_jobs USING btree (batched_background_migration_id, status);
-CREATE INDEX index_batched_migrations_on_job_table_and_column_name ON batched_background_migrations USING btree (job_class_name, table_name, column_name);
-
CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id);
CREATE UNIQUE INDEX index_board_assignees_on_board_id_and_assignee_id ON board_assignees USING btree (board_id, assignee_id);
@@ -23325,6 +25497,8 @@ CREATE INDEX index_boards_epic_user_preferences_on_user_id ON boards_epic_user_p
CREATE INDEX index_boards_on_group_id ON boards USING btree (group_id);
+CREATE INDEX index_boards_on_iteration_cadence_id ON boards USING btree (iteration_cadence_id);
+
CREATE INDEX index_boards_on_iteration_id ON boards USING btree (iteration_id);
CREATE INDEX index_boards_on_milestone_id ON boards USING btree (milestone_id);
@@ -23335,7 +25509,7 @@ CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON bro
CREATE INDEX index_bulk_import_configurations_on_bulk_import_id ON bulk_import_configurations USING btree (bulk_import_id);
-CREATE INDEX index_bulk_import_entities_on_bulk_import_id ON bulk_import_entities USING btree (bulk_import_id);
+CREATE INDEX index_bulk_import_entities_on_bulk_import_id_and_status ON bulk_import_entities USING btree (bulk_import_id, status);
CREATE INDEX index_bulk_import_entities_on_namespace_id ON bulk_import_entities USING btree (namespace_id);
@@ -23365,11 +25539,7 @@ CREATE INDEX index_ci_build_report_results_on_project_id ON ci_build_report_resu
CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON ci_build_trace_chunks USING btree (build_id, chunk_index);
-CREATE UNIQUE INDEX index_ci_build_trace_section_names_on_project_id_and_name ON ci_build_trace_section_names USING btree (project_id, name);
-
-CREATE INDEX index_ci_build_trace_sections_on_project_id ON ci_build_trace_sections USING btree (project_id);
-
-CREATE INDEX index_ci_build_trace_sections_on_section_name_id ON ci_build_trace_sections USING btree (section_name_id);
+CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id);
CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id ON ci_builds_metadata USING btree (build_id);
@@ -23397,8 +25567,6 @@ CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING b
CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_builds USING btree (project_id) WHERE (((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text));
-CREATE INDEX index_ci_builds_on_protected ON ci_builds USING btree (protected);
-
CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at);
CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC);
@@ -23407,10 +25575,10 @@ CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id);
CREATE INDEX index_ci_builds_on_status_and_type_and_runner_id ON ci_builds USING btree (status, type, runner_id);
-CREATE UNIQUE INDEX index_ci_builds_on_token ON ci_builds USING btree (token);
-
CREATE UNIQUE INDEX index_ci_builds_on_token_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted IS NOT NULL);
+CREATE UNIQUE INDEX index_ci_builds_on_token_partial ON ci_builds USING btree (token) WHERE (token IS NOT NULL);
+
CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at);
CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);
@@ -23449,6 +25617,8 @@ CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts
CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store);
+CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23]));
+
CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type);
CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id);
@@ -23467,10 +25637,16 @@ CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON c
CREATE UNIQUE INDEX index_ci_namespace_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date);
+CREATE INDEX index_ci_pending_builds_id_on_protected_partial ON ci_pending_builds USING btree (id) WHERE (protected = true);
+
CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USING btree (build_id);
+CREATE INDEX index_ci_pending_builds_on_namespace_id ON ci_pending_builds USING btree (namespace_id);
+
CREATE INDEX index_ci_pending_builds_on_project_id ON ci_pending_builds USING btree (project_id);
+CREATE INDEX index_ci_pending_builds_on_tag_ids ON ci_pending_builds USING btree (tag_ids) WHERE (cardinality(tag_ids) > 0);
+
CREATE INDEX index_ci_pipeline_artifacts_failed_verification ON ci_pipeline_artifacts USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
CREATE INDEX index_ci_pipeline_artifacts_needs_verification ON ci_pipeline_artifacts USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
@@ -23617,10 +25793,6 @@ CREATE INDEX index_ci_subscriptions_projects_on_upstream_project_id ON ci_subscr
CREATE UNIQUE INDEX index_ci_subscriptions_projects_unique_subscription ON ci_subscriptions_projects USING btree (downstream_project_id, upstream_project_id);
-CREATE INDEX index_ci_test_case_failures_on_build_id ON ci_test_case_failures USING btree (build_id);
-
-CREATE UNIQUE INDEX index_ci_test_cases_on_project_id_and_key_hash ON ci_test_cases USING btree (project_id, key_hash);
-
CREATE INDEX index_ci_trigger_requests_on_commit_id ON ci_trigger_requests USING btree (commit_id);
CREATE INDEX index_ci_trigger_requests_on_trigger_id_and_id ON ci_trigger_requests USING btree (trigger_id, id DESC);
@@ -23673,14 +25845,10 @@ CREATE UNIQUE INDEX index_clusters_applications_crossplane_on_cluster_id ON clus
CREATE UNIQUE INDEX index_clusters_applications_elastic_stacks_on_cluster_id ON clusters_applications_elastic_stacks USING btree (cluster_id);
-CREATE UNIQUE INDEX index_clusters_applications_fluentd_on_cluster_id ON clusters_applications_fluentd USING btree (cluster_id);
-
CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id);
CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON clusters_applications_ingress USING btree (cluster_id);
-CREATE INDEX index_clusters_applications_ingress_on_modsecurity ON clusters_applications_ingress USING btree (modsecurity_enabled, modsecurity_mode, cluster_id);
-
CREATE UNIQUE INDEX index_clusters_applications_jupyter_on_cluster_id ON clusters_applications_jupyter USING btree (cluster_id);
CREATE INDEX index_clusters_applications_jupyter_on_oauth_application_id ON clusters_applications_jupyter USING btree (oauth_application_id);
@@ -23711,6 +25879,8 @@ CREATE INDEX index_clusters_on_user_id ON clusters USING btree (user_id);
CREATE UNIQUE INDEX index_commit_user_mentions_on_note_id ON commit_user_mentions USING btree (note_id);
+CREATE INDEX index_compliance_frameworks_id_where_frameworks_not_null ON compliance_management_frameworks USING btree (id) WHERE (pipeline_configuration_full_path IS NOT NULL);
+
CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_composer_cache_files USING btree (id) WHERE (namespace_id IS NULL);
CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled);
@@ -23733,8 +25903,24 @@ CREATE INDEX index_custom_emoji_on_creator_id ON custom_emoji USING btree (creat
CREATE UNIQUE INDEX index_custom_emoji_on_namespace_id_and_name ON custom_emoji USING btree (namespace_id, name);
+CREATE INDEX index_customer_relations_contacts_on_group_id ON customer_relations_contacts USING btree (group_id);
+
+CREATE INDEX index_customer_relations_contacts_on_organization_id ON customer_relations_contacts USING btree (organization_id);
+
+CREATE UNIQUE INDEX index_customer_relations_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name));
+
+CREATE UNIQUE INDEX index_cycle_analytics_stage_event_hashes_on_hash_sha_256 ON analytics_cycle_analytics_stage_event_hashes USING btree (hash_sha256);
+
CREATE UNIQUE INDEX index_daily_build_group_report_results_unique_columns ON ci_daily_build_group_report_results USING btree (project_id, ref_path, date, group_name);
+CREATE INDEX index_dast_profile_schedules_active_next_run_at ON dast_profile_schedules USING btree (active, next_run_at);
+
+CREATE UNIQUE INDEX index_dast_profile_schedules_on_dast_profile_id ON dast_profile_schedules USING btree (dast_profile_id);
+
+CREATE INDEX index_dast_profile_schedules_on_project_id ON dast_profile_schedules USING btree (project_id);
+
+CREATE INDEX index_dast_profile_schedules_on_user_id ON dast_profile_schedules USING btree (user_id);
+
CREATE INDEX index_dast_profiles_on_dast_scanner_profile_id ON dast_profiles USING btree (dast_scanner_profile_id);
CREATE INDEX index_dast_profiles_on_dast_site_profile_id ON dast_profiles USING btree (dast_site_profile_id);
@@ -23751,6 +25937,8 @@ CREATE UNIQUE INDEX index_dast_site_profiles_on_project_id_and_name ON dast_site
CREATE UNIQUE INDEX index_dast_site_profiles_pipelines_on_ci_pipeline_id ON dast_site_profiles_pipelines USING btree (ci_pipeline_id);
+CREATE UNIQUE INDEX index_dast_site_token_on_token ON dast_site_tokens USING btree (token);
+
CREATE INDEX index_dast_site_tokens_on_project_id ON dast_site_tokens USING btree (project_id);
CREATE INDEX index_dast_site_validations_on_dast_site_token_id ON dast_site_validations USING btree (dast_site_token_id);
@@ -23761,6 +25949,12 @@ CREATE INDEX index_dast_sites_on_dast_site_validation_id ON dast_sites USING btr
CREATE UNIQUE INDEX index_dast_sites_on_project_id_and_url ON dast_sites USING btree (project_id, url);
+CREATE UNIQUE INDEX index_dep_ci_build_trace_section_names_on_project_id_and_name ON dep_ci_build_trace_section_names USING btree (project_id, name);
+
+CREATE INDEX index_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_trace_sections USING btree (project_id);
+
+CREATE INDEX index_dep_ci_build_trace_sections_on_section_name_id ON dep_ci_build_trace_sections USING btree (section_name_id);
+
CREATE INDEX index_dependency_proxy_blobs_on_group_id_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name);
CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id);
@@ -23889,6 +26083,8 @@ CREATE INDEX index_environments_on_project_id_and_tier ON environments USING btr
CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type);
+CREATE INDEX index_environments_on_state_and_auto_delete_at ON environments USING btree (auto_delete_at) WHERE ((auto_delete_at IS NOT NULL) AND ((state)::text = 'stopped'::text));
+
CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text));
CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id);
@@ -23939,6 +26135,28 @@ CREATE INDEX index_epics_on_start_date_sourcing_epic_id ON epics USING btree (st
CREATE INDEX index_epics_on_start_date_sourcing_milestone_id ON epics USING btree (start_date_sourcing_milestone_id);
+CREATE INDEX index_error_tracking_client_keys_on_project_id ON error_tracking_client_keys USING btree (project_id);
+
+CREATE INDEX index_error_tracking_error_events_on_error_id ON error_tracking_error_events USING btree (error_id);
+
+CREATE INDEX index_error_tracking_errors_on_project_id ON error_tracking_errors USING btree (project_id);
+
+CREATE INDEX index_esc_protected_branches_on_external_status_check_id ON external_status_checks_protected_branches USING btree (external_status_check_id);
+
+CREATE INDEX index_esc_protected_branches_on_protected_branch_id ON external_status_checks_protected_branches USING btree (protected_branch_id);
+
+CREATE UNIQUE INDEX index_escalation_rules_on_all_attributes ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds, user_id);
+
+CREATE INDEX index_escalation_rules_on_user ON incident_management_escalation_rules USING btree (user_id);
+
+CREATE INDEX index_et_errors_on_project_id_and_status_and_events_count ON error_tracking_errors USING btree (project_id, status, events_count);
+
+CREATE INDEX index_et_errors_on_project_id_and_status_and_first_seen_at ON error_tracking_errors USING btree (project_id, status, first_seen_at);
+
+CREATE INDEX index_et_errors_on_project_id_and_status_and_id ON error_tracking_errors USING btree (project_id, status, id);
+
+CREATE INDEX index_et_errors_on_project_id_and_status_and_last_seen_at ON error_tracking_errors USING btree (project_id, status, last_seen_at);
+
CREATE INDEX index_events_on_action ON events USING btree (action);
CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at);
@@ -23977,6 +26195,8 @@ CREATE UNIQUE INDEX index_experiments_on_name ON experiments USING btree (name);
CREATE INDEX index_expired_and_not_notified_personal_access_tokens ON personal_access_tokens USING btree (id, expires_at) WHERE ((impersonation = false) AND (revoked = false) AND (expire_notification_delivered = false));
+CREATE UNIQUE INDEX index_external_audit_event_destinations_on_namespace_id ON audit_events_external_audit_event_destinations USING btree (namespace_id, destination_url);
+
CREATE UNIQUE INDEX index_external_pull_requests_on_project_and_branches ON external_pull_requests USING btree (project_id, source_branch, target_branch);
CREATE UNIQUE INDEX index_feature_flag_scopes_on_flag_id_and_environment_scope ON operations_feature_flag_scopes USING btree (feature_flag_id, environment_scope);
@@ -24133,16 +26353,24 @@ CREATE INDEX index_group_repository_storage_moves_on_group_id ON group_repositor
CREATE UNIQUE INDEX index_group_stages_on_group_id_group_value_stream_id_and_name ON analytics_cycle_analytics_group_stages USING btree (group_id, group_value_stream_id, name);
+CREATE INDEX index_group_stages_on_stage_event_hash_id ON analytics_cycle_analytics_group_stages USING btree (stage_event_hash_id);
+
+CREATE UNIQUE INDEX index_group_user_callouts_feature ON user_group_callouts USING btree (user_id, feature_name, group_id);
+
CREATE UNIQUE INDEX index_group_wiki_repositories_on_disk_path ON group_wiki_repositories USING btree (disk_path);
CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositories USING btree (shard_id);
+CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at);
+
CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active;
CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (saml_provider_id) WHERE (saml_provider_id IS NOT NULL);
CREATE INDEX index_identities_on_user_id ON identities USING btree (user_id);
+CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_management_issuable_escalation_statuses USING btree (policy_id);
+
CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid);
CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL);
@@ -24185,6 +26413,24 @@ CREATE INDEX index_insights_on_namespace_id ON insights USING btree (namespace_i
CREATE INDEX index_insights_on_project_id ON insights USING btree (project_id);
+CREATE INDEX index_integrations_on_inherit_from_id ON integrations USING btree (inherit_from_id);
+
+CREATE INDEX index_integrations_on_project_and_type_where_inherit_null ON integrations USING btree (project_id, type) WHERE (inherit_from_id IS NULL);
+
+CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_unique ON integrations USING btree (project_id, type);
+
+CREATE INDEX index_integrations_on_template ON integrations USING btree (template);
+
+CREATE INDEX index_integrations_on_type ON integrations USING btree (type);
+
+CREATE UNIQUE INDEX index_integrations_on_type_and_instance_partial ON integrations USING btree (type, instance) WHERE (instance = true);
+
+CREATE UNIQUE INDEX index_integrations_on_type_and_template_partial ON integrations USING btree (type, template) WHERE (template = true);
+
+CREATE INDEX index_integrations_on_type_id_when_active_and_project_id_not_nu ON integrations USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
+
+CREATE UNIQUE INDEX index_integrations_on_unique_group_id_and_type ON integrations USING btree (group_id, type);
+
CREATE INDEX index_internal_ids_on_namespace_id ON internal_ids USING btree (namespace_id);
CREATE INDEX index_internal_ids_on_project_id ON internal_ids USING btree (project_id);
@@ -24199,6 +26445,8 @@ CREATE INDEX index_issuable_metric_images_on_issue_id ON issuable_metric_images
CREATE UNIQUE INDEX index_issuable_severities_on_issue_id ON issuable_severities USING btree (issue_id);
+CREATE INDEX index_issuable_slas_on_due_at_id_label_applied_issuable_closed ON issuable_slas USING btree (due_at, id) WHERE ((label_applied = false) AND (issuable_closed = false));
+
CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree (issue_id);
CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id);
@@ -24249,6 +26497,10 @@ CREATE UNIQUE INDEX index_issues_on_project_id_and_external_key ON issues USING
CREATE UNIQUE INDEX index_issues_on_project_id_and_iid ON issues USING btree (project_id, iid);
+CREATE INDEX index_issues_on_project_id_and_state_id_and_created_at_and_id ON issues USING btree (project_id, state_id, created_at, id);
+
+CREATE INDEX index_issues_on_project_id_and_upvotes_count ON issues USING btree (project_id, upvotes_count);
+
CREATE INDEX index_issues_on_promoted_to_epic_id ON issues USING btree (promoted_to_epic_id) WHERE (promoted_to_epic_id IS NOT NULL);
CREATE INDEX index_issues_on_sprint_id ON issues USING btree (sprint_id);
@@ -24259,6 +26511,8 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at);
CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL);
+CREATE INDEX index_issues_on_work_item_type_id ON issues USING btree (work_item_type_id);
+
CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id);
CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key);
@@ -24275,6 +26529,8 @@ CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING bt
CREATE INDEX index_keys_on_expires_at_and_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), expiry_notification_delivered_at) WHERE (expiry_notification_delivered_at IS NULL);
+CREATE INDEX index_keys_on_expires_at_and_id ON keys USING btree (date(timezone('UTC'::text, expires_at)), id) WHERE (expiry_notification_delivered_at IS NULL);
+
CREATE UNIQUE INDEX index_keys_on_fingerprint ON keys USING btree (fingerprint);
CREATE INDEX index_keys_on_fingerprint_sha256 ON keys USING btree (fingerprint_sha256);
@@ -24369,6 +26625,8 @@ CREATE INDEX index_merge_request_blocks_on_blocked_merge_request_id ON merge_req
CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON merge_request_cleanup_schedules USING btree (merge_request_id);
+CREATE INDEX index_merge_request_cleanup_schedules_on_status ON merge_request_cleanup_schedules USING btree (status);
+
CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id);
CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email);
@@ -24459,6 +26717,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON
CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true));
+CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON merge_requests USING btree (target_project_id, updated_at, id);
+
CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text);
CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title);
@@ -24485,6 +26745,8 @@ CREATE INDEX index_metrics_users_starred_dashboards_on_project_id ON metrics_use
CREATE INDEX index_migration_jobs_on_migration_id_and_finished_at ON batched_background_migration_jobs USING btree (batched_background_migration_id, finished_at);
+CREATE INDEX index_migration_jobs_on_migration_id_and_max_value ON batched_background_migration_jobs USING btree (batched_background_migration_id, max_value);
+
CREATE INDEX index_milestone_releases_on_release_id ON milestone_releases USING btree (release_id);
CREATE INDEX index_milestones_on_description_trigram ON milestones USING gin (description gin_trgm_ops);
@@ -24503,7 +26765,7 @@ CREATE INDEX index_mirror_data_non_scheduled_or_started ON project_mirror_data U
CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id);
-CREATE INDEX index_mr_cleanup_schedules_timestamps ON merge_request_cleanup_schedules USING btree (scheduled_at) WHERE (completed_at IS NULL);
+CREATE INDEX index_mr_cleanup_schedules_timestamps_status ON merge_request_cleanup_schedules USING btree (scheduled_at) WHERE ((completed_at IS NULL) AND (status = 0));
CREATE UNIQUE INDEX index_mr_context_commits_on_merge_request_id_and_sha ON merge_request_context_commits USING btree (merge_request_id, sha);
@@ -24627,8 +26889,6 @@ CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_esc
CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL));
-CREATE UNIQUE INDEX index_on_policy_schedule_status_elapsed_time_escalation_rules ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds);
-
CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON incident_management_escalation_policies USING btree (project_id, name);
CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text));
@@ -24723,6 +26983,8 @@ CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generi
CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 8);
+CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 11);
+
CREATE INDEX index_packages_package_file_build_infos_on_package_file_id ON packages_package_file_build_infos USING btree (package_file_id);
CREATE INDEX index_packages_package_file_build_infos_on_pipeline_id ON packages_package_file_build_infos USING btree (pipeline_id);
@@ -24815,6 +27077,8 @@ CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btre
CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id);
+CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_indexes USING btree (name);
+
CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier);
CREATE UNIQUE INDEX index_programming_languages_on_name ON programming_languages USING btree (name);
@@ -24825,12 +27089,12 @@ CREATE UNIQUE INDEX index_project_aliases_on_name ON project_aliases USING btree
CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree (project_id);
-CREATE INDEX index_project_authorizations_on_project_id ON project_authorizations USING btree (project_id);
-
CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id);
CREATE UNIQUE INDEX index_project_ci_cd_settings_on_project_id ON project_ci_cd_settings USING btree (project_id);
+CREATE UNIQUE INDEX index_project_ci_feature_usages_unique_columns ON project_ci_feature_usages USING btree (project_id, feature, default_branch);
+
CREATE INDEX index_project_compliance_framework_settings_on_framework_id ON project_compliance_framework_settings USING btree (framework_id);
CREATE INDEX index_project_compliance_framework_settings_on_project_id ON project_compliance_framework_settings USING btree (project_id);
@@ -24859,6 +27123,10 @@ CREATE UNIQUE INDEX index_project_features_on_project_id ON project_features USI
CREATE INDEX index_project_features_on_project_id_bal_20 ON project_features USING btree (project_id) WHERE (builds_access_level = 20);
+CREATE UNIQUE INDEX index_project_features_on_project_id_include_container_registry ON project_features USING btree (project_id) INCLUDE (container_registry_access_level);
+
+COMMENT ON INDEX index_project_features_on_project_id_include_container_registry IS 'Included column (container_registry_access_level) improves performance of the ContainerRepository.for_group_and_its_subgroups scope query';
+
CREATE INDEX index_project_features_on_project_id_ral_20 ON project_features USING btree (project_id) WHERE (repository_access_level = 20);
CREATE INDEX index_project_group_links_on_group_id ON project_group_links USING btree (group_id);
@@ -24897,6 +27165,8 @@ CREATE INDEX index_project_settings_on_project_id_partially ON project_settings
CREATE UNIQUE INDEX index_project_settings_on_push_rule_id ON project_settings USING btree (push_rule_id);
+CREATE INDEX index_project_stages_on_stage_event_hash_id ON analytics_cycle_analytics_project_stages USING btree (stage_event_hash_id);
+
CREATE INDEX index_project_statistics_on_namespace_id ON project_statistics USING btree (namespace_id);
CREATE INDEX index_project_statistics_on_packages_size_and_project_id ON project_statistics USING btree (packages_size, project_id);
@@ -24909,6 +27179,12 @@ CREATE INDEX index_project_statistics_on_storage_size_and_project_id ON project_
CREATE INDEX index_project_statistics_on_wiki_size_and_project_id ON project_statistics USING btree (wiki_size, project_id);
+CREATE INDEX index_project_topics_on_project_id ON project_topics USING btree (project_id);
+
+CREATE UNIQUE INDEX index_project_topics_on_project_id_and_topic_id ON project_topics USING btree (project_id, topic_id);
+
+CREATE INDEX index_project_topics_on_topic_id ON project_topics USING btree (topic_id);
+
CREATE UNIQUE INDEX index_project_tracing_settings_on_project_id ON project_tracing_settings USING btree (project_id);
CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false));
@@ -24989,6 +27265,8 @@ CREATE INDEX index_projects_on_pending_delete ON projects USING btree (pending_d
CREATE INDEX index_projects_on_pool_repository_id ON projects USING btree (pool_repository_id) WHERE (pool_repository_id IS NOT NULL);
+CREATE UNIQUE INDEX index_projects_on_project_namespace_id ON projects USING btree (project_namespace_id);
+
CREATE INDEX index_projects_on_repository_storage ON projects USING btree (repository_storage);
CREATE INDEX index_projects_on_runners_token ON projects USING btree (runners_token);
@@ -25093,12 +27371,16 @@ CREATE INDEX index_requirements_management_test_reports_on_author_id ON requirem
CREATE INDEX index_requirements_management_test_reports_on_build_id ON requirements_management_test_reports USING btree (build_id);
+CREATE INDEX index_requirements_management_test_reports_on_issue_id ON requirements_management_test_reports USING btree (issue_id);
+
CREATE INDEX index_requirements_management_test_reports_on_requirement_id ON requirements_management_test_reports USING btree (requirement_id);
CREATE INDEX index_requirements_on_author_id ON requirements USING btree (author_id);
CREATE INDEX index_requirements_on_created_at ON requirements USING btree (created_at);
+CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id);
+
CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id);
CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL);
@@ -25203,8 +27485,14 @@ CREATE INDEX index_security_findings_on_severity ON security_findings USING btre
CREATE UNIQUE INDEX index_security_findings_on_uuid_and_scan_id ON security_findings USING btree (uuid, scan_id);
+CREATE INDEX index_security_scans_on_created_at ON security_scans USING btree (created_at);
+
CREATE INDEX index_security_scans_on_date_created_at_and_id ON security_scans USING btree (date(timezone('UTC'::text, created_at)), id);
+CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree (pipeline_id);
+
+CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id);
+
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
@@ -25221,23 +27509,7 @@ CREATE INDEX index_serverless_domain_cluster_on_pages_domain_id ON serverless_do
CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON projects USING btree (id, creator_id, created_at) WHERE (service_desk_enabled = true);
-CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id);
-
-CREATE INDEX index_services_on_project_and_type_where_inherit_null ON services USING btree (project_id, type) WHERE (inherit_from_id IS NULL);
-
-CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type);
-
-CREATE INDEX index_services_on_template ON services USING btree (template);
-
-CREATE INDEX index_services_on_type ON services USING btree (type);
-
-CREATE UNIQUE INDEX index_services_on_type_and_instance_partial ON services USING btree (type, instance) WHERE (instance = true);
-
-CREATE UNIQUE INDEX index_services_on_type_and_template_partial ON services USING btree (type, template) WHERE (template = true);
-
-CREATE INDEX index_services_on_type_id_when_active_and_project_id_not_null ON services USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL));
-
-CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING btree (group_id, type);
+CREATE INDEX index_service_desk_settings_on_file_template_project_id ON service_desk_settings USING btree (file_template_project_id);
CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name);
@@ -25329,6 +27601,8 @@ CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm
CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id);
+CREATE INDEX index_status_check_responses_on_external_status_check_id ON status_check_responses USING btree (external_status_check_id);
+
CREATE INDEX index_status_check_responses_on_merge_request_id ON status_check_responses USING btree (merge_request_id);
CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_page_published_incidents USING btree (issue_id);
@@ -25385,8 +27659,6 @@ CREATE UNIQUE INDEX index_terraform_states_on_project_id_and_name ON terraform_s
CREATE UNIQUE INDEX index_terraform_states_on_uuid ON terraform_states USING btree (uuid);
-CREATE UNIQUE INDEX index_test_case_failures_unique_columns ON ci_test_case_failures USING btree (test_case_id, failed_at DESC, build_id);
-
CREATE INDEX index_timelogs_on_issue_id ON timelogs USING btree (issue_id);
CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_request_id);
@@ -25423,14 +27695,20 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_plaintext_token ON token_with
CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING btree (hashed_token);
+CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name);
+
CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects USING btree (project_id);
CREATE INDEX index_u2f_registrations_on_key_handle ON u2f_registrations USING btree (key_handle);
CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree (user_id);
+CREATE UNIQUE INDEX index_uniq_im_issuable_escalation_statuses_on_issue_id ON incident_management_issuable_escalation_statuses USING btree (issue_id);
+
CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id);
+CREATE UNIQUE INDEX index_unique_project_authorizations_on_project_id_user_id ON project_authorizations USING btree (project_id, user_id);
+
CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC);
CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id);
@@ -25465,6 +27743,8 @@ CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING
CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id);
+CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id);
+
CREATE INDEX index_user_highest_roles_on_user_id_and_highest_access_level ON user_highest_roles USING btree (user_id, highest_access_level);
CREATE INDEX index_user_interacted_projects_on_user_id ON user_interacted_projects USING btree (user_id);
@@ -25599,6 +27879,10 @@ CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vuln
CREATE UNIQUE INDEX index_vulnerability_findings_remediations_on_unique_keys ON vulnerability_findings_remediations USING btree (vulnerability_occurrence_id, vulnerability_remediation_id);
+CREATE UNIQUE INDEX index_vulnerability_flags_on_unique_columns ON vulnerability_flags USING btree (vulnerability_occurrence_id, flag_type, origin);
+
+CREATE INDEX index_vulnerability_flags_on_vulnerability_occurrence_id ON vulnerability_flags USING btree (vulnerability_occurrence_id);
+
CREATE INDEX index_vulnerability_historical_statistics_on_date_and_id ON vulnerability_historical_statistics USING btree (date, id);
CREATE UNIQUE INDEX index_vulnerability_identifiers_on_project_id_and_fingerprint ON vulnerability_identifiers USING btree (project_id, fingerprint);
@@ -25643,10 +27927,6 @@ CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerabili
CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id);
-CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id);
-
-CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id);
-
CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHERE ((type)::text = 'GroupHook'::text);
CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id);
@@ -25681,6 +27961,8 @@ CREATE INDEX index_x509_commit_signatures_on_x509_certificate_id ON x509_commit_
CREATE INDEX index_x509_issuers_on_subject_key_identifier ON x509_issuers USING btree (subject_key_identifier);
+CREATE INDEX index_zentao_tracker_data_on_integration_id ON zentao_tracker_data USING btree (integration_id);
+
CREATE INDEX index_zoom_meetings_on_issue_id ON zoom_meetings USING btree (issue_id);
CREATE UNIQUE INDEX index_zoom_meetings_on_issue_id_and_issue_status ON zoom_meetings USING btree (issue_id, issue_status) WHERE (issue_status = 1);
@@ -25745,12 +28027,16 @@ CREATE INDEX tmp_index_ci_builds_lock_version ON ci_builds USING btree (id) WHER
CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL);
-CREATE INDEX tmp_index_ci_stages_lock_version ON ci_stages USING btree (id) WHERE (lock_version IS NULL);
+CREATE INDEX tmp_index_ci_stages_lock_version ON ci_stages USING btree (id_convert_to_bigint) WHERE (lock_version IS NULL);
-CREATE INDEX tmp_index_on_security_findings_scan_id ON security_findings USING btree (scan_id) WHERE (uuid IS NULL);
+CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[]));
+
+CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[]));
CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2);
+CREATE INDEX tmp_index_taggings_on_id_where_taggable_type_project ON taggings USING btree (id) WHERE ((taggable_type)::text = 'Project'::text);
+
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name);
CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name);
@@ -25775,6 +28061,8 @@ CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback
CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id);
+CREATE UNIQUE INDEX work_item_types_namespace_id_and_name_unique ON work_item_types USING btree (namespace_id, btrim(lower(name)));
+
ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_created_at_author_id_idx;
ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_entity_id_entity_type_id_author_id_crea_idx;
@@ -25823,6 +28111,138 @@ ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH
ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_pkey;
+ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307_created_at_author_id_idx;
+
+ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307_entity_id_entity_type_id_author_id_crea_idx;
+
+ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202307_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212_pkey;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_20221_rule_id_idx;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2022_alert_id_idx;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2022_rule_id_idx1;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306_pkey;
+
+ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307_pkey;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_20230_rule_id_idx;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_alert_id_idx;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx1;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx2;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx3;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx4;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx5;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx6;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx1;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx2;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx3;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx4;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx5;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx6;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx7;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2_schedule_id_idx;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx1;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx2;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx3;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx4;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx5;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx6;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx7;
+
+ALTER INDEX index_incident_management_pending_alert_escalations_on_schedule ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations__schedule_id_idx8;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212_pkey;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_20221_rule_id_idx;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2022_issue_id_idx;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2022_rule_id_idx1;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306_pkey;
+
+ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307_pkey;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_20230_rule_id_idx;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_issue_id_idx;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx1;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx2;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx3;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx4;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx5;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx6;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx1;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx2;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx3;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx4;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx5;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx6;
+
+ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx7;
+
ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_1554dc6f11;
ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_719c6187cb;
@@ -25835,6 +28255,18 @@ ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTIT
ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea;
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303_pkey;
+
+ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304_pkey;
+
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey;
ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey;
@@ -25871,6 +28303,140 @@ ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_ho
ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_web_hook_id_idx;
+ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_created_at_web_hook_id_idx;
+
+ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_pkey;
+
+ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202307_web_hook_id_idx;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30_pkey;
+
+ALTER INDEX analytics_cycle_analytics_issue_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30_pkey;
+
+ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31_pkey;
+
ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10;
ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11;
@@ -26127,15 +28693,15 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p
ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey;
-CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db();
-
CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e();
CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957();
CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2();
-CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934();
+CREATE TRIGGER trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_490d204c00b3();
+
+CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e();
CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10();
@@ -26145,30 +28711,35 @@ CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipeli
CREATE TRIGGER trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b();
-CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6();
+CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON dep_ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6();
CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3();
-CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693();
-
CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002();
CREATE TRIGGER trigger_f1ca8ec18d78 BEFORE INSERT OR UPDATE ON geo_job_artifact_deleted_events FOR EACH ROW EXECUTE FUNCTION trigger_f1ca8ec18d78();
-CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+
+CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+
+CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
-CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN (((old.type_new = 'Integrations::ExternalWiki'::text) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_issue_tracker_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();
+CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN (((new.active = true) AND (new.type_new = 'Integrations::ExternalWiki'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_wiki_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.type)::text = 'ExternalWikiService'::text) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_has_external_wiki_on_type_new_updated AFTER UPDATE OF type_new ON integrations FOR EACH ROW WHEN (((new.type_new = 'Integrations::ExternalWiki'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON services FOR EACH ROW WHEN (((new.active = true) AND ((new.type)::text = 'ExternalWikiService'::text) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON integrations FOR EACH ROW WHEN (((new.type_new = 'Integrations::ExternalWiki'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
-CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.type)::text = 'ExternalWikiService'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki();
+CREATE TRIGGER trigger_type_new_on_insert AFTER INSERT ON integrations FOR EACH ROW EXECUTE FUNCTION integrations_set_type_new();
ALTER TABLE ONLY chat_names
- ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY deployments
+ ADD CONSTRAINT fk_009fd21147 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_013c9f36ca FOREIGN KEY (due_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
@@ -26176,15 +28747,18 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY clusters_applications_runners
ADD CONSTRAINT fk_02de2ded36 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE SET NULL;
+ALTER TABLE ONLY incident_management_escalation_rules
+ ADD CONSTRAINT fk_0314ee86eb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY service_desk_settings
+ ADD CONSTRAINT fk_03afb71f06 FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY design_management_designs_versions
ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE;
ALTER TABLE ONLY terraform_state_versions
ADD CONSTRAINT fk_04b91e4a9f FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_test_cases
- ADD CONSTRAINT fk_0526c30ded FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26212,9 +28786,6 @@ ALTER TABLE ONLY ci_unit_test_failures
ALTER TABLE ONLY project_pages_metadata
ADD CONSTRAINT fk_0fd5b22688 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE SET NULL;
-ALTER TABLE ONLY status_check_responses
- ADD CONSTRAINT fk_116e7e7369 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY group_deletion_schedules
ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26260,6 +28831,9 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY geo_container_repository_updated_events
ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT fk_21d25cac1a FOREIGN KEY (trace_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY users_star_projects
ADD CONSTRAINT fk_22cd27ddfc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26281,8 +28855,8 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_262d4c2d19 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
-ALTER TABLE ONLY ci_build_trace_sections
- ADD CONSTRAINT fk_264e112c66 FOREIGN KEY (section_name_id) REFERENCES ci_build_trace_section_names(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dep_ci_build_trace_sections
+ ADD CONSTRAINT fk_264e112c66 FOREIGN KEY (section_name_id) REFERENCES dep_ci_build_trace_section_names(id) ON DELETE CASCADE;
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_27548c6db3 FOREIGN KEY (hashed_storage_migrated_event_id) REFERENCES geo_hashed_storage_migrated_events(id) ON DELETE CASCADE;
@@ -26290,6 +28864,12 @@ ALTER TABLE ONLY geo_event_log
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL;
+ALTER TABLE ONLY agent_group_authorizations
+ ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY ci_freeze_periods
+ ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY notes
ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL;
@@ -26299,6 +28879,9 @@ ALTER TABLE ONLY members
ALTER TABLE ONLY lfs_objects_projects
ADD CONSTRAINT fk_2eb33f7a78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID;
+ALTER TABLE ONLY analytics_cycle_analytics_group_stages
+ ADD CONSTRAINT fk_3078345d6d FOREIGN KEY (stage_event_hash_id) REFERENCES analytics_cycle_analytics_stage_event_hashes(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_30f2a831f4 FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
@@ -26314,6 +28897,9 @@ ALTER TABLE ONLY ci_group_variables
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT fk_34af9ab07a FOREIGN KEY (topic_id) REFERENCES topics(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY in_product_marketing_emails
ADD CONSTRAINT fk_35c9101b63 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26359,7 +28945,7 @@ ALTER TABLE ONLY releases
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_4a99ebfd60 FOREIGN KEY (repositories_changed_event_id) REFERENCES geo_repositories_changed_events(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_trace_sections
+ALTER TABLE ONLY dep_ci_build_trace_sections
ADD CONSTRAINT fk_4ebe41f502 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
ALTER TABLE ONLY alert_management_alerts
@@ -26374,6 +28960,9 @@ ALTER TABLE ONLY dast_site_profiles_pipelines
ALTER TABLE ONLY terraform_states
ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY status_check_responses
+ ADD CONSTRAINT fk_55bd2abc83 FOREIGN KEY (external_status_check_id) REFERENCES external_status_checks(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_56067dcb44 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26383,6 +28972,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY deploy_keys_projects
ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT fk_5d46286ad3 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT fk_5e0c8d9154 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26398,6 +28990,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY dependency_proxy_group_settings
ADD CONSTRAINT fk_616ddd680a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_61d52aa0e7 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY events
ADD CONSTRAINT fk_61fbf6ca48 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26419,6 +29014,9 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_6cca0d8800 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY projects
ADD CONSTRAINT fk_6e5c14658a FOREIGN KEY (pool_repository_id) REFERENCES pool_repositories(id) ON DELETE SET NULL;
@@ -26428,7 +29026,10 @@ ALTER TABLE ONLY terraform_state_versions
ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
+ALTER TABLE ONLY projects
+ ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerabilities
@@ -26500,6 +29101,9 @@ ALTER TABLE ONLY experiment_subjects
ALTER TABLE ONLY merge_request_diffs
ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY requirements
+ ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_pipelines
ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26518,6 +29122,9 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY bulk_import_entities
ADD CONSTRAINT fk_88c725229f FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY requirements_management_test_reports
+ ADD CONSTRAINT fk_88f30752fc FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26539,6 +29146,9 @@ ALTER TABLE ONLY ci_pipeline_schedules
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT fk_94e80df60e FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT fk_94f7c8a81e FOREIGN KEY (comment_author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26605,6 +29215,9 @@ ALTER TABLE ONLY ci_pipelines
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_site_profiles_builds
+ ADD CONSTRAINT fk_a325505e99 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY jira_connect_subscriptions
ADD CONSTRAINT fk_a3c10bcf7d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26635,6 +29248,9 @@ ALTER TABLE ONLY alert_management_alerts
ALTER TABLE ONLY identities
ADD CONSTRAINT fk_aade90f0fc FOREIGN KEY (saml_provider_id) REFERENCES saml_providers(id) ON DELETE CASCADE;
+ALTER TABLE ONLY boards
+ ADD CONSTRAINT fk_ab0a250ff6 FOREIGN KEY (iteration_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_acd9737679 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26647,6 +29263,9 @@ ALTER TABLE ONLY ci_variables
ALTER TABLE ONLY merge_request_metrics
ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY dast_profile_schedules
+ ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE;
@@ -26659,6 +29278,9 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY project_access_tokens
ADD CONSTRAINT fk_b27801bfbf FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY issues
+ ADD CONSTRAINT fk_b37be69be6 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id);
+
ALTER TABLE ONLY protected_tag_create_access_levels
ADD CONSTRAINT fk_b4eb82fe3c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26668,12 +29290,18 @@ ALTER TABLE ONLY bulk_import_entities
ALTER TABLE ONLY compliance_management_frameworks
ADD CONSTRAINT fk_b74c45b71f FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT fk_b7d788e813 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY issue_assignees
ADD CONSTRAINT fk_b7d881734a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_trigger_requests
ADD CONSTRAINT fk_b8ec8b7245 FOREIGN KEY (trigger_id) REFERENCES ci_triggers(id) ON DELETE CASCADE;
+ALTER TABLE ONLY customer_relations_contacts
+ ADD CONSTRAINT fk_b91ddd9345 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY deployments
ADD CONSTRAINT fk_b9a3851b82 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26707,6 +29335,9 @@ ALTER TABLE ONLY packages_packages
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_c1f241c70d FOREIGN KEY (upload_deleted_event_id) REFERENCES geo_upload_deleted_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY analytics_cycle_analytics_project_stages
+ ADD CONSTRAINT fk_c3339bdfc9 FOREIGN KEY (stage_event_hash_id) REFERENCES analytics_cycle_analytics_stage_event_hashes(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_exports
ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26728,6 +29359,9 @@ ALTER TABLE ONLY external_approval_rules_protected_branches
ALTER TABLE ONLY external_approval_rules_protected_branches
ADD CONSTRAINT fk_ca2ffb55e6 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks_protected_branches
+ ADD CONSTRAINT fk_cc0dcc36d1 FOREIGN KEY (external_status_check_id) REFERENCES external_status_checks(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_profiles_pipelines
ADD CONSTRAINT fk_cc206a8c13 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
@@ -26756,7 +29390,7 @@ ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY web_hooks
- ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
@@ -26764,9 +29398,6 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_d5af95fcd9 FOREIGN KEY (lfs_object_deleted_event_id) REFERENCES geo_lfs_object_deleted_events(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_test_case_failures
- ADD CONSTRAINT fk_d69404d827 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -26785,9 +29416,15 @@ ALTER TABLE ONLY todos
ALTER TABLE ONLY project_group_links
ADD CONSTRAINT fk_daa8cee94c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_topics
+ ADD CONSTRAINT fk_db13576296 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dependency_proxy_blobs
ADD CONSTRAINT fk_db58bbc5d7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY security_scans
+ ADD CONSTRAINT fk_dbc89265b9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26803,12 +29440,18 @@ ALTER TABLE ONLY ci_resources
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_builds_metadata
+ ADD CONSTRAINT fk_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY gitlab_subscriptions
ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_scanner_profiles_builds
+ ADD CONSTRAINT fk_e4c49200f8 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -26836,7 +29479,7 @@ ALTER TABLE ONLY vulnerability_statistics
ALTER TABLE ONLY ci_triggers
ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
+ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY pages_domains
@@ -26893,6 +29536,9 @@ ALTER TABLE ONLY protected_tag_create_access_levels
ALTER TABLE ONLY ci_stages
ADD CONSTRAINT fk_fb57e6cc56 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE ONLY agent_group_authorizations
+ ADD CONSTRAINT fk_fb70782616 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY system_note_metadata
ADD CONSTRAINT fk_fbd87415c9 FOREIGN KEY (description_version_id) REFERENCES description_versions(id) ON DELETE SET NULL;
@@ -26905,6 +29551,9 @@ ALTER TABLE ONLY ci_daily_build_group_report_results
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
+ALTER TABLE ONLY ci_pending_builds
+ ADD CONSTRAINT fk_fdc0137e4a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_import_data
ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -26950,6 +29599,9 @@ ALTER TABLE ONLY incident_management_oncall_participants
ALTER TABLE ONLY events
ADD CONSTRAINT fk_rails_0434b48643 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_issue_escalations
+ ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ip_restrictions
ADD CONSTRAINT fk_rails_04a93778d5 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -26986,6 +29638,9 @@ ALTER TABLE ONLY packages_conan_file_metadata
ALTER TABLE ONLY ci_build_pending_states
ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY audit_events_external_audit_event_destinations
+ ADD CONSTRAINT fk_rails_0bc80a4edc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY operations_user_lists
ADD CONSTRAINT fk_rails_0c716e079b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27083,7 +29738,7 @@ ALTER TABLE ONLY group_wiki_repositories
ADD CONSTRAINT fk_rails_19755e374b FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT;
ALTER TABLE ONLY open_project_tracker_data
- ADD CONSTRAINT fk_rails_1987546e48 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_1987546e48 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY gpg_signatures
ADD CONSTRAINT fk_rails_19d4f1c6f9 FOREIGN KEY (gpg_key_subkey_id) REFERENCES gpg_key_subkeys(id) ON DELETE SET NULL;
@@ -27109,6 +29764,9 @@ ALTER TABLE ONLY epic_user_mentions
ALTER TABLE ONLY approver_groups
ADD CONSTRAINT fk_rails_1cdcbd7723 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY project_ci_feature_usages
+ ADD CONSTRAINT fk_rails_1deedbf64b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards
ADD CONSTRAINT fk_rails_1e9a074a35 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -27118,6 +29776,9 @@ ALTER TABLE ONLY boards_epic_board_positions
ALTER TABLE ONLY geo_repository_created_events
ADD CONSTRAINT fk_rails_1f49e46a61 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY external_status_checks
+ ADD CONSTRAINT fk_rails_1f5a8aa809 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dora_daily_metrics
ADD CONSTRAINT fk_rails_1fd07aff6f FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
@@ -27130,6 +29791,9 @@ ALTER TABLE ONLY approval_merge_request_rules_groups
ALTER TABLE ONLY vulnerability_feedback
ADD CONSTRAINT fk_rails_20976e6fd9 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
+ALTER TABLE ONLY work_item_types
+ ADD CONSTRAINT fk_rails_20f694a960 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY user_statuses
ADD CONSTRAINT fk_rails_2178592333 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27187,6 +29851,9 @@ ALTER TABLE ONLY dast_site_validations
ALTER TABLE ONLY vulnerability_findings_remediations
ADD CONSTRAINT fk_rails_28a8d0cf93 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT fk_rails_29abffe3b9 FOREIGN KEY (policy_id) REFERENCES incident_management_escalation_policies(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_29af06892a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -27196,6 +29863,9 @@ ALTER TABLE ONLY reviews
ALTER TABLE ONLY draft_notes
ADD CONSTRAINT fk_rails_2a8dac9901 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dependency_proxy_image_ttl_group_policies
+ ADD CONSTRAINT fk_rails_2b1896d021 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY packages_tags
ADD CONSTRAINT fk_rails_2b18ae9256 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
@@ -27211,15 +29881,15 @@ ALTER TABLE ONLY packages_debian_group_component_files
ALTER TABLE ONLY boards_epic_board_labels
ADD CONSTRAINT fk_rails_2bedeb8799 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
+ALTER TABLE ONLY error_tracking_error_events
+ ADD CONSTRAINT fk_rails_2c096c0076 FOREIGN KEY (error_id) REFERENCES error_tracking_errors(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY onboarding_progresses
ADD CONSTRAINT fk_rails_2ccfd420cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_freeze_periods
- ADD CONSTRAINT fk_rails_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id);
-
ALTER TABLE ONLY issuable_severities
ADD CONSTRAINT fk_rails_2fbb74ad6d FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -27346,9 +30016,6 @@ ALTER TABLE ONLY security_orchestration_policy_configurations
ALTER TABLE ONLY ci_resources
ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE;
-ALTER TABLE ONLY clusters_applications_fluentd
- ADD CONSTRAINT fk_rails_4319b1dcd2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY batched_background_migration_jobs
ADD CONSTRAINT fk_rails_432153b86d FOREIGN KEY (batched_background_migration_id) REFERENCES batched_background_migrations(id) ON DELETE CASCADE;
@@ -27556,6 +30223,9 @@ ALTER TABLE ONLY status_page_published_incidents
ALTER TABLE ONLY deployment_clusters
ADD CONSTRAINT fk_rails_6359a164df FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_issue_escalations
+ ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY evidences
ADD CONSTRAINT fk_rails_6388b435a6 FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE;
@@ -27601,9 +30271,6 @@ ALTER TABLE ONLY operations_feature_flags_clients
ALTER TABLE ONLY namespace_admin_notes
ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
-ALTER TABLE ONLY web_hook_logs_archived
- ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams
ADD CONSTRAINT fk_rails_669f4ba293 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27631,12 +30298,18 @@ ALTER TABLE ONLY plan_limits
ALTER TABLE ONLY operations_feature_flags_issues
ADD CONSTRAINT fk_rails_6a8856ca4f FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
+ALTER TABLE ONLY error_tracking_errors
+ ADD CONSTRAINT fk_rails_6b41f837ba FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY prometheus_alerts
ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
ALTER TABLE ONLY term_agreements
ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_assets
+ ADD CONSTRAINT fk_rails_6edbbecba4 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY project_compliance_framework_settings
ADD CONSTRAINT fk_rails_6f5294f16c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27674,7 +30347,7 @@ ALTER TABLE ONLY vulnerability_finding_evidence_requests
ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
ALTER TABLE ONLY slack_integrations
- ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY custom_emoji
ADD CONSTRAINT fk_rails_745925b412 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -27727,6 +30400,9 @@ ALTER TABLE ONLY terraform_states
ALTER TABLE ONLY analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages
+ ADD CONSTRAINT fk_rails_79e77f6c5c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY software_license_policies
ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE;
@@ -27757,6 +30433,9 @@ ALTER TABLE ONLY required_code_owners_sections
ALTER TABLE ONLY dast_site_profiles
ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY zentao_tracker_data
+ ADD CONSTRAINT fk_rails_84efda7be0 FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards_epic_user_preferences
ADD CONSTRAINT fk_rails_851fe1510a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27814,6 +30493,9 @@ ALTER TABLE ONLY vulnerability_feedback
ALTER TABLE ONLY ci_pipeline_messages
ADD CONSTRAINT fk_rails_8d3b04e3e1 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_alert_escalations
+ ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY approval_merge_request_rules_approved_approvers
ADD CONSTRAINT fk_rails_8dc94cff4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -27847,6 +30529,9 @@ ALTER TABLE ONLY project_error_tracking_settings
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_responses
+ ADD CONSTRAINT fk_rails_929041a499 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_request_cleanup_schedules
ADD CONSTRAINT fk_rails_92dd0e705c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@@ -27889,6 +30574,9 @@ ALTER TABLE ONLY board_project_recent_visits
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_98fe21e486 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL;
+ALTER TABLE ONLY error_tracking_client_keys
+ ADD CONSTRAINT fk_rails_99342d1d54 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY pages_deployments
ADD CONSTRAINT fk_rails_993b88f59a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27935,7 +30623,7 @@ ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT fk_rails_a18600f210 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY jira_tracker_data
- ADD CONSTRAINT fk_rails_a299066916 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_a299066916 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY protected_environments
ADD CONSTRAINT fk_rails_a354313d11 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -27943,6 +30631,9 @@ ALTER TABLE ONLY protected_environments
ALTER TABLE ONLY fork_network_members
ADD CONSTRAINT fk_rails_a40860a1ca FOREIGN KEY (fork_network_id) REFERENCES fork_networks(id) ON DELETE CASCADE;
+ALTER TABLE ONLY customer_relations_organizations
+ ADD CONSTRAINT fk_rails_a48597902f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY operations_feature_flag_scopes
ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE;
@@ -27988,7 +30679,7 @@ ALTER TABLE ONLY merge_request_user_mentions
ALTER TABLE ONLY x509_commit_signatures
ADD CONSTRAINT fk_rails_ab07452314 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_trace_sections
+ALTER TABLE ONLY dep_ci_build_trace_sections
ADD CONSTRAINT fk_rails_ab7c104e26 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY resource_iteration_events
@@ -28006,6 +30697,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages
ALTER TABLE ONLY metrics_dashboard_annotations
ADD CONSTRAINT fk_rails_aeb11a7643 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_trace_metadata
+ ADD CONSTRAINT fk_rails_aebc78111f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY bulk_import_trackers
ADD CONSTRAINT fk_rails_aed566d3f3 FOREIGN KEY (bulk_import_entity_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE;
@@ -28187,7 +30881,7 @@ ALTER TABLE ONLY operations_strategies_user_lists
ADD CONSTRAINT fk_rails_ccb7e4bc0b FOREIGN KEY (user_list_id) REFERENCES operations_user_lists(id) ON DELETE CASCADE;
ALTER TABLE ONLY issue_tracker_data
- ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerability_finding_evidence_headers
ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE;
@@ -28198,6 +30892,9 @@ ALTER TABLE ONLY resource_milestone_events
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_cee126f66c FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_requests
+ ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY epic_metrics
ADD CONSTRAINT fk_rails_d071904753 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE;
@@ -28291,9 +30988,6 @@ ALTER TABLE ONLY packages_packages
ALTER TABLE ONLY cluster_platforms_kubernetes
ADD CONSTRAINT fk_rails_e1e2cf841a FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_builds_metadata
- ADD CONSTRAINT fk_rails_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY vulnerability_finding_evidences
ADD CONSTRAINT fk_rails_e3205a0c65 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
@@ -28303,6 +30997,9 @@ ALTER TABLE ONLY clusters_integration_prometheus
ALTER TABLE ONLY vulnerability_occurrence_identifiers
ADD CONSTRAINT fk_rails_e4ef6d027c FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_flags
+ ADD CONSTRAINT fk_rails_e59393b48b FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT fk_rails_e59e868733 FOREIGN KEY (clusters_applications_knative_id) REFERENCES clusters_applications_knative(id) ON DELETE CASCADE;
@@ -28348,12 +31045,12 @@ ALTER TABLE ONLY vulnerability_issue_links
ALTER TABLE ONLY merge_request_blocks
ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY vulnerability_finding_evidence_sources
+ ADD CONSTRAINT fk_rails_e9761bed4c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY protected_branch_unprotect_access_levels
ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_test_case_failures
- ADD CONSTRAINT fk_rails_eab6349715 FOREIGN KEY (test_case_id) REFERENCES ci_test_cases(id) ON DELETE CASCADE;
-
ALTER TABLE ONLY alert_management_alert_user_mentions
ADD CONSTRAINT fk_rails_eb2de0cdef FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
@@ -28414,9 +31111,15 @@ ALTER TABLE ONLY approval_project_rules_users
ALTER TABLE ONLY insights
ADD CONSTRAINT fk_rails_f36fda3932 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_alert_escalations
+ ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY board_group_recent_visits
ADD CONSTRAINT fk_rails_f410736518 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY incident_management_issuable_escalation_statuses
+ ADD CONSTRAINT fk_rails_f4c811fd28 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_f5827a7ccd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -28438,7 +31141,7 @@ ALTER TABLE ONLY issues_self_managed_prometheus_alert_events
ALTER TABLE ONLY merge_requests_closing_issues
ADD CONSTRAINT fk_rails_f8540692be FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_trace_section_names
+ALTER TABLE ONLY dep_ci_build_trace_section_names
ADD CONSTRAINT fk_rails_f8cd72cd26 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_trains
@@ -28447,6 +31150,9 @@ ALTER TABLE ONLY merge_trains
ALTER TABLE ONLY ci_runner_namespaces
ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY banned_users
+ ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY requirements_management_test_reports
ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES requirements(id) ON DELETE CASCADE;
@@ -28465,6 +31171,12 @@ ALTER TABLE ONLY ci_job_variables
ALTER TABLE ONLY packages_nuget_metadata
ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
+ALTER TABLE incident_management_pending_alert_escalations
+ ADD CONSTRAINT fk_rails_fcbfd9338b FOREIGN KEY (schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE;
+
+ALTER TABLE ONLY customer_relations_contacts
+ ADD CONSTRAINT fk_rails_fd3f2e7572 FOREIGN KEY (organization_id) REFERENCES customer_relations_organizations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY external_approval_rules
ADD CONSTRAINT fk_rails_fd4f9ac573 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -28483,8 +31195,8 @@ ALTER TABLE ONLY resource_label_events
ALTER TABLE ONLY ci_builds_metadata
ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY services
- ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE;
+ALTER TABLE ONLY integrations
+ ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES integrations(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL;
diff --git a/db/migrate/20210603140302_add_pronouns_to_user_details.rb b/db/migrate/20210603140302_add_pronouns_to_user_details.rb
deleted file mode 100644
index f28d45bdf6f..00000000000
--- a/db/migrate/20210603140302_add_pronouns_to_user_details.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddPronounsToUserDetails < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210607050531_add_text_limit_to_user_details_pronouns
- with_lock_retries do
- add_column :user_details, :pronouns, :text, null: true
- end
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- with_lock_retries do
- remove_column :user_details, :pronouns
- end
- end
-end
diff --git a/db/migrate/20210603222333_remove_builds_email_service_from_services.rb b/db/migrate/20210603222333_remove_builds_email_service_from_services.rb
deleted file mode 100644
index 791b8b659af..00000000000
--- a/db/migrate/20210603222333_remove_builds_email_service_from_services.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveBuildsEmailServiceFromServices < ActiveRecord::Migration[6.1]
- def up
- execute("DELETE from services WHERE type = 'BuildsEmailService'")
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210604032738_create_dast_site_profiles_builds.rb b/db/migrate/20210604032738_create_dast_site_profiles_builds.rb
deleted file mode 100644
index 6e653b36787..00000000000
--- a/db/migrate/20210604032738_create_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- def up
- table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Site Profiles and CI Builds' }
-
- create_table :dast_site_profiles_builds, primary_key: [:dast_site_profile_id, :ci_build_id], comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :dast_site_profile_id, null: false
- t.bigint :ci_build_id, null: false
-
- t.index :ci_build_id, unique: true, name: :dast_site_profiles_builds_on_ci_build_id
- end
- end
-
- def down
- drop_table :dast_site_profiles_builds
- end
-end
diff --git a/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb b/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb
deleted file mode 100644
index 6908da69e08..00000000000
--- a/db/migrate/20210604034158_add_ci_build_id_fk_to_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiBuildIdFkToDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_site_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_site_profiles_builds, column: :ci_build_id
- end
- end
-end
diff --git a/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb b/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb
deleted file mode 100644
index 58fe3090a4f..00000000000
--- a/db/migrate/20210604034354_add_dast_site_profile_id_fk_to_dast_site_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddDastSiteProfileIdFkToDastSiteProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_site_profiles_builds, :dast_site_profiles, column: :dast_site_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_site_profiles_builds, column: :dast_site_profile_id
- end
- end
-end
diff --git a/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb b/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb
deleted file mode 100644
index 0fe3ada4c0d..00000000000
--- a/db/migrate/20210604051330_create_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- def up
- table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Scanner Profiles and CI Builds' }
-
- create_table :dast_scanner_profiles_builds, primary_key: [:dast_scanner_profile_id, :ci_build_id], comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :dast_scanner_profile_id, null: false
- t.bigint :ci_build_id, null: false
-
- t.index :ci_build_id, unique: true, name: :dast_scanner_profiles_builds_on_ci_build_id
- end
- end
-
- def down
- drop_table :dast_scanner_profiles_builds
- end
-end
diff --git a/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb b/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb
deleted file mode 100644
index cc495c749c5..00000000000
--- a/db/migrate/20210604051742_add_ci_build_id_fk_to_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiBuildIdFkToDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_scanner_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_scanner_profiles_builds, column: :ci_build_id
- end
- end
-end
diff --git a/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb b/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb
deleted file mode 100644
index 0c14c798da4..00000000000
--- a/db/migrate/20210604051917_add_dast_scanner_profile_id_fk_to_dast_scanner_profiles_builds.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddDastScannerProfileIdFkToDastScannerProfilesBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_scanner_profiles_builds, :dast_scanner_profiles, column: :dast_scanner_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :dast_scanner_profiles_builds, column: :dast_scanner_profile_id
- end
- end
-end
diff --git a/db/migrate/20210604082145_create_external_status_checks_table.rb b/db/migrate/20210604082145_create_external_status_checks_table.rb
deleted file mode 100644
index c1ad3df6c9e..00000000000
--- a/db/migrate/20210604082145_create_external_status_checks_table.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# frozen_string_literal: true
-
-class CreateExternalStatusChecksTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :external_status_checks, if_not_exists: true do |t|
- t.references :project, foreign_key: { on_delete: :cascade }, null: false, index: false
- t.timestamps_with_timezone
- t.text :external_url, null: false
- t.text_limit :external_url, 255
- t.text :name, null: false
- t.text_limit :name, 255
-
- t.index([:project_id, :name],
- unique: true,
- name: 'idx_on_external_status_checks_project_id_name')
- t.index([:project_id, :external_url],
- unique: true,
- name: 'idx_on_external_status_checks_project_id_external_url')
- end
-
- create_table :external_status_checks_protected_branches do |t|
- t.bigint :external_status_check_id, null: false
- t.bigint :protected_branch_id, null: false
-
- t.index :external_status_check_id, name: 'index_esc_protected_branches_on_external_status_check_id'
- t.index :protected_branch_id, name: 'index_esc_protected_branches_on_protected_branch_id'
- end
- end
-
- def down
- with_lock_retries do
- drop_table :external_status_checks_protected_branches, force: :cascade, if_exists: true
- end
-
- with_lock_retries do
- drop_table :external_status_checks, force: :cascade, if_exists: true
- end
- end
-end
diff --git a/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb b/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb
deleted file mode 100644
index a12aef9455d..00000000000
--- a/db/migrate/20210604085600_rename_status_check_responses_approval_rule.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-class RenameStatusCheckResponsesApprovalRule < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- execute('DELETE FROM status_check_responses')
-
- unless column_exists?(:status_check_responses, :external_status_check_id)
- add_column :status_check_responses, :external_status_check_id, :bigint, null: false # rubocop:disable Rails/NotNullColumn
- end
-
- add_concurrent_foreign_key :status_check_responses, :external_status_checks, column: :external_status_check_id, on_delete: :cascade
- add_concurrent_foreign_key :status_check_responses, :merge_requests, column: :merge_request_id, on_delete: :cascade
-
- add_concurrent_index :status_check_responses, :external_status_check_id
-
- # Setting this to true so that we can remove the column in a future release once the column has been removed. It has been ignored in 14.0
- change_column_null :status_check_responses, :external_approval_rule_id, true
-
- with_lock_retries do
- remove_foreign_key :status_check_responses, :external_approval_rules
- end
- end
-
- def down
- change_column_null :status_check_responses, :external_approval_rule_id, false
- with_lock_retries do
- add_foreign_key :status_check_responses, :external_approval_rules
- end
- remove_column :status_check_responses, :external_status_check_id
- end
-end
diff --git a/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb b/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb
deleted file mode 100644
index 41c543e5deb..00000000000
--- a/db/migrate/20210607050531_add_text_limit_to_user_details_pronouns.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserDetailsPronouns < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_details, :pronouns, 50
- end
-
- def down
- remove_text_limit :user_details, :pronouns
- end
-end
diff --git a/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb b/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb
deleted file mode 100644
index 5357059f475..00000000000
--- a/db/migrate/20210607080044_remove_temporary_index_on_security_findings_scan_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTemporaryIndexOnSecurityFindingsScanId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'tmp_index_on_security_findings_scan_id'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :security_findings, INDEX_NAME
- end
-
- def down
- add_concurrent_index :security_findings, :scan_id, where: 'uuid is null', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb b/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb
deleted file mode 100644
index 20b9e8d95ee..00000000000
--- a/db/migrate/20210607154719_add_job_token_scope_enabled_to_ci_cd_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddJobTokenScopeEnabledToCiCdSettings < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- end
- end
-end
diff --git a/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb b/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb
deleted file mode 100644
index 490a7f2e960..00000000000
--- a/db/migrate/20210608072312_initialize_conversion_of_ci_stages_to_bigint.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class InitializeConversionOfCiStagesToBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_stages
- COLUMNS = %i(id)
-
- def up
- initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-
- def down
- revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb b/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb
deleted file mode 100644
index 4a52600d4c7..00000000000
--- a/db/migrate/20210608072346_backfill_ci_stages_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCiStagesForBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = :ci_stages
- COLUMNS = %i(id)
-
- def up
- backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-
- def down
- revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
- end
-end
diff --git a/db/migrate/20210608103230_add_issue_id_to_test_report.rb b/db/migrate/20210608103230_add_issue_id_to_test_report.rb
deleted file mode 100644
index f4e723d0af8..00000000000
--- a/db/migrate/20210608103230_add_issue_id_to_test_report.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIdToTestReport < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :requirements_management_test_reports, :issue_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :requirements_management_test_reports, :issue_id
- end
- end
-end
diff --git a/db/migrate/20210608103235_add_issue_index_to_test_report.rb b/db/migrate/20210608103235_add_issue_index_to_test_report.rb
deleted file mode 100644
index 41f1970b2a9..00000000000
--- a/db/migrate/20210608103235_add_issue_index_to_test_report.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIndexToTestReport < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_requirements_management_test_reports_on_issue_id'
-
- def up
- add_concurrent_index :requirements_management_test_reports, :issue_id, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :requirements_management_test_reports, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210608110752_change_column_null_test_report_requirement.rb b/db/migrate/20210608110752_change_column_null_test_report_requirement.rb
deleted file mode 100644
index 44a614a34ce..00000000000
--- a/db/migrate/20210608110752_change_column_null_test_report_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeColumnNullTestReportRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TARGET_TABLE = :requirements_management_test_reports
-
- def up
- with_lock_retries do
- change_column_null TARGET_TABLE, :requirement_id, true
- end
- end
-
- def down
- # no-op as it's difficult to revert
- end
-end
diff --git a/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb b/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb
deleted file mode 100644
index e256bce6ae0..00000000000
--- a/db/migrate/20210608110760_add_requirement_test_reports_foreign_key.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequirementTestReportsForeignKey < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_TABLE = :requirements_management_test_reports
- CONSTRAINT_NAME = 'requirements_test_reports_requirement_id_xor_issue_id'
-
- def up
- add_concurrent_foreign_key TARGET_TABLE, :issues, column: :issue_id
-
- add_check_constraint(TARGET_TABLE, 'num_nonnulls(requirement_id, issue_id) = 1', CONSTRAINT_NAME)
- end
-
- def down
- remove_check_constraint TARGET_TABLE, CONSTRAINT_NAME
-
- with_lock_retries do
- remove_foreign_key_if_exists(TARGET_TABLE, column: :issue_id)
- end
- end
-end
diff --git a/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb b/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb
deleted file mode 100644
index 28214aedce6..00000000000
--- a/db/migrate/20210609013512_add_unique_index_for_batched_background_migrations.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexForBatchedBackgroundMigrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = :batched_background_migrations
- INDEX_NAME = 'index_batched_background_migrations_on_unique_configuration'
- REDUNDANT_INDEX_NAME = 'index_batched_migrations_on_job_table_and_column_name'
-
- def up
- add_concurrent_index TABLE_NAME,
- %i[job_class_name table_name column_name job_arguments],
- unique: true,
- name: INDEX_NAME
-
- remove_concurrent_index_by_name TABLE_NAME, REDUNDANT_INDEX_NAME
- end
-
- def down
- add_concurrent_index TABLE_NAME,
- %i[job_class_name table_name column_name],
- name: REDUNDANT_INDEX_NAME
-
- remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb b/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb
deleted file mode 100644
index 406bbe2095f..00000000000
--- a/db/migrate/20210609090856_add_expiry_id_ssh_key_notification_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddExpiryIdSshKeyNotificationIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_keys_on_expires_at_and_id'
-
- def up
- add_concurrent_index :keys,
- "date(timezone('UTC', expires_at)), id",
- where: 'expiry_notification_delivered_at IS NULL',
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :keys, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb b/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb
deleted file mode 100644
index 461d5838aed..00000000000
--- a/db/migrate/20210609192728_add_status_check_foreign_key_to_external_status_check_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusCheckForeignKeyToExternalStatusCheckId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_status_checks_protected_branches, :external_status_checks, column: :external_status_check_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_status_checks_protected_branches, column: :external_status_check_id
- end
- end
-end
diff --git a/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb b/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb
deleted file mode 100644
index 6eeee60ec3a..00000000000
--- a/db/migrate/20210609193101_add_status_check_foreign_key_to_protected_branch_id.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusCheckForeignKeyToProtectedBranchId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :external_status_checks_protected_branches, :protected_branches, column: :protected_branch_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :external_status_checks_protected_branches, column: :protected_branch_id
- end
- end
-end
diff --git a/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb b/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb
deleted file mode 100644
index 026fa0d7043..00000000000
--- a/db/migrate/20210610102410_add_protected_attribute_to_pending_builds.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddProtectedAttributeToPendingBuilds < ActiveRecord::Migration[6.1]
- def change
- add_column :ci_pending_builds, :protected, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb b/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb
deleted file mode 100644
index f0bcbe5e472..00000000000
--- a/db/migrate/20210610153556_delete_legacy_operations_feature_flags.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class DeleteLegacyOperationsFeatureFlags < ActiveRecord::Migration[6.1]
- LEGACY_FEATURE_FLAG_VERSION = 1
-
- def up
- execute("DELETE FROM operations_feature_flags WHERE version = #{LEGACY_FEATURE_FLAG_VERSION}")
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb b/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb
deleted file mode 100644
index ef2177fa9ce..00000000000
--- a/db/migrate/20210611082822_add_pages_file_entries_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddPagesFileEntriesToPlanLimits < ActiveRecord::Migration[6.1]
- def change
- add_column(:plan_limits, :pages_file_entries, :integer, default: 200_000, null: false)
- end
-end
diff --git a/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb b/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb
deleted file mode 100644
index ecd8bac22be..00000000000
--- a/db/migrate/20210611100359_rebuild_index_for_cadence_iterations_automation.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-# frozen_string_literal: true
-
-class RebuildIndexForCadenceIterationsAutomation < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'cadence_create_iterations_automation'
-
- disable_ddl_transaction!
-
- def up
- return if index_exists_and_is_valid?
-
- remove_concurrent_index_by_name :iterations_cadences, INDEX_NAME
-
- disable_statement_timeout do
- execute(
- <<-SQL
- CREATE INDEX CONCURRENTLY #{INDEX_NAME} ON iterations_cadences
- USING BTREE(automatic, duration_in_weeks, (DATE ((COALESCE("iterations_cadences"."last_run_date", DATE('01-01-1970')) + "iterations_cadences"."duration_in_weeks" * INTERVAL '1 week'))))
- WHERE duration_in_weeks IS NOT NULL
- SQL
- )
- end
- end
-
- def down
- remove_concurrent_index_by_name :iterations_cadences, INDEX_NAME
- end
-
- def index_exists_and_is_valid?
- execute(
- <<-SQL
- SELECT identifier
- FROM postgres_indexes
- WHERE identifier LIKE '%#{INDEX_NAME}' AND valid_index=TRUE
- SQL
- ).any?
- end
-end
diff --git a/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb b/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb
deleted file mode 100644
index 0a9eb64a5fc..00000000000
--- a/db/migrate/20210611101034_add_devops_adoption_sast_dast.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSastDast < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :sast_enabled_count, :integer
- add_column :analytics_devops_adoption_snapshots, :dast_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb b/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb
deleted file mode 100644
index cc37c5f1020..00000000000
--- a/db/migrate/20210614131002_add_detection_method_to_vulnerabilities_finding.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddDetectionMethodToVulnerabilitiesFinding < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerability_occurrences, :detection_method, :smallint, null: false, default: 0
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerability_occurrences, :detection_method
- end
- end
-end
diff --git a/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb b/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb
deleted file mode 100644
index 248fff6c42f..00000000000
--- a/db/migrate/20210614142311_add_running_container_scanning_max_size_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRunningContainerScanningMaxSizeToPlanLimits < ActiveRecord::Migration[6.0]
- def change
- add_column :plan_limits, :ci_max_artifact_size_running_container_scanning, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb b/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb
deleted file mode 100644
index e6b7ba7616d..00000000000
--- a/db/migrate/20210614143954_add_unique_index_for_helm_packages.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexForHelmPackages < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_helm'
- PACKAGE_TYPE_HELM = 11
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, where: "package_type = #{PACKAGE_TYPE_HELM}", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :packages_packages, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210615064342_add_issue_id_to_requirement.rb b/db/migrate/20210615064342_add_issue_id_to_requirement.rb
deleted file mode 100644
index a6d85bd9d6e..00000000000
--- a/db/migrate/20210615064342_add_issue_id_to_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIdToRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :requirements, :issue_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :requirements, :issue_id
- end
- end
-end
diff --git a/db/migrate/20210616110748_add_issue_index_to_requirement.rb b/db/migrate/20210616110748_add_issue_index_to_requirement.rb
deleted file mode 100644
index 747ee3875dc..00000000000
--- a/db/migrate/20210616110748_add_issue_index_to_requirement.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueIndexToRequirement < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_requirements_on_issue_id'
-
- def up
- add_concurrent_index :requirements, :issue_id, name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :requirements, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb b/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb
deleted file mode 100644
index ed851da9f31..00000000000
--- a/db/migrate/20210616111311_add_issue_requirement_foreign_key.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddIssueRequirementForeignKey < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_TABLE = :requirements
-
- def up
- add_concurrent_foreign_key TARGET_TABLE, :issues, column: :issue_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists(TARGET_TABLE, column: :issue_id)
- end
- end
-end
diff --git a/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb b/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb
deleted file mode 100644
index 7086b20c48f..00000000000
--- a/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimestampToSchemaMigration < ActiveRecord::Migration[6.1]
- def up
- # Add a nullable column with default null first
- add_column :schema_migrations, :finished_at, :timestamptz
-
- # Change default to NOW() for new records
- change_column_default :schema_migrations, :finished_at, -> { 'NOW()' }
- end
-
- def down
- remove_column :schema_migrations, :finished_at
- end
-end
diff --git a/db/migrate/20210616154808_remove_ci_build_protected_index.rb b/db/migrate/20210616154808_remove_ci_build_protected_index.rb
deleted file mode 100644
index 25a8d159c1e..00000000000
--- a/db/migrate/20210616154808_remove_ci_build_protected_index.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCiBuildProtectedIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- INDEX_NAME = 'index_ci_builds_on_protected'
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index :ci_builds, :protected, name: INDEX_NAME
- end
-
- def down
- add_concurrent_index :ci_builds, :protected, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb b/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb
deleted file mode 100644
index 8447ff79d12..00000000000
--- a/db/migrate/20210616185947_add_mailgun_settings_to_application_setting.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddMailgunSettingsToApplicationSetting < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :encrypted_mailgun_signing_key, :binary
- add_column :application_settings, :encrypted_mailgun_signing_key_iv, :binary
-
- add_column :application_settings, :mailgun_events_enabled, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb b/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb
deleted file mode 100644
index 32249c9ed56..00000000000
--- a/db/migrate/20210617022324_create_incident_management_pending_alert_escalations.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementPendingAlertEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- execute(<<~SQL)
-
- CREATE TABLE incident_management_pending_alert_escalations (
- id bigserial NOT NULL,
- rule_id bigint,
- alert_id bigint NOT NULL,
- schedule_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- status smallint NOT NULL,
- PRIMARY KEY (id, process_at)
- ) PARTITION BY RANGE (process_at);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id
- ON incident_management_pending_alert_escalations USING btree (alert_id);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id
- ON incident_management_pending_alert_escalations USING btree (rule_id);
-
- CREATE INDEX index_incident_management_pending_alert_escalations_on_schedule_id
- ON incident_management_pending_alert_escalations USING btree (schedule_id);
-
- ALTER TABLE incident_management_pending_alert_escalations ADD CONSTRAINT fk_rails_fcbfd9338b
- FOREIGN KEY (schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE;
-
- ALTER TABLE incident_management_pending_alert_escalations ADD CONSTRAINT fk_rails_057c1e3d87
- FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE SET NULL;
-
- ALTER TABLE incident_management_pending_alert_escalations ADD CONSTRAINT fk_rails_8d8de95da9
- FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE;
- SQL
- end
- end
-
- def down
- with_lock_retries do
- drop_table :incident_management_pending_alert_escalations
- end
- end
-end
diff --git a/db/migrate/20210617161348_cascade_delete_freeze_periods.rb b/db/migrate/20210617161348_cascade_delete_freeze_periods.rb
deleted file mode 100644
index 90623b27920..00000000000
--- a/db/migrate/20210617161348_cascade_delete_freeze_periods.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class CascadeDeleteFreezePeriods < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- OLD_PROJECT_FK = 'fk_rails_2e02bbd1a6'
- NEW_PROJECT_FK = 'fk_2e02bbd1a6'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :ci_freeze_periods, :projects, column: :project_id, on_delete: :cascade, name: NEW_PROJECT_FK
- remove_foreign_key_if_exists :ci_freeze_periods, :projects, column: :project_id, name: OLD_PROJECT_FK
- end
-
- def down
- add_concurrent_foreign_key :ci_freeze_periods, :projects, column: :project_id, on_delete: nil, name: OLD_PROJECT_FK
- remove_foreign_key_if_exists :ci_freeze_periods, :projects, column: :project_id, name: NEW_PROJECT_FK
- end
-end
diff --git a/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb b/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb
deleted file mode 100644
index 9eebc6feb14..00000000000
--- a/db/migrate/20210617180131_migrate_usage_ping_sidekiq_queue.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateUsagePingSidekiqQueue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/SidekiqQueueMigrate
- def up
- sidekiq_queue_migrate 'cronjob:gitlab_usage_ping', to: 'cronjob:gitlab_service_ping'
- end
-
- def down
- sidekiq_queue_migrate 'cronjob:gitlab_service_ping', to: 'cronjob:gitlab_usage_ping'
- end
- # rubocop:enable Migration/SidekiqQueueMigrate
-end
diff --git a/db/migrate/20210621043337_rename_services_to_integrations.rb b/db/migrate/20210621043337_rename_services_to_integrations.rb
deleted file mode 100644
index 845c3c01a2a..00000000000
--- a/db/migrate/20210621043337_rename_services_to_integrations.rb
+++ /dev/null
@@ -1,151 +0,0 @@
-# frozen_string_literal: true
-
-class RenameServicesToIntegrations < Gitlab::Database::Migration[1.0]
- include Gitlab::Database::SchemaHelpers
-
- enable_lock_retries!
-
- # Function and trigger names match those migrated in:
- # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49916
- # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51852
-
- WIKI_FUNCTION_NAME = 'set_has_external_wiki'
- TRACKER_FUNCTION_NAME = 'set_has_external_issue_tracker'
-
- WIKI_TRIGGER_ON_INSERT_NAME = 'trigger_has_external_wiki_on_insert'
- WIKI_TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_wiki_on_update'
- WIKI_TRIGGER_ON_DELETE_NAME = 'trigger_has_external_wiki_on_delete'
-
- TRACKER_TRIGGER_ON_INSERT_NAME = 'trigger_has_external_issue_tracker_on_insert'
- TRACKER_TRIGGER_ON_UPDATE_NAME = 'trigger_has_external_issue_tracker_on_update'
- TRACKER_TRIGGER_ON_DELETE_NAME = 'trigger_has_external_issue_tracker_on_delete'
-
- ALL_TRIGGERS = [
- WIKI_TRIGGER_ON_INSERT_NAME,
- WIKI_TRIGGER_ON_UPDATE_NAME,
- WIKI_TRIGGER_ON_DELETE_NAME,
- TRACKER_TRIGGER_ON_INSERT_NAME,
- TRACKER_TRIGGER_ON_UPDATE_NAME,
- TRACKER_TRIGGER_ON_DELETE_NAME
- ].freeze
-
- def up
- execute('LOCK services IN ACCESS EXCLUSIVE MODE')
-
- drop_all_triggers(:services)
-
- rename_table_safely(:services, :integrations)
-
- recreate_all_triggers(:integrations)
- end
-
- def down
- execute('LOCK integrations IN ACCESS EXCLUSIVE MODE')
-
- drop_all_triggers(:integrations)
-
- undo_rename_table_safely(:services, :integrations)
-
- recreate_all_triggers(:services)
- end
-
- private
-
- def drop_all_triggers(table_name)
- ALL_TRIGGERS.each do |trigger_name|
- drop_trigger(table_name, trigger_name)
- end
- end
-
- def recreate_all_triggers(table_name)
- wiki_create_insert_trigger(table_name)
- wiki_create_update_trigger(table_name)
- wiki_create_delete_trigger(table_name)
-
- tracker_replace_trigger_function(table_name)
-
- tracker_create_insert_trigger(table_name)
- tracker_create_update_trigger(table_name)
- tracker_create_delete_trigger(table_name)
- end
-
- def wiki_create_insert_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.active = TRUE AND NEW.type = 'ExternalWikiService' AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- def wiki_create_update_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.type = 'ExternalWikiService' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- def wiki_create_delete_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{WIKI_TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON #{table_name}
- FOR EACH ROW
- WHEN (OLD.type = 'ExternalWikiService' AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{WIKI_FUNCTION_NAME}();
- SQL
- end
-
- # Using `replace: true` to rewrite the existing function
- def tracker_replace_trigger_function(table_name)
- create_trigger_function(TRACKER_FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE projects SET has_external_issue_tracker = (
- EXISTS
- (
- SELECT 1
- FROM #{table_name}
- WHERE project_id = COALESCE(NEW.project_id, OLD.project_id)
- AND active = TRUE
- AND category = 'issue_tracker'
- )
- )
- WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id);
- RETURN NULL;
- SQL
- end
- end
-
- def tracker_create_insert_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND NEW.active = TRUE AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-
- def tracker_create_update_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_UPDATE_NAME}
- AFTER UPDATE ON #{table_name}
- FOR EACH ROW
- WHEN (NEW.category = 'issue_tracker' AND OLD.active != NEW.active AND NEW.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-
- def tracker_create_delete_trigger(table_name)
- execute(<<~SQL)
- CREATE TRIGGER #{TRACKER_TRIGGER_ON_DELETE_NAME}
- AFTER DELETE ON #{table_name}
- FOR EACH ROW
- WHEN (OLD.category = 'issue_tracker' AND OLD.active = TRUE AND OLD.project_id IS NOT NULL)
- EXECUTE FUNCTION #{TRACKER_FUNCTION_NAME}();
- SQL
- end
-end
diff --git a/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb b/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb
deleted file mode 100644
index 9dba663f6a7..00000000000
--- a/db/migrate/20210621044000_rename_services_indexes_to_integrations.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class RenameServicesIndexesToIntegrations < ActiveRecord::Migration[6.1]
- INDEXES = %w(
- project_and_type_where_inherit_null
- project_id_and_type_unique
- template
- type
- type_and_instance_partial
- type_and_template_partial
- type_id_when_active_and_project_id_not_null
- unique_group_id_and_type
- ).freeze
-
- def up
- INDEXES.each do |index|
- execute(<<~SQL)
- ALTER INDEX IF EXISTS "index_services_on_#{index}" RENAME TO "index_integrations_on_#{index}"
- SQL
- end
- end
-
- def down
- INDEXES.each do |index|
- execute(<<~SQL)
- ALTER INDEX IF EXISTS "index_integrations_on_#{index}" RENAME TO "index_services_on_#{index}"
- SQL
- end
- end
-end
diff --git a/db/migrate/20210621084632_add_summary_to_timelogs.rb b/db/migrate/20210621084632_add_summary_to_timelogs.rb
deleted file mode 100644
index 45fd7f1e0bc..00000000000
--- a/db/migrate/20210621084632_add_summary_to_timelogs.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddSummaryToTimelogs < ActiveRecord::Migration[6.1]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210621090030_add_text_limit_to_timelogs_summary
- def change
- add_column :timelogs, :summary, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb b/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb
deleted file mode 100644
index ac872afd3fa..00000000000
--- a/db/migrate/20210621090030_add_text_limit_to_timelogs_summary.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToTimelogsSummary < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :timelogs, :summary, 255
- end
-
- def down
- remove_text_limit :timelogs, :summary
- end
-end
diff --git a/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb b/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb
deleted file mode 100644
index ae19a46b66f..00000000000
--- a/db/migrate/20210621091830_add_devops_adoption_snapshot_dependency_scanning.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotDependencyScanning < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :dependency_scanning_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb b/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb
deleted file mode 100644
index 03991cea41c..00000000000
--- a/db/migrate/20210622135221_add_foreign_key_for_environment_id_to_environments.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyForEnvironmentIdToEnvironments < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- # `validate: false` option is passed here, because validating the existing rows fails by the orphaned deployments,
- # which will be cleaned up in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64588.
- # The validation runs for only new records or updates, so that we can at least
- # stop creating orphaned rows.
- add_concurrent_foreign_key :deployments, :environments, column: :environment_id, on_delete: :cascade, validate: false
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :deployments, :environments
- end
- end
-end
diff --git a/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb b/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb
deleted file mode 100644
index 7a70f695039..00000000000
--- a/db/migrate/20210623074226_add_usage_ping_features_enabled_to_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddUsagePingFeaturesEnabledToApplicationSettings < ActiveRecord::Migration[6.1]
- def up
- add_column :application_settings, :usage_ping_features_enabled, :boolean, default: false, null: false
- end
-
- def down
- remove_column :application_settings, :usage_ping_features_enabled
- end
-end
diff --git a/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb b/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb
deleted file mode 100644
index d528c4c6967..00000000000
--- a/db/migrate/20210623123722_add_present_on_default_branch_to_vulnerabilities.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPresentOnDefaultBranchToVulnerabilities < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerabilities, :present_on_default_branch, :boolean, default: true, null: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerabilities, :present_on_default_branch
- end
- end
-end
diff --git a/db/migrate/20210623133635_create_error_tracking_errors.rb b/db/migrate/20210623133635_create_error_tracking_errors.rb
deleted file mode 100644
index e26fbe8df86..00000000000
--- a/db/migrate/20210623133635_create_error_tracking_errors.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingErrors < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_errors do |t|
- t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade }
- t.text :name, null: false
- t.text :description, null: false
- t.text :actor, null: false
- t.datetime_with_timezone :first_seen_at, null: false, default: -> { 'NOW()' }
- t.datetime_with_timezone :last_seen_at, null: false, default: -> { 'NOW()' }
- t.text :platform
-
- t.text_limit :name, 255
- t.text_limit :description, 1024
- t.text_limit :actor, 255
- t.text_limit :platform, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_errors
- end
-end
diff --git a/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb b/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
deleted file mode 100644
index 81903230f43..00000000000
--- a/db/migrate/20210623163342_add_index_to_compliance_management_frameworks_pipeline_configuration.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToComplianceManagementFrameworksPipelineConfiguration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_compliance_frameworks_id_where_frameworks_not_null'
-
- def up
- add_concurrent_index :compliance_management_frameworks, :id, name: INDEX_NAME, where: 'pipeline_configuration_full_path IS NOT NULL'
- end
-
- def down
- remove_concurrent_index_by_name :compliance_management_frameworks, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb b/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb
deleted file mode 100644
index 6ca040dbfbc..00000000000
--- a/db/migrate/20210624112821_add_devops_adoption_coverage_fuzzing.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionCoverageFuzzing < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :coverage_fuzzing_enabled_count, :integer
- end
-end
diff --git a/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb b/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb
deleted file mode 100644
index 085fccdc20f..00000000000
--- a/db/migrate/20210624180613_add_last_synced_at_to_licenses.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddLastSyncedAtToLicenses < ActiveRecord::Migration[6.1]
- def change
- add_column :licenses, :last_synced_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210625094554_create_error_tracking_error_events.rb b/db/migrate/20210625094554_create_error_tracking_error_events.rb
deleted file mode 100644
index c1ed6d6ce6e..00000000000
--- a/db/migrate/20210625094554_create_error_tracking_error_events.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingErrorEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_error_events do |t|
- t.references :error,
- index: true,
- null: false,
- foreign_key: { on_delete: :cascade, to_table: :error_tracking_errors }
-
- t.text :description, null: false
- t.text :environment
- t.text :level
- t.datetime_with_timezone :occurred_at, null: false
- t.jsonb :payload, null: false, default: {}
-
- t.text_limit :description, 255
- t.text_limit :environment, 255
- t.text_limit :level, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_error_events
- end
-end
diff --git a/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb b/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb
deleted file mode 100644
index 322e6991d0b..00000000000
--- a/db/migrate/20210627204936_add_plan_limits_max_size_cluster_image_scanning_column.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddPlanLimitsMaxSizeClusterImageScanningColumn < ActiveRecord::Migration[6.0]
- def change
- add_column :plan_limits, :ci_max_artifact_size_cluster_image_scanning, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210628154900_create_detached_partitions_table.rb b/db/migrate/20210628154900_create_detached_partitions_table.rb
deleted file mode 100644
index cf31d71835a..00000000000
--- a/db/migrate/20210628154900_create_detached_partitions_table.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDetachedPartitionsTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :detached_partitions do |t|
- t.timestamps_with_timezone null: false
- t.datetime_with_timezone :drop_after, null: false
- t.text :table_name, null: false
-
- # Postgres identifier names can be up to 63 bytes
- # See https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS
- t.text_limit :table_name, 63
- end
- end
-
- def down
- with_lock_retries do
- drop_table :detached_partitions
- end
- end
-end
diff --git a/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb b/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb
deleted file mode 100644
index 14b6b9efad3..00000000000
--- a/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AssociateExistingDastBuildsWithVariables < ActiveRecord::Migration[6.1]
- def up
- # no-op: Must have run before %"15.X" as it is not compatible with decomposed CI database
- end
-
- def down
- # No-op
- end
-end
diff --git a/db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb b/db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb
deleted file mode 100644
index c84a42cbea4..00000000000
--- a/db/migrate/20210629153519_add_index_to_bulk_import_entities_on_bulk_import_id_and_status.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToBulkImportEntitiesOnBulkImportIdAndStatus < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NEW_INDEX_NAME = 'index_bulk_import_entities_on_bulk_import_id_and_status'
- OLD_INDEX_NAME = 'index_bulk_import_entities_on_bulk_import_id'
-
- def up
- add_concurrent_index :bulk_import_entities, [:bulk_import_id, :status], name: NEW_INDEX_NAME
- remove_concurrent_index_by_name :bulk_import_entities, name: OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index :bulk_import_entities, :bulk_import_id, name: OLD_INDEX_NAME
- remove_concurrent_index_by_name :bulk_import_entities, name: NEW_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210630144339_add_invite_email_success_to_members.rb b/db/migrate/20210630144339_add_invite_email_success_to_members.rb
deleted file mode 100644
index 6c341ecb3f3..00000000000
--- a/db/migrate/20210630144339_add_invite_email_success_to_members.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddInviteEmailSuccessToMembers < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb b/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb
deleted file mode 100644
index 5df0f84ab78..00000000000
--- a/db/migrate/20210630222522_add_customers_dot_jwt_signing_key_to_application_settings.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddCustomersDotJwtSigningKeyToApplicationSettings < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :encrypted_customers_dot_jwt_signing_key, :binary
- add_column :application_settings, :encrypted_customers_dot_jwt_signing_key_iv, :binary
- end
-end
diff --git a/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb b/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb
deleted file mode 100644
index 703b2c7d0b8..00000000000
--- a/db/migrate/20210630224625_generate_customers_dot_jwt_signing_key.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class GenerateCustomersDotJwtSigningKey < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = 'application_settings'
-
- attr_encrypted :customers_dot_jwt_signing_key, {
- mode: :per_attribute_iv,
- key: Gitlab::Utils.ensure_utf8_size(Rails.application.secrets.db_key_base, bytes: 32.bytes),
- algorithm: 'aes-256-gcm',
- encode: true
- }
- end
-
- def up
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.find_each do |application_setting|
- application_setting.update(customers_dot_jwt_signing_key: OpenSSL::PKey::RSA.new(2048).to_pem)
- end
- end
-
- def down
- ApplicationSetting.reset_column_information
-
- ApplicationSetting.find_each do |application_setting|
- application_setting.update_columns(encrypted_customers_dot_jwt_signing_key: nil, encrypted_customers_dot_jwt_signing_key_iv: nil)
- end
- end
-end
diff --git a/db/migrate/20210701111627_add_upvotes_count_to_issues.rb b/db/migrate/20210701111627_add_upvotes_count_to_issues.rb
deleted file mode 100644
index beefb186f37..00000000000
--- a/db/migrate/20210701111627_add_upvotes_count_to_issues.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpvotesCountToIssues < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :issues, :upvotes_count, :integer, default: 0, null: false
- end
- end
-
- def down
- remove_column :issues, :upvotes_count
- end
-end
diff --git a/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb b/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb
deleted file mode 100644
index 561c98c449c..00000000000
--- a/db/migrate/20210702124842_add_ci_job_trace_size_to_plan_limits.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddCiJobTraceSizeToPlanLimits < ActiveRecord::Migration[6.1]
- def change
- add_column(:plan_limits, :ci_jobs_trace_size_limit, :integer, default: 100, null: false)
- end
-end
diff --git a/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb b/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb
deleted file mode 100644
index e54d762fa75..00000000000
--- a/db/migrate/20210705124128_add_project_settings_previous_default_branch.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectSettingsPreviousDefaultBranch < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210707173645_add_project_settings_previous_default_branch_text_limit
- def up
- with_lock_retries do
- add_column :project_settings, :previous_default_branch, :text
- end
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-
- def down
- with_lock_retries do
- remove_column :project_settings, :previous_default_branch
- end
- end
-end
diff --git a/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb b/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb
deleted file mode 100644
index a6983c2d599..00000000000
--- a/db/migrate/20210705130919_create_container_repos_on_exp_cleanup_status_project_id_start_date_index.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class CreateContainerReposOnExpCleanupStatusProjectIdStartDateIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- OLD_INDEX_NAME = 'idx_container_repositories_on_exp_cleanup_status_and_start_date'
- NEW_INDEX_NAME = 'idx_container_repos_on_exp_cleanup_status_project_id_start_date'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :project_id, :expiration_policy_started_at], name: NEW_INDEX_NAME)
- remove_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :expiration_policy_started_at], name: OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :expiration_policy_started_at], name: OLD_INDEX_NAME)
- remove_concurrent_index(:container_repositories, [:expiration_policy_cleanup_status, :project_id, :expiration_policy_started_at], name: NEW_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb b/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb
deleted file mode 100644
index 7f736bf2b87..00000000000
--- a/db/migrate/20210705132928_add_new_user_signups_cap_to_namespace_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddNewUserSignupsCapToNamespaceSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :namespace_settings, :new_user_signups_cap, :integer, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_settings, :new_user_signups_cap
- end
- end
-end
diff --git a/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb b/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb
deleted file mode 100644
index ea612100e5a..00000000000
--- a/db/migrate/20210705142714_initialize_conversion_of_ci_builds_metadata_id_to_bigint.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class InitializeConversionOfCiBuildsMetadataIdToBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_builds_metadata
- COLUMN = :id
-
- def up
- initialize_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
-
- def down
- revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN)
- end
-end
diff --git a/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb b/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb
deleted file mode 100644
index b362fd930a3..00000000000
--- a/db/migrate/20210705144657_add_instance_runners_enabled_to_ci_pending_build.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddInstanceRunnersEnabledToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :ci_pending_builds, :instance_runners_enabled, :boolean, null: false, default: false
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_pending_builds, :instance_runners_enabled
- end
- end
-end
diff --git a/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb b/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb
deleted file mode 100644
index 26727b7ad7d..00000000000
--- a/db/migrate/20210706084713_add_devops_adoption_snapshots_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSnapshotsIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_analytics_devops_adoption_snapshots_finalized'
-
- def up
- add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :end_time], where: "recorded_at >= end_time", name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb b/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb
deleted file mode 100644
index 866b16a6bb9..00000000000
--- a/db/migrate/20210706151154_add_remaining_ci_minutes_to_ci_pending_build.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddRemainingCiMinutesToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column(:ci_pending_builds, :namespace_id, :bigint)
- add_column(:ci_pending_builds, :minutes_exceeded, :boolean, null: false, default: false)
- end
- end
-
- def down
- with_lock_retries do
- remove_column(:ci_pending_builds, :minutes_exceeded)
- remove_column(:ci_pending_builds, :namespace_id)
- end
- end
-end
diff --git a/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb b/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb
deleted file mode 100644
index 2a04850d905..00000000000
--- a/db/migrate/20210706151446_add_namespace_foreign_key_to_ci_pending_build.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddNamespaceForeignKeyToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
- INDEX_NAME = 'index_ci_pending_builds_on_namespace_id'
-
- def up
- add_concurrent_index(:ci_pending_builds, :namespace_id, name: INDEX_NAME)
- add_concurrent_foreign_key(:ci_pending_builds, :namespaces, column: :namespace_id, on_delete: :cascade)
- end
-
- def down
- remove_foreign_key_if_exists(:ci_pending_builds, column: :namespace_id)
- remove_concurrent_index_by_name(:ci_pending_builds, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb b/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb
deleted file mode 100644
index a2a3d74cd49..00000000000
--- a/db/migrate/20210706152139_add_index_type_to_postgres_indexes_view.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexTypeToPostgresIndexesView < ActiveRecord::Migration[6.1]
- def up
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_indexes;
-
- CREATE VIEW postgres_indexes AS
- SELECT (pg_namespace.nspname::text || '.'::text) || i.relname::text AS identifier,
- pg_index.indexrelid,
- pg_namespace.nspname AS schema,
- i.relname AS name,
- pg_indexes.tablename,
- a.amname AS type,
- pg_index.indisunique AS "unique",
- pg_index.indisvalid AS valid_index,
- i.relispartition AS partitioned,
- pg_index.indisexclusion AS exclusion,
- pg_index.indexprs IS NOT NULL AS expression,
- pg_index.indpred IS NOT NULL AS partial,
- pg_indexes.indexdef AS definition,
- pg_relation_size(i.oid::regclass) AS ondisk_size_bytes
- FROM pg_index
- JOIN pg_class i ON i.oid = pg_index.indexrelid
- JOIN pg_namespace ON i.relnamespace = pg_namespace.oid
- JOIN pg_indexes ON i.relname = pg_indexes.indexname
- JOIN pg_am a ON i.relam = a.oid
- WHERE pg_namespace.nspname <> 'pg_catalog'::name AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name]));
- SQL
- end
-
- def down
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_indexes;
-
- CREATE VIEW postgres_indexes AS
- SELECT (((pg_namespace.nspname)::text || '.'::text) || (pg_class.relname)::text) AS identifier,
- pg_index.indexrelid,
- pg_namespace.nspname AS schema,
- pg_class.relname AS name,
- pg_indexes.tablename,
- pg_index.indisunique AS "unique",
- pg_index.indisvalid AS valid_index,
- pg_class.relispartition AS partitioned,
- pg_index.indisexclusion AS exclusion,
- (pg_index.indexprs IS NOT NULL) AS expression,
- (pg_index.indpred IS NOT NULL) AS partial,
- pg_indexes.indexdef AS definition,
- pg_relation_size((pg_class.oid)::regclass) AS ondisk_size_bytes
- FROM (((pg_index
- JOIN pg_class ON ((pg_class.oid = pg_index.indexrelid)))
- JOIN pg_namespace ON ((pg_class.relnamespace = pg_namespace.oid)))
- JOIN pg_indexes ON ((pg_class.relname = pg_indexes.indexname)))
- WHERE ((pg_namespace.nspname <> 'pg_catalog'::name) AND (pg_namespace.nspname = ANY (ARRAY["current_schema"(), 'gitlab_partitions_dynamic'::name, 'gitlab_partitions_static'::name])));
- SQL
- end
-end
diff --git a/db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb b/db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb
deleted file mode 100644
index f78e37d645a..00000000000
--- a/db/migrate/20210706213537_add_premium_and_ultimate_plan_limits.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# frozen_string_literal: true
-
-class AddPremiumAndUltimatePlanLimits < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- class Plan < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- has_one :limits, class_name: 'PlanLimits'
- end
-
- class PlanLimits < ActiveRecord::Base
- self.inheritance_column = :_type_disabled
-
- belongs_to :plan
- end
-
- def copy_plan_limits(from_plan_name:, to_plan_name:)
- source_plan = Plan.find_by(name: from_plan_name)
- target_plan = Plan.find_by(name: to_plan_name)
- return unless source_plan && target_plan
- return unless source_plan.limits.present?
- return if target_plan.limits.present?
-
- limits = source_plan.limits.dup
- limits.plan = target_plan
- limits.save!
- end
-
- def up
- return unless Gitlab.com?
-
- copy_plan_limits(from_plan_name: 'gold', to_plan_name: 'ultimate')
- copy_plan_limits(from_plan_name: 'silver', to_plan_name: 'premium')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb b/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb
deleted file mode 100644
index 597e274cda2..00000000000
--- a/db/migrate/20210707095545_add_status_to_merge_request_cleanup_schedules.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToMergeRequestCleanupSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_merge_request_cleanup_schedules_on_status'
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:merge_request_cleanup_schedules, :status)
- add_column(:merge_request_cleanup_schedules, :status, :integer, limit: 2, default: 0, null: false)
- end
-
- add_concurrent_index(:merge_request_cleanup_schedules, :status, name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, INDEX_NAME)
-
- if column_exists?(:merge_request_cleanup_schedules, :status)
- remove_column(:merge_request_cleanup_schedules, :status)
- end
- end
-end
diff --git a/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb b/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb
deleted file mode 100644
index 229dc01fb87..00000000000
--- a/db/migrate/20210707113056_add_tags_array_to_ci_pending_builds.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTagsArrayToCiPendingBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :ci_pending_builds, :tag_ids, :integer, array: true, default: []
- end
- end
-
- def down
- with_lock_retries do
- remove_column :ci_pending_builds, :tag_ids
- end
- end
-end
diff --git a/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb b/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb
deleted file mode 100644
index 90bc6fb82bd..00000000000
--- a/db/migrate/20210707151536_create_vulnerability_finding_evidence_sources.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceSources < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_sources do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_sources_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :name
- t.text :url
-
- t.text_limit :name, 2048
- t.text_limit :url, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_sources
- end
- end
-end
diff --git a/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb b/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb
deleted file mode 100644
index c138af486c1..00000000000
--- a/db/migrate/20210707163659_add_vulnerability_events_to_integrations.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilityEventsToIntegrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :integrations, :vulnerability_events, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb b/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb
deleted file mode 100644
index 57c71e6bc17..00000000000
--- a/db/migrate/20210707171536_create_vulnerability_finding_evidence_assets.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceAssets < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_assets do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_assets_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :type
- t.text :name
- t.text :url
-
- t.text_limit :type, 2048
- t.text_limit :name, 2048
- t.text_limit :url, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_assets
- end
- end
-end
diff --git a/db/migrate/20210707171554_create_vulnerability_flags.rb b/db/migrate/20210707171554_create_vulnerability_flags.rb
deleted file mode 100644
index bf33963b08f..00000000000
--- a/db/migrate/20210707171554_create_vulnerability_flags.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFlags < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- FALSE_POSITIVE_ENUM_VALUE = 0
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_flags do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_occurrence, null: false, foreign_key: { on_delete: :cascade }
-
- t.integer :flag_type, limit: 2, null: false, default: FALSE_POSITIVE_ENUM_VALUE
-
- t.text :origin, null: false
- t.text :description, null: false
-
- t.text_limit :origin, 255
- t.text_limit :description, 1024
- end
- end
-
- def down
- drop_table :vulnerability_flags
- end
-end
diff --git a/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb b/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb
deleted file mode 100644
index a6a83b00234..00000000000
--- a/db/migrate/20210707173645_add_project_settings_previous_default_branch_text_limit.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectSettingsPreviousDefaultBranchTextLimit < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :project_settings, :previous_default_branch, 4096
- end
-
- def down
- remove_text_limit :project_settings, :previous_default_branch
- end
-end
diff --git a/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb b/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb
deleted file mode 100644
index b9fc822a5a3..00000000000
--- a/db/migrate/20210707181536_create_vulnerability_finding_evidence_supporting_messages.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateVulnerabilityFindingEvidenceSupportingMessages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :vulnerability_finding_evidence_supporting_messages do |t|
- t.timestamps_with_timezone null: false
-
- t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_supporting_messages_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade }
- t.text :name
-
- t.text_limit :name, 2048
- end
- end
-
- def down
- with_lock_retries do
- drop_table :vulnerability_finding_evidence_supporting_messages
- end
- end
-end
diff --git a/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb b/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb
deleted file mode 100644
index 70141f4844e..00000000000
--- a/db/migrate/20210708011425_rename_ci_builds_metadata_foreign_key.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class RenameCiBuildsMetadataForeignKey < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_metadata'
- OLD_PREFIX = 'fk_rails_'
-
- def up
- with_lock_retries(raise_on_exhaustion: true) do
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id, prefix: 'fk_rails_'),
- concurrent_foreign_key_name(TABLE_NAME, :build_id)
- )
- end
- end
-
- def down
- with_lock_retries(raise_on_exhaustion: true) do
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id),
- concurrent_foreign_key_name(TABLE_NAME, :build_id, prefix: 'fk_rails_')
- )
- end
- end
-end
diff --git a/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb b/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb
deleted file mode 100644
index f613856a18c..00000000000
--- a/db/migrate/20210708063032_add_failed_count_to_merge_request_cleanup_schedules.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddFailedCountToMergeRequestCleanupSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :merge_request_cleanup_schedules, :failed_count, :integer, default: 0, null: false
- end
-end
diff --git a/db/migrate/20210708124229_add_security_scans_created_at_index.rb b/db/migrate/20210708124229_add_security_scans_created_at_index.rb
deleted file mode 100644
index d2d1958f5b9..00000000000
--- a/db/migrate/20210708124229_add_security_scans_created_at_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddSecurityScansCreatedAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_security_scans_on_created_at'
-
- def up
- add_concurrent_index(:security_scans, :created_at, name: INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:security_scans, INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210708131048_add_error_tracking_counter_cache.rb b/db/migrate/20210708131048_add_error_tracking_counter_cache.rb
deleted file mode 100644
index 3bf7e1e3688..00000000000
--- a/db/migrate/20210708131048_add_error_tracking_counter_cache.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddErrorTrackingCounterCache < ActiveRecord::Migration[6.1]
- def up
- add_column :error_tracking_errors, :events_count, :bigint, null: false, default: 0
- end
-
- def down
- remove_column :error_tracking_errors, :events_count
- end
-end
diff --git a/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb b/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb
deleted file mode 100644
index 82abfeb57f9..00000000000
--- a/db/migrate/20210708134446_remove_not_null_constraint_from_terms.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNotNullConstraintFromTerms < ActiveRecord::Migration[6.1]
- def up
- change_column_null :application_setting_terms, :terms, true
- end
-
- def down
- change_column_null :application_setting_terms, :terms, false
- end
-end
diff --git a/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb b/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb
deleted file mode 100644
index a9175833dd7..00000000000
--- a/db/migrate/20210708202548_add_scanners_column_to_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddScannersColumnToApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :scanners, :text, array: true
- end
-
- def down
- remove_column :approval_project_rules, :scanners
- end
-end
diff --git a/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb b/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb
deleted file mode 100644
index 8240e968e7a..00000000000
--- a/db/migrate/20210709085759_index_batched_migration_jobs_by_max_value.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class IndexBatchedMigrationJobsByMaxValue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_migration_jobs_on_migration_id_and_max_value'
-
- def up
- add_concurrent_index :batched_background_migration_jobs, %i(batched_background_migration_id max_value), name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb b/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb
deleted file mode 100644
index fbd9f7baa61..00000000000
--- a/db/migrate/20210709132707_change_default_job_token_scope_enabled.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDefaultJobTokenScopeEnabled < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-end
diff --git a/db/migrate/20210709221051_create_work_item_types.rb b/db/migrate/20210709221051_create_work_item_types.rb
deleted file mode 100644
index 749689811e0..00000000000
--- a/db/migrate/20210709221051_create_work_item_types.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class CreateWorkItemTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- create_table_with_constraints :work_item_types do |t|
- t.integer :base_type, limit: 2, default: 0, null: false
- t.integer :cached_markdown_version
- t.text :name, null: false
- t.text :description # rubocop:disable Migration/AddLimitToTextColumns
- t.text :description_html # rubocop:disable Migration/AddLimitToTextColumns
- t.text :icon_name, null: true
- t.references :namespace, foreign_key: { on_delete: :cascade }, index: false, null: true
- t.timestamps_with_timezone null: false
-
- t.text_limit :name, 255
- t.text_limit :icon_name, 255
- end
-
- add_concurrent_index :work_item_types,
- 'namespace_id, TRIM(BOTH FROM LOWER(name))',
- unique: true,
- name: :work_item_types_namespace_id_and_name_unique
- end
-
- def down
- with_lock_retries do
- drop_table :work_item_types
- end
- end
-end
diff --git a/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb b/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb
deleted file mode 100644
index 38292cd37c5..00000000000
--- a/db/migrate/20210709221659_add_work_item_type_id_to_issue.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddWorkItemTypeIdToIssue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:issues, :work_item_type_id)
- with_lock_retries do
- add_column :issues, :work_item_type_id, :bigint
- end
- end
-
- add_concurrent_index :issues, :work_item_type_id
- add_concurrent_foreign_key :issues, :work_item_types, column: :work_item_type_id, on_delete: nil
- end
-
- def down
- if foreign_key_exists?(:issues, :work_item_types)
- remove_foreign_key :issues, column: :work_item_type_id
- end
-
- with_lock_retries do
- remove_column :issues, :work_item_type_id
- end
- end
-end
diff --git a/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb b/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb
deleted file mode 100644
index 216d43dd62d..00000000000
--- a/db/migrate/20210712052519_add_label_applied_issuable_closed_to_issuable_sla.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddLabelAppliedIssuableClosedToIssuableSla < ActiveRecord::Migration[6.1]
- def change
- add_column :issuable_slas, :label_applied, :boolean, default: false, null: false
- add_column :issuable_slas, :issuable_closed, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb b/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb
deleted file mode 100644
index a19d15d80a0..00000000000
--- a/db/migrate/20210713070842_update_merge_request_cleanup_schedules_scheduled_at_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateMergeRequestCleanupSchedulesScheduledAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_mr_cleanup_schedules_timestamps_status'
- OLD_INDEX_NAME = 'index_mr_cleanup_schedules_timestamps'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index(:merge_request_cleanup_schedules, :scheduled_at, where: 'completed_at IS NULL AND status = 0', name: INDEX_NAME)
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, OLD_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name(:merge_request_cleanup_schedules, INDEX_NAME)
- add_concurrent_index(:merge_request_cleanup_schedules, :scheduled_at, where: 'completed_at IS NULL', name: OLD_INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210713123345_create_dast_profile_schedule.rb b/db/migrate/20210713123345_create_dast_profile_schedule.rb
deleted file mode 100644
index ea660de572a..00000000000
--- a/db/migrate/20210713123345_create_dast_profile_schedule.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDastProfileSchedule < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_profile_schedules_active_next_run_at'
-
- def up
- table_comment = {
- owner: 'group::dynamic analysis', description: 'Scheduling for scans using DAST Profiles'
- }
-
- create_table_with_constraints :dast_profile_schedules, comment: Gitlab::Json.dump(table_comment) do |t|
- t.bigint :project_id, null: false
- t.bigint :dast_profile_id, null: false
- t.bigint :user_id
-
- t.datetime_with_timezone :next_run_at, null: false
- t.timestamps_with_timezone null: false
- t.boolean :active, default: true, null: false
- t.text :cron, null: false
- t.text_limit :cron, 255
-
- t.index %i[active next_run_at], name: INDEX_NAME
- t.index %i[project_id dast_profile_id], unique: true
- t.index :dast_profile_id
- t.index :user_id
- end
- end
-
- def down
- with_lock_retries do
- drop_table :dast_profile_schedules
- end
- end
-end
diff --git a/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb b/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb
deleted file mode 100644
index 74f24364177..00000000000
--- a/db/migrate/20210713135152_add_devops_adoption_vulnerability_management_used_count.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionVulnerabilityManagementUsedCount < ActiveRecord::Migration[6.1]
- def change
- add_column :analytics_devops_adoption_snapshots, :vulnerability_management_used_count, :integer
- end
-end
diff --git a/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb b/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb
deleted file mode 100644
index 27eb2691754..00000000000
--- a/db/migrate/20210713144637_add_vulnerabilities_created_at_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilitiesCreatedAtIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_vulnerabilities_partial_devops_adoption'
-
- def up
- add_concurrent_index :vulnerabilities, [:project_id, :created_at], where: 'state != 1', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210713211008_create_banned_users.rb b/db/migrate/20210713211008_create_banned_users.rb
deleted file mode 100644
index 7e5eb7f95b8..00000000000
--- a/db/migrate/20210713211008_create_banned_users.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBannedUsers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :banned_users, id: false do |t|
- t.timestamps_with_timezone null: false
- t.references :user, primary_key: true, default: nil, foreign_key: { on_delete: :cascade }, type: :bigint, index: false, null: false
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :banned_users
- end
- end
-end
diff --git a/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb b/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb
deleted file mode 100644
index f0b9addb5f2..00000000000
--- a/db/migrate/20210713223941_remove_null_constraint_from_security_findings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNullConstraintFromSecurityFindings < ActiveRecord::Migration[6.1]
- def up
- change_column_null :security_findings, :project_fingerprint, true
- end
-
- def down
- # no-op, it can not be reverted due to existing records that might not be valid
- end
-end
diff --git a/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb b/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb
deleted file mode 100644
index 5931941a95e..00000000000
--- a/db/migrate/20210714043818_add_index_for_label_applied_to_issuable_sla.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexForLabelAppliedToIssuableSla < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issuable_slas_on_due_at_id_label_applied_issuable_closed'
-
- def up
- add_concurrent_index :issuable_slas, [:due_at, :id], name: INDEX_NAME, where: 'label_applied = FALSE AND issuable_closed = FALSE'
- end
-
- def down
- remove_concurrent_index_by_name :issuable_slas, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb b/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb
deleted file mode 100644
index fb18ac4e174..00000000000
--- a/db/migrate/20210714120600_add_detected_at_to_vulnerabilities.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddDetectedAtToVulnerabilities < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :vulnerabilities, :detected_at, :datetime_with_timezone
- change_column_default :vulnerabilities, :detected_at, -> { 'NOW()' }
- end
- end
-
- def down
- with_lock_retries do
- remove_column :vulnerabilities, :detected_at
- end
- end
-end
diff --git a/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb b/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb
deleted file mode 100644
index c042a875f57..00000000000
--- a/db/migrate/20210715074359_add_foreign_key_to_dast_profile_schedules_on_dast_profile.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnDastProfile < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :dast_profiles, column: :dast_profile_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :dast_profile_id
- end
- end
-end
diff --git a/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb b/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb
deleted file mode 100644
index 576cee090ff..00000000000
--- a/db/migrate/20210715074933_add_foreign_key_to_dast_profile_schedules_on_user.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnUser < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :users, column: :user_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb b/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb
deleted file mode 100644
index cfc76c4a12c..00000000000
--- a/db/migrate/20210715075203_add_foreign_key_to_dast_profile_schedules_on_project.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToDastProfileSchedulesOnProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :dast_profile_schedules, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :dast_profile_schedules, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20210716074555_revert_default_job_token_scope.rb b/db/migrate/20210716074555_revert_default_job_token_scope.rb
deleted file mode 100644
index d28f75605e4..00000000000
--- a/db/migrate/20210716074555_revert_default_job_token_scope.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RevertDefaultJobTokenScope < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-end
diff --git a/db/migrate/20210719145532_add_foreign_keys_view.rb b/db/migrate/20210719145532_add_foreign_keys_view.rb
deleted file mode 100644
index 2d31371e782..00000000000
--- a/db/migrate/20210719145532_add_foreign_keys_view.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeysView < ActiveRecord::Migration[6.1]
- def up
- execute(<<~SQL)
- CREATE OR REPLACE VIEW postgres_foreign_keys AS
- SELECT
- pg_constraint.oid AS oid,
- pg_constraint.conname AS name,
- constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier,
- referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier
- FROM pg_constraint
- INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid
- INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid
- INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid
- INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid
- WHERE contype = 'f';
- SQL
- end
-
- def down
- execute(<<~SQL)
- DROP VIEW IF EXISTS postgres_foreign_keys
- SQL
- end
-end
diff --git a/db/migrate/20210719182944_add_request_response_to_supporing_message.rb b/db/migrate/20210719182944_add_request_response_to_supporing_message.rb
deleted file mode 100644
index a374361e88d..00000000000
--- a/db/migrate/20210719182944_add_request_response_to_supporing_message.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddRequestResponseToSupporingMessage < ActiveRecord::Migration[6.1]
- def change
- change_column_null(:vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_id, true)
- change_column_null(:vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_id, true)
-
- # rubocop: disable Migration/AddReference
- # Table is empty, so no need to use add_concurrent_foreign_key and add_concurrent_index
- add_reference(:vulnerability_finding_evidence_requests,
- :vulnerability_finding_evidence_supporting_message,
- index: { name: 'finding_evidence_requests_on_supporting_evidence_id' },
- foreign_key: { on_delete: :cascade })
- add_reference(:vulnerability_finding_evidence_responses,
- :vulnerability_finding_evidence_supporting_message,
- index: { name: 'finding_evidence_responses_on_supporting_evidence_id' },
- foreign_key: { on_delete: :cascade })
- # rubocop:enable Migration/AddReference
- end
-end
diff --git a/db/migrate/20210719192928_add_invite_email_success_to_member.rb b/db/migrate/20210719192928_add_invite_email_success_to_member.rb
deleted file mode 100644
index ad629483a82..00000000000
--- a/db/migrate/20210719192928_add_invite_email_success_to_member.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddInviteEmailSuccessToMember < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210720083432_change_application_setting_terms_not_null.rb b/db/migrate/20210720083432_change_application_setting_terms_not_null.rb
deleted file mode 100644
index 76dbbe68967..00000000000
--- a/db/migrate/20210720083432_change_application_setting_terms_not_null.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeApplicationSettingTermsNotNull < ActiveRecord::Migration[6.1]
- def up
- execute("UPDATE application_setting_terms SET terms = '' WHERE terms IS NULL")
- change_column_null :application_setting_terms, :terms, false
- end
-
- def down
- change_column_null :application_setting_terms, :terms, true
- end
-end
diff --git a/db/migrate/20210720130006_create_error_tracking_client_keys.rb b/db/migrate/20210720130006_create_error_tracking_client_keys.rb
deleted file mode 100644
index caea4a3d65b..00000000000
--- a/db/migrate/20210720130006_create_error_tracking_client_keys.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class CreateErrorTrackingClientKeys < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :error_tracking_client_keys do |t|
- t.references :project,
- index: true,
- null: false,
- foreign_key: { on_delete: :cascade }
-
- t.boolean :active, default: true, null: false
- t.text :public_key, null: false
- t.text_limit :public_key, 255
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- drop_table :error_tracking_client_keys
- end
-end
diff --git a/db/migrate/20210720140841_create_postgres_async_indexes_table.rb b/db/migrate/20210720140841_create_postgres_async_indexes_table.rb
deleted file mode 100644
index 99025149840..00000000000
--- a/db/migrate/20210720140841_create_postgres_async_indexes_table.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CreatePostgresAsyncIndexesTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :postgres_async_indexes do |t|
- t.timestamps_with_timezone null: false
-
- t.text :name, null: false
- t.text :definition, null: false
- t.text :table_name, null: false
-
- t.text_limit :name, 63
- t.text_limit :definition, 2048
- t.text_limit :table_name, 63
-
- t.index :name, unique: true
- end
- end
-
- def down
- with_lock_retries do
- drop_table :postgres_async_indexes
- end
- end
-end
diff --git a/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb b/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb
deleted file mode 100644
index 7e4a785cb54..00000000000
--- a/db/migrate/20210721125525_add_signed_file_to_packages_debian_project_distributions.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSignedFileToPackagesDebianProjectDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files
- def change
- add_column :packages_debian_project_distributions, :signed_file, :text
- add_column :packages_debian_project_distributions, :signed_file_store, :integer, limit: 2, default: 1, null: false
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb b/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb
deleted file mode 100644
index f27c158bed2..00000000000
--- a/db/migrate/20210721125545_add_signed_file_to_packages_debian_group_distributions.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddSignedFileToPackagesDebianGroupDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files
- def change
- add_column :packages_debian_group_distributions, :signed_file, :text
- add_column :packages_debian_group_distributions, :signed_file_store, :integer, limit: 2, default: 1, null: false
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb b/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb
deleted file mode 100644
index 77524a5b068..00000000000
--- a/db/migrate/20210721125620_add_text_limit_to_packages_debian_project_distributions_signed_files.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToPackagesDebianProjectDistributionsSignedFiles < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- add_text_limit :packages_debian_project_distributions, :signed_file, 255
- end
-
- def down
- remove_text_limit :packages_debian_project_distributions, :signed_file
- end
-end
diff --git a/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb b/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb
deleted file mode 100644
index ef203cb2ff7..00000000000
--- a/db/migrate/20210721125637_add_text_limit_to_packages_debian_group_distributions_signed_files.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToPackagesDebianGroupDistributionsSignedFiles < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- def up
- add_text_limit :packages_debian_group_distributions, :signed_file, 255
- end
-
- def down
- remove_text_limit :packages_debian_group_distributions, :signed_file
- end
-end
diff --git a/db/migrate/20210721134706_add_type_new_to_integrations.rb b/db/migrate/20210721134706_add_type_new_to_integrations.rb
deleted file mode 100644
index b43fb73436c..00000000000
--- a/db/migrate/20210721134706_add_type_new_to_integrations.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddTypeNewToIntegrations < ActiveRecord::Migration[6.1]
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210721134707_add_text_limit_to_integrations_type_new
- def change
- add_column :integrations, :type_new, :text
- end
- # rubocop:enable Migration/AddLimitToTextColumns
-end
diff --git a/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb b/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb
deleted file mode 100644
index 8fb98abad8c..00000000000
--- a/db/migrate/20210721134707_add_text_limit_to_integrations_type_new.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :integrations, :type_new, 255
- end
-
- def down
- remove_text_limit :integrations, :type_new
- end
-end
diff --git a/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb b/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb
deleted file mode 100644
index 6b1f2aeba18..00000000000
--- a/db/migrate/20210721135638_add_triggers_to_integrations_type_new.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class AddTriggersToIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'integrations_set_type_new'
- TRIGGER_ON_INSERT_NAME = 'trigger_type_new_on_insert'
-
- def up
- create_trigger_function(FUNCTION_NAME, replace: true) do
- # This list matches `Gitlab::Integrations::StiType::NAMESPACED_INTEGRATIONS`.
- #
- # If we add new integrations after this migration we can directly use the
- # correct class name in `type`, and don't need to add it to `NAMESPACED_INTEGRATIONS`.
- <<~SQL
- WITH mapping(old_type, new_type) AS (VALUES
- ('AsanaService', 'Integrations::Asana'),
- ('AssemblaService', 'Integrations::Assembla'),
- ('BambooService', 'Integrations::Bamboo'),
- ('BugzillaService', 'Integrations::Bugzilla'),
- ('BuildkiteService', 'Integrations::Buildkite'),
- ('CampfireService', 'Integrations::Campfire'),
- ('ConfluenceService', 'Integrations::Confluence'),
- ('CustomIssueTrackerService', 'Integrations::CustomIssueTracker'),
- ('DatadogService', 'Integrations::Datadog'),
- ('DiscordService', 'Integrations::Discord'),
- ('DroneCiService', 'Integrations::DroneCi'),
- ('EmailsOnPushService', 'Integrations::EmailsOnPush'),
- ('EwmService', 'Integrations::Ewm'),
- ('ExternalWikiService', 'Integrations::ExternalWiki'),
- ('FlowdockService', 'Integrations::Flowdock'),
- ('HangoutsChatService', 'Integrations::HangoutsChat'),
- ('IrkerService', 'Integrations::Irker'),
- ('JenkinsService', 'Integrations::Jenkins'),
- ('JiraService', 'Integrations::Jira'),
- ('MattermostService', 'Integrations::Mattermost'),
- ('MattermostSlashCommandsService', 'Integrations::MattermostSlashCommands'),
- ('MicrosoftTeamsService', 'Integrations::MicrosoftTeams'),
- ('MockCiService', 'Integrations::MockCi'),
- ('MockMonitoringService', 'Integrations::MockMonitoring'),
- ('PackagistService', 'Integrations::Packagist'),
- ('PipelinesEmailService', 'Integrations::PipelinesEmail'),
- ('PivotaltrackerService', 'Integrations::Pivotaltracker'),
- ('PrometheusService', 'Integrations::Prometheus'),
- ('PushoverService', 'Integrations::Pushover'),
- ('RedmineService', 'Integrations::Redmine'),
- ('SlackService', 'Integrations::Slack'),
- ('SlackSlashCommandsService', 'Integrations::SlackSlashCommands'),
- ('TeamcityService', 'Integrations::Teamcity'),
- ('UnifyCircuitService', 'Integrations::UnifyCircuit'),
- ('YoutrackService', 'Integrations::Youtrack'),
- ('WebexTeamsService', 'Integrations::WebexTeams'),
-
- -- EE-only integrations
- ('GithubService', 'Integrations::Github'),
- ('GitlabSlackApplicationService', 'Integrations::GitlabSlackApplication')
- )
-
- UPDATE integrations SET type_new = mapping.new_type
- FROM mapping
- WHERE integrations.id = NEW.id
- AND mapping.old_type = NEW.type;
- RETURN NULL;
- SQL
- end
-
- execute(<<~SQL)
- CREATE TRIGGER #{TRIGGER_ON_INSERT_NAME}
- AFTER INSERT ON integrations
- FOR EACH ROW
- EXECUTE FUNCTION #{FUNCTION_NAME}();
- SQL
- end
-
- def down
- drop_trigger(:integrations, TRIGGER_ON_INSERT_NAME)
- drop_function(FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210721145029_add_state_to_members.rb b/db/migrate/20210721145029_add_state_to_members.rb
deleted file mode 100644
index d727c858374..00000000000
--- a/db/migrate/20210721145029_add_state_to_members.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddStateToMembers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb b/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb
deleted file mode 100644
index 00af9414ab7..00000000000
--- a/db/migrate/20210721174411_add_is_removed_to_escalation_rules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddIsRemovedToEscalationRules < ActiveRecord::Migration[6.1]
- def change
- add_column :incident_management_escalation_rules, :is_removed, :boolean, null: false, default: false
- end
-end
diff --git a/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb b/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb
deleted file mode 100644
index cf52a43435f..00000000000
--- a/db/migrate/20210721174441_update_escalation_rule_fk_for_pending_alert_escalations.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateEscalationRuleFkForPendingAlertEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- OLD_FOREIGN_KEY_CONSTRAINT = 'fk_rails_057c1e3d87'
-
- # Swap foreign key contrainst from ON DELETE SET NULL to ON DELETE CASCADE
- def up
- remove_foreign_key_if_exists :incident_management_pending_alert_escalations, :incident_management_escalation_rules, name: OLD_FOREIGN_KEY_CONSTRAINT
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_alert_escalations,
- :incident_management_escalation_rules,
- column: :rule_id
- end
-
- def down
- remove_foreign_key_if_exists :incident_management_pending_alert_escalations, :incident_management_escalation_rules, column: :rule_id
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_alert_escalations,
- :incident_management_escalation_rules,
- column: :rule_id,
- on_delete: :nullify,
- name: OLD_FOREIGN_KEY_CONSTRAINT
- end
-end
diff --git a/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb b/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb
deleted file mode 100644
index 89adaf89693..00000000000
--- a/db/migrate/20210721174453_remove_schedule_and_status_null_constraints_from_pending_escalations_alert.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveScheduleAndStatusNullConstraintsFromPendingEscalationsAlert < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- # In preparation of removal of these columns in 14.3.
- def up
- with_lock_retries do
- change_column_null :incident_management_pending_alert_escalations, :status, true
- change_column_null :incident_management_pending_alert_escalations, :schedule_id, true
- end
- end
-
- def down
- backfill_from_rules_and_disallow_column_null :status, value: :status
- backfill_from_rules_and_disallow_column_null :schedule_id, value: :oncall_schedule_id
- end
-
- private
-
- def backfill_from_rules_and_disallow_column_null(column, value:)
- with_lock_retries do
- execute <<~SQL
- UPDATE incident_management_pending_alert_escalations AS escalations
- SET #{column} = rules.#{value}
- FROM incident_management_escalation_rules AS rules
- WHERE rule_id = rules.id
- AND escalations.#{column} IS NULL
- SQL
-
- change_column_null :incident_management_pending_alert_escalations, column, false
- end
- end
-end
diff --git a/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb b/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb
deleted file mode 100644
index 3c0fa35d9c3..00000000000
--- a/db/migrate/20210721211602_add_vulnerability_amount_column_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilityAmountColumnIntoApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :vulnerabilities_allowed, :integer, limit: 2
- end
-
- def down
- remove_column :approval_project_rules, :vulnerabilities_allowed
- end
-end
diff --git a/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb b/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
deleted file mode 100644
index 7146c6c9537..00000000000
--- a/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveNullConstraintOnScheduleFromEscalationRules < ActiveRecord::Migration[6.1]
- def up
- change_column_null :incident_management_escalation_rules, :oncall_schedule_id, true
- end
-
- def down
- exec_query 'DELETE FROM incident_management_escalation_rules WHERE oncall_schedule_id IS NULL'
-
- change_column_null :incident_management_escalation_rules, :oncall_schedule_id, false
- end
-end
diff --git a/db/migrate/20210722074242_add_user_to_escalation_rules.rb b/db/migrate/20210722074242_add_user_to_escalation_rules.rb
deleted file mode 100644
index 061dd6194f7..00000000000
--- a/db/migrate/20210722074242_add_user_to_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :incident_management_escalation_rules, :user_id, :bigint, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :incident_management_escalation_rules, :user_id
- end
- end
-end
diff --git a/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb b/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb
deleted file mode 100644
index 047149d6e7c..00000000000
--- a/db/migrate/20210722074256_add_user_index_to_escalation_rules.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserIndexToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- USER_INDEX_NAME = 'index_escalation_rules_on_user'
- OLD_UNIQUE_INDEX_NAME = 'index_on_policy_schedule_status_elapsed_time_escalation_rules'
- NEW_UNIQUE_INDEX_NAME = 'index_escalation_rules_on_all_attributes'
-
- def up
- remove_concurrent_index_by_name :incident_management_escalation_rules, OLD_UNIQUE_INDEX_NAME
-
- add_concurrent_index :incident_management_escalation_rules, :user_id, name: USER_INDEX_NAME
- add_concurrent_index :incident_management_escalation_rules,
- [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds, :user_id],
- unique: true,
- name: NEW_UNIQUE_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :incident_management_escalation_rules, USER_INDEX_NAME
- remove_concurrent_index_by_name :incident_management_escalation_rules, NEW_UNIQUE_INDEX_NAME
-
- exec_query 'DELETE FROM incident_management_escalation_rules WHERE oncall_schedule_id IS NULL'
-
- add_concurrent_index :incident_management_escalation_rules,
- [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds],
- unique: true,
- name: OLD_UNIQUE_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb b/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb
deleted file mode 100644
index acdfc1ed835..00000000000
--- a/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUserFkToEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :incident_management_escalation_rules, :users, column: :user_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :incident_management_escalation_rules, column: :user_id
- end
- end
-end
diff --git a/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb b/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb
deleted file mode 100644
index bd140e1da56..00000000000
--- a/db/migrate/20210722074339_add_xor_check_constraint_for_escalation_rules.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddXorCheckConstraintForEscalationRules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- CONSTRAINT_NAME = 'escalation_rules_one_of_oncall_schedule_or_user'
-
- def up
- add_check_constraint :incident_management_escalation_rules, 'num_nonnulls(oncall_schedule_id, user_id) = 1', CONSTRAINT_NAME
- end
-
- def down
- remove_check_constraint :incident_management_escalation_rules, CONSTRAINT_NAME
- end
-end
diff --git a/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb b/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb
deleted file mode 100644
index 3f74f72454d..00000000000
--- a/db/migrate/20210722132844_devops_adoption_drop_redundant_indexes.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class DevopsAdoptionDropRedundantIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_SAST = 'index_ci_job_artifacts_sast_for_devops_adoption'
- INDEX_DAST = 'index_ci_job_artifacts_dast_for_devops_adoption'
-
- def up
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_SAST
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_DAST
- end
-
- def down
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 5", name: INDEX_SAST
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 8", name: INDEX_DAST
- end
-end
diff --git a/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb b/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb
deleted file mode 100644
index 974559239d7..00000000000
--- a/db/migrate/20210722150102_operations_feature_flags_correct_flexible_rollout_values.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class OperationsFeatureFlagsCorrectFlexibleRolloutValues < ActiveRecord::Migration[6.1]
- STICKINESS = { "USERID" => "userId", "RANDOM" => "random", "SESSIONID" => "sessionId", "DEFAULT" => "default" }.freeze
-
- def up
- STICKINESS.each do |before, after|
- update_statement = <<-SQL
- UPDATE operations_strategies
- SET parameters = parameters || jsonb_build_object('stickiness', '#{quote_string(after)}')
- WHERE name = 'flexibleRollout' AND parameters->>'stickiness' = '#{quote_string(before)}'
- SQL
-
- execute(update_statement)
- end
- end
-
- def down
- STICKINESS.each do |before, after|
- update_statement = <<-SQL
- UPDATE operations_strategies
- SET parameters = parameters || jsonb_build_object('stickiness', '#{quote_string(before)}')
- WHERE name = 'flexibleRollout' AND parameters->>'stickiness' = '#{quote_string(after)}'
- SQL
-
- execute(update_statement)
- end
- end
-end
diff --git a/db/migrate/20210722151951_add_columns_to_security_scans.rb b/db/migrate/20210722151951_add_columns_to_security_scans.rb
deleted file mode 100644
index 341cef057ce..00000000000
--- a/db/migrate/20210722151951_add_columns_to_security_scans.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddColumnsToSecurityScans < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :security_scans, :project_id, :bigint
- add_column :security_scans, :pipeline_id, :bigint
- end
- end
-
- def down
- with_lock_retries do
- remove_column :security_scans, :project_id, :bigint
- remove_column :security_scans, :pipeline_id, :bigint
- end
- end
-end
diff --git a/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb b/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb
deleted file mode 100644
index 4678aba2cff..00000000000
--- a/db/migrate/20210722210041_add_overridden_uuid_to_security_findings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddOverriddenUuidToSecurityFindings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column :security_findings, :overridden_uuid, :uuid, null: true
- end
- end
-
- def down
- with_lock_retries do
- remove_column :security_findings, :overridden_uuid
- end
- end
-end
diff --git a/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb b/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb
deleted file mode 100644
index cfaff4d0304..00000000000
--- a/db/migrate/20210723173132_create_index_on_environments_auto_delete_at.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIndexOnEnvironmentsAutoDeleteAt < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_environments_on_state_and_auto_delete_at'
-
- def up
- add_concurrent_index :environments,
- %i[auto_delete_at],
- where: "auto_delete_at IS NOT NULL AND state = 'stopped'",
- name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :environments, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb b/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb
deleted file mode 100644
index 5fd558e0c1b..00000000000
--- a/db/migrate/20210726134950_add_integrated_to_error_tracking_setting.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddIntegratedToErrorTrackingSetting < ActiveRecord::Migration[6.1]
- def up
- add_column :project_error_tracking_settings, :integrated, :boolean, null: false, default: false
- end
-
- def down
- remove_column :project_error_tracking_settings, :integrated
- end
-end
diff --git a/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb b/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb
deleted file mode 100644
index bd17a9df5df..00000000000
--- a/db/migrate/20210726202748_add_vulnerability_severities_into_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddVulnerabilitySeveritiesIntoApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- add_column :approval_project_rules, :severity_levels, :text, array: true, null: false, default: []
- end
-
- def down
- remove_column :approval_project_rules, :severity_levels
- end
-end
diff --git a/db/migrate/20210728110654_add_status_to_error_tracking_error.rb b/db/migrate/20210728110654_add_status_to_error_tracking_error.rb
deleted file mode 100644
index 035f97dc963..00000000000
--- a/db/migrate/20210728110654_add_status_to_error_tracking_error.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class AddStatusToErrorTrackingError < ActiveRecord::Migration[6.1]
- def up
- add_column :error_tracking_errors, :status, :integer, null: false, default: 0, limit: 2
- end
-
- def down
- remove_column :error_tracking_errors, :status
- end
-end
diff --git a/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb b/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb
deleted file mode 100644
index 418097b92e5..00000000000
--- a/db/migrate/20210728174349_add_fk_to_security_scans_columns.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkToSecurityScansColumns < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :security_scans, :project_id
- add_concurrent_foreign_key :security_scans, :projects, column: :project_id, on_delete: :cascade
-
- add_concurrent_index :security_scans, :pipeline_id
- end
-
- def down
- remove_foreign_key :security_scans, column: :project_id
- remove_concurrent_index_by_name :security_scans, name: 'index_security_scans_on_project_id'
-
- remove_concurrent_index_by_name :security_scans, name: 'index_security_scans_on_pipeline_id'
- end
-end
diff --git a/db/migrate/20210729061526_add_pronunciation_to_user_details.rb b/db/migrate/20210729061526_add_pronunciation_to_user_details.rb
deleted file mode 100644
index 6e0c8f1e808..00000000000
--- a/db/migrate/20210729061526_add_pronunciation_to_user_details.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddPronunciationToUserDetails < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # rubocop:disable Migration/AddLimitToTextColumns
- # limit is added in 20210729061556_add_text_limit_to_user_details_pronunciation.rb
- with_lock_retries do
- add_column :user_details, :pronunciation, :text, null: true
- end
- # rubocop:enable Migration/AddLimitToTextColumns
- end
-
- def down
- with_lock_retries do
- remove_column :user_details, :pronunciation
- end
- end
-end
diff --git a/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb b/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb
deleted file mode 100644
index 5466ee7bafa..00000000000
--- a/db/migrate/20210729061556_add_text_limit_to_user_details_pronunciation.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class AddTextLimitToUserDetailsPronunciation < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_text_limit :user_details, :pronunciation, 255
- end
-
- def down
- remove_text_limit :user_details, :pronunciation
- end
-end
diff --git a/db/migrate/20210729081351_create_topics.rb b/db/migrate/20210729081351_create_topics.rb
deleted file mode 100644
index 13ed2dc7ccc..00000000000
--- a/db/migrate/20210729081351_create_topics.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateTopics < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :topics do |t|
- t.text :name, null: false
- t.text_limit :name, 255
-
- t.index :name, unique: true
-
- t.timestamps_with_timezone
- end
- end
-
- def down
- with_lock_retries do
- drop_table :topics
- end
- end
-end
diff --git a/db/migrate/20210729081739_create_project_topics.rb b/db/migrate/20210729081739_create_project_topics.rb
deleted file mode 100644
index cbb8842f653..00000000000
--- a/db/migrate/20210729081739_create_project_topics.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectTopics < ActiveRecord::Migration[6.1]
- def change
- create_table :project_topics do |t|
- t.bigint :project_id, null: false
- t.bigint :topic_id, null: false
-
- t.index :project_id
- t.index :topic_id
- t.index [:project_id, :topic_id], unique: true
-
- t.timestamps_with_timezone
- end
- end
-end
diff --git a/db/migrate/20210729123101_confirm_security_bot.rb b/db/migrate/20210729123101_confirm_security_bot.rb
deleted file mode 100644
index 2184cc4e193..00000000000
--- a/db/migrate/20210729123101_confirm_security_bot.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class ConfirmSecurityBot < ActiveRecord::Migration[6.0]
- class User < ActiveRecord::Base
- self.table_name = 'users'
- SECURITY_BOT_TYPE = 8
- end
-
- def up
- User.where(user_type: User::SECURITY_BOT_TYPE, confirmed_at: nil)
- .update_all(confirmed_at: Time.current)
- end
-
- # no-op
- # Security Bot should be always confirmed
- def down
- end
-end
diff --git a/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb b/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb
deleted file mode 100644
index 27cf5c60cf0..00000000000
--- a/db/migrate/20210729125641_add_foreign_key_to_project_on_project_topic.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToProjectOnProjectTopic < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :project_topics, :projects, column: :project_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :project_topics, column: :project_id
- end
- end
-end
diff --git a/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb b/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb
deleted file mode 100644
index 1ada08dca1a..00000000000
--- a/db/migrate/20210729125659_add_foreign_key_to_topic_on_project_topic.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyToTopicOnProjectTopic < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :project_topics, :topics, column: :topic_id, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :project_topics, column: :topic_id
- end
- end
-end
diff --git a/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb b/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb
deleted file mode 100644
index 2193a698272..00000000000
--- a/db/migrate/20210729161242_remove_foreign_keys_from_ci_test_case_failures.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromCiTestCaseFailures < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = :ci_test_case_failures
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :build_id)
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :test_case_id)
- end
- end
-
- def down
- add_concurrent_foreign_key(TABLE_NAME, :ci_builds, column: :build_id, on_delete: :cascade)
- add_concurrent_foreign_key(TABLE_NAME, :ci_test_cases, column: :test_case_id, on_delete: :cascade)
- end
-end
diff --git a/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb b/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb
deleted file mode 100644
index 1d0a5f4fd64..00000000000
--- a/db/migrate/20210729192148_remove_foreign_keys_from_ci_test_cases.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveForeignKeysFromCiTestCases < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = :ci_test_cases
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_foreign_key_if_exists(TABLE_NAME, column: :project_id)
- end
- end
-
- def down
- add_concurrent_foreign_key(TABLE_NAME, :projects, column: :project_id, on_delete: :cascade)
- end
-end
diff --git a/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb b/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
deleted file mode 100644
index b16904a3b47..00000000000
--- a/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementIssuableEscalationStatuses < ActiveRecord::Migration[6.1]
- ISSUE_IDX = 'index_uniq_im_issuable_escalation_statuses_on_issue_id'
- POLICY_IDX = 'index_im_issuable_escalation_statuses_on_policy_id'
-
- def change
- create_table :incident_management_issuable_escalation_statuses do |t|
- t.timestamps_with_timezone
-
- t.references :issue, foreign_key: { on_delete: :cascade }, index: { unique: true, name: ISSUE_IDX }, null: false
- t.references :policy, foreign_key: { to_table: :incident_management_escalation_policies, on_delete: :nullify }, index: { name: POLICY_IDX }
-
- t.datetime_with_timezone :escalations_started_at
- t.datetime_with_timezone :resolved_at
-
- t.integer :status, default: 0, null: false, limit: 2
- end
- end
-end
diff --git a/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb b/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb
deleted file mode 100644
index ad517fbbff0..00000000000
--- a/db/migrate/20210730101609_create_analytics_cycle_analytics_stage_event_hashes.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsStageEventHashes < ActiveRecord::Migration[6.1]
- def change
- create_table :analytics_cycle_analytics_stage_event_hashes do |t|
- t.binary :hash_sha256
- t.index :hash_sha256, unique: true, name: 'index_cycle_analytics_stage_event_hashes_on_hash_sha_256'
- end
- end
-end
diff --git a/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb b/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb
deleted file mode 100644
index 2909df78a6a..00000000000
--- a/db/migrate/20210730102952_add_stage_hash_fk_to_project_stages.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddStageHashFkToProjectStages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:analytics_cycle_analytics_project_stages, :stage_event_hash_id)
- add_column :analytics_cycle_analytics_project_stages, :stage_event_hash_id, :bigint
- end
-
- add_concurrent_index :analytics_cycle_analytics_project_stages, :stage_event_hash_id, name: 'index_project_stages_on_stage_event_hash_id'
- add_concurrent_foreign_key :analytics_cycle_analytics_project_stages, :analytics_cycle_analytics_stage_event_hashes, column: :stage_event_hash_id, on_delete: :cascade
- end
-
- def down
- remove_column :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-end
diff --git a/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb b/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb
deleted file mode 100644
index 3cd53f2bb50..00000000000
--- a/db/migrate/20210730103808_add_stage_hash_fk_to_group_stages.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddStageHashFkToGroupStages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- unless column_exists?(:analytics_cycle_analytics_group_stages, :stage_event_hash_id)
- add_column :analytics_cycle_analytics_group_stages, :stage_event_hash_id, :bigint
- end
-
- add_concurrent_index :analytics_cycle_analytics_group_stages, :stage_event_hash_id, name: 'index_group_stages_on_stage_event_hash_id'
- add_concurrent_foreign_key :analytics_cycle_analytics_group_stages, :analytics_cycle_analytics_stage_event_hashes, column: :stage_event_hash_id, on_delete: :cascade
- end
-
- def down
- remove_column :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- end
-end
diff --git a/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb b/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb
deleted file mode 100644
index 20a6fde96ff..00000000000
--- a/db/migrate/20210730194555_create_incident_management_pending_issue_escalations.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class CreateIncidentManagementPendingIssueEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- execute(<<~SQL)
- CREATE TABLE incident_management_pending_issue_escalations (
- id bigserial NOT NULL,
- rule_id bigint NOT NULL,
- issue_id bigint NOT NULL,
- process_at timestamp with time zone NOT NULL,
- created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL,
- PRIMARY KEY (id, process_at)
- ) PARTITION BY RANGE (process_at);
-
- CREATE INDEX index_incident_management_pending_issue_escalations_on_issue_id
- ON incident_management_pending_issue_escalations USING btree (issue_id);
-
- CREATE INDEX index_incident_management_pending_issue_escalations_on_rule_id
- ON incident_management_pending_issue_escalations USING btree (rule_id);
- SQL
- end
- end
-
- def down
- with_lock_retries do
- drop_table :incident_management_pending_issue_escalations
- end
- end
-end
diff --git a/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb b/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb
deleted file mode 100644
index 38d72496484..00000000000
--- a/db/migrate/20210803110920_add_unique_index_to_vulnerability_flags_table.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToVulnerabilityFlagsTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_vulnerability_flags_on_unique_columns'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :vulnerability_flags, [:vulnerability_occurrence_id, :flag_type, :origin], name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :vulnerability_flags, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210804150320_create_base_work_item_types.rb b/db/migrate/20210804150320_create_base_work_item_types.rb
deleted file mode 100644
index 836264aae6e..00000000000
--- a/db/migrate/20210804150320_create_base_work_item_types.rb
+++ /dev/null
@@ -1,35 +0,0 @@
-# frozen_string_literal: true
-
-class CreateBaseWorkItemTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- module WorkItem
- class Type < ActiveRecord::Base
- self.table_name = 'work_item_types'
-
- enum base_type: {
- issue: 0,
- incident: 1,
- test_case: 2,
- requirement: 3
- }
-
- validates :name, uniqueness: { case_sensitive: false, scope: [:namespace_id] }
- end
- end
-
- def up
- # create default types
- WorkItem::Type.create(name: 'Issue', namespace_id: nil, base_type: :issue, icon_name: 'issue-type-issue')
- WorkItem::Type.create(name: 'Incident', namespace_id: nil, base_type: :incident, icon_name: 'issue-type-incident')
- WorkItem::Type.create(name: 'Test Case', namespace_id: nil, base_type: :test_case, icon_name: 'issue-type-test-case')
- WorkItem::Type.create(name: 'Requirement', namespace_id: nil, base_type: :requirement, icon_name: 'issue-type-requirements')
- end
-
- def down
- # We expect this table to be empty at the point of the up migration,
- # however there is a remote possibility that issues could already be
- # using one of these types, with a tight foreign constraint.
- # Therefore we will not attempt to remove any data.
- end
-end
diff --git a/db/migrate/20210804200114_create_customer_relations_organizations.rb b/db/migrate/20210804200114_create_customer_relations_organizations.rb
deleted file mode 100644
index 9936e97b9bf..00000000000
--- a/db/migrate/20210804200114_create_customer_relations_organizations.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCustomerRelationsOrganizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :customer_relations_organizations do |t|
- t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.integer :state, limit: 1, default: 1, null: false
- t.decimal :default_rate, precision: 18, scale: 2
- t.text :name, null: false
- t.text :description
-
- t.text_limit :name, 255
- t.text_limit :description, 1024
-
- t.index 'group_id, LOWER(name)', unique: true, name: :index_customer_relations_organizations_on_unique_name_per_group
- end
- end
-
- def down
- with_lock_retries do
- drop_table :customer_relations_organizations
- end
- end
-end
diff --git a/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb b/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb
deleted file mode 100644
index 66fcf485b2f..00000000000
--- a/db/migrate/20210804202057_add_tmp_index_approval_project_rules_scanners.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddTmpIndexApprovalProjectRulesScanners < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'tmp_index_approval_project_rules_scanners'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :approval_project_rules, :scanners, name: INDEX_NAME, using: :gin, where: "scanners @> '{cluster_image_scanning}'"
- end
-
- def down
- remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb b/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb
deleted file mode 100644
index ea77e29d365..00000000000
--- a/db/migrate/20210805085706_add_rule_index_to_security_orchestration_policy_rule_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddRuleIndexToSecurityOrchestrationPolicyRuleSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :security_orchestration_policy_rule_schedules, :rule_index, :integer, null: false, default: 0
- end
-end
diff --git a/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb b/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb
deleted file mode 100644
index 34f8ec43a8f..00000000000
--- a/db/migrate/20210806152104_add_pypi_package_requests_forwarding_to_application_settings.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPypiPackageRequestsForwardingToApplicationSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- add_column(:application_settings, :pypi_package_requests_forwarding, :boolean, default: true, null: false)
- end
- end
-
- def down
- with_lock_retries do
- remove_column(:application_settings, :pypi_package_requests_forwarding)
- end
- end
-end
diff --git a/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb b/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb
deleted file mode 100644
index c9b17e3d5c5..00000000000
--- a/db/migrate/20210807101446_add_cadence_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddCadenceToDastProfileSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :dast_profile_schedules, :cadence, :jsonb, null: false, default: {}
- end
-end
diff --git a/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb b/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb
deleted file mode 100644
index 3c3eb507432..00000000000
--- a/db/migrate/20210807101621_add_timezone_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimezoneToDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- # We disable these cops here because adding the column is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Rails/NotNullColumn
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- unless column_exists?(:dast_profile_schedules, :timezone)
- add_column :dast_profile_schedules, :timezone, :text, null: false
- end
-
- add_text_limit :dast_profile_schedules, :timezone, 255
- end
-
- def down
- return unless column_exists?(:dast_profile_schedules, :timezone)
-
- remove_column :dast_profile_schedules, :timezone
- end
-end
diff --git a/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb b/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb
deleted file mode 100644
index 4eea5fd7e8c..00000000000
--- a/db/migrate/20210807102004_add_starts_at_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddStartsAtToDastProfileSchedules < ActiveRecord::Migration[6.1]
- def change
- add_column :dast_profile_schedules, :starts_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' }
- end
-end
diff --git a/db/migrate/20210809014850_create_agent_group_authorizations.rb b/db/migrate/20210809014850_create_agent_group_authorizations.rb
deleted file mode 100644
index 43d7e63e0a2..00000000000
--- a/db/migrate/20210809014850_create_agent_group_authorizations.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAgentGroupAuthorizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- create_table :agent_group_authorizations do |t|
- t.bigint :group_id, null: false
- t.bigint :agent_id, null: false
- t.jsonb :config, null: false
-
- t.index :group_id
- t.index [:agent_id, :group_id], unique: true
- end
- end
-end
diff --git a/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb b/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb
deleted file mode 100644
index 2a3a51d0ca9..00000000000
--- a/db/migrate/20210809014918_add_agent_group_authorizations_foreign_keys.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddAgentGroupAuthorizationsForeignKeys < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :agent_group_authorizations, :namespaces, column: :group_id
- add_concurrent_foreign_key :agent_group_authorizations, :cluster_agents, column: :agent_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :agent_group_authorizations, column: :group_id
- end
-
- with_lock_retries do
- remove_foreign_key_if_exists :agent_group_authorizations, column: :agent_id
- end
- end
-end
diff --git a/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb b/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb
deleted file mode 100644
index 76308e2ea8e..00000000000
--- a/db/migrate/20210809194250_rename_tables_ci_build_trace_section.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RenameTablesCiBuildTraceSection < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- # Shorten deprecated to dep to avoid 'Index name..too long'
- rename_table(:ci_build_trace_sections, :dep_ci_build_trace_sections)
- rename_table(:ci_build_trace_section_names, :dep_ci_build_trace_section_names)
- end
-end
diff --git a/db/migrate/20210811120204_create_customer_relations_contacts.rb b/db/migrate/20210811120204_create_customer_relations_contacts.rb
deleted file mode 100644
index 0c26ee0ef59..00000000000
--- a/db/migrate/20210811120204_create_customer_relations_contacts.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCustomerRelationsContacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- create_table_with_constraints :customer_relations_contacts do |t|
- t.bigint :group_id, null: false
- t.references :organization, index: true, null: true, foreign_key: { to_table: :customer_relations_organizations, on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.integer :state, limit: 1, default: 1, null: false
- t.text :phone
- t.text :first_name, null: false
- t.text :last_name, null: false
- t.text :email
- t.text :description
-
- t.text_limit :phone, 32
- t.text_limit :first_name, 255
- t.text_limit :last_name, 255
- t.text_limit :email, 255
- t.text_limit :description, 1024
- end
- end
-
- def down
- with_lock_retries do
- drop_table :customer_relations_contacts
- end
- end
-end
diff --git a/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb b/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
deleted file mode 100644
index cf51bca630a..00000000000
--- a/db/migrate/20210811193033_add_unique_index_to_vulnerability_finding_links.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueIndexToVulnerabilityFindingLinks < Gitlab::Database::Migration[1.0]
- # This migration has been moved to db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb
- # Previously, this was causing an bug where there was a conflict between the table cleanup and the index creation.
-
- def up
- # no op
- end
-
- def down
- # no op
- end
-end
diff --git a/db/migrate/20210812171704_create_project_ci_feature_usages.rb b/db/migrate/20210812171704_create_project_ci_feature_usages.rb
deleted file mode 100644
index 376512bcb44..00000000000
--- a/db/migrate/20210812171704_create_project_ci_feature_usages.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class CreateProjectCiFeatureUsages < ActiveRecord::Migration[6.1]
- def change
- create_table :project_ci_feature_usages do |t|
- t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false
- t.integer :feature, null: false, limit: 2
- t.boolean :default_branch, default: false, null: false
- t.index [:project_id, :feature, :default_branch], unique: true, name: 'index_project_ci_feature_usages_unique_columns'
- end
- end
-end
diff --git a/db/migrate/20210813101742_create_zentao_tracker_data.rb b/db/migrate/20210813101742_create_zentao_tracker_data.rb
deleted file mode 100644
index 93d9cde3371..00000000000
--- a/db/migrate/20210813101742_create_zentao_tracker_data.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class CreateZentaoTrackerData < ActiveRecord::Migration[6.1]
- def change
- create_table :zentao_tracker_data do |t|
- t.references :integration, foreign_key: { on_delete: :cascade }, type: :bigint, index: true, null: false
- t.timestamps_with_timezone
- t.binary :encrypted_url
- t.binary :encrypted_url_iv
- t.binary :encrypted_api_url
- t.binary :encrypted_api_url_iv
- t.binary :encrypted_zentao_product_xid
- t.binary :encrypted_zentao_product_xid_iv
- t.binary :encrypted_api_token
- t.binary :encrypted_api_token_iv
- end
- end
-end
diff --git a/db/migrate/20210813111909_create_ci_build_trace_metadata.rb b/db/migrate/20210813111909_create_ci_build_trace_metadata.rb
deleted file mode 100644
index d8b7fd656e0..00000000000
--- a/db/migrate/20210813111909_create_ci_build_trace_metadata.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class CreateCiBuildTraceMetadata < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :ci_build_trace_metadata, id: false, if_not_exists: true do |t|
- t.references :build,
- index: false,
- primary_key: true,
- default: nil,
- foreign_key: { to_table: :ci_builds, on_delete: :cascade },
- type: :bigint,
- null: false
-
- t.bigint :trace_artifact_id
- t.integer :archival_attempts, default: 0, null: false, limit: 2
- t.binary :checksum
- t.binary :remote_checksum
-
- t.index :trace_artifact_id
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :ci_build_trace_metadata, if_exists: true
- end
- end
-end
diff --git a/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb b/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb
deleted file mode 100644
index 58b2471a96a..00000000000
--- a/db/migrate/20210813131313_create_foreign_key_on_contacts_group_id.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateForeignKeyOnContactsGroupId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_customer_relations_contacts_on_group_id'
-
- def up
- add_concurrent_index :customer_relations_contacts, :group_id, name: INDEX_NAME
- add_concurrent_foreign_key :customer_relations_contacts, :namespaces, column: :group_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :customer_relations_contacts, column: :group_id
- end
-
- remove_concurrent_index_by_name :customer_relations_contacts, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb b/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb
deleted file mode 100644
index b7ea8545df1..00000000000
--- a/db/migrate/20210816095826_add_unique_index_on_dast_profile_to_dast_profile_schedules.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddUniqueIndexOnDastProfileToDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_profile_schedules_on_dast_profile_id'
- TABLE = :dast_profile_schedules
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- # rubocop: disable Migration/RemoveIndex
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, :dast_profile_id, name: INDEX_NAME
- end
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, :dast_profile_id, unique: true, name: INDEX_NAME
- end
- end
-
- def down
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, :dast_profile_id, name: INDEX_NAME
- end
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, :dast_profile_id
- end
- end
-end
diff --git a/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb b/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb
deleted file mode 100644
index d625ae6d13d..00000000000
--- a/db/migrate/20210816161107_remove_index_containing_faulty_regex.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveIndexContainingFaultyRegex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = "tmp_index_merge_requests_draft_and_status"
-
- disable_ddl_transaction!
-
- def up
- remove_concurrent_index_by_name :merge_requests, INDEX_NAME
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/migrate/20210816192041_add_invites_email_success_to_member.rb b/db/migrate/20210816192041_add_invites_email_success_to_member.rb
deleted file mode 100644
index 89f475b056c..00000000000
--- a/db/migrate/20210816192041_add_invites_email_success_to_member.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddInvitesEmailSuccessToMember < ActiveRecord::Migration[6.1]
- def up
- unless column_exists?(:members, :invite_email_success)
- add_column :members, :invite_email_success, :boolean, null: false, default: true
- end
- end
-
- def down
- remove_column :members, :invite_email_success
- end
-end
diff --git a/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb b/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb
deleted file mode 100644
index 032b15234d8..00000000000
--- a/db/migrate/20210817084338_add_foreign_key_from_ci_build_metadata_to_ci_job_artifacts.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeyFromCiBuildMetadataToCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_foreign_key :ci_build_trace_metadata,
- :ci_job_artifacts,
- column: :trace_artifact_id,
- on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key :ci_build_trace_metadata, column: :trace_artifact_id
- end
- end
-end
diff --git a/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb b/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb
deleted file mode 100644
index e4b681d66fb..00000000000
--- a/db/migrate/20210817130415_add_project_id_name_version_id_to_npm_packages.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectIdNameVersionIdToNpmPackages < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'idx_installable_npm_pkgs_on_project_id_name_version_id'
-
- def up
- add_concurrent_index :packages_packages, [:project_id, :name, :version, :id], where: 'package_type = 2 AND status = 0', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :packages_packages, [:project_id, :name, :version, :id], where: 'package_type = 2 AND status = 0', name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210817172214_add_yaml_limits_application_setting.rb b/db/migrate/20210817172214_add_yaml_limits_application_setting.rb
deleted file mode 100644
index f502ef9825b..00000000000
--- a/db/migrate/20210817172214_add_yaml_limits_application_setting.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddYamlLimitsApplicationSetting < ActiveRecord::Migration[6.1]
- DOWNTIME = false
-
- def change
- add_column :application_settings, :max_yaml_size_bytes, :bigint, default: 1.megabyte, null: false
- add_column :application_settings, :max_yaml_depth, :integer, default: 100, null: false
- end
-end
diff --git a/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb b/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
deleted file mode 100644
index 791c5b60e54..00000000000
--- a/db/migrate/20210818034001_index_historical_data_on_recorded_at.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class IndexHistoricalDataOnRecordedAt < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_historical_data_on_recorded_at'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :historical_data, :recorded_at, name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :historical_data, INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb b/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb
deleted file mode 100644
index d9d05f2b737..00000000000
--- a/db/migrate/20210818055357_add_unique_commit_design_user_mention_indexes.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class AddUniqueCommitDesignUserMentionIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- COMMIT_INDEX_NAME = 'commit_id_and_note_id_index'
- DESIGN_INDEX_NAME = 'design_user_mentions_on_design_id_and_note_id_index'
-
- COMMIT_UNIQUE_INDEX_NAME = 'commit_user_mentions_on_commit_id_and_note_id_unique_index'
- DESIGN_UNIQUE_INDEX_NAME = 'design_user_mentions_on_design_id_and_note_id_unique_index'
-
- def up
- add_concurrent_index :commit_user_mentions, [:commit_id, :note_id], unique: true, name: COMMIT_UNIQUE_INDEX_NAME
- add_concurrent_index :design_user_mentions, [:design_id, :note_id], unique: true, name: DESIGN_UNIQUE_INDEX_NAME
-
- remove_concurrent_index_by_name :commit_user_mentions, COMMIT_INDEX_NAME
- remove_concurrent_index_by_name :design_user_mentions, DESIGN_INDEX_NAME
- end
-
- def down
- add_concurrent_index :design_user_mentions, [:design_id, :note_id], name: DESIGN_INDEX_NAME
- add_concurrent_index :commit_user_mentions, [:commit_id, :note_id], name: COMMIT_INDEX_NAME
-
- remove_concurrent_index_by_name :design_user_mentions, DESIGN_UNIQUE_INDEX_NAME
- remove_concurrent_index_by_name :commit_user_mentions, COMMIT_UNIQUE_INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb b/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb
deleted file mode 100644
index b50947a0a99..00000000000
--- a/db/migrate/20210818061156_remove_project_profile_compound_index_from_dast_profile_schedules.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class RemoveProjectProfileCompoundIndexFromDastProfileSchedules < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :dast_profile_schedules
- INDEX_NAME = 'index_dast_profile_schedules_on_project_id_and_dast_profile_id'
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- # rubocop: disable Migration/RemoveIndex
- def up
- execute('DELETE FROM dast_profile_schedules')
-
- if index_exists_by_name?(TABLE, INDEX_NAME)
- remove_index TABLE, %i[project_id dast_profile_id], name: INDEX_NAME
- end
- end
-
- def down
- execute('DELETE FROM dast_profile_schedules')
-
- unless index_exists_by_name?(TABLE, INDEX_NAME)
- add_index TABLE, %i[project_id dast_profile_id], unique: true, name: INDEX_NAME
- end
- end
-end
diff --git a/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb b/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb
deleted file mode 100644
index 392b335ab45..00000000000
--- a/db/migrate/20210818115613_add_index_project_id_on_dast_profile_schedule.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddIndexProjectIdOnDastProfileSchedule < ActiveRecord::Migration[6.1]
- # We disable these cops here because changing this index is safe. The table does not
- # have any data in it as it's behind a feature flag.
- # rubocop: disable Migration/AddIndex
- def change
- add_index :dast_profile_schedules, :project_id
- end
-end
diff --git a/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb b/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb
deleted file mode 100644
index 2999a6fd4f6..00000000000
--- a/db/migrate/20210818175949_update_integrations_trigger_type_new_on_insert.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIntegrationsTriggerTypeNewOnInsert < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- FUNCTION_NAME = 'integrations_set_type_new'
-
- def up
- # Update `type_new` dynamically based on `type`.
- #
- # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- UPDATE integrations SET type_new = regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1')
- WHERE integrations.id = NEW.id;
- RETURN NULL;
- SQL
- end
- end
-
- def down
- # We initially went with this static mapping since we assumed that new integrations could
- # just use the correct class name directly in `type`, but this will complicate the data migration
- # since we plan to drop `type` at some point and replace it with `type_new`, so we still need
- # to keep this column filled for all records.
- create_trigger_function(FUNCTION_NAME, replace: true) do
- <<~SQL
- WITH mapping(old_type, new_type) AS (VALUES
- ('AsanaService', 'Integrations::Asana'),
- ('AssemblaService', 'Integrations::Assembla'),
- ('BambooService', 'Integrations::Bamboo'),
- ('BugzillaService', 'Integrations::Bugzilla'),
- ('BuildkiteService', 'Integrations::Buildkite'),
- ('CampfireService', 'Integrations::Campfire'),
- ('ConfluenceService', 'Integrations::Confluence'),
- ('CustomIssueTrackerService', 'Integrations::CustomIssueTracker'),
- ('DatadogService', 'Integrations::Datadog'),
- ('DiscordService', 'Integrations::Discord'),
- ('DroneCiService', 'Integrations::DroneCi'),
- ('EmailsOnPushService', 'Integrations::EmailsOnPush'),
- ('EwmService', 'Integrations::Ewm'),
- ('ExternalWikiService', 'Integrations::ExternalWiki'),
- ('FlowdockService', 'Integrations::Flowdock'),
- ('HangoutsChatService', 'Integrations::HangoutsChat'),
- ('IrkerService', 'Integrations::Irker'),
- ('JenkinsService', 'Integrations::Jenkins'),
- ('JiraService', 'Integrations::Jira'),
- ('MattermostService', 'Integrations::Mattermost'),
- ('MattermostSlashCommandsService', 'Integrations::MattermostSlashCommands'),
- ('MicrosoftTeamsService', 'Integrations::MicrosoftTeams'),
- ('MockCiService', 'Integrations::MockCi'),
- ('MockMonitoringService', 'Integrations::MockMonitoring'),
- ('PackagistService', 'Integrations::Packagist'),
- ('PipelinesEmailService', 'Integrations::PipelinesEmail'),
- ('PivotaltrackerService', 'Integrations::Pivotaltracker'),
- ('PrometheusService', 'Integrations::Prometheus'),
- ('PushoverService', 'Integrations::Pushover'),
- ('RedmineService', 'Integrations::Redmine'),
- ('SlackService', 'Integrations::Slack'),
- ('SlackSlashCommandsService', 'Integrations::SlackSlashCommands'),
- ('TeamcityService', 'Integrations::Teamcity'),
- ('UnifyCircuitService', 'Integrations::UnifyCircuit'),
- ('YoutrackService', 'Integrations::Youtrack'),
- ('WebexTeamsService', 'Integrations::WebexTeams'),
-
- -- EE-only integrations
- ('GithubService', 'Integrations::Github'),
- ('GitlabSlackApplicationService', 'Integrations::GitlabSlackApplication')
- )
-
- UPDATE integrations SET type_new = mapping.new_type
- FROM mapping
- WHERE integrations.id = NEW.id
- AND mapping.old_type = NEW.type;
- RETURN NULL;
- SQL
- end
- end
-end
diff --git a/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb b/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb
deleted file mode 100644
index b8e00ed9db0..00000000000
--- a/db/migrate/20210818185548_add_tag_ids_index_to_ci_pending_build.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddTagIdsIndexToCiPendingBuild < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_ci_pending_builds_on_tag_ids'
-
- def up
- add_concurrent_index(:ci_pending_builds, :tag_ids, name: INDEX_NAME, where: 'cardinality(tag_ids) > 0')
- end
-
- def down
- remove_concurrent_index_by_name(:ci_pending_builds, name: INDEX_NAME)
- end
-end
diff --git a/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb b/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb
deleted file mode 100644
index 4cfd54ac348..00000000000
--- a/db/migrate/20210818193008_add_file_template_project_to_service_desk_settings.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddFileTemplateProjectToServiceDeskSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- add_column :service_desk_settings, :file_template_project_id, :bigint, null: true
- end
-end
diff --git a/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb b/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb
deleted file mode 100644
index cc8aeecd2b5..00000000000
--- a/db/migrate/20210818200455_add_file_template_project_foreign_key_to_service_desk_settings.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddFileTemplateProjectForeignKeyToServiceDeskSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_service_desk_settings_on_file_template_project_id'
-
- def up
- add_concurrent_index :service_desk_settings, :file_template_project_id, name: INDEX_NAME
- add_concurrent_foreign_key :service_desk_settings, :projects, column: :file_template_project_id, on_delete: :nullify
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :service_desk_settings, column: :file_template_project_id
- end
-
- remove_concurrent_index_by_name :service_desk_settings, name: INDEX_NAME
- end
-end
diff --git a/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb b/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb
deleted file mode 100644
index 72d2755effa..00000000000
--- a/db/migrate/20210818220234_add_default_project_approval_rules_vuln_allowed.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class AddDefaultProjectApprovalRulesVulnAllowed < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- DEFAULT_VALUE = 0
-
- def up
- change_column_default :approval_project_rules, :vulnerabilities_allowed, DEFAULT_VALUE
-
- update_column_in_batches(:approval_project_rules, :vulnerabilities_allowed, DEFAULT_VALUE) do |table, query|
- query.where(table[:vulnerabilities_allowed].eq(nil))
- end
-
- change_column_null :approval_project_rules, :vulnerabilities_allowed, false
- end
-
- def down
- change_column_default :approval_project_rules, :vulnerabilities_allowed, nil
- change_column_null :approval_project_rules, :vulnerabilities_allowed, true
- end
-end
diff --git a/db/migrate/20210819120243_add_throttle_files_api_columns.rb b/db/migrate/20210819120243_add_throttle_files_api_columns.rb
deleted file mode 100644
index ace093c7b0c..00000000000
--- a/db/migrate/20210819120243_add_throttle_files_api_columns.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleFilesApiColumns < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :throttle_unauthenticated_files_api_requests_per_period, :integer, default: 125, null: false
- add_column :application_settings, :throttle_unauthenticated_files_api_period_in_seconds, :integer, default: 15, null: false
- add_column :application_settings, :throttle_authenticated_files_api_requests_per_period, :integer, default: 500, null: false
- add_column :application_settings, :throttle_authenticated_files_api_period_in_seconds, :integer, default: 15, null: false
-
- add_column :application_settings, :throttle_unauthenticated_files_api_enabled, :boolean, default: false, null: false
- add_column :application_settings, :throttle_authenticated_files_api_enabled, :boolean, default: false, null: false
- end
-end
diff --git a/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb b/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb
deleted file mode 100644
index a60141991a6..00000000000
--- a/db/migrate/20210819152723_remove_tmp_index_approval_project_rules_scanners.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveTmpIndexApprovalProjectRulesScanners < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'tmp_index_approval_project_rules_scanners'
-
- def up
- remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME
- end
-
- def down
- add_concurrent_index :approval_project_rules, :scanners, name: INDEX_NAME, using: :gin, where: "scanners @> '{cluster_image_scanning}'"
- end
-end
diff --git a/db/migrate/20210819153805_set_default_job_token_scope_true.rb b/db/migrate/20210819153805_set_default_job_token_scope_true.rb
deleted file mode 100644
index 4536f664950..00000000000
--- a/db/migrate/20210819153805_set_default_job_token_scope_true.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class SetDefaultJobTokenScopeTrue < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: false, to: true
- end
- end
-
- def down
- with_lock_retries do
- change_column_default :project_ci_cd_settings, :job_token_scope_enabled, from: true, to: false
- end
- end
-end
diff --git a/db/migrate/20210819162047_add_columns_to_namespace_settings.rb b/db/migrate/20210819162047_add_columns_to_namespace_settings.rb
deleted file mode 100644
index f617990582a..00000000000
--- a/db/migrate/20210819162047_add_columns_to_namespace_settings.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddColumnsToNamespaceSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- add_column :namespace_settings, :setup_for_company, :boolean
- add_column :namespace_settings, :jobs_to_be_done, :smallint
- end
- end
-
- def down
- with_lock_retries do
- remove_column :namespace_settings, :setup_for_company
- remove_column :namespace_settings, :jobs_to_be_done
- end
- end
-end
diff --git a/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb b/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb
deleted file mode 100644
index bf0725a77a0..00000000000
--- a/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class CreateExternalAuditEventDestinationsTable < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- create_table :audit_events_external_audit_event_destinations do |t|
- t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade }
- t.text :destination_url, null: false, limit: 255 # rubocop:disable Migration/AddLimitToTextColumns
- t.timestamps_with_timezone null: false
-
- t.index [:namespace_id, :destination_url], unique: true, name: 'index_external_audit_event_destinations_on_namespace_id'
- end
- end
-end
diff --git a/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb b/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb
deleted file mode 100644
index 9d5322de498..00000000000
--- a/db/migrate/20210820171834_add_foreign_keys_for_pending_issue_escalations.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddForeignKeysForPendingIssueEscalations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_partitioned_foreign_key :incident_management_pending_issue_escalations,
- :incident_management_escalation_rules,
- column: :rule_id
-
- add_concurrent_partitioned_foreign_key :incident_management_pending_issue_escalations,
- :issues,
- column: :issue_id
- end
-
- def down
- remove_foreign_key_if_exists :incident_management_pending_issue_escalations, :incident_management_escalation_rules, column: :rule_id
- remove_foreign_key_if_exists :incident_management_pending_issue_escalations, :issues, column: :issue_id
- end
-end
diff --git a/db/migrate/20210823172643_create_user_group_callout.rb b/db/migrate/20210823172643_create_user_group_callout.rb
deleted file mode 100644
index 72341c0b275..00000000000
--- a/db/migrate/20210823172643_create_user_group_callout.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class CreateUserGroupCallout < ActiveRecord::Migration[6.1]
- def up
- create_table :user_group_callouts do |t|
- t.bigint :user_id, null: false
- t.bigint :group_id, null: false
- t.integer :feature_name, limit: 2, null: false
- t.datetime_with_timezone :dismissed_at
-
- t.index :group_id
- t.index [:user_id, :feature_name, :group_id], unique: true, name: 'index_group_user_callouts_feature'
- end
- end
-
- def down
- drop_table :user_group_callouts
- end
-end
diff --git a/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb b/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb
deleted file mode 100644
index 3bbd9c1259e..00000000000
--- a/db/migrate/20210823213417_create_dependency_proxy_image_ttl_group_policies.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class CreateDependencyProxyImageTtlGroupPolicies < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- create_table :dependency_proxy_image_ttl_group_policies, id: false do |t|
- t.timestamps_with_timezone null: false
- t.references :group, primary_key: true, default: nil, index: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }
- t.integer :ttl, default: 90
- t.boolean :enabled, null: false, default: false
- end
- end
- end
-
- def down
- with_lock_retries do
- drop_table :dependency_proxy_image_ttl_group_policies
- end
- end
-end
diff --git a/db/migrate/20210824055322_add_project_namespace_id_to_project.rb b/db/migrate/20210824055322_add_project_namespace_id_to_project.rb
deleted file mode 100644
index 9397ad4aab2..00000000000
--- a/db/migrate/20210824055322_add_project_namespace_id_to_project.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceIdToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- # This is being added to Projects as a replacement for Namespace
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/337099
- add_column :projects, :project_namespace_id, :bigint # rubocop: disable Migration/AddColumnsToWideTables
- end
- end
-
- def down
- with_lock_retries do
- remove_column :projects, :project_namespace_id
- end
- end
-end
diff --git a/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb b/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb
deleted file mode 100644
index 5c2391f68ed..00000000000
--- a/db/migrate/20210824105038_add_timestamp_columns_to_ci_build_trace_metadata.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-# frozen_string_literal: true
-
-class AddTimestampColumnsToCiBuildTraceMetadata < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_build_trace_metadata, :last_archival_attempt_at, :datetime_with_timezone
- add_column :ci_build_trace_metadata, :archived_at, :datetime_with_timezone
- end
-end
diff --git a/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb b/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb
deleted file mode 100644
index 15b580af737..00000000000
--- a/db/migrate/20210824160459_add_notification_level_to_ci_namespace_monthly_usages.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class AddNotificationLevelToCiNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0]
- def change
- add_column :ci_namespace_monthly_usages, :notification_level, :integer, limit: 2, default: 100, null: false
- end
-end
diff --git a/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb b/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb
deleted file mode 100644
index 4663cc513da..00000000000
--- a/db/migrate/20210825104558_change_description_limit_error_tracking_event.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ChangeDescriptionLimitErrorTrackingEvent < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- remove_text_limit :error_tracking_error_events, :description
- add_text_limit :error_tracking_error_events, :description, 1024
- end
-
- def down
- remove_text_limit :error_tracking_error_events, :description
- add_text_limit :error_tracking_error_events, :description, 255
- end
-end
diff --git a/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb b/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb
deleted file mode 100644
index 2e89dfeacbf..00000000000
--- a/db/migrate/20210825104656_create_analytics_cycle_analytics_merge_request_stage_events.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsMergeRequestStageEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
- include Gitlab::Database::MigrationHelpers
-
- def up
- execute <<~SQL
- CREATE TABLE analytics_cycle_analytics_merge_request_stage_events (
- stage_event_hash_id bigint NOT NULL,
- merge_request_id bigint NOT NULL,
- group_id bigint NOT NULL,
- project_id bigint NOT NULL,
- milestone_id bigint,
- author_id bigint,
- start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone,
- PRIMARY KEY (stage_event_hash_id, merge_request_id)
- ) PARTITION BY HASH (stage_event_hash_id)
- SQL
-
- create_hash_partitions :analytics_cycle_analytics_merge_request_stage_events, 32
- end
-
- def down
- drop_table :analytics_cycle_analytics_merge_request_stage_events
- end
-end
diff --git a/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb b/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb
deleted file mode 100644
index acc1d96bd23..00000000000
--- a/db/migrate/20210825110016_create_analytics_cycle_analytics_issue_stage_events.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class CreateAnalyticsCycleAnalyticsIssueStageEvents < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
- include Gitlab::Database::MigrationHelpers
-
- def up
- execute <<~SQL
- CREATE TABLE analytics_cycle_analytics_issue_stage_events (
- stage_event_hash_id integer NOT NULL,
- issue_id integer NOT NULL,
- group_id integer NOT NULL,
- project_id integer NOT NULL,
- milestone_id integer,
- author_id integer,
- start_event_timestamp timestamp with time zone NOT NULL,
- end_event_timestamp timestamp with time zone,
- PRIMARY KEY (stage_event_hash_id, issue_id)
- ) PARTITION BY HASH (stage_event_hash_id)
- SQL
-
- create_hash_partitions :analytics_cycle_analytics_issue_stage_events, 32
- end
-
- def down
- drop_table :analytics_cycle_analytics_issue_stage_events
- end
-end
diff --git a/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb b/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb
deleted file mode 100644
index dc3270dc5a7..00000000000
--- a/db/migrate/20210825190458_add_user_deactivation_email_option_to_application_settings.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class AddUserDeactivationEmailOptionToApplicationSettings < ActiveRecord::Migration[6.1]
- def change
- add_column :application_settings, :user_deactivation_emails_enabled, :boolean, default: true, null: false
- end
-end
diff --git a/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb b/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb
deleted file mode 100644
index cbe7d08894e..00000000000
--- a/db/migrate/20210825193448_add_iteration_cadence_id_to_issue_boards.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class AddIterationCadenceIdToIssueBoards < Gitlab::Database::Migration[1.0]
- enable_lock_retries!
-
- def change
- add_column :boards, :iteration_cadence_id, :bigint
- end
-end
diff --git a/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb b/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb
deleted file mode 100644
index 2149265b4e7..00000000000
--- a/db/migrate/20210826120834_add_locked_to_ci_job_artifacts.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-class AddLockedToCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
- COLUMN_NAME = 'locked'
-
- def up
- with_lock_retries do
- add_column TABLE_NAME, COLUMN_NAME, :smallint, default: 2
- end
- end
-
- def down
- with_lock_retries do
- remove_column TABLE_NAME, COLUMN_NAME
- end
- end
-end
diff --git a/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb b/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb
deleted file mode 100644
index 5abea4393b4..00000000000
--- a/db/migrate/20210826122748_create_loose_foreign_keys_deleted_records.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class CreateLooseForeignKeysDeletedRecords < ActiveRecord::Migration[6.1]
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- def up
- constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'deleted_table_name', 'max_length')
- execute(<<~SQL)
- CREATE TABLE loose_foreign_keys_deleted_records (
- created_at timestamp with time zone NOT NULL DEFAULT NOW(),
- deleted_table_name text NOT NULL,
- deleted_table_primary_key_value bigint NOT NULL,
- PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value),
- CONSTRAINT #{constraint_name} CHECK ((char_length(deleted_table_name) <= 63))
- ) PARTITION BY RANGE (created_at);
- SQL
-
- min_date = Date.today - 1.month
- max_date = Date.today + 3.months
- create_daterange_partitions('loose_foreign_keys_deleted_records', 'created_at', min_date, max_date)
- end
-
- def down
- drop_table :loose_foreign_keys_deleted_records
- end
-end
diff --git a/db/migrate/20210826124311_add_index_to_error_tracking_error.rb b/db/migrate/20210826124311_add_index_to_error_tracking_error.rb
deleted file mode 100644
index 5973331e487..00000000000
--- a/db/migrate/20210826124311_add_index_to_error_tracking_error.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToErrorTrackingError < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count'
- add_concurrent_index :error_tracking_errors, [:project_id, :status, :id], name: 'index_et_errors_on_project_id_and_status_and_id'
- end
-
- def down
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count'
- remove_concurrent_index :error_tracking_errors, [:project_id, :status, :id], name: 'index_et_errors_on_project_id_and_status_and_id'
- end
-end
diff --git a/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb b/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb
deleted file mode 100644
index 631cc27c8c0..00000000000
--- a/db/migrate/20210826145509_add_function_for_inserting_deleted_records.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class AddFunctionForInsertingDeletedRecords < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
-
- def up
- execute(<<~SQL)
- CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}()
- RETURNS TRIGGER AS
- $$
- BEGIN
- INSERT INTO loose_foreign_keys_deleted_records
- (deleted_table_name, deleted_table_primary_key_value)
- SELECT TG_TABLE_NAME, old_table.id FROM old_table
- ON CONFLICT DO NOTHING;
-
- RETURN NULL;
- END
- $$ LANGUAGE PLPGSQL
- SQL
- end
-
- def down
- drop_function(DELETED_RECORDS_INSERT_FUNCTION_NAME)
- end
-end
diff --git a/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb b/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb
deleted file mode 100644
index 675da2ea41c..00000000000
--- a/db/migrate/20210826170902_add_throttle_unauthenticated_api_columns.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class AddThrottleUnauthenticatedApiColumns < ActiveRecord::Migration[6.1]
- def change
- # The defaults match those from the current `throttle_unauthenticated_*` columns
- add_column :application_settings, :throttle_unauthenticated_api_enabled, :boolean, default: false, null: false
- add_column :application_settings, :throttle_unauthenticated_api_requests_per_period, :integer, default: 3600, null: false
- add_column :application_settings, :throttle_unauthenticated_api_period_in_seconds, :integer, default: 3600, null: false
- end
-end
diff --git a/db/migrate/20210602155110_init_schema.rb b/db/migrate/20210826171758_init_schema.rb
index 971a3e0e2db..971a3e0e2db 100644
--- a/db/migrate/20210602155110_init_schema.rb
+++ b/db/migrate/20210826171758_init_schema.rb
diff --git a/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb b/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb
new file mode 100644
index 00000000000..31d09e5ee8a
--- /dev/null
+++ b/db/migrate/20230130125541_add_attempts_and_last_error_to_postgres_async_indexes.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddAttemptsAndLastErrorToPostgresAsyncIndexes < Gitlab::Database::Migration[2.1]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
+ def change
+ add_column :postgres_async_indexes, :attempts, :integer, null: false, default: 0
+ add_column :postgres_async_indexes, :last_error, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb b/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
new file mode 100644
index 00000000000..1cd51453fd2
--- /dev/null
+++ b/db/migrate/20230130130624_add_text_limit_to_postgres_async_indexes_last_error.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToPostgresAsyncIndexesLastError < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :postgres_async_indexes, :last_error, 10_000
+ end
+
+ def down
+ remove_text_limit :postgres_async_indexes, :last_error
+ end
+end
diff --git a/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb b/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb
new file mode 100644
index 00000000000..b9c32f83411
--- /dev/null
+++ b/db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class CreatePostgresAsyncForeignKeyValidations < Gitlab::Database::Migration[2.1]
+ def change
+ create_table :postgres_async_foreign_key_validations, if_not_exists: true do |t|
+ t.timestamps_with_timezone null: false
+
+ t.text :name, null: false, limit: 63
+ t.text :table_name, null: false, limit: 63
+ t.text :last_error, limit: 10_000
+
+ t.integer :attempts, null: false, default: 0
+
+ t.index :name, unique: true
+ end
+ end
+end
diff --git a/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb b/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb
deleted file mode 100644
index dfd2806fece..00000000000
--- a/db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleLatestPipelineIdPopulation < ActiveRecord::Migration[6.1]
- def up
- # no-op: This migration has been marked as no-op and replaced by
- # `ReScheduleLatestPipelineIdPopulation` as we've found some problems.
- # For more information: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65280
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb b/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb
deleted file mode 100644
index b9b694012f2..00000000000
--- a/db/post_migrate/20210604133651_schedule_merge_request_diff_users_background_migration.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleMergeRequestDiffUsersBackgroundMigration < ActiveRecord::Migration[6.1]
- def up
- # no-op
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb b/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb
deleted file mode 100644
index 64d37054eb8..00000000000
--- a/db/post_migrate/20210606143426_add_index_for_container_registry_access_level.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexForContainerRegistryAccessLevel < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX = 'index_project_features_on_project_id_include_container_registry'
-
- def up
- if index_exists_by_name?('project_features', INDEX)
- Gitlab::AppLogger.warn "Index not created because it already exists (this may be due to an aborted migration or similar): table_name: project_features, index_name: #{INDEX}"
- return
- end
-
- begin
- disable_statement_timeout do
- execute "CREATE UNIQUE INDEX CONCURRENTLY #{INDEX} ON project_features " \
- 'USING btree (project_id) INCLUDE (container_registry_access_level)'
- end
- rescue ActiveRecord::StatementInvalid => ex
- raise "The index #{INDEX} couldn't be added: #{ex.message}"
- end
-
- create_comment(
- 'INDEX',
- INDEX,
- 'Included column (container_registry_access_level) improves performance of the ContainerRepository.for_group_and_its_subgroups scope query'
- )
- end
-
- def down
- remove_concurrent_index_by_name('project_features', INDEX)
- end
-end
diff --git a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb b/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb
deleted file mode 100644
index 596b643e079..00000000000
--- a/db/post_migrate/20210609125005_drop_non_partitioned_web_hook_logs.rb
+++ /dev/null
@@ -1,43 +0,0 @@
-# frozen_string_literal: true
-
-class DropNonPartitionedWebHookLogs < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers
-
- DOWNTIME = false
-
- def up
- drop_nonpartitioned_archive_table(:web_hook_logs)
- end
-
- def down
- execute(<<~SQL)
- CREATE TABLE web_hook_logs_archived (
- id integer NOT NULL,
- web_hook_id integer NOT NULL,
- trigger character varying,
- url character varying,
- request_headers text,
- request_data text,
- response_headers text,
- response_body text,
- response_status character varying,
- execution_duration double precision,
- internal_error_message character varying,
- created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
- );
-
- ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id);
-
- CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id);
- CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id);
-
- ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE;
- SQL
-
- with_lock_retries do
- create_trigger_to_sync_tables(:web_hook_logs, :web_hook_logs_archived, 'id')
- end
- end
-end
diff --git a/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb b/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb
deleted file mode 100644
index ed9a64c84ab..00000000000
--- a/db/post_migrate/20210609202501_schedule_backfill_draft_status_on_merge_requests.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillDraftStatusOnMergeRequests < ActiveRecord::Migration[6.1]
- def up
- # noop
- #
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb b/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb
deleted file mode 100644
index 9d37180326f..00000000000
--- a/db/post_migrate/20210610042700_remove_clusters_applications_fluentd_table.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveClustersApplicationsFluentdTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- drop_table :clusters_applications_fluentd
- end
-
- def down
- create_table :clusters_applications_fluentd do |t|
- t.integer :protocol, null: false, limit: 2
- t.integer :status, null: false
- t.integer :port, null: false
- t.references :cluster, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
- t.timestamps_with_timezone null: false
- t.string :version, null: false, limit: 255
- t.string :host, null: false, limit: 255
- t.boolean :cilium_log_enabled, default: true, null: false
- t.boolean :waf_log_enabled, default: true, null: false
- t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns
- end
- end
-end
diff --git a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb b/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
deleted file mode 100644
index 47a6e39e87a..00000000000
--- a/db/post_migrate/20210610102413_migrate_protected_attribute_to_pending_builds.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class MigrateProtectedAttributeToPendingBuilds < ActiveRecord::Migration[6.1]
- include ::Gitlab::Database::DynamicModelHelpers
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.dev_or_test_env? || Gitlab.com?
-
- each_batch_range('ci_pending_builds', connection: connection, of: 1000) do |min, max|
- execute <<~SQL
- UPDATE ci_pending_builds
- SET protected = true
- FROM ci_builds
- WHERE ci_pending_builds.build_id = ci_builds.id
- AND ci_builds.protected = true
- AND ci_pending_builds.id BETWEEN #{min} AND #{max}
- SQL
- end
- end
-
- def down
- # no op
- end
-end
diff --git a/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb b/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb
deleted file mode 100644
index 140bf7df4e6..00000000000
--- a/db/post_migrate/20210610113229_add_index_to_protected_pending_builds.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexToProtectedPendingBuilds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_ci_pending_builds_id_on_protected_partial'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :ci_pending_builds, :id, where: 'protected = true', name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_pending_builds, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb b/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb
deleted file mode 100644
index f4827c0bbc0..00000000000
--- a/db/post_migrate/20210610141711_disable_expiration_policies_linked_to_no_container_images.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class DisableExpirationPoliciesLinkedToNoContainerImages < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- BATCH_SIZE = 1000
-
- class ContainerExpirationPolicy < ActiveRecord::Base
- include ::EachBatch
- self.table_name = 'container_expiration_policies'
- end
-
- def up
- ContainerExpirationPolicy.where(enabled: true).each_batch(of: BATCH_SIZE) do |batch, _|
- sql = <<-SQL
- WITH batched_relation AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} (#{batch.limit(BATCH_SIZE).to_sql})
- UPDATE container_expiration_policies
- SET enabled = FALSE
- FROM batched_relation
- WHERE container_expiration_policies.project_id = batched_relation.project_id
- AND NOT EXISTS (SELECT 1 FROM "container_repositories" WHERE container_repositories.project_id = container_expiration_policies.project_id)
- SQL
- execute(sql)
- end
- end
-
- def down
- # no-op
-
- # we can't accuretaly know which policies were previously enabled during `#up`
- end
-end
diff --git a/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb b/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb
deleted file mode 100644
index 45728ef26f5..00000000000
--- a/db/post_migrate/20210611080951_fix_missing_traversal_ids.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class FixMissingTraversalIds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- ROOTS_MIGRATION = 'BackfillNamespaceTraversalIdsRoots'
- CHILDREN_MIGRATION = 'BackfillNamespaceTraversalIdsChildren'
- DOWNTIME = false
- BATCH_SIZE = 1_000
- SUB_BATCH_SIZE = 50
- DELAY_INTERVAL = 2.minutes
- ROOT_NS_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_root_namespaces'
- CHILD_INDEX_NAME = 'tmp_index_namespaces_empty_traversal_ids_with_child_namespaces'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :namespaces, :id, where: "parent_id IS NULL AND traversal_ids = '{}'", name: ROOT_NS_INDEX_NAME
- add_concurrent_index :namespaces, :id, where: "parent_id IS NOT NULL AND traversal_ids = '{}'", name: CHILD_INDEX_NAME
-
- # Personal namespaces and top-level groups
- final_delay = queue_background_migration_jobs_by_range_at_intervals(
- ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots::Namespace.base_query.where("traversal_ids = '{}'"),
- ROOTS_MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- other_job_arguments: [SUB_BATCH_SIZE],
- track_jobs: true
- )
- final_delay += DELAY_INTERVAL
-
- # Subgroups
- queue_background_migration_jobs_by_range_at_intervals(
- ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren::Namespace.base_query.where("traversal_ids = '{}'"),
- CHILDREN_MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- initial_delay: final_delay,
- other_job_arguments: [SUB_BATCH_SIZE],
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name :namespaces, ROOT_NS_INDEX_NAME
- remove_concurrent_index_by_name :namespaces, CHILD_INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb b/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb
deleted file mode 100644
index 9d40fe30ed6..00000000000
--- a/db/post_migrate/20210614124111_add_devops_adoption_sast_dast_indexes.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class AddDevopsAdoptionSastDastIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_SAST = 'index_ci_job_artifacts_sast_for_devops_adoption'
- INDEX_DAST = 'index_ci_job_artifacts_dast_for_devops_adoption'
-
- def up
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 5", name: INDEX_SAST
- add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 8", name: INDEX_DAST
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_SAST
- remove_concurrent_index_by_name :ci_job_artifacts, INDEX_DAST
- end
-end
diff --git a/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb b/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb
deleted file mode 100644
index 818aea39762..00000000000
--- a/db/post_migrate/20210615234935_fix_batched_migrations_old_format_job_arguments.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-# frozen_string_literal: true
-
-class FixBatchedMigrationsOldFormatJobArguments < ActiveRecord::Migration[6.1]
- class BatchedMigration < ActiveRecord::Base
- self.table_name = 'batched_background_migrations'
- end
-
- def up
- # rubocop:disable Style/WordArray
- [
- ['events', 'id', ['id', 'id_convert_to_bigint'], [['id'], ['id_convert_to_bigint']]],
- ['push_event_payloads', 'event_id', ['event_id', 'event_id_convert_to_bigint'], [['event_id'], ['event_id_convert_to_bigint']]]
- ].each do |table_name, column_name, legacy_job_arguments, current_job_arguments|
- base_scope = BatchedMigration
- .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob', table_name: table_name, column_name: column_name)
- # rubocop:enable Style/WordArray
-
- # rubocop:disable Rails/WhereEquals
- base_scope
- .where('job_arguments = ?', Gitlab::Json.dump(legacy_job_arguments))
- .where('NOT EXISTS (?)', base_scope.select('1').where('job_arguments = ?', Gitlab::Json.dump(current_job_arguments)))
- .update_all(job_arguments: current_job_arguments)
- # rubocop:enable Rails/WhereEquals
- end
- end
-
- def down
- # No-op, there is no way to know were the existing record migrated from
- # legacy job arguments, or were using the current format from the start.
- # There is no reason to go back anyway.
- end
-end
diff --git a/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb b/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb
deleted file mode 100644
index 6e169a6f0e1..00000000000
--- a/db/post_migrate/20210616145254_add_partial_index_for_ci_builds_token.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddPartialIndexForCiBuildsToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NAME = 'index_ci_builds_on_token_partial'
-
- def up
- add_concurrent_index :ci_builds, :token, unique: true, where: 'token IS NOT NULL', name: NAME
- end
-
- def down
- remove_concurrent_index_by_name :ci_builds, NAME
- end
-end
diff --git a/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb b/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb
deleted file mode 100644
index 71fd61072ac..00000000000
--- a/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-#
-class AddCiArtifactsDevopsAdoptionIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- NEW_INDEX = 'index_ci_job_artifacts_on_file_type_for_devops_adoption'
-
- def up
- add_concurrent_index :ci_job_artifacts, [:file_type, :project_id, :created_at], name: NEW_INDEX, where: 'file_type IN (5,6,8,23)'
- end
-
- def down
- remove_concurrent_index_by_name :ci_job_artifacts, NEW_INDEX
- end
-end
diff --git a/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb b/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb
deleted file mode 100644
index 498090c3ab9..00000000000
--- a/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-# frozen_string_literal: true
-
-class ReplaceProjectAuthorizationsProjectIdIndex < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- OLD_INDEX_NAME = 'index_project_authorizations_on_project_id'
- NEW_INDEX_NAME = 'index_project_authorizations_on_project_id_user_id'
-
- def up
- add_concurrent_index(:project_authorizations, [:project_id, :user_id], name: NEW_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, OLD_INDEX_NAME)
- end
-
- def down
- add_concurrent_index(:project_authorizations, :project_id, name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, NEW_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb b/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb
deleted file mode 100644
index 0430c8447d9..00000000000
--- a/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class DropRemoveOnCloseFromLabels < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # Migration that adds column was reverted, but run in Gitlab SaaS stg and prod
- return unless column_exists?(:labels, :remove_on_close)
-
- with_lock_retries do
- remove_column :labels, :remove_on_close
- end
- end
-
- def down
- # No rollback as the original migration was reverted in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62056
- # up simply removes the column from envs where the original migration was run
- end
-end
diff --git a/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb b/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb
deleted file mode 100644
index 8d326036a68..00000000000
--- a/db/post_migrate/20210621223000_steal_background_jobs_that_reference_services.rb
+++ /dev/null
@@ -1,14 +0,0 @@
-# frozen_string_literal: true
-
-class StealBackgroundJobsThatReferenceServices < ActiveRecord::Migration[6.1]
- def up
- Gitlab::BackgroundMigration.steal('BackfillJiraTrackerDeploymentType2')
- Gitlab::BackgroundMigration.steal('FixProjectsWithoutPrometheusService')
- Gitlab::BackgroundMigration.steal('MigrateIssueTrackersSensitiveData')
- Gitlab::BackgroundMigration.steal('RemoveDuplicateServices')
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb b/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb
deleted file mode 100644
index 803a6fa0aca..00000000000
--- a/db/post_migrate/20210621223242_finalize_rename_services_to_integrations.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeRenameServicesToIntegrations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- finalize_table_rename(:services, :integrations)
- end
-
- def down
- undo_finalize_table_rename(:services, :integrations)
- end
-end
diff --git a/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb b/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb
deleted file mode 100644
index f37c446f66c..00000000000
--- a/db/post_migrate/20210622041846_finalize_push_event_payloads_bigint_conversion.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'push_event_payloads'
- INDEX_NAME = 'index_push_event_payloads_on_event_id_convert_to_bigint'
-
- def up
- return unless should_run?
-
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'event_id',
- job_arguments: [["event_id"], ["event_id_convert_to_bigint"]]
- )
-
- swap_columns
- end
-
- def down
- return unless should_run?
-
- swap_columns
- end
-
- private
-
- def should_run?
- Gitlab.dev_or_test_env? || Gitlab.com?
- end
-
- def swap_columns
- add_concurrent_index TABLE_NAME, :event_id_convert_to_bigint, unique: true, name: INDEX_NAME
-
- # Add a foreign key on `event_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_36c74129da)
- add_concurrent_foreign_key TABLE_NAME, :events, column: :event_id_convert_to_bigint, on_delete: :cascade
-
- with_lock_retries(raise_on_exhaustion: true) do
- # Swap column names
- temp_name = 'event_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id_convert_to_bigint)} TO #{quote_column_name(:event_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:event_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:event_id, :event_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :event_id, nil
- change_column_default TABLE_NAME, :event_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT push_event_payloads_pkey"
- rename_index TABLE_NAME, INDEX_NAME, 'push_event_payloads_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT push_event_payloads_pkey PRIMARY KEY USING INDEX push_event_payloads_pkey"
-
- # Drop original FK on the old int4 `event_id` (fk_36c74129da)
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :event_id)
- # We swapped the columns but the FK for event_id is still using the old name for the event_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :event_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :event_id)
- )
- end
- end
-end
diff --git a/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb b/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb
deleted file mode 100644
index 1f0bdfc5012..00000000000
--- a/db/post_migrate/20210622045705_finalize_events_bigint_conversion.rb
+++ /dev/null
@@ -1,86 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeEventsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'events'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["id"], ["id_convert_to_bigint"]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "events_pkey" PRIMARY KEY, btree (id)
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_events_on_id_convert_to_bigint'
- # This is to replace the existing "index_events_on_project_id_and_id" btree (project_id, id)
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], name: 'index_events_on_project_id_and_id_convert_to_bigint'
- # This is to replace the existing "index_events_on_project_id_and_id_desc_on_merged_action" btree (project_id, id DESC) WHERE action = 7
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], order: { id_convert_to_bigint: :desc },
- where: "action = 7", name: 'index_events_on_project_id_and_id_bigint_desc_on_merged_action'
-
- # Add a FK on `push_event_payloads(event_id)` to `id_convert_to_bigint`, the old FK (fk_36c74129da)
- # will be removed when events_pkey constraint is droppped.
- fk_event_id = concurrent_foreign_key_name(:push_event_payloads, :event_id)
- fk_event_id_tmp = "#{fk_event_id}_tmp"
- add_concurrent_foreign_key :push_event_payloads, TABLE_NAME,
- column: :event_id, target_column: :id_convert_to_bigint,
- name: fk_event_id_tmp, on_delete: :cascade, reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start.
- # Lock order should be
- # 1. events
- # 2. push_event_payloads
- # in order to match the order in EventCreateService#create_push_event,
- # and avoid deadlocks.
- execute "LOCK TABLE #{TABLE_NAME}, push_event_payloads IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE events_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('events_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT events_pkey CASCADE" # this will drop fk_36c74129da
- rename_index TABLE_NAME, 'index_events_on_id_convert_to_bigint', 'events_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT events_pkey PRIMARY KEY USING INDEX events_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_events_on_project_id_and_id'
- rename_index TABLE_NAME, 'index_events_on_project_id_and_id_convert_to_bigint', 'index_events_on_project_id_and_id'
- execute 'DROP INDEX index_events_on_project_id_and_id_desc_on_merged_action'
- rename_index TABLE_NAME, 'index_events_on_project_id_and_id_bigint_desc_on_merged_action', 'index_events_on_project_id_and_id_desc_on_merged_action'
-
- # Change the name of the temporary FK
- rename_constraint(:push_event_payloads, fk_event_id_tmp, fk_event_id)
- end
- end
-end
diff --git a/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb b/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb
deleted file mode 100644
index a38cb68ff08..00000000000
--- a/db/post_migrate/20210622141148_schedule_delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleDeleteOrphanedDeployments < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- MIGRATION = 'DeleteOrphanedDeployments'
- BATCH_SIZE = 100_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- # no-op.
- # This background migration is rescheduled in 20210722010101_cleanup_delete_orphaned_deployments_background_migration.rb
- # with a smaller batch size, because the initial attempt caused
- # 80 failures out of 1639 batches (faiulre rate is 4.88%) due to statement timeouts,
- # that takes approx. 1 hour to perform a cleanup/sync migration.
- # See https://gitlab.com/gitlab-org/gitlab/-/issues/335071#note_618380503 for more information.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb b/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
deleted file mode 100644
index 1176e704d0a..00000000000
--- a/db/post_migrate/20210628124505_reset_job_token_scope_enabled.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class ResetJobTokenScopeEnabled < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- # Irreversible
- end
-end
diff --git a/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb b/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb
deleted file mode 100644
index 371298aef62..00000000000
--- a/db/post_migrate/20210629101712_remove_deprecated_modsecurity_columns.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDeprecatedModsecurityColumns < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_clusters_applications_ingress_on_modsecurity'
-
- def up
- remove_column :clusters_applications_ingress, :modsecurity_enabled if column_exists?(:clusters_applications_ingress, :modsecurity_enabled)
- remove_column :clusters_applications_ingress, :modsecurity_mode if column_exists?(:clusters_applications_ingress, :modsecurity_mode)
- end
-
- def down
- add_column :clusters_applications_ingress, :modsecurity_enabled, :boolean unless column_exists?(:clusters_applications_ingress, :modsecurity_enabled)
- add_column :clusters_applications_ingress, :modsecurity_mode, :smallint, null: false, default: 0 unless column_exists?(:clusters_applications_ingress, :modsecurity_mode)
-
- add_concurrent_index :clusters_applications_ingress, [:modsecurity_enabled, :modsecurity_mode, :cluster_id], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb b/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb
deleted file mode 100644
index cc26db924fe..00000000000
--- a/db/post_migrate/20210629104933_drop_index_on_ci_builds_for_token.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class DropIndexOnCiBuildsForToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEXNAME = :index_ci_builds_on_token
-
- def up
- remove_concurrent_index_by_name :ci_builds, INDEXNAME
- end
-
- def down
- add_concurrent_index :ci_builds, :token, unique: true, name: INDEXNAME
- end
-end
diff --git a/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb b/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb
deleted file mode 100644
index 834a23a5c7a..00000000000
--- a/db/post_migrate/20210630025020_migrate_push_event_payloads_event_id_back_to_integer_for_gitlab_com.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-require Rails.root.join('db', 'post_migrate', '20210622041846_finalize_push_event_payloads_bigint_conversion')
-
-class MigratePushEventPayloadsEventIdBackToIntegerForGitlabCom < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- def up
- FinalizePushEventPayloadsBigintConversion.new.down
- end
-
- def down
- FinalizePushEventPayloadsBigintConversion.new.up
- end
-end
diff --git a/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb b/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb
deleted file mode 100644
index 89a39660a04..00000000000
--- a/db/post_migrate/20210701033622_finalize_ci_builds_needs_bigint_conversion.rb
+++ /dev/null
@@ -1,69 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsNeedsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_build_needs'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_build_needs_on_build_id_and_name" UNIQUE, btree (build_id, name)
- add_concurrent_index TABLE_NAME, [:build_id_convert_to_bigint, :name], unique: true, name: 'index_ci_build_needs_on_build_id_convert_to_bigint_and_name'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_rails_3cf221d4ed)
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :build_id_convert_to_bigint, on_delete: :cascade,
- name: 'fk_rails_3cf221d4ed_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_build_needs_on_build_id_and_name'
- rename_index TABLE_NAME, 'index_ci_build_needs_on_build_id_convert_to_bigint_and_name', 'index_ci_build_needs_on_build_id_and_name'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_3cf221d4ed)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_3cf221d4ed'
- # We swapped the columns but the FK for buil_id is still using the temporary name for the buil_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_3cf221d4ed_tmp', 'fk_rails_3cf221d4ed')
- end
- end
-end
diff --git a/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb b/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb
deleted file mode 100644
index 0afc0bc1d08..00000000000
--- a/db/post_migrate/20210701111909_backfill_issues_upvotes_count.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIssuesUpvotesCount < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillUpvotesCountOnIssues'
- DELAY_INTERVAL = 2.minutes
- BATCH_SIZE = 5_000
-
- def up
- scope = Issue.joins("INNER JOIN award_emoji e ON e.awardable_id = issues.id AND e.awardable_type = 'Issue' AND e.name = 'thumbsup'")
-
- queue_background_migration_jobs_by_range_at_intervals(
- scope,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb b/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb
deleted file mode 100644
index 776f1ad545d..00000000000
--- a/db/post_migrate/20210701141346_finalize_ci_builds_stage_id_bigint_conversion.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsStageIdBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id stage_id], %w[id_convert_to_bigint stage_id_convert_to_bigint]]
- )
-
- swap_columns
- end
-
- def down
- swap_columns
- end
-
- private
-
- def swap_columns
- # Create a copy of the original column's index on the new column
- add_concurrent_index TABLE_NAME, :stage_id_convert_to_bigint, name: :index_ci_builds_on_converted_stage_id # rubocop:disable Migration/PreventIndexCreation
-
- # Create a copy of the original column's FK on the new column
- add_concurrent_foreign_key TABLE_NAME, :ci_stages, column: :stage_id_convert_to_bigint, on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- quoted_table_name = quote_table_name(TABLE_NAME)
- quoted_referenced_table_name = quote_table_name(:ci_stages)
-
- # Acquire locks up-front, not just to the build table but the FK's referenced table
- execute "LOCK TABLE #{quoted_referenced_table_name}, #{quoted_table_name} IN ACCESS EXCLUSIVE MODE"
-
- # Swap the column names of the two columns
- temporary_name = 'stage_id_tmp'
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:stage_id)} TO #{quote_column_name(temporary_name)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:stage_id_convert_to_bigint)} TO #{quote_column_name(:stage_id)}"
- execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(temporary_name)} TO #{quote_column_name(:stage_id_convert_to_bigint)}"
-
- # Reset the function so PG drops the plan cache for the incorrect integer type
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection)
- .name([:id, :stage_id], [:id_convert_to_bigint, :stage_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Remove the original column index, and rename the new column index to the original name
- execute 'DROP INDEX index_ci_builds_on_stage_id'
- rename_index TABLE_NAME, :index_ci_builds_on_converted_stage_id, :index_ci_builds_on_stage_id
-
- # Remove the original column foreign key, and rename the new column foreign key to the original name
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :stage_id)
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :stage_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :stage_id))
- end
- end
-end
diff --git a/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb b/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb
deleted file mode 100644
index a9f6d4ea2d9..00000000000
--- a/db/post_migrate/20210705143150_backfill_ci_builds_metadata_id_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCiBuildsMetadataIdForBigintConversion < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- include Gitlab::Database::MigrationHelpers
-
- TABLE = :ci_builds_metadata
- COLUMN = :id
-
- def up
- backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100
- end
-
- def down
- revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN
- end
-end
diff --git a/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb b/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb
deleted file mode 100644
index 7224e84c1b3..00000000000
--- a/db/post_migrate/20210706112800_remove_cloud_license_enabled_from_application_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveCloudLicenseEnabledFromApplicationSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- with_lock_retries do
- remove_column :application_settings, :cloud_license_enabled
- end
- end
-
- def down
- with_lock_retries do
- add_column :application_settings, :cloud_license_enabled, :boolean, null: false, default: false
- end
- end
-end
diff --git a/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb b/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb
deleted file mode 100644
index 65ec43930ea..00000000000
--- a/db/post_migrate/20210706115312_add_upvotes_count_index_to_issues.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpvotesCountIndexToIssues < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_issues_on_project_id_and_upvotes_count'
-
- def up
- add_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index :issues, [:project_id, :upvotes_count], name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb b/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb
deleted file mode 100644
index 73344ee061f..00000000000
--- a/db/post_migrate/20210706120847_remove_framework_column_from_compliance_management_frameworks.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveFrameworkColumnFromComplianceManagementFrameworks < ActiveRecord::Migration[6.1]
- def change
- remove_column :project_compliance_framework_settings, :framework, :smallint
- end
-end
diff --git a/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb b/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb
deleted file mode 100644
index 255b64f9bc7..00000000000
--- a/db/post_migrate/20210706142819_re_schedule_latest_pipeline_id_population.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulation < ActiveRecord::Migration[6.1]
- def change
- # no-op: This migration has been marked as no-op and replaced by
- # `ReScheduleLatestPipelineIdPopulationWithLogging` as we've found some problems.
- # For more information: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66050
- end
-end
diff --git a/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb b/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb
deleted file mode 100644
index 11045348672..00000000000
--- a/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class FinalizeCiJobArtifactsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_job_artifact_on_id_convert_to_bigint'
- # This is to replace the existing "index_ci_job_artifacts_for_terraform_reports" btree (project_id, id) where (file_type = 18)
- add_concurrent_index TABLE_NAME, [:project_id, :id_convert_to_bigint], name: 'index_ci_job_artifacts_for_terraform_reports_bigint', where: "file_type = 18"
- # This is to replace the existing "index_ci_job_artifacts_id_for_terraform_reports" btree (id) where (file_type = 18)
- add_concurrent_index TABLE_NAME, [:id_convert_to_bigint], name: 'index_ci_job_artifacts_id_for_terraform_reports_bigint', where: "file_type = 18"
-
- # Add a FK on `project_pages_metadata(artifacts_archive_id)` to `id_convert_to_bigint`, the old FK (fk_69366a119e)
- # will be removed when ci_job_artifacts_pkey constraint is droppped.
- fk_artifacts_archive_id = concurrent_foreign_key_name(:project_pages_metadata, :artifacts_archive_id)
- fk_artifacts_archive_id_tmp = "#{fk_artifacts_archive_id}_tmp"
- add_concurrent_foreign_key :project_pages_metadata, TABLE_NAME,
- column: :artifacts_archive_id, target_column: :id_convert_to_bigint,
- name: fk_artifacts_archive_id_tmp,
- on_delete: :nullify,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME}, project_pages_metadata IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :job_id], [:id_convert_to_bigint, :job_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_job_artifacts_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_job_artifacts_pkey CASCADE" # this will drop ci_job_artifacts_pkey primary key
- rename_index TABLE_NAME, 'index_ci_job_artifact_on_id_convert_to_bigint', 'ci_job_artifacts_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY USING INDEX ci_job_artifacts_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_ci_job_artifacts_for_terraform_reports'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_for_terraform_reports_bigint', 'index_ci_job_artifacts_for_terraform_reports'
- execute 'DROP INDEX index_ci_job_artifacts_id_for_terraform_reports'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_id_for_terraform_reports_bigint', 'index_ci_job_artifacts_id_for_terraform_reports'
-
- # Change the name of the temporary FK for project_pages_metadata(artifacts_archive_id) -> id
- rename_constraint(:project_pages_metadata, fk_artifacts_archive_id_tmp, fk_artifacts_archive_id)
- end
- end
-end
diff --git a/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb b/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb
deleted file mode 100644
index f3ce32ad9c8..00000000000
--- a/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class FinalizeCiStagesBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_stages'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['id'], ['id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- # This will replace the existing ci_stages_pkey index for the primary key
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_stages_on_id_convert_to_bigint'
-
- # This will replace the existing ci_stages_on_pipeline_id_and_id index
- add_concurrent_index TABLE_NAME, [:pipeline_id, :id_convert_to_bigint],
- name: 'index_ci_stages_on_pipeline_id_and_id_convert_to_bigint',
- where: 'status in (0, 1, 2, 8, 9, 10)'
-
- # Add a foreign key on ci_builds(stage_id_convert_to_bigint), which we'll rename later. Give it the correct final name
- fk_stage_id = concurrent_foreign_key_name(:ci_builds, :stage_id)
- fk_stage_id_tmp = "#{fk_stage_id}_tmp"
- add_concurrent_foreign_key :ci_builds, :ci_stages, column: :stage_id,
- target_column: :id_convert_to_bigint,
- name: fk_stage_id_tmp,
- on_delete: :cascade,
- reverse_lock_order: true
-
- # Now it's time to do things in a transaction
- with_lock_retries(raise_on_exhaustion: true) do
- execute "LOCK TABLE #{TABLE_NAME}, ci_builds IN ACCESS EXCLUSIVE MODE"
-
- temp_name = quote_column_name('id_tmp')
- id_name = quote_column_name(:id)
- id_convert_to_bigint_name = quote_column_name(:id_convert_to_bigint)
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_name} TO #{temp_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_convert_to_bigint_name} TO #{id_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{id_convert_to_bigint_name}"
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE ci_stages_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_stages_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap pkey constraint
- # This will drop fk_3a9eaa254d (ci_builds(stage_id) references ci_stages(id))
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_stages_pkey CASCADE"
- rename_index TABLE_NAME, 'index_ci_stages_on_id_convert_to_bigint', 'ci_stages_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_stages_pkey PRIMARY KEY USING INDEX ci_stages_pkey"
-
- # Rename the other indexes
- execute "DROP INDEX index_ci_stages_on_pipeline_id_and_id"
- rename_index TABLE_NAME, 'index_ci_stages_on_pipeline_id_and_id_convert_to_bigint', 'index_ci_stages_on_pipeline_id_and_id'
-
- rename_constraint(:ci_builds, fk_stage_id_tmp, fk_stage_id)
- end
- end
-end
diff --git a/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb b/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb
deleted file mode 100644
index 3879c3c368a..00000000000
--- a/db/post_migrate/20210708011426_finalize_ci_builds_metadata_bigint_conversion.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsMetadataBigintConversion < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_metadata'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["id"], ["id_convert_to_bigint"]]
- )
-
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [["build_id"], ["build_id_convert_to_bigint"]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # Indexes were pre-created on gitlab.com to avoid slowing down deployments
- #
- # rubocop:disable Migration/PreventIndexCreation
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_ci_builds_metadata_on_id_convert_to_bigint'
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, where: 'has_exposed_artifacts IS TRUE', name: 'index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts'
- create_covering_index TABLE_NAME, 'index_ci_builds_metadata_on_build_id_int8_where_interruptible'
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, unique: true, name: 'index_ci_builds_metadata_on_build_id_convert_to_bigint'
- # rubocop:enable Migration/PreventIndexCreation
-
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- swap_column :id
- swap_column :build_id
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- execute "ALTER FUNCTION #{quote_table_name(Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:id, :id_convert_to_bigint))} RESET ALL"
- execute "ALTER FUNCTION #{quote_table_name(Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint))} RESET ALL"
-
- # Swap defaults for PK
- execute "ALTER SEQUENCE ci_builds_metadata_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('ci_builds_metadata_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap defaults for FK
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_builds_metadata_pkey CASCADE"
- rename_index TABLE_NAME, 'index_ci_builds_metadata_on_id_convert_to_bigint', 'ci_builds_metadata_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY USING INDEX ci_builds_metadata_pkey"
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- swap_index 'index_ci_builds_metadata_on_build_id', 'index_ci_builds_metadata_on_build_id_convert_to_bigint'
- swap_index 'index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts', 'index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts'
- swap_index 'index_ci_builds_metadata_on_build_id_and_id_and_interruptible', 'index_ci_builds_metadata_on_build_id_int8_where_interruptible'
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-
- # Swap FK constraint
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :build_id)
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :build_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :build_id)
- )
- end
- end
-
- def swap_index(old, new)
- execute "DROP INDEX #{old}"
- rename_index TABLE_NAME, new, old
- end
-
- def swap_column(name)
- temp_name = "#{name}_tmp"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(name)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:"#{name}_convert_to_bigint")} TO #{quote_column_name(name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:"#{name}_convert_to_bigint")}"
- end
-
- def create_covering_index(table, name)
- return if index_exists_by_name?(table, name)
-
- disable_statement_timeout do
- execute <<~SQL
- CREATE INDEX CONCURRENTLY #{name}
- ON #{table} (build_id_convert_to_bigint) INCLUDE (id_convert_to_bigint)
- WHERE interruptible = true
- SQL
- end
- end
-end
diff --git a/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb b/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb
deleted file mode 100644
index 53f13ca96d2..00000000000
--- a/db/post_migrate/20210708130419_reschedule_merge_request_diff_users_background_migration.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleMergeRequestDiffUsersBackgroundMigration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- # The number of rows to process in a single migration job.
- #
- # The minimum interval for background migrations is two minutes. On staging we
- # observed we can process roughly 20 000 rows in a minute. Based on the total
- # number of rows on staging, this translates to a total processing time of
- # roughly 14 days.
- #
- # By using a batch size of 40 000, we maintain a rate of roughly 20 000 rows
- # per minute, hopefully keeping the total migration time under two weeks;
- # instead of four weeks.
- BATCH_SIZE = 40_000
-
- MIGRATION_NAME = 'MigrateMergeRequestDiffCommitUsers'
-
- class MergeRequestDiff < ActiveRecord::Base
- self.table_name = 'merge_request_diffs'
- end
-
- def up
- start = MergeRequestDiff.minimum(:id).to_i
- max = MergeRequestDiff.maximum(:id).to_i
- delay = BackgroundMigrationWorker.minimum_interval
-
- Gitlab::Database::BackgroundMigrationJob
- .where(class_name: MIGRATION_NAME)
- .delete_all
-
- # The table merge_request_diff_commits contains _a lot_ of rows (roughly 400
- # 000 000 on staging). Iterating a table that large to determine job ranges
- # would take a while.
- #
- # To avoid that overhead, we simply schedule fixed ranges according to the
- # minimum and maximum IDs. The background migration in turn only processes
- # rows that actually exist.
- while start < max
- stop = start + BATCH_SIZE
-
- migrate_in(delay, MIGRATION_NAME, [start, stop])
-
- Gitlab::Database::BackgroundMigrationJob
- .create!(class_name: MIGRATION_NAME, arguments: [start, stop])
-
- delay += BackgroundMigrationWorker.minimum_interval
- start += BATCH_SIZE
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb b/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb
deleted file mode 100644
index aa812151164..00000000000
--- a/db/post_migrate/20210709024048_finalize_push_event_payloads_bigint_conversion_2.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion2 < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5256
- end
-
- def down
- # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5256
- end
-end
diff --git a/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb b/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb
deleted file mode 100644
index 34701d8ba46..00000000000
--- a/db/post_migrate/20210713042000_fix_ci_sources_pipelines_index_names.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-# frozen_string_literal: true
-
-# When the `ci_sources_pipelines` table was first introduced in GitLab
-# 9.3 EE, the foreign key names generate for the table appeared to
-# have been calculated via a hash using the table name
-# `ci_pipeline_source_pipelines`. This led to a merge conflict and
-# confusion during a CE to EE merge in GitLab 10.0, which regenerated
-# the schema with the correct foreign key names.
-#
-# Hence anyone who installed GitLab prior to 10.0 may have been seeded
-# the database with stale, incorrect foreign key names.
-#
-# During the Great BigInt Conversion of 2021, several migrations
-# assumed that the foreign key `fk_be5624bf37` existed for
-# `ci_sources_pipeline`. However, older installations may have had the
-# correct foreign key under the name `fk_3f0c88d7dc`.
-#
-# To eliminate future confusion and migration failures, we now rename
-# the foreign key constraints and index to what they should be today.
-class FixCiSourcesPipelinesIndexNames < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_sources_pipelines'
-
- # GitLab 9.5.4: https://gitlab.com/gitlab-org/gitlab/-/blob/v9.5.4-ee/db/schema.rb#L2026-2030
- # GitLab 10.0: https://gitlab.com/gitlab-org/gitlab/-/blob/v10.0.0-ee/db/schema.rb#L2064-2068
- OLD_TO_NEW_FOREIGN_KEY_DEFS = {
- 'fk_3f0c88d7dc' => { table: :ci_builds, column: :source_job_id, name: 'fk_be5624bf37' },
- 'fk_b8c0fac459' => { table: :ci_pipelines, column: :pipeline_id, name: 'fk_e1bad85861' },
- 'fk_3a3e3cb83a' => { table: :ci_pipelines, column: :source_pipeline_id, name: 'fk_d4e29af7d7' },
- 'fk_8868d0f3e4' => { table: :projects, column: :source_project_id, name: 'fk_acd9737679' },
- 'fk_83b4346e48' => { table: :projects, name: 'fk_1e53c97c0a' }
- }
- OLD_INDEX_NAME = 'index_ci_pipeline_source_pipelines_on_source_job_id'
- NEW_INDEX_NAME = 'index_ci_sources_pipelines_on_source_job_id'
-
- def up
- OLD_TO_NEW_FOREIGN_KEY_DEFS.each do |old_name, entry|
- options = { column: entry[:column], name: old_name }.compact
-
- if foreign_key_exists?(TABLE_NAME, entry[:table], **options)
- rename_constraint(TABLE_NAME, old_name, entry[:name])
- end
- end
-
- if index_exists_by_name?(TABLE_NAME, OLD_INDEX_NAME)
- if index_exists_by_name?(TABLE_NAME, NEW_INDEX_NAME)
- remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
- else
- rename_index(TABLE_NAME, OLD_INDEX_NAME, NEW_INDEX_NAME)
- end
- end
- end
-
- # There's no reason to revert this change since it should apply on stale schemas
- def down; end
-end
diff --git a/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb b/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb
deleted file mode 100644
index 38b7852b320..00000000000
--- a/db/post_migrate/20210713042153_finalize_ci_sources_pipelines_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiSourcesPipelinesBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_sources_pipelines'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['source_job_id'], ['source_job_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_sources_pipelines_on_source_job_id" btree (source_job_id)
- add_concurrent_index TABLE_NAME, :source_job_id_convert_to_bigint, name: 'index_ci_sources_pipelines_on_source_job_id_convert_to_bigint'
-
- # Add a foreign key on `source_job_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_be5624bf37)
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :source_job_id_convert_to_bigint, on_delete: :cascade,
- name: 'fk_be5624bf37_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'source_job_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:source_job_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:source_job_id_convert_to_bigint)} TO #{quote_column_name(:source_job_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:source_job_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:source_job_id, :source_job_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # No need to swap defaults, both columns have no default value
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_sources_pipelines_on_source_job_id'
- rename_index TABLE_NAME, 'index_ci_sources_pipelines_on_source_job_id_convert_to_bigint', 'index_ci_sources_pipelines_on_source_job_id'
-
- # Drop original FK on the old int4 `source_job_id` (fk_be5624bf37)
- remove_foreign_key TABLE_NAME, name: 'fk_be5624bf37'
- # We swapped the columns but the FK is still using the temporary name
- # So we have to also swap the FK name now that we dropped the other one
- rename_constraint(TABLE_NAME, 'fk_be5624bf37_tmp', 'fk_be5624bf37')
- end
- end
-end
diff --git a/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb b/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb
deleted file mode 100644
index 457e7826f38..00000000000
--- a/db/post_migrate/20210713075117_re_schedule_latest_pipeline_id_population_with_logging.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulationWithLogging < ActiveRecord::Migration[6.1]
- def up
- # no-op: The content of the migration has been moved to
- # `ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes`.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb b/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb
deleted file mode 100644
index af17b35d47d..00000000000
--- a/db/post_migrate/20210714015537_finalize_ci_build_trace_chunks_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildTraceChunksBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_build_trace_chunks'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_build_trace_chunks_on_build_id_and_chunk_index" UNIQUE, btree (build_id, chunk_index)
- add_concurrent_index TABLE_NAME, [:build_id_convert_to_bigint, :chunk_index], unique: true, name: 'i_ci_build_trace_chunks_build_id_convert_to_bigint_chunk_index'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK ()
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade, name: 'fk_rails_1013b761f2_tmp'
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME}, ci_builds IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index'
- rename_index TABLE_NAME, 'i_ci_build_trace_chunks_build_id_convert_to_bigint_chunk_index', 'index_ci_build_trace_chunks_on_build_id_and_chunk_index'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_1013b761f2)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_1013b761f2'
- # We swapped the columns but the FK for buil_id is still using the temporary name for the build_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_1013b761f2_tmp', 'fk_rails_1013b761f2')
- end
- end
-end
diff --git a/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb b/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb
deleted file mode 100644
index 20118dbbac8..00000000000
--- a/db/post_migrate/20210721122840_remove_seat_link_enabled_from_application_settings.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSeatLinkEnabledFromApplicationSettings < ActiveRecord::Migration[6.1]
- def up
- remove_column :application_settings, :seat_link_enabled
- end
-
- def down
- add_column :application_settings, :seat_link_enabled, :boolean, null: false, default: true
- end
-end
diff --git a/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb b/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb
deleted file mode 100644
index 076a238381e..00000000000
--- a/db/post_migrate/20210721125804_remove_signing_keys_from_packages_debian_project_distributions.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSigningKeysFromPackagesDebianProjectDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- remove_column :packages_debian_project_distributions, :encrypted_signing_keys, :text
- remove_column :packages_debian_project_distributions, :encrypted_signing_keys_iv, :text
- end
-end
diff --git a/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb b/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb
deleted file mode 100644
index 4b751c06972..00000000000
--- a/db/post_migrate/20210721125820_remove_signing_keys_from_packages_debian_group_distributions.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveSigningKeysFromPackagesDebianGroupDistributions < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def change
- remove_column :packages_debian_group_distributions, :encrypted_signing_keys, :text
- remove_column :packages_debian_group_distributions, :encrypted_signing_keys_iv, :text
- end
-end
diff --git a/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb b/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb
deleted file mode 100644
index 5d42fd4896d..00000000000
--- a/db/post_migrate/20210721174521_add_non_null_constraint_for_escalation_rule_on_pending_alert_escalations.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-# frozen_string_literal: true
-
-class AddNonNullConstraintForEscalationRuleOnPendingAlertEscalations < ActiveRecord::Migration[6.1]
- ELAPSED_WHOLE_MINUTES_IN_SECONDS = <<~SQL
- ABS(ROUND(
- EXTRACT(EPOCH FROM (escalations.process_at - escalations.created_at))/60*60
- ))
- SQL
-
- INSERT_RULES_FOR_ESCALATIONS_WITHOUT_RULES = <<~SQL
- INSERT INTO incident_management_escalation_rules (policy_id, oncall_schedule_id, status, elapsed_time_seconds, is_removed)
- SELECT
- policies.id,
- schedule_id,
- status,
- #{ELAPSED_WHOLE_MINUTES_IN_SECONDS} AS elapsed_time_seconds,
- TRUE
- FROM incident_management_pending_alert_escalations AS escalations
- INNER JOIN incident_management_oncall_schedules AS schedules ON schedules.id = schedule_id
- INNER JOIN incident_management_escalation_policies AS policies ON policies.project_id = schedules.project_id
- WHERE rule_id IS NULL
- GROUP BY policies.id, schedule_id, status, elapsed_time_seconds
- ON CONFLICT DO NOTHING;
- SQL
-
- UPDATE_EMPTY_RULE_IDS = <<~SQL
- UPDATE incident_management_pending_alert_escalations AS escalations
- SET rule_id = rules.id
- FROM incident_management_pending_alert_escalations AS through_escalations
- INNER JOIN incident_management_oncall_schedules AS schedules ON schedules.id = through_escalations.schedule_id
- INNER JOIN incident_management_escalation_policies AS policies ON policies.project_id = schedules.project_id
- INNER JOIN incident_management_escalation_rules AS rules ON rules.policy_id = policies.id
- WHERE escalations.rule_id IS NULL
- AND rules.status = escalations.status
- AND rules.oncall_schedule_id = escalations.schedule_id
- AND rules.elapsed_time_seconds = #{ELAPSED_WHOLE_MINUTES_IN_SECONDS};
- SQL
-
- DELETE_LEFTOVER_ESCALATIONS_WITHOUT_RULES = 'DELETE FROM incident_management_pending_alert_escalations WHERE rule_id IS NULL;'
-
- # For each alert which has a pending escalation without a corresponding rule,
- # create a rule with the expected attributes for the project's policy.
- #
- # Deletes all escalations without rules/policy & adds non-null constraint for rule_id.
- def up
- exec_query INSERT_RULES_FOR_ESCALATIONS_WITHOUT_RULES
- exec_query UPDATE_EMPTY_RULE_IDS
- exec_query DELETE_LEFTOVER_ESCALATIONS_WITHOUT_RULES
-
- change_column_null :incident_management_pending_alert_escalations, :rule_id, false
- end
-
- def down
- change_column_null :incident_management_pending_alert_escalations, :rule_id, true
- end
-end
diff --git a/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb b/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb
deleted file mode 100644
index b0608f15ce1..00000000000
--- a/db/post_migrate/20210722010101_reschedule_delete_orphaned_deployments.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class RescheduleDeleteOrphanedDeployments < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'DeleteOrphanedDeployments'
- BATCH_SIZE = 10_000
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- Gitlab::BackgroundMigration.steal(MIGRATION)
- Gitlab::Database::BackgroundMigrationJob.for_migration_class(MIGRATION).delete_all
-
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('deployments'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb b/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb
deleted file mode 100644
index b611b51e3ff..00000000000
--- a/db/post_migrate/20210722042939_update_issuable_slas_where_issue_closed.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateIssuableSlasWhereIssueClosed < ActiveRecord::Migration[6.1]
- ISSUE_CLOSED_STATUS = 2
-
- class IssuableSla < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'issuable_slas'
-
- belongs_to :issue, class_name: 'Issue'
- end
-
- class Issue < ActiveRecord::Base
- self.table_name = 'issues'
-
- has_one :issuable_sla, class_name: 'IssuableSla'
- end
-
- def up
- IssuableSla.each_batch(of: 50) do |relation|
- relation.joins(:issue)
- .where(issues: { state_id: ISSUE_CLOSED_STATUS } )
- .update_all(issuable_closed: true)
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb b/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb
deleted file mode 100644
index c66c14d1900..00000000000
--- a/db/post_migrate/20210722055217_add_updated_at_index_on_merge_requests.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddUpdatedAtIndexOnMergeRequests < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_merge_requests_on_target_project_id_and_updated_at_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :merge_requests, [:target_project_id, :updated_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :merge_requests, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
deleted file mode 100644
index 78ae4f23286..00000000000
--- a/db/post_migrate/20210722110515_revert_backfill_ci_build_trace_sections_for_bigint_conversion.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class RevertBackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = :ci_build_trace_sections
- COLUMN = :build_id
-
- def up
- revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN, primary_key: COLUMN
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb b/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb
deleted file mode 100644
index 5bf6a9e7911..00000000000
--- a/db/post_migrate/20210722155635_finalize_convert_geo_job_artifact_deleted_events_bigint.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeConvertGeoJobArtifactDeletedEventsBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'geo_job_artifact_deleted_events'
- COLUMN_NAME = 'job_artifact_id'
- COLUMN_NAME_CONVERTED = "#{COLUMN_NAME}_convert_to_bigint"
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [[COLUMN_NAME], [COLUMN_NAME_CONVERTED]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- old_index_name = 'index_geo_job_artifact_deleted_events_on_job_artifact_id'
-
- bigint_index_name = 'index_geo_job_artifact_deleted_events_on_job_artifact_id_bigint'
- add_concurrent_index TABLE_NAME, COLUMN_NAME_CONVERTED, name: bigint_index_name
-
- with_lock_retries(raise_on_exhaustion: true) do
- execute("LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE")
-
- temp_name = quote_column_name("#{COLUMN_NAME}_tmp")
- old_column_name = quote_column_name(COLUMN_NAME)
- new_column_name = quote_column_name(COLUMN_NAME_CONVERTED)
-
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{old_column_name} TO #{temp_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{new_column_name} TO #{old_column_name}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{new_column_name}"
-
- change_column_default TABLE_NAME, COLUMN_NAME, nil
- change_column_default TABLE_NAME, COLUMN_NAME_CONVERTED, 0
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(COLUMN_NAME, COLUMN_NAME_CONVERTED)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- execute "DROP INDEX #{old_index_name}"
-
- rename_index TABLE_NAME, bigint_index_name, old_index_name
- end
- end
-end
diff --git a/db/post_migrate/20210727113447_backfill_integrations_type_new.rb b/db/post_migrate/20210727113447_backfill_integrations_type_new.rb
deleted file mode 100644
index 47238bae4d5..00000000000
--- a/db/post_migrate/20210727113447_backfill_integrations_type_new.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillIntegrationsTypeNew < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- MIGRATION = 'BackfillIntegrationsTypeNew'
- INTERVAL = 2.minutes
-
- def up
- queue_batched_background_migration(
- MIGRATION,
- :integrations,
- :id,
- job_interval: INTERVAL
- )
- end
-
- def down
- delete_batched_background_migration(MIGRATION, :integrations, :id, [])
- end
-end
diff --git a/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb b/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
deleted file mode 100644
index d4ce1e7024f..00000000000
--- a/db/post_migrate/20210727175201_remove_unused_columns_from_elastic_reindexing_tasks.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveUnusedColumnsFromElasticReindexingTasks < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- remove_column :elastic_reindexing_tasks, :documents_count, :integer
- remove_column :elastic_reindexing_tasks, :index_name_from, :text
- remove_column :elastic_reindexing_tasks, :index_name_to, :text
- remove_column :elastic_reindexing_tasks, :elastic_task, :text
- remove_column :elastic_reindexing_tasks, :documents_count_target, :integer
- end
-
- def down
- add_column :elastic_reindexing_tasks, :documents_count, :integer
- add_column :elastic_reindexing_tasks, :index_name_from, :text
- add_column :elastic_reindexing_tasks, :index_name_to, :text
- add_column :elastic_reindexing_tasks, :elastic_task, :text
- add_column :elastic_reindexing_tasks, :documents_count_target, :integer
-
- add_text_limit :elastic_reindexing_tasks, :index_name_from, 255
- add_text_limit :elastic_reindexing_tasks, :index_name_to, 255
- add_text_limit :elastic_reindexing_tasks, :elastic_task, 255
- end
-end
diff --git a/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb b/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb
deleted file mode 100644
index 8ec608453a0..00000000000
--- a/db/post_migrate/20210729163312_re_schedule_latest_pipeline_id_population_with_all_security_related_artifact_types.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class ReScheduleLatestPipelineIdPopulationWithAllSecurityRelatedArtifactTypes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 100
- MIGRATION = 'PopulateLatestPipelineIds'
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee?
-
- Gitlab::BackgroundMigration.steal(MIGRATION)
-
- queue_background_migration_jobs_by_range_at_intervals(
- Gitlab::BackgroundMigration::PopulateLatestPipelineIds::ProjectSetting.has_vulnerabilities_without_latest_pipeline_set,
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- primary_column_name: 'project_id'
- )
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb b/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb
deleted file mode 100644
index ad6676a1704..00000000000
--- a/db/post_migrate/20210729192959_drop_ci_test_case_failures_table.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiTestCaseFailuresTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- drop_table :ci_test_case_failures
- end
-
- def down
- create_table :ci_test_case_failures do |t|
- t.datetime_with_timezone :failed_at
- t.bigint :test_case_id, null: false
- t.bigint :build_id, null: false
-
- t.index [:test_case_id, :failed_at, :build_id], name: 'index_test_case_failures_unique_columns', unique: true, order: { failed_at: :desc }
- t.index :build_id
- end
- end
-end
diff --git a/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb b/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb
deleted file mode 100644
index 2de1749721d..00000000000
--- a/db/post_migrate/20210729193056_drop_ci_test_cases_table.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class DropCiTestCasesTable < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
-
- disable_ddl_transaction!
-
- def up
- drop_table :ci_test_cases
- end
-
- def down
- create_table_with_constraints :ci_test_cases do |t|
- t.bigint :project_id, null: false
- t.text :key_hash, null: false
- t.text_limit :key_hash, 64
-
- t.index [:project_id, :key_hash], unique: true
- end
- end
-end
diff --git a/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb b/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb
deleted file mode 100644
index 3102561a129..00000000000
--- a/db/post_migrate/20210730104800_schedule_extract_project_topics_into_separate_table.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleExtractProjectTopicsIntoSeparateTable < ActiveRecord::Migration[6.0]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- BATCH_SIZE = 1_000
- DELAY_INTERVAL = 2.minutes
- MIGRATION = 'ExtractProjectTopicsIntoSeparateTable'
- INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project'
- INDEX_CONDITION = "taggable_type = 'Project'"
-
- disable_ddl_transaction!
-
- class Tagging < ActiveRecord::Base
- include ::EachBatch
-
- self.table_name = 'taggings'
- end
-
- def up
- # this index is used in 20210730104800_schedule_extract_project_topics_into_separate_table
- add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation
-
- queue_background_migration_jobs_by_range_at_intervals(
- Tagging.where(taggable_type: 'Project'),
- MIGRATION,
- DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- track_jobs: true
- )
- end
-
- def down
- remove_concurrent_index_by_name :taggings, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210730170823_schedule_security_setting_creation.rb b/db/post_migrate/20210730170823_schedule_security_setting_creation.rb
deleted file mode 100644
index cea7b976bf9..00000000000
--- a/db/post_migrate/20210730170823_schedule_security_setting_creation.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleSecuritySettingCreation < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- MIGRATION = 'CreateSecuritySetting'
- BATCH_SIZE = 1000
- INTERVAL = 5.minutes.to_i
-
- disable_ddl_transaction!
-
- def up
- return unless Gitlab.ee? # Security Settings available only in EE version
-
- queue_background_migration_jobs_by_range_at_intervals(
- define_batchable_model('projects'),
- MIGRATION,
- INTERVAL,
- batch_size: BATCH_SIZE
- )
- end
-
- # We're adding data so no need for rollback
- def down
- end
-end
diff --git a/db/post_migrate/20210731132939_backfill_stage_event_hash.rb b/db/post_migrate/20210731132939_backfill_stage_event_hash.rb
deleted file mode 100644
index e4966cc0e6d..00000000000
--- a/db/post_migrate/20210731132939_backfill_stage_event_hash.rb
+++ /dev/null
@@ -1,115 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillStageEventHash < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- BATCH_SIZE = 100
- EVENT_ID_IDENTIFIER_MAPPING = {
- 1 => :issue_created,
- 2 => :issue_first_mentioned_in_commit,
- 3 => :issue_closed,
- 4 => :issue_first_added_to_board,
- 5 => :issue_first_associated_with_milestone,
- 7 => :issue_last_edited,
- 8 => :issue_label_added,
- 9 => :issue_label_removed,
- 10 => :issue_deployed_to_production,
- 100 => :merge_request_created,
- 101 => :merge_request_first_deployed_to_production,
- 102 => :merge_request_last_build_finished,
- 103 => :merge_request_last_build_started,
- 104 => :merge_request_merged,
- 105 => :merge_request_closed,
- 106 => :merge_request_last_edited,
- 107 => :merge_request_label_added,
- 108 => :merge_request_label_removed,
- 109 => :merge_request_first_commit_at,
- 1000 => :code_stage_start,
- 1001 => :issue_stage_end,
- 1002 => :plan_stage_start
- }.freeze
-
- LABEL_BASED_EVENTS = Set.new([8, 9, 107, 108]).freeze
-
- class GroupStage < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'analytics_cycle_analytics_group_stages'
- end
-
- class ProjectStage < ActiveRecord::Base
- include EachBatch
-
- self.table_name = 'analytics_cycle_analytics_project_stages'
- end
-
- class StageEventHash < ActiveRecord::Base
- self.table_name = 'analytics_cycle_analytics_stage_event_hashes'
- end
-
- def up
- GroupStage.reset_column_information
- ProjectStage.reset_column_information
- StageEventHash.reset_column_information
-
- update_stage_table(GroupStage)
- update_stage_table(ProjectStage)
-
- add_not_null_constraint :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- add_not_null_constraint :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-
- def down
- remove_not_null_constraint :analytics_cycle_analytics_group_stages, :stage_event_hash_id
- remove_not_null_constraint :analytics_cycle_analytics_project_stages, :stage_event_hash_id
- end
-
- private
-
- def update_stage_table(klass)
- klass.each_batch(of: BATCH_SIZE) do |relation|
- klass.transaction do
- records = relation.where(stage_event_hash_id: nil).lock!.to_a # prevent concurrent modification (unlikely to happen)
- records = delete_invalid_records(records)
- next if records.empty?
-
- hashes_by_stage = records.index_with { |stage| calculate_stage_events_hash(stage) }
- hashes = hashes_by_stage.values.uniq
-
- StageEventHash.insert_all(hashes.map { |hash| { hash_sha256: hash } })
-
- stage_event_hashes_by_hash = StageEventHash.where(hash_sha256: hashes).index_by(&:hash_sha256)
- records.each do |stage|
- stage.update!(stage_event_hash_id: stage_event_hashes_by_hash[hashes_by_stage[stage]].id)
- end
- end
- end
- end
-
- def calculate_stage_events_hash(stage)
- start_event_hash = calculate_event_hash(stage.start_event_identifier, stage.start_event_label_id)
- end_event_hash = calculate_event_hash(stage.end_event_identifier, stage.end_event_label_id)
-
- Digest::SHA256.hexdigest("#{start_event_hash}-#{end_event_hash}")
- end
-
- def calculate_event_hash(event_identifier, label_id = nil)
- str = EVENT_ID_IDENTIFIER_MAPPING.fetch(event_identifier).to_s
- str << "-#{label_id}" if LABEL_BASED_EVENTS.include?(event_identifier)
-
- Digest::SHA256.hexdigest(str)
- end
-
- # Invalid records are safe to delete, since they are not working properly anyway
- def delete_invalid_records(records)
- to_be_deleted = records.select do |record|
- EVENT_ID_IDENTIFIER_MAPPING[record.start_event_identifier].nil? ||
- EVENT_ID_IDENTIFIER_MAPPING[record.end_event_identifier].nil?
- end
-
- to_be_deleted.each(&:delete)
- records - to_be_deleted
- end
-end
diff --git a/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb b/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb
deleted file mode 100644
index 289b77f0a5c..00000000000
--- a/db/post_migrate/20210802043253_finalize_push_event_payloads_bigint_conversion_3.rb
+++ /dev/null
@@ -1,87 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizePushEventPayloadsBigintConversion3 < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'push_event_payloads'
- INDEX_NAME = 'index_push_event_payloads_on_event_id_convert_to_bigint'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'event_id',
- job_arguments: [["event_id"], ["event_id_convert_to_bigint"]]
- )
-
- return if already_swapped?
-
- swap_columns
- end
-
- def down
- swap_columns
- end
-
- private
-
- def already_swapped?
- push_event_payloads_columns = columns(TABLE_NAME)
- event_id = push_event_payloads_columns.find { |c| c.name == 'event_id' }
- event_id_convert_to_bigint = push_event_payloads_columns.find { |c| c.name == 'event_id_convert_to_bigint' }
-
- event_id.sql_type == 'bigint' && event_id_convert_to_bigint.sql_type == 'integer'
- end
-
- def swap_columns
- add_concurrent_index TABLE_NAME, :event_id_convert_to_bigint, unique: true, name: INDEX_NAME
-
- # Add a foreign key on `event_id_convert_to_bigint` before we swap the columns and drop the old FK (fk_36c74129da)
- add_concurrent_foreign_key TABLE_NAME, :events, column: :event_id_convert_to_bigint,
- on_delete: :cascade, reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start.
- # Lock order should be
- # 1. events
- # 2. push_event_payloads
- # in order to match the order in EventCreateService#create_push_event,
- # and avoid deadlocks.
- execute "LOCK TABLE events, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'event_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:event_id_convert_to_bigint)} TO #{quote_column_name(:event_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:event_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:event_id, :event_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :event_id, nil
- change_column_default TABLE_NAME, :event_id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT push_event_payloads_pkey"
- rename_index TABLE_NAME, INDEX_NAME, 'push_event_payloads_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT push_event_payloads_pkey PRIMARY KEY USING INDEX push_event_payloads_pkey"
-
- # Drop original FK on the old int4 `event_id` (fk_36c74129da)
- remove_foreign_key TABLE_NAME, name: concurrent_foreign_key_name(TABLE_NAME, :event_id)
- # We swapped the columns but the FK for event_id is still using the old name for the event_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(
- TABLE_NAME,
- concurrent_foreign_key_name(TABLE_NAME, :event_id_convert_to_bigint),
- concurrent_foreign_key_name(TABLE_NAME, :event_id)
- )
- end
- end
-end
diff --git a/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb b/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
deleted file mode 100644
index 318d9e8a218..00000000000
--- a/db/post_migrate/20210802112233_add_index_issues_on_project_id_and_state_id_and_created_at_and_id.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-class AddIndexIssuesOnProjectIdAndStateIdAndCreatedAtAndId < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- DOWNTIME = false
- INDEX_NAME = 'index_issues_on_project_id_and_state_id_and_created_at_and_id'
-
- disable_ddl_transaction!
-
- def up
- add_concurrent_index :issues, [:project_id, :state_id, :created_at, :id], name: INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :issues, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb b/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb
deleted file mode 100644
index 067b7166cf3..00000000000
--- a/db/post_migrate/20210802131812_finalize_convert_deployments_bigint.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeConvertDeploymentsBigint < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'deployments'
- COLUMN_NAME = 'deployable_id'
- COLUMN_NAME_BIGINT = "#{COLUMN_NAME}_convert_to_bigint"
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [[COLUMN_NAME], [COLUMN_NAME_BIGINT]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- def swap
- old_index_name = 'index_deployments_on_deployable_type_and_deployable_id'
- bigint_index_name = 'index_deployments_on_deployable_type_and_deployable_id_bigint'
- add_concurrent_index TABLE_NAME, ['deployable_type', COLUMN_NAME_BIGINT], name: bigint_index_name
-
- with_lock_retries(raise_on_exhaustion: true) do
- # Swap columns
- temp_name = "#{COLUMN_NAME}_tmp"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(COLUMN_NAME)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(COLUMN_NAME_BIGINT)} TO #{quote_column_name(COLUMN_NAME)}"
- execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(COLUMN_NAME_BIGINT)}"
-
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(COLUMN_NAME, COLUMN_NAME_BIGINT)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- execute "DROP INDEX #{old_index_name}"
- rename_index TABLE_NAME, bigint_index_name, old_index_name
- end
- end
-end
diff --git a/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb b/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb
deleted file mode 100644
index a2736a563c7..00000000000
--- a/db/post_migrate/20210804150624_remove_cluster_image_scanning_from_approval_project_rules.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveClusterImageScanningFromApprovalProjectRules < ActiveRecord::Migration[6.1]
- def up
- execute("update approval_project_rules set scanners = array_remove(scanners, 'cluster_image_scanning') where scanners @> '{cluster_image_scanning}'")
- end
-
- def down
- # nothing to do here
- end
-end
diff --git a/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb b/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb
deleted file mode 100644
index 81e73effe7b..00000000000
--- a/db/post_migrate/20210804151444_prepare_indexes_for_ci_job_artifact_bigint_conversion.rb
+++ /dev/null
@@ -1,38 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiJobArtifactBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_job_artifacts, :id_convert_to_bigint, unique: true,
- name: :index_ci_job_artifact_on_id_convert_to_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:project_id, :id_convert_to_bigint],
- where: 'file_type = 18', name: :index_ci_job_artifacts_for_terraform_reports_bigint
-
- prepare_async_index :ci_job_artifacts, :id_convert_to_bigint,
- where: 'file_type = 18',
- name: :index_ci_job_artifacts_id_for_terraform_reports_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:expire_at, :job_id_convert_to_bigint],
- name: :index_ci_job_artifacts_on_expire_at_and_job_id_bigint
-
- prepare_async_index :ci_job_artifacts,
- [:job_id_convert_to_bigint, :file_type],
- unique: true, name: :index_ci_job_artifacts_on_job_id_and_file_type_bigint
- end
-
- def down
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_on_job_id_and_file_type_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_on_expire_at_and_job_id_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_id_for_terraform_reports_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifacts_for_terraform_reports_bigint
-
- unprepare_async_index_by_name :ci_job_artifacts, :index_ci_job_artifact_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb b/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb
deleted file mode 100644
index ab6691dea1f..00000000000
--- a/db/post_migrate/20210804153307_prepare_indexes_for_tagging_bigint_conversion.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForTaggingBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :taggings, :id_convert_to_bigint, unique: true,
- name: :index_taggings_on_id_convert_to_bigint
-
- prepare_async_index :taggings, [:taggable_id_convert_to_bigint, :taggable_type],
- name: :i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type
-
- prepare_async_index :taggings, [:taggable_id_convert_to_bigint, :taggable_type, :context],
- name: :i_taggings_on_taggable_bigint_and_taggable_type_and_context
-
- prepare_async_index :taggings, [:tag_id, :taggable_id_convert_to_bigint, :taggable_type, :context, :tagger_id, :tagger_type],
- unique: true, name: :taggings_idx_tmp
- end
-
- def down
- unprepare_async_index_by_name :taggings, :taggings_idx_tmp
-
- unprepare_async_index_by_name :taggings, :i_taggings_on_taggable_bigint_and_taggable_type_and_context
-
- unprepare_async_index_by_name :taggings, :i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type
-
- unprepare_async_index_by_name :taggings, :index_taggings_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb b/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb
deleted file mode 100644
index 16f3e87000c..00000000000
--- a/db/post_migrate/20210804154407_prepare_indexes_for_ci_stage_bigint_conversion.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiStageBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_stages, :id_convert_to_bigint, unique: true,
- name: :index_ci_stages_on_id_convert_to_bigint
-
- prepare_async_index :ci_stages, [:pipeline_id, :id_convert_to_bigint],
- where: 'status in (0, 1, 2, 8, 9, 10)',
- name: :index_ci_stages_on_pipeline_id_and_id_convert_to_bigint
- end
-
- def down
- unprepare_async_index_by_name :ci_stages,
- :index_ci_stages_on_pipeline_id_and_id_convert_to_bigint
-
- unprepare_async_index_by_name :ci_stages, :index_ci_stages_on_id_convert_to_bigint
- end
-end
diff --git a/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb b/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb
deleted file mode 100644
index 5e18450f465..00000000000
--- a/db/post_migrate/20210805131510_finalize_ci_builds_runner_session_bigint_conversion.rb
+++ /dev/null
@@ -1,67 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeCiBuildsRunnerSessionBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_builds_runner_session'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [['build_id'], ['build_id_convert_to_bigint']]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- add_concurrent_index TABLE_NAME, :build_id_convert_to_bigint, unique: true, name: 'index_ci_builds_runner_session_on_build_id_convert_to_bigint'
-
- # Add a foreign key on `build_id_convert_to_bigint` before we swap the columns and drop the old FK ()
- add_concurrent_foreign_key TABLE_NAME, :ci_builds, column: :build_id_convert_to_bigint, on_delete: :cascade, name: 'fk_rails_70707857d3_tmp', reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'build_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:build_id_convert_to_bigint)} TO #{quote_column_name(:build_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:build_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name(:build_id, :build_id_convert_to_bigint)
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :build_id, nil
- change_column_default TABLE_NAME, :build_id_convert_to_bigint, 0
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX index_ci_builds_runner_session_on_build_id'
- rename_index TABLE_NAME, 'index_ci_builds_runner_session_on_build_id_convert_to_bigint', 'index_ci_builds_runner_session_on_build_id'
-
- # Drop original FK on the old int4 `build_id` (fk_rails_70707857d3)
- remove_foreign_key TABLE_NAME, name: 'fk_rails_70707857d3'
-
- # We swapped the columns but the FK for buil_id is still using the temporary name for the build_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, 'fk_rails_70707857d3_tmp', 'fk_rails_70707857d3')
- end
- end
-end
diff --git a/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb b/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb
deleted file mode 100644
index f27f61729a3..00000000000
--- a/db/post_migrate/20210805192450_update_trial_plans_ci_daily_pipeline_schedule_triggers.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateTrialPlansCiDailyPipelineScheduleTriggers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- PREMIUM_TRIAL = 'premium_trial'
- ULTIMATE_TRIAL = 'ultimate_trial'
- EVERY_5_MINUTES = (1.day.in_minutes / 5).to_i
-
- class Plan < ActiveRecord::Base
- self.table_name = 'plans'
- self.inheritance_column = :_type_disabled
-
- has_one :limits, class_name: 'PlanLimits'
- end
-
- class PlanLimits < ActiveRecord::Base
- self.table_name = 'plan_limits'
- self.inheritance_column = :_type_disabled
-
- belongs_to :plan
- end
-
- def plan_limits_present?
- premium_trial_plan = Plan.find_by(name: PREMIUM_TRIAL)
- ultimate_trial_plan = Plan.find_by(name: ULTIMATE_TRIAL)
-
- premium_trial_plan && premium_trial_plan.limits && ultimate_trial_plan && ultimate_trial_plan.limits
- end
-
- def up
- return unless Gitlab.com?
-
- if plan_limits_present?
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', PREMIUM_TRIAL, EVERY_5_MINUTES)
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', ULTIMATE_TRIAL, EVERY_5_MINUTES)
- end
- end
-
- def down
- return unless Gitlab.com?
-
- if plan_limits_present?
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', PREMIUM_TRIAL, 0)
- create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', ULTIMATE_TRIAL, 0)
- end
- end
-end
diff --git a/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb b/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb
deleted file mode 100644
index 90bca79624d..00000000000
--- a/db/post_migrate/20210806011811_schedule_backfill_draft_column_on_merge_requests_rerun.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleBackfillDraftColumnOnMergeRequestsRerun < ActiveRecord::Migration[6.1]
- def up
- # noop
- #
- end
-
- def down
- # noop
- #
- end
-end
diff --git a/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb b/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb
deleted file mode 100644
index 5f094e48ed4..00000000000
--- a/db/post_migrate/20210806131706_finalize_taggins_bigint_conversion.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeTagginsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'taggings'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id taggable_id], %w[id_convert_to_bigint taggable_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # rubocop:disable Migration/PreventIndexCreation
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: 'index_taggings_on_id_convert_to_bigint'
-
- # This is to replace the existing "index_taggings_on_taggable_id_and_taggable_type" btree (taggable_id, taggable_type)
- add_concurrent_index TABLE_NAME, [:taggable_id_convert_to_bigint, :taggable_type], name: 'i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type'
-
- # This is to replace the existing "index_taggings_on_taggable_id_and_taggable_type_and_context" btree (taggable_id, taggable_type, context)
- add_concurrent_index TABLE_NAME, [:taggable_id_convert_to_bigint, :taggable_type, :context], name: 'i_taggings_on_taggable_bigint_and_taggable_type_and_context'
-
- # This is to replace the existing "taggings_idx" btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type)
- add_concurrent_index TABLE_NAME, [:tag_id, :taggable_id_convert_to_bigint, :taggable_type, :context, :tagger_id, :tagger_type], unique: true, name: 'taggings_idx_tmp'
-
- # This is to replace the existing "tmp_index_taggings_on_id_where_taggable_type_project" btree (id) WHERE taggable_type::text = 'Project'::text
- add_concurrent_index TABLE_NAME, :id_convert_to_bigint, where: "taggable_type = 'Project'", name: 'tmp_index_taggings_on_id_bigint_where_taggable_type_project'
- # rubocop:enable Migration/PreventIndexCreation
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
- execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- # Swap column names
- temp_name = 'taggable_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:taggable_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:taggable_id_convert_to_bigint)} TO #{quote_column_name(:taggable_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:taggable_id_convert_to_bigint)}"
-
- temp_name = 'id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :taggable_id], [:id_convert_to_bigint, :taggable_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- execute "ALTER SEQUENCE taggings_id_seq OWNED BY #{TABLE_NAME}.id"
- change_column_default TABLE_NAME, :id, -> { "nextval('taggings_id_seq'::regclass)" }
- change_column_default TABLE_NAME, :id_convert_to_bigint, 0
-
- # Swap PK constraint
- execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT taggings_pkey CASCADE"
- rename_index TABLE_NAME, 'index_taggings_on_id_convert_to_bigint', 'taggings_pkey'
- execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT taggings_pkey PRIMARY KEY USING INDEX taggings_pkey"
-
- # Rename the index on the `bigint` column to match the new column name
- # (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here)
- execute 'DROP INDEX IF EXISTS index_taggings_on_taggable_id_and_taggable_type'
- rename_index TABLE_NAME, 'i_taggings_on_taggable_id_convert_to_bigint_and_taggable_type', 'index_taggings_on_taggable_id_and_taggable_type'
- execute 'DROP INDEX IF EXISTS index_taggings_on_taggable_id_and_taggable_type_and_context'
- rename_index TABLE_NAME, 'i_taggings_on_taggable_bigint_and_taggable_type_and_context', 'index_taggings_on_taggable_id_and_taggable_type_and_context'
- execute 'DROP INDEX IF EXISTS taggings_idx'
- rename_index TABLE_NAME, 'taggings_idx_tmp', 'taggings_idx'
- execute 'DROP INDEX IF EXISTS tmp_index_taggings_on_id_where_taggable_type_project'
- rename_index TABLE_NAME, 'tmp_index_taggings_on_id_bigint_where_taggable_type_project', 'tmp_index_taggings_on_id_where_taggable_type_project'
- end
- end
-end
diff --git a/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb b/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb
deleted file mode 100644
index ddbafaf32a9..00000000000
--- a/db/post_migrate/20210809123658_orphaned_invite_tokens_cleanup.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-# frozen_string_literal: true
-
-class OrphanedInviteTokensCleanup < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_orphaned_invite_tokens'
-
- def up
- add_concurrent_index('members', :id, where: query_condition, name: TMP_INDEX_NAME)
-
- membership.where(query_condition).pluck(:id).each_slice(10) do |group|
- membership.where(id: group).where(query_condition).update_all(invite_token: nil)
- end
-
- remove_concurrent_index_by_name('members', TMP_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name('members', TMP_INDEX_NAME) if index_exists_by_name?('members', TMP_INDEX_NAME)
-
- # This migration is irreversible
- end
-
- private
-
- def membership
- @membership ||= define_batchable_model('members')
- end
-
- # We need to ensure we're comparing timestamp with time zones across
- # the board since that is an immutable comparison. Some database
- # schemas have a mix of timestamp without time zones and and timestamp
- # with time zones: https://gitlab.com/groups/gitlab-org/-/epics/2473
- def query_condition
- "invite_token IS NOT NULL and invite_accepted_at IS NOT NULL and #{timestamptz("invite_accepted_at")} < #{timestamptz("created_at")}"
- end
-
- def timestamptz(name)
- if column_type(name) == "timestamp without time zone"
- "TIMEZONE('UTC', #{name})"
- else
- name
- end
- end
-
- def column_type(name)
- membership.columns_hash[name].sql_type
- end
-end
diff --git a/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb b/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb
deleted file mode 100644
index 5cec6fa30b8..00000000000
--- a/db/post_migrate/20210809143931_finalize_job_id_conversion_to_bigint_for_ci_job_artifacts.rb
+++ /dev/null
@@ -1,79 +0,0 @@
-# frozen_string_literal: true
-
-class FinalizeJobIdConversionToBigintForCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE_NAME = 'ci_job_artifacts'
-
- def up
- ensure_batched_background_migration_is_finished(
- job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
- table_name: TABLE_NAME,
- column_name: 'id',
- job_arguments: [%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]]
- )
-
- swap
- end
-
- def down
- swap
- end
-
- private
-
- def swap
- # This is to replace the existing "index_ci_job_artifacts_on_expire_at_and_job_id" btree (expire_at, job_id)
- add_concurrent_index TABLE_NAME, [:expire_at, :job_id_convert_to_bigint], name: 'index_ci_job_artifacts_on_expire_at_and_job_id_bigint'
- # This is to replace the existing "index_ci_job_artifacts_on_job_id_and_file_type" btree (job_id, file_type)
- add_concurrent_index TABLE_NAME, [:job_id_convert_to_bigint, :file_type], name: 'index_ci_job_artifacts_on_job_id_and_file_type_bigint', unique: true
-
- # # Add a FK on `job_id_convert_to_bigint` to `ci_builds(id)`, the old FK (fk_rails_c5137cb2c1)
- # # is removed below since it won't be dropped automatically.
- fk_ci_builds_job_id = concurrent_foreign_key_name(TABLE_NAME, :job_id, prefix: 'fk_rails_')
- fk_ci_builds_job_id_tmp = "#{fk_ci_builds_job_id}_tmp"
-
- add_concurrent_foreign_key TABLE_NAME, :ci_builds,
- column: :job_id_convert_to_bigint,
- name: fk_ci_builds_job_id_tmp,
- on_delete: :cascade,
- reverse_lock_order: true
-
- with_lock_retries(raise_on_exhaustion: true) do
- # We'll need ACCESS EXCLUSIVE lock on the related tables,
- # lets make sure it can be acquired from the start
-
- execute "LOCK TABLE ci_builds, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE"
-
- temp_name = 'job_id_tmp'
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:job_id)} TO #{quote_column_name(temp_name)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(:job_id_convert_to_bigint)} TO #{quote_column_name(:job_id)}"
- execute "ALTER TABLE #{quote_table_name(TABLE_NAME)} RENAME COLUMN #{quote_column_name(temp_name)} TO #{quote_column_name(:job_id_convert_to_bigint)}"
-
- # We need to update the trigger function in order to make PostgreSQL to
- # regenerate the execution plan for it. This is to avoid type mismatch errors like
- # "type of parameter 15 (bigint) does not match that when preparing the plan (integer)"
- function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection).name([:id, :job_id], [:id_convert_to_bigint, :job_id_convert_to_bigint])
- execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
-
- # Swap defaults
- change_column_default TABLE_NAME, :job_id, nil
- change_column_default TABLE_NAME, :job_id_convert_to_bigint, 0
-
- # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY here
- execute 'DROP INDEX index_ci_job_artifacts_on_expire_at_and_job_id'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_on_expire_at_and_job_id_bigint', 'index_ci_job_artifacts_on_expire_at_and_job_id'
- execute 'DROP INDEX index_ci_job_artifacts_on_job_id_and_file_type'
- rename_index TABLE_NAME, 'index_ci_job_artifacts_on_job_id_and_file_type_bigint', 'index_ci_job_artifacts_on_job_id_and_file_type'
-
- # Drop original FK on the old int4 `job_id` (fk_rails_c5137cb2c1)
- remove_foreign_key TABLE_NAME, name: fk_ci_builds_job_id
-
- # We swapped the columns but the FK for job_id is still using the temporary name for the job_id_convert_to_bigint column
- # So we have to also swap the FK name now that we dropped the other one with the same
- rename_constraint(TABLE_NAME, fk_ci_builds_job_id_tmp, fk_ci_builds_job_id)
- end
- end
-end
diff --git a/db/post_migrate/20210811122206_update_external_project_bots.rb b/db/post_migrate/20210811122206_update_external_project_bots.rb
deleted file mode 100644
index dc2e3d316b0..00000000000
--- a/db/post_migrate/20210811122206_update_external_project_bots.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class UpdateExternalProjectBots < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- class User < ActiveRecord::Base
- self.table_name = 'users'
- end
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_update_external_project_bots'
-
- def up
- add_concurrent_index('users', 'id', name: TMP_INDEX_NAME, where: 'external = true')
-
- ids = ActiveRecord::Base.connection
- .execute("SELECT u.id FROM users u JOIN users u2 on u2.id = u.created_by_id WHERE u.user_type = 6 AND u2.external = true")
- .map { |result| result['id'] }
-
- ids.each_slice(10) do |group|
- UpdateExternalProjectBots::User.where(id: group).update_all(external: true)
- end
-
- remove_concurrent_index_by_name('users', TMP_INDEX_NAME)
- end
-
- def down
- remove_concurrent_index_by_name('users', TMP_INDEX_NAME) if index_exists_by_name?('users', TMP_INDEX_NAME)
-
- # This migration is irreversible
- end
-end
diff --git a/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb b/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb
deleted file mode 100644
index 106d1430dca..00000000000
--- a/db/post_migrate/20210811214811_schedule_copy_ci_builds_columns_to_security_scans.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleCopyCiBuildsColumnsToSecurityScans < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- # no-op as we found an issue with bg migration, we fixed it and rescheduling it again.
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb b/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb
deleted file mode 100644
index 1c2e2b52e8b..00000000000
--- a/db/post_migrate/20210812013042_remove_duplicate_project_authorizations.rb
+++ /dev/null
@@ -1,112 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateProjectAuthorizations < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- BATCH_SIZE = 10_000
- OLD_INDEX_NAME = 'index_project_authorizations_on_project_id_user_id'
- INDEX_NAME = 'index_unique_project_authorizations_on_project_id_user_id'
-
- class ProjectAuthorization < ActiveRecord::Base
- self.table_name = 'project_authorizations'
- end
-
- disable_ddl_transaction!
-
- def up
- batch do |first_record, last_record|
- break if first_record.blank?
-
- # construct a range query where we filter records between the first and last records
- rows = ActiveRecord::Base.connection.execute <<~SQL
- SELECT user_id, project_id
- FROM project_authorizations
- WHERE
- #{start_condition(first_record)}
- #{end_condition(last_record)}
- GROUP BY user_id, project_id
- HAVING COUNT(*) > 1
- SQL
-
- rows.each do |row|
- deduplicate_item(row['project_id'], row['user_id'])
- end
- end
-
- add_concurrent_index :project_authorizations, [:project_id, :user_id], unique: true, name: INDEX_NAME
- remove_concurrent_index_by_name :project_authorizations, OLD_INDEX_NAME
- end
-
- def down
- add_concurrent_index(:project_authorizations, [:project_id, :user_id], name: OLD_INDEX_NAME)
- remove_concurrent_index_by_name(:project_authorizations, INDEX_NAME)
- end
-
- private
-
- def start_condition(record)
- "(user_id, project_id) >= (#{Integer(record.user_id)}, #{Integer(record.project_id)})"
- end
-
- def end_condition(record)
- return "" unless record
-
- "AND (user_id, project_id) <= (#{Integer(record.user_id)}, #{Integer(record.project_id)})"
- end
-
- def batch(&block)
- order = Gitlab::Pagination::Keyset::Order.build(
- [
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'user_id',
- order_expression: ProjectAuthorization.arel_table[:user_id].asc,
- nullable: :not_nullable,
- distinct: false
- ),
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'project_id',
- order_expression: ProjectAuthorization.arel_table[:project_id].asc,
- nullable: :not_nullable,
- distinct: false
- ),
- Gitlab::Pagination::Keyset::ColumnOrderDefinition.new(
- attribute_name: 'access_level',
- order_expression: ProjectAuthorization.arel_table[:access_level].asc,
- nullable: :not_nullable,
- distinct: true
- )
- ])
-
- scope = ProjectAuthorization.order(order)
- cursor = {}
- loop do
- current_scope = scope.dup
-
- relation = order.apply_cursor_conditions(current_scope, cursor)
- first_record = relation.take
- last_record = relation.offset(BATCH_SIZE).take
-
- yield first_record, last_record
-
- break if last_record.blank?
-
- cursor = order.cursor_attributes_for_node(last_record)
- end
- end
-
- def deduplicate_item(project_id, user_id)
- auth_records = ProjectAuthorization.where(project_id: project_id, user_id: user_id).order(access_level: :desc).to_a
-
- ActiveRecord::Base.transaction do
- # Keep the highest access level and destroy the rest.
- auth_records[1..].each do |record|
- ProjectAuthorization
- .where(
- project_id: record.project_id,
- user_id: record.user_id,
- access_level: record.access_level
- ).delete_all
- end
- end
- end
-end
diff --git a/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb b/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb
deleted file mode 100644
index 6b4c69efa2b..00000000000
--- a/db/post_migrate/20210812145010_reset_job_token_scope_enabled_again.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class ResetJobTokenScopeEnabledAgain < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- with_lock_retries do
- remove_column :project_ci_cd_settings, :job_token_scope_enabled
- add_column :project_ci_cd_settings, :job_token_scope_enabled, :boolean, default: false, null: false
- end
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb b/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb
deleted file mode 100644
index d11baae42e2..00000000000
--- a/db/post_migrate/20210813151908_replace_external_wiki_triggers.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-# frozen_string_literal: true
-
-class ReplaceExternalWikiTriggers < ActiveRecord::Migration[6.1]
- include Gitlab::Database::SchemaHelpers
-
- def up
- replace_triggers('type_new', 'Integrations::ExternalWiki')
-
- # we need an extra trigger to handle when type_new is updated by the
- # `integrations_set_type_new` trigger.
- # This can be removed when this trigger has been removed.
- execute(<<~SQL.squish)
- CREATE TRIGGER #{trigger_name(:type_new_updated)}
- AFTER UPDATE OF type_new ON integrations FOR EACH ROW
- WHEN ((new.type_new)::text = 'Integrations::ExternalWiki'::text AND new.project_id IS NOT NULL)
- EXECUTE FUNCTION set_has_external_wiki();
- SQL
- end
-
- def down
- execute("DROP TRIGGER IF EXISTS #{trigger_name(:type_new_updated)} ON integrations;")
- replace_triggers('type', 'ExternalWikiService')
- end
-
- private
-
- def replace_triggers(column_name, value)
- triggers(column_name, value).each do |event, condition|
- trigger = trigger_name(event)
-
- # create duplicate trigger, using the defined condition
- execute(<<~SQL.squish)
- CREATE TRIGGER #{trigger}_new AFTER #{event.upcase} ON integrations FOR EACH ROW
- WHEN (#{condition})
- EXECUTE FUNCTION set_has_external_wiki();
- SQL
-
- # Swap the triggers in place, so that the new trigger has the canonical name
- execute("ALTER TRIGGER #{trigger} ON integrations RENAME TO #{trigger}_old;")
- execute("ALTER TRIGGER #{trigger}_new ON integrations RENAME TO #{trigger};")
-
- # remove the old, now redundant trigger
- execute("DROP TRIGGER IF EXISTS #{trigger}_old ON integrations;")
- end
- end
-
- def trigger_name(event)
- "trigger_has_external_wiki_on_#{event}"
- end
-
- def triggers(column_name, value)
- {
- delete: "#{matches_value('old', column_name, value)} AND #{project_not_null('old')}",
- insert: "(new.active = true) AND #{matches_value('new', column_name, value)} AND #{project_not_null('new')}",
- update: "#{matches_value('new', column_name, value)} AND (old.active <> new.active) AND #{project_not_null('new')}"
- }
- end
-
- def project_not_null(row)
- "(#{row}.project_id IS NOT NULL)"
- end
-
- def matches_value(row, column_name, value)
- "((#{row}.#{column_name})::text = '#{value}'::text)"
- end
-end
diff --git a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb b/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
deleted file mode 100644
index 0e6f1c50534..00000000000
--- a/db/post_migrate/20210813195518_schedule_recalculate_uuid_on_vulnerabilities_occurrences3.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences3 < ActiveRecord::Migration[6.0]
- def up
- # no-op
- # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb b/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb
deleted file mode 100644
index 074ba97da65..00000000000
--- a/db/post_migrate/20210816183304_schedule_copy_ci_builds_columns_to_security_scans2.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class ScheduleCopyCiBuildsColumnsToSecurityScans2 < ActiveRecord::Migration[6.1]
- def up
- # no-op: Must have run before %"15.X" as it is not compatible with decomposed CI database
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb b/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb
deleted file mode 100644
index e1ed28f6826..00000000000
--- a/db/post_migrate/20210817024335_prepare_indexes_for_events_bigint_conversion.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForEventsBigintConversion < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = 'events'
-
- def up
- prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true,
- name: :index_events_on_id_convert_to_bigint
-
- prepare_async_index TABLE_NAME, [:project_id, :id_convert_to_bigint],
- name: :index_events_on_project_id_and_id_convert_to_bigint
-
- prepare_async_index TABLE_NAME, [:project_id, :id_convert_to_bigint],
- order: { id_convert_to_bigint: :desc },
- where: 'action = 7', name: :index_events_on_project_id_and_id_bigint_desc_on_merged_action
- end
-
- def down
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_id_convert_to_bigint
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_project_id_and_id_convert_to_bigint
- unprepare_async_index_by_name TABLE_NAME, :index_events_on_project_id_and_id_bigint_desc_on_merged_action
- end
-end
diff --git a/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb b/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb
deleted file mode 100644
index d86d49f4393..00000000000
--- a/db/post_migrate/20210818185845_backfill_projects_with_coverage.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillProjectsWithCoverage < ActiveRecord::Migration[6.1]
- def up
- # noop
- end
-
- def down
- # noop
- end
-end
diff --git a/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb b/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb
deleted file mode 100644
index bbcee556020..00000000000
--- a/db/post_migrate/20210819145000_drop_temporary_columns_and_triggers_for_ci_builds_runner_session.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryColumnsAndTriggersForCiBuildsRunnerSession < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = 'ci_builds_runner_session'
- TEMPORARY_COLUMN = 'build_id_convert_to_bigint'
- MAIN_COLUMN = 'build_id'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- with_lock_retries do
- cleanup_conversion_of_integer_to_bigint(TABLE, MAIN_COLUMN)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- add_column(TABLE, TEMPORARY_COLUMN, :int, default: 0, null: false)
- install_rename_triggers(TABLE, MAIN_COLUMN, TEMPORARY_COLUMN)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb b/db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb
deleted file mode 100644
index cdfd92ac0d7..00000000000
--- a/db/post_migrate/20210819183128_reset_severity_levels_to_new_default.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class ResetSeverityLevelsToNewDefault < ActiveRecord::Migration[6.1]
- ALL_SEVERITY_LEVELS = 6 # ::Enums::Vulnerability::SEVERITY_LEVELS.count
-
- def up
- execute(<<~SQL.squish)
- UPDATE approval_project_rules
- SET severity_levels = '{unknown, high, critical}'
- WHERE array_length(severity_levels, 1) = #{ALL_SEVERITY_LEVELS};
- SQL
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb b/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb
deleted file mode 100644
index 7e893d62c28..00000000000
--- a/db/post_migrate/20210823113259_steal_merge_request_diff_commit_users_migration.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-# See https://docs.gitlab.com/ee/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class StealMergeRequestDiffCommitUsersMigration < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- def up
- job = Gitlab::Database::BackgroundMigrationJob
- .for_migration_class('MigrateMergeRequestDiffCommitUsers')
- .pending
- .last
-
- return unless job
-
- # We schedule in one hour so we don't end up running the migrations while a
- # deployment is still wrapping up. Not that that really matters, but it
- # prevents from too much happening during a deployment window.
- migrate_in(1.hour, 'StealMigrateMergeRequestDiffCommitUsers', job.arguments)
- end
-
- def down
- # no-op
- end
-end
diff --git a/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb b/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb
deleted file mode 100644
index 35cf3b55200..00000000000
--- a/db/post_migrate/20210823132600_remove_duplicate_dast_site_tokens.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateDastSiteTokens < ActiveRecord::Migration[6.1]
- disable_ddl_transaction!
-
- class DastSiteToken < ApplicationRecord
- self.table_name = 'dast_site_tokens'
- self.inheritance_column = :_type_disabled
-
- scope :duplicates, -> do
- all_duplicates = select(:project_id, :url)
- .distinct
- .group(:project_id, :url)
- .having('count(*) > 1')
- .pluck('array_agg(id) as ids')
-
- duplicate_ids = extract_duplicate_ids(all_duplicates)
-
- where(id: duplicate_ids)
- end
-
- def self.extract_duplicate_ids(duplicates)
- duplicates.flat_map { |ids| ids.first(ids.size - 1) }
- end
- end
-
- def up
- DastSiteToken.duplicates.delete_all
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb b/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb
deleted file mode 100644
index 42b25a192d5..00000000000
--- a/db/post_migrate/20210823142036_drop_temporary_trigger_for_ci_job_artifacts.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class DropTemporaryTriggerForCiJobArtifacts < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TABLE = 'ci_job_artifacts'
- TEMPORARY_COLUMNS = %w(id_convert_to_bigint job_id_convert_to_bigint)
- MAIN_COLUMNS = %w(id job_id)
- TRIGGER = 'trigger_be1804f21693'
-
- # rubocop:disable Migration/WithLockRetriesDisallowedMethod
- def up
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- remove_rename_triggers(TABLE, TRIGGER)
- end
- end
-
- def down
- check_trigger_permissions!(TABLE)
-
- with_lock_retries do
- install_rename_triggers(TABLE, MAIN_COLUMNS, TEMPORARY_COLUMNS, trigger_name: TRIGGER)
- end
- end
- # rubocop:enable Migration/WithLockRetriesDisallowedMethod
-end
diff --git a/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb b/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
deleted file mode 100644
index 638361d0e83..00000000000
--- a/db/post_migrate/20210823193234_remove_allow_editing_commit_messages_from_project_settings.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveAllowEditingCommitMessagesFromProjectSettings < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- return unless column_exists?(:project_settings, :allow_editing_commit_messages)
-
- with_lock_retries do
- remove_column :project_settings, :allow_editing_commit_messages
- end
- end
-
- def down
- with_lock_retries do
- add_column :project_settings, :allow_editing_commit_messages, :boolean, default: false, null: false
- end
- end
-end
diff --git a/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb b/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
deleted file mode 100644
index d88a31fca7d..00000000000
--- a/db/post_migrate/20210824102624_add_project_namespace_index_to_project.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceIndexToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_projects_on_project_namespace_id'
-
- def up
- add_concurrent_index :projects, :project_namespace_id, name: INDEX_NAME, unique: true
- end
-
- def down
- remove_concurrent_index_by_name :projects, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb b/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb
deleted file mode 100644
index 5cb42fd61a7..00000000000
--- a/db/post_migrate/20210824102750_add_project_namespace_foreign_key_to_project.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectNamespaceForeignKeyToProject < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TARGET_COLUMN = :project_namespace_id
-
- def up
- add_concurrent_foreign_key :projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
- end
- end
-end
diff --git a/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb b/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb
deleted file mode 100644
index bf95aa98295..00000000000
--- a/db/post_migrate/20210824174615_prepare_ci_builds_metadata_and_ci_build_async_indexes.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareCiBuildsMetadataAndCiBuildAsyncIndexes < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- def up
- prepare_async_index :ci_builds_metadata, :id_convert_to_bigint, unique: true,
- name: :index_ci_builds_metadata_on_id_convert_to_bigint
-
- prepare_async_index :ci_builds_metadata, :build_id_convert_to_bigint, unique: true,
- name: :index_ci_builds_metadata_on_build_id_convert_to_bigint
-
- prepare_async_index :ci_builds_metadata, :build_id_convert_to_bigint, where: 'has_exposed_artifacts IS TRUE',
- name: :index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts
-
- prepare_async_index_from_sql(:ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_where_interruptible, <<~SQL.squish)
- CREATE INDEX CONCURRENTLY "index_ci_builds_metadata_on_build_id_int8_where_interruptible"
- ON "ci_builds_metadata" ("build_id_convert_to_bigint") INCLUDE ("id_convert_to_bigint")
- WHERE interruptible = true
- SQL
-
- prepare_async_index :ci_builds, :id_convert_to_bigint, unique: true,
- name: :index_ci_builds_on_converted_id
- end
-
- def down
- unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_converted_id
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_where_interruptible
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_int8_and_exposed_artifacts
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_build_id_convert_to_bigint
-
- unprepare_async_index_by_name :ci_builds_metadata, :index_ci_builds_metadata_on_id_convert_to_bigint
- end
-
- private
-
- def prepare_async_index_from_sql(table_name, index_name, definition)
- return unless async_index_creation_available?
-
- return if index_name_exists?(table_name, index_name)
-
- async_index = Gitlab::Database::AsyncIndexes::PostgresAsyncIndex.find_or_create_by!(name: index_name) do |rec|
- rec.table_name = table_name
- rec.definition = definition
- end
-
- Gitlab::AppLogger.info(
- message: 'Prepared index for async creation',
- table_name: async_index.table_name,
- index_name: async_index.name)
- end
-end
diff --git a/db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb b/db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb
deleted file mode 100644
index d892e6897af..00000000000
--- a/db/post_migrate/20210825150212_cleanup_remaining_orphan_invites.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-# frozen_string_literal: true
-
-class CleanupRemainingOrphanInvites < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- disable_ddl_transaction!
-
- TMP_INDEX_NAME = 'tmp_idx_members_with_orphaned_invites'
-
- QUERY_CONDITION = "invite_token IS NOT NULL AND user_id IS NOT NULL"
-
- def up
- membership = define_batchable_model('members')
-
- add_concurrent_index :members, :id, where: QUERY_CONDITION, name: TMP_INDEX_NAME
-
- membership.where(QUERY_CONDITION).pluck(:id).each_slice(10) do |group|
- membership.where(id: group).where(QUERY_CONDITION).update_all(invite_token: nil)
- end
-
- remove_concurrent_index_by_name :members, TMP_INDEX_NAME
- end
-
- def down
- remove_concurrent_index_by_name :members, TMP_INDEX_NAME if index_exists_by_name?(:members, TMP_INDEX_NAME)
- end
-end
diff --git a/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb b/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb
deleted file mode 100644
index 4d8e18ba8ed..00000000000
--- a/db/post_migrate/20210825182303_remove_duplicate_dast_site_tokens_with_same_token.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-class RemoveDuplicateDastSiteTokensWithSameToken < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- INDEX_NAME = 'index_dast_site_token_on_token'
-
- # rubocop: disable Migration/AddIndex
- def up
- execute("WITH duplicate_tokens AS(
- SELECT id, rank() OVER (PARTITION BY token ORDER BY id) r FROM dast_site_tokens
- )
- DELETE FROM dast_site_tokens c USING duplicate_tokens t
- WHERE c.id = t.id AND t.r > 1;")
-
- add_index :dast_site_tokens, :token, name: INDEX_NAME, unique: true
- end
-
- # rubocop: disable Migration/RemoveIndex
- def down
- remove_index :dast_site_tokens, :token, name: INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb b/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb
deleted file mode 100644
index eb879d9bc7a..00000000000
--- a/db/post_migrate/20210825193548_add_fk_to_iteration_cadence_id_on_boards.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-# frozen_string_literal: true
-
-class AddFkToIterationCadenceIdOnBoards < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_boards_on_iteration_cadence_id'
-
- def up
- add_concurrent_index :boards, :iteration_cadence_id, name: INDEX_NAME
- add_concurrent_foreign_key :boards, :iterations_cadences, column: :iteration_cadence_id
- end
-
- def down
- with_lock_retries do
- remove_foreign_key_if_exists :boards, column: :iteration_cadence_id
- end
- remove_concurrent_index_by_name :boards, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb b/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb
deleted file mode 100644
index 1f6650140d4..00000000000
--- a/db/post_migrate/20210825193652_backfill_cadence_id_for_boards_scoped_to_iteration.rb
+++ /dev/null
@@ -1,49 +0,0 @@
-# frozen_string_literal: true
-
-class BackfillCadenceIdForBoardsScopedToIteration < Gitlab::Database::Migration[1.0]
- disable_ddl_transaction!
-
- BATCH_SIZE = 1000
- DELAY = 2.minutes.to_i
- MIGRATION = 'BackfillIterationCadenceIdForBoards'
-
- class MigrationBoard < ApplicationRecord
- include EachBatch
-
- self.table_name = 'boards'
- end
-
- def up
- schedule_backfill_group_boards
- schedule_backfill_project_boards
- end
-
- def down
- MigrationBoard.where.not(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['none', 'down', *range])
- end
- end
-
- private
-
- def schedule_backfill_project_boards
- MigrationBoard.where(iteration_id: -4).where.not(project_id: nil).where(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['project', 'up', *range])
- end
- end
-
- def schedule_backfill_group_boards
- MigrationBoard.where(iteration_id: -4).where.not(group_id: nil).where(iteration_cadence_id: nil).each_batch(of: BATCH_SIZE) do |batch, index|
- range = batch.pick(Arel.sql('MIN(id)'), Arel.sql('MAX(id)'))
- delay = index * DELAY
-
- migrate_in(delay, MIGRATION, ['group', 'up', *range])
- end
- end
-end
diff --git a/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb b/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
deleted file mode 100644
index e11bb25d83c..00000000000
--- a/db/post_migrate/20210826110839_prepare_indexes_for_ci_job_artifacts_expire_at_unlocked.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# frozen_string_literal: true
-
-class PrepareIndexesForCiJobArtifactsExpireAtUnlocked < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- TABLE_NAME = 'ci_job_artifacts'
- INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx'
-
- def up
- prepare_async_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME
- end
-
- def down
- unprepare_async_index_by_name TABLE_NAME, INDEX_NAME
- end
-end
diff --git a/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb b/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb
deleted file mode 100644
index 7615931464b..00000000000
--- a/db/post_migrate/20210826171758_initialize_throttle_unauthenticated_api_columns.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-# frozen_string_literal: true
-
-# Initialize the new `throttle_unauthenticated_api_*` columns with the current values
-# from the `throttle_unauthenticated_*` columns, which will now only apply to web requests.
-#
-# The columns for the unauthenticated web rate limit will be renamed later
-# in https://gitlab.com/gitlab-org/gitlab/-/issues/340031.
-class InitializeThrottleUnauthenticatedApiColumns < ActiveRecord::Migration[6.1]
- class ApplicationSetting < ActiveRecord::Base
- self.table_name = :application_settings
- end
-
- def up
- ApplicationSetting.update_all(%q{
- throttle_unauthenticated_api_enabled = throttle_unauthenticated_enabled,
- throttle_unauthenticated_api_requests_per_period = throttle_unauthenticated_requests_per_period,
- throttle_unauthenticated_api_period_in_seconds = throttle_unauthenticated_period_in_seconds
- })
- end
-
- def down
- end
-end
diff --git a/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb b/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..ae51e312fc4
--- /dev/null
+++ b/db/post_migrate/20230207143602_schedule_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ScheduleFkIndexToCiBuildTraceMetadataOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_build_trace_metadata_on_partition_id_build_id
+ TABLE_NAME = :ci_build_trace_metadata
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ prepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME, unique: true)
+ end
+
+ def down
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..c9eda410b34
--- /dev/null
+++ b/db/post_migrate/20230207143844_schedule_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ScheduleFkIndexToCiJobArtifactsOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_job_artifacts_on_partition_id_job_id
+ TABLE_NAME = :ci_job_artifacts
+ COLUMNS = [:partition_id, :job_id]
+
+ def up
+ prepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/schema_migrations/20210602155110 b/db/schema_migrations/20210602155110
deleted file mode 100644
index 127375dc477..00000000000
--- a/db/schema_migrations/20210602155110
+++ /dev/null
@@ -1 +0,0 @@
-aa04d433e400ed3ec11e5d40ada72f122b1d8b7a82f8803d9206da5c94ec5ef9 \ No newline at end of file
diff --git a/db/schema_migrations/20210602164044 b/db/schema_migrations/20210602164044
deleted file mode 100644
index 4574aaf9cb9..00000000000
--- a/db/schema_migrations/20210602164044
+++ /dev/null
@@ -1 +0,0 @@
-6c617b919e6e0cba0bd62cc0d5056dcad3ebe1a9ce25102a288de5456cbaa6c3 \ No newline at end of file
diff --git a/db/schema_migrations/20210603140302 b/db/schema_migrations/20210603140302
deleted file mode 100644
index 346cf84c85c..00000000000
--- a/db/schema_migrations/20210603140302
+++ /dev/null
@@ -1 +0,0 @@
-5b58dbdcba08f6e56802aa58ba0d23e5353c1818a8d4d653d53dabaac4c0234c \ No newline at end of file
diff --git a/db/schema_migrations/20210603222333 b/db/schema_migrations/20210603222333
deleted file mode 100644
index 25b5055f17e..00000000000
--- a/db/schema_migrations/20210603222333
+++ /dev/null
@@ -1 +0,0 @@
-fb02e0fee2760dad203b54d81c342dbf1461b3010503cab05da1eb14ab5d33da \ No newline at end of file
diff --git a/db/schema_migrations/20210604032738 b/db/schema_migrations/20210604032738
deleted file mode 100644
index 1bd62357c71..00000000000
--- a/db/schema_migrations/20210604032738
+++ /dev/null
@@ -1 +0,0 @@
-fa373e98739d57d829273cfa9246137e2c151be67e97183c1dcdb288150aaeb5 \ No newline at end of file
diff --git a/db/schema_migrations/20210604034158 b/db/schema_migrations/20210604034158
deleted file mode 100644
index 06b04764628..00000000000
--- a/db/schema_migrations/20210604034158
+++ /dev/null
@@ -1 +0,0 @@
-c7cf4aad7637d793d1ace8fee02111bc9b0d2eea09efadb0fd616bc5c5e5550c \ No newline at end of file
diff --git a/db/schema_migrations/20210604034354 b/db/schema_migrations/20210604034354
deleted file mode 100644
index a76242b3412..00000000000
--- a/db/schema_migrations/20210604034354
+++ /dev/null
@@ -1 +0,0 @@
-da868be7c8edefc462110b5b36415870cc0c7c59dba1e3d514348011a9e70642 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051330 b/db/schema_migrations/20210604051330
deleted file mode 100644
index 74140921c2f..00000000000
--- a/db/schema_migrations/20210604051330
+++ /dev/null
@@ -1 +0,0 @@
-2d025932dca7a407968e14872ce053461e69550098ca089d4e6ece323d240927 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051742 b/db/schema_migrations/20210604051742
deleted file mode 100644
index 32ed06dafff..00000000000
--- a/db/schema_migrations/20210604051742
+++ /dev/null
@@ -1 +0,0 @@
-7529373266b6c9b179367d5fa8775f5e2ad600008957b3a821d689aec70c7407 \ No newline at end of file
diff --git a/db/schema_migrations/20210604051917 b/db/schema_migrations/20210604051917
deleted file mode 100644
index 0034d9988e7..00000000000
--- a/db/schema_migrations/20210604051917
+++ /dev/null
@@ -1 +0,0 @@
-3818094a4470ff7d0c105c000655dac4205e8265f78df638df0e2ef3dc6deaf3 \ No newline at end of file
diff --git a/db/schema_migrations/20210604082145 b/db/schema_migrations/20210604082145
deleted file mode 100644
index 2c568f0f2b6..00000000000
--- a/db/schema_migrations/20210604082145
+++ /dev/null
@@ -1 +0,0 @@
-f4191b4b8ae7c282c0012f533a01ebe341d62cb0418e39ad543d06ed2dac63a4 \ No newline at end of file
diff --git a/db/schema_migrations/20210604085600 b/db/schema_migrations/20210604085600
deleted file mode 100644
index aa8b3120916..00000000000
--- a/db/schema_migrations/20210604085600
+++ /dev/null
@@ -1 +0,0 @@
-8b6e1c7bacf2cbc05ba94e3fea2ab20e30b78ccaa6833949c11f89d1bdec8110 \ No newline at end of file
diff --git a/db/schema_migrations/20210604133651 b/db/schema_migrations/20210604133651
deleted file mode 100644
index 7c6394cd470..00000000000
--- a/db/schema_migrations/20210604133651
+++ /dev/null
@@ -1 +0,0 @@
-0c01bb41113c468a602649b591e1fd2959a6e3190c835ef2e27351cf69f50fd5 \ No newline at end of file
diff --git a/db/schema_migrations/20210606143426 b/db/schema_migrations/20210606143426
deleted file mode 100644
index a8a2d7d784c..00000000000
--- a/db/schema_migrations/20210606143426
+++ /dev/null
@@ -1 +0,0 @@
-1f99d446428ddac2a0fa7d64bdce9fc300bf02e88c35cdb3d726c501641e721d \ No newline at end of file
diff --git a/db/schema_migrations/20210607050531 b/db/schema_migrations/20210607050531
deleted file mode 100644
index e69ab586f4d..00000000000
--- a/db/schema_migrations/20210607050531
+++ /dev/null
@@ -1 +0,0 @@
-77f24cb4756dfeef16ba48a189d3bf9352534f858446522bc49495b9295374a8 \ No newline at end of file
diff --git a/db/schema_migrations/20210607080044 b/db/schema_migrations/20210607080044
deleted file mode 100644
index 9ccf86d8194..00000000000
--- a/db/schema_migrations/20210607080044
+++ /dev/null
@@ -1 +0,0 @@
-88f16dc06371d320a1245de68aba5ed4ad7cd8f15c4e5898619a751840981072 \ No newline at end of file
diff --git a/db/schema_migrations/20210607154719 b/db/schema_migrations/20210607154719
deleted file mode 100644
index 0f7aab0fc39..00000000000
--- a/db/schema_migrations/20210607154719
+++ /dev/null
@@ -1 +0,0 @@
-dd6bf6ae4988e8e07247388554992d5100dedb2bd66e92c42a6bb144dc6b1937 \ No newline at end of file
diff --git a/db/schema_migrations/20210608072312 b/db/schema_migrations/20210608072312
deleted file mode 100644
index c0c052397b1..00000000000
--- a/db/schema_migrations/20210608072312
+++ /dev/null
@@ -1 +0,0 @@
-c395f52ee34cd758df87ba0f74f4528a189704498e133fa53f0dd3f6f31a77b3 \ No newline at end of file
diff --git a/db/schema_migrations/20210608072346 b/db/schema_migrations/20210608072346
deleted file mode 100644
index 6ca0ad0f471..00000000000
--- a/db/schema_migrations/20210608072346
+++ /dev/null
@@ -1 +0,0 @@
-9f8ff974adc7c20908cd423b2d3f69d8ec16b0fcbb8bfbdb9347a9ff3f3a007a \ No newline at end of file
diff --git a/db/schema_migrations/20210608103230 b/db/schema_migrations/20210608103230
deleted file mode 100644
index 541faa3aab7..00000000000
--- a/db/schema_migrations/20210608103230
+++ /dev/null
@@ -1 +0,0 @@
-12d8de65d287cf29fa2761264c42eb42e7fe2a5b36c279e623d93897503b5313 \ No newline at end of file
diff --git a/db/schema_migrations/20210608103235 b/db/schema_migrations/20210608103235
deleted file mode 100644
index 601c374e620..00000000000
--- a/db/schema_migrations/20210608103235
+++ /dev/null
@@ -1 +0,0 @@
-fc503b8e9672eb5638d2cb3468c8df4d9c0d998332909351121ace04d3f7214a \ No newline at end of file
diff --git a/db/schema_migrations/20210608110752 b/db/schema_migrations/20210608110752
deleted file mode 100644
index 5c4a1f16971..00000000000
--- a/db/schema_migrations/20210608110752
+++ /dev/null
@@ -1 +0,0 @@
-cbe4cff5937f3ba39a4aeeed78dcc6dc6ece212b01b16bfcd61ccf4a20427dcc \ No newline at end of file
diff --git a/db/schema_migrations/20210608110760 b/db/schema_migrations/20210608110760
deleted file mode 100644
index 46ace509e0d..00000000000
--- a/db/schema_migrations/20210608110760
+++ /dev/null
@@ -1 +0,0 @@
-b84505713afce3bf0673329a3a4eaf85a00d4f8948f56d43d365d6cc47ef629c \ No newline at end of file
diff --git a/db/schema_migrations/20210609013512 b/db/schema_migrations/20210609013512
deleted file mode 100644
index 52541965dde..00000000000
--- a/db/schema_migrations/20210609013512
+++ /dev/null
@@ -1 +0,0 @@
-ddd40d4fb063b3a728f4b9a214d6033f70ee3719ac769957f5295a0c5f62a5c0 \ No newline at end of file
diff --git a/db/schema_migrations/20210609090856 b/db/schema_migrations/20210609090856
deleted file mode 100644
index f0c3c25a01b..00000000000
--- a/db/schema_migrations/20210609090856
+++ /dev/null
@@ -1 +0,0 @@
-597e04c51bdad1900b2535c9d664c9e3a4d2a5879e657ef470bbc7ac461d3cca \ No newline at end of file
diff --git a/db/schema_migrations/20210609125005 b/db/schema_migrations/20210609125005
deleted file mode 100644
index 3e26956bdb8..00000000000
--- a/db/schema_migrations/20210609125005
+++ /dev/null
@@ -1 +0,0 @@
-de8468173d8a7499d03b84913cf071af8842a2f47d5f85908af20bf7c71dc96b \ No newline at end of file
diff --git a/db/schema_migrations/20210609192728 b/db/schema_migrations/20210609192728
deleted file mode 100644
index e39cbc077b4..00000000000
--- a/db/schema_migrations/20210609192728
+++ /dev/null
@@ -1 +0,0 @@
-b6c503eddc1c5e36957b59efc8fc5dd75da18104499667c3fcc435fcbd739af3 \ No newline at end of file
diff --git a/db/schema_migrations/20210609193101 b/db/schema_migrations/20210609193101
deleted file mode 100644
index 42fc6427247..00000000000
--- a/db/schema_migrations/20210609193101
+++ /dev/null
@@ -1 +0,0 @@
-09771c6f56e54a4d3dc0caab4891cbaf2a1d5685ccb1161d141ce38e44d6cfdb \ No newline at end of file
diff --git a/db/schema_migrations/20210609202501 b/db/schema_migrations/20210609202501
deleted file mode 100644
index ad71feddcfc..00000000000
--- a/db/schema_migrations/20210609202501
+++ /dev/null
@@ -1 +0,0 @@
-93f577e2fe2dcc0daafc4ff7e15a4511a2e9f86f05f9892f5c7625f11bfce3ae \ No newline at end of file
diff --git a/db/schema_migrations/20210610042700 b/db/schema_migrations/20210610042700
deleted file mode 100644
index ef0f3e34f48..00000000000
--- a/db/schema_migrations/20210610042700
+++ /dev/null
@@ -1 +0,0 @@
-f8b8276ed7e120b61f6748a328590a98f0e444e0d26bcb1a2b0daa54c3643acd \ No newline at end of file
diff --git a/db/schema_migrations/20210610102410 b/db/schema_migrations/20210610102410
deleted file mode 100644
index 1d6bb16209e..00000000000
--- a/db/schema_migrations/20210610102410
+++ /dev/null
@@ -1 +0,0 @@
-dab13c78f6f758c63be923277c0f31e4cce4e30f77a8dc2983a9bb1500a454f9 \ No newline at end of file
diff --git a/db/schema_migrations/20210610102413 b/db/schema_migrations/20210610102413
deleted file mode 100644
index d94b1623e24..00000000000
--- a/db/schema_migrations/20210610102413
+++ /dev/null
@@ -1 +0,0 @@
-ce21070d44a34081c6babd14e6a1b607bad5ed9047b18f4ef0beb64b5a2ce120 \ No newline at end of file
diff --git a/db/schema_migrations/20210610113229 b/db/schema_migrations/20210610113229
deleted file mode 100644
index 15d4d567534..00000000000
--- a/db/schema_migrations/20210610113229
+++ /dev/null
@@ -1 +0,0 @@
-3ad279a7c57e433a8ee349dabd2536c1de9055936b05c26b5469606067eb90d4 \ No newline at end of file
diff --git a/db/schema_migrations/20210610141711 b/db/schema_migrations/20210610141711
deleted file mode 100644
index 786ca655eeb..00000000000
--- a/db/schema_migrations/20210610141711
+++ /dev/null
@@ -1 +0,0 @@
-b8bfe0d67516f0fe71c166a616c2279fc9f45769c369d8ddd86e9705dbc55097 \ No newline at end of file
diff --git a/db/schema_migrations/20210610153556 b/db/schema_migrations/20210610153556
deleted file mode 100644
index 71b71a671c4..00000000000
--- a/db/schema_migrations/20210610153556
+++ /dev/null
@@ -1 +0,0 @@
-39ca841ce1de3faadee41fbb756d80c98efd853fbbffa7cb3f8f9de56752078b \ No newline at end of file
diff --git a/db/schema_migrations/20210611080951 b/db/schema_migrations/20210611080951
deleted file mode 100644
index ca33abde56c..00000000000
--- a/db/schema_migrations/20210611080951
+++ /dev/null
@@ -1 +0,0 @@
-95e4b697f5c5b18935b73bbeb0c42c96e3e5abde9e4f9e179d1a93a891a0694b \ No newline at end of file
diff --git a/db/schema_migrations/20210611082822 b/db/schema_migrations/20210611082822
deleted file mode 100644
index 474adb00646..00000000000
--- a/db/schema_migrations/20210611082822
+++ /dev/null
@@ -1 +0,0 @@
-28b31b6e8aba1b8feec2b9a29b5f91f7145431be5d8b9875bddb8183f89700f7 \ No newline at end of file
diff --git a/db/schema_migrations/20210611100359 b/db/schema_migrations/20210611100359
deleted file mode 100644
index 058f7c8ff4e..00000000000
--- a/db/schema_migrations/20210611100359
+++ /dev/null
@@ -1 +0,0 @@
-9429a8adca0bc85167f64e76d8d72b45d09d4303a01bd9c4ca39560bb4d89799 \ No newline at end of file
diff --git a/db/schema_migrations/20210611101034 b/db/schema_migrations/20210611101034
deleted file mode 100644
index 70712a32be1..00000000000
--- a/db/schema_migrations/20210611101034
+++ /dev/null
@@ -1 +0,0 @@
-a535348229ff5e9e3c5b530ded9407df9f4308fc4d9967106bf246d7267c2a48 \ No newline at end of file
diff --git a/db/schema_migrations/20210614124111 b/db/schema_migrations/20210614124111
deleted file mode 100644
index 25427277070..00000000000
--- a/db/schema_migrations/20210614124111
+++ /dev/null
@@ -1 +0,0 @@
-30c6316f3931075bd8b167e06af5d80b7ece65f428d1fa7602ab27b526bc8410 \ No newline at end of file
diff --git a/db/schema_migrations/20210614131002 b/db/schema_migrations/20210614131002
deleted file mode 100644
index 6d59a254365..00000000000
--- a/db/schema_migrations/20210614131002
+++ /dev/null
@@ -1 +0,0 @@
-dedf2f8d76f4131f34d61fe2c730f8b092ca46f8b35b08a76b7bc096c140aad1 \ No newline at end of file
diff --git a/db/schema_migrations/20210614142311 b/db/schema_migrations/20210614142311
deleted file mode 100644
index 69a2472990a..00000000000
--- a/db/schema_migrations/20210614142311
+++ /dev/null
@@ -1 +0,0 @@
-5dc0a4f91dc35b7720b20e89fa77374a0337c380b9234704e7d4143639e512f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210614143954 b/db/schema_migrations/20210614143954
deleted file mode 100644
index 7fd3ce9b49e..00000000000
--- a/db/schema_migrations/20210614143954
+++ /dev/null
@@ -1 +0,0 @@
-b958d65f1b3b43d7bcd2a703489132ba9a2ba1e0374d45533399355ce6be9365 \ No newline at end of file
diff --git a/db/schema_migrations/20210615064342 b/db/schema_migrations/20210615064342
deleted file mode 100644
index a126cd6258e..00000000000
--- a/db/schema_migrations/20210615064342
+++ /dev/null
@@ -1 +0,0 @@
-509f30d8772e24efc52c5aa12ebcde084f7ded8d228109bbbdda2f21d3235512 \ No newline at end of file
diff --git a/db/schema_migrations/20210615234935 b/db/schema_migrations/20210615234935
deleted file mode 100644
index 83e43f74a53..00000000000
--- a/db/schema_migrations/20210615234935
+++ /dev/null
@@ -1 +0,0 @@
-205336e95a6e3c9fa8c56fa67e66ef3023ba8c6cd4e6f3599160b74b3fbfaa3c \ No newline at end of file
diff --git a/db/schema_migrations/20210616110748 b/db/schema_migrations/20210616110748
deleted file mode 100644
index 06cab110a99..00000000000
--- a/db/schema_migrations/20210616110748
+++ /dev/null
@@ -1 +0,0 @@
-8207eb9917b4d02f39cd9e9eca9ec0e001266b25b3378f09e4e8c27ff22b6e73 \ No newline at end of file
diff --git a/db/schema_migrations/20210616111311 b/db/schema_migrations/20210616111311
deleted file mode 100644
index 070f9adfcda..00000000000
--- a/db/schema_migrations/20210616111311
+++ /dev/null
@@ -1 +0,0 @@
-fd014b505ecd162c232da23a10c34dc4b1f1dbe8fe357a0f20585479b25d50bc \ No newline at end of file
diff --git a/db/schema_migrations/20210616134905 b/db/schema_migrations/20210616134905
deleted file mode 100644
index 90658174989..00000000000
--- a/db/schema_migrations/20210616134905
+++ /dev/null
@@ -1 +0,0 @@
-52843d12ab18b92c71a334cf877682d9fae57632cf0ba14213dfc0543e39cf1b \ No newline at end of file
diff --git a/db/schema_migrations/20210616145254 b/db/schema_migrations/20210616145254
deleted file mode 100644
index e5d7553d883..00000000000
--- a/db/schema_migrations/20210616145254
+++ /dev/null
@@ -1 +0,0 @@
-525fbdd66dcabbf1e6d0430468600f86fbc3c00dcfdab1c5a052294d7d73de37 \ No newline at end of file
diff --git a/db/schema_migrations/20210616154808 b/db/schema_migrations/20210616154808
deleted file mode 100644
index be7d5811540..00000000000
--- a/db/schema_migrations/20210616154808
+++ /dev/null
@@ -1 +0,0 @@
-adfa07888317cb7f22062f5d23906bc01de579305acb3bb3384f18e3f581a87b \ No newline at end of file
diff --git a/db/schema_migrations/20210616185947 b/db/schema_migrations/20210616185947
deleted file mode 100644
index 30275f102dc..00000000000
--- a/db/schema_migrations/20210616185947
+++ /dev/null
@@ -1 +0,0 @@
-8d73f4b4b716176afe5a9b0ee3a4ef28bbbc2fe944a18fb66afa8cf8f763e8ac \ No newline at end of file
diff --git a/db/schema_migrations/20210617022324 b/db/schema_migrations/20210617022324
deleted file mode 100644
index 40bace34b4c..00000000000
--- a/db/schema_migrations/20210617022324
+++ /dev/null
@@ -1 +0,0 @@
-fa4f1ec80e7039e59d283dc6effd6904ca33c637d27c687d990822eb2f6198e5 \ No newline at end of file
diff --git a/db/schema_migrations/20210617161348 b/db/schema_migrations/20210617161348
deleted file mode 100644
index 238f969d304..00000000000
--- a/db/schema_migrations/20210617161348
+++ /dev/null
@@ -1 +0,0 @@
-3f73aa7d2cff11d00b330d88e76daaa058f82b7012da3c244f246da6e538921c \ No newline at end of file
diff --git a/db/schema_migrations/20210617180131 b/db/schema_migrations/20210617180131
deleted file mode 100644
index b44f82a3311..00000000000
--- a/db/schema_migrations/20210617180131
+++ /dev/null
@@ -1 +0,0 @@
-2adb38e71c6173350d1f98f3237b692e4f12c8a073115be23f3a713f69cde911 \ No newline at end of file
diff --git a/db/schema_migrations/20210621043337 b/db/schema_migrations/20210621043337
deleted file mode 100644
index 1dd6b0ac1dd..00000000000
--- a/db/schema_migrations/20210621043337
+++ /dev/null
@@ -1 +0,0 @@
-cfe35a1297c4a92c4b5e62757ed74c11ffd6f207777291c11b05a4e3cee91618 \ No newline at end of file
diff --git a/db/schema_migrations/20210621044000 b/db/schema_migrations/20210621044000
deleted file mode 100644
index 0b620576357..00000000000
--- a/db/schema_migrations/20210621044000
+++ /dev/null
@@ -1 +0,0 @@
-64babbed04b9e3bf59bb723b43e3c30730527f0e0e09906073b5bd9379067ab6 \ No newline at end of file
diff --git a/db/schema_migrations/20210621084632 b/db/schema_migrations/20210621084632
deleted file mode 100644
index 4ab2467fab0..00000000000
--- a/db/schema_migrations/20210621084632
+++ /dev/null
@@ -1 +0,0 @@
-fb5b54e29400836afb122cd38a2ae34abc1ff6dd800eadaba023220c51da6868 \ No newline at end of file
diff --git a/db/schema_migrations/20210621090030 b/db/schema_migrations/20210621090030
deleted file mode 100644
index c015bc6ec7f..00000000000
--- a/db/schema_migrations/20210621090030
+++ /dev/null
@@ -1 +0,0 @@
-5077a5c9cfe9b79506bb65d9dd02b745545a8586c198041bf7cbb945827c07cf \ No newline at end of file
diff --git a/db/schema_migrations/20210621091830 b/db/schema_migrations/20210621091830
deleted file mode 100644
index 89a505b0c9a..00000000000
--- a/db/schema_migrations/20210621091830
+++ /dev/null
@@ -1 +0,0 @@
-11450695142e5145e5cbf9077f259e28c908b794948be5c4b77e34465f6498aa \ No newline at end of file
diff --git a/db/schema_migrations/20210621111747 b/db/schema_migrations/20210621111747
deleted file mode 100644
index 728eb47b0ba..00000000000
--- a/db/schema_migrations/20210621111747
+++ /dev/null
@@ -1 +0,0 @@
-582a22626330e93e679a14eff2cdd85a5732f797fc1a6c94409d46cc5027c8ea \ No newline at end of file
diff --git a/db/schema_migrations/20210621155328 b/db/schema_migrations/20210621155328
deleted file mode 100644
index ba3dd235cee..00000000000
--- a/db/schema_migrations/20210621155328
+++ /dev/null
@@ -1 +0,0 @@
-d08fdc3da5fe1a7bf20af5fbe42438fc43ebdf1299c61159740df7644e4ea117 \ No newline at end of file
diff --git a/db/schema_migrations/20210621164210 b/db/schema_migrations/20210621164210
deleted file mode 100644
index 6855b8e42ee..00000000000
--- a/db/schema_migrations/20210621164210
+++ /dev/null
@@ -1 +0,0 @@
-b952f1e3fe2bfa680ba68b79637e0a2a1ee5b388cfa106db62521a663262b024 \ No newline at end of file
diff --git a/db/schema_migrations/20210621223000 b/db/schema_migrations/20210621223000
deleted file mode 100644
index 17f64d4b263..00000000000
--- a/db/schema_migrations/20210621223000
+++ /dev/null
@@ -1 +0,0 @@
-07d0de05b6a59ba0d1f464ae488f5ead812bc643984ac3dc662c78a02a978f7f \ No newline at end of file
diff --git a/db/schema_migrations/20210621223242 b/db/schema_migrations/20210621223242
deleted file mode 100644
index 9aa2562f30f..00000000000
--- a/db/schema_migrations/20210621223242
+++ /dev/null
@@ -1 +0,0 @@
-eeee178019c259a6fff85219490abf62f2694227cc2facf454d93e57c373833b \ No newline at end of file
diff --git a/db/schema_migrations/20210622041846 b/db/schema_migrations/20210622041846
deleted file mode 100644
index f16291b8424..00000000000
--- a/db/schema_migrations/20210622041846
+++ /dev/null
@@ -1 +0,0 @@
-750cda544df323be99452d53aaf39933c8584fc6754ece45263e131884d980d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210622045705 b/db/schema_migrations/20210622045705
deleted file mode 100644
index edf47a46a9d..00000000000
--- a/db/schema_migrations/20210622045705
+++ /dev/null
@@ -1 +0,0 @@
-8400d4497656a9f3f692528f9c0118e8898f2d4d5b0ebbaa55ebadea15628041 \ No newline at end of file
diff --git a/db/schema_migrations/20210622135221 b/db/schema_migrations/20210622135221
deleted file mode 100644
index eedd4d82b2c..00000000000
--- a/db/schema_migrations/20210622135221
+++ /dev/null
@@ -1 +0,0 @@
-e43889baa57ea2cd0b87ba98819408115955f6a6586b3275cf0a08bd79909c71 \ No newline at end of file
diff --git a/db/schema_migrations/20210622141148 b/db/schema_migrations/20210622141148
deleted file mode 100644
index ba693e271aa..00000000000
--- a/db/schema_migrations/20210622141148
+++ /dev/null
@@ -1 +0,0 @@
-432954295d6f3a2a45f3deef42b547ffe42501beaea4f376e1be51cf148de671 \ No newline at end of file
diff --git a/db/schema_migrations/20210623074226 b/db/schema_migrations/20210623074226
deleted file mode 100644
index 76d5cd41839..00000000000
--- a/db/schema_migrations/20210623074226
+++ /dev/null
@@ -1 +0,0 @@
-1a0df6210d9ee0e0229f3cdf3e95acaaa47ebf4ca31ac0fd9f57255115355f99 \ No newline at end of file
diff --git a/db/schema_migrations/20210623123722 b/db/schema_migrations/20210623123722
deleted file mode 100644
index f635c512d94..00000000000
--- a/db/schema_migrations/20210623123722
+++ /dev/null
@@ -1 +0,0 @@
-af58377b87f7e0fb4709637f96b24a4075322d0d8cf87dfaf5bf8e0f8a9372e0 \ No newline at end of file
diff --git a/db/schema_migrations/20210623133635 b/db/schema_migrations/20210623133635
deleted file mode 100644
index bd59fe90c62..00000000000
--- a/db/schema_migrations/20210623133635
+++ /dev/null
@@ -1 +0,0 @@
-1a930fec524c91c5d382c40514d0d1943e59514f5dbd8588595363c24819b8d0 \ No newline at end of file
diff --git a/db/schema_migrations/20210623163342 b/db/schema_migrations/20210623163342
deleted file mode 100644
index f60112edd81..00000000000
--- a/db/schema_migrations/20210623163342
+++ /dev/null
@@ -1 +0,0 @@
-6732401a959a7a691b8729e2bfb38e010dd4da4cd04418aada22946c42fdd6dc \ No newline at end of file
diff --git a/db/schema_migrations/20210624112821 b/db/schema_migrations/20210624112821
deleted file mode 100644
index 86b0e9612e0..00000000000
--- a/db/schema_migrations/20210624112821
+++ /dev/null
@@ -1 +0,0 @@
-2fca5d3203b7bb766274fc333e9a2a267340142856bd23efaabb1cb2c1cb7cb7 \ No newline at end of file
diff --git a/db/schema_migrations/20210624180613 b/db/schema_migrations/20210624180613
deleted file mode 100644
index e7f4d25fc78..00000000000
--- a/db/schema_migrations/20210624180613
+++ /dev/null
@@ -1 +0,0 @@
-705c4cf981f1929f8e8e4d8a8a3c12613516d65e59c71ac79048224cd97c47cc \ No newline at end of file
diff --git a/db/schema_migrations/20210625094554 b/db/schema_migrations/20210625094554
deleted file mode 100644
index a20925101f8..00000000000
--- a/db/schema_migrations/20210625094554
+++ /dev/null
@@ -1 +0,0 @@
-df9e976b0f294284ad9e9b617da42310c83cb1acc6db6ea00ea93c49c2310a1c \ No newline at end of file
diff --git a/db/schema_migrations/20210627204936 b/db/schema_migrations/20210627204936
deleted file mode 100644
index abc39339816..00000000000
--- a/db/schema_migrations/20210627204936
+++ /dev/null
@@ -1 +0,0 @@
-b37bf7db9c00c8f54c0ccca2d418f1279e12ff7e5b71347966494dc5645eb648 \ No newline at end of file
diff --git a/db/schema_migrations/20210628124505 b/db/schema_migrations/20210628124505
deleted file mode 100644
index 478617f5506..00000000000
--- a/db/schema_migrations/20210628124505
+++ /dev/null
@@ -1 +0,0 @@
-7add197fec50d8da5bcdbca83115558480668c26ad3a3fefc4ab93c07f34f63a \ No newline at end of file
diff --git a/db/schema_migrations/20210628154900 b/db/schema_migrations/20210628154900
deleted file mode 100644
index 5c0b60872b5..00000000000
--- a/db/schema_migrations/20210628154900
+++ /dev/null
@@ -1 +0,0 @@
-136a375fbd7e1faf25e7f53e0677b8525811bd917892efa1430d204453bf2a1d \ No newline at end of file
diff --git a/db/schema_migrations/20210629031900 b/db/schema_migrations/20210629031900
deleted file mode 100644
index 5f4949c36de..00000000000
--- a/db/schema_migrations/20210629031900
+++ /dev/null
@@ -1 +0,0 @@
-4f20581b0d16157fbe984383417f0463d7e52252569480796aa3c73abf19c95f \ No newline at end of file
diff --git a/db/schema_migrations/20210629101712 b/db/schema_migrations/20210629101712
deleted file mode 100644
index 4b4a88bdfa3..00000000000
--- a/db/schema_migrations/20210629101712
+++ /dev/null
@@ -1 +0,0 @@
-28e448810fdf8bab4de44d45acac862e752f578b5b8fd77b885a385b9ef16b2d \ No newline at end of file
diff --git a/db/schema_migrations/20210629104933 b/db/schema_migrations/20210629104933
deleted file mode 100644
index 4c5a3fb0003..00000000000
--- a/db/schema_migrations/20210629104933
+++ /dev/null
@@ -1 +0,0 @@
-2ec44dfd0745fd155ab3ab52153688a8969641134a9cc0cc485dd698cc8fd2d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210629153519 b/db/schema_migrations/20210629153519
deleted file mode 100644
index 304ff5c9fa6..00000000000
--- a/db/schema_migrations/20210629153519
+++ /dev/null
@@ -1 +0,0 @@
-cba36a2e8bedd70f8ccaca47517314d0a3c75a9b8d90715a29919247aa686835 \ No newline at end of file
diff --git a/db/schema_migrations/20210630025020 b/db/schema_migrations/20210630025020
deleted file mode 100644
index 7808a7e3178..00000000000
--- a/db/schema_migrations/20210630025020
+++ /dev/null
@@ -1 +0,0 @@
-71ad8c8f2419721f8fdf6c6bbd1265c4a7ca277972c59319e155bc6dfc46aa48 \ No newline at end of file
diff --git a/db/schema_migrations/20210630144339 b/db/schema_migrations/20210630144339
deleted file mode 100644
index 5d91d60199c..00000000000
--- a/db/schema_migrations/20210630144339
+++ /dev/null
@@ -1 +0,0 @@
-8d1777941e1a4b5f9f8f5f5e3ae416d6d02aaee1174eff1f9b4b38a6cdf0103a \ No newline at end of file
diff --git a/db/schema_migrations/20210630222522 b/db/schema_migrations/20210630222522
deleted file mode 100644
index 737034eb132..00000000000
--- a/db/schema_migrations/20210630222522
+++ /dev/null
@@ -1 +0,0 @@
-6cd7654e53bb3dd75118dd399473c98e9953cbb28eaed7a4e3a232de38ca72d1 \ No newline at end of file
diff --git a/db/schema_migrations/20210630224625 b/db/schema_migrations/20210630224625
deleted file mode 100644
index f6c7fccc41f..00000000000
--- a/db/schema_migrations/20210630224625
+++ /dev/null
@@ -1 +0,0 @@
-570edf634eba17e5c7d388fdf7103acb857e477374763205535e280f72050f71 \ No newline at end of file
diff --git a/db/schema_migrations/20210701033622 b/db/schema_migrations/20210701033622
deleted file mode 100644
index 40dcc68d424..00000000000
--- a/db/schema_migrations/20210701033622
+++ /dev/null
@@ -1 +0,0 @@
-e38d73441ddd7f6238a66ee86009c445ad6056f3e6872e7a6c72abe051294d7e \ No newline at end of file
diff --git a/db/schema_migrations/20210701111627 b/db/schema_migrations/20210701111627
deleted file mode 100644
index ca52a786a22..00000000000
--- a/db/schema_migrations/20210701111627
+++ /dev/null
@@ -1 +0,0 @@
-c2efdad12c3d0ec5371259baa91466137b827f513250e901842ab28e56c3de0a \ No newline at end of file
diff --git a/db/schema_migrations/20210701111909 b/db/schema_migrations/20210701111909
deleted file mode 100644
index ed6e2d56e8d..00000000000
--- a/db/schema_migrations/20210701111909
+++ /dev/null
@@ -1 +0,0 @@
-fdd7509fc88e563b65b487706cae1a64066a7ba7d4bd13d0414b8431c3ddfb68 \ No newline at end of file
diff --git a/db/schema_migrations/20210701141346 b/db/schema_migrations/20210701141346
deleted file mode 100644
index bbc8116361e..00000000000
--- a/db/schema_migrations/20210701141346
+++ /dev/null
@@ -1 +0,0 @@
-da16754bf484ba9a585f9de055f242dbee311d7cf7d0ce67c834ebaed61b96d4 \ No newline at end of file
diff --git a/db/schema_migrations/20210702124842 b/db/schema_migrations/20210702124842
deleted file mode 100644
index dbaeb88a6fd..00000000000
--- a/db/schema_migrations/20210702124842
+++ /dev/null
@@ -1 +0,0 @@
-8c4c92c4606cf406def47829ce16e903b3b2da00cbbdccfe6f0af5fa249be862 \ No newline at end of file
diff --git a/db/schema_migrations/20210705124128 b/db/schema_migrations/20210705124128
deleted file mode 100644
index 247378331e4..00000000000
--- a/db/schema_migrations/20210705124128
+++ /dev/null
@@ -1 +0,0 @@
-02aea8fe759614bc3aa751e023aa508963f8183366f6d6f518bbccc2d85ec1a1 \ No newline at end of file
diff --git a/db/schema_migrations/20210705130919 b/db/schema_migrations/20210705130919
deleted file mode 100644
index 9e0b9ffe69a..00000000000
--- a/db/schema_migrations/20210705130919
+++ /dev/null
@@ -1 +0,0 @@
-c33dd2c63d5a8c6e3c2f49e640b1780734b4bfca88378fac67ea5f5bd24fb2b4 \ No newline at end of file
diff --git a/db/schema_migrations/20210705132928 b/db/schema_migrations/20210705132928
deleted file mode 100644
index c1ef3ec3c1f..00000000000
--- a/db/schema_migrations/20210705132928
+++ /dev/null
@@ -1 +0,0 @@
-c66a42fc813846a09d4389a895a2d20ad48889d8ff45ab642e771b6792490623 \ No newline at end of file
diff --git a/db/schema_migrations/20210705142714 b/db/schema_migrations/20210705142714
deleted file mode 100644
index 7a64734b0e1..00000000000
--- a/db/schema_migrations/20210705142714
+++ /dev/null
@@ -1 +0,0 @@
-b47570ac9018a50206f239ffdafce2e672e6888a11a51e01f6d59d62a6a929af \ No newline at end of file
diff --git a/db/schema_migrations/20210705143150 b/db/schema_migrations/20210705143150
deleted file mode 100644
index 9c91d772a41..00000000000
--- a/db/schema_migrations/20210705143150
+++ /dev/null
@@ -1 +0,0 @@
-9240ebbc69525a5bc1732f5e0ee2903f2b40b8693f24fcb911e72b5ba943357e \ No newline at end of file
diff --git a/db/schema_migrations/20210705144657 b/db/schema_migrations/20210705144657
deleted file mode 100644
index 557dbdbd95c..00000000000
--- a/db/schema_migrations/20210705144657
+++ /dev/null
@@ -1 +0,0 @@
-9ba27b5e2599262846a06736db72fb0d31dc904e2ef4d167c1ee9530feb6367f \ No newline at end of file
diff --git a/db/schema_migrations/20210706084713 b/db/schema_migrations/20210706084713
deleted file mode 100644
index 7c87af30919..00000000000
--- a/db/schema_migrations/20210706084713
+++ /dev/null
@@ -1 +0,0 @@
-f69e3f50e4e5642a59e157a3c4a133090ec843b563e47198d560a54328176e56 \ No newline at end of file
diff --git a/db/schema_migrations/20210706112800 b/db/schema_migrations/20210706112800
deleted file mode 100644
index f1f00867472..00000000000
--- a/db/schema_migrations/20210706112800
+++ /dev/null
@@ -1 +0,0 @@
-5dd1596d0d6e6f5aa39cbf8a65be294650bead7a099cf50917b438cf75529257 \ No newline at end of file
diff --git a/db/schema_migrations/20210706115312 b/db/schema_migrations/20210706115312
deleted file mode 100644
index a1298418836..00000000000
--- a/db/schema_migrations/20210706115312
+++ /dev/null
@@ -1 +0,0 @@
-ac150e706b115849aa3802ae7b8e07d983e89eb637c48582c64948cbc7d7163d \ No newline at end of file
diff --git a/db/schema_migrations/20210706120847 b/db/schema_migrations/20210706120847
deleted file mode 100644
index 329e5650dd0..00000000000
--- a/db/schema_migrations/20210706120847
+++ /dev/null
@@ -1 +0,0 @@
-0fffffc44c32a936760424541e183b1a41938750d4e10da9dd76c2a09094a07b \ No newline at end of file
diff --git a/db/schema_migrations/20210706142819 b/db/schema_migrations/20210706142819
deleted file mode 100644
index 193c6ba1d56..00000000000
--- a/db/schema_migrations/20210706142819
+++ /dev/null
@@ -1 +0,0 @@
-ed0daff7120cbdba2f0e9ca1f2e40c11114bb2c7db4543903d16891ffbbba3f8 \ No newline at end of file
diff --git a/db/schema_migrations/20210706151154 b/db/schema_migrations/20210706151154
deleted file mode 100644
index 32534755d69..00000000000
--- a/db/schema_migrations/20210706151154
+++ /dev/null
@@ -1 +0,0 @@
-fc330cf9875a423db87748e84c574f2208e164945b56361a563f2085d324f610 \ No newline at end of file
diff --git a/db/schema_migrations/20210706151446 b/db/schema_migrations/20210706151446
deleted file mode 100644
index 3d5d381b2a5..00000000000
--- a/db/schema_migrations/20210706151446
+++ /dev/null
@@ -1 +0,0 @@
-4400cd95cf149a7abc759ca412b0d87c81bc405719999ce60502869d21d17aaa \ No newline at end of file
diff --git a/db/schema_migrations/20210706152139 b/db/schema_migrations/20210706152139
deleted file mode 100644
index 81339dc1d81..00000000000
--- a/db/schema_migrations/20210706152139
+++ /dev/null
@@ -1 +0,0 @@
-45ec2dd6113d112050a1ac062064950fa18b3b5903a9fd60234e9e9fa48c7070 \ No newline at end of file
diff --git a/db/schema_migrations/20210706212710 b/db/schema_migrations/20210706212710
deleted file mode 100644
index 7a4e6df37a4..00000000000
--- a/db/schema_migrations/20210706212710
+++ /dev/null
@@ -1 +0,0 @@
-33162af4ef99c32d3c5b38479e407d4911a8d3dce53407dbee6e5745c8e945ae \ No newline at end of file
diff --git a/db/schema_migrations/20210706213537 b/db/schema_migrations/20210706213537
deleted file mode 100644
index fa621773ee7..00000000000
--- a/db/schema_migrations/20210706213537
+++ /dev/null
@@ -1 +0,0 @@
-150463cef309e6bf69240c258dc8aede53b846a08a7e2d668ee0429709022554 \ No newline at end of file
diff --git a/db/schema_migrations/20210707095545 b/db/schema_migrations/20210707095545
deleted file mode 100644
index 83255c22622..00000000000
--- a/db/schema_migrations/20210707095545
+++ /dev/null
@@ -1 +0,0 @@
-98d4deaf0564119c1ee44d76d3a30bff1a0fceb7cab67c5dbef576faef62ddf5 \ No newline at end of file
diff --git a/db/schema_migrations/20210707113056 b/db/schema_migrations/20210707113056
deleted file mode 100644
index 3526caf8109..00000000000
--- a/db/schema_migrations/20210707113056
+++ /dev/null
@@ -1 +0,0 @@
-837b9a56114c63064379cf276a3c7e2bbe845af9022a542c4fcec94a25062017 \ No newline at end of file
diff --git a/db/schema_migrations/20210707151536 b/db/schema_migrations/20210707151536
deleted file mode 100644
index feea256b2ac..00000000000
--- a/db/schema_migrations/20210707151536
+++ /dev/null
@@ -1 +0,0 @@
-4fc688d17e374faf806a25635e05b053228ac201b94920d4f3b3810329a6552c \ No newline at end of file
diff --git a/db/schema_migrations/20210707163659 b/db/schema_migrations/20210707163659
deleted file mode 100644
index e0c33c79a85..00000000000
--- a/db/schema_migrations/20210707163659
+++ /dev/null
@@ -1 +0,0 @@
-ac14aa49830a3af9a1445c0c7680f5660247a8104c8e4c1ae542c4b368f7c9bf \ No newline at end of file
diff --git a/db/schema_migrations/20210707171536 b/db/schema_migrations/20210707171536
deleted file mode 100644
index dd78b254a67..00000000000
--- a/db/schema_migrations/20210707171536
+++ /dev/null
@@ -1 +0,0 @@
-ee8576a7dec8e0657a3976422f74202e3f89c9a72aae64f0f75398d0c6ff5b97 \ No newline at end of file
diff --git a/db/schema_migrations/20210707171554 b/db/schema_migrations/20210707171554
deleted file mode 100644
index ef6f174f734..00000000000
--- a/db/schema_migrations/20210707171554
+++ /dev/null
@@ -1 +0,0 @@
-5f2acbd5ed9132ad6c11cf4be34061decde2f3c602ef319331454b424e6b4344 \ No newline at end of file
diff --git a/db/schema_migrations/20210707173645 b/db/schema_migrations/20210707173645
deleted file mode 100644
index 0cc2386b4ef..00000000000
--- a/db/schema_migrations/20210707173645
+++ /dev/null
@@ -1 +0,0 @@
-e440dac0e14df7309c84e72b98ed6373c712901dc66310a474979e0fce7dc59c \ No newline at end of file
diff --git a/db/schema_migrations/20210707181536 b/db/schema_migrations/20210707181536
deleted file mode 100644
index 7bbdcc9a1d0..00000000000
--- a/db/schema_migrations/20210707181536
+++ /dev/null
@@ -1 +0,0 @@
-0c25d19d03bce4f145eca271c852aad6a8327821a8f5ff0aa2f0286f4a65b328 \ No newline at end of file
diff --git a/db/schema_migrations/20210707210916 b/db/schema_migrations/20210707210916
deleted file mode 100644
index e3c0f8fe783..00000000000
--- a/db/schema_migrations/20210707210916
+++ /dev/null
@@ -1 +0,0 @@
-0681e068672621fbaa513cadd86e6137709413bb370ae9d416fc562b19f11ff6 \ No newline at end of file
diff --git a/db/schema_migrations/20210708011425 b/db/schema_migrations/20210708011425
deleted file mode 100644
index 33e28f436ce..00000000000
--- a/db/schema_migrations/20210708011425
+++ /dev/null
@@ -1 +0,0 @@
-e3f4424daaba173f607dbae7c84b4f6070126d262e7e9808c6a90e64648e10ed \ No newline at end of file
diff --git a/db/schema_migrations/20210708011426 b/db/schema_migrations/20210708011426
deleted file mode 100644
index abb2743928c..00000000000
--- a/db/schema_migrations/20210708011426
+++ /dev/null
@@ -1 +0,0 @@
-b48556968cbff2e3aff65236b313ed8a626af4a08b1cad06723b74a99b678895 \ No newline at end of file
diff --git a/db/schema_migrations/20210708063032 b/db/schema_migrations/20210708063032
deleted file mode 100644
index 9d3271bdd91..00000000000
--- a/db/schema_migrations/20210708063032
+++ /dev/null
@@ -1 +0,0 @@
-77f6db1d2aeebdefd76c96966da6c9e4ce5da2c92a42f6ac2398b35fa21c680f \ No newline at end of file
diff --git a/db/schema_migrations/20210708124229 b/db/schema_migrations/20210708124229
deleted file mode 100644
index 29cf5b8986f..00000000000
--- a/db/schema_migrations/20210708124229
+++ /dev/null
@@ -1 +0,0 @@
-18f7a9a0e9f0b331028951adf2bf6ca9a9fc4a62872f5307ee9d74761ae06deb \ No newline at end of file
diff --git a/db/schema_migrations/20210708130419 b/db/schema_migrations/20210708130419
deleted file mode 100644
index b20db5b17c2..00000000000
--- a/db/schema_migrations/20210708130419
+++ /dev/null
@@ -1 +0,0 @@
-8545d6575c9dacec6796882677c4403cf3559430518e8709bf390f20717413d7 \ No newline at end of file
diff --git a/db/schema_migrations/20210708131048 b/db/schema_migrations/20210708131048
deleted file mode 100644
index f61978d8e0f..00000000000
--- a/db/schema_migrations/20210708131048
+++ /dev/null
@@ -1 +0,0 @@
-ed0c0dc015e7c3457248303b8b478c8d259d6a800a2bfed8b05b1f976b6794a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210708134446 b/db/schema_migrations/20210708134446
deleted file mode 100644
index 9ec3b2182df..00000000000
--- a/db/schema_migrations/20210708134446
+++ /dev/null
@@ -1 +0,0 @@
-1367865e22f6129fa69f3c86dc72b88a9af0479a41f2029a446464aeeed9c18e \ No newline at end of file
diff --git a/db/schema_migrations/20210708202548 b/db/schema_migrations/20210708202548
deleted file mode 100644
index 286bcb07786..00000000000
--- a/db/schema_migrations/20210708202548
+++ /dev/null
@@ -1 +0,0 @@
-e2d7e54330f586bf31d953455b2ebac1fc9b6b24058a1cc7b277bc819ebf232a \ No newline at end of file
diff --git a/db/schema_migrations/20210709024048 b/db/schema_migrations/20210709024048
deleted file mode 100644
index 52e089cd5a7..00000000000
--- a/db/schema_migrations/20210709024048
+++ /dev/null
@@ -1 +0,0 @@
-d35079b6d6ed38ce8f212a09e684988f7499d456d28f70b6178914b1b17eee5b \ No newline at end of file
diff --git a/db/schema_migrations/20210709085759 b/db/schema_migrations/20210709085759
deleted file mode 100644
index 4546b090e42..00000000000
--- a/db/schema_migrations/20210709085759
+++ /dev/null
@@ -1 +0,0 @@
-4216604d14b4ccc652ba423a95ee9bd15646b3553903dc4b79497871f5384492 \ No newline at end of file
diff --git a/db/schema_migrations/20210709132707 b/db/schema_migrations/20210709132707
deleted file mode 100644
index 04ba096a692..00000000000
--- a/db/schema_migrations/20210709132707
+++ /dev/null
@@ -1 +0,0 @@
-e0a2de69a3c9d616b87207b764e33fa3326627e065f28fc200c1414f08ee9fff \ No newline at end of file
diff --git a/db/schema_migrations/20210709221051 b/db/schema_migrations/20210709221051
deleted file mode 100644
index 1c2f47e20ad..00000000000
--- a/db/schema_migrations/20210709221051
+++ /dev/null
@@ -1 +0,0 @@
-7847339fb7b143845e2715b15505016dc8e6de3fbd2c5cb4bae55da4f25a5a5f \ No newline at end of file
diff --git a/db/schema_migrations/20210709221659 b/db/schema_migrations/20210709221659
deleted file mode 100644
index f6626986920..00000000000
--- a/db/schema_migrations/20210709221659
+++ /dev/null
@@ -1 +0,0 @@
-5bec34d517f3f2bbb9735f73fb5641512c9f5286ee5d7a59b17c976dd1459347 \ No newline at end of file
diff --git a/db/schema_migrations/20210712052519 b/db/schema_migrations/20210712052519
deleted file mode 100644
index 3c0874b338f..00000000000
--- a/db/schema_migrations/20210712052519
+++ /dev/null
@@ -1 +0,0 @@
-f3959b7a6f7ac95019f2f85c6383ddd11294562e94936ef3b5704bd4de7c5910 \ No newline at end of file
diff --git a/db/schema_migrations/20210713042000 b/db/schema_migrations/20210713042000
deleted file mode 100644
index ed775d6e188..00000000000
--- a/db/schema_migrations/20210713042000
+++ /dev/null
@@ -1 +0,0 @@
-ede336cca4f5d692fb9fccb60db7846a917d887412a10699e818a6caf0ef6a45 \ No newline at end of file
diff --git a/db/schema_migrations/20210713042153 b/db/schema_migrations/20210713042153
deleted file mode 100644
index fca0fe62d73..00000000000
--- a/db/schema_migrations/20210713042153
+++ /dev/null
@@ -1 +0,0 @@
-95aa786acfbd53f1e819e49c6c6ec703d609396f2cc04a5791d1ffc77800dc72 \ No newline at end of file
diff --git a/db/schema_migrations/20210713070842 b/db/schema_migrations/20210713070842
deleted file mode 100644
index 857dea1627e..00000000000
--- a/db/schema_migrations/20210713070842
+++ /dev/null
@@ -1 +0,0 @@
-2899d954a199fa52bf6ab4beca5f22dcb9f9f0312e658f1307d1a7355394f1bb \ No newline at end of file
diff --git a/db/schema_migrations/20210713075117 b/db/schema_migrations/20210713075117
deleted file mode 100644
index 2525886b176..00000000000
--- a/db/schema_migrations/20210713075117
+++ /dev/null
@@ -1 +0,0 @@
-9a8cbcf6ddbdd4379320ed747faed9beb0c2104eb89e61b349432b1f0346a4b5 \ No newline at end of file
diff --git a/db/schema_migrations/20210713123345 b/db/schema_migrations/20210713123345
deleted file mode 100644
index f145ecc3d6b..00000000000
--- a/db/schema_migrations/20210713123345
+++ /dev/null
@@ -1 +0,0 @@
-d1226fdefe839aae4c7425924058e1944f883824c43a299b154bb6873d6c3855 \ No newline at end of file
diff --git a/db/schema_migrations/20210713135152 b/db/schema_migrations/20210713135152
deleted file mode 100644
index a1ba4e939e9..00000000000
--- a/db/schema_migrations/20210713135152
+++ /dev/null
@@ -1 +0,0 @@
-d7f8f7f5d8a6cf03d500825ef43234c69f7ad36908c0bade337591b05985c2fe \ No newline at end of file
diff --git a/db/schema_migrations/20210713144637 b/db/schema_migrations/20210713144637
deleted file mode 100644
index ebc122e0275..00000000000
--- a/db/schema_migrations/20210713144637
+++ /dev/null
@@ -1 +0,0 @@
-699ac7f8b9253920271686c497b57521bf4b0d26c802ca2a57447e4929cd147f \ No newline at end of file
diff --git a/db/schema_migrations/20210713211008 b/db/schema_migrations/20210713211008
deleted file mode 100644
index 75ccad3e348..00000000000
--- a/db/schema_migrations/20210713211008
+++ /dev/null
@@ -1 +0,0 @@
-f66d8f3bc32996fe7743cc98cfb96fedd86784d38c8debb5143b7adabdfebd18 \ No newline at end of file
diff --git a/db/schema_migrations/20210713223941 b/db/schema_migrations/20210713223941
deleted file mode 100644
index 6b0ebf6de5d..00000000000
--- a/db/schema_migrations/20210713223941
+++ /dev/null
@@ -1 +0,0 @@
-a97ac46a042b7f049f27db4f4916b8b0dbf527ba3c34fc9cc577da7807a88d32 \ No newline at end of file
diff --git a/db/schema_migrations/20210714015537 b/db/schema_migrations/20210714015537
deleted file mode 100644
index eb1c88e29a0..00000000000
--- a/db/schema_migrations/20210714015537
+++ /dev/null
@@ -1 +0,0 @@
-2f6441a5d5e3c4aad6b88c3944436dab213b7eeb2f35453657ffac8c0733efc1 \ No newline at end of file
diff --git a/db/schema_migrations/20210714043818 b/db/schema_migrations/20210714043818
deleted file mode 100644
index 21c46a2608f..00000000000
--- a/db/schema_migrations/20210714043818
+++ /dev/null
@@ -1 +0,0 @@
-344736284dc18b5f7516ec2062bef99b2444ae31720691e56b4e8687d5566b31 \ No newline at end of file
diff --git a/db/schema_migrations/20210714120600 b/db/schema_migrations/20210714120600
deleted file mode 100644
index e698300671b..00000000000
--- a/db/schema_migrations/20210714120600
+++ /dev/null
@@ -1 +0,0 @@
-de9167bc4f9e2b68b257a7ff81636d5dbb6d73ff81672fdf1c73adadf5707bea \ No newline at end of file
diff --git a/db/schema_migrations/20210715074359 b/db/schema_migrations/20210715074359
deleted file mode 100644
index 35cbbf55463..00000000000
--- a/db/schema_migrations/20210715074359
+++ /dev/null
@@ -1 +0,0 @@
-7bc0654a97f85100df93b9dbbbdab374873f6d3d379a4393f718bad923b064ba \ No newline at end of file
diff --git a/db/schema_migrations/20210715074933 b/db/schema_migrations/20210715074933
deleted file mode 100644
index 721e9d8d32c..00000000000
--- a/db/schema_migrations/20210715074933
+++ /dev/null
@@ -1 +0,0 @@
-e29240947b2e0e6fa7c91643c5d1a2efa02ec062b5ccdffdf382dff993ab6225 \ No newline at end of file
diff --git a/db/schema_migrations/20210715075203 b/db/schema_migrations/20210715075203
deleted file mode 100644
index d123de45c42..00000000000
--- a/db/schema_migrations/20210715075203
+++ /dev/null
@@ -1 +0,0 @@
-9d29f4d776031e90cb42122146f65bb13e8778d223467a83dc311f4adab31565 \ No newline at end of file
diff --git a/db/schema_migrations/20210716074555 b/db/schema_migrations/20210716074555
deleted file mode 100644
index f079b199ca5..00000000000
--- a/db/schema_migrations/20210716074555
+++ /dev/null
@@ -1 +0,0 @@
-5cf415013b50c46fde5f12702c3f5bae808848a82eb57bfa38764947fc672ad9 \ No newline at end of file
diff --git a/db/schema_migrations/20210719145532 b/db/schema_migrations/20210719145532
deleted file mode 100644
index a9afd7a18ed..00000000000
--- a/db/schema_migrations/20210719145532
+++ /dev/null
@@ -1 +0,0 @@
-5e088e5109b50d8f4fadd37a0382d7dc4ce856a851ec2b97f8d5d868c3cb19fd \ No newline at end of file
diff --git a/db/schema_migrations/20210719182944 b/db/schema_migrations/20210719182944
deleted file mode 100644
index 37213ace8d9..00000000000
--- a/db/schema_migrations/20210719182944
+++ /dev/null
@@ -1 +0,0 @@
-9320dcd2a5bed122310aefd630f9c406a25b22767dba3bf118a30df044c2d6a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210719192928 b/db/schema_migrations/20210719192928
deleted file mode 100644
index b15de2220ed..00000000000
--- a/db/schema_migrations/20210719192928
+++ /dev/null
@@ -1 +0,0 @@
-eed403573697ac7f454ce47d6e4ab3561a10a62177caaaea40d5d70953068175 \ No newline at end of file
diff --git a/db/schema_migrations/20210720083432 b/db/schema_migrations/20210720083432
deleted file mode 100644
index 44c8b4ae689..00000000000
--- a/db/schema_migrations/20210720083432
+++ /dev/null
@@ -1 +0,0 @@
-6096780be4fae007485f150a019fc4555153e4b22b893d5fe29be36834d970a9 \ No newline at end of file
diff --git a/db/schema_migrations/20210720130006 b/db/schema_migrations/20210720130006
deleted file mode 100644
index c55eb9a283e..00000000000
--- a/db/schema_migrations/20210720130006
+++ /dev/null
@@ -1 +0,0 @@
-03d86d635c54b53bd540443f0a911d4f0ae59ec3494be23952490c5df70dd28c \ No newline at end of file
diff --git a/db/schema_migrations/20210720140841 b/db/schema_migrations/20210720140841
deleted file mode 100644
index ecb20e55d1c..00000000000
--- a/db/schema_migrations/20210720140841
+++ /dev/null
@@ -1 +0,0 @@
-1ef66bdf4a1c61d9a1e0e632d8728f86769ac727d43971e897284272e9f53581 \ No newline at end of file
diff --git a/db/schema_migrations/20210721122840 b/db/schema_migrations/20210721122840
deleted file mode 100644
index 375a03adc3d..00000000000
--- a/db/schema_migrations/20210721122840
+++ /dev/null
@@ -1 +0,0 @@
-483ef6f8ef379f39ecff32853c777c12c59d2858f061879c375ff6d429396167 \ No newline at end of file
diff --git a/db/schema_migrations/20210721125525 b/db/schema_migrations/20210721125525
deleted file mode 100644
index fa11899d7b4..00000000000
--- a/db/schema_migrations/20210721125525
+++ /dev/null
@@ -1 +0,0 @@
-8ffb00b1a86fb1f9574b3811f88a65a1478f64cf59dc99a3324e04c4f4f0c7dd \ No newline at end of file
diff --git a/db/schema_migrations/20210721125545 b/db/schema_migrations/20210721125545
deleted file mode 100644
index 372de21e151..00000000000
--- a/db/schema_migrations/20210721125545
+++ /dev/null
@@ -1 +0,0 @@
-8b43136ea6df74ad379537e28392c43770ecd8586eff8e830c52e65976f6978a \ No newline at end of file
diff --git a/db/schema_migrations/20210721125620 b/db/schema_migrations/20210721125620
deleted file mode 100644
index 4b72ac24379..00000000000
--- a/db/schema_migrations/20210721125620
+++ /dev/null
@@ -1 +0,0 @@
-fa27f8e932f47946a67b2e739a978573e5f375ac0b1058ee79353e22d514755d \ No newline at end of file
diff --git a/db/schema_migrations/20210721125637 b/db/schema_migrations/20210721125637
deleted file mode 100644
index dd4b29fdf1c..00000000000
--- a/db/schema_migrations/20210721125637
+++ /dev/null
@@ -1 +0,0 @@
-40f99f3c05290fe967cac6c1b90d913decacb491e1253fb166d4dd06363dd38b \ No newline at end of file
diff --git a/db/schema_migrations/20210721125804 b/db/schema_migrations/20210721125804
deleted file mode 100644
index 41756d62a7f..00000000000
--- a/db/schema_migrations/20210721125804
+++ /dev/null
@@ -1 +0,0 @@
-5c6cc14f49d8fa9d0f0610eab731f93f874d6e9b5e3d49d5a127830241528488 \ No newline at end of file
diff --git a/db/schema_migrations/20210721125820 b/db/schema_migrations/20210721125820
deleted file mode 100644
index 0c281f8587a..00000000000
--- a/db/schema_migrations/20210721125820
+++ /dev/null
@@ -1 +0,0 @@
-7cba2fedb94fb5dc7fa5b796c6a93d2c5c8b57aee64b294e0c20dde07bf5253a \ No newline at end of file
diff --git a/db/schema_migrations/20210721134706 b/db/schema_migrations/20210721134706
deleted file mode 100644
index c250f5661a9..00000000000
--- a/db/schema_migrations/20210721134706
+++ /dev/null
@@ -1 +0,0 @@
-e6c8fd913f591fed24072e9b0032b47dbb1165f2c1cf50ed01cfcd5f7da32cba \ No newline at end of file
diff --git a/db/schema_migrations/20210721134707 b/db/schema_migrations/20210721134707
deleted file mode 100644
index 4c25899474c..00000000000
--- a/db/schema_migrations/20210721134707
+++ /dev/null
@@ -1 +0,0 @@
-a795dad532a5ed2a645e49e586c6fb73167e9ae38843cf5cbcf37cf8661b765a \ No newline at end of file
diff --git a/db/schema_migrations/20210721135638 b/db/schema_migrations/20210721135638
deleted file mode 100644
index 3ca020593d2..00000000000
--- a/db/schema_migrations/20210721135638
+++ /dev/null
@@ -1 +0,0 @@
-a4219ce93f790ec372991adca4b1cc5c0410d57e92817082344b11758ca5ae93 \ No newline at end of file
diff --git a/db/schema_migrations/20210721145029 b/db/schema_migrations/20210721145029
deleted file mode 100644
index 2c28570b609..00000000000
--- a/db/schema_migrations/20210721145029
+++ /dev/null
@@ -1 +0,0 @@
-1585d2912058ce3a9225233c23707a3679a3f8df2078c71b5cc48f28b7bb9392 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174411 b/db/schema_migrations/20210721174411
deleted file mode 100644
index eae69e34afc..00000000000
--- a/db/schema_migrations/20210721174411
+++ /dev/null
@@ -1 +0,0 @@
-ac95292b2ab05f17ed13cb8e95ace0660e6dc82e33d6ef1cccd02890abf6c739 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174441 b/db/schema_migrations/20210721174441
deleted file mode 100644
index 473e3b4c55a..00000000000
--- a/db/schema_migrations/20210721174441
+++ /dev/null
@@ -1 +0,0 @@
-9f3a39b11f250f64e4e6b8623279604c1dba14330f45c26840f6e0b46f7d48a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174453 b/db/schema_migrations/20210721174453
deleted file mode 100644
index 3fe95971491..00000000000
--- a/db/schema_migrations/20210721174453
+++ /dev/null
@@ -1 +0,0 @@
-7b20c623b58982ba5d228902c6da6d10245edf3874ece9b02d58e8560d2d5d96 \ No newline at end of file
diff --git a/db/schema_migrations/20210721174521 b/db/schema_migrations/20210721174521
deleted file mode 100644
index 03887b9c738..00000000000
--- a/db/schema_migrations/20210721174521
+++ /dev/null
@@ -1 +0,0 @@
-f16b563bbfa15b97143e82d2a1e78e9d9805d13e02e3a0845369d4ce3204b3cc \ No newline at end of file
diff --git a/db/schema_migrations/20210721211602 b/db/schema_migrations/20210721211602
deleted file mode 100644
index bf96fc31ea5..00000000000
--- a/db/schema_migrations/20210721211602
+++ /dev/null
@@ -1 +0,0 @@
-ee3e6377478302f41aa06f2278f38a9dde2f325318b4f2eba1007abb1dd1099c \ No newline at end of file
diff --git a/db/schema_migrations/20210722010101 b/db/schema_migrations/20210722010101
deleted file mode 100644
index ed0b98e6d1a..00000000000
--- a/db/schema_migrations/20210722010101
+++ /dev/null
@@ -1 +0,0 @@
-bbd39849499d16f92a5129506a87a6b253f209200bcb3a63c2432862c4b78aae \ No newline at end of file
diff --git a/db/schema_migrations/20210722042939 b/db/schema_migrations/20210722042939
deleted file mode 100644
index fe5a3820bf9..00000000000
--- a/db/schema_migrations/20210722042939
+++ /dev/null
@@ -1 +0,0 @@
-dd3b35b87c2f015895d807ede2521c9672fb41ec7a3b0b1a2f7abdc009950b6e \ No newline at end of file
diff --git a/db/schema_migrations/20210722055217 b/db/schema_migrations/20210722055217
deleted file mode 100644
index 45d62ce852c..00000000000
--- a/db/schema_migrations/20210722055217
+++ /dev/null
@@ -1 +0,0 @@
-bd934c20443d5a044caa9e92389018291ffb2bf60b8ca54d9baca4a0e70caf28 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074220 b/db/schema_migrations/20210722074220
deleted file mode 100644
index d0bc4133883..00000000000
--- a/db/schema_migrations/20210722074220
+++ /dev/null
@@ -1 +0,0 @@
-cf276b9aa97fc7857499e1b103a8e09eda329a4db92d0e653cc6f7128987be39 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074242 b/db/schema_migrations/20210722074242
deleted file mode 100644
index 2fc61b36ed2..00000000000
--- a/db/schema_migrations/20210722074242
+++ /dev/null
@@ -1 +0,0 @@
-5c6aff5b43a1e81e84a42f008a8a1ab90c77ee450884aa1ecc86bce551424f43 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074256 b/db/schema_migrations/20210722074256
deleted file mode 100644
index cedf6a7419b..00000000000
--- a/db/schema_migrations/20210722074256
+++ /dev/null
@@ -1 +0,0 @@
-d49b1f48c2fa1cac8d7793f8bb025792f4bb85eed787ba3abdbaa4647523b70a \ No newline at end of file
diff --git a/db/schema_migrations/20210722074309 b/db/schema_migrations/20210722074309
deleted file mode 100644
index 27b1bb9e493..00000000000
--- a/db/schema_migrations/20210722074309
+++ /dev/null
@@ -1 +0,0 @@
-eab0f8488b0122ec6c5625c66ebcbd221579bdd9cc2cf670d1f26181709f23b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210722074339 b/db/schema_migrations/20210722074339
deleted file mode 100644
index dc269e54868..00000000000
--- a/db/schema_migrations/20210722074339
+++ /dev/null
@@ -1 +0,0 @@
-a7a6697d86b71d59104af35a9d7d6f3caebf4ee1252e4f3e52133afb3f642e48 \ No newline at end of file
diff --git a/db/schema_migrations/20210722110515 b/db/schema_migrations/20210722110515
deleted file mode 100644
index 1e4791fc2f9..00000000000
--- a/db/schema_migrations/20210722110515
+++ /dev/null
@@ -1 +0,0 @@
-c9057cb28d2576551eafe78998023742018fa8351f2e550b7e35832a5509d21c \ No newline at end of file
diff --git a/db/schema_migrations/20210722132844 b/db/schema_migrations/20210722132844
deleted file mode 100644
index 7367cb1c13e..00000000000
--- a/db/schema_migrations/20210722132844
+++ /dev/null
@@ -1 +0,0 @@
-b4dfa045ec38a15d46288acc271a3ae93fed85b8605ab11640d9bbcfbd5b94cf \ No newline at end of file
diff --git a/db/schema_migrations/20210722150102 b/db/schema_migrations/20210722150102
deleted file mode 100644
index 42f6cfb3b7e..00000000000
--- a/db/schema_migrations/20210722150102
+++ /dev/null
@@ -1 +0,0 @@
-cea8e51f6917be9ad43280fba9f8e7d9b9db1f508e249d9f5df792e43c0b8313 \ No newline at end of file
diff --git a/db/schema_migrations/20210722151951 b/db/schema_migrations/20210722151951
deleted file mode 100644
index a5e6a8c0963..00000000000
--- a/db/schema_migrations/20210722151951
+++ /dev/null
@@ -1 +0,0 @@
-7289fb2a65c1210a352991fae7fac0c8e1129a33c166d0dad6f2aed98cb672a6 \ No newline at end of file
diff --git a/db/schema_migrations/20210722155635 b/db/schema_migrations/20210722155635
deleted file mode 100644
index d131ff9016e..00000000000
--- a/db/schema_migrations/20210722155635
+++ /dev/null
@@ -1 +0,0 @@
-d98c54e5ec60fc0ee1c008160118f6f0c45eb801932d4d3abcd26aba33ebdea6 \ No newline at end of file
diff --git a/db/schema_migrations/20210722210041 b/db/schema_migrations/20210722210041
deleted file mode 100644
index 09dbff3b4c2..00000000000
--- a/db/schema_migrations/20210722210041
+++ /dev/null
@@ -1 +0,0 @@
-253a3520f05e252b6e6bbb3ef5f8af6c374c897ffa736c89fbea3089fdfa8fc4 \ No newline at end of file
diff --git a/db/schema_migrations/20210723173132 b/db/schema_migrations/20210723173132
deleted file mode 100644
index 3199fb547d5..00000000000
--- a/db/schema_migrations/20210723173132
+++ /dev/null
@@ -1 +0,0 @@
-b64ba2a9ee42497aa9f60ca76f4925076cb77e73fd79bb9b10362cd48d11252b \ No newline at end of file
diff --git a/db/schema_migrations/20210726134950 b/db/schema_migrations/20210726134950
deleted file mode 100644
index 73f298e04a7..00000000000
--- a/db/schema_migrations/20210726134950
+++ /dev/null
@@ -1 +0,0 @@
-d989534193566d90f1d4d61a0a588f3204670b67e049e875011a06b32ffd941a \ No newline at end of file
diff --git a/db/schema_migrations/20210726202748 b/db/schema_migrations/20210726202748
deleted file mode 100644
index 390847c8a07..00000000000
--- a/db/schema_migrations/20210726202748
+++ /dev/null
@@ -1 +0,0 @@
-378e12c3c7c49e294ab4ab792151af8e3829cc6f38295d5faa0995ad16f3f934 \ No newline at end of file
diff --git a/db/schema_migrations/20210727113447 b/db/schema_migrations/20210727113447
deleted file mode 100644
index 236022f5af3..00000000000
--- a/db/schema_migrations/20210727113447
+++ /dev/null
@@ -1 +0,0 @@
-19e23131949e6056ea9837231fac6a2307fb52a8287eb34cc6e89eed11d52849 \ No newline at end of file
diff --git a/db/schema_migrations/20210727175201 b/db/schema_migrations/20210727175201
deleted file mode 100644
index 78dae022e6b..00000000000
--- a/db/schema_migrations/20210727175201
+++ /dev/null
@@ -1 +0,0 @@
-c7ae79084b802723a24064cb700b6cdc9a23011d3fed45457799c1ae7aa19ce6 \ No newline at end of file
diff --git a/db/schema_migrations/20210728110654 b/db/schema_migrations/20210728110654
deleted file mode 100644
index 3dd51a29bb7..00000000000
--- a/db/schema_migrations/20210728110654
+++ /dev/null
@@ -1 +0,0 @@
-8c317e202b9fb5fc3733325fd2447f65283c3752fcb314033f5d3b2b28484f71 \ No newline at end of file
diff --git a/db/schema_migrations/20210728174349 b/db/schema_migrations/20210728174349
deleted file mode 100644
index 59035edce30..00000000000
--- a/db/schema_migrations/20210728174349
+++ /dev/null
@@ -1 +0,0 @@
-3a56c903333f13e9e3d39e5b65a3b70fdcfbf967cdac8bff348dfb71c0fde520 \ No newline at end of file
diff --git a/db/schema_migrations/20210729061526 b/db/schema_migrations/20210729061526
deleted file mode 100644
index a56a4b4b245..00000000000
--- a/db/schema_migrations/20210729061526
+++ /dev/null
@@ -1 +0,0 @@
-5c71f4176ecf8f422e948c2c2ecb1e6662494def11e06d7d0071d73f379770f0 \ No newline at end of file
diff --git a/db/schema_migrations/20210729061556 b/db/schema_migrations/20210729061556
deleted file mode 100644
index 3b39a351328..00000000000
--- a/db/schema_migrations/20210729061556
+++ /dev/null
@@ -1 +0,0 @@
-75be4e92b482c9003485658c42ba1e94a2d5c6a5a0653c8a27c5983fafd1d6a7 \ No newline at end of file
diff --git a/db/schema_migrations/20210729081351 b/db/schema_migrations/20210729081351
deleted file mode 100644
index 1f397457443..00000000000
--- a/db/schema_migrations/20210729081351
+++ /dev/null
@@ -1 +0,0 @@
-17463867a8c14981386256dc90169fb879e1921d65eccca53eae576d49fba49d \ No newline at end of file
diff --git a/db/schema_migrations/20210729081739 b/db/schema_migrations/20210729081739
deleted file mode 100644
index 2215c7d7e66..00000000000
--- a/db/schema_migrations/20210729081739
+++ /dev/null
@@ -1 +0,0 @@
-af7963d27bda6ef85fb5b5a06ecf1de14f21829eecdaf13e763aa9a6ffc2e83c \ No newline at end of file
diff --git a/db/schema_migrations/20210729123101 b/db/schema_migrations/20210729123101
deleted file mode 100644
index 77f5bfba94e..00000000000
--- a/db/schema_migrations/20210729123101
+++ /dev/null
@@ -1 +0,0 @@
-8522eaf951d87de04aea82fe8e1a9577e6665c8d08245282239476e49b02bc7d \ No newline at end of file
diff --git a/db/schema_migrations/20210729125641 b/db/schema_migrations/20210729125641
deleted file mode 100644
index e5ee4127656..00000000000
--- a/db/schema_migrations/20210729125641
+++ /dev/null
@@ -1 +0,0 @@
-b7bc495d010e0640b1145ca55f47696047fd4360d2dfc9a3da7941ab62840132 \ No newline at end of file
diff --git a/db/schema_migrations/20210729125659 b/db/schema_migrations/20210729125659
deleted file mode 100644
index 64c8cd0aeef..00000000000
--- a/db/schema_migrations/20210729125659
+++ /dev/null
@@ -1 +0,0 @@
-5826e87b2ce13d4951e9b8e774c87c29c6e0a0954a85d60ec68155f2c5cf3ccc \ No newline at end of file
diff --git a/db/schema_migrations/20210729161242 b/db/schema_migrations/20210729161242
deleted file mode 100644
index 38769ac4ff0..00000000000
--- a/db/schema_migrations/20210729161242
+++ /dev/null
@@ -1 +0,0 @@
-22a64ce9a8cbebd2024908cc74cc92a50fb6ccaa1580ebea3be60d3659c48fa0 \ No newline at end of file
diff --git a/db/schema_migrations/20210729163312 b/db/schema_migrations/20210729163312
deleted file mode 100644
index 2c888f6786f..00000000000
--- a/db/schema_migrations/20210729163312
+++ /dev/null
@@ -1 +0,0 @@
-94978b93b1590cb2cfd9536a44a8817aa485a35d5372dfed31041261f5e12406 \ No newline at end of file
diff --git a/db/schema_migrations/20210729192148 b/db/schema_migrations/20210729192148
deleted file mode 100644
index 8cf650a223a..00000000000
--- a/db/schema_migrations/20210729192148
+++ /dev/null
@@ -1 +0,0 @@
-6ed7827f6f911dbb40637ac056298877b709fb7356bc9ee3a366cceb48268646 \ No newline at end of file
diff --git a/db/schema_migrations/20210729192959 b/db/schema_migrations/20210729192959
deleted file mode 100644
index df4f4ed2c71..00000000000
--- a/db/schema_migrations/20210729192959
+++ /dev/null
@@ -1 +0,0 @@
-3cb0c88fddfec66c0d89c4c1f34d0538be88a44f2039e6c542c5282b293ce019 \ No newline at end of file
diff --git a/db/schema_migrations/20210729193056 b/db/schema_migrations/20210729193056
deleted file mode 100644
index fea83eb2750..00000000000
--- a/db/schema_migrations/20210729193056
+++ /dev/null
@@ -1 +0,0 @@
-d983a765482b368bd7a238b3b75fc9b0a45310f295953ea053ee4c42785e8684 \ No newline at end of file
diff --git a/db/schema_migrations/20210729202143 b/db/schema_migrations/20210729202143
deleted file mode 100644
index c817508eb5f..00000000000
--- a/db/schema_migrations/20210729202143
+++ /dev/null
@@ -1 +0,0 @@
-ce20c699d6e6d6baf812c926dde08485764faa2fdeb8af14808670bf692aab00 \ No newline at end of file
diff --git a/db/schema_migrations/20210730101609 b/db/schema_migrations/20210730101609
deleted file mode 100644
index f3522b194b2..00000000000
--- a/db/schema_migrations/20210730101609
+++ /dev/null
@@ -1 +0,0 @@
-f819eaed7e387f18f066180cbf9d0849b3e38db95bbf3e8487d3bc58d9b489ae \ No newline at end of file
diff --git a/db/schema_migrations/20210730102952 b/db/schema_migrations/20210730102952
deleted file mode 100644
index a21008671c2..00000000000
--- a/db/schema_migrations/20210730102952
+++ /dev/null
@@ -1 +0,0 @@
-cb97b869bfb0b76dd0684aca1f40c86e7c1c9c9a0d52684830115288088e8066 \ No newline at end of file
diff --git a/db/schema_migrations/20210730103808 b/db/schema_migrations/20210730103808
deleted file mode 100644
index 6467a981cbb..00000000000
--- a/db/schema_migrations/20210730103808
+++ /dev/null
@@ -1 +0,0 @@
-5c104ffdb64943aa4828a9b961c8f9141dfd2ae861cea7116722d2b0d4598957 \ No newline at end of file
diff --git a/db/schema_migrations/20210730104800 b/db/schema_migrations/20210730104800
deleted file mode 100644
index d8e2986e946..00000000000
--- a/db/schema_migrations/20210730104800
+++ /dev/null
@@ -1 +0,0 @@
-7764c058665015707aff6e25ccbf60d4a329c67c16106b2ef523862ef82298b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210730170823 b/db/schema_migrations/20210730170823
deleted file mode 100644
index d1822fde24b..00000000000
--- a/db/schema_migrations/20210730170823
+++ /dev/null
@@ -1 +0,0 @@
-33b260626d65347a80240ffdce5f9e2abfc578e8151ed41f1ca9b16ef2654853 \ No newline at end of file
diff --git a/db/schema_migrations/20210730194555 b/db/schema_migrations/20210730194555
deleted file mode 100644
index 5b2a142779d..00000000000
--- a/db/schema_migrations/20210730194555
+++ /dev/null
@@ -1 +0,0 @@
-2d0399beca58815197487d310318ed1cb3d8e85671d55581a6256ceac7667b43 \ No newline at end of file
diff --git a/db/schema_migrations/20210731132939 b/db/schema_migrations/20210731132939
deleted file mode 100644
index f032b0fadad..00000000000
--- a/db/schema_migrations/20210731132939
+++ /dev/null
@@ -1 +0,0 @@
-97d968bba0eb2bf6faa19de8a3e4fe93dc03a623b623dc802ab0fe0a4afb0370 \ No newline at end of file
diff --git a/db/schema_migrations/20210802043253 b/db/schema_migrations/20210802043253
deleted file mode 100644
index a8017b11b8a..00000000000
--- a/db/schema_migrations/20210802043253
+++ /dev/null
@@ -1 +0,0 @@
-b844c7c56019fc984c2604ae11f6ee9eb587806b5c78e4beea4dda93e384f9b2 \ No newline at end of file
diff --git a/db/schema_migrations/20210802112233 b/db/schema_migrations/20210802112233
deleted file mode 100644
index 68626f9398b..00000000000
--- a/db/schema_migrations/20210802112233
+++ /dev/null
@@ -1 +0,0 @@
-1b55c50a9ba085ae7a0552da4985755c67eafb74e76b06590179803b4b215f81 \ No newline at end of file
diff --git a/db/schema_migrations/20210802131812 b/db/schema_migrations/20210802131812
deleted file mode 100644
index ef533ba9abd..00000000000
--- a/db/schema_migrations/20210802131812
+++ /dev/null
@@ -1 +0,0 @@
-a686e5df8b1528fa4d8d1c7b65b234837443d0cc249d08a38694f83263bb0532 \ No newline at end of file
diff --git a/db/schema_migrations/20210803110920 b/db/schema_migrations/20210803110920
deleted file mode 100644
index 69ba671ea7b..00000000000
--- a/db/schema_migrations/20210803110920
+++ /dev/null
@@ -1 +0,0 @@
-529cf86e09b5aa9015b604e73827cb21e92ced401f30dfb281115a506596bd4e \ No newline at end of file
diff --git a/db/schema_migrations/20210804150320 b/db/schema_migrations/20210804150320
deleted file mode 100644
index 336fec35970..00000000000
--- a/db/schema_migrations/20210804150320
+++ /dev/null
@@ -1 +0,0 @@
-53d4f6ca18602b25af631a25dee7b0ebf9cb98e7a4f8cd87830f939bc13bb893 \ No newline at end of file
diff --git a/db/schema_migrations/20210804150624 b/db/schema_migrations/20210804150624
deleted file mode 100644
index 135519b6b93..00000000000
--- a/db/schema_migrations/20210804150624
+++ /dev/null
@@ -1 +0,0 @@
-52e71aa3ec92473006b37e9319797133356f7747b91c32b09a746e183501655f \ No newline at end of file
diff --git a/db/schema_migrations/20210804151444 b/db/schema_migrations/20210804151444
deleted file mode 100644
index 0d633c3da36..00000000000
--- a/db/schema_migrations/20210804151444
+++ /dev/null
@@ -1 +0,0 @@
-4a6676e9185a99070751c91c71a7a9e6a845426d68567abf80a2e414251e5805 \ No newline at end of file
diff --git a/db/schema_migrations/20210804153307 b/db/schema_migrations/20210804153307
deleted file mode 100644
index ae7baaa4cf4..00000000000
--- a/db/schema_migrations/20210804153307
+++ /dev/null
@@ -1 +0,0 @@
-d73756410c7f37662c50bb05c372e6ac32ba81f232c07debcd42d1f679eb74ef \ No newline at end of file
diff --git a/db/schema_migrations/20210804154407 b/db/schema_migrations/20210804154407
deleted file mode 100644
index dc0e40c7117..00000000000
--- a/db/schema_migrations/20210804154407
+++ /dev/null
@@ -1 +0,0 @@
-ab7ee98704e844de4a3ba3ae14ea64dd46539e63d49c7c7e0d67ed03ebc3bbd4 \ No newline at end of file
diff --git a/db/schema_migrations/20210804200114 b/db/schema_migrations/20210804200114
deleted file mode 100644
index b4ac42657ba..00000000000
--- a/db/schema_migrations/20210804200114
+++ /dev/null
@@ -1 +0,0 @@
-db62fb6413db4be5e1013bccf16b0c3a66c9aaf9f3d646f42442be16c511af5f \ No newline at end of file
diff --git a/db/schema_migrations/20210804202057 b/db/schema_migrations/20210804202057
deleted file mode 100644
index dd592038d11..00000000000
--- a/db/schema_migrations/20210804202057
+++ /dev/null
@@ -1 +0,0 @@
-48f140728fede7cf38469c8dfcb5480b4f2b8e29af4b1edd5d38024548493c2d \ No newline at end of file
diff --git a/db/schema_migrations/20210805085706 b/db/schema_migrations/20210805085706
deleted file mode 100644
index b41a68968ec..00000000000
--- a/db/schema_migrations/20210805085706
+++ /dev/null
@@ -1 +0,0 @@
-ec968f1f9fcc5a3551664e74726e1c65b327128e2388e1357ae6d0cf6f05fb95 \ No newline at end of file
diff --git a/db/schema_migrations/20210805131510 b/db/schema_migrations/20210805131510
deleted file mode 100644
index a80524552b9..00000000000
--- a/db/schema_migrations/20210805131510
+++ /dev/null
@@ -1 +0,0 @@
-ee6dc82719ecfbdf58d2c76589f328bed9e1a4455f4c593ae45ae7b2afc62602 \ No newline at end of file
diff --git a/db/schema_migrations/20210805192450 b/db/schema_migrations/20210805192450
deleted file mode 100644
index 1b9ae3880e0..00000000000
--- a/db/schema_migrations/20210805192450
+++ /dev/null
@@ -1 +0,0 @@
-a63f878d89269eb8a2a3cc3b0c81d700861031a079a4a69b56d45d73c4c7946e \ No newline at end of file
diff --git a/db/schema_migrations/20210806011811 b/db/schema_migrations/20210806011811
deleted file mode 100644
index 7b8317bec10..00000000000
--- a/db/schema_migrations/20210806011811
+++ /dev/null
@@ -1 +0,0 @@
-e4f4f3c91cdb8ce8b1fa6c2bd0bb1fb1a8c0dedbb78c20bbaef6e36bfa9551c4 \ No newline at end of file
diff --git a/db/schema_migrations/20210806131706 b/db/schema_migrations/20210806131706
deleted file mode 100644
index 78be9905398..00000000000
--- a/db/schema_migrations/20210806131706
+++ /dev/null
@@ -1 +0,0 @@
-2539e3e09682f1d7a0902b495a140151a5debef40623348d3cc552d4ba00722f \ No newline at end of file
diff --git a/db/schema_migrations/20210806152104 b/db/schema_migrations/20210806152104
deleted file mode 100644
index a8bdc0615d5..00000000000
--- a/db/schema_migrations/20210806152104
+++ /dev/null
@@ -1 +0,0 @@
-1bdbcc6ef5ccf7a2bfb1f9571885e218e230a81b632a2d993302bd87432963f3 \ No newline at end of file
diff --git a/db/schema_migrations/20210807101446 b/db/schema_migrations/20210807101446
deleted file mode 100644
index 0b6d526429f..00000000000
--- a/db/schema_migrations/20210807101446
+++ /dev/null
@@ -1 +0,0 @@
-30e1463616c60b92afb28bbb76e3c55830a385af6df0e60e16ed96d9e75943b9 \ No newline at end of file
diff --git a/db/schema_migrations/20210807101621 b/db/schema_migrations/20210807101621
deleted file mode 100644
index ab053cf4cbc..00000000000
--- a/db/schema_migrations/20210807101621
+++ /dev/null
@@ -1 +0,0 @@
-7e9b39914ade766357751953a4981225dbae7e5d371d4824af61b01af70f46ae \ No newline at end of file
diff --git a/db/schema_migrations/20210807102004 b/db/schema_migrations/20210807102004
deleted file mode 100644
index e63485435f8..00000000000
--- a/db/schema_migrations/20210807102004
+++ /dev/null
@@ -1 +0,0 @@
-a2454f9fca3b1cedf7a0f2288b69abe799fe1f9ff4e2fe26d2cadfdddea73a83 \ No newline at end of file
diff --git a/db/schema_migrations/20210809014850 b/db/schema_migrations/20210809014850
deleted file mode 100644
index 541d397d169..00000000000
--- a/db/schema_migrations/20210809014850
+++ /dev/null
@@ -1 +0,0 @@
-6f67e2bba5f42d48a9b21f8ab4d9abf4495ef7e0226ea903d51e77eed85ad0cb \ No newline at end of file
diff --git a/db/schema_migrations/20210809014918 b/db/schema_migrations/20210809014918
deleted file mode 100644
index 099f032c76a..00000000000
--- a/db/schema_migrations/20210809014918
+++ /dev/null
@@ -1 +0,0 @@
-d282a027d03920a53d49444f54745ab7d2c8bcccc485ac9407ff9dbbef77981f \ No newline at end of file
diff --git a/db/schema_migrations/20210809123658 b/db/schema_migrations/20210809123658
deleted file mode 100644
index 0db44d3c8f5..00000000000
--- a/db/schema_migrations/20210809123658
+++ /dev/null
@@ -1 +0,0 @@
-f4a1963c8f21b8c767766c3a18037bae223efce8452c87f570cf9789d6f666d6 \ No newline at end of file
diff --git a/db/schema_migrations/20210809143931 b/db/schema_migrations/20210809143931
deleted file mode 100644
index 294c62d54d8..00000000000
--- a/db/schema_migrations/20210809143931
+++ /dev/null
@@ -1 +0,0 @@
-37cac2c3c5c5c22a34e0a77733c5330a32101090ac47b46260123c3362a9e36f \ No newline at end of file
diff --git a/db/schema_migrations/20210809194250 b/db/schema_migrations/20210809194250
deleted file mode 100644
index c70e543e20e..00000000000
--- a/db/schema_migrations/20210809194250
+++ /dev/null
@@ -1 +0,0 @@
-35475ad862d713055a90af508dba393834ce8aa60eb1abf46b8f9698c2d42276 \ No newline at end of file
diff --git a/db/schema_migrations/20210811120204 b/db/schema_migrations/20210811120204
deleted file mode 100644
index 1802d357900..00000000000
--- a/db/schema_migrations/20210811120204
+++ /dev/null
@@ -1 +0,0 @@
-77d80801402f18e69d17a9f120445fe14d05cec3a93a08341abf89ae81cda5b9 \ No newline at end of file
diff --git a/db/schema_migrations/20210811122206 b/db/schema_migrations/20210811122206
deleted file mode 100644
index 3bb2799461a..00000000000
--- a/db/schema_migrations/20210811122206
+++ /dev/null
@@ -1 +0,0 @@
-f6f5e081672fb42adde980fa12f696f5d8fd11921ee52c1472b3d745bb11a5ff \ No newline at end of file
diff --git a/db/schema_migrations/20210811193033 b/db/schema_migrations/20210811193033
deleted file mode 100644
index 0d97d5a238a..00000000000
--- a/db/schema_migrations/20210811193033
+++ /dev/null
@@ -1 +0,0 @@
-a7e259fa72dfdfa40137d278499d6b63b84f939f46936c0f4ed289ed152d9356 \ No newline at end of file
diff --git a/db/schema_migrations/20210811214811 b/db/schema_migrations/20210811214811
deleted file mode 100644
index b34641b6b44..00000000000
--- a/db/schema_migrations/20210811214811
+++ /dev/null
@@ -1 +0,0 @@
-9e66aa8fc5e2a32ce0857f7ef77e906424bdf86c49643dfc71ed1a2e353b2095 \ No newline at end of file
diff --git a/db/schema_migrations/20210812013042 b/db/schema_migrations/20210812013042
deleted file mode 100644
index fee1a2b268a..00000000000
--- a/db/schema_migrations/20210812013042
+++ /dev/null
@@ -1 +0,0 @@
-0af6e6e56967cef9d1160dbfd95456428337843d893307c69505e1a2d3c2074a \ No newline at end of file
diff --git a/db/schema_migrations/20210812145010 b/db/schema_migrations/20210812145010
deleted file mode 100644
index 0a00afc3c70..00000000000
--- a/db/schema_migrations/20210812145010
+++ /dev/null
@@ -1 +0,0 @@
-24c49a12b6624c8e215e8a0c16b1bc9acc1875e68d3727fc3904b9e2eee1d319 \ No newline at end of file
diff --git a/db/schema_migrations/20210812171704 b/db/schema_migrations/20210812171704
deleted file mode 100644
index 2471f7cdd38..00000000000
--- a/db/schema_migrations/20210812171704
+++ /dev/null
@@ -1 +0,0 @@
-7c62c47ebad110a343c1f9834ae34bd0fa2bad763025da06f911e127a7380542 \ No newline at end of file
diff --git a/db/schema_migrations/20210813101742 b/db/schema_migrations/20210813101742
deleted file mode 100644
index f711612a8dc..00000000000
--- a/db/schema_migrations/20210813101742
+++ /dev/null
@@ -1 +0,0 @@
-4401423fc602a6d5df95857282bb84851fa99ddeb6c3d1ce4614f12c1dc4ec87 \ No newline at end of file
diff --git a/db/schema_migrations/20210813111909 b/db/schema_migrations/20210813111909
deleted file mode 100644
index c6073d273da..00000000000
--- a/db/schema_migrations/20210813111909
+++ /dev/null
@@ -1 +0,0 @@
-78ea79c2157acb8a0b29afb4d2f3de6965fb0ea885b5d5f939f22ccda1d53b1e \ No newline at end of file
diff --git a/db/schema_migrations/20210813131313 b/db/schema_migrations/20210813131313
deleted file mode 100644
index abb03783efe..00000000000
--- a/db/schema_migrations/20210813131313
+++ /dev/null
@@ -1 +0,0 @@
-5ab51c1fb5bde22123f2d55f6422de0d8d0a84b7a98ce3146cbf491475c97b66 \ No newline at end of file
diff --git a/db/schema_migrations/20210813151908 b/db/schema_migrations/20210813151908
deleted file mode 100644
index b2d1602658b..00000000000
--- a/db/schema_migrations/20210813151908
+++ /dev/null
@@ -1 +0,0 @@
-fdb6dd20c1cd5feaf0efd8eb94a4d61fc4812f1142572433ae397cd5f27bf603 \ No newline at end of file
diff --git a/db/schema_migrations/20210813195518 b/db/schema_migrations/20210813195518
deleted file mode 100644
index d64dd04d05b..00000000000
--- a/db/schema_migrations/20210813195518
+++ /dev/null
@@ -1 +0,0 @@
-848e0201709b3608e76308e9d610e2a4e48ab665c7d8b52f3d23f0a215df58ff \ No newline at end of file
diff --git a/db/schema_migrations/20210816095826 b/db/schema_migrations/20210816095826
deleted file mode 100644
index 079a83fae8f..00000000000
--- a/db/schema_migrations/20210816095826
+++ /dev/null
@@ -1 +0,0 @@
-d1ad234656f49861d2ca7694d23116e930bba597fca32b1015db698cc23bdc1c \ No newline at end of file
diff --git a/db/schema_migrations/20210816161107 b/db/schema_migrations/20210816161107
deleted file mode 100644
index 1b8ab5265b7..00000000000
--- a/db/schema_migrations/20210816161107
+++ /dev/null
@@ -1 +0,0 @@
-1e4d0b062c8e43b1af37c6cf869f9c173248d7bf5451b4aa5468d48c1004b97c \ No newline at end of file
diff --git a/db/schema_migrations/20210816183304 b/db/schema_migrations/20210816183304
deleted file mode 100644
index eebc52f99d7..00000000000
--- a/db/schema_migrations/20210816183304
+++ /dev/null
@@ -1 +0,0 @@
-08fed4e3269629304c5036361c237f4c9b860c26212b155869773296a79df01a \ No newline at end of file
diff --git a/db/schema_migrations/20210816192041 b/db/schema_migrations/20210816192041
deleted file mode 100644
index d60da5dda39..00000000000
--- a/db/schema_migrations/20210816192041
+++ /dev/null
@@ -1 +0,0 @@
-7d069706b4379685cfe85a5c65444d139f6f93578ff6ff66759e0a694e119bb4 \ No newline at end of file
diff --git a/db/schema_migrations/20210817024335 b/db/schema_migrations/20210817024335
deleted file mode 100644
index 019ec0a26b7..00000000000
--- a/db/schema_migrations/20210817024335
+++ /dev/null
@@ -1 +0,0 @@
-360bb1c16c93d7a6564ed70fa2dea4212e1fd00d101cfdc9017b54f67eae797d \ No newline at end of file
diff --git a/db/schema_migrations/20210817084338 b/db/schema_migrations/20210817084338
deleted file mode 100644
index ca7219b7ea6..00000000000
--- a/db/schema_migrations/20210817084338
+++ /dev/null
@@ -1 +0,0 @@
-e301e1be82c96e62bba0f958c54dda4633b28553246d4c576d6de33cd33e0a50 \ No newline at end of file
diff --git a/db/schema_migrations/20210817130415 b/db/schema_migrations/20210817130415
deleted file mode 100644
index e8481cb4019..00000000000
--- a/db/schema_migrations/20210817130415
+++ /dev/null
@@ -1 +0,0 @@
-8c1ec0dfc043861377786bd7731a1a1f994d6f03833f4dcc2ba94ab1ddc83acf \ No newline at end of file
diff --git a/db/schema_migrations/20210817172214 b/db/schema_migrations/20210817172214
deleted file mode 100644
index 5e334c7d690..00000000000
--- a/db/schema_migrations/20210817172214
+++ /dev/null
@@ -1 +0,0 @@
-d6dd6ce802beeea380e0eb1c564f6a5cbc6d30cb3488a3cb91935e1302a4c387 \ No newline at end of file
diff --git a/db/schema_migrations/20210818034001 b/db/schema_migrations/20210818034001
deleted file mode 100644
index e20a891b5f1..00000000000
--- a/db/schema_migrations/20210818034001
+++ /dev/null
@@ -1 +0,0 @@
-ebf0c2a7b0563dafa562136a0758baf631db92c0ce33f7200da24092f1eb2930 \ No newline at end of file
diff --git a/db/schema_migrations/20210818055357 b/db/schema_migrations/20210818055357
deleted file mode 100644
index 1557aa0ac3e..00000000000
--- a/db/schema_migrations/20210818055357
+++ /dev/null
@@ -1 +0,0 @@
-1092a16d742b08ef2ef5f74bdaa92bb5f9cedbdb1161ab71abe501c39b164689 \ No newline at end of file
diff --git a/db/schema_migrations/20210818061156 b/db/schema_migrations/20210818061156
deleted file mode 100644
index fba5486b2a8..00000000000
--- a/db/schema_migrations/20210818061156
+++ /dev/null
@@ -1 +0,0 @@
-23becdc9ad558882f4ce42e76391cdc2f760322a09c998082465fcb6d29dfeb5 \ No newline at end of file
diff --git a/db/schema_migrations/20210818115613 b/db/schema_migrations/20210818115613
deleted file mode 100644
index efe76d3a46a..00000000000
--- a/db/schema_migrations/20210818115613
+++ /dev/null
@@ -1 +0,0 @@
-9c5114dac05e90c15567bb3274f20f03a82f9e4d73d5c72d89c26bc9d742cc35 \ No newline at end of file
diff --git a/db/schema_migrations/20210818175949 b/db/schema_migrations/20210818175949
deleted file mode 100644
index 8e316d2dd9c..00000000000
--- a/db/schema_migrations/20210818175949
+++ /dev/null
@@ -1 +0,0 @@
-0d04487e59b783f0aa88ddd4f79716ae570ba87528b15bd07400aa4b1cef92c1 \ No newline at end of file
diff --git a/db/schema_migrations/20210818185548 b/db/schema_migrations/20210818185548
deleted file mode 100644
index 42826826512..00000000000
--- a/db/schema_migrations/20210818185548
+++ /dev/null
@@ -1 +0,0 @@
-88ca485c8513df96b1f1aec1585c385223dc53889e547db42b509b0cd1bea9b7 \ No newline at end of file
diff --git a/db/schema_migrations/20210818185845 b/db/schema_migrations/20210818185845
deleted file mode 100644
index 7ed2204aeb6..00000000000
--- a/db/schema_migrations/20210818185845
+++ /dev/null
@@ -1 +0,0 @@
-dc8ca347fb0c87e1a66389fd9f37fa9702f8bd53237ada40192bb0a875dbe940 \ No newline at end of file
diff --git a/db/schema_migrations/20210818193008 b/db/schema_migrations/20210818193008
deleted file mode 100644
index aef60a5ab5b..00000000000
--- a/db/schema_migrations/20210818193008
+++ /dev/null
@@ -1 +0,0 @@
-d24d10134d661728dbe688da2b90da55c584627ca764a6cc4604631f8a5fa334 \ No newline at end of file
diff --git a/db/schema_migrations/20210818200455 b/db/schema_migrations/20210818200455
deleted file mode 100644
index c476ef5b488..00000000000
--- a/db/schema_migrations/20210818200455
+++ /dev/null
@@ -1 +0,0 @@
-25eb43de74e7eb158718b19d8cea5da2540507e96fcbe47d4829fa806e773308 \ No newline at end of file
diff --git a/db/schema_migrations/20210818220234 b/db/schema_migrations/20210818220234
deleted file mode 100644
index e32f27029cf..00000000000
--- a/db/schema_migrations/20210818220234
+++ /dev/null
@@ -1 +0,0 @@
-8d247218468ad383d1a8a2dc67d5e7e67ddad2a33a38203a41e49c4c018adc7e \ No newline at end of file
diff --git a/db/schema_migrations/20210819120243 b/db/schema_migrations/20210819120243
deleted file mode 100644
index e31d0ca6414..00000000000
--- a/db/schema_migrations/20210819120243
+++ /dev/null
@@ -1 +0,0 @@
-5c74d34171ed9129ffbb3efe5417da1ba857cd729837544e58074debd5afca88 \ No newline at end of file
diff --git a/db/schema_migrations/20210819145000 b/db/schema_migrations/20210819145000
deleted file mode 100644
index 56301031459..00000000000
--- a/db/schema_migrations/20210819145000
+++ /dev/null
@@ -1 +0,0 @@
-a73a33d30af332c8c01cd9d55618a1b84bc9074ffe4d06fd72c8eb37cd264954 \ No newline at end of file
diff --git a/db/schema_migrations/20210819152723 b/db/schema_migrations/20210819152723
deleted file mode 100644
index b5f4d2795f7..00000000000
--- a/db/schema_migrations/20210819152723
+++ /dev/null
@@ -1 +0,0 @@
-b311fdb0a6e0e10ca3c67b9b2c3d920f8e735f0fd8398fdaa25853e14f88ae97 \ No newline at end of file
diff --git a/db/schema_migrations/20210819153805 b/db/schema_migrations/20210819153805
deleted file mode 100644
index fe0d1dcfd69..00000000000
--- a/db/schema_migrations/20210819153805
+++ /dev/null
@@ -1 +0,0 @@
-195d2444bf9d5113ee589b1accdbf04efbc7fb84c2ead4deed3985b254345e07 \ No newline at end of file
diff --git a/db/schema_migrations/20210819162047 b/db/schema_migrations/20210819162047
deleted file mode 100644
index c50e07543da..00000000000
--- a/db/schema_migrations/20210819162047
+++ /dev/null
@@ -1 +0,0 @@
-5a02c5a24bb4c7cb63da2e5cc53ff89461f328d0092bb4bb6589223dc4bdae8c \ No newline at end of file
diff --git a/db/schema_migrations/20210819183128 b/db/schema_migrations/20210819183128
deleted file mode 100644
index 84b8b3780e3..00000000000
--- a/db/schema_migrations/20210819183128
+++ /dev/null
@@ -1 +0,0 @@
-d57791945f0d21da90a5b1d75db9add6c7e916ad3c13df2522c7d71d572baa47 \ No newline at end of file
diff --git a/db/schema_migrations/20210819185500 b/db/schema_migrations/20210819185500
deleted file mode 100644
index 1f92c1d81a9..00000000000
--- a/db/schema_migrations/20210819185500
+++ /dev/null
@@ -1 +0,0 @@
-eab87cb4abfad7542fcff7c25d984e4a7588c824a13b379cb16c87d0c077cfbb \ No newline at end of file
diff --git a/db/schema_migrations/20210820171834 b/db/schema_migrations/20210820171834
deleted file mode 100644
index be62c2b9a63..00000000000
--- a/db/schema_migrations/20210820171834
+++ /dev/null
@@ -1 +0,0 @@
-892a71a3f6fdeb20cb2837a426d6d0931c756f8bf3d647e520a72a0bb6f78309 \ No newline at end of file
diff --git a/db/schema_migrations/20210823113259 b/db/schema_migrations/20210823113259
deleted file mode 100644
index 79f416332d8..00000000000
--- a/db/schema_migrations/20210823113259
+++ /dev/null
@@ -1 +0,0 @@
-06b44a856fc970f52b19ad8eeb38f885182003eff50ef1524ecf30887f4664d9 \ No newline at end of file
diff --git a/db/schema_migrations/20210823132600 b/db/schema_migrations/20210823132600
deleted file mode 100644
index 85ab3b55ee4..00000000000
--- a/db/schema_migrations/20210823132600
+++ /dev/null
@@ -1 +0,0 @@
-7324c3803c910338261556c65cae5d0827e78b77890386e402e056d480c3486b \ No newline at end of file
diff --git a/db/schema_migrations/20210823142036 b/db/schema_migrations/20210823142036
deleted file mode 100644
index ec24927dfcf..00000000000
--- a/db/schema_migrations/20210823142036
+++ /dev/null
@@ -1 +0,0 @@
-874ed71410406d10ade9c834d1374b039effd9e88514d327d04275e11e837ffb \ No newline at end of file
diff --git a/db/schema_migrations/20210823172643 b/db/schema_migrations/20210823172643
deleted file mode 100644
index e89e11bb544..00000000000
--- a/db/schema_migrations/20210823172643
+++ /dev/null
@@ -1 +0,0 @@
-e6570f8ee366431b17b34051b9d0dcf2aff6216f8d65b3b6eec5be5666fed229 \ No newline at end of file
diff --git a/db/schema_migrations/20210823193234 b/db/schema_migrations/20210823193234
deleted file mode 100644
index d47f1ec567a..00000000000
--- a/db/schema_migrations/20210823193234
+++ /dev/null
@@ -1 +0,0 @@
-b85ef326056bb152d527e34b49caa3c40ee8685c3b14654992246c6adf082f8c \ No newline at end of file
diff --git a/db/schema_migrations/20210823213417 b/db/schema_migrations/20210823213417
deleted file mode 100644
index bcd41f479e6..00000000000
--- a/db/schema_migrations/20210823213417
+++ /dev/null
@@ -1 +0,0 @@
-62496310640493bf9b7f0e1cbe91b170542da3250a1cf482f5e0237d0e8847b1 \ No newline at end of file
diff --git a/db/schema_migrations/20210824055322 b/db/schema_migrations/20210824055322
deleted file mode 100644
index ed3925f8ac5..00000000000
--- a/db/schema_migrations/20210824055322
+++ /dev/null
@@ -1 +0,0 @@
-abd298ec9e6d9016c05032504d9ff0de7af9c6a031e0eacb041f29e59e82f289 \ No newline at end of file
diff --git a/db/schema_migrations/20210824102624 b/db/schema_migrations/20210824102624
deleted file mode 100644
index c736c84f8f8..00000000000
--- a/db/schema_migrations/20210824102624
+++ /dev/null
@@ -1 +0,0 @@
-f1fc9e062f5100db6a549fffa2fcd78d8eb6854cea388a6ac7addf4f6f232920 \ No newline at end of file
diff --git a/db/schema_migrations/20210824102750 b/db/schema_migrations/20210824102750
deleted file mode 100644
index 520c8365d41..00000000000
--- a/db/schema_migrations/20210824102750
+++ /dev/null
@@ -1 +0,0 @@
-cc99eb2b40ee88d4d6df07253f599deb26be2fca7b941c5cecb2f8fb7ff3641d \ No newline at end of file
diff --git a/db/schema_migrations/20210824105038 b/db/schema_migrations/20210824105038
deleted file mode 100644
index 24772827b3b..00000000000
--- a/db/schema_migrations/20210824105038
+++ /dev/null
@@ -1 +0,0 @@
-9fe4e2a3d5c50507220ac8363a9f7975ca1fc87575ee0c2ba8948c6d9bcd7019 \ No newline at end of file
diff --git a/db/schema_migrations/20210824160459 b/db/schema_migrations/20210824160459
deleted file mode 100644
index afab14f962c..00000000000
--- a/db/schema_migrations/20210824160459
+++ /dev/null
@@ -1 +0,0 @@
-39924743a04ba01cb85eed5ef88762a6a3e29c56f397a59632ba43e0ccec40b3 \ No newline at end of file
diff --git a/db/schema_migrations/20210824174615 b/db/schema_migrations/20210824174615
deleted file mode 100644
index 56160c801f1..00000000000
--- a/db/schema_migrations/20210824174615
+++ /dev/null
@@ -1 +0,0 @@
-830cf08352b0d1f0c7f08ea67107466ea1d6a478c6f47d5e19f0ffa6c57f5641 \ No newline at end of file
diff --git a/db/schema_migrations/20210825104558 b/db/schema_migrations/20210825104558
deleted file mode 100644
index 3457bbf1ace..00000000000
--- a/db/schema_migrations/20210825104558
+++ /dev/null
@@ -1 +0,0 @@
-ab678fb5e8ddf7e6dc84f36248440e94953d7c85ee6a50f4e5c06f32c6ee66ec \ No newline at end of file
diff --git a/db/schema_migrations/20210825104656 b/db/schema_migrations/20210825104656
deleted file mode 100644
index 9f91a3c364f..00000000000
--- a/db/schema_migrations/20210825104656
+++ /dev/null
@@ -1 +0,0 @@
-c15d736eb441503d321e1bf377edd204aa1b5822ed697cce2934ff87eca441a9 \ No newline at end of file
diff --git a/db/schema_migrations/20210825110016 b/db/schema_migrations/20210825110016
deleted file mode 100644
index 8c1b11653f1..00000000000
--- a/db/schema_migrations/20210825110016
+++ /dev/null
@@ -1 +0,0 @@
-e9e8444056a114d471f60156ec1e5a96082c7922604f1926c0256eb17986c484 \ No newline at end of file
diff --git a/db/schema_migrations/20210825150212 b/db/schema_migrations/20210825150212
deleted file mode 100644
index bdd83542199..00000000000
--- a/db/schema_migrations/20210825150212
+++ /dev/null
@@ -1 +0,0 @@
-5dc6a4f9ecbd705bf8361c65b29931cde94968084e8ae7945a27acdcbd6475c8 \ No newline at end of file
diff --git a/db/schema_migrations/20210825182303 b/db/schema_migrations/20210825182303
deleted file mode 100644
index af9dc177a72..00000000000
--- a/db/schema_migrations/20210825182303
+++ /dev/null
@@ -1 +0,0 @@
-a7f4911fcb9ab939a6e5e9a6e5e927fd6828ff062324d8483d78c8f8a4ded4e6 \ No newline at end of file
diff --git a/db/schema_migrations/20210825190458 b/db/schema_migrations/20210825190458
deleted file mode 100644
index e03c12e4284..00000000000
--- a/db/schema_migrations/20210825190458
+++ /dev/null
@@ -1 +0,0 @@
-43d152f4235a07111a401be7b52a527571be04861c71381c311d6a48c8574dc9 \ No newline at end of file
diff --git a/db/schema_migrations/20210825193448 b/db/schema_migrations/20210825193448
deleted file mode 100644
index b62b45b61ae..00000000000
--- a/db/schema_migrations/20210825193448
+++ /dev/null
@@ -1 +0,0 @@
-d9c7cc7721b28cbd442bf40255ecfbd20d0abf4cd31631c150ebdc05c76062be \ No newline at end of file
diff --git a/db/schema_migrations/20210825193548 b/db/schema_migrations/20210825193548
deleted file mode 100644
index 0255e6719ef..00000000000
--- a/db/schema_migrations/20210825193548
+++ /dev/null
@@ -1 +0,0 @@
-b97b77aef61db2e51106ac090f5511a67fa85be8f3741f618fe03c8c03ecd88c \ No newline at end of file
diff --git a/db/schema_migrations/20210825193652 b/db/schema_migrations/20210825193652
deleted file mode 100644
index 0ecca0962dc..00000000000
--- a/db/schema_migrations/20210825193652
+++ /dev/null
@@ -1 +0,0 @@
-fd7aef11635bc4c5d6b9346dbed90f6c114da7b7a33744083e8610f3850e4736 \ No newline at end of file
diff --git a/db/schema_migrations/20210826110839 b/db/schema_migrations/20210826110839
deleted file mode 100644
index 165141ef852..00000000000
--- a/db/schema_migrations/20210826110839
+++ /dev/null
@@ -1 +0,0 @@
-72b64ddbaf86eb296fe49fd38bea759d5247414142fe1cd11aee7e1d6171e142 \ No newline at end of file
diff --git a/db/schema_migrations/20210826120834 b/db/schema_migrations/20210826120834
deleted file mode 100644
index ebbdb86049c..00000000000
--- a/db/schema_migrations/20210826120834
+++ /dev/null
@@ -1 +0,0 @@
-a8cd5165815a2f1e6b825ea3ee2a9bde88c1790f6ebe92296bee6a9a892b83f2 \ No newline at end of file
diff --git a/db/schema_migrations/20210826122748 b/db/schema_migrations/20210826122748
deleted file mode 100644
index e6d87674da3..00000000000
--- a/db/schema_migrations/20210826122748
+++ /dev/null
@@ -1 +0,0 @@
-a1290cc671c487a7c24bfdb02c564d656a6606258e680e65ed108e3a28de10ca \ No newline at end of file
diff --git a/db/schema_migrations/20210826124311 b/db/schema_migrations/20210826124311
deleted file mode 100644
index c63d85f13b7..00000000000
--- a/db/schema_migrations/20210826124311
+++ /dev/null
@@ -1 +0,0 @@
-2cad14b3b7cb4f958a26cb6d4e76380338b745cc90c2e31c521614ea277c4ee9 \ No newline at end of file
diff --git a/db/schema_migrations/20210826145509 b/db/schema_migrations/20210826145509
deleted file mode 100644
index 9f93b675b12..00000000000
--- a/db/schema_migrations/20210826145509
+++ /dev/null
@@ -1 +0,0 @@
-661b2f03f2387f0d49cbb11c333ad29c6af5caed1f43e860fa0f263f8e7371c2 \ No newline at end of file
diff --git a/db/schema_migrations/20210826170902 b/db/schema_migrations/20210826170902
deleted file mode 100644
index f20877de3a5..00000000000
--- a/db/schema_migrations/20210826170902
+++ /dev/null
@@ -1 +0,0 @@
-97536098a2d3b127c6e6b9c079d10d272552dc9064f6b23fb92482baffaac7db \ No newline at end of file
diff --git a/db/schema_migrations/20230130125541 b/db/schema_migrations/20230130125541
new file mode 100644
index 00000000000..126cf47bb09
--- /dev/null
+++ b/db/schema_migrations/20230130125541
@@ -0,0 +1 @@
+a0efe869fb89bd1118bb19184ad47459d8eac8ac517f1fac80eebc7c7da387fc \ No newline at end of file
diff --git a/db/schema_migrations/20230130130624 b/db/schema_migrations/20230130130624
new file mode 100644
index 00000000000..f52a61e9450
--- /dev/null
+++ b/db/schema_migrations/20230130130624
@@ -0,0 +1 @@
+b56a8f0b3c32f29567a28fe2d21a41757365e16eb4cb98639c1ca288656491db \ No newline at end of file
diff --git a/db/schema_migrations/20230206143851 b/db/schema_migrations/20230206143851
new file mode 100644
index 00000000000..52c7753a7ac
--- /dev/null
+++ b/db/schema_migrations/20230206143851
@@ -0,0 +1 @@
+08ba891bbf1342addac1197cbbb13c539ba865928082c72b469c8fae26154728 \ No newline at end of file
diff --git a/db/schema_migrations/20230207143602 b/db/schema_migrations/20230207143602
new file mode 100644
index 00000000000..f7b6b5c106b
--- /dev/null
+++ b/db/schema_migrations/20230207143602
@@ -0,0 +1 @@
+5a74e84b0cb956fcd04d85cac572694788aef1a41b43280ad9fd911cb314ef8c \ No newline at end of file
diff --git a/db/schema_migrations/20230207143844 b/db/schema_migrations/20230207143844
new file mode 100644
index 00000000000..380ad3ec54d
--- /dev/null
+++ b/db/schema_migrations/20230207143844
@@ -0,0 +1 @@
+a2df7a3f9f3020294538a282f1ef8d365ac28026e7653c03a2bb1ec5c873f464 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 3827afa0a1a..204b2d4f40a 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -19811,6 +19811,28 @@ CREATE SEQUENCE pool_repositories_id_seq
ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id;
+CREATE TABLE postgres_async_foreign_key_validations (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ name text NOT NULL,
+ table_name text NOT NULL,
+ last_error text,
+ attempts integer DEFAULT 0 NOT NULL,
+ CONSTRAINT check_536a40afbf CHECK ((char_length(last_error) <= 10000)),
+ CONSTRAINT check_74fb7c8e57 CHECK ((char_length(name) <= 63)),
+ CONSTRAINT check_cd435d6301 CHECK ((char_length(table_name) <= 63))
+);
+
+CREATE SEQUENCE postgres_async_foreign_key_validations_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE postgres_async_foreign_key_validations_id_seq OWNED BY postgres_async_foreign_key_validations.id;
+
CREATE TABLE postgres_async_indexes (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -19818,7 +19840,10 @@ CREATE TABLE postgres_async_indexes (
name text NOT NULL,
definition text NOT NULL,
table_name text NOT NULL,
+ attempts integer DEFAULT 0 NOT NULL,
+ last_error text,
CONSTRAINT check_083b21157b CHECK ((char_length(definition) <= 2048)),
+ CONSTRAINT check_45dc23c315 CHECK ((char_length(last_error) <= 10000)),
CONSTRAINT check_b732c6cd1d CHECK ((char_length(name) <= 63)),
CONSTRAINT check_e64ff4359e CHECK ((char_length(table_name) <= 63))
);
@@ -24723,6 +24748,8 @@ ALTER TABLE ONLY pm_packages ALTER COLUMN id SET DEFAULT nextval('pm_packages_id
ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass);
+ALTER TABLE ONLY postgres_async_foreign_key_validations ALTER COLUMN id SET DEFAULT nextval('postgres_async_foreign_key_validations_id_seq'::regclass);
+
ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('postgres_async_indexes_id_seq'::regclass);
ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass);
@@ -26955,6 +26982,9 @@ ALTER TABLE ONLY pm_packages
ALTER TABLE ONLY pool_repositories
ADD CONSTRAINT pool_repositories_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY postgres_async_foreign_key_validations
+ ADD CONSTRAINT postgres_async_foreign_key_validations_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY postgres_async_indexes
ADD CONSTRAINT postgres_async_indexes_pkey PRIMARY KEY (id);
@@ -30907,6 +30937,8 @@ CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btre
CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id);
+CREATE UNIQUE INDEX index_postgres_async_foreign_key_validations_on_name ON postgres_async_foreign_key_validations USING btree (name);
+
CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_indexes USING btree (name);
CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier);