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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /db
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'db')
-rw-r--r--db/docs/achievements.yml2
-rw-r--r--db/docs/airflow_dags.yml10
-rw-r--r--db/docs/analytics_cycle_analytics_project_stages.yml3
-rw-r--r--db/docs/analytics_cycle_analytics_project_value_streams.yml3
-rw-r--r--db/docs/application_settings.yml2
-rw-r--r--db/docs/ar_internal_metadata.yml7
-rw-r--r--db/docs/automation_rules.yml10
-rw-r--r--db/docs/ci_builds_metadata.yml3
-rw-r--r--db/docs/clusters_applications_cert_managers.yml2
-rw-r--r--db/docs/clusters_applications_cilium.yml2
-rw-r--r--db/docs/dast_profiles_tags.yml10
-rw-r--r--db/docs/dast_scanner_profiles_tags.yml5
-rw-r--r--db/docs/emails.yml2
-rw-r--r--db/docs/events.yml2
-rw-r--r--db/docs/ghost_user_migrations.yml2
-rw-r--r--db/docs/jira_connect_installations.yml2
-rw-r--r--db/docs/licenses.yml2
-rw-r--r--db/docs/namespaces_storage_limit_exclusions.yml12
-rw-r--r--db/docs/pm_checkpoints.yml10
-rw-r--r--db/docs/postgres_async_foreign_key_validations.yml11
-rw-r--r--db/docs/project_data_transfers.yml10
-rw-r--r--db/docs/push_event_payloads.yml2
-rw-r--r--db/docs/routes.yml2
-rw-r--r--db/docs/scan_result_policies.yml10
-rw-r--r--db/docs/user_achievements.yml2
-rw-r--r--db/docs/user_custom_attributes.yml2
-rw-r--r--db/docs/user_details.yml2
-rw-r--r--db/docs/user_follow_users.yml2
-rw-r--r--db/docs/user_preferences.yml2
-rw-r--r--db/docs/user_statuses.yml2
-rw-r--r--db/docs/users.yml2
-rw-r--r--db/docs/wiki_repository_states.yml10
-rw-r--r--db/docs/work_item_types.yml4
-rw-r--r--db/docs/work_item_widget_definitions.yml12
-rw-r--r--db/docs/zoekt_indexed_namespaces.yml10
-rw-r--r--db/docs/zoekt_shards.yml10
-rw-r--r--db/fixtures/development/33_triage_ops.rb2
-rw-r--r--db/init_structure.sql3572
l---------db/main_clusterwide.sql1
-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/20220722150231_create_function_gitlab_schema_prevent_write.rb2
-rw-r--r--db/migrate/20221116134507_add_projects_emails_enabled_column.rb7
-rw-r--r--db/migrate/20221116134539_add_namespaces_emails_enabled_column.rb8
-rw-r--r--db/migrate/20221128155738_add_discord_to_user_details.rb12
-rw-r--r--db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb15
-rw-r--r--db/migrate/20221216145659_add_pa_clickhouse_connection_string_to_application_settings.rb7
-rw-r--r--db/migrate/20221219112632_add_next_over_limit_check_at_to_namespace_details.rb20
-rw-r--r--db/migrate/20221219122320_copy_clickhouse_connection_string_to_encrypted_var.rb25
-rw-r--r--db/migrate/20221228072549_add_pwa_attributes_to_appearances.rb15
-rw-r--r--db/migrate/20221228073206_add_text_limit_to_pwa_attributes.rb15
-rw-r--r--db/migrate/20221229064959_add_links_to_spam_to_abuse_reports.rb7
-rw-r--r--db/migrate/20230102131000_add_smtp_credentials_to_service_desk_settings.rb28
-rw-r--r--db/migrate/20230102131050_add_unique_constraint_for_custom_email_to_service_desk_settings.rb18
-rw-r--r--db/migrate/20230102131100_add_text_limits_to_smtp_credentials_on_service_desk_settings.rb19
-rw-r--r--db/migrate/20230102180341_add_merge_request_meta_to_merge_requests_compliance_violations.rb10
-rw-r--r--db/migrate/20230104201524_add_zoekt_shards_and_indexed_namespaces.rb20
-rw-r--r--db/migrate/20230106014423_add_constraint_to_links_to_spam.rb15
-rw-r--r--db/migrate/20230106184809_create_dast_profiles_tags.rb18
-rw-r--r--db/migrate/20230107125328_add_zoekt_indexed_namespaces_foreign_key.rb15
-rw-r--r--db/migrate/20230109093043_create_namespaces_storage_limit_exclusions.rb20
-rw-r--r--db/migrate/20230109095622_rename_web_hook_calls_to_web_hook_calls_high.rb13
-rw-r--r--db/migrate/20230109232316_create_wiki_repository_states.rb44
-rw-r--r--db/migrate/20230110212906_add_on_update_action_to_postgres_foreign_keys.rb73
-rw-r--r--db/migrate/20230111171355_add_allow_possible_spam_to_application_settings.rb9
-rw-r--r--db/migrate/20230111174113_create_airflow_dags.rb18
-rw-r--r--db/migrate/20230113195141_package_metadata_set_default_not_null.rb7
-rw-r--r--db/migrate/20230116143310_add_pages_unique_domain_columns_to_project_settings.rb13
-rw-r--r--db/migrate/20230116143311_add_project_settings_pages_unique_domain_limit.rb13
-rw-r--r--db/migrate/20230116143312_add_project_settings_pages_unique_domain_unique_index.rb20
-rw-r--r--db/migrate/20230117173433_create_project_data_transfer.rb32
-rw-r--r--db/migrate/20230119150727_add_search_curation_settings_to_application_settings.rb17
-rw-r--r--db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb8
-rw-r--r--db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb13
-rw-r--r--db/migrate/20230119214643_add_deactivation_email_additional_text_to_application_settings.rb12
-rw-r--r--db/migrate/20230119215436_add_package_metadata_checkpoints.rb19
-rw-r--r--db/migrate/20230120170042_re_add_web_hook_calls_column.rb9
-rw-r--r--db/migrate/20230120170631_drop_sync_triggers_from_web_hook_calls_plan_limits.rb15
-rw-r--r--db/migrate/20230120171818_sync_plan_limits_web_hook_calls_columns.rb15
-rw-r--r--db/migrate/20230123095022_create_scan_result_policies.rb18
-rw-r--r--db/migrate/20230123120004_add_datetime_fields_to_bulk_import_trackers.rb13
-rw-r--r--db/migrate/20230123150648_add_deactivation_email_additional_text_to_application_settings_text_limits.rb13
-rw-r--r--db/migrate/20230124122143_add_deploy_key_id_to_create_access_levels.rb11
-rw-r--r--db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb17
-rw-r--r--db/migrate/20230124183643_add_checksums_column_to_project_mirror_data.rb9
-rw-r--r--db/migrate/20230124193917_add_index_for_protected_tag_create_access_levels.rb18
-rw-r--r--db/migrate/20230125090315_add_prepared_at_to_merge_request.rb17
-rw-r--r--db/migrate/20230126023444_add_timestamps_to_package_metadata_tables.rb17
-rw-r--r--db/migrate/20230126110439_change_default_value_for_inbound_job_token_scope_enabled.rb11
-rw-r--r--db/migrate/20230126151622_add_ci_triggers_encrypted_token.rb13
-rw-r--r--db/migrate/20230126210436_add_jira_connect_public_key_storage_enabled_setting.rb7
-rw-r--r--db/migrate/20230127093353_initialize_conversion_of_merge_request_metrics_to_bigint.rb16
-rw-r--r--db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb11
-rw-r--r--db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb13
-rw-r--r--db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb29
-rw-r--r--db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb15
-rw-r--r--db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb29
-rw-r--r--db/migrate/20230127155217_add_id_column_to_package_metadata_join_table.rb20
-rw-r--r--db/migrate/20230127164007_add_trial_date_index_to_gitlab_subscribtions.rb15
-rw-r--r--db/migrate/20230129094140_add_widget_definitions.rb24
-rw-r--r--db/migrate/20230129154126_add_widget_def_namespace_fk.rb16
-rw-r--r--db/migrate/20230129154202_add_widget_def_work_item_type_fk.rb15
-rw-r--r--db/migrate/20230129154819_add_widgets_for_work_item_types.rb143
-rw-r--r--db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb16
-rw-r--r--db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb16
-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/20230130175512_initialize_conversion_of_sent_notifications_to_bigint.rb16
-rw-r--r--db/migrate/20230130204743_remove_protected_environment_default_access_level.rb7
-rw-r--r--db/migrate/20230131004948_initialize_conversion_of_notes_id_to_bigint.rb16
-rw-r--r--db/migrate/20230131090842_add_global_group_approvers_enabled_to_application_settings.rb11
-rw-r--r--db/migrate/20230131123923_raise_ci_variables_default_limits.rb8
-rw-r--r--db/migrate/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages.rb21
-rw-r--r--db/migrate/20230201012727_initialize_conversion_of_todos_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230202023208_initialize_conversion_of_suggestions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230202153926_add_scan_result_policy_id_to_approval_rules.rb10
-rw-r--r--db/migrate/20230203011359_create_automation_rules.rb28
-rw-r--r--db/migrate/20230203145514_allow_null_pipeline_id_to_dast_pre_scan_verification.rb11
-rw-r--r--db/migrate/20230206143851_create_postgres_async_foreign_key_validations.rb17
-rw-r--r--db/migrate/20230206172702_add_match_on_inclusion_to_scan_result_policy.rb9
-rw-r--r--db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207005549_initialize_conversion_of_snippet_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207011344_initialize_conversion_of_design_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207012217_initialize_conversion_of_vulnerability_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207015819_initialize_conversion_of_commit_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207025259_initialize_conversion_of_merge_request_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207030244_initialize_conversion_of_timelogs_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230208103640_rename_runner_machine_xid.rb13
-rw-r--r--db/migrate/20230210181214_add_allow_deploy_tokens_and_keys_with_external_authn_to_application_settings.rb8
-rw-r--r--db/migrate/20230214142447_remove_text_limit_from_ci_job_artifacts_original_filename.rb17
-rw-r--r--db/migrate/20230214142813_remove_ci_job_artifacts_original_filename.rb16
-rw-r--r--db/post_migrate/20210602164044_schedule_latest_pipeline_id_population.rb13
-rw-r--r--db/post_migrate/20210604070207_retry_backfill_traversal_ids.rb21
-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/20221108045019_truncate_timeline_event_tags_table.rb2
-rw-r--r--db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb24
-rw-r--r--db/post_migrate/20221116134611_add_namespaces_emails_enabled_column_data.rb28
-rw-r--r--db/post_migrate/20221116134633_add_projects_emails_enabled_column_data.rb28
-rw-r--r--db/post_migrate/20230104222438_add_partition_index_to_builds_metadata.rb18
-rw-r--r--db/post_migrate/20230104222514_add_foreign_key_to_builds_metadata.rb18
-rw-r--r--db/post_migrate/20230109100044_cleanup_web_hook_calls_column_rename.rb13
-rw-r--r--db/post_migrate/20230109144915_remove_push_rules_application_settings_push_rule_id_fk.rb21
-rw-r--r--db/post_migrate/20230109144928_remove_users_application_settings_usage_stats_set_by_user_id_fk.rb21
-rw-r--r--db/post_migrate/20230109144941_remove_namespaces_application_settings_instance_administrators_group_id_fk.rb21
-rw-r--r--db/post_migrate/20230109144953_remove_projects_application_settings_file_template_project_id_fk.rb21
-rw-r--r--db/post_migrate/20230109145005_remove_projects_application_settings_instance_administration_project_id_fk.rb21
-rw-r--r--db/post_migrate/20230109145018_remove_namespaces_application_settings_custom_project_templates_group_id_fk.rb21
-rw-r--r--db/post_migrate/20230112051854_add_not_null_constraint_to_o_auth_access_tokens_expires_in.rb17
-rw-r--r--db/post_migrate/20230112141236_schedule_vulnerabilities_feedback_migration2.rb23
-rw-r--r--db/post_migrate/20230112144946_add_tmp_index_to_ci_build_need.rb20
-rw-r--r--db/post_migrate/20230112145326_add_tmp_index_to_ci_pipeline_variable.rb20
-rw-r--r--db/post_migrate/20230116160904_remove_user_details_fields_from_user.rb14
-rw-r--r--db/post_migrate/20230117092947_add_tmp_index_to_ci_build_report_results.rb20
-rw-r--r--db/post_migrate/20230117093222_add_tmp_index_to_ci_builds_on_partition_id.rb19
-rw-r--r--db/post_migrate/20230117093736_add_tmp_index_to_ci_pipelines_on_partition_id.rb19
-rw-r--r--db/post_migrate/20230117093924_add_tmp_index_to_ci_stages_on_partition_id.rb19
-rw-r--r--db/post_migrate/20230117094111_prepare_tmp_index_to_ci_build_trace_metadata.rb20
-rw-r--r--db/post_migrate/20230117094226_prepare_tmp_index_to_ci_job_artifact.rb20
-rw-r--r--db/post_migrate/20230117094316_add_tmp_index_to_ci_job_variable.rb20
-rw-r--r--db/post_migrate/20230117114739_clear_duplicate_jobs_cookies.rb22
-rw-r--r--db/post_migrate/20230118083437_redefine_foreign_key_on_ci_unit_test_failure.rb51
-rw-r--r--db/post_migrate/20230118083632_redefine_foreign_key_on_ci_build_pending_state.rb51
-rw-r--r--db/post_migrate/20230118083748_redefine_foreign_key_on_ci_build_trace_chunk.rb51
-rw-r--r--db/post_migrate/20230119085509_add_index_to_ci_running_build.rb17
-rw-r--r--db/post_migrate/20230119085552_add_foreign_key_to_ci_running_build.rb31
-rw-r--r--db/post_migrate/20230119090944_add_index_to_ci_pending_build.rb17
-rw-r--r--db/post_migrate/20230119091027_add_foreign_key_to_ci_pending_build.rb31
-rw-r--r--db/post_migrate/20230119095022_add_fk_index_to_ci_builds_runner_session_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230119095023_add_fk_to_ci_builds_runner_session_on_partition_id_and_build_id.rb37
-rw-r--r--db/post_migrate/20230119095024_validate_fk_on_ci_builds_runner_session_partition_id_and_build_id.rb15
-rw-r--r--db/post_migrate/20230119095025_remove_fk_to_ci_builds_ci_builds_runner_session_on_build_id.rb35
-rw-r--r--db/post_migrate/20230119123256_add_fk_index_to_ci_resources_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230119123257_add_fk_to_ci_resources_on_partition_id_and_build_id.rb32
-rw-r--r--db/post_migrate/20230119123258_validate_fk_on_ci_resources_partition_id_and_build_id.rb15
-rw-r--r--db/post_migrate/20230119123259_remove_fk_to_ci_builds_ci_resources_on_build_id.rb30
-rw-r--r--db/post_migrate/20230119123908_add_temporary_size_index_to_package_files.rb19
-rw-r--r--db/post_migrate/20230119123937_queue_fix_incoherent_packages_size_on_project_statistics.rb29
-rw-r--r--db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb15
-rw-r--r--db/post_migrate/20230124101832_remove_fk_to_ci_builds_ci_unit_test_failure_on_build_id.rb35
-rw-r--r--db/post_migrate/20230124102131_remove_fk_to_ci_builds_ci_build_pending_state_on_build_id.rb35
-rw-r--r--db/post_migrate/20230124102222_remove_fk_to_ci_builds_ci_build_trace_chunk_on_build_id.rb35
-rw-r--r--db/post_migrate/20230124104310_prepare_web_hook_logs_id_created_at_async_index.rb43
-rw-r--r--db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb30
-rw-r--r--db/post_migrate/20230125093840_rebalance_partition_id_ci_build.rb30
-rw-r--r--db/post_migrate/20230126091522_add_unique_index_to_ci_build_pending_state.rb22
-rw-r--r--db/post_migrate/20230126133531_remove_not_null_constraints_for_tables_with_schema_differences_v3.rb18
-rw-r--r--db/post_migrate/20230127101834_backfill_merge_request_metrics_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb15
-rw-r--r--db/post_migrate/20230127123947_add_fk_index_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb17
-rw-r--r--db/post_migrate/20230127123948_add_fk_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb37
-rw-r--r--db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb17
-rw-r--r--db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb15
-rw-r--r--db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb17
-rw-r--r--db/post_migrate/20230127151606_add_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230127151607_add_fk_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb37
-rw-r--r--db/post_migrate/20230127152727_add_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb17
-rw-r--r--db/post_migrate/20230127152728_add_fk_to_ci_job_artifacts_on_partition_id_and_job_id.rb37
-rw-r--r--db/post_migrate/20230127153229_add_fk_index_to_ci_job_variables_on_partition_id_and_job_id.rb17
-rw-r--r--db/post_migrate/20230127153230_add_fk_to_ci_job_variables_on_partition_id_and_job_id.rb37
-rw-r--r--db/post_migrate/20230130070623_add_index_on_packages_package_file_file_name.rb14
-rw-r--r--db/post_migrate/20230130073109_nullify_creator_id_of_orphaned_projects.rb27
-rw-r--r--db/post_migrate/20230130075434_schedule_tmp_index_to_ci_build_report_results.rb20
-rw-r--r--db/post_migrate/20230130084718_drop_invalid_async_index_from_postgres_async_index.rb21
-rw-r--r--db/post_migrate/20230130102855_add_fk_index_to_ci_build_report_results_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230130102856_add_fk_to_ci_build_report_results_on_partition_id_and_build_id.rb37
-rw-r--r--db/post_migrate/20230130103957_add_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230130103958_add_fk_to_ci_build_needs_on_partition_id_and_build_id.rb37
-rw-r--r--db/post_migrate/20230130202201_backfill_sent_notifications_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230131005411_backfill_notes_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb22
-rw-r--r--db/post_migrate/20230131210921_prepare_index_for_vulnerability_reads_on_project_id_scanner_id_vulnerability_id.rb16
-rw-r--r--db/post_migrate/20230201012846_backfill_todos_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb23
-rw-r--r--db/post_migrate/20230201152525_schedule_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb17
-rw-r--r--db/post_migrate/20230201153450_add_index_on_lfs_objects_file.rb14
-rw-r--r--db/post_migrate/20230201171450_finalize_backfill_environment_tier_migration.rb22
-rw-r--r--db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230202004247_add_index_on_merge_request_diffs_external_diff.rb14
-rw-r--r--db/post_migrate/20230202023224_backfill_suggestions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230202131928_encrypt_ci_trigger_token.rb29
-rw-r--r--db/post_migrate/20230203122602_schedule_vulnerabilities_feedback_migration3.rb24
-rw-r--r--db/post_migrate/20230203122609_change_pipeline_name_index.rb20
-rw-r--r--db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207005701_backfill_snippet_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207011414_backfill_design_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207012238_backfill_vulnerability_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207015850_backfill_commit_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207025315_backfill_merge_request_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207030259_backfill_timelogs_note_id_for_bigint_conversion.rb16
-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/post_migrate/20230208100917_fix_partition_ids_for_ci_pipeline_variable.rb30
-rw-r--r--db/post_migrate/20230208103009_fix_partition_ids_for_ci_job_artifact.rb30
-rw-r--r--db/post_migrate/20230208110638_cleanup_ci_runner_machines_machine_xid_rename.rb13
-rw-r--r--db/post_migrate/20230208132608_fix_partition_ids_for_ci_stage.rb30
-rw-r--r--db/post_migrate/20230209090702_fix_partition_ids_for_ci_build_report_result.rb30
-rw-r--r--db/post_migrate/20230209092204_fix_partition_ids_for_ci_build_trace_metadata.rb30
-rw-r--r--db/post_migrate/20230209103650_add_unique_software_license_policies_index_on_project_and_scan_result_policy.rb18
-rw-r--r--db/post_migrate/20230209103714_add_fk_to_approval_rules_on_scan_result_policy_id.rb23
-rw-r--r--db/post_migrate/20230209123006_remove_unique_software_license_policies_index_on_project.rb15
-rw-r--r--db/post_migrate/20230209131808_recount_epic_cache_counts_v3.rb29
-rw-r--r--db/post_migrate/20230209140102_fix_partition_ids_for_ci_build_metadata.rb30
-rw-r--r--db/post_migrate/20230209171547_schedule_vulnerabilities_feedback_migration4.rb43
-rw-r--r--db/post_migrate/20230210113924_prepare_index_approval_rules_on_scan_result_policy_id.rb17
-rw-r--r--db/post_migrate/20230214122717_fix_partition_ids_for_ci_job_variables.rb23
-rw-r--r--db/post_migrate/20230214154101_fix_partition_ids_on_ci_sources_pipelines.rb36
-rw-r--r--db/post_migrate/20230214174335_prepare_async_index_web_hook_logs.rb39
-rw-r--r--db/post_migrate/20230216035802_prepare_async_foreign_key_validation_for_ci_build_needs.rb15
-rw-r--r--db/post_migrate/20230216052103_prepare_async_foreign_key_validation_for_ci_build_report_results.rb15
-rw-r--r--db/post_migrate/20230216054348_prepare_async_foreign_key_validation_for_ci_job_artifacts.rb15
-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/202106040702071
-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/202211161345071
-rw-r--r--db/schema_migrations/202211161345391
-rw-r--r--db/schema_migrations/202211161346111
-rw-r--r--db/schema_migrations/202211161346331
-rw-r--r--db/schema_migrations/202211281557381
-rw-r--r--db/schema_migrations/202211281658331
-rw-r--r--db/schema_migrations/202212161456591
-rw-r--r--db/schema_migrations/202212191126321
-rw-r--r--db/schema_migrations/202212191223201
-rw-r--r--db/schema_migrations/202212280725491
-rw-r--r--db/schema_migrations/202212280732061
-rw-r--r--db/schema_migrations/202212290649591
-rw-r--r--db/schema_migrations/202301021310001
-rw-r--r--db/schema_migrations/202301021310501
-rw-r--r--db/schema_migrations/202301021311001
-rw-r--r--db/schema_migrations/202301021803411
-rw-r--r--db/schema_migrations/202301042015241
-rw-r--r--db/schema_migrations/202301042224381
-rw-r--r--db/schema_migrations/202301042225141
-rw-r--r--db/schema_migrations/202301060144231
-rw-r--r--db/schema_migrations/202301061848091
-rw-r--r--db/schema_migrations/202301071253281
-rw-r--r--db/schema_migrations/202301090930431
-rw-r--r--db/schema_migrations/202301090956221
-rw-r--r--db/schema_migrations/202301091000441
-rw-r--r--db/schema_migrations/202301091449151
-rw-r--r--db/schema_migrations/202301091449281
-rw-r--r--db/schema_migrations/202301091449411
-rw-r--r--db/schema_migrations/202301091449531
-rw-r--r--db/schema_migrations/202301091450051
-rw-r--r--db/schema_migrations/202301091450181
-rw-r--r--db/schema_migrations/202301092323161
-rw-r--r--db/schema_migrations/202301102129061
-rw-r--r--db/schema_migrations/202301111713551
-rw-r--r--db/schema_migrations/202301111741131
-rw-r--r--db/schema_migrations/202301120518541
-rw-r--r--db/schema_migrations/202301121412361
-rw-r--r--db/schema_migrations/202301121449461
-rw-r--r--db/schema_migrations/202301121453261
-rw-r--r--db/schema_migrations/202301131951411
-rw-r--r--db/schema_migrations/202301161433101
-rw-r--r--db/schema_migrations/202301161433111
-rw-r--r--db/schema_migrations/202301161433121
-rw-r--r--db/schema_migrations/202301161609041
-rw-r--r--db/schema_migrations/202301170929471
-rw-r--r--db/schema_migrations/202301170932221
-rw-r--r--db/schema_migrations/202301170937361
-rw-r--r--db/schema_migrations/202301170939241
-rw-r--r--db/schema_migrations/202301170941111
-rw-r--r--db/schema_migrations/202301170942261
-rw-r--r--db/schema_migrations/202301170943161
-rw-r--r--db/schema_migrations/202301171147391
-rw-r--r--db/schema_migrations/202301171734331
-rw-r--r--db/schema_migrations/202301180834371
-rw-r--r--db/schema_migrations/202301180836321
-rw-r--r--db/schema_migrations/202301180837481
-rw-r--r--db/schema_migrations/202301190855091
-rw-r--r--db/schema_migrations/202301190855521
-rw-r--r--db/schema_migrations/202301190909441
-rw-r--r--db/schema_migrations/202301190910271
-rw-r--r--db/schema_migrations/202301190950221
-rw-r--r--db/schema_migrations/202301190950231
-rw-r--r--db/schema_migrations/202301190950241
-rw-r--r--db/schema_migrations/202301190950251
-rw-r--r--db/schema_migrations/202301191232561
-rw-r--r--db/schema_migrations/202301191232571
-rw-r--r--db/schema_migrations/202301191232581
-rw-r--r--db/schema_migrations/202301191232591
-rw-r--r--db/schema_migrations/202301191239081
-rw-r--r--db/schema_migrations/202301191239371
-rw-r--r--db/schema_migrations/202301191507271
-rw-r--r--db/schema_migrations/202301191516361
-rw-r--r--db/schema_migrations/202301191519401
-rw-r--r--db/schema_migrations/202301192146431
-rw-r--r--db/schema_migrations/202301192154361
-rw-r--r--db/schema_migrations/202301201700421
-rw-r--r--db/schema_migrations/202301201706311
-rw-r--r--db/schema_migrations/202301201718181
-rw-r--r--db/schema_migrations/202301230950221
-rw-r--r--db/schema_migrations/202301230950231
-rw-r--r--db/schema_migrations/202301231200041
-rw-r--r--db/schema_migrations/202301231506481
-rw-r--r--db/schema_migrations/202301241018321
-rw-r--r--db/schema_migrations/202301241021311
-rw-r--r--db/schema_migrations/202301241022221
-rw-r--r--db/schema_migrations/202301241043101
-rw-r--r--db/schema_migrations/202301241221431
-rw-r--r--db/schema_migrations/202301241732551
-rw-r--r--db/schema_migrations/202301241836431
-rw-r--r--db/schema_migrations/202301241939171
-rw-r--r--db/schema_migrations/202301250903151
-rw-r--r--db/schema_migrations/202301250937231
-rw-r--r--db/schema_migrations/202301250938401
-rw-r--r--db/schema_migrations/202301260234441
-rw-r--r--db/schema_migrations/202301260915221
-rw-r--r--db/schema_migrations/202301261104391
-rw-r--r--db/schema_migrations/202301261335311
-rw-r--r--db/schema_migrations/202301261516221
-rw-r--r--db/schema_migrations/202301262104361
-rw-r--r--db/schema_migrations/202301270933531
-rw-r--r--db/schema_migrations/202301271018341
-rw-r--r--db/schema_migrations/202301271156071
-rw-r--r--db/schema_migrations/202301271211071
-rw-r--r--db/schema_migrations/202301271214431
-rw-r--r--db/schema_migrations/202301271239471
-rw-r--r--db/schema_migrations/202301271239481
-rw-r--r--db/schema_migrations/202301271250181
-rw-r--r--db/schema_migrations/202301271318351
-rw-r--r--db/schema_migrations/202301271319151
-rw-r--r--db/schema_migrations/202301271515291
-rw-r--r--db/schema_migrations/202301271515301
-rw-r--r--db/schema_migrations/202301271515311
-rw-r--r--db/schema_migrations/202301271516061
-rw-r--r--db/schema_migrations/202301271516071
-rw-r--r--db/schema_migrations/202301271527271
-rw-r--r--db/schema_migrations/202301271527281
-rw-r--r--db/schema_migrations/202301271532291
-rw-r--r--db/schema_migrations/202301271532301
-rw-r--r--db/schema_migrations/202301271552171
-rw-r--r--db/schema_migrations/202301271640071
-rw-r--r--db/schema_migrations/202301290941401
-rw-r--r--db/schema_migrations/202301291541261
-rw-r--r--db/schema_migrations/202301291542021
-rw-r--r--db/schema_migrations/202301291548191
-rw-r--r--db/schema_migrations/202301300706231
-rw-r--r--db/schema_migrations/202301300731091
-rw-r--r--db/schema_migrations/202301300754341
-rw-r--r--db/schema_migrations/202301300847181
-rw-r--r--db/schema_migrations/202301301028551
-rw-r--r--db/schema_migrations/202301301028561
-rw-r--r--db/schema_migrations/202301301039571
-rw-r--r--db/schema_migrations/202301301039581
-rw-r--r--db/schema_migrations/202301301048191
-rw-r--r--db/schema_migrations/202301301108551
-rw-r--r--db/schema_migrations/202301301255411
-rw-r--r--db/schema_migrations/202301301306241
-rw-r--r--db/schema_migrations/202301301755121
-rw-r--r--db/schema_migrations/202301302022011
-rw-r--r--db/schema_migrations/202301302047431
-rw-r--r--db/schema_migrations/202301310049481
-rw-r--r--db/schema_migrations/202301310054111
-rw-r--r--db/schema_migrations/202301310908421
-rw-r--r--db/schema_migrations/202301311239231
-rw-r--r--db/schema_migrations/202301311258441
-rw-r--r--db/schema_migrations/202301311949591
-rw-r--r--db/schema_migrations/202301312109211
-rw-r--r--db/schema_migrations/202302010127271
-rw-r--r--db/schema_migrations/202302010128461
-rw-r--r--db/schema_migrations/202302010142231
-rw-r--r--db/schema_migrations/202302010142381
-rw-r--r--db/schema_migrations/202302010820381
-rw-r--r--db/schema_migrations/202302011525251
-rw-r--r--db/schema_migrations/202302011534501
-rw-r--r--db/schema_migrations/202302011714501
-rw-r--r--db/schema_migrations/202302020026161
-rw-r--r--db/schema_migrations/202302020026371
-rw-r--r--db/schema_migrations/202302020042471
-rw-r--r--db/schema_migrations/202302020232081
-rw-r--r--db/schema_migrations/202302020232241
-rw-r--r--db/schema_migrations/202302020322481
-rw-r--r--db/schema_migrations/202302020323021
-rw-r--r--db/schema_migrations/202302021319281
-rw-r--r--db/schema_migrations/202302021539261
-rw-r--r--db/schema_migrations/202302030113591
-rw-r--r--db/schema_migrations/202302031226021
-rw-r--r--db/schema_migrations/202302031226091
-rw-r--r--db/schema_migrations/202302031455141
-rw-r--r--db/schema_migrations/202302061438511
-rw-r--r--db/schema_migrations/202302061727021
-rw-r--r--db/schema_migrations/202302070037371
-rw-r--r--db/schema_migrations/202302070038121
-rw-r--r--db/schema_migrations/202302070055491
-rw-r--r--db/schema_migrations/202302070057011
-rw-r--r--db/schema_migrations/202302070113441
-rw-r--r--db/schema_migrations/202302070114141
-rw-r--r--db/schema_migrations/202302070122171
-rw-r--r--db/schema_migrations/202302070122381
-rw-r--r--db/schema_migrations/202302070158191
-rw-r--r--db/schema_migrations/202302070158501
-rw-r--r--db/schema_migrations/202302070252591
-rw-r--r--db/schema_migrations/202302070253151
-rw-r--r--db/schema_migrations/202302070302441
-rw-r--r--db/schema_migrations/202302070302591
-rw-r--r--db/schema_migrations/202302071436021
-rw-r--r--db/schema_migrations/202302071438441
-rw-r--r--db/schema_migrations/202302081009171
-rw-r--r--db/schema_migrations/202302081030091
-rw-r--r--db/schema_migrations/202302081036401
-rw-r--r--db/schema_migrations/202302081106381
-rw-r--r--db/schema_migrations/202302081326081
-rw-r--r--db/schema_migrations/202302090907021
-rw-r--r--db/schema_migrations/202302090922041
-rw-r--r--db/schema_migrations/202302091036501
-rw-r--r--db/schema_migrations/202302091037141
-rw-r--r--db/schema_migrations/202302091230061
-rw-r--r--db/schema_migrations/202302091318081
-rw-r--r--db/schema_migrations/202302091401021
-rw-r--r--db/schema_migrations/202302091715471
-rw-r--r--db/schema_migrations/202302101139241
-rw-r--r--db/schema_migrations/202302101812141
-rw-r--r--db/schema_migrations/202302141227171
-rw-r--r--db/schema_migrations/202302141424471
-rw-r--r--db/schema_migrations/202302141428131
-rw-r--r--db/schema_migrations/202302141541011
-rw-r--r--db/schema_migrations/202302141743351
-rw-r--r--db/schema_migrations/202302160358021
-rw-r--r--db/schema_migrations/202302160521031
-rw-r--r--db/schema_migrations/202302160543481
-rw-r--r--db/structure.sql876
1060 files changed, 8575 insertions, 8246 deletions
diff --git a/db/docs/achievements.yml b/db/docs/achievements.yml
index 04d17defa06..6f471929aea 100644
--- a/db/docs/achievements.yml
+++ b/db/docs/achievements.yml
@@ -3,7 +3,7 @@ table_name: achievements
classes:
- Achievements::Achievement
feature_categories:
-- users
+- user_profile
description: Achievements which can be created by namespaces to award them to users
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105871
milestone: '15.7'
diff --git a/db/docs/airflow_dags.yml b/db/docs/airflow_dags.yml
new file mode 100644
index 00000000000..6ed6c9753a8
--- /dev/null
+++ b/db/docs/airflow_dags.yml
@@ -0,0 +1,10 @@
+---
+table_name: airflow_dags
+classes:
+ - Airflow::Dags
+feature_categories:
+ - dataops
+description: An Airflow DAG is a record of the current status of a DAG from an Airflow instance
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108900
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/analytics_cycle_analytics_project_stages.yml b/db/docs/analytics_cycle_analytics_project_stages.yml
index dc5b1db16cd..4d6baab5a00 100644
--- a/db/docs/analytics_cycle_analytics_project_stages.yml
+++ b/db/docs/analytics_cycle_analytics_project_stages.yml
@@ -1,10 +1,9 @@
---
table_name: analytics_cycle_analytics_project_stages
classes:
-- Analytics::CycleAnalytics::ProjectStage
feature_categories:
- value_stream_management
-description: Persists project level value stream analytics stages.
+description: Persists project level value stream analytics stages. Scheduled for removal in https://gitlab.com/gitlab-org/gitlab/-/issues/390194
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/15061
milestone: '12.2'
gitlab_schema: gitlab_main
diff --git a/db/docs/analytics_cycle_analytics_project_value_streams.yml b/db/docs/analytics_cycle_analytics_project_value_streams.yml
index 5881c048d3b..839b49f1bed 100644
--- a/db/docs/analytics_cycle_analytics_project_value_streams.yml
+++ b/db/docs/analytics_cycle_analytics_project_value_streams.yml
@@ -1,10 +1,9 @@
---
table_name: analytics_cycle_analytics_project_value_streams
classes:
-- Analytics::CycleAnalytics::ProjectValueStream
feature_categories:
- value_stream_management
-description: Used to store the value stream configurations for projects
+description: Used to store the value stream configurations for projects. Scheduled for removal in https://gitlab.com/gitlab-org/gitlab/-/issues/390194
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60925
milestone: '13.12'
gitlab_schema: gitlab_main
diff --git a/db/docs/application_settings.yml b/db/docs/application_settings.yml
index 1015884e8a3..51246fcf91c 100644
--- a/db/docs/application_settings.yml
+++ b/db/docs/application_settings.yml
@@ -11,4 +11,4 @@ feature_categories:
description: GitLab application settings
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/8589b4e137f50293952923bb07e2814257d7784d
milestone: '7.7'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_clusterwide
diff --git a/db/docs/ar_internal_metadata.yml b/db/docs/ar_internal_metadata.yml
index 4e5c0c2d833..34049edf7ba 100644
--- a/db/docs/ar_internal_metadata.yml
+++ b/db/docs/ar_internal_metadata.yml
@@ -1,10 +1,11 @@
---
table_name: ar_internal_metadata
-classes: []
+classes:
+- ActiveRecord::InternalMetadata
feature_categories:
- database
-description: >-
- An internal table used by ActiveRecord to store information about how the database was migrated.
+description: An internal table used by ActiveRecord to store information about how
+ the database was migrated.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685
milestone: '0.8'
gitlab_schema: gitlab_internal
diff --git a/db/docs/automation_rules.yml b/db/docs/automation_rules.yml
new file mode 100644
index 00000000000..fcbbf247f9d
--- /dev/null
+++ b/db/docs/automation_rules.yml
@@ -0,0 +1,10 @@
+---
+table_name: automation_rules
+description: Stores automation rules and their trigger events
+classes:
+- Automation::Rule
+feature_categories:
+- no_code_automation
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111021
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/ci_builds_metadata.yml b/db/docs/ci_builds_metadata.yml
index 71f8a0c5427..028b6dfefab 100644
--- a/db/docs/ci_builds_metadata.yml
+++ b/db/docs/ci_builds_metadata.yml
@@ -1,7 +1,6 @@
---
table_name: ci_builds_metadata
-classes:
-- Ci::BuildMetadata
+classes: []
feature_categories:
- continuous_integration
description: TODO
diff --git a/db/docs/clusters_applications_cert_managers.yml b/db/docs/clusters_applications_cert_managers.yml
index 36bc15e045c..78ef851a2c0 100644
--- a/db/docs/clusters_applications_cert_managers.yml
+++ b/db/docs/clusters_applications_cert_managers.yml
@@ -1,7 +1,5 @@
---
table_name: clusters_applications_cert_managers
-classes:
-- Clusters::Applications::CertManager
feature_categories:
- kubernetes_management
description: "(Deprecated) A GitLab managed cert-manager installation in a Kubernetes cluster"
diff --git a/db/docs/clusters_applications_cilium.yml b/db/docs/clusters_applications_cilium.yml
index b28d674cef0..12e5753f12e 100644
--- a/db/docs/clusters_applications_cilium.yml
+++ b/db/docs/clusters_applications_cilium.yml
@@ -1,7 +1,5 @@
---
table_name: clusters_applications_cilium
-classes:
-- Clusters::Applications::Cilium
feature_categories:
- security_policy_management
description: Information about installed instance of Cilium in the cluster
diff --git a/db/docs/dast_profiles_tags.yml b/db/docs/dast_profiles_tags.yml
new file mode 100644
index 00000000000..b3129d6a82f
--- /dev/null
+++ b/db/docs/dast_profiles_tags.yml
@@ -0,0 +1,10 @@
+---
+table_name: dast_profiles_tags
+classes:
+- Dast::ProfileTag
+feature_categories:
+- dynamic_application_security_testing
+description: Join Table for Runner tags and DAST Profiles
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108371
+milestone: '15.8'
+gitlab_schema: gitlab_main
diff --git a/db/docs/dast_scanner_profiles_tags.yml b/db/docs/dast_scanner_profiles_tags.yml
index 9766ce6c4fc..e423680f862 100644
--- a/db/docs/dast_scanner_profiles_tags.yml
+++ b/db/docs/dast_scanner_profiles_tags.yml
@@ -1,9 +1,8 @@
---
table_name: dast_scanner_profiles_tags
-classes:
- - Dast::ScannerProfileTag
+classes: []
feature_categories:
- - dynamic_application_security_testing
+- dynamic_application_security_testing
description: Join Table for Runner tags and DAST Scanner Profiles
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104909
milestone: '15.7'
diff --git a/db/docs/emails.yml b/db/docs/emails.yml
index 8b107994d7d..0a6dad02aac 100644
--- a/db/docs/emails.yml
+++ b/db/docs/emails.yml
@@ -3,7 +3,7 @@ table_name: emails
classes:
- Email
feature_categories:
-- users
+- user_profile
description: Stores users email records
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/29cfd33d949d21d67f3892473c24d4f0a127dfe6
milestone: '6.6'
diff --git a/db/docs/events.yml b/db/docs/events.yml
index 45e3d49fd94..ab4fb314456 100644
--- a/db/docs/events.yml
+++ b/db/docs/events.yml
@@ -4,7 +4,7 @@ classes:
- Event
- PushEvent
feature_categories:
-- users
+- user_profile
description: Stores user generated events.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/a847501fd2ffc1c4becc7d0d352d80168d9b3568
milestone: "<6.0"
diff --git a/db/docs/ghost_user_migrations.yml b/db/docs/ghost_user_migrations.yml
index 245e6735cd6..9d5c9617917 100644
--- a/db/docs/ghost_user_migrations.yml
+++ b/db/docs/ghost_user_migrations.yml
@@ -3,7 +3,7 @@ table_name: ghost_user_migrations
classes:
- Users::GhostUserMigration
feature_categories:
-- users
+- user_profile
description: Users records awaiting for their associated records to be migrated to ghost user
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95473
milestone: '15.4'
diff --git a/db/docs/jira_connect_installations.yml b/db/docs/jira_connect_installations.yml
index e812fd748d5..e9494c59f29 100644
--- a/db/docs/jira_connect_installations.yml
+++ b/db/docs/jira_connect_installations.yml
@@ -4,7 +4,7 @@ classes:
- JiraConnectInstallation
feature_categories:
- integrations
-description: GitLab.com for Jira Cloud app installation data, formerly Jira Connect App.
+description: GitLab for Jira Cloud app installation data, formerly Jira Connect App.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9593
milestone: '11.9'
gitlab_schema: gitlab_main
diff --git a/db/docs/licenses.yml b/db/docs/licenses.yml
index 0957105695e..6309e7b3a9f 100644
--- a/db/docs/licenses.yml
+++ b/db/docs/licenses.yml
@@ -7,4 +7,4 @@ feature_categories:
description: Used to store information related to the instance's license
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d1f2b09fadcfba210c5121bd214b910b9f9809fd
milestone: '7.11'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_clusterwide
diff --git a/db/docs/namespaces_storage_limit_exclusions.yml b/db/docs/namespaces_storage_limit_exclusions.yml
new file mode 100644
index 00000000000..d66da2797dd
--- /dev/null
+++ b/db/docs/namespaces_storage_limit_exclusions.yml
@@ -0,0 +1,12 @@
+---
+table_name: namespaces_storage_limit_exclusions
+classes:
+ - Namespaces::Storage::LimitExclusion
+feature_categories:
+ - subscription_cost_management
+description: |
+ Stores namespaces that are excluded from the storage limit.
+ Any namespaces that are included in this table will not have storage limitations applied.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108449
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/pm_checkpoints.yml b/db/docs/pm_checkpoints.yml
new file mode 100644
index 00000000000..e360e8ad356
--- /dev/null
+++ b/db/docs/pm_checkpoints.yml
@@ -0,0 +1,10 @@
+---
+table_name: pm_checkpoints
+classes:
+- PackageMetadata::Checkpoint
+feature_categories:
+- license_compliance
+description: Tracks position of last synced file.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109713
+milestone: '15.9'
+gitlab_schema: gitlab_pm
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/docs/project_data_transfers.yml b/db/docs/project_data_transfers.yml
new file mode 100644
index 00000000000..cf06c61cad6
--- /dev/null
+++ b/db/docs/project_data_transfers.yml
@@ -0,0 +1,10 @@
+---
+table_name: project_data_transfers
+classes:
+- Projects::DataTransfer
+feature_categories:
+- source_code_management
+description: Data transfer metrics per project
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107970
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/push_event_payloads.yml b/db/docs/push_event_payloads.yml
index d0f1bdeb060..35d8e657480 100644
--- a/db/docs/push_event_payloads.yml
+++ b/db/docs/push_event_payloads.yml
@@ -3,7 +3,7 @@ table_name: push_event_payloads
classes:
- PushEventPayload
feature_categories:
-- users
+- user_profile
description: Stores log of push events
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12463
milestone: '9.5'
diff --git a/db/docs/routes.yml b/db/docs/routes.yml
index c54f976d91a..4c078bc8558 100644
--- a/db/docs/routes.yml
+++ b/db/docs/routes.yml
@@ -6,7 +6,7 @@ classes:
feature_categories:
- projects
- subgroups
-- users
+- user_profile
description: Stores routes per namespaces and projects
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7121
milestone: '9.0'
diff --git a/db/docs/scan_result_policies.yml b/db/docs/scan_result_policies.yml
new file mode 100644
index 00000000000..6533a133a6e
--- /dev/null
+++ b/db/docs/scan_result_policies.yml
@@ -0,0 +1,10 @@
+---
+table_name: scan_result_policies
+classes:
+- Security::ScanResultPolicyRead
+feature_categories:
+- security_policy_management
+description: Stores rules of a Security Orchestration Policy.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109624
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/user_achievements.yml b/db/docs/user_achievements.yml
index e60631de630..a7a20f77fb4 100644
--- a/db/docs/user_achievements.yml
+++ b/db/docs/user_achievements.yml
@@ -3,7 +3,7 @@ table_name: user_achievements
classes:
- Achievements::UserAchievement
feature_categories:
-- users
+- user_profile
description: Achievements awarded to and revoked from users
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107027
milestone: '15.8'
diff --git a/db/docs/user_custom_attributes.yml b/db/docs/user_custom_attributes.yml
index 992f790cf24..8db43b2777d 100644
--- a/db/docs/user_custom_attributes.yml
+++ b/db/docs/user_custom_attributes.yml
@@ -3,7 +3,7 @@ table_name: user_custom_attributes
classes:
- UserCustomAttribute
feature_categories:
-- users
+- user_profile
description: Storing custom attributes per user
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/13038
milestone: '10.1'
diff --git a/db/docs/user_details.yml b/db/docs/user_details.yml
index 7001c22289d..f633ca8b863 100644
--- a/db/docs/user_details.yml
+++ b/db/docs/user_details.yml
@@ -3,7 +3,7 @@ table_name: user_details
classes:
- UserDetail
feature_categories:
-- users
+- user_profile
description: Stores user details
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25483
milestone: '12.9'
diff --git a/db/docs/user_follow_users.yml b/db/docs/user_follow_users.yml
index 12d64b01a1d..63a7a639a06 100644
--- a/db/docs/user_follow_users.yml
+++ b/db/docs/user_follow_users.yml
@@ -3,7 +3,7 @@ table_name: user_follow_users
classes:
- Users::UserFollowUser
feature_categories:
-- users
+- user_profile
description: Stores which users follow each other
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45451
milestone: '13.9'
diff --git a/db/docs/user_preferences.yml b/db/docs/user_preferences.yml
index 7bc1ab27ccb..3763997fc63 100644
--- a/db/docs/user_preferences.yml
+++ b/db/docs/user_preferences.yml
@@ -3,7 +3,7 @@ table_name: user_preferences
classes:
- UserPreference
feature_categories:
-- users
+- user_profile
description: Stores users' preferences
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7816
milestone: '11.5'
diff --git a/db/docs/user_statuses.yml b/db/docs/user_statuses.yml
index e5f4d4ee72f..b37b3e259d6 100644
--- a/db/docs/user_statuses.yml
+++ b/db/docs/user_statuses.yml
@@ -3,7 +3,7 @@ table_name: user_statuses
classes:
- UserStatus
feature_categories:
-- users
+- user_profile
description: Stores users' statuses
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/20614
milestone: '11.2'
diff --git a/db/docs/users.yml b/db/docs/users.yml
index 324d81850a1..265e1553fa1 100644
--- a/db/docs/users.yml
+++ b/db/docs/users.yml
@@ -5,7 +5,7 @@ classes:
- TmpUser
- User
feature_categories:
-- users
+- user_profile
description: TODO
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685
milestone: "<6.0"
diff --git a/db/docs/wiki_repository_states.yml b/db/docs/wiki_repository_states.yml
new file mode 100644
index 00000000000..7f579b9098e
--- /dev/null
+++ b/db/docs/wiki_repository_states.yml
@@ -0,0 +1,10 @@
+---
+table_name: wiki_repository_states
+classes:
+- Geo::WikiRepositoryState
+feature_categories:
+- geo_replication
+description: Separate table for project wikis containing Geo verification metadata.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109033
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/work_item_types.yml b/db/docs/work_item_types.yml
index 21ec69da152..37d2c47de25 100644
--- a/db/docs/work_item_types.yml
+++ b/db/docs/work_item_types.yml
@@ -1,10 +1,12 @@
---
table_name: work_item_types
classes:
+- AddWidgetsForWorkItemTypes::WorkItemType
- WorkItems::Type
feature_categories:
- team_planning
-description: The work item type related to an issue. Currently one of a predefined set but in future will support custom types.
+description: The work item type related to an issue. Currently one of a predefined
+ set but in future will support custom types.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55705
milestone: '14.2'
gitlab_schema: gitlab_main
diff --git a/db/docs/work_item_widget_definitions.yml b/db/docs/work_item_widget_definitions.yml
new file mode 100644
index 00000000000..59cbca14908
--- /dev/null
+++ b/db/docs/work_item_widget_definitions.yml
@@ -0,0 +1,12 @@
+---
+table_name: work_item_widget_definitions
+classes:
+- AddWidgetsForWorkItemTypes::WidgetDefinition
+- WorkItems::WidgetDefinition
+feature_categories:
+- team_planning
+description: Mapping of widgets for each work item type. Currently one of a predefined
+ set but in future will support custom types.
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107582
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/zoekt_indexed_namespaces.yml b/db/docs/zoekt_indexed_namespaces.yml
new file mode 100644
index 00000000000..1ab748ac154
--- /dev/null
+++ b/db/docs/zoekt_indexed_namespaces.yml
@@ -0,0 +1,10 @@
+---
+table_name: zoekt_indexed_namespaces
+classes:
+- Zoekt::IndexedNamespace
+feature_categories:
+- global_search
+description: Describes a namespace that is configured to use a specific Zoekt shard for code search
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105049
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/docs/zoekt_shards.yml b/db/docs/zoekt_shards.yml
new file mode 100644
index 00000000000..5fe3b469b19
--- /dev/null
+++ b/db/docs/zoekt_shards.yml
@@ -0,0 +1,10 @@
+---
+table_name: zoekt_shards
+classes:
+- Zoekt::Shard
+feature_categories:
+- global_search
+description: Describes a Zoekt server that will be used for indexing and search for some configured namespaces
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105049
+milestone: '15.9'
+gitlab_schema: gitlab_main
diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb
index f2266e49efc..080e985fc5f 100644
--- a/db/fixtures/development/33_triage_ops.rb
+++ b/db/fixtures/development/33_triage_ops.rb
@@ -73,6 +73,8 @@ class Gitlab::Seeder::TriageOps
pipeline:run-single-db
pipeline:skip-undercoverage
pipeline:update-cache
+ documentation
+ Community contribution
LABELS
def seed!
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/main_clusterwide.sql b/db/main_clusterwide.sql
new file mode 120000
index 00000000000..b402facb598
--- /dev/null
+++ b/db/main_clusterwide.sql
@@ -0,0 +1 @@
+structure.sql \ No newline at end of file
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/20220722150231_create_function_gitlab_schema_prevent_write.rb b/db/migrate/20220722150231_create_function_gitlab_schema_prevent_write.rb
index d25923923f2..29c6d9ce87d 100644
--- a/db/migrate/20220722150231_create_function_gitlab_schema_prevent_write.rb
+++ b/db/migrate/20220722150231_create_function_gitlab_schema_prevent_write.rb
@@ -26,7 +26,7 @@ class CreateFunctionGitlabSchemaPreventWrite < Gitlab::Database::Migration[2.0]
return if Gitlab.com?
execute(<<~SQL)
- DROP FUNCTION #{TRIGGER_FUNCTION_NAME}
+ DROP FUNCTION #{TRIGGER_FUNCTION_NAME} CASCADE
SQL
end
end
diff --git a/db/migrate/20221116134507_add_projects_emails_enabled_column.rb b/db/migrate/20221116134507_add_projects_emails_enabled_column.rb
new file mode 100644
index 00000000000..1499ea2752b
--- /dev/null
+++ b/db/migrate/20221116134507_add_projects_emails_enabled_column.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+class AddProjectsEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
+ enable_lock_retries!
+ def change
+ add_column :project_settings, :emails_enabled, :boolean, default: true, null: false
+ end
+end
diff --git a/db/migrate/20221116134539_add_namespaces_emails_enabled_column.rb b/db/migrate/20221116134539_add_namespaces_emails_enabled_column.rb
new file mode 100644
index 00000000000..e979cbb8aa5
--- /dev/null
+++ b/db/migrate/20221116134539_add_namespaces_emails_enabled_column.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+class AddNamespacesEmailsEnabledColumn < Gitlab::Database::Migration[2.0]
+ enable_lock_retries!
+
+ def change
+ add_column :namespace_settings, :emails_enabled, :boolean, default: true, null: false
+ end
+end
diff --git a/db/migrate/20221128155738_add_discord_to_user_details.rb b/db/migrate/20221128155738_add_discord_to_user_details.rb
new file mode 100644
index 00000000000..4d59a53dcd7
--- /dev/null
+++ b/db/migrate/20221128155738_add_discord_to_user_details.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddDiscordToUserDetails < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limits are added in 20221128165833_add_discord_field_limit_to_user_details.rb
+ def change
+ add_column :user_details, :discord, :text, default: '', null: false
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb
new file mode 100644
index 00000000000..a63b2019b20
--- /dev/null
+++ b/db/migrate/20221128165833_add_discord_field_limit_to_user_details.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddDiscordFieldLimitToUserDetails < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ USER_DETAILS_FIELD_LIMIT = 500
+
+ def up
+ add_text_limit :user_details, :discord, USER_DETAILS_FIELD_LIMIT
+ end
+
+ def down
+ remove_text_limit :user_details, :discord
+ end
+end
diff --git a/db/migrate/20221216145659_add_pa_clickhouse_connection_string_to_application_settings.rb b/db/migrate/20221216145659_add_pa_clickhouse_connection_string_to_application_settings.rb
new file mode 100644
index 00000000000..8774ee8b964
--- /dev/null
+++ b/db/migrate/20221216145659_add_pa_clickhouse_connection_string_to_application_settings.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+class AddPaClickhouseConnectionStringToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string, :binary
+ add_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, :binary
+ end
+end
diff --git a/db/migrate/20221219112632_add_next_over_limit_check_at_to_namespace_details.rb b/db/migrate/20221219112632_add_next_over_limit_check_at_to_namespace_details.rb
new file mode 100644
index 00000000000..dd2acbfd0bb
--- /dev/null
+++ b/db/migrate/20221219112632_add_next_over_limit_check_at_to_namespace_details.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddNextOverLimitCheckAtToNamespaceDetails < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ TABLE_NAME = :namespace_details
+ COLUMN = :next_over_limit_check_at
+
+ def up
+ with_lock_retries do
+ add_column TABLE_NAME, COLUMN, :datetime_with_timezone, null: true
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_column TABLE_NAME, COLUMN
+ end
+ end
+end
diff --git a/db/migrate/20221219122320_copy_clickhouse_connection_string_to_encrypted_var.rb b/db/migrate/20221219122320_copy_clickhouse_connection_string_to_encrypted_var.rb
new file mode 100644
index 00000000000..feaa2dab170
--- /dev/null
+++ b/db/migrate/20221219122320_copy_clickhouse_connection_string_to_encrypted_var.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+class CopyClickhouseConnectionStringToEncryptedVar < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ class ApplicationSetting < MigrationRecord
+ self.table_name = 'application_settings'
+
+ attr_encrypted :product_analytics_clickhouse_connection_string, {
+ mode: :per_attribute_iv,
+ key: Settings.attr_encrypted_db_key_base_32,
+ algorithm: 'aes-256-gcm',
+ encode: true
+ }.merge(encode: false, encode_iv: false)
+ end
+
+ def up
+ setting = ApplicationSetting.first
+
+ setting.update!(product_analytics_clickhouse_connection_string: setting.clickhouse_connection_string) if setting
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/migrate/20221228072549_add_pwa_attributes_to_appearances.rb b/db/migrate/20221228072549_add_pwa_attributes_to_appearances.rb
new file mode 100644
index 00000000000..4c800d3305c
--- /dev/null
+++ b/db/migrate/20221228072549_add_pwa_attributes_to_appearances.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddPwaAttributesToAppearances < Gitlab::Database::Migration[2.1]
+ # rubocop:disable Migration/AddLimitToTextColumns
+ def up
+ add_column :appearances, :pwa_name, :text
+ add_column :appearances, :pwa_description, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+
+ def down
+ remove_column :appearances, :pwa_name
+ remove_column :appearances, :pwa_description
+ end
+end
diff --git a/db/migrate/20221228073206_add_text_limit_to_pwa_attributes.rb b/db/migrate/20221228073206_add_text_limit_to_pwa_attributes.rb
new file mode 100644
index 00000000000..0f3bf66dfa8
--- /dev/null
+++ b/db/migrate/20221228073206_add_text_limit_to_pwa_attributes.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddTextLimitToPwaAttributes < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :appearances, :pwa_name, 255
+ add_text_limit :appearances, :pwa_description, 2048
+ end
+
+ def down
+ remove_text_limit :appearances, :pwa_name
+ remove_text_limit :appearances, :pwa_description
+ end
+end
diff --git a/db/migrate/20221229064959_add_links_to_spam_to_abuse_reports.rb b/db/migrate/20221229064959_add_links_to_spam_to_abuse_reports.rb
new file mode 100644
index 00000000000..af4761644c4
--- /dev/null
+++ b/db/migrate/20221229064959_add_links_to_spam_to_abuse_reports.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddLinksToSpamToAbuseReports < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :abuse_reports, :links_to_spam, :text, array: true, null: false, default: []
+ end
+end
diff --git a/db/migrate/20230102131000_add_smtp_credentials_to_service_desk_settings.rb b/db/migrate/20230102131000_add_smtp_credentials_to_service_desk_settings.rb
new file mode 100644
index 00000000000..8d3e3860ceb
--- /dev/null
+++ b/db/migrate/20230102131000_add_smtp_credentials_to_service_desk_settings.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class AddSmtpCredentialsToServiceDeskSettings < Gitlab::Database::Migration[2.1]
+ def up
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20230102131100_add_text_limits_to_smtp_credentials_on_service_desk_settings.rb
+ add_column :service_desk_settings, :custom_email_enabled, :boolean, default: false, null: false
+ # Unique constraint/index is added in 20230102131050_add_unique_constraint_for_custom_email_to_...
+ add_column :service_desk_settings, :custom_email, :text
+ add_column :service_desk_settings, :custom_email_smtp_address, :text
+ add_column :service_desk_settings, :custom_email_smtp_port, :integer
+ add_column :service_desk_settings, :custom_email_smtp_username, :text
+ # Encrypted attribute via attr_encrypted needs these two columns
+ add_column :service_desk_settings, :encrypted_custom_email_smtp_password, :binary
+ add_column :service_desk_settings, :encrypted_custom_email_smtp_password_iv, :binary
+ # rubocop:enable Migration/AddLimitToTextColumns
+ end
+
+ def down
+ remove_column :service_desk_settings, :custom_email_enabled
+ remove_column :service_desk_settings, :custom_email
+ remove_column :service_desk_settings, :custom_email_smtp_address
+ remove_column :service_desk_settings, :custom_email_smtp_port
+ remove_column :service_desk_settings, :custom_email_smtp_username
+ remove_column :service_desk_settings, :encrypted_custom_email_smtp_password
+ remove_column :service_desk_settings, :encrypted_custom_email_smtp_password_iv
+ end
+end
diff --git a/db/migrate/20230102131050_add_unique_constraint_for_custom_email_to_service_desk_settings.rb b/db/migrate/20230102131050_add_unique_constraint_for_custom_email_to_service_desk_settings.rb
new file mode 100644
index 00000000000..cfee56ececd
--- /dev/null
+++ b/db/migrate/20230102131050_add_unique_constraint_for_custom_email_to_service_desk_settings.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddUniqueConstraintForCustomEmailToServiceDeskSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'custom_email_unique_constraint'
+
+ def up
+ # Force custom_email to be unique instance-wide. This is neccessary because we will match
+ # incoming service desk emails with a custom email by the custom_email field.
+ # This also adds the corresponding index
+ add_concurrent_index(:service_desk_settings, :custom_email, unique: true, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(:service_desk_settings, INDEX_NAME)
+ end
+end
diff --git a/db/migrate/20230102131100_add_text_limits_to_smtp_credentials_on_service_desk_settings.rb b/db/migrate/20230102131100_add_text_limits_to_smtp_credentials_on_service_desk_settings.rb
new file mode 100644
index 00000000000..60c96bd6bdb
--- /dev/null
+++ b/db/migrate/20230102131100_add_text_limits_to_smtp_credentials_on_service_desk_settings.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTextLimitsToSmtpCredentialsOnServiceDeskSettings < Gitlab::Database::Migration[2.1]
+ MAXIMUM_LIMIT = 255
+
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :service_desk_settings, :custom_email, MAXIMUM_LIMIT
+ add_text_limit :service_desk_settings, :custom_email_smtp_address, MAXIMUM_LIMIT
+ add_text_limit :service_desk_settings, :custom_email_smtp_username, MAXIMUM_LIMIT
+ end
+
+ def down
+ remove_text_limit :service_desk_settings, :custom_email
+ remove_text_limit :service_desk_settings, :custom_email_smtp_address
+ remove_text_limit :service_desk_settings, :custom_email_smtp_username
+ end
+end
diff --git a/db/migrate/20230102180341_add_merge_request_meta_to_merge_requests_compliance_violations.rb b/db/migrate/20230102180341_add_merge_request_meta_to_merge_requests_compliance_violations.rb
new file mode 100644
index 00000000000..84e1994e91c
--- /dev/null
+++ b/db/migrate/20230102180341_add_merge_request_meta_to_merge_requests_compliance_violations.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class AddMergeRequestMetaToMergeRequestsComplianceViolations < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :merge_requests_compliance_violations, :merged_at, :datetime_with_timezone
+ add_column :merge_requests_compliance_violations, :target_project_id, :integer
+ add_column :merge_requests_compliance_violations, :title, :text # rubocop:disable Migration/AddLimitToTextColumns
+ add_column :merge_requests_compliance_violations, :target_branch, :text # rubocop:disable Migration/AddLimitToTextColumns
+ end
+end
diff --git a/db/migrate/20230104201524_add_zoekt_shards_and_indexed_namespaces.rb b/db/migrate/20230104201524_add_zoekt_shards_and_indexed_namespaces.rb
new file mode 100644
index 00000000000..c9d7bc51041
--- /dev/null
+++ b/db/migrate/20230104201524_add_zoekt_shards_and_indexed_namespaces.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddZoektShardsAndIndexedNamespaces < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ create_table :zoekt_shards do |t|
+ t.text :index_base_url, limit: 1024, index: { unique: true }, null: false
+ t.text :search_base_url, limit: 1024, index: { unique: true }, null: false
+ t.timestamps_with_timezone
+ end
+
+ create_table :zoekt_indexed_namespaces do |t|
+ t.references :zoekt_shard, null: false, index: false, foreign_key: { on_delete: :cascade }
+ t.bigint :namespace_id, null: false, index: true
+ t.timestamps_with_timezone
+ t.index [:zoekt_shard_id, :namespace_id], unique: true, name: 'index_zoekt_shard_and_namespace'
+ end
+ end
+end
diff --git a/db/migrate/20230106014423_add_constraint_to_links_to_spam.rb b/db/migrate/20230106014423_add_constraint_to_links_to_spam.rb
new file mode 100644
index 00000000000..b3d7ff3755a
--- /dev/null
+++ b/db/migrate/20230106014423_add_constraint_to_links_to_spam.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddConstraintToLinksToSpam < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ CONSTRAINT_NAME = "abuse_reports_links_to_spam_length_check"
+
+ def up
+ add_check_constraint :abuse_reports, "CARDINALITY(links_to_spam) <= 20", CONSTRAINT_NAME
+ end
+
+ def down
+ remove_check_constraint :abuse_reports, CONSTRAINT_NAME
+ end
+end
diff --git a/db/migrate/20230106184809_create_dast_profiles_tags.rb b/db/migrate/20230106184809_create_dast_profiles_tags.rb
new file mode 100644
index 00000000000..f31eaea5fa8
--- /dev/null
+++ b/db/migrate/20230106184809_create_dast_profiles_tags.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateDastProfilesTags < Gitlab::Database::Migration[2.1]
+ def up
+ create_table :dast_profiles_tags do |t|
+ t.references :dast_profile, null: false, foreign_key: { on_delete: :cascade },
+ index: { name: 'i_dast_profiles_tags_on_scanner_profiles_id' }
+
+ t.bigint :tag_id, null: false
+
+ t.index :tag_id, name: :index_dast_profiles_tags_on_tag_id
+ end
+ end
+
+ def down
+ drop_table :dast_profiles_tags
+ end
+end
diff --git a/db/migrate/20230107125328_add_zoekt_indexed_namespaces_foreign_key.rb b/db/migrate/20230107125328_add_zoekt_indexed_namespaces_foreign_key.rb
new file mode 100644
index 00000000000..db995d6603e
--- /dev/null
+++ b/db/migrate/20230107125328_add_zoekt_indexed_namespaces_foreign_key.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddZoektIndexedNamespacesForeignKey < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :zoekt_indexed_namespaces, :namespaces, column: :namespace_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :zoekt_indexed_namespaces, column: :namespace_id
+ end
+ end
+end
diff --git a/db/migrate/20230109093043_create_namespaces_storage_limit_exclusions.rb b/db/migrate/20230109093043_create_namespaces_storage_limit_exclusions.rb
new file mode 100644
index 00000000000..06168587fb5
--- /dev/null
+++ b/db/migrate/20230109093043_create_namespaces_storage_limit_exclusions.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class CreateNamespacesStorageLimitExclusions < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ create_table :namespaces_storage_limit_exclusions do |t|
+ t.references :namespace,
+ foreign_key: { on_delete: :cascade },
+ index: true,
+ null: false
+ t.text :reason, null: false, limit: 255
+ t.timestamps_with_timezone null: false
+ end
+ end
+
+ def down
+ drop_table :namespaces_storage_limit_exclusions
+ end
+end
diff --git a/db/migrate/20230109095622_rename_web_hook_calls_to_web_hook_calls_high.rb b/db/migrate/20230109095622_rename_web_hook_calls_to_web_hook_calls_high.rb
new file mode 100644
index 00000000000..d3a461b3abb
--- /dev/null
+++ b/db/migrate/20230109095622_rename_web_hook_calls_to_web_hook_calls_high.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class RenameWebHookCallsToWebHookCallsHigh < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :plan_limits, :web_hook_calls, :web_hook_calls_high
+ end
+
+ def down
+ undo_rename_column_concurrently :plan_limits, :web_hook_calls, :web_hook_calls_high
+ end
+end
diff --git a/db/migrate/20230109232316_create_wiki_repository_states.rb b/db/migrate/20230109232316_create_wiki_repository_states.rb
new file mode 100644
index 00000000000..61afc18c0f6
--- /dev/null
+++ b/db/migrate/20230109232316_create_wiki_repository_states.rb
@@ -0,0 +1,44 @@
+# frozen_string_literal: true
+
+class CreateWikiRepositoryStates < Gitlab::Database::Migration[2.0]
+ VERIFICATION_STATE_INDEX_NAME = "index_wiki_repository_states_on_verification_state"
+ PENDING_VERIFICATION_INDEX_NAME = "index_wiki_repository_states_pending_verification"
+ FAILED_VERIFICATION_INDEX_NAME = "index_wiki_repository_states_failed_verification"
+ NEEDS_VERIFICATION_INDEX_NAME = "index_wiki_repository_states_needs_verification"
+
+ enable_lock_retries!
+
+ def up
+ create_table :wiki_repository_states do |t|
+ t.datetime_with_timezone :verification_started_at
+ t.datetime_with_timezone :verification_retry_at
+ t.datetime_with_timezone :verified_at
+ t.references :project_wiki_repository, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade }
+ t.integer :verification_state, default: 0, limit: 2, null: false
+ t.integer :verification_retry_count, limit: 2
+ t.binary :verification_checksum, using: 'verification_checksum::bytea'
+ t.text :verification_failure, limit: 255
+
+ t.index :verification_state,
+ name: VERIFICATION_STATE_INDEX_NAME
+
+ t.index :verified_at,
+ where: "(verification_state = 0)",
+ order: { verified_at: 'ASC NULLS FIRST' },
+ name: PENDING_VERIFICATION_INDEX_NAME
+
+ t.index :verification_retry_at,
+ where: "(verification_state = 3)",
+ order: { verification_retry_at: 'ASC NULLS FIRST' },
+ name: FAILED_VERIFICATION_INDEX_NAME
+
+ t.index :verification_state,
+ where: "(verification_state = 0 OR verification_state = 3)",
+ name: NEEDS_VERIFICATION_INDEX_NAME
+ end
+ end
+
+ def down
+ drop_table :wiki_repository_states
+ end
+end
diff --git a/db/migrate/20230110212906_add_on_update_action_to_postgres_foreign_keys.rb b/db/migrate/20230110212906_add_on_update_action_to_postgres_foreign_keys.rb
new file mode 100644
index 00000000000..6cc3aeed56f
--- /dev/null
+++ b/db/migrate/20230110212906_add_on_update_action_to_postgres_foreign_keys.rb
@@ -0,0 +1,73 @@
+# frozen_string_literal: true
+
+class AddOnUpdateActionToPostgresForeignKeys < Gitlab::Database::Migration[2.1]
+ def up
+ execute(<<~SQL)
+ -- adding the on_update_action before is_inherited requires recreating the view
+ DROP VIEW IF EXISTS postgres_foreign_keys;
+ 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,
+ constrained_table.relname::text AS constrained_table_name,
+ referenced_table.relname::text AS referenced_table_name,
+ constrained_cols.constrained_columns,
+ referenced_cols.referenced_columns,
+ pg_constraint.confdeltype AS on_delete_action,
+ pg_constraint.confupdtype as on_update_action,
+ pg_constraint.coninhcount > 0 as is_inherited
+ 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
+ CROSS JOIN LATERAL (
+ SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array
+ FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)
+ INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid
+ ) constrained_cols(constrained_columns)
+ CROSS JOIN LATERAL (
+ SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)
+ FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)
+ INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid
+ ) referenced_cols(referenced_columns)
+ WHERE contype = 'f';
+ SQL
+ end
+
+ def down
+ execute(<<~SQL)
+ DROP VIEW IF EXISTS postgres_foreign_keys;
+ 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,
+ constrained_table.relname::text AS constrained_table_name,
+ referenced_table.relname::text AS referenced_table_name,
+ constrained_cols.constrained_columns,
+ referenced_cols.referenced_columns,
+ pg_constraint.confdeltype AS on_delete_action,
+ pg_constraint.coninhcount > 0 as is_inherited
+ 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
+ CROSS JOIN LATERAL (
+ SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array
+ FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx)
+ INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid
+ ) constrained_cols(constrained_columns)
+ CROSS JOIN LATERAL (
+ SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx)
+ FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx)
+ INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid
+ ) referenced_cols(referenced_columns)
+ WHERE contype = 'f';
+ SQL
+ end
+end
diff --git a/db/migrate/20230111171355_add_allow_possible_spam_to_application_settings.rb b/db/migrate/20230111171355_add_allow_possible_spam_to_application_settings.rb
new file mode 100644
index 00000000000..0b6b20e6129
--- /dev/null
+++ b/db/migrate/20230111171355_add_allow_possible_spam_to_application_settings.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddAllowPossibleSpamToApplicationSettings < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :application_settings, :allow_possible_spam, :boolean, default: false, null: false
+ end
+end
diff --git a/db/migrate/20230111174113_create_airflow_dags.rb b/db/migrate/20230111174113_create_airflow_dags.rb
new file mode 100644
index 00000000000..798acadd790
--- /dev/null
+++ b/db/migrate/20230111174113_create_airflow_dags.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateAirflowDags < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+ def change
+ create_table :airflow_dags do |t|
+ t.references :project, index: true, foreign_key: { on_delete: :cascade }, null: false
+ t.timestamps_with_timezone null: false
+ t.datetime_with_timezone :next_run
+ t.boolean :has_import_errors
+ t.boolean :is_active
+ t.boolean :is_paused
+ t.text :dag_name, null: false, limit: 255
+ t.text :schedule, limit: 255
+ t.text :fileloc, limit: 255
+ end
+ end
+end
diff --git a/db/migrate/20230113195141_package_metadata_set_default_not_null.rb b/db/migrate/20230113195141_package_metadata_set_default_not_null.rb
new file mode 100644
index 00000000000..92aed8a5706
--- /dev/null
+++ b/db/migrate/20230113195141_package_metadata_set_default_not_null.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class PackageMetadataSetDefaultNotNull < Gitlab::Database::Migration[2.1]
+ def change
+ change_column_null(:pm_package_versions, :pm_package_id, false)
+ end
+end
diff --git a/db/migrate/20230116143310_add_pages_unique_domain_columns_to_project_settings.rb b/db/migrate/20230116143310_add_pages_unique_domain_columns_to_project_settings.rb
new file mode 100644
index 00000000000..53c4f429243
--- /dev/null
+++ b/db/migrate/20230116143310_add_pages_unique_domain_columns_to_project_settings.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddPagesUniqueDomainColumnsToProjectSettings < Gitlab::Database::Migration[2.1]
+ def up
+ add_column :project_settings, :pages_unique_domain_enabled, :boolean, default: false, null: false
+ add_column :project_settings, :pages_unique_domain, :text # rubocop: disable Migration/AddLimitToTextColumns
+ end
+
+ def down
+ remove_column :project_settings, :pages_unique_domain_enabled, :boolean
+ remove_column :project_settings, :pages_unique_domain, :text
+ end
+end
diff --git a/db/migrate/20230116143311_add_project_settings_pages_unique_domain_limit.rb b/db/migrate/20230116143311_add_project_settings_pages_unique_domain_limit.rb
new file mode 100644
index 00000000000..53c2a344a2c
--- /dev/null
+++ b/db/migrate/20230116143311_add_project_settings_pages_unique_domain_limit.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddProjectSettingsPagesUniqueDomainLimit < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :project_settings, :pages_unique_domain, 63
+ end
+
+ def down
+ remove_text_limit :project_settings, :pages_unique_domain
+ end
+end
diff --git a/db/migrate/20230116143312_add_project_settings_pages_unique_domain_unique_index.rb b/db/migrate/20230116143312_add_project_settings_pages_unique_domain_unique_index.rb
new file mode 100644
index 00000000000..3e6fea00ed2
--- /dev/null
+++ b/db/migrate/20230116143312_add_project_settings_pages_unique_domain_unique_index.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddProjectSettingsPagesUniqueDomainUniqueIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :project_settings,
+ :pages_unique_domain,
+ unique: true,
+ where: 'pages_unique_domain IS NOT NULL',
+ name: 'unique_index_for_project_pages_unique_domain'
+ end
+
+ def down
+ remove_concurrent_index :project_settings,
+ :pages_unique_domain,
+ unique: true,
+ name: 'unique_index_for_project_pages_unique_domain'
+ end
+end
diff --git a/db/migrate/20230117173433_create_project_data_transfer.rb b/db/migrate/20230117173433_create_project_data_transfer.rb
new file mode 100644
index 00000000000..f63191c991b
--- /dev/null
+++ b/db/migrate/20230117173433_create_project_data_transfer.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+class CreateProjectDataTransfer < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ create_table :project_data_transfers do |t|
+ t.references :project, index: false, null: false
+ t.references :namespace, index: true, null: false
+ t.bigint :repository_egress, null: false, default: 0
+ t.bigint :artifacts_egress, null: false, default: 0
+ t.bigint :packages_egress, null: false, default: 0
+ t.bigint :registry_egress, null: false, default: 0
+ t.date :date, null: false
+ t.datetime_with_timezone :created_at, null: false
+
+ t.index [:project_id, :namespace_id, :date], unique: true,
+ name: 'index_project_data_transfers_on_project_and_namespace_and_date'
+ end
+ end
+
+ add_check_constraint :project_data_transfers,
+ "(date = date_trunc('month', date))", 'project_data_transfers_project_year_month_constraint'
+ end
+
+ def down
+ with_lock_retries do
+ drop_table :project_data_transfers
+ end
+ end
+end
diff --git a/db/migrate/20230119150727_add_search_curation_settings_to_application_settings.rb b/db/migrate/20230119150727_add_search_curation_settings_to_application_settings.rb
new file mode 100644
index 00000000000..f2ae4f49b9d
--- /dev/null
+++ b/db/migrate/20230119150727_add_search_curation_settings_to_application_settings.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddSearchCurationSettingsToApplicationSettings < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_column :application_settings, :search_max_shard_size_gb, :integer, default: 50, null: false
+ add_column :application_settings, :search_max_docs_denominator, :integer, default: 5_000_000, null: false
+ add_column :application_settings, :search_min_docs_before_rollover, :integer, default: 100_000, null: false
+ end
+
+ def down
+ remove_column :application_settings, :search_max_shard_size_gb
+ remove_column :application_settings, :search_max_docs_denominator
+ remove_column :application_settings, :search_min_docs_before_rollover
+ end
+end
diff --git a/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb b/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb
new file mode 100644
index 00000000000..e330ecfdae8
--- /dev/null
+++ b/db/migrate/20230119151636_add_url_hash_to_web_hook_logs.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddUrlHashToWebHookLogs < Gitlab::Database::Migration[2.1]
+ def change
+ # limit is added in 20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb
+ add_column :web_hook_logs, :url_hash, :text # rubocop:disable Migration/AddLimitToTextColumns
+ end
+end
diff --git a/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb b/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb
new file mode 100644
index 00000000000..28e719b0a0f
--- /dev/null
+++ b/db/migrate/20230119151940_add_text_limit_to_web_hook_logs_url_hash.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddTextLimitToWebHookLogsUrlHash < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :web_hook_logs, :url_hash, 44, validate: false
+ end
+
+ def down
+ remove_text_limit :web_hook_logs, :url_hash
+ end
+end
diff --git a/db/migrate/20230119214643_add_deactivation_email_additional_text_to_application_settings.rb b/db/migrate/20230119214643_add_deactivation_email_additional_text_to_application_settings.rb
new file mode 100644
index 00000000000..e2b3e12c0ef
--- /dev/null
+++ b/db/migrate/20230119214643_add_deactivation_email_additional_text_to_application_settings.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class AddDeactivationEmailAdditionalTextToApplicationSettings < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ # rubocop:disable Migration/AddLimitToTextColumns
+ # limit is added in 20230123150648_add_deactivation_email_additional_text_to_application_settings_text_limits.rb
+ def change
+ add_column :application_settings, :deactivation_email_additional_text, :text
+ end
+ # rubocop:enable Migration/AddLimitToTextColumns
+end
diff --git a/db/migrate/20230119215436_add_package_metadata_checkpoints.rb b/db/migrate/20230119215436_add_package_metadata_checkpoints.rb
new file mode 100644
index 00000000000..a8349a107b1
--- /dev/null
+++ b/db/migrate/20230119215436_add_package_metadata_checkpoints.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddPackageMetadataCheckpoints < Gitlab::Database::Migration[2.1]
+ def up
+ create_table :pm_checkpoints, id: false do |t|
+ t.integer :sequence, null: false
+ t.timestamps_with_timezone
+ t.integer :purl_type, null: false, primary_key: true
+ t.integer :chunk, null: false, limit: 2
+ end
+
+ change_column(:pm_checkpoints, :purl_type, :integer, limit: 2)
+ drop_sequence(:pm_checkpoints, :purl_type, 'pm_checkpoints_purl_type_seq')
+ end
+
+ def down
+ drop_table :pm_checkpoints
+ end
+end
diff --git a/db/migrate/20230120170042_re_add_web_hook_calls_column.rb b/db/migrate/20230120170042_re_add_web_hook_calls_column.rb
new file mode 100644
index 00000000000..1096c073f37
--- /dev/null
+++ b/db/migrate/20230120170042_re_add_web_hook_calls_column.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class ReAddWebHookCallsColumn < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :plan_limits, :web_hook_calls, :integer, default: 0, null: false, if_not_exists: true
+ end
+end
diff --git a/db/migrate/20230120170631_drop_sync_triggers_from_web_hook_calls_plan_limits.rb b/db/migrate/20230120170631_drop_sync_triggers_from_web_hook_calls_plan_limits.rb
new file mode 100644
index 00000000000..74c642437b9
--- /dev/null
+++ b/db/migrate/20230120170631_drop_sync_triggers_from_web_hook_calls_plan_limits.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class DropSyncTriggersFromWebHookCallsPlanLimits < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ drop_trigger('trigger_c0776354152a', 'plan_limits')
+ drop_trigger('trigger_d0c336b01d00', 'plan_limits')
+ drop_trigger('trigger_e19c4cf656dc', 'plan_limits')
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/migrate/20230120171818_sync_plan_limits_web_hook_calls_columns.rb b/db/migrate/20230120171818_sync_plan_limits_web_hook_calls_columns.rb
new file mode 100644
index 00000000000..28c29f8731a
--- /dev/null
+++ b/db/migrate/20230120171818_sync_plan_limits_web_hook_calls_columns.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class SyncPlanLimitsWebHookCallsColumns < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ execute('UPDATE plan_limits SET web_hook_calls=web_hook_calls_high')
+ end
+
+ def down
+ # noop
+ end
+end
diff --git a/db/migrate/20230123095022_create_scan_result_policies.rb b/db/migrate/20230123095022_create_scan_result_policies.rb
new file mode 100644
index 00000000000..6f9eb7d0511
--- /dev/null
+++ b/db/migrate/20230123095022_create_scan_result_policies.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateScanResultPolicies < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = "index_scan_result_policies_on_policy_configuration_id"
+
+ def change
+ create_table :scan_result_policies do |t|
+ t.references :security_orchestration_policy_configuration,
+ null: false,
+ foreign_key: { on_delete: :cascade },
+ index: { name: INDEX_NAME }
+
+ t.timestamps_with_timezone null: false
+ t.integer :orchestration_policy_idx, limit: 2, null: false
+ t.text :license_states, array: true, default: []
+ end
+ end
+end
diff --git a/db/migrate/20230123120004_add_datetime_fields_to_bulk_import_trackers.rb b/db/migrate/20230123120004_add_datetime_fields_to_bulk_import_trackers.rb
new file mode 100644
index 00000000000..a35fd382b34
--- /dev/null
+++ b/db/migrate/20230123120004_add_datetime_fields_to_bulk_import_trackers.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddDatetimeFieldsToBulkImportTrackers < Gitlab::Database::Migration[2.1]
+ def up
+ add_column :bulk_import_trackers, :created_at, :datetime_with_timezone, null: true
+ add_column :bulk_import_trackers, :updated_at, :datetime_with_timezone, null: true
+ end
+
+ def down
+ remove_column :bulk_import_trackers, :created_at
+ remove_column :bulk_import_trackers, :updated_at
+ end
+end
diff --git a/db/migrate/20230123150648_add_deactivation_email_additional_text_to_application_settings_text_limits.rb b/db/migrate/20230123150648_add_deactivation_email_additional_text_to_application_settings_text_limits.rb
new file mode 100644
index 00000000000..ae3d3a516e3
--- /dev/null
+++ b/db/migrate/20230123150648_add_deactivation_email_additional_text_to_application_settings_text_limits.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddDeactivationEmailAdditionalTextToApplicationSettingsTextLimits < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_text_limit :application_settings, :deactivation_email_additional_text, 1000
+ end
+
+ def down
+ remove_text_limit :application_settings, :deactivation_email_additional_text
+ end
+end
diff --git a/db/migrate/20230124122143_add_deploy_key_id_to_create_access_levels.rb b/db/migrate/20230124122143_add_deploy_key_id_to_create_access_levels.rb
new file mode 100644
index 00000000000..d26cf2a1e5f
--- /dev/null
+++ b/db/migrate/20230124122143_add_deploy_key_id_to_create_access_levels.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddDeployKeyIdToCreateAccessLevels < Gitlab::Database::Migration[2.1]
+ def up
+ add_column :protected_tag_create_access_levels, :deploy_key_id, :integer
+ end
+
+ def down
+ remove_column :protected_tag_create_access_levels, :deploy_key_id
+ end
+end
diff --git a/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb
new file mode 100644
index 00000000000..7a5f05c977c
--- /dev/null
+++ b/db/migrate/20230124173255_raise_group_and_project_ci_variable_limits.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RaiseGroupAndProjectCiVariableLimits < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ create_or_update_plan_limit('project_ci_variables', 'default', 8000)
+ create_or_update_plan_limit('group_ci_variables', 'default', 30000)
+ end
+
+ def down
+ create_or_update_plan_limit('project_ci_variables', 'default', 200)
+ create_or_update_plan_limit('group_ci_variables', 'default', 200)
+ end
+end
diff --git a/db/migrate/20230124183643_add_checksums_column_to_project_mirror_data.rb b/db/migrate/20230124183643_add_checksums_column_to_project_mirror_data.rb
new file mode 100644
index 00000000000..a4c13b4308f
--- /dev/null
+++ b/db/migrate/20230124183643_add_checksums_column_to_project_mirror_data.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddChecksumsColumnToProjectMirrorData < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :project_mirror_data, :checksums, :jsonb, null: false, default: {}
+ end
+end
diff --git a/db/migrate/20230124193917_add_index_for_protected_tag_create_access_levels.rb b/db/migrate/20230124193917_add_index_for_protected_tag_create_access_levels.rb
new file mode 100644
index 00000000000..7068f4f0447
--- /dev/null
+++ b/db/migrate/20230124193917_add_index_for_protected_tag_create_access_levels.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddIndexForProtectedTagCreateAccessLevels < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ DEPLOY_KEY_INDEX_NAME = 'index_protected_tag_create_access_levels_on_deploy_key_id'
+
+ def up
+ add_concurrent_foreign_key :protected_tag_create_access_levels, :keys, column: :deploy_key_id, on_delete: :cascade
+ add_concurrent_index :protected_tag_create_access_levels, :deploy_key_id,
+ name: DEPLOY_KEY_INDEX_NAME
+ end
+
+ def down
+ remove_foreign_key_if_exists :protected_tag_create_access_levels, column: :deploy_key_id
+ remove_concurrent_index_by_name :protected_tag_create_access_levels, name: DEPLOY_KEY_INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230125090315_add_prepared_at_to_merge_request.rb b/db/migrate/20230125090315_add_prepared_at_to_merge_request.rb
new file mode 100644
index 00000000000..4e4b4ccf671
--- /dev/null
+++ b/db/migrate/20230125090315_add_prepared_at_to_merge_request.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddPreparedAtToMergeRequest < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ add_column :merge_requests, 'prepared_at', :datetime_with_timezone
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :merge_requests, 'prepared_at'
+ end
+ end
+end
diff --git a/db/migrate/20230126023444_add_timestamps_to_package_metadata_tables.rb b/db/migrate/20230126023444_add_timestamps_to_package_metadata_tables.rb
new file mode 100644
index 00000000000..ccf239ac273
--- /dev/null
+++ b/db/migrate/20230126023444_add_timestamps_to_package_metadata_tables.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddTimestampsToPackageMetadataTables < Gitlab::Database::Migration[2.1]
+ def up
+ add_timestamps_with_timezone(:pm_packages, null: false, default: -> { 'NOW()' })
+ add_timestamps_with_timezone(:pm_package_versions, null: false, default: -> { 'NOW()' })
+ add_timestamps_with_timezone(:pm_licenses, null: false, default: -> { 'NOW()' })
+ add_timestamps_with_timezone(:pm_package_version_licenses, null: false, default: -> { 'NOW()' })
+ end
+
+ def down
+ remove_timestamps(:pm_packages)
+ remove_timestamps(:pm_package_versions)
+ remove_timestamps(:pm_licenses)
+ remove_timestamps(:pm_package_version_licenses)
+ end
+end
diff --git a/db/migrate/20230126110439_change_default_value_for_inbound_job_token_scope_enabled.rb b/db/migrate/20230126110439_change_default_value_for_inbound_job_token_scope_enabled.rb
new file mode 100644
index 00000000000..9b9de65d423
--- /dev/null
+++ b/db/migrate/20230126110439_change_default_value_for_inbound_job_token_scope_enabled.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class ChangeDefaultValueForInboundJobTokenScopeEnabled < Gitlab::Database::Migration[2.1]
+ def up
+ change_column_default :project_ci_cd_settings, :inbound_job_token_scope_enabled, from: false, to: true
+ end
+
+ def down
+ change_column_default :project_ci_cd_settings, :inbound_job_token_scope_enabled, from: true, to: false
+ end
+end
diff --git a/db/migrate/20230126151622_add_ci_triggers_encrypted_token.rb b/db/migrate/20230126151622_add_ci_triggers_encrypted_token.rb
new file mode 100644
index 00000000000..8f394d24d6a
--- /dev/null
+++ b/db/migrate/20230126151622_add_ci_triggers_encrypted_token.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddCiTriggersEncryptedToken < Gitlab::Database::Migration[2.1]
+ def up
+ add_column :ci_triggers, :encrypted_token, :binary
+ add_column :ci_triggers, :encrypted_token_iv, :binary
+ end
+
+ def down
+ remove_column :ci_triggers, :encrypted_token
+ remove_column :ci_triggers, :encrypted_token_iv
+ end
+end
diff --git a/db/migrate/20230126210436_add_jira_connect_public_key_storage_enabled_setting.rb b/db/migrate/20230126210436_add_jira_connect_public_key_storage_enabled_setting.rb
new file mode 100644
index 00000000000..1d8ac03f9df
--- /dev/null
+++ b/db/migrate/20230126210436_add_jira_connect_public_key_storage_enabled_setting.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class AddJiraConnectPublicKeyStorageEnabledSetting < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :jira_connect_public_key_storage_enabled, :boolean, default: false, null: false
+ end
+end
diff --git a/db/migrate/20230127093353_initialize_conversion_of_merge_request_metrics_to_bigint.rb b/db/migrate/20230127093353_initialize_conversion_of_merge_request_metrics_to_bigint.rb
new file mode 100644
index 00000000000..dfca67a2e2f
--- /dev/null
+++ b/db/migrate/20230127093353_initialize_conversion_of_merge_request_metrics_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfMergeRequestMetricsToBigint < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ TABLE = :merge_request_metrics
+ 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/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb b/db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb
new file mode 100644
index 00000000000..b429bea1600
--- /dev/null
+++ b/db/migrate/20230127121107_add_git_rate_limit_users_alertlist_to_application_settings.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddGitRateLimitUsersAlertlistToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings, :git_rate_limit_users_alertlist,
+ :integer,
+ array: true,
+ default: [],
+ null: false
+ end
+end
diff --git a/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb b/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb
new file mode 100644
index 00000000000..4679d668843
--- /dev/null
+++ b/db/migrate/20230127121443_add_unique_project_download_limit_alertlist_to_namespace_settings.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class AddUniqueProjectDownloadLimitAlertlistToNamespaceSettings < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :namespace_settings, :unique_project_download_limit_alertlist,
+ :integer,
+ array: true,
+ default: [],
+ null: false
+ end
+end
diff --git a/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb
new file mode 100644
index 00000000000..bbfb0c90596
--- /dev/null
+++ b/db/migrate/20230127151529_add_project_pointer_for_analytics_dashboard.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class AddProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ change_column_null :analytics_dashboards_pointers, :project_id, true
+ change_column_null :analytics_dashboards_pointers, :namespace_id, true
+
+ unless column_exists?(:analytics_dashboards_pointers, :target_project_id)
+ add_column :analytics_dashboards_pointers, :target_project_id, :bigint
+ end
+
+ add_concurrent_foreign_key :analytics_dashboards_pointers, :projects,
+ column: :target_project_id,
+ on_delete: :cascade
+
+ add_concurrent_index :analytics_dashboards_pointers, :target_project_id
+ end
+
+ def down
+ change_column_null :analytics_dashboards_pointers, :project_id, false
+ change_column_null :analytics_dashboards_pointers, :namespace_id, false
+
+ return unless column_exists?(:analytics_dashboards_pointers, :target_project_id)
+
+ remove_column :analytics_dashboards_pointers, :target_project_id
+ end
+end
diff --git a/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb
new file mode 100644
index 00000000000..233474d0918
--- /dev/null
+++ b/db/migrate/20230127151530_migrate_project_pointer_for_analytics_dashboard.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class MigrateProjectPointerForAnalyticsDashboard < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ execute 'UPDATE analytics_dashboards_pointers SET target_project_id = project_id'
+ execute 'UPDATE analytics_dashboards_pointers SET project_id = NULL'
+ end
+
+ def down
+ execute 'UPDATE analytics_dashboards_pointers SET project_id = target_project_id'
+ execute 'UPDATE analytics_dashboards_pointers SET target_project_id = NULL'
+ end
+end
diff --git a/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb
new file mode 100644
index 00000000000..d615185fe8a
--- /dev/null
+++ b/db/migrate/20230127151531_change_dashboard_analytics_project_pointer_project_null.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class ChangeDashboardAnalyticsProjectPointerProjectNull < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ EXISTENCE_CONSTRAINT = 'chk_analytics_dashboards_pointers_project_or_namespace'
+ NEW_UNIQ_INDEX = 'idx_uniq_analytics_dashboards_pointers_on_project_id'
+ OLD_INDEX = 'index_analytics_dashboards_pointers_on_project_id'
+
+ def up
+ add_check_constraint :analytics_dashboards_pointers,
+ "(project_id IS NULL) <> (namespace_id IS NULL)",
+ EXISTENCE_CONSTRAINT
+
+ change_column_null :analytics_dashboards_pointers, :target_project_id, false
+
+ add_concurrent_index :analytics_dashboards_pointers, :project_id, name: NEW_UNIQ_INDEX, unique: true
+ remove_concurrent_index_by_name :analytics_dashboards_pointers, OLD_INDEX
+ end
+
+ def down
+ remove_check_constraint :analytics_dashboards_pointers, EXISTENCE_CONSTRAINT
+
+ change_column_null :analytics_dashboards_pointers, :target_project_id, true
+
+ add_concurrent_index :analytics_dashboards_pointers, :project_id, name: OLD_INDEX
+ remove_concurrent_index_by_name :analytics_dashboards_pointers, NEW_UNIQ_INDEX
+ end
+end
diff --git a/db/migrate/20230127155217_add_id_column_to_package_metadata_join_table.rb b/db/migrate/20230127155217_add_id_column_to_package_metadata_join_table.rb
new file mode 100644
index 00000000000..960421ae38e
--- /dev/null
+++ b/db/migrate/20230127155217_add_id_column_to_package_metadata_join_table.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddIdColumnToPackageMetadataJoinTable < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ COMPOSITE_UNIQUE_INDEX = :i_pm_package_version_licenses_join_ids
+
+ def up
+ drop_constraint(:pm_package_version_licenses, :pm_package_version_licenses_pkey, cascade: true)
+ add_column(:pm_package_version_licenses, :id, :primary_key)
+ add_concurrent_index(:pm_package_version_licenses, [:pm_package_version_id, :pm_license_id], unique: true,
+ name: COMPOSITE_UNIQUE_INDEX)
+ end
+
+ def down
+ remove_column(:pm_package_version_licenses, :id)
+ add_primary_key_using_index(:pm_package_version_licenses, :pm_package_version_licenses_pkey, COMPOSITE_UNIQUE_INDEX)
+ remove_concurrent_index_by_name(:pm_package_version_licenses, COMPOSITE_UNIQUE_INDEX)
+ end
+end
diff --git a/db/migrate/20230127164007_add_trial_date_index_to_gitlab_subscribtions.rb b/db/migrate/20230127164007_add_trial_date_index_to_gitlab_subscribtions.rb
new file mode 100644
index 00000000000..57117638945
--- /dev/null
+++ b/db/migrate/20230127164007_add_trial_date_index_to_gitlab_subscribtions.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddTrialDateIndexToGitlabSubscribtions < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_gitlab_subscriptions_on_trial_and_trial_starts_on'
+
+ def up
+ add_concurrent_index :gitlab_subscriptions, [:trial, :trial_starts_on], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :gitlab_subscriptions, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20230129094140_add_widget_definitions.rb b/db/migrate/20230129094140_add_widget_definitions.rb
new file mode 100644
index 00000000000..09816f7386d
--- /dev/null
+++ b/db/migrate/20230129094140_add_widget_definitions.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class AddWidgetDefinitions < Gitlab::Database::Migration[2.1]
+ UNIQUE_INDEX_NAME = 'index_work_item_widget_definitions_on_namespace_type_and_name'
+ UNIQUE_DEFAULT_NAMESPACE_INDEX_NAME = 'index_work_item_widget_definitions_on_default_witype_and_name'
+
+ def up
+ create_table :work_item_widget_definitions do |t|
+ t.references :namespace, index: false
+ t.references :work_item_type, index: true, null: false
+ t.integer :widget_type, null: false, limit: 2
+ t.boolean :disabled, default: false
+ t.text :name, limit: 255
+
+ t.index [:namespace_id, :work_item_type_id, :name], unique: true, name: UNIQUE_INDEX_NAME
+ t.index [:work_item_type_id, :name], where: "namespace_id is NULL",
+ unique: true, name: UNIQUE_DEFAULT_NAMESPACE_INDEX_NAME
+ end
+ end
+
+ def down
+ drop_table :work_item_widget_definitions
+ end
+end
diff --git a/db/migrate/20230129154126_add_widget_def_namespace_fk.rb b/db/migrate/20230129154126_add_widget_def_namespace_fk.rb
new file mode 100644
index 00000000000..cf3f83fdbfe
--- /dev/null
+++ b/db/migrate/20230129154126_add_widget_def_namespace_fk.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddWidgetDefNamespaceFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :work_item_widget_definitions, :work_item_types,
+ column: :work_item_type_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :work_item_widget_definitions, column: :work_item_type_id
+ end
+ end
+end
diff --git a/db/migrate/20230129154202_add_widget_def_work_item_type_fk.rb b/db/migrate/20230129154202_add_widget_def_work_item_type_fk.rb
new file mode 100644
index 00000000000..530f2c78198
--- /dev/null
+++ b/db/migrate/20230129154202_add_widget_def_work_item_type_fk.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddWidgetDefWorkItemTypeFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :work_item_widget_definitions, :namespaces, column: :namespace_id, on_delete: :cascade
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :work_item_widget_definitions, column: :namespace_id
+ end
+ end
+end
diff --git a/db/migrate/20230129154819_add_widgets_for_work_item_types.rb b/db/migrate/20230129154819_add_widgets_for_work_item_types.rb
new file mode 100644
index 00000000000..b936ea2e409
--- /dev/null
+++ b/db/migrate/20230129154819_add_widgets_for_work_item_types.rb
@@ -0,0 +1,143 @@
+# frozen_string_literal: true
+
+class AddWidgetsForWorkItemTypes < Gitlab::Database::Migration[2.1]
+ class WorkItemType < MigrationRecord
+ self.table_name = 'work_item_types'
+ end
+
+ class WidgetDefinition < MigrationRecord
+ self.table_name = 'work_item_widget_definitions'
+ end
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+ disable_ddl_transaction!
+
+ def up
+ widget_names = {
+ assignees: 'Assignees',
+ labels: 'Labels',
+ description: 'Description',
+ hierarchy: 'Hierarchy',
+ start_and_due_date: 'Start and due date',
+ milestone: 'Milestone',
+ notes: 'Notes',
+ iteration: 'Iteration',
+ weight: 'Weight',
+ health_status: 'Health status',
+ progress: 'Progress',
+ status: 'Status',
+ requirement_legacy: 'Requirement legacy',
+ test_reports: 'Test reports'
+ }
+
+ widgets_for_type = {
+ 'Issue' => [
+ :assignees,
+ :labels,
+ :description,
+ :hierarchy,
+ :start_and_due_date,
+ :milestone,
+ :notes,
+ # EE widgets
+ :iteration,
+ :weight,
+ :health_status
+ ],
+ 'Incident' => [
+ :description,
+ :hierarchy,
+ :notes
+ ],
+ 'Test Case' => [
+ :description,
+ :notes
+ ],
+ 'Requirement' => [
+ :description,
+ :notes,
+ :status,
+ :requirement_legacy,
+ :test_reports
+ ],
+ 'Task' => [
+ :assignees,
+ :labels,
+ :description,
+ :hierarchy,
+ :start_and_due_date,
+ :milestone,
+ :notes,
+ :iteration,
+ :weight
+ ],
+ 'Objective' => [
+ :assignees,
+ :labels,
+ :description,
+ :hierarchy,
+ :milestone,
+ :notes,
+ :health_status,
+ :progress
+ ],
+ 'Key Result' => [
+ :assignees,
+ :labels,
+ :description,
+ :hierarchy,
+ :start_and_due_date,
+ :notes,
+ :health_status,
+ :progress
+ ]
+ }
+
+ widgets_enum = {
+ assignees: 0,
+ description: 1,
+ hierarchy: 2,
+ labels: 3,
+ milestone: 4,
+ notes: 5,
+ start_and_due_date: 6,
+ health_status: 7, # EE-only
+ weight: 8, # EE-only
+ iteration: 9, # EE-only
+ progress: 10, # EE-only
+ status: 11, # EE-only
+ requirement_legacy: 12, # EE-only
+ test_reports: 13
+ }
+
+ widgets = []
+ widgets_for_type.each do |type_name, widget_syms|
+ type = WorkItemType.find_by_name_and_namespace_id(type_name, nil)
+
+ unless type
+ Gitlab::AppLogger.warn("type #{type_name} is missing, not adding widgets")
+
+ next
+ end
+
+ widgets += widget_syms.map do |widget_sym|
+ {
+ work_item_type_id: type.id,
+ name: widget_names[widget_sym],
+ widget_type: widgets_enum[widget_sym]
+ }
+ end
+ end
+
+ return if widgets.empty?
+
+ WidgetDefinition.upsert_all(
+ widgets,
+ unique_by: :index_work_item_widget_definitions_on_default_witype_and_name
+ )
+ end
+
+ def down
+ WidgetDefinition.delete_all
+ end
+end
diff --git a/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb b/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb
new file mode 100644
index 00000000000..680ad570391
--- /dev/null
+++ b/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfCiBuildNeedsToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :ci_build_needs
+ COLUMNS = %i[id]
+
+ enable_lock_retries!
+
+ 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/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb b/db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb
new file mode 100644
index 00000000000..ae7ad3b52c2
--- /dev/null
+++ b/db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillCiBuildNeedsForBigIntConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :ci_build_needs
+ COLUMNS = %i[id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ 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/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/20230130175512_initialize_conversion_of_sent_notifications_to_bigint.rb b/db/migrate/20230130175512_initialize_conversion_of_sent_notifications_to_bigint.rb
new file mode 100644
index 00000000000..4e588ab2197
--- /dev/null
+++ b/db/migrate/20230130175512_initialize_conversion_of_sent_notifications_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfSentNotificationsToBigint < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ TABLE = :sent_notifications
+ 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/20230130204743_remove_protected_environment_default_access_level.rb b/db/migrate/20230130204743_remove_protected_environment_default_access_level.rb
new file mode 100644
index 00000000000..d01fd6b90f3
--- /dev/null
+++ b/db/migrate/20230130204743_remove_protected_environment_default_access_level.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+class RemoveProtectedEnvironmentDefaultAccessLevel < Gitlab::Database::Migration[2.1]
+ def change
+ change_column_default :protected_environment_deploy_access_levels, :access_level, from: 40, to: nil
+ end
+end
diff --git a/db/migrate/20230131004948_initialize_conversion_of_notes_id_to_bigint.rb b/db/migrate/20230131004948_initialize_conversion_of_notes_id_to_bigint.rb
new file mode 100644
index 00000000000..a376ba50e87
--- /dev/null
+++ b/db/migrate/20230131004948_initialize_conversion_of_notes_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfNotesIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :notes
+ COLUMNS = %i[id]
+
+ enable_lock_retries!
+
+ 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/20230131090842_add_global_group_approvers_enabled_to_application_settings.rb b/db/migrate/20230131090842_add_global_group_approvers_enabled_to_application_settings.rb
new file mode 100644
index 00000000000..cb3c747d351
--- /dev/null
+++ b/db/migrate/20230131090842_add_global_group_approvers_enabled_to_application_settings.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AddGlobalGroupApproversEnabledToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column :application_settings,
+ :security_policy_global_group_approvers_enabled,
+ :boolean,
+ default: true,
+ null: false
+ end
+end
diff --git a/db/migrate/20230131123923_raise_ci_variables_default_limits.rb b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb
new file mode 100644
index 00000000000..ebe59c13e18
--- /dev/null
+++ b/db/migrate/20230131123923_raise_ci_variables_default_limits.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class RaiseCiVariablesDefaultLimits < Gitlab::Database::Migration[2.1]
+ def change
+ change_column_default(:plan_limits, :project_ci_variables, from: 200, to: 8000)
+ change_column_default(:plan_limits, :group_ci_variables, from: 200, to: 30000)
+ end
+end
diff --git a/db/migrate/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages.rb b/db/migrate/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages.rb
new file mode 100644
index 00000000000..88ff29769b1
--- /dev/null
+++ b/db/migrate/20230131125844_add_project_id_name_id_version_index_to_installable_npm_packages.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddProjectIdNameIdVersionIndexToInstallableNpmPackages < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'idx_packages_on_project_id_name_id_version_when_installable_npm'
+ PACKAGE_TYPE_NPM = 2
+
+ def up
+ add_concurrent_index(
+ :packages_packages,
+ [:project_id, :name, :id, :version],
+ name: INDEX_NAME,
+ where: "package_type = #{PACKAGE_TYPE_NPM} AND status IN (0, 1)"
+ )
+ end
+
+ def down
+ remove_concurrent_index_by_name(:packages_packages, INDEX_NAME)
+ end
+end
diff --git a/db/migrate/20230201012727_initialize_conversion_of_todos_note_id_to_bigint.rb b/db/migrate/20230201012727_initialize_conversion_of_todos_note_id_to_bigint.rb
new file mode 100644
index 00000000000..06ddcacba42
--- /dev/null
+++ b/db/migrate/20230201012727_initialize_conversion_of_todos_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfTodosNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :todos
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb b/db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb
new file mode 100644
index 00000000000..ec84f1cb946
--- /dev/null
+++ b/db/migrate/20230201014223_initialize_conversion_of_system_note_metadata_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfSystemNoteMetadataNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :system_note_metadata
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb b/db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..8e0c4e0b106
--- /dev/null
+++ b/db/migrate/20230202002616_initialize_conversion_of_epic_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfEpicUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :epic_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230202023208_initialize_conversion_of_suggestions_note_id_to_bigint.rb b/db/migrate/20230202023208_initialize_conversion_of_suggestions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..9b271089801
--- /dev/null
+++ b/db/migrate/20230202023208_initialize_conversion_of_suggestions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfSuggestionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :suggestions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb b/db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..3df255b3d6d
--- /dev/null
+++ b/db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfIssueUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :issue_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230202153926_add_scan_result_policy_id_to_approval_rules.rb b/db/migrate/20230202153926_add_scan_result_policy_id_to_approval_rules.rb
new file mode 100644
index 00000000000..b72405ccf30
--- /dev/null
+++ b/db/migrate/20230202153926_add_scan_result_policy_id_to_approval_rules.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+class AddScanResultPolicyIdToApprovalRules < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :approval_project_rules, :scan_result_policy_id, :bigint
+ add_column :approval_merge_request_rules, :scan_result_policy_id, :bigint
+ end
+end
diff --git a/db/migrate/20230203011359_create_automation_rules.rb b/db/migrate/20230203011359_create_automation_rules.rb
new file mode 100644
index 00000000000..d247799bee8
--- /dev/null
+++ b/db/migrate/20230203011359_create_automation_rules.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class CreateAutomationRules < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ create_table :automation_rules do |t|
+ t.references :namespace, null: false, index: false, foreign_key: { on_delete: :cascade }
+ t.boolean :issues_events, default: false, null: false
+ t.boolean :merge_requests_events, default: false, null: false
+ t.boolean :permanently_disabled, default: false, null: false
+ t.text :name, null: false, limit: 255
+ t.text :rule, null: false, limit: 2048
+ t.timestamps_with_timezone null: false
+
+ t.index 'namespace_id, LOWER(name)',
+ name: 'index_automation_rules_namespace_id_name',
+ unique: true
+
+ t.index [:namespace_id, :permanently_disabled],
+ name: 'index_automation_rules_namespace_id_permanently_disabled'
+ end
+ end
+
+ def down
+ drop_table :automation_rules
+ end
+end
diff --git a/db/migrate/20230203145514_allow_null_pipeline_id_to_dast_pre_scan_verification.rb b/db/migrate/20230203145514_allow_null_pipeline_id_to_dast_pre_scan_verification.rb
new file mode 100644
index 00000000000..11e8a856c11
--- /dev/null
+++ b/db/migrate/20230203145514_allow_null_pipeline_id_to_dast_pre_scan_verification.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class AllowNullPipelineIdToDastPreScanVerification < Gitlab::Database::Migration[2.1]
+ def up
+ change_column_null :dast_pre_scan_verifications, :ci_pipeline_id, true
+ end
+
+ def down
+ # There may now be nulls in the table, so we cannot re-add the constraint here.
+ 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/migrate/20230206172702_add_match_on_inclusion_to_scan_result_policy.rb b/db/migrate/20230206172702_add_match_on_inclusion_to_scan_result_policy.rb
new file mode 100644
index 00000000000..bec3dfeca76
--- /dev/null
+++ b/db/migrate/20230206172702_add_match_on_inclusion_to_scan_result_policy.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddMatchOnInclusionToScanResultPolicy < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ add_column :scan_result_policies, :match_on_inclusion, :boolean
+ end
+end
diff --git a/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb b/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb
new file mode 100644
index 00000000000..22c7d252dc3
--- /dev/null
+++ b/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfNoteDiffFilesDiffNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :note_diff_files
+ COLUMNS = %i[diff_note_id]
+
+ enable_lock_retries!
+
+ 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/20230207005549_initialize_conversion_of_snippet_user_mentions_note_id_to_bigint.rb b/db/migrate/20230207005549_initialize_conversion_of_snippet_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..3f994a0e40f
--- /dev/null
+++ b/db/migrate/20230207005549_initialize_conversion_of_snippet_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfSnippetUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :snippet_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230207011344_initialize_conversion_of_design_user_mentions_note_id_to_bigint.rb b/db/migrate/20230207011344_initialize_conversion_of_design_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..6f192bf402c
--- /dev/null
+++ b/db/migrate/20230207011344_initialize_conversion_of_design_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfDesignUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :design_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230207012217_initialize_conversion_of_vulnerability_user_mentions_note_id_to_bigint.rb b/db/migrate/20230207012217_initialize_conversion_of_vulnerability_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..feaf705a770
--- /dev/null
+++ b/db/migrate/20230207012217_initialize_conversion_of_vulnerability_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfVulnerabilityUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :vulnerability_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230207015819_initialize_conversion_of_commit_user_mentions_note_id_to_bigint.rb b/db/migrate/20230207015819_initialize_conversion_of_commit_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..bede8624c2b
--- /dev/null
+++ b/db/migrate/20230207015819_initialize_conversion_of_commit_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfCommitUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :commit_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230207025259_initialize_conversion_of_merge_request_user_mentions_note_id_to_bigint.rb b/db/migrate/20230207025259_initialize_conversion_of_merge_request_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..ef8b2a27393
--- /dev/null
+++ b/db/migrate/20230207025259_initialize_conversion_of_merge_request_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfMergeRequestUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :merge_request_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230207030244_initialize_conversion_of_timelogs_note_id_to_bigint.rb b/db/migrate/20230207030244_initialize_conversion_of_timelogs_note_id_to_bigint.rb
new file mode 100644
index 00000000000..85e218f8e64
--- /dev/null
+++ b/db/migrate/20230207030244_initialize_conversion_of_timelogs_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfTimelogsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :timelogs
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ 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/20230208103640_rename_runner_machine_xid.rb b/db/migrate/20230208103640_rename_runner_machine_xid.rb
new file mode 100644
index 00000000000..c9c9ffd324f
--- /dev/null
+++ b/db/migrate/20230208103640_rename_runner_machine_xid.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class RenameRunnerMachineXid < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :ci_runner_machines, :machine_xid, :system_xid
+ end
+
+ def down
+ undo_rename_column_concurrently :ci_runner_machines, :machine_xid, :system_xid
+ end
+end
diff --git a/db/migrate/20230210181214_add_allow_deploy_tokens_and_keys_with_external_authn_to_application_settings.rb b/db/migrate/20230210181214_add_allow_deploy_tokens_and_keys_with_external_authn_to_application_settings.rb
new file mode 100644
index 00000000000..d65fbca1975
--- /dev/null
+++ b/db/migrate/20230210181214_add_allow_deploy_tokens_and_keys_with_external_authn_to_application_settings.rb
@@ -0,0 +1,8 @@
+# frozen_string_literal: true
+
+class AddAllowDeployTokensAndKeysWithExternalAuthnToApplicationSettings < Gitlab::Database::Migration[2.1]
+ def change
+ add_column(:application_settings, :allow_deploy_tokens_and_keys_with_external_authn, :boolean,
+ default: false, null: false)
+ end
+end
diff --git a/db/migrate/20230214142447_remove_text_limit_from_ci_job_artifacts_original_filename.rb b/db/migrate/20230214142447_remove_text_limit_from_ci_job_artifacts_original_filename.rb
new file mode 100644
index 00000000000..68552839a54
--- /dev/null
+++ b/db/migrate/20230214142447_remove_text_limit_from_ci_job_artifacts_original_filename.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveTextLimitFromCiJobArtifactsOriginalFilename < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ # In preparation for 20230214142813_remove_ci_job_artifacts_original_filename.rb
+ # We first remove the text limit before removing the column.
+ # This is to properly reverse the 2-step migration to add a text column with limit
+ # https://docs.gitlab.com/ee/development/database/strings_and_the_text_data_type.html#add-a-text-column-to-an-existing-table
+ remove_text_limit :ci_job_artifacts, :original_filename
+ end
+
+ def down
+ add_text_limit :ci_job_artifacts, :original_filename, 512
+ end
+end
diff --git a/db/migrate/20230214142813_remove_ci_job_artifacts_original_filename.rb b/db/migrate/20230214142813_remove_ci_job_artifacts_original_filename.rb
new file mode 100644
index 00000000000..fed09fb113d
--- /dev/null
+++ b/db/migrate/20230214142813_remove_ci_job_artifacts_original_filename.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class RemoveCiJobArtifactsOriginalFilename < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def up
+ # This column has never been used and has always been under ignore_column since it was added.
+ # We're doing the removal of the ignore_column in the same MR with this migration and this
+ # is why we are not doing this in post migrate.
+ remove_column :ci_job_artifacts, :original_filename, :text # rubocop:disable Migration/RemoveColumn
+ end
+
+ def down
+ add_column :ci_job_artifacts, :original_filename, :text
+ 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/20210604070207_retry_backfill_traversal_ids.rb b/db/post_migrate/20210604070207_retry_backfill_traversal_ids.rb
deleted file mode 100644
index 5e540c7f359..00000000000
--- a/db/post_migrate/20210604070207_retry_backfill_traversal_ids.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-# frozen_string_literal: true
-
-class RetryBackfillTraversalIds < ActiveRecord::Migration[6.1]
- include Gitlab::Database::MigrationHelpers
-
- ROOTS_MIGRATION = 'BackfillNamespaceTraversalIdsRoots'
- CHILDREN_MIGRATION = 'BackfillNamespaceTraversalIdsChildren'
- DOWNTIME = false
- DELAY_INTERVAL = 2.minutes
-
- disable_ddl_transaction!
-
- def up
- duration = requeue_background_migration_jobs_by_range_at_intervals(ROOTS_MIGRATION, DELAY_INTERVAL)
- requeue_background_migration_jobs_by_range_at_intervals(CHILDREN_MIGRATION, DELAY_INTERVAL, initial_delay: duration)
- 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/20221108045019_truncate_timeline_event_tags_table.rb b/db/post_migrate/20221108045019_truncate_timeline_event_tags_table.rb
index 37e6a21abed..a576f9e860f 100644
--- a/db/post_migrate/20221108045019_truncate_timeline_event_tags_table.rb
+++ b/db/post_migrate/20221108045019_truncate_timeline_event_tags_table.rb
@@ -4,6 +4,8 @@ class TruncateTimelineEventTagsTable < Gitlab::Database::Migration[2.0]
disable_ddl_transaction!
def up
+ return unless Gitlab::Database.gitlab_schemas_for_connection(connection).include?(:gitlab_main)
+
execute('TRUNCATE TABLE incident_management_timeline_event_tags, incident_management_timeline_event_tag_links')
end
diff --git a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
index f98be3f036f..d409a4dfdd1 100644
--- a/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
+++ b/db/post_migrate/20221110045406_sanitize_confidential_note_todos.rb
@@ -3,29 +3,13 @@
class SanitizeConfidentialNoteTodos < Gitlab::Database::Migration[2.0]
restrict_gitlab_migration gitlab_schema: :gitlab_main
- MIGRATION = 'SanitizeConfidentialTodos'
- DELAY_INTERVAL = 2.minutes.to_i
- BATCH_SIZE = 200
- MAX_BATCH_SIZE = 1000
- SUB_BATCH_SIZE = 20
-
- disable_ddl_transaction!
- restrict_gitlab_migration gitlab_schema: :gitlab_main
-
def up
- queue_batched_background_migration(
- MIGRATION,
- :notes,
- :id,
- job_interval: DELAY_INTERVAL,
- batch_size: BATCH_SIZE,
- max_batch_size: MAX_BATCH_SIZE,
- sub_batch_size: SUB_BATCH_SIZE,
- gitlab_schema: :gitlab_main
- )
+ # no-op: this empty migration is left here only for compatibility reasons.
+ # It was a temporary migration which used not-isolated code.
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/382557
end
def down
- delete_batched_background_migration(MIGRATION, :notes, :id, [])
+ # no-op
end
end
diff --git a/db/post_migrate/20221116134611_add_namespaces_emails_enabled_column_data.rb b/db/post_migrate/20221116134611_add_namespaces_emails_enabled_column_data.rb
new file mode 100644
index 00000000000..e3efc18f3fd
--- /dev/null
+++ b/db/post_migrate/20221116134611_add_namespaces_emails_enabled_column_data.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+class AddNamespacesEmailsEnabledColumnData < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'AddNamespacesEmailsEnabledColumnData'
+ DELAY_INTERVAL = 2.minutes.to_i
+ BATCH_SIZE = 200
+ MAX_BATCH_SIZE = 1000
+ SUB_BATCH_SIZE = 20
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :namespaces,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ max_batch_size: MAX_BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE,
+ gitlab_schema: :gitlab_main
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :namespaces, :id, [])
+ end
+end
diff --git a/db/post_migrate/20221116134633_add_projects_emails_enabled_column_data.rb b/db/post_migrate/20221116134633_add_projects_emails_enabled_column_data.rb
new file mode 100644
index 00000000000..9f0edbd0707
--- /dev/null
+++ b/db/post_migrate/20221116134633_add_projects_emails_enabled_column_data.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+class AddProjectsEmailsEnabledColumnData < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ MIGRATION = 'AddProjectsEmailsEnabledColumnData'
+ DELAY_INTERVAL = 2.minutes.to_i
+ BATCH_SIZE = 200
+ MAX_BATCH_SIZE = 1000
+ SUB_BATCH_SIZE = 20
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :projects,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ max_batch_size: MAX_BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE,
+ gitlab_schema: :gitlab_main
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :projects, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230104222438_add_partition_index_to_builds_metadata.rb b/db/post_migrate/20230104222438_add_partition_index_to_builds_metadata.rb
new file mode 100644
index 00000000000..474f6f8540b
--- /dev/null
+++ b/db/post_migrate/20230104222438_add_partition_index_to_builds_metadata.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddPartitionIndexToBuildsMetadata < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'p_ci_builds_metadata_on_runner_machine_id_idx'
+
+ def up
+ add_concurrent_partitioned_index :p_ci_builds_metadata, :runner_machine_id, name: INDEX_NAME,
+ where: 'runner_machine_id IS NOT NULL'
+ end
+
+ def down
+ remove_concurrent_partitioned_index_by_name :p_ci_builds_metadata, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230104222514_add_foreign_key_to_builds_metadata.rb b/db/post_migrate/20230104222514_add_foreign_key_to_builds_metadata.rb
new file mode 100644
index 00000000000..b9c78e4eeb9
--- /dev/null
+++ b/db/post_migrate/20230104222514_add_foreign_key_to_builds_metadata.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToBuildsMetadata < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_partitioned_foreign_key :p_ci_builds_metadata,
+ :ci_runner_machines,
+ column: :runner_machine_id,
+ on_delete: :nullify
+ end
+
+ def down
+ remove_foreign_key_if_exists :p_ci_builds_metadata, column: :runner_machine_id
+ end
+end
diff --git a/db/post_migrate/20230109100044_cleanup_web_hook_calls_column_rename.rb b/db/post_migrate/20230109100044_cleanup_web_hook_calls_column_rename.rb
new file mode 100644
index 00000000000..eca75bff199
--- /dev/null
+++ b/db/post_migrate/20230109100044_cleanup_web_hook_calls_column_rename.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class CleanupWebHookCallsColumnRename < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ # noop, related incident: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8264
+ end
+
+ def down
+ undo_cleanup_concurrent_column_rename :plan_limits, :web_hook_calls, :web_hook_calls_high
+ end
+end
diff --git a/db/post_migrate/20230109144915_remove_push_rules_application_settings_push_rule_id_fk.rb b/db/post_migrate/20230109144915_remove_push_rules_application_settings_push_rule_id_fk.rb
new file mode 100644
index 00000000000..7ac492a6e62
--- /dev/null
+++ b/db/post_migrate/20230109144915_remove_push_rules_application_settings_push_rule_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemovePushRulesApplicationSettingsPushRuleIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :push_rules, name: "fk_693b8795e4")
+
+ with_lock_retries do
+ execute('LOCK push_rules, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :push_rules, name: "fk_693b8795e4")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :push_rules,
+ name: "fk_693b8795e4", column: :push_rule_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230109144928_remove_users_application_settings_usage_stats_set_by_user_id_fk.rb b/db/post_migrate/20230109144928_remove_users_application_settings_usage_stats_set_by_user_id_fk.rb
new file mode 100644
index 00000000000..a8b9b48dbc7
--- /dev/null
+++ b/db/post_migrate/20230109144928_remove_users_application_settings_usage_stats_set_by_user_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveUsersApplicationSettingsUsageStatsSetByUserIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :users, name: "fk_964370041d")
+
+ with_lock_retries do
+ execute('LOCK users, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :users, name: "fk_964370041d")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :users,
+ name: "fk_964370041d", column: :usage_stats_set_by_user_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230109144941_remove_namespaces_application_settings_instance_administrators_group_id_fk.rb b/db/post_migrate/20230109144941_remove_namespaces_application_settings_instance_administrators_group_id_fk.rb
new file mode 100644
index 00000000000..82f0d8a2e47
--- /dev/null
+++ b/db/post_migrate/20230109144941_remove_namespaces_application_settings_instance_administrators_group_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveNamespacesApplicationSettingsInstanceAdministratorsGroupIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :namespaces, name: "fk_e8a145f3a7")
+
+ with_lock_retries do
+ execute('LOCK namespaces, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :namespaces, name: "fk_e8a145f3a7")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :namespaces,
+ name: "fk_e8a145f3a7", column: :instance_administrators_group_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230109144953_remove_projects_application_settings_file_template_project_id_fk.rb b/db/post_migrate/20230109144953_remove_projects_application_settings_file_template_project_id_fk.rb
new file mode 100644
index 00000000000..8527930e5a7
--- /dev/null
+++ b/db/post_migrate/20230109144953_remove_projects_application_settings_file_template_project_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveProjectsApplicationSettingsFileTemplateProjectIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :projects, name: "fk_ec757bd087")
+
+ with_lock_retries do
+ execute('LOCK projects, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :projects, name: "fk_ec757bd087")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :projects,
+ name: "fk_ec757bd087", column: :file_template_project_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230109145005_remove_projects_application_settings_instance_administration_project_id_fk.rb b/db/post_migrate/20230109145005_remove_projects_application_settings_instance_administration_project_id_fk.rb
new file mode 100644
index 00000000000..e91769a90bb
--- /dev/null
+++ b/db/post_migrate/20230109145005_remove_projects_application_settings_instance_administration_project_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveProjectsApplicationSettingsInstanceAdministrationProjectIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :projects, name: "fk_rails_7e112a9599")
+
+ with_lock_retries do
+ execute('LOCK projects, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :projects, name: "fk_rails_7e112a9599")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :projects,
+ name: "fk_rails_7e112a9599", column: :instance_administration_project_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230109145018_remove_namespaces_application_settings_custom_project_templates_group_id_fk.rb b/db/post_migrate/20230109145018_remove_namespaces_application_settings_custom_project_templates_group_id_fk.rb
new file mode 100644
index 00000000000..cfc915f57b4
--- /dev/null
+++ b/db/post_migrate/20230109145018_remove_namespaces_application_settings_custom_project_templates_group_id_fk.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class RemoveNamespacesApplicationSettingsCustomProjectTemplatesGroupIdFk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless foreign_key_exists?(:application_settings, :namespaces, name: "fk_rails_b53e481273")
+
+ with_lock_retries do
+ execute('LOCK namespaces, application_settings IN ACCESS EXCLUSIVE MODE') if transaction_open?
+
+ remove_foreign_key_if_exists(:application_settings, :namespaces, name: "fk_rails_b53e481273")
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(:application_settings, :namespaces,
+ name: "fk_rails_b53e481273", column: :custom_project_templates_group_id,
+ target_column: :id, on_delete: :nullify)
+ end
+end
diff --git a/db/post_migrate/20230112051854_add_not_null_constraint_to_o_auth_access_tokens_expires_in.rb b/db/post_migrate/20230112051854_add_not_null_constraint_to_o_auth_access_tokens_expires_in.rb
new file mode 100644
index 00000000000..21028993f5d
--- /dev/null
+++ b/db/post_migrate/20230112051854_add_not_null_constraint_to_o_auth_access_tokens_expires_in.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddNotNullConstraintToOAuthAccessTokensExpiresIn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ # validate: false ensures that existing records are not affected
+ # https://docs.gitlab.com/ee/development/database/not_null_constraints.html#prevent-new-invalid-records-current-release
+ add_not_null_constraint :oauth_access_tokens, :expires_in, validate: false
+ change_column_default :oauth_access_tokens, :expires_in, 7200
+ end
+
+ def down
+ remove_not_null_constraint :oauth_access_tokens, :expires_in
+ change_column_default :oauth_access_tokens, :expires_in, nil
+ end
+end
diff --git a/db/post_migrate/20230112141236_schedule_vulnerabilities_feedback_migration2.rb b/db/post_migrate/20230112141236_schedule_vulnerabilities_feedback_migration2.rb
new file mode 100644
index 00000000000..7d8cba96a91
--- /dev/null
+++ b/db/post_migrate/20230112141236_schedule_vulnerabilities_feedback_migration2.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class ScheduleVulnerabilitiesFeedbackMigration2 < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateVulnerabilitiesFeedbackToVulnerabilitiesStateTransition'
+ TABLE_NAME = :vulnerability_feedback
+ BATCH_COLUMN = :id
+ DELAY_INTERVAL = 5.minutes
+ BATCH_SIZE = 250
+ MAX_BATCH_SIZE = 250
+ SUB_BATCH_SIZE = 50
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ # rescheduled by 20230203122602_schedule_vulnerabilities_feedback_migration3.rb
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230112144946_add_tmp_index_to_ci_build_need.rb b/db/post_migrate/20230112144946_add_tmp_index_to_ci_build_need.rb
new file mode 100644
index 00000000000..d1e0ae6665f
--- /dev/null
+++ b/db/post_migrate/20230112144946_add_tmp_index_to_ci_build_need.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiBuildNeed < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_build_needs_on_partition_id_and_id
+ TABLE_NAME = :ci_build_needs
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230112145326_add_tmp_index_to_ci_pipeline_variable.rb b/db/post_migrate/20230112145326_add_tmp_index_to_ci_pipeline_variable.rb
new file mode 100644
index 00000000000..920b70765cc
--- /dev/null
+++ b/db/post_migrate/20230112145326_add_tmp_index_to_ci_pipeline_variable.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiPipelineVariable < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_pipeline_variables_on_partition_id_and_id
+ TABLE_NAME = :ci_pipeline_variables
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230116160904_remove_user_details_fields_from_user.rb b/db/post_migrate/20230116160904_remove_user_details_fields_from_user.rb
new file mode 100644
index 00000000000..8842f75e691
--- /dev/null
+++ b/db/post_migrate/20230116160904_remove_user_details_fields_from_user.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class RemoveUserDetailsFieldsFromUser < Gitlab::Database::Migration[2.1]
+ enable_lock_retries!
+
+ def change
+ %i[linkedin twitter skype website_url].each do |column|
+ remove_column :users, column, :string, null: false, default: ''
+ end
+ %i[location organization].each do |column|
+ remove_column :users, column, :string, null: true
+ end
+ end
+end
diff --git a/db/post_migrate/20230117092947_add_tmp_index_to_ci_build_report_results.rb b/db/post_migrate/20230117092947_add_tmp_index_to_ci_build_report_results.rb
new file mode 100644
index 00000000000..a116562e9ec
--- /dev/null
+++ b/db/post_migrate/20230117092947_add_tmp_index_to_ci_build_report_results.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiBuildReportResults < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_build_report_results_on_partition_id_and_id
+ TABLE_NAME = :ci_build_report_results
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230117093222_add_tmp_index_to_ci_builds_on_partition_id.rb b/db/post_migrate/20230117093222_add_tmp_index_to_ci_builds_on_partition_id.rb
new file mode 100644
index 00000000000..3a40e636ef9
--- /dev/null
+++ b/db/post_migrate/20230117093222_add_tmp_index_to_ci_builds_on_partition_id.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiBuildsOnPartitionId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_builds_on_partition_id_and_id
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index :ci_builds, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index :ci_builds, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+end
diff --git a/db/post_migrate/20230117093736_add_tmp_index_to_ci_pipelines_on_partition_id.rb b/db/post_migrate/20230117093736_add_tmp_index_to_ci_pipelines_on_partition_id.rb
new file mode 100644
index 00000000000..a8e5da592af
--- /dev/null
+++ b/db/post_migrate/20230117093736_add_tmp_index_to_ci_pipelines_on_partition_id.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiPipelinesOnPartitionId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_pipelines_on_partition_id_and_id
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index :ci_pipelines, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index :ci_pipelines, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+end
diff --git a/db/post_migrate/20230117093924_add_tmp_index_to_ci_stages_on_partition_id.rb b/db/post_migrate/20230117093924_add_tmp_index_to_ci_stages_on_partition_id.rb
new file mode 100644
index 00000000000..33273ee2ba4
--- /dev/null
+++ b/db/post_migrate/20230117093924_add_tmp_index_to_ci_stages_on_partition_id.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiStagesOnPartitionId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_stages_on_partition_id_and_id
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index :ci_stages, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index :ci_stages, [:partition_id, :id], name: INDEX_NAME, where: 'partition_id = 101'
+ end
+end
diff --git a/db/post_migrate/20230117094111_prepare_tmp_index_to_ci_build_trace_metadata.rb b/db/post_migrate/20230117094111_prepare_tmp_index_to_ci_build_trace_metadata.rb
new file mode 100644
index 00000000000..93356b4eb3f
--- /dev/null
+++ b/db/post_migrate/20230117094111_prepare_tmp_index_to_ci_build_trace_metadata.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class PrepareTmpIndexToCiBuildTraceMetadata < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_build_trace_metadata_on_partition_id_and_id
+ TABLE_NAME = :ci_build_trace_metadata
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :build_id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230117094226_prepare_tmp_index_to_ci_job_artifact.rb b/db/post_migrate/20230117094226_prepare_tmp_index_to_ci_job_artifact.rb
new file mode 100644
index 00000000000..db0c51e4cfd
--- /dev/null
+++ b/db/post_migrate/20230117094226_prepare_tmp_index_to_ci_job_artifact.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class PrepareTmpIndexToCiJobArtifact < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_job_artifacts_on_partition_id_and_id
+ TABLE_NAME = :ci_job_artifacts
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230117094316_add_tmp_index_to_ci_job_variable.rb b/db/post_migrate/20230117094316_add_tmp_index_to_ci_job_variable.rb
new file mode 100644
index 00000000000..96de0c9fed1
--- /dev/null
+++ b/db/post_migrate/20230117094316_add_tmp_index_to_ci_job_variable.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddTmpIndexToCiJobVariable < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_job_variables_on_partition_id_and_id
+ TABLE_NAME = :ci_job_variables
+
+ def up
+ return unless Gitlab.com?
+
+ add_concurrent_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230117114739_clear_duplicate_jobs_cookies.rb b/db/post_migrate/20230117114739_clear_duplicate_jobs_cookies.rb
new file mode 100644
index 00000000000..ce587e6c902
--- /dev/null
+++ b/db/post_migrate/20230117114739_clear_duplicate_jobs_cookies.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+# This is workaround for
+# https://gitlab.com/gitlab-org/gitlab/-/issues/388253. During a
+# zero-downtime upgrade, duplicate jobs cookies can fail to get deleted.
+# This post-deployment migration deletes all such cookies. This can
+# cause some jobs that normally would have been deduplicated to twice
+# instead of once.
+class ClearDuplicateJobsCookies < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ Gitlab::Redis::Queues.with do |redis| # rubocop:disable Cop/RedisQueueUsage
+ redis.scan_each(match: "resque:gitlab:duplicate:*:cookie:v2").each_slice(100) do |keys|
+ redis.del(keys)
+ end
+ end
+ end
+
+ def down; end
+end
diff --git a/db/post_migrate/20230118083437_redefine_foreign_key_on_ci_unit_test_failure.rb b/db/post_migrate/20230118083437_redefine_foreign_key_on_ci_unit_test_failure.rb
new file mode 100644
index 00000000000..220da0908a9
--- /dev/null
+++ b/db/post_migrate/20230118083437_redefine_foreign_key_on_ci_unit_test_failure.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+class RedefineForeignKeyOnCiUnitTestFailure < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_unit_test_failures
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ OLD_FK_NAME = :fk_0f09856e1f_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: new_foreign_key_name,
+ on_update: :cascade
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: OLD_FK_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: OLD_FK_NAME
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: new_foreign_key_name)
+ end
+ end
+
+ private
+
+ def new_foreign_key_name
+ "#{concurrent_foreign_key_name(SOURCE_TABLE_NAME, [PARTITION_COLUMN, COLUMN])}_p"
+ end
+end
diff --git a/db/post_migrate/20230118083632_redefine_foreign_key_on_ci_build_pending_state.rb b/db/post_migrate/20230118083632_redefine_foreign_key_on_ci_build_pending_state.rb
new file mode 100644
index 00000000000..002ec923989
--- /dev/null
+++ b/db/post_migrate/20230118083632_redefine_foreign_key_on_ci_build_pending_state.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+class RedefineForeignKeyOnCiBuildPendingState < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_pending_states
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ OLD_FK_NAME = :fk_rails_0bbbfeaf9d_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: new_foreign_key_name,
+ on_update: :cascade
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: OLD_FK_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: OLD_FK_NAME
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: new_foreign_key_name)
+ end
+ end
+
+ private
+
+ def new_foreign_key_name
+ "#{concurrent_foreign_key_name(SOURCE_TABLE_NAME, [PARTITION_COLUMN, COLUMN])}_p"
+ end
+end
diff --git a/db/post_migrate/20230118083748_redefine_foreign_key_on_ci_build_trace_chunk.rb b/db/post_migrate/20230118083748_redefine_foreign_key_on_ci_build_trace_chunk.rb
new file mode 100644
index 00000000000..3474e672dfa
--- /dev/null
+++ b/db/post_migrate/20230118083748_redefine_foreign_key_on_ci_build_trace_chunk.rb
@@ -0,0 +1,51 @@
+# frozen_string_literal: true
+
+class RedefineForeignKeyOnCiBuildTraceChunk < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_trace_chunks
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ OLD_FK_NAME = :fk_rails_1013b761f2_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: new_foreign_key_name,
+ on_update: :cascade
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: OLD_FK_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: OLD_FK_NAME
+ )
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: new_foreign_key_name)
+ end
+ end
+
+ private
+
+ def new_foreign_key_name
+ "#{concurrent_foreign_key_name(SOURCE_TABLE_NAME, [PARTITION_COLUMN, COLUMN])}_p"
+ end
+end
diff --git a/db/post_migrate/20230119085509_add_index_to_ci_running_build.rb b/db/post_migrate/20230119085509_add_index_to_ci_running_build.rb
new file mode 100644
index 00000000000..f340b78801f
--- /dev/null
+++ b/db/post_migrate/20230119085509_add_index_to_ci_running_build.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexToCiRunningBuild < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_running_builds_on_partition_id_build_id
+ TABLE_NAME = :ci_running_builds
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230119085552_add_foreign_key_to_ci_running_build.rb b/db/post_migrate/20230119085552_add_foreign_key_to_ci_running_build.rb
new file mode 100644
index 00000000000..94dfdc5b967
--- /dev/null
+++ b/db/post_migrate/20230119085552_add_foreign_key_to_ci_running_build.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToCiRunningBuild < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_running_builds
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_da45cfa165_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: FK_NAME,
+ on_update: :cascade
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME)
+ end
+ end
+end
diff --git a/db/post_migrate/20230119090944_add_index_to_ci_pending_build.rb b/db/post_migrate/20230119090944_add_index_to_ci_pending_build.rb
new file mode 100644
index 00000000000..de58b6a0ef8
--- /dev/null
+++ b/db/post_migrate/20230119090944_add_index_to_ci_pending_build.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexToCiPendingBuild < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_pending_builds_on_partition_id_build_id
+ TABLE_NAME = :ci_pending_builds
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230119091027_add_foreign_key_to_ci_pending_build.rb b/db/post_migrate/20230119091027_add_foreign_key_to_ci_pending_build.rb
new file mode 100644
index 00000000000..9f7f807e738
--- /dev/null
+++ b/db/post_migrate/20230119091027_add_foreign_key_to_ci_pending_build.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class AddForeignKeyToCiPendingBuild < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_pending_builds
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_725a2644a3_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: true,
+ reverse_lock_order: true,
+ name: FK_NAME,
+ on_update: :cascade
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME)
+ end
+ end
+end
diff --git a/db/post_migrate/20230119095022_add_fk_index_to_ci_builds_runner_session_on_partition_id_and_build_id.rb b/db/post_migrate/20230119095022_add_fk_index_to_ci_builds_runner_session_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..9fee62e55f2
--- /dev/null
+++ b/db/post_migrate/20230119095022_add_fk_index_to_ci_builds_runner_session_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiBuildsRunnerSessionOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_builds_runner_session_on_partition_id_build_id
+ TABLE_NAME = :ci_builds_runner_session
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME, unique: true)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230119095023_add_fk_to_ci_builds_runner_session_on_partition_id_and_build_id.rb b/db/post_migrate/20230119095023_add_fk_to_ci_builds_runner_session_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..e3aed238e0f
--- /dev/null
+++ b/db/post_migrate/20230119095023_add_fk_to_ci_builds_runner_session_on_partition_id_and_build_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiBuildsRunnerSessionOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_builds_runner_session
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_70707857d3_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230119095024_validate_fk_on_ci_builds_runner_session_partition_id_and_build_id.rb b/db/post_migrate/20230119095024_validate_fk_on_ci_builds_runner_session_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..07402b749ea
--- /dev/null
+++ b/db/post_migrate/20230119095024_validate_fk_on_ci_builds_runner_session_partition_id_and_build_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class ValidateFkOnCiBuildsRunnerSessionPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_builds_runner_session
+ FK_NAME = :fk_rails_70707857d3_p
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ validate_foreign_key(TABLE_NAME, COLUMNS, name: FK_NAME)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230119095025_remove_fk_to_ci_builds_ci_builds_runner_session_on_build_id.rb b/db/post_migrate/20230119095025_remove_fk_to_ci_builds_ci_builds_runner_session_on_build_id.rb
new file mode 100644
index 00000000000..0707114d3a5
--- /dev/null
+++ b/db/post_migrate/20230119095025_remove_fk_to_ci_builds_ci_builds_runner_session_on_build_id.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class RemoveFkToCiBuildsCiBuildsRunnerSessionOnBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_builds_runner_session
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_70707857d3
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: COLUMN,
+ target_column: TARGET_COLUMN,
+ validate: true,
+ reverse_lock_order: true,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230119123256_add_fk_index_to_ci_resources_on_partition_id_and_build_id.rb b/db/post_migrate/20230119123256_add_fk_index_to_ci_resources_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..8c1b8c81235
--- /dev/null
+++ b/db/post_migrate/20230119123256_add_fk_index_to_ci_resources_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiResourcesOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_resources_on_partition_id_build_id
+ TABLE_NAME = :ci_resources
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230119123257_add_fk_to_ci_resources_on_partition_id_and_build_id.rb b/db/post_migrate/20230119123257_add_fk_to_ci_resources_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..8279def779e
--- /dev/null
+++ b/db/post_migrate/20230119123257_add_fk_to_ci_resources_on_partition_id_and_build_id.rb
@@ -0,0 +1,32 @@
+# frozen_string_literal: true
+
+class AddFkToCiResourcesOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_resources
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_e169a8e3d5_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :nullify,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME)
+ end
+ end
+end
diff --git a/db/post_migrate/20230119123258_validate_fk_on_ci_resources_partition_id_and_build_id.rb b/db/post_migrate/20230119123258_validate_fk_on_ci_resources_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..3df7f27d921
--- /dev/null
+++ b/db/post_migrate/20230119123258_validate_fk_on_ci_resources_partition_id_and_build_id.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class ValidateFkOnCiResourcesPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_resources
+ FK_NAME = :fk_e169a8e3d5_p
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ validate_foreign_key(TABLE_NAME, COLUMNS, name: FK_NAME)
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230119123259_remove_fk_to_ci_builds_ci_resources_on_build_id.rb b/db/post_migrate/20230119123259_remove_fk_to_ci_builds_ci_resources_on_build_id.rb
new file mode 100644
index 00000000000..fcf6989f30d
--- /dev/null
+++ b/db/post_migrate/20230119123259_remove_fk_to_ci_builds_ci_resources_on_build_id.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class RemoveFkToCiBuildsCiResourcesOnBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_resources
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_e169a8e3d5
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME)
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: COLUMN,
+ target_column: TARGET_COLUMN,
+ validate: true,
+ reverse_lock_order: true,
+ on_delete: :nullify,
+ name: FK_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230119123908_add_temporary_size_index_to_package_files.rb b/db/post_migrate/20230119123908_add_temporary_size_index_to_package_files.rb
new file mode 100644
index 00000000000..dbd1f2ce112
--- /dev/null
+++ b/db/post_migrate/20230119123908_add_temporary_size_index_to_package_files.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddTemporarySizeIndexToPackageFiles < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'tmp_idx_package_files_on_non_zero_size'
+
+ disable_ddl_transaction!
+
+ def up
+ # Temporary index to be removed in 16.0 https://gitlab.com/gitlab-org/gitlab/-/issues/386695
+ add_concurrent_index :packages_package_files,
+ %i[package_id size],
+ where: 'size IS NOT NULL',
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :packages_package_files, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230119123937_queue_fix_incoherent_packages_size_on_project_statistics.rb b/db/post_migrate/20230119123937_queue_fix_incoherent_packages_size_on_project_statistics.rb
new file mode 100644
index 00000000000..b00888e28d5
--- /dev/null
+++ b/db/post_migrate/20230119123937_queue_fix_incoherent_packages_size_on_project_statistics.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class QueueFixIncoherentPackagesSizeOnProjectStatistics < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'FixIncoherentPackagesSizeOnProjectStatistics'
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 17000
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ class Package < MigrationRecord
+ self.table_name = 'packages_packages'
+ end
+
+ def up
+ return unless ::QueueFixIncoherentPackagesSizeOnProjectStatistics::Package.exists?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ :project_statistics,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :project_statistics, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb b/db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb
new file mode 100644
index 00000000000..7f61b3bfe85
--- /dev/null
+++ b/db/post_migrate/20230123095023_add_scan_result_policy_id_to_software_license_policies.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddScanResultPolicyIdToSoftwareLicensePolicies < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = "index_software_license_policies_on_scan_result_policy_id"
+
+ def change
+ # rubocop:disable Migration/AddReference
+ add_reference :software_license_policies,
+ :scan_result_policy,
+ foreign_key: { on_delete: :cascade },
+ index: { name: INDEX_NAME },
+ null: true
+ # rubocop:enable Migration/AddReference
+ end
+end
diff --git a/db/post_migrate/20230124101832_remove_fk_to_ci_builds_ci_unit_test_failure_on_build_id.rb b/db/post_migrate/20230124101832_remove_fk_to_ci_builds_ci_unit_test_failure_on_build_id.rb
new file mode 100644
index 00000000000..943c458d0fe
--- /dev/null
+++ b/db/post_migrate/20230124101832_remove_fk_to_ci_builds_ci_unit_test_failure_on_build_id.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class RemoveFkToCiBuildsCiUnitTestFailureOnBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_unit_test_failures
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_0f09856e1f
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: COLUMN,
+ target_column: TARGET_COLUMN,
+ validate: true,
+ reverse_lock_order: true,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230124102131_remove_fk_to_ci_builds_ci_build_pending_state_on_build_id.rb b/db/post_migrate/20230124102131_remove_fk_to_ci_builds_ci_build_pending_state_on_build_id.rb
new file mode 100644
index 00000000000..a969aec0968
--- /dev/null
+++ b/db/post_migrate/20230124102131_remove_fk_to_ci_builds_ci_build_pending_state_on_build_id.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class RemoveFkToCiBuildsCiBuildPendingStateOnBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_pending_states
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_0bbbfeaf9d
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: COLUMN,
+ target_column: TARGET_COLUMN,
+ validate: true,
+ reverse_lock_order: true,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230124102222_remove_fk_to_ci_builds_ci_build_trace_chunk_on_build_id.rb b/db/post_migrate/20230124102222_remove_fk_to_ci_builds_ci_build_trace_chunk_on_build_id.rb
new file mode 100644
index 00000000000..3e03b0774ee
--- /dev/null
+++ b/db/post_migrate/20230124102222_remove_fk_to_ci_builds_ci_build_trace_chunk_on_build_id.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+class RemoveFkToCiBuildsCiBuildTraceChunkOnBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_trace_chunks
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_1013b761f2
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ def down
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: COLUMN,
+ target_column: TARGET_COLUMN,
+ validate: true,
+ reverse_lock_order: true,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+end
diff --git a/db/post_migrate/20230124104310_prepare_web_hook_logs_id_created_at_async_index.rb b/db/post_migrate/20230124104310_prepare_web_hook_logs_id_created_at_async_index.rb
new file mode 100644
index 00000000000..ea087265c90
--- /dev/null
+++ b/db/post_migrate/20230124104310_prepare_web_hook_logs_id_created_at_async_index.rb
@@ -0,0 +1,43 @@
+# 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 PrepareWebHookLogsIdCreatedAtAsyncIndex < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_web_hook_logs_on_web_hook_id_and_created_at'
+
+ def up
+ # Since web_hook_logs is a partitioned table, we need to prepare the index
+ # for each partition individually. We can't use the `prepare_async_index`
+ # method directly because it will try to prepare the index for the whole
+ # table, which will fail.
+
+ # In a future migration after this one, we will create the index on the
+ # parent table itself.
+ each_partition(:web_hook_logs) do |partition, partition_index_name|
+ prepare_async_index(partition.identifier, [:web_hook_id, :created_at],
+ name: partition_index_name)
+ end
+ end
+
+ def down
+ each_partition(:web_hook_logs) do |partition, partition_index_name|
+ unprepare_async_index_by_name(partition.identifier, partition_index_name)
+ end
+ end
+
+ private
+
+ def each_partition(table_name)
+ partitioned_table = find_partitioned_table(table_name)
+ partitioned_table.postgres_partitions.order(:name).each do |partition|
+ partition_index_name = generated_index_name(partition.identifier, INDEX_NAME)
+
+ yield partition, partition_index_name
+ end
+ end
+end
diff --git a/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb b/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb
new file mode 100644
index 00000000000..aaea55ce331
--- /dev/null
+++ b/db/post_migrate/20230125093723_rebalance_partition_id_ci_pipeline.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class RebalancePartitionIdCiPipeline < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes
+ TABLE = :ci_pipelines
+ BATCH_SIZE = 2_000
+ SUB_BATCH_SIZE = 200
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230125093840_rebalance_partition_id_ci_build.rb b/db/post_migrate/20230125093840_rebalance_partition_id_ci_build.rb
new file mode 100644
index 00000000000..6165c266a82
--- /dev/null
+++ b/db/post_migrate/20230125093840_rebalance_partition_id_ci_build.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class RebalancePartitionIdCiBuild < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes.freeze
+ TABLE = :ci_builds
+ BATCH_SIZE = 5_000
+ SUB_BATCH_SIZE = 500
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230126091522_add_unique_index_to_ci_build_pending_state.rb b/db/post_migrate/20230126091522_add_unique_index_to_ci_build_pending_state.rb
new file mode 100644
index 00000000000..484b64feb97
--- /dev/null
+++ b/db/post_migrate/20230126091522_add_unique_index_to_ci_build_pending_state.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class AddUniqueIndexToCiBuildPendingState < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ OLD_INDEX_NAME = :index_ci_build_pending_states_on_partition_id_build_id
+ NEW_INDEX_NAME = :unique_index_ci_build_pending_states_on_partition_id_build_id
+ TABLE_NAME = :ci_build_pending_states
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, name: NEW_INDEX_NAME)
+
+ remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME)
+ end
+
+ def down
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: OLD_INDEX_NAME)
+
+ remove_concurrent_index_by_name(TABLE_NAME, NEW_INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230126133531_remove_not_null_constraints_for_tables_with_schema_differences_v3.rb b/db/post_migrate/20230126133531_remove_not_null_constraints_for_tables_with_schema_differences_v3.rb
new file mode 100644
index 00000000000..04ed7a7ee12
--- /dev/null
+++ b/db/post_migrate/20230126133531_remove_not_null_constraints_for_tables_with_schema_differences_v3.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveNotNullConstraintsForTablesWithSchemaDifferencesV3 < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ return unless Gitlab.com?
+
+ change_column_null :integrations, :updated_at, true
+ change_column_null :integrations, :created_at, true
+
+ change_column_null :project_settings, :show_default_award_emojis, true
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230127101834_backfill_merge_request_metrics_for_bigint_conversion.rb b/db/post_migrate/20230127101834_backfill_merge_request_metrics_for_bigint_conversion.rb
new file mode 100644
index 00000000000..02ef1c230da
--- /dev/null
+++ b/db/post_migrate/20230127101834_backfill_merge_request_metrics_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillMergeRequestMetricsForBigintConversion < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ TABLE = :merge_request_metrics
+ COLUMNS = %i[id]
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 200)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb b/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb
new file mode 100644
index 00000000000..1b16ac5c187
--- /dev/null
+++ b/db/post_migrate/20230127115607_add_hosted_plan_id_and_trial_index_to_gitlab_subscriptions.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddHostedPlanIdAndTrialIndexToGitlabSubscriptions < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id_and_trial'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :gitlab_subscriptions, [:hosted_plan_id, :trial], name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :gitlab_subscriptions, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230127123947_add_fk_index_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb b/db/post_migrate/20230127123947_add_fk_index_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb
new file mode 100644
index 00000000000..f2a9d362cc4
--- /dev/null
+++ b/db/post_migrate/20230127123947_add_fk_index_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiSourcesPipelinesOnSourcePartitionIdAndSourceJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_sources_pipelines_on_source_partition_id_source_job_id
+ TABLE_NAME = :ci_sources_pipelines
+ COLUMNS = [:source_partition_id, :source_job_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230127123948_add_fk_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb b/db/post_migrate/20230127123948_add_fk_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb
new file mode 100644
index 00000000000..7adf97268ff
--- /dev/null
+++ b/db/post_migrate/20230127123948_add_fk_to_ci_sources_pipelines_on_source_partition_id_and_source_job_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiSourcesPipelinesOnSourcePartitionIdAndSourceJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_sources_pipelines
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :source_job_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_be5624bf37_p
+ PARTITION_COLUMN = :source_partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [:partition_id, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb b/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb
new file mode 100644
index 00000000000..6cc21920748
--- /dev/null
+++ b/db/post_migrate/20230127125018_remove_hosted_plan_id_index_from_gitlab_subscriptions.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class RemoveHostedPlanIdIndexFromGitlabSubscriptions < Gitlab::Database::Migration[2.1]
+ OLD_INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id'
+ NEW_INDEX_NAME = 'index_gitlab_subscriptions_on_hosted_plan_id_and_trial'
+ TABLE = :gitlab_subscriptions
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name TABLE, OLD_INDEX_NAME if index_exists_by_name?(TABLE, NEW_INDEX_NAME)
+ end
+
+ def down
+ add_concurrent_index TABLE, :hosted_plan_id, name: OLD_INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb b/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb
new file mode 100644
index 00000000000..77ef7e7eba5
--- /dev/null
+++ b/db/post_migrate/20230127131835_add_application_settings_git_users_alertlist_max_usernames_constraint.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddApplicationSettingsGitUsersAlertlistMaxUsernamesConstraint < Gitlab::Database::Migration[2.1]
+ CONSTRAINT_NAME = 'app_settings_git_rate_limit_users_alertlist_max_usernames'
+
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint :application_settings, 'CARDINALITY(git_rate_limit_users_alertlist) <= 100', CONSTRAINT_NAME
+ end
+
+ def down
+ remove_check_constraint :application_settings, CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb b/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb
new file mode 100644
index 00000000000..0777d31aa3b
--- /dev/null
+++ b/db/post_migrate/20230127131915_add_namespace_settings_unique_project_download_limit_alertlist_size_constraint.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddNamespaceSettingsUniqueProjectDownloadLimitAlertlistSizeConstraint < Gitlab::Database::Migration[2.1]
+ CONSTRAINT_NAME = 'namespace_settings_unique_project_download_limit_alertlist_size'
+
+ disable_ddl_transaction!
+
+ def up
+ add_check_constraint :namespace_settings,
+ 'CARDINALITY(unique_project_download_limit_alertlist) <= 100',
+ CONSTRAINT_NAME
+ end
+
+ def down
+ remove_check_constraint :namespace_settings, CONSTRAINT_NAME
+ end
+end
diff --git a/db/post_migrate/20230127151606_add_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb b/db/post_migrate/20230127151606_add_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..a13ba0c21fb
--- /dev/null
+++ b/db/post_migrate/20230127151606_add_fk_index_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiBuildTraceMetadataOnPartitionIdAndBuildId < 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
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME, unique: true)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230127151607_add_fk_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb b/db/post_migrate/20230127151607_add_fk_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..389cfc6a4ec
--- /dev/null
+++ b/db/post_migrate/20230127151607_add_fk_to_ci_build_trace_metadata_on_partition_id_and_build_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiBuildTraceMetadataOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_trace_metadata
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_aebc78111f_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230127152727_add_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb b/db/post_migrate/20230127152727_add_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..66933fa600e
--- /dev/null
+++ b/db/post_migrate/20230127152727_add_fk_index_to_ci_job_artifacts_on_partition_id_and_job_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiJobArtifactsOnPartitionIdAndJobId < 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
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230127152728_add_fk_to_ci_job_artifacts_on_partition_id_and_job_id.rb b/db/post_migrate/20230127152728_add_fk_to_ci_job_artifacts_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..7c7cf7861ea
--- /dev/null
+++ b/db/post_migrate/20230127152728_add_fk_to_ci_job_artifacts_on_partition_id_and_job_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiJobArtifactsOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_job_artifacts
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :job_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_c5137cb2c1_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230127153229_add_fk_index_to_ci_job_variables_on_partition_id_and_job_id.rb b/db/post_migrate/20230127153229_add_fk_index_to_ci_job_variables_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..b06da3fc933
--- /dev/null
+++ b/db/post_migrate/20230127153229_add_fk_index_to_ci_job_variables_on_partition_id_and_job_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiJobVariablesOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_job_variables_on_partition_id_job_id
+ TABLE_NAME = :ci_job_variables
+ COLUMNS = [:partition_id, :job_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230127153230_add_fk_to_ci_job_variables_on_partition_id_and_job_id.rb b/db/post_migrate/20230127153230_add_fk_to_ci_job_variables_on_partition_id_and_job_id.rb
new file mode 100644
index 00000000000..7a6950fa96c
--- /dev/null
+++ b/db/post_migrate/20230127153230_add_fk_to_ci_job_variables_on_partition_id_and_job_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiJobVariablesOnPartitionIdAndJobId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_job_variables
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :job_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_fbf3b34792_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230130070623_add_index_on_packages_package_file_file_name.rb b/db/post_migrate/20230130070623_add_index_on_packages_package_file_file_name.rb
new file mode 100644
index 00000000000..d7b495df272
--- /dev/null
+++ b/db/post_migrate/20230130070623_add_index_on_packages_package_file_file_name.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddIndexOnPackagesPackageFileFileName < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_packages_package_files_on_file_name'
+
+ def up
+ prepare_async_index :packages_package_files, :file_name, name: INDEX_NAME, using: :gin,
+ opclass: { description: :gin_trgm_ops }
+ end
+
+ def down
+ unprepare_async_index :packages_package_files, :file_name, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230130073109_nullify_creator_id_of_orphaned_projects.rb b/db/post_migrate/20230130073109_nullify_creator_id_of_orphaned_projects.rb
new file mode 100644
index 00000000000..c13c6552c8e
--- /dev/null
+++ b/db/post_migrate/20230130073109_nullify_creator_id_of_orphaned_projects.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class NullifyCreatorIdOfOrphanedProjects < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ BATCH_SIZE = 1000
+ SUB_BATCH_SIZE = 500
+ MAX_BATCH_SIZE = 5000
+ MIGRATION = 'NullifyCreatorIdColumnOfOrphanedProjects'
+ INTERVAL = 2.minutes
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :projects,
+ :id,
+ job_interval: INTERVAL,
+ batch_size: BATCH_SIZE,
+ max_batch_size: MAX_BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :projects, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230130075434_schedule_tmp_index_to_ci_build_report_results.rb b/db/post_migrate/20230130075434_schedule_tmp_index_to_ci_build_report_results.rb
new file mode 100644
index 00000000000..778510e9fcb
--- /dev/null
+++ b/db/post_migrate/20230130075434_schedule_tmp_index_to_ci_build_report_results.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class ScheduleTmpIndexToCiBuildReportResults < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :tmp_index_ci_build_report_results_on_partition_id_and_build_id
+ TABLE_NAME = :ci_build_report_results
+
+ def up
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :build_id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230130084718_drop_invalid_async_index_from_postgres_async_index.rb b/db/post_migrate/20230130084718_drop_invalid_async_index_from_postgres_async_index.rb
new file mode 100644
index 00000000000..ebe28eb4088
--- /dev/null
+++ b/db/post_migrate/20230130084718_drop_invalid_async_index_from_postgres_async_index.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class DropInvalidAsyncIndexFromPostgresAsyncIndex < Gitlab::Database::Migration[2.1]
+ # rollback 20230117092947_add_tmp_index_to_ci_build_report_results.rb
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'tmp_index_ci_build_report_results_on_partition_id_and_id'
+ TABLE_NAME = 'ci_build_report_results'
+
+ def up
+ return unless Gitlab.com?
+
+ unprepare_async_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ prepare_async_index(TABLE_NAME, [:partition_id, :id], where: 'partition_id = 101', name: INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230130102855_add_fk_index_to_ci_build_report_results_on_partition_id_and_build_id.rb b/db/post_migrate/20230130102855_add_fk_index_to_ci_build_report_results_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..4fe71ba46d9
--- /dev/null
+++ b/db/post_migrate/20230130102855_add_fk_index_to_ci_build_report_results_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiBuildReportResultsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_build_report_results_on_partition_id_build_id
+ TABLE_NAME = :ci_build_report_results
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230130102856_add_fk_to_ci_build_report_results_on_partition_id_and_build_id.rb b/db/post_migrate/20230130102856_add_fk_to_ci_build_report_results_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..ef301af2c9f
--- /dev/null
+++ b/db/post_migrate/20230130102856_add_fk_to_ci_build_report_results_on_partition_id_and_build_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiBuildReportResultsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_report_results
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_16cb1ff064_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230130103957_add_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb b/db/post_migrate/20230130103957_add_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..cea4070a8be
--- /dev/null
+++ b/db/post_migrate/20230130103957_add_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddFkIndexToCiBuildNeedsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_build_needs_on_partition_id_build_id
+ TABLE_NAME = :ci_build_needs
+ COLUMNS = [:partition_id, :build_id]
+
+ def up
+ add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME)
+ end
+
+ def down
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+end
diff --git a/db/post_migrate/20230130103958_add_fk_to_ci_build_needs_on_partition_id_and_build_id.rb b/db/post_migrate/20230130103958_add_fk_to_ci_build_needs_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..46985f12ff9
--- /dev/null
+++ b/db/post_migrate/20230130103958_add_fk_to_ci_build_needs_on_partition_id_and_build_id.rb
@@ -0,0 +1,37 @@
+# frozen_string_literal: true
+
+class AddFkToCiBuildNeedsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :ci_build_needs
+ TARGET_TABLE_NAME = :ci_builds
+ COLUMN = :build_id
+ TARGET_COLUMN = :id
+ FK_NAME = :fk_rails_3cf221d4ed_p
+ PARTITION_COLUMN = :partition_id
+
+ def up
+ add_concurrent_foreign_key(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ column: [PARTITION_COLUMN, COLUMN],
+ target_column: [PARTITION_COLUMN, TARGET_COLUMN],
+ validate: false,
+ reverse_lock_order: true,
+ on_update: :cascade,
+ on_delete: :cascade,
+ name: FK_NAME
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+end
diff --git a/db/post_migrate/20230130202201_backfill_sent_notifications_for_bigint_conversion.rb b/db/post_migrate/20230130202201_backfill_sent_notifications_for_bigint_conversion.rb
new file mode 100644
index 00000000000..2c8efed8dc2
--- /dev/null
+++ b/db/post_migrate/20230130202201_backfill_sent_notifications_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillSentNotificationsForBigintConversion < Gitlab::Database::Migration[2.1]
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ TABLE = :sent_notifications
+ 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/post_migrate/20230131005411_backfill_notes_id_for_bigint_conversion.rb b/db/post_migrate/20230131005411_backfill_notes_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..b0ccc14e947
--- /dev/null
+++ b/db/post_migrate/20230131005411_backfill_notes_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillNotesIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :notes
+ COLUMNS = %i[id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 500)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb b/db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb
new file mode 100644
index 00000000000..57364e2200b
--- /dev/null
+++ b/db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class RemoveInvalidDeployAccessLevel < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ # clean up any rows with invalid access_level entries
+ def up
+ update_column_in_batches(:protected_environment_deploy_access_levels, :access_level, nil) do |table, query|
+ query.where(
+ table.grouping(table[:user_id].not_eq(nil).or(table[:group_id].not_eq(nil)))
+ .and(table[:access_level].not_eq(nil)))
+ end
+ end
+
+ def down
+ # no-op
+
+ # we are setting access_level to NULL if group_id or user_id are present
+ end
+end
diff --git a/db/post_migrate/20230131210921_prepare_index_for_vulnerability_reads_on_project_id_scanner_id_vulnerability_id.rb b/db/post_migrate/20230131210921_prepare_index_for_vulnerability_reads_on_project_id_scanner_id_vulnerability_id.rb
new file mode 100644
index 00000000000..0ac4e805f8a
--- /dev/null
+++ b/db/post_migrate/20230131210921_prepare_index_for_vulnerability_reads_on_project_id_scanner_id_vulnerability_id.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class PrepareIndexForVulnerabilityReadsOnProjectIdScannerIdVulnerabilityId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'idx_vulnerability_reads_project_id_scanner_id_vulnerability_id'
+
+ # Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/382625
+ def up
+ prepare_async_index :vulnerability_reads, [:project_id, :scanner_id, :vulnerability_id], name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :vulnerability_reads, [:project_id, :scanner_id, :vulnerability_id], name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230201012846_backfill_todos_note_id_for_bigint_conversion.rb b/db/post_migrate/20230201012846_backfill_todos_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..a105bea13ab
--- /dev/null
+++ b/db/post_migrate/20230201012846_backfill_todos_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillTodosNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :todos
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 500)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb b/db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..df24b755b7f
--- /dev/null
+++ b/db/post_migrate/20230201014238_backfill_system_note_metadata_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillSystemNoteMetadataNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :system_note_metadata
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
new file mode 100644
index 00000000000..7f90b3293d8
--- /dev/null
+++ b/db/post_migrate/20230201082038_drop_web_hook_calls_high_column.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class DropWebHookCallsHighColumn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ if column_exists?(:plan_limits, :web_hook_calls_high) # rubocop:disable Style/IfUnlessModifier
+ remove_column :plan_limits, :web_hook_calls_high
+ end
+ end
+ end
+
+ def down
+ with_lock_retries do
+ unless column_exists?(:plan_limits, :web_hook_calls_high)
+ # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ add_column :plan_limits, :web_hook_calls_high, :integer, default: 0
+ # rubocop:enable Migration/SchemaAdditionMethodsNoPost
+ end
+ end
+ end
+end
diff --git a/db/post_migrate/20230201152525_schedule_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb b/db/post_migrate/20230201152525_schedule_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb
new file mode 100644
index 00000000000..674d92295c3
--- /dev/null
+++ b/db/post_migrate/20230201152525_schedule_fk_index_to_ci_build_needs_on_partition_id_and_build_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ScheduleFkIndexToCiBuildNeedsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = :index_ci_build_needs_on_partition_id_build_id
+ TABLE_NAME = :ci_build_needs
+ COLUMNS = [:partition_id, :build_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/post_migrate/20230201153450_add_index_on_lfs_objects_file.rb b/db/post_migrate/20230201153450_add_index_on_lfs_objects_file.rb
new file mode 100644
index 00000000000..669b3faf3d6
--- /dev/null
+++ b/db/post_migrate/20230201153450_add_index_on_lfs_objects_file.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddIndexOnLfsObjectsFile < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_lfs_objects_on_file'
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/390401
+ def up
+ prepare_async_index :lfs_objects, :file, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :lfs_objects, :file, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230201171450_finalize_backfill_environment_tier_migration.rb b/db/post_migrate/20230201171450_finalize_backfill_environment_tier_migration.rb
new file mode 100644
index 00000000000..ae4062cb764
--- /dev/null
+++ b/db/post_migrate/20230201171450_finalize_backfill_environment_tier_migration.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class FinalizeBackfillEnvironmentTierMigration < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'BackfillEnvironmentTiers'
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ ensure_batched_background_migration_is_finished(
+ job_class_name: MIGRATION,
+ table_name: :environments,
+ column_name: :id,
+ job_arguments: [],
+ finalize: true
+ )
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..1f7af1af78f
--- /dev/null
+++ b/db/post_migrate/20230202002637_backfill_epic_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillEpicUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :epic_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230202004247_add_index_on_merge_request_diffs_external_diff.rb b/db/post_migrate/20230202004247_add_index_on_merge_request_diffs_external_diff.rb
new file mode 100644
index 00000000000..6f8cfced238
--- /dev/null
+++ b/db/post_migrate/20230202004247_add_index_on_merge_request_diffs_external_diff.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class AddIndexOnMergeRequestDiffsExternalDiff < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_merge_request_diffs_on_external_diff'
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/390399
+ def up
+ prepare_async_index :merge_request_diffs, :external_diff, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :merge_request_diffs, :external_diff, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230202023224_backfill_suggestions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230202023224_backfill_suggestions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..c4bd2ccf0c7
--- /dev/null
+++ b/db/post_migrate/20230202023224_backfill_suggestions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillSuggestionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :suggestions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..749a2f97d7c
--- /dev/null
+++ b/db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillIssueUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :issue_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 40_000, sub_batch_size: 500)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230202131928_encrypt_ci_trigger_token.rb b/db/post_migrate/20230202131928_encrypt_ci_trigger_token.rb
new file mode 100644
index 00000000000..c1cb40d1da1
--- /dev/null
+++ b/db/post_migrate/20230202131928_encrypt_ci_trigger_token.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class EncryptCiTriggerToken < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ MIGRATION = 'EncryptCiTriggerToken'
+ DELAY_INTERVAL = 2.minutes
+ BATCH_SIZE = 1_000
+ MAX_BATCH_SIZE = 2_000
+ SUB_BATCH_SIZE = 100
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :ci_triggers,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ max_batch_size: MAX_BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :ci_triggers, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230203122602_schedule_vulnerabilities_feedback_migration3.rb b/db/post_migrate/20230203122602_schedule_vulnerabilities_feedback_migration3.rb
new file mode 100644
index 00000000000..7fed726823b
--- /dev/null
+++ b/db/post_migrate/20230203122602_schedule_vulnerabilities_feedback_migration3.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+class ScheduleVulnerabilitiesFeedbackMigration3 < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateVulnerabilitiesFeedbackToVulnerabilitiesStateTransition'
+ TABLE_NAME = :vulnerability_feedback
+ BATCH_COLUMN = :id
+ DELAY_INTERVAL = 5.minutes
+ BATCH_SIZE = 250
+ MAX_BATCH_SIZE = 250
+ SUB_BATCH_SIZE = 50
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ # replaced by db/post_migrate/20230209171547_schedule_vulnerabilities_feedback_migration4.rb
+ # no-op
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230203122609_change_pipeline_name_index.rb b/db/post_migrate/20230203122609_change_pipeline_name_index.rb
new file mode 100644
index 00000000000..2f2fef82c9d
--- /dev/null
+++ b/db/post_migrate/20230203122609_change_pipeline_name_index.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class ChangePipelineNameIndex < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ OLD_INDEX_NAME = 'index_pipeline_metadata_on_pipeline_id_name_lower_text_pattern'
+ NEW_INDEX_NAME = 'index_pipeline_metadata_on_pipeline_id_name_text_pattern'
+
+ def up
+ add_concurrent_index :ci_pipeline_metadata, 'pipeline_id, name text_pattern_ops', name: NEW_INDEX_NAME
+
+ remove_concurrent_index_by_name :ci_pipeline_metadata, OLD_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :ci_pipeline_metadata, 'pipeline_id, lower(name) text_pattern_ops', name: OLD_INDEX_NAME
+
+ remove_concurrent_index_by_name :ci_pipeline_metadata, NEW_INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..ce53a855b2a
--- /dev/null
+++ b/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillNoteDiffFilesDiffNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :note_diff_files
+ COLUMNS = %i[diff_note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 40_000)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230207005701_backfill_snippet_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207005701_backfill_snippet_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..4d4c36bf8fc
--- /dev/null
+++ b/db/post_migrate/20230207005701_backfill_snippet_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillSnippetUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :snippet_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230207011414_backfill_design_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207011414_backfill_design_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..6e971bad382
--- /dev/null
+++ b/db/post_migrate/20230207011414_backfill_design_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillDesignUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :design_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230207012238_backfill_vulnerability_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207012238_backfill_vulnerability_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..e6d674c09ce
--- /dev/null
+++ b/db/post_migrate/20230207012238_backfill_vulnerability_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillVulnerabilityUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :vulnerability_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230207015850_backfill_commit_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207015850_backfill_commit_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..d690c00dc7c
--- /dev/null
+++ b/db/post_migrate/20230207015850_backfill_commit_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillCommitUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :commit_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/post_migrate/20230207025315_backfill_merge_request_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207025315_backfill_merge_request_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..127c1c17bce
--- /dev/null
+++ b/db/post_migrate/20230207025315_backfill_merge_request_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillMergeRequestUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :merge_request_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 30_000, sub_batch_size: 500)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230207030259_backfill_timelogs_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207030259_backfill_timelogs_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..e88b810d813
--- /dev/null
+++ b/db/post_migrate/20230207030259_backfill_timelogs_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillTimelogsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :timelogs
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ 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/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/post_migrate/20230208100917_fix_partition_ids_for_ci_pipeline_variable.rb b/db/post_migrate/20230208100917_fix_partition_ids_for_ci_pipeline_variable.rb
new file mode 100644
index 00000000000..9901e6af4ae
--- /dev/null
+++ b/db/post_migrate/20230208100917_fix_partition_ids_for_ci_pipeline_variable.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiPipelineVariable < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes.freeze
+ TABLE = :ci_pipeline_variables
+ BATCH_SIZE = 2_000
+ SUB_BATCH_SIZE = 200
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230208103009_fix_partition_ids_for_ci_job_artifact.rb b/db/post_migrate/20230208103009_fix_partition_ids_for_ci_job_artifact.rb
new file mode 100644
index 00000000000..d1b25639638
--- /dev/null
+++ b/db/post_migrate/20230208103009_fix_partition_ids_for_ci_job_artifact.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiJobArtifact < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes
+ TABLE = :ci_job_artifacts
+ BATCH_SIZE = 5_000
+ SUB_BATCH_SIZE = 500
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230208110638_cleanup_ci_runner_machines_machine_xid_rename.rb b/db/post_migrate/20230208110638_cleanup_ci_runner_machines_machine_xid_rename.rb
new file mode 100644
index 00000000000..b596d7773ae
--- /dev/null
+++ b/db/post_migrate/20230208110638_cleanup_ci_runner_machines_machine_xid_rename.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class CleanupCiRunnerMachinesMachineXidRename < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ cleanup_concurrent_column_rename :ci_runner_machines, :machine_xid, :system_xid
+ end
+
+ def down
+ undo_cleanup_concurrent_column_rename :ci_runner_machines, :machine_xid, :system_xid
+ end
+end
diff --git a/db/post_migrate/20230208132608_fix_partition_ids_for_ci_stage.rb b/db/post_migrate/20230208132608_fix_partition_ids_for_ci_stage.rb
new file mode 100644
index 00000000000..c3ec614a37f
--- /dev/null
+++ b/db/post_migrate/20230208132608_fix_partition_ids_for_ci_stage.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiStage < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes.freeze
+ TABLE = :ci_stages
+ BATCH_SIZE = 3_000
+ SUB_BATCH_SIZE = 300
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230209090702_fix_partition_ids_for_ci_build_report_result.rb b/db/post_migrate/20230209090702_fix_partition_ids_for_ci_build_report_result.rb
new file mode 100644
index 00000000000..d21d986ee31
--- /dev/null
+++ b/db/post_migrate/20230209090702_fix_partition_ids_for_ci_build_report_result.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiBuildReportResult < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes.freeze
+ TABLE = :ci_build_report_results
+ BATCH_SIZE = 2_000
+ SUB_BATCH_SIZE = 200
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :build_id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :build_id, [])
+ end
+end
diff --git a/db/post_migrate/20230209092204_fix_partition_ids_for_ci_build_trace_metadata.rb b/db/post_migrate/20230209092204_fix_partition_ids_for_ci_build_trace_metadata.rb
new file mode 100644
index 00000000000..25087dcbfa4
--- /dev/null
+++ b/db/post_migrate/20230209092204_fix_partition_ids_for_ci_build_trace_metadata.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiBuildTraceMetadata < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes.freeze
+ TABLE = :ci_build_trace_metadata
+ BATCH_SIZE = 3_000
+ SUB_BATCH_SIZE = 300
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :build_id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :build_id, [])
+ end
+end
diff --git a/db/post_migrate/20230209103650_add_unique_software_license_policies_index_on_project_and_scan_result_policy.rb b/db/post_migrate/20230209103650_add_unique_software_license_policies_index_on_project_and_scan_result_policy.rb
new file mode 100644
index 00000000000..b3e6c42370a
--- /dev/null
+++ b/db/post_migrate/20230209103650_add_unique_software_license_policies_index_on_project_and_scan_result_policy.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class AddUniqueSoftwareLicensePoliciesIndexOnProjectAndScanResultPolicy < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'idx_software_license_policies_unique_on_project_and_scan_policy'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :software_license_policies,
+ [:project_id, :software_license_id, :scan_result_policy_id],
+ unique: true,
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :software_license_policies, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230209103714_add_fk_to_approval_rules_on_scan_result_policy_id.rb b/db/post_migrate/20230209103714_add_fk_to_approval_rules_on_scan_result_policy_id.rb
new file mode 100644
index 00000000000..cfc2c33b32a
--- /dev/null
+++ b/db/post_migrate/20230209103714_add_fk_to_approval_rules_on_scan_result_policy_id.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddFkToApprovalRulesOnScanResultPolicyId < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_foreign_key :approval_project_rules,
+ :scan_result_policies,
+ column: :scan_result_policy_id,
+ on_delete: :cascade,
+ reverse_lock_order: true
+ add_concurrent_foreign_key :approval_merge_request_rules,
+ :scan_result_policies,
+ column: :scan_result_policy_id,
+ on_delete: :cascade,
+ reverse_lock_order: true
+ end
+
+ def down
+ remove_foreign_key_if_exists :approval_project_rules, column: :scan_result_policy_id
+ remove_foreign_key_if_exists :approval_merge_request_rules, column: :scan_result_policy_id
+ end
+end
diff --git a/db/post_migrate/20230209123006_remove_unique_software_license_policies_index_on_project.rb b/db/post_migrate/20230209123006_remove_unique_software_license_policies_index_on_project.rb
new file mode 100644
index 00000000000..5c69fc6d9fe
--- /dev/null
+++ b/db/post_migrate/20230209123006_remove_unique_software_license_policies_index_on_project.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class RemoveUniqueSoftwareLicensePoliciesIndexOnProject < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'index_software_license_policies_unique_per_project'
+
+ disable_ddl_transaction!
+
+ def up
+ remove_concurrent_index_by_name :software_license_policies, INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :software_license_policies, [:project_id, :software_license_id], unique: true, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230209131808_recount_epic_cache_counts_v3.rb b/db/post_migrate/20230209131808_recount_epic_cache_counts_v3.rb
new file mode 100644
index 00000000000..6252a300453
--- /dev/null
+++ b/db/post_migrate/20230209131808_recount_epic_cache_counts_v3.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class RecountEpicCacheCountsV3 < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'ThirdRecountEpicCacheCounts'
+ DELAY_INTERVAL = 2.minutes.to_i
+ BATCH_SIZE = 200
+ MAX_BATCH_SIZE = 1000
+ SUB_BATCH_SIZE = 20
+
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ queue_batched_background_migration(
+ MIGRATION,
+ :epics,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ max_batch_size: MAX_BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE,
+ gitlab_schema: :gitlab_main
+ )
+ end
+
+ def down
+ delete_batched_background_migration(MIGRATION, :epics, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230209140102_fix_partition_ids_for_ci_build_metadata.rb b/db/post_migrate/20230209140102_fix_partition_ids_for_ci_build_metadata.rb
new file mode 100644
index 00000000000..07fcbcc3ad7
--- /dev/null
+++ b/db/post_migrate/20230209140102_fix_partition_ids_for_ci_build_metadata.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiBuildMetadata < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'RebalancePartitionId'
+ DELAY_INTERVAL = 2.minutes
+ TABLE = :p_ci_builds_metadata
+ BATCH_SIZE = 5_000
+ SUB_BATCH_SIZE = 500
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ return unless Gitlab.com?
+
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE,
+ :id,
+ job_interval: DELAY_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ return unless Gitlab.com?
+
+ delete_batched_background_migration(MIGRATION, TABLE, :id, [])
+ end
+end
diff --git a/db/post_migrate/20230209171547_schedule_vulnerabilities_feedback_migration4.rb b/db/post_migrate/20230209171547_schedule_vulnerabilities_feedback_migration4.rb
new file mode 100644
index 00000000000..fb2f8fd65cc
--- /dev/null
+++ b/db/post_migrate/20230209171547_schedule_vulnerabilities_feedback_migration4.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+class ScheduleVulnerabilitiesFeedbackMigration4 < Gitlab::Database::Migration[2.1]
+ MIGRATION = 'MigrateVulnerabilitiesFeedbackToVulnerabilitiesStateTransition'
+ TABLE_NAME = :vulnerability_feedback
+ BATCH_COLUMN = :id
+ JOB_INTERVAL = 2.minutes
+ BATCH_SIZE = 250
+ SUB_BATCH_SIZE = 5
+
+ disable_ddl_transaction!
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ # Delete the previous jobs
+ delete_batched_background_migration(
+ MIGRATION,
+ TABLE_NAME,
+ BATCH_COLUMN,
+ []
+ )
+
+ # Reschedule the migration
+ queue_batched_background_migration(
+ MIGRATION,
+ TABLE_NAME,
+ BATCH_COLUMN,
+ job_interval: JOB_INTERVAL,
+ batch_size: BATCH_SIZE,
+ sub_batch_size: SUB_BATCH_SIZE
+ )
+ end
+
+ def down
+ delete_batched_background_migration(
+ MIGRATION,
+ TABLE_NAME,
+ BATCH_COLUMN,
+ []
+ )
+ end
+end
diff --git a/db/post_migrate/20230210113924_prepare_index_approval_rules_on_scan_result_policy_id.rb b/db/post_migrate/20230210113924_prepare_index_approval_rules_on_scan_result_policy_id.rb
new file mode 100644
index 00000000000..5776d6f737e
--- /dev/null
+++ b/db/post_migrate/20230210113924_prepare_index_approval_rules_on_scan_result_policy_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class PrepareIndexApprovalRulesOnScanResultPolicyId < Gitlab::Database::Migration[2.1]
+ PROJECT_INDEX_NAME = 'idx_approval_project_rules_on_scan_result_policy_id'
+ MERGE_REQUEST_INDEX_NAME = 'idx_approval_merge_request_rules_on_scan_result_policy_id'
+
+ # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/391312
+ def up
+ prepare_async_index :approval_project_rules, :scan_result_policy_id, name: PROJECT_INDEX_NAME
+ prepare_async_index :approval_merge_request_rules, :scan_result_policy_id, name: MERGE_REQUEST_INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :approval_project_rules, :scan_result_policy_id, name: PROJECT_INDEX_NAME
+ unprepare_async_index :approval_merge_request_rules, :scan_result_policy_id, name: MERGE_REQUEST_INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230214122717_fix_partition_ids_for_ci_job_variables.rb b/db/post_migrate/20230214122717_fix_partition_ids_for_ci_job_variables.rb
new file mode 100644
index 00000000000..0a201c51467
--- /dev/null
+++ b/db/post_migrate/20230214122717_fix_partition_ids_for_ci_job_variables.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsForCiJobVariables < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ BATCH_SIZE = 50
+
+ def up
+ return unless Gitlab.com?
+
+ define_batchable_model(:ci_job_variables)
+ .where(partition_id: 101)
+ .each_batch(of: BATCH_SIZE) do |batch|
+ batch.update_all(partition_id: 100)
+ sleep 0.1
+ end
+ end
+
+ def down
+ # no-op
+ end
+end
diff --git a/db/post_migrate/20230214154101_fix_partition_ids_on_ci_sources_pipelines.rb b/db/post_migrate/20230214154101_fix_partition_ids_on_ci_sources_pipelines.rb
new file mode 100644
index 00000000000..c05b759c2d0
--- /dev/null
+++ b/db/post_migrate/20230214154101_fix_partition_ids_on_ci_sources_pipelines.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+class FixPartitionIdsOnCiSourcesPipelines < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ BATCH_SIZE = 50
+
+ def up
+ return unless Gitlab.com?
+
+ model = define_batchable_model(:ci_sources_pipelines)
+
+ batch_update_records(model, :partition_id, from: 101, to: 100, source_partition_id: 100)
+ batch_update_records(model, :source_partition_id, from: 101, to: 100)
+ end
+
+ def down
+ # no-op
+ end
+
+ private
+
+ def batch_update_records(model, column, from:, to:, **updates)
+ updates.reverse_merge!(column => to)
+
+ model
+ .where(model.arel_table[column].eq(from))
+ .each_batch(of: BATCH_SIZE) { |batch| update_records(batch, updates) }
+ end
+
+ def update_records(relation, updates)
+ relation.update_all(updates)
+ sleep 0.1
+ end
+end
diff --git a/db/post_migrate/20230214174335_prepare_async_index_web_hook_logs.rb b/db/post_migrate/20230214174335_prepare_async_index_web_hook_logs.rb
new file mode 100644
index 00000000000..536f0750b91
--- /dev/null
+++ b/db/post_migrate/20230214174335_prepare_async_index_web_hook_logs.rb
@@ -0,0 +1,39 @@
+# frozen_string_literal: true
+
+class PrepareAsyncIndexWebHookLogs < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::PartitioningMigrationHelpers
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_web_hook_logs_on_web_hook_id_and_created_at'
+
+ def up
+ # Since web_hook_logs is a partitioned table, we need to prepare the index
+ # for each partition individually. We can't use the `prepare_async_index`
+ # method directly because it will try to prepare the index for the whole
+ # table, which will fail.
+
+ # In a future migration, we will create the index on the parent table itself.
+ each_partition(:web_hook_logs) do |partition, partition_index_name|
+ prepare_async_index(partition.identifier, [:web_hook_id, :created_at],
+ name: partition_index_name)
+ end
+ end
+
+ def down
+ each_partition(:web_hook_logs) do |partition, partition_index_name|
+ unprepare_async_index_by_name(partition.identifier, partition_index_name)
+ end
+ end
+
+ private
+
+ def each_partition(table_name)
+ partitioned_table = find_partitioned_table(table_name)
+ partitioned_table.postgres_partitions.order(:name).each do |partition|
+ partition_index_name = generated_index_name(partition.identifier, INDEX_NAME)
+
+ yield partition, partition_index_name
+ end
+ end
+end
diff --git a/db/post_migrate/20230216035802_prepare_async_foreign_key_validation_for_ci_build_needs.rb b/db/post_migrate/20230216035802_prepare_async_foreign_key_validation_for_ci_build_needs.rb
new file mode 100644
index 00000000000..1c3215a6691
--- /dev/null
+++ b/db/post_migrate/20230216035802_prepare_async_foreign_key_validation_for_ci_build_needs.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class PrepareAsyncForeignKeyValidationForCiBuildNeeds < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_build_needs
+ COLUMN_NAMES = [:partition_id, :build_id]
+ FOREIGN_KEY_NAME = :fk_rails_3cf221d4ed_p
+
+ def up
+ prepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_NAME)
+ end
+
+ def down
+ unprepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_NAME)
+ end
+end
diff --git a/db/post_migrate/20230216052103_prepare_async_foreign_key_validation_for_ci_build_report_results.rb b/db/post_migrate/20230216052103_prepare_async_foreign_key_validation_for_ci_build_report_results.rb
new file mode 100644
index 00000000000..e9add3fd2ae
--- /dev/null
+++ b/db/post_migrate/20230216052103_prepare_async_foreign_key_validation_for_ci_build_report_results.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class PrepareAsyncForeignKeyValidationForCiBuildReportResults < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_build_report_results
+ COLUMN_NAMES = [:partition_id, :build_id]
+ FOREIGN_KEY_NAME = :fk_rails_16cb1ff064_p
+
+ def up
+ prepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_NAME)
+ end
+
+ def down
+ unprepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_NAME)
+ end
+end
diff --git a/db/post_migrate/20230216054348_prepare_async_foreign_key_validation_for_ci_job_artifacts.rb b/db/post_migrate/20230216054348_prepare_async_foreign_key_validation_for_ci_job_artifacts.rb
new file mode 100644
index 00000000000..6d545361e10
--- /dev/null
+++ b/db/post_migrate/20230216054348_prepare_async_foreign_key_validation_for_ci_job_artifacts.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class PrepareAsyncForeignKeyValidationForCiJobArtifacts < Gitlab::Database::Migration[2.1]
+ TABLE_NAME = :ci_job_artifacts
+ COLUMN_NAMES = [:partition_id, :job_id]
+ FOREIGN_KEY_NAME = :fk_rails_c5137cb2c1_p
+
+ def up
+ prepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_NAME)
+ end
+
+ def down
+ unprepare_async_foreign_key_validation(TABLE_NAME, COLUMN_NAMES, name: FOREIGN_KEY_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/20210604070207 b/db/schema_migrations/20210604070207
deleted file mode 100644
index 3531c9775bd..00000000000
--- a/db/schema_migrations/20210604070207
+++ /dev/null
@@ -1 +0,0 @@
-ec44b7f134de2ea6537c6fe3109fa9d7e32785233f3d1b8e9ea118474d21526a \ 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/20221116134507 b/db/schema_migrations/20221116134507
new file mode 100644
index 00000000000..cb761de5adb
--- /dev/null
+++ b/db/schema_migrations/20221116134507
@@ -0,0 +1 @@
+80504a4700681db9e46d729f4175dc077fae7e1b0235c9178558293b83f7a006 \ No newline at end of file
diff --git a/db/schema_migrations/20221116134539 b/db/schema_migrations/20221116134539
new file mode 100644
index 00000000000..4f25094c3a8
--- /dev/null
+++ b/db/schema_migrations/20221116134539
@@ -0,0 +1 @@
+dd36d2586454c8799effa598c0a058a6adf332622877eae16dd95d468f9b3958 \ No newline at end of file
diff --git a/db/schema_migrations/20221116134611 b/db/schema_migrations/20221116134611
new file mode 100644
index 00000000000..9e47c46b7e3
--- /dev/null
+++ b/db/schema_migrations/20221116134611
@@ -0,0 +1 @@
+0668760d6df566ac3081bd9fa2a053497da7a7af652225e91831110435166dcb \ No newline at end of file
diff --git a/db/schema_migrations/20221116134633 b/db/schema_migrations/20221116134633
new file mode 100644
index 00000000000..3f89ce1ff9d
--- /dev/null
+++ b/db/schema_migrations/20221116134633
@@ -0,0 +1 @@
+ceaf6a2b15da0dde23ba37f1166aa5135a9dce1abbe9fca81a12a41cc0319fd9 \ No newline at end of file
diff --git a/db/schema_migrations/20221128155738 b/db/schema_migrations/20221128155738
new file mode 100644
index 00000000000..5322aa1f75e
--- /dev/null
+++ b/db/schema_migrations/20221128155738
@@ -0,0 +1 @@
+39ca72ad461ff7b56ce6feed351ef46ee9f3584a8c3c9383ca75f44b61baa1a1 \ No newline at end of file
diff --git a/db/schema_migrations/20221128165833 b/db/schema_migrations/20221128165833
new file mode 100644
index 00000000000..e2aeaa26c32
--- /dev/null
+++ b/db/schema_migrations/20221128165833
@@ -0,0 +1 @@
+4f4846fe8e5f84ee566dfc8f9b8249e1ff1d77f8f6c2f0006d89a73a2e734b9d \ No newline at end of file
diff --git a/db/schema_migrations/20221216145659 b/db/schema_migrations/20221216145659
new file mode 100644
index 00000000000..9ff23376bd9
--- /dev/null
+++ b/db/schema_migrations/20221216145659
@@ -0,0 +1 @@
+aacb19ddcf902b9f0ad07f113b2fbd1c9d408b707ad62880ef058ff5b129b456 \ No newline at end of file
diff --git a/db/schema_migrations/20221219112632 b/db/schema_migrations/20221219112632
new file mode 100644
index 00000000000..0bba0080af7
--- /dev/null
+++ b/db/schema_migrations/20221219112632
@@ -0,0 +1 @@
+400cab0a2d3130dd7406024cf982c7312918019197ae06af06696435f6bb5aaa \ No newline at end of file
diff --git a/db/schema_migrations/20221219122320 b/db/schema_migrations/20221219122320
new file mode 100644
index 00000000000..bac9b8181c4
--- /dev/null
+++ b/db/schema_migrations/20221219122320
@@ -0,0 +1 @@
+8c4a83a223ae23e3d56665a584af192311459d18af228d71b868775c368086a7 \ No newline at end of file
diff --git a/db/schema_migrations/20221228072549 b/db/schema_migrations/20221228072549
new file mode 100644
index 00000000000..e0079614de0
--- /dev/null
+++ b/db/schema_migrations/20221228072549
@@ -0,0 +1 @@
+2935444c762f3fdc8bd04055fc6048be4b637d2136e71a84479135e44c50856b \ No newline at end of file
diff --git a/db/schema_migrations/20221228073206 b/db/schema_migrations/20221228073206
new file mode 100644
index 00000000000..cbd5116deea
--- /dev/null
+++ b/db/schema_migrations/20221228073206
@@ -0,0 +1 @@
+0105a4d40b8ecb6e4c1bc543001f223bf9bbb25c03288dd394859d4926bb4801 \ No newline at end of file
diff --git a/db/schema_migrations/20221229064959 b/db/schema_migrations/20221229064959
new file mode 100644
index 00000000000..545aa310068
--- /dev/null
+++ b/db/schema_migrations/20221229064959
@@ -0,0 +1 @@
+052f83d45f263bc95b80081af9c3086b6677b49e503ddc11770f444d7abd7e45 \ No newline at end of file
diff --git a/db/schema_migrations/20230102131000 b/db/schema_migrations/20230102131000
new file mode 100644
index 00000000000..2c0fa2c3f2a
--- /dev/null
+++ b/db/schema_migrations/20230102131000
@@ -0,0 +1 @@
+13b992cf6f30efc7a82062c5184f3e8398704c01e73618c6dd38071ee67595e1 \ No newline at end of file
diff --git a/db/schema_migrations/20230102131050 b/db/schema_migrations/20230102131050
new file mode 100644
index 00000000000..03e9292d7e5
--- /dev/null
+++ b/db/schema_migrations/20230102131050
@@ -0,0 +1 @@
+4933fd938c23b99963542c2f7e1f50e0270f6817ce49b0864fc7bdad63ea98b3 \ No newline at end of file
diff --git a/db/schema_migrations/20230102131100 b/db/schema_migrations/20230102131100
new file mode 100644
index 00000000000..86af671bfe6
--- /dev/null
+++ b/db/schema_migrations/20230102131100
@@ -0,0 +1 @@
+889e814bc9633481afeae8e63bfe080bfc956839fd5f97c0d39725f3acdff100 \ No newline at end of file
diff --git a/db/schema_migrations/20230102180341 b/db/schema_migrations/20230102180341
new file mode 100644
index 00000000000..bc153e07b1a
--- /dev/null
+++ b/db/schema_migrations/20230102180341
@@ -0,0 +1 @@
+1ed2531b3655b46f67c523f4a588471b1b0cb291b24c9491e6efe89d644546d8 \ No newline at end of file
diff --git a/db/schema_migrations/20230104201524 b/db/schema_migrations/20230104201524
new file mode 100644
index 00000000000..e98bb08fe2f
--- /dev/null
+++ b/db/schema_migrations/20230104201524
@@ -0,0 +1 @@
+e27a0a61f6807352c02ddf7c0bd44a86e3c244051fa3977f597cc92e83fcb0d1 \ No newline at end of file
diff --git a/db/schema_migrations/20230104222438 b/db/schema_migrations/20230104222438
new file mode 100644
index 00000000000..9390a389376
--- /dev/null
+++ b/db/schema_migrations/20230104222438
@@ -0,0 +1 @@
+4d6f00bb2679beaac6952d5324c9c3b36c54b5b7bf85fd18e57bdace9bb0ceb6 \ No newline at end of file
diff --git a/db/schema_migrations/20230104222514 b/db/schema_migrations/20230104222514
new file mode 100644
index 00000000000..070e537614c
--- /dev/null
+++ b/db/schema_migrations/20230104222514
@@ -0,0 +1 @@
+2647722de5ee25c720772c61b516ecf6f1121a83269c53381568ce0a349750a3 \ No newline at end of file
diff --git a/db/schema_migrations/20230106014423 b/db/schema_migrations/20230106014423
new file mode 100644
index 00000000000..f4fc4137ffd
--- /dev/null
+++ b/db/schema_migrations/20230106014423
@@ -0,0 +1 @@
+1551efcbb268bdb564647fb36ad700b995a8296229a858a3c82cb36ff3cff673 \ No newline at end of file
diff --git a/db/schema_migrations/20230106184809 b/db/schema_migrations/20230106184809
new file mode 100644
index 00000000000..95318b9ea02
--- /dev/null
+++ b/db/schema_migrations/20230106184809
@@ -0,0 +1 @@
+dad6e8972db3829dc6c02013ee87b08aa9bf4c50e58b35b0dbd67935ee4c266a \ No newline at end of file
diff --git a/db/schema_migrations/20230107125328 b/db/schema_migrations/20230107125328
new file mode 100644
index 00000000000..94ba5596a06
--- /dev/null
+++ b/db/schema_migrations/20230107125328
@@ -0,0 +1 @@
+741599316bd51b0d454e49c43a06b834d8d172f3fd1dcd28996494da8fdf5d8b \ No newline at end of file
diff --git a/db/schema_migrations/20230109093043 b/db/schema_migrations/20230109093043
new file mode 100644
index 00000000000..5a5f9ed2180
--- /dev/null
+++ b/db/schema_migrations/20230109093043
@@ -0,0 +1 @@
+98252d08d480287f1014d7b7c46eafdaa53b9582607e87d5169ec7c314b56ccc \ No newline at end of file
diff --git a/db/schema_migrations/20230109095622 b/db/schema_migrations/20230109095622
new file mode 100644
index 00000000000..1a0f0c80918
--- /dev/null
+++ b/db/schema_migrations/20230109095622
@@ -0,0 +1 @@
+a567168b41dc56069e485ef303aeb69b967e685d463ed44d99f54dc96cdf9bbd \ No newline at end of file
diff --git a/db/schema_migrations/20230109100044 b/db/schema_migrations/20230109100044
new file mode 100644
index 00000000000..6e72af38f8f
--- /dev/null
+++ b/db/schema_migrations/20230109100044
@@ -0,0 +1 @@
+052c36d0911e104f8bc42f3229170c234f3c61555f53712adbfee6ab385233b3 \ No newline at end of file
diff --git a/db/schema_migrations/20230109144915 b/db/schema_migrations/20230109144915
new file mode 100644
index 00000000000..3aa06a8e06c
--- /dev/null
+++ b/db/schema_migrations/20230109144915
@@ -0,0 +1 @@
+af5a388ec9716c4ad7e1b513c672aee382e56f859bfbc5b4bd238a6d3c3c2155 \ No newline at end of file
diff --git a/db/schema_migrations/20230109144928 b/db/schema_migrations/20230109144928
new file mode 100644
index 00000000000..e8491d35e6f
--- /dev/null
+++ b/db/schema_migrations/20230109144928
@@ -0,0 +1 @@
+1eb5fb28c64d25991587b61821293bb94216a7753b3444568ab389cd1fbfe416 \ No newline at end of file
diff --git a/db/schema_migrations/20230109144941 b/db/schema_migrations/20230109144941
new file mode 100644
index 00000000000..a9ddefa2314
--- /dev/null
+++ b/db/schema_migrations/20230109144941
@@ -0,0 +1 @@
+9a10f3fdd239fb65b36d9820474adbf804a2f93f14a11b33007946872e637e36 \ No newline at end of file
diff --git a/db/schema_migrations/20230109144953 b/db/schema_migrations/20230109144953
new file mode 100644
index 00000000000..b677a0cba24
--- /dev/null
+++ b/db/schema_migrations/20230109144953
@@ -0,0 +1 @@
+da3526f94be5d3ae58c2f12efc725cc9782d6611f4c75cdb02af501eb97437a7 \ No newline at end of file
diff --git a/db/schema_migrations/20230109145005 b/db/schema_migrations/20230109145005
new file mode 100644
index 00000000000..703e57b88c5
--- /dev/null
+++ b/db/schema_migrations/20230109145005
@@ -0,0 +1 @@
+5d094f7f2425ce48874af990cdda371da5956c70c4c520c85ba20ce243518b70 \ No newline at end of file
diff --git a/db/schema_migrations/20230109145018 b/db/schema_migrations/20230109145018
new file mode 100644
index 00000000000..0d89853b931
--- /dev/null
+++ b/db/schema_migrations/20230109145018
@@ -0,0 +1 @@
+7285f96cefaecee6fb83d16bfa0559c967cb28269a9ebaf806e16c5c9850c7fb \ No newline at end of file
diff --git a/db/schema_migrations/20230109232316 b/db/schema_migrations/20230109232316
new file mode 100644
index 00000000000..813483d4496
--- /dev/null
+++ b/db/schema_migrations/20230109232316
@@ -0,0 +1 @@
+94981a0226e10e8f1c711e5b3e110486c019595b822c5d8bf728285233ebd22b \ No newline at end of file
diff --git a/db/schema_migrations/20230110212906 b/db/schema_migrations/20230110212906
new file mode 100644
index 00000000000..9a8bf353b09
--- /dev/null
+++ b/db/schema_migrations/20230110212906
@@ -0,0 +1 @@
+0b186a286daefba0149e5b5b34a82109a6d8d67227b3ae9197182d0af97dce43 \ No newline at end of file
diff --git a/db/schema_migrations/20230111171355 b/db/schema_migrations/20230111171355
new file mode 100644
index 00000000000..453c56f562d
--- /dev/null
+++ b/db/schema_migrations/20230111171355
@@ -0,0 +1 @@
+add0aa50627dd4a76e090c72d816f071113c59e96ed8eeb6733c93554b1a8a6f \ No newline at end of file
diff --git a/db/schema_migrations/20230111174113 b/db/schema_migrations/20230111174113
new file mode 100644
index 00000000000..99b63468318
--- /dev/null
+++ b/db/schema_migrations/20230111174113
@@ -0,0 +1 @@
+e91e041c1bec4b92128c7e3d2cb2319b96bc399b5aff5c165d57581aa023f2b4 \ No newline at end of file
diff --git a/db/schema_migrations/20230112051854 b/db/schema_migrations/20230112051854
new file mode 100644
index 00000000000..5082b8bfad7
--- /dev/null
+++ b/db/schema_migrations/20230112051854
@@ -0,0 +1 @@
+16e7446f8fba7fe0b76559432ac6ecc30261a5775b9f914c77425ceab3b92315 \ No newline at end of file
diff --git a/db/schema_migrations/20230112141236 b/db/schema_migrations/20230112141236
new file mode 100644
index 00000000000..6f22c27eb01
--- /dev/null
+++ b/db/schema_migrations/20230112141236
@@ -0,0 +1 @@
+d313ee9c99032255e491c1d2113d4ab07c4619287b5bceeb64ee08235f88f434 \ No newline at end of file
diff --git a/db/schema_migrations/20230112144946 b/db/schema_migrations/20230112144946
new file mode 100644
index 00000000000..e9e307791f5
--- /dev/null
+++ b/db/schema_migrations/20230112144946
@@ -0,0 +1 @@
+a2cb76b2138b3edc014c01c4b130fcd58bf81a10c68c897376f5bf8d69d5a660 \ No newline at end of file
diff --git a/db/schema_migrations/20230112145326 b/db/schema_migrations/20230112145326
new file mode 100644
index 00000000000..1878bebba66
--- /dev/null
+++ b/db/schema_migrations/20230112145326
@@ -0,0 +1 @@
+97a52b54895ff5f5ea3c2dac6148c8d8110081bffe9064c50547b776ec56e78a \ No newline at end of file
diff --git a/db/schema_migrations/20230113195141 b/db/schema_migrations/20230113195141
new file mode 100644
index 00000000000..f64f9ce41f2
--- /dev/null
+++ b/db/schema_migrations/20230113195141
@@ -0,0 +1 @@
+3e69f6ab127ec01a005ad1de935500fd4bf5528745cec88139aa2917b2a07abf \ No newline at end of file
diff --git a/db/schema_migrations/20230116143310 b/db/schema_migrations/20230116143310
new file mode 100644
index 00000000000..c33f9990531
--- /dev/null
+++ b/db/schema_migrations/20230116143310
@@ -0,0 +1 @@
+992b178c63147915cf4f45c9ff7e9853fd69dc23c5dec758ea1707c5d5f0db47 \ No newline at end of file
diff --git a/db/schema_migrations/20230116143311 b/db/schema_migrations/20230116143311
new file mode 100644
index 00000000000..fca11c68a25
--- /dev/null
+++ b/db/schema_migrations/20230116143311
@@ -0,0 +1 @@
+a447880939f84f9c9e0b1d4afd2bc8a73bf930798b44a66387b350136ab822c9 \ No newline at end of file
diff --git a/db/schema_migrations/20230116143312 b/db/schema_migrations/20230116143312
new file mode 100644
index 00000000000..f704f78d6f8
--- /dev/null
+++ b/db/schema_migrations/20230116143312
@@ -0,0 +1 @@
+0df7cea4aee522e901ea673debf4244ba2f9b85059fd6ee3b2d46a8171d85fe2 \ No newline at end of file
diff --git a/db/schema_migrations/20230116160904 b/db/schema_migrations/20230116160904
new file mode 100644
index 00000000000..278ed9bd572
--- /dev/null
+++ b/db/schema_migrations/20230116160904
@@ -0,0 +1 @@
+b699539dfc4453d93c64b6b3532531ec9000d61cfc81ae5267c2c52eb489632f \ No newline at end of file
diff --git a/db/schema_migrations/20230117092947 b/db/schema_migrations/20230117092947
new file mode 100644
index 00000000000..4eeca7e3526
--- /dev/null
+++ b/db/schema_migrations/20230117092947
@@ -0,0 +1 @@
+775eb98fc81524f667cfab4dfdcee9bd668143c7286011dd1f0d40f87fc06ab0 \ No newline at end of file
diff --git a/db/schema_migrations/20230117093222 b/db/schema_migrations/20230117093222
new file mode 100644
index 00000000000..5b539456dd1
--- /dev/null
+++ b/db/schema_migrations/20230117093222
@@ -0,0 +1 @@
+4d38db045a0d505ea8f62327de8cc58fc0896e7c194cf71ca28ba08113757696 \ No newline at end of file
diff --git a/db/schema_migrations/20230117093736 b/db/schema_migrations/20230117093736
new file mode 100644
index 00000000000..7d61bf2ba5c
--- /dev/null
+++ b/db/schema_migrations/20230117093736
@@ -0,0 +1 @@
+28b959fe3c79a9d24e24d296112ee7ada71b9932e608cbf5fa2d01cac3db0247 \ No newline at end of file
diff --git a/db/schema_migrations/20230117093924 b/db/schema_migrations/20230117093924
new file mode 100644
index 00000000000..0fc56af4b10
--- /dev/null
+++ b/db/schema_migrations/20230117093924
@@ -0,0 +1 @@
+0a34ab643f8ac5fdd0dd604f53244fe07a88ebf992fed7863bf38300817c9acb \ No newline at end of file
diff --git a/db/schema_migrations/20230117094111 b/db/schema_migrations/20230117094111
new file mode 100644
index 00000000000..407024de0cb
--- /dev/null
+++ b/db/schema_migrations/20230117094111
@@ -0,0 +1 @@
+49b81bf05f155f17d44fede8a513ee5bea56e2ba7cd41a55505e31ba36c50b5e \ No newline at end of file
diff --git a/db/schema_migrations/20230117094226 b/db/schema_migrations/20230117094226
new file mode 100644
index 00000000000..cc0943e7e65
--- /dev/null
+++ b/db/schema_migrations/20230117094226
@@ -0,0 +1 @@
+429754e80bcfde582c92a69a6b655a13254b7ac0fe3504bfad0924560a4c1eed \ No newline at end of file
diff --git a/db/schema_migrations/20230117094316 b/db/schema_migrations/20230117094316
new file mode 100644
index 00000000000..5657905baf9
--- /dev/null
+++ b/db/schema_migrations/20230117094316
@@ -0,0 +1 @@
+7cd9ca122b41eb610e03dd258d74c5c7aaa31482a4ff21dfba720def099a1487 \ No newline at end of file
diff --git a/db/schema_migrations/20230117114739 b/db/schema_migrations/20230117114739
new file mode 100644
index 00000000000..cb9fabfe4c4
--- /dev/null
+++ b/db/schema_migrations/20230117114739
@@ -0,0 +1 @@
+f4ba0d1de73da2b7a912c06ca458898f3404235025089efc74aee9fc4caa511a \ No newline at end of file
diff --git a/db/schema_migrations/20230117173433 b/db/schema_migrations/20230117173433
new file mode 100644
index 00000000000..cef42780547
--- /dev/null
+++ b/db/schema_migrations/20230117173433
@@ -0,0 +1 @@
+ee7f3ba064eaaf4a1bf92e5c0a2ed32e5d294ddd6f1fdd8e6eed54c8b83c2af5 \ No newline at end of file
diff --git a/db/schema_migrations/20230118083437 b/db/schema_migrations/20230118083437
new file mode 100644
index 00000000000..44a4ceb4e95
--- /dev/null
+++ b/db/schema_migrations/20230118083437
@@ -0,0 +1 @@
+5d05a62784cc89c1c74531df16d0f4b47bbdba5e1c9f62434335e896a45e5784 \ No newline at end of file
diff --git a/db/schema_migrations/20230118083632 b/db/schema_migrations/20230118083632
new file mode 100644
index 00000000000..ef6d72182c3
--- /dev/null
+++ b/db/schema_migrations/20230118083632
@@ -0,0 +1 @@
+834f5888e949a3ba83b409d64f619329d32d8abb0202dd5aa2a5cec72a90c4c8 \ No newline at end of file
diff --git a/db/schema_migrations/20230118083748 b/db/schema_migrations/20230118083748
new file mode 100644
index 00000000000..9b1965a625d
--- /dev/null
+++ b/db/schema_migrations/20230118083748
@@ -0,0 +1 @@
+69bc3d796516f6b2c4de3027be529ea4f366bb03db05d2bdc58faf7041ef173a \ No newline at end of file
diff --git a/db/schema_migrations/20230119085509 b/db/schema_migrations/20230119085509
new file mode 100644
index 00000000000..1eb8297a4b3
--- /dev/null
+++ b/db/schema_migrations/20230119085509
@@ -0,0 +1 @@
+6206e50e14c129aeb1d44fbd82add001e73b338bbe80bdade852ff7ec0bc0f86 \ No newline at end of file
diff --git a/db/schema_migrations/20230119085552 b/db/schema_migrations/20230119085552
new file mode 100644
index 00000000000..d548c864d2f
--- /dev/null
+++ b/db/schema_migrations/20230119085552
@@ -0,0 +1 @@
+4bc2f855e1448c3c1b3d6d2b853dc61b049048fa0fee663fe798d86ea88b09a0 \ No newline at end of file
diff --git a/db/schema_migrations/20230119090944 b/db/schema_migrations/20230119090944
new file mode 100644
index 00000000000..b9efaee5bc0
--- /dev/null
+++ b/db/schema_migrations/20230119090944
@@ -0,0 +1 @@
+6d66200b1707cb469891aa661ed944b133833abe5a0cdd37e4cae1b78b36426f \ No newline at end of file
diff --git a/db/schema_migrations/20230119091027 b/db/schema_migrations/20230119091027
new file mode 100644
index 00000000000..f4a5d3d556a
--- /dev/null
+++ b/db/schema_migrations/20230119091027
@@ -0,0 +1 @@
+0e269f5d643757423c3597f646b298224ab3c2eb60ab92cb030edb6ec8fb3241 \ No newline at end of file
diff --git a/db/schema_migrations/20230119095022 b/db/schema_migrations/20230119095022
new file mode 100644
index 00000000000..02c615d27f2
--- /dev/null
+++ b/db/schema_migrations/20230119095022
@@ -0,0 +1 @@
+938ad78781f488d0add8b1a85217f93ca41d7093015817d5bd5c8a853d3172b8 \ No newline at end of file
diff --git a/db/schema_migrations/20230119095023 b/db/schema_migrations/20230119095023
new file mode 100644
index 00000000000..ae882ff2ca7
--- /dev/null
+++ b/db/schema_migrations/20230119095023
@@ -0,0 +1 @@
+f0b069e73170819e044496fb6eb02b43d0ee2697524659b50ab9b66dd3ec9792 \ No newline at end of file
diff --git a/db/schema_migrations/20230119095024 b/db/schema_migrations/20230119095024
new file mode 100644
index 00000000000..e7e4255c233
--- /dev/null
+++ b/db/schema_migrations/20230119095024
@@ -0,0 +1 @@
+be0b7fd198db3caa10e16606a861de6e708eadd225ad0360604a9f4c512a3d19 \ No newline at end of file
diff --git a/db/schema_migrations/20230119095025 b/db/schema_migrations/20230119095025
new file mode 100644
index 00000000000..f7eac79873c
--- /dev/null
+++ b/db/schema_migrations/20230119095025
@@ -0,0 +1 @@
+66239a6e2fdc476126ca247042078a1b939da15ff91c00cd0392ce664eadc9af \ No newline at end of file
diff --git a/db/schema_migrations/20230119123256 b/db/schema_migrations/20230119123256
new file mode 100644
index 00000000000..3a2db3c1d76
--- /dev/null
+++ b/db/schema_migrations/20230119123256
@@ -0,0 +1 @@
+bbf6542b726466ae98323f1e7dd636874e01228ec584166ab617a917822b3fa1 \ No newline at end of file
diff --git a/db/schema_migrations/20230119123257 b/db/schema_migrations/20230119123257
new file mode 100644
index 00000000000..78d75e164c0
--- /dev/null
+++ b/db/schema_migrations/20230119123257
@@ -0,0 +1 @@
+e69eabf71bfdfc9c5aa50829d08b3ef1473e5359d01e08e1bdc94fcbb7c58e6e \ No newline at end of file
diff --git a/db/schema_migrations/20230119123258 b/db/schema_migrations/20230119123258
new file mode 100644
index 00000000000..0bb155c2106
--- /dev/null
+++ b/db/schema_migrations/20230119123258
@@ -0,0 +1 @@
+6af88109e5186a6a2f18418f441e232757ee0b03cb8af62e72c86ca4d12075c9 \ No newline at end of file
diff --git a/db/schema_migrations/20230119123259 b/db/schema_migrations/20230119123259
new file mode 100644
index 00000000000..c4ffc37f790
--- /dev/null
+++ b/db/schema_migrations/20230119123259
@@ -0,0 +1 @@
+49e256cdd550386c989cb6edea22873547b96120cfd8b5652de532dbbe21928c \ No newline at end of file
diff --git a/db/schema_migrations/20230119123908 b/db/schema_migrations/20230119123908
new file mode 100644
index 00000000000..9a403a9da30
--- /dev/null
+++ b/db/schema_migrations/20230119123908
@@ -0,0 +1 @@
+9ad4c4a096bdbb8180326618ad686bedee57a53ada952dbfb820855a1f8098a9 \ No newline at end of file
diff --git a/db/schema_migrations/20230119123937 b/db/schema_migrations/20230119123937
new file mode 100644
index 00000000000..53e0789b79e
--- /dev/null
+++ b/db/schema_migrations/20230119123937
@@ -0,0 +1 @@
+2240a3ac34b434da6cf7e814033ff1e318da12bd0b81920764500fe6f80d5416 \ No newline at end of file
diff --git a/db/schema_migrations/20230119150727 b/db/schema_migrations/20230119150727
new file mode 100644
index 00000000000..287ad14c4c8
--- /dev/null
+++ b/db/schema_migrations/20230119150727
@@ -0,0 +1 @@
+cd4606f0aab2593365b74ec0f99115e61fda3f77d6c01b7276f44e9a440d69be \ No newline at end of file
diff --git a/db/schema_migrations/20230119151636 b/db/schema_migrations/20230119151636
new file mode 100644
index 00000000000..8cc012ec6f1
--- /dev/null
+++ b/db/schema_migrations/20230119151636
@@ -0,0 +1 @@
+18054d43494d8870295c5eb6fca2498625c10cad2d040b209c4d235ae08d6480 \ No newline at end of file
diff --git a/db/schema_migrations/20230119151940 b/db/schema_migrations/20230119151940
new file mode 100644
index 00000000000..c0a4d78421f
--- /dev/null
+++ b/db/schema_migrations/20230119151940
@@ -0,0 +1 @@
+c8040984273d168b3a41b3d09d8745b80c4045a0230e1917df277cc9a5b4ca71 \ No newline at end of file
diff --git a/db/schema_migrations/20230119214643 b/db/schema_migrations/20230119214643
new file mode 100644
index 00000000000..4b7817ad6ad
--- /dev/null
+++ b/db/schema_migrations/20230119214643
@@ -0,0 +1 @@
+9bd94352c496d2554d6f96cc8aeda484b3efa894f88d5f8ae69f01ef3a2982bf \ No newline at end of file
diff --git a/db/schema_migrations/20230119215436 b/db/schema_migrations/20230119215436
new file mode 100644
index 00000000000..97303b6e759
--- /dev/null
+++ b/db/schema_migrations/20230119215436
@@ -0,0 +1 @@
+e5498ebd6ea0c18271078236a4f64b447fa5c55318b92c04f12a66834a38f67d \ No newline at end of file
diff --git a/db/schema_migrations/20230120170042 b/db/schema_migrations/20230120170042
new file mode 100644
index 00000000000..924c3cb4408
--- /dev/null
+++ b/db/schema_migrations/20230120170042
@@ -0,0 +1 @@
+036fd539aa235ccaba493bfa7294f28cf71cfd73a1e069de2977b9313fd0b655 \ No newline at end of file
diff --git a/db/schema_migrations/20230120170631 b/db/schema_migrations/20230120170631
new file mode 100644
index 00000000000..0fce8945eee
--- /dev/null
+++ b/db/schema_migrations/20230120170631
@@ -0,0 +1 @@
+61838f8cfb759c53aa8ccc47620cd4d6595a72293172c7e3ac77b2e79e422200 \ No newline at end of file
diff --git a/db/schema_migrations/20230120171818 b/db/schema_migrations/20230120171818
new file mode 100644
index 00000000000..00ddff1026f
--- /dev/null
+++ b/db/schema_migrations/20230120171818
@@ -0,0 +1 @@
+c0f53f169d2525ebd5e374c102fe73521d344df078c37384675995ac97fbed9a \ No newline at end of file
diff --git a/db/schema_migrations/20230123095022 b/db/schema_migrations/20230123095022
new file mode 100644
index 00000000000..258c9e571ad
--- /dev/null
+++ b/db/schema_migrations/20230123095022
@@ -0,0 +1 @@
+d526d2549357ca87fb4abf400d6128cc14d01ea633cf2d496c3a9111e412c7f2 \ No newline at end of file
diff --git a/db/schema_migrations/20230123095023 b/db/schema_migrations/20230123095023
new file mode 100644
index 00000000000..cdc0376c719
--- /dev/null
+++ b/db/schema_migrations/20230123095023
@@ -0,0 +1 @@
+7ad649155804a011c43e4208eea1f59c3e6894591587b5cf9ba4e8be4f5fa757 \ No newline at end of file
diff --git a/db/schema_migrations/20230123120004 b/db/schema_migrations/20230123120004
new file mode 100644
index 00000000000..f7f7c9af384
--- /dev/null
+++ b/db/schema_migrations/20230123120004
@@ -0,0 +1 @@
+879b3884221a9082aa2100eae23243fe0580d9ff56fd0de8433d535120b333ce \ No newline at end of file
diff --git a/db/schema_migrations/20230123150648 b/db/schema_migrations/20230123150648
new file mode 100644
index 00000000000..859934593fc
--- /dev/null
+++ b/db/schema_migrations/20230123150648
@@ -0,0 +1 @@
+2e6b5f695349f464cbd5c73cffbb55e86044c6edf8708f785291ab85c0a4edbb \ No newline at end of file
diff --git a/db/schema_migrations/20230124101832 b/db/schema_migrations/20230124101832
new file mode 100644
index 00000000000..ace7ff6027f
--- /dev/null
+++ b/db/schema_migrations/20230124101832
@@ -0,0 +1 @@
+c549badd648613b0f52c69719cd62c93c5f49c1d39190a500bd68ec63a90c045 \ No newline at end of file
diff --git a/db/schema_migrations/20230124102131 b/db/schema_migrations/20230124102131
new file mode 100644
index 00000000000..81654dbb5d3
--- /dev/null
+++ b/db/schema_migrations/20230124102131
@@ -0,0 +1 @@
+0e71cb12dfdd1af07f23e218ad76fd081877f49a20e9122ffcbad01e65a25c6f \ No newline at end of file
diff --git a/db/schema_migrations/20230124102222 b/db/schema_migrations/20230124102222
new file mode 100644
index 00000000000..6374755bd61
--- /dev/null
+++ b/db/schema_migrations/20230124102222
@@ -0,0 +1 @@
+268e8ce7d9313f375843a3e8f23beb8028287ef2581f8120f78cbb2fe5b83f99 \ No newline at end of file
diff --git a/db/schema_migrations/20230124104310 b/db/schema_migrations/20230124104310
new file mode 100644
index 00000000000..92a6e54eff3
--- /dev/null
+++ b/db/schema_migrations/20230124104310
@@ -0,0 +1 @@
+00c5c88297137232a7a180452f7ce03dcd56733a0b2e0acc2abfd5a63d36e39e \ No newline at end of file
diff --git a/db/schema_migrations/20230124122143 b/db/schema_migrations/20230124122143
new file mode 100644
index 00000000000..a38e5b7c40b
--- /dev/null
+++ b/db/schema_migrations/20230124122143
@@ -0,0 +1 @@
+be87eb6052d3f853f05f59a6deb8669857047ca95d28b209b1c19c66fa96ff15 \ No newline at end of file
diff --git a/db/schema_migrations/20230124173255 b/db/schema_migrations/20230124173255
new file mode 100644
index 00000000000..b1134aad384
--- /dev/null
+++ b/db/schema_migrations/20230124173255
@@ -0,0 +1 @@
+e11768af160039168f1badf070a8da705660f8a3518198570a0ad4fc39913d92 \ No newline at end of file
diff --git a/db/schema_migrations/20230124183643 b/db/schema_migrations/20230124183643
new file mode 100644
index 00000000000..d8a2afdd1ca
--- /dev/null
+++ b/db/schema_migrations/20230124183643
@@ -0,0 +1 @@
+b96d1e00bf6368c639cb49afacbde681c505067f09457938106abe8c468bf118 \ No newline at end of file
diff --git a/db/schema_migrations/20230124193917 b/db/schema_migrations/20230124193917
new file mode 100644
index 00000000000..b8e45dd4692
--- /dev/null
+++ b/db/schema_migrations/20230124193917
@@ -0,0 +1 @@
+277c1abd9cc4f9fb6aca4991b7643d8b9964ef466f4d209848c90b34c8eec9c0 \ No newline at end of file
diff --git a/db/schema_migrations/20230125090315 b/db/schema_migrations/20230125090315
new file mode 100644
index 00000000000..aefe04923e7
--- /dev/null
+++ b/db/schema_migrations/20230125090315
@@ -0,0 +1 @@
+37cc2c2eeb910333a45a18820a569d4263eb614bc138a6a0fe11d037bae045c3 \ No newline at end of file
diff --git a/db/schema_migrations/20230125093723 b/db/schema_migrations/20230125093723
new file mode 100644
index 00000000000..9c5782dcdac
--- /dev/null
+++ b/db/schema_migrations/20230125093723
@@ -0,0 +1 @@
+364f785b564d92d2956c5ffea71091561231888ffa6f4cd9125fc8ebf9150f77 \ No newline at end of file
diff --git a/db/schema_migrations/20230125093840 b/db/schema_migrations/20230125093840
new file mode 100644
index 00000000000..1d2fab25619
--- /dev/null
+++ b/db/schema_migrations/20230125093840
@@ -0,0 +1 @@
+c66f77a9de07e2f88b6d371b14f7f72068a5b8e25cb382cb08e578021affbeb7 \ No newline at end of file
diff --git a/db/schema_migrations/20230126023444 b/db/schema_migrations/20230126023444
new file mode 100644
index 00000000000..1f22c4096fa
--- /dev/null
+++ b/db/schema_migrations/20230126023444
@@ -0,0 +1 @@
+76894f6bf574e61d078781f0dc914f77dc1bf82a6a6786a32adaf8f829261387 \ No newline at end of file
diff --git a/db/schema_migrations/20230126091522 b/db/schema_migrations/20230126091522
new file mode 100644
index 00000000000..b179f736257
--- /dev/null
+++ b/db/schema_migrations/20230126091522
@@ -0,0 +1 @@
+48276b76dbedc046f7270e7204558ab045e48a6d7da9e1c0a58a76b06e51bfa5 \ No newline at end of file
diff --git a/db/schema_migrations/20230126110439 b/db/schema_migrations/20230126110439
new file mode 100644
index 00000000000..92153a67a50
--- /dev/null
+++ b/db/schema_migrations/20230126110439
@@ -0,0 +1 @@
+14bc260de13fb0a42e13777183c5977ff66a01dac4670767f9aabec975c9171e \ No newline at end of file
diff --git a/db/schema_migrations/20230126133531 b/db/schema_migrations/20230126133531
new file mode 100644
index 00000000000..21a2394d94e
--- /dev/null
+++ b/db/schema_migrations/20230126133531
@@ -0,0 +1 @@
+259fa00544b9f63d512738dcbd4fb1ffcdbbfae58e15f7fbeb4fe34e5e7fe1f3 \ No newline at end of file
diff --git a/db/schema_migrations/20230126151622 b/db/schema_migrations/20230126151622
new file mode 100644
index 00000000000..1713fa8f5f2
--- /dev/null
+++ b/db/schema_migrations/20230126151622
@@ -0,0 +1 @@
+b5de05db35043b53f3b00635da9d46475dbf7c9d133e83e5295fe4080ab004bb \ No newline at end of file
diff --git a/db/schema_migrations/20230126210436 b/db/schema_migrations/20230126210436
new file mode 100644
index 00000000000..7bdd4c12f69
--- /dev/null
+++ b/db/schema_migrations/20230126210436
@@ -0,0 +1 @@
+fc4716b37e18eed2e352ba56fff2c1bb685385336b75144745925a11c4c4f3cd \ No newline at end of file
diff --git a/db/schema_migrations/20230127093353 b/db/schema_migrations/20230127093353
new file mode 100644
index 00000000000..903688f1608
--- /dev/null
+++ b/db/schema_migrations/20230127093353
@@ -0,0 +1 @@
+7b6b30a2de12f145df5eb0814f584a117a421b1ae23c4dd45fea58fe0d883653 \ No newline at end of file
diff --git a/db/schema_migrations/20230127101834 b/db/schema_migrations/20230127101834
new file mode 100644
index 00000000000..4d89984347a
--- /dev/null
+++ b/db/schema_migrations/20230127101834
@@ -0,0 +1 @@
+13aba72dc08069cf5585657a6c684495886f27c634cdb63c363ddd1ab6f7c58d \ No newline at end of file
diff --git a/db/schema_migrations/20230127115607 b/db/schema_migrations/20230127115607
new file mode 100644
index 00000000000..48b062249e1
--- /dev/null
+++ b/db/schema_migrations/20230127115607
@@ -0,0 +1 @@
+d0d4a09ec220c34da584f5119435c0c782f32d78dd3cf9b864b444ccdb77041e \ No newline at end of file
diff --git a/db/schema_migrations/20230127121107 b/db/schema_migrations/20230127121107
new file mode 100644
index 00000000000..3e3993908e0
--- /dev/null
+++ b/db/schema_migrations/20230127121107
@@ -0,0 +1 @@
+a95107b71a3e9c6a07b2e50ad18c37b93d0ec3ebcda3cbb8075603f1fb91c555 \ No newline at end of file
diff --git a/db/schema_migrations/20230127121443 b/db/schema_migrations/20230127121443
new file mode 100644
index 00000000000..b876d31ae78
--- /dev/null
+++ b/db/schema_migrations/20230127121443
@@ -0,0 +1 @@
+08d2be57e3b7293bc6179e2265a7a627cb3b2327f6027039e9c3af9fa746425c \ No newline at end of file
diff --git a/db/schema_migrations/20230127123947 b/db/schema_migrations/20230127123947
new file mode 100644
index 00000000000..cc3981f1302
--- /dev/null
+++ b/db/schema_migrations/20230127123947
@@ -0,0 +1 @@
+dd57ab40a4263df49d8f52f8f737c5cc62101f932752cbb984cb6072d766d6f0 \ No newline at end of file
diff --git a/db/schema_migrations/20230127123948 b/db/schema_migrations/20230127123948
new file mode 100644
index 00000000000..0fa5c113d57
--- /dev/null
+++ b/db/schema_migrations/20230127123948
@@ -0,0 +1 @@
+aec7695c7e1cd2eb61625c1c08f7d8ee955bd729a8d70ea2753afcb7b545bfe6 \ No newline at end of file
diff --git a/db/schema_migrations/20230127125018 b/db/schema_migrations/20230127125018
new file mode 100644
index 00000000000..21d47c4e8d7
--- /dev/null
+++ b/db/schema_migrations/20230127125018
@@ -0,0 +1 @@
+3be83793807d10ef26eb5adbfcfb47efee04d6aa3b3fde84467a69db0fb3d422 \ No newline at end of file
diff --git a/db/schema_migrations/20230127131835 b/db/schema_migrations/20230127131835
new file mode 100644
index 00000000000..2b7f6d0e918
--- /dev/null
+++ b/db/schema_migrations/20230127131835
@@ -0,0 +1 @@
+bf4c2b95c008f100045bad2b2c31ce03564f5b3299711ad7a423febd49117f52 \ No newline at end of file
diff --git a/db/schema_migrations/20230127131915 b/db/schema_migrations/20230127131915
new file mode 100644
index 00000000000..0ba27861821
--- /dev/null
+++ b/db/schema_migrations/20230127131915
@@ -0,0 +1 @@
+c5d7812734f7561736dafb427fe5276c248aad40a28304e6a785660bec2f54e2 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151529 b/db/schema_migrations/20230127151529
new file mode 100644
index 00000000000..b36a1842904
--- /dev/null
+++ b/db/schema_migrations/20230127151529
@@ -0,0 +1 @@
+a3ba269ba178efa2a9025448ba9bf6cd4089484580510a1edc0aa111d5f92b23 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151530 b/db/schema_migrations/20230127151530
new file mode 100644
index 00000000000..35951a5aadd
--- /dev/null
+++ b/db/schema_migrations/20230127151530
@@ -0,0 +1 @@
+54678c1253121aaa9b3378b05621f212a6addaf88bd735c697706272a4dae2f8 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151531 b/db/schema_migrations/20230127151531
new file mode 100644
index 00000000000..ab576c0772d
--- /dev/null
+++ b/db/schema_migrations/20230127151531
@@ -0,0 +1 @@
+4403e5a0350da73dc83f6a4fd42e5e8721c3983fe8582d9df58f20b7fbc73333 \ No newline at end of file
diff --git a/db/schema_migrations/20230127151606 b/db/schema_migrations/20230127151606
new file mode 100644
index 00000000000..576d1fcf615
--- /dev/null
+++ b/db/schema_migrations/20230127151606
@@ -0,0 +1 @@
+a8a968bf361b6807757d61720adf502528749b6d0236415d709bb393e540eefc \ No newline at end of file
diff --git a/db/schema_migrations/20230127151607 b/db/schema_migrations/20230127151607
new file mode 100644
index 00000000000..a39fc0dbfff
--- /dev/null
+++ b/db/schema_migrations/20230127151607
@@ -0,0 +1 @@
+814f3c5716966479aff28a3c2b1713632847c4c30381f2634e7136d5b5cf9f74 \ No newline at end of file
diff --git a/db/schema_migrations/20230127152727 b/db/schema_migrations/20230127152727
new file mode 100644
index 00000000000..e29d1af05ac
--- /dev/null
+++ b/db/schema_migrations/20230127152727
@@ -0,0 +1 @@
+03377600dfb6df35b3541c4a6a1fdf19d29179c55ed101141289442322086651 \ No newline at end of file
diff --git a/db/schema_migrations/20230127152728 b/db/schema_migrations/20230127152728
new file mode 100644
index 00000000000..e2fa412b5aa
--- /dev/null
+++ b/db/schema_migrations/20230127152728
@@ -0,0 +1 @@
+50e5a64558a8253e13514d158cc265e463dcfc92d3615a1f207d18b94778ec68 \ No newline at end of file
diff --git a/db/schema_migrations/20230127153229 b/db/schema_migrations/20230127153229
new file mode 100644
index 00000000000..a61e9ebcf97
--- /dev/null
+++ b/db/schema_migrations/20230127153229
@@ -0,0 +1 @@
+4a1764bf10e6d07f0504a0bdac252c0820d20203ed1fe4a7d39d7bcf1ab524a0 \ No newline at end of file
diff --git a/db/schema_migrations/20230127153230 b/db/schema_migrations/20230127153230
new file mode 100644
index 00000000000..99afc6f1eec
--- /dev/null
+++ b/db/schema_migrations/20230127153230
@@ -0,0 +1 @@
+89ca31682d8d789ff29958cee8451decab966c934012fb6f973565ea18803205 \ No newline at end of file
diff --git a/db/schema_migrations/20230127155217 b/db/schema_migrations/20230127155217
new file mode 100644
index 00000000000..0194dba8cdd
--- /dev/null
+++ b/db/schema_migrations/20230127155217
@@ -0,0 +1 @@
+11645dc1986919fcc78d16b0a33033b95aee086b21620c7628e6bd7ec35cd9e5 \ No newline at end of file
diff --git a/db/schema_migrations/20230127164007 b/db/schema_migrations/20230127164007
new file mode 100644
index 00000000000..36c45aab0e7
--- /dev/null
+++ b/db/schema_migrations/20230127164007
@@ -0,0 +1 @@
+9eeead7484119ca0a9764104856970e5d78d484f4616552f8535f1eb047f4ae7 \ No newline at end of file
diff --git a/db/schema_migrations/20230129094140 b/db/schema_migrations/20230129094140
new file mode 100644
index 00000000000..1e8543ebfd6
--- /dev/null
+++ b/db/schema_migrations/20230129094140
@@ -0,0 +1 @@
+e14187450e98a7ea699beecbc41733f6a524a1612cc0acbea3aa5b75a4f7be49 \ No newline at end of file
diff --git a/db/schema_migrations/20230129154126 b/db/schema_migrations/20230129154126
new file mode 100644
index 00000000000..f7cecf227d9
--- /dev/null
+++ b/db/schema_migrations/20230129154126
@@ -0,0 +1 @@
+685bc851446d875d72f5712533b13baea90f6f3bc82d383f1fff10859c341e49 \ No newline at end of file
diff --git a/db/schema_migrations/20230129154202 b/db/schema_migrations/20230129154202
new file mode 100644
index 00000000000..6af55471b91
--- /dev/null
+++ b/db/schema_migrations/20230129154202
@@ -0,0 +1 @@
+a6146c49a1930b1cad7f56e6c3a8dbd433bd605d965a083f2dea3ab25261b94d \ No newline at end of file
diff --git a/db/schema_migrations/20230129154819 b/db/schema_migrations/20230129154819
new file mode 100644
index 00000000000..42bae9a9e20
--- /dev/null
+++ b/db/schema_migrations/20230129154819
@@ -0,0 +1 @@
+c8d2063f94253e79ff3c707e2af75a963863bcf601993c81e3043bbc5c2ae21b \ No newline at end of file
diff --git a/db/schema_migrations/20230130070623 b/db/schema_migrations/20230130070623
new file mode 100644
index 00000000000..136a4612f6a
--- /dev/null
+++ b/db/schema_migrations/20230130070623
@@ -0,0 +1 @@
+3d098df1006f9dba019a1637cd921ff9ffe087a967841fd2d27f7bc4db7e0e42 \ No newline at end of file
diff --git a/db/schema_migrations/20230130073109 b/db/schema_migrations/20230130073109
new file mode 100644
index 00000000000..38eebbdfed4
--- /dev/null
+++ b/db/schema_migrations/20230130073109
@@ -0,0 +1 @@
+939b01db3195eab6eceeae3b5b08c2a366566cadea85e0f84ba5abb4e004fe93 \ No newline at end of file
diff --git a/db/schema_migrations/20230130075434 b/db/schema_migrations/20230130075434
new file mode 100644
index 00000000000..d31dafc4739
--- /dev/null
+++ b/db/schema_migrations/20230130075434
@@ -0,0 +1 @@
+897f84696379e25d1aba5956db63dd1f4696a546d4c3a4742f0aa8b8eaecdbf6 \ No newline at end of file
diff --git a/db/schema_migrations/20230130084718 b/db/schema_migrations/20230130084718
new file mode 100644
index 00000000000..8ba8cf04105
--- /dev/null
+++ b/db/schema_migrations/20230130084718
@@ -0,0 +1 @@
+90e2078790aed27af30756977d40a9ae839ddadcf336c0d1d4da4ab56a26d7ec \ No newline at end of file
diff --git a/db/schema_migrations/20230130102855 b/db/schema_migrations/20230130102855
new file mode 100644
index 00000000000..91f9164a254
--- /dev/null
+++ b/db/schema_migrations/20230130102855
@@ -0,0 +1 @@
+1e6d539713dd9d6b6b8afd5fcb6db87e75eb96fccf91a94c00700760fb5e963f \ No newline at end of file
diff --git a/db/schema_migrations/20230130102856 b/db/schema_migrations/20230130102856
new file mode 100644
index 00000000000..f258d0e1eae
--- /dev/null
+++ b/db/schema_migrations/20230130102856
@@ -0,0 +1 @@
+4dc770e4a78c0f3e3aa5af43e017744a85b4974c1315508ac2244c7b12f4e0b3 \ No newline at end of file
diff --git a/db/schema_migrations/20230130103957 b/db/schema_migrations/20230130103957
new file mode 100644
index 00000000000..ace3e7f1a8d
--- /dev/null
+++ b/db/schema_migrations/20230130103957
@@ -0,0 +1 @@
+17e3e3236ba71778e86a4df672ba2b7080a127658792b60669738fdad4fe2f36 \ No newline at end of file
diff --git a/db/schema_migrations/20230130103958 b/db/schema_migrations/20230130103958
new file mode 100644
index 00000000000..ffc3d56dfc7
--- /dev/null
+++ b/db/schema_migrations/20230130103958
@@ -0,0 +1 @@
+0678dd7f9e8ad7c7e5761b7b624340fdf7785688d41badfb4affc8a2e2181072 \ No newline at end of file
diff --git a/db/schema_migrations/20230130104819 b/db/schema_migrations/20230130104819
new file mode 100644
index 00000000000..5236cd410ea
--- /dev/null
+++ b/db/schema_migrations/20230130104819
@@ -0,0 +1 @@
+1d1db0265c80b089d2438bdc43565b2de065d44dce2b737aa022385f45cdbeb0 \ No newline at end of file
diff --git a/db/schema_migrations/20230130110855 b/db/schema_migrations/20230130110855
new file mode 100644
index 00000000000..1ad25e84bfa
--- /dev/null
+++ b/db/schema_migrations/20230130110855
@@ -0,0 +1 @@
+1ee31ee657b890ba62e125c23fecfcc588192521181986b017b524e9044adb18 \ 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/20230130175512 b/db/schema_migrations/20230130175512
new file mode 100644
index 00000000000..77e9d27b8ef
--- /dev/null
+++ b/db/schema_migrations/20230130175512
@@ -0,0 +1 @@
+cfda498c61c30312398c325b04944109128ea5363e4096307cb2f59ee850f8a6 \ No newline at end of file
diff --git a/db/schema_migrations/20230130202201 b/db/schema_migrations/20230130202201
new file mode 100644
index 00000000000..625a80908cd
--- /dev/null
+++ b/db/schema_migrations/20230130202201
@@ -0,0 +1 @@
+d2a0747a84d465cd7e4e4ca48539442ee37da00691f14bac580f225aa055be36 \ No newline at end of file
diff --git a/db/schema_migrations/20230130204743 b/db/schema_migrations/20230130204743
new file mode 100644
index 00000000000..dcb1725a6e2
--- /dev/null
+++ b/db/schema_migrations/20230130204743
@@ -0,0 +1 @@
+3c6dd3b83bc6a1d9e94c93784e201d3e9114ef62070468a31abe9167ae111c35 \ No newline at end of file
diff --git a/db/schema_migrations/20230131004948 b/db/schema_migrations/20230131004948
new file mode 100644
index 00000000000..843732944a4
--- /dev/null
+++ b/db/schema_migrations/20230131004948
@@ -0,0 +1 @@
+a72828f13fa31c30338ba1b833addbf7fd439e4ea2c51ded252db943826289d9 \ No newline at end of file
diff --git a/db/schema_migrations/20230131005411 b/db/schema_migrations/20230131005411
new file mode 100644
index 00000000000..31ba576c9c9
--- /dev/null
+++ b/db/schema_migrations/20230131005411
@@ -0,0 +1 @@
+21088bc90a263d5fd5e4cff9cfdea3b778dd98f9207ef6729acafadec40383b6 \ No newline at end of file
diff --git a/db/schema_migrations/20230131090842 b/db/schema_migrations/20230131090842
new file mode 100644
index 00000000000..c76f02ee2f5
--- /dev/null
+++ b/db/schema_migrations/20230131090842
@@ -0,0 +1 @@
+a494467874e35f0843a383ebdf3ac8344356b435f568e7e5334a460622cae696 \ No newline at end of file
diff --git a/db/schema_migrations/20230131123923 b/db/schema_migrations/20230131123923
new file mode 100644
index 00000000000..1368a92047e
--- /dev/null
+++ b/db/schema_migrations/20230131123923
@@ -0,0 +1 @@
+5acafd951bd7a1a521d2b82de5e4b2146e43dab401b3bae82b3d0bb5255c3373 \ No newline at end of file
diff --git a/db/schema_migrations/20230131125844 b/db/schema_migrations/20230131125844
new file mode 100644
index 00000000000..87ad79325f1
--- /dev/null
+++ b/db/schema_migrations/20230131125844
@@ -0,0 +1 @@
+ccf6031d207b41bfacbd671b9e320e0929e43d5c62744df49b073f5ee6a90885 \ No newline at end of file
diff --git a/db/schema_migrations/20230131194959 b/db/schema_migrations/20230131194959
new file mode 100644
index 00000000000..141a6de47e3
--- /dev/null
+++ b/db/schema_migrations/20230131194959
@@ -0,0 +1 @@
+6b646889335342e41d3e891c13abe8c0fc3cb04c4a3e8a74d1f5b3ab19704111 \ No newline at end of file
diff --git a/db/schema_migrations/20230131210921 b/db/schema_migrations/20230131210921
new file mode 100644
index 00000000000..8947d4ea112
--- /dev/null
+++ b/db/schema_migrations/20230131210921
@@ -0,0 +1 @@
+3057b3de5a7ccfa065cb6c279c61a454abcbd9b0e0f3735ec5b9869c450ae3d1 \ No newline at end of file
diff --git a/db/schema_migrations/20230201012727 b/db/schema_migrations/20230201012727
new file mode 100644
index 00000000000..c501b1b8e55
--- /dev/null
+++ b/db/schema_migrations/20230201012727
@@ -0,0 +1 @@
+92bef6fc42b8d85e7900b1f8e3b9857dca8f9e4f0af58dc5ad64d3a70e33c5f4 \ No newline at end of file
diff --git a/db/schema_migrations/20230201012846 b/db/schema_migrations/20230201012846
new file mode 100644
index 00000000000..0a23144f40b
--- /dev/null
+++ b/db/schema_migrations/20230201012846
@@ -0,0 +1 @@
+5c748226d7b587337526c07c680abade315f6d758237c6bf51daf7ca35c218aa \ No newline at end of file
diff --git a/db/schema_migrations/20230201014223 b/db/schema_migrations/20230201014223
new file mode 100644
index 00000000000..323fe555df5
--- /dev/null
+++ b/db/schema_migrations/20230201014223
@@ -0,0 +1 @@
+42100a86045f084c3b74e404a2f95d4d76751ad92102edb271dc628279060ce5 \ No newline at end of file
diff --git a/db/schema_migrations/20230201014238 b/db/schema_migrations/20230201014238
new file mode 100644
index 00000000000..8a2d6effa5e
--- /dev/null
+++ b/db/schema_migrations/20230201014238
@@ -0,0 +1 @@
+00bbfdf3e45248b72aac115e44a95c23b71344dcc9e35ad3be6bf1f5eda33561 \ No newline at end of file
diff --git a/db/schema_migrations/20230201082038 b/db/schema_migrations/20230201082038
new file mode 100644
index 00000000000..b7e1ee666db
--- /dev/null
+++ b/db/schema_migrations/20230201082038
@@ -0,0 +1 @@
+0b735c9ccd267734fd4c4f6f15f6dfac67ec212786e4c31d75b73e2fae537617 \ No newline at end of file
diff --git a/db/schema_migrations/20230201152525 b/db/schema_migrations/20230201152525
new file mode 100644
index 00000000000..51fd8eabe91
--- /dev/null
+++ b/db/schema_migrations/20230201152525
@@ -0,0 +1 @@
+cfe3f77bf0615889a0fd1d55ef4f07f2bb9a1dbe1a6bb0fb5a36c017f9a5ca46 \ No newline at end of file
diff --git a/db/schema_migrations/20230201153450 b/db/schema_migrations/20230201153450
new file mode 100644
index 00000000000..75f2f582af7
--- /dev/null
+++ b/db/schema_migrations/20230201153450
@@ -0,0 +1 @@
+f1af51a9623eb1ca9464c74897dababb3dbfba324453cdc36625da820e198663 \ No newline at end of file
diff --git a/db/schema_migrations/20230201171450 b/db/schema_migrations/20230201171450
new file mode 100644
index 00000000000..c46340e0852
--- /dev/null
+++ b/db/schema_migrations/20230201171450
@@ -0,0 +1 @@
+c63f9cf6abb67b2d2623b662cd9dd7c9684a972c0aa89ea43f59e6196dacb249 \ No newline at end of file
diff --git a/db/schema_migrations/20230202002616 b/db/schema_migrations/20230202002616
new file mode 100644
index 00000000000..dc441296f20
--- /dev/null
+++ b/db/schema_migrations/20230202002616
@@ -0,0 +1 @@
+b78e2581507a85f6ba72f1a6636fb6e8fe372fc8a4accf8f954d25e1ee8c6dc8 \ No newline at end of file
diff --git a/db/schema_migrations/20230202002637 b/db/schema_migrations/20230202002637
new file mode 100644
index 00000000000..8ada17cb13b
--- /dev/null
+++ b/db/schema_migrations/20230202002637
@@ -0,0 +1 @@
+67ce816b0b7e4055f4ffcbfaf407fc56c655f907863528697c83d0f718f9ae21 \ No newline at end of file
diff --git a/db/schema_migrations/20230202004247 b/db/schema_migrations/20230202004247
new file mode 100644
index 00000000000..f3736acf5f9
--- /dev/null
+++ b/db/schema_migrations/20230202004247
@@ -0,0 +1 @@
+a7cdaa5554fef6d92fd73fcb6bc0afa3905e673b403007379a21073fe7c4c3b3 \ No newline at end of file
diff --git a/db/schema_migrations/20230202023208 b/db/schema_migrations/20230202023208
new file mode 100644
index 00000000000..084f49a3bf3
--- /dev/null
+++ b/db/schema_migrations/20230202023208
@@ -0,0 +1 @@
+8b6e79c82b253588febad81b34a4ee5f3b82437f3a7e8efb98c40f8a0ffca4f6 \ No newline at end of file
diff --git a/db/schema_migrations/20230202023224 b/db/schema_migrations/20230202023224
new file mode 100644
index 00000000000..b86d8b0d035
--- /dev/null
+++ b/db/schema_migrations/20230202023224
@@ -0,0 +1 @@
+9ecfae596418d97e7187b1c04bdccf1f719150f3e75658287be39a58e9c8707b \ No newline at end of file
diff --git a/db/schema_migrations/20230202032248 b/db/schema_migrations/20230202032248
new file mode 100644
index 00000000000..61a5bfbf6bd
--- /dev/null
+++ b/db/schema_migrations/20230202032248
@@ -0,0 +1 @@
+b2ccc83a631f40528c073b9e5387a7fdd0190d0339ec3c42b8f1ee4408c14ca2 \ No newline at end of file
diff --git a/db/schema_migrations/20230202032302 b/db/schema_migrations/20230202032302
new file mode 100644
index 00000000000..f6077769d62
--- /dev/null
+++ b/db/schema_migrations/20230202032302
@@ -0,0 +1 @@
+84e9b2a8d4a85a7d4c458c0c224b4082f2840cfb3b4b2b777bcbea21abbdf930 \ No newline at end of file
diff --git a/db/schema_migrations/20230202131928 b/db/schema_migrations/20230202131928
new file mode 100644
index 00000000000..becc0cb13a0
--- /dev/null
+++ b/db/schema_migrations/20230202131928
@@ -0,0 +1 @@
+9258d377d0a0756bcb1951eca629fd2975b20c243b98e49e1cff72a665ef96f7 \ No newline at end of file
diff --git a/db/schema_migrations/20230202153926 b/db/schema_migrations/20230202153926
new file mode 100644
index 00000000000..7be855b6d22
--- /dev/null
+++ b/db/schema_migrations/20230202153926
@@ -0,0 +1 @@
+b446c818b57801c3afa26fd4e2c633f04b7956d80f709947cc1be9f87a520fc2 \ No newline at end of file
diff --git a/db/schema_migrations/20230203011359 b/db/schema_migrations/20230203011359
new file mode 100644
index 00000000000..364395a3252
--- /dev/null
+++ b/db/schema_migrations/20230203011359
@@ -0,0 +1 @@
+51ce125f058811cd0f118429049389d9b67479628472830bce4c04cc81969a37 \ No newline at end of file
diff --git a/db/schema_migrations/20230203122602 b/db/schema_migrations/20230203122602
new file mode 100644
index 00000000000..a03143094f5
--- /dev/null
+++ b/db/schema_migrations/20230203122602
@@ -0,0 +1 @@
+bb8b177385489eeefda9b8c1e9534398ec759d95fbf46ee3af02a3964a03e1ae \ No newline at end of file
diff --git a/db/schema_migrations/20230203122609 b/db/schema_migrations/20230203122609
new file mode 100644
index 00000000000..a1549773f34
--- /dev/null
+++ b/db/schema_migrations/20230203122609
@@ -0,0 +1 @@
+7a1f0770999871ba021a2d6f0c036f4dbe19143abacd7140c76f6f576b89f002 \ No newline at end of file
diff --git a/db/schema_migrations/20230203145514 b/db/schema_migrations/20230203145514
new file mode 100644
index 00000000000..f929711f279
--- /dev/null
+++ b/db/schema_migrations/20230203145514
@@ -0,0 +1 @@
+42f7cf3cb5d8b9b3f1c8a30b1f48fb6a5bf650e368c927b2b3c6c74c2c339088 \ 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/20230206172702 b/db/schema_migrations/20230206172702
new file mode 100644
index 00000000000..686eaf82767
--- /dev/null
+++ b/db/schema_migrations/20230206172702
@@ -0,0 +1 @@
+779501ae368409cfe42bf03151309a07f043834c37d742dc52a062727a9cb9de \ No newline at end of file
diff --git a/db/schema_migrations/20230207003737 b/db/schema_migrations/20230207003737
new file mode 100644
index 00000000000..d66f0ed1543
--- /dev/null
+++ b/db/schema_migrations/20230207003737
@@ -0,0 +1 @@
+f054d4b0332145a5c27c3c7d329d0f4851a8a7abf1314055077a2ac4c7a8463a \ No newline at end of file
diff --git a/db/schema_migrations/20230207003812 b/db/schema_migrations/20230207003812
new file mode 100644
index 00000000000..6422de7ce37
--- /dev/null
+++ b/db/schema_migrations/20230207003812
@@ -0,0 +1 @@
+5d0e6aed4be364bd4884259f56b44812200963cea724b23130fa8b19f58e2574 \ No newline at end of file
diff --git a/db/schema_migrations/20230207005549 b/db/schema_migrations/20230207005549
new file mode 100644
index 00000000000..fc3dedf162b
--- /dev/null
+++ b/db/schema_migrations/20230207005549
@@ -0,0 +1 @@
+060067232f46ea992de5d5392c2918f81167d224b3b90f3a7567b624a3d8d4e3 \ No newline at end of file
diff --git a/db/schema_migrations/20230207005701 b/db/schema_migrations/20230207005701
new file mode 100644
index 00000000000..1ffa8f0b483
--- /dev/null
+++ b/db/schema_migrations/20230207005701
@@ -0,0 +1 @@
+1602c379715b3ca22c75fc4ff39cda49d0735db29d0be2256265fb5313ea332f \ No newline at end of file
diff --git a/db/schema_migrations/20230207011344 b/db/schema_migrations/20230207011344
new file mode 100644
index 00000000000..0d41804e37a
--- /dev/null
+++ b/db/schema_migrations/20230207011344
@@ -0,0 +1 @@
+c7cf038ab9b9d853a1e321508bdfd3044b5774adf7d08c157c2c0881bda6bac2 \ No newline at end of file
diff --git a/db/schema_migrations/20230207011414 b/db/schema_migrations/20230207011414
new file mode 100644
index 00000000000..3b13317b1e6
--- /dev/null
+++ b/db/schema_migrations/20230207011414
@@ -0,0 +1 @@
+8350a8c8dca95ea8c18e0ee132f8b6a732ddd6981ddb9742aecbfc5ad3daa091 \ No newline at end of file
diff --git a/db/schema_migrations/20230207012217 b/db/schema_migrations/20230207012217
new file mode 100644
index 00000000000..e0709cfd57a
--- /dev/null
+++ b/db/schema_migrations/20230207012217
@@ -0,0 +1 @@
+e9b82380fc23c85bf9f4dc6595a4eb59eedfe696f5dc256141e8b4a7ebaa6ee3 \ No newline at end of file
diff --git a/db/schema_migrations/20230207012238 b/db/schema_migrations/20230207012238
new file mode 100644
index 00000000000..4c5d782a1c0
--- /dev/null
+++ b/db/schema_migrations/20230207012238
@@ -0,0 +1 @@
+d3789404b6ecb38eabfa75c41db936bceb2aa219c770764d30caca6d94358ba4 \ No newline at end of file
diff --git a/db/schema_migrations/20230207015819 b/db/schema_migrations/20230207015819
new file mode 100644
index 00000000000..5f501f9a7ac
--- /dev/null
+++ b/db/schema_migrations/20230207015819
@@ -0,0 +1 @@
+fb2aae23e613c0e930b88c6ff67382330b7379e3664bb74477ebf7aa48f52e8e \ No newline at end of file
diff --git a/db/schema_migrations/20230207015850 b/db/schema_migrations/20230207015850
new file mode 100644
index 00000000000..a936f67d58e
--- /dev/null
+++ b/db/schema_migrations/20230207015850
@@ -0,0 +1 @@
+cecda7c2b2e82768edcc45546adf028ba7839c26ed403c35e12614b341760fbf \ No newline at end of file
diff --git a/db/schema_migrations/20230207025259 b/db/schema_migrations/20230207025259
new file mode 100644
index 00000000000..377c2581168
--- /dev/null
+++ b/db/schema_migrations/20230207025259
@@ -0,0 +1 @@
+8f8c230c6254a1dedb71209eb11af47e90fdec52287ed22f833c34ad2cb24156 \ No newline at end of file
diff --git a/db/schema_migrations/20230207025315 b/db/schema_migrations/20230207025315
new file mode 100644
index 00000000000..0f665eff8b2
--- /dev/null
+++ b/db/schema_migrations/20230207025315
@@ -0,0 +1 @@
+775d411ef7bfff2cfb20495a1429dddeec2ecb5e84b549818419efa8bfa155d3 \ No newline at end of file
diff --git a/db/schema_migrations/20230207030244 b/db/schema_migrations/20230207030244
new file mode 100644
index 00000000000..bece0b240db
--- /dev/null
+++ b/db/schema_migrations/20230207030244
@@ -0,0 +1 @@
+30d4ae8a173564126a93ccd7c82d3f43c6567b2c279f7a9949baa50cff372b0c \ No newline at end of file
diff --git a/db/schema_migrations/20230207030259 b/db/schema_migrations/20230207030259
new file mode 100644
index 00000000000..30c5d56506d
--- /dev/null
+++ b/db/schema_migrations/20230207030259
@@ -0,0 +1 @@
+250261f4bbe1da4067a0a9c634114c893c7f43c968dc22fc684a1ea6f85926a8 \ 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/schema_migrations/20230208100917 b/db/schema_migrations/20230208100917
new file mode 100644
index 00000000000..1862dcf6738
--- /dev/null
+++ b/db/schema_migrations/20230208100917
@@ -0,0 +1 @@
+55d9815e9590681cedf6e5817ef6419db882837325b9d3c86ae34419339b090d \ No newline at end of file
diff --git a/db/schema_migrations/20230208103009 b/db/schema_migrations/20230208103009
new file mode 100644
index 00000000000..097184279f6
--- /dev/null
+++ b/db/schema_migrations/20230208103009
@@ -0,0 +1 @@
+2f8fda2911fdbff0e7d0d90c6288c003e36471a6e107271227a6d67bda2775a0 \ No newline at end of file
diff --git a/db/schema_migrations/20230208103640 b/db/schema_migrations/20230208103640
new file mode 100644
index 00000000000..7a9e6a603cb
--- /dev/null
+++ b/db/schema_migrations/20230208103640
@@ -0,0 +1 @@
+7f000addc9083ff438abccdbd607fc702d1999a7a182d375d5b7355f0b03304b \ No newline at end of file
diff --git a/db/schema_migrations/20230208110638 b/db/schema_migrations/20230208110638
new file mode 100644
index 00000000000..3aa5c616646
--- /dev/null
+++ b/db/schema_migrations/20230208110638
@@ -0,0 +1 @@
+fac390d1508329864c7e859e1c302e00868679b5438c2f5a31dfdaea7ba73eab \ No newline at end of file
diff --git a/db/schema_migrations/20230208132608 b/db/schema_migrations/20230208132608
new file mode 100644
index 00000000000..9ecc9531ca7
--- /dev/null
+++ b/db/schema_migrations/20230208132608
@@ -0,0 +1 @@
+a4709b533b0ef420e5a14088fcf7e2646d4601019f62429b528ea3c715da87ca \ No newline at end of file
diff --git a/db/schema_migrations/20230209090702 b/db/schema_migrations/20230209090702
new file mode 100644
index 00000000000..9eb84a3b5d0
--- /dev/null
+++ b/db/schema_migrations/20230209090702
@@ -0,0 +1 @@
+f3f0611b503bf2be35a201541826a33dd0ff58a0b41c6588303317f2b171d567 \ No newline at end of file
diff --git a/db/schema_migrations/20230209092204 b/db/schema_migrations/20230209092204
new file mode 100644
index 00000000000..c6432053853
--- /dev/null
+++ b/db/schema_migrations/20230209092204
@@ -0,0 +1 @@
+f3962b71ec4b63a2e056872fc155ae4e41cdef8c989728b5e60553c6d602ccee \ No newline at end of file
diff --git a/db/schema_migrations/20230209103650 b/db/schema_migrations/20230209103650
new file mode 100644
index 00000000000..c4e01b8f49e
--- /dev/null
+++ b/db/schema_migrations/20230209103650
@@ -0,0 +1 @@
+f56cd57c85a852f129099357ae72e94cbed7bc08c3099273842708dc40bc4411 \ No newline at end of file
diff --git a/db/schema_migrations/20230209103714 b/db/schema_migrations/20230209103714
new file mode 100644
index 00000000000..1609e8df370
--- /dev/null
+++ b/db/schema_migrations/20230209103714
@@ -0,0 +1 @@
+bcfb07f384564295b4fc359ced37d5fdcde5689a589ab32953fb1d276de692e8 \ No newline at end of file
diff --git a/db/schema_migrations/20230209123006 b/db/schema_migrations/20230209123006
new file mode 100644
index 00000000000..a4f8e624eeb
--- /dev/null
+++ b/db/schema_migrations/20230209123006
@@ -0,0 +1 @@
+daaba8ca5c6b9e5eb4ca06d4194208452cb1cf91da8abd80ea228b3887a30c0c \ No newline at end of file
diff --git a/db/schema_migrations/20230209131808 b/db/schema_migrations/20230209131808
new file mode 100644
index 00000000000..ba90b9dcd50
--- /dev/null
+++ b/db/schema_migrations/20230209131808
@@ -0,0 +1 @@
+48c3039b24ab063a550419d3883b3c6308709e0ef9eacc0f4f1cdc3c99fb4148 \ No newline at end of file
diff --git a/db/schema_migrations/20230209140102 b/db/schema_migrations/20230209140102
new file mode 100644
index 00000000000..b1938fc21a3
--- /dev/null
+++ b/db/schema_migrations/20230209140102
@@ -0,0 +1 @@
+c9f92b576436a473380ad2035030a108c60efd4c2f46a259a46246d2019c4285 \ No newline at end of file
diff --git a/db/schema_migrations/20230209171547 b/db/schema_migrations/20230209171547
new file mode 100644
index 00000000000..1c3b3b8d8f4
--- /dev/null
+++ b/db/schema_migrations/20230209171547
@@ -0,0 +1 @@
+ec7d8a7d00e5c6a80efa6c859df8de31e8615df4ba586d6b014fee60e0da6644 \ No newline at end of file
diff --git a/db/schema_migrations/20230210113924 b/db/schema_migrations/20230210113924
new file mode 100644
index 00000000000..b9787cddadb
--- /dev/null
+++ b/db/schema_migrations/20230210113924
@@ -0,0 +1 @@
+00998ed2ff2e1300d4af7f2b1f3817aad6cc3dcec37887704ebc0571963c461d \ No newline at end of file
diff --git a/db/schema_migrations/20230210181214 b/db/schema_migrations/20230210181214
new file mode 100644
index 00000000000..ab7b3b1ca21
--- /dev/null
+++ b/db/schema_migrations/20230210181214
@@ -0,0 +1 @@
+9e7245187ad1618304f2cdc901a6d8f63e63d007578da92f7ba049def9312923 \ No newline at end of file
diff --git a/db/schema_migrations/20230214122717 b/db/schema_migrations/20230214122717
new file mode 100644
index 00000000000..6f69502caa3
--- /dev/null
+++ b/db/schema_migrations/20230214122717
@@ -0,0 +1 @@
+803a4aa4c28aecf498d2a70046850d8128327feb12fe1a42f1255cd08da7746e \ No newline at end of file
diff --git a/db/schema_migrations/20230214142447 b/db/schema_migrations/20230214142447
new file mode 100644
index 00000000000..0f13b11d39e
--- /dev/null
+++ b/db/schema_migrations/20230214142447
@@ -0,0 +1 @@
+29006be848d8a5ba33c0e757ac4743cc19dc0274893e2e23c73615218975feef \ No newline at end of file
diff --git a/db/schema_migrations/20230214142813 b/db/schema_migrations/20230214142813
new file mode 100644
index 00000000000..4cfbe09f8a2
--- /dev/null
+++ b/db/schema_migrations/20230214142813
@@ -0,0 +1 @@
+c7f6778eb181c6c4e97b7d7698bb7df5a4589710426d0a6574d5230f9751ebed \ No newline at end of file
diff --git a/db/schema_migrations/20230214154101 b/db/schema_migrations/20230214154101
new file mode 100644
index 00000000000..97ea6dfb259
--- /dev/null
+++ b/db/schema_migrations/20230214154101
@@ -0,0 +1 @@
+89f5c87983f2739ad20f1f3f3542aea5cd9373879d399835207028792e1e097c \ No newline at end of file
diff --git a/db/schema_migrations/20230214174335 b/db/schema_migrations/20230214174335
new file mode 100644
index 00000000000..a34c5d7c8a0
--- /dev/null
+++ b/db/schema_migrations/20230214174335
@@ -0,0 +1 @@
+8e5862a7c63bc1ccb2ab634d7c8b7fa3b8289b579bcc0531af27572fa6e7e3fc \ No newline at end of file
diff --git a/db/schema_migrations/20230216035802 b/db/schema_migrations/20230216035802
new file mode 100644
index 00000000000..b61b7368c27
--- /dev/null
+++ b/db/schema_migrations/20230216035802
@@ -0,0 +1 @@
+b00c36a3c19608e64c9616d32eb204aca8fcfb29ab6f2d36b136d22ba0c00579 \ No newline at end of file
diff --git a/db/schema_migrations/20230216052103 b/db/schema_migrations/20230216052103
new file mode 100644
index 00000000000..5b4fa3b84fa
--- /dev/null
+++ b/db/schema_migrations/20230216052103
@@ -0,0 +1 @@
+f6520e0b7cda276b7cf198bcbb0be4425c844a88d38118740675b639dbc73694 \ No newline at end of file
diff --git a/db/schema_migrations/20230216054348 b/db/schema_migrations/20230216054348
new file mode 100644
index 00000000000..c878ce97f9e
--- /dev/null
+++ b/db/schema_migrations/20230216054348
@@ -0,0 +1 @@
+d86d07d1a1f02b72cfa45ebe83088366d200af00c8ab77f3a287af8476d00f14 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index ec8f3362c40..c277291e823 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -225,6 +225,33 @@ RETURN NULL;
END
$$;
+CREATE FUNCTION trigger_080e73845bfd() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_0e214b8a14f2() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_17c3a95ee58a() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -234,6 +261,123 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_3207b8d0d6f3() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_3dc62927cae8() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_775287b6d67a() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."diff_note_id_convert_to_bigint" := NEW."diff_note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_7f4fcd5aa322() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_bfc6e47be8cc() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_bfcbace4260d() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_c2051020aa8b() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_c5a5f48f12b0() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_c7107f30d69d() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_dca935e3a712() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
+CREATE FUNCTION trigger_ee7956d805e6() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -475,7 +619,8 @@ CREATE TABLE web_hook_logs (
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
+ created_at timestamp without time zone NOT NULL,
+ url_hash text
)
PARTITION BY RANGE (created_at);
@@ -10587,6 +10732,8 @@ CREATE TABLE abuse_reports (
cached_markdown_version integer,
category smallint DEFAULT 1 NOT NULL,
reported_from_url text DEFAULT ''::text NOT NULL,
+ links_to_spam text[] DEFAULT '{}'::text[] NOT NULL,
+ CONSTRAINT abuse_reports_links_to_spam_length_check CHECK ((cardinality(links_to_spam) <= 20)),
CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512))
);
@@ -10678,6 +10825,32 @@ CREATE SEQUENCE agent_project_authorizations_id_seq
ALTER SEQUENCE agent_project_authorizations_id_seq OWNED BY agent_project_authorizations.id;
+CREATE TABLE airflow_dags (
+ 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,
+ next_run timestamp with time zone,
+ has_import_errors boolean,
+ is_active boolean,
+ is_paused boolean,
+ dag_name text NOT NULL,
+ schedule text,
+ fileloc text,
+ CONSTRAINT check_6999a61016 CHECK ((char_length(schedule) <= 255)),
+ CONSTRAINT check_6f52bee3a1 CHECK ((char_length(fileloc) <= 255)),
+ CONSTRAINT check_e10ac15d52 CHECK ((char_length(dag_name) <= 255))
+);
+
+CREATE SEQUENCE airflow_dags_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE airflow_dags_id_seq OWNED BY airflow_dags.id;
+
CREATE TABLE alert_management_alert_assignees (
id bigint NOT NULL,
user_id bigint NOT NULL,
@@ -10953,8 +11126,10 @@ ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY anal
CREATE TABLE analytics_dashboards_pointers (
id bigint NOT NULL,
- namespace_id bigint NOT NULL,
- project_id bigint NOT NULL
+ namespace_id bigint,
+ project_id bigint,
+ target_project_id bigint NOT NULL,
+ CONSTRAINT chk_analytics_dashboards_pointers_project_or_namespace CHECK (((project_id IS NULL) <> (namespace_id IS NULL)))
);
CREATE SEQUENCE analytics_dashboards_pointers_id_seq
@@ -11065,8 +11240,12 @@ CREATE TABLE appearances (
profile_image_guidelines_html text,
pwa_short_name text,
pwa_icon text,
+ pwa_name text,
+ pwa_description text,
CONSTRAINT appearances_profile_image_guidelines CHECK ((char_length(profile_image_guidelines) <= 4096)),
+ CONSTRAINT check_13b2165eca CHECK ((char_length(pwa_name) <= 255)),
CONSTRAINT check_5c3fd63577 CHECK ((char_length(pwa_short_name) <= 255)),
+ CONSTRAINT check_5e0e6f24ed CHECK ((char_length(pwa_description) <= 2048)),
CONSTRAINT check_5e5b7ac344 CHECK ((char_length(pwa_icon) <= 1024))
);
@@ -11561,10 +11740,22 @@ CREATE TABLE application_settings (
bulk_import_enabled boolean DEFAULT false NOT NULL,
allow_runner_registration_token boolean DEFAULT true NOT NULL,
user_defaults_to_private_profile boolean DEFAULT false NOT NULL,
+ allow_possible_spam boolean DEFAULT false NOT NULL,
+ encrypted_product_analytics_clickhouse_connection_string bytea,
+ encrypted_product_analytics_clickhouse_connection_string_iv bytea,
+ search_max_shard_size_gb integer DEFAULT 50 NOT NULL,
+ search_max_docs_denominator integer DEFAULT 5000000 NOT NULL,
+ search_min_docs_before_rollover integer DEFAULT 100000 NOT NULL,
+ deactivation_email_additional_text text,
+ jira_connect_public_key_storage_enabled boolean DEFAULT false NOT NULL,
+ git_rate_limit_users_alertlist integer[] DEFAULT '{}'::integer[] NOT NULL,
+ allow_deploy_tokens_and_keys_with_external_authn boolean DEFAULT false NOT NULL,
+ security_policy_global_group_approvers_enabled boolean DEFAULT true 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_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)),
CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)),
CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)),
+ CONSTRAINT app_settings_git_rate_limit_users_alertlist_max_usernames CHECK ((cardinality(git_rate_limit_users_alertlist) <= 100)),
CONSTRAINT app_settings_git_rate_limit_users_allowlist_max_usernames CHECK ((cardinality(git_rate_limit_users_allowlist) <= 100)),
CONSTRAINT app_settings_max_pages_custom_domains_per_project_check CHECK ((max_pages_custom_domains_per_project >= 0)),
CONSTRAINT app_settings_max_terraform_state_size_bytes_check CHECK ((max_terraform_state_size_bytes >= 0)),
@@ -11598,6 +11789,7 @@ CREATE TABLE application_settings (
CONSTRAINT check_9a719834eb CHECK ((char_length(secret_detection_token_revocation_url) <= 255)),
CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)),
CONSTRAINT check_a5704163cc CHECK ((char_length(secret_detection_revocation_token_types_url) <= 255)),
+ CONSTRAINT check_b8c74ea5b3 CHECK ((char_length(deactivation_email_additional_text) <= 1000)),
CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)),
CONSTRAINT check_d4865d70f3 CHECK ((char_length(clickhouse_connection_string) <= 1024)),
CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)),
@@ -11695,6 +11887,7 @@ CREATE TABLE approval_merge_request_rules (
severity_levels text[] DEFAULT '{}'::text[] NOT NULL,
vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL,
security_orchestration_policy_configuration_id bigint,
+ scan_result_policy_id bigint,
CONSTRAINT check_6fca5928b2 CHECK ((char_length(section) <= 255))
);
@@ -11767,7 +11960,8 @@ CREATE TABLE approval_project_rules (
vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL,
orchestration_policy_idx smallint,
applies_to_all_protected_branches boolean DEFAULT false NOT NULL,
- security_orchestration_policy_configuration_id bigint
+ security_orchestration_policy_configuration_id bigint,
+ scan_result_policy_id bigint
);
CREATE TABLE approval_project_rules_groups (
@@ -11988,6 +12182,29 @@ CREATE SEQUENCE authentication_events_id_seq
ALTER SEQUENCE authentication_events_id_seq OWNED BY authentication_events.id;
+CREATE TABLE automation_rules (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ issues_events boolean DEFAULT false NOT NULL,
+ merge_requests_events boolean DEFAULT false NOT NULL,
+ permanently_disabled boolean DEFAULT false NOT NULL,
+ name text NOT NULL,
+ rule text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_0be3e2c953 CHECK ((char_length(name) <= 255)),
+ CONSTRAINT check_ed5a4fcbd5 CHECK ((char_length(rule) <= 2048))
+);
+
+CREATE SEQUENCE automation_rules_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE automation_rules_id_seq OWNED BY automation_rules.id;
+
CREATE TABLE award_emoji (
id integer NOT NULL,
name character varying,
@@ -12535,6 +12752,8 @@ CREATE TABLE bulk_import_trackers (
jid text,
stage smallint DEFAULT 0 NOT NULL,
status smallint DEFAULT 0 NOT NULL,
+ created_at timestamp with time zone,
+ updated_at timestamp with time zone,
CONSTRAINT check_2d45cae629 CHECK ((char_length(relation) <= 255)),
CONSTRAINT check_40aeaa600b CHECK ((char_length(next_page) <= 255)),
CONSTRAINT check_603f91cb06 CHECK ((char_length(jid) <= 255)),
@@ -12617,7 +12836,8 @@ CREATE TABLE ci_build_needs (
artifacts boolean DEFAULT true NOT NULL,
optional boolean DEFAULT false NOT NULL,
build_id bigint NOT NULL,
- partition_id bigint DEFAULT 100 NOT NULL
+ partition_id bigint DEFAULT 100 NOT NULL,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE ci_build_needs_id_seq
@@ -12949,11 +13169,9 @@ CREATE TABLE ci_job_artifacts (
id bigint NOT NULL,
job_id bigint NOT NULL,
locked smallint DEFAULT 2,
- original_filename text,
partition_id bigint DEFAULT 100 NOT NULL,
accessibility smallint DEFAULT 0 NOT NULL,
- CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)),
- CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512))
+ CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL))
);
CREATE SEQUENCE ci_job_artifacts_id_seq
@@ -13397,7 +13615,6 @@ CREATE TABLE ci_runner_machines (
id bigint NOT NULL,
runner_id bigint NOT NULL,
executor_type smallint,
- machine_xid text NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
contacted_at timestamp with time zone,
@@ -13407,11 +13624,13 @@ CREATE TABLE ci_runner_machines (
architecture text,
ip_address text,
config jsonb DEFAULT '{}'::jsonb NOT NULL,
+ system_xid text,
CONSTRAINT check_1537c1f66f CHECK ((char_length(platform) <= 255)),
+ CONSTRAINT check_5253913ae9 CHECK ((char_length(system_xid) <= 64)),
CONSTRAINT check_6f45a91da7 CHECK ((char_length(version) <= 2048)),
- CONSTRAINT check_84ed5d8703 CHECK ((char_length(machine_xid) <= 64)),
CONSTRAINT check_9b521b3105 CHECK ((char_length(architecture) <= 255)),
CONSTRAINT check_afb8efc1a2 CHECK ((char_length(revision) <= 255)),
+ CONSTRAINT check_b714f452d5 CHECK ((system_xid IS NOT NULL)),
CONSTRAINT check_f214590856 CHECK ((char_length(ip_address) <= 1024))
);
@@ -13669,7 +13888,9 @@ CREATE TABLE ci_triggers (
project_id integer,
owner_id integer NOT NULL,
description character varying,
- ref character varying
+ ref character varying,
+ encrypted_token bytea,
+ encrypted_token_iv bytea
);
CREATE SEQUENCE ci_triggers_id_seq
@@ -14178,7 +14399,8 @@ CREATE TABLE commit_user_mentions (
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
mentioned_groups_ids integer[],
- commit_id character varying NOT NULL
+ commit_id character varying NOT NULL,
+ note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE commit_user_mentions_id_seq
@@ -14464,7 +14686,7 @@ ALTER SEQUENCE dast_pre_scan_verification_steps_id_seq OWNED BY dast_pre_scan_ve
CREATE TABLE dast_pre_scan_verifications (
id bigint NOT NULL,
dast_profile_id bigint NOT NULL,
- ci_pipeline_id bigint NOT NULL,
+ ci_pipeline_id bigint,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
status smallint DEFAULT 0 NOT NULL
@@ -14540,6 +14762,21 @@ CREATE TABLE dast_profiles_pipelines (
COMMENT ON TABLE dast_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Profiles and CI Pipelines"}';
+CREATE TABLE dast_profiles_tags (
+ id bigint NOT NULL,
+ dast_profile_id bigint NOT NULL,
+ tag_id bigint NOT NULL
+);
+
+CREATE SEQUENCE dast_profiles_tags_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE dast_profiles_tags_id_seq OWNED BY dast_profiles_tags.id;
+
CREATE TABLE dast_scanner_profiles (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -15034,7 +15271,8 @@ CREATE TABLE design_user_mentions (
note_id integer NOT NULL,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE design_user_mentions_id_seq
@@ -15364,7 +15602,8 @@ CREATE TABLE epic_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE epic_user_mentions_id_seq
@@ -16988,7 +17227,8 @@ CREATE TABLE issue_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE issue_user_mentions_id_seq
@@ -17731,6 +17971,7 @@ CREATE TABLE merge_request_metrics (
added_lines integer,
removed_lines integer,
target_project_id integer,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL,
CONSTRAINT check_e03d0900bf CHECK ((target_project_id IS NOT NULL))
);
@@ -17783,7 +18024,8 @@ CREATE TABLE merge_request_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE merge_request_user_mentions_id_seq
@@ -17838,6 +18080,7 @@ CREATE TABLE merge_requests (
sprint_id bigint,
merge_ref_sha bytea,
draft boolean DEFAULT false NOT NULL,
+ prepared_at timestamp with time zone,
CONSTRAINT check_970d272570 CHECK ((lock_version IS NOT NULL))
);
@@ -17863,7 +18106,11 @@ CREATE TABLE merge_requests_compliance_violations (
violating_user_id bigint NOT NULL,
merge_request_id bigint NOT NULL,
reason smallint NOT NULL,
- severity_level smallint DEFAULT 0 NOT NULL
+ severity_level smallint DEFAULT 0 NOT NULL,
+ merged_at timestamp with time zone,
+ target_project_id integer,
+ title text,
+ target_branch text
);
CREATE SEQUENCE merge_requests_compliance_violations_id_seq
@@ -18175,7 +18422,8 @@ CREATE TABLE namespace_details (
free_user_cap_over_limt_notified_at timestamp with time zone,
free_user_cap_over_limit_notified_at timestamp with time zone,
dashboard_notification_at timestamp with time zone,
- dashboard_enforcement_at timestamp with time zone
+ dashboard_enforcement_at timestamp with time zone,
+ next_over_limit_check_at timestamp with time zone
);
CREATE TABLE namespace_limits (
@@ -18249,7 +18497,10 @@ CREATE TABLE namespace_settings (
default_compliance_framework_id bigint,
runner_registration_enabled boolean DEFAULT true,
allow_runner_registration_token boolean DEFAULT true NOT NULL,
+ unique_project_download_limit_alertlist integer[] DEFAULT '{}'::integer[] NOT NULL,
+ emails_enabled boolean DEFAULT true NOT NULL,
CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)),
+ CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)),
CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100))
);
@@ -18332,6 +18583,24 @@ CREATE SEQUENCE namespaces_id_seq
ALTER SEQUENCE namespaces_id_seq OWNED BY namespaces.id;
+CREATE TABLE namespaces_storage_limit_exclusions (
+ id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ reason text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_81640b2ee2 CHECK ((char_length(reason) <= 255))
+);
+
+CREATE SEQUENCE namespaces_storage_limit_exclusions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE namespaces_storage_limit_exclusions_id_seq OWNED BY namespaces_storage_limit_exclusions.id;
+
CREATE TABLE namespaces_sync_events (
id bigint NOT NULL,
namespace_id bigint NOT NULL
@@ -18356,7 +18625,8 @@ CREATE TABLE note_diff_files (
a_mode character varying NOT NULL,
b_mode character varying NOT NULL,
new_path text NOT NULL,
- old_path text NOT NULL
+ old_path text NOT NULL,
+ diff_note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE note_diff_files_id_seq
@@ -18396,7 +18666,8 @@ CREATE TABLE notes (
review_id bigint,
confidential boolean,
last_edited_at timestamp with time zone,
- internal boolean DEFAULT false NOT NULL
+ internal boolean DEFAULT false NOT NULL,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE notes_id_seq
@@ -18479,7 +18750,7 @@ CREATE TABLE oauth_access_tokens (
application_id integer,
token character varying NOT NULL,
refresh_token character varying,
- expires_in integer,
+ expires_in integer DEFAULT 7200,
revoked_at timestamp without time zone,
created_at timestamp without time zone NOT NULL,
scopes character varying
@@ -19565,7 +19836,6 @@ CREATE TABLE plan_limits (
helm_max_file_size bigint DEFAULT 5242880 NOT NULL,
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_max_artifact_size_running_container_scanning integer DEFAULT 0 NOT NULL,
ci_max_artifact_size_cluster_image_scanning integer DEFAULT 0 NOT NULL,
@@ -19581,15 +19851,16 @@ CREATE TABLE plan_limits (
security_policy_scan_execution_schedules integer DEFAULT 0 NOT NULL,
web_hook_calls_mid integer DEFAULT 0 NOT NULL,
web_hook_calls_low integer DEFAULT 0 NOT NULL,
- project_ci_variables integer DEFAULT 200 NOT NULL,
- group_ci_variables integer DEFAULT 200 NOT NULL,
+ project_ci_variables integer DEFAULT 8000 NOT NULL,
+ group_ci_variables integer DEFAULT 30000 NOT NULL,
ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL,
rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL,
ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL,
pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL,
enforcement_limit integer DEFAULT 0 NOT NULL,
notification_limit integer DEFAULT 0 NOT NULL,
- dashboard_limit_enabled_at timestamp with time zone
+ dashboard_limit_enabled_at timestamp with time zone,
+ web_hook_calls integer DEFAULT 0 NOT NULL
);
CREATE SEQUENCE plan_limits_id_seq
@@ -19618,9 +19889,19 @@ CREATE SEQUENCE plans_id_seq
ALTER SEQUENCE plans_id_seq OWNED BY plans.id;
+CREATE TABLE pm_checkpoints (
+ sequence integer NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ purl_type smallint NOT NULL,
+ chunk smallint NOT NULL
+);
+
CREATE TABLE pm_licenses (
id bigint NOT NULL,
spdx_identifier text NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_c1eb81d1ba CHECK ((char_length(spdx_identifier) <= 50))
);
@@ -19635,13 +19916,27 @@ ALTER SEQUENCE pm_licenses_id_seq OWNED BY pm_licenses.id;
CREATE TABLE pm_package_version_licenses (
pm_package_version_id bigint NOT NULL,
- pm_license_id bigint NOT NULL
+ pm_license_id bigint NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
+ id bigint NOT NULL
);
+CREATE SEQUENCE pm_package_version_licenses_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE pm_package_version_licenses_id_seq OWNED BY pm_package_version_licenses.id;
+
CREATE TABLE pm_package_versions (
id bigint NOT NULL,
- pm_package_id bigint,
+ pm_package_id bigint NOT NULL,
version text NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_2d8a88cfcc CHECK ((char_length(version) <= 255))
);
@@ -19658,6 +19953,8 @@ CREATE TABLE pm_packages (
id bigint NOT NULL,
purl_type smallint NOT NULL,
name text NOT NULL,
+ created_at timestamp with time zone DEFAULT now() NOT NULL,
+ updated_at timestamp with time zone DEFAULT now() NOT NULL,
CONSTRAINT check_3a3aedb8ba CHECK ((char_length(name) <= 255))
);
@@ -19687,6 +19984,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,
@@ -19694,7 +20013,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))
);
@@ -19749,6 +20071,7 @@ CREATE VIEW postgres_foreign_keys AS
constrained_cols.constrained_columns,
referenced_cols.referenced_columns,
pg_constraint.confdeltype AS on_delete_action,
+ pg_constraint.confupdtype AS on_update_action,
(pg_constraint.coninhcount > 0) AS is_inherited
FROM ((((((pg_constraint
JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid)))
@@ -20082,7 +20405,7 @@ CREATE TABLE project_ci_cd_settings (
separated_caches boolean DEFAULT true NOT NULL,
opt_in_jwt boolean DEFAULT false NOT NULL,
allow_fork_pipelines_to_run_in_parent_project boolean DEFAULT true NOT NULL,
- inbound_job_token_scope_enabled boolean DEFAULT false NOT NULL
+ inbound_job_token_scope_enabled boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE project_ci_cd_settings_id_seq
@@ -20159,6 +20482,28 @@ CREATE SEQUENCE project_daily_statistics_id_seq
ALTER SEQUENCE project_daily_statistics_id_seq OWNED BY project_daily_statistics.id;
+CREATE TABLE project_data_transfers (
+ id bigint NOT NULL,
+ project_id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ repository_egress bigint DEFAULT 0 NOT NULL,
+ artifacts_egress bigint DEFAULT 0 NOT NULL,
+ packages_egress bigint DEFAULT 0 NOT NULL,
+ registry_egress bigint DEFAULT 0 NOT NULL,
+ date date NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ CONSTRAINT project_data_transfers_project_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone)))
+);
+
+CREATE SEQUENCE project_data_transfers_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE project_data_transfers_id_seq OWNED BY project_data_transfers.id;
+
CREATE TABLE project_deploy_tokens (
id integer NOT NULL,
project_id integer NOT NULL,
@@ -20326,7 +20671,8 @@ CREATE TABLE project_mirror_data (
last_error text,
last_update_at timestamp with time zone,
last_successful_update_at timestamp with time zone,
- correlation_id_value character varying(128)
+ correlation_id_value character varying(128),
+ checksums jsonb DEFAULT '{}'::jsonb NOT NULL
);
CREATE SEQUENCE project_mirror_data_id_seq
@@ -20497,6 +20843,10 @@ CREATE TABLE project_settings (
only_allow_merge_if_all_status_checks_passed boolean DEFAULT false NOT NULL,
mirror_branch_regex text,
allow_pipeline_trigger_approve_deployment boolean DEFAULT false NOT NULL,
+ emails_enabled boolean DEFAULT true NOT NULL,
+ pages_unique_domain_enabled boolean DEFAULT false NOT NULL,
+ pages_unique_domain text,
+ CONSTRAINT check_1a30456322 CHECK ((char_length(pages_unique_domain) <= 63)),
CONSTRAINT check_2981f15877 CHECK ((char_length(jitsu_key) <= 100)),
CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)),
CONSTRAINT check_3ca5cbffe6 CHECK ((char_length(issue_branch_template) <= 255)),
@@ -20861,7 +21211,7 @@ CREATE TABLE protected_environment_deploy_access_levels (
id integer NOT NULL,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
- access_level integer DEFAULT 40,
+ access_level integer,
protected_environment_id integer NOT NULL,
user_id integer,
group_id integer,
@@ -20905,7 +21255,8 @@ CREATE TABLE protected_tag_create_access_levels (
user_id integer,
group_id integer,
created_at timestamp without time zone NOT NULL,
- updated_at timestamp without time zone NOT NULL
+ updated_at timestamp without time zone NOT NULL,
+ deploy_key_id integer
);
CREATE SEQUENCE protected_tag_create_access_levels_id_seq
@@ -21474,6 +21825,25 @@ CREATE SEQUENCE sbom_vulnerable_component_versions_id_seq
ALTER SEQUENCE sbom_vulnerable_component_versions_id_seq OWNED BY sbom_vulnerable_component_versions.id;
+CREATE TABLE scan_result_policies (
+ id bigint NOT NULL,
+ security_orchestration_policy_configuration_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ orchestration_policy_idx smallint NOT NULL,
+ license_states text[] DEFAULT '{}'::text[],
+ match_on_inclusion boolean
+);
+
+CREATE SEQUENCE scan_result_policies_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE scan_result_policies_id_seq OWNED BY scan_result_policies.id;
+
CREATE TABLE schema_migrations (
version character varying NOT NULL,
finished_at timestamp with time zone DEFAULT now()
@@ -21666,7 +22036,8 @@ CREATE TABLE sent_notifications (
line_code character varying,
note_type character varying,
"position" text,
- in_reply_to_discussion_id character varying
+ in_reply_to_discussion_id character varying,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE sent_notifications_id_seq
@@ -21710,7 +22081,17 @@ CREATE TABLE service_desk_settings (
issue_template_key character varying(255),
outgoing_name character varying(255),
project_key character varying(255),
- file_template_project_id bigint
+ file_template_project_id bigint,
+ custom_email_enabled boolean DEFAULT false NOT NULL,
+ custom_email text,
+ custom_email_smtp_address text,
+ custom_email_smtp_port integer,
+ custom_email_smtp_username text,
+ encrypted_custom_email_smtp_password bytea,
+ encrypted_custom_email_smtp_password_iv bytea,
+ CONSTRAINT check_57a79552e1 CHECK ((char_length(custom_email) <= 255)),
+ CONSTRAINT check_b283637a9e CHECK ((char_length(custom_email_smtp_address) <= 255)),
+ CONSTRAINT check_e3535d46ee CHECK ((char_length(custom_email_smtp_username) <= 255))
);
CREATE TABLE shards (
@@ -21846,7 +22227,8 @@ CREATE TABLE snippet_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE snippet_user_mentions_id_seq
@@ -21895,7 +22277,8 @@ CREATE TABLE software_license_policies (
software_license_id integer NOT NULL,
classification integer DEFAULT 0 NOT NULL,
created_at timestamp with time zone NOT NULL,
- updated_at timestamp with time zone NOT NULL
+ updated_at timestamp with time zone NOT NULL,
+ scan_result_policy_id bigint
);
CREATE SEQUENCE software_license_policies_id_seq
@@ -22082,7 +22465,8 @@ CREATE TABLE suggestions (
to_content text NOT NULL,
lines_above integer DEFAULT 0 NOT NULL,
lines_below integer DEFAULT 0 NOT NULL,
- outdated boolean DEFAULT false NOT NULL
+ outdated boolean DEFAULT false NOT NULL,
+ note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE suggestions_id_seq
@@ -22101,7 +22485,8 @@ CREATE TABLE system_note_metadata (
action character varying,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
- description_version_id bigint
+ description_version_id bigint,
+ note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE system_note_metadata_id_seq
@@ -22257,6 +22642,7 @@ CREATE TABLE timelogs (
note_id integer,
project_id integer,
summary text,
+ note_id_convert_to_bigint bigint,
CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255))
);
@@ -22283,7 +22669,8 @@ CREATE TABLE todos (
note_id integer,
commit_id character varying,
group_id integer,
- resolved_by_action smallint
+ resolved_by_action smallint,
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE todos_id_seq
@@ -22556,9 +22943,11 @@ CREATE TABLE user_details (
organization text DEFAULT ''::text NOT NULL,
password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL,
onboarding_step_url text,
+ discord text DEFAULT ''::text NOT NULL,
CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)),
CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)),
CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)),
+ CONSTRAINT check_4ef1de1a15 CHECK ((char_length(discord) <= 500)),
CONSTRAINT check_4f51129940 CHECK ((char_length(onboarding_step_url) <= 2000)),
CONSTRAINT check_7b246dad73 CHECK ((char_length(organization) <= 500)),
CONSTRAINT check_7d6489f8f3 CHECK ((char_length(linkedin) <= 500)),
@@ -22783,9 +23172,6 @@ CREATE TABLE users (
name character varying,
admin boolean DEFAULT false NOT NULL,
projects_limit integer NOT NULL,
- skype character varying DEFAULT ''::character varying NOT NULL,
- linkedin character varying DEFAULT ''::character varying NOT NULL,
- twitter character varying DEFAULT ''::character varying NOT NULL,
failed_attempts integer DEFAULT 0,
locked_at timestamp without time zone,
username character varying,
@@ -22802,12 +23188,10 @@ CREATE TABLE users (
confirmation_sent_at timestamp without time zone,
unconfirmed_email character varying,
hide_no_ssh_key boolean DEFAULT false,
- website_url character varying DEFAULT ''::character varying NOT NULL,
admin_email_unsubscribed_at timestamp without time zone,
notification_email character varying,
hide_no_password boolean DEFAULT false,
password_automatically_set boolean DEFAULT false,
- location character varying,
encrypted_otp_secret character varying,
encrypted_otp_secret_iv character varying,
encrypted_otp_secret_salt character varying,
@@ -22824,7 +23208,6 @@ CREATE TABLE users (
otp_grace_period_started_at timestamp without time zone,
external boolean DEFAULT false,
incoming_email_token character varying,
- organization character varying,
auditor boolean DEFAULT false NOT NULL,
require_two_factor_authentication_from_group boolean DEFAULT false NOT NULL,
two_factor_grace_period integer DEFAULT 48 NOT NULL,
@@ -23460,7 +23843,8 @@ CREATE TABLE vulnerability_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE vulnerability_user_mentions_id_seq
@@ -23586,6 +23970,28 @@ CREATE SEQUENCE wiki_page_slugs_id_seq
ALTER SEQUENCE wiki_page_slugs_id_seq OWNED BY wiki_page_slugs.id;
+CREATE TABLE wiki_repository_states (
+ id bigint NOT NULL,
+ verification_started_at timestamp with time zone,
+ verification_retry_at timestamp with time zone,
+ verified_at timestamp with time zone,
+ project_wiki_repository_id bigint NOT NULL,
+ verification_state smallint DEFAULT 0 NOT NULL,
+ verification_retry_count smallint,
+ verification_checksum bytea,
+ verification_failure text,
+ CONSTRAINT check_2933ff60dc CHECK ((char_length(verification_failure) <= 255))
+);
+
+CREATE SEQUENCE wiki_repository_states_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE wiki_repository_states_id_seq OWNED BY wiki_repository_states.id;
+
CREATE TABLE work_item_hierarchy_restrictions (
id bigint NOT NULL,
parent_type_id bigint NOT NULL,
@@ -23651,6 +24057,25 @@ CREATE SEQUENCE work_item_types_id_seq
ALTER SEQUENCE work_item_types_id_seq OWNED BY work_item_types.id;
+CREATE TABLE work_item_widget_definitions (
+ id bigint NOT NULL,
+ namespace_id bigint,
+ work_item_type_id bigint NOT NULL,
+ widget_type smallint NOT NULL,
+ disabled boolean DEFAULT false,
+ name text,
+ CONSTRAINT check_050f2e2328 CHECK ((char_length(name) <= 255))
+);
+
+CREATE SEQUENCE work_item_widget_definitions_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE work_item_widget_definitions_id_seq OWNED BY work_item_widget_definitions.id;
+
CREATE TABLE x509_certificates (
id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@@ -23733,6 +24158,42 @@ CREATE SEQUENCE zentao_tracker_data_id_seq
ALTER SEQUENCE zentao_tracker_data_id_seq OWNED BY zentao_tracker_data.id;
+CREATE TABLE zoekt_indexed_namespaces (
+ id bigint NOT NULL,
+ zoekt_shard_id bigint NOT NULL,
+ namespace_id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL
+);
+
+CREATE SEQUENCE zoekt_indexed_namespaces_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE zoekt_indexed_namespaces_id_seq OWNED BY zoekt_indexed_namespaces.id;
+
+CREATE TABLE zoekt_shards (
+ id bigint NOT NULL,
+ index_base_url text NOT NULL,
+ search_base_url text NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ updated_at timestamp with time zone NOT NULL,
+ CONSTRAINT check_61794bac26 CHECK ((char_length(search_base_url) <= 1024)),
+ CONSTRAINT check_c65bb85a32 CHECK ((char_length(index_base_url) <= 1024))
+);
+
+CREATE SEQUENCE zoekt_shards_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE zoekt_shards_id_seq OWNED BY zoekt_shards.id;
+
CREATE TABLE zoom_meetings (
id bigint NOT NULL,
project_id bigint NOT NULL,
@@ -23762,6 +24223,8 @@ ALTER TABLE ONLY agent_group_authorizations ALTER COLUMN id SET DEFAULT nextval(
ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_project_authorizations_id_seq'::regclass);
+ALTER TABLE ONLY airflow_dags ALTER COLUMN id SET DEFAULT nextval('airflow_dags_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_metric_images ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_metric_images_id_seq'::regclass);
@@ -23832,6 +24295,8 @@ ALTER TABLE ONLY audit_events_streaming_headers ALTER COLUMN id SET DEFAULT next
ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass);
+ALTER TABLE ONLY automation_rules ALTER COLUMN id SET DEFAULT nextval('automation_rules_id_seq'::regclass);
+
ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass);
ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('background_migration_jobs_id_seq'::regclass);
@@ -24050,6 +24515,8 @@ ALTER TABLE ONLY dast_profile_schedules ALTER COLUMN id SET DEFAULT nextval('das
ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profiles_id_seq'::regclass);
+ALTER TABLE ONLY dast_profiles_tags ALTER COLUMN id SET DEFAULT nextval('dast_profiles_tags_id_seq'::regclass);
+
ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass);
ALTER TABLE ONLY dast_scanner_profiles_tags ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_tags_id_seq'::regclass);
@@ -24376,6 +24843,8 @@ ALTER TABLE ONLY namespace_statistics ALTER COLUMN id SET DEFAULT nextval('names
ALTER TABLE ONLY namespaces ALTER COLUMN id SET DEFAULT nextval('namespaces_id_seq'::regclass);
+ALTER TABLE ONLY namespaces_storage_limit_exclusions ALTER COLUMN id SET DEFAULT nextval('namespaces_storage_limit_exclusions_id_seq'::regclass);
+
ALTER TABLE ONLY namespaces_sync_events ALTER COLUMN id SET DEFAULT nextval('namespaces_sync_events_id_seq'::regclass);
ALTER TABLE ONLY note_diff_files ALTER COLUMN id SET DEFAULT nextval('note_diff_files_id_seq'::regclass);
@@ -24478,12 +24947,16 @@ ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regcl
ALTER TABLE ONLY pm_licenses ALTER COLUMN id SET DEFAULT nextval('pm_licenses_id_seq'::regclass);
+ALTER TABLE ONLY pm_package_version_licenses ALTER COLUMN id SET DEFAULT nextval('pm_package_version_licenses_id_seq'::regclass);
+
ALTER TABLE ONLY pm_package_versions ALTER COLUMN id SET DEFAULT nextval('pm_package_versions_id_seq'::regclass);
ALTER TABLE ONLY pm_packages ALTER COLUMN id SET DEFAULT nextval('pm_packages_id_seq'::regclass);
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);
@@ -24510,6 +24983,8 @@ ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('
ALTER TABLE ONLY project_daily_statistics ALTER COLUMN id SET DEFAULT nextval('project_daily_statistics_id_seq'::regclass);
+ALTER TABLE ONLY project_data_transfers ALTER COLUMN id SET DEFAULT nextval('project_data_transfers_id_seq'::regclass);
+
ALTER TABLE ONLY project_deploy_tokens ALTER COLUMN id SET DEFAULT nextval('project_deploy_tokens_id_seq'::regclass);
ALTER TABLE ONLY project_export_jobs ALTER COLUMN id SET DEFAULT nextval('project_export_jobs_id_seq'::regclass);
@@ -24620,6 +25095,8 @@ ALTER TABLE ONLY sbom_sources ALTER COLUMN id SET DEFAULT nextval('sbom_sources_
ALTER TABLE ONLY sbom_vulnerable_component_versions ALTER COLUMN id SET DEFAULT nextval('sbom_vulnerable_component_versions_id_seq'::regclass);
+ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass);
+
ALTER TABLE ONLY scim_identities ALTER COLUMN id SET DEFAULT nextval('scim_identities_id_seq'::regclass);
ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_id_seq'::regclass);
@@ -24800,12 +25277,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 wiki_repository_states ALTER COLUMN id SET DEFAULT nextval('wiki_repository_states_id_seq'::regclass);
+
ALTER TABLE ONLY work_item_hierarchy_restrictions ALTER COLUMN id SET DEFAULT nextval('work_item_hierarchy_restrictions_id_seq'::regclass);
ALTER TABLE ONLY work_item_parent_links ALTER COLUMN id SET DEFAULT nextval('work_item_parent_links_id_seq'::regclass);
ALTER TABLE ONLY work_item_types ALTER COLUMN id SET DEFAULT nextval('work_item_types_id_seq'::regclass);
+ALTER TABLE ONLY work_item_widget_definitions ALTER COLUMN id SET DEFAULT nextval('work_item_widget_definitions_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);
@@ -24814,6 +25295,10 @@ ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_
ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass);
+ALTER TABLE ONLY zoekt_indexed_namespaces ALTER COLUMN id SET DEFAULT nextval('zoekt_indexed_namespaces_id_seq'::regclass);
+
+ALTER TABLE ONLY zoekt_shards ALTER COLUMN id SET DEFAULT nextval('zoekt_shards_id_seq'::regclass);
+
ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass);
ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events
@@ -25419,6 +25904,9 @@ ALTER TABLE ONLY agent_group_authorizations
ALTER TABLE ONLY agent_project_authorizations
ADD CONSTRAINT agent_project_authorizations_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY airflow_dags
+ ADD CONSTRAINT airflow_dags_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY alert_management_alert_assignees
ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id);
@@ -25536,6 +26024,9 @@ ALTER TABLE ONLY audit_events_streaming_headers
ALTER TABLE ONLY authentication_events
ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY automation_rules
+ ADD CONSTRAINT automation_rules_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY award_emoji
ADD CONSTRAINT award_emoji_pkey PRIMARY KEY (id);
@@ -25632,6 +26123,9 @@ ALTER TABLE ONLY chat_teams
ALTER TABLE vulnerability_scanners
ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID;
+ALTER TABLE oauth_access_tokens
+ ADD CONSTRAINT check_70f294ef54 CHECK ((expires_in IS NOT NULL)) NOT VALID;
+
ALTER TABLE sprints
ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID;
@@ -25641,6 +26135,9 @@ ALTER TABLE group_import_states
ALTER TABLE sprints
ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID;
+ALTER TABLE web_hook_logs
+ ADD CONSTRAINT check_df72cb58f5 CHECK ((char_length(url_hash) <= 44)) NOT VALID;
+
ALTER TABLE projects
ADD CONSTRAINT check_fa75869cb1 CHECK ((project_namespace_id IS NOT NULL)) NOT VALID;
@@ -25917,6 +26414,9 @@ ALTER TABLE ONLY dast_profiles_pipelines
ALTER TABLE ONLY dast_profiles
ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY dast_profiles_tags
+ ADD CONSTRAINT dast_profiles_tags_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);
@@ -26499,6 +26999,9 @@ ALTER TABLE ONLY namespace_statistics
ALTER TABLE ONLY namespaces
ADD CONSTRAINT namespaces_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY namespaces_storage_limit_exclusions
+ ADD CONSTRAINT namespaces_storage_limit_exclusions_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY namespaces_sync_events
ADD CONSTRAINT namespaces_sync_events_pkey PRIMARY KEY (id);
@@ -26676,11 +27179,14 @@ ALTER TABLE ONLY plan_limits
ALTER TABLE ONLY plans
ADD CONSTRAINT plans_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY pm_checkpoints
+ ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (purl_type);
+
ALTER TABLE ONLY pm_licenses
ADD CONSTRAINT pm_licenses_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_package_version_licenses
- ADD CONSTRAINT pm_package_version_licenses_pkey PRIMARY KEY (pm_package_version_id, pm_license_id);
+ ADD CONSTRAINT pm_package_version_licenses_pkey PRIMARY KEY (id);
ALTER TABLE ONLY pm_package_versions
ADD CONSTRAINT pm_package_versions_pkey PRIMARY KEY (id);
@@ -26691,6 +27197,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);
@@ -26736,6 +27245,9 @@ ALTER TABLE ONLY project_custom_attributes
ALTER TABLE ONLY project_daily_statistics
ADD CONSTRAINT project_daily_statistics_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY project_data_transfers
+ ADD CONSTRAINT project_data_transfers_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY project_deploy_tokens
ADD CONSTRAINT project_deploy_tokens_pkey PRIMARY KEY (id);
@@ -26928,6 +27440,9 @@ ALTER TABLE ONLY sbom_sources
ALTER TABLE ONLY sbom_vulnerable_component_versions
ADD CONSTRAINT sbom_vulnerable_component_versions_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY scan_result_policies
+ ADD CONSTRAINT scan_result_policies_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY schema_migrations
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
@@ -27237,6 +27752,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 wiki_repository_states
+ ADD CONSTRAINT wiki_repository_states_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY work_item_hierarchy_restrictions
ADD CONSTRAINT work_item_hierarchy_restrictions_pkey PRIMARY KEY (id);
@@ -27249,6 +27767,9 @@ ALTER TABLE ONLY work_item_progresses
ALTER TABLE ONLY work_item_types
ADD CONSTRAINT work_item_types_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY work_item_widget_definitions
+ ADD CONSTRAINT work_item_widget_definitions_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY x509_certificates
ADD CONSTRAINT x509_certificates_pkey PRIMARY KEY (id);
@@ -27261,6 +27782,12 @@ ALTER TABLE ONLY x509_issuers
ALTER TABLE ONLY zentao_tracker_data
ADD CONSTRAINT zentao_tracker_data_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY zoekt_indexed_namespaces
+ ADD CONSTRAINT zoekt_indexed_namespaces_pkey PRIMARY KEY (id);
+
+ALTER TABLE ONLY zoekt_shards
+ ADD CONSTRAINT zoekt_shards_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY zoom_meetings
ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id);
@@ -28214,6 +28741,8 @@ CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index O
CREATE INDEX composer_cache_files_index_on_deleted_at ON packages_composer_cache_files USING btree (delete_at, id);
+CREATE UNIQUE INDEX custom_email_unique_constraint ON service_desk_settings USING btree (custom_email);
+
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);
@@ -28240,10 +28769,14 @@ CREATE INDEX i_compliance_frameworks_on_id_and_created_at ON compliance_manageme
CREATE INDEX i_dast_pre_scan_verification_steps_on_pre_scan_verification_id ON dast_pre_scan_verification_steps USING btree (dast_pre_scan_verification_id);
+CREATE INDEX i_dast_profiles_tags_on_scanner_profiles_id ON dast_profiles_tags USING btree (dast_profile_id);
+
CREATE INDEX i_dast_scanner_profiles_tags_on_scanner_profiles_id ON dast_scanner_profiles_tags USING btree (dast_scanner_profile_id);
CREATE UNIQUE INDEX i_pm_licenses_on_spdx_identifier ON pm_licenses USING btree (spdx_identifier);
+CREATE UNIQUE INDEX i_pm_package_version_licenses_join_ids ON pm_package_version_licenses USING btree (pm_package_version_id, pm_license_id);
+
CREATE UNIQUE INDEX i_pm_package_versions_on_package_id_and_version ON pm_package_versions USING btree (pm_package_id, version);
CREATE UNIQUE INDEX i_pm_packages_purl_type_and_name ON pm_packages USING btree (purl_type, name);
@@ -28360,6 +28893,8 @@ CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON pac
CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON packages_debian_project_component_files USING btree (architecture_id);
+CREATE INDEX idx_packages_on_project_id_name_id_version_when_installable_npm ON packages_packages USING btree (project_id, name, id, version) WHERE ((package_type = 2) AND (status = ANY (ARRAY[0, 1])));
+
CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 7) AND (status <> 4));
CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 8) AND (status <> 4));
@@ -28416,10 +28951,14 @@ CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan
CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id);
+CREATE UNIQUE INDEX idx_software_license_policies_unique_on_project_and_scan_policy ON software_license_policies USING btree (project_id, software_license_id, scan_result_policy_id);
+
CREATE INDEX idx_streaming_headers_on_external_audit_event_destination_id ON audit_events_streaming_headers USING btree (external_audit_event_destination_id);
CREATE INDEX idx_test_reports_on_issue_id_created_at_and_id ON requirements_management_test_reports USING btree (issue_id, created_at, id);
+CREATE UNIQUE INDEX idx_uniq_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id);
+
CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id);
CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha);
@@ -28462,6 +29001,8 @@ CREATE UNIQUE INDEX index_agent_project_authorizations_on_agent_id_and_project_i
CREATE INDEX index_agent_project_authorizations_on_project_id ON agent_project_authorizations USING btree (project_id);
+CREATE INDEX index_airflow_dags_on_project_id ON airflow_dags USING btree (project_id);
+
CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assignees USING btree (alert_id);
CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id);
@@ -28518,7 +29059,7 @@ CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analyti
CREATE UNIQUE INDEX index_analytics_dashboards_pointers_on_namespace_id ON analytics_dashboards_pointers USING btree (namespace_id);
-CREATE INDEX index_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id);
+CREATE INDEX index_analytics_dashboards_pointers_on_target_project_id ON analytics_dashboards_pointers USING btree (target_project_id);
CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id);
@@ -28598,12 +29139,20 @@ CREATE INDEX index_authentication_events_on_provider ON authentication_events US
CREATE INDEX index_authentication_events_on_user_and_ip_address_and_result ON authentication_events USING btree (user_id, ip_address, result);
+CREATE UNIQUE INDEX index_automation_rules_namespace_id_name ON automation_rules USING btree (namespace_id, lower(name));
+
+CREATE INDEX index_automation_rules_namespace_id_permanently_disabled ON automation_rules USING btree (namespace_id, permanently_disabled);
+
CREATE INDEX index_award_emoji_on_awardable_type_and_awardable_id ON award_emoji USING btree (awardable_type, awardable_id);
CREATE UNIQUE INDEX index_aws_roles_on_role_external_id ON aws_roles USING btree (role_external_id);
CREATE UNIQUE INDEX index_aws_roles_on_user_id ON aws_roles USING btree (user_id);
+CREATE INDEX p_ci_builds_metadata_on_runner_machine_id_idx ON ONLY p_ci_builds_metadata USING btree (runner_machine_id) WHERE (runner_machine_id IS NOT NULL);
+
+CREATE INDEX index_b6331cde35 ON ci_builds_metadata USING btree (runner_machine_id) WHERE (runner_machine_id IS NOT NULL);
+
CREATE INDEX index_background_migration_jobs_for_partitioning_migrations ON background_migration_jobs USING btree (((arguments ->> 2))) WHERE (class_name = 'Gitlab::Database::PartitioningMigrationHelpers::BackfillPartitionedTable'::text);
CREATE INDEX index_background_migration_jobs_on_class_name_and_arguments ON background_migration_jobs USING btree (class_name, arguments);
@@ -28730,9 +29279,11 @@ CREATE UNIQUE INDEX index_chat_teams_on_namespace_id ON chat_teams USING btree (
CREATE UNIQUE INDEX index_ci_build_needs_on_build_id_and_name ON ci_build_needs USING btree (build_id, name);
+CREATE INDEX index_ci_build_needs_on_partition_id_build_id ON ci_build_needs USING btree (partition_id, build_id);
+
CREATE UNIQUE INDEX index_ci_build_pending_states_on_build_id ON ci_build_pending_states USING btree (build_id);
-CREATE INDEX index_ci_build_pending_states_on_partition_id_build_id ON ci_build_pending_states USING btree (partition_id, build_id);
+CREATE UNIQUE INDEX index_ci_build_report_results_on_partition_id_build_id ON ci_build_report_results USING btree (partition_id, build_id);
CREATE INDEX index_ci_build_report_results_on_project_id ON ci_build_report_results USING btree (project_id);
@@ -28740,6 +29291,8 @@ CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON c
CREATE INDEX index_ci_build_trace_chunks_on_partition_id_build_id ON ci_build_trace_chunks USING btree (partition_id, build_id);
+CREATE UNIQUE INDEX index_ci_build_trace_metadata_on_partition_id_build_id ON ci_build_trace_metadata USING btree (partition_id, build_id);
+
CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id);
CREATE INDEX p_ci_builds_metadata_build_id_idx ON ONLY p_ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE);
@@ -28804,6 +29357,8 @@ CREATE INDEX index_ci_builds_runner_id_running ON ci_builds USING btree (runner_
CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id);
+CREATE UNIQUE INDEX index_ci_builds_runner_session_on_partition_id_build_id ON ci_builds_runner_session USING btree (partition_id, build_id);
+
CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id);
CREATE INDEX index_ci_daily_build_group_report_results_on_last_pipeline_id ON ci_daily_build_group_report_results USING btree (last_pipeline_id);
@@ -28838,6 +29393,8 @@ CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_file_type ON ci_job_art
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_partition_id_job_id ON ci_job_artifacts USING btree (partition_id, job_id);
+
CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id);
CREATE INDEX index_ci_job_artifacts_on_project_id_and_id ON ci_job_artifacts USING btree (project_id, id);
@@ -28852,6 +29409,8 @@ CREATE INDEX index_ci_job_variables_on_job_id ON ci_job_variables USING btree (j
CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables USING btree (key, job_id);
+CREATE INDEX index_ci_job_variables_on_partition_id_job_id ON ci_job_variables USING btree (partition_id, job_id);
+
CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON ci_minutes_additional_packs USING btree (namespace_id, purchase_xid);
CREATE UNIQUE INDEX index_ci_namespace_mirrors_on_namespace_id ON ci_namespace_mirrors USING btree (namespace_id);
@@ -28866,6 +29425,8 @@ CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USI
CREATE INDEX index_ci_pending_builds_on_namespace_id ON ci_pending_builds USING btree (namespace_id);
+CREATE UNIQUE INDEX index_ci_pending_builds_on_partition_id_build_id ON ci_pending_builds USING btree (partition_id, build_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);
@@ -28964,13 +29525,15 @@ CREATE UNIQUE INDEX index_ci_resource_groups_on_project_id_and_key ON ci_resourc
CREATE INDEX index_ci_resources_on_build_id ON ci_resources USING btree (build_id);
+CREATE INDEX index_ci_resources_on_partition_id_build_id ON ci_resources USING btree (partition_id, build_id);
+
CREATE UNIQUE INDEX index_ci_resources_on_resource_group_id_and_build_id ON ci_resources USING btree (resource_group_id, build_id);
CREATE INDEX index_ci_runner_machines_on_contacted_at_desc_and_id_desc ON ci_runner_machines USING btree (contacted_at DESC, id DESC);
CREATE INDEX index_ci_runner_machines_on_created_at_and_id_desc ON ci_runner_machines USING btree (created_at, id DESC);
-CREATE UNIQUE INDEX index_ci_runner_machines_on_runner_id_and_machine_xid ON ci_runner_machines USING btree (runner_id, machine_xid);
+CREATE UNIQUE INDEX index_ci_runner_machines_on_runner_id_and_system_xid ON ci_runner_machines USING btree (runner_id, system_xid);
CREATE INDEX index_ci_runner_machines_on_version ON ci_runner_machines USING btree (version);
@@ -29012,6 +29575,8 @@ CREATE INDEX index_ci_runners_on_version ON ci_runners USING btree (version);
CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id);
+CREATE UNIQUE INDEX index_ci_running_builds_on_partition_id_build_id ON ci_running_builds USING btree (partition_id, build_id);
+
CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id);
CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id);
@@ -29034,6 +29599,8 @@ CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines US
CREATE INDEX index_ci_sources_pipelines_on_source_job_id ON ci_sources_pipelines USING btree (source_job_id);
+CREATE INDEX index_ci_sources_pipelines_on_source_partition_id_source_job_id ON ci_sources_pipelines USING btree (source_partition_id, source_job_id);
+
CREATE INDEX index_ci_sources_pipelines_on_source_pipeline_id ON ci_sources_pipelines USING btree (source_pipeline_id);
CREATE INDEX index_ci_sources_pipelines_on_source_project_id ON ci_sources_pipelines USING btree (source_project_id);
@@ -29220,6 +29787,8 @@ CREATE UNIQUE INDEX index_dast_profiles_on_project_id_and_name ON dast_profiles
CREATE UNIQUE INDEX index_dast_profiles_pipelines_on_ci_pipeline_id ON dast_profiles_pipelines USING btree (ci_pipeline_id);
+CREATE INDEX index_dast_profiles_tags_on_tag_id ON dast_profiles_tags USING btree (tag_id);
+
CREATE UNIQUE INDEX index_dast_scanner_profiles_on_project_id_and_name ON dast_scanner_profiles USING btree (project_id, name);
CREATE INDEX index_dast_scanner_profiles_tags_on_tag_id ON dast_scanner_profiles_tags USING btree (tag_id);
@@ -29610,12 +30179,14 @@ CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gi
CREATE INDEX index_gitlab_subscriptions_on_end_date_and_namespace_id ON gitlab_subscriptions USING btree (end_date, namespace_id);
-CREATE INDEX index_gitlab_subscriptions_on_hosted_plan_id ON gitlab_subscriptions USING btree (hosted_plan_id);
+CREATE INDEX index_gitlab_subscriptions_on_hosted_plan_id_and_trial ON gitlab_subscriptions USING btree (hosted_plan_id, trial);
CREATE INDEX index_gitlab_subscriptions_on_max_seats_used_changed_at ON gitlab_subscriptions USING btree (max_seats_used_changed_at, namespace_id);
CREATE UNIQUE INDEX index_gitlab_subscriptions_on_namespace_id ON gitlab_subscriptions USING btree (namespace_id);
+CREATE INDEX index_gitlab_subscriptions_on_trial_and_trial_starts_on ON gitlab_subscriptions USING btree (trial, trial_starts_on);
+
CREATE UNIQUE INDEX index_gpg_key_subkeys_on_fingerprint ON gpg_key_subkeys USING btree (fingerprint);
CREATE INDEX index_gpg_key_subkeys_on_gpg_key_id ON gpg_key_subkeys USING btree (gpg_key_id);
@@ -30284,6 +30855,8 @@ CREATE INDEX index_namespaces_on_type_and_visibility_and_parent_id ON namespaces
CREATE INDEX index_namespaces_public_groups_name_id ON namespaces USING btree (name, id) WHERE (((type)::text = 'Group'::text) AND (visibility_level = 20));
+CREATE INDEX index_namespaces_storage_limit_exclusions_on_namespace_id ON namespaces_storage_limit_exclusions USING btree (namespace_id);
+
CREATE INDEX index_namespaces_sync_events_on_namespace_id ON namespaces_sync_events USING btree (namespace_id);
CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON members USING btree (source_id, source_type) WHERE ((requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text));
@@ -30574,7 +31147,7 @@ CREATE UNIQUE INDEX index_personal_access_tokens_on_token_digest ON personal_acc
CREATE INDEX index_personal_access_tokens_on_user_id ON personal_access_tokens USING btree (user_id);
-CREATE INDEX index_pipeline_metadata_on_pipeline_id_name_lower_text_pattern ON ci_pipeline_metadata USING btree (pipeline_id, lower(name) text_pattern_ops);
+CREATE INDEX index_pipeline_metadata_on_pipeline_id_name_text_pattern ON ci_pipeline_metadata USING btree (pipeline_id, name text_pattern_ops);
CREATE UNIQUE INDEX index_plan_limits_on_plan_id ON plan_limits USING btree (plan_id);
@@ -30592,6 +31165,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);
@@ -30624,6 +31199,10 @@ CREATE UNIQUE INDEX index_project_custom_attributes_on_project_id_and_key ON pro
CREATE UNIQUE INDEX index_project_daily_statistics_on_project_id_and_date ON project_daily_statistics USING btree (project_id, date DESC);
+CREATE INDEX index_project_data_transfers_on_namespace_id ON project_data_transfers USING btree (namespace_id);
+
+CREATE UNIQUE INDEX index_project_data_transfers_on_project_and_namespace_and_date ON project_data_transfers USING btree (project_id, namespace_id, date);
+
CREATE INDEX index_project_deploy_tokens_on_deploy_token_id ON project_deploy_tokens USING btree (deploy_token_id);
CREATE UNIQUE INDEX index_project_deploy_tokens_on_project_id_and_deploy_token_id ON project_deploy_tokens USING btree (project_id, deploy_token_id);
@@ -30872,6 +31451,8 @@ CREATE UNIQUE INDEX index_protected_environments_on_project_id_and_name ON prote
CREATE INDEX index_protected_tag_create_access ON protected_tag_create_access_levels USING btree (protected_tag_id);
+CREATE INDEX index_protected_tag_create_access_levels_on_deploy_key_id ON protected_tag_create_access_levels USING btree (deploy_key_id);
+
CREATE INDEX index_protected_tag_create_access_levels_on_group_id ON protected_tag_create_access_levels USING btree (group_id);
CREATE INDEX index_protected_tag_create_access_levels_on_user_id ON protected_tag_create_access_levels USING btree (user_id);
@@ -31036,6 +31617,8 @@ CREATE UNIQUE INDEX index_sbom_occurrences_on_uuid ON sbom_occurrences USING btr
CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources USING btree (source_type, source);
+CREATE INDEX index_scan_result_policies_on_policy_configuration_id ON scan_result_policies USING btree (security_orchestration_policy_configuration_id);
+
CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id);
CREATE UNIQUE INDEX index_scim_identities_on_lower_extern_uid_and_group_id ON scim_identities USING btree (lower((extern_uid)::text), group_id);
@@ -31146,9 +31729,9 @@ CREATE INDEX index_snippets_on_updated_at ON snippets USING btree (updated_at);
CREATE INDEX index_snippets_on_visibility_level_and_secret ON snippets USING btree (visibility_level, secret);
-CREATE INDEX index_software_license_policies_on_software_license_id ON software_license_policies USING btree (software_license_id);
+CREATE INDEX index_software_license_policies_on_scan_result_policy_id ON software_license_policies USING btree (scan_result_policy_id);
-CREATE UNIQUE INDEX index_software_license_policies_unique_per_project ON software_license_policies USING btree (project_id, software_license_id);
+CREATE INDEX index_software_license_policies_on_software_license_id ON software_license_policies USING btree (software_license_id);
CREATE INDEX index_software_licenses_on_spdx_identifier ON software_licenses USING btree (spdx_identifier);
@@ -31646,6 +32229,16 @@ CREATE UNIQUE INDEX index_wiki_page_slugs_on_slug_and_wiki_page_meta_id ON wiki_
CREATE INDEX index_wiki_page_slugs_on_wiki_page_meta_id ON wiki_page_slugs USING btree (wiki_page_meta_id);
+CREATE INDEX index_wiki_repository_states_failed_verification ON wiki_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3);
+
+CREATE INDEX index_wiki_repository_states_needs_verification ON wiki_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3));
+
+CREATE UNIQUE INDEX index_wiki_repository_states_on_project_wiki_repository_id ON wiki_repository_states USING btree (project_wiki_repository_id);
+
+CREATE INDEX index_wiki_repository_states_on_verification_state ON wiki_repository_states USING btree (verification_state);
+
+CREATE INDEX index_wiki_repository_states_pending_verification ON wiki_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0);
+
CREATE INDEX index_work_item_hierarchy_restrictions_on_child_type_id ON work_item_hierarchy_restrictions USING btree (child_type_id);
CREATE UNIQUE INDEX index_work_item_hierarchy_restrictions_on_parent_and_child ON work_item_hierarchy_restrictions USING btree (parent_type_id, child_type_id);
@@ -31656,6 +32249,12 @@ CREATE UNIQUE INDEX index_work_item_parent_links_on_work_item_id ON work_item_pa
CREATE INDEX index_work_item_parent_links_on_work_item_parent_id ON work_item_parent_links USING btree (work_item_parent_id);
+CREATE UNIQUE INDEX index_work_item_widget_definitions_on_default_witype_and_name ON work_item_widget_definitions USING btree (work_item_type_id, name) WHERE (namespace_id IS NULL);
+
+CREATE UNIQUE INDEX index_work_item_widget_definitions_on_namespace_type_and_name ON work_item_widget_definitions USING btree (namespace_id, work_item_type_id, name);
+
+CREATE INDEX index_work_item_widget_definitions_on_work_item_type_id ON work_item_widget_definitions USING btree (work_item_type_id);
+
CREATE INDEX index_x509_certificates_on_subject_key_identifier ON x509_certificates USING btree (subject_key_identifier);
CREATE INDEX index_x509_certificates_on_x509_issuer_id ON x509_certificates USING btree (x509_issuer_id);
@@ -31670,6 +32269,14 @@ CREATE INDEX index_x509_issuers_on_subject_key_identifier ON x509_issuers USING
CREATE INDEX index_zentao_tracker_data_on_integration_id ON zentao_tracker_data USING btree (integration_id);
+CREATE INDEX index_zoekt_indexed_namespaces_on_namespace_id ON zoekt_indexed_namespaces USING btree (namespace_id);
+
+CREATE UNIQUE INDEX index_zoekt_shard_and_namespace ON zoekt_indexed_namespaces USING btree (zoekt_shard_id, namespace_id);
+
+CREATE UNIQUE INDEX index_zoekt_shards_on_index_base_url ON zoekt_shards USING btree (index_base_url);
+
+CREATE UNIQUE INDEX index_zoekt_shards_on_search_base_url ON zoekt_shards USING btree (search_base_url);
+
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);
@@ -31762,6 +32369,8 @@ CREATE INDEX tmp_idx_for_feedback_comment_processing ON vulnerability_feedback U
CREATE INDEX tmp_idx_for_vulnerability_feedback_migration ON vulnerability_feedback USING btree (id) WHERE ((migrated_to_state_transition = false) AND (feedback_type = 0));
+CREATE INDEX tmp_idx_package_files_on_non_zero_size ON packages_package_files USING btree (package_id, size) WHERE (size IS NOT NULL);
+
CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL));
CREATE INDEX tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace ON ci_job_artifacts USING btree (id) WHERE (((date_part('day'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision])) AND (date_part('minute'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(0)::double precision, (30)::double precision, (45)::double precision])) AND (date_part('second'::text, timezone('UTC'::text, expire_at)) = (0)::double precision)) OR (file_type = 3));
@@ -31806,6 +32415,10 @@ CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_suite
CREATE UNIQUE INDEX unique_ci_builds_token_encrypted_and_partition_id ON ci_builds USING btree (token_encrypted, partition_id) WHERE (token_encrypted IS NOT NULL);
+CREATE UNIQUE INDEX unique_index_ci_build_pending_states_on_partition_id_build_id ON ci_build_pending_states USING btree (partition_id, build_id);
+
+CREATE UNIQUE INDEX unique_index_for_project_pages_unique_domain ON project_settings USING btree (pages_unique_domain) WHERE (pages_unique_domain IS NOT NULL);
+
CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id);
CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id);
@@ -33104,6 +33717,8 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p
ALTER INDEX p_ci_builds_metadata_pkey ATTACH PARTITION ci_builds_metadata_pkey;
+ALTER INDEX p_ci_builds_metadata_on_runner_machine_id_idx ATTACH PARTITION index_b6331cde35;
+
ALTER INDEX p_ci_builds_metadata_build_id_idx ATTACH PARTITION index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts;
ALTER INDEX p_ci_builds_metadata_build_id_id_idx ATTACH PARTITION index_ci_builds_metadata_on_build_id_and_id_and_interruptible;
@@ -33132,10 +33747,42 @@ CREATE TRIGGER nullify_merge_request_metrics_build_data_on_update BEFORE UPDATE
CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+CREATE TRIGGER trigger_080e73845bfd BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE FUNCTION trigger_080e73845bfd();
+
+CREATE TRIGGER trigger_0e214b8a14f2 BEFORE INSERT OR UPDATE ON vulnerability_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_0e214b8a14f2();
+
+CREATE TRIGGER trigger_17c3a95ee58a BEFORE INSERT OR UPDATE ON commit_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_17c3a95ee58a();
+
CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd();
+CREATE TRIGGER trigger_3207b8d0d6f3 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_3207b8d0d6f3();
+
+CREATE TRIGGER trigger_3dc62927cae8 BEFORE INSERT OR UPDATE ON design_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_3dc62927cae8();
+
+CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
+
+CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_482bac5ec48a();
+
+CREATE TRIGGER trigger_775287b6d67a BEFORE INSERT OR UPDATE ON note_diff_files FOR EACH ROW EXECUTE FUNCTION trigger_775287b6d67a();
+
+CREATE TRIGGER trigger_7f4fcd5aa322 BEFORE INSERT OR UPDATE ON sent_notifications FOR EACH ROW EXECUTE FUNCTION trigger_7f4fcd5aa322();
+
+CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc();
+
+CREATE TRIGGER trigger_bfcbace4260d BEFORE INSERT OR UPDATE ON merge_request_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfcbace4260d();
+
+CREATE TRIGGER trigger_c2051020aa8b BEFORE INSERT OR UPDATE ON issue_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c2051020aa8b();
+
+CREATE TRIGGER trigger_c5a5f48f12b0 BEFORE INSERT OR UPDATE ON epic_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c5a5f48f12b0();
+
+CREATE TRIGGER trigger_c7107f30d69d BEFORE INSERT OR UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION trigger_c7107f30d69d();
+
+CREATE TRIGGER trigger_dca935e3a712 BEFORE INSERT OR UPDATE ON todos FOR EACH ROW EXECUTE FUNCTION trigger_dca935e3a712();
+
CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace();
+CREATE TRIGGER trigger_ee7956d805e6 BEFORE INSERT OR UPDATE ON suggestions FOR EACH ROW EXECUTE FUNCTION trigger_ee7956d805e6();
+
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();
@@ -33196,6 +33843,9 @@ ALTER TABLE ONLY service_desk_settings
ALTER TABLE ONLY design_management_designs_versions
ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE;
+ALTER TABLE ONLY analytics_dashboards_pointers
+ ADD CONSTRAINT fk_05d96922bd FOREIGN KEY (target_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;
@@ -33223,12 +33873,6 @@ ALTER TABLE ONLY notification_settings
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_unit_test_failures
- ADD CONSTRAINT fk_0f09856e1f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_unit_test_failures
- ADD CONSTRAINT fk_0f09856e1f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE;
-
ALTER TABLE ONLY deployment_approvals
ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -33394,6 +34038,9 @@ ALTER TABLE ONLY sprints
ALTER TABLE ONLY push_event_payloads
ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY protected_tag_create_access_levels
+ ADD CONSTRAINT fk_386a642e13 FOREIGN KEY (deploy_key_id) REFERENCES keys(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY incident_management_timeline_events
ADD CONSTRAINT fk_38a74279df FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -33409,6 +34056,9 @@ ALTER TABLE ONLY agent_activity_events
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL;
+ALTER TABLE ONLY zoekt_indexed_namespaces
+ ADD CONSTRAINT fk_3bebdb4efc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY epics
ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@@ -33514,6 +34164,9 @@ ALTER TABLE ONLY user_achievements
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_6149611a04 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL;
+ALTER TABLE ONLY work_item_widget_definitions
+ ADD CONSTRAINT fk_61bfa96db5 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY deployment_approvals
ADD CONSTRAINT fk_61cdbdc5b9 FOREIGN KEY (approval_rule_id) REFERENCES protected_environment_approval_rules(id) ON DELETE SET NULL;
@@ -33532,9 +34185,6 @@ ALTER TABLE ONLY merge_requests
ALTER TABLE ONLY ci_builds
ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_693b8795e4 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY project_wiki_repository_states
ADD CONSTRAINT fk_6951681c70 FOREIGN KEY (project_wiki_repository_id) REFERENCES project_wiki_repositories(id) ON DELETE CASCADE;
@@ -33643,6 +34293,9 @@ ALTER TABLE ONLY merge_request_diffs
ALTER TABLE ONLY requirements
ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_pending_states
+ ADD CONSTRAINT fk_861cd17da3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_86c84214ec FOREIGN KEY (repository_renamed_event_id) REFERENCES geo_repository_renamed_events(id) ON DELETE CASCADE;
@@ -33664,6 +34317,9 @@ ALTER TABLE ONLY requirements_management_test_reports
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_trace_chunks
+ ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE ONLY sbom_vulnerable_component_versions
ADD CONSTRAINT fk_8a2a1197f9 FOREIGN KEY (sbom_component_version_id) REFERENCES sbom_component_versions(id) ON DELETE CASCADE;
@@ -33697,9 +34353,6 @@ ALTER TABLE ONLY vulnerabilities
ALTER TABLE ONLY boards_epic_list_user_preferences
ADD CONSTRAINT fk_95eac55851 FOREIGN KEY (epic_list_id) REFERENCES boards_epic_lists(id) ON DELETE CASCADE;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_964370041d FOREIGN KEY (usage_stats_set_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_96b1dd429c FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL;
@@ -33727,6 +34380,9 @@ ALTER TABLE ONLY epics
ALTER TABLE ONLY user_group_callouts
ADD CONSTRAINT fk_9dc8b9d4b2 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_unit_test_failures
+ ADD CONSTRAINT fk_9e0fc58930_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE ONLY protected_environments
ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -33865,6 +34521,9 @@ ALTER TABLE ONLY snippets
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_be5624bf37 FOREIGN KEY (source_job_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_sources_pipelines
+ ADD CONSTRAINT fk_be5624bf37_p FOREIGN KEY (source_partition_id, source_job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY packages_maven_metadata
ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;
@@ -34009,8 +34668,11 @@ ALTER TABLE ONLY protected_branches
ALTER TABLE ONLY issues
ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL;
+ALTER TABLE ONLY approval_project_rules
+ ADD CONSTRAINT fk_e1372c912e FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY ci_resources
- ADD CONSTRAINT fk_e169a8e3d5 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
+ ADD CONSTRAINT fk_e169a8e3d5_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE ONLY ci_sources_pipelines
ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
@@ -34039,21 +34701,18 @@ ALTER TABLE ONLY namespaces
ALTER TABLE ONLY fork_networks
ADD CONSTRAINT fk_e7b436b2b5 FOREIGN KEY (root_project_id) REFERENCES projects(id) ON DELETE SET NULL;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY pages_domains
ADD CONSTRAINT fk_ea2f6dfc6f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_ec757bd087 FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY merge_requests_compliance_violations
ADD CONSTRAINT fk_ec881c1c6f FOREIGN KEY (violating_user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY work_item_widget_definitions
+ ADD CONSTRAINT fk_ecf57512f7 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY events
ADD CONSTRAINT fk_edfd187b6f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -34099,6 +34758,9 @@ ALTER TABLE ONLY boards_epic_list_user_preferences
ALTER TABLE ONLY user_project_callouts
ADD CONSTRAINT fk_f62dd11a33 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY approval_merge_request_rules
+ ADD CONSTRAINT fk_f726c79756 FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY cluster_agents
ADD CONSTRAINT fk_f7d43dee13 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -34153,6 +34815,9 @@ ALTER TABLE ONLY approval_merge_request_rules
ALTER TABLE ONLY namespace_statistics
ADD CONSTRAINT fk_rails_0062050394 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY automation_rules
+ ADD CONSTRAINT fk_rails_025b519b8d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY incident_management_oncall_participants
ADD CONSTRAINT fk_rails_032b12996a FOREIGN KEY (oncall_rotation_id) REFERENCES incident_management_oncall_rotations(id) ON DELETE CASCADE;
@@ -34189,12 +34854,6 @@ ALTER TABLE ONLY packages_conan_file_metadata
ALTER TABLE ONLY related_epic_links
ADD CONSTRAINT fk_rails_0b72027748 FOREIGN KEY (target_id) REFERENCES epics(id) ON DELETE CASCADE;
-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 ci_build_pending_states
- ADD CONSTRAINT fk_rails_0bbbfeaf9d_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, 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;
@@ -34222,12 +34881,6 @@ ALTER TABLE ONLY issue_email_participants
ALTER TABLE ONLY merge_request_context_commits
ADD CONSTRAINT fk_rails_0fe0039f60 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
-ALTER TABLE ONLY ci_build_trace_chunks
- ADD CONSTRAINT fk_rails_1013b761f2 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
-
-ALTER TABLE ONLY ci_build_trace_chunks
- ADD CONSTRAINT fk_rails_1013b761f2_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE;
-
ALTER TABLE ONLY vulnerability_exports
ADD CONSTRAINT fk_rails_1019162882 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -34267,12 +34920,18 @@ ALTER TABLE ONLY diff_note_positions
ALTER TABLE ONLY analytics_cycle_analytics_aggregations
ADD CONSTRAINT fk_rails_13c8374c7a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY namespaces_storage_limit_exclusions
+ ADD CONSTRAINT fk_rails_14e8f7b0e0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY users_security_dashboard_projects
ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_build_report_results
ADD CONSTRAINT fk_rails_16cb1ff064 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_report_results
+ ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY project_deploy_tokens
ADD CONSTRAINT fk_rails_170e03cbaf FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@@ -34537,6 +35196,9 @@ ALTER TABLE ONLY chat_teams
ALTER TABLE ONLY ci_build_needs
ADD CONSTRAINT fk_rails_3cf221d4ed FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_build_needs
+ ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY cluster_groups
ADD CONSTRAINT fk_rails_3d28377556 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@@ -34657,6 +35319,9 @@ ALTER TABLE ONLY geo_repository_renamed_events
ALTER TABLE ONLY aws_roles
ADD CONSTRAINT fk_rails_4ed56f4720 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY zoekt_indexed_namespaces
+ ADD CONSTRAINT fk_rails_4f6006e94c FOREIGN KEY (zoekt_shard_id) REFERENCES zoekt_shards(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY packages_debian_publications
ADD CONSTRAINT fk_rails_4fc8ebd03e FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE;
@@ -34886,7 +35551,7 @@ ALTER TABLE ONLY analytics_dashboards_pointers
ADD CONSTRAINT fk_rails_7027b7eaa9 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_builds_runner_session
- ADD CONSTRAINT fk_rails_70707857d3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_rails_70707857d3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY list_user_preferences
ADD CONSTRAINT fk_rails_70b2ef5ce2 FOREIGN KEY (list_id) REFERENCES lists(id) ON DELETE CASCADE;
@@ -34897,6 +35562,9 @@ ALTER TABLE ONLY project_custom_attributes
ALTER TABLE ONLY ci_pending_builds
ADD CONSTRAINT fk_rails_725a2644a3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_pending_builds
+ ADD CONSTRAINT fk_rails_725a2644a3_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE security_findings
ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE;
@@ -34978,9 +35646,6 @@ ALTER TABLE ONLY milestone_releases
ALTER TABLE ONLY resource_state_events
ADD CONSTRAINT fk_rails_7ddc5f7457 FOREIGN KEY (source_merge_request_id) REFERENCES merge_requests(id) ON DELETE SET NULL;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_rails_7e112a9599 FOREIGN KEY (instance_administration_project_id) REFERENCES projects(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_7e7688ecaf FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
@@ -35272,9 +35937,15 @@ ALTER TABLE ONLY ci_pipeline_artifacts
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_aa1b2961b1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
+ALTER TABLE ONLY wiki_repository_states
+ ADD CONSTRAINT fk_rails_aa2f8a61ba FOREIGN KEY (project_wiki_repository_id) REFERENCES project_wiki_repositories(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY x509_commit_signatures
ADD CONSTRAINT fk_rails_ab07452314 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY dast_profiles_tags
+ ADD CONSTRAINT fk_rails_ab9e643cd8 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY resource_iteration_events
ADD CONSTRAINT fk_rails_abf5d4affa FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -35296,6 +35967,9 @@ ALTER TABLE ONLY metrics_dashboard_annotations
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 ci_build_trace_metadata
+ ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
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;
@@ -35335,9 +36009,6 @@ ALTER TABLE ONLY merge_request_predictions
ALTER TABLE ONLY incident_management_escalation_rules
ADD CONSTRAINT fk_rails_b3c9c17bd4 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE;
-ALTER TABLE ONLY application_settings
- ADD CONSTRAINT fk_rails_b53e481273 FOREIGN KEY (custom_project_templates_group_id) REFERENCES namespaces(id) ON DELETE SET NULL;
-
ALTER TABLE ONLY packages_debian_project_component_files
ADD CONSTRAINT fk_rails_b543a9622b FOREIGN KEY (architecture_id) REFERENCES packages_debian_project_architectures(id) ON DELETE RESTRICT;
@@ -35449,6 +36120,9 @@ ALTER TABLE ONLY boards_epic_board_recent_visits
ALTER TABLE ONLY ci_job_artifacts
ADD CONSTRAINT fk_rails_c5137cb2c1 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_job_artifacts
+ ADD CONSTRAINT fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY packages_events
ADD CONSTRAINT fk_rails_c6c20d0094 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE SET NULL;
@@ -35482,6 +36156,9 @@ ALTER TABLE ONLY gpg_signatures
ALTER TABLE ONLY board_group_recent_visits
ADD CONSTRAINT fk_rails_ca04c38720 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE;
+ALTER TABLE ONLY airflow_dags
+ ADD CONSTRAINT fk_rails_ca3ac0d68c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY boards_epic_board_positions
ADD CONSTRAINT fk_rails_cb4563dd6e FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE;
@@ -35560,6 +36237,9 @@ ALTER TABLE ONLY merge_request_reviewers
ALTER TABLE ONLY ci_running_builds
ADD CONSTRAINT fk_rails_da45cfa165 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_running_builds
+ ADD CONSTRAINT fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE;
+
ALTER TABLE ONLY jira_imports
ADD CONSTRAINT fk_rails_da617096ce FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -35587,6 +36267,9 @@ ALTER TABLE ONLY incident_management_timeline_event_tags
ALTER TABLE ONLY user_callouts
ADD CONSTRAINT fk_rails_ddfdd80f3d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE ONLY scan_result_policies
+ ADD CONSTRAINT fk_rails_de9e5d2ce6 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY dast_scanner_profiles_tags
ADD CONSTRAINT fk_rails_deb79b7f19 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE;
@@ -35638,6 +36321,9 @@ ALTER TABLE ONLY serverless_domain_cluster
ALTER TABLE ONLY incident_management_escalation_policies
ADD CONSTRAINT fk_rails_e5b513daa7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY software_license_policies
+ ADD CONSTRAINT fk_rails_e5b77d620e FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY vulnerability_external_issue_links
ADD CONSTRAINT fk_rails_e5ba7f7b13 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@@ -35788,6 +36474,9 @@ ALTER TABLE ONLY merge_requests_closing_issues
ALTER TABLE ONLY banned_users
ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE p_ci_builds_metadata
+ ADD CONSTRAINT fk_rails_fae01b2700 FOREIGN KEY (runner_machine_id) REFERENCES ci_runner_machines(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY operations_feature_flags_issues
ADD CONSTRAINT fk_rails_fb4d2a7cb1 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
@@ -35800,6 +36489,9 @@ ALTER TABLE ONLY serverless_domain_cluster
ALTER TABLE ONLY ci_job_variables
ADD CONSTRAINT fk_rails_fbf3b34792 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_job_variables
+ ADD CONSTRAINT fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY packages_nuget_metadata
ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE;