diff options
Diffstat (limited to 'db')
1730 files changed, 18288 insertions, 7831 deletions
diff --git a/db/docs/abuse_report_events.yml b/db/docs/abuse_report_events.yml new file mode 100644 index 00000000000..ea19a44c39d --- /dev/null +++ b/db/docs/abuse_report_events.yml @@ -0,0 +1,10 @@ +--- +table_name: abuse_report_events +classes: + - ResourceEvents::AbuseReportEvent +feature_categories: + - instance_resiliency +description: Stores actions taken on abuse reports. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119199 +milestone: "16.0" +gitlab_schema: gitlab_main diff --git a/db/docs/abuse_trust_scores.yml b/db/docs/abuse_trust_scores.yml new file mode 100644 index 00000000000..75a8888e069 --- /dev/null +++ b/db/docs/abuse_trust_scores.yml @@ -0,0 +1,10 @@ +--- +table_name: abuse_trust_scores +classes: +- Abuse::TrustScore +feature_categories: +- instance_resiliency +description: Aggregates per-user scores related to potential product abuse. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117301 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/agent_activity_events.yml b/db/docs/agent_activity_events.yml index 9fd906d5352..d014ef1f114 100644 --- a/db/docs/agent_activity_events.yml +++ b/db/docs/agent_activity_events.yml @@ -3,7 +3,7 @@ table_name: agent_activity_events classes: - Clusters::Agents::ActivityEvent feature_categories: -- kubernetes_management +- deployment_management description: Historical timeline events belonging to a cluster agent introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74577 milestone: '14.6' diff --git a/db/docs/agent_group_authorizations.yml b/db/docs/agent_group_authorizations.yml index 61c8733383a..f0d45dbdc3d 100644 --- a/db/docs/agent_group_authorizations.yml +++ b/db/docs/agent_group_authorizations.yml @@ -1,9 +1,9 @@ --- table_name: agent_group_authorizations classes: -- Clusters::Agents::GroupAuthorization +- Clusters::Agents::Authorizations::CiAccess::GroupAuthorization feature_categories: -- kubernetes_management +- deployment_management description: Configuration for a group that is authorized to use a particular cluster agent introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68023 milestone: '14.3' diff --git a/db/docs/agent_project_authorizations.yml b/db/docs/agent_project_authorizations.yml index e595c84b5d5..77c26571c28 100644 --- a/db/docs/agent_project_authorizations.yml +++ b/db/docs/agent_project_authorizations.yml @@ -1,9 +1,9 @@ --- table_name: agent_project_authorizations classes: -- Clusters::Agents::ProjectAuthorization +- Clusters::Agents::Authorizations::CiAccess::ProjectAuthorization feature_categories: -- kubernetes_management +- deployment_management description: Configuration for a project that is authorized to use a particular cluster agent introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67295 milestone: '14.3' diff --git a/db/docs/agent_user_access_group_authorizations.yml b/db/docs/agent_user_access_group_authorizations.yml new file mode 100644 index 00000000000..cd4df56d5a0 --- /dev/null +++ b/db/docs/agent_user_access_group_authorizations.yml @@ -0,0 +1,10 @@ +--- +table_name: agent_user_access_group_authorizations +classes: +- Clusters::Agents::Authorizations::UserAccess::GroupAuthorization +feature_categories: +- deployment_management +description: Configuration for a group that is authorized to use a particular cluster agent through user_access keyword +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116901 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/agent_user_access_project_authorizations.yml b/db/docs/agent_user_access_project_authorizations.yml new file mode 100644 index 00000000000..f0629af6ec2 --- /dev/null +++ b/db/docs/agent_user_access_project_authorizations.yml @@ -0,0 +1,10 @@ +--- +table_name: agent_user_access_project_authorizations +classes: +- Clusters::Agents::Authorizations::UserAccess::ProjectAuthorization +feature_categories: +- deployment_management +description: Configuration for a project that is authorized to use a particular cluster agent through user_access keyword +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116901 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/airflow_dags.yml b/db/docs/airflow_dags.yml deleted file mode 100644 index 6ed6c9753a8..00000000000 --- a/db/docs/airflow_dags.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -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 deleted file mode 100644 index 4d6baab5a00..00000000000 --- a/db/docs/analytics_cycle_analytics_project_stages.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -table_name: analytics_cycle_analytics_project_stages -classes: -feature_categories: -- value_stream_management -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 deleted file mode 100644 index 839b49f1bed..00000000000 --- a/db/docs/analytics_cycle_analytics_project_value_streams.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -table_name: analytics_cycle_analytics_project_value_streams -classes: -feature_categories: -- value_stream_management -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/appearances.yml b/db/docs/appearances.yml index 104a72263f0..e2777d02e1c 100644 --- a/db/docs/appearances.yml +++ b/db/docs/appearances.yml @@ -7,4 +7,4 @@ feature_categories: description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/40104eead753e7e8ea77951a74a3941546c35aab milestone: '6.8' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_clusterwide diff --git a/db/docs/application_setting_terms.yml b/db/docs/application_setting_terms.yml index 046231b13a4..d58d4d67569 100644 --- a/db/docs/application_setting_terms.yml +++ b/db/docs/application_setting_terms.yml @@ -3,7 +3,7 @@ table_name: application_setting_terms classes: - ApplicationSetting::Term feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/cf37bef287d7dd5d2dce3e2276489767b8c0671f milestone: '10.8' diff --git a/db/docs/approval_project_rules_users.yml b/db/docs/approval_project_rules_users.yml index ce35033356a..1066f31a396 100644 --- a/db/docs/approval_project_rules_users.yml +++ b/db/docs/approval_project_rules_users.yml @@ -1,6 +1,7 @@ --- table_name: approval_project_rules_users -classes: [] +classes: +- ApprovalProjectRulesUser feature_categories: - source_code_management description: Keeps connection between user and a project approval rule diff --git a/db/docs/atlassian_identities.yml b/db/docs/atlassian_identities.yml index e43c8018d5c..e24c316c0f6 100644 --- a/db/docs/atlassian_identities.yml +++ b/db/docs/atlassian_identities.yml @@ -3,7 +3,7 @@ table_name: atlassian_identities classes: - Atlassian::Identity feature_categories: -- authentication_and_authorization +- system_access description: Stores Atlassian credentials that are used to integrate with Atlassian API introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40176 milestone: '13.4' diff --git a/db/docs/audit_events_google_cloud_logging_configurations.yml b/db/docs/audit_events_google_cloud_logging_configurations.yml new file mode 100644 index 00000000000..bd6c13a1fdf --- /dev/null +++ b/db/docs/audit_events_google_cloud_logging_configurations.yml @@ -0,0 +1,10 @@ +--- +table_name: audit_events_google_cloud_logging_configurations +classes: + - AuditEvents::GoogleCloudLoggingConfiguration +feature_categories: + - audit_events +description: Stores Google Cloud Logging configurations associated with IAM service accounts, used for generating access tokens. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/issues/409421 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/audit_events_instance_external_audit_event_destinations.yml b/db/docs/audit_events_instance_external_audit_event_destinations.yml new file mode 100644 index 00000000000..fe57989cec2 --- /dev/null +++ b/db/docs/audit_events_instance_external_audit_event_destinations.yml @@ -0,0 +1,10 @@ +--- +table_name: audit_events_instance_external_audit_event_destinations +classes: + - AuditEvents::InstanceExternalAuditEventDestination +feature_categories: + - audit_events +description: Stores external destination urls for instance level audit events. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116909 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/authentication_events.yml b/db/docs/authentication_events.yml index eaede3b7cd4..440ca695ad2 100644 --- a/db/docs/authentication_events.yml +++ b/db/docs/authentication_events.yml @@ -3,7 +3,7 @@ table_name: authentication_events classes: - AuthenticationEvent feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/39652 milestone: '13.4' diff --git a/db/docs/aws_roles.yml b/db/docs/aws_roles.yml index 902d6a97b62..0d5c9a6acb2 100644 --- a/db/docs/aws_roles.yml +++ b/db/docs/aws_roles.yml @@ -3,7 +3,7 @@ table_name: aws_roles classes: - Aws::Role feature_categories: -- kubernetes_management +- deployment_management description: (Deprecated) AWS IAM role for creating EKS clusters via GitLab introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17057 milestone: '12.4' diff --git a/db/docs/banned_users.yml b/db/docs/banned_users.yml index d14b6d77234..33c5c9024cd 100644 --- a/db/docs/banned_users.yml +++ b/db/docs/banned_users.yml @@ -3,7 +3,7 @@ table_name: banned_users classes: - Users::BannedUser feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64728 milestone: '14.2' diff --git a/db/docs/batched_background_migrations/backfill_admin_mode_scope_for_personal_access_tokens.yml b/db/docs/batched_background_migrations/backfill_admin_mode_scope_for_personal_access_tokens.yml new file mode 100644 index 00000000000..33f3371e294 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_admin_mode_scope_for_personal_access_tokens.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: BackfillAdminModeScopeForPersonalAccessTokens +description: backfills `admin_mode` scope to personal access tokens associated to administrators +feature_category: system_access +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107875 +milestone: 15.8 diff --git a/db/docs/batched_background_migrations/backfill_design_management_repositories.yml b/db/docs/batched_background_migrations/backfill_design_management_repositories.yml new file mode 100644 index 00000000000..95ff87869c3 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_design_management_repositories.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: BackfillDesignManagementRepositories +description: Backfills the new table with project ids +feature_category: geo_replication +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116975 +milestone: 15.11 diff --git a/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml b/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml new file mode 100644 index 00000000000..5adc58a73cd --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_project_wiki_repositories.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: BackfillProjectWikiRepositories +description: >- + Backfills the project_wiki_repositories table for each project that still + does not have an entry in this table. +feature_category: geo +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113783 +milestone: 15.10 diff --git a/db/docs/batched_background_migrations/backfill_work_item_type_id_for_issues.yml b/db/docs/batched_background_migrations/backfill_work_item_type_id_for_issues.yml new file mode 100644 index 00000000000..01e9fd7528e --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_work_item_type_id_for_issues.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: BackfillWorkItemTypeIdForIssues +description: Backfills every record in the issues table with the appropriate work_item_type_id +feature_category: team_planning +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96591 +milestone: 15.4 diff --git a/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml b/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml new file mode 100644 index 00000000000..630aeccd6e1 --- /dev/null +++ b/db/docs/batched_background_migrations/cleanup_personal_access_tokens_with_nil_expires_at.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: CleanupPersonalAccessTokensWithInvalidExpiresAt +description: Updates value of expires_at column to 365 days from now when it's nil for PersonalAccessTokens +feature_category: system_access +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120239 +milestone: 16.0 diff --git a/db/docs/batched_background_migrations/migrate_human_user_type.yml b/db/docs/batched_background_migrations/migrate_human_user_type.yml new file mode 100644 index 00000000000..869a4fe7351 --- /dev/null +++ b/db/docs/batched_background_migrations/migrate_human_user_type.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: MigrateHumanUserType +description: Migrates human user type from old value (nil) to new value (0) for better indexing +feature_category: user_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115849 +milestone: 16.0 diff --git a/db/docs/batched_background_migrations/populate_vulnerability_dismissal_fields.yml b/db/docs/batched_background_migrations/populate_vulnerability_dismissal_fields.yml new file mode 100644 index 00000000000..b51a6ab37d0 --- /dev/null +++ b/db/docs/batched_background_migrations/populate_vulnerability_dismissal_fields.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: PopulateVulnerabilityDismissalFields +description: This populates missing dismissal info for vulnerabilities. +feature_category: vulnerability_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/issues/405032 +milestone: 15.11 diff --git a/db/docs/batched_background_migrations/update_code_suggestions_for_namespace_settings.yml b/db/docs/batched_background_migrations/update_code_suggestions_for_namespace_settings.yml new file mode 100644 index 00000000000..e0196878d61 --- /dev/null +++ b/db/docs/batched_background_migrations/update_code_suggestions_for_namespace_settings.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: UpdateCodeSuggestionsForNamespaceSettings +description: Enables Code Suggestions for all namespaces by default +feature_category: code_suggestions +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117899 +milestone: 16.0 diff --git a/db/docs/broadcast_messages.yml b/db/docs/broadcast_messages.yml index d6d6a93ad2e..bceb79b7f9c 100644 --- a/db/docs/broadcast_messages.yml +++ b/db/docs/broadcast_messages.yml @@ -7,4 +7,4 @@ feature_categories: description: GitLab can display broadcast messages to users of a GitLab instance introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/f1ecf53c1e55fbbc66cb2d7d12fb411cbfc2ace8 milestone: '6.3' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_clusterwide diff --git a/db/docs/bulk_import_batch_trackers.yml b/db/docs/bulk_import_batch_trackers.yml new file mode 100644 index 00000000000..6e6ee123588 --- /dev/null +++ b/db/docs/bulk_import_batch_trackers.yml @@ -0,0 +1,11 @@ +--- +table_name: bulk_import_batch_trackers +classes: +- BulkImports::BatchTracker +feature_categories: +- importers +description: Used to store and track the import status of a batch of relations for the migration + of groups or projects +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111708 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/bulk_import_export_batches.yml b/db/docs/bulk_import_export_batches.yml new file mode 100644 index 00000000000..8cbd032a23a --- /dev/null +++ b/db/docs/bulk_import_export_batches.yml @@ -0,0 +1,11 @@ +--- +table_name: bulk_import_export_batches +classes: +- BulkImports::ExportBatch +feature_categories: +- importers +description: Used to track the generation status of export batch files for groups + or projects +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111708 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/catalog_resources.yml b/db/docs/catalog_resources.yml new file mode 100644 index 00000000000..5bc689c308e --- /dev/null +++ b/db/docs/catalog_resources.yml @@ -0,0 +1,8 @@ +--- +table_name: catalog_resources +feature_categories: +- pipeline_composition +description: Projects containing a catalog resource. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112482 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/ci_build_needs.yml b/db/docs/ci_build_needs.yml index 7253e83601a..0a84efb5598 100644 --- a/db/docs/ci_build_needs.yml +++ b/db/docs/ci_build_needs.yml @@ -3,7 +3,7 @@ table_name: ci_build_needs classes: - Ci::BuildNeed feature_categories: -- pipeline_authoring +- pipeline_composition description: Dependencies for a specific CI/CD job. introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/31328 milestone: '12.2' diff --git a/db/docs/ci_cost_settings.yml b/db/docs/ci_cost_settings.yml new file mode 100644 index 00000000000..3c5fc00cee0 --- /dev/null +++ b/db/docs/ci_cost_settings.yml @@ -0,0 +1,10 @@ +--- +table_name: ci_cost_settings +classes: +- Ci::Minutes::CostSetting +feature_categories: +- continuous_integration +description: A set of cost factors per runner which are applied to ci job duration based on project type. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111977 +milestone: '15.10' +gitlab_schema: gitlab_ci diff --git a/db/docs/ci_editor_ai_conversation_messages.yml b/db/docs/ci_editor_ai_conversation_messages.yml new file mode 100644 index 00000000000..fd7ab9bac61 --- /dev/null +++ b/db/docs/ci_editor_ai_conversation_messages.yml @@ -0,0 +1,10 @@ +--- +table_name: ci_editor_ai_conversation_messages +classes: +- Ci::Editor::AiConversation::Message +feature_categories: +- pipeline_composition +description: "Represents an ai message for a user and project for the pipeline editor bot." +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119840 +milestone: '16.0' +gitlab_schema: gitlab_ci diff --git a/db/docs/ci_group_variables.yml b/db/docs/ci_group_variables.yml index c504a601c4c..6cea3df07d4 100644 --- a/db/docs/ci_group_variables.yml +++ b/db/docs/ci_group_variables.yml @@ -3,7 +3,7 @@ table_name: ci_group_variables classes: - Ci::GroupVariable feature_categories: -- pipeline_authoring +- secrets_management description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/5b0954759cc24bdba97be89bb117c5440174f859 milestone: '9.4' diff --git a/db/docs/ci_instance_variables.yml b/db/docs/ci_instance_variables.yml index c39fe03b993..cb7aced8461 100644 --- a/db/docs/ci_instance_variables.yml +++ b/db/docs/ci_instance_variables.yml @@ -3,7 +3,7 @@ table_name: ci_instance_variables classes: - Ci::InstanceVariable feature_categories: -- pipeline_authoring +- secrets_management description: CI/CD variables available to all projects and groups in an instance. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30156 milestone: '13.0' diff --git a/db/docs/ci_job_variables.yml b/db/docs/ci_job_variables.yml index 1cbabb4fcbb..306aabb225d 100644 --- a/db/docs/ci_job_variables.yml +++ b/db/docs/ci_job_variables.yml @@ -3,7 +3,7 @@ table_name: ci_job_variables classes: - Ci::JobVariable feature_categories: -- pipeline_authoring +- secrets_management description: CI/CD variables set to a job when running it manually. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/14784 milestone: '12.2' diff --git a/db/docs/ci_minutes_additional_packs.yml b/db/docs/ci_minutes_additional_packs.yml index be4b0a19621..c449e8c22e7 100644 --- a/db/docs/ci_minutes_additional_packs.yml +++ b/db/docs/ci_minutes_additional_packs.yml @@ -4,7 +4,8 @@ classes: - Ci::Minutes::AdditionalPack feature_categories: - purchase -description: TODO +- consumables_cost_management +description: Stores CI minutes purchases for a given namespace with fields for synchronizing and expiring available minutes between Customers Portal and GitLab. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62393 milestone: '14.0' gitlab_schema: gitlab_ci diff --git a/db/docs/ci_namespace_mirrors.yml b/db/docs/ci_namespace_mirrors.yml index 1566f043a0e..29e79c065c6 100644 --- a/db/docs/ci_namespace_mirrors.yml +++ b/db/docs/ci_namespace_mirrors.yml @@ -3,7 +3,7 @@ table_name: ci_namespace_mirrors classes: - Ci::NamespaceMirror feature_categories: -- pods +- cell description: Mirrors some data from the `main` database into the `ci` database so that we can join directly in a single query introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75621 milestone: '14.6' diff --git a/db/docs/ci_pipeline_variables.yml b/db/docs/ci_pipeline_variables.yml index aaf49b17c99..4b1e4dc39c3 100644 --- a/db/docs/ci_pipeline_variables.yml +++ b/db/docs/ci_pipeline_variables.yml @@ -3,7 +3,7 @@ table_name: ci_pipeline_variables classes: - Ci::PipelineVariable feature_categories: -- pipeline_authoring +- secrets_management description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/56418e85ac6b667d19495665860092ce4d74f55d milestone: '9.5' diff --git a/db/docs/ci_project_mirrors.yml b/db/docs/ci_project_mirrors.yml index 8e332a10194..af7ce4f3017 100644 --- a/db/docs/ci_project_mirrors.yml +++ b/db/docs/ci_project_mirrors.yml @@ -3,7 +3,7 @@ table_name: ci_project_mirrors classes: - Ci::ProjectMirror feature_categories: -- pods +- cell description: Mirrors some data from the `main` database into the `ci` database so that we can join directly in a single query introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75621 milestone: '14.6' diff --git a/db/docs/ci_runner_machines.yml b/db/docs/ci_runner_machines.yml index 17cb700d96b..c7395907814 100644 --- a/db/docs/ci_runner_machines.yml +++ b/db/docs/ci_runner_machines.yml @@ -1,10 +1,10 @@ --- table_name: ci_runner_machines classes: -- Ci::RunnerMachine +- Ci::RunnerManager feature_categories: - runner_fleet -description: Information about host machines associated to Ci::Runner models +description: Information about runner managers associated to Ci::Runner models introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107801 milestone: '15.8' gitlab_schema: gitlab_ci diff --git a/db/docs/ci_secure_file_states.yml b/db/docs/ci_secure_file_states.yml index 5734f040f2f..2f193e63e16 100644 --- a/db/docs/ci_secure_file_states.yml +++ b/db/docs/ci_secure_file_states.yml @@ -3,7 +3,7 @@ table_name: ci_secure_file_states classes: - Geo::CiSecureFileState feature_categories: -- pipeline_authoring +- secrets_management description: Stores verification state for Geo replicated Project-level Secure Files. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90510 milestone: '15.2' diff --git a/db/docs/ci_secure_files.yml b/db/docs/ci_secure_files.yml index 6124eeade28..c88b500b62d 100644 --- a/db/docs/ci_secure_files.yml +++ b/db/docs/ci_secure_files.yml @@ -3,7 +3,7 @@ table_name: ci_secure_files classes: - Ci::SecureFile feature_categories: -- pipeline_authoring +- secrets_management description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77886 milestone: '14.7' diff --git a/db/docs/ci_sources_pipelines.yml b/db/docs/ci_sources_pipelines.yml index 7e0121ab66e..034c3bd7db7 100644 --- a/db/docs/ci_sources_pipelines.yml +++ b/db/docs/ci_sources_pipelines.yml @@ -3,7 +3,7 @@ table_name: ci_sources_pipelines classes: - Ci::Sources::Pipeline feature_categories: -- pipeline_authoring +- pipeline_composition description: It stores parent-child and cross-project pipeline relationships. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/163983e0d7d1dab622846441bd0dd9086c78a69f milestone: '9.3' diff --git a/db/docs/ci_variables.yml b/db/docs/ci_variables.yml index bcb6b3f3753..7440b886ab8 100644 --- a/db/docs/ci_variables.yml +++ b/db/docs/ci_variables.yml @@ -3,7 +3,7 @@ table_name: ci_variables classes: - Ci::Variable feature_categories: -- pipeline_authoring +- secrets_management description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/046b28312704f3131e72dcd2dbdacc5264d4aa62 milestone: '8.0' diff --git a/db/docs/cluster_agent_tokens.yml b/db/docs/cluster_agent_tokens.yml index 24b093c948c..36e843406b0 100644 --- a/db/docs/cluster_agent_tokens.yml +++ b/db/docs/cluster_agent_tokens.yml @@ -3,7 +3,7 @@ table_name: cluster_agent_tokens classes: - Clusters::AgentToken feature_categories: -- kubernetes_management +- deployment_management description: Tokens used by cluster agents to connect to GitLab introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33228 milestone: '13.3' diff --git a/db/docs/cluster_agents.yml b/db/docs/cluster_agents.yml index 14574fb82f4..237d8d23bfd 100644 --- a/db/docs/cluster_agents.yml +++ b/db/docs/cluster_agents.yml @@ -3,7 +3,7 @@ table_name: cluster_agents classes: - Clusters::Agent feature_categories: -- kubernetes_management +- deployment_management description: Represents a GitLab Agent for Kubernetes installed in a Kubernetes cluster introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33228 milestone: '13.3' diff --git a/db/docs/cluster_enabled_grants.yml b/db/docs/cluster_enabled_grants.yml index 873bbb4b7b5..4c6bef3db0e 100644 --- a/db/docs/cluster_enabled_grants.yml +++ b/db/docs/cluster_enabled_grants.yml @@ -3,7 +3,7 @@ table_name: cluster_enabled_grants classes: - Clusters::ClusterEnabledGrant feature_categories: -- kubernetes_management +- deployment_management description: Persists information about namespaces which got an extended life for certificate based clusters introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87149 milestone: '15.1' diff --git a/db/docs/cluster_groups.yml b/db/docs/cluster_groups.yml index ff5c3d890fd..70c11431acf 100644 --- a/db/docs/cluster_groups.yml +++ b/db/docs/cluster_groups.yml @@ -3,7 +3,7 @@ table_name: cluster_groups classes: - Clusters::Group feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) Join table between 'clusters' and 'namespaces'" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/0e15eec86d83cbdfefe17966bf5c02e4d419a34d milestone: '11.5' diff --git a/db/docs/cluster_platforms_kubernetes.yml b/db/docs/cluster_platforms_kubernetes.yml index c92705b7c46..961eb37e366 100644 --- a/db/docs/cluster_platforms_kubernetes.yml +++ b/db/docs/cluster_platforms_kubernetes.yml @@ -3,7 +3,7 @@ table_name: cluster_platforms_kubernetes classes: - Clusters::Platforms::Kubernetes feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) Kubernetes specific details for a cluster integration" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d0cff7f5855f91b5479f9fdaa39d8d95ec691a9e milestone: '10.2' diff --git a/db/docs/cluster_projects.yml b/db/docs/cluster_projects.yml index 89bcd726e1f..152b60ea87b 100644 --- a/db/docs/cluster_projects.yml +++ b/db/docs/cluster_projects.yml @@ -3,7 +3,7 @@ table_name: cluster_projects classes: - Clusters::Project feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) Join table between 'clusters' and 'projects'" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d0cff7f5855f91b5479f9fdaa39d8d95ec691a9e milestone: '10.2' diff --git a/db/docs/cluster_providers_aws.yml b/db/docs/cluster_providers_aws.yml index 7c32b9291d1..ed9937b9a66 100644 --- a/db/docs/cluster_providers_aws.yml +++ b/db/docs/cluster_providers_aws.yml @@ -3,7 +3,7 @@ table_name: cluster_providers_aws classes: - Clusters::Providers::Aws feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) AWS specific details for an EKS cluster integration" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17057 milestone: '12.4' diff --git a/db/docs/cluster_providers_gcp.yml b/db/docs/cluster_providers_gcp.yml index cc89320d346..a16e07d9fd3 100644 --- a/db/docs/cluster_providers_gcp.yml +++ b/db/docs/cluster_providers_gcp.yml @@ -3,7 +3,7 @@ table_name: cluster_providers_gcp classes: - Clusters::Providers::Gcp feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) GCP specific details for a GKE cluster integration" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d0cff7f5855f91b5479f9fdaa39d8d95ec691a9e milestone: '10.2' diff --git a/db/docs/clusters.yml b/db/docs/clusters.yml index f791c84bfa2..309bdd426b6 100644 --- a/db/docs/clusters.yml +++ b/db/docs/clusters.yml @@ -3,7 +3,7 @@ table_name: clusters classes: - Clusters::Cluster feature_categories: -- kubernetes_management +- deployment_management description: Persists information about GitLab managed clusters introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/14879 milestone: '10.1' diff --git a/db/docs/clusters_applications_cert_managers.yml b/db/docs/clusters_applications_cert_managers.yml deleted file mode 100644 index 78ef851a2c0..00000000000 --- a/db/docs/clusters_applications_cert_managers.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -table_name: clusters_applications_cert_managers -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed cert-manager installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/8837519445c319a699e0f3ced1c6912c839f3389 -milestone: '11.6' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_cilium.yml b/db/docs/clusters_applications_cilium.yml deleted file mode 100644 index 12e5753f12e..00000000000 --- a/db/docs/clusters_applications_cilium.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -table_name: clusters_applications_cilium -feature_categories: -- security_policy_management -description: Information about installed instance of Cilium in the cluster -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34601 -milestone: '13.2' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_crossplane.yml b/db/docs/clusters_applications_crossplane.yml deleted file mode 100644 index f633f746e70..00000000000 --- a/db/docs/clusters_applications_crossplane.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_crossplane -classes: -- Clusters::Applications::Crossplane -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Crossplane installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18797 -milestone: '12.5' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_helm.yml b/db/docs/clusters_applications_helm.yml deleted file mode 100644 index bb849a21cae..00000000000 --- a/db/docs/clusters_applications_helm.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_helm -classes: -- Clusters::Applications::Helm -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Helm installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/64be8d70ae20928df351e495a3442bb6036bc3e7 -milestone: '10.2' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_ingress.yml b/db/docs/clusters_applications_ingress.yml deleted file mode 100644 index 02dda5a4498..00000000000 --- a/db/docs/clusters_applications_ingress.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_ingress -classes: -- Clusters::Applications::Ingress -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Ingress installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d8223468ae2ae061020cc26336c51dc93cc75571 -milestone: '10.2' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_jupyter.yml b/db/docs/clusters_applications_jupyter.yml deleted file mode 100644 index b15b889779b..00000000000 --- a/db/docs/clusters_applications_jupyter.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_jupyter -classes: -- Clusters::Applications::Jupyter -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Jupyter installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/db9f765852d9fef464e69c0bf47a382f2ab7219d -milestone: '11.0' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_knative.yml b/db/docs/clusters_applications_knative.yml deleted file mode 100644 index e17a0284a1f..00000000000 --- a/db/docs/clusters_applications_knative.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_knative -classes: -- Clusters::Applications::Knative -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Knative installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/b5155b90ee233e2824c168fbb06b3ce5d3aeb194 -milestone: '11.5' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_prometheus.yml b/db/docs/clusters_applications_prometheus.yml deleted file mode 100644 index 9b99ffba5db..00000000000 --- a/db/docs/clusters_applications_prometheus.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_prometheus -classes: -- Clusters::Applications::Prometheus -feature_categories: -- kubernetes_management -description: Information about installed instance of Prometheus in the cluster -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/0d4548026f3060ca0a8f7aa8d8fc89838bc66130 -milestone: '10.4' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_applications_runners.yml b/db/docs/clusters_applications_runners.yml deleted file mode 100644 index c2fd4799cf9..00000000000 --- a/db/docs/clusters_applications_runners.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: clusters_applications_runners -classes: -- Clusters::Applications::Runner -feature_categories: -- kubernetes_management -description: "(Deprecated) A GitLab managed Runner installation in a Kubernetes cluster" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/c607008ee55e35465e04a938a341f2f24cb6761f -milestone: '10.6' -gitlab_schema: gitlab_main diff --git a/db/docs/clusters_kubernetes_namespaces.yml b/db/docs/clusters_kubernetes_namespaces.yml index 3572cfa4f2c..1c272eea497 100644 --- a/db/docs/clusters_kubernetes_namespaces.yml +++ b/db/docs/clusters_kubernetes_namespaces.yml @@ -3,7 +3,7 @@ table_name: clusters_kubernetes_namespaces classes: - Clusters::KubernetesNamespace feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) A Kubernetes namespace in a GitLab managed Kubernetes cluster" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/e3ca493876ab71ed29817a0af436fc563f564bbe milestone: '11.5' diff --git a/db/docs/container_registry_data_repair_details.yml b/db/docs/container_registry_data_repair_details.yml new file mode 100644 index 00000000000..c258fff4832 --- /dev/null +++ b/db/docs/container_registry_data_repair_details.yml @@ -0,0 +1,10 @@ +--- +table_name: container_registry_data_repair_details +classes: +- ContainerRegistry::DataRepairDetail +feature_categories: +- container_registry +description: Contains details for the container registry data repair +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113029 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/container_repository_states.yml b/db/docs/container_repository_states.yml new file mode 100644 index 00000000000..300bf7bdd41 --- /dev/null +++ b/db/docs/container_repository_states.yml @@ -0,0 +1,11 @@ +--- +table_name: container_repository_states +description: Checksum states of container repositories for Geo verification +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111077 +milestone: 15.10 +classes: +- Geo::ContainerRepositoryState +feature_categories: +- geo_replication +gitlab_schema: gitlab_main + diff --git a/db/docs/deleted_tables/airflow_dags.yml b/db/docs/deleted_tables/airflow_dags.yml new file mode 100644 index 00000000000..4942e71d3bf --- /dev/null +++ b/db/docs/deleted_tables/airflow_dags.yml @@ -0,0 +1,12 @@ +--- +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 +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112192 +removed_in_milestone: '15.10' diff --git a/db/docs/deleted_tables/analytics_cycle_analytics_project_stages.yml b/db/docs/deleted_tables/analytics_cycle_analytics_project_stages.yml new file mode 100644 index 00000000000..75e1d307d59 --- /dev/null +++ b/db/docs/deleted_tables/analytics_cycle_analytics_project_stages.yml @@ -0,0 +1,11 @@ +--- +table_name: analytics_cycle_analytics_project_stages +classes: +feature_categories: +- value_stream_management +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 +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118980 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/analytics_cycle_analytics_project_value_streams.yml b/db/docs/deleted_tables/analytics_cycle_analytics_project_value_streams.yml new file mode 100644 index 00000000000..8fbaf68ec7f --- /dev/null +++ b/db/docs/deleted_tables/analytics_cycle_analytics_project_value_streams.yml @@ -0,0 +1,11 @@ +--- +table_name: analytics_cycle_analytics_project_value_streams +classes: +feature_categories: +- value_stream_management +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 +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118980 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_cert_managers.yml b/db/docs/deleted_tables/clusters_applications_cert_managers.yml new file mode 100644 index 00000000000..cdf170d2a89 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_cert_managers.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_cert_managers +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed cert-manager installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/8837519445c319a699e0f3ced1c6912c839f3389 +milestone: '11.6' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119238 +removed_in_milestone: '16.0'
\ No newline at end of file diff --git a/db/docs/deleted_tables/clusters_applications_cilium.yml b/db/docs/deleted_tables/clusters_applications_cilium.yml new file mode 100644 index 00000000000..0dd4be4f94f --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_cilium.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_cilium +feature_categories: +- security_policy_management +description: Information about installed instance of Cilium in the cluster +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34601 +milestone: '13.2' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119332 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_crossplane.yml b/db/docs/deleted_tables/clusters_applications_crossplane.yml new file mode 100644 index 00000000000..9e0ec4828d4 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_crossplane.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_crossplane +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Crossplane installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18797 +milestone: '12.5' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119361 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_elastic_stacks.yml b/db/docs/deleted_tables/clusters_applications_elastic_stacks.yml new file mode 100644 index 00000000000..931b8ed9aad --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_elastic_stacks.yml @@ -0,0 +1,12 @@ +--- +table_name: clusters_applications_elastic_stacks +classes: +- Clusters::Applications::ElasticStack +feature_categories: +- kubernetes_management +description: (Deprecated) A GitLab managed Elastic Stack installation in a Kubernetes cluster +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18015 +milestone: '12.5' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91859 +removed_in_milestone: '15.2' diff --git a/db/docs/deleted_tables/clusters_applications_helm.yml b/db/docs/deleted_tables/clusters_applications_helm.yml new file mode 100644 index 00000000000..5011a6dd3e1 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_helm.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_helm +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Helm installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/64be8d70ae20928df351e495a3442bb6036bc3e7 +milestone: '10.2' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119380 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_ingress.yml b/db/docs/deleted_tables/clusters_applications_ingress.yml new file mode 100644 index 00000000000..d06486f37a4 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_ingress.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_ingress +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Ingress installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/d8223468ae2ae061020cc26336c51dc93cc75571 +milestone: '10.2' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119386 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_jupyter.yml b/db/docs/deleted_tables/clusters_applications_jupyter.yml new file mode 100644 index 00000000000..539cba27bd9 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_jupyter.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_jupyter +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Jupyter installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/db9f765852d9fef464e69c0bf47a382f2ab7219d +milestone: '11.0' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119469 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_knative.yml b/db/docs/deleted_tables/clusters_applications_knative.yml new file mode 100644 index 00000000000..666f126f022 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_knative.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_knative +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Knative installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/b5155b90ee233e2824c168fbb06b3ce5d3aeb194 +milestone: '11.5' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119515 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_prometheus.yml b/db/docs/deleted_tables/clusters_applications_prometheus.yml new file mode 100644 index 00000000000..eb33a41e181 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_prometheus.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_prometheus +feature_categories: +- deployment_management +description: Information about installed instance of Prometheus in the cluster +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/0d4548026f3060ca0a8f7aa8d8fc89838bc66130 +milestone: '10.4' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119533 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_applications_runners.yml b/db/docs/deleted_tables/clusters_applications_runners.yml new file mode 100644 index 00000000000..e849e9d12c6 --- /dev/null +++ b/db/docs/deleted_tables/clusters_applications_runners.yml @@ -0,0 +1,10 @@ +--- +table_name: clusters_applications_runners +feature_categories: +- deployment_management +description: "(Deprecated) A GitLab managed Runner installation in a Kubernetes cluster" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/c607008ee55e35465e04a938a341f2f24cb6761f +milestone: '10.6' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119540 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/clusters_integration_elasticstack.yml b/db/docs/deleted_tables/clusters_integration_elasticstack.yml new file mode 100644 index 00000000000..f52db5d797c --- /dev/null +++ b/db/docs/deleted_tables/clusters_integration_elasticstack.yml @@ -0,0 +1,12 @@ +--- +table_name: clusters_integration_elasticstack +classes: +- Clusters::Integrations::ElasticStack +feature_categories: +- configure +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61077 +milestone: '13.12' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91859 +removed_in_milestone: '15.2' diff --git a/db/docs/deleted_tables/experiment_subjects.yml b/db/docs/deleted_tables/experiment_subjects.yml new file mode 100644 index 00000000000..ff3e0dab8b4 --- /dev/null +++ b/db/docs/deleted_tables/experiment_subjects.yml @@ -0,0 +1,12 @@ +--- +table_name: experiment_subjects +classes: + - ExperimentSubject +feature_categories: + - experimentation_conversion +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47042 +milestone: '13.7' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103933 +removed_in_milestone: '15.7' diff --git a/db/docs/deleted_tables/experiment_users.yml b/db/docs/deleted_tables/experiment_users.yml new file mode 100644 index 00000000000..f7c1278cd69 --- /dev/null +++ b/db/docs/deleted_tables/experiment_users.yml @@ -0,0 +1,12 @@ +--- +table_name: experiment_users +classes: + - ExperimentUser +feature_categories: + - experimentation_conversion +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38397 +milestone: '13.3' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102337 +removed_in_milestone: '15.6' diff --git a/db/docs/deleted_tables/experiments.yml b/db/docs/deleted_tables/experiments.yml new file mode 100644 index 00000000000..5e56dc076c1 --- /dev/null +++ b/db/docs/deleted_tables/experiments.yml @@ -0,0 +1,12 @@ +--- +table_name: experiments +classes: + - Experiment +feature_categories: + - experimentation_conversion +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38397 +milestone: '13.3' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103933 +removed_in_milestone: '15.7' diff --git a/db/docs/deleted_tables/geo_container_repository_updated_events.yml b/db/docs/deleted_tables/geo_container_repository_updated_events.yml new file mode 100644 index 00000000000..db0a3d0ccf7 --- /dev/null +++ b/db/docs/deleted_tables/geo_container_repository_updated_events.yml @@ -0,0 +1,12 @@ +--- +table_name: geo_container_repository_updated_events +classes: + - Geo::ContainerRepositoryUpdatedEvent +feature_categories: + - geo_replication +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107732 +removed_in_milestone: '15.8' diff --git a/db/docs/deleted_tables/geo_job_artifact_deleted_events.yml b/db/docs/deleted_tables/geo_job_artifact_deleted_events.yml new file mode 100644 index 00000000000..3df5d7c253e --- /dev/null +++ b/db/docs/deleted_tables/geo_job_artifact_deleted_events.yml @@ -0,0 +1,12 @@ +--- +table_name: geo_job_artifact_deleted_events +classes: +- Geo::JobArtifactDeletedEvent +feature_categories: +- geo_replication +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3935 +milestone: '10.4' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/85219 +removed_in_milestone: '15.0' diff --git a/db/docs/deleted_tables/geo_lfs_object_deleted_events.yml b/db/docs/deleted_tables/geo_lfs_object_deleted_events.yml new file mode 100644 index 00000000000..d4f1633d812 --- /dev/null +++ b/db/docs/deleted_tables/geo_lfs_object_deleted_events.yml @@ -0,0 +1,11 @@ +--- +table_name: geo_lfs_object_deleted_events +classes: [] +feature_categories: +- geo_replication +description: Geo event for when an LFS object gets deleted, belongs to geo_event_log. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3481 +milestone: '10.2' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88257 +removed_in_milestone: '15.1' diff --git a/db/docs/deleted_tables/packages_events.yml b/db/docs/deleted_tables/packages_events.yml new file mode 100644 index 00000000000..0758ea58e04 --- /dev/null +++ b/db/docs/deleted_tables/packages_events.yml @@ -0,0 +1,12 @@ +--- +table_name: packages_events +classes: +- Packages::Event +feature_categories: +- package_registry +description: Package tracking events (deprecated) +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41846 +milestone: '13.5' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114947 +removed_in_milestone: '15.11' diff --git a/db/docs/deleted_tables/partitioned_foreign_keys.yml b/db/docs/deleted_tables/partitioned_foreign_keys.yml new file mode 100644 index 00000000000..3c107f1eaed --- /dev/null +++ b/db/docs/deleted_tables/partitioned_foreign_keys.yml @@ -0,0 +1,11 @@ +--- +table_name: partitioned_foreign_keys +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82215 +removed_in_milestone: 14.9 diff --git a/db/docs/deleted_tables/post_migration_test_table.yml b/db/docs/deleted_tables/post_migration_test_table.yml new file mode 100644 index 00000000000..f8dd5242d4b --- /dev/null +++ b/db/docs/deleted_tables/post_migration_test_table.yml @@ -0,0 +1,11 @@ +--- +table_name: post_migration_test_table +classes: [] +feature_categories: + - database +description: Test table to verify the behavior of the post-deploy independent pipeline +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91119 +milestone: '15.2' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92571 +removed_in_milestone: '15.2' diff --git a/db/docs/deleted_tables/project_tracing_settings.yml b/db/docs/deleted_tables/project_tracing_settings.yml new file mode 100644 index 00000000000..4704a7580e7 --- /dev/null +++ b/db/docs/deleted_tables/project_tracing_settings.yml @@ -0,0 +1,12 @@ +--- +table_name: project_tracing_settings +classes: + - ProjectTracingSetting +feature_categories: + - tracing +description: +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7903 +milestone: '15.5' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91679 +removed_in_milestone: '15.2' diff --git a/db/docs/deleted_tables/serverless_domain_cluster.yml b/db/docs/deleted_tables/serverless_domain_cluster.yml new file mode 100644 index 00000000000..be80f6ed5db --- /dev/null +++ b/db/docs/deleted_tables/serverless_domain_cluster.yml @@ -0,0 +1,10 @@ +--- +table_name: serverless_domain_cluster +feature_categories: +- deployment_management +description: "(Deprecated) A custom domain for a GitLab managed Knative installation" +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19835 +milestone: '12.6' +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119543 +removed_in_milestone: '16.0' diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_assets.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_assets.yml new file mode 100644 index 00000000000..32e23058cf1 --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_assets.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_assets +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_headers.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_headers.yml new file mode 100644 index 00000000000..172c099801b --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_headers.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_headers +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_requests.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_requests.yml new file mode 100644 index 00000000000..adfb524f1fa --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_requests.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_requests +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_responses.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_responses.yml new file mode 100644 index 00000000000..dfa4ae7947a --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_responses.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_responses +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_sources.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_sources.yml new file mode 100644 index 00000000000..b1355169751 --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_sources.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_sources +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deleted_tables/vulnerability_finding_evidence_supporting_messages.yml b/db/docs/deleted_tables/vulnerability_finding_evidence_supporting_messages.yml new file mode 100644 index 00000000000..685f3c3fa95 --- /dev/null +++ b/db/docs/deleted_tables/vulnerability_finding_evidence_supporting_messages.yml @@ -0,0 +1,11 @@ +--- +table_name: vulnerability_finding_evidence_supporting_messages +classes: [] +feature_categories: +- database +description: +introduced_by_url: +milestone: +gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76697 +removed_in_milestone: 14.7 diff --git a/db/docs/deployment_clusters.yml b/db/docs/deployment_clusters.yml index eea538a83d2..011c5252593 100644 --- a/db/docs/deployment_clusters.yml +++ b/db/docs/deployment_clusters.yml @@ -3,7 +3,7 @@ table_name: deployment_clusters classes: - DeploymentCluster feature_categories: -- kubernetes_management +- deployment_management description: "(Deprecated) Join table between `deployments` and `clusters`" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/24235 milestone: '12.8' diff --git a/db/docs/design_management_repositories.yml b/db/docs/design_management_repositories.yml new file mode 100644 index 00000000000..61d905c2703 --- /dev/null +++ b/db/docs/design_management_repositories.yml @@ -0,0 +1,10 @@ +--- +table_name: design_management_repositories +classes: +- DesignManagement::Repository +feature_categories: +- design_management +description: Holds information about Design Management Repositories +introduced_by_url: 'https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111555' +milestone: '15.11' +gitlab_schema: gitlab_main
\ No newline at end of file diff --git a/db/docs/design_management_repository_states.yml b/db/docs/design_management_repository_states.yml new file mode 100644 index 00000000000..3a8fa59fb42 --- /dev/null +++ b/db/docs/design_management_repository_states.yml @@ -0,0 +1,10 @@ +--- +table_name: design_management_repository_states +classes: +classes: [] +feature_categories: +- geo_replication +description: Separate table for Design Repository verification states +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113958 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/dora_daily_metrics.yml b/db/docs/dora_daily_metrics.yml index 52ffdfc7f1b..abd5e256686 100644 --- a/db/docs/dora_daily_metrics.yml +++ b/db/docs/dora_daily_metrics.yml @@ -4,6 +4,7 @@ classes: - Dora::DailyMetrics feature_categories: - continuous_delivery +- value_stream_management description: Stores daily snapshots of DORA4 metrics per environment. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55473 milestone: '13.10' diff --git a/db/docs/dora_performance_scores.yml b/db/docs/dora_performance_scores.yml new file mode 100644 index 00000000000..2a02adf5e1d --- /dev/null +++ b/db/docs/dora_performance_scores.yml @@ -0,0 +1,10 @@ +--- +table_name: dora_performance_scores +classes: +- Dora::PerformanceScore +feature_categories: +- value_stream_management +description: Stores monthly snapshots of DORA4 performance scores per project. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115689 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/elastic_reindexing_slices.yml b/db/docs/elastic_reindexing_slices.yml index 84e42b16d57..9b8cc69e73b 100644 --- a/db/docs/elastic_reindexing_slices.yml +++ b/db/docs/elastic_reindexing_slices.yml @@ -3,7 +3,7 @@ table_name: elastic_reindexing_slices classes: - Elastic::ReindexingSlice feature_categories: -- application_performance +- global_search description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55681 milestone: '13.12' diff --git a/db/docs/elasticsearch_indexed_projects.yml b/db/docs/elasticsearch_indexed_projects.yml index 17e2e116fdd..17fc5d0f779 100644 --- a/db/docs/elasticsearch_indexed_projects.yml +++ b/db/docs/elasticsearch_indexed_projects.yml @@ -3,7 +3,7 @@ table_name: elasticsearch_indexed_projects classes: - ElasticsearchIndexedProject feature_categories: -- application_performance +- global_search description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9861 milestone: '11.10' diff --git a/db/docs/events.yml b/db/docs/events.yml index ab4fb314456..04d90a24ec9 100644 --- a/db/docs/events.yml +++ b/db/docs/events.yml @@ -5,7 +5,13 @@ classes: - PushEvent feature_categories: - user_profile -description: Stores user generated events. +- wiki +- team_planning +- design_management +- code_review_workflow +- source_code_management +- user_management +description: Stores events created by users interacting with various product features introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/a847501fd2ffc1c4becc7d0d352d80168d9b3568 -milestone: "<6.0" +milestone: "2.2" gitlab_schema: gitlab_main diff --git a/db/docs/group_group_links.yml b/db/docs/group_group_links.yml index f1541871795..1fa70ec02a6 100644 --- a/db/docs/group_group_links.yml +++ b/db/docs/group_group_links.yml @@ -3,7 +3,7 @@ table_name: group_group_links classes: - GroupGroupLink feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/17117 milestone: '12.5' diff --git a/db/docs/historical_data.yml b/db/docs/historical_data.yml index a7af9e04c14..d822b0d32b4 100644 --- a/db/docs/historical_data.yml +++ b/db/docs/historical_data.yml @@ -4,7 +4,8 @@ classes: - HistoricalData feature_categories: - sm_provisioning -description: TODO +- seat_cost_management +description: Stores seat usage data as active_user_count. Used in service ping analytics, cloud licensing, user limits, and renewal workflows. introduced_by_url: https://dev.gitlab.org/gitlab/gitlab-ee/-/merge_requests/390 milestone: '7.11' gitlab_schema: gitlab_main diff --git a/db/docs/identities.yml b/db/docs/identities.yml index 149907a419e..f2790c53466 100644 --- a/db/docs/identities.yml +++ b/db/docs/identities.yml @@ -3,7 +3,7 @@ table_name: identities classes: - Identity feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/1a80d13a3990937580c97e2b0ba8fb98f69bc055 milestone: '7.6' diff --git a/db/docs/integrations.yml b/db/docs/integrations.yml index 5bb4f448541..91675f8de35 100644 --- a/db/docs/integrations.yml +++ b/db/docs/integrations.yml @@ -26,6 +26,7 @@ classes: - Integrations::ExternalWiki - Integrations::Github - Integrations::GitlabSlackApplication +- Integrations::GooglePlay - Integrations::HangoutsChat - Integrations::Harbor - Integrations::Irker @@ -46,6 +47,7 @@ classes: - Integrations::Shimo - Integrations::Slack - Integrations::SlackSlashCommands +- Integrations::SquashTm - Integrations::Teamcity - Integrations::UnifyCircuit - Integrations::WebexTeams diff --git a/db/docs/ip_restrictions.yml b/db/docs/ip_restrictions.yml index 93f0da0505a..fbf90135d0a 100644 --- a/db/docs/ip_restrictions.yml +++ b/db/docs/ip_restrictions.yml @@ -3,7 +3,7 @@ table_name: ip_restrictions classes: - IpRestriction feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/12669 milestone: '12.0' diff --git a/db/docs/issue_assignment_events.yml b/db/docs/issue_assignment_events.yml new file mode 100644 index 00000000000..0ba9f9ca21f --- /dev/null +++ b/db/docs/issue_assignment_events.yml @@ -0,0 +1,10 @@ +--- +table_name: issue_assignment_events +classes: +- ResourceEvents::IssueAssignmentEvent +feature_categories: +- value_stream_management +description: Tracks the assignment and unassignment events for issues +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117379 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/keys.yml b/db/docs/keys.yml index 4e626b1465c..41f6786a6cc 100644 --- a/db/docs/keys.yml +++ b/db/docs/keys.yml @@ -5,7 +5,7 @@ classes: - Key - LDAPKey feature_categories: -- authentication_and_authorization +- system_access - continuous_delivery description: SSH keys used by users or for deployments. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685 diff --git a/db/docs/ldap_group_links.yml b/db/docs/ldap_group_links.yml index d9a1b0acca5..74cc1a13d69 100644 --- a/db/docs/ldap_group_links.yml +++ b/db/docs/ldap_group_links.yml @@ -3,7 +3,7 @@ table_name: ldap_group_links classes: - LdapGroupLink feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/b017947ac91655f8ae6593fb63c3423cd1b439f4 milestone: '7.3' diff --git a/db/docs/loose_foreign_keys_deleted_records.yml b/db/docs/loose_foreign_keys_deleted_records.yml index 8ce8d4e52b3..24de9b85e4c 100644 --- a/db/docs/loose_foreign_keys_deleted_records.yml +++ b/db/docs/loose_foreign_keys_deleted_records.yml @@ -3,7 +3,7 @@ table_name: loose_foreign_keys_deleted_records classes: - LooseForeignKeys::DeletedRecord feature_categories: -- pods +- cell description: Used by the loose foreign keys feature as a queue of parent records whose child records (via foreign keys) need to be deleted/nullified introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70152 milestone: '14.3' diff --git a/db/docs/merge_request_assignment_events.yml b/db/docs/merge_request_assignment_events.yml new file mode 100644 index 00000000000..49eeefcbcf0 --- /dev/null +++ b/db/docs/merge_request_assignment_events.yml @@ -0,0 +1,10 @@ +--- +table_name: merge_request_assignment_events +classes: +- ResourceEvents::MergeRequestAssignmentEvent +feature_categories: +- value_stream_management +description: Tracks the assignment and unassignment events for merge requests +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117379 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/merge_request_diff_llm_summaries.yml b/db/docs/merge_request_diff_llm_summaries.yml new file mode 100644 index 00000000000..2ae4cd841e3 --- /dev/null +++ b/db/docs/merge_request_diff_llm_summaries.yml @@ -0,0 +1,11 @@ +--- +table_name: merge_request_diff_llm_summaries +classes: +- MergeRequest::DiffLlmSummary +feature_categories: +- code_review_workflow +description: This is the table that stores information about the diff summaries produced + from different LLM's. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118671 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/merge_trains.yml b/db/docs/merge_trains.yml index 3b666322d3b..7d0310236e9 100644 --- a/db/docs/merge_trains.yml +++ b/db/docs/merge_trains.yml @@ -1,10 +1,10 @@ --- table_name: merge_trains classes: -- MergeTrain +- MergeTrains::Car feature_categories: - continuous_integration -description: TODO +description: Each record represents a single merge request which is or was part of a merge train. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/827fc3ccb9335aa29fba0fc532b70015ec4c5186 milestone: '11.11' gitlab_schema: gitlab_main diff --git a/db/docs/namespace_admin_notes.yml b/db/docs/namespace_admin_notes.yml index 6d6710f7ee4..50ca72b270c 100644 --- a/db/docs/namespace_admin_notes.yml +++ b/db/docs/namespace_admin_notes.yml @@ -3,7 +3,7 @@ table_name: namespace_admin_notes classes: - Namespace::AdminNote feature_categories: -- authentication_and_authorization +- system_access - subgroups description: Contains notes about groups that are visible to server administrators. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47825 diff --git a/db/docs/namespace_aggregation_schedules.yml b/db/docs/namespace_aggregation_schedules.yml index 56ac5ee3ed6..d57311fff8f 100644 --- a/db/docs/namespace_aggregation_schedules.yml +++ b/db/docs/namespace_aggregation_schedules.yml @@ -3,7 +3,7 @@ table_name: namespace_aggregation_schedules classes: - Namespace::AggregationSchedule feature_categories: -- subscription_cost_management +- consumables_cost_management description: Keeps update schedules for namespace_root_storage_statistics introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29570 milestone: '12.1' diff --git a/db/docs/namespace_ldap_settings.yml b/db/docs/namespace_ldap_settings.yml new file mode 100644 index 00000000000..e2ebbf54fde --- /dev/null +++ b/db/docs/namespace_ldap_settings.yml @@ -0,0 +1,10 @@ +--- +table_name: namespace_ldap_settings +classes: + - Namespaces::LdapSetting +feature_categories: + - system_access +description: Used to store LDAP settings for namespaces +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108908 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/namespace_limits.yml b/db/docs/namespace_limits.yml index bcc687de858..5bb06b53cb2 100644 --- a/db/docs/namespace_limits.yml +++ b/db/docs/namespace_limits.yml @@ -3,7 +3,7 @@ table_name: namespace_limits classes: - NamespaceLimit feature_categories: -- subscription_cost_management +- consumables_cost_management description: Contains limits for namespace features like storage and ci introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34746 milestone: '13.2' diff --git a/db/docs/namespace_root_storage_statistics.yml b/db/docs/namespace_root_storage_statistics.yml index ac2207d7698..b14fb915cbf 100644 --- a/db/docs/namespace_root_storage_statistics.yml +++ b/db/docs/namespace_root_storage_statistics.yml @@ -4,7 +4,8 @@ classes: - Namespace::RootStorageStatistics feature_categories: - application_instrumentation -description: TODO -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/bde41ee866d0fe0b1bb5ece1130fb6e24d95ad17 +- consumables_cost_management +description: Stores usage data totals for all available consumable features across projects for a given namespace. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/29570 milestone: '12.1' gitlab_schema: gitlab_main diff --git a/db/docs/namespace_statistics.yml b/db/docs/namespace_statistics.yml index e84d5d563f8..4c294db3315 100644 --- a/db/docs/namespace_statistics.yml +++ b/db/docs/namespace_statistics.yml @@ -4,7 +4,8 @@ classes: - NamespaceStatistics feature_categories: - application_instrumentation -description: TODO -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/48d8bdca0493056a717cd7d9fee2e8b51d6b0502 +- consumables_cost_management +description: Stores usage statistics for both CI minutes and a limited set of storage types for a given namespace. This should not be confused with namespace_root_storage_statistics table which holds statistics across more storage types for a group. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/965 milestone: '9.0' gitlab_schema: gitlab_main diff --git a/db/docs/namespaces_storage_limit_exclusions.yml b/db/docs/namespaces_storage_limit_exclusions.yml index d66da2797dd..b96c15112ec 100644 --- a/db/docs/namespaces_storage_limit_exclusions.yml +++ b/db/docs/namespaces_storage_limit_exclusions.yml @@ -3,7 +3,7 @@ table_name: namespaces_storage_limit_exclusions classes: - Namespaces::Storage::LimitExclusion feature_categories: - - subscription_cost_management + - consumables_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. diff --git a/db/docs/namespaces_sync_events.yml b/db/docs/namespaces_sync_events.yml index f089ca85789..fdac8accd7f 100644 --- a/db/docs/namespaces_sync_events.yml +++ b/db/docs/namespaces_sync_events.yml @@ -3,7 +3,7 @@ table_name: namespaces_sync_events classes: - Namespaces::SyncEvent feature_categories: -- pods +- cell description: Used as a queue of data that needs to be synchronized between the `ci` and `main` database introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75517 milestone: '14.6' diff --git a/db/docs/note_metadata.yml b/db/docs/note_metadata.yml new file mode 100644 index 00000000000..63527152abe --- /dev/null +++ b/db/docs/note_metadata.yml @@ -0,0 +1,14 @@ +--- +table_name: note_metadata +classes: +- Notes::NoteMetadata +feature_categories: +- code_review_workflow +- portfolio_management +- service_desk +- source_code_management +- team_planning +description: Store any extra metadata for notes +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117149 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/oauth_access_grants.yml b/db/docs/oauth_access_grants.yml index 197d4fc59bd..8339863cca7 100644 --- a/db/docs/oauth_access_grants.yml +++ b/db/docs/oauth_access_grants.yml @@ -4,7 +4,7 @@ classes: - Doorkeeper::AccessGrant - OauthAccessGrant feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/e41dadcb33fda44ee274daa673bd933e13aa90eb milestone: '7.7' diff --git a/db/docs/oauth_access_tokens.yml b/db/docs/oauth_access_tokens.yml index f409762f483..4f68fe5b6c6 100644 --- a/db/docs/oauth_access_tokens.yml +++ b/db/docs/oauth_access_tokens.yml @@ -4,7 +4,7 @@ classes: - Doorkeeper::AccessToken - OauthAccessToken feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/e41dadcb33fda44ee274daa673bd933e13aa90eb milestone: '7.7' diff --git a/db/docs/oauth_applications.yml b/db/docs/oauth_applications.yml index ac13ab3319a..e24578c3272 100644 --- a/db/docs/oauth_applications.yml +++ b/db/docs/oauth_applications.yml @@ -3,7 +3,7 @@ table_name: oauth_applications classes: - Doorkeeper::Application feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/e41dadcb33fda44ee274daa673bd933e13aa90eb milestone: '7.7' diff --git a/db/docs/oauth_openid_requests.yml b/db/docs/oauth_openid_requests.yml index 011b91a758a..59de50597c3 100644 --- a/db/docs/oauth_openid_requests.yml +++ b/db/docs/oauth_openid_requests.yml @@ -3,7 +3,7 @@ table_name: oauth_openid_requests classes: - Doorkeeper::OpenidConnect::Request feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/c4982890489d254da2fe998aab30bf257767ed5e milestone: '9.0' diff --git a/db/docs/organizations.yml b/db/docs/organizations.yml new file mode 100644 index 00000000000..68278d0e6e4 --- /dev/null +++ b/db/docs/organizations.yml @@ -0,0 +1,10 @@ +--- +table_name: organizations +classes: +- Organization +feature_categories: +- cell +description: Define ownership of namespaces, projects, and users by organizations +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119421 +milestone: "16.0" +gitlab_schema: gitlab_main diff --git a/db/docs/p_ci_runner_machine_builds.yml b/db/docs/p_ci_runner_machine_builds.yml new file mode 100644 index 00000000000..55d09963acc --- /dev/null +++ b/db/docs/p_ci_runner_machine_builds.yml @@ -0,0 +1,9 @@ +table_name: p_ci_runner_machine_builds +classes: +- Ci::RunnerManagerBuild +feature_categories: +- runner_fleet +description: Relationships between builds and runner managers +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111476 +milestone: '15.9' +gitlab_schema: gitlab_ci diff --git a/db/docs/packages_events.yml b/db/docs/packages_events.yml deleted file mode 100644 index 38c47c53721..00000000000 --- a/db/docs/packages_events.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: packages_events -classes: -- Packages::Event -feature_categories: -- package_registry -description: Package tracking events (deprecated) -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/41846 -milestone: '13.5' -gitlab_schema: gitlab_main diff --git a/db/docs/packages_npm_metadata_caches.yml b/db/docs/packages_npm_metadata_caches.yml new file mode 100644 index 00000000000..3329c75b7ee --- /dev/null +++ b/db/docs/packages_npm_metadata_caches.yml @@ -0,0 +1,10 @@ +--- +table_name: packages_npm_metadata_caches +classes: +- Packages::Npm::MetadataCache +feature_categories: +- package_registry +description: Store the metadata of npm packages to use later as a cache +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114312 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/personal_access_tokens.yml b/db/docs/personal_access_tokens.yml index 8241f4234d8..2739db8371f 100644 --- a/db/docs/personal_access_tokens.yml +++ b/db/docs/personal_access_tokens.yml @@ -3,7 +3,7 @@ table_name: personal_access_tokens classes: - PersonalAccessToken feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/3a609038748055a27c7e01cf4b55d8249709c9cc milestone: '8.9' diff --git a/db/docs/pm_advisories.yml b/db/docs/pm_advisories.yml new file mode 100644 index 00000000000..010f029978e --- /dev/null +++ b/db/docs/pm_advisories.yml @@ -0,0 +1,11 @@ +--- +table_name: pm_advisories +classes: +- PackageMetadata::Advisory +feature_categories: +- software_composition_analysis +- container_scanning +description: Stores security advisories. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117326 +milestone: '16.0' +gitlab_schema: gitlab_pm diff --git a/db/docs/pm_affected_packages.yml b/db/docs/pm_affected_packages.yml new file mode 100644 index 00000000000..ad389c72b59 --- /dev/null +++ b/db/docs/pm_affected_packages.yml @@ -0,0 +1,11 @@ +--- +table_name: pm_affected_packages +classes: +- PackageMetadata::AffectedPackage +feature_categories: +- software_composition_analysis +- container_scanning +description: Stores info for packages affected by an advisory. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117326 +milestone: '16.0' +gitlab_schema: gitlab_pm diff --git a/db/docs/pm_checkpoints.yml b/db/docs/pm_checkpoints.yml index e360e8ad356..2e42077943d 100644 --- a/db/docs/pm_checkpoints.yml +++ b/db/docs/pm_checkpoints.yml @@ -3,7 +3,7 @@ table_name: pm_checkpoints classes: - PackageMetadata::Checkpoint feature_categories: -- license_compliance +- software_composition_analysis description: Tracks position of last synced file. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109713 milestone: '15.9' diff --git a/db/docs/pm_licenses.yml b/db/docs/pm_licenses.yml index 55ef2719cbc..31d9ae7a179 100644 --- a/db/docs/pm_licenses.yml +++ b/db/docs/pm_licenses.yml @@ -3,7 +3,7 @@ table_name: pm_licenses classes: - PackageMetadata::License feature_categories: - - license_compliance + - software_composition_analysis description: Tracks licenses referenced by public package registries. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102794 milestone: '15.6' diff --git a/db/docs/pm_package_version_licenses.yml b/db/docs/pm_package_version_licenses.yml index 439162ecf9d..1e3f21c4383 100644 --- a/db/docs/pm_package_version_licenses.yml +++ b/db/docs/pm_package_version_licenses.yml @@ -3,7 +3,7 @@ table_name: pm_package_version_licenses classes: - PackageMetadata::PackageVersionLicense feature_categories: - - license_compliance + - software_composition_analysis description: Tracks licenses under which a given package version has been published. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102794 milestone: '15.6' diff --git a/db/docs/pm_package_versions.yml b/db/docs/pm_package_versions.yml index 7b015ddc174..b216d58ce99 100644 --- a/db/docs/pm_package_versions.yml +++ b/db/docs/pm_package_versions.yml @@ -3,7 +3,7 @@ table_name: pm_package_versions classes: - PackageMetadata::PackageVersion feature_categories: -- license_compliance +- software_composition_analysis description: Tracks package versions served by public package registries. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102794 milestone: '15.6' diff --git a/db/docs/pm_packages.yml b/db/docs/pm_packages.yml index 35932b37990..b114e75791f 100644 --- a/db/docs/pm_packages.yml +++ b/db/docs/pm_packages.yml @@ -3,7 +3,7 @@ table_name: pm_packages classes: - PackageMetadata::Package feature_categories: -- license_compliance +- software_composition_analysis description: Tracks packages served by public package registries. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/102794 milestone: '15.6' diff --git a/db/docs/postgres_async_foreign_key_validations.yml b/db/docs/postgres_async_foreign_key_validations.yml index 0b9608a3ace..587dd7d69a2 100644 --- a/db/docs/postgres_async_foreign_key_validations.yml +++ b/db/docs/postgres_async_foreign_key_validations.yml @@ -1,7 +1,7 @@ --- table_name: postgres_async_foreign_key_validations classes: -- Gitlab::Database::AsyncForeignKeys::PostgresAsyncForeignKeyValidation +- Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValidation feature_categories: - database description: >- diff --git a/db/docs/project_access_tokens.yml b/db/docs/project_access_tokens.yml index ddaca744571..3c19e4dc19f 100644 --- a/db/docs/project_access_tokens.yml +++ b/db/docs/project_access_tokens.yml @@ -2,7 +2,7 @@ table_name: project_access_tokens classes: [] feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/33272 milestone: '13.1' diff --git a/db/docs/project_authorizations.yml b/db/docs/project_authorizations.yml index b37634047f0..b81235d4aac 100644 --- a/db/docs/project_authorizations.yml +++ b/db/docs/project_authorizations.yml @@ -4,7 +4,7 @@ classes: - ProjectAuthorization feature_categories: - projects -- authentication_and_authorization +- system_access description: Stores maximal access to the project per user introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/6839 milestone: '8.14' diff --git a/db/docs/project_group_links.yml b/db/docs/project_group_links.yml index c03141058b6..aa981adb745 100644 --- a/db/docs/project_group_links.yml +++ b/db/docs/project_group_links.yml @@ -3,7 +3,7 @@ table_name: project_group_links classes: - ProjectGroupLink feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/3ac5a759e93e632539438d4564582c645a9f6799 milestone: "<6.0" diff --git a/db/docs/project_security_settings.yml b/db/docs/project_security_settings.yml index 99a767978fb..af559d11164 100644 --- a/db/docs/project_security_settings.yml +++ b/db/docs/project_security_settings.yml @@ -3,7 +3,7 @@ table_name: project_security_settings classes: - ProjectSecuritySetting feature_categories: -- dependency_scanning +- software_composition_analysis - container_scanning description: Project settings related to security features. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32577 diff --git a/db/docs/project_states.yml b/db/docs/project_states.yml new file mode 100644 index 00000000000..275a31b23b8 --- /dev/null +++ b/db/docs/project_states.yml @@ -0,0 +1,10 @@ +--- +table_name: project_states +classes: +- Geo::ProjectState +feature_categories: +- geo_replication +description: Separate table for project containing Geo verification metadata. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117909 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/projects_sync_events.yml b/db/docs/projects_sync_events.yml index 70e325d1c0a..84b99fe6080 100644 --- a/db/docs/projects_sync_events.yml +++ b/db/docs/projects_sync_events.yml @@ -3,7 +3,7 @@ table_name: projects_sync_events classes: - Projects::SyncEvent feature_categories: -- pods +- cell description: Used as a queue of data that needs to be synchronized between the `ci` and `main` database introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75517 milestone: '14.6' diff --git a/db/docs/remote_development_agent_configs.yml b/db/docs/remote_development_agent_configs.yml new file mode 100644 index 00000000000..89e80095580 --- /dev/null +++ b/db/docs/remote_development_agent_configs.yml @@ -0,0 +1,10 @@ +--- +table_name: remote_development_agent_configs +classes: +- RemoteDevelopment::RemoteDevelopmentAgentConfig +feature_categories: +- remote_development +description: Remote Development Cluster Agent Configuration +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105783 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/resource_iteration_events.yml b/db/docs/resource_iteration_events.yml index 46a9e88fd9a..fe39c2cc04a 100644 --- a/db/docs/resource_iteration_events.yml +++ b/db/docs/resource_iteration_events.yml @@ -3,7 +3,7 @@ table_name: resource_iteration_events classes: - ResourceIterationEvent feature_categories: -- planning_analytics +- team_planning description: Records the addition and removal of issues to iterations introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/37617 milestone: '13.3' diff --git a/db/docs/resource_label_events.yml b/db/docs/resource_label_events.yml index 9de636ea874..9997cb576aa 100644 --- a/db/docs/resource_label_events.yml +++ b/db/docs/resource_label_events.yml @@ -3,7 +3,7 @@ table_name: resource_label_events classes: - ResourceLabelEvent feature_categories: -- planning_analytics +- team_planning description: Records the addition and removal of labels from resources that can be labelled; such as issues, MRs and epics introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6697 milestone: '11.2' diff --git a/db/docs/resource_link_events.yml b/db/docs/resource_link_events.yml new file mode 100644 index 00000000000..7d367a76c2c --- /dev/null +++ b/db/docs/resource_link_events.yml @@ -0,0 +1,10 @@ +--- +table_name: resource_link_events +classes: +- WorkItems::ResourceLinkEvent +feature_categories: +- team_planning +description: Records the change of parent link on work items along with timestamps +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114394 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/resource_milestone_events.yml b/db/docs/resource_milestone_events.yml index 02962bc0056..5ec3271492f 100644 --- a/db/docs/resource_milestone_events.yml +++ b/db/docs/resource_milestone_events.yml @@ -3,7 +3,7 @@ table_name: resource_milestone_events classes: - ResourceMilestoneEvent feature_categories: -- planning_analytics +- team_planning description: Records the addition and removal of issues to milestones introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23965 milestone: '12.8' diff --git a/db/docs/resource_state_events.yml b/db/docs/resource_state_events.yml index 2390cd26bac..b93c7e51dd0 100644 --- a/db/docs/resource_state_events.yml +++ b/db/docs/resource_state_events.yml @@ -3,7 +3,7 @@ table_name: resource_state_events classes: - ResourceStateEvent feature_categories: -- planning_analytics +- team_planning description: Records the change of state of issues between opened and closed introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28926 milestone: '13.0' diff --git a/db/docs/resource_weight_events.yml b/db/docs/resource_weight_events.yml index 12cf9b27d19..2abd3be48f8 100644 --- a/db/docs/resource_weight_events.yml +++ b/db/docs/resource_weight_events.yml @@ -3,7 +3,7 @@ table_name: resource_weight_events classes: - ResourceWeightEvent feature_categories: -- planning_analytics +- team_planning description: Records the change of weight on issues along with timestamps introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/21515 milestone: '12.7' diff --git a/db/docs/saml_group_links.yml b/db/docs/saml_group_links.yml index 5fd2372a22d..4dfb33e37a5 100644 --- a/db/docs/saml_group_links.yml +++ b/db/docs/saml_group_links.yml @@ -3,7 +3,7 @@ table_name: saml_group_links classes: - SamlGroupLink feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45061 milestone: '13.5' diff --git a/db/docs/saml_providers.yml b/db/docs/saml_providers.yml index 6fcc0e0e370..21ef2ed3a26 100644 --- a/db/docs/saml_providers.yml +++ b/db/docs/saml_providers.yml @@ -3,7 +3,7 @@ table_name: saml_providers classes: - SamlProvider feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4549 milestone: '10.7' diff --git a/db/docs/schema_inconsistencies.yml b/db/docs/schema_inconsistencies.yml new file mode 100644 index 00000000000..af95f26accb --- /dev/null +++ b/db/docs/schema_inconsistencies.yml @@ -0,0 +1,10 @@ +--- +table_name: schema_inconsistencies +feature_categories: +- database +description: The schema_inconsistencies table contains a list of database schema inconsistencies. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114876 +milestone: '15.11' +classes: +- Gitlab::Database::SchemaValidation::SchemaInconsistency +gitlab_schema: gitlab_main diff --git a/db/docs/schema_migrations.yml b/db/docs/schema_migrations.yml index f5b52bc4db2..3aba0ea1d1b 100644 --- a/db/docs/schema_migrations.yml +++ b/db/docs/schema_migrations.yml @@ -2,11 +2,12 @@ table_name: schema_migrations classes: - ActiveRecord::SchemaMigration +- Embedding::SchemaMigration - Geo::TrackingBase::SchemaMigration feature_categories: - database -description: >- - An internal table used by ActiveRecord to keep track of which migrations have been applied to the database. +description: An internal table used by ActiveRecord to keep track of which migrations + have been applied to the database. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685 milestone: '0.8' gitlab_schema: gitlab_internal diff --git a/db/docs/scim_identities.yml b/db/docs/scim_identities.yml index 6ad69d9b4cc..16fec8da041 100644 --- a/db/docs/scim_identities.yml +++ b/db/docs/scim_identities.yml @@ -3,7 +3,7 @@ table_name: scim_identities classes: - ScimIdentity feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26124 milestone: '12.9' diff --git a/db/docs/scim_oauth_access_tokens.yml b/db/docs/scim_oauth_access_tokens.yml index e26cd94f4cd..addd4c49ed5 100644 --- a/db/docs/scim_oauth_access_tokens.yml +++ b/db/docs/scim_oauth_access_tokens.yml @@ -3,7 +3,7 @@ table_name: scim_oauth_access_tokens classes: - ScimOauthAccessToken feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/e9b2253fe3538234d1c4d173c4549a955233d836 milestone: '11.10' diff --git a/db/docs/search_indices.yml b/db/docs/search_indices.yml new file mode 100644 index 00000000000..7b9789686a7 --- /dev/null +++ b/db/docs/search_indices.yml @@ -0,0 +1,11 @@ +--- +table_name: search_indices +classes: +- Search::Index +- Search::NoteIndex +feature_categories: +- global_search +description: Represents an Advanced Search index +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113612/ +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/search_namespace_index_assignments.yml b/db/docs/search_namespace_index_assignments.yml new file mode 100644 index 00000000000..5ddaa628dc9 --- /dev/null +++ b/db/docs/search_namespace_index_assignments.yml @@ -0,0 +1,10 @@ +--- +table_name: search_namespace_index_assignments +classes: +- Search::NamespaceIndexAssignment +feature_categories: +- global_search +description: Joins a Namespace to a Search::Index +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113612 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/serverless_domain_cluster.yml b/db/docs/serverless_domain_cluster.yml deleted file mode 100644 index 23c77b2c043..00000000000 --- a/db/docs/serverless_domain_cluster.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: serverless_domain_cluster -classes: -- Serverless::DomainCluster -feature_categories: -- kubernetes_management -description: "(Deprecated) A custom domain for a GitLab managed Knative installation" -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19835 -milestone: '12.6' -gitlab_schema: gitlab_main diff --git a/db/docs/service_desk_custom_email_credentials.yml b/db/docs/service_desk_custom_email_credentials.yml new file mode 100644 index 00000000000..fdfdce8fc21 --- /dev/null +++ b/db/docs/service_desk_custom_email_credentials.yml @@ -0,0 +1,11 @@ +--- +table_name: service_desk_custom_email_credentials +classes: +- ServiceDesk::CustomEmailCredential +feature_categories: +- service_desk +description: Holds all the credentials for custom email + addresses for Service Desk +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114917 +milestone: '15.11' +gitlab_schema: gitlab_main diff --git a/db/docs/service_desk_custom_email_verifications.yml b/db/docs/service_desk_custom_email_verifications.yml new file mode 100644 index 00000000000..cec5db374d9 --- /dev/null +++ b/db/docs/service_desk_custom_email_verifications.yml @@ -0,0 +1,11 @@ +--- +table_name: service_desk_custom_email_verifications +classes: +- ServiceDesk::CustomEmailVerification +feature_categories: +- service_desk +description: Holds the verification state and additional information for custom email + addresses for Service Desk +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/112938 +milestone: '15.10' +gitlab_schema: gitlab_main diff --git a/db/docs/smartcard_identities.yml b/db/docs/smartcard_identities.yml index 76b8d1a1368..905811768c1 100644 --- a/db/docs/smartcard_identities.yml +++ b/db/docs/smartcard_identities.yml @@ -3,7 +3,7 @@ table_name: smartcard_identities classes: - SmartcardIdentity feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/b6316689fdc2d142af85b17d511d39e50712b420 milestone: '11.6' diff --git a/db/docs/term_agreements.yml b/db/docs/term_agreements.yml index 502adad8ac0..bc2abea809e 100644 --- a/db/docs/term_agreements.yml +++ b/db/docs/term_agreements.yml @@ -3,7 +3,7 @@ table_name: term_agreements classes: - TermAgreement feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/82eeb72c8c03727540b902d40e7e657d0a5ecb4c milestone: '10.8' diff --git a/db/docs/token_with_ivs.yml b/db/docs/token_with_ivs.yml index 2acdff0dad1..521e26baac0 100644 --- a/db/docs/token_with_ivs.yml +++ b/db/docs/token_with_ivs.yml @@ -3,7 +3,7 @@ table_name: token_with_ivs classes: - TokenWithIv feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/37b80b4048190c2e1a35ec399e4aeb35d511090e milestone: '13.9' diff --git a/db/docs/u2f_registrations.yml b/db/docs/u2f_registrations.yml index 27b0ca3f2f5..b1aaa8148bd 100644 --- a/db/docs/u2f_registrations.yml +++ b/db/docs/u2f_registrations.yml @@ -3,7 +3,7 @@ table_name: u2f_registrations classes: - U2fRegistration feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/791cc9138be6ea1783e3c3853370cf0290f4d41e milestone: '8.9' diff --git a/db/docs/user_canonical_emails.yml b/db/docs/user_canonical_emails.yml index aeb1c3d830f..df3240b52fa 100644 --- a/db/docs/user_canonical_emails.yml +++ b/db/docs/user_canonical_emails.yml @@ -3,7 +3,7 @@ table_name: user_canonical_emails classes: - UserCanonicalEmail feature_categories: -- authentication_and_authorization +- system_access description: stores the canonical version of user's primary email address introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/27722 milestone: '13.0' diff --git a/db/docs/user_highest_roles.yml b/db/docs/user_highest_roles.yml index cc12e3080ff..cfe4c2e5ce0 100644 --- a/db/docs/user_highest_roles.yml +++ b/db/docs/user_highest_roles.yml @@ -3,7 +3,7 @@ table_name: user_highest_roles classes: - UserHighestRole feature_categories: -- authentication_and_authorization +- system_access description: Stores highest role per User they have in a Group or a Project. If a User has an open invite or pending access request or no membership the highest role will be set to nil. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26987 milestone: '12.9' diff --git a/db/docs/user_permission_export_uploads.yml b/db/docs/user_permission_export_uploads.yml index 217ede5bad2..fe76f1fa618 100644 --- a/db/docs/user_permission_export_uploads.yml +++ b/db/docs/user_permission_export_uploads.yml @@ -3,7 +3,7 @@ table_name: user_permission_export_uploads classes: - UserPermissionExportUpload feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47846 milestone: '13.7' diff --git a/db/docs/user_synced_attributes_metadata.yml b/db/docs/user_synced_attributes_metadata.yml index efc0ad1ec95..a2162c071c9 100644 --- a/db/docs/user_synced_attributes_metadata.yml +++ b/db/docs/user_synced_attributes_metadata.yml @@ -3,7 +3,7 @@ table_name: user_synced_attributes_metadata classes: - UserSyncedAttributesMetadata feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/4df54f260751a832ebf0b8c18524020d6604994b milestone: '10.0' diff --git a/db/docs/value_stream_dashboard_aggregations.yml b/db/docs/value_stream_dashboard_aggregations.yml new file mode 100644 index 00000000000..b05a0f4c6d0 --- /dev/null +++ b/db/docs/value_stream_dashboard_aggregations.yml @@ -0,0 +1,11 @@ +--- +table_name: value_stream_dashboard_aggregations +classes: +- Analytics::ValueStreamDashboard::Aggregation +feature_categories: +- value_stream_management +description: Stores the top-level namespaces which are opted-in to the value stream + dashboard feature. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118908 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/value_stream_dashboard_counts.yml b/db/docs/value_stream_dashboard_counts.yml new file mode 100644 index 00000000000..8aec148f3a7 --- /dev/null +++ b/db/docs/value_stream_dashboard_counts.yml @@ -0,0 +1,11 @@ +--- +table_name: value_stream_dashboard_counts +classes: +- Analytics::ValueStreamDashboard::Count +feature_categories: +- value_stream_management +description: Collects counts for various objects in GitLab for the Value Stream Dashboard + feature. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118220 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/docs/verification_codes.yml b/db/docs/verification_codes.yml index 9d0e3f53830..b34818070b1 100644 --- a/db/docs/verification_codes.yml +++ b/db/docs/verification_codes.yml @@ -1,6 +1,7 @@ --- table_name: verification_codes -classes: [] +classes: +- feature_categories: - jihu description: Used by the JiHu edition for user verification diff --git a/db/docs/vulnerability_advisories.yml b/db/docs/vulnerability_advisories.yml index 18029e784b5..6ce7f30aa7c 100644 --- a/db/docs/vulnerability_advisories.yml +++ b/db/docs/vulnerability_advisories.yml @@ -4,8 +4,7 @@ classes: - Vulnerabilities::Advisory feature_categories: - container_scanning -- dependency_scanning -- license_compliance +- software_composition_analysis description: Stores vulnerability advisories introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95622 milestone: '15.4' diff --git a/db/docs/webauthn_registrations.yml b/db/docs/webauthn_registrations.yml index fc983ea60ca..1ec27e1bb3b 100644 --- a/db/docs/webauthn_registrations.yml +++ b/db/docs/webauthn_registrations.yml @@ -3,7 +3,7 @@ table_name: webauthn_registrations classes: - WebauthnRegistration feature_categories: -- authentication_and_authorization +- system_access description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35797 milestone: '13.2' diff --git a/db/docs/work_item_types.yml b/db/docs/work_item_types.yml index 37d2c47de25..9c3da6a1b9d 100644 --- a/db/docs/work_item_types.yml +++ b/db/docs/work_item_types.yml @@ -1,6 +1,7 @@ --- table_name: work_item_types classes: +- AddNotificationsWorkItemWidget::WorkItemType - AddWidgetsForWorkItemTypes::WorkItemType - WorkItems::Type feature_categories: diff --git a/db/docs/work_item_widget_definitions.yml b/db/docs/work_item_widget_definitions.yml index 59cbca14908..a11fbfd34ae 100644 --- a/db/docs/work_item_widget_definitions.yml +++ b/db/docs/work_item_widget_definitions.yml @@ -1,6 +1,7 @@ --- table_name: work_item_widget_definitions classes: +- AddNotificationsWorkItemWidget::WidgetDefinition - AddWidgetsForWorkItemTypes::WidgetDefinition - WorkItems::WidgetDefinition feature_categories: diff --git a/db/docs/workspaces.yml b/db/docs/workspaces.yml new file mode 100644 index 00000000000..045a31d0d73 --- /dev/null +++ b/db/docs/workspaces.yml @@ -0,0 +1,10 @@ +--- +table_name: workspaces +classes: +- RemoteDevelopment::Workspace +feature_categories: +- remote_development +description: Remote Development Workspaces +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105783 +milestone: '16.0' +gitlab_schema: gitlab_main diff --git a/db/fixtures/development/14_pipelines.rb b/db/fixtures/development/14_pipelines.rb index 9120d95ca5d..67696828420 100644 --- a/db/fixtures/development/14_pipelines.rb +++ b/db/fixtures/development/14_pipelines.rb @@ -199,11 +199,15 @@ class Gitlab::Seeder::Pipelines GenericCommitStatus.create!(attributes) end + def runners + @runners ||= FactoryBot.create_list(:ci_runner, 6) + end + def job_attributes(pipeline, stage, opts) { name: 'test build', ci_stage: stage, stage_idx: stage.position, ref: pipeline.ref, tag: false, user: build_user, project: @project, pipeline: pipeline, - scheduling_type: :stage, created_at: Time.now, updated_at: Time.now + scheduling_type: :stage, created_at: Time.now, updated_at: Time.now, runner_id: runners.shuffle.first.id }.merge(opts) end diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index fa890531861..50155668dca 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -18,7 +18,8 @@ require 'active_support/testing/time_helpers' # # VSA_SEED_PROJECT_ID=10 FILTER=cycle_analytics SEED_VSA=1 bundle exec rake db:seed_fu -class Gitlab::Seeder::CycleAnalytics +# rubocop:disable Rails/Output +class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChildren include ActiveSupport::Testing::TimeHelpers attr_reader :project, :issues, :merge_requests, :developers @@ -26,18 +27,21 @@ class Gitlab::Seeder::CycleAnalytics FLAG = 'SEED_VSA' PERF_TEST = 'VSA_PERF_TEST' - ISSUE_STAGE_MAX_DURATION_IN_HOURS = 72 - PLAN_STAGE_MAX_DURATION_IN_HOURS = 48 - CODE_STAGE_MAX_DURATION_IN_HOURS = 72 - TEST_STAGE_MAX_DURATION_IN_HOURS = 5 - REVIEW_STAGE_MAX_DURATION_IN_HOURS = 72 - DEPLOYMENT_MAX_DURATION_IN_HOURS = 48 + MAX_DURATIONS = { # in hours + issue: 72, + plan: 48, + code: 72, + test: 5, + review: 72, + deployment: 48, + lead_time: 32 + }.freeze def self.seeder_based_on_env(project) if ENV[FLAG] - self.new(project: project) + new(project: project) elsif ENV[PERF_TEST] - self.new(project: project, perf: true) + new(project: project, perf: true) end end @@ -54,8 +58,10 @@ class Gitlab::Seeder::CycleAnalytics puts puts 'WARNING' puts '=======' - puts "Seeding #{self.class} is not possible because the given project (#{project.full_path}) doesn't have a repository." - puts 'Try specifying a project with working repository or omit the VSA_SEED_PROJECT_ID parameter so the seed script will automatically create one.' + puts "Seeding #{self.class} is not possible because the given project " \ + "(#{project.full_path}) doesn't have a repository." + puts 'Try specifying a project with working repository or omit the VSA_SEED_PROJECT_ID parameter ' \ + 'so the seed script will automatically create one.' puts return @@ -64,6 +70,7 @@ class Gitlab::Seeder::CycleAnalytics create_developers! create_issues! + seed_lead_time! seed_issue_stage! seed_plan_stage! seed_code_stage! @@ -79,7 +86,7 @@ class Gitlab::Seeder::CycleAnalytics def seed_issue_stage! issues.each do |issue| - time = within_end_time(issue.created_at + rand(ISSUE_STAGE_MAX_DURATION_IN_HOURS).hours) + time = within_end_time(issue.created_at + rand(MAX_DURATIONS[:issue]).hours) if issue.id.even? issue.metrics.update!(first_associated_with_milestone_at: time) @@ -93,7 +100,7 @@ class Gitlab::Seeder::CycleAnalytics issues.each do |issue| plan_stage_start = issue.metrics.first_associated_with_milestone_at || issue.metrics.first_added_to_board_at - first_mentioned_in_commit_at = within_end_time(plan_stage_start + rand(PLAN_STAGE_MAX_DURATION_IN_HOURS).hours) + first_mentioned_in_commit_at = within_end_time(plan_stage_start + rand(MAX_DURATIONS[:plan]).hours) issue.metrics.update!(first_mentioned_in_commit_at: first_mentioned_in_commit_at) end end @@ -107,7 +114,7 @@ class Gitlab::Seeder::CycleAnalytics source_branch: "#{issue.iid}-feature-branch", target_branch: 'master', author: developers.sample, - created_at: within_end_time(issue.metrics.first_mentioned_in_commit_at + rand(CODE_STAGE_MAX_DURATION_IN_HOURS).hours) + created_at: within_end_time(issue.metrics.first_mentioned_in_commit_at + rand(MAX_DURATIONS[:code]).hours) ) @merge_requests << merge_request @@ -118,16 +125,17 @@ class Gitlab::Seeder::CycleAnalytics def seed_test_stage! merge_requests.each do |merge_request| - pipeline = FactoryBot.create(:ci_pipeline, :success, project: project, partition_id: Ci::Pipeline.current_partition_value) + pipeline = FactoryBot.create(:ci_pipeline, :success, project: project, + partition_id: Ci::Pipeline.current_partition_value) build = FactoryBot.create(:ci_build, pipeline: pipeline, project: project, user: developers.sample) # Required because seeds run in a transaction and these are now # created in an `after_commit` hook. - merge_request.ensure_metrics + merge_request.ensure_metrics! merge_request.metrics.update!( latest_build_started_at: merge_request.created_at, - latest_build_finished_at: within_end_time(merge_request.created_at + TEST_STAGE_MAX_DURATION_IN_HOURS.hours), + latest_build_finished_at: within_end_time(merge_request.created_at + MAX_DURATIONS[:test].hours), pipeline_id: build.commit_id ) end @@ -135,13 +143,25 @@ class Gitlab::Seeder::CycleAnalytics def seed_review_stage! merge_requests.each do |merge_request| - merge_request.metrics.update!(merged_at: within_end_time(merge_request.created_at + REVIEW_STAGE_MAX_DURATION_IN_HOURS.hours)) + merge_request.metrics.update!( + merged_at: within_end_time(merge_request.created_at + MAX_DURATIONS[:review].hours) + ) end end def seed_staging_stage! merge_requests.each do |merge_request| - merge_request.metrics.update!(first_deployed_to_production_at: within_end_time(merge_request.metrics.merged_at + DEPLOYMENT_MAX_DURATION_IN_HOURS.hours)) + first_deployed_to_production_at = merge_request.metrics.merged_at + MAX_DURATIONS[:deployment].hours + merge_request.metrics.update!( + first_deployed_to_production_at: within_end_time(first_deployed_to_production_at) + ) + end + end + + def seed_lead_time! + issues.each do |issue| + created_at = issue.created_at - MAX_DURATIONS[:lead_time].hours + issue.update!(created_at: created_at, closed_at: Time.now) end end @@ -224,3 +244,4 @@ Gitlab::Seeder.quiet do puts "Skipped. Use the `#{Gitlab::Seeder::CycleAnalytics::FLAG}` environment variable to enable." end end +# rubocop:enable Rails/Output diff --git a/db/fixtures/development/28_integrations.rb b/db/fixtures/development/28_integrations.rb index db54593ae27..76f3f646271 100644 --- a/db/fixtures/development/28_integrations.rb +++ b/db/fixtures/development/28_integrations.rb @@ -3,7 +3,7 @@ Gitlab::Seeder.quiet do # This is only enabled if you're going to be using the customer portal in # development. - # CUSTOMER_PORTAL_URL=https://your.ngrok.io FILTER=integrations rake db:seed_fu + # CUSTOMER_PORTAL_URL=http://localhost:5000 FILTER=integrations rake db:seed_fu flag = 'CUSTOMER_PORTAL_URL' if ENV[flag] diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index 080e985fc5f..5cdb1496c3d 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -85,6 +85,7 @@ class Gitlab::Seeder::TriageOps Sidekiq::Testing.inline! do puts "Ensuring required groups" ensure_group('gitlab-com') + ensure_group('gitlab-com/support') ensure_group('gitlab-com/gl-security/appsec') ensure_group('gitlab-jh/jh-team') ensure_group('gitlab-org') @@ -192,7 +193,7 @@ class Gitlab::Seeder::TriageOps group = Group.new( name: group_path.titleize, path: group_path, - parent_id: parent&.id + parent: parent ) group.description = FFaker::Lorem.sentence group.save! diff --git a/db/fixtures/development/36_achievements.rb b/db/fixtures/development/36_achievements.rb new file mode 100644 index 00000000000..5798fd2d6c7 --- /dev/null +++ b/db/fixtures/development/36_achievements.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +class Gitlab::Seeder::Achievements + attr_reader :group, :user_ids, :maintainer_ids + + def initialize(group, user_ids) + @group = group + @maintainer_ids = group.members.maintainers.pluck_user_ids + @maintainer_ids << User.admins.first.id + @user_ids = user_ids + end + + def seed! + achievement_ids = Achievements::Achievement.pluck(:id) + achievement_ids = seed_achievements if achievement_ids.empty? + + user_ids.reverse.each_with_index do |user_id, user_index| + (user_index + 1).times do |achievement_index| + ::Achievements::UserAchievement.create!( + user_id: user_id, + achievement_id: achievement_ids[achievement_index], + awarded_by_user_id: maintainer_ids.sample, + revoked_by_user_id: achievement_index == 0 ? maintainer_ids.sample : nil, + revoked_at: achievement_index == 0 ? DateTime.current : nil + ) + + print '.' + end + end + end + + def seed_achievements + achievement_ids = [] + + + ['revoked', 'first mr', 'hero', 'legend'].each do |achievement_name| + achievement_ids << ::Achievements::Achievement.create!( + namespace_id: group.id, + name: achievement_name, + description: achievement_name == 'hero' ? 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry''s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.' : nil, + avatar: seed_avatar(achievement_name) + ).id + + print '.' + end + + achievement_ids + end + + def seed_avatar(achievement_name) + case achievement_name + when 'first mr' + File.new(Rails.root.join('db', 'fixtures', 'development', 'rocket.jpg'), 'r') + when 'hero' + File.new(Rails.root.join('db', 'fixtures', 'development', 'heart.png'), 'r') + end + end +end + +Gitlab::Seeder.quiet do + puts "\nGenerating ahievements" + + group = Group.first + users = User.first(4).pluck(:id) + Gitlab::Seeder::Achievements.new(group, users).seed! +rescue => e + warn "\nError seeding achievements: #{e}" +end diff --git a/db/fixtures/development/37_timelogs.rb b/db/fixtures/development/37_timelogs.rb new file mode 100644 index 00000000000..b5be9d21cb3 --- /dev/null +++ b/db/fixtures/development/37_timelogs.rb @@ -0,0 +1,99 @@ +# frozen_string_literal: true + +class Gitlab::Seeder::Timelogs + attr_reader :project, :issues, :merge_requests, :users + + def initialize(project, users) + @project = project + @issues = project.issues + @merge_requests = project.merge_requests + @users = users + end + + def seed! + ensure_users_are_reporters + + print "\nGenerating time entries for issues and merge requests in '#{project.full_path}'\n" + seed_on_issuables(issues) + seed_on_issuables(merge_requests) + end + + def self.find_or_create_reporters + password = SecureRandom.hex.slice(0, 16) + + [ + User.find_by_username("root"), + find_or_create_reporter_user("timelogs_reporter_user_1", password), + find_or_create_reporter_user("timelogs_reporter_user_2", password) + ].compact + end + + private + + def ensure_users_are_reporters + team = ProjectTeam.new(project) + + users.each do |user| + unless team.member?(user, Gitlab::Access::REPORTER) + print "\nAdding #{user.username} to #{project.full_path} reporters" + team.add_reporter(user) + end + end + end + + def seed_on_issuables(issuables) + min_date = Time.now - 2.months + max_date = Time.now + + issuables.each do |issuable| + rand(2..5).times do + timelog_author = users.sample + + ::Timelogs::CreateService.new( + issuable, rand(10..120) * 60, rand(min_date..max_date), FFaker::Lorem.sentence, timelog_author + ).execute + + print '.' + end + end + end + + def self.find_or_create_reporter_user(username, password) + user = User.find_by_username(username) + if user.nil? + print "\nCreating user '#{username}' with password: '#{password}'" + + user = User.create!( + username: username, + name: FFaker::Name.name, + email: FFaker::Internet.email, + confirmed_at: DateTime.now, + password: password + ) + end + + user + end +end + +if ENV['SEED_TIMELOGS'] + Gitlab::Seeder.quiet do + users = Gitlab::Seeder::Timelogs.find_or_create_reporters + + # Seed timelogs for the first 5 projects + projects = Project.first(5) + + # Always seed timelogs to the Flight project + flight_project = Project.find_by_full_path("flightjs/Flight") + projects |= [flight_project] unless flight_project.nil? + + projects.each do |project| + Gitlab::Seeder::Timelogs.new(project, users).seed! unless project.nil? + end + + rescue => e + warn "\nError seeding timelogs: #{e}" + end +else + puts "Skipped. Use the `SEED_TIMELOGS` environment variable to enable seeding timelogs data." +end diff --git a/db/fixtures/development/98_gitlab_instance_administration_project.rb b/db/fixtures/development/98_gitlab_instance_administration_project.rb deleted file mode 100644 index 35bc3edbd70..00000000000 --- a/db/fixtures/development/98_gitlab_instance_administration_project.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -response = Sidekiq::Worker.skipping_transaction_check do - result = ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute - - next result unless result[:status] == :success - - AuthorizedProjectUpdate::ProjectRecalculateService.new(result[:project]).execute - - result -end - -if response[:status] == :success - puts "Successfully created self-monitoring project." -else - puts "Could not create self-monitoring project due to error: '#{response[:message]}'" - puts "Check logs for more details." -end diff --git a/db/fixtures/development/heart.png b/db/fixtures/development/heart.png Binary files differnew file mode 100644 index 00000000000..23ad1c76ffa --- /dev/null +++ b/db/fixtures/development/heart.png diff --git a/db/fixtures/development/rocket.jpg b/db/fixtures/development/rocket.jpg Binary files differnew file mode 100644 index 00000000000..ab843fe057c --- /dev/null +++ b/db/fixtures/development/rocket.jpg diff --git a/db/fixtures/production/998_gitlab_instance_administration_project.rb b/db/fixtures/production/998_gitlab_instance_administration_project.rb deleted file mode 100644 index d935832aea6..00000000000 --- a/db/fixtures/production/998_gitlab_instance_administration_project.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -response = ::Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService.new.execute - -if response[:status] == :success - puts "Successfully created self-monitoring project." -else - puts "Could not create self-monitoring project due to error: '#{response[:message]}'" - puts "Check logs for more details." -end diff --git a/db/init_structure.sql b/db/init_structure.sql index 2b952381952..aee0f767996 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -10,178 +10,101 @@ 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 +CREATE FUNCTION delete_associated_project_namespace() 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; +DELETE FROM namespaces +WHERE namespaces.id = OLD.project_namespace_id AND +namespaces.type = 'Project'; +RETURN NULL; - RETURN NULL; END $$; -CREATE FUNCTION integrations_set_type_new() RETURNS trigger +CREATE FUNCTION insert_into_loose_foreign_keys_deleted_records() 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; + INSERT INTO loose_foreign_keys_deleted_records + (fully_qualified_table_name, primary_key_value) + SELECT TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table; + RETURN NULL; END $$; -CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger +CREATE FUNCTION insert_namespaces_sync_event() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN -UPDATE projects SET has_external_issue_tracker = ( - EXISTS - ( - SELECT 1 - FROM integrations - 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); +INSERT INTO namespaces_sync_events (namespace_id) +VALUES(COALESCE(NEW.id, OLD.id)); RETURN NULL; END $$; -CREATE FUNCTION set_has_external_wiki() RETURNS trigger +CREATE FUNCTION insert_projects_sync_event() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN -UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE) -WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id); +INSERT INTO projects_sync_events (project_id) +VALUES(COALESCE(NEW.id, OLD.id)); RETURN NULL; END $$; -CREATE FUNCTION trigger_07c94931164e() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."event_id_convert_to_bigint" := NEW."event_id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_21e7a2602957() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - NEW."stage_id_convert_to_bigint" := NEW."stage_id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_490d204c00b3() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - 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; -$$; - -CREATE FUNCTION trigger_69523443cc10() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_77f5e1d20482() RETURNS trigger +CREATE FUNCTION integrations_set_type_new() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."deployable_id_convert_to_bigint" := NEW."deployable_id"; - RETURN NEW; -END; -$$; +UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1') +WHERE integrations.id = NEW.id; +RETURN NULL; -CREATE FUNCTION trigger_8485e97c00e3() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."source_job_id_convert_to_bigint" := NEW."source_job_id"; - RETURN NEW; -END; +END $$; -CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger - LANGUAGE plpgsql +CREATE FUNCTION next_traversal_ids_sibling(traversal_ids integer[]) RETURNS integer[] + LANGUAGE plpgsql IMMUTABLE STRICT AS $$ BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; + return traversal_ids[1:array_length(traversal_ids, 1)-1] || + ARRAY[traversal_ids[array_length(traversal_ids, 1)]+1]; END; $$; -CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger +CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; -END; -$$; +UPDATE projects SET has_external_issue_tracker = ( + EXISTS + ( + SELECT 1 + FROM integrations + 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; -CREATE FUNCTION trigger_aebe8b822ad3() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - NEW."taggable_id_convert_to_bigint" := NEW."taggable_id"; - RETURN NEW; -END; +END $$; -CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger +CREATE FUNCTION set_has_external_wiki() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; -END; -$$; +UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE) +WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id); +RETURN NULL; -CREATE FUNCTION trigger_f1ca8ec18d78() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."job_artifact_id_convert_to_bigint" := NEW."job_artifact_id"; - RETURN NEW; -END; +END $$; CREATE TABLE audit_events ( @@ -394,15 +317,188 @@ CREATE TABLE gitlab_partitions_dynamic.audit_events_202307 ( ); 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 gitlab_partitions_dynamic.audit_events_202308 ( + 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_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202309 ( + 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_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-01 00:00:00'); + +CREATE TABLE batched_background_migration_job_transition_logs ( + id bigint NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE batched_background_migration_job_transition_logs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE batched_background_migration_job_transition_logs_id_seq OWNED BY batched_background_migration_job_transition_logs.id; + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-02-28 18:00:00-06'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 ( + id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, + batched_background_migration_job_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + previous_status smallint NOT NULL, + next_status smallint NOT NULL, + exception_class text, + exception_message text, + CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), + CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) +); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); + 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 + updated_at timestamp with time zone NOT NULL ) PARTITION BY RANGE (process_at); @@ -419,35 +515,27 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); -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 + updated_at timestamp with time zone NOT NULL ); -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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -455,11 +543,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -467,11 +553,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -479,11 +563,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -491,11 +573,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -503,11 +583,9 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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'); @@ -515,14 +593,32 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat 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 + updated_at timestamp with time zone NOT NULL ); 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 gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 ( + id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, + rule_id bigint NOT NULL, + alert_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_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 ( + id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, + rule_id bigint NOT NULL, + alert_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_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); + CREATE TABLE incident_management_pending_issue_escalations ( id bigint NOT NULL, rule_id bigint NOT NULL, @@ -550,7 +646,6 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat 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, @@ -560,7 +655,6 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat 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, @@ -632,61 +726,137 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat ); 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 ( +CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 ( + 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_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 ( + 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_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); + +CREATE TABLE verification_codes ( 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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ) PARTITION BY RANGE (created_at); -CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_000000 ( +COMMENT ON TABLE verification_codes IS 'JiHu-specific table'; + +CREATE TABLE gitlab_partitions_dynamic.verification_codes_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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000 FOR VALUES FROM (MINVALUE) TO ('2023-01-31 18:00:00-06'); -CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212 ( +CREATE TABLE gitlab_partitions_dynamic.verification_codes_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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_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_202301 ( +CREATE TABLE gitlab_partitions_dynamic.verification_codes_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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_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_202302 ( +CREATE TABLE gitlab_partitions_dynamic.verification_codes_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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); -CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303 ( +CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 ( 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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); -CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304 ( +CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 ( 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)) + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -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'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.verification_codes_202307 ( + created_at timestamp with time zone DEFAULT now() NOT NULL, + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) +); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.verification_codes_202308 ( + created_at timestamp with time zone DEFAULT now() NOT NULL, + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) +); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); + +CREATE TABLE gitlab_partitions_dynamic.verification_codes_202309 ( + created_at timestamp with time zone DEFAULT now() NOT NULL, + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) +); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); CREATE TABLE web_hook_logs ( id bigint NOT NULL, @@ -730,7 +900,6 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_000000 ( 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_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202212 ( id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, @@ -868,399 +1037,466 @@ CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202307 ( ); 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 gitlab_partitions_dynamic.web_hook_logs_202308 ( + 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_202308 FOR VALUES FROM ('2023-08-01 00:00:00') TO ('2023-09-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202309 ( + 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_202309 FOR VALUES FROM ('2023-09-01 00:00:00') TO ('2023-10-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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ) 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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, + stage_event_hash_id bigint NOT NULL, + issue_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 + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1272,7 +1508,8 @@ CREATE TABLE analytics_cycle_analytics_merge_request_stage_events ( milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ) PARTITION BY HASH (stage_event_hash_id); @@ -1284,7 +1521,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1296,7 +1534,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1308,7 +1547,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1320,7 +1560,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1332,7 +1573,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1344,7 +1586,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1356,7 +1599,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1368,7 +1612,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1380,7 +1625,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1392,7 +1638,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1404,7 +1651,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1416,7 +1664,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1428,7 +1677,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1440,7 +1690,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1452,7 +1703,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1464,7 +1716,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1476,7 +1729,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1488,7 +1742,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1500,7 +1755,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1512,7 +1768,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1524,7 +1781,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1536,7 +1794,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1548,7 +1807,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1560,7 +1820,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1572,7 +1833,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1584,7 +1846,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1596,7 +1859,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1608,7 +1872,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1620,7 +1885,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1632,7 +1898,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1644,7 +1911,8 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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); @@ -1656,10 +1924,629 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st milestone_id bigint, author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, - end_event_timestamp timestamp with time zone + end_event_timestamp timestamp with time zone, + state_id smallint DEFAULT 1 NOT NULL ); 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 issue_search_data ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +) +PARTITION BY HASH (project_id); + +CREATE TABLE gitlab_partitions_static.issue_search_data_00 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_00 FOR VALUES WITH (modulus 64, remainder 0); + +CREATE TABLE gitlab_partitions_static.issue_search_data_01 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_01 FOR VALUES WITH (modulus 64, remainder 1); + +CREATE TABLE gitlab_partitions_static.issue_search_data_02 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_02 FOR VALUES WITH (modulus 64, remainder 2); + +CREATE TABLE gitlab_partitions_static.issue_search_data_03 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_03 FOR VALUES WITH (modulus 64, remainder 3); + +CREATE TABLE gitlab_partitions_static.issue_search_data_04 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_04 FOR VALUES WITH (modulus 64, remainder 4); + +CREATE TABLE gitlab_partitions_static.issue_search_data_05 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_05 FOR VALUES WITH (modulus 64, remainder 5); + +CREATE TABLE gitlab_partitions_static.issue_search_data_06 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_06 FOR VALUES WITH (modulus 64, remainder 6); + +CREATE TABLE gitlab_partitions_static.issue_search_data_07 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_07 FOR VALUES WITH (modulus 64, remainder 7); + +CREATE TABLE gitlab_partitions_static.issue_search_data_08 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_08 FOR VALUES WITH (modulus 64, remainder 8); + +CREATE TABLE gitlab_partitions_static.issue_search_data_09 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_09 FOR VALUES WITH (modulus 64, remainder 9); + +CREATE TABLE gitlab_partitions_static.issue_search_data_10 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_10 FOR VALUES WITH (modulus 64, remainder 10); + +CREATE TABLE gitlab_partitions_static.issue_search_data_11 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_11 FOR VALUES WITH (modulus 64, remainder 11); + +CREATE TABLE gitlab_partitions_static.issue_search_data_12 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_12 FOR VALUES WITH (modulus 64, remainder 12); + +CREATE TABLE gitlab_partitions_static.issue_search_data_13 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_13 FOR VALUES WITH (modulus 64, remainder 13); + +CREATE TABLE gitlab_partitions_static.issue_search_data_14 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_14 FOR VALUES WITH (modulus 64, remainder 14); + +CREATE TABLE gitlab_partitions_static.issue_search_data_15 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_15 FOR VALUES WITH (modulus 64, remainder 15); + +CREATE TABLE gitlab_partitions_static.issue_search_data_16 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_16 FOR VALUES WITH (modulus 64, remainder 16); + +CREATE TABLE gitlab_partitions_static.issue_search_data_17 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_17 FOR VALUES WITH (modulus 64, remainder 17); + +CREATE TABLE gitlab_partitions_static.issue_search_data_18 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_18 FOR VALUES WITH (modulus 64, remainder 18); + +CREATE TABLE gitlab_partitions_static.issue_search_data_19 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_19 FOR VALUES WITH (modulus 64, remainder 19); + +CREATE TABLE gitlab_partitions_static.issue_search_data_20 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_20 FOR VALUES WITH (modulus 64, remainder 20); + +CREATE TABLE gitlab_partitions_static.issue_search_data_21 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_21 FOR VALUES WITH (modulus 64, remainder 21); + +CREATE TABLE gitlab_partitions_static.issue_search_data_22 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_22 FOR VALUES WITH (modulus 64, remainder 22); + +CREATE TABLE gitlab_partitions_static.issue_search_data_23 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_23 FOR VALUES WITH (modulus 64, remainder 23); + +CREATE TABLE gitlab_partitions_static.issue_search_data_24 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_24 FOR VALUES WITH (modulus 64, remainder 24); + +CREATE TABLE gitlab_partitions_static.issue_search_data_25 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_25 FOR VALUES WITH (modulus 64, remainder 25); + +CREATE TABLE gitlab_partitions_static.issue_search_data_26 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_26 FOR VALUES WITH (modulus 64, remainder 26); + +CREATE TABLE gitlab_partitions_static.issue_search_data_27 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_27 FOR VALUES WITH (modulus 64, remainder 27); + +CREATE TABLE gitlab_partitions_static.issue_search_data_28 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_28 FOR VALUES WITH (modulus 64, remainder 28); + +CREATE TABLE gitlab_partitions_static.issue_search_data_29 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_29 FOR VALUES WITH (modulus 64, remainder 29); + +CREATE TABLE gitlab_partitions_static.issue_search_data_30 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_30 FOR VALUES WITH (modulus 64, remainder 30); + +CREATE TABLE gitlab_partitions_static.issue_search_data_31 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_31 FOR VALUES WITH (modulus 64, remainder 31); + +CREATE TABLE gitlab_partitions_static.issue_search_data_32 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_32 FOR VALUES WITH (modulus 64, remainder 32); + +CREATE TABLE gitlab_partitions_static.issue_search_data_33 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_33 FOR VALUES WITH (modulus 64, remainder 33); + +CREATE TABLE gitlab_partitions_static.issue_search_data_34 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_34 FOR VALUES WITH (modulus 64, remainder 34); + +CREATE TABLE gitlab_partitions_static.issue_search_data_35 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_35 FOR VALUES WITH (modulus 64, remainder 35); + +CREATE TABLE gitlab_partitions_static.issue_search_data_36 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_36 FOR VALUES WITH (modulus 64, remainder 36); + +CREATE TABLE gitlab_partitions_static.issue_search_data_37 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_37 FOR VALUES WITH (modulus 64, remainder 37); + +CREATE TABLE gitlab_partitions_static.issue_search_data_38 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_38 FOR VALUES WITH (modulus 64, remainder 38); + +CREATE TABLE gitlab_partitions_static.issue_search_data_39 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_39 FOR VALUES WITH (modulus 64, remainder 39); + +CREATE TABLE gitlab_partitions_static.issue_search_data_40 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_40 FOR VALUES WITH (modulus 64, remainder 40); + +CREATE TABLE gitlab_partitions_static.issue_search_data_41 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_41 FOR VALUES WITH (modulus 64, remainder 41); + +CREATE TABLE gitlab_partitions_static.issue_search_data_42 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_42 FOR VALUES WITH (modulus 64, remainder 42); + +CREATE TABLE gitlab_partitions_static.issue_search_data_43 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_43 FOR VALUES WITH (modulus 64, remainder 43); + +CREATE TABLE gitlab_partitions_static.issue_search_data_44 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_44 FOR VALUES WITH (modulus 64, remainder 44); + +CREATE TABLE gitlab_partitions_static.issue_search_data_45 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_45 FOR VALUES WITH (modulus 64, remainder 45); + +CREATE TABLE gitlab_partitions_static.issue_search_data_46 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_46 FOR VALUES WITH (modulus 64, remainder 46); + +CREATE TABLE gitlab_partitions_static.issue_search_data_47 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_47 FOR VALUES WITH (modulus 64, remainder 47); + +CREATE TABLE gitlab_partitions_static.issue_search_data_48 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_48 FOR VALUES WITH (modulus 64, remainder 48); + +CREATE TABLE gitlab_partitions_static.issue_search_data_49 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_49 FOR VALUES WITH (modulus 64, remainder 49); + +CREATE TABLE gitlab_partitions_static.issue_search_data_50 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_50 FOR VALUES WITH (modulus 64, remainder 50); + +CREATE TABLE gitlab_partitions_static.issue_search_data_51 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_51 FOR VALUES WITH (modulus 64, remainder 51); + +CREATE TABLE gitlab_partitions_static.issue_search_data_52 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_52 FOR VALUES WITH (modulus 64, remainder 52); + +CREATE TABLE gitlab_partitions_static.issue_search_data_53 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_53 FOR VALUES WITH (modulus 64, remainder 53); + +CREATE TABLE gitlab_partitions_static.issue_search_data_54 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_54 FOR VALUES WITH (modulus 64, remainder 54); + +CREATE TABLE gitlab_partitions_static.issue_search_data_55 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_55 FOR VALUES WITH (modulus 64, remainder 55); + +CREATE TABLE gitlab_partitions_static.issue_search_data_56 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_56 FOR VALUES WITH (modulus 64, remainder 56); + +CREATE TABLE gitlab_partitions_static.issue_search_data_57 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_57 FOR VALUES WITH (modulus 64, remainder 57); + +CREATE TABLE gitlab_partitions_static.issue_search_data_58 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_58 FOR VALUES WITH (modulus 64, remainder 58); + +CREATE TABLE gitlab_partitions_static.issue_search_data_59 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_59 FOR VALUES WITH (modulus 64, remainder 59); + +CREATE TABLE gitlab_partitions_static.issue_search_data_60 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_60 FOR VALUES WITH (modulus 64, remainder 60); + +CREATE TABLE gitlab_partitions_static.issue_search_data_61 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_61 FOR VALUES WITH (modulus 64, remainder 61); + +CREATE TABLE gitlab_partitions_static.issue_search_data_62 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_62 FOR VALUES WITH (modulus 64, remainder 62); + +CREATE TABLE gitlab_partitions_static.issue_search_data_63 ( + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + search_vector tsvector +); +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63); + +CREATE TABLE loose_foreign_keys_deleted_records ( + id bigint NOT NULL, + partition bigint DEFAULT 1 NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + consume_after timestamp with time zone DEFAULT now(), + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +) +PARTITION BY LIST (partition); + +CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id; + +CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 ( + id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL, + partition bigint DEFAULT 1 NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + consume_after timestamp with time zone DEFAULT now(), + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +); +ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1'); + CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, project_id integer NOT NULL, @@ -10335,6 +11222,30 @@ CREATE SEQUENCE abuse_reports_id_seq ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id; +CREATE TABLE agent_activity_events ( + id bigint NOT NULL, + agent_id bigint NOT NULL, + user_id bigint, + project_id bigint, + merge_request_id bigint, + agent_token_id bigint, + recorded_at timestamp with time zone NOT NULL, + kind smallint NOT NULL, + level smallint NOT NULL, + sha bytea, + detail text, + CONSTRAINT check_068205e735 CHECK ((char_length(detail) <= 255)) +); + +CREATE SEQUENCE agent_activity_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE agent_activity_events_id_seq OWNED BY agent_activity_events.id; + CREATE TABLE agent_group_authorizations ( id bigint NOT NULL, group_id bigint NOT NULL, @@ -10351,6 +11262,22 @@ CREATE SEQUENCE agent_group_authorizations_id_seq ALTER SEQUENCE agent_group_authorizations_id_seq OWNED BY agent_group_authorizations.id; +CREATE TABLE agent_project_authorizations ( + id bigint NOT NULL, + project_id bigint NOT NULL, + agent_id bigint NOT NULL, + config jsonb NOT NULL +); + +CREATE SEQUENCE agent_project_authorizations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE agent_project_authorizations_id_seq OWNED BY agent_project_authorizations.id; + CREATE TABLE alert_management_alert_assignees ( id bigint NOT NULL, user_id bigint NOT NULL, @@ -10589,7 +11516,6 @@ ALTER SEQUENCE analytics_devops_adoption_segments_id_seq OWNED BY analytics_devo CREATE TABLE analytics_devops_adoption_snapshots ( id bigint NOT NULL, - segment_id bigint, recorded_at timestamp with time zone NOT NULL, issue_opened boolean NOT NULL, merge_request_opened boolean NOT NULL, @@ -10976,7 +11902,7 @@ CREATE TABLE application_settings ( secret_detection_revocation_token_types_url text, encrypted_cloud_license_auth_token text, encrypted_cloud_license_auth_token_iv text, - personal_access_token_prefix text, + personal_access_token_prefix text DEFAULT 'glpat-'::text, kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL, disable_feed_token boolean DEFAULT false NOT NULL, container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 NOT NULL, @@ -11032,13 +11958,47 @@ CREATE TABLE application_settings ( 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, + throttle_authenticated_git_lfs_requests_per_period integer DEFAULT 1000 NOT NULL, + throttle_authenticated_git_lfs_period_in_seconds integer DEFAULT 60 NOT NULL, + throttle_authenticated_git_lfs_enabled boolean DEFAULT false NOT NULL, + jobs_per_stage_page_size integer DEFAULT 200 NOT NULL, + sidekiq_job_limiter_mode smallint DEFAULT 1 NOT NULL, + sidekiq_job_limiter_compression_threshold_bytes integer DEFAULT 100000 NOT NULL, + sidekiq_job_limiter_limit_bytes integer DEFAULT 0 NOT NULL, + dependency_proxy_ttl_group_policy_worker_capacity smallint DEFAULT 2 NOT NULL, + throttle_unauthenticated_deprecated_api_requests_per_period integer DEFAULT 1800 NOT NULL, + throttle_unauthenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_unauthenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_deprecated_api_requests_per_period integer DEFAULT 3600 NOT NULL, + throttle_authenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_authenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL, + suggest_pipeline_enabled boolean DEFAULT true NOT NULL, + content_validation_endpoint_url text, + encrypted_content_validation_api_key bytea, + encrypted_content_validation_api_key_iv bytea, + content_validation_endpoint_enabled boolean DEFAULT false NOT NULL, + sentry_enabled boolean DEFAULT false NOT NULL, + sentry_dsn text, + sentry_clientside_dsn text, + sentry_environment text, + max_ssh_key_lifetime integer, + static_objects_external_storage_auth_token_encrypted text, + future_subscriptions jsonb DEFAULT '[]'::jsonb 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_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_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), + CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)), + CONSTRAINT app_settings_yaml_max_size_positive CHECK ((max_yaml_size_bytes > 0)), CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), + CONSTRAINT check_32710817e9 CHECK ((char_length(static_objects_external_storage_auth_token_encrypted) <= 255)), + CONSTRAINT check_3def0f1829 CHECK ((char_length(sentry_clientside_dsn) <= 255)), + CONSTRAINT check_4f8b811780 CHECK ((char_length(sentry_dsn) <= 255)), CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT check_57123c9593 CHECK ((char_length(help_page_documentation_base_url) <= 255)), + CONSTRAINT check_5a84c3ffdc CHECK ((char_length(content_validation_endpoint_url) <= 255)), + CONSTRAINT check_5bcba483c4 CHECK ((char_length(sentry_environment) <= 255)), CONSTRAINT check_718b4458ae CHECK ((char_length(personal_access_token_prefix) <= 20)), CONSTRAINT check_7227fad848 CHECK ((char_length(rate_limiting_response_text) <= 255)), CONSTRAINT check_85a39b68ff CHECK ((char_length(encrypted_ci_jwt_signing_key_iv) <= 255)), @@ -11053,6 +12013,14 @@ CREATE TABLE application_settings ( CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)) ); +COMMENT ON COLUMN application_settings.content_validation_endpoint_url IS 'JiHu-specific column'; + +COMMENT ON COLUMN application_settings.encrypted_content_validation_api_key IS 'JiHu-specific column'; + +COMMENT ON COLUMN application_settings.encrypted_content_validation_api_key_iv IS 'JiHu-specific column'; + +COMMENT ON COLUMN application_settings.content_validation_endpoint_enabled IS 'JiHu-specific column'; + CREATE SEQUENCE application_settings_id_seq AS integer START WITH 1 @@ -11089,6 +12057,7 @@ CREATE TABLE approval_merge_request_rules ( report_type smallint, section text, modified_from_project_rule boolean DEFAULT false NOT NULL, + orchestration_policy_idx smallint, CONSTRAINT check_6fca5928b2 CHECK ((char_length(section) <= 255)) ); @@ -11156,7 +12125,10 @@ CREATE TABLE approval_project_rules ( rule_type smallint DEFAULT 0 NOT NULL, scanners text[], vulnerabilities_allowed smallint DEFAULT 0 NOT NULL, - severity_levels text[] DEFAULT '{}'::text[] NOT NULL + severity_levels text[] DEFAULT '{}'::text[] NOT NULL, + report_type smallint, + vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL, + orchestration_policy_idx smallint ); CREATE TABLE approval_project_rules_groups ( @@ -11871,7 +12843,9 @@ CREATE TABLE bulk_imports ( source_type smallint NOT NULL, status smallint 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, + source_version text, + CONSTRAINT check_ea4e58775a CHECK ((char_length(source_version) <= 63)) ); CREATE SEQUENCE bulk_imports_id_seq @@ -11927,7 +12901,6 @@ ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id; CREATE TABLE ci_build_needs ( 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, @@ -11981,7 +12954,6 @@ 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_convert_to_bigint integer DEFAULT 0 NOT NULL, chunk_index integer NOT NULL, data_store integer NOT NULL, raw_data bytea, @@ -12010,7 +12982,6 @@ CREATE TABLE ci_build_trace_metadata ( ); CREATE TABLE ci_builds ( - id integer NOT NULL, status character varying, finished_at timestamp without time zone, trace text, @@ -12045,7 +13016,6 @@ CREATE TABLE ci_builds ( coverage_regex character varying, auto_canceled_by_id integer, retried boolean, - stage_id_convert_to_bigint integer, protected boolean, failure_reason integer, scheduled_at timestamp with time zone, @@ -12055,7 +13025,7 @@ CREATE TABLE ci_builds ( resource_group_id bigint, waiting_for_resource_at timestamp with time zone, scheduling_type smallint, - id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + id bigint NOT NULL, stage_id bigint ); @@ -12070,8 +13040,6 @@ CREATE SEQUENCE ci_builds_id_seq ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id; CREATE TABLE ci_builds_metadata ( - 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, @@ -12083,7 +13051,8 @@ CREATE TABLE ci_builds_metadata ( expanded_environment_name character varying(255), secrets jsonb DEFAULT '{}'::jsonb NOT NULL, build_id bigint NOT NULL, - id bigint NOT NULL + id bigint NOT NULL, + runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -12223,10 +13192,29 @@ CREATE SEQUENCE ci_instance_variables_id_seq ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id; +CREATE TABLE ci_job_artifact_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + job_artifact_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_df832b66ea CHECK ((char_length(verification_failure) <= 255)) +); + +CREATE SEQUENCE ci_job_artifact_states_job_artifact_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_artifact_states_job_artifact_id_seq OWNED BY ci_job_artifact_states.job_artifact_id; + CREATE TABLE ci_job_artifacts ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, project_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, @@ -12240,7 +13228,9 @@ CREATE TABLE ci_job_artifacts ( id bigint NOT NULL, job_id bigint NOT NULL, locked smallint DEFAULT 2, - CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)) + original_filename text, + CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)), + CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512)) ); CREATE SEQUENCE ci_job_artifacts_id_seq @@ -12297,7 +13287,7 @@ CREATE TABLE ci_minutes_additional_packs ( expires_at date, number_of_minutes integer NOT NULL, purchase_xid text, - CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32)) + CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 50)) ); CREATE SEQUENCE ci_minutes_additional_packs_id_seq @@ -12309,6 +13299,21 @@ CREATE SEQUENCE ci_minutes_additional_packs_id_seq ALTER SEQUENCE ci_minutes_additional_packs_id_seq OWNED BY ci_minutes_additional_packs.id; +CREATE TABLE ci_namespace_mirrors ( + id bigint NOT NULL, + namespace_id integer NOT NULL, + traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL +); + +CREATE SEQUENCE ci_namespace_mirrors_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_namespace_mirrors_id_seq OWNED BY ci_namespace_mirrors.id; + CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -12316,6 +13321,8 @@ CREATE TABLE ci_namespace_monthly_usages ( 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, + shared_runners_duration integer DEFAULT 0 NOT NULL, + created_at timestamp with time zone, CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -12337,7 +13344,8 @@ CREATE TABLE ci_pending_builds ( instance_runners_enabled boolean DEFAULT false NOT NULL, namespace_id bigint, minutes_exceeded boolean DEFAULT false NOT NULL, - tag_ids integer[] DEFAULT '{}'::integer[] + tag_ids integer[] DEFAULT '{}'::integer[], + namespace_traversal_ids integer[] DEFAULT '{}'::integer[] ); CREATE SEQUENCE ci_pending_builds_id_seq @@ -12557,11 +13565,28 @@ CREATE SEQUENCE ci_platform_metrics_id_seq ALTER SEQUENCE ci_platform_metrics_id_seq OWNED BY ci_platform_metrics.id; +CREATE TABLE ci_project_mirrors ( + id bigint NOT NULL, + project_id integer NOT NULL, + namespace_id integer NOT NULL +); + +CREATE SEQUENCE ci_project_mirrors_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_project_mirrors_id_seq OWNED BY ci_project_mirrors.id; + CREATE TABLE ci_project_monthly_usages ( id bigint NOT NULL, project_id bigint NOT NULL, date date NOT NULL, amount_used numeric(18,2) DEFAULT 0.0 NOT NULL, + shared_runners_duration integer DEFAULT 0 NOT NULL, + created_at timestamp with time zone, CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -12596,7 +13621,8 @@ CREATE TABLE ci_resource_groups ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, project_id bigint NOT NULL, - key character varying(255) NOT NULL + key character varying(255) NOT NULL, + process_mode smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_resource_groups_id_seq @@ -12717,7 +13743,6 @@ CREATE TABLE ci_sources_pipelines ( project_id integer, pipeline_id integer, source_project_id integer, - source_job_id_convert_to_bigint integer, source_pipeline_id integer, source_job_id bigint ); @@ -12748,7 +13773,6 @@ 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_convert_to_bigint integer DEFAULT 0 NOT NULL, project_id integer, pipeline_id integer, created_at timestamp without time zone, @@ -13311,7 +14335,8 @@ CREATE TABLE clusters_integration_prometheus ( cluster_id bigint NOT NULL, enabled boolean DEFAULT false NOT NULL, encrypted_alert_manager_token text, - encrypted_alert_manager_token_iv text + encrypted_alert_manager_token_iv text, + health_status smallint DEFAULT 0 NOT NULL ); CREATE TABLE clusters_kubernetes_namespaces ( @@ -13415,6 +14440,29 @@ CREATE SEQUENCE container_repositories_id_seq ALTER SEQUENCE container_repositories_id_seq OWNED BY container_repositories.id; +CREATE TABLE content_blocked_states ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + commit_sha bytea NOT NULL, + blob_sha bytea NOT NULL, + path text NOT NULL, + container_identifier text NOT NULL, + CONSTRAINT check_023093d38f CHECK ((char_length(container_identifier) <= 255)), + CONSTRAINT check_1870100678 CHECK ((char_length(path) <= 2048)) +); + +COMMENT ON TABLE content_blocked_states IS 'JiHu-specific table'; + +CREATE SEQUENCE content_blocked_states_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE content_blocked_states_id_seq OWNED BY content_blocked_states.id; + CREATE TABLE conversational_development_index_metrics ( id integer NOT NULL, leader_issues double precision NOT NULL, @@ -13461,6 +14509,25 @@ CREATE SEQUENCE conversational_development_index_metrics_id_seq ALTER SEQUENCE conversational_development_index_metrics_id_seq OWNED BY conversational_development_index_metrics.id; +CREATE TABLE coverage_fuzzing_corpuses ( + id bigint NOT NULL, + project_id bigint NOT NULL, + user_id bigint, + package_id bigint NOT NULL, + file_updated_at timestamp with time zone DEFAULT now() NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE coverage_fuzzing_corpuses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE coverage_fuzzing_corpuses_id_seq OWNED BY coverage_fuzzing_corpuses.id; + CREATE TABLE csv_issue_imports ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -13777,33 +14844,6 @@ 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, @@ -13812,7 +14852,9 @@ CREATE TABLE dependency_proxy_blobs ( file_store integer, group_id integer NOT NULL, size bigint, - updated_at timestamp with time zone NOT NULL + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + read_at timestamp with time zone DEFAULT now() NOT NULL ); CREATE SEQUENCE dependency_proxy_blobs_id_seq @@ -13862,6 +14904,8 @@ CREATE TABLE dependency_proxy_manifests ( file text NOT NULL, digest text NOT NULL, content_type text, + status smallint DEFAULT 0 NOT NULL, + read_at timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT check_079b293a7b CHECK ((char_length(file) <= 255)), CONSTRAINT check_167a9a8a91 CHECK ((char_length(content_type) <= 255)), CONSTRAINT check_c579e3f586 CHECK ((char_length(file_name) <= 255)), @@ -13923,6 +14967,24 @@ CREATE SEQUENCE deploy_tokens_id_seq ALTER SEQUENCE deploy_tokens_id_seq OWNED BY deploy_tokens.id; +CREATE TABLE deployment_approvals ( + id bigint NOT NULL, + deployment_id bigint NOT NULL, + user_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint NOT NULL +); + +CREATE SEQUENCE deployment_approvals_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE deployment_approvals_id_seq OWNED BY deployment_approvals.id; + CREATE TABLE deployment_clusters ( deployment_id integer NOT NULL, cluster_id integer NOT NULL, @@ -13944,7 +15006,6 @@ CREATE TABLE deployments ( tag boolean NOT NULL, sha character varying NOT NULL, user_id integer, - deployable_id_convert_to_bigint integer, deployable_type character varying, created_at timestamp without time zone, updated_at timestamp without time zone, @@ -13952,7 +15013,8 @@ CREATE TABLE deployments ( finished_at timestamp with time zone, status smallint NOT NULL, cluster_id integer, - deployable_id bigint + deployable_id bigint, + archived boolean DEFAULT false NOT NULL ); CREATE SEQUENCE deployments_id_seq @@ -14128,7 +15190,9 @@ CREATE TABLE draft_notes ( "position" text, original_position text, change_position text, - commit_id bytea + commit_id bytea, + line_code text, + CONSTRAINT check_c497a94a0e CHECK ((char_length(line_code) <= 255)) ); CREATE SEQUENCE draft_notes_id_seq @@ -14372,7 +15436,9 @@ CREATE TABLE epics ( state_id smallint DEFAULT 1, external_key character varying(255), confidential boolean DEFAULT false NOT NULL, - CONSTRAINT check_57ee003890 CHECK ((state_id IS NOT NULL)) + color text DEFAULT '#1068bf'::text, + CONSTRAINT check_57ee003890 CHECK ((state_id IS NOT NULL)), + CONSTRAINT check_ca608c40b3 CHECK ((char_length(color) <= 7)) ); CREATE SEQUENCE epics_id_seq @@ -14457,7 +15523,6 @@ CREATE SEQUENCE error_tracking_errors_id_seq ALTER SEQUENCE error_tracking_errors_id_seq OWNED BY error_tracking_errors.id; CREATE TABLE events ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, project_id integer, author_id integer NOT NULL, target_id integer, @@ -14759,7 +15824,6 @@ CREATE TABLE geo_event_log ( hashed_storage_migrated_event_id bigint, lfs_object_deleted_event_id bigint, hashed_storage_attachments_event_id bigint, - upload_deleted_event_id bigint, job_artifact_deleted_event_id bigint, reset_checksum_event_id bigint, cache_invalidation_event_id bigint, @@ -14834,7 +15898,6 @@ 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_convert_to_bigint integer DEFAULT 0 NOT NULL, file_path character varying NOT NULL, job_artifact_id bigint NOT NULL ); @@ -14891,9 +15954,6 @@ CREATE TABLE geo_node_statuses ( lfs_objects_count integer, lfs_objects_synced_count integer, lfs_objects_failed_count integer, - attachments_count integer, - attachments_synced_count integer, - attachments_failed_count integer, last_event_id integer, last_event_date timestamp without time zone, cursor_last_event_id integer, @@ -14918,7 +15978,6 @@ CREATE TABLE geo_node_statuses ( wikis_verification_failed_count integer, lfs_objects_synced_missing_on_primary_count integer, job_artifacts_synced_missing_on_primary_count integer, - attachments_synced_missing_on_primary_count integer, repositories_checksummed_count integer, repositories_checksum_failed_count integer, repositories_checksum_mismatch_count integer, @@ -15089,24 +16148,6 @@ CREATE SEQUENCE geo_reset_checksum_events_id_seq ALTER SEQUENCE geo_reset_checksum_events_id_seq OWNED BY geo_reset_checksum_events.id; -CREATE TABLE geo_upload_deleted_events ( - id bigint NOT NULL, - upload_id integer NOT NULL, - file_path character varying NOT NULL, - model_id integer NOT NULL, - model_type character varying NOT NULL, - uploader character varying NOT NULL -); - -CREATE SEQUENCE geo_upload_deleted_events_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE geo_upload_deleted_events_id_seq OWNED BY geo_upload_deleted_events.id; - CREATE TABLE gitlab_subscription_histories ( id bigint NOT NULL, gitlab_subscription_created_at timestamp with time zone, @@ -15654,6 +16695,35 @@ CREATE SEQUENCE incident_management_oncall_shifts_id_seq ALTER SEQUENCE incident_management_oncall_shifts_id_seq OWNED BY incident_management_oncall_shifts.id; +CREATE TABLE incident_management_timeline_events ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + occurred_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + author_id bigint, + issue_id bigint NOT NULL, + updated_by_user_id bigint, + promoted_from_note_id bigint, + cached_markdown_version integer, + editable boolean DEFAULT false NOT NULL, + note text NOT NULL, + note_html text NOT NULL, + action text NOT NULL, + CONSTRAINT check_18fd072206 CHECK ((char_length(action) <= 128)), + CONSTRAINT check_3875ed0aac CHECK ((char_length(note) <= 10000)), + CONSTRAINT check_94a235d6a4 CHECK ((char_length(note_html) <= 10000)) +); + +CREATE SEQUENCE incident_management_timeline_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_timeline_events_id_seq OWNED BY incident_management_timeline_events.id; + CREATE TABLE index_statuses ( id integer NOT NULL, project_id integer NOT NULL, @@ -15722,6 +16792,7 @@ CREATE TABLE integrations ( group_id bigint, vulnerability_events boolean DEFAULT false NOT NULL, type_new text, + archive_trace_events boolean DEFAULT false NOT NULL, CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255)) ); @@ -15825,6 +16896,23 @@ CREATE TABLE issue_assignees ( issue_id integer NOT NULL ); +CREATE TABLE issue_customer_relations_contacts ( + id bigint NOT NULL, + issue_id bigint NOT NULL, + contact_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE issue_customer_relations_contacts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_customer_relations_contacts_id_seq OWNED BY issue_customer_relations_contacts.id; + CREATE TABLE issue_email_participants ( id bigint NOT NULL, issue_id bigint NOT NULL, @@ -15843,6 +16931,22 @@ CREATE SEQUENCE issue_email_participants_id_seq ALTER SEQUENCE issue_email_participants_id_seq OWNED BY issue_email_participants.id; +CREATE TABLE issue_emails ( + id bigint NOT NULL, + issue_id bigint NOT NULL, + email_message_id text NOT NULL, + CONSTRAINT check_5abf3e6aea CHECK ((char_length(email_message_id) <= 1000)) +); + +CREATE SEQUENCE issue_emails_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_emails_id_seq OWNED BY issue_emails.id; + CREATE TABLE issue_links ( id integer NOT NULL, source_id integer NOT NULL, @@ -15990,7 +17094,7 @@ CREATE TABLE iterations_cadences ( group_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - start_date date NOT NULL, + start_date date, last_run_date date, duration_in_weeks integer, iterations_in_advance integer, @@ -16240,6 +17344,27 @@ CREATE SEQUENCE lfs_file_locks_id_seq ALTER SEQUENCE lfs_file_locks_id_seq OWNED BY lfs_file_locks.id; +CREATE TABLE lfs_object_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + lfs_object_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_efe45a8ab3 CHECK ((char_length(verification_failure) <= 255)) +); + +CREATE SEQUENCE lfs_object_states_lfs_object_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE lfs_object_states_lfs_object_id_seq OWNED BY lfs_object_states.lfs_object_id; + CREATE TABLE lfs_objects ( id integer NOT NULL, oid character varying NOT NULL, @@ -16343,6 +17468,24 @@ CREATE SEQUENCE lists_id_seq ALTER SEQUENCE lists_id_seq OWNED BY lists.id; +CREATE TABLE member_tasks ( + id bigint NOT NULL, + member_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, + tasks smallint[] DEFAULT '{}'::smallint[] NOT NULL +); + +CREATE SEQUENCE member_tasks_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE member_tasks_id_seq OWNED BY member_tasks.id; + CREATE TABLE members ( id integer NOT NULL, access_level integer NOT NULL, @@ -16361,7 +17504,8 @@ CREATE TABLE members ( expires_at date, ldap boolean DEFAULT false NOT NULL, override boolean DEFAULT false NOT NULL, - invite_email_success boolean DEFAULT true NOT NULL + invite_email_success boolean DEFAULT true NOT NULL, + state smallint DEFAULT 0 ); CREATE SEQUENCE members_id_seq @@ -16378,7 +17522,8 @@ CREATE TABLE merge_request_assignees ( id integer NOT NULL, user_id integer NOT NULL, merge_request_id integer NOT NULL, - created_at timestamp with time zone + created_at timestamp with time zone, + state smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE merge_request_assignees_id_seq @@ -16491,10 +17636,6 @@ CREATE TABLE merge_request_diff_commits ( merge_request_diff_id integer NOT NULL, relative_order integer NOT NULL, sha bytea NOT NULL, - author_name text, - author_email text, - committer_name text, - committer_email text, message text, trailers jsonb DEFAULT '{}'::jsonb NOT NULL, commit_author_id bigint, @@ -16704,6 +17845,22 @@ CREATE SEQUENCE merge_requests_closing_issues_id_seq ALTER SEQUENCE merge_requests_closing_issues_id_seq OWNED BY merge_requests_closing_issues.id; +CREATE TABLE merge_requests_compliance_violations ( + id bigint NOT NULL, + violating_user_id bigint NOT NULL, + merge_request_id bigint NOT NULL, + reason smallint NOT NULL +); + +CREATE SEQUENCE merge_requests_compliance_violations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_requests_compliance_violations_id_seq OWNED BY merge_requests_compliance_violations.id; + CREATE SEQUENCE merge_requests_id_seq AS integer START WITH 1 @@ -16925,7 +18082,7 @@ CREATE TABLE namespaces ( owner_id integer, created_at timestamp without time zone, updated_at timestamp without time zone, - type character varying, + type character varying DEFAULT 'User'::character varying NOT NULL, description character varying DEFAULT ''::character varying NOT NULL, avatar character varying, share_with_group_lock boolean DEFAULT false, @@ -16967,7 +18124,7 @@ CREATE TABLE namespaces ( shared_runners_enabled boolean DEFAULT true NOT NULL, allow_descendants_override_disabled_shared_runners boolean DEFAULT false NOT NULL, traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL, - delayed_project_removal boolean DEFAULT false NOT NULL + tmp_project_id integer ); CREATE SEQUENCE namespaces_id_seq @@ -16980,6 +18137,20 @@ CREATE SEQUENCE namespaces_id_seq ALTER SEQUENCE namespaces_id_seq OWNED BY namespaces.id; +CREATE TABLE namespaces_sync_events ( + id bigint NOT NULL, + namespace_id bigint NOT NULL +); + +CREATE SEQUENCE namespaces_sync_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE namespaces_sync_events_id_seq OWNED BY namespaces_sync_events.id; + CREATE TABLE note_diff_files ( id integer NOT NULL, diff_note_id integer NOT NULL, @@ -17144,7 +18315,8 @@ CREATE TABLE oauth_applications ( owner_id integer, owner_type character varying, trusted boolean DEFAULT false NOT NULL, - confidential boolean DEFAULT true NOT NULL + confidential boolean DEFAULT true NOT NULL, + expire_access_tokens boolean DEFAULT false NOT NULL ); CREATE SEQUENCE oauth_applications_id_seq @@ -17204,30 +18376,6 @@ CREATE SEQUENCE onboarding_progresses_id_seq ALTER SEQUENCE onboarding_progresses_id_seq OWNED BY onboarding_progresses.id; -CREATE TABLE open_project_tracker_data ( - id bigint NOT NULL, - service_id integer NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - encrypted_url character varying(255), - encrypted_url_iv character varying(255), - encrypted_api_url character varying(255), - encrypted_api_url_iv character varying(255), - encrypted_token character varying(255), - encrypted_token_iv character varying(255), - closed_status_id character varying(5), - project_identifier_code character varying(100) -); - -CREATE SEQUENCE open_project_tracker_data_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE open_project_tracker_data_id_seq OWNED BY open_project_tracker_data.id; - CREATE TABLE operations_feature_flag_scopes ( id bigint NOT NULL, feature_flag_id bigint NOT NULL, @@ -17777,7 +18925,7 @@ CREATE TABLE packages_helm_file_metadata ( package_file_id bigint NOT NULL, channel text NOT NULL, metadata jsonb, - CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63)) + CONSTRAINT check_06e8d100af CHECK ((char_length(channel) <= 255)) ); CREATE TABLE packages_maven_metadata ( @@ -17800,6 +18948,12 @@ CREATE SEQUENCE packages_maven_metadata_id_seq ALTER SEQUENCE packages_maven_metadata_id_seq OWNED BY packages_maven_metadata.id; +CREATE TABLE packages_npm_metadata ( + package_id bigint NOT NULL, + package_json jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT chk_rails_e5cbc301ae CHECK ((char_length((package_json)::text) < 20000)) +); + CREATE TABLE packages_nuget_dependency_link_metadata ( dependency_link_id bigint NOT NULL, target_framework text NOT NULL, @@ -17959,6 +19113,27 @@ CREATE SEQUENCE packages_tags_id_seq ALTER SEQUENCE packages_tags_id_seq OWNED BY packages_tags.id; +CREATE TABLE pages_deployment_states ( + pages_deployment_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_15217e8c3a CHECK ((char_length(verification_failure) <= 255)) +); + +CREATE SEQUENCE pages_deployment_states_pages_deployment_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pages_deployment_states_pages_deployment_id_seq OWNED BY pages_deployment_states.pages_deployment_id; + CREATE TABLE pages_deployments ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18169,7 +19344,12 @@ CREATE TABLE plan_limits ( 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 + ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL, + dast_profile_schedules integer DEFAULT 1 NOT NULL, + external_audit_event_destinations integer DEFAULT 5 NOT NULL, + dotenv_variables integer DEFAULT 20 NOT NULL, + dotenv_size integer DEFAULT 5120 NOT NULL, + pipeline_triggers integer DEFAULT 25000 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -18379,7 +19559,7 @@ CREATE VIEW postgres_indexes AS 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_indexes ON (((i.relname = pg_indexes.indexname) AND (pg_namespace.nspname = pg_indexes.schemaname)))) 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]))); @@ -18446,6 +19626,24 @@ CREATE SEQUENCE postgres_reindex_actions_id_seq ALTER SEQUENCE postgres_reindex_actions_id_seq OWNED BY postgres_reindex_actions.id; +CREATE TABLE postgres_reindex_queued_actions ( + id bigint NOT NULL, + index_identifier text NOT NULL, + state smallint DEFAULT 0 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + updated_at timestamp with time zone DEFAULT now() NOT NULL, + CONSTRAINT check_e4b01395c0 CHECK ((char_length(index_identifier) <= 255)) +); + +CREATE SEQUENCE postgres_reindex_queued_actions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE postgres_reindex_queued_actions_id_seq OWNED BY postgres_reindex_queued_actions.id; + CREATE TABLE programming_languages ( id integer NOT NULL, name character varying NOT NULL, @@ -18527,7 +19725,7 @@ CREATE TABLE project_ci_cd_settings ( auto_rollback_enabled boolean DEFAULT false NOT NULL, keep_latest_artifact boolean DEFAULT true NOT NULL, restrict_user_defined_variables boolean DEFAULT false NOT NULL, - job_token_scope_enabled boolean DEFAULT true NOT NULL + job_token_scope_enabled boolean DEFAULT false NOT NULL ); CREATE SEQUENCE project_ci_cd_settings_id_seq @@ -18631,7 +19829,7 @@ CREATE TABLE project_error_tracking_settings ( encrypted_token_iv character varying, project_name character varying, organization_name character varying, - integrated boolean DEFAULT false NOT NULL + integrated boolean DEFAULT true NOT NULL ); CREATE TABLE project_export_jobs ( @@ -18876,7 +20074,13 @@ CREATE TABLE project_settings ( prevent_merge_without_jira_issue 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)) + warn_about_potentially_unwanted_characters boolean DEFAULT true NOT NULL, + merge_commit_template text, + has_shimo boolean DEFAULT false NOT NULL, + squash_commit_template text, + CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)), + CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)), + CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)) ); CREATE TABLE project_statistics ( @@ -18969,7 +20173,6 @@ CREATE TABLE projects ( public_builds boolean DEFAULT true NOT NULL, last_repository_check_failed boolean, last_repository_check_at timestamp without time zone, - container_registry_enabled boolean, only_allow_merge_if_pipeline_succeeds boolean DEFAULT false NOT NULL, has_external_issue_tracker boolean, repository_storage character varying DEFAULT 'default'::character varying NOT NULL, @@ -19037,6 +20240,20 @@ CREATE SEQUENCE projects_id_seq ALTER SEQUENCE projects_id_seq OWNED BY projects.id; +CREATE TABLE projects_sync_events ( + id bigint NOT NULL, + project_id bigint NOT NULL +); + +CREATE SEQUENCE projects_sync_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE projects_sync_events_id_seq OWNED BY projects_sync_events.id; + CREATE TABLE prometheus_alert_events ( id bigint NOT NULL, project_id integer NOT NULL, @@ -19212,6 +20429,7 @@ CREATE TABLE protected_environments ( updated_at timestamp with time zone NOT NULL, name character varying NOT NULL, group_id bigint, + required_approval_count integer DEFAULT 0 NOT NULL, CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))) ); @@ -19265,7 +20483,6 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id; CREATE TABLE push_event_payloads ( commit_count bigint NOT NULL, - event_id_convert_to_bigint integer DEFAULT 0 NOT NULL, action smallint NOT NULL, ref_type smallint NOT NULL, commit_from bytea, @@ -19477,8 +20694,7 @@ CREATE TABLE requirements_management_test_reports ( author_id bigint, state smallint NOT NULL, build_id bigint, - issue_id bigint, - CONSTRAINT requirements_test_reports_requirement_id_xor_issue_id CHECK ((num_nonnulls(requirement_id, issue_id) = 1)) + issue_id bigint ); CREATE SEQUENCE requirements_management_test_reports_id_seq @@ -19785,7 +21001,9 @@ CREATE TABLE security_scans ( scan_type smallint NOT NULL, info jsonb DEFAULT '{}'::jsonb NOT NULL, project_id bigint, - pipeline_id bigint + pipeline_id bigint, + latest boolean DEFAULT true NOT NULL, + status smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE security_scans_id_seq @@ -20098,6 +21316,7 @@ CREATE TABLE sprints ( description_html text, state_enum smallint DEFAULT 1 NOT NULL, iterations_cadence_id integer, + sequence integer, CONSTRAINT sprints_must_belong_to_project_or_group CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))), CONSTRAINT sprints_title CHECK ((char_length(title) <= 255)) ); @@ -20231,9 +21450,7 @@ CREATE SEQUENCE system_note_metadata_id_seq ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id; CREATE TABLE taggings ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, tag_id integer, - taggable_id_convert_to_bigint integer, taggable_type character varying, tagger_id integer, tagger_type character varying, @@ -20415,6 +21632,11 @@ CREATE TABLE topics ( name text NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, + avatar text, + description text, + total_projects_count bigint DEFAULT 0 NOT NULL, + CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)), + CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)), CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255)) ); @@ -20482,6 +21704,27 @@ CREATE SEQUENCE upcoming_reconciliations_id_seq ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id; +CREATE TABLE upload_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + upload_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_7396dc8591 CHECK ((char_length(verification_failure) <= 255)) +); + +CREATE SEQUENCE upload_states_upload_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE upload_states_upload_id_seq OWNED BY upload_states.upload_id; + CREATE TABLE uploads ( id integer NOT NULL, size bigint NOT NULL, @@ -20564,7 +21807,14 @@ ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id; CREATE TABLE user_credit_card_validations ( user_id bigint NOT NULL, - credit_card_validated_at timestamp with time zone NOT NULL + credit_card_validated_at timestamp with time zone NOT NULL, + expiration_date date, + last_digits smallint, + holder_name text, + network text, + CONSTRAINT check_1765e2b30f CHECK ((char_length(network) <= 32)), + CONSTRAINT check_3eea080c91 CHECK (((last_digits >= 0) AND (last_digits <= 9999))), + CONSTRAINT check_eafe45d88b CHECK ((char_length(holder_name) <= 26)) ); CREATE TABLE user_custom_attributes ( @@ -20591,18 +21841,21 @@ CREATE TABLE user_details ( job_title character varying(200) DEFAULT ''::character varying NOT NULL, bio character varying(255) DEFAULT ''::character varying NOT NULL, webauthn_xid text, - bio_html text, - cached_markdown_version integer, provisioned_by_group_id bigint, other_role text, pronouns text, pronunciation text, + registration_objective smallint, + phone text, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), + CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)), 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)) ); +COMMENT ON COLUMN user_details.phone IS 'JiHu-specific column'; + CREATE SEQUENCE user_details_user_id_seq START WITH 1 INCREMENT BY 1 @@ -20789,7 +22042,7 @@ CREATE TABLE users ( encrypted_otp_secret_salt character varying, otp_required_for_login boolean DEFAULT false NOT NULL, otp_backup_codes text, - public_email character varying DEFAULT ''::character varying NOT NULL, + public_email character varying, dashboard integer DEFAULT 0, project_view integer DEFAULT 0, consumed_timestep integer, @@ -20825,7 +22078,9 @@ CREATE TABLE users ( first_name character varying(255), last_name character varying(255), role smallint, - user_type smallint + user_type smallint, + static_object_token_encrypted text, + CONSTRAINT check_7bde697e8e CHECK ((char_length(static_object_token_encrypted) <= 255)) ); CREATE SEQUENCE users_id_seq @@ -20889,7 +22144,8 @@ CREATE TABLE users_statistics ( with_highest_role_maintainer integer DEFAULT 0 NOT NULL, with_highest_role_owner integer DEFAULT 0 NOT NULL, bots integer DEFAULT 0 NOT NULL, - blocked integer DEFAULT 0 NOT NULL + blocked integer DEFAULT 0 NOT NULL, + with_highest_role_minimal_access integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE users_statistics_id_seq @@ -21155,6 +22411,7 @@ CREATE TABLE vulnerability_finding_evidences ( updated_at timestamp with time zone NOT NULL, vulnerability_occurrence_id bigint NOT NULL, summary text, + data jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) ); @@ -21365,6 +22622,7 @@ CREATE TABLE vulnerability_occurrences ( cve text, location jsonb, detection_method smallint DEFAULT 0 NOT NULL, + migrated_to_new_structure boolean DEFAULT false 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)), @@ -21380,6 +22638,30 @@ CREATE SEQUENCE vulnerability_occurrences_id_seq ALTER SEQUENCE vulnerability_occurrences_id_seq OWNED BY vulnerability_occurrences.id; +CREATE TABLE vulnerability_reads ( + id bigint NOT NULL, + vulnerability_id bigint NOT NULL, + project_id bigint NOT NULL, + scanner_id bigint NOT NULL, + report_type smallint NOT NULL, + severity smallint NOT NULL, + state smallint NOT NULL, + has_issues boolean DEFAULT false NOT NULL, + resolved_on_default_branch boolean DEFAULT false NOT NULL, + uuid uuid NOT NULL, + location_image text, + CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)) +); + +CREATE SEQUENCE vulnerability_reads_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_reads_id_seq OWNED BY vulnerability_reads.id; + CREATE TABLE vulnerability_remediations ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -21698,8 +22980,12 @@ 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_activity_events ALTER COLUMN id SET DEFAULT nextval('agent_activity_events_id_seq'::regclass); + ALTER TABLE ONLY agent_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_group_authorizations_id_seq'::regclass); +ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_project_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); @@ -21768,6 +23054,8 @@ ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval(' ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass); + ALTER TABLE ONLY batched_background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_jobs_id_seq'::regclass); ALTER TABLE ONLY batched_background_migrations ALTER COLUMN id SET DEFAULT nextval('batched_background_migrations_id_seq'::regclass); @@ -21842,6 +23130,8 @@ ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_grou ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_instance_variables_id_seq'::regclass); +ALTER TABLE ONLY ci_job_artifact_states ALTER COLUMN job_artifact_id SET DEFAULT nextval('ci_job_artifact_states_job_artifact_id_seq'::regclass); + ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_artifacts_id_seq'::regclass); ALTER TABLE ONLY ci_job_token_project_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_project_scope_links_id_seq'::regclass); @@ -21850,6 +23140,8 @@ ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_va ALTER TABLE ONLY ci_minutes_additional_packs ALTER COLUMN id SET DEFAULT nextval('ci_minutes_additional_packs_id_seq'::regclass); +ALTER TABLE ONLY ci_namespace_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_namespace_mirrors_id_seq'::regclass); + ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass); ALTER TABLE ONLY ci_pending_builds ALTER COLUMN id SET DEFAULT nextval('ci_pending_builds_id_seq'::regclass); @@ -21872,6 +23164,8 @@ ALTER TABLE ONLY ci_pipelines_config ALTER COLUMN pipeline_id SET DEFAULT nextva ALTER TABLE ONLY ci_platform_metrics ALTER COLUMN id SET DEFAULT nextval('ci_platform_metrics_id_seq'::regclass); +ALTER TABLE ONLY ci_project_mirrors ALTER COLUMN id SET DEFAULT nextval('ci_project_mirrors_id_seq'::regclass); + ALTER TABLE ONLY ci_project_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_project_monthly_usages_id_seq'::regclass); ALTER TABLE ONLY ci_refs ALTER COLUMN id SET DEFAULT nextval('ci_refs_id_seq'::regclass); @@ -21950,8 +23244,12 @@ ALTER TABLE ONLY compliance_management_frameworks ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('container_repositories_id_seq'::regclass); +ALTER TABLE ONLY content_blocked_states ALTER COLUMN id SET DEFAULT nextval('content_blocked_states_id_seq'::regclass); + ALTER TABLE ONLY conversational_development_index_metrics ALTER COLUMN id SET DEFAULT nextval('conversational_development_index_metrics_id_seq'::regclass); +ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER COLUMN id SET DEFAULT nextval('coverage_fuzzing_corpuses_id_seq'::regclass); + ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issue_imports_id_seq'::regclass); ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass); @@ -21976,8 +23274,6 @@ 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); @@ -21988,6 +23284,8 @@ ALTER TABLE ONLY deploy_keys_projects ALTER COLUMN id SET DEFAULT nextval('deplo ALTER TABLE ONLY deploy_tokens ALTER COLUMN id SET DEFAULT nextval('deploy_tokens_id_seq'::regclass); +ALTER TABLE ONLY deployment_approvals ALTER COLUMN id SET DEFAULT nextval('deployment_approvals_id_seq'::regclass); + ALTER TABLE ONLY deployments ALTER COLUMN id SET DEFAULT nextval('deployments_id_seq'::regclass); ALTER TABLE ONLY description_versions ALTER COLUMN id SET DEFAULT nextval('description_versions_id_seq'::regclass); @@ -22096,8 +23394,6 @@ ALTER TABLE ONLY geo_repository_updated_events ALTER COLUMN id SET DEFAULT nextv ALTER TABLE ONLY geo_reset_checksum_events ALTER COLUMN id SET DEFAULT nextval('geo_reset_checksum_events_id_seq'::regclass); -ALTER TABLE ONLY geo_upload_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_upload_deleted_events_id_seq'::regclass); - ALTER TABLE ONLY gitlab_subscription_histories ALTER COLUMN id SET DEFAULT nextval('gitlab_subscription_histories_id_seq'::regclass); ALTER TABLE ONLY gitlab_subscriptions ALTER COLUMN id SET DEFAULT nextval('gitlab_subscriptions_id_seq'::regclass); @@ -22152,6 +23448,8 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id S 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 incident_management_timeline_events ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_events_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); @@ -22168,8 +23466,12 @@ ALTER TABLE ONLY issuable_severities ALTER COLUMN id SET DEFAULT nextval('issuab ALTER TABLE ONLY issuable_slas ALTER COLUMN id SET DEFAULT nextval('issuable_slas_id_seq'::regclass); +ALTER TABLE ONLY issue_customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('issue_customer_relations_contacts_id_seq'::regclass); + ALTER TABLE ONLY issue_email_participants ALTER COLUMN id SET DEFAULT nextval('issue_email_participants_id_seq'::regclass); +ALTER TABLE ONLY issue_emails ALTER COLUMN id SET DEFAULT nextval('issue_emails_id_seq'::regclass); + ALTER TABLE ONLY issue_links ALTER COLUMN id SET DEFAULT nextval('issue_links_id_seq'::regclass); ALTER TABLE ONLY issue_metrics ALTER COLUMN id SET DEFAULT nextval('issue_metrics_id_seq'::regclass); @@ -22202,6 +23504,8 @@ ALTER TABLE ONLY ldap_group_links ALTER COLUMN id SET DEFAULT nextval('ldap_grou ALTER TABLE ONLY lfs_file_locks ALTER COLUMN id SET DEFAULT nextval('lfs_file_locks_id_seq'::regclass); +ALTER TABLE ONLY lfs_object_states ALTER COLUMN lfs_object_id SET DEFAULT nextval('lfs_object_states_lfs_object_id_seq'::regclass); + ALTER TABLE ONLY lfs_objects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_id_seq'::regclass); ALTER TABLE ONLY lfs_objects_projects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_projects_id_seq'::regclass); @@ -22212,6 +23516,10 @@ ALTER TABLE ONLY list_user_preferences ALTER COLUMN id SET DEFAULT nextval('list ALTER TABLE ONLY lists ALTER COLUMN id SET DEFAULT nextval('lists_id_seq'::regclass); +ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER COLUMN id SET DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass); + +ALTER TABLE ONLY member_tasks ALTER COLUMN id SET DEFAULT nextval('member_tasks_id_seq'::regclass); + ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::regclass); ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass); @@ -22238,6 +23546,8 @@ ALTER TABLE ONLY merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_reque ALTER TABLE ONLY merge_requests_closing_issues ALTER COLUMN id SET DEFAULT nextval('merge_requests_closing_issues_id_seq'::regclass); +ALTER TABLE ONLY merge_requests_compliance_violations ALTER COLUMN id SET DEFAULT nextval('merge_requests_compliance_violations_id_seq'::regclass); + ALTER TABLE ONLY merge_trains ALTER COLUMN id SET DEFAULT nextval('merge_trains_id_seq'::regclass); ALTER TABLE ONLY metrics_dashboard_annotations ALTER COLUMN id SET DEFAULT nextval('metrics_dashboard_annotations_id_seq'::regclass); @@ -22256,6 +23566,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_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); ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); @@ -22272,8 +23584,6 @@ ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oaut ALTER TABLE ONLY onboarding_progresses ALTER COLUMN id SET DEFAULT nextval('onboarding_progresses_id_seq'::regclass); -ALTER TABLE ONLY open_project_tracker_data ALTER COLUMN id SET DEFAULT nextval('open_project_tracker_data_id_seq'::regclass); - ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass); ALTER TABLE ONLY operations_feature_flags ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_id_seq'::regclass); @@ -22336,6 +23646,8 @@ ALTER TABLE ONLY packages_packages ALTER COLUMN id SET DEFAULT nextval('packages ALTER TABLE ONLY packages_tags ALTER COLUMN id SET DEFAULT nextval('packages_tags_id_seq'::regclass); +ALTER TABLE ONLY pages_deployment_states ALTER COLUMN pages_deployment_id SET DEFAULT nextval('pages_deployment_states_pages_deployment_id_seq'::regclass); + ALTER TABLE ONLY pages_deployments ALTER COLUMN id SET DEFAULT nextval('pages_deployments_id_seq'::regclass); ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('pages_domain_acme_orders_id_seq'::regclass); @@ -22358,6 +23670,8 @@ ALTER TABLE ONLY postgres_async_indexes ALTER COLUMN id SET DEFAULT nextval('pos ALTER TABLE ONLY postgres_reindex_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_actions_id_seq'::regclass); +ALTER TABLE ONLY postgres_reindex_queued_actions ALTER COLUMN id SET DEFAULT nextval('postgres_reindex_queued_actions_id_seq'::regclass); + ALTER TABLE ONLY product_analytics_events_experimental ALTER COLUMN id SET DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass); ALTER TABLE ONLY programming_languages ALTER COLUMN id SET DEFAULT nextval('programming_languages_id_seq'::regclass); @@ -22404,6 +23718,8 @@ ALTER TABLE ONLY project_tracing_settings ALTER COLUMN id SET DEFAULT nextval('p ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass); +ALTER TABLE ONLY projects_sync_events ALTER COLUMN id SET DEFAULT nextval('projects_sync_events_id_seq'::regclass); + ALTER TABLE ONLY prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('prometheus_alert_events_id_seq'::regclass); ALTER TABLE ONLY prometheus_alerts ALTER COLUMN id SET DEFAULT nextval('prometheus_alerts_id_seq'::regclass); @@ -22536,6 +23852,8 @@ ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_regi ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass); +ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('upload_states_upload_id_seq'::regclass); + ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass); @@ -22608,6 +23926,8 @@ ALTER TABLE ONLY vulnerability_occurrence_pipelines ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY vulnerability_occurrences ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrences_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_reads ALTER COLUMN id SET DEFAULT nextval('vulnerability_reads_id_seq'::regclass); + ALTER TABLE ONLY vulnerability_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_remediations_id_seq'::regclass); ALTER TABLE ONLY vulnerability_scanners ALTER COLUMN id SET DEFAULT nextval('vulnerability_scanners_id_seq'::regclass); @@ -22668,8 +23988,38 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306 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.audit_events_202308 + ADD CONSTRAINT audit_events_202308_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202309 + ADD CONSTRAINT audit_events_202309_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY batched_background_migration_job_transition_logs + ADD CONSTRAINT batched_background_migration_job_transition_logs_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 + ADD CONSTRAINT batched_background_migration_job_transition_logs_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202306_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202307_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202308_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 + ADD CONSTRAINT batched_background_migration_job_transition_logs_202309_pkey PRIMARY KEY (id, created_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); @@ -22677,6 +24027,9 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_esc 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 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_202301 ADD CONSTRAINT incident_management_pending_alert_escalations_202301_pkey PRIMARY KEY (id, process_at); @@ -22698,8 +24051,11 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_esc 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_alert_escalations_202308 + ADD CONSTRAINT incident_management_pending_alert_escalations_202308_pkey PRIMARY KEY (id, process_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 + ADD CONSTRAINT incident_management_pending_alert_escalations_202309_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); @@ -22707,6 +24063,9 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc 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 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_202301 ADD CONSTRAINT incident_management_pending_issue_escalations_202301_pkey PRIMARY KEY (id, process_at); @@ -22728,33 +24087,48 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc 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.incident_management_pending_issue_escalations_202308 + ADD CONSTRAINT incident_management_pending_issue_escalations_202308_pkey PRIMARY KEY (id, process_at); -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.incident_management_pending_issue_escalations_202309 + ADD CONSTRAINT incident_management_pending_issue_escalations_202309_pkey PRIMARY KEY (id, process_at); -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 verification_codes + ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); -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.verification_codes_000000 + ADD CONSTRAINT verification_codes_000000_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); -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.verification_codes_202302 + ADD CONSTRAINT verification_codes_202302_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); -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.verification_codes_202303 + ADD CONSTRAINT verification_codes_202303_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); -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 gitlab_partitions_dynamic.verification_codes_202304 + ADD CONSTRAINT verification_codes_202304_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); -ALTER TABLE ONLY web_hook_logs - ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at); +ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202305 + ADD CONSTRAINT verification_codes_202305_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); + +ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202306 + ADD CONSTRAINT verification_codes_202306_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); + +ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202307 + ADD CONSTRAINT verification_codes_202307_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); + +ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202308 + ADD CONSTRAINT verification_codes_202308_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); + +ALTER TABLE ONLY gitlab_partitions_dynamic.verification_codes_202309 + ADD CONSTRAINT verification_codes_202309_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000 ADD CONSTRAINT web_hook_logs_000000_pkey PRIMARY KEY (id, created_at); +ALTER TABLE ONLY web_hook_logs + ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at); + ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202212 ADD CONSTRAINT web_hook_logs_202212_pkey PRIMARY KEY (id, created_at); @@ -22779,6 +24153,12 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306 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 gitlab_partitions_dynamic.web_hook_logs_202308 + ADD CONSTRAINT web_hook_logs_202308_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202309 + ADD CONSTRAINT web_hook_logs_202309_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); @@ -22977,6 +24357,207 @@ ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_reques 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 issue_search_data + ADD CONSTRAINT issue_search_data_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_00 + ADD CONSTRAINT issue_search_data_00_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_01 + ADD CONSTRAINT issue_search_data_01_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_02 + ADD CONSTRAINT issue_search_data_02_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_03 + ADD CONSTRAINT issue_search_data_03_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_04 + ADD CONSTRAINT issue_search_data_04_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_05 + ADD CONSTRAINT issue_search_data_05_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_06 + ADD CONSTRAINT issue_search_data_06_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_07 + ADD CONSTRAINT issue_search_data_07_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_08 + ADD CONSTRAINT issue_search_data_08_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_09 + ADD CONSTRAINT issue_search_data_09_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_10 + ADD CONSTRAINT issue_search_data_10_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_11 + ADD CONSTRAINT issue_search_data_11_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_12 + ADD CONSTRAINT issue_search_data_12_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_13 + ADD CONSTRAINT issue_search_data_13_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_14 + ADD CONSTRAINT issue_search_data_14_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_15 + ADD CONSTRAINT issue_search_data_15_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_16 + ADD CONSTRAINT issue_search_data_16_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_17 + ADD CONSTRAINT issue_search_data_17_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_18 + ADD CONSTRAINT issue_search_data_18_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_19 + ADD CONSTRAINT issue_search_data_19_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_20 + ADD CONSTRAINT issue_search_data_20_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_21 + ADD CONSTRAINT issue_search_data_21_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_22 + ADD CONSTRAINT issue_search_data_22_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_23 + ADD CONSTRAINT issue_search_data_23_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_24 + ADD CONSTRAINT issue_search_data_24_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_25 + ADD CONSTRAINT issue_search_data_25_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_26 + ADD CONSTRAINT issue_search_data_26_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_27 + ADD CONSTRAINT issue_search_data_27_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_28 + ADD CONSTRAINT issue_search_data_28_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_29 + ADD CONSTRAINT issue_search_data_29_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_30 + ADD CONSTRAINT issue_search_data_30_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_31 + ADD CONSTRAINT issue_search_data_31_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_32 + ADD CONSTRAINT issue_search_data_32_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_33 + ADD CONSTRAINT issue_search_data_33_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_34 + ADD CONSTRAINT issue_search_data_34_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_35 + ADD CONSTRAINT issue_search_data_35_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_36 + ADD CONSTRAINT issue_search_data_36_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_37 + ADD CONSTRAINT issue_search_data_37_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_38 + ADD CONSTRAINT issue_search_data_38_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_39 + ADD CONSTRAINT issue_search_data_39_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_40 + ADD CONSTRAINT issue_search_data_40_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_41 + ADD CONSTRAINT issue_search_data_41_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_42 + ADD CONSTRAINT issue_search_data_42_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_43 + ADD CONSTRAINT issue_search_data_43_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_44 + ADD CONSTRAINT issue_search_data_44_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_45 + ADD CONSTRAINT issue_search_data_45_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_46 + ADD CONSTRAINT issue_search_data_46_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_47 + ADD CONSTRAINT issue_search_data_47_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_48 + ADD CONSTRAINT issue_search_data_48_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_49 + ADD CONSTRAINT issue_search_data_49_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_50 + ADD CONSTRAINT issue_search_data_50_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_51 + ADD CONSTRAINT issue_search_data_51_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_52 + ADD CONSTRAINT issue_search_data_52_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_53 + ADD CONSTRAINT issue_search_data_53_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_54 + ADD CONSTRAINT issue_search_data_54_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_55 + ADD CONSTRAINT issue_search_data_55_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_56 + ADD CONSTRAINT issue_search_data_56_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_57 + ADD CONSTRAINT issue_search_data_57_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_58 + ADD CONSTRAINT issue_search_data_58_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_59 + ADD CONSTRAINT issue_search_data_59_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_60 + ADD CONSTRAINT issue_search_data_60_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_61 + ADD CONSTRAINT issue_search_data_61_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62 + ADD CONSTRAINT issue_search_data_62_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_63 + ADD CONSTRAINT issue_search_data_63_pkey PRIMARY KEY (project_id, issue_id); + +ALTER TABLE ONLY loose_foreign_keys_deleted_records + ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id); + +ALTER TABLE ONLY gitlab_partitions_static.loose_foreign_keys_deleted_records_1 + ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -23175,9 +24756,15 @@ 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_activity_events + ADD CONSTRAINT agent_activity_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY agent_group_authorizations ADD CONSTRAINT agent_group_authorizations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY agent_project_authorizations + ADD CONSTRAINT agent_project_authorizations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY alert_management_alert_assignees ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id); @@ -23367,6 +24954,9 @@ ALTER TABLE ONLY chat_teams ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; +ALTER TABLE security_findings + ADD CONSTRAINT check_6c2851a8c9 CHECK ((uuid IS NOT NULL)) NOT VALID; + ALTER TABLE sprints ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID; @@ -23391,9 +24981,6 @@ ALTER TABLE ONLY ci_build_trace_chunks ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT ci_build_trace_metadata_pkey PRIMARY KEY (build_id); -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 ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id); @@ -23418,6 +25005,9 @@ ALTER TABLE ONLY ci_group_variables ALTER TABLE ONLY ci_instance_variables ADD CONSTRAINT ci_instance_variables_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_job_artifact_states + ADD CONSTRAINT ci_job_artifact_states_pkey PRIMARY KEY (job_artifact_id); + ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id); @@ -23430,6 +25020,9 @@ ALTER TABLE ONLY ci_job_variables ALTER TABLE ONLY ci_minutes_additional_packs ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_namespace_mirrors + ADD CONSTRAINT ci_namespace_mirrors_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_namespace_monthly_usages ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id); @@ -23463,6 +25056,9 @@ ALTER TABLE ONLY ci_pipelines ALTER TABLE ONLY ci_platform_metrics ADD CONSTRAINT ci_platform_metrics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_project_mirrors + ADD CONSTRAINT ci_project_mirrors_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_project_monthly_usages ADD CONSTRAINT ci_project_monthly_usages_pkey PRIMARY KEY (id); @@ -23589,9 +25185,15 @@ ALTER TABLE ONLY container_expiration_policies ALTER TABLE ONLY container_repositories ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id); +ALTER TABLE ONLY content_blocked_states + ADD CONSTRAINT content_blocked_states_pkey PRIMARY KEY (id); + ALTER TABLE ONLY conversational_development_index_metrics ADD CONSTRAINT conversational_development_index_metrics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT coverage_fuzzing_corpuses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY csv_issue_imports ADD CONSTRAINT csv_issue_imports_pkey PRIMARY KEY (id); @@ -23640,9 +25242,6 @@ 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); @@ -23661,6 +25260,9 @@ ALTER TABLE ONLY deploy_keys_projects ALTER TABLE ONLY deploy_tokens ADD CONSTRAINT deploy_tokens_pkey PRIMARY KEY (id); +ALTER TABLE ONLY deployment_approvals + ADD CONSTRAINT deployment_approvals_pkey PRIMARY KEY (id); + ALTER TABLE ONLY deployment_clusters ADD CONSTRAINT deployment_clusters_pkey PRIMARY KEY (deployment_id); @@ -23835,9 +25437,6 @@ ALTER TABLE ONLY geo_repository_updated_events ALTER TABLE ONLY geo_reset_checksum_events ADD CONSTRAINT geo_reset_checksum_events_pkey PRIMARY KEY (id); -ALTER TABLE ONLY geo_upload_deleted_events - ADD CONSTRAINT geo_upload_deleted_events_pkey PRIMARY KEY (id); - ALTER TABLE ONLY gitlab_subscription_histories ADD CONSTRAINT gitlab_subscription_histories_pkey PRIMARY KEY (id); @@ -23925,6 +25524,9 @@ ALTER TABLE ONLY incident_management_oncall_schedules ALTER TABLE ONLY incident_management_oncall_shifts ADD CONSTRAINT incident_management_oncall_shifts_pkey PRIMARY KEY (id); +ALTER TABLE ONLY incident_management_timeline_events + ADD CONSTRAINT incident_management_timeline_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY index_statuses ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id); @@ -23952,9 +25554,15 @@ ALTER TABLE ONLY issuable_slas ALTER TABLE ONLY issue_assignees ADD CONSTRAINT issue_assignees_pkey PRIMARY KEY (issue_id, user_id); +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT issue_customer_relations_contacts_pkey PRIMARY KEY (id); + ALTER TABLE ONLY issue_email_participants ADD CONSTRAINT issue_email_participants_pkey PRIMARY KEY (id); +ALTER TABLE ONLY issue_emails + ADD CONSTRAINT issue_emails_pkey PRIMARY KEY (id); + ALTER TABLE ONLY issue_links ADD CONSTRAINT issue_links_pkey PRIMARY KEY (id); @@ -24015,6 +25623,9 @@ ALTER TABLE ONLY ldap_group_links ALTER TABLE ONLY lfs_file_locks ADD CONSTRAINT lfs_file_locks_pkey PRIMARY KEY (id); +ALTER TABLE ONLY lfs_object_states + ADD CONSTRAINT lfs_object_states_pkey PRIMARY KEY (lfs_object_id); + ALTER TABLE ONLY lfs_objects ADD CONSTRAINT lfs_objects_pkey PRIMARY KEY (id); @@ -24030,6 +25641,9 @@ ALTER TABLE ONLY list_user_preferences ALTER TABLE ONLY lists ADD CONSTRAINT lists_pkey PRIMARY KEY (id); +ALTER TABLE ONLY member_tasks + ADD CONSTRAINT member_tasks_pkey PRIMARY KEY (id); + ALTER TABLE ONLY members ADD CONSTRAINT members_pkey PRIMARY KEY (id); @@ -24075,6 +25689,9 @@ ALTER TABLE ONLY merge_request_user_mentions ALTER TABLE ONLY merge_requests_closing_issues ADD CONSTRAINT merge_requests_closing_issues_pkey PRIMARY KEY (id); +ALTER TABLE ONLY merge_requests_compliance_violations + ADD CONSTRAINT merge_requests_compliance_violations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_requests ADD CONSTRAINT merge_requests_pkey PRIMARY KEY (id); @@ -24117,6 +25734,9 @@ ALTER TABLE ONLY namespace_statistics ALTER TABLE ONLY namespaces ADD CONSTRAINT namespaces_pkey PRIMARY KEY (id); +ALTER TABLE ONLY namespaces_sync_events + ADD CONSTRAINT namespaces_sync_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY note_diff_files ADD CONSTRAINT note_diff_files_pkey PRIMARY KEY (id); @@ -24141,9 +25761,6 @@ ALTER TABLE ONLY oauth_openid_requests ALTER TABLE ONLY onboarding_progresses ADD CONSTRAINT onboarding_progresses_pkey PRIMARY KEY (id); -ALTER TABLE ONLY open_project_tracker_data - ADD CONSTRAINT open_project_tracker_data_pkey PRIMARY KEY (id); - ALTER TABLE ONLY operations_feature_flag_scopes ADD CONSTRAINT operations_feature_flag_scopes_pkey PRIMARY KEY (id); @@ -24234,6 +25851,9 @@ ALTER TABLE ONLY packages_helm_file_metadata ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_npm_metadata + ADD CONSTRAINT packages_npm_metadata_pkey PRIMARY KEY (package_id); + ALTER TABLE ONLY packages_nuget_dependency_link_metadata ADD CONSTRAINT packages_nuget_dependency_link_metadata_pkey PRIMARY KEY (dependency_link_id); @@ -24258,6 +25878,9 @@ ALTER TABLE ONLY packages_rubygems_metadata ALTER TABLE ONLY packages_tags ADD CONSTRAINT packages_tags_pkey PRIMARY KEY (id); +ALTER TABLE ONLY pages_deployment_states + ADD CONSTRAINT pages_deployment_states_pkey PRIMARY KEY (pages_deployment_id); + ALTER TABLE ONLY pages_deployments ADD CONSTRAINT pages_deployments_pkey PRIMARY KEY (id); @@ -24291,6 +25914,9 @@ ALTER TABLE ONLY postgres_async_indexes ALTER TABLE ONLY postgres_reindex_actions ADD CONSTRAINT postgres_reindex_actions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY postgres_reindex_queued_actions + ADD CONSTRAINT postgres_reindex_queued_actions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY programming_languages ADD CONSTRAINT programming_languages_pkey PRIMARY KEY (id); @@ -24384,6 +26010,9 @@ ALTER TABLE ONLY project_tracing_settings ALTER TABLE ONLY projects ADD CONSTRAINT projects_pkey PRIMARY KEY (id); +ALTER TABLE ONLY projects_sync_events + ADD CONSTRAINT projects_sync_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY prometheus_alert_events ADD CONSTRAINT prometheus_alert_events_pkey PRIMARY KEY (id); @@ -24504,6 +26133,9 @@ ALTER TABLE ONLY sent_notifications ALTER TABLE ONLY sentry_issues ADD CONSTRAINT sentry_issues_pkey PRIMARY KEY (id); +ALTER TABLE ONLY sprints + ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED; + ALTER TABLE ONLY serverless_domain_cluster ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid); @@ -24600,6 +26232,9 @@ ALTER TABLE ONLY u2f_registrations ALTER TABLE ONLY upcoming_reconciliations ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY upload_states + ADD CONSTRAINT upload_states_pkey PRIMARY KEY (upload_id); + ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); @@ -24723,6 +26358,9 @@ ALTER TABLE ONLY vulnerability_occurrence_pipelines ALTER TABLE ONLY vulnerability_occurrences ADD CONSTRAINT vulnerability_occurrences_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_reads + ADD CONSTRAINT vulnerability_reads_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerability_remediations ADD CONSTRAINT vulnerability_remediations_pkey PRIMARY KEY (id); @@ -24805,18 +26443,44 @@ CREATE INDEX audit_events_202307_created_at_author_id_idx ON gitlab_partitions_d 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 audit_events_202308_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202308 USING btree (created_at, author_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 audit_events_202308_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202308 USING btree (entity_id, entity_type, id DESC, author_id, created_at); -CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id ON ONLY incident_management_pending_alert_escalations USING btree (alert_id); +CREATE INDEX audit_events_202309_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202309 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202309_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202309 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id ON ONLY batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration__idx ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx1 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx2 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx3 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx4 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx5 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx6 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 USING btree (batched_background_migration_job_id); + +CREATE INDEX batched_background_migration__batched_background_migration_idx7 ON gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 USING btree (batched_background_migration_job_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 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 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_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 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_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); @@ -24831,6 +26495,10 @@ CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx5 ON 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_2023_rule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (rule_id); + +CREATE INDEX incident_management_pending_alert_escalations_2023_rule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 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); @@ -24845,38 +26513,22 @@ CREATE INDEX incident_management_pending_alert_escalations_202_alert_id_idx6 ON 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_202_alert_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 USING btree (alert_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_alert_escalations_202_alert_id_idx9 ON gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 USING btree (alert_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 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_20230_rule_id_idx ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 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_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); @@ -24891,6 +26543,10 @@ CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx5 ON 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_2023_rule_id_idx7 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (rule_id); + +CREATE INDEX incident_management_pending_issue_escalations_2023_rule_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 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); @@ -24905,6 +26561,10 @@ CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx6 ON 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 incident_management_pending_issue_escalations_202_issue_id_idx8 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 USING btree (issue_id); + +CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx9 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 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); @@ -24921,6 +26581,28 @@ CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000 CREATE INDEX index_fdb8d5eeea ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (created_at, web_hook_id); +CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON ONLY verification_codes USING btree (visitor_id_code, phone, created_at); + +COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index'; + +CREATE UNIQUE INDEX verification_codes_000000_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_000000 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202302_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202302 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202303_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202303 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202304_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202304 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202305_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202305 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202306_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202306 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202307_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202307 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202308_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202308 USING btree (visitor_id_code, phone, created_at); + +CREATE UNIQUE INDEX verification_codes_202309_visitor_id_code_phone_created_at_idx ON gitlab_partitions_dynamic.verification_codes_202309 USING btree (visitor_id_code, phone, created_at); + CREATE INDEX web_hook_logs_202302_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (created_at, web_hook_id); CREATE INDEX web_hook_logs_202302_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (web_hook_id); @@ -24945,6 +26627,806 @@ CREATE INDEX web_hook_logs_202307_created_at_web_hook_id_idx ON gitlab_partition 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 web_hook_logs_202308_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202308 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202308_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202308 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202309_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202309 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202309_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202309 USING btree (web_hook_id); + +CREATE INDEX index_issue_stage_events_project_duration ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_000925dbd7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_merge_request_stage_events_project_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_006f943df6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ON ONLY loose_foreign_keys_deleted_records USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); + +CREATE INDEX index_01e3390fac ON gitlab_partitions_static.loose_foreign_keys_deleted_records_1 USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); + +CREATE INDEX index_02749b504c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_merge_request_stage_events_group_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_0287f5ba09 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_03aa30a758 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_issue_stage_events_group_duration ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_055179c3ea ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_061fe00461 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_070cef72c3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_08e3cfc564 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_merge_request_stage_events_group_in_progress_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_09af45dd6f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_0c153e2eae ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_issue_stage_events_group_in_progress_duration ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_0ca85f3d71 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_issue_stage_events_project_in_progress_duration ON ONLY analytics_cycle_analytics_issue_stage_events USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_0d837a5dda ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_0f28a65451 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_10588dbff0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_107e123e17 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_1230a7a402 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_142c4e7ea4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_merge_request_stage_events_project_in_progress_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_14e4fa1d7d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_14f3645821 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_16627b455e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_1a0388713a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_1a349ed064 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_1af932a3c7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_1b0ea30bdb ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_1f6c3faabe ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_1f8af04ed1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_201c5ddbe9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_20353089e0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_206349925b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_21db459e34 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_21e262390a ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2208bd7d7f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_223592b4a1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_22acc9ab11 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_22ed8f01dd ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_234d38a657 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_23783dc748 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_241e9a574c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_24ac321751 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_25e2aaee9b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2653e7eeb8 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2745f5a388 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_27759556bc ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_27d7ad78d8 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_281840d2d1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_296f64df5c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2ad4b4fdbc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2b7c0a294e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2c6422f668 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2dfcdbe81e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2e1054b181 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2e6991d05b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2f80c360c3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_2fc271c673 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_2fcfd0dc70 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3005c75335 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3206c1e6af ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3249505125 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_331eb67441 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_3640194b77 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_372160a706 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_38a538234e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_39625b8a41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_399dc06649 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3a10b315c0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3c2a3a6ac9 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_3e6be332b7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_41a1c3a4c6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_435802dd01 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_436fa9ad5f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_453a659cb6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_46b989b294 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_47638677a3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4810ac88f5 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_491b4b749e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4a243772d7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4b1793a4c4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4b22560035 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4c2645eef2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4c9d14f978 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4d04210a95 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4d4f2f7de6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4db5aa5872 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_4dead6f314 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4e6ce1c371 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4f2eb7a06b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_4f6fc34e57 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_50c09f6e04 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5111e3e7e7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_52ea79bf8e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_541cc045fc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_551676e972 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_56281bfb73 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5660b1b38e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_59a8209ab6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_59ce40fcc4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5a5f39d824 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5b613b5fcf ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5b944f308d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5bc2f32084 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5c4053b63d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5db09170d4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5ee060202f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5f24f6ead2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5f96b344e2 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_5fb1867c41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_5fe1d00845 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_60e3480f23 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6137e27484 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_620fe77c99 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_625ed9e965 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_64e3a1dfa1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_64eb4cf8bd ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_6580ecb2db ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_682eba05f6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_69bdcf213e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6a39f6d5ac ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_6add8e74cf ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6b1ce61c8f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6cfb391b86 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_6e6c2e6a1d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6ea423bbd1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_6ec4c4afd4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6f4e0abe54 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_6fa47e1334 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_70c657954b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_71c2b26944 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_72027c157f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_739845f617 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_74addd1240 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_75dc81d1d7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_765b0cd8db ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_77096a1dc6 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_77c6293242 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_7b7c85eceb ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_7da2307d2e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_7ead2300ca ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_7ecb5b68b4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_807671c4be ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_807fa83fc0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_80c65daf20 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_81b9cf594f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_82c675952c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_83c5049b3e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_83edf231b8 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_844abd2888 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_8464227c80 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_8685d7c69c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_8688b40056 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_87d40fb9f9 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_88b40d6740 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_89c79afe5c ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_8a0fc3de4f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_8b9f9a19a4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_8fb48e72ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_9201b952a0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_92c09e352b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_9490e0e0b7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_95a353f50b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_971af9481e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_9955b1dc59 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_9b8e89ae41 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_9ee83b068b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a1a9dc36c1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a2d9f185a5 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a3feed3097 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a6999c65c9 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a6c68d16b2 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_a8276a450f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_a88f20fc98 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a9424aa392 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a99cee1904 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_a9deff2159 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_aabc184267 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ab22231a16 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_abbdf80ab1 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_adc159c3fe ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_aed7f7b10c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_aee84adb5b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_b1dda405af ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_b607012614 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_b7f21460bb ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_b83fe1306b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_bc189e47ab ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_bca83177ef ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_bedd7e160b ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_bee2b94a80 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c08e669dfa ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c09bb66559 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c119f5b92e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c17dae3605 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c1cdd90d0d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c2b951bf20 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c42b2e7eae ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c435d904ce ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c473921734 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c546bb0736 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c59cde6209 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c66758baa7 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c6ea8a0e26 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c8c4219c0a ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_c971e6c5ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_c9b14a3d9f ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_cbb61ea269 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_cc0ba6343b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_cd2b2939a4 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_cda41e106e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_cfa4237c83 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_d01ea0126a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_d0d285c264 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_d27b4c84e7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_d2fe918e83 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_d35c969634 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_d6047ee813 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_d69c2485f4 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_d8fa9793ad ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_d9384b768d ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_dc571ba649 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_df62a8c50e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_e1a4f994d8 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_e3d1fd5b19 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_e3d6234929 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_e54adf9acb ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_e6405afea0 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_e64588e276 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_e716b8ac3f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_e73bc5ba6a ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_e8f3a327b2 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_ea0c2d3361 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_eb558957f0 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_ec25d494e6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ed094a4f13 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ee4c549a2d ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ef6a48bd29 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_ef7be2ae94 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f0cdd09a5e ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f112fae8ac ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f1c3d14cdc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f256d3f6a1 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f2848acfc7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 USING btree (stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f3d7d86e09 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f47327ec1f ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f6b0d458a3 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_f705dc8541 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f76e8a5304 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f86acdc2ff ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f878aab8e3 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_f902c261ce ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 USING btree (stage_event_hash_id, project_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_fbccc855cf ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 USING btree (stage_event_hash_id, group_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_fbf2d3310b ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_fccbe45c32 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_fee429223e ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ff00c038cc ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 USING btree (stage_event_hash_id, project_id, start_event_timestamp, merge_request_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_ff39be5400 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 USING btree (stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); + +CREATE INDEX index_ff8741d8d7 ON gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 USING btree (stage_event_hash_id, group_id, start_event_timestamp, issue_id) WHERE ((end_event_timestamp IS NULL) AND (state_id = 1)); + +CREATE INDEX index_issue_search_data_on_issue_id ON ONLY issue_search_data USING btree (issue_id); + +CREATE INDEX issue_search_data_00_issue_id_idx ON gitlab_partitions_static.issue_search_data_00 USING btree (issue_id); + +CREATE INDEX index_issue_search_data_on_search_vector ON ONLY issue_search_data USING gin (search_vector); + +CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector); + +CREATE INDEX issue_search_data_01_issue_id_idx ON gitlab_partitions_static.issue_search_data_01 USING btree (issue_id); + +CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector); + +CREATE INDEX issue_search_data_02_issue_id_idx ON gitlab_partitions_static.issue_search_data_02 USING btree (issue_id); + +CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector); + +CREATE INDEX issue_search_data_03_issue_id_idx ON gitlab_partitions_static.issue_search_data_03 USING btree (issue_id); + +CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector); + +CREATE INDEX issue_search_data_04_issue_id_idx ON gitlab_partitions_static.issue_search_data_04 USING btree (issue_id); + +CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector); + +CREATE INDEX issue_search_data_05_issue_id_idx ON gitlab_partitions_static.issue_search_data_05 USING btree (issue_id); + +CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector); + +CREATE INDEX issue_search_data_06_issue_id_idx ON gitlab_partitions_static.issue_search_data_06 USING btree (issue_id); + +CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector); + +CREATE INDEX issue_search_data_07_issue_id_idx ON gitlab_partitions_static.issue_search_data_07 USING btree (issue_id); + +CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector); + +CREATE INDEX issue_search_data_08_issue_id_idx ON gitlab_partitions_static.issue_search_data_08 USING btree (issue_id); + +CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector); + +CREATE INDEX issue_search_data_09_issue_id_idx ON gitlab_partitions_static.issue_search_data_09 USING btree (issue_id); + +CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector); + +CREATE INDEX issue_search_data_10_issue_id_idx ON gitlab_partitions_static.issue_search_data_10 USING btree (issue_id); + +CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector); + +CREATE INDEX issue_search_data_11_issue_id_idx ON gitlab_partitions_static.issue_search_data_11 USING btree (issue_id); + +CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector); + +CREATE INDEX issue_search_data_12_issue_id_idx ON gitlab_partitions_static.issue_search_data_12 USING btree (issue_id); + +CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector); + +CREATE INDEX issue_search_data_13_issue_id_idx ON gitlab_partitions_static.issue_search_data_13 USING btree (issue_id); + +CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector); + +CREATE INDEX issue_search_data_14_issue_id_idx ON gitlab_partitions_static.issue_search_data_14 USING btree (issue_id); + +CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector); + +CREATE INDEX issue_search_data_15_issue_id_idx ON gitlab_partitions_static.issue_search_data_15 USING btree (issue_id); + +CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector); + +CREATE INDEX issue_search_data_16_issue_id_idx ON gitlab_partitions_static.issue_search_data_16 USING btree (issue_id); + +CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector); + +CREATE INDEX issue_search_data_17_issue_id_idx ON gitlab_partitions_static.issue_search_data_17 USING btree (issue_id); + +CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector); + +CREATE INDEX issue_search_data_18_issue_id_idx ON gitlab_partitions_static.issue_search_data_18 USING btree (issue_id); + +CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector); + +CREATE INDEX issue_search_data_19_issue_id_idx ON gitlab_partitions_static.issue_search_data_19 USING btree (issue_id); + +CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector); + +CREATE INDEX issue_search_data_20_issue_id_idx ON gitlab_partitions_static.issue_search_data_20 USING btree (issue_id); + +CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector); + +CREATE INDEX issue_search_data_21_issue_id_idx ON gitlab_partitions_static.issue_search_data_21 USING btree (issue_id); + +CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector); + +CREATE INDEX issue_search_data_22_issue_id_idx ON gitlab_partitions_static.issue_search_data_22 USING btree (issue_id); + +CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector); + +CREATE INDEX issue_search_data_23_issue_id_idx ON gitlab_partitions_static.issue_search_data_23 USING btree (issue_id); + +CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector); + +CREATE INDEX issue_search_data_24_issue_id_idx ON gitlab_partitions_static.issue_search_data_24 USING btree (issue_id); + +CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector); + +CREATE INDEX issue_search_data_25_issue_id_idx ON gitlab_partitions_static.issue_search_data_25 USING btree (issue_id); + +CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector); + +CREATE INDEX issue_search_data_26_issue_id_idx ON gitlab_partitions_static.issue_search_data_26 USING btree (issue_id); + +CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector); + +CREATE INDEX issue_search_data_27_issue_id_idx ON gitlab_partitions_static.issue_search_data_27 USING btree (issue_id); + +CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector); + +CREATE INDEX issue_search_data_28_issue_id_idx ON gitlab_partitions_static.issue_search_data_28 USING btree (issue_id); + +CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector); + +CREATE INDEX issue_search_data_29_issue_id_idx ON gitlab_partitions_static.issue_search_data_29 USING btree (issue_id); + +CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector); + +CREATE INDEX issue_search_data_30_issue_id_idx ON gitlab_partitions_static.issue_search_data_30 USING btree (issue_id); + +CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector); + +CREATE INDEX issue_search_data_31_issue_id_idx ON gitlab_partitions_static.issue_search_data_31 USING btree (issue_id); + +CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector); + +CREATE INDEX issue_search_data_32_issue_id_idx ON gitlab_partitions_static.issue_search_data_32 USING btree (issue_id); + +CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector); + +CREATE INDEX issue_search_data_33_issue_id_idx ON gitlab_partitions_static.issue_search_data_33 USING btree (issue_id); + +CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector); + +CREATE INDEX issue_search_data_34_issue_id_idx ON gitlab_partitions_static.issue_search_data_34 USING btree (issue_id); + +CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector); + +CREATE INDEX issue_search_data_35_issue_id_idx ON gitlab_partitions_static.issue_search_data_35 USING btree (issue_id); + +CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector); + +CREATE INDEX issue_search_data_36_issue_id_idx ON gitlab_partitions_static.issue_search_data_36 USING btree (issue_id); + +CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector); + +CREATE INDEX issue_search_data_37_issue_id_idx ON gitlab_partitions_static.issue_search_data_37 USING btree (issue_id); + +CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector); + +CREATE INDEX issue_search_data_38_issue_id_idx ON gitlab_partitions_static.issue_search_data_38 USING btree (issue_id); + +CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector); + +CREATE INDEX issue_search_data_39_issue_id_idx ON gitlab_partitions_static.issue_search_data_39 USING btree (issue_id); + +CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector); + +CREATE INDEX issue_search_data_40_issue_id_idx ON gitlab_partitions_static.issue_search_data_40 USING btree (issue_id); + +CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector); + +CREATE INDEX issue_search_data_41_issue_id_idx ON gitlab_partitions_static.issue_search_data_41 USING btree (issue_id); + +CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector); + +CREATE INDEX issue_search_data_42_issue_id_idx ON gitlab_partitions_static.issue_search_data_42 USING btree (issue_id); + +CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector); + +CREATE INDEX issue_search_data_43_issue_id_idx ON gitlab_partitions_static.issue_search_data_43 USING btree (issue_id); + +CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector); + +CREATE INDEX issue_search_data_44_issue_id_idx ON gitlab_partitions_static.issue_search_data_44 USING btree (issue_id); + +CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector); + +CREATE INDEX issue_search_data_45_issue_id_idx ON gitlab_partitions_static.issue_search_data_45 USING btree (issue_id); + +CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector); + +CREATE INDEX issue_search_data_46_issue_id_idx ON gitlab_partitions_static.issue_search_data_46 USING btree (issue_id); + +CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector); + +CREATE INDEX issue_search_data_47_issue_id_idx ON gitlab_partitions_static.issue_search_data_47 USING btree (issue_id); + +CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector); + +CREATE INDEX issue_search_data_48_issue_id_idx ON gitlab_partitions_static.issue_search_data_48 USING btree (issue_id); + +CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector); + +CREATE INDEX issue_search_data_49_issue_id_idx ON gitlab_partitions_static.issue_search_data_49 USING btree (issue_id); + +CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector); + +CREATE INDEX issue_search_data_50_issue_id_idx ON gitlab_partitions_static.issue_search_data_50 USING btree (issue_id); + +CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector); + +CREATE INDEX issue_search_data_51_issue_id_idx ON gitlab_partitions_static.issue_search_data_51 USING btree (issue_id); + +CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector); + +CREATE INDEX issue_search_data_52_issue_id_idx ON gitlab_partitions_static.issue_search_data_52 USING btree (issue_id); + +CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector); + +CREATE INDEX issue_search_data_53_issue_id_idx ON gitlab_partitions_static.issue_search_data_53 USING btree (issue_id); + +CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector); + +CREATE INDEX issue_search_data_54_issue_id_idx ON gitlab_partitions_static.issue_search_data_54 USING btree (issue_id); + +CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector); + +CREATE INDEX issue_search_data_55_issue_id_idx ON gitlab_partitions_static.issue_search_data_55 USING btree (issue_id); + +CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector); + +CREATE INDEX issue_search_data_56_issue_id_idx ON gitlab_partitions_static.issue_search_data_56 USING btree (issue_id); + +CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector); + +CREATE INDEX issue_search_data_57_issue_id_idx ON gitlab_partitions_static.issue_search_data_57 USING btree (issue_id); + +CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector); + +CREATE INDEX issue_search_data_58_issue_id_idx ON gitlab_partitions_static.issue_search_data_58 USING btree (issue_id); + +CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector); + +CREATE INDEX issue_search_data_59_issue_id_idx ON gitlab_partitions_static.issue_search_data_59 USING btree (issue_id); + +CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector); + +CREATE INDEX issue_search_data_60_issue_id_idx ON gitlab_partitions_static.issue_search_data_60 USING btree (issue_id); + +CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector); + +CREATE INDEX issue_search_data_61_issue_id_idx ON gitlab_partitions_static.issue_search_data_61 USING btree (issue_id); + +CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector); + +CREATE INDEX issue_search_data_62_issue_id_idx ON gitlab_partitions_static.issue_search_data_62 USING btree (issue_id); + +CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector); + +CREATE INDEX issue_search_data_63_issue_id_idx ON gitlab_partitions_static.issue_search_data_63 USING btree (issue_id); + +CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector); + 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); @@ -25093,6 +27575,8 @@ CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING b 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 ci_job_artifacts_expire_at_unlocked_idx ON ci_job_artifacts USING btree (expire_at) WHERE (locked = 0); + CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true); CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index ON commit_user_mentions USING btree (commit_id, note_id); @@ -25129,7 +27613,7 @@ CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_fi 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 UNIQUE INDEX finding_evidences_on_unique_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); @@ -25165,6 +27649,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_helm_pkgs_on_project_id_id ON packages_packages USING btree (project_id, 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); @@ -25173,9 +27659,7 @@ CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issu CREATE INDEX idx_issues_on_project_id_and_due_date_and_id_and_state_id ON issues USING btree (project_id, due_date, id, state_id) WHERE (due_date IS NOT NULL); -CREATE INDEX idx_issues_on_project_id_and_rel_asc_and_id ON issues USING btree (project_id, relative_position, id); - -CREATE INDEX idx_issues_on_project_id_and_rel_position_and_state_id_and_id ON issues USING btree (project_id, relative_position, state_id, id DESC); +CREATE INDEX idx_issues_on_project_id_and_rel_position_and_id_and_state_id ON issues USING btree (project_id, relative_position, id, state_id); CREATE INDEX idx_issues_on_project_id_and_updated_at_and_id_and_state_id ON issues USING btree (project_id, updated_at, id, state_id); @@ -25279,10 +27763,24 @@ 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 INDEX index_agent_activity_events_on_agent_id_and_recorded_at_and_id ON agent_activity_events USING btree (agent_id, recorded_at, id); + +CREATE INDEX index_agent_activity_events_on_agent_token_id ON agent_activity_events USING btree (agent_token_id) WHERE (agent_token_id IS NOT NULL); + +CREATE INDEX index_agent_activity_events_on_merge_request_id ON agent_activity_events USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL); + +CREATE INDEX index_agent_activity_events_on_project_id ON agent_activity_events USING btree (project_id) WHERE (project_id IS NOT NULL); + +CREATE INDEX index_agent_activity_events_on_user_id ON agent_activity_events USING btree (user_id) WHERE (user_id IS NOT NULL); + 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 UNIQUE INDEX index_agent_project_authorizations_on_agent_id_and_project_id ON agent_project_authorizations USING btree (agent_id, project_id); + +CREATE INDEX index_agent_project_authorizations_on_project_id ON agent_project_authorizations 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); @@ -25375,6 +27873,8 @@ CREATE INDEX index_approval_project_rules_on_rule_type ON approval_project_rules CREATE INDEX index_approval_project_rules_protected_branches_pb_id ON approval_project_rules_protected_branches USING btree (protected_branch_id); +CREATE INDEX index_approval_project_rules_report_type ON approval_project_rules USING btree (report_type); + CREATE UNIQUE INDEX index_approval_project_rules_users_1 ON approval_project_rules_users USING btree (approval_project_rule_id, user_id); CREATE INDEX index_approval_project_rules_users_2 ON approval_project_rules_users USING btree (user_id); @@ -25507,6 +28007,8 @@ CREATE INDEX index_boards_on_project_id ON boards USING btree (project_id); CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON broadcast_messages USING btree (ends_at, broadcast_type, id); +CREATE INDEX index_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids); + 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_and_status ON bulk_import_entities USING btree (bulk_import_id, status); @@ -25569,6 +28071,8 @@ CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_bu CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at); +CREATE INDEX index_ci_builds_on_resource_group_and_status_and_commit_id ON ci_builds USING btree (resource_group_id, status, commit_id) WHERE (resource_group_id IS NOT NULL); + CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC); CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id); @@ -25609,6 +28113,8 @@ CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key); +CREATE INDEX index_ci_job_artifact_states_on_job_artifact_id ON ci_job_artifact_states USING btree (job_artifact_id); + CREATE INDEX index_ci_job_artifacts_for_terraform_reports ON ci_job_artifacts USING btree (project_id, id) WHERE (file_type = 18); CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts USING btree (id) WHERE (file_type = 18); @@ -25635,6 +28141,8 @@ CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables 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); + 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); @@ -25723,6 +28231,10 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipel CREATE INDEX index_ci_pipelines_on_user_id_and_id_and_cancelable_status ON ci_pipelines USING btree (user_id, id) WHERE ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('waiting_for_resource'::character varying)::text, ('preparing'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text, ('scheduled'::character varying)::text])); +CREATE INDEX index_ci_project_mirrors_on_namespace_id ON ci_project_mirrors USING btree (namespace_id); + +CREATE UNIQUE INDEX index_ci_project_mirrors_on_project_id ON ci_project_mirrors USING btree (project_id); + CREATE UNIQUE INDEX index_ci_project_monthly_usages_on_project_id_and_date ON ci_project_monthly_usages USING btree (project_id, date); CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_path ON ci_refs USING btree (project_id, ref_path); @@ -25861,6 +28373,10 @@ CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON cluster CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); +CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integration_elasticstack USING btree (enabled, created_at, cluster_id); + +CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id); + CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_id ON clusters_kubernetes_namespaces USING btree (cluster_id); CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id); @@ -25893,6 +28409,14 @@ CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON conta CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops); +CREATE UNIQUE INDEX index_content_blocked_states_on_container_id_commit_sha_path ON content_blocked_states USING btree (container_identifier, commit_sha, path); + +CREATE UNIQUE INDEX index_coverage_fuzzing_corpuses_on_package_id ON coverage_fuzzing_corpuses USING btree (package_id); + +CREATE INDEX index_coverage_fuzzing_corpuses_on_project_id ON coverage_fuzzing_corpuses USING btree (project_id); + +CREATE INDEX index_coverage_fuzzing_corpuses_on_user_id ON coverage_fuzzing_corpuses USING btree (user_id); + CREATE INDEX index_created_at_on_codeowner_approval_merge_request_rules ON approval_merge_request_rules USING btree (created_at) WHERE ((rule_type = 2) AND (section <> 'codeowners'::text)); CREATE INDEX index_csv_issue_imports_on_project_id ON csv_issue_imports USING btree (project_id); @@ -25937,6 +28461,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_project_id_and_url ON dast_site_tokens USING btree (project_id, url); + 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); @@ -25949,17 +28475,19 @@ 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 UNIQUE INDEX index_dep_prox_manifests_on_group_id_file_name_and_status ON dependency_proxy_manifests USING btree (group_id, file_name, status); -CREATE INDEX index_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_trace_sections USING btree (project_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_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_status_read_at_id ON dependency_proxy_blobs USING btree (group_id, status, read_at, 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_blobs_on_status ON dependency_proxy_blobs USING btree (status); CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id); -CREATE UNIQUE INDEX index_dependency_proxy_manifests_on_group_id_and_file_name ON dependency_proxy_manifests USING btree (group_id, file_name); +CREATE INDEX index_dependency_proxy_manifests_on_group_id_status_read_at_id ON dependency_proxy_manifests USING btree (group_id, status, read_at, id); + +CREATE INDEX index_dependency_proxy_manifests_on_status ON dependency_proxy_manifests USING btree (status); CREATE INDEX index_deploy_key_id_on_protected_branch_push_access_levels ON protected_branch_push_access_levels USING btree (deploy_key_id); @@ -25973,10 +28501,16 @@ CREATE INDEX index_deploy_tokens_on_token_and_expires_at_and_id ON deploy_tokens CREATE UNIQUE INDEX index_deploy_tokens_on_token_encrypted ON deploy_tokens USING btree (token_encrypted); +CREATE UNIQUE INDEX index_deployment_approvals_on_deployment_id_and_user_id ON deployment_approvals USING btree (deployment_id, user_id); + +CREATE INDEX index_deployment_approvals_on_user_id ON deployment_approvals USING btree (user_id); + CREATE UNIQUE INDEX index_deployment_clusters_on_cluster_id_and_deployment_id ON deployment_clusters USING btree (cluster_id, deployment_id); CREATE INDEX index_deployment_merge_requests_on_merge_request_id ON deployment_merge_requests USING btree (merge_request_id); +CREATE INDEX index_deployments_on_archived_project_id_iid ON deployments USING btree (archived, project_id, iid); + CREATE INDEX index_deployments_on_cluster_id_and_status ON deployments USING btree (cluster_id, status); CREATE INDEX index_deployments_on_created_at ON deployments USING btree (created_at); @@ -25987,6 +28521,8 @@ CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btr CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deployments USING btree (environment_id, iid, project_id); +CREATE INDEX index_deployments_on_environment_id_and_ref ON deployments USING btree (environment_id, ref); + CREATE INDEX index_deployments_on_environment_id_status_and_finished_at ON deployments USING btree (environment_id, status, finished_at); CREATE INDEX index_deployments_on_environment_id_status_and_id ON deployments USING btree (environment_id, status, id); @@ -26149,13 +28685,13 @@ CREATE UNIQUE INDEX index_escalation_rules_on_all_attributes ON incident_managem 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_id ON error_tracking_errors USING btree (project_id, status, id); -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_events_count_id_desc ON error_tracking_errors USING btree (project_id, status, events_count DESC, id DESC); -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_first_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, first_seen_at DESC, id DESC); -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_et_errors_on_project_id_and_status_last_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, last_seen_at DESC, id DESC); CREATE INDEX index_events_on_action ON events USING btree (action); @@ -26165,6 +28701,8 @@ CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events U CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_id); +CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone); + CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL); CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (project_id, created_at); @@ -26173,8 +28711,6 @@ CREATE INDEX index_events_on_project_id_and_id ON events USING btree (project_id CREATE INDEX index_events_on_project_id_and_id_desc_on_merged_action ON events USING btree (project_id, id DESC) WHERE (action = 7); -CREATE INDEX index_events_on_target_type_and_target_id ON events USING btree (target_type, target_id); - CREATE UNIQUE INDEX index_events_on_target_type_and_target_id_and_fingerprint ON events USING btree (target_type, target_id, fingerprint); CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id); @@ -26207,8 +28743,6 @@ CREATE UNIQUE INDEX index_feature_gates_on_feature_key_and_key_and_value ON feat CREATE UNIQUE INDEX index_features_on_key ON features USING btree (key); -CREATE INDEX index_for_resource_group ON ci_builds USING btree (resource_group_id, id) WHERE (resource_group_id IS NOT NULL); - CREATE INDEX index_for_status_per_branch_per_project ON merge_trains USING btree (target_project_id, target_branch, status); CREATE INDEX index_fork_network_members_on_fork_network_id ON fork_network_members USING btree (fork_network_id); @@ -26245,8 +28779,6 @@ CREATE INDEX index_geo_event_log_on_repository_updated_event_id ON geo_event_log CREATE INDEX index_geo_event_log_on_reset_checksum_event_id ON geo_event_log USING btree (reset_checksum_event_id) WHERE (reset_checksum_event_id IS NOT NULL); -CREATE INDEX index_geo_event_log_on_upload_deleted_event_id ON geo_event_log USING btree (upload_deleted_event_id) WHERE (upload_deleted_event_id IS NOT NULL); - CREATE INDEX index_geo_hashed_storage_attachments_events_on_project_id ON geo_hashed_storage_attachments_events USING btree (project_id); CREATE INDEX index_geo_hashed_storage_migrated_events_on_project_id ON geo_hashed_storage_migrated_events USING btree (project_id); @@ -26283,7 +28815,9 @@ CREATE INDEX index_geo_repository_updated_events_on_source ON geo_repository_upd CREATE INDEX index_geo_reset_checksum_events_on_project_id ON geo_reset_checksum_events USING btree (project_id); -CREATE INDEX index_geo_upload_deleted_events_on_upload_id ON geo_upload_deleted_events USING btree (upload_id); +CREATE INDEX index_gin_ci_namespace_mirrors_on_traversal_ids ON ci_namespace_mirrors USING gin (traversal_ids); + +CREATE INDEX index_gin_ci_pending_builds_on_namespace_traversal_ids ON ci_pending_builds USING gin (namespace_traversal_ids); CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gitlab_subscription_histories USING btree (gitlab_subscription_id); @@ -26373,6 +28907,16 @@ CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_mana CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid); +CREATE INDEX index_im_timeline_events_author_id ON incident_management_timeline_events USING btree (author_id); + +CREATE INDEX index_im_timeline_events_issue_id ON incident_management_timeline_events USING btree (issue_id); + +CREATE INDEX index_im_timeline_events_project_id ON incident_management_timeline_events USING btree (project_id); + +CREATE INDEX index_im_timeline_events_promoted_from_note_id ON incident_management_timeline_events USING btree (promoted_from_note_id); + +CREATE INDEX index_im_timeline_events_updated_by_user_id ON incident_management_timeline_events USING btree (updated_by_user_id); + CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL); CREATE INDEX index_import_export_uploads_on_project_id ON import_export_uploads USING btree (project_id); @@ -26389,6 +28933,8 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL); +CREATE INDEX index_imported_projects_on_import_type_id ON projects USING btree (import_type, id) WHERE (import_type IS NOT NULL); + CREATE INDEX index_in_product_marketing_emails_on_user_id ON in_product_marketing_emails USING btree (user_id); CREATE UNIQUE INDEX index_in_product_marketing_emails_on_user_track_series ON in_product_marketing_emails USING btree (user_id, track, series); @@ -26451,14 +28997,24 @@ CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id); +CREATE UNIQUE INDEX index_issue_crm_contacts_on_issue_id_and_contact_id ON issue_customer_relations_contacts USING btree (issue_id, contact_id); + +CREATE INDEX index_issue_customer_relations_contacts_on_contact_id ON issue_customer_relations_contacts USING btree (contact_id); + CREATE UNIQUE INDEX index_issue_email_participants_on_issue_id_and_lower_email ON issue_email_participants USING btree (issue_id, lower(email)); +CREATE INDEX index_issue_emails_on_email_message_id ON issue_emails USING btree (email_message_id); + +CREATE INDEX index_issue_emails_on_issue_id ON issue_emails USING btree (issue_id); + CREATE INDEX index_issue_links_on_source_id ON issue_links USING btree (source_id); CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links USING btree (source_id, target_id); CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id); +CREATE INDEX index_issue_metrics_first_mentioned_in_commit ON issue_metrics USING btree (issue_id) WHERE (date_part('year'::text, first_mentioned_in_commit_at) > (2019)::double precision); + CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at); CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count); @@ -26527,7 +29083,13 @@ CREATE INDEX index_jira_imports_on_user_id ON jira_imports USING btree (user_id) CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING btree (service_id); -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_job_artifact_states_failed_verification ON ci_job_artifact_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_job_artifact_states_needs_verification ON ci_job_artifact_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_job_artifact_states_on_verification_state ON ci_job_artifact_states USING btree (verification_state); + +CREATE INDEX index_job_artifact_states_pending_verification ON ci_job_artifact_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); 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); @@ -26553,17 +29115,17 @@ CREATE INDEX index_label_priorities_on_priority ON label_priorities USING btree CREATE UNIQUE INDEX index_label_priorities_on_project_id_and_label_id ON label_priorities USING btree (project_id, label_id); -CREATE UNIQUE INDEX index_labels_on_group_id_and_project_id_and_title ON labels USING btree (group_id, project_id, title); +CREATE INDEX index_labels_on_group_id ON labels USING btree (group_id); -CREATE UNIQUE INDEX index_labels_on_group_id_and_title_unique ON labels USING btree (group_id, title) WHERE (project_id IS NULL); +CREATE UNIQUE INDEX index_labels_on_group_id_and_title_varchar_unique ON labels USING btree (group_id, title varchar_pattern_ops) WHERE (project_id IS NULL); CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id); -CREATE UNIQUE INDEX index_labels_on_project_id_and_title_unique ON labels USING btree (project_id, title) WHERE (group_id IS NULL); +CREATE UNIQUE INDEX index_labels_on_project_id_and_title_varchar_unique ON labels USING btree (project_id, title varchar_pattern_ops) WHERE (group_id IS NULL); CREATE INDEX index_labels_on_template ON labels USING btree (template) WHERE template; -CREATE INDEX index_labels_on_title ON labels USING btree (title); +CREATE INDEX index_labels_on_title_varchar ON labels USING btree (title varchar_pattern_ops); CREATE INDEX index_labels_on_type_and_project_id ON labels USING btree (type, project_id); @@ -26571,6 +29133,16 @@ CREATE UNIQUE INDEX index_lfs_file_locks_on_project_id_and_path ON lfs_file_lock CREATE INDEX index_lfs_file_locks_on_user_id ON lfs_file_locks USING btree (user_id); +CREATE INDEX index_lfs_object_states_failed_verification ON lfs_object_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_lfs_object_states_needs_verification ON lfs_object_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_lfs_object_states_on_lfs_object_id ON lfs_object_states USING btree (lfs_object_id); + +CREATE INDEX index_lfs_object_states_on_verification_state ON lfs_object_states USING btree (verification_state); + +CREATE INDEX index_lfs_object_states_pending_verification ON lfs_object_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_lfs_objects_on_file_store ON lfs_objects USING btree (file_store); CREATE UNIQUE INDEX index_lfs_objects_on_oid ON lfs_objects USING btree (oid); @@ -26597,6 +29169,12 @@ CREATE INDEX index_lists_on_milestone_id ON lists USING btree (milestone_id); CREATE INDEX index_lists_on_user_id ON lists USING btree (user_id); +CREATE INDEX index_member_tasks_on_member_id ON member_tasks USING btree (member_id); + +CREATE UNIQUE INDEX index_member_tasks_on_member_id_and_project_id ON member_tasks USING btree (member_id, project_id); + +CREATE INDEX index_member_tasks_on_project_id ON member_tasks USING btree (project_id); + CREATE INDEX index_members_on_access_level ON members USING btree (access_level); CREATE INDEX index_members_on_expires_at ON members USING btree (expires_at); @@ -26677,6 +29255,10 @@ CREATE INDEX index_merge_requests_closing_issues_on_issue_id ON merge_requests_c CREATE INDEX index_merge_requests_closing_issues_on_merge_request_id ON merge_requests_closing_issues USING btree (merge_request_id); +CREATE INDEX index_merge_requests_compliance_violations_on_violating_user_id ON merge_requests_compliance_violations USING btree (violating_user_id); + +CREATE UNIQUE INDEX index_merge_requests_compliance_violations_unique_columns ON merge_requests_compliance_violations USING btree (merge_request_id, violating_user_id, reason); + CREATE INDEX index_merge_requests_on_assignee_id ON merge_requests USING btree (assignee_id); CREATE INDEX index_merge_requests_on_author_id ON merge_requests USING btree (author_id); @@ -26785,6 +29367,8 @@ CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL); +CREATE UNIQUE INDEX index_namespaces_name_parent_id_type ON namespaces USING btree (name, parent_id, type); + CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at); CREATE INDEX index_namespaces_on_custom_project_templates_group_id_and_type ON namespaces USING btree (custom_project_templates_group_id, type) WHERE (custom_project_templates_group_id IS NOT NULL); @@ -26795,8 +29379,6 @@ CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespac CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING btree (ldap_sync_last_update_at); -CREATE UNIQUE INDEX index_namespaces_on_name_and_parent_id ON namespaces USING btree (name, parent_id); - CREATE INDEX index_namespaces_on_name_trigram ON namespaces USING gin (name gin_trgm_ops); CREATE INDEX index_namespaces_on_owner_id ON namespaces USING btree (owner_id); @@ -26819,7 +29401,13 @@ CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON names CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids); -CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL); +CREATE INDEX index_namespaces_on_traversal_ids_for_groups ON namespaces USING gin (traversal_ids) WHERE ((type)::text = 'Group'::text); + +CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id); + +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_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)); @@ -26837,8 +29425,6 @@ CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id); CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code); -CREATE INDEX index_notes_on_note_trigram ON notes USING gin (note gin_trgm_ops); - CREATE INDEX index_notes_on_noteable_id_and_noteable_type_and_system ON notes USING btree (noteable_id, noteable_type, system); CREATE INDEX index_notes_on_project_id_and_id_and_system_false ON notes USING btree (project_id, id) WHERE (NOT system); @@ -26871,6 +29457,8 @@ CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON oauth_openid_requ CREATE UNIQUE INDEX index_on_deploy_keys_id_and_type_and_public ON keys USING btree (id, type) WHERE (public = true); +CREATE INDEX index_on_group_id_on_webhooks ON web_hooks USING btree (group_id); + CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USING btree (lower((extern_uid)::text), provider); CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at); @@ -26895,10 +29483,6 @@ CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path): CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); -CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time); - -CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at); - CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username)::text)); @@ -26917,8 +29501,6 @@ CREATE UNIQUE INDEX index_onboarding_progresses_on_namespace_id ON onboarding_pr CREATE INDEX index_oncall_shifts_on_rotation_id_and_starts_at_and_ends_at ON incident_management_oncall_shifts USING btree (rotation_id, starts_at, ends_at); -CREATE INDEX index_open_project_tracker_data_on_service_id ON open_project_tracker_data USING btree (service_id); - CREATE INDEX index_operations_feature_flags_issues_on_issue_id ON operations_feature_flags_issues USING btree (issue_id); CREATE UNIQUE INDEX index_operations_feature_flags_on_project_id_and_iid ON operations_feature_flags USING btree (project_id, iid); @@ -26973,6 +29555,8 @@ CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel); +CREATE INDEX index_packages_helm_file_metadata_on_pf_id_and_channel ON packages_helm_file_metadata USING btree (package_file_id, channel); + CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path); CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path); @@ -26993,6 +29577,8 @@ CREATE INDEX index_packages_package_files_on_file_store ON packages_package_file CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON packages_package_files USING btree (package_id, file_name); +CREATE INDEX index_packages_package_files_on_package_id_id ON packages_package_files USING btree (package_id, id); + CREATE INDEX index_packages_package_files_on_verification_state ON packages_package_files USING btree (verification_state); CREATE INDEX index_packages_packages_on_creator_id ON packages_packages USING btree (creator_id); @@ -27015,6 +29601,16 @@ CREATE INDEX index_packages_tags_on_package_id ON packages_tags USING btree (pac CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags USING btree (package_id, updated_at DESC); +CREATE INDEX index_pages_deployment_states_failed_verification ON pages_deployment_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_pages_deployment_states_needs_verification ON pages_deployment_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_pages_deployment_states_on_pages_deployment_id ON pages_deployment_states USING btree (pages_deployment_id); + +CREATE INDEX index_pages_deployment_states_on_verification_state ON pages_deployment_states USING btree (verification_state); + +CREATE INDEX index_pages_deployment_states_pending_verification ON pages_deployment_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_pages_deployments_on_ci_build_id ON pages_deployments USING btree (ci_build_id); CREATE INDEX index_pages_deployments_on_file_store_and_id ON pages_deployments USING btree (file_store, id); @@ -27081,6 +29677,8 @@ CREATE UNIQUE INDEX index_postgres_async_indexes_on_name ON postgres_async_index CREATE INDEX index_postgres_reindex_actions_on_index_identifier ON postgres_reindex_actions USING btree (index_identifier); +CREATE INDEX index_postgres_reindex_queued_actions_on_state ON postgres_reindex_queued_actions USING btree (state); + CREATE UNIQUE INDEX index_programming_languages_on_name ON programming_languages USING btree (name); CREATE INDEX index_project_access_tokens_on_project_id ON project_access_tokens USING btree (project_id); @@ -27277,6 +29875,8 @@ CREATE INDEX index_projects_on_star_count ON projects USING btree (star_count); CREATE INDEX index_projects_on_updated_at_and_id ON projects USING btree (updated_at, id); +CREATE INDEX index_projects_sync_events_on_project_id ON projects_sync_events USING btree (project_id); + CREATE UNIQUE INDEX index_prometheus_alert_event_scoped_payload_key ON prometheus_alert_events USING btree (prometheus_alert_id, payload_key); CREATE INDEX index_prometheus_alert_events_on_project_id_and_status ON prometheus_alert_events USING btree (project_id, status); @@ -27355,7 +29955,7 @@ CREATE UNIQUE INDEX index_release_links_on_release_id_and_name ON release_links CREATE UNIQUE INDEX index_release_links_on_release_id_and_url ON release_links USING btree (release_id, url); -CREATE INDEX index_releases_on_author_id ON releases USING btree (author_id); +CREATE INDEX index_releases_on_author_id_id_created_at ON releases USING btree (author_id, id, created_at); CREATE INDEX index_releases_on_project_id_and_tag ON releases USING btree (project_id, tag); @@ -27625,8 +30225,6 @@ CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadat CREATE INDEX index_taggings_on_tag_id ON taggings USING btree (tag_id); -CREATE INDEX index_taggings_on_taggable_id_and_taggable_type ON taggings USING btree (taggable_id, taggable_type); - CREATE INDEX index_taggings_on_taggable_id_and_taggable_type_and_context ON taggings USING btree (taggable_id, taggable_type, context); CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name); @@ -27683,6 +30281,8 @@ CREATE INDEX index_todos_on_note_id ON todos USING btree (note_id); CREATE INDEX index_todos_on_project_id ON todos USING btree (project_id); +CREATE INDEX index_todos_on_project_id_and_user_id_and_id ON todos USING btree (project_id, user_id, id); + CREATE INDEX index_todos_on_target_type_and_target_id ON todos USING btree (target_type, target_id); CREATE INDEX index_todos_on_user_id ON todos USING btree (user_id); @@ -27697,6 +30297,10 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name); +CREATE INDEX index_topics_on_name_trigram ON topics USING gin (name gin_trgm_ops); + +CREATE INDEX index_topics_total_projects_count ON topics USING btree (total_projects_count DESC, id); + 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); @@ -27715,6 +30319,16 @@ CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_fail CREATE UNIQUE INDEX index_upcoming_reconciliations_on_namespace_id ON upcoming_reconciliations USING btree (namespace_id); +CREATE INDEX index_upload_states_failed_verification ON upload_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_upload_states_needs_verification ON upload_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_upload_states_on_upload_id ON upload_states USING btree (upload_id); + +CREATE INDEX index_upload_states_on_verification_state ON upload_states USING btree (verification_state); + +CREATE INDEX index_upload_states_pending_verification ON upload_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum); CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type); @@ -27735,10 +30349,18 @@ CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id ON user_canonical_ema CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id_and_canonical_email ON user_canonical_emails USING btree (user_id, canonical_email); +CREATE INDEX index_user_credit_card_validations_meta_data_full_match ON user_credit_card_validations USING btree (holder_name, expiration_date, last_digits, credit_card_validated_at); + +CREATE INDEX index_user_credit_card_validations_meta_data_partial_match ON user_credit_card_validations USING btree (expiration_date, last_digits, network, credit_card_validated_at); + CREATE INDEX index_user_custom_attributes_on_key_and_value ON user_custom_attributes USING btree (key, value); CREATE UNIQUE INDEX index_user_custom_attributes_on_user_id_and_key ON user_custom_attributes USING btree (user_id, key); +CREATE UNIQUE INDEX index_user_details_on_phone ON user_details USING btree (phone) WHERE (phone IS NOT NULL); + +COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index'; + CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING btree (provisioned_by_group_id); CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id); @@ -27777,7 +30399,7 @@ CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token); CREATE INDEX index_users_on_group_view ON users USING btree (group_view); -CREATE INDEX index_users_on_id_and_last_activity_on_for_non_internal_active ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4])))); +CREATE INDEX index_users_on_id_and_last_activity_on_for_active_human_service ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 4))); CREATE INDEX index_users_on_incoming_email_token ON users USING btree (incoming_email_token); @@ -27787,7 +30409,7 @@ CREATE INDEX index_users_on_name ON users USING btree (name); CREATE INDEX index_users_on_name_trigram ON users USING gin (name gin_trgm_ops); -CREATE INDEX index_users_on_public_email ON users USING btree (public_email) WHERE ((public_email)::text <> ''::text); +CREATE INDEX index_users_on_public_email_excluding_null_and_empty ON users USING btree (public_email) WHERE (((public_email)::text <> ''::text) AND (public_email IS NOT NULL)); CREATE INDEX index_users_on_require_two_factor_authentication_from_group ON users USING btree (require_two_factor_authentication_from_group) WHERE (require_two_factor_authentication_from_group = true); @@ -27823,6 +30445,8 @@ CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date); +CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC); + CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); CREATE INDEX index_vulnerabilities_on_confirmed_by_id ON vulnerabilities USING btree (confirmed_by_id); @@ -27893,12 +30517,20 @@ CREATE INDEX index_vulnerability_occurrence_identifiers_on_identifier_id ON vuln CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON vulnerability_occurrence_identifiers USING btree (occurrence_id, identifier_id); +CREATE INDEX index_vulnerability_occurrence_pipelines_occurrence_id_and_id ON vulnerability_occurrence_pipelines USING btree (occurrence_id, id DESC); + CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id); CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint); CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); +CREATE INDEX index_vulnerability_occurrences_on_location_cluster_id ON vulnerability_occurrences USING gin (((location -> 'cluster_id'::text))) WHERE (report_type = 7); + +CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7])); + +CREATE INDEX index_vulnerability_occurrences_on_migrated_to_new_structure ON vulnerability_occurrences USING btree (migrated_to_new_structure, id); + CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerability_occurrences USING btree (project_fingerprint); @@ -27911,6 +30543,14 @@ CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occ CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id); +CREATE INDEX index_vulnerability_reads_on_location_image ON vulnerability_reads USING btree (location_image) WHERE (report_type = ANY (ARRAY[2, 7])); + +CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USING btree (scanner_id); + +CREATE UNIQUE INDEX index_vulnerability_reads_on_uuid ON vulnerability_reads USING btree (uuid); + +CREATE UNIQUE INDEX index_vulnerability_reads_on_vulnerability_id ON vulnerability_reads USING btree (vulnerability_id); + CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum ON vulnerability_remediations USING btree (project_id, checksum); CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id); @@ -28021,21 +30661,15 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); -CREATE INDEX tmp_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true); - -CREATE INDEX tmp_index_ci_builds_lock_version ON ci_builds USING btree (id) WHERE (lock_version IS NULL); - CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL); -CREATE INDEX tmp_index_ci_stages_lock_version ON ci_stages USING btree (id_convert_to_bigint) WHERE (lock_version 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 UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USING btree (tmp_project_id); -CREATE INDEX tmp_index_taggings_on_id_where_taggable_type_project ON taggings USING btree (id) WHERE ((taggable_type)::text = 'Project'::text); +CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); @@ -28061,6 +30695,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 INDEX vulnerability_occurrences_location_temp_index ON vulnerability_occurrences USING btree (id) WHERE (location IS NULL); + 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; @@ -28117,15 +30753,49 @@ 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_202307_pkey; -ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211_pkey; +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308_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_202308_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202308_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309_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_202309_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202309_pkey; + +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration__idx; + +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx1; + +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx2; + +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx3; + +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx4; -ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212_pkey; +ALTER INDEX i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx5; -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 i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx6; -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 i_batched_background_migration_job_transition_logs_on_job_id ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration__batched_background_migration_idx7; -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 batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308_pkey; + +ALTER INDEX batched_background_migration_job_transition_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309_pkey; ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301_pkey; @@ -28141,6 +30811,10 @@ ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307_pkey; +ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308_pkey; + +ALTER INDEX incident_management_pending_alert_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309_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; @@ -28157,7 +30831,9 @@ ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTAC 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_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx7; + +ALTER INDEX index_incident_management_pending_alert_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_2023_rule_id_idx8; 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; @@ -28171,33 +30847,9 @@ ALTER INDEX index_incident_management_pending_alert_escalations_on_alert_id ATTA 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_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx8; -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 index_incident_management_pending_alert_escalations_on_alert_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202_alert_id_idx9; ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301_pkey; @@ -28213,6 +30865,10 @@ ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307_pkey; +ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308_pkey; + +ALTER INDEX incident_management_pending_issue_escalations_pkey ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309_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; @@ -28229,7 +30885,9 @@ ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTAC 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_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx7; + +ALTER INDEX index_incident_management_pending_issue_escalations_on_rule_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_2023_rule_id_idx8; 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; @@ -28243,31 +30901,53 @@ ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTA 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_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx8; + +ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx9; + 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; -ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_80bf138a51; - ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_962081978f; -ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_eecfac613f; - 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 verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_visitor_id_code_phone_created_at_idx; + +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302_pkey; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202212_pkey; +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302_visitor_id_code_phone_created_at_idx; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202301_pkey; +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303_pkey; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202302_pkey; +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303_visitor_id_code_phone_created_at_idx; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202303_pkey; +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304_pkey; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_202304_pkey; +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304_visitor_id_code_phone_created_at_idx; -ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey; +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305_visitor_id_code_phone_created_at_idx; + +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306_visitor_id_code_phone_created_at_idx; + +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307_visitor_id_code_phone_created_at_idx; + +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308_visitor_id_code_phone_created_at_idx; + +ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309_pkey; + +ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309_visitor_id_code_phone_created_at_idx; ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey; @@ -28309,6 +30989,18 @@ 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_202307_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_202308_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202308_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_202309_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202309_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; @@ -28437,6 +31129,906 @@ ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PAR 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_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_000925dbd7; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_006f943df6; + +ALTER INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ATTACH PARTITION gitlab_partitions_static.index_01e3390fac; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_02749b504c; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_0287f5ba09; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_03aa30a758; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_055179c3ea; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_061fe00461; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_070cef72c3; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_08e3cfc564; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_09af45dd6f; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_0c153e2eae; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0ca85f3d71; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0d837a5dda; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_0f28a65451; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_10588dbff0; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_107e123e17; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1230a7a402; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_142c4e7ea4; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_14e4fa1d7d; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_14f3645821; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_16627b455e; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_1a0388713a; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1a349ed064; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1af932a3c7; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1b0ea30bdb; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1f6c3faabe; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_1f8af04ed1; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_201c5ddbe9; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_20353089e0; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_206349925b; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_21db459e34; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_21e262390a; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2208bd7d7f; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_223592b4a1; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_22acc9ab11; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_22ed8f01dd; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_234d38a657; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_23783dc748; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_241e9a574c; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_24ac321751; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_25e2aaee9b; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2653e7eeb8; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_2745f5a388; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_27759556bc; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_27d7ad78d8; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_281840d2d1; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_296f64df5c; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2ad4b4fdbc; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2b7c0a294e; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2c6422f668; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2dfcdbe81e; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2e1054b181; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2e6991d05b; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_2f80c360c3; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_2fc271c673; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_2fcfd0dc70; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_3005c75335; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3206c1e6af; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3249505125; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_331eb67441; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3640194b77; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_372160a706; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_38a538234e; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_39625b8a41; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_399dc06649; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3a10b315c0; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_3c2a3a6ac9; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_3e6be332b7; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_41a1c3a4c6; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_435802dd01; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_436fa9ad5f; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_453a659cb6; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_46b989b294; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_47638677a3; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4810ac88f5; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_491b4b749e; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4a243772d7; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4b1793a4c4; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4b22560035; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4c2645eef2; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4c9d14f978; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4d04210a95; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4d4f2f7de6; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_4db5aa5872; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4dead6f314; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4e6ce1c371; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_4f2eb7a06b; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_4f6fc34e57; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_50c09f6e04; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5111e3e7e7; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_52ea79bf8e; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_541cc045fc; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_551676e972; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_56281bfb73; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5660b1b38e; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_59a8209ab6; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_59ce40fcc4; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5a5f39d824; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5b613b5fcf; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_5b944f308d; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5bc2f32084; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5c4053b63d; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_5db09170d4; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5ee060202f; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5f24f6ead2; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_5f96b344e2; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5fb1867c41; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_5fe1d00845; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_60e3480f23; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_6137e27484; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_620fe77c99; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_625ed9e965; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_64e3a1dfa1; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_64eb4cf8bd; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6580ecb2db; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_682eba05f6; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_69bdcf213e; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_6a39f6d5ac; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6add8e74cf; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6b1ce61c8f; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_6cfb391b86; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6e6c2e6a1d; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_6ea423bbd1; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6ec4c4afd4; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6f4e0abe54; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_6fa47e1334; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_70c657954b; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_71c2b26944; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_72027c157f; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_739845f617; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_74addd1240; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_75dc81d1d7; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_765b0cd8db; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_77096a1dc6; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_77c6293242; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_7b7c85eceb; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_7da2307d2e; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_7ead2300ca; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_7ecb5b68b4; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_807671c4be; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_807fa83fc0; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_80c65daf20; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_81b9cf594f; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_82c675952c; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_83c5049b3e; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_83edf231b8; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_844abd2888; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8464227c80; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8685d7c69c; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_8688b40056; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_87d40fb9f9; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_88b40d6740; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_89c79afe5c; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_8a0fc3de4f; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_8b9f9a19a4; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_8fb48e72ce; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_9201b952a0; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_92c09e352b; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9490e0e0b7; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_95a353f50b; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_971af9481e; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9955b1dc59; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_9b8e89ae41; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_9ee83b068b; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a1a9dc36c1; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a2d9f185a5; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a3feed3097; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a6999c65c9; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_a6c68d16b2; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_a8276a450f; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a88f20fc98; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a9424aa392; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_a99cee1904; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_a9deff2159; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_aabc184267; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ab22231a16; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_abbdf80ab1; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_adc159c3fe; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_aed7f7b10c; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_aee84adb5b; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b1dda405af; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b607012614; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_b7f21460bb; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_b83fe1306b; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bc189e47ab; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_bca83177ef; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bedd7e160b; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_bee2b94a80; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c08e669dfa; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c09bb66559; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c119f5b92e; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c17dae3605; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c1cdd90d0d; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c2b951bf20; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c42b2e7eae; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c435d904ce; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c473921734; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c546bb0736; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c59cde6209; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c66758baa7; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c6ea8a0e26; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_c8c4219c0a; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_c971e6c5ce; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_c9b14a3d9f; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cbb61ea269; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_cc0ba6343b; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_cd2b2939a4; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cda41e106e; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_cfa4237c83; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_d01ea0126a; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d0d285c264; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d27b4c84e7; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d2fe918e83; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d35c969634; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d6047ee813; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d69c2485f4; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_d8fa9793ad; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_d9384b768d; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_dc571ba649; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_df62a8c50e; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e1a4f994d8; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e3d1fd5b19; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e3d6234929; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e54adf9acb; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e6405afea0; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_e64588e276; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e716b8ac3f; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e73bc5ba6a; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_e8f3a327b2; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ea0c2d3361; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_eb558957f0; + +ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_ec25d494e6; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ed094a4f13; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ee4c549a2d; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ef6a48bd29; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_ef7be2ae94; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f0cdd09a5e; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f112fae8ac; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f1c3d14cdc; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f256d3f6a1; + +ALTER INDEX index_issue_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_f2848acfc7; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f3d7d86e09; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f47327ec1f; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_f6b0d458a3; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f705dc8541; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f76e8a5304; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f86acdc2ff; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f878aab8e3; + +ALTER INDEX index_issue_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_f902c261ce; + +ALTER INDEX index_merge_request_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fbccc855cf; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fbf2d3310b; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_fccbe45c32; + +ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_fee429223e; + +ALTER INDEX index_merge_request_stage_events_project_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ff00c038cc; + +ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_ff39be5400; + +ALTER INDEX index_issue_stage_events_group_in_progress_duration ATTACH PARTITION gitlab_partitions_static.index_ff8741d8d7; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_00_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_01_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_02_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_03_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_04_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_05_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_06_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_07_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_08_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_09_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_10_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_11_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_12_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_13_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_14_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_15_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_16_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_17_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_18_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_19_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_20_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_21_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_22_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_23_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_24_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_25_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_26_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_27_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_28_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_29_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_30_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_31_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_32_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_33_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_34_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_35_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_36_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_37_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_38_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_39_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_40_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_41_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_42_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_43_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_44_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_45_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_46_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_47_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_48_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_49_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_50_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_51_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_52_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_53_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_54_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_55_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_56_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_57_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_58_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_59_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_60_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_61_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_62_search_vector_idx; + +ALTER INDEX index_issue_search_data_on_issue_id ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_issue_id_idx; + +ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_pkey; + +ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_search_vector_idx; + +ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1_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; @@ -28693,31 +32285,19 @@ 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 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 chat_names_loose_fk_trigger AFTER DELETE ON chat_names REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_490d204c00b3 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_490d204c00b3(); +CREATE TRIGGER ci_builds_loose_fk_trigger AFTER DELETE ON ci_builds REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e(); +CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10(); +CREATE TRIGGER ci_runners_loose_fk_trigger AFTER DELETE ON ci_runners REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482(); +CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3(); +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_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 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_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_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_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(); @@ -28733,8 +32313,43 @@ CREATE TRIGGER trigger_has_external_wiki_on_type_new_updated AFTER UPDATE OF typ 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_namespaces_parent_id_on_insert AFTER INSERT ON namespaces FOR EACH ROW EXECUTE FUNCTION insert_namespaces_sync_event(); + +CREATE TRIGGER trigger_namespaces_parent_id_on_update AFTER UPDATE ON namespaces FOR EACH ROW WHEN ((old.parent_id IS DISTINCT FROM new.parent_id)) EXECUTE FUNCTION insert_namespaces_sync_event(); + +CREATE TRIGGER trigger_projects_parent_id_on_insert AFTER INSERT ON projects FOR EACH ROW EXECUTE FUNCTION insert_projects_sync_event(); + +CREATE TRIGGER trigger_projects_parent_id_on_update AFTER UPDATE ON projects FOR EACH ROW WHEN ((old.namespace_id IS DISTINCT FROM new.namespace_id)) EXECUTE FUNCTION insert_projects_sync_event(); + CREATE TRIGGER trigger_type_new_on_insert AFTER INSERT ON integrations FOR EACH ROW EXECUTE FUNCTION integrations_set_type_new(); +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 + ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 + ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 + ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202212 + ADD CONSTRAINT fk_rails_636678b3bd FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 + ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 + ADD CONSTRAINT fk_rails_8d8de95da9 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000 + ADD CONSTRAINT fk_rails_bb3355782d FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202211 + ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202212 + ADD CONSTRAINT fk_rails_f3d17bc8af FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE; + ALTER TABLE ONLY chat_names ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE; @@ -28744,9 +32359,6 @@ ALTER TABLE ONLY deployments ALTER TABLE ONLY epics ADD CONSTRAINT fk_013c9f36ca FOREIGN KEY (due_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL; -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; @@ -28756,9 +32368,6 @@ 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 terraform_state_versions - ADD CONSTRAINT fk_04b91e4a9f FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL; - ALTER TABLE ONLY issues ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -28771,6 +32380,9 @@ ALTER TABLE ONLY projects ALTER TABLE ONLY dast_sites ADD CONSTRAINT fk_0a57f2271b FOREIGN KEY (dast_site_validation_id) REFERENCES dast_site_validations(id) ON DELETE SET NULL; +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT fk_0c0037f723 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY web_hooks ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28783,12 +32395,18 @@ ALTER TABLE ONLY lists 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 deployment_approvals + ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + 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 group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY member_tasks + ADD CONSTRAINT fk_12816d4bbb FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_1302949740 FOREIGN KEY (last_edited_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -28807,6 +32425,12 @@ ALTER TABLE ONLY internal_ids ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_176d3fbb5d FOREIGN KEY (job_artifact_deleted_event_id) REFERENCES geo_job_artifact_deleted_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_timeline_events + ADD CONSTRAINT fk_17a5fafbd4 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY incident_management_timeline_events + ADD CONSTRAINT fk_1800597ef9 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY project_features ADD CONSTRAINT fk_18513d9b92 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28819,6 +32443,9 @@ ALTER TABLE ONLY analytics_devops_adoption_segments ALTER TABLE ONLY user_details ADD CONSTRAINT fk_190e4fcc88 FOREIGN KEY (provisioned_by_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY agent_project_authorizations + ADD CONSTRAINT fk_1d30bb4987 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL; @@ -28828,6 +32455,9 @@ ALTER TABLE ONLY ci_sources_pipelines ALTER TABLE ONLY epics ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_204d40056a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_container_repository_updated_events ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; @@ -28849,24 +32479,33 @@ ALTER TABLE ONLY import_failures ALTER TABLE ONLY project_ci_cd_settings ADD CONSTRAINT fk_24c15d2f2e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_activity_events + ADD CONSTRAINT fk_256c631779 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_25b99c1be3 FOREIGN KEY (parent_id) REFERENCES epics(id) ON DELETE CASCADE; 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 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; ALTER TABLE ONLY deployments ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL; +ALTER TABLE ONLY merge_requests_compliance_violations + ADD CONSTRAINT fk_290ec1ab02 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_29f6f15f82 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY agent_group_authorizations ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY deployment_approvals + ADD CONSTRAINT fk_2d060dfc73 FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_freeze_periods ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28912,12 +32551,18 @@ 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 incident_management_timeline_events + ADD CONSTRAINT fk_38a74279df FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY bulk_import_exports ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_activity_events + ADD CONSTRAINT fk_3af186389b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE SET NULL; + ALTER TABLE ONLY issues ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; @@ -28933,6 +32578,9 @@ ALTER TABLE ONLY ci_pipeline_schedule_variables ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_42c3b54bed FOREIGN KEY (cache_invalidation_event_id) REFERENCES geo_cache_invalidation_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_timeline_events + ADD CONSTRAINT fk_4432fc4d78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_runner_projects ADD CONSTRAINT fk_4478a6f1e4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28945,8 +32593,8 @@ 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 dep_ci_build_trace_sections - ADD CONSTRAINT fk_4ebe41f502 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_reads + ADD CONSTRAINT fk_5001652292 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_51ab4b6089 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id) ON DELETE CASCADE; @@ -28996,6 +32644,9 @@ ALTER TABLE ONLY dast_profile_schedules ALTER TABLE ONLY events ADD CONSTRAINT fk_61fbf6ca48 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_reads + ADD CONSTRAINT fk_62736f638f FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_641731faff FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -29011,6 +32662,9 @@ ALTER TABLE ONLY application_settings ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY namespaces + ADD CONSTRAINT fk_6a77f66919 FOREIGN KEY (tmp_project_id) REFERENCES projects(id) ON DELETE CASCADE; + 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; @@ -29071,6 +32725,9 @@ ALTER TABLE ONLY protected_branches ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT fk_7b92f835bb FOREIGN KEY (contact_id) REFERENCES customer_relations_contacts(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -29188,6 +32845,9 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY epics ADD CONSTRAINT fk_9d480c64b2 FOREIGN KEY (start_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL; +ALTER TABLE ONLY user_group_callouts + ADD CONSTRAINT fk_9dc8b9d4b2 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_environments ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -29251,6 +32911,9 @@ ALTER TABLE ONLY identities ALTER TABLE ONLY boards ADD CONSTRAINT fk_ab0a250ff6 FOREIGN KEY (iteration_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE; +ALTER TABLE ONLY member_tasks + ADD CONSTRAINT fk_ab636303dd FOREIGN KEY (project_id) REFERENCES projects(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; @@ -29278,6 +32941,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 vulnerability_reads + ADD CONSTRAINT fk_b28c28abf1 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues ADD CONSTRAINT fk_b37be69be6 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id); @@ -29296,6 +32962,9 @@ ALTER TABLE ONLY external_status_checks_protected_branches ALTER TABLE ONLY issue_assignees ADD CONSTRAINT fk_b7d881734a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_project_authorizations + ADD CONSTRAINT fk_b7fe9b4777 FOREIGN KEY (agent_id) REFERENCES cluster_agents(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; @@ -29332,12 +33001,12 @@ ALTER TABLE ONLY design_management_versions ALTER TABLE ONLY packages_packages ADD CONSTRAINT fk_c188f0dba4 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; -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 user_group_callouts + ADD CONSTRAINT fk_c366e12ec3 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -29350,6 +33019,12 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY issues ADD CONSTRAINT fk_c63cbf6c25 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY agent_activity_events + ADD CONSTRAINT fk_c815368376 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; + +ALTER TABLE ONLY agent_activity_events + ADD CONSTRAINT fk_c8b006d40f FOREIGN KEY (agent_token_id) REFERENCES cluster_agent_tokens(id) ON DELETE SET NULL; + ALTER TABLE ONLY issue_links ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -29398,9 +33073,15 @@ 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 incident_management_timeline_events + ADD CONSTRAINT fk_d606a2a890 FOREIGN KEY (promoted_from_note_id) REFERENCES notes(id) ON DELETE SET NULL; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_activity_events + ADD CONSTRAINT fk_d6f785c9fc FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY metrics_users_starred_dashboards ADD CONSTRAINT fk_d76a2b9a8c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -29488,9 +33169,15 @@ ALTER TABLE ONLY pages_domains 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 events ADD CONSTRAINT fk_edfd187b6f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_ef5ebf339f FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_efb96ab1e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -29713,9 +33400,6 @@ ALTER TABLE ONLY project_deploy_tokens ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT fk_rails_1722574860 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; -ALTER TABLE ONLY packages_build_infos - ADD CONSTRAINT fk_rails_17a9a0dffc FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; - ALTER TABLE ONLY security_orchestration_policy_rule_schedules ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; @@ -29737,9 +33421,6 @@ ALTER TABLE ONLY bulk_import_failures 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 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; @@ -29824,9 +33505,6 @@ ALTER TABLE ONLY incident_management_oncall_rotations ALTER TABLE ONLY ci_unit_test_failures ADD CONSTRAINT fk_rails_259da3e79c FOREIGN KEY (unit_test_id) REFERENCES ci_unit_tests(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_snapshots - ADD CONSTRAINT fk_rails_25da9a92c0 FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; - ALTER TABLE ONLY cluster_agents ADD CONSTRAINT fk_rails_25e9fc2d5d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -29983,9 +33661,6 @@ ALTER TABLE ONLY snippet_user_mentions ALTER TABLE ONLY clusters_applications_helm ADD CONSTRAINT fk_rails_3e2b1c06bc FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY packages_package_file_build_infos - ADD CONSTRAINT fk_rails_3e3f630188 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; - ALTER TABLE ONLY epic_user_mentions ADD CONSTRAINT fk_rails_3eaf4d88cc FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -30001,6 +33676,9 @@ ALTER TABLE ONLY description_versions ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT fk_rails_40cc7ccbc3 FOREIGN KEY (cluster_project_id) REFERENCES cluster_projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY lfs_object_states + ADD CONSTRAINT fk_rails_4188448cd5 FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_node_namespace_links ADD CONSTRAINT fk_rails_41ff5fb854 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -30010,9 +33688,6 @@ ALTER TABLE ONLY epic_issues ALTER TABLE ONLY ci_refs ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY security_orchestration_policy_configurations - ADD CONSTRAINT fk_rails_42ed6c25ec FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE RESTRICT; - ALTER TABLE ONLY ci_resources ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE; @@ -30424,6 +34099,9 @@ ALTER TABLE ONLY application_settings ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT fk_rails_7e7688ecaf FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_artifact_states + ADD CONSTRAINT fk_rails_80a9cba3b2 FOREIGN KEY (job_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE; + ALTER TABLE ONLY approval_merge_request_rules_users ADD CONSTRAINT fk_rails_80e6801803 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; @@ -30598,6 +34276,9 @@ ALTER TABLE ONLY gpg_keys ALTER TABLE ONLY analytics_language_trend_repository_languages ADD CONSTRAINT fk_rails_9d851d566c FOREIGN KEY (programming_language_id) REFERENCES programming_languages(id) ON DELETE CASCADE; +ALTER TABLE ONLY namespaces_sync_events + ADD CONSTRAINT fk_rails_9da32a0431 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY badges ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -30679,9 +34360,6 @@ 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 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 ADD CONSTRAINT fk_rails_abf5d4affa FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -30745,6 +34423,9 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER TABLE ONLY namespace_aggregation_schedules ADD CONSTRAINT fk_rails_b565c8d16c FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE batched_background_migration_job_transition_logs + ADD CONSTRAINT fk_rails_b7523a175b FOREIGN KEY (batched_background_migration_job_id) REFERENCES batched_background_migration_jobs(id) ON DELETE CASCADE; + ALTER TABLE ONLY approval_project_rules_protected_branches ADD CONSTRAINT fk_rails_b7567b031b FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; @@ -30769,6 +34450,9 @@ ALTER TABLE ONLY security_findings ALTER TABLE ONLY packages_debian_project_component_files ADD CONSTRAINT fk_rails_bbe9ebfbd9 FOREIGN KEY (component_id) REFERENCES packages_debian_project_components(id) ON DELETE RESTRICT; +ALTER TABLE ONLY projects_sync_events + ADD CONSTRAINT fk_rails_bbf0eef59f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY approval_merge_request_rules_users ADD CONSTRAINT fk_rails_bc8972fa55 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -30802,6 +34486,9 @@ ALTER TABLE ONLY atlassian_identities ALTER TABLE ONLY serverless_domain_cluster ADD CONSTRAINT fk_rails_c09009dee1 FOREIGN KEY (pages_domain_id) REFERENCES pages_domains(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_npm_metadata + ADD CONSTRAINT fk_rails_c0e5fce6f3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + ALTER TABLE ONLY labels ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -30820,9 +34507,6 @@ ALTER TABLE ONLY packages_nuget_dependency_link_metadata ALTER TABLE ONLY group_deploy_keys_groups ADD CONSTRAINT fk_rails_c3854f19f5 FOREIGN KEY (group_deploy_key_id) REFERENCES group_deploy_keys(id) ON DELETE CASCADE; -ALTER TABLE ONLY pages_deployments - ADD CONSTRAINT fk_rails_c3a90cf29b FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL; - ALTER TABLE ONLY merge_request_user_mentions ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -30895,6 +34579,9 @@ ALTER TABLE ONLY resource_iteration_events ALTER TABLE ONLY vulnerability_finding_evidence_requests ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE; +ALTER TABLE ONLY upload_states + ADD CONSTRAINT fk_rails_d00f153613 FOREIGN KEY (upload_id) REFERENCES uploads(id) ON DELETE CASCADE; + ALTER TABLE ONLY epic_metrics ADD CONSTRAINT fk_rails_d071904753 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -30988,6 +34675,9 @@ 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 issue_emails + ADD CONSTRAINT fk_rails_e2ee00a8f7 FOREIGN KEY (issue_id) REFERENCES issues(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; @@ -31102,9 +34792,6 @@ ALTER TABLE ONLY snippet_repositories ALTER TABLE ONLY elastic_reindexing_subtasks ADD CONSTRAINT fk_rails_f2cc190164 FOREIGN KEY (elastic_reindexing_task_id) REFERENCES elastic_reindexing_tasks(id) ON DELETE CASCADE; -ALTER TABLE ONLY ci_pipeline_chat_data - ADD CONSTRAINT fk_rails_f300456b63 FOREIGN KEY (chat_name_id) REFERENCES chat_names(id) ON DELETE CASCADE; - ALTER TABLE ONLY approval_project_rules_users ADD CONSTRAINT fk_rails_f365da8250 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -31141,9 +34828,6 @@ 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 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 ADD CONSTRAINT fk_rails_f90820cb08 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; @@ -31171,9 +34855,6 @@ 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; @@ -31192,9 +34873,15 @@ ALTER TABLE ONLY project_tracing_settings ALTER TABLE ONLY resource_label_events ADD CONSTRAINT fk_rails_fe91ece594 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY pages_deployment_states + ADD CONSTRAINT fk_rails_ff6ca551a4 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_orchestration_policy_configurations + ADD CONSTRAINT fk_security_policy_configurations_management_project_id FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(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; @@ -31213,6 +34900,12 @@ ALTER TABLE ONLY timelogs ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE issue_search_data + ADD CONSTRAINT issue_search_data_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE issue_search_data + ADD CONSTRAINT issue_search_data_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; diff --git a/db/migrate/20210826171758_init_schema.rb b/db/migrate/20210826171758_init_schema.rb deleted file mode 100644 index 971a3e0e2db..00000000000 --- a/db/migrate/20210826171758_init_schema.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class InitSchema < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - execute(File.read("db/init_structure.sql")) - end - - def down - raise ActiveRecord::IrreversibleMigration, "The initial migration is not able to be reverted." - end -end diff --git a/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb b/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb deleted file mode 100644 index bc515bc061c..00000000000 --- a/db/migrate/20210830085837_add_throttle_authenticated_git_lfs_columns.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddThrottleAuthenticatedGitLfsColumns < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period, :integer, default: 1000, null: false - add_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds, :integer, default: 60, null: false - add_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean, default: false, null: false - end - end - - def down - with_lock_retries do - remove_column :application_settings, :throttle_authenticated_git_lfs_requests_per_period - remove_column :application_settings, :throttle_authenticated_git_lfs_period_in_seconds - remove_column :application_settings, :throttle_authenticated_git_lfs_enabled, :boolean - end - end -end diff --git a/db/migrate/20210830140524_add_state_to_member.rb b/db/migrate/20210830140524_add_state_to_member.rb deleted file mode 100644 index 6009376badb..00000000000 --- a/db/migrate/20210830140524_add_state_to_member.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddStateToMember < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - def up - unless column_exists?(:members, :state) - with_lock_retries do - add_column :members, :state, :integer, limit: 2, default: 0 - end - end - end - - def down - if column_exists?(:members, :state) - with_lock_retries do - remove_column :members, :state - end - end - end -end diff --git a/db/migrate/20210830154358_add_yaml_limit_constraints.rb b/db/migrate/20210830154358_add_yaml_limit_constraints.rb deleted file mode 100644 index 74236993fff..00000000000 --- a/db/migrate/20210830154358_add_yaml_limit_constraints.rb +++ /dev/null @@ -1,25 +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 AddYamlLimitConstraints < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - SIZE_CONSTRAINT_NAME = 'app_settings_yaml_max_size_positive' - DEPTH_CONSTRAINT_NAME = 'app_settings_yaml_max_depth_positive' - - disable_ddl_transaction! - - def up - add_check_constraint :application_settings, 'max_yaml_size_bytes > 0', SIZE_CONSTRAINT_NAME - add_check_constraint :application_settings, 'max_yaml_depth > 0', DEPTH_CONSTRAINT_NAME - end - - def down - remove_check_constraint :application_settings, SIZE_CONSTRAINT_NAME - remove_check_constraint :application_settings, DEPTH_CONSTRAINT_NAME - end -end diff --git a/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb b/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb deleted file mode 100644 index a3366bd9ddb..00000000000 --- a/db/migrate/20210831134840_add_package_file_id_channel_idx_to_packages_helm_file_metadata.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPackageFileIdChannelIdxToPackagesHelmFileMetadata < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_packages_helm_file_metadata_on_pf_id_and_channel' - - def up - add_concurrent_index :packages_helm_file_metadata, [:package_file_id, :channel], name: INDEX_NAME - end - - def down - remove_concurrent_index :packages_helm_file_metadata, [:package_file_id, :channel], name: INDEX_NAME - end -end diff --git a/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb b/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb deleted file mode 100644 index 5e65b5c0fe1..00000000000 --- a/db/migrate/20210831135249_add_installable_helm_pkgs_idx_to_packages.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddInstallableHelmPkgsIdxToPackages < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'idx_installable_helm_pkgs_on_project_id_id' - - def up - add_concurrent_index :packages_packages, [:project_id, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index :packages_packages, [:project_id, :id], name: INDEX_NAME - end -end diff --git a/db/migrate/20210831203408_upsert_base_work_item_types.rb b/db/migrate/20210831203408_upsert_base_work_item_types.rb deleted file mode 100644 index 9a556bd6c2c..00000000000 --- a/db/migrate/20210831203408_upsert_base_work_item_types.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class UpsertBaseWorkItemTypes < ActiveRecord::Migration[6.1] - module WorkItem - class Type < ActiveRecord::Base - self.table_name = 'work_item_types' - - enum base_type: { - issue: 0, - incident: 1, - test_case: 2, - requirement: 3 - } - end - end - - def up - # upsert default types - WorkItem::Type.find_or_create_by(name: 'Issue', namespace_id: nil, base_type: :issue, icon_name: 'issue-type-issue') - WorkItem::Type.find_or_create_by(name: 'Incident', namespace_id: nil, base_type: :incident, icon_name: 'issue-type-incident') - WorkItem::Type.find_or_create_by(name: 'Test Case', namespace_id: nil, base_type: :test_case, icon_name: 'issue-type-test-case') - WorkItem::Type.find_or_create_by(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/20210901065504_add_index_on_name_and_id_to_public_groups.rb b/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb deleted file mode 100644 index e0c9d932b38..00000000000 --- a/db/migrate/20210901065504_add_index_on_name_and_id_to_public_groups.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnNameAndIdToPublicGroups < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_namespaces_public_groups_name_id' - PUBLIC_VISIBILITY_LEVEL = 20 - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, [:name, :id], - name: INDEX_NAME, - where: "type = 'Group' AND visibility_level = #{PUBLIC_VISIBILITY_LEVEL}" - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb b/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb deleted file mode 100644 index 3c022cbaf5e..00000000000 --- a/db/migrate/20210902171406_add_latest_column_into_the_security_scans_table.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddLatestColumnIntoTheSecurityScansTable < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - add_column :security_scans, :latest, :boolean, default: true, null: false - end - - def down - remove_column :security_scans, :latest - end -end diff --git a/db/migrate/20210902171808_set_default_job_token_scope_false.rb b/db/migrate/20210902171808_set_default_job_token_scope_false.rb deleted file mode 100644 index 0680382094f..00000000000 --- a/db/migrate/20210902171808_set_default_job_token_scope_false.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class SetDefaultJobTokenScopeFalse < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - 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/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb b/db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb deleted file mode 100644 index 4638637331d..00000000000 --- a/db/migrate/20210902184334_add_expire_access_tokens_to_doorkeeper_application.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddExpireAccessTokensToDoorkeeperApplication < Gitlab::Database::Migration[1.0] - def change - add_column :oauth_applications, :expire_access_tokens, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb b/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb deleted file mode 100644 index 6c5d23d8703..00000000000 --- a/db/migrate/20210903054158_recreate_stage_issue_events_table_with_bigints.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class RecreateStageIssueEventsTableWithBigints < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - def up - drop_table :analytics_cycle_analytics_issue_stage_events # rubocop:disable Migration/DropTable - - execute <<~SQL - CREATE TABLE analytics_cycle_analytics_issue_stage_events ( - stage_event_hash_id bigint NOT NULL, - issue_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, 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 - - 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 -end diff --git a/db/migrate/20210906100021_delete_project_namespace_trigger.rb b/db/migrate/20210906100021_delete_project_namespace_trigger.rb deleted file mode 100644 index ce68cf7d6d4..00000000000 --- a/db/migrate/20210906100021_delete_project_namespace_trigger.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class DeleteProjectNamespaceTrigger < Gitlab::Database::Migration[1.0] - include Gitlab::Database::SchemaHelpers - - TRIGGER_NAME = "trigger_delete_project_namespace_on_project_delete" - FUNCTION_NAME = 'delete_associated_project_namespace' - - def up - create_trigger_function(FUNCTION_NAME, replace: true) do - <<~SQL - DELETE FROM namespaces - WHERE namespaces.id = OLD.project_namespace_id AND - namespaces.type = 'Project'; - RETURN NULL; - SQL - end - - execute(<<~SQL.squish) - CREATE TRIGGER #{TRIGGER_NAME} - AFTER DELETE ON projects FOR EACH ROW - WHEN (OLD.project_namespace_id IS NOT NULL) - EXECUTE FUNCTION #{FUNCTION_NAME}(); - SQL - end - - def down - drop_trigger(:projects, TRIGGER_NAME) - drop_function(FUNCTION_NAME) - end -end diff --git a/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb b/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb deleted file mode 100644 index 540344bd761..00000000000 --- a/db/migrate/20210907182337_add_group_id_fkey_for_user_group_callout.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddGroupIdFkeyForUserGroupCallout < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :user_group_callouts, :namespaces, column: :group_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :user_group_callouts, column: :group_id - end - end -end diff --git a/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb b/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb deleted file mode 100644 index 37b73335933..00000000000 --- a/db/migrate/20210907182359_add_user_id_fkey_for_user_group_callout.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUserIdFkeyForUserGroupCallout < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :user_group_callouts, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :user_group_callouts, column: :user_id - end - end -end diff --git a/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb b/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb deleted file mode 100644 index 85c7522d006..00000000000 --- a/db/migrate/20210908060951_add_dast_schedules_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDastSchedulesToPlanLimits < Gitlab::Database::Migration[1.0] - def change - add_column(:plan_limits, :dast_profile_schedules, :integer, default: 1, null: false) - end -end diff --git a/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb b/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb deleted file mode 100644 index b9980f65c98..00000000000 --- a/db/migrate/20210908061132_insert_dast_profile_schedules_plan_limits.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class InsertDastProfileSchedulesPlanLimits < Gitlab::Database::Migration[1.0] - def up - create_or_update_plan_limit('dast_profile_schedules', 'default', 0) - create_or_update_plan_limit('dast_profile_schedules', 'free', 1) - create_or_update_plan_limit('dast_profile_schedules', 'bronze', 1) - create_or_update_plan_limit('dast_profile_schedules', 'silver', 1) - create_or_update_plan_limit('dast_profile_schedules', 'premium', 1) - create_or_update_plan_limit('dast_profile_schedules', 'premium_trial', 1) - create_or_update_plan_limit('dast_profile_schedules', 'gold', 20) - create_or_update_plan_limit('dast_profile_schedules', 'ultimate', 20) - create_or_update_plan_limit('dast_profile_schedules', 'ultimate_trial', 20) - end - - def down - create_or_update_plan_limit('dast_profile_schedules', 'default', 0) - create_or_update_plan_limit('dast_profile_schedules', 'free', 0) - create_or_update_plan_limit('dast_profile_schedules', 'bronze', 0) - create_or_update_plan_limit('dast_profile_schedules', 'silver', 0) - create_or_update_plan_limit('dast_profile_schedules', 'premium', 0) - create_or_update_plan_limit('dast_profile_schedules', 'premium_trial', 0) - create_or_update_plan_limit('dast_profile_schedules', 'gold', 0) - create_or_update_plan_limit('dast_profile_schedules', 'ultimate', 0) - create_or_update_plan_limit('dast_profile_schedules', 'ultimate_trial', 0) - end -end diff --git a/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb b/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb deleted file mode 100644 index 81a76ecb10a..00000000000 --- a/db/migrate/20210908100810_add_jobs_per_stage_page_size_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddJobsPerStagePageSizeToApplicationSettings < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, :jobs_per_stage_page_size, :integer, default: 200, null: false - end -end diff --git a/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb b/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb deleted file mode 100644 index dd0796a1c86..00000000000 --- a/db/migrate/20210908140437_add_sidekiq_limits_to_application_settings.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddSidekiqLimitsToApplicationSettings < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! # needed for now to avoid subtransactions - - def up - with_lock_retries do - add_column :application_settings, :sidekiq_job_limiter_mode, :smallint, default: 1, null: false - add_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes, :integer, default: 100_000, null: false - add_column :application_settings, :sidekiq_job_limiter_limit_bytes, :integer, default: 0, null: false - end - end - - def down - with_lock_retries do - remove_column :application_settings, :sidekiq_job_limiter_mode - remove_column :application_settings, :sidekiq_job_limiter_compression_threshold_bytes - remove_column :application_settings, :sidekiq_job_limiter_limit_bytes - end - end -end diff --git a/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb b/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb deleted file mode 100644 index b8e7c7af144..00000000000 --- a/db/migrate/20210908185736_add_status_to_dependency_proxy_manifests.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddStatusToDependencyProxyManifests < Gitlab::Database::Migration[1.0] - def change - add_column :dependency_proxy_manifests, :status, :smallint, default: 0, null: false - end -end diff --git a/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb b/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb deleted file mode 100644 index 4fbdcad33cd..00000000000 --- a/db/migrate/20210908185754_add_status_to_dependency_proxy_blobs.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddStatusToDependencyProxyBlobs < Gitlab::Database::Migration[1.0] - def change - add_column :dependency_proxy_blobs, :status, :smallint, default: 0, null: false - end -end diff --git a/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb b/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb deleted file mode 100644 index 447508d3d5b..00000000000 --- a/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDataToVulnerabilityFindingEvidence < Gitlab::Database::Migration[1.0] - def change - add_column :vulnerability_finding_evidences, :data, :jsonb, default: {}, null: false - end -end diff --git a/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb b/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb deleted file mode 100644 index 38d9c4b5dd9..00000000000 --- a/db/migrate/20210909184349_add_index_package_id_id_on_package_files.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexPackageIdIdOnPackageFiles < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_packages_package_files_on_package_id_id' - - def up - disable_statement_timeout do - execute "CREATE INDEX CONCURRENTLY #{INDEX_NAME} ON packages_package_files (package_id, id)" unless index_exists_by_name?(:package_package_files, INDEX_NAME) - end - end - - def down - remove_concurrent_index_by_name :packages_package_files, INDEX_NAME - end -end diff --git a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb deleted file mode 100644 index 52fab5a63ee..00000000000 --- a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDependencyProxyTtlGroupPolicyWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, - :dependency_proxy_ttl_group_policy_worker_capacity, - :smallint, - default: 2, - null: false - end -end diff --git a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb deleted file mode 100644 index 9b522f2874f..00000000000 --- a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddAppSettingsDepProxyTtlWorkerCapacityCheckConstraint < Gitlab::Database::Migration[1.0] - CONSTRAINT_NAME = 'app_settings_dep_proxy_ttl_policies_worker_capacity_positive' - - disable_ddl_transaction! - - def up - add_check_constraint :application_settings, 'dependency_proxy_ttl_group_policy_worker_capacity >= 0', CONSTRAINT_NAME - end - - def down - remove_check_constraint :application_settings, CONSTRAINT_NAME - end -end diff --git a/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb b/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb deleted file mode 100644 index ebb0de53d6a..00000000000 --- a/db/migrate/20210910141043_change_ci_minutes_additional_pack_text_limit.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ChangeCiMinutesAdditionalPackTextLimit < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - remove_text_limit :ci_minutes_additional_packs, :purchase_xid - add_text_limit :ci_minutes_additional_packs, :purchase_xid, 50 - end - - def down - remove_text_limit :ci_minutes_additional_packs, :purchase_xid - add_text_limit :ci_minutes_additional_packs, :purchase_xid, 32, validate: false - end -end diff --git a/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb b/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb deleted file mode 100644 index 4b147034657..00000000000 --- a/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddReportTypeIntoApprovalProjectRules < Gitlab::Database::Migration[1.0] - def up - add_column :approval_project_rules, :report_type, :integer, limit: 2 - end - - def down - remove_column :approval_project_rules, :report_type - end -end diff --git a/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb b/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb deleted file mode 100644 index 83eddf2fb0d..00000000000 --- a/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddRunnerFeaturesToCiBuildsMetadata < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :ci_builds_metadata, :runner_features, :jsonb, default: {}, null: false - end -end diff --git a/db/migrate/20210913010411_create_agent_project_authorizations.rb b/db/migrate/20210913010411_create_agent_project_authorizations.rb deleted file mode 100644 index 02b6ac677e0..00000000000 --- a/db/migrate/20210913010411_create_agent_project_authorizations.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateAgentProjectAuthorizations < Gitlab::Database::Migration[1.0] - def change - create_table :agent_project_authorizations do |t| - t.bigint :project_id, null: false - t.bigint :agent_id, null: false - t.jsonb :config, null: false - - t.index :project_id - t.index [:agent_id, :project_id], unique: true - end - end -end diff --git a/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb b/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb deleted file mode 100644 index 545fc125950..00000000000 --- a/db/migrate/20210913010432_add_agent_project_authorizations_foreign_keys.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddAgentProjectAuthorizationsForeignKeys < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :agent_project_authorizations, :projects, column: :project_id - add_concurrent_foreign_key :agent_project_authorizations, :cluster_agents, column: :agent_id - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :agent_project_authorizations, column: :project_id - end - - with_lock_retries do - remove_foreign_key_if_exists :agent_project_authorizations, column: :agent_id - end - end -end diff --git a/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb b/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb deleted file mode 100644 index 9dd420604f4..00000000000 --- a/db/migrate/20210913122457_add_namespace_traversal_ids_to_ci_pending_builds.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddNamespaceTraversalIdsToCiPendingBuilds < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :ci_pending_builds, :namespace_traversal_ids, :integer, array: true, default: [] - end -end diff --git a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb deleted file mode 100644 index 845697c28b5..00000000000 --- a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class UpdateDependencyProxyManifestsUniquenessConstraint < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - NEW_INDEX_NAME = 'index_dep_prox_manifests_on_group_id_file_name_and_status' - OLD_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_and_file_name' - - def up - add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name, :status], unique: true, name: NEW_INDEX_NAME - remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_INDEX_NAME - end - - def down - add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name], unique: true, name: OLD_INDEX_NAME - remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb b/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb deleted file mode 100644 index 6e57429bca8..00000000000 --- a/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddThrottleDeprecatedApiColumns < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false - add_column :application_settings, :throttle_unauthenticated_deprecated_api_period_in_seconds, :integer, default: 3600, null: false - add_column :application_settings, :throttle_unauthenticated_deprecated_api_enabled, :boolean, default: false, null: false - - add_column :application_settings, :throttle_authenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false - add_column :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, :integer, default: 1800, null: false - add_column :application_settings, :throttle_authenticated_deprecated_api_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb deleted file mode 100644 index 9b593fbe540..00000000000 --- a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddStatusIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] - MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_status' - BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_status' - - disable_ddl_transaction! - - def up - add_concurrent_index :dependency_proxy_manifests, :status, name: MANIFEST_INDEX_NAME - add_concurrent_index :dependency_proxy_blobs, :status, name: BLOB_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME - remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME - end -end diff --git a/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb b/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb deleted file mode 100644 index 35cd18c1da9..00000000000 --- a/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnClustersIntegrationPrometheusEnabled < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_clusters_integration_prometheus_enabled' - - def up - add_concurrent_index(:clusters_integration_prometheus, [:enabled, :created_at, :cluster_id], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:clusters_integration_prometheus, INDEX_NAME) - end -end diff --git a/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb b/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb deleted file mode 100644 index bdaa84f27fe..00000000000 --- a/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnClustersIntegrationElasticStackEnabled < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_clusters_integration_elasticstack_enabled' - - def up - add_concurrent_index(:clusters_integration_elasticstack, [:enabled, :created_at, :cluster_id], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:clusters_integration_elasticstack, INDEX_NAME) - end -end diff --git a/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb b/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb deleted file mode 100644 index 2ceeb53cd1e..00000000000 --- a/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddAvatarAndDescriptionToTopic < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - def up - add_column :topics, :avatar, :text - add_column :topics, :description, :text - end - # rubocop:enable Migration/AddLimitToTextColumns - - def down - remove_column :topics, :avatar - remove_column :topics, :description - end -end diff --git a/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb b/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb deleted file mode 100644 index 6bac264fcf4..00000000000 --- a/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddProcessModeToResourceGroups < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - PROCESS_MODE_UNORDERED = 0 - - def up - add_column :ci_resource_groups, :process_mode, :integer, default: PROCESS_MODE_UNORDERED, null: false, limit: 2 - end - - def down - remove_column :ci_resource_groups, :process_mode - end -end diff --git a/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb b/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb deleted file mode 100644 index ac4821b8007..00000000000 --- a/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexForProjectTopicsOnTaggings < Gitlab::Database::Migration[1.0] - MIGRATION = 'ExtractProjectTopicsIntoSeparateTable' - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project' - INDEX_CONDITION = "taggable_type = 'Project'" - - disable_ddl_transaction! - - def up - # Ensure that no background jobs of 20210730104800_schedule_extract_project_topics_into_separate_table remain - finalize_background_migration MIGRATION - # this index was used in 20210730104800_schedule_extract_project_topics_into_separate_table - remove_concurrent_index_by_name :taggings, INDEX_NAME - end - - def down - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation - end -end diff --git a/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb b/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb deleted file mode 100644 index 456788de521..00000000000 --- a/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemovePipelineFkFromPackagesBuildInfos < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:packages_build_infos, :ci_pipelines) - end - end - - def down - add_concurrent_foreign_key(:packages_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify) - end -end diff --git a/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb b/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb deleted file mode 100644 index 187ddc8a088..00000000000 --- a/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemovePipelineFkFromPackagesPackageFileBuildInfos < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:packages_package_file_build_infos, :ci_pipelines) - end - end - - def down - add_concurrent_foreign_key(:packages_package_file_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify) - end -end diff --git a/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb b/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb deleted file mode 100644 index ee7a474928e..00000000000 --- a/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddRegistrationObjectiveToUserDetail < Gitlab::Database::Migration[1.0] - def change - add_column :user_details, :registration_objective, :smallint - end -end diff --git a/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb b/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb deleted file mode 100644 index 83ceaa58ff4..00000000000 --- a/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToTopicsDescriptionAndAvatar < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :topics, :description, 1024 - add_text_limit :topics, :avatar, 255 - end - - def down - remove_text_limit :topics, :avatar - remove_text_limit :topics, :description - end -end diff --git a/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb b/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb deleted file mode 100644 index 5ac12eccc7d..00000000000 --- a/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddSuggestPipelineEnabledToApplicationSettings < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, :suggest_pipeline_enabled, :boolean, default: true, null: false - end -end diff --git a/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb b/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb deleted file mode 100644 index 67975636488..00000000000 --- a/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class IndexLabelsUsingVarcharPatternOps < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - NEW_TITLE_INDEX_NAME = 'index_labels_on_title_varchar' - NEW_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_varchar_unique' - NEW_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_varchar_unique' - NEW_GROUP_ID_INDEX_NAME = 'index_labels_on_group_id' - - OLD_TITLE_INDEX_NAME = 'index_labels_on_title' - OLD_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_unique' - OLD_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_unique' - OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_project_id_and_title' - - def up - add_concurrent_index :labels, :title, order: { title: :varchar_pattern_ops }, name: NEW_TITLE_INDEX_NAME - add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_PROJECT_ID_TITLE_INDEX_NAME - add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_GROUP_ID_TITLE_INDEX_NAME - add_concurrent_index :labels, :group_id, name: NEW_GROUP_ID_INDEX_NAME - - remove_concurrent_index_by_name :labels, OLD_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, OLD_PROJECT_ID_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, OLD_GROUP_ID_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME - end - - def down - add_concurrent_index :labels, :title, name: OLD_TITLE_INDEX_NAME - add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, name: OLD_PROJECT_ID_TITLE_INDEX_NAME - add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, name: OLD_GROUP_ID_TITLE_INDEX_NAME - add_concurrent_index :labels, [:group_id, :project_id, :title], unique: true, name: OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME - - remove_concurrent_index_by_name :labels, NEW_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, NEW_PROJECT_ID_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, NEW_GROUP_ID_TITLE_INDEX_NAME - remove_concurrent_index_by_name :labels, NEW_GROUP_ID_INDEX_NAME - end -end diff --git a/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb b/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb deleted file mode 100644 index c03c463b9bb..00000000000 --- a/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddReportTypeIndexIntoApprovalProjectRules < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_approval_project_rules_report_type' - - def up - add_concurrent_index :approval_project_rules, :report_type, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :approval_project_rules, name: INDEX_NAME - end -end diff --git a/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb b/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb deleted file mode 100644 index 6cbbe582ff6..00000000000 --- a/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueNamespacesIndexOnNameParentIdAndType < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_namespaces_name_parent_id_type' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, [:name, :parent_id, :type], unique: true, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb b/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb deleted file mode 100644 index 001f3a6964b..00000000000 --- a/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class DropUniqueNamespacesIndexOnNameAndParentId < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_namespaces_on_name_and_parent_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end - - def down - add_concurrent_index :namespaces, [:name, :parent_id], unique: true, name: INDEX_NAME - end -end diff --git a/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb b/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb deleted file mode 100644 index 2d89d295608..00000000000 --- a/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateIssueCustomerRelationsContacts < Gitlab::Database::Migration[1.0] - def change - create_table :issue_customer_relations_contacts do |t| - t.bigint :issue_id, null: false - t.bigint :contact_id, null: false - t.timestamps_with_timezone null: false - - t.index :contact_id - t.index [:issue_id, :contact_id], unique: true, name: :index_issue_crm_contacts_on_issue_id_and_contact_id - end - end -end diff --git a/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb b/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb deleted file mode 100644 index 7be465ca31a..00000000000 --- a/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIssueCustomerRelationsContactsForeignKeys < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :issue_customer_relations_contacts, :issues, column: :issue_id - add_concurrent_foreign_key :issue_customer_relations_contacts, :customer_relations_contacts, column: :contact_id - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :issue_id - end - - with_lock_retries do - remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :contact_id - end - end -end diff --git a/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb b/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb deleted file mode 100644 index 2958285e7a5..00000000000 --- a/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddMetaDataToUserCreditCardValidations < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - def change - change_table :user_credit_card_validations do |t| - t.date :expiration_date - t.integer :last_digits, limit: 2 # last 4 digits - t.text :holder_name - end - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb b/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb deleted file mode 100644 index 11d436093b7..00000000000 --- a/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class LimitHolderNameOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :user_credit_card_validations, :holder_name, 26 # ISO IEC 7813 - - add_check_constraint(:user_credit_card_validations, 'last_digits BETWEEN 0 AND 9999', constraint_name) - end - - def down - remove_text_limit :user_credit_card_validations, :holder_name - - remove_check_constraint(:user_credit_card_validations, constraint_name) - end - - private - - def constraint_name - check_constraint_name(:user_credit_card_validations, :last_digits, 'range') - end -end diff --git a/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb b/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb deleted file mode 100644 index cc4f4d35f09..00000000000 --- a/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class IndexMetaDataOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_user_credit_card_validations_meta_data_full_match' - - def up - add_concurrent_index :user_credit_card_validations, - [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at], - name: INDEX_NAME - end - - def down - remove_concurrent_index :user_credit_card_validations, - [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at], - name: INDEX_NAME - end -end diff --git a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb deleted file mode 100644 index fc4cc1945f3..00000000000 --- a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class ChangeDefaultForIntegratedErrorTracking < Gitlab::Database::Migration[1.0] - def up - change_column_default :project_error_tracking_settings, :integrated, from: false, to: true - end - - def down - change_column_default :project_error_tracking_settings, :integrated, from: true, to: false - end -end diff --git a/db/migrate/20210928155022_improve_index_for_error_tracking.rb b/db/migrate/20210928155022_improve_index_for_error_tracking.rb deleted file mode 100644 index ec8427670d7..00000000000 --- a/db/migrate/20210928155022_improve_index_for_error_tracking.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class ImproveIndexForErrorTracking < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_index :error_tracking_errors, %i(project_id status last_seen_at id), - order: { last_seen_at: :desc, id: :desc }, - name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc' - - add_concurrent_index :error_tracking_errors, %i(project_id status first_seen_at id), - order: { first_seen_at: :desc, id: :desc }, - name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc' - - add_concurrent_index :error_tracking_errors, %i(project_id status events_count id), - order: { events_count: :desc, id: :desc }, - name: 'index_et_errors_on_project_id_and_status_events_count_id_desc' - - 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' - end - - def down - 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' - - remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc' - remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc' - remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count, :id], name: 'index_et_errors_on_project_id_and_status_events_count_id_desc' - end -end diff --git a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb deleted file mode 100644 index ef437641f2c..00000000000 --- a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddGroupIdStatusIdIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] - MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_status_and_id' - BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_group_id_status_and_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: MANIFEST_INDEX_NAME - add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: BLOB_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME - remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME - end -end diff --git a/db/migrate/20210929025600_add_phone_to_user_details.rb b/db/migrate/20210929025600_add_phone_to_user_details.rb deleted file mode 100644 index 9bcfd4ab7e3..00000000000 --- a/db/migrate/20210929025600_add_phone_to_user_details.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddPhoneToUserDetails < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - # rubocop:disable Migration/AddLimitToTextColumns - def up - add_column :user_details, :phone, :text, comment: 'JiHu-specific column' - end - # rubocop:enable Migration/AddLimitToTextColumns - - def down - remove_column :user_details, :phone - end -end diff --git a/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb b/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb deleted file mode 100644 index f250aad3253..00000000000 --- a/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToUserDetailsPhone < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :user_details, :phone, 32 - end - - def down - remove_text_limit :user_details, :phone - end -end diff --git a/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb b/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb deleted file mode 100644 index e0cf7aa8a44..00000000000 --- a/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexPhoneOnUserDetails < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_user_details_on_phone' - - def up - add_concurrent_index :user_details, :phone, unique: true, where: 'phone IS NOT NULL', name: INDEX_NAME, comment: 'JiHu-specific index' - end - - def down - remove_concurrent_index_by_name :user_details, INDEX_NAME - end -end diff --git a/db/migrate/20210929032555_create_verification_codes.rb b/db/migrate/20210929032555_create_verification_codes.rb deleted file mode 100644 index ad743641b9c..00000000000 --- a/db/migrate/20210929032555_create_verification_codes.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class CreateVerificationCodes < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - def up - constraint_visitor_id_code = check_constraint_name('verification_codes', 'visitor_id_code', 'max_length') - constraint_code = check_constraint_name('verification_codes', 'code', 'max_length') - constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length') - - execute(<<~SQL) - CREATE TABLE verification_codes ( - created_at timestamp with time zone NOT NULL DEFAULT NOW(), - visitor_id_code text, - code text, - phone text, - PRIMARY KEY (created_at, visitor_id_code, code, phone), - CONSTRAINT #{constraint_visitor_id_code} CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT #{constraint_code} CHECK ((char_length(code) <= 8)), - CONSTRAINT #{constraint_phone} CHECK ((char_length(phone) <= 32)) - ) PARTITION BY RANGE (created_at); - COMMENT ON TABLE verification_codes IS 'JiHu-specific table'; - - CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON verification_codes (visitor_id_code, phone, created_at); - COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index'; - SQL - - min_date = Date.today - 1.month - max_date = Date.today + 1.month - create_daterange_partitions('verification_codes', 'created_at', min_date, max_date) - end - - def down - drop_table :verification_codes - end -end diff --git a/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb b/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb deleted file mode 100644 index 1335c06cf1f..00000000000 --- a/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddSecurityPolicyConfigurationsManagementProjectIdForeignKey < Gitlab::Database::Migration[1.0] - CONSTRAINT_NAME = 'fk_security_policy_configurations_management_project_id' - OLD_CONSTRAINT_NAME = 'fk_rails_42ed6c25ec' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME) - remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME) - end - - def down - add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME) - remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb b/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb deleted file mode 100644 index 60ca3040d70..00000000000 --- a/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true -class AddReleasesAuthorIdIdCreatedAtIndex < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_releases_on_author_id_id_created_at' - - def up - add_concurrent_index :releases, [:author_id, :id, :created_at], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :releases, INDEX_NAME - end -end diff --git a/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb b/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb deleted file mode 100644 index 166afa13371..00000000000 --- a/db/migrate/20210929144453_add_warn_about_potentially_unwanted_characters_to_project_settings.rb +++ /dev/null @@ -1,16 +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 AddWarnAboutPotentiallyUnwantedCharactersToProjectSettings < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - add_column :project_settings, :warn_about_potentially_unwanted_characters, :boolean, null: false, default: true - end - - def down - remove_column :project_settings, :warn_about_potentially_unwanted_characters - end -end diff --git a/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb b/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb deleted file mode 100644 index be82b16ee8c..00000000000 --- a/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class FixDeprecatedApiThrottleDefaults < Gitlab::Database::Migration[1.0] - def change - change_column_default :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, from: 3600, to: 1800 - change_column_default :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, from: 1800, to: 3600 - end -end diff --git a/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb b/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb deleted file mode 100644 index d0eb4a32cac..00000000000 --- a/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddSourceVersionToBulkImports < Gitlab::Database::Migration[1.0] - def change - add_column :bulk_imports, :source_version, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb b/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb deleted file mode 100644 index c24883b626d..00000000000 --- a/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateCoverageFuzzingCorpuses < Gitlab::Database::Migration[1.0] - def change - create_table :coverage_fuzzing_corpuses do |t| - t.bigint :project_id, null: false - t.bigint :user_id - t.bigint :package_id, null: false - - t.datetime_with_timezone :file_updated_at, null: false, default: -> { 'NOW()' } - t.timestamps_with_timezone null: false - - t.index :project_id - t.index :user_id - t.index :package_id - end - end -end diff --git a/db/migrate/20211004075629_add_topics_name_gin_index.rb b/db/migrate/20211004075629_add_topics_name_gin_index.rb deleted file mode 100644 index 94634a4cb2f..00000000000 --- a/db/migrate/20211004075629_add_topics_name_gin_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTopicsNameGinIndex < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_topics_on_name_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :topics, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name :topics, INDEX_NAME - end -end diff --git a/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb b/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb deleted file mode 100644 index 3e44c388617..00000000000 --- a/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddExternalEventDestinationLimitToPlanLimits < Gitlab::Database::Migration[1.0] - def change - add_column(:plan_limits, :external_audit_event_destinations, :integer, default: 5, null: false) - end -end diff --git a/db/migrate/20211004122540_create_member_tasks.rb b/db/migrate/20211004122540_create_member_tasks.rb deleted file mode 100644 index e1141873bcb..00000000000 --- a/db/migrate/20211004122540_create_member_tasks.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CreateMemberTasks < Gitlab::Database::Migration[1.0] - def change - create_table :member_tasks do |t| - t.references :member, index: true, null: false - t.references :project, index: true, null: false - t.timestamps_with_timezone null: false - t.integer :tasks, limit: 2, array: true, null: false, default: [] - t.index [:member_id, :project_id], unique: true - end - end -end diff --git a/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb b/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb deleted file mode 100644 index ba1fb443343..00000000000 --- a/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToCorpusesOnProject < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :coverage_fuzzing_corpuses, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :coverage_fuzzing_corpuses, column: :project_id - end - end -end diff --git a/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb b/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb deleted file mode 100644 index da08ab97acf..00000000000 --- a/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToCorpusesOnUser < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :coverage_fuzzing_corpuses, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :coverage_fuzzing_corpuses, column: :user_id - end - end -end diff --git a/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb b/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb deleted file mode 100644 index 74ba7b070d0..00000000000 --- a/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToCorpusesOnPackage < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :coverage_fuzzing_corpuses, :packages_packages, column: :package_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :coverage_fuzzing_corpuses, column: :package_id - end - end -end diff --git a/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb b/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb deleted file mode 100644 index 2aaf5e4cf87..00000000000 --- a/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class DropTimeRangePartitionedLooseFk < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - def up - # the table is not in use - drop_table :loose_foreign_keys_deleted_records # rubocop: disable Migration/DropTable - end - - def down - 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 -end diff --git a/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb b/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb deleted file mode 100644 index 6f52b6ec63b..00000000000 --- a/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddRangePartitionedLooseFkTable < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - def up - constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'fully_qualified_table_name', 'max_length') - execute(<<~SQL) - CREATE TABLE loose_foreign_keys_deleted_records ( - id BIGSERIAL NOT NULL, - partition bigint NOT NULL, - primary_key_value bigint NOT NULL, - status smallint NOT NULL DEFAULT 1, - created_at timestamp with time zone NOT NULL DEFAULT NOW(), - fully_qualified_table_name text NOT NULL, - PRIMARY KEY (partition, id), - CONSTRAINT #{constraint_name} CHECK ((char_length(fully_qualified_table_name) <= 150)) - ) PARTITION BY LIST (partition); - - CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 - PARTITION OF loose_foreign_keys_deleted_records - FOR VALUES IN (1); - SQL - end - - def down - drop_table :loose_foreign_keys_deleted_records - end -end diff --git a/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb b/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb deleted file mode 100644 index b03ad069eba..00000000000 --- a/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class RecreateLooseFkInsertFunction < Gitlab::Database::Migration[1.0] - 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 - (partition, fully_qualified_table_name, primary_key_value) - SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table - ON CONFLICT DO NOTHING; - - RETURN NULL; - END - $$ LANGUAGE PLPGSQL - SQL - end - - def down - # old function - 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 -end diff --git a/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb b/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb deleted file mode 100644 index f3447918ad3..00000000000 --- a/db/migrate/20211005112404_add_member_id_foreign_key_to_member_tasks.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddMemberIdForeignKeyToMemberTasks < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :member_tasks, :members, column: :member_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :member_tasks, column: :member_id - end - end -end diff --git a/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb b/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb deleted file mode 100644 index ead6bb88e60..00000000000 --- a/db/migrate/20211005112645_add_project_id_foreign_key_to_member_tasks.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdForeignKeyToMemberTasks < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :member_tasks, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :member_tasks, column: :project_id - end - end -end diff --git a/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb b/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb deleted file mode 100644 index ebca4c70879..00000000000 --- a/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0] - def up - add_column :topics, :total_projects_count, :bigint, null: false, default: 0 - end - - def down - remove_column :topics, :total_projects_count - end -end diff --git a/db/migrate/20211006103122_change_helm_channel_length.rb b/db/migrate/20211006103122_change_helm_channel_length.rb deleted file mode 100644 index 6579ca4053b..00000000000 --- a/db/migrate/20211006103122_change_helm_channel_length.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class ChangeHelmChannelLength < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :packages_helm_file_metadata, :channel, 255, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length_v2') - remove_text_limit :packages_helm_file_metadata, :channel, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length') - end - - def down - # no-op: Danger of failing if there are records with length(channel) > 63 - end -end diff --git a/db/migrate/20211006122010_add_topics_total_projects_count_index.rb b/db/migrate/20211006122010_add_topics_total_projects_count_index.rb deleted file mode 100644 index bd969a9ff0a..00000000000 --- a/db/migrate/20211006122010_add_topics_total_projects_count_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTopicsTotalProjectsCountIndex < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_topics_total_projects_count' - - disable_ddl_transaction! - - def up - add_concurrent_index :topics, [:total_projects_count, :id], order: { total_projects_count: :desc }, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :topics, INDEX_NAME - end -end diff --git a/db/migrate/20211007090229_create_issue_search_table.rb b/db/migrate/20211007090229_create_issue_search_table.rb deleted file mode 100644 index 1fc15d20bd0..00000000000 --- a/db/migrate/20211007090229_create_issue_search_table.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateIssueSearchTable < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - def up - execute <<~SQL - CREATE TABLE issue_search_data ( - project_id bigint NOT NULL REFERENCES projects(id) ON DELETE CASCADE, - issue_id bigint NOT NULL REFERENCES issues(id) ON DELETE CASCADE, - created_at timestamp with time zone DEFAULT NOW() NOT NULL, - updated_at timestamp with time zone DEFAULT NOW() NOT NULL, - search_vector tsvector, - PRIMARY KEY (project_id, issue_id) - ) PARTITION BY HASH (project_id) - SQL - - # rubocop: disable Migration/AddIndex - add_index :issue_search_data, :issue_id - add_index :issue_search_data, :search_vector, using: :gin, name: 'index_issue_search_data_on_search_vector' - # rubocop: enable Migration/AddIndex - - create_hash_partitions :issue_search_data, 64 - end - - def down - drop_table :issue_search_data - end -end diff --git a/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb b/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb deleted file mode 100644 index d60171dead7..00000000000 --- a/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddStatusColumnToSecurityScansTable < Gitlab::Database::Migration[1.0] - def change - add_column :security_scans, :status, :integer, limit: 1, default: 0, null: false - end -end diff --git a/db/migrate/20211008043855_remove_notes_trigram_index.rb b/db/migrate/20211008043855_remove_notes_trigram_index.rb deleted file mode 100644 index a20ef1852e2..00000000000 --- a/db/migrate/20211008043855_remove_notes_trigram_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveNotesTrigramIndex < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - NOTES_TRIGRAM_INDEX_NAME = 'index_notes_on_note_trigram' - - def up - remove_concurrent_index_by_name(:notes, NOTES_TRIGRAM_INDEX_NAME) - end - - def down - add_concurrent_index :notes, :note, name: NOTES_TRIGRAM_INDEX_NAME, using: :gin, opclass: { content: :gin_trgm_ops } - end -end diff --git a/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb b/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb deleted file mode 100644 index 862d1a26867..00000000000 --- a/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddSharedRunnersDurationToCiNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :ci_namespace_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false - end -end diff --git a/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb b/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb deleted file mode 100644 index 76bb7356f0f..00000000000 --- a/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddSharedRunnersDurationToCiProjectMonthlyUsages < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :ci_project_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false - end -end diff --git a/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb b/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb deleted file mode 100644 index a69d12d4e52..00000000000 --- a/db/migrate/20211008193137_add_health_status_column_on_clusters_integration_prometheus.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddHealthStatusColumnOnClustersIntegrationPrometheus < Gitlab::Database::Migration[1.0] - def change - # For now, health checks will only run on monitor demo projects - add_column :clusters_integration_prometheus, :health_status, :smallint, limit: 2, default: 0, null: false - end -end diff --git a/db/migrate/20211011004242_create_content_blocked_states.rb b/db/migrate/20211011004242_create_content_blocked_states.rb deleted file mode 100644 index d70717f9786..00000000000 --- a/db/migrate/20211011004242_create_content_blocked_states.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreateContentBlockedStates < Gitlab::Database::Migration[1.0] - def change - create_table :content_blocked_states, comment: 'JiHu-specific table' do |t| - t.timestamps_with_timezone null: false - t.binary :commit_sha, null: false - t.binary :blob_sha, null: false - t.text :path, null: false, limit: 2048 - t.text :container_identifier, null: false, limit: 255 - - t.index [:container_identifier, :commit_sha, :path], name: 'index_content_blocked_states_on_container_id_commit_sha_path', unique: true - end - end -end diff --git a/db/migrate/20211011140930_create_ci_namespace_mirrors.rb b/db/migrate/20211011140930_create_ci_namespace_mirrors.rb deleted file mode 100644 index b9a708c5d7b..00000000000 --- a/db/migrate/20211011140930_create_ci_namespace_mirrors.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreateCiNamespaceMirrors < Gitlab::Database::Migration[1.0] - TABLE_NAME = :ci_namespace_mirrors - INDEX_NAME = "index_gin_#{TABLE_NAME}_on_traversal_ids" - - def change - create_table TABLE_NAME do |t| - t.integer :namespace_id, null: false, index: { unique: true } - t.integer :traversal_ids, array: true, default: [], null: false - - t.index :traversal_ids, name: INDEX_NAME, using: :gin - end - end -end diff --git a/db/migrate/20211011140931_create_ci_project_mirrors.rb b/db/migrate/20211011140931_create_ci_project_mirrors.rb deleted file mode 100644 index 2407b7e0b84..00000000000 --- a/db/migrate/20211011140931_create_ci_project_mirrors.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class CreateCiProjectMirrors < Gitlab::Database::Migration[1.0] - TABLE_NAME = :ci_project_mirrors - - def change - create_table TABLE_NAME do |t| - t.integer :project_id, null: false, index: { unique: true } - t.integer :namespace_id, null: false, index: true - end - end -end diff --git a/db/migrate/20211011140932_create_namespaces_sync_events.rb b/db/migrate/20211011140932_create_namespaces_sync_events.rb deleted file mode 100644 index 06831423343..00000000000 --- a/db/migrate/20211011140932_create_namespaces_sync_events.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesSyncEvents < Gitlab::Database::Migration[1.0] - def change - create_table :namespaces_sync_events do |t| - t.references :namespace, null: false, index: true, foreign_key: { on_delete: :cascade } - end - end -end diff --git a/db/migrate/20211011141239_create_projects_sync_events.rb b/db/migrate/20211011141239_create_projects_sync_events.rb deleted file mode 100644 index 50fe988ac1b..00000000000 --- a/db/migrate/20211011141239_create_projects_sync_events.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectsSyncEvents < Gitlab::Database::Migration[1.0] - def change - create_table :projects_sync_events do |t| - t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade } - end - end -end diff --git a/db/migrate/20211011141242_create_namespaces_sync_trigger.rb b/db/migrate/20211011141242_create_namespaces_sync_trigger.rb deleted file mode 100644 index 91f64709f28..00000000000 --- a/db/migrate/20211011141242_create_namespaces_sync_trigger.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesSyncTrigger < Gitlab::Database::Migration[1.0] - include Gitlab::Database::SchemaHelpers - - enable_lock_retries! - - TABLE_NAME = 'namespaces' - EVENT_TABLE_NAME = 'namespaces_sync_events' - FUNCTION_NAME = 'insert_namespaces_sync_event' - TRIGGER_ON_INSERT = 'trigger_namespaces_parent_id_on_insert' - TRIGGER_ON_UPDATE = 'trigger_namespaces_parent_id_on_update' - - def up - create_trigger_function(FUNCTION_NAME) do - <<~SQL - INSERT INTO #{EVENT_TABLE_NAME} (namespace_id) - VALUES(COALESCE(NEW.id, OLD.id)); - RETURN NULL; - SQL - end - - create_trigger(TABLE_NAME, TRIGGER_ON_INSERT, FUNCTION_NAME, fires: 'AFTER INSERT') - - create_trigger(TABLE_NAME, TRIGGER_ON_UPDATE, FUNCTION_NAME, fires: 'AFTER UPDATE') do - <<~SQL - WHEN (OLD.parent_id IS DISTINCT FROM NEW.parent_id) - SQL - end - end - - def down - drop_trigger(TABLE_NAME, TRIGGER_ON_INSERT) - drop_trigger(TABLE_NAME, TRIGGER_ON_UPDATE) - drop_function(FUNCTION_NAME) - end -end diff --git a/db/migrate/20211011141243_create_projects_sync_trigger.rb b/db/migrate/20211011141243_create_projects_sync_trigger.rb deleted file mode 100644 index 03b31c35a3a..00000000000 --- a/db/migrate/20211011141243_create_projects_sync_trigger.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectsSyncTrigger < Gitlab::Database::Migration[1.0] - include Gitlab::Database::SchemaHelpers - - enable_lock_retries! - - TABLE_NAME = 'projects' - EVENT_TABLE_NAME = 'projects_sync_events' - FUNCTION_NAME = 'insert_projects_sync_event' - TRIGGER_ON_INSERT = 'trigger_projects_parent_id_on_insert' - TRIGGER_ON_UPDATE = 'trigger_projects_parent_id_on_update' - - def up - create_trigger_function(FUNCTION_NAME) do - <<~SQL - INSERT INTO #{EVENT_TABLE_NAME} (project_id) - VALUES(COALESCE(NEW.id, OLD.id)); - RETURN NULL; - SQL - end - - create_trigger(TABLE_NAME, TRIGGER_ON_INSERT, FUNCTION_NAME, fires: 'AFTER INSERT') - - create_trigger(TABLE_NAME, TRIGGER_ON_UPDATE, FUNCTION_NAME, fires: 'AFTER UPDATE') do - <<~SQL - WHEN (OLD.namespace_id IS DISTINCT FROM NEW.namespace_id) - SQL - end - end - - def down - drop_trigger(TABLE_NAME, TRIGGER_ON_INSERT) - drop_trigger(TABLE_NAME, TRIGGER_ON_UPDATE) - drop_function(FUNCTION_NAME) - end -end diff --git a/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb b/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb deleted file mode 100644 index f32b8fc5a65..00000000000 --- a/db/migrate/20211012015903_next_traversal_ids_sibling_function.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class NextTraversalIdsSiblingFunction < Gitlab::Database::Migration[1.0] - include Gitlab::Database::SchemaHelpers - - FUNCTION_NAME = 'next_traversal_ids_sibling' - - def up - # Given array [1,2,3,4,5], concatenate the first part of the array [1,2,3,4] - # with the last element in the array (5) after being incremented ([6]). - # - # [1,2,3,4,5] => [1,2,3,4,6] - execute(<<~SQL) - CREATE OR REPLACE FUNCTION #{FUNCTION_NAME}(traversal_ids INT[]) RETURNS INT[] - AS $$ - BEGIN - return traversal_ids[1:array_length(traversal_ids, 1)-1] || - ARRAY[traversal_ids[array_length(traversal_ids, 1)]+1]; - END; - $$ - LANGUAGE plpgsql - IMMUTABLE - RETURNS NULL ON NULL INPUT; - SQL - end - - def down - execute("DROP FUNCTION #{FUNCTION_NAME}(traversal_ids INT[])") - end -end diff --git a/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb b/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb deleted file mode 100644 index 9b4fca9a98c..00000000000 --- a/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToBulkImportsSourceVersion < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :bulk_imports, :source_version, 63 - end - - def down - remove_text_limit :bulk_imports, :source_version - end -end diff --git a/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb b/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb deleted file mode 100644 index 443dbe37c0b..00000000000 --- a/db/migrate/20211012134316_clean_up_migrate_merge_request_diff_commit_users.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class CleanUpMigrateMergeRequestDiffCommitUsers < Gitlab::Database::Migration[1.0] - def up - jobs = Gitlab::Database::BackgroundMigrationJob - .for_migration_class('MigrateMergeRequestDiffCommitUsers') - .pending - .to_a - - return if jobs.empty? - - say("#{jobs.length} MigrateMergeRequestDiffCommitUsers are still pending") - - # Normally we don't process background migrations in a regular migration, as - # this could take a while to complete and thus block a deployment. - # - # In this case the jobs have all been processed for GitLab.com at the time - # of writing. In addition, it's been a few releases since this migration was - # introduced. As a result, self-hosted instances should have their - # migrations finished a long time ago. - # - # For these reasons we clean up any pending jobs (just in case) before - # deploying the code. This also allows us to immediately start using the new - # setup only, instead of having to support both the old and new approach for - # at least one more release. - jobs.each do |job| - Gitlab::BackgroundMigration::MigrateMergeRequestDiffCommitUsers - .new - .perform(*job.arguments) - end - end - - def down - end -end diff --git a/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb b/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb deleted file mode 100644 index 9a79fdca192..00000000000 --- a/db/migrate/20211013014228_add_content_validation_endpoint_to_application_settings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddContentValidationEndpointToApplicationSettings < Gitlab::Database::Migration[1.0] - def up - # rubocop:disable Migration/AddLimitToTextColumns - add_column :application_settings, :content_validation_endpoint_url, :text, comment: 'JiHu-specific column' - # rubocop:disable Migration/AddLimitToTextColumns - - add_column :application_settings, :encrypted_content_validation_api_key, :binary, comment: 'JiHu-specific column' - add_column :application_settings, :encrypted_content_validation_api_key_iv, :binary, comment: 'JiHu-specific column' - add_column :application_settings, :content_validation_endpoint_enabled, :boolean, null: false, default: false, comment: 'JiHu-specific column' - end - - def down - remove_column :application_settings, :content_validation_endpoint_url - remove_column :application_settings, :encrypted_content_validation_api_key - remove_column :application_settings, :encrypted_content_validation_api_key_iv - remove_column :application_settings, :content_validation_endpoint_enabled - end -end diff --git a/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb b/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb deleted file mode 100644 index eee4cbad796..00000000000 --- a/db/migrate/20211013080714_add_network_to_user_credit_card_validations.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddNetworkToUserCreditCardValidations < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :user_credit_card_validations, :network, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb b/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb deleted file mode 100644 index 38a019e718d..00000000000 --- a/db/migrate/20211013080715_limit_network_on_user_credit_card_validations.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class LimitNetworkOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :user_credit_card_validations, :network, 32 - end - - def down - remove_text_limit :user_credit_card_validations, :network - end -end diff --git a/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb b/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb deleted file mode 100644 index 849dbab77db..00000000000 --- a/db/migrate/20211013080716_index_include_network_on_user_credit_card_validations.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class IndexIncludeNetworkOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_user_credit_card_validations_meta_data_partial_match' - - def up - add_concurrent_index :user_credit_card_validations, - [:expiration_date, :last_digits, :network, :credit_card_validated_at], - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :user_credit_card_validations, INDEX_NAME - end -end diff --git a/db/migrate/20211013192749_add_states_into_approval_project_rules.rb b/db/migrate/20211013192749_add_states_into_approval_project_rules.rb deleted file mode 100644 index 98fefbab12c..00000000000 --- a/db/migrate/20211013192749_add_states_into_approval_project_rules.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddStatesIntoApprovalProjectRules < Gitlab::Database::Migration[1.0] - def up - add_column :approval_project_rules, :vulnerability_states, :text, array: true, null: false, default: ['newly_detected'] - end - - def down - remove_column :approval_project_rules, :vulnerability_states - end -end diff --git a/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb b/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb deleted file mode 100644 index adf2fdb2da7..00000000000 --- a/db/migrate/20211015021114_add_merge_commit_template_to_project_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMergeCommitTemplateToProjectSettings < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :project_settings, :merge_commit_template, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb b/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb deleted file mode 100644 index 972872b8d2a..00000000000 --- a/db/migrate/20211015024135_add_merge_commit_template_limit_to_project_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddMergeCommitTemplateLimitToProjectSettings < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :project_settings, :merge_commit_template, 500 - end - - def down - remove_text_limit :project_settings, :merge_commit_template - end -end diff --git a/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb b/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb deleted file mode 100644 index cc73cb5047b..00000000000 --- a/db/migrate/20211018101034_add_tmp_project_id_column_to_namespaces.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddTmpProjectIdColumnToNamespaces < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - # this is a temporary column to be able to batch insert records into namespaces table and then be able to link these - # to projects table. - add_column :namespaces, :tmp_project_id, :integer # rubocop: disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb b/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb deleted file mode 100644 index 574f54bc60e..00000000000 --- a/db/migrate/20211018161447_fix_double_entries_in_postgres_index_view.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -class FixDoubleEntriesInPostgresIndexView < Gitlab::Database::Migration[1.0] - 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 AND pg_namespace.nspname = pg_indexes.schemaname - 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) || 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 -end diff --git a/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb b/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb deleted file mode 100644 index 0eb8d0989a5..00000000000 --- a/db/migrate/20211019153615_add_state_to_merge_request_assignees.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true -class AddStateToMergeRequestAssignees < Gitlab::Database::Migration[1.0] - REVIEW_DEFAULT_STATE = 0 - - def change - add_column :merge_request_assignees, :state, :smallint, default: REVIEW_DEFAULT_STATE, null: false - end -end diff --git a/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb b/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb deleted file mode 100644 index 970c018df46..00000000000 --- a/db/migrate/20211020030948_add_runtime_runner_features_to_ci_builds_metadata.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddRuntimeRunnerFeaturesToCiBuildsMetadata < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :ci_builds_metadata, :runtime_runner_features, :jsonb, default: {}, null: false - end -end diff --git a/db/migrate/20211020095357_add_group_traversal_id_index.rb b/db/migrate/20211020095357_add_group_traversal_id_index.rb deleted file mode 100644 index e4739ff217e..00000000000 --- a/db/migrate/20211020095357_add_group_traversal_id_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddGroupTraversalIdIndex < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_namespaces_on_traversal_ids_for_groups' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :traversal_ids, using: :gin, where: "type='Group'", name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/migrate/20211021115409_add_color_to_epics.rb b/db/migrate/20211021115409_add_color_to_epics.rb deleted file mode 100644 index 14b38209f30..00000000000 --- a/db/migrate/20211021115409_add_color_to_epics.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddColorToEpics < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20211021124715_add_text_limit_to_epics_color - def change - add_column :epics, :color, :text, default: '#1068bf' - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20211021124715_add_text_limit_to_epics_color.rb b/db/migrate/20211021124715_add_text_limit_to_epics_color.rb deleted file mode 100644 index 7844575c521..00000000000 --- a/db/migrate/20211021124715_add_text_limit_to_epics_color.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToEpicsColor < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :epics, :color, 7 - end - - def down - remove_text_limit :epics, :color - end -end diff --git a/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb b/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb deleted file mode 100644 index d8b40893b47..00000000000 --- a/db/migrate/20211021125908_add_sentry_settings_to_application_settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddSentrySettingsToApplicationSettings < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :application_settings, :sentry_enabled, :boolean, default: false, null: false - add_column :application_settings, :sentry_dsn, :text - add_column :application_settings, :sentry_clientside_dsn, :text - add_column :application_settings, :sentry_environment, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb b/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb deleted file mode 100644 index 34d18741788..00000000000 --- a/db/migrate/20211021134458_add_limits_to_sentry_settings_on_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLimitsToSentrySettingsOnApplicationSettings < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :application_settings, :sentry_dsn, 255 - add_text_limit :application_settings, :sentry_clientside_dsn, 255 - add_text_limit :application_settings, :sentry_environment, 255 - end - - def down - remove_text_limit :application_settings, :sentry_dsn - remove_text_limit :application_settings, :sentry_clientside_dsn - remove_text_limit :application_settings, :sentry_environment - end -end diff --git a/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb b/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb deleted file mode 100644 index 345cd1785ea..00000000000 --- a/db/migrate/20211025103744_add_state_id_to_vsa_issue_stage_events.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddStateIdToVsaIssueStageEvents < Gitlab::Database::Migration[1.0] - def change - add_column :analytics_cycle_analytics_issue_stage_events, :state_id, :smallint, default: 1, null: false - end -end diff --git a/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb b/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb deleted file mode 100644 index be28d56e19d..00000000000 --- a/db/migrate/20211025103758_add_state_id_to_vsa_merge_request_stage_events.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddStateIdToVsaMergeRequestStageEvents < Gitlab::Database::Migration[1.0] - def change - add_column :analytics_cycle_analytics_merge_request_stage_events, :state_id, :smallint, default: 1, null: false - end -end diff --git a/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb b/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb deleted file mode 100644 index 90e68f6a0ac..00000000000 --- a/db/migrate/20211026124336_add_archive_trace_events_to_integrations.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddArchiveTraceEventsToIntegrations < Gitlab::Database::Migration[1.0] - def change - add_column :integrations, :archive_trace_events, :boolean, null: false, default: false - end -end diff --git a/db/migrate/20211026143238_remove_index_releases_on_author_id.rb b/db/migrate/20211026143238_remove_index_releases_on_author_id.rb deleted file mode 100644 index 7cd086dbf7d..00000000000 --- a/db/migrate/20211026143238_remove_index_releases_on_author_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexReleasesOnAuthorId < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_releases_on_author_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :releases, INDEX_NAME - end - - def down - add_concurrent_index :releases, [:author_id], name: INDEX_NAME - end -end diff --git a/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb b/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb deleted file mode 100644 index 8b004af06c0..00000000000 --- a/db/migrate/20211027203950_add_updated_index_for_dormant_users.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUpdatedIndexForDormantUsers < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_active_human_service' - - disable_ddl_transaction! - - def up - index_condition = "state = 'active' AND (users.user_type IS NULL OR users.user_type = 4)" - - add_concurrent_index :users, [:id, :last_activity_on], where: index_condition, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :users, INDEX_NAME - end -end diff --git a/db/migrate/20211028132247_create_packages_npm_metadata.rb b/db/migrate/20211028132247_create_packages_npm_metadata.rb deleted file mode 100644 index cbe5429fca1..00000000000 --- a/db/migrate/20211028132247_create_packages_npm_metadata.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesNpmMetadata < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - create_table :packages_npm_metadata, id: false do |t| - t.references :package, primary_key: true, default: nil, index: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint - t.jsonb :package_json, default: {}, null: false - - t.check_constraint 'char_length(package_json::text) < 20000' - end - end - end - - def down - with_lock_retries do - drop_table :packages_npm_metadata - end - end -end diff --git a/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb b/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb deleted file mode 100644 index d9949863a92..00000000000 --- a/db/migrate/20211028212259_add_default_to_personal_access_tokens_prefix.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultToPersonalAccessTokensPrefix < Gitlab::Database::Migration[1.0] - def change - change_column_default(:application_settings, :personal_access_token_prefix, from: nil, to: 'glpat-') - end -end diff --git a/db/migrate/20211101132310_add_reindexing_queue.rb b/db/migrate/20211101132310_add_reindexing_queue.rb deleted file mode 100644 index d9d1f9dce89..00000000000 --- a/db/migrate/20211101132310_add_reindexing_queue.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddReindexingQueue < Gitlab::Database::Migration[1.0] - def change - create_table :postgres_reindex_queued_actions do |t| - t.text :index_identifier, null: false, limit: 255 - t.integer :state, limit: 2, null: false, default: 0 - t.timestamps_with_timezone null: false - - t.index :state - end - - change_column_default :postgres_reindex_queued_actions, :created_at, from: nil, to: -> { 'NOW()' } - change_column_default :postgres_reindex_queued_actions, :updated_at, from: nil, to: -> { 'NOW()' } - end -end diff --git a/db/migrate/20211101165656_create_upload_states.rb b/db/migrate/20211101165656_create_upload_states.rb deleted file mode 100644 index 64873f4c9a2..00000000000 --- a/db/migrate/20211101165656_create_upload_states.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class CreateUploadStates < Gitlab::Database::Migration[1.0] - VERIFICATION_STATE_INDEX_NAME = "index_upload_states_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_upload_states_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_upload_states_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_upload_states_needs_verification" - - disable_ddl_transaction! - - def up - create_table :upload_states, id: false do |t| - t.datetime_with_timezone :verification_started_at - t.datetime_with_timezone :verification_retry_at - t.datetime_with_timezone :verified_at - t.references :upload, primary_key: true, null: false, 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 :upload_states - end -end diff --git a/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb b/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb deleted file mode 100644 index 43cd7afbf06..00000000000 --- a/db/migrate/20211103062728_add_with_highest_role_minimal_access_to_users_statistics.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddWithHighestRoleMinimalAccessToUsersStatistics < Gitlab::Database::Migration[1.0] - def change - add_column :users_statistics, :with_highest_role_minimal_access, :integer, null: false, default: 0 - end -end diff --git a/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb b/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb deleted file mode 100644 index 4062fd1be01..00000000000 --- a/db/migrate/20211104012209_add_text_limit_to_application_settings_content_validation_endpoint_url.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToApplicationSettingsContentValidationEndpointUrl < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :application_settings, :content_validation_endpoint_url, 255 - end - - def down - remove_text_limit :application_settings, :content_validation_endpoint_url - end -end diff --git a/db/migrate/20211105010101_add_archived_column_to_deployments.rb b/db/migrate/20211105010101_add_archived_column_to_deployments.rb deleted file mode 100644 index f9ac81915b4..00000000000 --- a/db/migrate/20211105010101_add_archived_column_to_deployments.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddArchivedColumnToDeployments < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :deployments, :archived, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb b/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb deleted file mode 100644 index a594674f470..00000000000 --- a/db/migrate/20211105125756_add_read_at_to_dependency_proxy_manifests.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddReadAtToDependencyProxyManifests < Gitlab::Database::Migration[1.0] - def change - add_column :dependency_proxy_manifests, :read_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' } - end -end diff --git a/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb b/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb deleted file mode 100644 index 1808a541498..00000000000 --- a/db/migrate/20211105125813_add_read_at_to_dependency_proxy_blobs.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddReadAtToDependencyProxyBlobs < Gitlab::Database::Migration[1.0] - def change - add_column :dependency_proxy_blobs, :read_at, :datetime_with_timezone, null: false, default: -> { 'NOW()' } - end -end diff --git a/db/migrate/20211105160316_create_dotenv_application_limits.rb b/db/migrate/20211105160316_create_dotenv_application_limits.rb deleted file mode 100644 index 3ea94fd60fc..00000000000 --- a/db/migrate/20211105160316_create_dotenv_application_limits.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class CreateDotenvApplicationLimits < Gitlab::Database::Migration[1.0] - def change - add_column(:plan_limits, :dotenv_variables, :integer, default: 20, null: false) - add_column(:plan_limits, :dotenv_size, :integer, default: 5.kilobytes, null: false) - end -end diff --git a/db/migrate/20211105161404_insert_dotenv_application_limits.rb b/db/migrate/20211105161404_insert_dotenv_application_limits.rb deleted file mode 100644 index 2749cf4a019..00000000000 --- a/db/migrate/20211105161404_insert_dotenv_application_limits.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class InsertDotenvApplicationLimits < Gitlab::Database::Migration[1.0] - def up - create_or_update_plan_limit('dotenv_variables', 'default', 150) - create_or_update_plan_limit('dotenv_variables', 'free', 50) - create_or_update_plan_limit('dotenv_variables', 'opensource', 150) - create_or_update_plan_limit('dotenv_variables', 'premium', 100) - create_or_update_plan_limit('dotenv_variables', 'premium_trial', 100) - create_or_update_plan_limit('dotenv_variables', 'ultimate', 150) - create_or_update_plan_limit('dotenv_variables', 'ultimate_trial', 150) - - create_or_update_plan_limit('dotenv_size', 'default', 5.kilobytes) - end - - def down - create_or_update_plan_limit('dotenv_variables', 'default', 20) - create_or_update_plan_limit('dotenv_variables', 'free', 20) - create_or_update_plan_limit('dotenv_variables', 'opensource', 20) - create_or_update_plan_limit('dotenv_variables', 'premium', 20) - create_or_update_plan_limit('dotenv_variables', 'premium_trial', 20) - create_or_update_plan_limit('dotenv_variables', 'ultimate', 20) - create_or_update_plan_limit('dotenv_variables', 'ultimate_trial', 20) - - create_or_update_plan_limit('dotenv_size', 'default', 5.kilobytes) - end -end diff --git a/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb b/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb deleted file mode 100644 index 38671c75e0c..00000000000 --- a/db/migrate/20211108154510_create_pipeline_triggers_application_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class CreatePipelineTriggersApplicationLimits < Gitlab::Database::Migration[1.0] - def change - add_column(:plan_limits, :pipeline_triggers, :integer, default: 25_000, null: false) - end -end diff --git a/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb b/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb deleted file mode 100644 index c1341fad729..00000000000 --- a/db/migrate/20211108154841_insert_pipeline_triggers_application_limits.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class InsertPipelineTriggersApplicationLimits < Gitlab::Database::Migration[1.0] - def up - create_or_update_plan_limit('pipeline_triggers', 'default', 0) - create_or_update_plan_limit('pipeline_triggers', 'free', 25_000) - create_or_update_plan_limit('pipeline_triggers', 'opensource', 0) - create_or_update_plan_limit('pipeline_triggers', 'premium', 0) - create_or_update_plan_limit('pipeline_triggers', 'premium_trial', 0) - create_or_update_plan_limit('pipeline_triggers', 'ultimate', 0) - create_or_update_plan_limit('pipeline_triggers', 'ultimate_trial', 0) - end - - def down - create_or_update_plan_limit('pipeline_triggers', 'default', 0) - create_or_update_plan_limit('pipeline_triggers', 'free', 0) - create_or_update_plan_limit('pipeline_triggers', 'opensource', 0) - create_or_update_plan_limit('pipeline_triggers', 'premium', 0) - create_or_update_plan_limit('pipeline_triggers', 'premium_trial', 0) - create_or_update_plan_limit('pipeline_triggers', 'ultimate', 0) - create_or_update_plan_limit('pipeline_triggers', 'ultimate_trial', 0) - end -end diff --git a/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb b/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb deleted file mode 100644 index ac0f0ddca17..00000000000 --- a/db/migrate/20211108203248_update_dependency_proxy_indexes_with_read_at.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class UpdateDependencyProxyIndexesWithReadAt < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - NEW_BLOB_INDEX = 'index_dependency_proxy_blobs_on_group_id_status_read_at_id' - OLD_BLOB_INDEX = 'index_dependency_proxy_blobs_on_group_id_status_and_id' - - NEW_MANIFEST_INDEX = 'index_dependency_proxy_manifests_on_group_id_status_read_at_id' - OLD_MANIFEST_INDEX = 'index_dependency_proxy_manifests_on_group_id_status_and_id' - - def up - add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :read_at, :id], name: NEW_BLOB_INDEX - add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :read_at, :id], name: NEW_MANIFEST_INDEX - - remove_concurrent_index_by_name :dependency_proxy_blobs, OLD_BLOB_INDEX - remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_MANIFEST_INDEX - end - - def down - add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: OLD_BLOB_INDEX - add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: OLD_MANIFEST_INDEX - - remove_concurrent_index_by_name :dependency_proxy_blobs, NEW_BLOB_INDEX - remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_MANIFEST_INDEX - end -end diff --git a/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb b/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb deleted file mode 100644 index 90e5fa34817..00000000000 --- a/db/migrate/20211108204736_add_policy_idx_to_approval_project_rule.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddPolicyIdxToApprovalProjectRule < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :approval_project_rules, :orchestration_policy_idx, :integer, limit: 2 - end -end diff --git a/db/migrate/20211108211434_remove_index_for_resource_group.rb b/db/migrate/20211108211434_remove_index_for_resource_group.rb deleted file mode 100644 index 8b03f12d08b..00000000000 --- a/db/migrate/20211108211434_remove_index_for_resource_group.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexForResourceGroup < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_for_resource_group' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :ci_builds, INDEX_NAME - end - - def down - # rubocop:disable Migration/PreventIndexCreation - add_concurrent_index :ci_builds, [:resource_group_id, :id], where: 'resource_group_id IS NOT NULL', name: INDEX_NAME - # rubocop:enable Migration/PreventIndexCreation - end -end diff --git a/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb b/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb deleted file mode 100644 index 6b8e8c0d4f3..00000000000 --- a/db/migrate/20211109100050_add_consume_after_to_loose_fk_deleted_records.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddConsumeAfterToLooseFkDeletedRecords < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - add_column :loose_foreign_keys_deleted_records, :consume_after, :datetime_with_timezone, default: -> { 'NOW()' } - end - - def down - remove_column :loose_foreign_keys_deleted_records, :consume_after - end -end diff --git a/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb b/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb deleted file mode 100644 index fccb1fc5cac..00000000000 --- a/db/migrate/20211109101010_support_partition_query_in_loose_fk_table.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class SupportPartitionQueryInLooseFkTable < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_partitioned_query' - - def up - add_concurrent_partitioned_index :loose_foreign_keys_deleted_records, - %I[partition fully_qualified_table_name consume_after id], - where: 'status = 1', - name: INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME - end -end diff --git a/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb b/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb deleted file mode 100644 index 0bfafb94d0b..00000000000 --- a/db/migrate/20211110010101_add_index_on_unarchived_deployments.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnUnarchivedDeployments < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_deployments_on_archived_project_id_iid' - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, %i[archived project_id iid], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/migrate/20211110014701_create_agent_activity_events.rb b/db/migrate/20211110014701_create_agent_activity_events.rb deleted file mode 100644 index 11b9c6d03b3..00000000000 --- a/db/migrate/20211110014701_create_agent_activity_events.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateAgentActivityEvents < Gitlab::Database::Migration[1.0] - def change - create_table :agent_activity_events do |t| - t.bigint :agent_id, null: false - t.bigint :user_id, index: { where: 'user_id IS NOT NULL' } - t.bigint :project_id, index: { where: 'project_id IS NOT NULL' } - t.bigint :merge_request_id, index: { where: 'merge_request_id IS NOT NULL' } - t.bigint :agent_token_id, index: { where: 'agent_token_id IS NOT NULL' } - - t.datetime_with_timezone :recorded_at, null: false - t.integer :kind, limit: 2, null: false - t.integer :level, limit: 2, null: false - - t.binary :sha - t.text :detail, limit: 255 - - t.index [:agent_id, :recorded_at, :id] - end - end -end diff --git a/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb b/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb deleted file mode 100644 index fcbafcccb06..00000000000 --- a/db/migrate/20211110015252_add_agent_activity_events_foreign_keys.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class AddAgentActivityEventsForeignKeys < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :agent_activity_events, :cluster_agents, column: :agent_id, on_delete: :cascade - add_concurrent_foreign_key :agent_activity_events, :users, column: :user_id, on_delete: :nullify - add_concurrent_foreign_key :agent_activity_events, :projects, column: :project_id, on_delete: :nullify - add_concurrent_foreign_key :agent_activity_events, :merge_requests, column: :merge_request_id, on_delete: :nullify - add_concurrent_foreign_key :agent_activity_events, :cluster_agent_tokens, column: :agent_token_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :agent_activity_events, column: :agent_id - end - - with_lock_retries do - remove_foreign_key_if_exists :agent_activity_events, column: :user_id - end - - with_lock_retries do - remove_foreign_key_if_exists :agent_activity_events, column: :project_id - end - - with_lock_retries do - remove_foreign_key_if_exists :agent_activity_events, column: :merge_request_id - end - - with_lock_retries do - remove_foreign_key_if_exists :agent_activity_events, column: :agent_token_id - end - end -end diff --git a/db/migrate/20211110092710_create_issue_emails.rb b/db/migrate/20211110092710_create_issue_emails.rb deleted file mode 100644 index 5f6104fa2c3..00000000000 --- a/db/migrate/20211110092710_create_issue_emails.rb +++ /dev/null @@ -1,21 +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 CreateIssueEmails < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - create_table :issue_emails do |t| - t.references :issue, index: true, null: false, unique: true, foreign_key: { on_delete: :cascade } - t.text :email_message_id, null: false, limit: 1000 - - t.index :email_message_id - end - end - - def down - drop_table :issue_emails - end -end diff --git a/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb b/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb deleted file mode 100644 index 01507908e0f..00000000000 --- a/db/migrate/20211110100050_add_has_shimo_to_project_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddHasShimoToProjectSettings < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :project_settings, :has_shimo, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb b/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb deleted file mode 100644 index 064dc38f5b3..00000000000 --- a/db/migrate/20211111112425_create_merge_requests_compliance_violations.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CreateMergeRequestsComplianceViolations < Gitlab::Database::Migration[1.0] - def change - create_table :merge_requests_compliance_violations do |t| - t.bigint :violating_user_id, null: false - t.bigint :merge_request_id, null: false - t.integer :reason, limit: 2, null: false - t.index :violating_user_id - t.index [:merge_request_id, :violating_user_id, :reason], unique: true, name: 'index_merge_requests_compliance_violations_unique_columns' - end - end -end diff --git a/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb b/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb deleted file mode 100644 index b280c35433b..00000000000 --- a/db/migrate/20211111112639_add_fk_compliance_violations_merge_request.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddFkComplianceViolationsMergeRequest < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :merge_requests_compliance_violations, - :merge_requests, - column: :merge_request_id, - on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :merge_requests_compliance_violations, column: :merge_request_id - end - end -end diff --git a/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb b/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb deleted file mode 100644 index af1cd6f07ed..00000000000 --- a/db/migrate/20211111112713_add_fk_compliance_violations_violating_user.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddFkComplianceViolationsViolatingUser < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :merge_requests_compliance_violations, - :users, - column: :violating_user_id, - on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :merge_requests_compliance_violations, column: :violating_user_id - end - end -end diff --git a/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb b/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb deleted file mode 100644 index 6120a6ed0b4..00000000000 --- a/db/migrate/20211111164025_add_squash_commit_template_to_project_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddSquashCommitTemplateToProjectSettings < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :project_settings, :squash_commit_template, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb b/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb deleted file mode 100644 index 578d2271d60..00000000000 --- a/db/migrate/20211111164047_add_squash_commit_template_limit_to_project_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddSquashCommitTemplateLimitToProjectSettings < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :project_settings, :squash_commit_template, 500 - end - - def down - remove_text_limit :project_settings, :squash_commit_template - end -end diff --git a/db/migrate/20211112073413_change_package_index_on_corpus.rb b/db/migrate/20211112073413_change_package_index_on_corpus.rb deleted file mode 100644 index 6e8222f853c..00000000000 --- a/db/migrate/20211112073413_change_package_index_on_corpus.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class ChangePackageIndexOnCorpus < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_coverage_fuzzing_corpuses_on_package_id' - - disable_ddl_transaction! - - # Changing this index is safe. - # The table does not have any data in it as it's behind a feature flag. - def up - remove_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME - add_concurrent_index :coverage_fuzzing_corpuses, :package_id, unique: true, name: INDEX_NAME - end - - def down - remove_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME - add_concurrent_index :coverage_fuzzing_corpuses, :package_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb b/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb deleted file mode 100644 index 8dd23e1a72e..00000000000 --- a/db/migrate/20211112155416_populate_default_value_for_personal_access_tokens_prefix.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class PopulateDefaultValueForPersonalAccessTokensPrefix < Gitlab::Database::Migration[1.0] - def up - execute( - <<-SQL - UPDATE - application_settings - SET - personal_access_token_prefix = default - WHERE - personal_access_token_prefix IS NULL - SQL - ) - end - - def down - # no-op - end -end diff --git a/db/migrate/20211115132613_create_incident_management_timeline_events.rb b/db/migrate/20211115132613_create_incident_management_timeline_events.rb deleted file mode 100644 index 217dcd27b4c..00000000000 --- a/db/migrate/20211115132613_create_incident_management_timeline_events.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class CreateIncidentManagementTimelineEvents < Gitlab::Database::Migration[1.0] - def up - create_table :incident_management_timeline_events do |t| - t.timestamps_with_timezone null: false - t.datetime_with_timezone :occurred_at, null: false - t.bigint :project_id, null: false - t.bigint :author_id - t.bigint :issue_id, null: false - t.bigint :updated_by_user_id - t.bigint :promoted_from_note_id - t.integer :cached_markdown_version - t.boolean :editable, null: false, default: false - t.text :note, limit: 10_000, null: false - t.text :note_html, limit: 10_000, null: false - t.text :action, limit: 128, null: false - - t.index :project_id, name: 'index_im_timeline_events_project_id' - t.index :author_id, name: 'index_im_timeline_events_author_id' - t.index :issue_id, name: 'index_im_timeline_events_issue_id' - t.index :updated_by_user_id, name: 'index_im_timeline_events_updated_by_user_id' - t.index :promoted_from_note_id, name: 'index_im_timeline_events_promoted_from_note_id' - end - end - - def down - drop_table :incident_management_timeline_events - end -end diff --git a/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb b/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb deleted file mode 100644 index 893043cc1ab..00000000000 --- a/db/migrate/20211115142803_add_foreign_key_to_incident_management_timeline_events_on_project.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToIncidentManagementTimelineEventsOnProject < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :incident_management_timeline_events, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :incident_management_timeline_events, column: :project_id - end - end -end diff --git a/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb b/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb deleted file mode 100644 index 0f5886eb5ed..00000000000 --- a/db/migrate/20211115142847_add_foreign_key_to_incident_management_timeline_events_on_user.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToIncidentManagementTimelineEventsOnUser < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :author_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key :incident_management_timeline_events, column: :author_id - end - end -end diff --git a/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb b/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb deleted file mode 100644 index bdcf7f389d1..00000000000 --- a/db/migrate/20211115142911_add_foreign_key_to_incident_management_timeline_events_on_issue.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToIncidentManagementTimelineEventsOnIssue < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :incident_management_timeline_events, :issues, column: :issue_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :incident_management_timeline_events, column: :issue_id - end - end -end diff --git a/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb b/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb deleted file mode 100644 index e0e2bec72ad..00000000000 --- a/db/migrate/20211115145107_add_created_at_to_namespace_monthly_usages.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddCreatedAtToNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :ci_namespace_monthly_usages, :created_at, :datetime_with_timezone - end - end - - def down - with_lock_retries do - remove_column :ci_namespace_monthly_usages, :created_at - end - end -end diff --git a/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb b/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb deleted file mode 100644 index eb0cd448da3..00000000000 --- a/db/migrate/20211115154103_add_created_at_to_project_monthly_usage.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddCreatedAtToProjectMonthlyUsage < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :ci_project_monthly_usages, :created_at, :datetime_with_timezone - end - end - - def down - with_lock_retries do - remove_column :ci_project_monthly_usages, :created_at - end - end -end diff --git a/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb b/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb deleted file mode 100644 index a35020699fc..00000000000 --- a/db/migrate/20211116093739_add_foreign_key_to_incident_management_timeline_events_on_updated_by_user.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToIncidentManagementTimelineEventsOnUpdatedByUser < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :incident_management_timeline_events, :users, column: :updated_by_user_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key :incident_management_timeline_events, column: :updated_by_user_id - end - end -end diff --git a/db/migrate/20211117174209_create_vulnerability_reads.rb b/db/migrate/20211117174209_create_vulnerability_reads.rb deleted file mode 100644 index b9e32bfd0fa..00000000000 --- a/db/migrate/20211117174209_create_vulnerability_reads.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityReads < Gitlab::Database::Migration[1.0] - def change - create_table :vulnerability_reads do |t| - t.bigint :vulnerability_id, null: false - t.bigint :project_id, null: false - t.bigint :scanner_id, null: false - t.integer :report_type, limit: 2, null: false - t.integer :severity, limit: 2, null: false - t.integer :state, limit: 2, null: false - t.boolean :has_issues, default: false, null: false - t.boolean :resolved_on_default_branch, default: false, null: false - t.uuid :uuid, null: false - t.text :location_image, limit: 2048 - - t.index :vulnerability_id, unique: true - t.index :scanner_id - t.index :uuid, unique: true - t.index [:project_id, :state, :severity, :vulnerability_id], name: :index_vuln_reads_on_project_id_state_severity_and_vuln_id, order: { vulnerability_id: :desc } - t.index :location_image, where: "report_type IN (2, 7)", name: :index_vulnerability_reads_on_location_image - end - end -end diff --git a/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb b/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb deleted file mode 100644 index 185178d8025..00000000000 --- a/db/migrate/20211118100959_change_default_value_of_loose_fk_deleted_records_partition.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class ChangeDefaultValueOfLooseFkDeletedRecordsPartition < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - change_column_default(:loose_foreign_keys_deleted_records, :partition, from: nil, to: 1) - end -end diff --git a/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb b/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb deleted file mode 100644 index 33159167b19..00000000000 --- a/db/migrate/20211118103439_remove_hardcoded_partition_from_loose_fk_trigger_function.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class RemoveHardcodedPartitionFromLooseFkTriggerFunction < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - execute(<<~SQL) - CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}() - RETURNS TRIGGER AS - $$ - BEGIN - INSERT INTO loose_foreign_keys_deleted_records - (fully_qualified_table_name, primary_key_value) - SELECT TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table; - - RETURN NULL; - END - $$ LANGUAGE PLPGSQL - SQL - end - - def down - execute(<<~SQL) - CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}() - RETURNS TRIGGER AS - $$ - BEGIN - INSERT INTO loose_foreign_keys_deleted_records - (partition, fully_qualified_table_name, primary_key_value) - SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table - ON CONFLICT DO NOTHING; - - RETURN NULL; - END - $$ LANGUAGE PLPGSQL - SQL - end -end diff --git a/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb b/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb deleted file mode 100644 index 1b0d2104c91..00000000000 --- a/db/migrate/20211118114228_add_max_ssh_key_lifetime_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddMaxSshKeyLifetimeToApplicationSettings < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, :max_ssh_key_lifetime, :integer - end -end diff --git a/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb b/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb deleted file mode 100644 index dd5b0bdc028..00000000000 --- a/db/migrate/20211118124537_add_foreign_key_to_vulnerability_reads_on_vulnerability.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToVulnerabilityReadsOnVulnerability < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_reads, :vulnerabilities, column: :vulnerability_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :vulnerability_reads, column: :vulnerability_id - end - end -end diff --git a/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb b/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb deleted file mode 100644 index 14dde371e3d..00000000000 --- a/db/migrate/20211118124628_add_foreign_key_to_vulnerability_reads_on_project.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToVulnerabilityReadsOnProject < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_reads, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :vulnerability_reads, column: :project_id - end - end -end diff --git a/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb b/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb deleted file mode 100644 index 923e62a4beb..00000000000 --- a/db/migrate/20211118124650_add_foreign_key_to_vulnerability_reads_on_scanner.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToVulnerabilityReadsOnScanner < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_reads, :vulnerability_scanners, column: :scanner_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :vulnerability_reads, column: :scanner_id - end - end -end diff --git a/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb b/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb deleted file mode 100644 index f52bc346d16..00000000000 --- a/db/migrate/20211119085015_add_orignal_filename_to_ci_job_artifact.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddOrignalFilenameToCiJobArtifact < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20211119085036_add_text_limit_to_job_artifact_original_filename.rb - def up - add_column :ci_job_artifacts, :original_filename, :text - end - # rubocop:enable Migration/AddLimitToTextColumns - - def down - remove_column :ci_job_artifacts, :original_filename, :text - end -end diff --git a/db/migrate/20211119111006_create_job_artifact_states.rb b/db/migrate/20211119111006_create_job_artifact_states.rb deleted file mode 100644 index 44dffed58ee..00000000000 --- a/db/migrate/20211119111006_create_job_artifact_states.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class CreateJobArtifactStates < Gitlab::Database::Migration[1.0] - VERIFICATION_STATE_INDEX_NAME = "index_job_artifact_states_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_job_artifact_states_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_job_artifact_states_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_job_artifact_states_needs_verification" - - enable_lock_retries! - - def up - create_table :ci_job_artifact_states, id: false do |t| - t.datetime_with_timezone :verification_started_at - t.datetime_with_timezone :verification_retry_at - t.datetime_with_timezone :verified_at - t.references :job_artifact, primary_key: true, null: false, foreign_key: { on_delete: :cascade, to_table: :ci_job_artifacts } - 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 :ci_job_artifact_states - end -end diff --git a/db/migrate/20211119154221_create_pages_deployment_states.rb b/db/migrate/20211119154221_create_pages_deployment_states.rb deleted file mode 100644 index 283f6c7d0d7..00000000000 --- a/db/migrate/20211119154221_create_pages_deployment_states.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class CreatePagesDeploymentStates < Gitlab::Database::Migration[1.0] - VERIFICATION_STATE_INDEX_NAME = "index_pages_deployment_states_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_pages_deployment_states_needs_verification" - - disable_ddl_transaction! - - def up - unless table_exists?(:pages_deployment_states) - with_lock_retries do - create_table :pages_deployment_states, id: false do |t| - t.references :pages_deployment, primary_key: true, null: false, foreign_key: { on_delete: :cascade } - t.integer :verification_state, default: 0, limit: 2, null: false - t.column :verification_started_at, :datetime_with_timezone - t.datetime_with_timezone :verification_retry_at - t.datetime_with_timezone :verified_at - t.integer :verification_retry_count, limit: 2 - t.binary :verification_checksum, using: 'verification_checksum::bytea' - t.text :verification_failure - - 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 - end - - add_text_limit :pages_deployment_states, :verification_failure, 255 - end - - def down - drop_table :pages_deployment_states - end -end diff --git a/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb b/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb deleted file mode 100644 index 9064242ee30..00000000000 --- a/db/migrate/20211119170805_remove_test_report_requirement_issue_constraint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class RemoveTestReportRequirementIssueConstraint < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TARGET_TABLE = :requirements_management_test_reports - CONSTRAINT_NAME = 'requirements_test_reports_requirement_id_xor_issue_id' - - def up - remove_check_constraint TARGET_TABLE, CONSTRAINT_NAME - end - - def down - add_check_constraint(TARGET_TABLE, 'num_nonnulls(requirement_id, issue_id) = 1', CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb b/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb deleted file mode 100644 index ca6b78efbc7..00000000000 --- a/db/migrate/20211119194024_add_required_approval_count_to_protected_environments.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddRequiredApprovalCountToProtectedEnvironments < Gitlab::Database::Migration[1.0] - def change - add_column :protected_environments, :required_approval_count, :integer, default: 0, null: false - end -end diff --git a/db/migrate/20211119195201_create_deployment_approvals.rb b/db/migrate/20211119195201_create_deployment_approvals.rb deleted file mode 100644 index a238da302f9..00000000000 --- a/db/migrate/20211119195201_create_deployment_approvals.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CreateDeploymentApprovals < Gitlab::Database::Migration[1.0] - def change - create_table :deployment_approvals do |t| - t.bigint :deployment_id, null: false - t.bigint :user_id, null: false, index: true - t.timestamps_with_timezone null: false - t.integer :status, limit: 2, null: false - t.index [:deployment_id, :user_id], unique: true - end - end -end diff --git a/db/migrate/20211122103051_add_line_code_to_draft_notes.rb b/db/migrate/20211122103051_add_line_code_to_draft_notes.rb deleted file mode 100644 index c78b75f3a33..00000000000 --- a/db/migrate/20211122103051_add_line_code_to_draft_notes.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddLineCodeToDraftNotes < Gitlab::Database::Migration[1.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb - def change - add_column :draft_notes, :line_code, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb b/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb deleted file mode 100644 index b1c7bc4d5ce..00000000000 --- a/db/migrate/20211122215001_add_policy_idx_to_approval_merge_request_rule.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddPolicyIdxToApprovalMergeRequestRule < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - add_column :approval_merge_request_rules, :orchestration_policy_idx, :integer, limit: 2 - end -end diff --git a/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb b/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb deleted file mode 100644 index 280626c5d3b..00000000000 --- a/db/migrate/20211123135255_create_batched_background_migration_job_transition_logs.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class CreateBatchedBackgroundMigrationJobTransitionLogs < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - def up - execute(<<~SQL) - CREATE TABLE batched_background_migration_job_transition_logs ( - id bigserial NOT NULL, - batched_background_migration_job_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - previous_status smallint NOT NULL, - next_status smallint NOT NULL, - exception_class text, - exception_message text, - CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), - CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)), - PRIMARY KEY (id, created_at) - ) PARTITION BY RANGE (created_at); - - CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id - ON batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id); - - ALTER TABLE batched_background_migration_job_transition_logs ADD CONSTRAINT fk_rails_b7523a175b - FOREIGN KEY (batched_background_migration_job_id) REFERENCES batched_background_migration_jobs(id) ON DELETE CASCADE; - SQL - - min_date = Date.today - max_date = Date.today + 6.months - - create_daterange_partitions('batched_background_migration_job_transition_logs', 'created_at', min_date, max_date) - end - - def down - drop_table :batched_background_migration_job_transition_logs - end -end diff --git a/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb b/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb deleted file mode 100644 index da20e9a8f8e..00000000000 --- a/db/migrate/20211123181236_add_user_foreign_key_to_deployment_approvals.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUserForeignKeyToDeploymentApprovals < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :deployment_approvals, :users, column: :user_id - end - - def down - with_lock_retries do - remove_foreign_key :deployment_approvals, :users - end - end -end diff --git a/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb b/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb deleted file mode 100644 index 10a0c6ca402..00000000000 --- a/db/migrate/20211123182614_make_iteration_cadences_start_date_nullable.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class MakeIterationCadencesStartDateNullable < Gitlab::Database::Migration[1.0] - def change - change_column_null :iterations_cadences, :start_date, true - end -end diff --git a/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb b/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb deleted file mode 100644 index b3567d6b873..00000000000 --- a/db/migrate/20211124095704_add_draft_notes_line_code_text_limit.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddDraftNotesLineCodeTextLimit < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :draft_notes, :line_code, 255 - end - - def down - remove_text_limit :draft_notes, :line_code - end -end diff --git a/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb b/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb deleted file mode 100644 index 868bc4f14f2..00000000000 --- a/db/migrate/20211124132319_add_encrypted_static_objects_external_storage_auth_token.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddEncryptedStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0] - def up - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20211126113029_add_text_limit_for_static_objects_external_storage_auth_token - add_column :application_settings, :static_objects_external_storage_auth_token_encrypted, :text - # rubocop:enable Migration/AddLimitToTextColumns - end - - def down - remove_column :application_settings, :static_objects_external_storage_auth_token_encrypted - end -end diff --git a/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb b/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb deleted file mode 100644 index cbe5dbf99fc..00000000000 --- a/db/migrate/20211126042235_add_sequence_column_to_sprints_table.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddSequenceColumnToSprintsTable < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - add_column :sprints, :sequence, :integer - execute "ALTER TABLE sprints ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED" - end - - def down - remove_column :sprints, :sequence - end -end diff --git a/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb b/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb deleted file mode 100644 index 45c4686e674..00000000000 --- a/db/migrate/20211126113029_add_text_limit_for_static_objects_external_storage_auth_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true -class AddTextLimitForStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :application_settings, :static_objects_external_storage_auth_token_encrypted, 255 - end - - def down - remove_text_limit :application_settings, :static_objects_external_storage_auth_token_encrypted - end -end diff --git a/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb b/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb deleted file mode 100644 index 92ba54d4c89..00000000000 --- a/db/migrate/20211126115449_encrypt_static_objects_external_storage_auth_token.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class EncryptStaticObjectsExternalStorageAuthToken < Gitlab::Database::Migration[1.0] - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - - scope :encrypted_token_is_null, -> { where(static_objects_external_storage_auth_token_encrypted: nil) } - scope :encrypted_token_is_not_null, -> { where.not(static_objects_external_storage_auth_token_encrypted: nil) } - scope :plaintext_token_is_not_null, -> { where.not(static_objects_external_storage_auth_token: nil) } - end - - def up - ApplicationSetting.reset_column_information - - ApplicationSetting.encrypted_token_is_null.plaintext_token_is_not_null.find_each do |application_setting| - next if application_setting.static_objects_external_storage_auth_token.empty? - - token_encrypted = Gitlab::CryptoHelper.aes256_gcm_encrypt(application_setting.static_objects_external_storage_auth_token) - application_setting.update!(static_objects_external_storage_auth_token_encrypted: token_encrypted) - end - end - - def down - ApplicationSetting.reset_column_information - - ApplicationSetting.encrypted_token_is_not_null.find_each do |application_setting| - token = Gitlab::CryptoHelper.aes256_gcm_decrypt(application_setting.static_objects_external_storage_auth_token_encrypted) - application_setting.update!(static_objects_external_storage_auth_token: token, static_objects_external_storage_auth_token_encrypted: nil) - end - end -end diff --git a/db/migrate/20211126142200_add_encrypted_static_object_token.rb b/db/migrate/20211126142200_add_encrypted_static_object_token.rb deleted file mode 100644 index 839354244e7..00000000000 --- a/db/migrate/20211126142200_add_encrypted_static_object_token.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddEncryptedStaticObjectToken < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20211126142354_add_text_limit_to_encrypted_static_object_token - add_column :users, :static_object_token_encrypted, :text # rubocop:disable Migration/AddColumnsToWideTables - # rubocop:enable Migration/AddLimitToTextColumns - end - - def down - remove_column :users, :static_object_token_encrypted - end -end diff --git a/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb b/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb deleted file mode 100644 index a43e7d9a741..00000000000 --- a/db/migrate/20211126142354_add_text_limit_to_encrypted_static_object_token.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToEncryptedStaticObjectToken < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :users, :static_object_token_encrypted, 255 - end - - def down - remove_text_limit :users, :static_object_token_encrypted - end -end diff --git a/db/migrate/20211126204445_add_task_to_work_item_types.rb b/db/migrate/20211126204445_add_task_to_work_item_types.rb deleted file mode 100644 index 875c2272c6d..00000000000 --- a/db/migrate/20211126204445_add_task_to_work_item_types.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class AddTaskToWorkItemTypes < Gitlab::Database::Migration[1.0] - TASK_ENUM_VALUE = 4 - - class WorkItemType < ActiveRecord::Base - self.inheritance_column = :_type_disabled - self.table_name = 'work_item_types' - - validates :name, uniqueness: { case_sensitive: false, scope: [:namespace_id] } - end - - def up - # New instances will not run this migration and add this type via fixtures - # checking if record exists mostly because migration specs will run all migrations - # and that will conflict with the preloaded base work item types - task_work_item = WorkItemType.find_by(name: 'Task', namespace_id: nil) - - if task_work_item - say('Task item record exist, skipping creation') - else - WorkItemType.create(name: 'Task', namespace_id: nil, base_type: TASK_ENUM_VALUE, icon_name: 'issue-type-task') - end - end - - def down - # There's the remote possibility that issues could already be - # using this issue type, with a tight foreign constraint. - # Therefore we will not attempt to remove any data. - end -end diff --git a/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb b/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb deleted file mode 100644 index 8c3cf82d7c7..00000000000 --- a/db/migrate/20211129151155_add_migrated_to_new_structure_column_to_vulnerability_occurrences.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddMigratedToNewStructureColumnToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] - def change - add_column :vulnerability_occurrences, :migrated_to_new_structure, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb b/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb deleted file mode 100644 index 4cf8263f8f0..00000000000 --- a/db/migrate/20211129151832_add_index_on_vulnerability_occurrences_migrated_to_new_structure_column.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnVulnerabilityOccurrencesMigratedToNewStructureColumn < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_vulnerability_occurrences_on_migrated_to_new_structure' - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerability_occurrences, [:migrated_to_new_structure, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME - end -end diff --git a/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb b/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb deleted file mode 100644 index a09409900f7..00000000000 --- a/db/migrate/20211130151724_add_foreign_key_to_incident_management_timeline_events_on_note.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToIncidentManagementTimelineEventsOnNote < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :incident_management_timeline_events, :notes, column: :promoted_from_note_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key :incident_management_timeline_events, column: :promoted_from_note_id - end - end -end diff --git a/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb b/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb deleted file mode 100644 index 1aca3e7e8e2..00000000000 --- a/db/migrate/20211130205719_add_uniqueness_for_evidence_occurrence_id.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddUniquenessForEvidenceOccurrenceId < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'finding_evidences_on_vulnerability_occurrence_id' - UNIQUE_INDEX_NAME = 'finding_evidences_on_unique_vulnerability_occurrence_id' - - def up - add_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], unique: true, name: UNIQUE_INDEX_NAME - remove_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: INDEX_NAME - end - - def down - add_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: INDEX_NAME - remove_concurrent_index :vulnerability_finding_evidences, [:vulnerability_occurrence_id], name: UNIQUE_INDEX_NAME - end -end diff --git a/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb b/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb deleted file mode 100644 index 9cbbef42327..00000000000 --- a/db/migrate/20211201061733_add_future_subscriptions_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddFutureSubscriptionsToApplicationSettings < Gitlab::Database::Migration[1.0] - def change - add_column :application_settings, :future_subscriptions, :jsonb, null: false, default: [] - end -end diff --git a/db/migrate/20211201143042_create_lfs_object_states.rb b/db/migrate/20211201143042_create_lfs_object_states.rb deleted file mode 100644 index 91accbcd438..00000000000 --- a/db/migrate/20211201143042_create_lfs_object_states.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class CreateLfsObjectStates < Gitlab::Database::Migration[1.0] - VERIFICATION_STATE_INDEX_NAME = "index_lfs_object_states_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_lfs_object_states_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_lfs_object_states_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_lfs_object_states_needs_verification" - - disable_ddl_transaction! - - def up - create_table :lfs_object_states, id: false do |t| - t.datetime_with_timezone :verification_started_at - t.datetime_with_timezone :verification_retry_at - t.datetime_with_timezone :verified_at - t.references :lfs_object, primary_key: true, null: false, 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 :lfs_object_states - end -end diff --git a/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb b/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb deleted file mode 100644 index 60bc892d792..00000000000 --- a/db/migrate/20211202041233_add_deployment_foreign_key_to_deployment_approvals.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddDeploymentForeignKeyToDeploymentApprovals < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :deployment_approvals, :deployments, column: :deployment_id - end - - def down - with_lock_retries do - remove_foreign_key :deployment_approvals, :deployments - end - end -end diff --git a/db/migrate/20211202041233_init_schema.rb b/db/migrate/20211202041233_init_schema.rb new file mode 100644 index 00000000000..97027f8a9e4 --- /dev/null +++ b/db/migrate/20211202041233_init_schema.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class InitSchema < Gitlab::Database::Migration[1.0] + DOWNTIME = false + + def up + execute(File.read("db/init_structure.sql")) + end + + def down + raise ActiveRecord::IrreversibleMigration, "The initial migration is not able to be reverted." + end +end diff --git a/db/migrate/20221225010101_create_workspaces_table.rb b/db/migrate/20221225010101_create_workspaces_table.rb new file mode 100644 index 00000000000..4c8bc26bcf6 --- /dev/null +++ b/db/migrate/20221225010101_create_workspaces_table.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class CreateWorkspacesTable < Gitlab::Database::Migration[2.1] + def up + create_table :workspaces do |t| + t.timestamps_with_timezone null: false + # NOTE: All workspace foreign key references are currently `on_delete: :cascade`, because we have no support or + # testing around null values. However, in the future we may want to switch these to nullify, especially + # once we start introducing logging, metrics, billing, etc. around workspaces. + t.bigint :user_id, null: false, index: true + t.bigint :project_id, null: false, index: true + t.bigint :cluster_agent_id, null: false, index: true + t.datetime_with_timezone :desired_state_updated_at, null: false + t.datetime_with_timezone :responded_to_agent_at + t.integer :max_hours_before_termination, limit: 2, null: false + t.text :name, limit: 64, null: false, index: { unique: true } + t.text :namespace, limit: 64, null: false + t.text :desired_state, limit: 32, null: false + t.text :actual_state, limit: 32, null: false + t.text :editor, limit: 256, null: false + t.text :devfile_ref, limit: 256, null: false + t.text :devfile_path, limit: 2048, null: false + # NOTE: The limit on the devfile fields are arbitrary, and only added to avoid a rubocop + # Migration/AddLimitToTextColumns error. We expect the average devfile side to be small, perhaps ~0.5k for a + # devfile and ~2k for a processed_devfile, but to account for unexpected usage resulting in larger files, + # we have specified 65535, which allows for a YAML file with over 800 lines of an average 80-character + # length. + t.text :devfile, limit: 65535 + t.text :processed_devfile, limit: 65535 + t.text :url, limit: 1024, null: false + # NOTE: The resource version is currently backed by etcd's mod_revision. + # However, it's important to note that the application should not rely on the implementation details of + # the versioning system maintained by Kubernetes. We may change the implementation of resource version + # in the future, such as to change it to a timestamp or per-object counter. + # https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + # The limit of 64 is arbitrary. + t.text :deployment_resource_version, limit: 64 + end + end + + def down + drop_table :workspaces + end +end diff --git a/db/migrate/20221225010102_create_workspaces_user_foreign_key.rb b/db/migrate/20221225010102_create_workspaces_user_foreign_key.rb new file mode 100644 index 00000000000..f6c38f289d6 --- /dev/null +++ b/db/migrate/20221225010102_create_workspaces_user_foreign_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateWorkspacesUserForeignKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # NOTE: All workspace foreign key references are currently `on_delete: :cascade`, because we have no support or + # testing around null values. However, in the future we may want to switch these to nullify, especially + # once we start introducing logging, metrics, billing, etc. around workspaces. + add_concurrent_foreign_key :workspaces, :users, column: :user_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :workspaces, column: :user_id + end + end +end diff --git a/db/migrate/20221225010103_create_workspaces_project_foreign_key.rb b/db/migrate/20221225010103_create_workspaces_project_foreign_key.rb new file mode 100644 index 00000000000..fe2b6eec2e0 --- /dev/null +++ b/db/migrate/20221225010103_create_workspaces_project_foreign_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateWorkspacesProjectForeignKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # NOTE: All workspace foreign key references are currently `on_delete: :cascade`, because we have no support or + # testing around null values. However, in the future we may want to switch these to nullify, especially + # once we start introducing logging, metrics, billing, etc. around workspaces. + add_concurrent_foreign_key :workspaces, :projects, column: :project_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :workspaces, column: :project_id + end + end +end diff --git a/db/migrate/20221225010104_create_workspaces_cluster_agent_foreign_key.rb b/db/migrate/20221225010104_create_workspaces_cluster_agent_foreign_key.rb new file mode 100644 index 00000000000..c7874349e86 --- /dev/null +++ b/db/migrate/20221225010104_create_workspaces_cluster_agent_foreign_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateWorkspacesClusterAgentForeignKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # NOTE: All workspace foreign key references are currently `on_delete: :cascade`, because we have no support or + # testing around null values. However, in the future we may want to switch these to nullify, especially + # once we start introducing logging, metrics, billing, etc. around workspaces. + add_concurrent_foreign_key :workspaces, :cluster_agents, column: :cluster_agent_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :workspaces, column: :cluster_agent_id + end + end +end diff --git a/db/migrate/20221225010105_create_remote_development_agent_configs_table.rb b/db/migrate/20221225010105_create_remote_development_agent_configs_table.rb new file mode 100644 index 00000000000..f375f78b616 --- /dev/null +++ b/db/migrate/20221225010105_create_remote_development_agent_configs_table.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateRemoteDevelopmentAgentConfigsTable < Gitlab::Database::Migration[2.1] + def up + create_table :remote_development_agent_configs do |t| + t.timestamps_with_timezone null: false + t.bigint :cluster_agent_id, null: false, index: true + t.boolean :enabled, null: false + t.text :dns_zone, null: false, limit: 256 + end + end + + def down + drop_table :remote_development_agent_configs + end +end diff --git a/db/migrate/20221225010106_create_remote_development_agent_config_agent_foreign_key.rb b/db/migrate/20221225010106_create_remote_development_agent_config_agent_foreign_key.rb new file mode 100644 index 00000000000..b861f417168 --- /dev/null +++ b/db/migrate/20221225010106_create_remote_development_agent_config_agent_foreign_key.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateRemoteDevelopmentAgentConfigAgentForeignKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :remote_development_agent_configs, + :cluster_agents, column: :cluster_agent_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :remote_development_agent_configs, column: :cluster_agent_id + end + end +end diff --git a/db/migrate/20221229172604_add_runner_registration_enabled_to_project_settings.rb b/db/migrate/20221229172604_add_runner_registration_enabled_to_project_settings.rb new file mode 100644 index 00000000000..0e403dac24f --- /dev/null +++ b/db/migrate/20221229172604_add_runner_registration_enabled_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRunnerRegistrationEnabledToProjectSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :project_settings, :runner_registration_enabled, :boolean, default: true + end +end diff --git a/db/migrate/20230113164245_create_namespace_ldap_settings.rb b/db/migrate/20230113164245_create_namespace_ldap_settings.rb new file mode 100644 index 00000000000..5ad72c00b47 --- /dev/null +++ b/db/migrate/20230113164245_create_namespace_ldap_settings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateNamespaceLdapSettings < Gitlab::Database::Migration[2.1] + def change + create_table :namespace_ldap_settings, if_not_exists: true, id: false do |t| + t.references :namespace, primary_key: true, default: nil, + type: :bigint, index: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.column :sync_last_start_at, :datetime_with_timezone + t.column :sync_last_update_at, :datetime_with_timezone + t.column :sync_last_successful_at, :datetime_with_timezone + t.integer :sync_status, null: false, default: 0, limit: 2 + t.text :sync_error, limit: 255 + end + end +end diff --git a/db/migrate/20230118135145_add_service_desk_custom_email_verifications.rb b/db/migrate/20230118135145_add_service_desk_custom_email_verifications.rb new file mode 100644 index 00000000000..32f7f3392e6 --- /dev/null +++ b/db/migrate/20230118135145_add_service_desk_custom_email_verifications.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class AddServiceDeskCustomEmailVerifications < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + create_table(:service_desk_custom_email_verifications, id: false, primary_key: :project_id) do |t| + t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false + t.references :triggerer, index: true, foreign_key: { to_table: :users, on_delete: :nullify } + t.timestamps_with_timezone + t.datetime_with_timezone :triggered_at + t.integer :state, limit: 2, null: false, default: 0 + t.integer :error, limit: 2 + t.binary :encrypted_token + t.binary :encrypted_token_iv + end + + execute "ALTER TABLE service_desk_custom_email_verifications ADD PRIMARY KEY (project_id);" + end + + def down + drop_table :service_desk_custom_email_verifications + end +end diff --git a/db/migrate/20230127024835_add_database_apdex_settings_to_application_settings.rb b/db/migrate/20230127024835_add_database_apdex_settings_to_application_settings.rb new file mode 100644 index 00000000000..70c4962d02d --- /dev/null +++ b/db/migrate/20230127024835_add_database_apdex_settings_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDatabaseApdexSettingsToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :database_apdex_settings, :jsonb + end +end diff --git a/db/migrate/20230127030015_add_deny_all_outgoing_requests_to_application_settings.rb b/db/migrate/20230127030015_add_deny_all_outgoing_requests_to_application_settings.rb new file mode 100644 index 00000000000..b12176a5541 --- /dev/null +++ b/db/migrate/20230127030015_add_deny_all_outgoing_requests_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddDenyAllOutgoingRequestsToApplicationSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :application_settings, :deny_all_requests_except_allowed, :boolean, default: false, null: false + 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 index 960421ae38e..4ce3643208e 100644 --- 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 @@ -6,6 +6,10 @@ class AddIdColumnToPackageMetadataJoinTable < Gitlab::Database::Migration[2.1] COMPOSITE_UNIQUE_INDEX = :i_pm_package_version_licenses_join_ids def up + if Gitlab::Database::PostgresPartitionedTable.where(name: 'pm_package_version_licenses').exists? + recreate_unpartitioned_tables + end + 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, @@ -13,8 +17,60 @@ class AddIdColumnToPackageMetadataJoinTable < Gitlab::Database::Migration[2.1] end def down + return if Gitlab::Database::PostgresPartitionedTable.where(name: 'pm_package_version_licenses').exists? + 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 + + private + + def recreate_unpartitioned_tables + drop_table(:pm_package_version_licenses, force: :cascade) # rubocop:disable Migration/DropTable + drop_table(:pm_package_versions, force: :cascade) # rubocop:disable Migration/DropTable + drop_table(:pm_packages, force: :cascade) # rubocop:disable Migration/DropTable + + create_table :pm_packages do |t| + t.integer :purl_type, limit: 2, null: false + t.text :name, null: false, limit: 255 + t.timestamps_with_timezone null: false + t.index [:purl_type, :name], name: 'i_pm_packages_purl_type_and_name', unique: true + end + + create_table :pm_package_versions do |t| + t.references :pm_package, + index: false, + null: false, + foreign_key: { + to_table: :pm_packages, + column: :pm_package_id, + name: 'fk_rails_cf94c3e601', + on_delete: :cascade + } + t.text :version, null: false, limit: 255 + t.timestamps_with_timezone null: false + t.index [:pm_package_id, :version], name: 'i_pm_package_versions_on_package_id_and_version', unique: true + t.index :pm_package_id, name: 'index_pm_package_versions_on_pm_package_id' + end + + create_table :pm_package_version_licenses, primary_key: [:pm_package_version_id, :pm_license_id] do |t| + t.references :pm_package_version, + index: false, + null: false, + foreign_key: { + to_table: :pm_package_versions, + column: :pm_package_version_id, + name: 'fk_rails_30ddb7f837', + on_delete: :cascade + } + t.references :pm_license, + index: false, + null: false, + foreign_key: { name: 'fk_rails_7520ea026d', on_delete: :cascade } + t.timestamps_with_timezone null: false + t.index :pm_license_id, name: 'index_pm_package_version_licenses_on_pm_license_id' + t.index :pm_package_version_id, name: 'index_pm_package_version_licenses_on_pm_package_version_id' + end + end end diff --git a/db/migrate/20230201165656_create_container_repository_states.rb b/db/migrate/20230201165656_create_container_repository_states.rb new file mode 100644 index 00000000000..0e84faf11ee --- /dev/null +++ b/db/migrate/20230201165656_create_container_repository_states.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class CreateContainerRepositoryStates < Gitlab::Database::Migration[2.1] + VERIFICATION_STATE_INDEX_NAME = "index_container_repository_states_on_verification_state" + PENDING_VERIFICATION_INDEX_NAME = "index_container_repository_states_pending_verification" + FAILED_VERIFICATION_INDEX_NAME = "index_container_repository_states_failed_verification" + NEEDS_VERIFICATION_INDEX_NAME = "index_container_repository_states_needs_verification" + + disable_ddl_transaction! + + def up + create_table :container_repository_states, id: false do |t| + t.datetime_with_timezone :verification_started_at + t.datetime_with_timezone :verification_retry_at + t.datetime_with_timezone :verified_at + t.references :container_repository, + primary_key: true, + default: nil, + index: false, + foreign_key: { on_delete: :cascade } + t.integer :verification_state, default: 0, limit: 2, null: false + t.integer :verification_retry_count, default: 0, limit: 2, null: false + 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 :container_repository_states + end +end diff --git a/db/migrate/20230202094723_add_default_syntax_highlighting_theme_to_application_settings.rb b/db/migrate/20230202094723_add_default_syntax_highlighting_theme_to_application_settings.rb new file mode 100644 index 00000000000..048afb51f26 --- /dev/null +++ b/db/migrate/20230202094723_add_default_syntax_highlighting_theme_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDefaultSyntaxHighlightingThemeToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :default_syntax_highlighting_theme, :integer, default: 1, null: false + end +end diff --git a/db/migrate/20230207002330_add_project_group_link_on_delete_cascade_fk.rb b/db/migrate/20230207002330_add_project_group_link_on_delete_cascade_fk.rb new file mode 100644 index 00000000000..5d6f4961baf --- /dev/null +++ b/db/migrate/20230207002330_add_project_group_link_on_delete_cascade_fk.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddProjectGroupLinkOnDeleteCascadeFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + :project_group_links, + :namespaces, + column: :group_id, + on_delete: :cascade, + validate: false + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :project_group_links, column: :group_id + end + end +end diff --git a/db/migrate/20230210152109_add_bulk_import_export_batches.rb b/db/migrate/20230210152109_add_bulk_import_export_batches.rb new file mode 100644 index 00000000000..380f8a43aae --- /dev/null +++ b/db/migrate/20230210152109_add_bulk_import_export_batches.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddBulkImportExportBatches < Gitlab::Database::Migration[2.1] + def up + create_table :bulk_import_export_batches do |t| + t.references :export, index: true, null: false, foreign_key: { + to_table: :bulk_import_exports, on_delete: :cascade + } + t.timestamps_with_timezone null: false + t.integer :status, limit: 2, null: false, default: 0 + t.integer :batch_number, null: false, default: 0 + t.integer :objects_count, null: false, default: 0 + t.text :error, limit: 255 + t.index [:export_id, :batch_number], unique: true, name: 'i_bulk_import_export_batches_id_batch_number' + end + end + + def down + drop_table :bulk_import_export_batches + end +end diff --git a/db/migrate/20230210153420_add_batched_column_to_bulk_import_exports.rb b/db/migrate/20230210153420_add_batched_column_to_bulk_import_exports.rb new file mode 100644 index 00000000000..cfe4a2059bb --- /dev/null +++ b/db/migrate/20230210153420_add_batched_column_to_bulk_import_exports.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddBatchedColumnToBulkImportExports < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_import_exports, :batched, :boolean, null: false, default: false + add_column :bulk_import_exports, :batches_count, :integer, null: false, default: 0 + add_column :bulk_import_exports, :total_objects_count, :integer, null: false, default: 0 + end +end diff --git a/db/migrate/20230210155715_add_batch_id_to_bulk_import_export_uploads.rb b/db/migrate/20230210155715_add_batch_id_to_bulk_import_export_uploads.rb new file mode 100644 index 00000000000..986d31a5839 --- /dev/null +++ b/db/migrate/20230210155715_add_batch_id_to_bulk_import_export_uploads.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddBatchIdToBulkImportExportUploads < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_import_export_uploads, :batch_id, :bigint + end +end diff --git a/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb b/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb new file mode 100644 index 00000000000..de0286f27ed --- /dev/null +++ b/db/migrate/20230210160037_add_batch_foreign_key_to_bulk_import_export_uploads.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddBatchForeignKeyToBulkImportExportUploads < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :bulk_import_export_uploads, :bulk_import_export_batches, column: :batch_id + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :bulk_import_export_uploads, column: :batch_id + end + end +end diff --git a/db/migrate/20230210160351_add_bulk_import_batch_trackers.rb b/db/migrate/20230210160351_add_bulk_import_batch_trackers.rb new file mode 100644 index 00000000000..40f6341680f --- /dev/null +++ b/db/migrate/20230210160351_add_bulk_import_batch_trackers.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddBulkImportBatchTrackers < Gitlab::Database::Migration[2.1] + def up + create_table :bulk_import_batch_trackers do |t| + t.references :tracker, index: true, null: false, foreign_key: { + to_table: :bulk_import_trackers, on_delete: :cascade + } + t.timestamps_with_timezone null: false + t.integer :status, limit: 2, null: false, default: 0 + t.integer :batch_number, null: false, default: 0 + t.integer :fetched_objects_count, null: false, default: 0 + t.integer :imported_objects_count, null: false, default: 0 + t.text :error, limit: 255 + t.index [:tracker_id, :batch_number], unique: true, name: 'i_bulk_import_trackers_id_batch_number' + end + end + + def down + drop_table :bulk_import_batch_trackers + end +end diff --git a/db/migrate/20230210161002_add_batched_column_to_bulk_import_trackers.rb b/db/migrate/20230210161002_add_batched_column_to_bulk_import_trackers.rb new file mode 100644 index 00000000000..5640164a117 --- /dev/null +++ b/db/migrate/20230210161002_add_batched_column_to_bulk_import_trackers.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddBatchedColumnToBulkImportTrackers < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_import_trackers, :batched, :boolean, default: false + end +end diff --git a/db/migrate/20230210171012_add_batch_id_index_to_bulk_import_export_uploads.rb b/db/migrate/20230210171012_add_batch_id_index_to_bulk_import_export_uploads.rb new file mode 100644 index 00000000000..c2fd4198762 --- /dev/null +++ b/db/migrate/20230210171012_add_batch_id_index_to_bulk_import_export_uploads.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddBatchIdIndexToBulkImportExportUploads < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'bulk_import_export_uploads_batch_id' + + def up + add_concurrent_index :bulk_import_export_uploads, :batch_id, name: INDEX_NAME + end + + def down + remove_concurrent_index :bulk_import_export_uploads, :batch_id, name: INDEX_NAME + end +end diff --git a/db/migrate/20230213213559_add_index_on_project_id_and_scanner_id_and_vulnerability_id_on_vulnerability_reads.rb b/db/migrate/20230213213559_add_index_on_project_id_and_scanner_id_and_vulnerability_id_on_vulnerability_reads.rb new file mode 100644 index 00000000000..ee9e15d2484 --- /dev/null +++ b/db/migrate/20230213213559_add_index_on_project_id_and_scanner_id_and_vulnerability_id_on_vulnerability_reads.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnProjectIdAndScannerIdAndVulnerabilityIdOnVulnerabilityReads < Gitlab::Database::Migration[2.1] + INDEX_NAME = "idx_vulnerability_reads_project_id_scanner_id_vulnerability_id" + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerability_reads, [:project_id, :scanner_id, :vulnerability_id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME + end +end diff --git a/db/migrate/20230215074223_add_ci_runner_machine_builds_partitioned_table.rb b/db/migrate/20230215074223_add_ci_runner_machine_builds_partitioned_table.rb new file mode 100644 index 00000000000..4e47d35d804 --- /dev/null +++ b/db/migrate/20230215074223_add_ci_runner_machine_builds_partitioned_table.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddCiRunnerMachineBuildsPartitionedTable < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + enable_lock_retries! + + TABLE_NAME = :ci_runner_machine_builds + PARENT_TABLE_NAME = :p_ci_runner_machine_builds + FIRST_PARTITION = 100 + + def up + execute(<<~SQL) + CREATE TABLE #{PARENT_TABLE_NAME} ( + partition_id bigint NOT NULL, + build_id bigint NOT NULL, + runner_machine_id bigint NOT NULL, + PRIMARY KEY (partition_id, build_id), + CONSTRAINT fk_bb490f12fe_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE + ) + PARTITION BY LIST (partition_id); + + CREATE INDEX index_ci_runner_machine_builds_on_runner_machine_id ON #{PARENT_TABLE_NAME} USING btree (runner_machine_id); + SQL + end + + def down + drop_table PARENT_TABLE_NAME + end +end diff --git a/db/migrate/20230215124011_add_provisioned_by_group_at_to_user_details.rb b/db/migrate/20230215124011_add_provisioned_by_group_at_to_user_details.rb new file mode 100644 index 00000000000..3ff1cf6c6d4 --- /dev/null +++ b/db/migrate/20230215124011_add_provisioned_by_group_at_to_user_details.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddProvisionedByGroupAtToUserDetails < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :user_details, :provisioned_by_group_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20230215131026_add_has_failures_column_to_bulk_imports.rb b/db/migrate/20230215131026_add_has_failures_column_to_bulk_imports.rb new file mode 100644 index 00000000000..52517244f3e --- /dev/null +++ b/db/migrate/20230215131026_add_has_failures_column_to_bulk_imports.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddHasFailuresColumnToBulkImports < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_imports, :has_failures, :boolean, default: false + end +end diff --git a/db/migrate/20230215180605_index_sbom_occurrences_on_project_id_and_id.rb b/db/migrate/20230215180605_index_sbom_occurrences_on_project_id_and_id.rb new file mode 100644 index 00000000000..34538a1a7ff --- /dev/null +++ b/db/migrate/20230215180605_index_sbom_occurrences_on_project_id_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexSbomOccurrencesOnProjectIdAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_sbom_occurrences_on_project_id_and_id' + + def up + add_concurrent_index :sbom_occurrences, [:project_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_occurrences, INDEX_NAME + end +end diff --git a/db/migrate/20230216040505_add_status_and_resolved_at_to_abuse_reports.rb b/db/migrate/20230216040505_add_status_and_resolved_at_to_abuse_reports.rb new file mode 100644 index 00000000000..3cfd082b465 --- /dev/null +++ b/db/migrate/20230216040505_add_status_and_resolved_at_to_abuse_reports.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddStatusAndResolvedAtToAbuseReports < Gitlab::Database::Migration[2.1] + def change + add_column :abuse_reports, :status, :integer, limit: 2, default: 1, null: false + add_timestamps_with_timezone(:abuse_reports, columns: [:resolved_at], null: true) + end +end diff --git a/db/migrate/20230216071312_add_status_category_and_id_index_to_abuse_reports.rb b/db/migrate/20230216071312_add_status_category_and_id_index_to_abuse_reports.rb new file mode 100644 index 00000000000..0c529f15b1b --- /dev/null +++ b/db/migrate/20230216071312_add_status_category_and_id_index_to_abuse_reports.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusCategoryAndIdIndexToAbuseReports < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_abuse_reports_on_status_category_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :abuse_reports, [:status, :category, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :abuse_reports, INDEX_NAME + end +end diff --git a/db/migrate/20230216142836_update_vulnerability_reads_trigger_to_set_has_issue.rb b/db/migrate/20230216142836_update_vulnerability_reads_trigger_to_set_has_issue.rb new file mode 100644 index 00000000000..73afa176b97 --- /dev/null +++ b/db/migrate/20230216142836_update_vulnerability_reads_trigger_to_set_has_issue.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +class UpdateVulnerabilityReadsTriggerToSetHasIssue < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + execute(<<~SQL) + CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads() + RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + severity smallint; + state smallint; + report_type smallint; + resolved_on_default_branch boolean; + present_on_default_branch boolean; + namespace_id bigint; + has_issues boolean; + BEGIN + IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN + RETURN NULL; + END IF; + + IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN + RETURN NULL; + END IF; + + SELECT + vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch, vulnerabilities.present_on_default_branch + INTO + severity, state, report_type, resolved_on_default_branch, present_on_default_branch + FROM + vulnerabilities + WHERE + vulnerabilities.id = NEW.vulnerability_id; + + IF present_on_default_branch IS NOT true THEN + RETURN NULL; + END IF; + + SELECT + projects.namespace_id + INTO + namespace_id + FROM + projects + WHERE + projects.id = NEW.project_id; + + SELECT + EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.vulnerability_id) + INTO + has_issues; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) + VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint), has_issues) + ON CONFLICT(vulnerability_id) DO NOTHING; + RETURN NULL; + END + $$ + SQL + + execute(<<~SQL) + CREATE OR REPLACE FUNCTION insert_vulnerability_reads_from_vulnerability() + RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + scanner_id bigint; + uuid uuid; + location_image text; + cluster_agent_id text; + casted_cluster_agent_id bigint; + namespace_id bigint; + has_issues boolean; + BEGIN + SELECT + v_o.scanner_id, v_o.uuid, v_o.location->>'image', v_o.location->'kubernetes_resource'->>'agent_id', CAST(v_o.location->'kubernetes_resource'->>'agent_id' AS bigint), projects.namespace_id + INTO + scanner_id, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, namespace_id + FROM + vulnerability_occurrences v_o + INNER JOIN projects ON projects.id = v_o.project_id + WHERE + v_o.vulnerability_id = NEW.id + LIMIT 1; + + SELECT + EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.id) + INTO + has_issues; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) + VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) + ON CONFLICT(vulnerability_id) DO NOTHING; + RETURN NULL; + END + $$ + SQL + end + + def down + execute(<<~SQL) + CREATE OR REPLACE FUNCTION insert_or_update_vulnerability_reads() RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + severity smallint; + state smallint; + report_type smallint; + resolved_on_default_branch boolean; + present_on_default_branch boolean; + namespace_id bigint; + BEGIN + IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN + RETURN NULL; + END IF; + + IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN + RETURN NULL; + END IF; + + SELECT + vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch, vulnerabilities.present_on_default_branch + INTO + severity, state, report_type, resolved_on_default_branch, present_on_default_branch + FROM + vulnerabilities + WHERE + vulnerabilities.id = NEW.vulnerability_id; + + IF present_on_default_branch IS NOT true THEN + RETURN NULL; + END IF; + + SELECT + projects.namespace_id + INTO + namespace_id + FROM + projects + WHERE + projects.id = NEW.project_id; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id) + VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint)) + ON CONFLICT(vulnerability_id) DO NOTHING; + RETURN NULL; + END + $$; + SQL + + execute(<<~SQL) + CREATE OR REPLACE FUNCTION insert_vulnerability_reads_from_vulnerability() RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + scanner_id bigint; + uuid uuid; + location_image text; + cluster_agent_id text; + casted_cluster_agent_id bigint; + namespace_id bigint; + BEGIN + SELECT + v_o.scanner_id, v_o.uuid, v_o.location->>'image', v_o.location->'kubernetes_resource'->>'agent_id', CAST(v_o.location->'kubernetes_resource'->>'agent_id' AS bigint), projects.namespace_id + INTO + scanner_id, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, namespace_id + FROM + vulnerability_occurrences v_o + INNER JOIN projects ON projects.id = v_o.project_id + WHERE + v_o.vulnerability_id = NEW.id + LIMIT 1; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id) + VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id) + ON CONFLICT(vulnerability_id) DO NOTHING; + RETURN NULL; + END + $$; + SQL + end +end diff --git a/db/migrate/20230216144719_drop_table_airflow_dags.rb b/db/migrate/20230216144719_drop_table_airflow_dags.rb new file mode 100644 index 00000000000..ed80ca16703 --- /dev/null +++ b/db/migrate/20230216144719_drop_table_airflow_dags.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class DropTableAirflowDags < Gitlab::Database::Migration[2.1] + def up + # the table is not in use + drop_table :airflow_dags, if_exists: true # rubocop: disable Migration/DropTable + end + + def down + 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/20230216152912_add_has_failures_column_to_bulk_import_entities.rb b/db/migrate/20230216152912_add_has_failures_column_to_bulk_import_entities.rb new file mode 100644 index 00000000000..4c48acd9dce --- /dev/null +++ b/db/migrate/20230216152912_add_has_failures_column_to_bulk_import_entities.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddHasFailuresColumnToBulkImportEntities < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_import_entities, :has_failures, :boolean, default: false + end +end diff --git a/db/migrate/20230216171309_create_ci_runner_cost_settings.rb b/db/migrate/20230216171309_create_ci_runner_cost_settings.rb new file mode 100644 index 00000000000..5bc624c635a --- /dev/null +++ b/db/migrate/20230216171309_create_ci_runner_cost_settings.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateCiRunnerCostSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :ci_cost_settings, id: false do |t| + t.timestamps_with_timezone null: false + t.references :runner, null: false, primary_key: true, index: false, + foreign_key: { to_table: :ci_runners, on_delete: :cascade }, + type: :bigint, default: nil + t.float :standard_factor, null: false, default: 1.00 + t.float :os_contribution_factor, null: false, default: 0.008 + t.float :os_plan_factor, null: false, default: 0.5 + end + end +end diff --git a/db/migrate/20230217065736_add_projects_api_rate_limit_unauthenticated_to_application_settings.rb b/db/migrate/20230217065736_add_projects_api_rate_limit_unauthenticated_to_application_settings.rb new file mode 100644 index 00000000000..f11560c33e9 --- /dev/null +++ b/db/migrate/20230217065736_add_projects_api_rate_limit_unauthenticated_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddProjectsApiRateLimitUnauthenticatedToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :projects_api_rate_limit_unauthenticated, :integer, default: 400, null: false + end +end diff --git a/db/migrate/20230217144421_add_check_type_to_pre_scan_step.rb b/db/migrate/20230217144421_add_check_type_to_pre_scan_step.rb new file mode 100644 index 00000000000..e4b59c28d73 --- /dev/null +++ b/db/migrate/20230217144421_add_check_type_to_pre_scan_step.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddCheckTypeToPreScanStep < Gitlab::Database::Migration[2.1] + def up + add_column :dast_pre_scan_verification_steps, :check_type, :integer, limit: 2, default: 0, null: false + end + + def down + remove_column :dast_pre_scan_verification_steps, :check_type + end +end diff --git a/db/migrate/20230217232554_add_state_changed_in_to_vulnerability_state_transitions.rb b/db/migrate/20230217232554_add_state_changed_in_to_vulnerability_state_transitions.rb new file mode 100644 index 00000000000..6a8b3b87e21 --- /dev/null +++ b/db/migrate/20230217232554_add_state_changed_in_to_vulnerability_state_transitions.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddStateChangedInToVulnerabilityStateTransitions < Gitlab::Database::Migration[2.1] + def up + add_column :vulnerability_state_transitions, :state_changed_at_pipeline_id, :bigint + end + + def down + remove_column :vulnerability_state_transitions, :state_changed_at_pipeline_id + end +end diff --git a/db/migrate/20230220035034_add_status_and_id_index_to_abuse_reports.rb b/db/migrate/20230220035034_add_status_and_id_index_to_abuse_reports.rb new file mode 100644 index 00000000000..cea01572e37 --- /dev/null +++ b/db/migrate/20230220035034_add_status_and_id_index_to_abuse_reports.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusAndIdIndexToAbuseReports < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_abuse_reports_on_status_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :abuse_reports, [:status, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :abuse_reports, INDEX_NAME + end +end diff --git a/db/migrate/20230220163141_create_catalog_resources_table.rb b/db/migrate/20230220163141_create_catalog_resources_table.rb new file mode 100644 index 00000000000..9a60a68415a --- /dev/null +++ b/db/migrate/20230220163141_create_catalog_resources_table.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CreateCatalogResourcesTable < Gitlab::Database::Migration[2.1] + def change + create_table :catalog_resources do |t| + t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } + + t.datetime_with_timezone :created_at, null: false + end + end +end diff --git a/db/migrate/20230221110256_create_initial_partition_for_ci_runner_machine_builds.rb b/db/migrate/20230221110256_create_initial_partition_for_ci_runner_machine_builds.rb new file mode 100644 index 00000000000..9aa7049dde1 --- /dev/null +++ b/db/migrate/20230221110256_create_initial_partition_for_ci_runner_machine_builds.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +class CreateInitialPartitionForCiRunnerMachineBuilds < Gitlab::Database::Migration[2.1] + PARTITION_NAME = 'gitlab_partitions_dynamic.ci_runner_machine_builds_100' + TABLE_NAME = 'p_ci_runner_machine_builds' + FIRST_PARTITION = 100 + BUILDS_TABLE = 'ci_builds' + + disable_ddl_transaction! + + def up + with_lock_retries(**lock_args) do + connection.execute(<<~SQL) + LOCK TABLE #{BUILDS_TABLE} IN SHARE UPDATE EXCLUSIVE MODE; + LOCK TABLE ONLY #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE; + SQL + + connection.execute(<<~SQL) + CREATE TABLE IF NOT EXISTS #{PARTITION_NAME} + PARTITION OF #{TABLE_NAME} + FOR VALUES IN (#{FIRST_PARTITION}); + SQL + end + end + + def down + # no-op + # + # The migration should not remove the partition table since it might + # have been created by 20230215074223_add_ci_runner_machine_builds_partitioned_table.rb. + # In that case, the rollback would result in a different state. + end + + private + + def lock_args + { + raise_on_exhaustion: true, + timing_configuration: lock_timing_configuration + } + end + + def lock_timing_configuration + iterations = Gitlab::Database::WithLockRetries::DEFAULT_TIMING_CONFIGURATION + aggressive_iterations = Array.new(5) { [10.seconds, 1.minute] } + + iterations + aggressive_iterations + end +end diff --git a/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb b/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb new file mode 100644 index 00000000000..50fcf6fd113 --- /dev/null +++ b/db/migrate/20230222153048_add_registry_size_estimated_to_namespace_root_storage_statistics.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddRegistrySizeEstimatedToNamespaceRootStorageStatistics < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_ns_root_stor_stats_on_registry_size_estimated' + + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :namespace_root_storage_statistics, :registry_size_estimated, :boolean, default: false, null: false + end + + add_concurrent_index :namespace_root_storage_statistics, :registry_size_estimated, name: INDEX_NAME + end + + def down + with_lock_retries do + remove_column :namespace_root_storage_statistics, :registry_size_estimated + end + end +end diff --git a/db/migrate/20230222161226_add_custom_jira_regex_to_jira_tracker_data.rb b/db/migrate/20230222161226_add_custom_jira_regex_to_jira_tracker_data.rb new file mode 100644 index 00000000000..c9668c311a3 --- /dev/null +++ b/db/migrate/20230222161226_add_custom_jira_regex_to_jira_tracker_data.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddCustomJiraRegexToJiraTrackerData < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230222161954_add_text_limit_to_custom_jira_regex_fields.rb + enable_lock_retries! + def change + add_column :jira_tracker_data, :jira_issue_prefix, :text + add_column :jira_tracker_data, :jira_issue_regex, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230222161954_add_text_limit_to_custom_jira_regex_fields.rb b/db/migrate/20230222161954_add_text_limit_to_custom_jira_regex_fields.rb new file mode 100644 index 00000000000..625655fda9d --- /dev/null +++ b/db/migrate/20230222161954_add_text_limit_to_custom_jira_regex_fields.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTextLimitToCustomJiraRegexFields < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :jira_tracker_data, :jira_issue_prefix, 255 + add_text_limit :jira_tracker_data, :jira_issue_regex, 255 + end + + def down + remove_text_limit :jira_tracker_data, :jira_issue_regex + remove_text_limit :jira_tracker_data, :jira_issue_regex + end +end diff --git a/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb b/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb new file mode 100644 index 00000000000..c86c16f692a --- /dev/null +++ b/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ChangePublicProjectsMinutesCostFactorDefaultTo1 < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + change_column_default :ci_runners, :public_projects_minutes_cost_factor, from: 0.0, to: 1.0 + end + end + + def down + with_lock_retries do + change_column_default :ci_runners, :public_projects_minutes_cost_factor, from: 1.0, to: 0.0 + end + end +end diff --git a/db/migrate/20230224130315_add_constraint_type_to_postgres_async_constraint_validation.rb b/db/migrate/20230224130315_add_constraint_type_to_postgres_async_constraint_validation.rb new file mode 100644 index 00000000000..dee5810d0d1 --- /dev/null +++ b/db/migrate/20230224130315_add_constraint_type_to_postgres_async_constraint_validation.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddConstraintTypeToPostgresAsyncConstraintValidation < Gitlab::Database::Migration[2.1] + def change + add_column :postgres_async_foreign_key_validations, :constraint_type, :integer, null: false, default: 0, limit: 2 + end +end diff --git a/db/migrate/20230224161346_add_saml_group_lock_to_application_settings.rb b/db/migrate/20230224161346_add_saml_group_lock_to_application_settings.rb new file mode 100644 index 00000000000..003dd5c5b61 --- /dev/null +++ b/db/migrate/20230224161346_add_saml_group_lock_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSamlGroupLockToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :lock_memberships_to_saml, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230228092612_add_index_next_over_limit_check_at_asc_order_synchronously.rb b/db/migrate/20230228092612_add_index_next_over_limit_check_at_asc_order_synchronously.rb new file mode 100644 index 00000000000..a811b67bb43 --- /dev/null +++ b/db/migrate/20230228092612_add_index_next_over_limit_check_at_asc_order_synchronously.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexNextOverLimitCheckAtAscOrderSynchronously < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = 'namespace_details' + INDEX_NAME = 'index_next_over_limit_check_at_asc_order' + COLUMN = 'next_over_limit_check_at' + + def up + add_concurrent_index TABLE_NAME, COLUMN, name: INDEX_NAME, order: { next_over_limit_check_at: 'ASC NULLS FIRST' } + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/migrate/20230228133011_add_design_description.rb b/db/migrate/20230228133011_add_design_description.rb new file mode 100644 index 00000000000..bff9a25f2ac --- /dev/null +++ b/db/migrate/20230228133011_add_design_description.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddDesignDescription < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + # text limit is added in a separate migration + def up + add_column :design_management_designs, :cached_markdown_version, :integer + add_column :design_management_designs, :description, :text + add_column :design_management_designs, :description_html, :text + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :design_management_designs, :cached_markdown_version + remove_column :design_management_designs, :description + remove_column :design_management_designs, :description_html + end +end diff --git a/db/migrate/20230228135034_add_design_description_limit.rb b/db/migrate/20230228135034_add_design_description_limit.rb new file mode 100644 index 00000000000..47c5f8c6ab1 --- /dev/null +++ b/db/migrate/20230228135034_add_design_description_limit.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddDesignDescriptionLimit < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :design_management_designs, :description, 1_000_000 + end + + def down + remove_text_limit :design_management_designs, :description + end +end diff --git a/db/migrate/20230228142350_add_notifications_work_item_widget.rb b/db/migrate/20230228142350_add_notifications_work_item_widget.rb new file mode 100644 index 00000000000..1bc89a6875c --- /dev/null +++ b/db/migrate/20230228142350_add_notifications_work_item_widget.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class AddNotificationsWorkItemWidget < 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! + + WIDGET_NAME = 'Notifications' + WIDGET_ENUM_VALUE = 14 + WORK_ITEM_TYPES = [ + 'Issue', + 'Incident', + 'Test Case', + 'Requirement', + 'Task', + 'Objective', + 'Key Result' + ].freeze + + def up + widgets = [] + + WORK_ITEM_TYPES.each do |type_name| + type = WorkItemType.find_by_name_and_namespace_id(type_name, nil) + + unless type + Gitlab::AppLogger.warn("type #{type_name} is missing, not adding widget") + + next + end + + widgets << { + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + } + 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.where(name: WIDGET_NAME).delete_all + end +end diff --git a/db/migrate/20230228183644_add_partitioning_info_to_postgres_foreign_keys.rb b/db/migrate/20230228183644_add_partitioning_info_to_postgres_foreign_keys.rb new file mode 100644 index 00000000000..5fe2a497077 --- /dev/null +++ b/db/migrate/20230228183644_add_partitioning_info_to_postgres_foreign_keys.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +class AddPartitioningInfoToPostgresForeignKeys < Gitlab::Database::Migration[2.1] + def up + execute <<~SQL + DROP VIEW IF EXISTS postgres_foreign_keys; + CREATE 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, + pg_constraint.convalidated as is_valid, + partitioned_parent_oids.parent_oid as parent_oid + 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) + LEFT JOIN LATERAL ( + SELECT refobjid as parent_oid + FROM pg_depend + WHERE objid = pg_constraint.oid + AND pg_depend.deptype = 'P' + AND refobjid IN (SELECT oid FROM pg_constraint WHERE contype = 'f') + LIMIT 1 + ) partitioned_parent_oids(parent_oid) ON true + WHERE contype = 'f'; + SQL + + Gitlab::Database::PostgresForeignKey.reset_column_information + end + + def down + execute <<~SQL + DROP VIEW IF EXISTS postgres_foreign_keys; + CREATE 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 + + Gitlab::Database::PostgresForeignKey.reset_column_information + end +end diff --git a/db/migrate/20230228212427_add_index_user_details_on_user_id_for_enterprise_users_without_date.rb b/db/migrate/20230228212427_add_index_user_details_on_user_id_for_enterprise_users_without_date.rb new file mode 100644 index 00000000000..198aee2201c --- /dev/null +++ b/db/migrate/20230228212427_add_index_user_details_on_user_id_for_enterprise_users_without_date.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexUserDetailsOnUserIdForEnterpriseUsersWithoutDate < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_without_date' + + disable_ddl_transaction! + + def up + add_concurrent_index( + :user_details, :user_id, + where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NULL', + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name :user_details, INDEX_NAME + end +end diff --git a/db/migrate/20230228212905_add_index_user_details_on_user_id_for_enterprise_users_with_date.rb b/db/migrate/20230228212905_add_index_user_details_on_user_id_for_enterprise_users_with_date.rb new file mode 100644 index 00000000000..e57d4fc4261 --- /dev/null +++ b/db/migrate/20230228212905_add_index_user_details_on_user_id_for_enterprise_users_with_date.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexUserDetailsOnUserIdForEnterpriseUsersWithDate < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_user_details_on_user_id_for_enterprise_users_with_date' + + disable_ddl_transaction! + + def up + add_concurrent_index( + :user_details, :user_id, + where: 'provisioned_by_group_id IS NOT NULL AND provisioned_by_group_at IS NOT NULL', + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name :user_details, INDEX_NAME + end +end diff --git a/db/migrate/20230303144424_unique_index_on_catalog_resources_project.rb b/db/migrate/20230303144424_unique_index_on_catalog_resources_project.rb new file mode 100644 index 00000000000..6ac2e72616a --- /dev/null +++ b/db/migrate/20230303144424_unique_index_on_catalog_resources_project.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class UniqueIndexOnCatalogResourcesProject < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_catalog_resources_on_project_id' + + def up + remove_concurrent_index :catalog_resources, :project_id, name: INDEX_NAME + add_concurrent_index :catalog_resources, :project_id, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index :catalog_resources, :project_id, name: INDEX_NAME + add_concurrent_index :catalog_resources, :project_id, name: INDEX_NAME + end +end diff --git a/db/migrate/20230303232426_add_role_approvers_to_scan_result_policies.rb b/db/migrate/20230303232426_add_role_approvers_to_scan_result_policies.rb new file mode 100644 index 00000000000..7d3f4491818 --- /dev/null +++ b/db/migrate/20230303232426_add_role_approvers_to_scan_result_policies.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRoleApproversToScanResultPolicies < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :scan_result_policies, :role_approvers, :integer, array: true, default: [] + end +end diff --git a/db/migrate/20230306145230_add_product_analytics_data_collector_host_to_application_settings.rb b/db/migrate/20230306145230_add_product_analytics_data_collector_host_to_application_settings.rb new file mode 100644 index 00000000000..4ae2479b1e6 --- /dev/null +++ b/db/migrate/20230306145230_add_product_analytics_data_collector_host_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddProductAnalyticsDataCollectorHostToApplicationSettings < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + def change + add_column :application_settings, :product_analytics_data_collector_host, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230307000000_create_design_management_repository.rb b/db/migrate/20230307000000_create_design_management_repository.rb new file mode 100644 index 00000000000..da4dee9f320 --- /dev/null +++ b/db/migrate/20230307000000_create_design_management_repository.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CreateDesignManagementRepository < Gitlab::Database::Migration[2.1] + def change + create_table :design_management_repositories do |t| + t.references :project, index: { unique: true }, null: false, foreign_key: { on_delete: :cascade } + + t.timestamps_with_timezone null: false + end + end +end diff --git a/db/migrate/20230307091216_add_status_reporter_id_and_id_index_to_abuse_reports.rb b/db/migrate/20230307091216_add_status_reporter_id_and_id_index_to_abuse_reports.rb new file mode 100644 index 00000000000..cfd077368c8 --- /dev/null +++ b/db/migrate/20230307091216_add_status_reporter_id_and_id_index_to_abuse_reports.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusReporterIdAndIdIndexToAbuseReports < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_abuse_reports_on_status_reporter_id_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :abuse_reports, [:status, :reporter_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :abuse_reports, INDEX_NAME + end +end diff --git a/db/migrate/20230307122838_add_text_limit_to_application_settings_product_analytics_data_collector_host.rb b/db/migrate/20230307122838_add_text_limit_to_application_settings_product_analytics_data_collector_host.rb new file mode 100644 index 00000000000..4f87cc9aee0 --- /dev/null +++ b/db/migrate/20230307122838_add_text_limit_to_application_settings_product_analytics_data_collector_host.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToApplicationSettingsProductAnalyticsDataCollectorHost < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :application_settings, :product_analytics_data_collector_host, 255 + end + + def down + remove_text_limit :application_settings, :product_analytics_data_collector_host + end +end diff --git a/db/migrate/20230307132729_create_schema_inconsistencies.rb b/db/migrate/20230307132729_create_schema_inconsistencies.rb new file mode 100644 index 00000000000..4891cc6ab7b --- /dev/null +++ b/db/migrate/20230307132729_create_schema_inconsistencies.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateSchemaInconsistencies < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :schema_inconsistencies do |t| + t.references :issue, index: true, null: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.text :object_name, null: false, limit: 63 + t.text :table_name, null: false, limit: 63 + t.text :valitador_name, null: false, limit: 63 + end + end +end diff --git a/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb b/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb new file mode 100644 index 00000000000..b2e4cc8ceb2 --- /dev/null +++ b/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveCreateLearnGitlabWorkerJobInstances < Gitlab::Database::Migration[2.1] + def up + # No-op to fix https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8612 + end + + def down + # No-op to fix https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8612 + end +end diff --git a/db/migrate/20230307233631_add_public_runner_release_version_fetch_setting.rb b/db/migrate/20230307233631_add_public_runner_release_version_fetch_setting.rb new file mode 100644 index 00000000000..584774d58ad --- /dev/null +++ b/db/migrate/20230307233631_add_public_runner_release_version_fetch_setting.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddPublicRunnerReleaseVersionFetchSetting < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_column :application_settings, :update_runner_versions_enabled, :boolean, + default: true, null: false, if_not_exists: true + end + + def down + remove_column :application_settings, :update_runner_versions_enabled, if_exists: true + end +end diff --git a/db/migrate/20230308154243_add_package_id_to_ml_candidates.rb b/db/migrate/20230308154243_add_package_id_to_ml_candidates.rb new file mode 100644 index 00000000000..ed13ddc894c --- /dev/null +++ b/db/migrate/20230308154243_add_package_id_to_ml_candidates.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddPackageIdToMlCandidates < Gitlab::Database::Migration[2.1] + def change + add_column :ml_candidates, :package_id, :bigint, null: true + end +end diff --git a/db/migrate/20230308154244_add_package_id_foreign_key_to_ml_candidates.rb b/db/migrate/20230308154244_add_package_id_foreign_key_to_ml_candidates.rb new file mode 100644 index 00000000000..7f12673e410 --- /dev/null +++ b/db/migrate/20230308154244_add_package_id_foreign_key_to_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPackageIdForeignKeyToMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :ml_candidates, :packages_packages, column: :package_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :ml_candidates, column: :package_id + end + end +end diff --git a/db/migrate/20230308154245_add_index_on_package_id_for_ml_candidates.rb b/db/migrate/20230308154245_add_index_on_package_id_for_ml_candidates.rb new file mode 100644 index 00000000000..cb3c9cd5a33 --- /dev/null +++ b/db/migrate/20230308154245_add_index_on_package_id_for_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnPackageIdForMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_candidates_on_package_id' + + def up + add_concurrent_index :ml_candidates, :package_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ml_candidates, name: INDEX_NAME + end +end diff --git a/db/migrate/20230308163018_create_container_registry_data_repair_details.rb b/db/migrate/20230308163018_create_container_registry_data_repair_details.rb new file mode 100644 index 00000000000..b682eb6ee7e --- /dev/null +++ b/db/migrate/20230308163018_create_container_registry_data_repair_details.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateContainerRegistryDataRepairDetails < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :container_registry_data_repair_details, id: false do |t| + t.integer :missing_count, default: 0 + t.references :project, + primary_key: true, + default: nil, + index: false, + foreign_key: { to_table: :projects, on_delete: :cascade } + t.timestamps_with_timezone null: false + end + end +end diff --git a/db/migrate/20230309000957_add_external_identifiers_to_import_failures.rb b/db/migrate/20230309000957_add_external_identifiers_to_import_failures.rb new file mode 100644 index 00000000000..f95cf0035d4 --- /dev/null +++ b/db/migrate/20230309000957_add_external_identifiers_to_import_failures.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddExternalIdentifiersToImportFailures < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :import_failures, :external_identifiers, :jsonb, default: {}, null: false + end +end diff --git a/db/migrate/20230313012226_create_search_indices.rb b/db/migrate/20230313012226_create_search_indices.rb new file mode 100644 index 00000000000..e1ef29be5af --- /dev/null +++ b/db/migrate/20230313012226_create_search_indices.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateSearchIndices < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :search_indices do |t| + t.timestamps_with_timezone null: false + t.integer :bucket_number # We allow null bucket numbers to support custom index assignments + t.text :path, null: false, limit: 255 + t.text :type, null: false, limit: 255 + end + + add_index :search_indices, [:id, :type], unique: true + add_index :search_indices, [:type, :path], unique: true + add_index :search_indices, [:type, :bucket_number], unique: true + end +end diff --git a/db/migrate/20230313012609_create_search_namespace_index_assignments.rb b/db/migrate/20230313012609_create_search_namespace_index_assignments.rb new file mode 100644 index 00000000000..ea3760ead74 --- /dev/null +++ b/db/migrate/20230313012609_create_search_namespace_index_assignments.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class CreateSearchNamespaceIndexAssignments < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :search_namespace_index_assignments do |t| + t.references :namespace, foreign_key: true, null: true, on_delete: :nullify + t.bigint :search_index_id, index: true, null: false + t.bigint :namespace_id_non_nullable, null: false + t.timestamps_with_timezone null: false + t.integer :namespace_id_hashed, null: false + t.text :index_type, null: false, limit: 255 + end + + add_index :search_namespace_index_assignments, + [:namespace_id, :index_type], + unique: true, + name: 'index_search_namespace_index_assignments_uniqueness_index_type' + + add_index :search_namespace_index_assignments, + [:namespace_id, :search_index_id], + unique: true, + name: 'index_search_namespace_index_assignments_uniqueness_on_index_id' + end +end diff --git a/db/migrate/20230313014038_add_search_index_foreign_key_to_search_namespace_index_assignments.rb b/db/migrate/20230313014038_add_search_index_foreign_key_to_search_namespace_index_assignments.rb new file mode 100644 index 00000000000..c49833b01e1 --- /dev/null +++ b/db/migrate/20230313014038_add_search_index_foreign_key_to_search_namespace_index_assignments.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddSearchIndexForeignKeyToSearchNamespaceIndexAssignments < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + FK_NAME = 'fk_search_index_id_and_type' + + def up + add_concurrent_foreign_key :search_namespace_index_assignments, :search_indices, + name: FK_NAME, column: [:search_index_id, :index_type], target_column: [:id, :type], on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :search_namespace_index_assignments, name: FK_NAME + end + end +end diff --git a/db/migrate/20230313031351_create_resource_link_events.rb b/db/migrate/20230313031351_create_resource_link_events.rb new file mode 100644 index 00000000000..03f00c9416b --- /dev/null +++ b/db/migrate/20230313031351_create_resource_link_events.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateResourceLinkEvents < Gitlab::Database::Migration[2.1] + def change + create_table :resource_link_events do |t| + t.integer :action, limit: 2, null: false + t.bigint :user_id, null: false + t.references :issue, index: true, null: false, foreign_key: { on_delete: :cascade } + t.references :child_work_item, index: true, null: false, foreign_key: { to_table: :issues, on_delete: :cascade } + t.datetime_with_timezone :created_at, null: false + + t.index :user_id + end + end +end diff --git a/db/migrate/20230313054226_add_status_created_at_and_updated_at_indexes_to_abuse_reports.rb b/db/migrate/20230313054226_add_status_created_at_and_updated_at_indexes_to_abuse_reports.rb new file mode 100644 index 00000000000..b619d6b8732 --- /dev/null +++ b/db/migrate/20230313054226_add_status_created_at_and_updated_at_indexes_to_abuse_reports.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddStatusCreatedAtAndUpdatedAtIndexesToAbuseReports < Gitlab::Database::Migration[2.1] + STATUS_AND_CREATED_AT_INDEX = 'index_abuse_reports_on_status_and_created_at' + STATUS_AND_UPDATED_AT_INDEX = 'index_abuse_reports_on_status_and_updated_at' + + disable_ddl_transaction! + + def up + add_concurrent_index :abuse_reports, [:status, :created_at], name: STATUS_AND_CREATED_AT_INDEX + add_concurrent_index :abuse_reports, [:status, :updated_at], name: STATUS_AND_UPDATED_AT_INDEX + end + + def down + remove_concurrent_index_by_name :abuse_reports, STATUS_AND_CREATED_AT_INDEX + remove_concurrent_index_by_name :abuse_reports, STATUS_AND_UPDATED_AT_INDEX + end +end diff --git a/db/migrate/20230313092109_add_start_end_and_current_values_to_wi_progressess.rb b/db/migrate/20230313092109_add_start_end_and_current_values_to_wi_progressess.rb new file mode 100644 index 00000000000..308bf4a0cf4 --- /dev/null +++ b/db/migrate/20230313092109_add_start_end_and_current_values_to_wi_progressess.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddStartEndAndCurrentValuesToWiProgressess < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :work_item_progresses, :start_value, :float, default: 0, null: false + add_column :work_item_progresses, :end_value, :float, default: 100, null: false + add_column :work_item_progresses, :current_value, :float, default: 0, null: false + end +end diff --git a/db/migrate/20230313100920_add_gitlab_dedicated_instance_to_application_settings.rb b/db/migrate/20230313100920_add_gitlab_dedicated_instance_to_application_settings.rb new file mode 100644 index 00000000000..ce83c022661 --- /dev/null +++ b/db/migrate/20230313100920_add_gitlab_dedicated_instance_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddGitlabDedicatedInstanceToApplicationSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :application_settings, :gitlab_dedicated_instance, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230313181536_create_packages_npm_metadata_caches.rb b/db/migrate/20230313181536_create_packages_npm_metadata_caches.rb new file mode 100644 index 00000000000..fde33342f04 --- /dev/null +++ b/db/migrate/20230313181536_create_packages_npm_metadata_caches.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class CreatePackagesNpmMetadataCaches < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + INDEX_NAME = 'index_npm_metadata_caches_on_package_name_project_id_unique' + + def up + create_table :packages_npm_metadata_caches do |t| + t.timestamps_with_timezone + + t.datetime_with_timezone :last_downloaded_at + t.bigint :project_id, index: true + t.integer :file_store, default: 1 + t.integer :size, null: false + t.text :file, null: false, limit: 255 + t.text :package_name, null: false # rubocop:disable Migration/AddLimitToTextColumns + + t.index %i[package_name project_id], name: INDEX_NAME, unique: true, where: 'project_id IS NOT NULL' + end + end + + def down + drop_table :packages_npm_metadata_caches + end +end diff --git a/db/migrate/20230314094210_drop_index_from_webauthn_registrations_on_u2f_registration_id.rb b/db/migrate/20230314094210_drop_index_from_webauthn_registrations_on_u2f_registration_id.rb new file mode 100644 index 00000000000..52c661a5f1d --- /dev/null +++ b/db/migrate/20230314094210_drop_index_from_webauthn_registrations_on_u2f_registration_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropIndexFromWebauthnRegistrationsOnU2fRegistrationId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists :webauthn_registrations, column: :u2f_registration_id + end + end + + def down + add_concurrent_foreign_key( + :webauthn_registrations, :u2f_registrations, column: :u2f_registration_id, on_delete: :cascade) + end +end diff --git a/db/migrate/20230315053635_add_screenshot_to_abuse_reports.rb b/db/migrate/20230315053635_add_screenshot_to_abuse_reports.rb new file mode 100644 index 00000000000..421878967c4 --- /dev/null +++ b/db/migrate/20230315053635_add_screenshot_to_abuse_reports.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddScreenshotToAbuseReports < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230327074932_add_text_limit_to_abuse_reports_screenshot + def change + add_column :abuse_reports, :screenshot, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230316093433_insert_daily_invites_trial_plan_limits.rb b/db/migrate/20230316093433_insert_daily_invites_trial_plan_limits.rb new file mode 100644 index 00000000000..f6254cad192 --- /dev/null +++ b/db/migrate/20230316093433_insert_daily_invites_trial_plan_limits.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class InsertDailyInvitesTrialPlanLimits < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + return unless Gitlab.com? + + create_or_update_plan_limit('daily_invites', 'premium_trial', 50) + create_or_update_plan_limit('daily_invites', 'ultimate_trial', 50) + end + + def down + return unless Gitlab.com? + + create_or_update_plan_limit('daily_invites', 'premium_trial', 0) + create_or_update_plan_limit('daily_invites', 'ultimate_trial', 0) + end +end diff --git a/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb b/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb new file mode 100644 index 00000000000..c0537a1985d --- /dev/null +++ b/db/migrate/20230316095948_create_service_desk_custom_email_credentials.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class CreateServiceDeskCustomEmailCredentials < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table(:service_desk_custom_email_credentials, id: false) do |t| + t.references :project, + primary_key: true, + default: nil, + index: false, + foreign_key: { to_table: :projects, on_delete: :cascade } + t.timestamps_with_timezone + t.integer :smtp_port + t.text :smtp_address, limit: 255 + t.binary :encrypted_smtp_username + t.binary :encrypted_smtp_username_iv + t.binary :encrypted_smtp_password + t.binary :encrypted_smtp_password_iv + end + end +end diff --git a/db/migrate/20230317162059_add_current_user_todos_work_item_widget.rb b/db/migrate/20230317162059_add_current_user_todos_work_item_widget.rb new file mode 100644 index 00000000000..4ed1fd6869c --- /dev/null +++ b/db/migrate/20230317162059_add_current_user_todos_work_item_widget.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class AddCurrentUserTodosWorkItemWidget < 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! + + WIDGET_NAME = 'Current user todos' + WIDGET_ENUM_VALUE = 15 + WORK_ITEM_TYPES = [ + 'Issue', + 'Incident', + 'Test Case', + 'Requirement', + 'Task', + 'Objective', + 'Key Result' + ].freeze + + def up + widgets = [] + + WORK_ITEM_TYPES.each do |type_name| + type = WorkItemType.find_by_name_and_namespace_id(type_name, nil) + + unless type + Gitlab::AppLogger.warn("type #{type_name} is missing, not adding widget") + + next + end + + widgets << { + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + } + 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.where(name: WIDGET_NAME).delete_all + end +end diff --git a/db/migrate/20230321085011_add_column_to_users_statistisc.rb b/db/migrate/20230321085011_add_column_to_users_statistisc.rb new file mode 100644 index 00000000000..8eef2ff5765 --- /dev/null +++ b/db/migrate/20230321085011_add_column_to_users_statistisc.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddColumnToUsersStatistisc < Gitlab::Database::Migration[2.1] + def change + add_column :users_statistics, :with_highest_role_guest_with_custom_role, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20230321113956_add_indexes_to_merge_request_compliance_violations.rb b/db/migrate/20230321113956_add_indexes_to_merge_request_compliance_violations.rb new file mode 100644 index 00000000000..66a24dc73c4 --- /dev/null +++ b/db/migrate/20230321113956_add_indexes_to_merge_request_compliance_violations.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddIndexesToMergeRequestComplianceViolations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_SEVERITY_LEVEL_DESC = 'i_compliance_violations_on_project_id_severity_and_id' + INDEX_REASON_ASC = 'i_compliance_violations_on_project_id_reason_and_id' + INDEX_TITLE_ASC = 'i_compliance_violations_on_project_id_title_and_id' + INDEX_MERGED_AT_ASC = 'i_compliance_violations_on_project_id_merged_at_and_id' + + def up + add_concurrent_index :merge_requests_compliance_violations, [:target_project_id, :severity_level, :id], + order: { severity_level: :desc, id: :desc }, using: :btree, name: INDEX_SEVERITY_LEVEL_DESC + add_concurrent_index :merge_requests_compliance_violations, [:target_project_id, :reason, :id], + order: { reason: :asc, id: :asc }, using: :btree, name: INDEX_REASON_ASC + add_concurrent_index :merge_requests_compliance_violations, [:target_project_id, :title, :id], + order: { title: :asc, id: :asc }, using: :btree, name: INDEX_TITLE_ASC + add_concurrent_index :merge_requests_compliance_violations, [:target_project_id, :merged_at, :id], + order: { merged_at: :asc, id: :asc }, using: :btree, name: INDEX_MERGED_AT_ASC + end + + def down + remove_concurrent_index_by_name :merge_requests_compliance_violations, INDEX_TITLE_ASC + remove_concurrent_index_by_name :merge_requests_compliance_violations, INDEX_TITLE_ASC + remove_concurrent_index_by_name :merge_requests_compliance_violations, INDEX_SEVERITY_LEVEL_DESC + remove_concurrent_index_by_name :merge_requests_compliance_violations, INDEX_REASON_ASC + remove_concurrent_index_by_name :merge_requests_compliance_violations, INDEX_MERGED_AT_ASC + end +end diff --git a/db/migrate/20230321153304_rename_ml_candidates_iid_to_eid.rb b/db/migrate/20230321153304_rename_ml_candidates_iid_to_eid.rb new file mode 100644 index 00000000000..2e884e92aa7 --- /dev/null +++ b/db/migrate/20230321153304_rename_ml_candidates_iid_to_eid.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RenameMlCandidatesIidToEid < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + rename_column_concurrently :ml_candidates, :iid, :eid + end + + def down + undo_rename_column_concurrently :ml_candidates, :iid, :eid + end +end diff --git a/db/migrate/20230321161218_add_project_access_token_limit_to_plan_limits.rb b/db/migrate/20230321161218_add_project_access_token_limit_to_plan_limits.rb new file mode 100644 index 00000000000..5f9400b9498 --- /dev/null +++ b/db/migrate/20230321161218_add_project_access_token_limit_to_plan_limits.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddProjectAccessTokenLimitToPlanLimits < Gitlab::Database::Migration[2.1] + def change + add_column(:plan_limits, :project_access_token_limit, :integer, default: 0, null: false) + end +end diff --git a/db/migrate/20230321161441_insert_project_access_token_limit.rb b/db/migrate/20230321161441_insert_project_access_token_limit.rb new file mode 100644 index 00000000000..a449e6f8e7c --- /dev/null +++ b/db/migrate/20230321161441_insert_project_access_token_limit.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class InsertProjectAccessTokenLimit < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + create_or_update_plan_limit('project_access_token_limit', 'premium_trial', 1) + create_or_update_plan_limit('project_access_token_limit', 'ultimate_trial', 1) + end + + def down + create_or_update_plan_limit('project_access_token_limit', 'premium_trial', 0) + create_or_update_plan_limit('project_access_token_limit', 'ultimate_trial', 0) + end +end diff --git a/db/migrate/20230321162810_add_project_id_to_ml_candidates.rb b/db/migrate/20230321162810_add_project_id_to_ml_candidates.rb new file mode 100644 index 00000000000..a8121f197d9 --- /dev/null +++ b/db/migrate/20230321162810_add_project_id_to_ml_candidates.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddProjectIdToMlCandidates < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :ml_candidates, :project_id, :bigint, null: true + end +end diff --git a/db/migrate/20230321162902_add_index_on_project_id_on_ml_candidates.rb b/db/migrate/20230321162902_add_index_on_project_id_on_ml_candidates.rb new file mode 100644 index 00000000000..e6c08468c0c --- /dev/null +++ b/db/migrate/20230321162902_add_index_on_project_id_on_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnProjectIdOnMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_candidates_on_project_id' + + def up + add_concurrent_index :ml_candidates, :project_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ml_candidates, INDEX_NAME + end +end diff --git a/db/migrate/20230321163051_add_project_id_foreign_key_to_ml_candidates.rb b/db/migrate/20230321163051_add_project_id_foreign_key_to_ml_candidates.rb new file mode 100644 index 00000000000..3e43a160306 --- /dev/null +++ b/db/migrate/20230321163051_add_project_id_foreign_key_to_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddProjectIdForeignKeyToMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :ml_candidates, :projects, column: :project_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :ml_candidates, column: :project_id + end + end +end diff --git a/db/migrate/20230321170734_add_internal_id_to_ml_candidates.rb b/db/migrate/20230321170734_add_internal_id_to_ml_candidates.rb new file mode 100644 index 00000000000..f6ced91c0a8 --- /dev/null +++ b/db/migrate/20230321170734_add_internal_id_to_ml_candidates.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddInternalIdToMlCandidates < Gitlab::Database::Migration[2.1] + def change + add_column :ml_candidates, :internal_id, :bigint, null: true + end +end diff --git a/db/migrate/20230321170803_add_index_on_project_id_on_internal_id_to_ml_candidates.rb b/db/migrate/20230321170803_add_index_on_project_id_on_internal_id_to_ml_candidates.rb new file mode 100644 index 00000000000..4c295972106 --- /dev/null +++ b/db/migrate/20230321170803_add_index_on_project_id_on_internal_id_to_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnProjectIdOnInternalIdToMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_candidates_on_project_id_on_internal_id' + + def up + add_concurrent_index :ml_candidates, [:project_id, :internal_id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ml_candidates, INDEX_NAME + end +end diff --git a/db/migrate/20230322145403_add_project_id_foreign_key_to_packages_npm_metadata_caches.rb b/db/migrate/20230322145403_add_project_id_foreign_key_to_packages_npm_metadata_caches.rb new file mode 100644 index 00000000000..7c542279bd0 --- /dev/null +++ b/db/migrate/20230322145403_add_project_id_foreign_key_to_packages_npm_metadata_caches.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddProjectIdForeignKeyToPackagesNpmMetadataCaches < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE = :packages_npm_metadata_caches + TARGET_TABLE = :projects + COLUMN = :project_id + + def up + add_concurrent_foreign_key SOURCE_TABLE, TARGET_TABLE, column: COLUMN, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key SOURCE_TABLE, column: COLUMN + end + end +end diff --git a/db/migrate/20230322151605_rerun_remove_invalid_deploy_access_level.rb b/db/migrate/20230322151605_rerun_remove_invalid_deploy_access_level.rb new file mode 100644 index 00000000000..e140ecc58c7 --- /dev/null +++ b/db/migrate/20230322151605_rerun_remove_invalid_deploy_access_level.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class RerunRemoveInvalidDeployAccessLevel < 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 + + update_column_in_batches(:protected_environment_deploy_access_levels, :group_id, nil) do |table, query| + query.where(table[:user_id].not_eq(nil).and(table[:group_id].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/migrate/20230322162512_add_valid_deploy_access_level_constraint.rb b/db/migrate/20230322162512_add_valid_deploy_access_level_constraint.rb new file mode 100644 index 00000000000..4cf82375563 --- /dev/null +++ b/db/migrate/20230322162512_add_valid_deploy_access_level_constraint.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddValidDeployAccessLevelConstraint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'check_deploy_access_levels_user_group_access_level_any_not_null' + CONSTRAINT = '(num_nonnulls(user_id, group_id, access_level) = 1)' + + def up + add_check_constraint :protected_environment_deploy_access_levels, CONSTRAINT, CONSTRAINT_NAME + end + + def down + remove_check_constraint :protected_environment_deploy_access_levels, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20230322164031_create_design_management_repository_states.rb b/db/migrate/20230322164031_create_design_management_repository_states.rb new file mode 100644 index 00000000000..0c906a45ae8 --- /dev/null +++ b/db/migrate/20230322164031_create_design_management_repository_states.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class CreateDesignManagementRepositoryStates < Gitlab::Database::Migration[2.1] + VERIFICATION_STATE_INDEX_NAME = "index_design_management_repository_states_on_verification_state" + PENDING_VERIFICATION_INDEX_NAME = "index_design_management_repository_states_pending_verification" + FAILED_VERIFICATION_INDEX_NAME = "index_design_management_repository_states_failed_verification" + NEEDS_VERIFICATION_INDEX_NAME = "index_design_management_repository_states_needs_verification" + + enable_lock_retries! + + def up + create_table :design_management_repository_states, id: false do |t| + t.datetime_with_timezone :verification_started_at + t.datetime_with_timezone :verification_retry_at + t.datetime_with_timezone :verified_at + t.references :design_management_repository, primary_key: true, default: nil, index: false, + foreign_key: { on_delete: :cascade } + t.integer :verification_state, default: 0, limit: 2, null: false + t.integer :verification_retry_count, default: 0, limit: 2, null: false + 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 :design_management_repository_states + end +end diff --git a/db/migrate/20230323021618_add_silent_mode_enabled_to_application_settings.rb b/db/migrate/20230323021618_add_silent_mode_enabled_to_application_settings.rb new file mode 100644 index 00000000000..e3592e0bd13 --- /dev/null +++ b/db/migrate/20230323021618_add_silent_mode_enabled_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSilentModeEnabledToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :silent_mode_enabled, :boolean, default: false, null: false, if_not_exists: true + end +end diff --git a/db/migrate/20230323101138_add_award_emoji_work_item_widget.rb b/db/migrate/20230323101138_add_award_emoji_work_item_widget.rb new file mode 100644 index 00000000000..6a6b50c81a5 --- /dev/null +++ b/db/migrate/20230323101138_add_award_emoji_work_item_widget.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class AddAwardEmojiWorkItemWidget < 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! + + WIDGET_NAME = 'Award emoji' + WIDGET_ENUM_VALUE = 16 + WORK_ITEM_TYPES = [ + 'Issue', + 'Incident', + 'Test Case', + 'Requirement', + 'Task', + 'Objective', + 'Key Result' + ].freeze + + def up + widgets = [] + + WORK_ITEM_TYPES.each do |type_name| + type = WorkItemType.find_by_name_and_namespace_id(type_name, nil) + + unless type + Gitlab::AppLogger.warn("type #{type_name} is missing, not adding widget") + + next + end + + widgets << { + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + } + 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.where(name: WIDGET_NAME).delete_all + end +end diff --git a/db/migrate/20230323120601_create_dora_performance_scores.rb b/db/migrate/20230323120601_create_dora_performance_scores.rb new file mode 100644 index 00000000000..2c4304fedb6 --- /dev/null +++ b/db/migrate/20230323120601_create_dora_performance_scores.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateDoraPerformanceScores < Gitlab::Database::Migration[2.1] + def change + create_table :dora_performance_scores do |t| + t.references :project, null: false, foreign_key: { on_delete: :cascade }, index: false + t.date :date, null: false + t.integer :deployment_frequency, limit: 2 + t.integer :lead_time_for_changes, limit: 2 + t.integer :time_to_restore_service, limit: 2 + t.integer :change_failure_rate, limit: 2 + + t.index [:project_id, :date], unique: true + end + end +end diff --git a/db/migrate/20230323140745_add_root_directory_to_pages_deployment.rb b/db/migrate/20230323140745_add_root_directory_to_pages_deployment.rb new file mode 100644 index 00000000000..781ba3e89d4 --- /dev/null +++ b/db/migrate/20230323140745_add_root_directory_to_pages_deployment.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRootDirectoryToPagesDeployment < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230323140746_add_text_limit_to_pages_deployment_root_directory + def change + add_column :pages_deployments, :root_directory, :text, default: "public" + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230323140746_add_text_limit_to_pages_deployment_root_directory.rb b/db/migrate/20230323140746_add_text_limit_to_pages_deployment_root_directory.rb new file mode 100644 index 00000000000..12209422fbb --- /dev/null +++ b/db/migrate/20230323140746_add_text_limit_to_pages_deployment_root_directory.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToPagesDeploymentRootDirectory < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :pages_deployments, :root_directory, 255 + end + + def down + remove_text_limit :pages_deployments, :root_directory + end +end diff --git a/db/migrate/20230323153042_track_push_rules_deletions.rb b/db/migrate/20230323153042_track_push_rules_deletions.rb new file mode 100644 index 00000000000..2aa7fad8de1 --- /dev/null +++ b/db/migrate/20230323153042_track_push_rules_deletions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackPushRulesDeletions < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:push_rules) + end + + def down + untrack_record_deletions(:push_rules) + end +end diff --git a/db/migrate/20230323153328_track_tags_deletions.rb b/db/migrate/20230323153328_track_tags_deletions.rb new file mode 100644 index 00000000000..085d14a56fa --- /dev/null +++ b/db/migrate/20230323153328_track_tags_deletions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackTagsDeletions < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:tags) + end + + def down + untrack_record_deletions(:tags) + end +end diff --git a/db/migrate/20230323191750_add_shard_settings_to_search_indices.rb b/db/migrate/20230323191750_add_shard_settings_to_search_indices.rb new file mode 100644 index 00000000000..b032e3b8a61 --- /dev/null +++ b/db/migrate/20230323191750_add_shard_settings_to_search_indices.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddShardSettingsToSearchIndices < Gitlab::Database::Migration[2.1] + def change + add_column :search_indices, :number_of_shards, :integer, default: 2, null: false + add_column :search_indices, :number_of_replicas, :integer, default: 1, null: false + end +end diff --git a/db/migrate/20230327074932_add_text_limit_to_abuse_reports_screenshot.rb b/db/migrate/20230327074932_add_text_limit_to_abuse_reports_screenshot.rb new file mode 100644 index 00000000000..3bb9722188f --- /dev/null +++ b/db/migrate/20230327074932_add_text_limit_to_abuse_reports_screenshot.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToAbuseReportsScreenshot < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :abuse_reports, :screenshot, 255 + end + + def down + remove_text_limit :abuse_reports, :screenshot + end +end diff --git a/db/migrate/20230327123333_backfill_product_analytics_data_collector_host.rb b/db/migrate/20230327123333_backfill_product_analytics_data_collector_host.rb new file mode 100644 index 00000000000..04041d78c3e --- /dev/null +++ b/db/migrate/20230327123333_backfill_product_analytics_data_collector_host.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class BackfillProductAnalyticsDataCollectorHost < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # fills product_analytics_data_collector_host by replacing jitsu_host subdomain with collector + regex = "'://(.+?\\.)'" + replace_with = "'://collector.'" + execute <<~SQL + UPDATE application_settings + SET product_analytics_data_collector_host = regexp_replace(jitsu_host, #{regex}, #{replace_with}, 'g') + WHERE jitsu_host IS NOT NULL AND product_analytics_data_collector_host IS NULL + SQL + end + + def down + # noop + end +end diff --git a/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb b/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb new file mode 100644 index 00000000000..eac1d4e30c1 --- /dev/null +++ b/db/migrate/20230328020316_delete_unused_index_on_merge_requests_on_state_id_and_merge_status.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DeleteUnusedIndexOnMergeRequestsOnStateIdAndMergeStatus < Gitlab::Database::Migration[2.1] + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402491 + + def up + prepare_async_index_removal :merge_requests, [:state_id, :merge_status], + where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))", + name: 'idx_merge_requests_on_state_id_and_merge_status' + end + + def down + unprepare_async_index :merge_requests, [:state_id, :merge_status], + where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))", + name: 'idx_merge_requests_on_state_id_and_merge_status' + end +end diff --git a/db/migrate/20230328023535_initialize_conversion_of_award_emoji_awardable_id_to_bigint.rb b/db/migrate/20230328023535_initialize_conversion_of_award_emoji_awardable_id_to_bigint.rb new file mode 100644 index 00000000000..00bccb5cde2 --- /dev/null +++ b/db/migrate/20230328023535_initialize_conversion_of_award_emoji_awardable_id_to_bigint.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class InitializeConversionOfAwardEmojiAwardableIdToBigint < Gitlab::Database::Migration[2.1] + TABLE = :award_emoji + COLUMNS = %i[awardable_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/20230328031720_initialize_conversion_of_events_target_id_to_bigint.rb b/db/migrate/20230328031720_initialize_conversion_of_events_target_id_to_bigint.rb new file mode 100644 index 00000000000..b30b681f42d --- /dev/null +++ b/db/migrate/20230328031720_initialize_conversion_of_events_target_id_to_bigint.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class InitializeConversionOfEventsTargetIdToBigint < Gitlab::Database::Migration[2.1] + TABLE = :events + COLUMNS = %i[target_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/20230328165313_add_disabled_following_to_user_preferences.rb b/db/migrate/20230328165313_add_disabled_following_to_user_preferences.rb new file mode 100644 index 00000000000..0841829c957 --- /dev/null +++ b/db/migrate/20230328165313_add_disabled_following_to_user_preferences.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddDisabledFollowingToUserPreferences < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :user_preferences, :enabled_following, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb b/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb new file mode 100644 index 00000000000..78f0122c609 --- /dev/null +++ b/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLockVersionToTerraformState < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :terraform_states, :activerecord_lock_version, :integer, null: false, default: 0 + end +end diff --git a/db/migrate/20230329085754_add_foreign_key_to_resource_link_events_on_user.rb b/db/migrate/20230329085754_add_foreign_key_to_resource_link_events_on_user.rb new file mode 100644 index 00000000000..6a167f232ae --- /dev/null +++ b/db/migrate/20230329085754_add_foreign_key_to_resource_link_events_on_user.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToResourceLinkEventsOnUser < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :resource_link_events, :users, column: :user_id, on_delete: :nullify, validate: true + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :resource_link_events, column: :user_id + end + end +end diff --git a/db/migrate/20230329152410_add_achievements_enabled_to_user_preferences.rb b/db/migrate/20230329152410_add_achievements_enabled_to_user_preferences.rb new file mode 100644 index 00000000000..bd11a4a6128 --- /dev/null +++ b/db/migrate/20230329152410_add_achievements_enabled_to_user_preferences.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAchievementsEnabledToUserPreferences < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :user_preferences, :achievements_enabled, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230329194244_add_index_packages_debian_file_metadata_when_unknown.rb b/db/migrate/20230329194244_add_index_packages_debian_file_metadata_when_unknown.rb new file mode 100644 index 00000000000..9b87f1319f3 --- /dev/null +++ b/db/migrate/20230329194244_add_index_packages_debian_file_metadata_when_unknown.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexPackagesDebianFileMetadataWhenUnknown < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'i_pkgs_deb_file_meta_on_updated_at_package_file_id_when_unknown' + UNKNOWN = 1 + + def up + add_concurrent_index :packages_debian_file_metadata, [:updated_at, :package_file_id], + where: "file_type = #{UNKNOWN}", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_debian_file_metadata, name: INDEX_NAME + end +end diff --git a/db/migrate/20230330101438_create_fk_ml_candidate_params_on_candidate_id.rb b/db/migrate/20230330101438_create_fk_ml_candidate_params_on_candidate_id.rb new file mode 100644 index 00000000000..8273ffc27e2 --- /dev/null +++ b/db/migrate/20230330101438_create_fk_ml_candidate_params_on_candidate_id.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class CreateFkMlCandidateParamsOnCandidateId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + NEW_CONSTRAINT_NAME = 'fk_ml_candidate_params_on_candidate_id' + + def up + add_concurrent_foreign_key( + :ml_candidate_params, + :ml_candidates, + column: :candidate_id, + on_delete: :cascade, + validate: false, + name: NEW_CONSTRAINT_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists( + :ml_candidate_params, + column: :candidate_id, + on_delete: :cascade, + name: NEW_CONSTRAINT_NAME + ) + end + end +end diff --git a/db/migrate/20230330101439_validate_fk_ml_candidate_params_on_candidate_id.rb b/db/migrate/20230330101439_validate_fk_ml_candidate_params_on_candidate_id.rb new file mode 100644 index 00000000000..912380ac3b7 --- /dev/null +++ b/db/migrate/20230330101439_validate_fk_ml_candidate_params_on_candidate_id.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ValidateFkMlCandidateParamsOnCandidateId < Gitlab::Database::Migration[2.1] + NEW_CONSTRAINT_NAME = 'fk_ml_candidate_params_on_candidate_id' + + def up + validate_foreign_key(:ml_candidate_params, :candidate_id, name: NEW_CONSTRAINT_NAME) + end + + def down + # no-op + end +end diff --git a/db/migrate/20230330101440_remove_old_fk_ml_candidate_params_on_candidate_id.rb b/db/migrate/20230330101440_remove_old_fk_ml_candidate_params_on_candidate_id.rb new file mode 100644 index 00000000000..8e143cd3ed2 --- /dev/null +++ b/db/migrate/20230330101440_remove_old_fk_ml_candidate_params_on_candidate_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveOldFkMlCandidateParamsOnCandidateId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + OLD_CONSTRAINT_NAME = 'fk_rails_d4a51d1185' + + def up + remove_foreign_key_if_exists(:ml_candidate_params, column: :candidate_id, name: OLD_CONSTRAINT_NAME) + end + + def down + add_concurrent_foreign_key( + :ml_candidate_params, + :ml_candidates, + column: :candidate_id, + validate: false, + name: OLD_CONSTRAINT_NAME + ) + end +end diff --git a/db/migrate/20230330101441_create_fk_ml_candidate_metrics_on_candidate_id.rb b/db/migrate/20230330101441_create_fk_ml_candidate_metrics_on_candidate_id.rb new file mode 100644 index 00000000000..0ef0075127d --- /dev/null +++ b/db/migrate/20230330101441_create_fk_ml_candidate_metrics_on_candidate_id.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class CreateFkMlCandidateMetricsOnCandidateId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + NEW_CONSTRAINT_NAME = 'fk_ml_candidate_metrics_on_candidate_id' + + def up + add_concurrent_foreign_key( + :ml_candidate_metrics, + :ml_candidates, + column: :candidate_id, + on_delete: :cascade, + validate: false, + name: NEW_CONSTRAINT_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists( + :ml_candidate_metrics, + column: :candidate_id, + on_delete: :cascade, + name: NEW_CONSTRAINT_NAME + ) + end + end +end diff --git a/db/migrate/20230330101442_validate_fk_ml_candidate_metrics_on_candidate_id.rb b/db/migrate/20230330101442_validate_fk_ml_candidate_metrics_on_candidate_id.rb new file mode 100644 index 00000000000..5180c6582cf --- /dev/null +++ b/db/migrate/20230330101442_validate_fk_ml_candidate_metrics_on_candidate_id.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ValidateFkMlCandidateMetricsOnCandidateId < Gitlab::Database::Migration[2.1] + NEW_CONSTRAINT_NAME = 'fk_ml_candidate_metrics_on_candidate_id' + + def up + validate_foreign_key(:ml_candidate_metrics, :candidate_id, name: NEW_CONSTRAINT_NAME) + end + + def down + # no-op + end +end diff --git a/db/migrate/20230330101443_remove_old_fk_ml_candidate_metrics_on_candidate_id.rb b/db/migrate/20230330101443_remove_old_fk_ml_candidate_metrics_on_candidate_id.rb new file mode 100644 index 00000000000..2e9153cb9d9 --- /dev/null +++ b/db/migrate/20230330101443_remove_old_fk_ml_candidate_metrics_on_candidate_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveOldFkMlCandidateMetricsOnCandidateId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + OLD_CONSTRAINT_NAME = 'fk_rails_efb613a25a' + + def up + remove_foreign_key_if_exists(:ml_candidate_metrics, column: :candidate_id, name: OLD_CONSTRAINT_NAME) + end + + def down + add_concurrent_foreign_key( + :ml_candidate_metrics, + :ml_candidates, + column: :candidate_id, + validate: false, + name: OLD_CONSTRAINT_NAME + ) + end +end diff --git a/db/migrate/20230330215636_remove_unused_project_jira_indexes.rb b/db/migrate/20230330215636_remove_unused_project_jira_indexes.rb new file mode 100644 index 00000000000..ce10b70f81c --- /dev/null +++ b/db/migrate/20230330215636_remove_unused_project_jira_indexes.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class RemoveUnusedProjectJiraIndexes < Gitlab::Database::Migration[2.1] + TITLE_INDEX = { + name: 'index_merge_requests_on_target_project_id_and_iid_jira_title', + where: "((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text)" + }.freeze + + DESCRIPTION_INDEX = { + name: 'index_merge_requests_on_target_project_id_iid_jira_description', + where: "(description ~ '[A-Z][A-Z_0-9]+-\d+'::text)" + }.freeze + + # TODO: Indexes to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/403327 + def up + prepare_async_index_removal :merge_requests, [:target_project_id, :iid], + where: TITLE_INDEX[:where], + name: TITLE_INDEX[:name] + + prepare_async_index_removal :merge_requests, [:target_project_id, :iid], + where: DESCRIPTION_INDEX[:where], + name: DESCRIPTION_INDEX[:name] + end + + def down + unprepare_async_index :merge_requests, [:target_project_id, :iid], + where: TITLE_INDEX[:where], + name: TITLE_INDEX[:name] + + unprepare_async_index :merge_requests, [:target_project_id, :iid], + where: DESCRIPTION_INDEX[:where], + name: DESCRIPTION_INDEX[:name] + end +end diff --git a/db/migrate/20230331142006_add_open_ai_api_key_application_setting.rb b/db/migrate/20230331142006_add_open_ai_api_key_application_setting.rb new file mode 100644 index 00000000000..735cb414c99 --- /dev/null +++ b/db/migrate/20230331142006_add_open_ai_api_key_application_setting.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddOpenAiApiKeyApplicationSetting < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :encrypted_openai_api_key, :binary + add_column :application_settings, :encrypted_openai_api_key_iv, :binary + end +end diff --git a/db/migrate/20230403023440_add_database_max_running_batched_background_migrations_to_application_settings.rb b/db/migrate/20230403023440_add_database_max_running_batched_background_migrations_to_application_settings.rb new file mode 100644 index 00000000000..136855403f9 --- /dev/null +++ b/db/migrate/20230403023440_add_database_max_running_batched_background_migrations_to_application_settings.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddDatabaseMaxRunningBatchedBackgroundMigrationsToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :database_max_running_batched_background_migrations, + :integer, null: false, default: 2 + end +end diff --git a/db/migrate/20230403023441_set_max_running_batched_background_migrations_for_gitlab_com.rb b/db/migrate/20230403023441_set_max_running_batched_background_migrations_for_gitlab_com.rb new file mode 100644 index 00000000000..6e8d423e679 --- /dev/null +++ b/db/migrate/20230403023441_set_max_running_batched_background_migrations_for_gitlab_com.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class SetMaxRunningBatchedBackgroundMigrationsForGitlabCom < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + return unless Gitlab.com? && !Gitlab.jh? + + execute 'UPDATE application_settings SET database_max_running_batched_background_migrations = 4' + end + + def down + return unless Gitlab.com? && !Gitlab.jh? + + execute 'UPDATE application_settings SET database_max_running_batched_background_migrations = 2' + end +end diff --git a/db/migrate/20230403093349_ensure_packages_npm_metadata_caches_is_empty.rb b/db/migrate/20230403093349_ensure_packages_npm_metadata_caches_is_empty.rb new file mode 100644 index 00000000000..baeb368fda1 --- /dev/null +++ b/db/migrate/20230403093349_ensure_packages_npm_metadata_caches_is_empty.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class EnsurePackagesNpmMetadataCachesIsEmpty < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + truncate_tables!('packages_npm_metadata_caches') + end + + def down + # no-op + end +end diff --git a/db/migrate/20230403113620_add_pinned_nav_items_to_user_preference.rb b/db/migrate/20230403113620_add_pinned_nav_items_to_user_preference.rb new file mode 100644 index 00000000000..8f7509db318 --- /dev/null +++ b/db/migrate/20230403113620_add_pinned_nav_items_to_user_preference.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddPinnedNavItemsToUserPreference < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :user_preferences, :pinned_nav_items, :jsonb, null: false, default: {} + end +end diff --git a/db/migrate/20230403145705_add_purl_sync_to_settings.rb b/db/migrate/20230403145705_add_purl_sync_to_settings.rb new file mode 100644 index 00000000000..3bc9ce07235 --- /dev/null +++ b/db/migrate/20230403145705_add_purl_sync_to_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddPurlSyncToSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :package_metadata_purl_types, :smallint, array: true, default: [] + end +end diff --git a/db/migrate/20230403164454_add_fork_storage_size_columns_to_root_storage_statistics.rb b/db/migrate/20230403164454_add_fork_storage_size_columns_to_root_storage_statistics.rb new file mode 100644 index 00000000000..3428fba669f --- /dev/null +++ b/db/migrate/20230403164454_add_fork_storage_size_columns_to_root_storage_statistics.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddForkStorageSizeColumnsToRootStorageStatistics < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :namespace_root_storage_statistics, :public_forks_storage_size, :bigint, default: 0, null: false + add_column :namespace_root_storage_statistics, :internal_forks_storage_size, :bigint, default: 0, null: false + add_column :namespace_root_storage_statistics, :private_forks_storage_size, :bigint, default: 0, null: false + end +end diff --git a/db/migrate/20230404111427_add_first_contribution_to_merge_request_metrics.rb b/db/migrate/20230404111427_add_first_contribution_to_merge_request_metrics.rb new file mode 100644 index 00000000000..d0366907191 --- /dev/null +++ b/db/migrate/20230404111427_add_first_contribution_to_merge_request_metrics.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddFirstContributionToMergeRequestMetrics < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :merge_request_metrics, :first_contribution, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230404160131_add_status_to_data_repair_details.rb b/db/migrate/20230404160131_add_status_to_data_repair_details.rb new file mode 100644 index 00000000000..564b0450752 --- /dev/null +++ b/db/migrate/20230404160131_add_status_to_data_repair_details.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddStatusToDataRepairDetails < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_container_registry_data_repair_details_on_status' + + def up + unless column_exists?(:container_registry_data_repair_details, :status) + add_column(:container_registry_data_repair_details, :status, :integer, default: 0, null: false, limit: 2) + end + + add_concurrent_index :container_registry_data_repair_details, :status, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :container_registry_data_repair_details, name: INDEX_NAME + remove_column :container_registry_data_repair_details, :status + end +end diff --git a/db/migrate/20230405071033_add_object_storage_key_to_packages_npm_metadata_caches.rb b/db/migrate/20230405071033_add_object_storage_key_to_packages_npm_metadata_caches.rb new file mode 100644 index 00000000000..a4c0f01ab2a --- /dev/null +++ b/db/migrate/20230405071033_add_object_storage_key_to_packages_npm_metadata_caches.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class AddObjectStorageKeyToPackagesNpmMetadataCaches < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_npm_metadata_caches_on_object_storage_key' + + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230503191056_add_text_limit_to_packages_npm_metadata_caches_object_storage_key + def up + unless column_exists?(:packages_npm_metadata_caches, :object_storage_key) + # The existing table is empty. + # rubocop:disable Rails/NotNullColumn + add_column :packages_npm_metadata_caches, :object_storage_key, :text, null: false + # rubocop:enable Rails/NotNullColumn + end + + add_concurrent_index :packages_npm_metadata_caches, :object_storage_key, unique: true, name: INDEX_NAME + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :packages_npm_metadata_caches, :object_storage_key + end +end diff --git a/db/migrate/20230405102815_add_unique_namespace_index_to_storage_limit_exclusions.rb b/db/migrate/20230405102815_add_unique_namespace_index_to_storage_limit_exclusions.rb new file mode 100644 index 00000000000..d732fb35ce9 --- /dev/null +++ b/db/migrate/20230405102815_add_unique_namespace_index_to_storage_limit_exclusions.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class AddUniqueNamespaceIndexToStorageLimitExclusions < Gitlab::Database::Migration[2.1] + TABLE_NAME = 'namespaces_storage_limit_exclusions' + OLD_INDEX_NAME = 'index_namespaces_storage_limit_exclusions_on_namespace_id' + NEW_INDEX_NAME = 'unique_idx_namespaces_storage_limit_exclusions_on_namespace_id' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE_NAME, :namespace_id, + unique: true, + name: NEW_INDEX_NAME + + remove_concurrent_index_by_name TABLE_NAME, OLD_INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :namespace_id, + unique: false, + name: OLD_INDEX_NAME + + remove_concurrent_index_by_name TABLE_NAME, NEW_INDEX_NAME + end +end diff --git a/db/migrate/20230406040908_add_system_note_metadata_id__to_resource_link_events.rb b/db/migrate/20230406040908_add_system_note_metadata_id__to_resource_link_events.rb new file mode 100644 index 00000000000..042e588a5f5 --- /dev/null +++ b/db/migrate/20230406040908_add_system_note_metadata_id__to_resource_link_events.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSystemNoteMetadataIdToResourceLinkEvents < Gitlab::Database::Migration[2.1] + def change + add_column :resource_link_events, :system_note_metadata_id, :bigint + end +end diff --git a/db/migrate/20230406042906_add_unique_index_to_resource_link_events_on_system_note_metadata_id.rb b/db/migrate/20230406042906_add_unique_index_to_resource_link_events_on_system_note_metadata_id.rb new file mode 100644 index 00000000000..97d2e89c80b --- /dev/null +++ b/db/migrate/20230406042906_add_unique_index_to_resource_link_events_on_system_note_metadata_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexToResourceLinkEventsOnSystemNoteMetadataId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'unique_index_on_system_note_metadata_id' + + def up + add_concurrent_index :resource_link_events, :system_note_metadata_id, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :resource_link_events, name: INDEX_NAME + end +end diff --git a/db/migrate/20230406043900_add_system_note_metadata_foreign_key_to_resource_link_events.rb b/db/migrate/20230406043900_add_system_note_metadata_foreign_key_to_resource_link_events.rb new file mode 100644 index 00000000000..431e7ac0e7e --- /dev/null +++ b/db/migrate/20230406043900_add_system_note_metadata_foreign_key_to_resource_link_events.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSystemNoteMetadataForeignKeyToResourceLinkEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :resource_link_events, :system_note_metadata, + column: :system_note_metadata_id, on_delete: :cascade, validate: false + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :resource_link_events, column: :system_note_metadata_id + end + end +end diff --git a/db/migrate/20230406060452_create_instance_external_audit_event_destinations.rb b/db/migrate/20230406060452_create_instance_external_audit_event_destinations.rb new file mode 100644 index 00000000000..4347d13ceb4 --- /dev/null +++ b/db/migrate/20230406060452_create_instance_external_audit_event_destinations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateInstanceExternalAuditEventDestinations < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :audit_events_instance_external_audit_event_destinations do |t| + t.timestamps_with_timezone null: false + t.text :destination_url, null: false, limit: 255 # rubocop:disable Migration/AddLimitToTextColumns + t.binary :encrypted_verification_token, null: false + t.binary :encrypted_verification_token_iv, null: false + end + end +end diff --git a/db/migrate/20230406073847_validate_foreign_key_for_resource_link_events_on_system_note_metadata_id.rb b/db/migrate/20230406073847_validate_foreign_key_for_resource_link_events_on_system_note_metadata_id.rb new file mode 100644 index 00000000000..f06657ccabc --- /dev/null +++ b/db/migrate/20230406073847_validate_foreign_key_for_resource_link_events_on_system_note_metadata_id.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ValidateForeignKeyForResourceLinkEventsOnSystemNoteMetadataId < Gitlab::Database::Migration[2.1] + def up + validate_foreign_key :resource_link_events, :system_note_metadata_id + end + + def down + # No-op + end +end diff --git a/db/migrate/20230406095544_add_pa_configurator_base_to_app_settings.rb b/db/migrate/20230406095544_add_pa_configurator_base_to_app_settings.rb new file mode 100644 index 00000000000..b6b33cdf17b --- /dev/null +++ b/db/migrate/20230406095544_add_pa_configurator_base_to_app_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddPaConfiguratorBaseToAppSettings < Gitlab::Database::Migration[2.1] + def up + add_column :application_settings, :encrypted_product_analytics_configurator_connection_string, :binary + add_column :application_settings, :encrypted_product_analytics_configurator_connection_string_iv, :binary + end + + def down + remove_column :application_settings, :encrypted_product_analytics_configurator_connection_string + remove_column :application_settings, :encrypted_product_analytics_configurator_connection_string_iv + end +end diff --git a/db/migrate/20230406134436_add_identity_toggle_to_user_preferences.rb b/db/migrate/20230406134436_add_identity_toggle_to_user_preferences.rb new file mode 100644 index 00000000000..0b7fcceb3ee --- /dev/null +++ b/db/migrate/20230406134436_add_identity_toggle_to_user_preferences.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddIdentityToggleToUserPreferences < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :user_preferences, :pass_user_identities_to_ci_jwt, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230406150254_create_agent_user_access_project_authorizations_table.rb b/db/migrate/20230406150254_create_agent_user_access_project_authorizations_table.rb new file mode 100644 index 00000000000..1adc3bb001a --- /dev/null +++ b/db/migrate/20230406150254_create_agent_user_access_project_authorizations_table.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateAgentUserAccessProjectAuthorizationsTable < Gitlab::Database::Migration[2.1] + INDEX_NAME_1 = 'index_agent_user_access_on_project_id' + INDEX_NAME_2 = 'index_agent_user_access_on_agent_id_and_project_id' + + def change + create_table :agent_user_access_project_authorizations do |t| + t.bigint :project_id, null: false + t.bigint :agent_id, null: false + t.jsonb :config, null: false + + t.index [:project_id], name: INDEX_NAME_1 + t.index [:agent_id, :project_id], unique: true, name: INDEX_NAME_2 + end + end +end diff --git a/db/migrate/20230406150354_create_agent_user_access_group_authorizations_table.rb b/db/migrate/20230406150354_create_agent_user_access_group_authorizations_table.rb new file mode 100644 index 00000000000..1d4df7d7330 --- /dev/null +++ b/db/migrate/20230406150354_create_agent_user_access_group_authorizations_table.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateAgentUserAccessGroupAuthorizationsTable < Gitlab::Database::Migration[2.1] + INDEX_NAME_1 = 'index_agent_user_access_on_group_id' + INDEX_NAME_2 = 'index_agent_user_access_on_agent_id_and_group_id' + + def change + create_table :agent_user_access_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], name: INDEX_NAME_1 + t.index [:agent_id, :group_id], unique: true, name: INDEX_NAME_2 + end + end +end diff --git a/db/migrate/20230406150454_add_fks_to_agent_user_access_authorizations.rb b/db/migrate/20230406150454_add_fks_to_agent_user_access_authorizations.rb new file mode 100644 index 00000000000..62f00620108 --- /dev/null +++ b/db/migrate/20230406150454_add_fks_to_agent_user_access_authorizations.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class AddFksToAgentUserAccessAuthorizations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :agent_user_access_project_authorizations, :projects, + column: :project_id, on_delete: :cascade + add_concurrent_foreign_key :agent_user_access_project_authorizations, :cluster_agents, + column: :agent_id, on_delete: :cascade + add_concurrent_foreign_key :agent_user_access_group_authorizations, :namespaces, + column: :group_id, on_delete: :cascade + add_concurrent_foreign_key :agent_user_access_group_authorizations, :cluster_agents, + column: :agent_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :agent_user_access_project_authorizations, column: :project_id + end + + with_lock_retries do + remove_foreign_key_if_exists :agent_user_access_project_authorizations, column: :agent_id + end + + with_lock_retries do + remove_foreign_key_if_exists :agent_user_access_group_authorizations, column: :group_id + end + + with_lock_retries do + remove_foreign_key_if_exists :agent_user_access_group_authorizations, column: :agent_id + end + end +end diff --git a/db/migrate/20230407164616_add_code_suggestions_to_namespace_settings.rb b/db/migrate/20230407164616_add_code_suggestions_to_namespace_settings.rb new file mode 100644 index 00000000000..ce500fec2f0 --- /dev/null +++ b/db/migrate/20230407164616_add_code_suggestions_to_namespace_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddCodeSuggestionsToNamespaceSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :namespace_settings, :code_suggestions, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230410092450_add_product_analytics_instrumentation_key_to_project_settings.rb b/db/migrate/20230410092450_add_product_analytics_instrumentation_key_to_project_settings.rb new file mode 100644 index 00000000000..eaaddef083c --- /dev/null +++ b/db/migrate/20230410092450_add_product_analytics_instrumentation_key_to_project_settings.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddProductAnalyticsInstrumentationKeyToProjectSettings < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230413153140_add_text_limit_to_project_settings_instrumentation_key.rb + def up + with_lock_retries do + add_column :project_settings, :product_analytics_instrumentation_key, :text unless + column_exists?(:project_settings, :product_analytics_instrumentation_key) + end + end + + def down + with_lock_retries do + remove_column :project_settings, :product_analytics_instrumentation_key + end + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230411171001_create_abuse_trust_scores.rb b/db/migrate/20230411171001_create_abuse_trust_scores.rb new file mode 100644 index 00000000000..2c95a2ab01e --- /dev/null +++ b/db/migrate/20230411171001_create_abuse_trust_scores.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateAbuseTrustScores < Gitlab::Database::Migration[2.1] + def change + create_table :abuse_trust_scores do |t| + t.belongs_to :user, foreign_key: { to_table: :users, on_delete: :cascade }, index: false + + t.float :score, null: false + t.timestamps_with_timezone null: false + t.integer :source, limit: 2, null: false + t.text :correlation_id_value, limit: 32 + + t.index [:user_id, :source, :created_at] + end + end +end diff --git a/db/migrate/20230411205121_create_package_metadata_advisory_info.rb b/db/migrate/20230411205121_create_package_metadata_advisory_info.rb new file mode 100644 index 00000000000..adfc8e868f7 --- /dev/null +++ b/db/migrate/20230411205121_create_package_metadata_advisory_info.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +class CreatePackageMetadataAdvisoryInfo < Gitlab::Database::Migration[2.1] + def change + create_table :pm_advisories do |t| + t.text :advisory_xid, limit: 36, null: false + t.date :published_date, null: false + t.timestamps_with_timezone null: false + t.integer :source_xid, limit: 2, null: false + + t.text :title, limit: 256 + t.text :description, limit: 8192 + t.text :cvss_v2, limit: 128 + t.text :cvss_v3, limit: 128 + t.text :urls, array: true, default: [] + t.jsonb :identifiers, null: false + + t.index [:advisory_xid, :source_xid], unique: true + t.check_constraint 'CARDINALITY(urls) <= 10' + end + + create_table :pm_affected_packages do |t| + t.references :pm_advisory, index: true, foreign_key: { on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.integer :purl_type, limit: 2, null: false + + t.text :package_name, limit: 256, null: false + t.text :distro_version, limit: 256, null: true + t.text :solution, limit: 2048, null: true + t.text :affected_range, limit: 512, null: false + t.text :fixed_versions, array: true, default: [] + t.jsonb :overridden_advisory_fields, null: false, default: {} + + t.index [:pm_advisory_id, :purl_type, :package_name, :distro_version], unique: true, + name: 'i_affected_packages_unique_for_upsert' + t.check_constraint 'CARDINALITY(fixed_versions) <= 10' + end + end +end diff --git a/db/migrate/20230412073614_create_issue_assignment_events.rb b/db/migrate/20230412073614_create_issue_assignment_events.rb new file mode 100644 index 00000000000..1b57c59eb2b --- /dev/null +++ b/db/migrate/20230412073614_create_issue_assignment_events.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateIssueAssignmentEvents < Gitlab::Database::Migration[2.1] + def change + create_table :issue_assignment_events do |t| + t.references :user, null: true, index: true, foreign_key: { on_delete: :nullify } + t.bigint :issue_id, null: false + t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } + t.integer :action, limit: 2, null: false, default: 1 + + t.index %i[issue_id action created_at id], name: 'index_on_issue_assignment_events_issue_id_action_created_at_id' + end + end +end diff --git a/db/migrate/20230412080242_add_concurrent_fk_to_issue_assignment_events.rb b/db/migrate/20230412080242_add_concurrent_fk_to_issue_assignment_events.rb new file mode 100644 index 00000000000..3bff98c6e69 --- /dev/null +++ b/db/migrate/20230412080242_add_concurrent_fk_to_issue_assignment_events.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddConcurrentFkToIssueAssignmentEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :issue_assignment_events, + :issues, + column: :issue_id, + on_delete: :cascade + end + + def down + remove_foreign_key_if_exists :resource_assignment_events, column: :issue_id + end +end diff --git a/db/migrate/20230412151659_add_ci_job_artifacts_file_final_path.rb b/db/migrate/20230412151659_add_ci_job_artifacts_file_final_path.rb new file mode 100644 index 00000000000..18bf8640a45 --- /dev/null +++ b/db/migrate/20230412151659_add_ci_job_artifacts_file_final_path.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddCiJobArtifactsFileFinalPath < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in db/post_migrate/20230412152538_add_text_limit_to_ci_job_artifacts_file_final_path.rb + def change + add_column :ci_job_artifacts, :file_final_path, :text, null: true + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230412185920_validate_ci_job_artifacts_file_final_path.rb b/db/migrate/20230412185920_validate_ci_job_artifacts_file_final_path.rb new file mode 100644 index 00000000000..464ac1eec72 --- /dev/null +++ b/db/migrate/20230412185920_validate_ci_job_artifacts_file_final_path.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ValidateCiJobArtifactsFileFinalPath < Gitlab::Database::Migration[2.1] + def up + constraint_name = text_limit_name(:ci_job_artifacts, :file_final_path) + validate_check_constraint :ci_job_artifacts, constraint_name + end + + # No-op + def down; end +end diff --git a/db/migrate/20230413080906_create_merge_request_assignment_events.rb b/db/migrate/20230413080906_create_merge_request_assignment_events.rb new file mode 100644 index 00000000000..b976dc8935a --- /dev/null +++ b/db/migrate/20230413080906_create_merge_request_assignment_events.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateMergeRequestAssignmentEvents < Gitlab::Database::Migration[2.1] + def change + create_table :merge_request_assignment_events do |t| + t.references :user, null: true, index: true, foreign_key: { on_delete: :nullify } + t.bigint :merge_request_id, null: false + t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } + t.integer :action, limit: 2, null: false, default: 1 + + t.index %i[merge_request_id action created_at id], + name: 'index_on_mr_assignment_events_mr_id_action_created_at_id' + end + end +end diff --git a/db/migrate/20230413080918_add_concurrent_fk_to_merge_request_assignment_events.rb b/db/migrate/20230413080918_add_concurrent_fk_to_merge_request_assignment_events.rb new file mode 100644 index 00000000000..5b7d08a3547 --- /dev/null +++ b/db/migrate/20230413080918_add_concurrent_fk_to_merge_request_assignment_events.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddConcurrentFkToMergeRequestAssignmentEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :merge_request_assignment_events, + :merge_requests, + column: :merge_request_id, + on_delete: :cascade + end + + def down + remove_foreign_key_if_exists :merge_request_assignment_events, column: :merge_request_id + end +end diff --git a/db/migrate/20230413153140_add_text_limit_to_project_settings_instrumentation_key.rb b/db/migrate/20230413153140_add_text_limit_to_project_settings_instrumentation_key.rb new file mode 100644 index 00000000000..7ec0a800066 --- /dev/null +++ b/db/migrate/20230413153140_add_text_limit_to_project_settings_instrumentation_key.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToProjectSettingsInstrumentationKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :project_settings, :product_analytics_instrumentation_key, 255 + end + + def down + remove_text_limit :project_settings, :product_analytics_instrumentation_key + end +end diff --git a/db/migrate/20230414190012_add_product_analytics_to_project_settings.rb b/db/migrate/20230414190012_add_product_analytics_to_project_settings.rb new file mode 100644 index 00000000000..c77168f05be --- /dev/null +++ b/db/migrate/20230414190012_add_product_analytics_to_project_settings.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +class AddProductAnalyticsToProjectSettings < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :project_settings, :jitsu_host, :text, if_not_exists: true + add_column :project_settings, :jitsu_project_xid, :text, if_not_exists: true + add_column :project_settings, :jitsu_administrator_email, :text, if_not_exists: true + add_column :project_settings, :encrypted_jitsu_administrator_password, :binary, if_not_exists: true + add_column :project_settings, :encrypted_jitsu_administrator_password_iv, :binary, if_not_exists: true + add_column :project_settings, :product_analytics_data_collector_host, :text, if_not_exists: true + add_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string, + :binary, if_not_exists: true + add_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, + :binary, if_not_exists: true + add_column :project_settings, :cube_api_base_url, :text, if_not_exists: true + add_column :project_settings, :encrypted_cube_api_key, :binary, if_not_exists: true + add_column :project_settings, :encrypted_cube_api_key_iv, :binary, if_not_exists: true + end + + add_text_limit :project_settings, :jitsu_host, 255 + add_text_limit :project_settings, :jitsu_project_xid, 255 + add_text_limit :project_settings, :jitsu_administrator_email, 255 + add_text_limit :project_settings, :product_analytics_data_collector_host, 255 + add_text_limit :project_settings, :cube_api_base_url, 512 + end + + def down + with_lock_retries do + remove_column :project_settings, :jitsu_host, if_exists: true + remove_column :project_settings, :jitsu_project_xid, if_exists: true + remove_column :project_settings, :jitsu_administrator_email, if_exists: true + remove_column :project_settings, :encrypted_jitsu_administrator_password, if_exists: true + remove_column :project_settings, :encrypted_jitsu_administrator_password_iv, if_exists: true + remove_column :project_settings, :product_analytics_data_collector_host, if_exists: true + remove_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string, if_exists: true + remove_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, if_exists: true + remove_column :project_settings, :cube_api_base_url, if_exists: true + remove_column :project_settings, :encrypted_cube_api_key, if_exists: true + remove_column :project_settings, :encrypted_cube_api_key_iv, if_exists: true + end + end +end diff --git a/db/migrate/20230414230535_add_external_identifiers_index_to_import_failures.rb.rb b/db/migrate/20230414230535_add_external_identifiers_index_to_import_failures.rb.rb new file mode 100644 index 00000000000..5d9a35108f4 --- /dev/null +++ b/db/migrate/20230414230535_add_external_identifiers_index_to_import_failures.rb.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddExternalIdentifiersIndexToImportFailures < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_import_failures_on_external_identifiers' + + def up + add_concurrent_index :import_failures, :external_identifiers, name: INDEX_NAME, + where: "external_identifiers != '{}'" + end + + def down + remove_concurrent_index_by_name :import_failures, INDEX_NAME + end +end diff --git a/db/migrate/20230417145900_add_visibility_pipeline_id_type_to_user_preferences.rb b/db/migrate/20230417145900_add_visibility_pipeline_id_type_to_user_preferences.rb new file mode 100644 index 00000000000..2c58a40f244 --- /dev/null +++ b/db/migrate/20230417145900_add_visibility_pipeline_id_type_to_user_preferences.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddVisibilityPipelineIdTypeToUserPreferences < Gitlab::Database::Migration[2.1] + def change + add_column :user_preferences, :visibility_pipeline_id_type, :integer, default: 0, limit: 2, null: false + end +end diff --git a/db/migrate/20230418183540_create_project_states.rb b/db/migrate/20230418183540_create_project_states.rb new file mode 100644 index 00000000000..b23436028b5 --- /dev/null +++ b/db/migrate/20230418183540_create_project_states.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class CreateProjectStates < Gitlab::Database::Migration[2.1] + VERIFICATION_STATE_INDEX_NAME = "index_project_states_on_verification_state" + PENDING_VERIFICATION_INDEX_NAME = "index_project_states_pending_verification" + FAILED_VERIFICATION_INDEX_NAME = "index_project_states_failed_verification" + NEEDS_VERIFICATION_INDEX_NAME = "index_project_states_needs_verification" + + enable_lock_retries! + + def up + create_table :project_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, 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, default: 0, limit: 2, null: false + 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 :project_states + end +end diff --git a/db/migrate/20230418215853_add_assignee_widget_to_incidents.rb b/db/migrate/20230418215853_add_assignee_widget_to_incidents.rb new file mode 100644 index 00000000000..66eaee8ab87 --- /dev/null +++ b/db/migrate/20230418215853_add_assignee_widget_to_incidents.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +class AddAssigneeWidgetToIncidents < 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! + + WIDGET_NAME = 'Assignees' + WIDGET_ENUM_VALUE = 0 + WORK_ITEM_TYPE = 'Incident' + FAILURE_MSG = "type #{WORK_ITEM_TYPE} is missing, not adding widget" + + def up + type = WorkItemType.find_by_name_and_namespace_id(WORK_ITEM_TYPE, nil) + + unless type + say(FAILURE_MSG) + Gitlab::AppLogger.warn(FAILURE_MSG) + + return + end + + widgets = [{ + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + }] + + WidgetDefinition.upsert_all( + widgets, + unique_by: :index_work_item_widget_definitions_on_default_witype_and_name + ) + end + + def down + type = WorkItemType.find_by_name_and_namespace_id(WORK_ITEM_TYPE, nil) + return unless type + + WidgetDefinition.where(work_item_type_id: type, name: WIDGET_NAME).delete_all + end +end diff --git a/db/migrate/20230419105225_remove_phabricator_from_application_settings.rb b/db/migrate/20230419105225_remove_phabricator_from_application_settings.rb new file mode 100644 index 00000000000..42b27d3dd76 --- /dev/null +++ b/db/migrate/20230419105225_remove_phabricator_from_application_settings.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RemovePhabricatorFromApplicationSettings < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class ApplicationSetting < MigrationRecord + end + + def up + return if import_sources.empty? + + new_sources = import_sources - ['phabricator'] + + ApplicationSetting.update_all(import_sources: new_sources.to_yaml) + end + + def down + ## a reversion is not needed as Phabricator is no longer a supported import source + # and attempting to save it as one will result in a ActiveRecord error. + end + + def import_sources + ## the last ApplicationSetting record is used to determine application settings + import_sources = ApplicationSetting.last&.import_sources + import_sources.nil? ? [] : YAML.safe_load(import_sources) + end +end diff --git a/db/migrate/20230419130952_remove_github_import_job_instances.rb b/db/migrate/20230419130952_remove_github_import_job_instances.rb new file mode 100644 index 00000000000..e7028032eb4 --- /dev/null +++ b/db/migrate/20230419130952_remove_github_import_job_instances.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveGithubImportJobInstances < Gitlab::Database::Migration[2.1] + def up + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/9300 + end + + def down + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/9300 + end +end diff --git a/db/migrate/20230419192748_add_bot_user_id_to_security_orchestration_policy_configurations.rb b/db/migrate/20230419192748_add_bot_user_id_to_security_orchestration_policy_configurations.rb new file mode 100644 index 00000000000..980581c3727 --- /dev/null +++ b/db/migrate/20230419192748_add_bot_user_id_to_security_orchestration_policy_configurations.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddBotUserIdToSecurityOrchestrationPolicyConfigurations < Gitlab::Database::Migration[2.1] + def change + add_column :security_orchestration_policy_configurations, :bot_user_id, :integer + end +end diff --git a/db/migrate/20230419193807_add_foreign_key_for_bot_user_id_to_security_orchestration_policy_configurations.rb b/db/migrate/20230419193807_add_foreign_key_for_bot_user_id_to_security_orchestration_policy_configurations.rb new file mode 100644 index 00000000000..5a809aa9692 --- /dev/null +++ b/db/migrate/20230419193807_add_foreign_key_for_bot_user_id_to_security_orchestration_policy_configurations.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class AddForeignKeyForBotUserIdToSecurityOrchestrationPolicyConfigurations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_security_policy_configurations_on_bot_user_id' + + def up + add_concurrent_foreign_key :security_orchestration_policy_configurations, :users, column: :bot_user_id, + on_delete: :nullify + + add_concurrent_index :security_orchestration_policy_configurations, :bot_user_id, + where: "security_orchestration_policy_configurations.bot_user_id IS NOT NULL", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :security_orchestration_policy_configurations, INDEX_NAME + + with_lock_retries do + remove_foreign_key_if_exists :security_orchestration_policy_configurations, column: :bot_user_id + end + end +end diff --git a/db/migrate/20230420012220_create_organizations.rb b/db/migrate/20230420012220_create_organizations.rb new file mode 100644 index 00000000000..ba6e89837d8 --- /dev/null +++ b/db/migrate/20230420012220_create_organizations.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class CreateOrganizations < Gitlab::Database::Migration[2.1] + def change + create_table :organizations do |t| + t.timestamps_with_timezone null: false + end + end +end diff --git a/db/migrate/20230420040912_initialize_conversion_of_ci_pipelines.rb b/db/migrate/20230420040912_initialize_conversion_of_ci_pipelines.rb new file mode 100644 index 00000000000..84bad801ce4 --- /dev/null +++ b/db/migrate/20230420040912_initialize_conversion_of_ci_pipelines.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class InitializeConversionOfCiPipelines < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE = :ci_pipelines + 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/20230420115733_add_ai_settings_to_namespace_settings.rb b/db/migrate/20230420115733_add_ai_settings_to_namespace_settings.rb new file mode 100644 index 00000000000..681691d39c7 --- /dev/null +++ b/db/migrate/20230420115733_add_ai_settings_to_namespace_settings.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddAiSettingsToNamespaceSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :namespace_settings, :experiment_features_enabled, :boolean, default: false, null: false + add_column :namespace_settings, :third_party_ai_features_enabled, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230420131608_add_partitioned_vsd_counts_table.rb b/db/migrate/20230420131608_add_partitioned_vsd_counts_table.rb new file mode 100644 index 00000000000..dc2a3a15239 --- /dev/null +++ b/db/migrate/20230420131608_add_partitioned_vsd_counts_table.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class AddPartitionedVsdCountsTable < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + def up + execute(<<~SQL) + CREATE TABLE value_stream_dashboard_counts ( + id bigserial NOT NULL, + namespace_id bigint NOT NULL, + count bigint NOT NULL, + recorded_at timestamp with time zone NOT NULL, + metric smallint NOT NULL, + PRIMARY KEY (namespace_id, metric, recorded_at, count, id) + ) PARTITION BY RANGE (recorded_at); + SQL + + min_date = Date.today + max_date = Date.today + 6.months + create_daterange_partitions('value_stream_dashboard_counts', 'recorded_at', min_date, max_date) + end + + def down + drop_table :value_stream_dashboard_counts + end +end diff --git a/db/migrate/20230420132910_create_ci_ai_conversation.rb b/db/migrate/20230420132910_create_ci_ai_conversation.rb new file mode 100644 index 00000000000..7676a2b0ae1 --- /dev/null +++ b/db/migrate/20230420132910_create_ci_ai_conversation.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class CreateCiAiConversation < Gitlab::Database::Migration[2.1] + def up + create_table :ci_editor_ai_conversation_messages do |t| + t.bigint :user_id, + null: false + t.bigint :project_id, + null: false + t.timestamps_with_timezone null: false + t.text :role, limit: 100, + null: false + t.text :content, limit: 16384, + null: true + t.text :async_errors, array: true, null: false, default: [] + + t.index [:user_id, :project_id, :created_at], + name: :index_ci_editor_ai_messages_on_user_project_and_created_at + + t.index :project_id, + name: :index_ci_editor_ai_messages_project_id + + t.index :created_at, + name: :index_ci_editor_ai_messages_created_at + end + end + + def down + drop_table :ci_editor_ai_conversation_messages + end +end diff --git a/db/migrate/20230421035557_create_note_metadata.rb b/db/migrate/20230421035557_create_note_metadata.rb new file mode 100644 index 00000000000..fd15d8510d1 --- /dev/null +++ b/db/migrate/20230421035557_create_note_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateNoteMetadata < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :note_metadata, id: false do |t| + t.references :note, + primary_key: true, + null: false, + type: :bigint, + index: true, + foreign_key: { on_delete: :cascade } + t.text :email_participant, null: true, limit: 255 + t.timestamps_with_timezone null: true + end + end +end diff --git a/db/migrate/20230421081907_add_auth_type_to_jira_tracker_data.rb b/db/migrate/20230421081907_add_auth_type_to_jira_tracker_data.rb new file mode 100644 index 00000000000..4b2ae667e69 --- /dev/null +++ b/db/migrate/20230421081907_add_auth_type_to_jira_tracker_data.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAuthTypeToJiraTrackerData < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def change + add_column :jira_tracker_data, :jira_auth_type, :smallint, default: 0, null: false + end +end diff --git a/db/migrate/20230421124302_epic_boards_show_colors.rb b/db/migrate/20230421124302_epic_boards_show_colors.rb new file mode 100644 index 00000000000..cfc8e228196 --- /dev/null +++ b/db/migrate/20230421124302_epic_boards_show_colors.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class EpicBoardsShowColors < Gitlab::Database::Migration[2.1] + def change + add_column :boards_epic_boards, :display_colors, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230421165020_add_ci_max_includes_to_application_settings.rb b/db/migrate/20230421165020_add_ci_max_includes_to_application_settings.rb new file mode 100644 index 00000000000..9996d3b1654 --- /dev/null +++ b/db/migrate/20230421165020_add_ci_max_includes_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddCiMaxIncludesToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :ci_max_includes, :integer, default: 150, null: false + end +end diff --git a/db/migrate/20230424094117_add_read_vulnerability_to_member_roles.rb b/db/migrate/20230424094117_add_read_vulnerability_to_member_roles.rb new file mode 100644 index 00000000000..4ae4a7f6bff --- /dev/null +++ b/db/migrate/20230424094117_add_read_vulnerability_to_member_roles.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddReadVulnerabilityToMemberRoles < Gitlab::Database::Migration[2.1] + def change + add_column :member_roles, :read_vulnerability, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230424122236_add_ci_build_id_to_ml_candidate.rb b/db/migrate/20230424122236_add_ci_build_id_to_ml_candidate.rb new file mode 100644 index 00000000000..b777f365242 --- /dev/null +++ b/db/migrate/20230424122236_add_ci_build_id_to_ml_candidate.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddCiBuildIdToMlCandidate < Gitlab::Database::Migration[2.1] + def change + add_column :ml_candidates, :ci_build_id, :bigint, null: true + end +end diff --git a/db/migrate/20230424131551_add_index_on_ci_build_id_to_ml_candidates.rb b/db/migrate/20230424131551_add_index_on_ci_build_id_to_ml_candidates.rb new file mode 100644 index 00000000000..89e5be7e1c5 --- /dev/null +++ b/db/migrate/20230424131551_add_index_on_ci_build_id_to_ml_candidates.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnCiBuildIdToMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_candidates_on_ci_build_id' + + def up + add_concurrent_index :ml_candidates, :ci_build_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ml_candidates, name: INDEX_NAME + end +end diff --git a/db/migrate/20230424155321_add_licenses_field_to_package_metadata_packages.rb b/db/migrate/20230424155321_add_licenses_field_to_package_metadata_packages.rb new file mode 100644 index 00000000000..99a8f5633dd --- /dev/null +++ b/db/migrate/20230424155321_add_licenses_field_to_package_metadata_packages.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLicensesFieldToPackageMetadataPackages < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :pm_packages, :licenses, :jsonb, null: true + end +end diff --git a/db/migrate/20230424194721_add_tofa_application_settings.rb b/db/migrate/20230424194721_add_tofa_application_settings.rb new file mode 100644 index 00000000000..c39e85a1a87 --- /dev/null +++ b/db/migrate/20230424194721_add_tofa_application_settings.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddTofaApplicationSettings < Gitlab::Database::Migration[2.1] + def change + change_table(:application_settings, bulk: true) do |t| + t.column :encrypted_tofa_credentials, :binary + t.column :encrypted_tofa_credentials_iv, :binary + t.column :encrypted_tofa_host, :binary + t.column :encrypted_tofa_host_iv, :binary + t.column :encrypted_tofa_url, :binary + t.column :encrypted_tofa_url_iv, :binary + t.column :encrypted_tofa_response_json_keys, :binary + t.column :encrypted_tofa_response_json_keys_iv, :binary + t.column :encrypted_tofa_request_json_keys, :binary + t.column :encrypted_tofa_request_json_keys_iv, :binary + t.column :encrypted_tofa_request_payload, :binary + t.column :encrypted_tofa_request_payload_iv, :binary + t.column :encrypted_tofa_client_library_class, :binary + t.column :encrypted_tofa_client_library_class_iv, :binary + t.column :encrypted_tofa_client_library_args, :binary + t.column :encrypted_tofa_client_library_args_iv, :binary + t.column :encrypted_tofa_client_library_create_credentials_method, :binary + t.column :encrypted_tofa_client_library_create_credentials_method_iv, :binary + t.column :encrypted_tofa_client_library_fetch_access_token_method, :binary + t.column :encrypted_tofa_client_library_fetch_access_token_method_iv, :binary + t.column :encrypted_tofa_access_token_expires_in, :binary + t.column :encrypted_tofa_access_token_expires_in_iv, :binary + end + end +end diff --git a/db/migrate/20230425101542_remove_create_cross_project_pipeline_worker_job_instances.rb b/db/migrate/20230425101542_remove_create_cross_project_pipeline_worker_job_instances.rb new file mode 100644 index 00000000000..cf91b2a52d4 --- /dev/null +++ b/db/migrate/20230425101542_remove_create_cross_project_pipeline_worker_job_instances.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveCreateCrossProjectPipelineWorkerJobInstances < Gitlab::Database::Migration[2.1] + def up + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/9566 + end + + def down + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/9566 + end +end diff --git a/db/migrate/20230425173111_create_merge_request_diff_llm_summary.rb b/db/migrate/20230425173111_create_merge_request_diff_llm_summary.rb new file mode 100644 index 00000000000..f37459d764e --- /dev/null +++ b/db/migrate/20230425173111_create_merge_request_diff_llm_summary.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateMergeRequestDiffLlmSummary < Gitlab::Database::Migration[2.1] + INDEX_NAME = "index_merge_request_diff_llm_summaries_on_mr_diff_id" + + def change + create_table :merge_request_diff_llm_summaries do |t| + t.bigint :user_id, null: true, index: true + t.bigint :merge_request_diff_id, null: false, index: + { name: INDEX_NAME } + t.timestamps_with_timezone null: false + t.integer :provider, null: false, limit: 2 + t.text :content, null: false, limit: 2056 + end + end +end diff --git a/db/migrate/20230426102200_fix_import_sources_on_application_settings_after_phabricator_removal.rb b/db/migrate/20230426102200_fix_import_sources_on_application_settings_after_phabricator_removal.rb new file mode 100644 index 00000000000..e2061138fc4 --- /dev/null +++ b/db/migrate/20230426102200_fix_import_sources_on_application_settings_after_phabricator_removal.rb @@ -0,0 +1,26 @@ +# 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 FixImportSourcesOnApplicationSettingsAfterPhabricatorRemoval < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class ApplicationSetting < MigrationRecord + end + + def up + sources = ApplicationSetting.last&.import_sources + + return unless sources.is_a?(String) + return if sources.start_with?('---') + + sources = YAML.safe_load(sources) + + ApplicationSetting.update_all(import_sources: sources.to_yaml) + end + + def down; end +end diff --git a/db/migrate/20230426161259_add_user_foreign_key_to_merge_request_diff_llm_summary.rb b/db/migrate/20230426161259_add_user_foreign_key_to_merge_request_diff_llm_summary.rb new file mode 100644 index 00000000000..d5692b4d956 --- /dev/null +++ b/db/migrate/20230426161259_add_user_foreign_key_to_merge_request_diff_llm_summary.rb @@ -0,0 +1,18 @@ +# 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 AddUserForeignKeyToMergeRequestDiffLlmSummary < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :merge_request_diff_llm_summaries, :users, column: :user_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :merge_request_diff_llm_summaries, column: :user_id + end + end +end diff --git a/db/migrate/20230426161341_add_merge_request_diff_foreign_key_to_merge_request_diff_llm_summary.rb b/db/migrate/20230426161341_add_merge_request_diff_foreign_key_to_merge_request_diff_llm_summary.rb new file mode 100644 index 00000000000..4271bd3c07c --- /dev/null +++ b/db/migrate/20230426161341_add_merge_request_diff_foreign_key_to_merge_request_diff_llm_summary.rb @@ -0,0 +1,19 @@ +# 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 AddMergeRequestDiffForeignKeyToMergeRequestDiffLlmSummary < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :merge_request_diff_llm_summaries, :merge_request_diffs, column: :merge_request_diff_id, + on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :merge_request_diff_llm_summaries, column: :merge_request_diff_id + end + end +end diff --git a/db/migrate/20230427065641_initialize_conversion_of_ci_pipeline_variables.rb b/db/migrate/20230427065641_initialize_conversion_of_ci_pipeline_variables.rb new file mode 100644 index 00000000000..1c986dee3d2 --- /dev/null +++ b/db/migrate/20230427065641_initialize_conversion_of_ci_pipeline_variables.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class InitializeConversionOfCiPipelineVariables < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE = :ci_pipeline_variables + 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/20230427094534_create_analytics_value_stream_dashboard_aggregations.rb b/db/migrate/20230427094534_create_analytics_value_stream_dashboard_aggregations.rb new file mode 100644 index 00000000000..fd6528790ca --- /dev/null +++ b/db/migrate/20230427094534_create_analytics_value_stream_dashboard_aggregations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateAnalyticsValueStreamDashboardAggregations < Gitlab::Database::Migration[2.1] + def change + create_table :value_stream_dashboard_aggregations, id: false do |t| + t.references :namespace, primary_key: true, null: false, index: false, foreign_key: { on_delete: :cascade } + t.datetime_with_timezone :last_run_at + t.boolean :enabled, null: false, default: true + + t.index [:last_run_at, :namespace_id], where: 'enabled IS TRUE', + name: 'index_on_value_stream_dashboard_aggregations_last_run_at_id' + end + end +end diff --git a/db/migrate/20230428101217_create_abuse_report_events.rb b/db/migrate/20230428101217_create_abuse_report_events.rb new file mode 100644 index 00000000000..78395955eaf --- /dev/null +++ b/db/migrate/20230428101217_create_abuse_report_events.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateAbuseReportEvents < Gitlab::Database::Migration[2.1] + def change + create_table :abuse_report_events do |t| + t.bigint :abuse_report_id, null: false, index: true + t.bigint :user_id, index: true + t.datetime_with_timezone :created_at, null: false + t.integer :action, limit: 2, null: false, default: 1 + t.integer :reason, limit: 2 + t.text :comment, limit: 1024 + end + end +end diff --git a/db/migrate/20230428134334_delete_create_cross_project_pipeline_worker_job_instances.rb b/db/migrate/20230428134334_delete_create_cross_project_pipeline_worker_job_instances.rb new file mode 100644 index 00000000000..517f85c0c1f --- /dev/null +++ b/db/migrate/20230428134334_delete_create_cross_project_pipeline_worker_job_instances.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DeleteCreateCrossProjectPipelineWorkerJobInstances < Gitlab::Database::Migration[2.1] + DEPRECATED_JOB_CLASSES = %w[ + CreateCrossProjectPipelineWorker + ] + + disable_ddl_transaction! + def up + sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) + end + + def down + # This migration removes any instances of deprecated workers and cannot be undone. + end +end diff --git a/db/migrate/20230501111636_add_users_fk_to_abuse_report_events.rb b/db/migrate/20230501111636_add_users_fk_to_abuse_report_events.rb new file mode 100644 index 00000000000..d721bc6bc7c --- /dev/null +++ b/db/migrate/20230501111636_add_users_fk_to_abuse_report_events.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUsersFkToAbuseReportEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :abuse_report_events, + :users, + column: :user_id, + on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :abuse_report_events, column: :user_id + end + end +end diff --git a/db/migrate/20230501163253_add_remember_me_enabled_to_application_settings.rb b/db/migrate/20230501163253_add_remember_me_enabled_to_application_settings.rb new file mode 100644 index 00000000000..40c4ccd9f26 --- /dev/null +++ b/db/migrate/20230501163253_add_remember_me_enabled_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddRememberMeEnabledToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :remember_me_enabled, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230502083003_add_abuse_reports_fk_to_abuse_report_events.rb b/db/migrate/20230502083003_add_abuse_reports_fk_to_abuse_report_events.rb new file mode 100644 index 00000000000..3b71867f337 --- /dev/null +++ b/db/migrate/20230502083003_add_abuse_reports_fk_to_abuse_report_events.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddAbuseReportsFkToAbuseReportEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :abuse_report_events, + :abuse_reports, + column: :abuse_report_id, + on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :abuse_report_events, column: :abuse_report_id + end + end +end diff --git a/db/migrate/20230503100753_add_version_format_and_data_type_to_checkpoints.rb b/db/migrate/20230503100753_add_version_format_and_data_type_to_checkpoints.rb new file mode 100644 index 00000000000..97a0541cdb5 --- /dev/null +++ b/db/migrate/20230503100753_add_version_format_and_data_type_to_checkpoints.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddVersionFormatAndDataTypeToCheckpoints < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + add_column(:pm_checkpoints, :data_type, :integer, limit: 2, default: 1, null: false) + add_column(:pm_checkpoints, :version_format, :integer, limit: 2, default: 1, null: false) + add_index(:pm_checkpoints, [:purl_type, :data_type, :version_format], unique: true, name: :pm_checkpoints_unique_index) # rubocop:disable Migration/AddIndex + swap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index) + end + + def down + add_index(:pm_checkpoints, [:purl_type], unique: true, name: :pm_checkpoints_unique_index) # rubocop:disable Migration/AddIndex + unswap_primary_key(:pm_checkpoints, :pm_checkpoints_pkey, :pm_checkpoints_unique_index) + remove_column(:pm_checkpoints, :version_format) + remove_column(:pm_checkpoints, :data_type) + end +end diff --git a/db/migrate/20230503191056_add_text_limit_to_packages_npm_metadata_caches_object_storage_key.rb b/db/migrate/20230503191056_add_text_limit_to_packages_npm_metadata_caches_object_storage_key.rb new file mode 100644 index 00000000000..b2759a30809 --- /dev/null +++ b/db/migrate/20230503191056_add_text_limit_to_packages_npm_metadata_caches_object_storage_key.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToPackagesNpmMetadataCachesObjectStorageKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :packages_npm_metadata_caches, :object_storage_key, 255 + end + + def down + remove_text_limit :packages_npm_metadata_caches, :object_storage_key + end +end diff --git a/db/migrate/20230504084524_remove_gitlab_import_source.rb b/db/migrate/20230504084524_remove_gitlab_import_source.rb new file mode 100644 index 00000000000..287b1cd3139 --- /dev/null +++ b/db/migrate/20230504084524_remove_gitlab_import_source.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class RemoveGitlabImportSource < Gitlab::Database::Migration[2.1] + include Gitlab::Utils::StrongMemoize + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class ApplicationSetting < MigrationRecord + end + + def up + return if import_sources.empty? + + new_sources = import_sources - ['gitlab'] + + ApplicationSetting.update_all(import_sources: new_sources.to_yaml) + end + + def down + ## a reversion is not needed as the Gitlab.com importer is no longer + # a supported import source. Attempting to save it as one will result + # in an ActiveRecord error. + end + + def import_sources + ## the last ApplicationSetting record is used to determine application settings + import_sources = ApplicationSetting.last&.import_sources + import_sources.nil? ? [] : YAML.safe_load(import_sources) + end + strong_memoize_attr(:import_sources) +end diff --git a/db/migrate/20230504112809_add_anthropic_api_key_application_setting.rb b/db/migrate/20230504112809_add_anthropic_api_key_application_setting.rb new file mode 100644 index 00000000000..aacb26643b9 --- /dev/null +++ b/db/migrate/20230504112809_add_anthropic_api_key_application_setting.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddAnthropicApiKeyApplicationSetting < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :encrypted_anthropic_api_key, :binary + add_column :application_settings, :encrypted_anthropic_api_key_iv, :binary + end +end diff --git a/db/migrate/20230505122015_add_lock_version_to_milestones.rb b/db/migrate/20230505122015_add_lock_version_to_milestones.rb new file mode 100644 index 00000000000..f8e34426c39 --- /dev/null +++ b/db/migrate/20230505122015_add_lock_version_to_milestones.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLockVersionToMilestones < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :milestones, :lock_version, :integer, null: false, default: 0 + end +end diff --git a/db/migrate/20230507192028_create_audit_events_google_cloud_logging_configurations.rb b/db/migrate/20230507192028_create_audit_events_google_cloud_logging_configurations.rb new file mode 100644 index 00000000000..1a32367382a --- /dev/null +++ b/db/migrate/20230507192028_create_audit_events_google_cloud_logging_configurations.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class CreateAuditEventsGoogleCloudLoggingConfigurations < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + UNIQUE_INDEX_NAME = "unique_google_cloud_logging_configurations_on_namespace_id" + + # rubocop:disable Migration/AddLimitToTextColumns + def change + create_table :audit_events_google_cloud_logging_configurations do |t| + t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.text :google_project_id_name, null: false, limit: 30 + t.text :client_email, null: false, limit: 254 + t.text :log_id_name, default: "audit_events", limit: 511 + t.binary :encrypted_private_key, null: false + t.binary :encrypted_private_key_iv, null: false + + t.index [:namespace_id, :google_project_id_name, :log_id_name], unique: true, name: UNIQUE_INDEX_NAME + end + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20230508074515_add_google_cloud_logging_configuration_limit_to_plan_limits.rb b/db/migrate/20230508074515_add_google_cloud_logging_configuration_limit_to_plan_limits.rb new file mode 100644 index 00000000000..a3a54fb55ea --- /dev/null +++ b/db/migrate/20230508074515_add_google_cloud_logging_configuration_limit_to_plan_limits.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddGoogleCloudLoggingConfigurationLimitToPlanLimits < Gitlab::Database::Migration[2.1] + def change + add_column(:plan_limits, :google_cloud_logging_configurations, :integer, default: 5, null: false) + end +end diff --git a/db/migrate/20230509072635_drop_unused_sequence_by_recreating_vsa_table.rb b/db/migrate/20230509072635_drop_unused_sequence_by_recreating_vsa_table.rb new file mode 100644 index 00000000000..d1abc9bbda7 --- /dev/null +++ b/db/migrate/20230509072635_drop_unused_sequence_by_recreating_vsa_table.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class DropUnusedSequenceByRecreatingVsaTable < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + # dropping is OK since we re-add the table in the same transaction + drop_table :value_stream_dashboard_aggregations, if_exists: true # rubocop: disable Migration/DropTable + create_table :value_stream_dashboard_aggregations, id: false do |t| + # Note: default: nil will prevent SEQUENCE creation + t.references :namespace, primary_key: true, null: false, index: false, foreign_key: { on_delete: :cascade }, + default: nil + t.datetime_with_timezone :last_run_at + t.boolean :enabled, null: false, default: true + + t.index [:last_run_at, :namespace_id], where: 'enabled IS TRUE', + name: 'index_on_value_stream_dashboard_aggregations_last_run_at_id' + end + end + + def down + # no-op, we don't want to restore the sequence + end +end diff --git a/db/migrate/20230509085428_change_organizations_sequence.rb b/db/migrate/20230509085428_change_organizations_sequence.rb new file mode 100644 index 00000000000..59ec8c6e1ea --- /dev/null +++ b/db/migrate/20230509085428_change_organizations_sequence.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class ChangeOrganizationsSequence < Gitlab::Database::Migration[2.1] + def up + # Modify sequence for organizations.id so id '1' is never automatically taken + execute "ALTER SEQUENCE organizations_id_seq START WITH 1000 MINVALUE 1000 RESTART" + end + + def down + execute "ALTER SEQUENCE organizations_id_seq START WITH 1 MINVALUE 1" + end +end diff --git a/db/migrate/20230509115525_add_name_to_organization.rb b/db/migrate/20230509115525_add_name_to_organization.rb new file mode 100644 index 00000000000..d77fa84a70c --- /dev/null +++ b/db/migrate/20230509115525_add_name_to_organization.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# rubocop:disable Migration/AddLimitToTextColumns, Migration/AddIndex +# limit is added in 20230515111314_add_text_limit_on_organization_name.rb +class AddNameToOrganization < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'unique_organizations_on_name_lower' + + def up + add_column :organizations, :name, :text, null: false, default: '' + + add_index :organizations, 'lower(name)', name: INDEX_NAME, unique: true + end + + def down + remove_column :organizations, :name, if_exists: true + end +end +# rubocop:enable Migration/AddLimitToTextColumns, Migration/AddIndex diff --git a/db/migrate/20230509131736_add_default_organization.rb b/db/migrate/20230509131736_add_default_organization.rb new file mode 100644 index 00000000000..a63e7171f53 --- /dev/null +++ b/db/migrate/20230509131736_add_default_organization.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddDefaultOrganization < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class Organization < MigrationRecord + end + + def up + Organization.create(id: 1, name: 'Default') + end + + def down + Organization.where(id: 1).delete_all + end +end diff --git a/db/migrate/20230509144234_delete_drop_older_deployments_worker_queues.rb b/db/migrate/20230509144234_delete_drop_older_deployments_worker_queues.rb new file mode 100644 index 00000000000..b6e3046e446 --- /dev/null +++ b/db/migrate/20230509144234_delete_drop_older_deployments_worker_queues.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DeleteDropOlderDeploymentsWorkerQueues < Gitlab::Database::Migration[2.1] + DEPRECATED_JOB_CLASSES = %w[ + Deployments::DropOlderDeploymentsWorker + ] + + disable_ddl_transaction! + def up + sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) + end + + def down + # This migration removes any instances of deprecated workers and cannot be undone. + end +end diff --git a/db/migrate/20230515111314_add_text_limit_on_organization_name.rb b/db/migrate/20230515111314_add_text_limit_on_organization_name.rb new file mode 100644 index 00000000000..c0b687fab94 --- /dev/null +++ b/db/migrate/20230515111314_add_text_limit_on_organization_name.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitOnOrganizationName < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :organizations, :name, 255 + end + + def down + remove_text_limit :organizations, :name + end +end diff --git a/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb b/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb deleted file mode 100644 index 1e65d5647e4..00000000000 --- a/db/post_migrate/20210826193907_add_unique_index_dast_site_token_project_id_and_url.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexDastSiteTokenProjectIdAndUrl < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_dast_site_token_on_project_id_and_url' - - def up - add_concurrent_index :dast_site_tokens, [:project_id, :url], name: INDEX_NAME, unique: true - end - - def down - remove_concurrent_index_by_name :dast_site_tokens, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb b/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb deleted file mode 100644 index d6b2db7790f..00000000000 --- a/db/post_migrate/20210830104800_reschedule_extract_project_topics_into_separate_table.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RescheduleExtractProjectTopicsIntoSeparateTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'ExtractProjectTopicsIntoSeparateTable' - DELAY_INTERVAL = 4.minutes - - disable_ddl_transaction! - - def up - requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb b/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb deleted file mode 100644 index a3fe0e6bd7a..00000000000 --- a/db/post_migrate/20210831123008_drop_temporary_trigger_for_ci_sources_pipelines.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class DropTemporaryTriggerForCiSourcesPipelines < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = 'ci_sources_pipelines' - TEMPORARY_COLUMN = 'source_job_id_convert_to_bigint' - MAIN_COLUMN = 'source_job_id' - TRIGGER = 'trigger_8485e97c00e3' - - # 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_COLUMN, TEMPORARY_COLUMN, trigger_name: TRIGGER) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod -end diff --git a/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb b/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb deleted file mode 100644 index e11f0d46563..00000000000 --- a/db/post_migrate/20210901044202_push_event_payloads_bigint_conversion_remove_triggers.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class PushEventPayloadsBigintConversionRemoveTriggers < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE_NAME = :push_event_payloads - TRIGGER_NAME = 'trigger_07c94931164e' - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - check_trigger_permissions!(TABLE_NAME) - - with_lock_retries do - remove_rename_triggers(TABLE_NAME, TRIGGER_NAME) - end - end - - def down - check_trigger_permissions!(TABLE_NAME) - - with_lock_retries do - install_rename_triggers(TABLE_NAME, :event_id, :event_id_convert_to_bigint, trigger_name: TRIGGER_NAME) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod -end diff --git a/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb b/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb deleted file mode 100644 index bfe3af2efa8..00000000000 --- a/db/post_migrate/20210901044237_events_bigint_conversion_remove_triggers.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class EventsBigintConversionRemoveTriggers < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE_NAME = :events - TRIGGER_NAME = :trigger_69523443cc10 - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - check_trigger_permissions!(TABLE_NAME) - - with_lock_retries do - remove_rename_triggers(TABLE_NAME, TRIGGER_NAME) - end - end - - def down - check_trigger_permissions!(TABLE_NAME) - - with_lock_retries do - install_rename_triggers(TABLE_NAME, :id, :id_convert_to_bigint, trigger_name: TRIGGER_NAME) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod -end diff --git a/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb b/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb deleted file mode 100644 index 8ee7feae1a6..00000000000 --- a/db/post_migrate/20210901153324_slice_merge_request_diff_commit_migrations.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -class SliceMergeRequestDiffCommitMigrations < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - BATCH_SIZE = 5_000 - MIGRATION_CLASS = 'MigrateMergeRequestDiffCommitUsers' - STEAL_MIGRATION_CLASS = 'StealMigrateMergeRequestDiffCommitUsers' - - def up - old_jobs = Gitlab::Database::BackgroundMigrationJob - .for_migration_class(MIGRATION_CLASS) - .pending - .to_a - - return if old_jobs.empty? - - transaction do - # This ensures we stop processing the old ranges, as the background - # migrations skip already processed jobs. - Gitlab::Database::BackgroundMigrationJob - .for_migration_class(MIGRATION_CLASS) - .pending - .update_all(status: :succeeded) - - rows = [] - - old_jobs.each do |job| - min, max = job.arguments - - while min < max - rows << { - class_name: MIGRATION_CLASS, - arguments: [min, min + BATCH_SIZE], - created_at: Time.now.utc, - updated_at: Time.now.utc - } - - min += BATCH_SIZE - end - end - - Gitlab::Database::BackgroundMigrationJob.insert_all!(rows) - end - - job = Gitlab::Database::BackgroundMigrationJob - .for_migration_class(MIGRATION_CLASS) - .pending - .first - - migrate_in(1.hour, STEAL_MIGRATION_CLASS, job.arguments) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb b/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb deleted file mode 100644 index 47795c5d646..00000000000 --- a/db/post_migrate/20210901184511_prepare_async_indexes_for_ci_builds.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -class PrepareAsyncIndexesForCiBuilds < Gitlab::Database::Migration[1.0] - def up - prepare_async_index :ci_builds, :stage_id_convert_to_bigint, name: :index_ci_builds_on_converted_stage_id - - prepare_async_index :ci_builds, [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], - where: "type::text = 'Ci::Build'::text - AND (retried = false OR retried IS NULL) - AND (name::text = ANY (ARRAY['sast'::character varying::text, - 'secret_detection'::character varying::text, - 'dependency_scanning'::character varying::text, - 'container_scanning'::character varying::text, - 'dast'::character varying::text]))", - name: :index_ci_builds_on_commit_id_expire_at_and_converted_id - - prepare_async_index :ci_builds, [:project_id, :id_convert_to_bigint], - name: :index_ci_builds_on_project_and_converted_id - - prepare_async_index :ci_builds, [:runner_id, :id_convert_to_bigint], - order: { id_convert_to_bigint: :desc }, - name: :index_ci_builds_on_runner_id_and_converted_id_desc - - prepare_async_index :ci_builds, [:resource_group_id, :id_convert_to_bigint], - where: 'resource_group_id IS NOT NULL', - name: :index_ci_builds_on_resource_group_and_converted_id - - prepare_async_index :ci_builds, [:name, :id_convert_to_bigint], - where: "(name::text = ANY (ARRAY['container_scanning'::character varying::text, - 'dast'::character varying::text, - 'dependency_scanning'::character varying::text, - 'license_management'::character varying::text, - 'sast'::character varying::text, - 'secret_detection'::character varying::text, - 'coverage_fuzzing'::character varying::text, - 'license_scanning'::character varying::text]) - ) AND type::text = 'Ci::Build'::text", - name: :index_security_ci_builds_on_name_and_converted_id_parser - - prepare_async_index_from_sql(:ci_builds, :index_ci_builds_runner_id_and_converted_id_pending_covering, <<~SQL.squish) - CREATE INDEX CONCURRENTLY index_ci_builds_runner_id_and_converted_id_pending_covering - ON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id) - WHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text - SQL - end - - def down - unprepare_async_index_by_name :ci_builds, :index_ci_builds_runner_id_and_converted_id_pending_covering - - unprepare_async_index_by_name :ci_builds, :index_security_ci_builds_on_name_and_converted_id_parser - - unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_resource_group_and_converted_id - - unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_runner_id_and_converted_id_desc - - unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_project_and_converted_id - - unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_commit_id_expire_at_and_converted_id - - unprepare_async_index_by_name :ci_builds, :index_ci_builds_on_converted_stage_id - 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/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb b/db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb deleted file mode 100644 index f04c5cd6561..00000000000 --- a/db/post_migrate/20210902144144_drop_temporary_columns_and_triggers_for_ci_build_needs.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class DropTemporaryColumnsAndTriggersForCiBuildNeeds < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = 'ci_build_needs' - 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/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb b/db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb deleted file mode 100644 index 44bec402cae..00000000000 --- a/db/post_migrate/20210906100316_drop_temporary_columns_and_triggers_for_ci_build_trace_chunks.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class DropTemporaryColumnsAndTriggersForCiBuildTraceChunks < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = 'ci_build_trace_chunks' - COLUMN = 'build_id' - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - with_lock_retries do - cleanup_conversion_of_integer_to_bigint(TABLE, COLUMN) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - - def down - restore_conversion_of_integer_to_bigint(TABLE, COLUMN) - end -end diff --git a/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb b/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb deleted file mode 100644 index cb5714055bb..00000000000 --- a/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class DropTemporaryColumnsAndTriggersForTaggings < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - TABLE = 'taggings' - COLUMNS = %w(id taggable_id) - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - - def down - restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb b/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb deleted file mode 100644 index 54dce0a7da8..00000000000 --- a/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForCiBuildsMetadata < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - TABLE = :ci_builds_metadata - - def up - cleanup_conversion_of_integer_to_bigint(TABLE, :id) - cleanup_conversion_of_integer_to_bigint(TABLE, :build_id) - end - - def down - restore_conversion_of_integer_to_bigint(TABLE, :build_id) - restore_conversion_of_integer_to_bigint(TABLE, :id) - end -end diff --git a/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb b/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb deleted file mode 100644 index 096b5b3bf42..00000000000 --- a/db/post_migrate/20210907021940_cleanup_bigint_conversion_for_ci_stages.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForCiStages < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = :ci_stages - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - with_lock_retries do - cleanup_conversion_of_integer_to_bigint(TABLE, :id) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - - def down - restore_conversion_of_integer_to_bigint(TABLE, :id) - end -end diff --git a/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb b/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb deleted file mode 100644 index 2d71c11cfa8..00000000000 --- a/db/post_migrate/20210907033745_cleanup_bigint_conversion_for_deployments.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForDeployments < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = :deployments - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - with_lock_retries do - cleanup_conversion_of_integer_to_bigint(TABLE, :deployable_id) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - - def down - restore_conversion_of_integer_to_bigint(TABLE, :deployable_id) - end -end diff --git a/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb b/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb deleted file mode 100644 index 26f00454029..00000000000 --- a/db/post_migrate/20210907041000_cleanup_bigint_conversion_for_geo_job_artifact_deleted_events.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForGeoJobArtifactDeletedEvents < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE = :geo_job_artifact_deleted_events - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - def up - with_lock_retries do - cleanup_conversion_of_integer_to_bigint(TABLE, :job_artifact_id) - end - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - - def down - restore_conversion_of_integer_to_bigint(TABLE, :job_artifact_id) - end -end diff --git a/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb b/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb deleted file mode 100644 index f164cdbf379..00000000000 --- a/db/post_migrate/20210907211557_finalize_ci_builds_bigint_conversion.rb +++ /dev/null @@ -1,223 +0,0 @@ -# frozen_string_literal: true - -class FinalizeCiBuildsBigintConversion < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE_NAME = 'ci_builds' - PK_INDEX_NAME = 'index_ci_builds_on_converted_id' - - SECONDARY_INDEXES = [ - { - original_name: :index_ci_builds_on_commit_id_artifacts_expired_at_and_id, - temporary_name: :index_ci_builds_on_commit_id_expire_at_and_converted_id, - columns: [:commit_id, :artifacts_expire_at, :id_convert_to_bigint], - options: { - where: "type::text = 'Ci::Build'::text - AND (retried = false OR retried IS NULL) - AND (name::text = ANY (ARRAY['sast'::character varying::text, - 'secret_detection'::character varying::text, - 'dependency_scanning'::character varying::text, - 'container_scanning'::character varying::text, - 'dast'::character varying::text]))" - } - }, - { - original_name: :index_ci_builds_on_project_id_and_id, - temporary_name: :index_ci_builds_on_project_and_converted_id, - columns: [:project_id, :id_convert_to_bigint], - options: {} - }, - { - original_name: :index_ci_builds_on_runner_id_and_id_desc, - temporary_name: :index_ci_builds_on_runner_id_and_converted_id_desc, - columns: [:runner_id, :id_convert_to_bigint], - options: { order: { id_convert_to_bigint: :desc } } - }, - { - original_name: :index_for_resource_group, - temporary_name: :index_ci_builds_on_resource_group_and_converted_id, - columns: [:resource_group_id, :id_convert_to_bigint], - options: { where: 'resource_group_id IS NOT NULL' } - }, - { - original_name: :index_security_ci_builds_on_name_and_id_parser_features, - temporary_name: :index_security_ci_builds_on_name_and_converted_id_parser, - columns: [:name, :id_convert_to_bigint], - options: { - where: "(name::text = ANY (ARRAY['container_scanning'::character varying::text, - 'dast'::character varying::text, - 'dependency_scanning'::character varying::text, - 'license_management'::character varying::text, - 'sast'::character varying::text, - 'secret_detection'::character varying::text, - 'coverage_fuzzing'::character varying::text, - 'license_scanning'::character varying::text]) - ) AND type::text = 'Ci::Build'::text" - } - } - ].freeze - - MANUAL_INDEX_NAMES = { - original_name: :index_ci_builds_runner_id_pending_covering, - temporary_name: :index_ci_builds_runner_id_and_converted_id_pending_covering - }.freeze - - REFERENCING_FOREIGN_KEYS = [ - [:ci_build_needs, :build_id, :cascade, 'fk_rails_'], - [:ci_build_pending_states, :build_id, :cascade, 'fk_rails_'], - [:ci_build_report_results, :build_id, :cascade, 'fk_rails_'], - [:ci_build_trace_chunks, :build_id, :cascade, 'fk_rails_'], - [:ci_build_trace_metadata, :build_id, :cascade, 'fk_rails_'], - [:ci_builds_runner_session, :build_id, :cascade, 'fk_rails_'], - [:ci_builds_metadata, :build_id, :cascade, 'fk_'], - [:ci_job_artifacts, :job_id, :cascade, 'fk_rails_'], - [:ci_job_variables, :job_id, :cascade, 'fk_rails_'], - [:ci_pending_builds, :build_id, :cascade, 'fk_rails_'], - [:ci_resources, :build_id, :nullify, 'fk_'], - [:ci_running_builds, :build_id, :cascade, 'fk_rails_'], - [:ci_sources_pipelines, :source_job_id, :cascade, 'fk_'], - [:ci_unit_test_failures, :build_id, :cascade, 'fk_'], - [:dast_scanner_profiles_builds, :ci_build_id, :cascade, 'fk_'], - [:dast_site_profiles_builds, :ci_build_id, :cascade, 'fk_'], - [:pages_deployments, :ci_build_id, :nullify, 'fk_rails_'], - [:requirements_management_test_reports, :build_id, :nullify, 'fk_rails_'], - [:security_scans, :build_id, :cascade, 'fk_rails_'], - [:terraform_state_versions, :ci_build_id, :nullify, 'fk_'] - ].freeze - - 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]] - ) - - # Remove this upfront since this table is being dropped, and doesn't need to be migrated - if foreign_key_exists?(:dep_ci_build_trace_sections, TABLE_NAME, column: :build_id) - remove_foreign_key(:dep_ci_build_trace_sections, TABLE_NAME, column: :build_id) - end - - # Remove this unexpected FK if it exists - https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5531#note_676576081 - if foreign_key_exists?(:ci_resources, TABLE_NAME, column: :build_id, name: 'fk_rails_e169a8e3d5') - remove_foreign_key(:ci_resources, TABLE_NAME, column: :build_id, name: 'fk_rails_e169a8e3d5') - end - - # Remove this unexpected FK if it exists - https://gitlab.com/gitlab-org/gitlab/-/issues/341822 - if foreign_key_exists?(:ci_sources_pipelines, TABLE_NAME, column: :source_job_id, name: 'fk_3f0c88d7dc') - remove_foreign_key(:ci_sources_pipelines, TABLE_NAME, column: :source_job_id, name: 'fk_3f0c88d7dc') - end - - swap_columns - end - - def down - swap_columns - end - - private - - def swap_columns - # Copy existing indexes from the original column to the new column - create_indexes - # Copy existing FKs from the original column to the new column - create_referencing_foreign_keys - - # Remove existing FKs from the referencing tables, so we don't have to lock on them when we drop the existing PK - replace_referencing_foreign_keys - - with_lock_retries(raise_on_exhaustion: true) do - quoted_table_name = quote_table_name(TABLE_NAME) - - # Swap the original and new column names - temporary_name = 'id_tmp' - execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:id)} TO #{quote_column_name(temporary_name)}" - execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(:id_convert_to_bigint)} TO #{quote_column_name(:id)}" - execute "ALTER TABLE #{quoted_table_name} RENAME COLUMN #{quote_column_name(temporary_name)} TO #{quote_column_name(: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" - - # Swap defaults of the two columns, and change ownership of the sequence to the new id - execute "ALTER SEQUENCE ci_builds_id_seq OWNED BY #{TABLE_NAME}.id" - change_column_default TABLE_NAME, :id, -> { "nextval('ci_builds_id_seq'::regclass)" } - change_column_default TABLE_NAME, :id_convert_to_bigint, 0 - - # Swap the PK constraint from the original column to the new column - # We deliberately don't CASCADE here because the old FKs should be removed already - execute "ALTER TABLE #{quoted_table_name} DROP CONSTRAINT ci_builds_pkey" - rename_index TABLE_NAME, PK_INDEX_NAME, 'ci_builds_pkey' - execute "ALTER TABLE #{quoted_table_name} ADD CONSTRAINT ci_builds_pkey PRIMARY KEY USING INDEX ci_builds_pkey" - - # Remove old column indexes and change new column indexes to have the original names - rename_secondary_indexes # rubocop:disable Migration/WithLockRetriesDisallowedMethod - end - end - - def create_indexes - add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME - - SECONDARY_INDEXES.each do |index_definition| - options = index_definition[:options] - options[:name] = index_definition[:temporary_name] - - add_concurrent_index(TABLE_NAME, index_definition[:columns], options) - end - - unless index_name_exists?(TABLE_NAME, MANUAL_INDEX_NAMES[:temporary_name]) - execute(<<~SQL) - CREATE INDEX CONCURRENTLY #{MANUAL_INDEX_NAMES[:temporary_name]} - ON ci_builds (runner_id, id_convert_to_bigint) INCLUDE (project_id) - WHERE status::text = 'pending'::text AND type::text = 'Ci::Build'::text - SQL - end - end - - def rename_secondary_indexes - (SECONDARY_INDEXES + [MANUAL_INDEX_NAMES]).each do |index_definition| - remove_index(TABLE_NAME, name: index_definition[:original_name]) # rubocop:disable Migration/RemoveIndex - rename_index(TABLE_NAME, index_definition[:temporary_name], index_definition[:original_name]) - end - end - - def create_referencing_foreign_keys - REFERENCING_FOREIGN_KEYS.each do |(from_table, column, on_delete, prefix)| - # Don't attempt to create the FK if one already exists from the table to the new column - # The check in `add_concurrent_foreign_key` already checks for this, but it looks for the foreign key - # with the new name only (containing the `_tmp` suffix). - # - # Since we might partially rename FKs and re-run the migration, we also have to check and see if a FK exists - # on those columns that might not match the `_tmp` name. - next if foreign_key_exists?(from_table, TABLE_NAME, column: column, primary_key: :id_convert_to_bigint) - - temporary_name = "#{concurrent_foreign_key_name(from_table, column, prefix: prefix)}_tmp" - - add_concurrent_foreign_key( - from_table, - TABLE_NAME, - column: column, - target_column: :id_convert_to_bigint, - name: temporary_name, - on_delete: on_delete) - end - end - - def replace_referencing_foreign_keys - REFERENCING_FOREIGN_KEYS.each do |(from_table, column, _, prefix)| - existing_name = concurrent_foreign_key_name(from_table, column, prefix: prefix) - - # Don't attempt to replace the FK unless it exists and points at the original column. - # This could happen if the migration is re-run due to failing midway. - next unless foreign_key_exists?(from_table, TABLE_NAME, column: column, primary_key: :id, name: existing_name) - - with_lock_retries do - temporary_name = "#{existing_name}_tmp" - - remove_foreign_key(from_table, TABLE_NAME, column: column, primary_key: :id, name: existing_name) - rename_constraint(from_table, temporary_name, existing_name) - end - end - end -end diff --git a/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb b/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb deleted file mode 100644 index 3a758394d7f..00000000000 --- a/db/post_migrate/20210908132335_disable_job_token_scope_when_unused.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class DisableJobTokenScopeWhenUnused < Gitlab::Database::Migration[1.0] - 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/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb b/db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb deleted file mode 100644 index ad31a40f324..00000000000 --- a/db/post_migrate/20210909104800_reschedule_extract_project_topics_into_separate_table_2.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class RescheduleExtractProjectTopicsIntoSeparateTable2 < Gitlab::Database::Migration[1.0] - MIGRATION = 'ExtractProjectTopicsIntoSeparateTable' - DELAY_INTERVAL = 4.minutes - - disable_ddl_transaction! - - def up - requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210909152027_remove_container_registry_enabled.rb b/db/post_migrate/20210909152027_remove_container_registry_enabled.rb deleted file mode 100644 index d97faaf58d2..00000000000 --- a/db/post_migrate/20210909152027_remove_container_registry_enabled.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveContainerRegistryEnabled < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_column :projects, :container_registry_enabled - end - end - - def down - with_lock_retries do - add_column :projects, :container_registry_enabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end - end -end diff --git a/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb b/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb deleted file mode 100644 index 537c235edab..00000000000 --- a/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class UpdateReportTypeForExistingApprovalProjectRules < Gitlab::Database::Migration[1.0] - def up - # 1. We only want to consider when rule_type is set to :report_approver (i.e., 2): - # enum rule_type: { - # regular: 0, - # code_owner: 1, # currently unused - # report_approver: 2, - # any_approver: 3 - # } - # 2. Also we want to change only the folowing names and respective values: - # DEFAULT_NAME_FOR_LICENSE_REPORT = 'License-Check' - # DEFAULT_NAME_FOR_VULNERABILITY_REPORT = 'Vulnerability-Check' - # DEFAULT_NAME_FOR_COVERAGE = 'Coverage-Check' - # enum report_type: { - # vulnerability: 1, - # license_scanning: 2, - # code_coverage: 3 - # } - - execute <<~SQL - UPDATE approval_project_rules - SET report_type = converted_values.report_type - FROM - ( values - (1, 'Vulnerability-Check'), - (2, 'License-Check'), - (3, 'Coverage-Check') - ) AS converted_values(report_type, name) - WHERE approval_project_rules.name = converted_values.name - AND approval_project_rules.rule_type = 2; - SQL - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb b/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb deleted file mode 100644 index 3584c7136e3..00000000000 --- a/db/post_migrate/20210914094840_add_gin_index_on_pending_builds_namespace_traversal_ids.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddGinIndexOnPendingBuildsNamespaceTraversalIds < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_gin_ci_pending_builds_on_namespace_traversal_ids' - - def up - add_concurrent_index :ci_pending_builds, :namespace_traversal_ids, name: INDEX_NAME, using: :gin - end - - def down - remove_concurrent_index_by_name :ci_pending_builds, INDEX_NAME - end -end diff --git a/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb b/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb deleted file mode 100644 index 4756bc3dca5..00000000000 --- a/db/post_migrate/20210914095310_cleanup_orphan_project_access_tokens.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class CleanupOrphanProjectAccessTokens < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TMP_INDEX_NAME = 'idx_users_on_user_type_project_bots_batched' - - def up - users_table = define_batchable_model('users') - - add_concurrent_index(:users, :id, name: TMP_INDEX_NAME, where: 'user_type = 6') - - accumulated_orphans = [] - users_table.where(user_type: 6).each_batch(of: 500) do |relation| - orphan_ids = relation.where("not exists(select 1 from members where members.user_id = users.id)").pluck(:id) - - orphan_ids.each_slice(10) do |ids| - users_table.where(id: ids).update_all(state: 'deactivated') - end - - accumulated_orphans += orphan_ids - end - - schedule_deletion(accumulated_orphans) - ensure - 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) - end - - private - - def schedule_deletion(orphan_ids) - return unless deletion_worker - - orphan_ids.each_slice(100) do |ids| - job_arguments = ids.map do |orphan_id| - [orphan_id, orphan_id, { skip_authorization: true }] - end - - deletion_worker.bulk_perform_async(job_arguments) - end - rescue StandardError - # Ignore any errors or interface changes since this part of migration is optional - end - - def deletion_worker - @deletion_worker = "DeleteUserWorker".safe_constantize unless defined?(@deletion_worker) - - @deletion_worker - end -end diff --git a/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb b/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb deleted file mode 100644 index d72866691ff..00000000000 --- a/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForCiBuilds < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - TABLE = :ci_builds - COLUMNS = [:id, :stage_id] - - def up - cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb b/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb deleted file mode 100644 index 42d21806405..00000000000 --- a/db/post_migrate/20210915202900_prepare_index_resource_group_status_commit_id_for_ci_builds.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class PrepareIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id' - - def up - prepare_async_index :ci_builds, [:resource_group_id, :status, :commit_id], - where: 'resource_group_id IS NOT NULL', - name: INDEX_NAME - end - - def down - unprepare_async_index_by_name :ci_builds, INDEX_NAME - end -end diff --git a/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb deleted file mode 100644 index 224d97243c5..00000000000 --- a/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveOldPendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0] - MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid' - NEW_MIGRATION_START_DATE = DateTime.new(2021, 8, 18, 0, 0, 0) - - def up - Gitlab::Database::BackgroundMigrationJob - .for_migration_class(MIGRATION_NAME) - .where('created_at < ?', NEW_MIGRATION_START_DATE) - .where(status: :pending) - .delete_all - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb deleted file mode 100644 index c03c379dcc0..00000000000 --- a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class ReschedulePendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0] - def up - # no-op - # no replacement because we will reschedule this for the whole table - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb b/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb deleted file mode 100644 index 7435a2c889b..00000000000 --- a/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveCiBuildsForeignKeyFromTerraformStateVersions < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:terraform_state_versions, :ci_builds) - end - end - - def down - add_concurrent_foreign_key(:terraform_state_versions, :ci_builds, column: :ci_build_id, on_delete: :nullify) - end -end diff --git a/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb deleted file mode 100644 index 7a6543395ff..00000000000 --- a/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddImageLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_vulnerability_occurrences_on_location_image' - - def up - add_concurrent_index :vulnerability_occurrences, "(location -> 'image')", - using: 'GIN', - where: 'report_type IN (2, 7)', - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME - end -end diff --git a/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb b/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb deleted file mode 100644 index e45d6ed34aa..00000000000 --- a/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class DropInt4ColumnsForCiJobArtifacts < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :ci_job_artifacts, :id_convert_to_bigint, :integer, null: false, default: 0 - remove_column :ci_job_artifacts, :job_id_convert_to_bigint, :integer, null: false, default: 0 - end -end diff --git a/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb b/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb deleted file mode 100644 index b25f1d88736..00000000000 --- a/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class DropInt4ColumnForCiSourcesPipelines < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :ci_sources_pipelines, :source_job_id_convert_to_bigint, :integer - end -end diff --git a/db/post_migrate/20210922082019_drop_int4_column_for_events.rb b/db/post_migrate/20210922082019_drop_int4_column_for_events.rb deleted file mode 100644 index a34d54e11e3..00000000000 --- a/db/post_migrate/20210922082019_drop_int4_column_for_events.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class DropInt4ColumnForEvents < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :events, :id_convert_to_bigint, :integer, null: false, default: 0 - end -end diff --git a/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb b/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb deleted file mode 100644 index 922a9b64b55..00000000000 --- a/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class ConcurrentIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id' - - disable_ddl_transaction! - - # Indexes were pre-created on gitlab.com to avoid slowing down deployments - # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70279 - - # rubocop: disable Migration/PreventIndexCreation - def up - add_concurrent_index :ci_builds, [:resource_group_id, :status, :commit_id], - where: 'resource_group_id IS NOT NULL', - name: INDEX_NAME - end - # rubocop: enable Migration/PreventIndexCreation - - def down - remove_concurrent_index_by_name :ci_builds, INDEX_NAME - end -end diff --git a/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb b/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb deleted file mode 100644 index 5e30ddacc98..00000000000 --- a/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class DropInt4ColumnForPushEventPayloads < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :push_event_payloads, :event_id_convert_to_bigint, :integer, null: false, default: 0 - end -end diff --git a/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb b/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb deleted file mode 100644 index a33885cc87b..00000000000 --- a/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveRedundantTaggingsIndex < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = :index_taggings_on_taggable_id_and_taggable_type - - def up - remove_concurrent_index_by_name :taggings, INDEX_NAME - end - - def down - add_concurrent_index :taggings, [:taggable_id, :taggable_type], name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb deleted file mode 100644 index 531410a91d9..00000000000 --- a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDelayedProjectRemovalFromNamespaces < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_column :namespaces, :delayed_project_removal - end - end - - def down - with_lock_retries do - add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false, if_not_exists: true # rubocop:disable Migration/AddColumnsToWideTables - end - - add_concurrent_index :namespaces, :id, name: 'tmp_idx_on_namespaces_delayed_project_removal', where: 'delayed_project_removal = TRUE' - end -end diff --git a/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb b/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb deleted file mode 100644 index 1da5aad0fab..00000000000 --- a/db/post_migrate/20210923192648_remove_foreign_keys_from_open_project_data_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveForeignKeysFromOpenProjectDataTable < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key :open_project_tracker_data, column: :service_id - end - end - - def down - with_lock_retries do - add_foreign_key :open_project_tracker_data, :integrations, column: :service_id, on_delete: :cascade - end - end -end diff --git a/db/post_migrate/20210923192649_remove_open_project_data_table.rb b/db/post_migrate/20210923192649_remove_open_project_data_table.rb deleted file mode 100644 index 252d7e07261..00000000000 --- a/db/post_migrate/20210923192649_remove_open_project_data_table.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class RemoveOpenProjectDataTable < Gitlab::Database::Migration[1.0] - def up - drop_table :open_project_tracker_data - end - - def down - create_table :open_project_tracker_data do |t| - t.integer :service_id, index: { name: 'index_open_project_tracker_data_on_service_id' }, null: false - t.timestamps_with_timezone - t.string :encrypted_url, limit: 255 - t.string :encrypted_url_iv, limit: 255 - t.string :encrypted_api_url, limit: 255 - t.string :encrypted_api_url_iv, limit: 255 - t.string :encrypted_token, limit: 255 - t.string :encrypted_token_iv, limit: 255 - t.string :closed_status_id, limit: 5 - t.string :project_identifier_code, limit: 100 - end - end -end diff --git a/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb b/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb deleted file mode 100644 index c7b0c7c6d14..00000000000 --- a/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateIssuesRelativePositionIndexes < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - RELATIVE_POSITION_INDEX_NAME = 'idx_issues_on_project_id_and_rel_asc_and_id' - RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_state_id_and_id' - - NEW_RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_id_and_state_id' - - def up - add_concurrent_index :issues, [:project_id, :relative_position, :id, :state_id], name: NEW_RELATIVE_POSITION_STATE_INDEX_NAME - - remove_concurrent_index_by_name :issues, RELATIVE_POSITION_INDEX_NAME - remove_concurrent_index_by_name :issues, RELATIVE_POSITION_STATE_INDEX_NAME - end - - def down - add_concurrent_index :issues, [:project_id, :relative_position, :state_id, :id], order: { id: :desc }, name: RELATIVE_POSITION_STATE_INDEX_NAME - add_concurrent_index :issues, [:project_id, :relative_position, :id], name: RELATIVE_POSITION_INDEX_NAME - - remove_concurrent_index_by_name :issues, NEW_RELATIVE_POSITION_STATE_INDEX_NAME - end -end diff --git a/db/post_migrate/20210930211936_backfill_user_namespace.rb b/db/post_migrate/20210930211936_backfill_user_namespace.rb deleted file mode 100644 index 6d71b09ad63..00000000000 --- a/db/post_migrate/20210930211936_backfill_user_namespace.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class BackfillUserNamespace < Gitlab::Database::Migration[1.0] - MIGRATION = 'BackfillUserNamespace' - INTERVAL = 2.minutes - BATCH_SIZE = 1_000 - SUB_BATCH_SIZE = 200 - DOWNTIME = false - - disable_ddl_transaction! - - def up - queue_batched_background_migration( - MIGRATION, - :namespaces, - :id, - job_interval: INTERVAL, - batch_size: BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE - ) - end - - def down - delete_batched_background_migration(MIGRATION, :namespaces, :id, []) - end -end diff --git a/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb b/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb deleted file mode 100644 index 2c2c3ac00af..00000000000 --- a/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryIndexToIssueMetrics < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit' - - def up - condition = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics - .first_mentioned_in_commit_at_condition - add_concurrent_index :issue_metrics, :issue_id, where: condition, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb b/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb deleted file mode 100644 index ffdb7f80f0e..00000000000 --- a/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class ScheduleFixFirstMentionedInCommitAtJob < Gitlab::Database::Migration[1.0] - MIGRATION = 'FixFirstMentionedInCommitAt' - BATCH_SIZE = 10_000 - INTERVAL = 2.minutes.to_i - - disable_ddl_transaction! - - def up - scope = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics - .from_2020 - - queue_background_migration_jobs_by_range_at_intervals( - scope, - MIGRATION, - INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true, - primary_column_name: :issue_id - ) - end - - def down - # noop - end -end diff --git a/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb b/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb deleted file mode 100644 index d82589efc90..00000000000 --- a/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class RemoveBioHtmlFromUserDetails < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :user_details, :bio_html, :text, null: true - remove_column :user_details, :cached_markdown_version, :integer, null: true - end -end diff --git a/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb b/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb deleted file mode 100644 index f49a0fe2f56..00000000000 --- a/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class RerescheduleDeleteOrphanedDeployments < Gitlab::Database::Migration[1.0] - MIGRATION = 'DeleteOrphanedDeployments' - DELAY_INTERVAL = 2.minutes - - disable_ddl_transaction! - - # This is the third time to schedule `DeleteOrphanedDeployments` migration. - # The first time failed by an inappropriate batch size and the second time failed by a retry bug. - # Since there is no issue in this migration itself, we can simply requeue the - # migration jobs **without** no-op-ing the previous migration. - # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69051#note_669230405 for more information. - def up - delete_queued_jobs(MIGRATION) - - requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb deleted file mode 100644 index 9887752618d..00000000000 --- a/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures < Gitlab::Database::Migration[1.0] - TABLE = "ci_builds" - OLD_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features" - NEW_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_broken" - COLUMNS = %i[name id] - CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, - 'dast'::character varying::text, - 'dependency_scanning'::character varying::text, - 'license_management'::character varying::text, - 'sast'::character varying::text, - 'secret_detection'::character varying::text, - 'coverage_fuzzing'::character varying::text, - 'license_scanning'::character varying::text]) - ) AND type::text = 'Ci::Build'::text" - - enable_lock_retries! - - def up - rename_index(TABLE, OLD_INDEX_NAME, NEW_INDEX_NAME) - prepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME, where: CONSTRAINTS - end - - def down - unprepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME - rename_index(TABLE, NEW_INDEX_NAME, OLD_INDEX_NAME) - end -end diff --git a/db/post_migrate/20211005194425_schedule_requirements_migration.rb b/db/post_migrate/20211005194425_schedule_requirements_migration.rb deleted file mode 100644 index 56211989b8e..00000000000 --- a/db/post_migrate/20211005194425_schedule_requirements_migration.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRequirementsMigration < Gitlab::Database::Migration[1.0] - DOWNTIME = false - - # 2021-10-05 requirements count: ~12500 - # - # Using 30 as batch size and 120 seconds default interval will produce: - # ~420 jobs - taking ~14 hours to perform - BATCH_SIZE = 30 - - MIGRATION = 'MigrateRequirementsToWorkItems' - - disable_ddl_transaction! - - class Requirement < ActiveRecord::Base - include EachBatch - - self.table_name = 'requirements' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Requirement.where(issue_id: nil), - MIGRATION, - 2.minutes, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # NO OP - end -end diff --git a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb deleted file mode 100644 index b14a9ab88b9..00000000000 --- a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class SchedulePopulateTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0] - MIGRATION = 'PopulateTopicsTotalProjectsCountCache' - BATCH_SIZE = 10_000 - DELAY_INTERVAL = 2.minutes - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('topics'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb b/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb deleted file mode 100644 index b046ab6ab03..00000000000 --- a/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class FinalizeIndexesForCiJobArtifactsExpireAtUnlocked < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - TABLE_NAME = 'ci_job_artifacts' - INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx' - - def up - add_concurrent_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME - end -end diff --git a/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb b/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb deleted file mode 100644 index 0185e4cbc5e..00000000000 --- a/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddNamespaceIndexOnTypeSync < Gitlab::Database::Migration[1.0] - FULL_INDEX_NAME = 'index_namespaces_on_type_and_id' - PARTIAL_INDEX_NAME = 'index_namespaces_on_type_and_id_partial' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, [:type, :id], name: FULL_INDEX_NAME - - remove_concurrent_index_by_name :namespaces, name: PARTIAL_INDEX_NAME - end - - def down - add_concurrent_index(:namespaces, [:type, :id], where: 'type IS NOT NULL', name: PARTIAL_INDEX_NAME) - - remove_concurrent_index_by_name :namespaces, name: FULL_INDEX_NAME - end -end diff --git a/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb b/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb deleted file mode 100644 index df0b8ef2a94..00000000000 --- a/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveAnalyticsSnapshotsSegmentIdColumn < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - remove_column :analytics_devops_adoption_snapshots, :segment_id - end - - def down - add_column :analytics_devops_adoption_snapshots, :segment_id, :bigint, after: :id - add_concurrent_foreign_key :analytics_devops_adoption_snapshots, :analytics_devops_adoption_segments, - column: :segment_id, name: 'fk_rails_25da9a92c0', on_delete: :cascade - add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :end_time], name: :index_on_snapshots_segment_id_end_time - add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :recorded_at], name: :index_on_snapshots_segment_id_recorded_at - end -end diff --git a/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb b/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb deleted file mode 100644 index 04af23446fd..00000000000 --- a/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class SchedulePopulateStatusColumnOfSecurityScans < Gitlab::Database::Migration[1.0] - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211011104843_add_new_loose_fk_index.rb b/db/post_migrate/20211011104843_add_new_loose_fk_index.rb deleted file mode 100644 index 710d0917d7f..00000000000 --- a/db/post_migrate/20211011104843_add_new_loose_fk_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddNewLooseFkIndex < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_loading_records' - - def up - add_concurrent_partitioned_index :loose_foreign_keys_deleted_records, - %I[fully_qualified_table_name id primary_key_value partition], - where: 'status = 1', - name: INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME - end -end diff --git a/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb b/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb deleted file mode 100644 index 82a0b1ac9c8..00000000000 --- a/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CleanupDeleteOrphanedDeploymentsBackgroundMigration < Gitlab::Database::Migration[1.0] - MIGRATION = 'DeleteOrphanedDeployments' - - disable_ddl_transaction! - - def up - finalize_background_migration(MIGRATION) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb b/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb deleted file mode 100644 index 882351ab974..00000000000 --- a/db/post_migrate/20211012051221_add_index_btree_namespaces_traversal_ids.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexBtreeNamespacesTraversalIds < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_btree_namespaces_traversal_ids' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :traversal_ids, using: :btree, name: INDEX_NAME - end - - def down - remove_concurrent_index :namespaces, :traversal_ids, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb b/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb deleted file mode 100644 index 80ed834903c..00000000000 --- a/db/post_migrate/20211012143815_remove_merge_request_diff_commit_columns.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class RemoveMergeRequestDiffCommitColumns < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - COLUMNS = %i[author_name author_email committer_name committer_email].freeze - - def change - COLUMNS.each do |column| - remove_column(:merge_request_diff_commits, column, :text) - end - end -end diff --git a/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb b/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb deleted file mode 100644 index e895ab6b9a0..00000000000 --- a/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class RemoveScheduleAndStatusFromPendingAlertEscalations < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - ESCALATIONS_TABLE = :incident_management_pending_alert_escalations - SCHEDULES_TABLE = :incident_management_oncall_schedules - INDEX_NAME = 'index_incident_management_pending_alert_escalations_on_schedule' - CONSTRAINT_NAME = 'fk_rails_fcbfd9338b' - - def up - with_lock_retries do - remove_column ESCALATIONS_TABLE, :schedule_id - remove_column ESCALATIONS_TABLE, :status - end - end - - def down - with_lock_retries do - add_column ESCALATIONS_TABLE, :schedule_id, :bigint unless column_exists?(ESCALATIONS_TABLE, :schedule_id) - add_column ESCALATIONS_TABLE, :status, :smallint unless column_exists?(ESCALATIONS_TABLE, :status) - end - - add_concurrent_partitioned_index ESCALATIONS_TABLE, :schedule_id, name: INDEX_NAME - add_concurrent_partitioned_foreign_key ESCALATIONS_TABLE, SCHEDULES_TABLE, column: :schedule_id, name: CONSTRAINT_NAME - end -end diff --git a/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb deleted file mode 100644 index 2efbfad6c56..00000000000 --- a/db/post_migrate/20211013125341_create_index_security_ci_builds_on_name_and_id_parser_features.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreateIndexSecurityCiBuildsOnNameAndIdParserFeatures < Gitlab::Database::Migration[1.0] - TABLE = "ci_builds" - COLUMNS = %i[name id] - INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features" - CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, - 'dast'::character varying::text, - 'dependency_scanning'::character varying::text, - 'license_management'::character varying::text, - 'sast'::character varying::text, - 'secret_detection'::character varying::text, - 'coverage_fuzzing'::character varying::text, - 'license_scanning'::character varying::text]) - ) AND type::text = 'Ci::Build'::text" - - disable_ddl_transaction! - - def up - add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) - end - - def down - remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) - end -end diff --git a/db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb b/db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb deleted file mode 100644 index b50b7fa21a5..00000000000 --- a/db/post_migrate/20211018101552_add_index_to_tmp_project_id_column_on_namespaces_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToTmpProjectIdColumnOnNamespacesTable < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_index_on_tmp_project_id_on_namespaces' - - def up - add_concurrent_index :namespaces, :tmp_project_id, name: INDEX_NAME, unique: true - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb b/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb deleted file mode 100644 index f2772389d02..00000000000 --- a/db/post_migrate/20211018101852_add_fk_to_tmp_project_id_column_on_namespaces_table.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddFkToTmpProjectIdColumnOnNamespacesTable < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :namespaces, :projects, column: :tmp_project_id - end - - def down - remove_foreign_key :namespaces, column: :tmp_project_id - end -end diff --git a/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb b/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb deleted file mode 100644 index d5fac373ca4..00000000000 --- a/db/post_migrate/20211018102252_add_index_to_group_id_column_on_webhooks_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToGroupIdColumnOnWebhooksTable < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_on_group_id_on_webhooks' - - def up - add_concurrent_index :web_hooks, :group_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :web_hooks, INDEX_NAME - end -end diff --git a/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb b/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb deleted file mode 100644 index 72a5970b6d7..00000000000 --- a/db/post_migrate/20211018123316_remove_not_null_constraint_and_default_for_public_email.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveNotNullConstraintAndDefaultForPublicEmail < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - change_column_null :users, :public_email, true - change_column_default :users, :public_email, from: '', to: nil - end - - def down - # There may now be nulls in the table, so we cannot re-add the constraint here. - change_column_default :users, :public_email, from: nil, to: '' - end -end diff --git a/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb b/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb deleted file mode 100644 index ecad4466c53..00000000000 --- a/db/post_migrate/20211018152654_schedule_remove_duplicate_vulnerabilities_findings3.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRemoveDuplicateVulnerabilitiesFindings3 < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION = 'RemoveDuplicateVulnerabilitiesFindings' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 5_000 - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('vulnerability_occurrences'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb b/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb deleted file mode 100644 index 8014c006f35..00000000000 --- a/db/post_migrate/20211021131217_add_deployments_environment_id_and_ref_index.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddDeploymentsEnvironmentIdAndRefIndex < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_deployments_on_environment_id_and_ref' - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, [:environment_id, :ref], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb b/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb deleted file mode 100644 index 7d0033c0ab9..00000000000 --- a/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class RemoveGeoUploadDeprecatedFields < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_column :geo_event_log, :upload_deleted_event_id, :bigint - end - end - - def down - with_lock_retries do - add_column(:geo_event_log, :upload_deleted_event_id, :bigint) unless column_exists?(:geo_event_log, :upload_deleted_event_id) - end - - add_concurrent_foreign_key :geo_event_log, :geo_upload_deleted_events, - column: :upload_deleted_event_id, - name: 'fk_c1f241c70d', - on_delete: :cascade - - add_concurrent_index :geo_event_log, - :upload_deleted_event_id, - name: 'index_geo_event_log_on_upload_deleted_event_id', - where: "(upload_deleted_event_id IS NOT NULL)" - end -end diff --git a/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb b/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb deleted file mode 100644 index b6987e68fb1..00000000000 --- a/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class DropGeoUploadDeletedEventsTable < Gitlab::Database::Migration[1.0] - def up - drop_table :geo_upload_deleted_events - end - - def down - create_table :geo_upload_deleted_events, id: :bigserial do |t| - t.integer :upload_id, null: false, index: true - t.string :file_path, null: false - t.integer :model_id, null: false - t.string :model_type, null: false - t.string :uploader, null: false - end - end -end diff --git a/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb deleted file mode 100644 index 9c40e81f527..00000000000 --- a/db/post_migrate/20211022112202_add_cluster_id_location_index_to_vulnerability_occurrences.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddClusterIdLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_vulnerability_occurrences_on_location_cluster_id' - - def up - add_concurrent_index :vulnerability_occurrences, "(location -> 'cluster_id')", - using: 'GIN', - where: 'report_type = 7', - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME - end -end diff --git a/db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb b/db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb deleted file mode 100644 index 9ee1b10a072..00000000000 --- a/db/post_migrate/20211022113000_drop_index_security_ci_builds_on_name_and_id_parser_features_broken.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class DropIndexSecurityCiBuildsOnNameAndIdParserFeaturesBroken < Gitlab::Database::Migration[1.0] - TABLE = "ci_builds" - COLUMNS = %i[name id] - INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_broken" - CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, - 'dast'::character varying::text, - 'dependency_scanning'::character varying::text, - 'license_management'::character varying::text, - 'sast'::character varying::text, - 'secret_detection'::character varying::text, - 'coverage_fuzzing'::character varying::text, - 'license_scanning'::character varying::text]) - ) AND type::text = 'Ci::Build'::text" - - disable_ddl_transaction! - - def up - remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) - end - - def down - add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) - end -end diff --git a/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb b/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb deleted file mode 100644 index 5b117f9e4b8..00000000000 --- a/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class RemoveOutdatedFieldsFromGeoNodeStatus < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def change - remove_column :geo_node_statuses, :attachments_count, :integer - remove_column :geo_node_statuses, :attachments_synced_count, :integer - remove_column :geo_node_statuses, :attachments_failed_count, :integer - remove_column :geo_node_statuses, :attachments_synced_missing_on_primary_count, :integer - end -end diff --git a/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb deleted file mode 100644 index 105d5ec98f4..00000000000 --- a/db/post_migrate/20211022214523_schedule_recalculate_vulnerability_finding_signatures_for_findings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0] - MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings' - BATCH_SIZE = 1_000 - DELAY_INTERVAL = 2.minutes - - disable_ddl_transaction! - - def up - # no-op based on https://docs.gitlab.com/ee/development/background_migrations.html#rescheduling-background-migrations - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb b/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb deleted file mode 100644 index e08ad8d89d1..00000000000 --- a/db/post_migrate/20211023102243_schedule_delete_invalid_epic_issues.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDeleteInvalidEpicIssues < Gitlab::Database::Migration[1.0] - # This is a now a no-op - # See https://gitlab.com/gitlab-org/gitlab/-/issues/348477 - - def up - # no-op - end - - def down - # also no-op - end -end diff --git a/db/post_migrate/20211026070408_backfill_issue_search_data.rb b/db/post_migrate/20211026070408_backfill_issue_search_data.rb deleted file mode 100644 index a2cf7b36a59..00000000000 --- a/db/post_migrate/20211026070408_backfill_issue_search_data.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class BackfillIssueSearchData < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION = 'BackfillIssueSearchData' - - def up - queue_batched_background_migration( - MIGRATION, - :issues, - :id, - batch_size: 100_000, - sub_batch_size: 1_000, - job_interval: 5.minutes - ) - end - - def down - delete_batched_background_migration(MIGRATION, :issues, :id, []) - end -end diff --git a/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb b/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb deleted file mode 100644 index 3836159c2cd..00000000000 --- a/db/post_migrate/20211027043206_track_ci_pipeline_deletions.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackCiPipelineDeletions < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:ci_pipelines) - end - - def down - untrack_record_deletions(:ci_pipelines) - end -end diff --git a/db/post_migrate/20211027043229_track_ci_build_deletions.rb b/db/post_migrate/20211027043229_track_ci_build_deletions.rb deleted file mode 100644 index b76d5f3261c..00000000000 --- a/db/post_migrate/20211027043229_track_ci_build_deletions.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackCiBuildDeletions < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:ci_builds) - end - - def down - untrack_record_deletions(:ci_builds) - end -end diff --git a/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb b/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb deleted file mode 100644 index 14cf305fb2e..00000000000 --- a/db/post_migrate/20211027064021_track_deletions_in_ci_runners.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackDeletionsInCiRunners < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:ci_runners) - end - - def down - untrack_record_deletions(:ci_runners) - end -end diff --git a/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb b/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb deleted file mode 100644 index 1c8f9d5196a..00000000000 --- a/db/post_migrate/20211027064156_track_deletions_in_chat_names.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackDeletionsInChatNames < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:chat_names) - end - - def down - untrack_record_deletions(:chat_names) - end -end diff --git a/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb b/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb deleted file mode 100644 index 3447c4da81a..00000000000 --- a/db/post_migrate/20211027112901_drop_index_keys_on_expires_at_and_before_expiry_notification_undelivered.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class DropIndexKeysOnExpiresAtAndBeforeExpiryNotificationUndelivered < Gitlab::Database::Migration[1.0] - DOWNTIME = false - INDEX_NAME = 'index_keys_on_expires_at_and_expiry_notification_undelivered' - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end - - def down - add_concurrent_index :keys, - "date(timezone('UTC', expires_at)), expiry_notification_delivered_at", - where: 'expiry_notification_delivered_at IS NULL', name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb b/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb deleted file mode 100644 index 5e556fe1f32..00000000000 --- a/db/post_migrate/20211027204011_remove_index_for_dormant_users.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexForDormantUsers < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_non_internal_active' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :users, INDEX_NAME - end - - def down - index_condition = "state = 'active' AND (users.user_type IS NULL OR users.user_type IN (NULL, 6, 4))" - - add_concurrent_index :users, [:id, :last_activity_on], where: index_condition, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb b/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb deleted file mode 100644 index 1f03e39aa81..00000000000 --- a/db/post_migrate/20211028085926_add_occurrence_id_id_desc_index_to_vulnerability_occurrence_pipelines.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddOccurrenceIdIdDescIndexToVulnerabilityOccurrencePipelines < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = "index_vulnerability_occurrence_pipelines_occurrence_id_and_id" - - def up - add_concurrent_index( - :vulnerability_occurrence_pipelines, - [:occurrence_id, :id], - order: { id: :desc }, - name: INDEX_NAME - ) - end - - def down - remove_concurrent_index_by_name( - :vulnerability_occurrence_pipelines, - INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb b/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb deleted file mode 100644 index 98984239ca4..00000000000 --- a/db/post_migrate/20211028100303_tmp_index_for_delete_issue_merge_request_taggings_records.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class TmpIndexForDeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_issue_mr' - INDEX_CONDITION = "taggable_type IN ('Issue', 'MergeRequest')" - - def up - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation - end - - def down - remove_concurrent_index_by_name :taggings, INDEX_NAME - end -end diff --git a/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb b/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb deleted file mode 100644 index a53f5a4fc25..00000000000 --- a/db/post_migrate/20211028100843_delete_issue_merge_request_taggings_records.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class DeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_issue_mr' - - BATCH_SIZE = 3_000 - TAGGABLE_TYPES = %w(Issue MergeRequest) - - class Tagging < ActiveRecord::Base - self.table_name = "taggings" - end - - def up - sleep 2 while Tagging.where(taggable_type: TAGGABLE_TYPES).limit(BATCH_SIZE).delete_all > 0 - - remove_concurrent_index_by_name :taggings, INDEX_NAME - end - - def down - end -end diff --git a/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb b/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb deleted file mode 100644 index 03e461dfcd0..00000000000 --- a/db/post_migrate/20211028123412_add_async_index_on_events_using_btree_created_at_id.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddAsyncIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_events_on_created_at_and_id' - TABLE = :events - COLUMNS = %i[created_at id] - CONSTRAINTS = "created_at > '2021-08-27'" - - def up - prepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS - end - - def down - unprepare_async_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS - end -end diff --git a/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb b/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb deleted file mode 100644 index 659cb7b76b2..00000000000 --- a/db/post_migrate/20211028155449_schedule_fix_merge_request_diff_commit_users_migration.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -class ScheduleFixMergeRequestDiffCommitUsersMigration < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION_CLASS = 'FixMergeRequestDiffCommitUsers' - - class Project < ApplicationRecord - include EachBatch - - self.table_name = 'projects' - end - - def up - # This is the day on which we merged - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63669. Since the - # deploy of this MR we may have imported projects using the old format, but - # after their merge_request_diff_id range had been migrated by Sidekiq. As a - # result, there may be rows without a committer_id or commit_author_id - # field. - date = '2021-07-07 00:00:00' - - transaction do - Project.each_batch(of: 10_000) do |batch| - time = Time.now.utc - rows = batch - .where('created_at >= ?', date) - .where(import_type: 'gitlab_project') - .pluck(:id) - .map do |id| - Gitlab::Database::BackgroundMigrationJob.new( - class_name: MIGRATION_CLASS, - arguments: [id], - created_at: time, - updated_at: time - ) - end - - Gitlab::Database::BackgroundMigrationJob - .bulk_insert!(rows, validate: false) - end - end - - job = Gitlab::Database::BackgroundMigrationJob - .for_migration_class(MIGRATION_CLASS) - .pending - .first - - migrate_in(2.minutes, MIGRATION_CLASS, job.arguments) if job - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211029102822_add_open_source_plan.rb b/db/post_migrate/20211029102822_add_open_source_plan.rb deleted file mode 100644 index bb65637ffca..00000000000 --- a/db/post_migrate/20211029102822_add_open_source_plan.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class AddOpenSourcePlan < Gitlab::Database::Migration[1.0] - class Plan < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - has_one :limits, class_name: 'PlanLimits' - - def actual_limits - self.limits || self.build_limits - end - end - - class PlanLimits < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - belongs_to :plan - end - - def create_plan_limits(plan_limit_name, plan) - plan_limit = Plan.find_or_initialize_by(name: plan_limit_name).actual_limits.dup - plan_limit.plan = plan - plan_limit.save! - end - - def up - return unless Gitlab.com? - - opensource = Plan.create!(name: 'opensource', title: 'Open Source Program') - - create_plan_limits('ultimate', opensource) - end - - def down - return unless Gitlab.com? - - Plan.where(name: 'opensource').delete_all - end -end diff --git a/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb b/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb deleted file mode 100644 index 73b70ad1e27..00000000000 --- a/db/post_migrate/20211031152417_add_indexes_to_issue_stage_events.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesToIssueStageEvents < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - GROUP_INDEX_NAME = 'index_issue_stage_events_group_duration' - GROUP_IN_PROGRESS_INDEX_NAME = 'index_issue_stage_events_group_in_progress_duration' - PROJECT_INDEX_NAME = 'index_issue_stage_events_project_duration' - PROJECT_IN_PROGRESS_INDEX_NAME = 'index_issue_stage_events_project_in_progress_duration' - - def up - add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events, - 'stage_event_hash_id, group_id, end_event_timestamp, issue_id, start_event_timestamp', - where: 'end_event_timestamp IS NOT NULL', - name: GROUP_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events, - 'stage_event_hash_id, project_id, end_event_timestamp, issue_id, start_event_timestamp', - where: 'end_event_timestamp IS NOT NULL', - name: PROJECT_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events, - 'stage_event_hash_id, group_id, start_event_timestamp, issue_id', - where: 'end_event_timestamp IS NULL AND state_id = 1', - name: GROUP_IN_PROGRESS_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_issue_stage_events, - 'stage_event_hash_id, project_id, start_event_timestamp, issue_id', - where: 'end_event_timestamp IS NULL AND state_id = 1', - name: PROJECT_IN_PROGRESS_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, GROUP_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, PROJECT_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, GROUP_IN_PROGRESS_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_issue_stage_events, PROJECT_IN_PROGRESS_INDEX_NAME - end -end diff --git a/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb b/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb deleted file mode 100644 index 9cc9d73c968..00000000000 --- a/db/post_migrate/20211031154919_add_indexes_to_merge_request_stage_events.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesToMergeRequestStageEvents < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - GROUP_INDEX_NAME = 'index_merge_request_stage_events_group_duration' - GROUP_IN_PROGRESS_INDEX_NAME = 'index_merge_request_stage_events_group_in_progress_duration' - PROJECT_INDEX_NAME = 'index_merge_request_stage_events_project_duration' - PROJECT_IN_PROGRESS_INDEX_NAME = 'index_merge_request_stage_events_project_in_progress_duration' - - def up - add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events, - 'stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp', - where: 'end_event_timestamp IS NOT NULL', - name: GROUP_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events, - 'stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp', - where: 'end_event_timestamp IS NOT NULL', - name: PROJECT_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events, - 'stage_event_hash_id, group_id, start_event_timestamp, merge_request_id', - where: 'end_event_timestamp IS NULL AND state_id = 1', - name: GROUP_IN_PROGRESS_INDEX_NAME - - add_concurrent_partitioned_index :analytics_cycle_analytics_merge_request_stage_events, - 'stage_event_hash_id, project_id, start_event_timestamp, merge_request_id', - where: 'end_event_timestamp IS NULL AND state_id = 1', - name: PROJECT_IN_PROGRESS_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, GROUP_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, PROJECT_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, GROUP_IN_PROGRESS_INDEX_NAME - remove_concurrent_partitioned_index_by_name :analytics_cycle_analytics_merge_request_stage_events, PROJECT_IN_PROGRESS_INDEX_NAME - end -end diff --git a/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb b/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb deleted file mode 100644 index ded9e717bb1..00000000000 --- a/db/post_migrate/20211101222614_consume_remaining_user_namespace_jobs.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ConsumeRemainingUserNamespaceJobs < Gitlab::Database::Migration[1.0] - MIGRATION = 'BackfillUserNamespace' - BATCH_SIZE = 200 - DEFAULT_VALUE = 'User' - - disable_ddl_transaction! - - def up - Gitlab::BackgroundMigration.steal(MIGRATION) - - # Do a manual update in case we lost BG jobs. The expected record count should be 0 or very low. - define_batchable_model('namespaces').where(type: nil).each_batch(of: BATCH_SIZE) do |batch| - min, max = batch.pluck('MIN(id), MAX(id)').flatten - - Gitlab::BackgroundMigration::BackfillUserNamespace.new.perform(min, max, :namespaces, :id, BATCH_SIZE, 0) - end - - change_column_null :namespaces, :type, false - end - - def down - change_column_null :namespaces, :type, true - end -end diff --git a/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb deleted file mode 100644 index 4aee79950dc..00000000000 --- a/db/post_migrate/20211102103127_add_temp_index_to_vulnerability_occurrences.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTempIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'vulnerability_occurrences_location_temp_index' - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerability_occurrences, :id, where: 'location IS NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb b/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb deleted file mode 100644 index 44e2630af06..00000000000 --- a/db/post_migrate/20211102114802_update_vulnerability_occurrences_location.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateVulnerabilityOccurrencesLocation < Gitlab::Database::Migration[1.0] - BATCH_SIZE = 20_000 - DELAY_INTERVAL = 3.minutes - MIGRATION_NAME = 'UpdateVulnerabilityOccurrencesLocation' - - disable_ddl_transaction! - - def up - return unless Gitlab.ee? - - relation = Gitlab::BackgroundMigration::UpdateVulnerabilityOccurrencesLocation::Occurrence.where(location: nil) - queue_background_migration_jobs_by_range_at_intervals(relation, - MIGRATION_NAME, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb b/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb deleted file mode 100644 index d949641dbce..00000000000 --- a/db/post_migrate/20211103141403_remove_propagate_service_template_worker.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class RemovePropagateServiceTemplateWorker < Gitlab::Database::Migration[1.0] - def up - Sidekiq::Queue.new('propagate_service_template').clear - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb b/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb deleted file mode 100644 index 33d5833db1a..00000000000 --- a/db/post_migrate/20211103162025_add_index_on_events_using_btree_created_at_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnEventsUsingBtreeCreatedAtId < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_events_on_created_at_and_id' - TABLE = :events - COLUMNS = %i[created_at id] - CONSTRAINTS = "created_at > '2021-08-27 00:00:00+00'" - disable_ddl_transaction! - - def up - add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS - end - - def down - remove_concurrent_index TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS - end -end diff --git a/db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb b/db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb deleted file mode 100644 index 00580b2f933..00000000000 --- a/db/post_migrate/20211103184303_drop_runner_features_from_ci_builds_metadata.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class DropRunnerFeaturesFromCiBuildsMetadata < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - remove_column :ci_builds_metadata, :runner_features - end - - def down - add_column :ci_builds_metadata, :runner_features, :jsonb, default: {}, null: false - end -end diff --git a/db/post_migrate/20211104044453_remove_redundant_events_index.rb b/db/post_migrate/20211104044453_remove_redundant_events_index.rb deleted file mode 100644 index 54e71e1b54b..00000000000 --- a/db/post_migrate/20211104044453_remove_redundant_events_index.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class RemoveRedundantEventsIndex < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :events, :index_events_on_target_type_and_target_id - end - - def down - add_concurrent_index :events, [:target_type, :target_id], name: :index_events_on_target_type_and_target_id - end -end diff --git a/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb b/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb deleted file mode 100644 index 1625d24ef92..00000000000 --- a/db/post_migrate/20211104165220_remove_vulnerability_finding_links.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RemoveVulnerabilityFindingLinks < Gitlab::Database::Migration[1.0] - # This migration has been moved to a TRUNCATE in 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/post_migrate/20211105135157_drop_ci_build_trace_sections.rb b/db/post_migrate/20211105135157_drop_ci_build_trace_sections.rb deleted file mode 100644 index 1595068952d..00000000000 --- a/db/post_migrate/20211105135157_drop_ci_build_trace_sections.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -class DropCiBuildTraceSections < Gitlab::Database::Migration[1.0] - include Gitlab::Database::SchemaHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:dep_ci_build_trace_sections, column: :project_id) - end - - with_lock_retries do - remove_foreign_key_if_exists(:dep_ci_build_trace_section_names, column: :project_id) - end - - if table_exists?(:dep_ci_build_trace_sections) - with_lock_retries do - drop_table :dep_ci_build_trace_sections - end - end - - if table_exists?(:dep_ci_build_trace_section_names) - with_lock_retries do - drop_table :dep_ci_build_trace_section_names - end - end - - drop_function('trigger_91dc388a5fe6') - end - - def down - execute(<<~SQL) - CREATE OR REPLACE FUNCTION trigger_91dc388a5fe6() RETURNS trigger - LANGUAGE plpgsql - AS $$ - BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; - END; - $$; - SQL - - execute_in_transaction(<<~SQL, !table_exists?(:dep_ci_build_trace_section_names)) - 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; - - 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 dep_ci_build_trace_section_names ADD CONSTRAINT dep_ci_build_trace_section_names_pkey PRIMARY KEY (id); - SQL - - execute_in_transaction(<<~SQL, !table_exists?(:dep_ci_build_trace_sections)) - CREATE TABLE dep_ci_build_trace_sections ( - project_id integer NOT NULL, - date_start timestamp without time zone NOT NULL, - date_end timestamp without 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 - ); - - ALTER TABLE ONLY dep_ci_build_trace_sections ADD CONSTRAINT ci_build_trace_sections_pkey PRIMARY KEY (build_id, section_name_id); - CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON dep_ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6(); - SQL - - add_concurrent_index :dep_ci_build_trace_section_names, [:project_id, :name], unique: true, name: 'index_dep_ci_build_trace_section_names_on_project_id_and_name' - add_concurrent_index :dep_ci_build_trace_sections, :project_id, name: 'index_dep_ci_build_trace_sections_on_project_id' - add_concurrent_index :dep_ci_build_trace_sections, :section_name_id, name: 'index_dep_ci_build_trace_sections_on_section_name_id' - - add_concurrent_foreign_key :dep_ci_build_trace_sections, :dep_ci_build_trace_section_names, column: :section_name_id, on_delete: :cascade, name: 'fk_264e112c66' - add_concurrent_foreign_key :dep_ci_build_trace_sections, :projects, column: :project_id, on_delete: :cascade, name: 'fk_ab7c104e26' - add_concurrent_foreign_key :dep_ci_build_trace_section_names, :projects, column: :project_id, on_delete: :cascade, name: 'fk_f8cd72cd26' - end - - private - - def execute_in_transaction(sql, condition) - return unless condition - - transaction do - execute(sql) - end - end -end diff --git a/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb b/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb deleted file mode 100644 index ef5a70713d0..00000000000 --- a/db/post_migrate/20211109112454_drop_old_loose_fk_deleted_records_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class DropOldLooseFkDeletedRecordsIndex < Gitlab::Database::Migration[1.0] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_loose_foreign_keys_deleted_records_for_loading_records' - - def up - remove_concurrent_partitioned_index_by_name :loose_foreign_keys_deleted_records, INDEX_NAME - end - - def down - add_concurrent_partitioned_index :loose_foreign_keys_deleted_records, - %I[fully_qualified_table_name id primary_key_value partition], - where: 'status = 1', - name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb b/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb deleted file mode 100644 index bdb8f5cd120..00000000000 --- a/db/post_migrate/20211110143306_add_not_null_constraint_to_security_findings_uuid.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintToSecurityFindingsUuid < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_not_null_constraint( - :security_findings, - :uuid, - validate: false - ) - end - - def down - remove_not_null_constraint( - :security_findings, - :uuid - ) - end -end diff --git a/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb b/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb deleted file mode 100644 index 7bc4af0ec4d..00000000000 --- a/db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryIndexOnSecurityFindingsUuid < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = "tmp_index_uuid_is_null" - - def up - add_concurrent_index( - :security_findings, - :id, - where: "uuid IS NULL", - name: INDEX_NAME - ) - end - - def down - remove_concurrent_index_by_name( - :security_findings, - INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb b/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb deleted file mode 100644 index 98e7b2a8a15..00000000000 --- a/db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDropInvalidSecurityFindings < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION = "DropInvalidSecurityFindings" - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 100_000 - SUB_BATCH_SIZE = 10_000 - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('security_findings').where(uuid: nil), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - other_job_arguments: [SUB_BATCH_SIZE], - track_jobs: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb b/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb deleted file mode 100644 index 19adc6c7084..00000000000 --- a/db/post_migrate/20211112113300_remove_ci_pipeline_chat_data_fk_on_chat_names.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class RemoveCiPipelineChatDataFkOnChatNames < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:ci_pipeline_chat_data, :chat_names, name: "fk_rails_f300456b63") - end - end - - def down - # Remove orphaned rows - execute <<~SQL - DELETE FROM ci_pipeline_chat_data - WHERE - NOT EXISTS (SELECT 1 FROM chat_names WHERE chat_names.id=ci_pipeline_chat_data.chat_name_id) - SQL - - add_concurrent_foreign_key(:ci_pipeline_chat_data, :chat_names, name: "fk_rails_f300456b63", column: :chat_name_id, target_column: :id, on_delete: "cascade") - end -end diff --git a/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb b/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb deleted file mode 100644 index b54edc1cf73..00000000000 --- a/db/post_migrate/20211115151704_add_index_on_projects_import_type_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnProjectsImportTypeId < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_imported_projects_on_import_type_id' - - def up - add_concurrent_index(:projects, [:import_type, :id], where: 'import_type IS NOT NULL', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:projects, INDEX_NAME) - end -end diff --git a/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb b/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb deleted file mode 100644 index 468b26e9eb1..00000000000 --- a/db/post_migrate/20211116091751_change_namespace_type_default_to_user.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ChangeNamespaceTypeDefaultToUser < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - change_column_default :namespaces, :type, 'User' - end - end - - def down - with_lock_retries do - change_column_default :namespaces, :type, nil - end - end -end diff --git a/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb b/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb deleted file mode 100644 index 0424d32a81e..00000000000 --- a/db/post_migrate/20211116111644_schedule_remove_occurrence_pipelines_and_duplicate_vulnerabilities_findings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings < Gitlab::Database::Migration[1.0] - MIGRATION = 'RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 10_000 - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('vulnerability_occurrences'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb b/db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb deleted file mode 100644 index ae9dba32a4a..00000000000 --- a/db/post_migrate/20211117084814_migrate_remaining_u2f_registrations.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class MigrateRemainingU2fRegistrations < Gitlab::Database::Migration[1.0] - BATCH_SIZE = 100 - - disable_ddl_transaction! - - def up - # We expect only a few number of records satisfying these conditions. - # on gitlab.com database, this number is 70 as on 17th Nov, 2021. - define_batchable_model('u2f_registrations') - .joins("LEFT JOIN webauthn_registrations ON webauthn_registrations.u2f_registration_id = u2f_registrations.id") - .where(webauthn_registrations: { u2f_registration_id: nil }) - .each_batch(of: BATCH_SIZE) do |batch, index| - batch.each do |record| - Gitlab::BackgroundMigration::MigrateU2fWebauthn.new.perform(record.id, record.id) - rescue StandardError => e - Gitlab::ErrorTracking.track_exception(e, u2f_registration_id: record.id) - end - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb b/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb deleted file mode 100644 index 5eb532f2a00..00000000000 --- a/db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class DropPagesDeploymentsBuildsFk < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - FK_NAME = 'fk_rails_c3a90cf29b' - - def up - remove_foreign_key_if_exists(:pages_deployments, :ci_builds, name: FK_NAME) - end - - def down - add_concurrent_foreign_key( - :pages_deployments, - :ci_builds, - name: FK_NAME, - column: :ci_build_id, - target_column: :id, - on_delete: :nullify - ) - end -end diff --git a/db/post_migrate/20211118194239_drop_invalid_remediations.rb b/db/post_migrate/20211118194239_drop_invalid_remediations.rb deleted file mode 100644 index 93edde87936..00000000000 --- a/db/post_migrate/20211118194239_drop_invalid_remediations.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class DropInvalidRemediations < Gitlab::Database::Migration[1.0] - BATCH_SIZE = 3_000 - DELAY_INTERVAL = 3.minutes - MIGRATION_NAME = 'DropInvalidRemediations' - DAY_PRIOR_TO_BUG_INTRODUCTION = DateTime.new(2021, 8, 1, 0, 0, 0) - - disable_ddl_transaction! - - def up - return unless Gitlab.ee? - - relation = Gitlab::BackgroundMigration::DropInvalidRemediations::FindingRemediation.where("created_at > ?", DAY_PRIOR_TO_BUG_INTRODUCTION) - queue_background_migration_jobs_by_range_at_intervals(relation, - MIGRATION_NAME, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb b/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb deleted file mode 100644 index 3eccbb1b3a4..00000000000 --- a/db/post_migrate/20211119085036_add_text_limit_to_job_artifact_original_filename.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToJobArtifactOriginalFilename < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - add_text_limit :ci_job_artifacts, :original_filename, 512 - end - - def down - remove_text_limit :ci_job_artifacts, :original_filename - end -end diff --git a/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb b/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb deleted file mode 100644 index 517e0f08d6a..00000000000 --- a/db/post_migrate/20211122033501_improve_index_on_events_for_calendar.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ImproveIndexOnEventsForCalendar < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at' - - def up - prepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME - end - - def down - unprepare_async_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME - end -end diff --git a/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb b/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb deleted file mode 100644 index df4867d6ae7..00000000000 --- a/db/post_migrate/20211122193948_cleanup_background_migration_of_requirements_to_work_items.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupBackgroundMigrationOfRequirementsToWorkItems < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION = 'MigrateRequirementsToWorkItems' - - disable_ddl_transaction! - - def up - finalize_background_migration(MIGRATION) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb b/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb deleted file mode 100644 index 599342e83e3..00000000000 --- a/db/post_migrate/20211123161906_cleanup_after_drop_invalid_security_findings.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CleanupAfterDropInvalidSecurityFindings < Gitlab::Database::Migration[1.0] - MIGRATION = "DropInvalidSecurityFindings" - INDEX_NAME = "tmp_index_uuid_is_null" - - disable_ddl_transaction! - - def up - # Make sure all jobs scheduled by - # db/post_migrate/20211110151350_schedule_drop_invalid_security_findings.rb - # are finished - finalize_background_migration(MIGRATION) - # Created by db/post_migrate/20211110151320_add_temporary_index_on_security_findings_uuid.rb - remove_concurrent_index_by_name :security_findings, INDEX_NAME - end - - def down - add_concurrent_index( - :security_findings, - :id, - where: "uuid IS NULL", - name: INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20211124132705_change_index_users_on_public_email.rb b/db/post_migrate/20211124132705_change_index_users_on_public_email.rb deleted file mode 100644 index 6e74a325033..00000000000 --- a/db/post_migrate/20211124132705_change_index_users_on_public_email.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class ChangeIndexUsersOnPublicEmail < Gitlab::Database::Migration[1.0] - INDEX_NAME = 'index_users_on_public_email' - INDEX_EXCLUDING_NULL_NAME = 'index_users_on_public_email_excluding_null_and_empty' - - disable_ddl_transaction! - - def up - index_condition = "public_email != '' AND public_email IS NOT NULL" - - add_concurrent_index :users, [:public_email], where: index_condition, name: INDEX_EXCLUDING_NULL_NAME - remove_concurrent_index_by_name :users, INDEX_NAME - end - - def down - index_condition = "public_email != ''" - - add_concurrent_index :users, [:public_email], where: index_condition, name: INDEX_NAME - remove_concurrent_index_by_name :users, INDEX_EXCLUDING_NULL_NAME - end -end diff --git a/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb b/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb deleted file mode 100644 index 5cc78fc75c4..00000000000 --- a/db/post_migrate/20211125120444_add_index_todos_project_id_user_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexTodosProjectIdUserId < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_todos_on_project_id_and_user_id_and_id' - - def up - add_concurrent_index :todos, [:project_id, :user_id, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :todos, INDEX_NAME - end -end diff --git a/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb b/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb deleted file mode 100644 index 420bfb8bcbc..00000000000 --- a/db/post_migrate/20211130165043_backfill_sequence_column_for_sprints_table.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class BackfillSequenceColumnForSprintsTable < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - execute( - <<-SQL - UPDATE sprints - SET sequence=t.row_number - FROM ( - SELECT id, row_number() OVER (PARTITION BY iterations_cadence_id ORDER BY start_date) - FROM sprints as s1 - WHERE s1.iterations_cadence_id IS NOT NULL - ) as t - WHERE t.id=sprints.id AND (sprints.sequence IS NULL OR sprints.sequence <> t.row_number) - SQL - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb b/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb deleted file mode 100644 index e688e0b467d..00000000000 --- a/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackDeletionsInNamespaces < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:namespaces) - end - - def down - untrack_record_deletions(:namespaces) - end -end diff --git a/db/post_migrate/20211130201101_track_deletions_in_projects.rb b/db/post_migrate/20211130201101_track_deletions_in_projects.rb deleted file mode 100644 index dfe7ab4c037..00000000000 --- a/db/post_migrate/20211130201101_track_deletions_in_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class TrackDeletionsInProjects < Gitlab::Database::Migration[1.0] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - track_record_deletions(:projects) - end - - def down - untrack_record_deletions(:projects) - end -end diff --git a/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb b/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb deleted file mode 100644 index 9a02f64e350..00000000000 --- a/db/post_migrate/20211201101541_drop_clusters_applications_runners_ci_runners_fk.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class DropClustersApplicationsRunnersCiRunnersFk < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36') - end - end - - def down - add_concurrent_foreign_key(:clusters_applications_runners, :ci_runners, name: 'fk_02de2ded36', column: :runner_id, target_column: :id, on_delete: 'set null') - end -end diff --git a/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb b/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb deleted file mode 100644 index 3dfa44f9615..00000000000 --- a/db/post_migrate/20221021082255_add_unique_index_on_ci_runners_token.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexOnCiRunnersToken < Gitlab::Database::Migration[2.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_uniq_ci_runners_on_token' - - def up - finalize_background_migration 'ResetDuplicateCiRunnersTokenValues' - - add_concurrent_index :ci_runners, - :token, - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb b/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb new file mode 100644 index 00000000000..4e6195bb3c8 --- /dev/null +++ b/db/post_migrate/20221021082256_finish_reset_duplicate_ci_runners_token_values.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinishResetDuplicateCiRunnersTokenValues < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'ResetDuplicateCiRunnersTokenValues', + table_name: :ci_runners, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb b/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb new file mode 100644 index 00000000000..3858c0efe06 --- /dev/null +++ b/db/post_migrate/20221021082257_add_unique_index_on_ci_runners_token.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnCiRunnersToken < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_uniq_ci_runners_on_token' + + def up + add_concurrent_index :ci_runners, + :token, + name: INDEX_NAME, + unique: true + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb deleted file mode 100644 index 8728c0ff20e..00000000000 --- a/db/post_migrate/20221021082312_add_unique_index_on_ci_runners_token_encrypted.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexOnCiRunnersTokenEncrypted < Gitlab::Database::Migration[2.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_uniq_ci_runners_on_token_encrypted' - - def up - finalize_background_migration 'ResetDuplicateCiRunnersTokenEncryptedValues' - - add_concurrent_index :ci_runners, - :token_encrypted, - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb b/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb new file mode 100644 index 00000000000..ba08322b1ff --- /dev/null +++ b/db/post_migrate/20221021082313_finish_reset_duplicate_ci_runners_token_encrypted_values.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinishResetDuplicateCiRunnersTokenEncryptedValues < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'ResetDuplicateCiRunnersTokenEncryptedValues', + table_name: :ci_runners, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb b/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb new file mode 100644 index 00000000000..12fc6a72e84 --- /dev/null +++ b/db/post_migrate/20221021082314_add_unique_index_on_ci_runners_token_encrypted.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnCiRunnersTokenEncrypted < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_uniq_ci_runners_on_token_encrypted' + + def up + add_concurrent_index :ci_runners, + :token_encrypted, + name: INDEX_NAME, + unique: true + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/post_migrate/20221117135032_remove_clusters_applications_job_instances.rb b/db/post_migrate/20221117135032_remove_clusters_applications_job_instances.rb index 1bc80271ff7..80cd00e7737 100644 --- a/db/post_migrate/20221117135032_remove_clusters_applications_job_instances.rb +++ b/db/post_migrate/20221117135032_remove_clusters_applications_job_instances.rb @@ -12,6 +12,8 @@ class RemoveClustersApplicationsJobInstances < Gitlab::Database::Migration[2.0] ClusterWaitForIngressIpAddressWorker ] + disable_ddl_transaction! + def up sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) end diff --git a/db/post_migrate/20221228103133_queue_backfill_admin_mode_scope_for_personal_access_tokens.rb b/db/post_migrate/20221228103133_queue_backfill_admin_mode_scope_for_personal_access_tokens.rb index c111d5090e1..577d55f4df6 100644 --- a/db/post_migrate/20221228103133_queue_backfill_admin_mode_scope_for_personal_access_tokens.rb +++ b/db/post_migrate/20221228103133_queue_backfill_admin_mode_scope_for_personal_access_tokens.rb @@ -1,21 +1,11 @@ # frozen_string_literal: true class QueueBackfillAdminModeScopeForPersonalAccessTokens < Gitlab::Database::Migration[2.1] - MIGRATION = 'BackfillAdminModeScopeForPersonalAccessTokens' - DELAY_INTERVAL = 2.minutes - restrict_gitlab_migration gitlab_schema: :gitlab_main - def up - queue_batched_background_migration( - MIGRATION, - :personal_access_tokens, - :id, - job_interval: DELAY_INTERVAL - ) - end + # no-op as the original migration is rescheduled + # in migrations version 20230406093640 + def up; end - def down - delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, []) - end + def down; end end diff --git a/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb b/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb new file mode 100644 index 00000000000..19020fecad5 --- /dev/null +++ b/db/post_migrate/20230113201308_backfill_namespace_ldap_settings.rb @@ -0,0 +1,33 @@ +# 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 BackfillNamespaceLdapSettings < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + DOWNTIME = false + MIGRATION = 'BackfillNamespaceLdapSettings' + TABLE_NAME = 'namespaces' + PRIMARY_KEY = :id + INTERVAL = 2.minutes + + def up + queue_batched_background_migration( + MIGRATION, + TABLE_NAME, + PRIMARY_KEY, + job_interval: INTERVAL + ) + end + + def down + delete_batched_background_migration( + MIGRATION, + TABLE_NAME, + PRIMARY_KEY, + [] + ) + end +end diff --git a/db/post_migrate/20230118144623_schedule_migration_for_remediation.rb b/db/post_migrate/20230118144623_schedule_migration_for_remediation.rb new file mode 100644 index 00000000000..ed95ecfaad3 --- /dev/null +++ b/db/post_migrate/20230118144623_schedule_migration_for_remediation.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ScheduleMigrationForRemediation < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'MigrateRemediationsForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 5000 + + def up + # no-op as described in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html + end + + def down + # no-op as described in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html + end +end diff --git a/db/post_migrate/20230125195503_queue_backfill_compliance_violations.rb b/db/post_migrate/20230125195503_queue_backfill_compliance_violations.rb new file mode 100644 index 00000000000..5f797421bd5 --- /dev/null +++ b/db/post_migrate/20230125195503_queue_backfill_compliance_violations.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class QueueBackfillComplianceViolations < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillComplianceViolations' + INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :merge_requests_compliance_violations, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :merge_requests_compliance_violations, :id, []) + end +end diff --git a/db/post_migrate/20230126101907_add_partition_index_to_web_hook_logs.rb b/db/post_migrate/20230126101907_add_partition_index_to_web_hook_logs.rb new file mode 100644 index 00000000000..4196767033c --- /dev/null +++ b/db/post_migrate/20230126101907_add_partition_index_to_web_hook_logs.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddPartitionIndexToWebHookLogs < 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 + add_concurrent_partitioned_index( + :web_hook_logs, + [:web_hook_id, :created_at], + name: INDEX_NAME + ) + end + + def down + remove_concurrent_partitioned_index_by_name :web_hook_logs, INDEX_NAME + end +end diff --git a/db/post_migrate/20230130182412_schedule_create_vulnerability_links_migration.rb b/db/post_migrate/20230130182412_schedule_create_vulnerability_links_migration.rb new file mode 100644 index 00000000000..a1162ce98d5 --- /dev/null +++ b/db/post_migrate/20230130182412_schedule_create_vulnerability_links_migration.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleCreateVulnerabilityLinksMigration < Gitlab::Database::Migration[2.1] + MIGRATION = 'CreateVulnerabilityLinks' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 250 + SUB_BATCH_SIZE = 5 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerability_feedback, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_feedback, :id, []) + end +end diff --git a/db/post_migrate/20230131184319_update_billable_users_index_for_service_accounts.rb b/db/post_migrate/20230131184319_update_billable_users_index_for_service_accounts.rb new file mode 100644 index 00000000000..e86a2476156 --- /dev/null +++ b/db/post_migrate/20230131184319_update_billable_users_index_for_service_accounts.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class UpdateBillableUsersIndexForServiceAccounts < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + OLD_INDEX = 'index_users_for_billable_users' + NEW_INDEX = 'index_users_for_active_billable_users' + + OLD_INDEX_CONDITION = <<~QUERY + ((state)::text = 'active'::text) AND ((user_type IS NULL) + OR (user_type = ANY (ARRAY[6, 4]))) AND + ((user_type IS NULL) OR (user_type = ANY (ARRAY[4, 5]))) + QUERY + NEW_INDEX_CONDITION = <<~QUERY + state = 'active' AND (user_type IS NULL OR user_type IN (6, 4, 13)) AND (user_type IS NULL OR user_type IN (4, 5)) + QUERY + + def up + add_concurrent_index(:users, :id, where: NEW_INDEX_CONDITION, name: NEW_INDEX) + remove_concurrent_index_by_name(:users, OLD_INDEX) + end + + def down + add_concurrent_index(:users, :id, where: OLD_INDEX_CONDITION, name: OLD_INDEX) + remove_concurrent_index_by_name(:users, NEW_INDEX) + 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 index 57364e2200b..13e49ca087d 100644 --- a/db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb +++ b/db/post_migrate/20230131194959_remove_invalid_deploy_access_level.rb @@ -3,20 +3,11 @@ 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 + # no-op, moved to 20230322151605_rerun_remove_invalid_deploy_access_level.rb 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/20230202135758_queue_backfill_prepared_at_data.rb b/db/post_migrate/20230202135758_queue_backfill_prepared_at_data.rb new file mode 100644 index 00000000000..227b469b625 --- /dev/null +++ b/db/post_migrate/20230202135758_queue_backfill_prepared_at_data.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class QueueBackfillPreparedAtData < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillPreparedAtMergeRequests' + DELAY_INTERVAL = 2.minutes + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :merge_requests, + :id, + job_interval: DELAY_INTERVAL, + batch_size: 5000, + sub_batch_size: 250 + ) + end + + def down + delete_batched_background_migration(MIGRATION, :merge_requests, :id, []) + end +end diff --git a/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb b/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb new file mode 100644 index 00000000000..e1d3787cbb3 --- /dev/null +++ b/db/post_migrate/20230202211434_migrate_redis_slot_keys.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +class MigrateRedisSlotKeys < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + BackupHLLRedisCounter.known_events.each do |event| + if event[:aggregation].to_sym == :daily + migrate_daily_aggregated(event) + else + migrate_weekly_aggregated(event) + end + end + end + + def down + # no-op + end + + private + + def migrate_daily_aggregated(event) + days_back = BackupHLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH + start_date = Date.today - days_back - 1.day + end_date = Date.today + 1.day + + (start_date..end_date).each do |date| + rename_key(event, date) + end + end + + def migrate_weekly_aggregated(event) + weeks_back = BackupHLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH + start_date = (Date.today - weeks_back).beginning_of_week - 1.day + end_date = Date.today.end_of_week + 1.day + + (start_date..end_date).each { |date| rename_key(event, date) } + end + + def rename_key(event, date) + old_key = old_redis_key(event, date) + new_key = BackupHLLRedisCounter.redis_key(event, date) + + # cannot simply rename due to different slots + Gitlab::Redis::SharedState.with do |r| + break unless r.exists?(old_key) + + Gitlab::Redis::HLL.add( + key: new_key, + value: r.pfcount(old_key), + expiry: r.ttl(old_key) + ) + end + end + + def old_redis_key(event, time) + name_with_slot = if event[:redis_slot].present? + event[:name].to_s.gsub(event[:redis_slot], "{#{event[:redis_slot]}}") + else + "{#{event[:name]}}" + end + + BackupHLLRedisCounter.apply_time_aggregation(name_with_slot, time, event) + end + + # :nocov: Existing backed up class # rubocop:disable Gitlab/NoCodeCoverageComment + module BackupHLLRedisCounter + DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH = 6.weeks + DEFAULT_DAILY_KEY_EXPIRY_LENGTH = 29.days + REDIS_SLOT = 'hll_counters' + + KNOWN_EVENTS_PATH = File.expand_path('known_events/*.yml', __dir__) + ALLOWED_AGGREGATIONS = %i[daily weekly].freeze + + class << self + def known_events + @known_events ||= load_events(KNOWN_EVENTS_PATH) + end + + def load_events(wildcard) + Dir[wildcard].each_with_object([]) do |path, events| + events.push(*load_yaml_from_path(path)) + end + end + + def load_yaml_from_path(path) + YAML.safe_load(File.read(path))&.map(&:with_indifferent_access) + end + + def known_events_names + known_events.map { |event| event[:name] } # rubocop:disable Rails/Pluck + end + + def redis_key(event, time, context = '') + key = "{#{REDIS_SLOT}}_#{event[:name]}" + key = apply_time_aggregation(key, time, event) + key = "#{context}_#{key}" if context.present? + key + end + + def apply_time_aggregation(key, time, event) + if event[:aggregation].to_sym == :daily + year_day = time.strftime('%G-%j') + "#{year_day}-#{key}" + else + year_week = time.strftime('%G-%V') + "#{key}-#{year_week}" + end + end + end + end + # :nocov: # rubocop:disable Gitlab/NoCodeCoverageComment +end diff --git a/db/post_migrate/20230208125736_schedule_migration_for_links.rb b/db/post_migrate/20230208125736_schedule_migration_for_links.rb new file mode 100644 index 00000000000..78b83bbb502 --- /dev/null +++ b/db/post_migrate/20230208125736_schedule_migration_for_links.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ScheduleMigrationForLinks < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'MigrateLinksForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 10000 + + def up + # no-op as it is rescheduled via db/post_migrate/20230314144640_reschedule_migration_for_links.rb + end + + def down + # no-op as it is rescheduled via db/post_migrate/20230314144640_reschedule_migration_for_links.rb + end +end diff --git a/db/post_migrate/20230209222452_schedule_remove_project_group_link_with_missing_groups.rb b/db/post_migrate/20230209222452_schedule_remove_project_group_link_with_missing_groups.rb new file mode 100644 index 00000000000..b7dd81267d7 --- /dev/null +++ b/db/post_migrate/20230209222452_schedule_remove_project_group_link_with_missing_groups.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleRemoveProjectGroupLinkWithMissingGroups < Gitlab::Database::Migration[2.1] + MIGRATION = 'RemoveProjectGroupLinkWithMissingGroups' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :project_group_links, + :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, :project_group_links, :id, []) + end +end diff --git a/db/post_migrate/20230213103019_add_index_for_next_over_limit_check_at.rb b/db/post_migrate/20230213103019_add_index_for_next_over_limit_check_at.rb new file mode 100644 index 00000000000..29c59cea3ff --- /dev/null +++ b/db/post_migrate/20230213103019_add_index_for_next_over_limit_check_at.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexForNextOverLimitCheckAt < Gitlab::Database::Migration[2.1] + TABLE_NAME = 'namespace_details' + INDEX_NAME = 'index_next_over_limit_check_at_asc_order' + + def up + prepare_async_index TABLE_NAME, + :next_over_limit_check_at, + order: { next_over_limit_check_at: 'ASC NULLS FIRST' }, + name: INDEX_NAME + end + + def down + unprepare_async_index TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20230214181633_finalize_ci_build_needs_big_int_conversion.rb b/db/post_migrate/20230214181633_finalize_ci_build_needs_big_int_conversion.rb new file mode 100644 index 00000000000..63b6148df6b --- /dev/null +++ b/db/post_migrate/20230214181633_finalize_ci_build_needs_big_int_conversion.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class FinalizeCiBuildNeedsBigIntConversion < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + TABLE_NAME = 'ci_build_needs' + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down; end + + private + + def should_run? + !Gitlab.jh? && (Gitlab.com? || Gitlab.dev_or_test_env?) + end +end diff --git a/db/post_migrate/20230215213349_add_sync_index_on_packages_package_file_filename.rb b/db/post_migrate/20230215213349_add_sync_index_on_packages_package_file_filename.rb new file mode 100644 index 00000000000..9a2e7abbbc1 --- /dev/null +++ b/db/post_migrate/20230215213349_add_sync_index_on_packages_package_file_filename.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddSyncIndexOnPackagesPackageFileFilename < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_packages_package_files_on_file_name' + + disable_ddl_transaction! + + def up + add_concurrent_index( + :packages_package_files, + :file_name, + name: INDEX_NAME, + using: :gin, + opclass: { description: :gin_trgm_ops } + ) + end + + def down + remove_concurrent_index_by_name :packages_package_files, INDEX_NAME + end +end diff --git a/db/post_migrate/20230216060333_prepare_async_foreign_key_validation_for_ci_build_trace_metadata.rb b/db/post_migrate/20230216060333_prepare_async_foreign_key_validation_for_ci_build_trace_metadata.rb new file mode 100644 index 00000000000..1d5999acc61 --- /dev/null +++ b/db/post_migrate/20230216060333_prepare_async_foreign_key_validation_for_ci_build_trace_metadata.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncForeignKeyValidationForCiBuildTraceMetadata < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_trace_metadata + COLUMN_NAMES = [:partition_id, :build_id] + FOREIGN_KEY_NAME = :fk_rails_aebc78111f_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/20230216191507_delete_incorrectly_onboarded_namespaces.rb b/db/post_migrate/20230216191507_delete_incorrectly_onboarded_namespaces.rb new file mode 100644 index 00000000000..5da485fd442 --- /dev/null +++ b/db/post_migrate/20230216191507_delete_incorrectly_onboarded_namespaces.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DeleteIncorrectlyOnboardedNamespaces < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # Changed to a no-op, this migration was reverted after + # an incident during a deploy to production on gitlab.com + # https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8436 + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230216222956_add_sync_index_on_lfs_objects_file.rb b/db/post_migrate/20230216222956_add_sync_index_on_lfs_objects_file.rb new file mode 100644 index 00000000000..8eda3345713 --- /dev/null +++ b/db/post_migrate/20230216222956_add_sync_index_on_lfs_objects_file.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddSyncIndexOnLfsObjectsFile < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_lfs_objects_on_file' + + disable_ddl_transaction! + + def up + add_concurrent_index :lfs_objects, :file, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :lfs_objects, INDEX_NAME + end +end diff --git a/db/post_migrate/20230216232404_add_sync_index_on_merge_request_diffs_external_diff.rb b/db/post_migrate/20230216232404_add_sync_index_on_merge_request_diffs_external_diff.rb new file mode 100644 index 00000000000..2f9b12f89c1 --- /dev/null +++ b/db/post_migrate/20230216232404_add_sync_index_on_merge_request_diffs_external_diff.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddSyncIndexOnMergeRequestDiffsExternalDiff < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_merge_request_diffs_on_external_diff' + + disable_ddl_transaction! + + def up + add_concurrent_index :merge_request_diffs, :external_diff, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_diffs, INDEX_NAME + end +end diff --git a/db/post_migrate/20230216233937_remove_application_settings_send_user_confirmation_email_column.rb b/db/post_migrate/20230216233937_remove_application_settings_send_user_confirmation_email_column.rb new file mode 100644 index 00000000000..d7720ebccbd --- /dev/null +++ b/db/post_migrate/20230216233937_remove_application_settings_send_user_confirmation_email_column.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RemoveApplicationSettingsSendUserConfirmationEmailColumn < Gitlab::Database::Migration[2.1] + def change + remove_column :application_settings, :send_user_confirmation_email, :boolean, default: false + end +end diff --git a/db/post_migrate/20230218145930_add_index_users_on_updated_at.rb b/db/post_migrate/20230218145930_add_index_users_on_updated_at.rb new file mode 100644 index 00000000000..229c3e1babd --- /dev/null +++ b/db/post_migrate/20230218145930_add_index_users_on_updated_at.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexUsersOnUpdatedAt < Gitlab::Database::Migration[2.1] + TABLE_NAME = 'users' + INDEX_NAME = 'index_users_on_updated_at' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE_NAME, :updated_at, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20230218145940_add_index_namespaces_on_updated_at.rb b/db/post_migrate/20230218145940_add_index_namespaces_on_updated_at.rb new file mode 100644 index 00000000000..cbad26fb142 --- /dev/null +++ b/db/post_migrate/20230218145940_add_index_namespaces_on_updated_at.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexNamespacesOnUpdatedAt < Gitlab::Database::Migration[2.1] + TABLE_NAME = 'namespaces' + INDEX_NAME = 'index_namespaces_on_updated_at' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE_NAME, :updated_at, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20230218152729_validate_fk_on_ci_job_artifacts_partition_id_and_job_id.rb b/db/post_migrate/20230218152729_validate_fk_on_ci_job_artifacts_partition_id_and_job_id.rb new file mode 100644 index 00000000000..9a9cb0d9487 --- /dev/null +++ b/db/post_migrate/20230218152729_validate_fk_on_ci_job_artifacts_partition_id_and_job_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiJobArtifactsPartitionIdAndJobId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_job_artifacts + FK_NAME = :fk_rails_c5137cb2c1_p + COLUMNS = [:partition_id, :job_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/20230218152730_remove_fk_to_ci_builds_ci_job_artifacts_on_job_id.rb b/db/post_migrate/20230218152730_remove_fk_to_ci_builds_ci_job_artifacts_on_job_id.rb new file mode 100644 index 00000000000..02747d57eab --- /dev/null +++ b/db/post_migrate/20230218152730_remove_fk_to_ci_builds_ci_job_artifacts_on_job_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiJobArtifactsOnJobId < 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 + + 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/20230219191034_add_pipeline_fk_to_vulnerability_state_transitions.rb b/db/post_migrate/20230219191034_add_pipeline_fk_to_vulnerability_state_transitions.rb new file mode 100644 index 00000000000..5c09c75861a --- /dev/null +++ b/db/post_migrate/20230219191034_add_pipeline_fk_to_vulnerability_state_transitions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPipelineFkToVulnerabilityStateTransitions < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_state_transitions_on_pipeline_id' + + def up + add_concurrent_index :vulnerability_state_transitions, :state_changed_at_pipeline_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_state_transitions, INDEX_NAME + end +end diff --git a/db/post_migrate/20230220102212_swap_columns_ci_build_needs_big_int_conversion.rb b/db/post_migrate/20230220102212_swap_columns_ci_build_needs_big_int_conversion.rb new file mode 100644 index 00000000000..de98847fad4 --- /dev/null +++ b/db/post_migrate/20230220102212_swap_columns_ci_build_needs_big_int_conversion.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class SwapColumnsCiBuildNeedsBigIntConversion < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = 'ci_build_needs' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + private + + def should_run? + !Gitlab.jh? && (Gitlab.com? || Gitlab.dev_or_test_env?) + end + + def swap + add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: + 'index_ci_build_needs_on_id_convert_to_bigint' + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + id_name = quote_column_name(:id) + temp_name = quote_column_name('id_tmp') + 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: Ci::ApplicationRecord.connection + ).name( + :id, :id_convert_to_bigint + ) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute "ALTER SEQUENCE ci_build_needs_id_seq OWNED BY #{TABLE_NAME}.id" + change_column_default TABLE_NAME, :id, -> { "nextval('ci_build_needs_id_seq'::regclass)" } + change_column_default TABLE_NAME, :id_convert_to_bigint, 0 + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_build_needs_pkey CASCADE" + rename_index TABLE_NAME, 'index_ci_build_needs_on_id_convert_to_bigint', 'ci_build_needs_pkey' + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY USING INDEX ci_build_needs_pkey" + end + end +end diff --git a/db/post_migrate/20230220112930_replace_uniq_index_on_postgres_async_foreign_key_validations.rb b/db/post_migrate/20230220112930_replace_uniq_index_on_postgres_async_foreign_key_validations.rb new file mode 100644 index 00000000000..1adc275e1e9 --- /dev/null +++ b/db/post_migrate/20230220112930_replace_uniq_index_on_postgres_async_foreign_key_validations.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ReplaceUniqIndexOnPostgresAsyncForeignKeyValidations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + NEW_INDEX_NAME = 'unique_postgres_async_fk_validations_name_and_table_name' + OLD_INDEX_NAME = 'index_postgres_async_foreign_key_validations_on_name' + TABLE_NAME = 'postgres_async_foreign_key_validations' + + def up + add_concurrent_index TABLE_NAME, [:name, :table_name], unique: true, name: NEW_INDEX_NAME + remove_concurrent_index_by_name TABLE_NAME, OLD_INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :name, unique: true, name: OLD_INDEX_NAME + remove_concurrent_index_by_name TABLE_NAME, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20230220132409_validate_fk_on_ci_build_report_results_partition_id_and_build_id.rb b/db/post_migrate/20230220132409_validate_fk_on_ci_build_report_results_partition_id_and_build_id.rb new file mode 100644 index 00000000000..5186f5f397e --- /dev/null +++ b/db/post_migrate/20230220132409_validate_fk_on_ci_build_report_results_partition_id_and_build_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiBuildReportResultsPartitionIdAndBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_report_results + FK_NAME = :fk_rails_16cb1ff064_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/20230220132410_remove_fk_to_ci_builds_ci_build_report_results_on_build_id.rb b/db/post_migrate/20230220132410_remove_fk_to_ci_builds_ci_build_report_results_on_build_id.rb new file mode 100644 index 00000000000..8cbcdf27374 --- /dev/null +++ b/db/post_migrate/20230220132410_remove_fk_to_ci_builds_ci_build_report_results_on_build_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiBuildReportResultsOnBuildId < 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 + + 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/20230220134145_validate_fk_on_ci_build_needs_partition_id_and_build_id.rb b/db/post_migrate/20230220134145_validate_fk_on_ci_build_needs_partition_id_and_build_id.rb new file mode 100644 index 00000000000..eec60a51834 --- /dev/null +++ b/db/post_migrate/20230220134145_validate_fk_on_ci_build_needs_partition_id_and_build_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiBuildNeedsPartitionIdAndBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_needs + FK_NAME = :fk_rails_3cf221d4ed_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/20230220134146_remove_fk_to_ci_builds_ci_build_needs_on_build_id.rb b/db/post_migrate/20230220134146_remove_fk_to_ci_builds_ci_build_needs_on_build_id.rb new file mode 100644 index 00000000000..04e7ec11ee6 --- /dev/null +++ b/db/post_migrate/20230220134146_remove_fk_to_ci_builds_ci_build_needs_on_build_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiBuildNeedsOnBuildId < 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 + + 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/20230220165240_add_index_to_approval_rules_on_scan_result_policy_id.rb b/db/post_migrate/20230220165240_add_index_to_approval_rules_on_scan_result_policy_id.rb new file mode 100644 index 00000000000..b510fdb0f86 --- /dev/null +++ b/db/post_migrate/20230220165240_add_index_to_approval_rules_on_scan_result_policy_id.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexToApprovalRulesOnScanResultPolicyId < 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' + + disable_ddl_transaction! + + def up + add_concurrent_index :approval_project_rules, :scan_result_policy_id, name: PROJECT_INDEX_NAME + add_concurrent_index :approval_merge_request_rules, :scan_result_policy_id, name: MERGE_REQUEST_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :approval_project_rules, :scan_result_policy_id, name: PROJECT_INDEX_NAME + remove_concurrent_index_by_name :approval_merge_request_rules, :scan_result_policy_id, + name: MERGE_REQUEST_INDEX_NAME + end +end diff --git a/db/post_migrate/20230221010522_prepare_async_foreign_key_validation_for_ci_sources_pipelines.rb b/db/post_migrate/20230221010522_prepare_async_foreign_key_validation_for_ci_sources_pipelines.rb new file mode 100644 index 00000000000..e25bbca5c80 --- /dev/null +++ b/db/post_migrate/20230221010522_prepare_async_foreign_key_validation_for_ci_sources_pipelines.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncForeignKeyValidationForCiSourcesPipelines < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + COLUMN_NAMES = [:source_partition_id, :source_job_id] + FOREIGN_KEY_NAME = :fk_be5624bf37_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/20230221011750_prepare_async_foreign_key_validation_for_ci_job_variables.rb b/db/post_migrate/20230221011750_prepare_async_foreign_key_validation_for_ci_job_variables.rb new file mode 100644 index 00000000000..973c4c7316d --- /dev/null +++ b/db/post_migrate/20230221011750_prepare_async_foreign_key_validation_for_ci_job_variables.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncForeignKeyValidationForCiJobVariables < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_job_variables + COLUMN_NAMES = [:partition_id, :job_id] + FOREIGN_KEY_NAME = :fk_rails_fbf3b34792_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/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb b/db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb new file mode 100644 index 00000000000..4800ce5ed4c --- /dev/null +++ b/db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTmpPartialIndexOnVulnerabilityReportTypes < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + CLAUSE = 'report_type IN (7, 99)' + + def up + # Temporary index to be removed in 15.11 https://gitlab.com/gitlab-org/gitlab/-/issues/393052 + prepare_async_index :vulnerability_occurrences, :id, where: CLAUSE, name: INDEX_NAME + end + + def down + unprepare_async_index :vulnerability_occurrences, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230221093535_add_sync_tmp_partial_index_on_vulnerability_report_types.rb b/db/post_migrate/20230221093535_add_sync_tmp_partial_index_on_vulnerability_report_types.rb new file mode 100644 index 00000000000..0200aa681e3 --- /dev/null +++ b/db/post_migrate/20230221093535_add_sync_tmp_partial_index_on_vulnerability_report_types.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSyncTmpPartialIndexOnVulnerabilityReportTypes < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in 15.11 https://gitlab.com/gitlab-org/gitlab/-/issues/393052 + add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20230221093536_schedule_migrate_shared_vulnerability_identifiers.rb b/db/post_migrate/20230221093536_schedule_migrate_shared_vulnerability_identifiers.rb new file mode 100644 index 00000000000..79943da148a --- /dev/null +++ b/db/post_migrate/20230221093536_schedule_migrate_shared_vulnerability_identifiers.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class ScheduleMigrateSharedVulnerabilityIdentifiers < Gitlab::Database::Migration[2.1] + MIGRATION = "MigrateSharedVulnerabilityIdentifiers" + TABLE_NAME = :vulnerability_occurrences + BATCH_COLUMN = :id + DELAY_INTERVAL = 2.minutes + + BATCH_SIZE = 1_000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration(MIGRATION, + TABLE_NAME, + BATCH_COLUMN, + job_interval: DELAY_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/20230221125148_add_fk_to_p_ci_builds_metadata_partitions_on_partition_id_and_build_id.rb b/db/post_migrate/20230221125148_add_fk_to_p_ci_builds_metadata_partitions_on_partition_id_and_build_id.rb new file mode 100644 index 00000000000..9df03f03d2b --- /dev/null +++ b/db/post_migrate/20230221125148_add_fk_to_p_ci_builds_metadata_partitions_on_partition_id_and_build_id.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class AddFkToPCiBuildsMetadataPartitionsOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :p_ci_builds_metadata + TARGET_TABLE_NAME = :ci_builds + COLUMN = :build_id + TARGET_COLUMN = :id + FK_NAME = :fk_e20479742e_p + PARTITION_COLUMN = :partition_id + + def up + Gitlab::Database::PostgresPartitionedTable.each_partition(SOURCE_TABLE_NAME) do |partition| + add_concurrent_foreign_key( + partition.identifier, + 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 + end + + def down + Gitlab::Database::PostgresPartitionedTable.each_partition(SOURCE_TABLE_NAME) do |partition| + with_lock_retries do + remove_foreign_key_if_exists( + partition.identifier, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + end +end diff --git a/db/post_migrate/20230221162222_raise_ci_variable_limits_on_gitlab_com.rb b/db/post_migrate/20230221162222_raise_ci_variable_limits_on_gitlab_com.rb new file mode 100644 index 00000000000..084f89b2a5d --- /dev/null +++ b/db/post_migrate/20230221162222_raise_ci_variable_limits_on_gitlab_com.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +class RaiseCiVariableLimitsOnGitlabCom < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + create_or_update_plan_limit('project_ci_variables', 'free', 8000) + create_or_update_plan_limit('project_ci_variables', 'bronze', 8000) + create_or_update_plan_limit('project_ci_variables', 'silver', 8000) + create_or_update_plan_limit('project_ci_variables', 'premium', 8000) + create_or_update_plan_limit('project_ci_variables', 'premium_trial', 8000) + create_or_update_plan_limit('project_ci_variables', 'gold', 8000) + create_or_update_plan_limit('project_ci_variables', 'ultimate', 8000) + create_or_update_plan_limit('project_ci_variables', 'ultimate_trial', 8000) + create_or_update_plan_limit('project_ci_variables', 'early_adopter', 8000) + create_or_update_plan_limit('project_ci_variables', 'opensource', 8000) + + create_or_update_plan_limit('group_ci_variables', 'free', 30000) + create_or_update_plan_limit('group_ci_variables', 'bronze', 30000) + create_or_update_plan_limit('group_ci_variables', 'silver', 30000) + create_or_update_plan_limit('group_ci_variables', 'premium', 30000) + create_or_update_plan_limit('group_ci_variables', 'premium_trial', 30000) + create_or_update_plan_limit('group_ci_variables', 'gold', 30000) + create_or_update_plan_limit('group_ci_variables', 'ultimate', 30000) + create_or_update_plan_limit('group_ci_variables', 'ultimate_trial', 30000) + create_or_update_plan_limit('group_ci_variables', 'early_adopter', 30000) + create_or_update_plan_limit('group_ci_variables', 'opensource', 30000) + end + + def down + create_or_update_plan_limit('project_ci_variables', 'free', 200) + create_or_update_plan_limit('project_ci_variables', 'bronze', 200) + create_or_update_plan_limit('project_ci_variables', 'silver', 200) + create_or_update_plan_limit('project_ci_variables', 'premium', 200) + create_or_update_plan_limit('project_ci_variables', 'premium_trial', 200) + create_or_update_plan_limit('project_ci_variables', 'gold', 200) + create_or_update_plan_limit('project_ci_variables', 'ultimate', 200) + create_or_update_plan_limit('project_ci_variables', 'ultimate_trial', 200) + create_or_update_plan_limit('project_ci_variables', 'early_adopter', 200) + create_or_update_plan_limit('project_ci_variables', 'opensource', 200) + + create_or_update_plan_limit('group_ci_variables', 'free', 200) + create_or_update_plan_limit('group_ci_variables', 'bronze', 200) + create_or_update_plan_limit('group_ci_variables', 'silver', 200) + create_or_update_plan_limit('group_ci_variables', 'premium', 200) + create_or_update_plan_limit('group_ci_variables', 'premium_trial', 200) + create_or_update_plan_limit('group_ci_variables', 'gold', 200) + create_or_update_plan_limit('group_ci_variables', 'ultimate', 200) + create_or_update_plan_limit('group_ci_variables', 'ultimate_trial', 200) + create_or_update_plan_limit('group_ci_variables', 'early_adopter', 200) + create_or_update_plan_limit('group_ci_variables', 'opensource', 200) + end +end diff --git a/db/post_migrate/20230221214519_remove_incorrectly_onboarded_namespaces_from_onboarding_progress.rb b/db/post_migrate/20230221214519_remove_incorrectly_onboarded_namespaces_from_onboarding_progress.rb new file mode 100644 index 00000000000..5672fc42851 --- /dev/null +++ b/db/post_migrate/20230221214519_remove_incorrectly_onboarded_namespaces_from_onboarding_progress.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RemoveIncorrectlyOnboardedNamespacesFromOnboardingProgress < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class OnboardingProgress < MigrationRecord + include EachBatch + + self.table_name = 'onboarding_progresses' + end + + class Project < MigrationRecord + self.table_name = 'projects' + end + + def up + names = ['Learn GitLab', 'Learn GitLab - Ultimate trial'] + + OnboardingProgress.each_batch(of: 500) do |batch| + namespaces_to_keep = Project.where(name: names, namespace_id: batch.select(:namespace_id)).select(:namespace_id) + batch.where.not(namespace_id: namespaces_to_keep).delete_all + end + end + + def down + # no op + end +end diff --git a/db/post_migrate/20230222035805_prepare_async_index_removal_of_token_for_ci_builds.rb b/db/post_migrate/20230222035805_prepare_async_index_removal_of_token_for_ci_builds.rb new file mode 100644 index 00000000000..6fd5bb18856 --- /dev/null +++ b/db/post_migrate/20230222035805_prepare_async_index_removal_of_token_for_ci_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexRemovalOfTokenForCiBuilds < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + COLUMN_NAME = :token_encrypted + INDEX_NAME = :index_ci_builds_on_token_encrypted + + def up + prepare_async_index_removal(TABLE_NAME, COLUMN_NAME, name: INDEX_NAME) + end + + def down + unprepare_async_index(TABLE_NAME, COLUMN_NAME, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb b/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb new file mode 100644 index 00000000000..d3ed5a8fa2c --- /dev/null +++ b/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveConcurrentIndexOnTokenEncryptedForCiBuilds < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + COLUMN_NAME = :token_encrypted + INDEX_NAME = :index_ci_builds_on_token_encrypted + WHERE_STATEMENT = 'token_encrypted IS NOT NULL' + + def up + remove_concurrent_index_by_name TABLE_NAME, name: INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME, where: WHERE_STATEMENT, unique: true + end +end diff --git a/db/post_migrate/20230222101420_remove_fk_to_ci_build_ci_pending_build_on_build_id.rb b/db/post_migrate/20230222101420_remove_fk_to_ci_build_ci_pending_build_on_build_id.rb new file mode 100644 index 00000000000..36e2f0f34f3 --- /dev/null +++ b/db/post_migrate/20230222101420_remove_fk_to_ci_build_ci_pending_build_on_build_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildCiPendingBuildOnBuildId < 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 + + 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/20230222102421_remove_fk_to_ci_build_ci_running_build_on_build_id.rb b/db/post_migrate/20230222102421_remove_fk_to_ci_build_ci_running_build_on_build_id.rb new file mode 100644 index 00000000000..d3cbfa649c3 --- /dev/null +++ b/db/post_migrate/20230222102421_remove_fk_to_ci_build_ci_running_build_on_build_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildCiRunningBuildOnBuildId < 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 + + 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/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb b/db/post_migrate/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb new file mode 100644 index 00000000000..b5085d24ab1 --- /dev/null +++ b/db/post_migrate/20230223014251_validate_not_null_constraint_on_oauth_access_tokens_expires_in.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ValidateNotNullConstraintOnOauthAccessTokensExpiresIn < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + validate_not_null_constraint :oauth_access_tokens, :expires_in + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230223065753_finalize_nullify_creator_id_of_orphaned_projects.rb b/db/post_migrate/20230223065753_finalize_nullify_creator_id_of_orphaned_projects.rb new file mode 100644 index 00000000000..aa3ed4837e7 --- /dev/null +++ b/db/post_migrate/20230223065753_finalize_nullify_creator_id_of_orphaned_projects.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeNullifyCreatorIdOfOrphanedProjects < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'NullifyCreatorIdColumnOfOrphanedProjects' + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :projects, + column_name: :id, + job_arguments: [] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230223082752_schedule_fk_validation_for_p_ci_builds_metadata_partitions_and_ci_builds.rb b/db/post_migrate/20230223082752_schedule_fk_validation_for_p_ci_builds_metadata_partitions_and_ci_builds.rb new file mode 100644 index 00000000000..bcb1147605e --- /dev/null +++ b/db/post_migrate/20230223082752_schedule_fk_validation_for_p_ci_builds_metadata_partitions_and_ci_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ScheduleFkValidationForPCiBuildsMetadataPartitionsAndCiBuilds < Gitlab::Database::Migration[2.1] + # This migration was used to validate the foreign keys on partitions introduced by + # db/post_migrate/20230221125148_add_fk_to_p_ci_builds_metadata_partitions_on_partition_id_and_build_id.rb + # but executing the rollback of + # db/post_migrate/20230306072532_add_partitioned_fk_to_p_ci_builds_metadata_on_partition_id_and_build_id.rb + # would also remove the FKs on partitions and this would errors out. + + def up + # No-op + end + + def down + # No-op + end +end diff --git a/db/post_migrate/20230223093704_add_foreign_key_on_creator_id_on_projects.rb b/db/post_migrate/20230223093704_add_foreign_key_on_creator_id_on_projects.rb new file mode 100644 index 00000000000..68fd6de3f23 --- /dev/null +++ b/db/post_migrate/20230223093704_add_foreign_key_on_creator_id_on_projects.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyOnCreatorIdOnProjects < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :projects, :users, column: :creator_id, on_delete: :nullify, validate: false + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :projects, column: :creator_id + end + end +end diff --git a/db/post_migrate/20230224085743_update_issues_internal_id_scope.rb b/db/post_migrate/20230224085743_update_issues_internal_id_scope.rb new file mode 100644 index 00000000000..71d16ccf2a6 --- /dev/null +++ b/db/post_migrate/20230224085743_update_issues_internal_id_scope.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class UpdateIssuesInternalIdScope < Gitlab::Database::Migration[2.1] + MIGRATION = 'IssuesInternalIdScopeUpdater' + INTERVAL = 2.minutes + BATCH_SIZE = 5_000 + MAX_BATCH_SIZE = 20_000 + SUB_BATCH_SIZE = 100 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :internal_ids, + :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, :internal_ids, :id, []) + end +end diff --git a/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb b/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb new file mode 100644 index 00000000000..7c2a43443df --- /dev/null +++ b/db/post_migrate/20230224144233_migrate_evidences_from_raw_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class MigrateEvidencesFromRawMetadata < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'MigrateEvidencesForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 10000 + + def up + # no-op as it has been rescheduled via db/post_migrate/20230330103104_reschedule_migrate_evidences.rb + end + + def down + # no-op as it has been rescheduled via db/post_migrate/20230330103104_reschedule_migrate_evidences.rb + end +end diff --git a/db/post_migrate/20230227123949_validate_fk_on_ci_sources_pipelines_source_partition_id_and_source_job_id.rb b/db/post_migrate/20230227123949_validate_fk_on_ci_sources_pipelines_source_partition_id_and_source_job_id.rb new file mode 100644 index 00000000000..630483ee1f8 --- /dev/null +++ b/db/post_migrate/20230227123949_validate_fk_on_ci_sources_pipelines_source_partition_id_and_source_job_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiSourcesPipelinesSourcePartitionIdAndSourceJobId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + FK_NAME = :fk_be5624bf37_p + COLUMNS = [:source_partition_id, :source_job_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/20230227123950_remove_fk_to_ci_builds_ci_sources_pipelines_on_source_job_id.rb b/db/post_migrate/20230227123950_remove_fk_to_ci_builds_ci_sources_pipelines_on_source_job_id.rb new file mode 100644 index 00000000000..17ae2ad1325 --- /dev/null +++ b/db/post_migrate/20230227123950_remove_fk_to_ci_builds_ci_sources_pipelines_on_source_job_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiSourcesPipelinesOnSourceJobId < 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 + + 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/20230227151608_validate_fk_on_ci_build_trace_metadata_partition_id_and_build_id.rb b/db/post_migrate/20230227151608_validate_fk_on_ci_build_trace_metadata_partition_id_and_build_id.rb new file mode 100644 index 00000000000..b95c416c128 --- /dev/null +++ b/db/post_migrate/20230227151608_validate_fk_on_ci_build_trace_metadata_partition_id_and_build_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiBuildTraceMetadataPartitionIdAndBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_trace_metadata + FK_NAME = :fk_rails_aebc78111f_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/20230227151609_remove_fk_to_ci_builds_ci_build_trace_metadata_on_build_id.rb b/db/post_migrate/20230227151609_remove_fk_to_ci_builds_ci_build_trace_metadata_on_build_id.rb new file mode 100644 index 00000000000..16e24d7ed4c --- /dev/null +++ b/db/post_migrate/20230227151609_remove_fk_to_ci_builds_ci_build_trace_metadata_on_build_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiBuildTraceMetadataOnBuildId < 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 + + 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/20230227153231_validate_fk_on_ci_job_variables_partition_id_and_job_id.rb b/db/post_migrate/20230227153231_validate_fk_on_ci_job_variables_partition_id_and_job_id.rb new file mode 100644 index 00000000000..035d26dbe94 --- /dev/null +++ b/db/post_migrate/20230227153231_validate_fk_on_ci_job_variables_partition_id_and_job_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkOnCiJobVariablesPartitionIdAndJobId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_job_variables + FK_NAME = :fk_rails_fbf3b34792_p + COLUMNS = [:partition_id, :job_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/20230227153232_remove_fk_to_ci_builds_ci_job_variables_on_job_id.rb b/db/post_migrate/20230227153232_remove_fk_to_ci_builds_ci_job_variables_on_job_id.rb new file mode 100644 index 00000000000..f5dae8b57e0 --- /dev/null +++ b/db/post_migrate/20230227153232_remove_fk_to_ci_builds_ci_job_variables_on_job_id.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsCiJobVariablesOnJobId < 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 + + 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/20230228021910_ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230228021910_ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..238c7fd0bec --- /dev/null +++ b/db/post_migrate/20230228021910_ensure_timelogs_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureTimelogsNoteIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'timelogs', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230228023014_swap_timelogs_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230228023014_swap_timelogs_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..722a71863b0 --- /dev/null +++ b/db/post_migrate/20230228023014_swap_timelogs_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +class SwapTimelogsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'timelogs' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing index_timelogs_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, name: 'index_timelogs_on_note_id_convert_to_bigint' + + # This will replace the existing fk_timelogs_note_id + add_concurrent_foreign_key :timelogs, :notes, column: :note_id_convert_to_bigint, + name: 'fk_timelogs_note_id_convert_to_bigint', + on_delete: :nullify + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute "DROP INDEX IF EXISTS index_timelogs_on_note_id" + rename_index TABLE_NAME, 'index_timelogs_on_note_id_convert_to_bigint', 'index_timelogs_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_timelogs_note_id" + rename_constraint(TABLE_NAME, 'fk_timelogs_note_id_convert_to_bigint', 'fk_timelogs_note_id') + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230301020246_ensure_mr_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230301020246_ensure_mr_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..90941af4eb2 --- /dev/null +++ b/db/post_migrate/20230301020246_ensure_mr_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureMrUserMentionsNoteIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'merge_request_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb b/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb new file mode 100644 index 00000000000..11468a5844e --- /dev/null +++ b/db/post_migrate/20230301020356_swap_merge_request_user_mentions_note_id_to_bigint.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +class SwapMergeRequestUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'merge_request_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_merge_request_user_mentions_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade, + validate: false + end + + def swap + # This will replace the existing index_merge_request_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_merge_request_user_mentions_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + # This will replace the existing merge_request_user_mentions_on_mr_id_and_note_id_index + add_concurrent_index TABLE_NAME, [:merge_request_id, :note_id_convert_to_bigint], unique: true, + name: 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index' + + # This will replace the existing merge_request_user_mentions_on_mr_id_index + add_concurrent_index TABLE_NAME, :merge_request_id, unique: true, + name: 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NULL' + + # This will replace the existing fk_rails_c440b9ea31 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_merge_request_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS index_merge_request_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_merge_request_user_mentions_note_id_convert_to_bigint', + 'index_merge_request_user_mentions_on_note_id' + + execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_and_note_id_index' + rename_index TABLE_NAME, 'mr_user_mentions_on_mr_id_and_note_id_convert_to_bigint_index', + 'merge_request_user_mentions_on_mr_id_and_note_id_index' + + execute 'DROP INDEX IF EXISTS merge_request_user_mentions_on_mr_id_index' + rename_index TABLE_NAME, 'merge_request_user_mentions_on_mr_id_index_convert_to_bigint', + 'merge_request_user_mentions_on_mr_id_index' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_c440b9ea31" + rename_constraint(TABLE_NAME, 'fk_merge_request_user_mentions_note_id_convert_to_bigint', 'fk_rails_c440b9ea31') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230301065107_add_index_on_expired_unlocked_non_trace_job_artifacts.rb b/db/post_migrate/20230301065107_add_index_on_expired_unlocked_non_trace_job_artifacts.rb new file mode 100644 index 00000000000..feda6971a85 --- /dev/null +++ b/db/post_migrate/20230301065107_add_index_on_expired_unlocked_non_trace_job_artifacts.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnExpiredUnlockedNonTraceJobArtifacts < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_job_artifacts_expire_at_unlocked_non_trace' + + def up + add_concurrent_index :ci_job_artifacts, :expire_at, + name: INDEX_NAME, + where: 'locked = 0 AND file_type != 3 AND expire_at IS NOT NULL' + end + + def down + remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20230302090155_add_async_index_on_unlocked_non_trace_job_artifacts_expire_at.rb b/db/post_migrate/20230302090155_add_async_index_on_unlocked_non_trace_job_artifacts_expire_at.rb new file mode 100644 index 00000000000..9f89b6916bd --- /dev/null +++ b/db/post_migrate/20230302090155_add_async_index_on_unlocked_non_trace_job_artifacts_expire_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAsyncIndexOnUnlockedNonTraceJobArtifactsExpireAt < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_ci_job_artifacts_expire_at_unlocked_non_trace' + + def up + prepare_async_index :ci_job_artifacts, :expire_at, + name: INDEX_NAME, + where: 'locked = 0 AND file_type != 3 AND expire_at IS NOT NULL' + end + + def down + unprepare_async_index :ci_job_artifacts, :expire_at, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230302123258_drop_runner_machines_constraint_on_ci_builds_metadata.rb b/db/post_migrate/20230302123258_drop_runner_machines_constraint_on_ci_builds_metadata.rb new file mode 100644 index 00000000000..c8f1b3be9bd --- /dev/null +++ b/db/post_migrate/20230302123258_drop_runner_machines_constraint_on_ci_builds_metadata.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class DropRunnerMachinesConstraintOnCiBuildsMetadata < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = 'p_ci_builds_metadata' + TARGET_TABLE_NAME = 'ci_runner_machines' + CONSTRAINT_NAME = 'fk_rails_fae01b2700' + + def up + with_lock_retries(raise_on_exhaustion: true) do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, TARGET_TABLE_NAME, name: CONSTRAINT_NAME) + end + end + + def down + with_lock_retries(raise_on_exhaustion: true) do + next if check_constraint_exists?(SOURCE_TABLE_NAME, CONSTRAINT_NAME) + + execute(<<~SQL) + ALTER TABLE #{SOURCE_TABLE_NAME} + ADD CONSTRAINT #{CONSTRAINT_NAME} FOREIGN KEY (runner_machine_id) + REFERENCES #{TARGET_TABLE_NAME}(id) ON DELETE SET NULL + SQL + end + end +end diff --git a/db/post_migrate/20230302123259_ensure_ci_runner_machines_is_empty.rb b/db/post_migrate/20230302123259_ensure_ci_runner_machines_is_empty.rb new file mode 100644 index 00000000000..9f7233f43f5 --- /dev/null +++ b/db/post_migrate/20230302123259_ensure_ci_runner_machines_is_empty.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class EnsureCiRunnerMachinesIsEmpty < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + return unless Gitlab::Database.gitlab_schemas_for_connection(connection).include?(:gitlab_ci) + + # Ensure that the ci_runner_machines table is empty to ensure that new builds + # don't try to create new join records until we add the missing FK. + execute('TRUNCATE TABLE ci_runner_machines, p_ci_runner_machine_builds') + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230302123301_add_index_on_runner_machine_id_on_runner_machine_builds.rb b/db/post_migrate/20230302123301_add_index_on_runner_machine_id_on_runner_machine_builds.rb new file mode 100644 index 00000000000..035223382bd --- /dev/null +++ b/db/post_migrate/20230302123301_add_index_on_runner_machine_id_on_runner_machine_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnRunnerMachineIdOnRunnerMachineBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + INDEX_NAME = 'index_p_ci_runner_machine_builds_on_runner_machine_id' + + def up + add_concurrent_partitioned_index :p_ci_runner_machine_builds, :runner_machine_id, unique: false, name: INDEX_NAME + end + + def down + remove_concurrent_partitioned_index_by_name :p_ci_runner_machine_builds, INDEX_NAME + end +end diff --git a/db/post_migrate/20230302163339_add_index_to_oauth_access_grants_application_id.rb b/db/post_migrate/20230302163339_add_index_to_oauth_access_grants_application_id.rb new file mode 100644 index 00000000000..0db6190e17d --- /dev/null +++ b/db/post_migrate/20230302163339_add_index_to_oauth_access_grants_application_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToOauthAccessGrantsApplicationId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_oauth_access_grants_on_application_id' + + def up + add_concurrent_index :oauth_access_grants, :application_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :oauth_access_grants, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230302185739_queue_fix_vulnerability_reads_has_issues.rb b/db/post_migrate/20230302185739_queue_fix_vulnerability_reads_has_issues.rb new file mode 100644 index 00000000000..09a5f6e9478 --- /dev/null +++ b/db/post_migrate/20230302185739_queue_fix_vulnerability_reads_has_issues.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class QueueFixVulnerabilityReadsHasIssues < Gitlab::Database::Migration[2.1] + MIGRATION = "FixVulnerabilityReadsHasIssues" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerability_issue_links, + :vulnerability_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_issue_links, :vulnerability_id, []) + end +end diff --git a/db/post_migrate/20230303105806_queue_delete_orphaned_packages_dependencies.rb b/db/post_migrate/20230303105806_queue_delete_orphaned_packages_dependencies.rb new file mode 100644 index 00000000000..8c741cf9868 --- /dev/null +++ b/db/post_migrate/20230303105806_queue_delete_orphaned_packages_dependencies.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueDeleteOrphanedPackagesDependencies < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'DeleteOrphanedPackagesDependencies' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 6000 + SUB_BATCH_SIZE = 100 + + disable_ddl_transaction! + def up + queue_batched_background_migration( + MIGRATION, + :packages_dependencies, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :packages_dependencies, :id, []) + end +end diff --git a/db/post_migrate/20230303120531_schedule_temporary_partitioning_indexes_removal.rb b/db/post_migrate/20230303120531_schedule_temporary_partitioning_indexes_removal.rb new file mode 100644 index 00000000000..73334be4214 --- /dev/null +++ b/db/post_migrate/20230303120531_schedule_temporary_partitioning_indexes_removal.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class ScheduleTemporaryPartitioningIndexesRemoval < Gitlab::Database::Migration[2.1] + INDEXES = [ + [:ci_pipelines, :tmp_index_ci_pipelines_on_partition_id_and_id], + [:ci_stages, :tmp_index_ci_stages_on_partition_id_and_id], + [:ci_builds, :tmp_index_ci_builds_on_partition_id_and_id], + [:ci_build_needs, :tmp_index_ci_build_needs_on_partition_id_and_id], + [:ci_build_report_results, :tmp_index_ci_build_report_results_on_partition_id_and_build_id], + [:ci_build_trace_metadata, :tmp_index_ci_build_trace_metadata_on_partition_id_and_id], + [:ci_job_artifacts, :tmp_index_ci_job_artifacts_on_partition_id_and_id], + [:ci_pipeline_variables, :tmp_index_ci_pipeline_variables_on_partition_id_and_id], + [:ci_job_variables, :tmp_index_ci_job_variables_on_partition_id_and_id], + [:ci_sources_pipelines, :tmp_index_ci_sources_pipelines_on_partition_id_and_id], + [:ci_sources_pipelines, :tmp_index_ci_sources_pipelines_on_source_partition_id_and_id], + [:ci_running_builds, :tmp_index_ci_running_builds_on_partition_id_and_id], + [:ci_pending_builds, :tmp_index_ci_pending_builds_on_partition_id_and_id], + [:ci_builds_runner_session, :tmp_index_ci_builds_runner_session_on_partition_id_and_id] + ] + + def up + INDEXES.each do |table_name, index_name| + prepare_async_index_removal table_name, nil, name: index_name + end + end + + def down + INDEXES.each do |table_name, index_name| + unprepare_async_index table_name, nil, name: index_name + end + end +end diff --git a/db/post_migrate/20230303154314_add_user_type_migration_indexes.rb b/db/post_migrate/20230303154314_add_user_type_migration_indexes.rb new file mode 100644 index 00000000000..8f9e193f0eb --- /dev/null +++ b/db/post_migrate/20230303154314_add_user_type_migration_indexes.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddUserTypeMigrationIndexes < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + BILLABLE_INDEX = 'index_users_for_active_billable_users_migration' + LAST_ACTIVITY_INDEX = 'i_users_on_last_activity_for_active_human_service_migration' + + def up + # Temporary indexes to migrate human user_type. See https://gitlab.com/gitlab-org/gitlab/-/issues/386474 + add_concurrent_index :users, :id, name: BILLABLE_INDEX, + where: "state = 'active' AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[6, 4, 13]))) " \ + "AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[4, 5])))" + add_concurrent_index :users, [:id, :last_activity_on], name: LAST_ACTIVITY_INDEX, + where: "((state)::text = 'active'::text) AND ((user_type IS NULL OR user_type = 0) OR (user_type = 4))" + end + + def down + remove_concurrent_index_by_name :users, BILLABLE_INDEX + remove_concurrent_index_by_name :users, LAST_ACTIVITY_INDEX + end +end diff --git a/db/post_migrate/20230304184416_drop_revokable_from_achievements.rb b/db/post_migrate/20230304184416_drop_revokable_from_achievements.rb new file mode 100644 index 00000000000..bb6c8d65c57 --- /dev/null +++ b/db/post_migrate/20230304184416_drop_revokable_from_achievements.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropRevokableFromAchievements < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + remove_column :achievements, :revokeable, :boolean, default: false, null: false + end +end diff --git a/db/post_migrate/20230306071456_validate_partitioning_fk_on_p_ci_builds_metadata_partitions.rb b/db/post_migrate/20230306071456_validate_partitioning_fk_on_p_ci_builds_metadata_partitions.rb new file mode 100644 index 00000000000..f07175e82f9 --- /dev/null +++ b/db/post_migrate/20230306071456_validate_partitioning_fk_on_p_ci_builds_metadata_partitions.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ValidatePartitioningFkOnPCiBuildsMetadataPartitions < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :p_ci_builds_metadata + FK_NAME = :fk_e20479742e_p + + def up + Gitlab::Database::PostgresPartitionedTable.each_partition(SOURCE_TABLE_NAME) do |partition| + next unless foreign_key_exists?(partition.identifier, name: FK_NAME) + + validate_foreign_key(partition.identifier, nil, name: FK_NAME) + end + end + + def down + # No-op + end +end diff --git a/db/post_migrate/20230306072532_add_partitioned_fk_to_p_ci_builds_metadata_on_partition_id_and_build_id.rb b/db/post_migrate/20230306072532_add_partitioned_fk_to_p_ci_builds_metadata_on_partition_id_and_build_id.rb new file mode 100644 index 00000000000..d66950378d2 --- /dev/null +++ b/db/post_migrate/20230306072532_add_partitioned_fk_to_p_ci_builds_metadata_on_partition_id_and_build_id.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class AddPartitionedFkToPCiBuildsMetadataOnPartitionIdAndBuildId < Gitlab::Database::Migration[2.1] + SOURCE_TABLE_NAME = :p_ci_builds_metadata + TARGET_TABLE_NAME = :ci_builds + FK_NAME = :fk_e20479742e_p + + disable_ddl_transaction! + + def up + return if foreign_key_exists?(SOURCE_TABLE_NAME, TARGET_TABLE_NAME, name: FK_NAME) + + with_lock_retries do + execute("LOCK TABLE #{TARGET_TABLE_NAME}, #{SOURCE_TABLE_NAME} IN ACCESS EXCLUSIVE MODE") + + execute(<<~SQL.squish) + ALTER TABLE #{SOURCE_TABLE_NAME} + ADD CONSTRAINT #{FK_NAME} + FOREIGN KEY (partition_id, build_id) + REFERENCES #{TARGET_TABLE_NAME} (partition_id, id) + ON UPDATE CASCADE ON DELETE CASCADE; + SQL + end + 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/20230306082852_remove_fk_to_ci_builds_p_ci_builds_metadata_on_build_id.rb b/db/post_migrate/20230306082852_remove_fk_to_ci_builds_p_ci_builds_metadata_on_build_id.rb new file mode 100644 index 00000000000..108a92aec3b --- /dev/null +++ b/db/post_migrate/20230306082852_remove_fk_to_ci_builds_p_ci_builds_metadata_on_build_id.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class RemoveFkToCiBuildsPCiBuildsMetadataOnBuildId < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :p_ci_builds_metadata + TARGET_TABLE_NAME = :ci_builds + FK_NAME = :fk_e20479742e + + 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_partitioned_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: :build_id, + on_delete: :cascade, + name: FK_NAME + ) + end +end diff --git a/db/post_migrate/20230306143322_prepare_ci_builds_primary_key_for_partitioning.rb b/db/post_migrate/20230306143322_prepare_ci_builds_primary_key_for_partitioning.rb new file mode 100644 index 00000000000..99b52e4c443 --- /dev/null +++ b/db/post_migrate/20230306143322_prepare_ci_builds_primary_key_for_partitioning.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +class PrepareCiBuildsPrimaryKeyForPartitioning < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + PRIMARY_KEY = :ci_builds_pkey + NEW_INDEX_NAME = :index_ci_builds_on_id_partition_id_unique + OLD_INDEX_NAME = :index_ci_builds_on_id_unique + + def up + swap_primary_key(TABLE_NAME, PRIMARY_KEY, NEW_INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, :id, unique: true, name: OLD_INDEX_NAME) + add_concurrent_index(TABLE_NAME, [:id, :partition_id], unique: true, name: NEW_INDEX_NAME) + + unswap_primary_key(TABLE_NAME, PRIMARY_KEY, OLD_INDEX_NAME) + + recreate_partitioned_foreign_keys + end + + private + + def recreate_partitioned_foreign_keys + add_partitioned_fk(:ci_job_variables, :fk_rails_fbf3b34792_p, column: :job_id) + add_partitioned_fk(:ci_job_artifacts, :fk_rails_c5137cb2c1_p, column: :job_id) + add_partitioned_fk(:ci_running_builds, :fk_rails_da45cfa165_p) + add_partitioned_fk(:ci_build_pending_states, :fk_861cd17da3_p) + add_partitioned_fk(:ci_build_trace_chunks, :fk_89e29fa5ee_p) + add_partitioned_fk(:ci_unit_test_failures, :fk_9e0fc58930_p) + add_partitioned_fk(:ci_build_trace_metadata, :fk_rails_aebc78111f_p) + add_partitioned_fk(:ci_pending_builds, :fk_rails_725a2644a3_p) + add_partitioned_fk(:ci_builds_runner_session, :fk_rails_70707857d3_p) + add_partitioned_fk(:ci_build_needs, :fk_rails_3cf221d4ed_p) + add_partitioned_fk(:ci_build_report_results, :fk_rails_16cb1ff064_p) + add_partitioned_fk(:ci_resources, :fk_e169a8e3d5_p, delete: :nullify) + add_partitioned_fk(:ci_sources_pipelines, :fk_be5624bf37_p, columns: %i[source_partition_id source_job_id]) + + add_routing_table_fk(:p_ci_builds_metadata, :fk_e20479742e_p) + add_routing_table_fk(:p_ci_runner_machine_builds, :fk_bb490f12fe_p) + end + + def add_partitioned_fk(source_table, name, column: :build_id, columns: nil, delete: :cascade) + add_concurrent_foreign_key(source_table, :ci_builds, + column: columns || [:partition_id, column], + target_column: [:partition_id, :id], + reverse_lock_order: true, + on_update: :cascade, + on_delete: delete, + name: name) + end + + def add_routing_table_fk(source_table, name) + add_concurrent_partitioned_foreign_key(source_table, :ci_builds, + column: [:partition_id, :build_id], + target_column: [:partition_id, :id], + reverse_lock_order: true, + on_update: :cascade, + on_delete: :cascade, + name: name) + end +end diff --git a/db/post_migrate/20230306195007_queue_backfill_project_wiki_repositories.rb b/db/post_migrate/20230306195007_queue_backfill_project_wiki_repositories.rb new file mode 100644 index 00000000000..8da5536541b --- /dev/null +++ b/db/post_migrate/20230306195007_queue_backfill_project_wiki_repositories.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class QueueBackfillProjectWikiRepositories < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230307085644_track_ci_runner_machine_record_changes.rb b/db/post_migrate/20230307085644_track_ci_runner_machine_record_changes.rb new file mode 100644 index 00000000000..deae1a57968 --- /dev/null +++ b/db/post_migrate/20230307085644_track_ci_runner_machine_record_changes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackCiRunnerMachineRecordChanges < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:ci_runner_machines) + end + + def down + untrack_record_deletions(:ci_runner_machines) + end +end diff --git a/db/post_migrate/20230307160251_rename_constraint_fk_rails_f601258b28_on_events_table.rb b/db/post_migrate/20230307160251_rename_constraint_fk_rails_f601258b28_on_events_table.rb new file mode 100644 index 00000000000..6b5ba4c3825 --- /dev/null +++ b/db/post_migrate/20230307160251_rename_constraint_fk_rails_f601258b28_on_events_table.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RenameConstraintFkRailsF601258b28OnEventsTable < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + TABLE_NAME = :events + FK_OLD_NAME = :fk_rails_f601258b28 + FK_NEW_NAME = :fk_rails_0434b48643 + + def up + return unless foreign_key_exists?(TABLE_NAME, name: FK_OLD_NAME) + + rename_constraint(TABLE_NAME, FK_OLD_NAME, FK_NEW_NAME) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230309010000_add_unique_index_mr_user_mentions_note_id_convert_to_bigint.rb b/db/post_migrate/20230309010000_add_unique_index_mr_user_mentions_note_id_convert_to_bigint.rb new file mode 100644 index 00000000000..9927bfb995a --- /dev/null +++ b/db/post_migrate/20230309010000_add_unique_index_mr_user_mentions_note_id_convert_to_bigint.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class AddUniqueIndexMrUserMentionsNoteIdConvertToBigint < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :merge_request_user_mentions + INDEX_NAME = :index_merge_request_user_mentions_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing index_merge_request_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: INDEX_NAME, + where: 'note_id_convert_to_bigint IS NOT NULL' + end + + def down + return unless should_run? + + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230309010931_add_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb b/db/post_migrate/20230309010931_add_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb new file mode 100644 index 00000000000..022e38460ae --- /dev/null +++ b/db/post_migrate/20230309010931_add_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +class AddFkOnMrUserMentionsNoteIdConvertToIdBigint < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :merge_request_user_mentions + TARGET_TABLE_NAME = :notes + FK_NAME = :fk_merge_request_user_mentions_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing fk_rails_c440b9ea31 + # when we swap the integer and bigint columns + add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME, + column: :note_id_convert_to_bigint, + name: FK_NAME, + on_delete: :cascade, + reverse_lock_order: true, + validate: false + end + + def down + return unless should_run? + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230309020422_validate_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb b/db/post_migrate/20230309020422_validate_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb new file mode 100644 index 00000000000..104fb7edb7e --- /dev/null +++ b/db/post_migrate/20230309020422_validate_fk_on_mr_user_mentions_note_id_convert_to_id_bigint.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ValidateFkOnMrUserMentionsNoteIdConvertToIdBigint < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :merge_request_user_mentions + COLUMN = :note_id_convert_to_bigint + FK_NAME = :fk_merge_request_user_mentions_note_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb b/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb new file mode 100644 index 00000000000..0a9ace2574c --- /dev/null +++ b/db/post_migrate/20230309071242_delete_security_policy_bot_users.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class DeleteSecurityPolicyBotUsers < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class User < MigrationRecord + self.table_name = 'users' + + enum user_type: { security_policy_bot: 10 } + end + + def up + User.where(user_type: :security_policy_bot).delete_all + end + + def down + # no-op + + # Deleted records can't be restored + end +end diff --git a/db/post_migrate/20230309085547_prepare_ci_builds_constraints_for_list_partitioning.rb b/db/post_migrate/20230309085547_prepare_ci_builds_constraints_for_list_partitioning.rb new file mode 100644 index 00000000000..966bff7d544 --- /dev/null +++ b/db/post_migrate/20230309085547_prepare_ci_builds_constraints_for_list_partitioning.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareCiBuildsConstraintsForListPartitioning < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_check_constraint(:ci_builds, 'partition_id = 100', 'partitioning_constraint', validate: false) + prepare_async_check_constraint_validation(:ci_builds, name: 'partitioning_constraint') + end + + def down + unprepare_async_check_constraint_validation(:ci_builds, name: 'partitioning_constraint') + remove_check_constraint(:ci_builds, 'partitioning_constraint') + end +end diff --git a/db/post_migrate/20230309103016_drop_id_partition_id_index_from_p_ci_build_metadata.rb b/db/post_migrate/20230309103016_drop_id_partition_id_index_from_p_ci_build_metadata.rb new file mode 100644 index 00000000000..6e8866c0552 --- /dev/null +++ b/db/post_migrate/20230309103016_drop_id_partition_id_index_from_p_ci_build_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropIdPartitionIdIndexFromPCiBuildMetadata < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + TABLE_NAME = :p_ci_builds_metadata + INDEX_NAME = :p_ci_builds_metadata_id_partition_id_idx + + def up + remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_partitioned_index(TABLE_NAME, %i[id partition_id], unique: true, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20230310111859_recreate_user_type_migration_indexes.rb b/db/post_migrate/20230310111859_recreate_user_type_migration_indexes.rb new file mode 100644 index 00000000000..539ce99a319 --- /dev/null +++ b/db/post_migrate/20230310111859_recreate_user_type_migration_indexes.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class RecreateUserTypeMigrationIndexes < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INCORRECT_BILLABLE_INDEX = 'index_users_for_active_billable_users_migration' + BILLABLE_INDEX = 'migrate_index_users_for_active_billable_users' + + def up + # Temporary index to migrate human user_type. See https://gitlab.com/gitlab-org/gitlab/-/issues/386474 + add_concurrent_index :users, :id, name: BILLABLE_INDEX, + where: "state = 'active' AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[0, 6, 4, 13]))) " \ + "AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[0, 4, 5])))" + + remove_concurrent_index_by_name :users, INCORRECT_BILLABLE_INDEX + end + + def down + add_concurrent_index :users, :id, name: INCORRECT_BILLABLE_INDEX, + where: "state = 'active' AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[6, 4, 13]))) " \ + "AND ((user_type IS NULL OR user_type = 0) OR (user_type = ANY (ARRAY[4, 5])))" + remove_concurrent_index_by_name :users, BILLABLE_INDEX + end +end diff --git a/db/post_migrate/20230310213308_sync_security_policy_rule_schedules_that_may_have_been_deleted_by_a_bug.rb b/db/post_migrate/20230310213308_sync_security_policy_rule_schedules_that_may_have_been_deleted_by_a_bug.rb new file mode 100644 index 00000000000..3435f889fa7 --- /dev/null +++ b/db/post_migrate/20230310213308_sync_security_policy_rule_schedules_that_may_have_been_deleted_by_a_bug.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +class SyncSecurityPolicyRuleSchedulesThatMayHaveBeenDeletedByABug < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class OrchestrationPolicyRuleSchedule < MigrationRecord + self.table_name = 'security_orchestration_policy_rule_schedules' + end + + def up + return unless Gitlab.ee? + return unless sync_scan_policies_worker + + OrchestrationPolicyRuleSchedule + .select(:security_orchestration_policy_configuration_id) + .distinct + .where(policy_index: 1..) + .pluck(:security_orchestration_policy_configuration_id) + .map { |policy_configuration_id| [policy_configuration_id] } + .then { |args_list| sync_scan_policies_worker.bulk_perform_async(args_list) } + end + + def down + # no-op + end + + private + + def sync_scan_policies_worker + unless defined?(@sync_scan_policies_worker) + @sync_scan_policies_worker = 'Security::SyncScanPoliciesWorker'.safe_constantize + end + + @sync_scan_policies_worker + end +end diff --git a/db/post_migrate/20230313031629_ensure_commit_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230313031629_ensure_commit_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..d651ca463af --- /dev/null +++ b/db/post_migrate/20230313031629_ensure_commit_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureCommitUserMentionsNoteIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'commit_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230313133001_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230313133001_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..ffda926c49e --- /dev/null +++ b/db/post_migrate/20230313133001_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class EnsureMergeRequestMetricsIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'merge_request_metrics', + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230313142631_backfill_ml_candidates_package_id.rb b/db/post_migrate/20230313142631_backfill_ml_candidates_package_id.rb new file mode 100644 index 00000000000..09f7cf5a0ba --- /dev/null +++ b/db/post_migrate/20230313142631_backfill_ml_candidates_package_id.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class BackfillMlCandidatesPackageId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + sql = <<-SQL + UPDATE ml_candidates + SET package_id = candidate_id_to_package_id.package_id + FROM (SELECT id as package_id, TRIM(LEADING 'ml_candidates_' FROM name) as candidate_id + FROM packages_packages + WHERE name LIKE 'ml_candidate_%' + and version = '-') AS candidate_id_to_package_id + WHERE cast(ml_candidates.id as text) = candidate_id_to_package_id.candidate_id + SQL + + execute(sql) + end + + def down; end +end diff --git a/db/post_migrate/20230313143033_swap_merge_request_metrics_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230313143033_swap_merge_request_metrics_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..089dd621033 --- /dev/null +++ b/db/post_migrate/20230313143033_swap_merge_request_metrics_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +class SwapMergeRequestMetricsIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'merge_request_metrics' + TMP_INDEX_NAME = 'tmp_index_mr_metrics_on_target_project_id_merged_at_nulls_last' + INDEX_NAME = 'index_mr_metrics_on_target_project_id_merged_at_nulls_last' + CONSTRAINT_NAME = 'merge_request_metrics_pkey' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + private + + def swap + add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, + name: 'index_merge_request_metrics_on_id_convert_to_bigint' + add_concurrent_index TABLE_NAME, 'target_project_id, merged_at DESC NULLS LAST, id_convert_to_bigint DESC', + name: TMP_INDEX_NAME + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_convert_to_bigint TO id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_tmp TO id_convert_to_bigint" + + 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 of the columns, and change ownership of the sequence to the new id + execute "ALTER SEQUENCE merge_request_metrics_id_seq OWNED BY #{TABLE_NAME}.id" + change_column_default TABLE_NAME, :id, -> { "nextval('merge_request_metrics_id_seq'::regclass)" } + change_column_default TABLE_NAME, :id_convert_to_bigint, 0 + + # Swap PK constraint + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS #{CONSTRAINT_NAME}" + rename_index TABLE_NAME, 'index_merge_request_metrics_on_id_convert_to_bigint', CONSTRAINT_NAME + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{CONSTRAINT_NAME} PRIMARY KEY USING INDEX #{CONSTRAINT_NAME}" + + # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY) + execute "DROP INDEX IF EXISTS #{INDEX_NAME}" + rename_index TABLE_NAME, TMP_INDEX_NAME, INDEX_NAME + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230313150531_reschedule_migration_for_remediation.rb b/db/post_migrate/20230313150531_reschedule_migration_for_remediation.rb new file mode 100644 index 00000000000..ebb6e53341f --- /dev/null +++ b/db/post_migrate/20230313150531_reschedule_migration_for_remediation.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# rubocop: disable BackgroundMigration/MissingDictionaryFile + +class RescheduleMigrationForRemediation < Gitlab::Database::Migration[2.1] + MIGRATION = 'MigrateRemediationsForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 5000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + + queue_batched_background_migration( + MIGRATION, + :vulnerability_occurrences, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + end +end +# rubocop: enable BackgroundMigration/MissingDictionaryFile diff --git a/db/post_migrate/20230313184306_add_temp_index_for_software_license_cleanup.rb b/db/post_migrate/20230313184306_add_temp_index_for_software_license_cleanup.rb new file mode 100644 index 00000000000..d2e35a0fa9e --- /dev/null +++ b/db/post_migrate/20230313184306_add_temp_index_for_software_license_cleanup.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTempIndexForSoftwareLicenseCleanup < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_index_for_software_licenses_spdx_identifier_cleanup' + + def up + add_concurrent_index :software_licenses, :spdx_identifier, where: 'spdx_identifier IS NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :software_licenses, INDEX_NAME + end +end diff --git a/db/post_migrate/20230313185145_cleanup_orphan_software_licenses.rb b/db/post_migrate/20230313185145_cleanup_orphan_software_licenses.rb new file mode 100644 index 00000000000..af971f692d6 --- /dev/null +++ b/db/post_migrate/20230313185145_cleanup_orphan_software_licenses.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class CleanupOrphanSoftwareLicenses < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class SoftwareLicense < MigrationRecord + self.table_name = 'software_licenses' + end + + class SoftwareLicensePolicy < MigrationRecord + self.table_name = 'software_license_policies' + end + + def up + SoftwareLicense + .where(spdx_identifier: nil) + .where.not( + id: SoftwareLicensePolicy.select(:software_license_id) + ).delete_all + end + + def down + # NO-OP + end +end diff --git a/db/post_migrate/20230314144640_reschedule_migration_for_links.rb b/db/post_migrate/20230314144640_reschedule_migration_for_links.rb new file mode 100644 index 00000000000..26d2f5b1d2c --- /dev/null +++ b/db/post_migrate/20230314144640_reschedule_migration_for_links.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RescheduleMigrationForLinks < Gitlab::Database::Migration[2.1] + MIGRATION = 'MigrateLinksForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 10000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb + end + + def down + # no-op as it is rescheduled via db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb + end +end diff --git a/db/post_migrate/20230314210657_set_email_confirmation_setting_from_soft_email_confirmation_ff.rb b/db/post_migrate/20230314210657_set_email_confirmation_setting_from_soft_email_confirmation_ff.rb new file mode 100644 index 00000000000..d01821ab838 --- /dev/null +++ b/db/post_migrate/20230314210657_set_email_confirmation_setting_from_soft_email_confirmation_ff.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SetEmailConfirmationSettingFromSoftEmailConfirmationFf < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class ApplicationSetting < MigrationRecord + self.table_name = 'application_settings' + end + + class FeatureGates < MigrationRecord + self.table_name = 'feature_gates' + end + + def up + return unless FeatureGates.find_by(feature_key: 'soft_email_confirmation')&.value == 'true' + + ApplicationSetting.update_all(email_confirmation_setting: 1) + end + + def down + ApplicationSetting.update_all(email_confirmation_setting: 0) + end +end diff --git a/db/post_migrate/20230315084704_finalize_issues_iid_scoping_to_namespace.rb b/db/post_migrate/20230315084704_finalize_issues_iid_scoping_to_namespace.rb new file mode 100644 index 00000000000..f9d4013d5f3 --- /dev/null +++ b/db/post_migrate/20230315084704_finalize_issues_iid_scoping_to_namespace.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class FinalizeIssuesIidScopingToNamespace < Gitlab::Database::Migration[2.1] + MIGRATION = 'IssuesInternalIdScopeUpdater' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :internal_ids, + column_name: :id, + job_arguments: [], + finalize: true) + end + + def down; end +end diff --git a/db/post_migrate/20230315161408_finalize_set_notifications_bigint_conversion_backfill.rb b/db/post_migrate/20230315161408_finalize_set_notifications_bigint_conversion_backfill.rb new file mode 100644 index 00000000000..d4a6d86d9cb --- /dev/null +++ b/db/post_migrate/20230315161408_finalize_set_notifications_bigint_conversion_backfill.rb @@ -0,0 +1,34 @@ +# 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 FinalizeSetNotificationsBigintConversionBackfill < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + restrict_gitlab_migration gitlab_schema: :gitlab_main + + disable_ddl_transaction! + + TABLE_NAME = :sent_notifications + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down + # No op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230316014650_remove_index_on_events_action_async.rb b/db/post_migrate/20230316014650_remove_index_on_events_action_async.rb new file mode 100644 index 00000000000..bc4bc4f941d --- /dev/null +++ b/db/post_migrate/20230316014650_remove_index_on_events_action_async.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class RemoveIndexOnEventsActionAsync < Gitlab::Database::Migration[2.1] + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/396830 + def up + prepare_async_index_removal :events, :action, name: 'index_events_on_action' + end + + def down + unprepare_async_index :events, :action, name: 'index_events_on_action' + end +end diff --git a/db/post_migrate/20230316014651_remove_index_on_events_action.rb b/db/post_migrate/20230316014651_remove_index_on_events_action.rb new file mode 100644 index 00000000000..61a3077c330 --- /dev/null +++ b/db/post_migrate/20230316014651_remove_index_on_events_action.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveIndexOnEventsAction < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + remove_concurrent_index :events, :action, name: 'index_events_on_action' + end + + def down + add_concurrent_index :events, :action, name: 'index_events_on_action' + end +end diff --git a/db/post_migrate/20230316073726_backfill_current_value_with_progress_work_item_progresses.rb b/db/post_migrate/20230316073726_backfill_current_value_with_progress_work_item_progresses.rb new file mode 100644 index 00000000000..cad5c74bb8a --- /dev/null +++ b/db/post_migrate/20230316073726_backfill_current_value_with_progress_work_item_progresses.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class BackfillCurrentValueWithProgressWorkItemProgresses < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + each_batch('work_item_progresses', connection: connection) do |relation| + min, max = relation.pick('MIN(issue_id), MAX(issue_id)') + + execute(<<~SQL) + UPDATE work_item_progresses SET current_value = progress + WHERE issue_id BETWEEN #{min} AND #{max} + SQL + end + end + + def down + # no-op as the columns are newly added + end +end diff --git a/db/post_migrate/20230316114426_swap_ci_runner_machine_builds_primary_key.rb b/db/post_migrate/20230316114426_swap_ci_runner_machine_builds_primary_key.rb new file mode 100644 index 00000000000..ea23edf8eb5 --- /dev/null +++ b/db/post_migrate/20230316114426_swap_ci_runner_machine_builds_primary_key.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class SwapCiRunnerMachineBuildsPrimaryKey < Gitlab::Database::Migration[2.1] + def up + # no-op. See https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8588 for details + end + + def down + # no-op. See https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8588 for details + end +end diff --git a/db/post_migrate/20230316164917_remove_packages_events_package_id_fk.rb b/db/post_migrate/20230316164917_remove_packages_events_package_id_fk.rb new file mode 100644 index 00000000000..1b030741564 --- /dev/null +++ b/db/post_migrate/20230316164917_remove_packages_events_package_id_fk.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class RemovePackagesEventsPackageIdFk < Gitlab::Database::Migration[2.1] + FK_NAME = 'fk_rails_c6c20d0094' + SOURCE_TABLE = :packages_events + TARGET_TABLE = :packages_packages + COLUMN = :package_id + + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE, + TARGET_TABLE, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + def down + add_concurrent_foreign_key( + SOURCE_TABLE, + TARGET_TABLE, + name: FK_NAME, + column: COLUMN, + on_delete: :nullify + ) + end +end diff --git a/db/post_migrate/20230316185746_drop_packages_events_table.rb b/db/post_migrate/20230316185746_drop_packages_events_table.rb new file mode 100644 index 00000000000..bb51fc7ae9c --- /dev/null +++ b/db/post_migrate/20230316185746_drop_packages_events_table.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class DropPackagesEventsTable < Gitlab::Database::Migration[2.1] + def up + drop_table :packages_events, if_exists: true + end + + def down + return if table_exists?(:packages_events) + + create_table :packages_events do |t| # rubocop:disable Migration/SchemaAdditionMethodsNoPost + t.integer :event_type, limit: 2, null: false + t.integer :event_scope, limit: 2, null: false + t.integer :originator_type, limit: 2, null: false + t.bigint :originator + t.datetime_with_timezone :created_at, null: false + t.references :package, + index: true, + foreign_key: { to_table: :packages_packages, on_delete: :nullify }, + type: :bigint + end + end +end diff --git a/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb b/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb new file mode 100644 index 00000000000..b4468c851ae --- /dev/null +++ b/db/post_migrate/20230317004428_migrate_daily_redis_hll_events_to_weekly_aggregation.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +class MigrateDailyRedisHllEventsToWeeklyAggregation < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + days_back = 29.days + start_date = Date.today - days_back - 1.day + end_date = Date.today + 1.day + keys = {} + + Gitlab::UsageDataCounters::HLLRedisCounter.known_events.each do |event| + next unless event[:aggregation].to_sym == :daily + + (start_date..end_date).each do |date| + daily_key = redis_key(event, date, :daily) + weekly_key = redis_key(event, date, :weekly) + + keys.key?(weekly_key) ? keys[weekly_key] << daily_key : keys[weekly_key] = [daily_key] + end + end + + keys.each do |weekly_key, daily_keys| + Gitlab::Redis::SharedState.with do |redis| + redis.pfmerge(weekly_key, *daily_keys) + redis.expire(weekly_key, 6.weeks) + end + end + end + + def down + # no-op + end + + # can't set daily key in HLLRedisCounter anymore, so need to duplicate logic here + def redis_key(event, time, aggregation) + key = "{hll_counters}_#{event[:name]}" + if aggregation.to_sym == :daily + year_day = time.strftime('%G-%j') + "#{year_day}-#{key}" + else + year_week = time.strftime('%G-%V') + "#{key}-#{year_week}" + end + end +end diff --git a/db/post_migrate/20230317075852_add_tmp_unique_packages_index_when_debian.rb b/db/post_migrate/20230317075852_add_tmp_unique_packages_index_when_debian.rb new file mode 100644 index 00000000000..9ea8d358366 --- /dev/null +++ b/db/post_migrate/20230317075852_add_tmp_unique_packages_index_when_debian.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTmpUniquePackagesIndexWhenDebian < Gitlab::Database::Migration[2.1] + TABLE_NAME = :packages_packages + PACKAGE_TYPE_DEBIAN = 9 + PACKAGE_STATUS_PENDING_DESTRUCTION = 4 + TMP_DEBIAN_UNIQUE_INDEX_NAME = 'tmp_unique_packages_project_id_and_name_and_version_when_debian' + + disable_ddl_transaction! + + def up + # This index will disallow further duplicates while we're deduplicating the data. + add_concurrent_index TABLE_NAME, [:project_id, :name, :version], + where: "package_type = #{PACKAGE_TYPE_DEBIAN} AND status != #{PACKAGE_STATUS_PENDING_DESTRUCTION} AND + created_at > TIMESTAMP WITH TIME ZONE '#{Time.now.utc}'", + unique: true, + name: TMP_DEBIAN_UNIQUE_INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, TMP_DEBIAN_UNIQUE_INDEX_NAME + end +end diff --git a/db/post_migrate/20230317080000_ensure_unique_debian_packages.rb b/db/post_migrate/20230317080000_ensure_unique_debian_packages.rb new file mode 100644 index 00000000000..250e0cb2369 --- /dev/null +++ b/db/post_migrate/20230317080000_ensure_unique_debian_packages.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +class EnsureUniqueDebianPackages < Gitlab::Database::Migration[2.1] + BATCH_SIZE = 1_000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class Package < MigrationRecord + include EachBatch + + self.table_name = 'packages_packages' + + enum package_type: { debian: 9 } + + enum status: { pending_destruction: 4 } + end + + def up + Package.distinct_each_batch(column: :project_id) do |package_projects| + project_ids = package_projects.pluck(:project_id) + duplicates = Package.debian + .not_pending_destruction + .where(project_id: project_ids) + .select('project_id, name, version, MAX(id) as last_id') + .group(:project_id, :name, :version) + .having('count(id) > 1') + loop do + duplicates.limit(BATCH_SIZE).each do |duplicate| + Package.debian + .not_pending_destruction + .where( + project_id: duplicate.project_id, + name: duplicate.name, + version: duplicate.version, + id: ..duplicate.last_id - 1 + ).update_all status: :pending_destruction + end + break unless duplicates.exists? + end + end + end + + def down + # nothing to do + end +end diff --git a/db/post_migrate/20230317080137_add_unique_packages_index_when_debian.rb b/db/post_migrate/20230317080137_add_unique_packages_index_when_debian.rb new file mode 100644 index 00000000000..b079e860c0f --- /dev/null +++ b/db/post_migrate/20230317080137_add_unique_packages_index_when_debian.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddUniquePackagesIndexWhenDebian < Gitlab::Database::Migration[2.1] + TABLE_NAME = :packages_packages + PACKAGE_TYPE_DEBIAN = 9 + PACKAGE_STATUS_PENDING_DESTRUCTION = 4 + TMP_DEBIAN_UNIQUE_INDEX_NAME = 'tmp_unique_packages_project_id_and_name_and_version_when_debian' + DEBIAN_UNIQUE_INDEX_NAME = 'unique_packages_project_id_and_name_and_version_when_debian' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE_NAME, [:project_id, :name, :version], + where: "package_type = #{PACKAGE_TYPE_DEBIAN} AND status != #{PACKAGE_STATUS_PENDING_DESTRUCTION}", + unique: true, + name: DEBIAN_UNIQUE_INDEX_NAME + remove_concurrent_index_by_name TABLE_NAME, TMP_DEBIAN_UNIQUE_INDEX_NAME + end + + def down + # This index will disallow further duplicates while we're deduplicating the data. + add_concurrent_index TABLE_NAME, [:project_id, :name, :version], + where: "package_type = #{PACKAGE_TYPE_DEBIAN} AND status != #{PACKAGE_STATUS_PENDING_DESTRUCTION} AND + created_at > TIMESTAMP WITH TIME ZONE '#{Time.now.utc}'", + unique: true, + name: TMP_DEBIAN_UNIQUE_INDEX_NAME + remove_concurrent_index_by_name TABLE_NAME, DEBIAN_UNIQUE_INDEX_NAME + end +end diff --git a/db/post_migrate/20230317151841_remove_from_to_state_constraint.rb b/db/post_migrate/20230317151841_remove_from_to_state_constraint.rb new file mode 100644 index 00000000000..21913d394d1 --- /dev/null +++ b/db/post_migrate/20230317151841_remove_from_to_state_constraint.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveFromToStateConstraint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + constraint_name = check_constraint_name( + 'vulnerability_state_transitions', + 'fully_qualified_table_name', + 'state_not_equal') + remove_check_constraint(:vulnerability_state_transitions, constraint_name) + end + + def down + constraint_name = check_constraint_name( + 'vulnerability_state_transitions', + 'fully_qualified_table_name', + 'state_not_equal') + add_check_constraint(:vulnerability_state_transitions, '(from_state != to_state)', constraint_name) + end +end diff --git a/db/post_migrate/20230317195228_prepare_async_sent_notifications_index.rb b/db/post_migrate/20230317195228_prepare_async_sent_notifications_index.rb new file mode 100644 index 00000000000..ea035b3ee58 --- /dev/null +++ b/db/post_migrate/20230317195228_prepare_async_sent_notifications_index.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class PrepareAsyncSentNotificationsIndex < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :sent_notifications + COLUMN_NAME = :id_convert_to_bigint + INDEX_NAME = :index_sent_notifications_on_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME, unique: true + end + + def down + return unless should_run? + + unprepare_async_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230319105436_remove_member_role_download_code.rb b/db/post_migrate/20230319105436_remove_member_role_download_code.rb new file mode 100644 index 00000000000..34921b8d806 --- /dev/null +++ b/db/post_migrate/20230319105436_remove_member_role_download_code.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RemoveMemberRoleDownloadCode < Gitlab::Database::Migration[2.1] + def change + remove_column :member_roles, :download_code, :boolean, default: false + end +end diff --git a/db/post_migrate/20230320110802_add_index_to_vulnerability_findings_on_uuid.rb b/db/post_migrate/20230320110802_add_index_to_vulnerability_findings_on_uuid.rb new file mode 100644 index 00000000000..6795a7ecbe7 --- /dev/null +++ b/db/post_migrate/20230320110802_add_index_to_vulnerability_findings_on_uuid.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexToVulnerabilityFindingsOnUuid < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_vuln_findings_on_uuid_including_vuln_id' + + disable_ddl_transaction! + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/397740 + + def up + prepare_async_index_from_sql <<-SQL + CREATE UNIQUE INDEX CONCURRENTLY #{INDEX_NAME} ON vulnerability_occurrences (uuid) include (vulnerability_id); + SQL + end + + def down + unprepare_async_index_by_name(:vulnerability_occurrences, INDEX_NAME) + end +end diff --git a/db/post_migrate/20230320155635_add_index_to_namespace_details.rb b/db/post_migrate/20230320155635_add_index_to_namespace_details.rb new file mode 100644 index 00000000000..de00c57836b --- /dev/null +++ b/db/post_migrate/20230320155635_add_index_to_namespace_details.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToNamespaceDetails < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_fuc_over_limit_notified_at' + TABLE_NAME = 'namespace_details' + COLUMN_NAME = 'free_user_cap_over_limit_notified_at' + + def up + add_concurrent_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230321003252_swap_commit_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230321003252_swap_commit_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..6b75ca44cc2 --- /dev/null +++ b/db/post_migrate/20230321003252_swap_commit_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +class SwapCommitUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'commit_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing commit_user_mentions_on_commit_id_and_note_id_unique_index + add_concurrent_index TABLE_NAME, [:commit_id, :note_id_convert_to_bigint], unique: true, + name: 'commit_user_mentions_on_commit_id_and_note_id_convert_to_bigint' + + # This will replace the existing index_commit_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_commit_user_mentions_on_note_id_convert_to_bigint' + + # This will replace the existing fk_rails_a6760813e0 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_commit_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :note_id, nil + change_column_default TABLE_NAME, :note_id_convert_to_bigint, 0 + + execute 'DROP INDEX IF EXISTS commit_user_mentions_on_commit_id_and_note_id_unique_index' + rename_index TABLE_NAME, 'commit_user_mentions_on_commit_id_and_note_id_convert_to_bigint', + 'commit_user_mentions_on_commit_id_and_note_id_unique_index' + + execute 'DROP INDEX IF EXISTS index_commit_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_commit_user_mentions_on_note_id_convert_to_bigint', + 'index_commit_user_mentions_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_a6760813e0" + rename_constraint(TABLE_NAME, 'fk_commit_user_mentions_note_id_convert_to_bigint', 'fk_rails_a6760813e0') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321011529_ensure_vum_bigint_backfill_is_finished_for_gl_dot_com.rb b/db/post_migrate/20230321011529_ensure_vum_bigint_backfill_is_finished_for_gl_dot_com.rb new file mode 100644 index 00000000000..be4eb05634a --- /dev/null +++ b/db/post_migrate/20230321011529_ensure_vum_bigint_backfill_is_finished_for_gl_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureVumBigintBackfillIsFinishedForGlDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'vulnerability_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321011903_swap_vulnerability_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230321011903_swap_vulnerability_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..6c5c001fe0f --- /dev/null +++ b/db/post_migrate/20230321011903_swap_vulnerability_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +class SwapVulnerabilityUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'vulnerability_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing index_vulnerability_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_vulnerability_user_mentions_on_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + # This will replace the existing index_vulns_user_mentions_on_vulnerability_id + add_concurrent_index TABLE_NAME, :vulnerability_id, unique: true, + name: 'tmp_index_vulns_user_mentions_on_vulnerability_id', + where: 'note_id_convert_to_bigint IS NULL' + + # This will replace the existing index_vulns_user_mentions_on_vulnerability_id_and_note_id + add_concurrent_index TABLE_NAME, [:vulnerability_id, :note_id_convert_to_bigint], unique: true, + name: 'tmp_index_vulns_user_mentions_on_vulnerability_id_and_note_id' + + # This will replace the existing fk_rails_a18600f210 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_vulnerability_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS index_vulnerability_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_vulnerability_user_mentions_on_note_id_convert_to_bigint', + 'index_vulnerability_user_mentions_on_note_id' + + execute 'DROP INDEX IF EXISTS index_vulns_user_mentions_on_vulnerability_id' + rename_index TABLE_NAME, 'tmp_index_vulns_user_mentions_on_vulnerability_id', + 'index_vulns_user_mentions_on_vulnerability_id' + + execute 'DROP INDEX IF EXISTS index_vulns_user_mentions_on_vulnerability_id_and_note_id' + rename_index TABLE_NAME, 'tmp_index_vulns_user_mentions_on_vulnerability_id_and_note_id', + 'index_vulns_user_mentions_on_vulnerability_id_and_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_a18600f210" + rename_constraint(TABLE_NAME, 'fk_vulnerability_user_mentions_note_id_convert_to_bigint', 'fk_rails_a18600f210') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321024333_ensure_design_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230321024333_ensure_design_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..175bc317406 --- /dev/null +++ b/db/post_migrate/20230321024333_ensure_design_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureDesignUserMentionsNoteIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'design_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321024903_swap_design_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230321024903_swap_design_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..ead6adc2e80 --- /dev/null +++ b/db/post_migrate/20230321024903_swap_design_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +class SwapDesignUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'design_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing design_user_mentions_on_design_id_and_note_id_unique_index + add_concurrent_index TABLE_NAME, [:design_id, :note_id_convert_to_bigint], unique: true, + name: 'design_um_on_design_id_and_note_id_convert_to_bigint_unique' + + # This will replace the existing index_design_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_design_user_mentions_on_note_id_convert_to_bigint' + + # This will replace the existing fk_rails_8de8c6d632 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_design_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :note_id, nil + change_column_default TABLE_NAME, :note_id_convert_to_bigint, 0 + + execute 'DROP INDEX IF EXISTS design_user_mentions_on_design_id_and_note_id_unique_index' + rename_index TABLE_NAME, 'design_um_on_design_id_and_note_id_convert_to_bigint_unique', + 'design_user_mentions_on_design_id_and_note_id_unique_index' + + execute 'DROP INDEX IF EXISTS index_design_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_design_user_mentions_on_note_id_convert_to_bigint', + 'index_design_user_mentions_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_8de8c6d632" + rename_constraint(TABLE_NAME, 'fk_design_user_mentions_note_id_convert_to_bigint', 'fk_rails_8de8c6d632') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321095759_remove_namespaces_broadcast_messages_namespace_id_fk.rb b/db/post_migrate/20230321095759_remove_namespaces_broadcast_messages_namespace_id_fk.rb new file mode 100644 index 00000000000..b22fb1d547d --- /dev/null +++ b/db/post_migrate/20230321095759_remove_namespaces_broadcast_messages_namespace_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveNamespacesBroadcastMessagesNamespaceIdFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:broadcast_messages, :namespaces, name: "fk_7bf2ec43da") + + with_lock_retries do + remove_foreign_key_if_exists(:broadcast_messages, :namespaces, + name: "fk_7bf2ec43da", reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:broadcast_messages, :namespaces, + name: "fk_7bf2ec43da", column: :namespace_id, + target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20230321124837_remove_ci_builds_partition_id_default.rb b/db/post_migrate/20230321124837_remove_ci_builds_partition_id_default.rb new file mode 100644 index 00000000000..a3a80fc6110 --- /dev/null +++ b/db/post_migrate/20230321124837_remove_ci_builds_partition_id_default.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveCiBuildsPartitionIdDefault < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + # no-op. See https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8588 for details. + end + + def down + # no-op. See https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8588 for details. + end +end diff --git a/db/post_migrate/20230321153035_add_package_id_created_at_desc_index_to_package_files.rb b/db/post_migrate/20230321153035_add_package_id_created_at_desc_index_to_package_files.rb new file mode 100644 index 00000000000..cb8fae70295 --- /dev/null +++ b/db/post_migrate/20230321153035_add_package_id_created_at_desc_index_to_package_files.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPackageIdCreatedAtDescIndexToPackageFiles < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_package_files_on_package_id_and_created_at_desc' + + def up + add_concurrent_index :packages_package_files, 'package_id, created_at DESC', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230321153337_cleanup_ml_candidates_iid_rename.rb b/db/post_migrate/20230321153337_cleanup_ml_candidates_iid_rename.rb new file mode 100644 index 00000000000..9db01b45ded --- /dev/null +++ b/db/post_migrate/20230321153337_cleanup_ml_candidates_iid_rename.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class CleanupMlCandidatesIidRename < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + cleanup_concurrent_column_rename :ml_candidates, :iid, :eid + end + + def down + undo_cleanup_concurrent_column_rename :ml_candidates, :iid, :eid + end +end diff --git a/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb b/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb new file mode 100644 index 00000000000..680a496e639 --- /dev/null +++ b/db/post_migrate/20230321163547_cleanup_conversion_big_int_ci_build_needs.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class CleanupConversionBigIntCiBuildNeeds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + TABLE = :ci_build_needs + + def up + return unless should_run? + + cleanup_conversion_of_integer_to_bigint(TABLE, :id) + end + + def down + return unless should_run? + + restore_conversion_of_integer_to_bigint(TABLE, :id) + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230321163947_backfill_ml_candidates_project_id.rb b/db/post_migrate/20230321163947_backfill_ml_candidates_project_id.rb new file mode 100644 index 00000000000..cfcc8a4978d --- /dev/null +++ b/db/post_migrate/20230321163947_backfill_ml_candidates_project_id.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class BackfillMlCandidatesProjectId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + sql = <<-SQL + UPDATE ml_candidates + SET project_id = temp.project_id + FROM ( + SELECT ml_candidates.id AS id, ml_experiments.project_id AS project_id + FROM ml_candidates INNER JOIN ml_experiments ON ml_candidates.experiment_id = ml_experiments.id + ) AS temp + WHERE ml_candidates.id = temp.id + SQL + + execute(sql) + end + + def down; end +end diff --git a/db/post_migrate/20230321170823_backfill_ml_candidates_internal_id.rb b/db/post_migrate/20230321170823_backfill_ml_candidates_internal_id.rb new file mode 100644 index 00000000000..b66f846bddb --- /dev/null +++ b/db/post_migrate/20230321170823_backfill_ml_candidates_internal_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class BackfillMlCandidatesInternalId < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + sql = <<-SQL + UPDATE ml_candidates + SET internal_id = temp.internal_id_num + FROM ( + SELECT id, ROW_NUMBER() OVER (PARTITION BY project_id ORDER BY internal_id, id ASC) AS internal_id_num + FROM ml_candidates + ) AS temp + WHERE ml_candidates.id = temp.id + SQL + + execute(sql) + end + + def down; end +end diff --git a/db/post_migrate/20230322011220_ensure_snippet_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230322011220_ensure_snippet_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..c4a936777d6 --- /dev/null +++ b/db/post_migrate/20230322011220_ensure_snippet_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureSnippetUserMentionsBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'snippet_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230322012209_swap_snippet_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230322012209_swap_snippet_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..3a79adb7488 --- /dev/null +++ b/db/post_migrate/20230322012209_swap_snippet_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +class SwapSnippetUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'snippet_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing index_snippet_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_snippet_user_mentions_on_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + # This will replace the existing snippet_user_mentions_on_snippet_id_and_note_id_index + add_concurrent_index TABLE_NAME, [:snippet_id, :note_id_convert_to_bigint], unique: true, + name: 'tmp_snippet_user_mentions_on_snippet_id_and_note_id_index' + + # This will replace the existing snippet_user_mentions_on_snippet_id_index + add_concurrent_index TABLE_NAME, :snippet_id, unique: true, + name: 'tmp_snippet_user_mentions_on_snippet_id_index', + where: 'note_id_convert_to_bigint IS NULL' + + # This will replace the existing fk_rails_4d3f96b2cb + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_snippet_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS index_snippet_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_snippet_user_mentions_on_note_id_convert_to_bigint', + 'index_snippet_user_mentions_on_note_id' + + execute 'DROP INDEX IF EXISTS snippet_user_mentions_on_snippet_id_and_note_id_index' + rename_index TABLE_NAME, 'tmp_snippet_user_mentions_on_snippet_id_and_note_id_index', + 'snippet_user_mentions_on_snippet_id_and_note_id_index' + + execute 'DROP INDEX IF EXISTS snippet_user_mentions_on_snippet_id_index' + rename_index TABLE_NAME, 'tmp_snippet_user_mentions_on_snippet_id_index', + 'snippet_user_mentions_on_snippet_id_index' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_4d3f96b2cb" + rename_constraint(TABLE_NAME, 'fk_snippet_user_mentions_note_id_convert_to_bigint', 'fk_rails_4d3f96b2cb') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..40b4967b306 --- /dev/null +++ b/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureNoteDiffFilesBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'note_diff_files', + column_name: 'id', + job_arguments: [['diff_note_id'], ['diff_note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230322085041_remove_user_namespace_records_from_vsa_aggregation.rb b/db/post_migrate/20230322085041_remove_user_namespace_records_from_vsa_aggregation.rb new file mode 100644 index 00000000000..6fc23c742b9 --- /dev/null +++ b/db/post_migrate/20230322085041_remove_user_namespace_records_from_vsa_aggregation.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class RemoveUserNamespaceRecordsFromVsaAggregation < Gitlab::Database::Migration[2.1] + BATCH_SIZE = 100 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + aggregations_model = define_batchable_model('analytics_cycle_analytics_aggregations') + namespaces_model = define_batchable_model('namespaces') + + aggregations_model.each_batch(of: BATCH_SIZE) do |relation| + inner_query = namespaces_model + .where(type: 'Group') + .where(aggregations_model.arel_table[:group_id].eq(namespaces_model.arel_table[:id])) + + relation.where('NOT EXISTS (?)', inner_query).delete_all + end + end + + def down + # noop + end +end diff --git a/db/post_migrate/20230322085852_validate_partitioning_constraint_on_ci_builds.rb b/db/post_migrate/20230322085852_validate_partitioning_constraint_on_ci_builds.rb new file mode 100644 index 00000000000..01612c82be5 --- /dev/null +++ b/db/post_migrate/20230322085852_validate_partitioning_constraint_on_ci_builds.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class ValidatePartitioningConstraintOnCiBuilds < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + validate_check_constraint :ci_builds, :partitioning_constraint + end + + # No-op + def down; end +end diff --git a/db/post_migrate/20230322151635_cleanup_bigint_conversion_for_merge_request_metrics.rb b/db/post_migrate/20230322151635_cleanup_bigint_conversion_for_merge_request_metrics.rb new file mode 100644 index 00000000000..d3ff224dbd7 --- /dev/null +++ b/db/post_migrate/20230322151635_cleanup_bigint_conversion_for_merge_request_metrics.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForMergeRequestMetrics < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE = :merge_request_metrics + + def up + return unless should_run? + + # rubocop:disable Migration/WithLockRetriesDisallowedMethod + with_lock_retries do + cleanup_conversion_of_integer_to_bigint(TABLE, :id) + end + # rubocop:enable Migration/WithLockRetriesDisallowedMethod + end + + def down + return unless should_run? + + restore_conversion_of_integer_to_bigint(TABLE, :id) + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230322203927_change_user_type_default.rb b/db/post_migrate/20230322203927_change_user_type_default.rb new file mode 100644 index 00000000000..792e9717c9f --- /dev/null +++ b/db/post_migrate/20230322203927_change_user_type_default.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ChangeUserTypeDefault < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + change_column_default :users, :user_type, 0 + end + + def down + change_column_default :users, :user_type, nil + end +end diff --git a/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..2550b5b07e9 --- /dev/null +++ b/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddUniqueIndexDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :note_diff_files + INDEX_NAME = :index_note_diff_files_on_diff_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing index_note_diff_files_on_diff_note_id + add_concurrent_index TABLE_NAME, :diff_note_id_convert_to_bigint, unique: true, + name: INDEX_NAME + end + + def down + return unless should_run? + + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..d2c833fd8d6 --- /dev/null +++ b/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +class AddFkOnDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :note_diff_files + TARGET_TABLE_NAME = :notes + FK_NAME = :fk_note_diff_files_diff_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing fk_rails_3d66047aeb + # when we swap the integer and bigint columns + add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME, + column: :diff_note_id_convert_to_bigint, + name: FK_NAME, + on_delete: :cascade, + reverse_lock_order: true, + validate: false + end + + def down + return unless should_run? + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..1e65fae223a --- /dev/null +++ b/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AsyncValidateFkNoteDiffFilesDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :note_diff_files + COLUMN = :diff_note_id_convert_to_bigint + FK_NAME = :fk_note_diff_files_diff_note_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb b/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb new file mode 100644 index 00000000000..f034bc21847 --- /dev/null +++ b/db/post_migrate/20230323131521_remove_machine_id_from_builds_metadata.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RemoveMachineIdFromBuildsMetadata < 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 + with_lock_retries do + remove_column :p_ci_builds_metadata, :runner_machine_id, if_exists: true + end + end + + def down + add_column :p_ci_builds_metadata, :runner_machine_id, :bigint, if_not_exists: true # rubocop: disable Migration/SchemaAdditionMethodsNoPost + + add_concurrent_partitioned_index :p_ci_builds_metadata, :runner_machine_id, name: INDEX_NAME, + where: 'runner_machine_id IS NOT NULL' + end +end diff --git a/db/post_migrate/20230323153433_fix_application_setting_push_rule_id_fk.rb b/db/post_migrate/20230323153433_fix_application_setting_push_rule_id_fk.rb new file mode 100644 index 00000000000..235959bfa0c --- /dev/null +++ b/db/post_migrate/20230323153433_fix_application_setting_push_rule_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class FixApplicationSettingPushRuleIdFk < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + # This migration fixes missing `track_record_deletions(:push_rules)` + # where the `application_settings.push_rule_id` would not be reset + # after removing push rule. + + def up + execute <<~SQL + UPDATE application_settings SET push_rule_id=NULL + WHERE push_rule_id IS NOT NULL AND NOT EXISTS ( + SELECT * FROM push_rules WHERE push_rules.id = application_settings.push_rule_id + ) + SQL + end + + def down; end +end diff --git a/db/post_migrate/20230327103401_queue_migrate_human_user_type.rb b/db/post_migrate/20230327103401_queue_migrate_human_user_type.rb new file mode 100644 index 00000000000..d686c70cb5a --- /dev/null +++ b/db/post_migrate/20230327103401_queue_migrate_human_user_type.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class QueueMigrateHumanUserType < Gitlab::Database::Migration[2.1] + MIGRATION = "MigrateHumanUserType" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 2000 + SUB_BATCH_SIZE = 10 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :users, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :users, :id, []) + end +end diff --git a/db/post_migrate/20230327125705_add_index_to_vulnerability_finding_signatures_on_signature_sha.rb b/db/post_migrate/20230327125705_add_index_to_vulnerability_finding_signatures_on_signature_sha.rb new file mode 100644 index 00000000000..1b2f156ce3c --- /dev/null +++ b/db/post_migrate/20230327125705_add_index_to_vulnerability_finding_signatures_on_signature_sha.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToVulnerabilityFindingSignaturesOnSignatureSha < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_vulnerability_finding_signatures_on_signature_sha' + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerability_finding_signatures, :signature_sha, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_finding_signatures, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230327144152_remove_ci_builds_partition_id_default_v2.rb b/db/post_migrate/20230327144152_remove_ci_builds_partition_id_default_v2.rb new file mode 100644 index 00000000000..188f597805f --- /dev/null +++ b/db/post_migrate/20230327144152_remove_ci_builds_partition_id_default_v2.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveCiBuildsPartitionIdDefaultV2 < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + change_column_default :ci_builds, :partition_id, from: 100, to: nil + end + + def down + change_column_default :ci_builds, :partition_id, from: nil, to: 100 + end +end diff --git a/db/post_migrate/20230328023554_backfill_award_emoji_awardable_id_for_bigint_conversion.rb b/db/post_migrate/20230328023554_backfill_award_emoji_awardable_id_for_bigint_conversion.rb new file mode 100644 index 00000000000..c083b0a8e4c --- /dev/null +++ b/db/post_migrate/20230328023554_backfill_award_emoji_awardable_id_for_bigint_conversion.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class BackfillAwardEmojiAwardableIdForBigintConversion < Gitlab::Database::Migration[2.1] + TABLE = :award_emoji + COLUMNS = %i[awardable_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/20230328030101_add_secureflag_training_provider.rb b/db/post_migrate/20230328030101_add_secureflag_training_provider.rb new file mode 100644 index 00000000000..4b32570ea56 --- /dev/null +++ b/db/post_migrate/20230328030101_add_secureflag_training_provider.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class AddSecureflagTrainingProvider < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + SECUREFLAG_DATA = { + name: 'SecureFlag', + description: "Get remediation advice with example code and recommended hands-on labs in a fully + interactive virtualised environment.", + url: "https://knowledge-base-api.secureflag.com/gitlab" + } + + class TrainingProvider < MigrationRecord + self.table_name = 'security_training_providers' + end + + def up + current_time = Time.current + timestamps = { created_at: current_time, updated_at: current_time } + + TrainingProvider.reset_column_information + TrainingProvider.upsert(SECUREFLAG_DATA.merge(timestamps)) + end + + def down + TrainingProvider.reset_column_information + TrainingProvider.find_by(name: SECUREFLAG_DATA[:name])&.destroy + end +end diff --git a/db/post_migrate/20230328031838_backfill_events_target_id_for_bigint_conversion.rb b/db/post_migrate/20230328031838_backfill_events_target_id_for_bigint_conversion.rb new file mode 100644 index 00000000000..711eb1d2e67 --- /dev/null +++ b/db/post_migrate/20230328031838_backfill_events_target_id_for_bigint_conversion.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class BackfillEventsTargetIdForBigintConversion < Gitlab::Database::Migration[2.1] + TABLE = :events + COLUMNS = %i[target_id] + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 100_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/20230328100534_truncate_error_tracking_tables.rb b/db/post_migrate/20230328100534_truncate_error_tracking_tables.rb new file mode 100644 index 00000000000..3b263303795 --- /dev/null +++ b/db/post_migrate/20230328100534_truncate_error_tracking_tables.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class TruncateErrorTrackingTables < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # Only truncate tables on Gitlab.com environments. + # TRUNCATE is a DDL statement (it drops the table and re-creates it), so we want to run the + # migration in DDL mode, but we also don't want to execute it against all schemas because + # it's considered a write operation. So, we'll manually check and skip the migration if + # it's on not `:gitlab_main`. + return unless Gitlab.com? && Gitlab::Database.gitlab_schemas_for_connection(connection).include?(:gitlab_main) + + execute('TRUNCATE table error_tracking_errors CASCADE') + end + + def down + # noop + end +end diff --git a/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb b/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb new file mode 100644 index 00000000000..f09888bd821 --- /dev/null +++ b/db/post_migrate/20230328111013_re_migrate_redis_slot_keys.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + Gitlab::UsageDataCounters::HLLRedisCounter.known_events.each do |event| + if event[:aggregation].to_sym == :daily + migrate_daily_aggregated(event) + else + migrate_weekly_aggregated(event) + end + end + end + + def down + # no-op + end + + private + + def migrate_daily_aggregated(event) + days_back = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH + start_date = Date.today - days_back - 1.day + end_date = Date.today + 1.day + + (start_date..end_date).each do |date| + rename_key(event, date) + end + end + + def migrate_weekly_aggregated(event) + weeks_back = Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH + start_date = (Date.today - weeks_back).beginning_of_week - 1.day + end_date = Date.today.end_of_week + 1.day + + (start_date..end_date).step(7).each { |date| rename_key(event, date) } + end + + def rename_key(event, date) + old_key = old_redis_key(event, date) + new_key = new_redis_key(event, date) + + # cannot simply rename due to different slots + Gitlab::Redis::SharedState.with do |redis| + hll_blob = redis.get(old_key) + + break unless hll_blob + + temp_key = new_key + "_#{Time.current.to_i}" + ttl = redis.ttl(old_key) + ttl = ttl > 0 ? ttl : Gitlab::UsageDataCounters::HLLRedisCounter.send(:expiry, event) + + redis.multi do |multi| + multi.set(temp_key, hll_blob, ex: 1.day.to_i) + multi.pfmerge(new_key, new_key, temp_key) + multi.expire(new_key, ttl) + end + + redis.del(temp_key) + end + end + + def old_redis_key(event, time) + name_with_slot = if event[:redis_slot].present? + event[:name].to_s.gsub(event[:redis_slot], "{#{event[:redis_slot]}}") + else + "{#{event[:name]}}" + end + + apply_time_aggregation(name_with_slot, time, event) + end + + def new_redis_key(event, time) + key = "{hll_counters}_#{event[:name]}" + apply_time_aggregation(key, time, event) + end + + def apply_time_aggregation(key, time, event) + if event[:aggregation].to_sym == :daily + year_day = time.strftime('%G-%j') + "#{year_day}-#{key}" + else + year_week = time.strftime('%G-%V') + "#{key}-#{year_week}" + end + end +end diff --git a/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb b/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb new file mode 100644 index 00000000000..d8d3360221c --- /dev/null +++ b/db/post_migrate/20230328151756_prepare_async_index_for_security_scans_on_pipeline_id_and_scan_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexForSecurityScansOnPipelineIdAndScanType < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_security_scans_on_pipeline_id_and_scan_type' + + disable_ddl_transaction! + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402978 + def up + prepare_async_index :security_scans, [:pipeline_id, :scan_type], name: INDEX_NAME + end + + def down + unprepare_async_index :security_scans, [:pipeline_id, :scan_type], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230328184031_swap_sent_notifications_id_columns.rb b/db/post_migrate/20230328184031_swap_sent_notifications_id_columns.rb new file mode 100644 index 00000000000..a2a0751c38a --- /dev/null +++ b/db/post_migrate/20230328184031_swap_sent_notifications_id_columns.rb @@ -0,0 +1,59 @@ +# 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 SwapSentNotificationsIdColumns < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :sent_notifications + COLUMN_NAME = :id_convert_to_bigint + INDEX_NAME = :index_sent_notifications_on_id_convert_to_bigint + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + add_concurrent_index TABLE_NAME, COLUMN_NAME, unique: true, name: INDEX_NAME + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Swap Columns + temp_name = quote_column_name(:id_tmp) + id_name = quote_column_name(:id) + id_convert_to_bigint_name = quote_column_name(COLUMN_NAME) + 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}" + + # Reset trigger + 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" + + execute "ALTER SEQUENCE #{TABLE_NAME}_id_seq OWNED BY #{TABLE_NAME}.id" + change_column_default TABLE_NAME, :id, -> { "nextval('#{TABLE_NAME}_id_seq'::regclass)" } + change_column_default TABLE_NAME, :id_convert_to_bigint, 0 + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT #{TABLE_NAME}_pkey CASCADE" + rename_index TABLE_NAME, INDEX_NAME, "#{TABLE_NAME}_pkey" + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{TABLE_NAME}_pkey PRIMARY KEY USING INDEX #{TABLE_NAME}_pkey" + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230329091107_truncate_p_ci_runner_machine_builds.rb b/db/post_migrate/20230329091107_truncate_p_ci_runner_machine_builds.rb new file mode 100644 index 00000000000..bf5d17857f6 --- /dev/null +++ b/db/post_migrate/20230329091107_truncate_p_ci_runner_machine_builds.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class TruncatePCiRunnerMachineBuilds < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + truncate_tables!('p_ci_runner_machine_builds') + end + + # no-op + def down; end +end diff --git a/db/post_migrate/20230329091300_swap_ci_runner_machine_builds_primary_key_v2.rb b/db/post_migrate/20230329091300_swap_ci_runner_machine_builds_primary_key_v2.rb new file mode 100644 index 00000000000..ad40ed118b1 --- /dev/null +++ b/db/post_migrate/20230329091300_swap_ci_runner_machine_builds_primary_key_v2.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +class SwapCiRunnerMachineBuildsPrimaryKeyV2 < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + TABLE_NAME = :p_ci_runner_machine_builds + BUILDS_TABLE = :ci_builds + + def up + reorder_primary_key_columns([:build_id, :partition_id]) + end + + def down + reorder_primary_key_columns([:partition_id, :build_id]) + end + + private + + def reorder_primary_key_columns(columns) + with_lock_retries(raise_on_exhaustion: true) do + connection.execute(<<~SQL) + LOCK TABLE #{BUILDS_TABLE}, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE; + SQL + + partitions = Gitlab::Database::PostgresPartitionedTable.each_partition(TABLE_NAME).to_a + partitions.each { |partition| drop_table partition.identifier } + + execute <<~SQL + ALTER TABLE #{TABLE_NAME} + DROP CONSTRAINT p_ci_runner_machine_builds_pkey CASCADE; + + ALTER TABLE #{TABLE_NAME} + ADD PRIMARY KEY (#{columns.join(', ')}); + SQL + + partitions.each do |partition| + connection.execute(<<~SQL) + CREATE TABLE IF NOT EXISTS #{partition.identifier} + PARTITION OF #{partition.parent_identifier} #{partition.condition}; + SQL + end + end + end +end diff --git a/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb b/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb new file mode 100644 index 00000000000..3013de7c31b --- /dev/null +++ b/db/post_migrate/20230329100222_drop_software_licenses_temp_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropSoftwareLicensesTempIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :software_licenses + INDEX_NAME = 'tmp_index_for_software_licenses_spdx_identifier_cleanup' + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index TABLE_NAME, :spdx_identifier, where: 'spdx_identifier IS NULL', name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230329163232_add_index_to_security_scans_on_pipeline_id_and_scan_type.rb b/db/post_migrate/20230329163232_add_index_to_security_scans_on_pipeline_id_and_scan_type.rb new file mode 100644 index 00000000000..d5d7b375cda --- /dev/null +++ b/db/post_migrate/20230329163232_add_index_to_security_scans_on_pipeline_id_and_scan_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToSecurityScansOnPipelineIdAndScanType < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_security_scans_on_pipeline_id_and_scan_type' + + disable_ddl_transaction! + + def up + add_concurrent_index :security_scans, [:pipeline_id, :scan_type], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :security_scans, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230330080731_remove_tmp_index_vuln_occurrences_on_report_type.rb b/db/post_migrate/20230330080731_remove_tmp_index_vuln_occurrences_on_report_type.rb new file mode 100644 index 00000000000..27e5b370efc --- /dev/null +++ b/db/post_migrate/20230330080731_remove_tmp_index_vuln_occurrences_on_report_type.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveTmpIndexVulnOccurrencesOnReportType < Gitlab::Database::Migration[2.1] + def up + # no-op + # This migration was reverted as it removed a temporary index necessary for a background migration. + # The migration file is re-added to ensure that all environments have the same list of migrations. + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230330103104_reschedule_migrate_evidences.rb b/db/post_migrate/20230330103104_reschedule_migrate_evidences.rb new file mode 100644 index 00000000000..8590e582373 --- /dev/null +++ b/db/post_migrate/20230330103104_reschedule_migrate_evidences.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RescheduleMigrateEvidences < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'MigrateEvidencesForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 10000 + + def up + # no-op as it has been rescheduled via db/post_migrate/20230508150219_reschedule_evidences_handling_unicode.rb + end + + def down + # no-op as it has been rescheduled via db/post_migrate/20230508150219_reschedule_evidences_handling_unicode.rb + end +end diff --git a/db/post_migrate/20230403023828_swap_note_diff_files_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230403023828_swap_note_diff_files_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..6a453722de9 --- /dev/null +++ b/db/post_migrate/20230403023828_swap_note_diff_files_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +class SwapNoteDiffFilesNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'note_diff_files' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + + add_concurrent_index TABLE_NAME, :diff_note_id_convert_to_bigint, unique: true, + name: 'index_note_diff_files_on_diff_note_id_convert_to_bigint' + + add_concurrent_foreign_key TABLE_NAME, :notes, column: :diff_note_id_convert_to_bigint, + name: 'fk_note_diff_files_diff_note_id_convert_to_bigint', + on_delete: :cascade, + validate: false + end + + def swap + # This will replace the existing index_note_diff_files_on_diff_note_id + add_concurrent_index TABLE_NAME, :diff_note_id_convert_to_bigint, unique: true, + name: 'index_note_diff_files_on_diff_note_id_convert_to_bigint' + + # This will replace the existing fk_rails_3d66047aeb + add_concurrent_foreign_key TABLE_NAME, :notes, column: :diff_note_id_convert_to_bigint, + name: 'fk_note_diff_files_diff_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id TO diff_note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id_convert_to_bigint TO diff_note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN diff_note_id_tmp TO diff_note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:diff_note_id, :diff_note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :diff_note_id, nil + change_column_default TABLE_NAME, :diff_note_id_convert_to_bigint, 0 + + execute 'DROP INDEX IF EXISTS index_note_diff_files_on_diff_note_id' + rename_index TABLE_NAME, 'index_note_diff_files_on_diff_note_id_convert_to_bigint', + 'index_note_diff_files_on_diff_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_3d66047aeb" + rename_constraint(TABLE_NAME, 'fk_note_diff_files_diff_note_id_convert_to_bigint', 'fk_rails_3d66047aeb') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230403041642_ensure_issue_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230403041642_ensure_issue_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..b6f121994b2 --- /dev/null +++ b/db/post_migrate/20230403041642_ensure_issue_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureIssueUserMentionsBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'issue_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230403041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230403041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..fb941e1cb51 --- /dev/null +++ b/db/post_migrate/20230403041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class SwapIssueUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + # No-op, moved to db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb + def up; end + + def down; end +end diff --git a/db/post_migrate/20230403085957_add_tmp_partial_index_on_vulnerability_report_types2.rb b/db/post_migrate/20230403085957_add_tmp_partial_index_on_vulnerability_report_types2.rb new file mode 100644 index 00000000000..e37d197ad6d --- /dev/null +++ b/db/post_migrate/20230403085957_add_tmp_partial_index_on_vulnerability_report_types2.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddTmpPartialIndexOnVulnerabilityReportTypes2 < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + CLAUSE = 'report_type IN (7, 99)' + + def up + return if index_exists?(:vulnerability_occurrences, :id, name: INDEX_NAME) + + # Temporary index to be removed in 16.1 https://gitlab.com/gitlab-org/gitlab/-/issues/404408 + prepare_async_index :vulnerability_occurrences, :id, where: CLAUSE, name: INDEX_NAME + end + + def down + unprepare_async_index :vulnerability_occurrences, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230403085958_add_sync_tmp_partial_index_on_vulnerability_report_types2.rb b/db/post_migrate/20230403085958_add_sync_tmp_partial_index_on_vulnerability_report_types2.rb new file mode 100644 index 00000000000..a2905fa2635 --- /dev/null +++ b/db/post_migrate/20230403085958_add_sync_tmp_partial_index_on_vulnerability_report_types2.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSyncTmpPartialIndexOnVulnerabilityReportTypes2 < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in 16.1 https://gitlab.com/gitlab-org/gitlab/-/issues/404408 + add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20230403190527_add_index_to_security_scans_on_scan_type.rb b/db/post_migrate/20230403190527_add_index_to_security_scans_on_scan_type.rb new file mode 100644 index 00000000000..b8a377e833c --- /dev/null +++ b/db/post_migrate/20230403190527_add_index_to_security_scans_on_scan_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexToSecurityScansOnScanType < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :security_scans + INDEX_NAME = 'index_for_security_scans_scan_type' + SUCCEEDED = 1 + + def up + add_concurrent_index TABLE_NAME, [:scan_type, :project_id, :pipeline_id], where: "status = #{SUCCEEDED}", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20230403221928_resync_scan_result_policies_for_namespaces.rb b/db/post_migrate/20230403221928_resync_scan_result_policies_for_namespaces.rb new file mode 100644 index 00000000000..34ab8ea3873 --- /dev/null +++ b/db/post_migrate/20230403221928_resync_scan_result_policies_for_namespaces.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +class ResyncScanResultPoliciesForNamespaces < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + BATCH_SIZE = 50 + + class Group < MigrationRecord + self.inheritance_column = :_type_disabled + self.table_name = 'namespaces' + + def self.as_ids + select(Arel.sql('namespaces.traversal_ids[array_length(namespaces.traversal_ids, 1)]').as('id')) + end + + def self_and_descendant_ids + self.class.where("traversal_ids @> ('{?}')", id).as_ids + end + end + + class Project < MigrationRecord + self.table_name = 'projects' + end + + class OrchestrationPolicyConfiguration < MigrationRecord + include EachBatch + self.table_name = 'security_orchestration_policy_configurations' + end + + def up + return unless Gitlab.ee? + return unless process_scan_result_policy_worker + + OrchestrationPolicyConfiguration + .where.not(namespace_id: nil) + .each_batch(column: :namespace_id, of: BATCH_SIZE) do |policy_configurations| + policy_configurations.each do |policy_configuration| + for_each_project(policy_configuration) do |project| + process_scan_result_policy_worker.perform_async(project.id, policy_configuration.id) + end + end + end + end + + def down + # no-op + end + + private + + def for_each_project(policy_configuration) + scope = Project.order(:id) + array_scope = Group.find(policy_configuration.namespace_id).self_and_descendant_ids + array_mapping_scope = ->(id_expression) do + Project.where(Project.arel_table[:namespace_id].eq(id_expression)).select(:id) + end + + query_builder = Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder.new( + scope: scope, + array_scope: array_scope, + array_mapping_scope: array_mapping_scope + ) + + query_builder.execute.limit(BATCH_SIZE).each do |project| + yield(project) if block_given? + end + end + + def process_scan_result_policy_worker + unless defined?(@process_scan_result_policy_worker) + @process_scan_result_policy_worker = 'Security::ProcessScanResultPolicyWorker'.safe_constantize + end + + @process_scan_result_policy_worker + end +end diff --git a/db/post_migrate/20230403231455_add_unique_index_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230403231455_add_unique_index_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..d02a21f472e --- /dev/null +++ b/db/post_migrate/20230403231455_add_unique_index_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class AddUniqueIndexIssueUserMentionsNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :issue_user_mentions + INDEX_NAME = :index_issue_user_mentions_on_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing index_issue_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: INDEX_NAME, + where: 'note_id_convert_to_bigint IS NOT NULL' + end + + def down + return unless should_run? + + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230403231841_add_fk_on_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230403231841_add_fk_on_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..e2b5c6fcbe3 --- /dev/null +++ b/db/post_migrate/20230403231841_add_fk_on_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +class AddFkOnIssueUserMentionsNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :issue_user_mentions + TARGET_TABLE_NAME = :notes + FK_NAME = :fk_issue_user_mentions_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing fk_rails_3861d9fefa + # when we swap the integer and bigint columns + add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME, + column: :note_id_convert_to_bigint, + name: FK_NAME, + on_delete: :cascade, + reverse_lock_order: true, + validate: false + end + + def down + return unless should_run? + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230403232121_async_validate_fk_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230403232121_async_validate_fk_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..dd01689213c --- /dev/null +++ b/db/post_migrate/20230403232121_async_validate_fk_issue_user_mentions_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AsyncValidateFkIssueUserMentionsNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :issue_user_mentions + COLUMN = :note_id_convert_to_bigint + FK_NAME = :fk_issue_user_mentions_note_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230404023648_ensure_suggestions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230404023648_ensure_suggestions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..adf33df6fc2 --- /dev/null +++ b/db/post_migrate/20230404023648_ensure_suggestions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureSuggestionsNoteIdBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'suggestions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230404023915_swap_suggestions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230404023915_swap_suggestions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..fb5c379c015 --- /dev/null +++ b/db/post_migrate/20230404023915_swap_suggestions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +class SwapSuggestionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'suggestions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing index_suggestions_on_note_id_and_relative_order + add_concurrent_index TABLE_NAME, [:note_id_convert_to_bigint, :relative_order], unique: true, + name: 'index_suggestions_on_note_id_convert_to_bigint_relative_order' + + # This will replace the existing fk_rails_33b03a535c + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_suggestions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :note_id, nil + change_column_default TABLE_NAME, :note_id_convert_to_bigint, 0 + + execute 'DROP INDEX IF EXISTS index_suggestions_on_note_id_and_relative_order' + rename_index TABLE_NAME, 'index_suggestions_on_note_id_convert_to_bigint_relative_order', + 'index_suggestions_on_note_id_and_relative_order' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_33b03a535c" + rename_constraint(TABLE_NAME, 'fk_suggestions_note_id_convert_to_bigint', 'fk_rails_33b03a535c') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230404030757_ensure_epic_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230404030757_ensure_epic_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..9b90d144042 --- /dev/null +++ b/db/post_migrate/20230404030757_ensure_epic_user_mentions_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureEpicUserMentionsBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'epic_user_mentions', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230404031041_swap_epic_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230404031041_swap_epic_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..3d0478c15dd --- /dev/null +++ b/db/post_migrate/20230404031041_swap_epic_user_mentions_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +class SwapEpicUserMentionsNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'epic_user_mentions' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing epic_user_mentions_on_epic_id_and_note_id_index + add_concurrent_index TABLE_NAME, [:epic_id, :note_id_convert_to_bigint], unique: true, + name: 'epic_user_mentions_on_epic_id_and_note_id_convert_to_bigint' + + # This will replace the existing epic_user_mentions_on_epic_id_index + add_concurrent_index TABLE_NAME, :epic_id, unique: true, + name: 'tmp_epic_user_mentions_on_epic_id_index', + where: 'note_id_convert_to_bigint IS NULL' + + # This will replace the existing index_epic_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_epic_user_mentions_on_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + # This will replace the existing fk_rails_1c65976a49 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_epic_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS epic_user_mentions_on_epic_id_and_note_id_index' + rename_index TABLE_NAME, 'epic_user_mentions_on_epic_id_and_note_id_convert_to_bigint', + 'epic_user_mentions_on_epic_id_and_note_id_index' + + execute 'DROP INDEX IF EXISTS epic_user_mentions_on_epic_id_index' + rename_index TABLE_NAME, 'tmp_epic_user_mentions_on_epic_id_index', + 'epic_user_mentions_on_epic_id_index' + + execute 'DROP INDEX IF EXISTS index_epic_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_epic_user_mentions_on_note_id_convert_to_bigint', + 'index_epic_user_mentions_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_1c65976a49" + rename_constraint(TABLE_NAME, 'fk_epic_user_mentions_note_id_convert_to_bigint', 'fk_rails_1c65976a49') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230404044338_drop_async_index_ci_job_artifacts_on_expire_at_for_removal.rb b/db/post_migrate/20230404044338_drop_async_index_ci_job_artifacts_on_expire_at_for_removal.rb new file mode 100644 index 00000000000..7c3cb65c884 --- /dev/null +++ b/db/post_migrate/20230404044338_drop_async_index_ci_job_artifacts_on_expire_at_for_removal.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class DropAsyncIndexCiJobArtifactsOnExpireAtForRemoval < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/393913 + def up + prepare_async_index_removal :ci_job_artifacts, :expire_at, name: INDEX_NAME + end + + def down + unprepare_async_index :ci_job_artifacts, :expire_at, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230404050414_remove_unused_merge_request_jira_indexes.rb b/db/post_migrate/20230404050414_remove_unused_merge_request_jira_indexes.rb new file mode 100644 index 00000000000..619fd326d7a --- /dev/null +++ b/db/post_migrate/20230404050414_remove_unused_merge_request_jira_indexes.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RemoveUnusedMergeRequestJiraIndexes < Gitlab::Database::Migration[2.1] + TITLE_INDEX = { + name: 'index_merge_requests_on_target_project_id_and_iid_jira_title', + where: "((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text)" + }.freeze + + DESCRIPTION_INDEX = { + name: 'index_merge_requests_on_target_project_id_iid_jira_description', + where: "(description ~ '[A-Z][A-Z_0-9]+-\d+'::text)" + }.freeze + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :merge_requests, name: TITLE_INDEX[:name] + remove_concurrent_index_by_name :merge_requests, name: DESCRIPTION_INDEX[:name] + end + + def down + add_concurrent_index :merge_requests, [:target_project_id, :iid], + where: TITLE_INDEX[:where], + name: TITLE_INDEX[:name] + add_concurrent_index :merge_requests, [:target_project_id, :iid], + where: DESCRIPTION_INDEX[:where], + name: DESCRIPTION_INDEX[:name] + end +end diff --git a/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb b/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb new file mode 100644 index 00000000000..efa0792c457 --- /dev/null +++ b/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb @@ -0,0 +1,19 @@ +# 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 DropSyncIndexCiJobArtifactsOnExpireAtForRemoval < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal' + CONDITIONS = 'locked = 0 AND expire_at IS NOT NULL' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :ci_job_artifacts, name: INDEX_NAME + end + + def down + add_concurrent_index :ci_job_artifacts, [:expire_at], where: CONDITIONS, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230404132544_prepare_async_index_for_override_uuids_logic.rb b/db/post_migrate/20230404132544_prepare_async_index_for_override_uuids_logic.rb new file mode 100644 index 00000000000..59c2bdf9470 --- /dev/null +++ b/db/post_migrate/20230404132544_prepare_async_index_for_override_uuids_logic.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexForOverrideUuidsLogic < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_occurrences_for_override_uuids_logic' + + def up + prepare_async_index :vulnerability_occurrences, [:project_id, :report_type, :location_fingerprint], name: INDEX_NAME + end + + def down + unprepare_async_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20230404194907_remove_mr_mentions_temp_index.rb b/db/post_migrate/20230404194907_remove_mr_mentions_temp_index.rb new file mode 100644 index 00000000000..49a2b22df0a --- /dev/null +++ b/db/post_migrate/20230404194907_remove_mr_mentions_temp_index.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RemoveMrMentionsTempIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'merge_request_mentions_temp_index' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402497 + def up + prepare_async_index_removal :merge_requests, :id, name: INDEX_NAME + end + + def down + unprepare_async_index :merge_requests, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230404194908_remove_mr_state_id_temp_index.rb b/db/post_migrate/20230404194908_remove_mr_state_id_temp_index.rb new file mode 100644 index 00000000000..4b469666167 --- /dev/null +++ b/db/post_migrate/20230404194908_remove_mr_state_id_temp_index.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RemoveMrStateIdTempIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'merge_requests_state_id_temp_index' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402497 + def up + prepare_async_index_removal :merge_requests, :state_id, name: INDEX_NAME + end + + def down + unprepare_async_index :merge_requests, :state_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230405072302_remove_p_ci_builds_metadata_partition_id_default.rb b/db/post_migrate/20230405072302_remove_p_ci_builds_metadata_partition_id_default.rb new file mode 100644 index 00000000000..303210d85c7 --- /dev/null +++ b/db/post_migrate/20230405072302_remove_p_ci_builds_metadata_partition_id_default.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemovePCiBuildsMetadataPartitionIdDefault < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + change_column_default :p_ci_builds_metadata, :partition_id, from: 100, to: nil + end + + def down + change_column_default :p_ci_builds_metadata, :partition_id, from: nil, to: 100 + end +end diff --git a/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb b/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb new file mode 100644 index 00000000000..fd6620d77fe --- /dev/null +++ b/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateIndexForOverrideUuidsLogicOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_occurrences_for_override_uuids_logic' + + def up + add_concurrent_index :vulnerability_occurrences, + [:project_id, :report_type, :location_fingerprint], + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20230405132104_remove_saml_provider_and_identities_non_root_group.rb b/db/post_migrate/20230405132104_remove_saml_provider_and_identities_non_root_group.rb new file mode 100644 index 00000000000..55a017464c2 --- /dev/null +++ b/db/post_migrate/20230405132104_remove_saml_provider_and_identities_non_root_group.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class RemoveSamlProviderAndIdentitiesNonRootGroup < Gitlab::Database::Migration[2.1] + BATCH_SIZE = 500 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + each_batch_range('saml_providers', scope: ->(table) { table.all }, of: BATCH_SIZE) do |min, max| + execute <<~SQL + DELETE FROM identities + WHERE identities.saml_provider_id + IN + ( + SELECT saml_providers.id FROM saml_providers + INNER JOIN namespaces ON namespaces.id=saml_providers.group_id + AND namespaces.type='Group' AND namespaces.parent_id IS NOT NULL + AND saml_providers.id BETWEEN #{min} AND #{max} + ); + + DELETE FROM saml_providers + USING namespaces + WHERE namespaces.id=saml_providers.group_id + AND namespaces.type='Group' AND namespaces.parent_id IS NOT NULL + AND saml_providers.id BETWEEN #{min} AND #{max}; + SQL + end + end + + def down + # noop + end +end diff --git a/db/post_migrate/20230405132855_remove_scim_token_and_scim_identity_non_root_group.rb b/db/post_migrate/20230405132855_remove_scim_token_and_scim_identity_non_root_group.rb new file mode 100644 index 00000000000..aa149acc5be --- /dev/null +++ b/db/post_migrate/20230405132855_remove_scim_token_and_scim_identity_non_root_group.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class RemoveScimTokenAndScimIdentityNonRootGroup < Gitlab::Database::Migration[2.1] + BATCH_SIZE = 500 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + each_batch_range('scim_oauth_access_tokens', scope: ->(table) { table.all }, of: BATCH_SIZE) do |min, max| + execute <<~SQL + DELETE FROM scim_identities + WHERE scim_identities.group_id + IN + ( + SELECT namespaces.id FROM scim_oauth_access_tokens + INNER JOIN namespaces ON namespaces.id=scim_oauth_access_tokens.group_id + WHERE namespaces.type='Group' AND namespaces.parent_id IS NOT NULL + AND scim_oauth_access_tokens.id BETWEEN #{min} AND #{max} + ); + + DELETE FROM scim_oauth_access_tokens + USING namespaces + WHERE namespaces.id=scim_oauth_access_tokens.group_id + AND namespaces.type='Group' AND namespaces.parent_id IS NOT NULL + AND scim_oauth_access_tokens.id BETWEEN #{min} AND #{max}; + SQL + end + end + + def down + # noop + end +end diff --git a/db/post_migrate/20230405200858_requeue_backfill_project_wiki_repositories.rb b/db/post_migrate/20230405200858_requeue_backfill_project_wiki_repositories.rb new file mode 100644 index 00000000000..363a3099064 --- /dev/null +++ b/db/post_migrate/20230405200858_requeue_backfill_project_wiki_repositories.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# rubocop:disable BackgroundMigration/MissingDictionaryFile +class RequeueBackfillProjectWikiRepositories < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillProjectWikiRepositories" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration(MIGRATION, :projects, :id, []) + + queue_batched_background_migration( + MIGRATION, + :projects, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :projects, :id, []) + end +end +# rubocop:enable BackgroundMigration/MissingDictionaryFile diff --git a/db/post_migrate/20230406041555_allow_null_file_md5_to_debian_project_component_files.rb b/db/post_migrate/20230406041555_allow_null_file_md5_to_debian_project_component_files.rb new file mode 100644 index 00000000000..d03f68e22ab --- /dev/null +++ b/db/post_migrate/20230406041555_allow_null_file_md5_to_debian_project_component_files.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AllowNullFileMd5ToDebianProjectComponentFiles < Gitlab::Database::Migration[2.1] + def up + change_column_null :packages_debian_project_component_files, :file_md5, 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/post_migrate/20230406041629_allow_null_file_md5_to_debian_group_component_files.rb b/db/post_migrate/20230406041629_allow_null_file_md5_to_debian_group_component_files.rb new file mode 100644 index 00000000000..15e8414f0bd --- /dev/null +++ b/db/post_migrate/20230406041629_allow_null_file_md5_to_debian_group_component_files.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AllowNullFileMd5ToDebianGroupComponentFiles < Gitlab::Database::Migration[2.1] + def up + change_column_null :packages_debian_group_component_files, :file_md5, 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/post_migrate/20230406093640_requeue_backfill_admin_mode_scope_for_personal_access_tokens.rb b/db/post_migrate/20230406093640_requeue_backfill_admin_mode_scope_for_personal_access_tokens.rb new file mode 100644 index 00000000000..17ba9edef22 --- /dev/null +++ b/db/post_migrate/20230406093640_requeue_backfill_admin_mode_scope_for_personal_access_tokens.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class RequeueBackfillAdminModeScopeForPersonalAccessTokens < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillAdminModeScopeForPersonalAccessTokens' + DELAY_INTERVAL = 2.minutes + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, []) + + queue_batched_background_migration( + MIGRATION, + :personal_access_tokens, + :id, + job_interval: DELAY_INTERVAL + ) + end + + def down + delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, []) + end +end diff --git a/db/post_migrate/20230406121544_queue_backfill_design_management_repositories.rb b/db/post_migrate/20230406121544_queue_backfill_design_management_repositories.rb new file mode 100644 index 00000000000..22ff4c8df45 --- /dev/null +++ b/db/post_migrate/20230406121544_queue_backfill_design_management_repositories.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillDesignManagementRepositories < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillDesignManagementRepositories" + + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :projects, + :id, + job_interval: DELAY_INTERVAL, + batch_size: 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/20230410111251_async_validate_fk_projects_creator_id.rb b/db/post_migrate/20230410111251_async_validate_fk_projects_creator_id.rb new file mode 100644 index 00000000000..b1ac2469c78 --- /dev/null +++ b/db/post_migrate/20230410111251_async_validate_fk_projects_creator_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AsyncValidateFkProjectsCreatorId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :projects + COLUMN_NAME = :creator_id + FK_NAME = :fk_03ec10b0d3 + + def up + prepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end +end diff --git a/db/post_migrate/20230410123709_validate_fk_projects_creator_id.rb b/db/post_migrate/20230410123709_validate_fk_projects_creator_id.rb new file mode 100644 index 00000000000..7f522cd92ef --- /dev/null +++ b/db/post_migrate/20230410123709_validate_fk_projects_creator_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateFkProjectsCreatorId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :projects + COLUMN_NAME = :creator_id + FK_NAME = :fk_03ec10b0d3 + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230411011959_add_temp_index_to_null_dismissed_info_vulnerabilities.rb b/db/post_migrate/20230411011959_add_temp_index_to_null_dismissed_info_vulnerabilities.rb new file mode 100644 index 00000000000..fe62260cb8f --- /dev/null +++ b/db/post_migrate/20230411011959_add_temp_index_to_null_dismissed_info_vulnerabilities.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddTempIndexToNullDismissedInfoVulnerabilities < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_index_vulnerability_dismissal_info' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/406653 + add_concurrent_index :vulnerabilities, :id, + where: "state = 2 AND (dismissed_at IS NULL OR dismissed_by_id IS NULL)", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME + end +end diff --git a/db/post_migrate/20230411153310_cleanup_bigint_conversion_for_sent_notifications.rb b/db/post_migrate/20230411153310_cleanup_bigint_conversion_for_sent_notifications.rb new file mode 100644 index 00000000000..567fe4fb3d2 --- /dev/null +++ b/db/post_migrate/20230411153310_cleanup_bigint_conversion_for_sent_notifications.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSentNotifications < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + TABLE = :sent_notifications + COLUMNS = [:id] + + def up + return unless should_run? + + cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end + + def down + return unless should_run? + + restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230412013251_ensure_system_note_metadata_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230412013251_ensure_system_note_metadata_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..a4ae604d66d --- /dev/null +++ b/db/post_migrate/20230412013251_ensure_system_note_metadata_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureSystemNoteMetadataBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'system_note_metadata', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230412104514_add_index_to_group_group_links.rb b/db/post_migrate/20230412104514_add_index_to_group_group_links.rb new file mode 100644 index 00000000000..655bff43b3c --- /dev/null +++ b/db/post_migrate/20230412104514_add_index_to_group_group_links.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexToGroupGroupLinks < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_group_group_links_on_shared_with_group_and_group_access' + TABLE_NAME = :group_group_links + + def up + add_concurrent_index TABLE_NAME, [:shared_with_group_id, :group_access], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb new file mode 100644 index 00000000000..9c6213c60ee --- /dev/null +++ b/db/post_migrate/20230412141541_reschedule_links_avoiding_duplication.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# rubocop: disable BackgroundMigration/MissingDictionaryFile + +class RescheduleLinksAvoidingDuplication < Gitlab::Database::Migration[2.1] + MIGRATION = 'MigrateLinksForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 500 + BATCH_SIZE = 10000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + + queue_batched_background_migration( + MIGRATION, + :vulnerability_occurrences, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + end +end +# rubocop: enable BackgroundMigration/MissingDictionaryFile diff --git a/db/post_migrate/20230412152538_add_text_limit_to_ci_job_artifacts_file_final_path.rb b/db/post_migrate/20230412152538_add_text_limit_to_ci_job_artifacts_file_final_path.rb new file mode 100644 index 00000000000..1ee83486cc5 --- /dev/null +++ b/db/post_migrate/20230412152538_add_text_limit_to_ci_job_artifacts_file_final_path.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddTextLimitToCiJobArtifactsFileFinalPath < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :ci_job_artifacts, :file_final_path, 1024, constraint_name: constraint_name, validate: false + prepare_async_check_constraint_validation(:ci_job_artifacts, name: constraint_name) + end + + def down + unprepare_async_check_constraint_validation(:ci_job_artifacts, name: constraint_name) + remove_text_limit :ci_job_artifacts, :file_final_path + end + + private + + def constraint_name + text_limit_name(:ci_job_artifacts, :file_final_path) + end +end diff --git a/db/post_migrate/20230412185837_queue_populate_vulnerability_dismissal_fields.rb b/db/post_migrate/20230412185837_queue_populate_vulnerability_dismissal_fields.rb new file mode 100644 index 00000000000..d0924e8fdf8 --- /dev/null +++ b/db/post_migrate/20230412185837_queue_populate_vulnerability_dismissal_fields.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class QueuePopulateVulnerabilityDismissalFields < Gitlab::Database::Migration[2.1] + MIGRATION = "PopulateVulnerabilityDismissalFields" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :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, :vulnerabilities, :id, []) + end +end diff --git a/db/post_migrate/20230412201517_remove_clusters_applications_cert_managers_fk.rb b/db/post_migrate/20230412201517_remove_clusters_applications_cert_managers_fk.rb new file mode 100644 index 00000000000..e565583b308 --- /dev/null +++ b/db/post_migrate/20230412201517_remove_clusters_applications_cert_managers_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsCertManagersFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_cert_managers, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_cert_managers, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_9e4f2cb4b2' + end +end diff --git a/db/post_migrate/20230412201528_remove_clusters_applications_cilium_fk.rb b/db/post_migrate/20230412201528_remove_clusters_applications_cilium_fk.rb new file mode 100644 index 00000000000..e1ebff390b7 --- /dev/null +++ b/db/post_migrate/20230412201528_remove_clusters_applications_cilium_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsCiliumFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_cilium, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_cilium, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_59dc12eea6' + end +end diff --git a/db/post_migrate/20230412201539_remove_clusters_applications_crossplane_fk.rb b/db/post_migrate/20230412201539_remove_clusters_applications_crossplane_fk.rb new file mode 100644 index 00000000000..46687466be7 --- /dev/null +++ b/db/post_migrate/20230412201539_remove_clusters_applications_crossplane_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsCrossplaneFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_crossplane, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_crossplane, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_87186702df' + end +end diff --git a/db/post_migrate/20230412201549_remove_clusters_applications_helm_fk.rb b/db/post_migrate/20230412201549_remove_clusters_applications_helm_fk.rb new file mode 100644 index 00000000000..6e2ccd53646 --- /dev/null +++ b/db/post_migrate/20230412201549_remove_clusters_applications_helm_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsHelmFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_helm, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_helm, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_3e2b1c06bc' + end +end diff --git a/db/post_migrate/20230412201600_remove_clusters_applications_ingress_fk.rb b/db/post_migrate/20230412201600_remove_clusters_applications_ingress_fk.rb new file mode 100644 index 00000000000..d911b105a24 --- /dev/null +++ b/db/post_migrate/20230412201600_remove_clusters_applications_ingress_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsIngressFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_ingress, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_ingress, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_753a7b41c1' + end +end diff --git a/db/post_migrate/20230412201611_remove_clusters_applications_jupyter_fk.rb b/db/post_migrate/20230412201611_remove_clusters_applications_jupyter_fk.rb new file mode 100644 index 00000000000..063a2e4c622 --- /dev/null +++ b/db/post_migrate/20230412201611_remove_clusters_applications_jupyter_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsJupyterFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_jupyter, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_jupyter, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_17df21c98c' + end +end diff --git a/db/post_migrate/20230412201621_remove_clusters_applications_knative_fk.rb b/db/post_migrate/20230412201621_remove_clusters_applications_knative_fk.rb new file mode 100644 index 00000000000..8f97e886b85 --- /dev/null +++ b/db/post_migrate/20230412201621_remove_clusters_applications_knative_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsKnativeFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_knative, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_knative, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_54fc91e0a0' + end +end diff --git a/db/post_migrate/20230412201632_remove_clusters_applications_prometheus_fk.rb b/db/post_migrate/20230412201632_remove_clusters_applications_prometheus_fk.rb new file mode 100644 index 00000000000..735019bfe5a --- /dev/null +++ b/db/post_migrate/20230412201632_remove_clusters_applications_prometheus_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsPrometheusFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_prometheus, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_prometheus, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_557e773639' + end +end diff --git a/db/post_migrate/20230412201642_remove_clusters_applications_runners_fk.rb b/db/post_migrate/20230412201642_remove_clusters_applications_runners_fk.rb new file mode 100644 index 00000000000..4921d0c8744 --- /dev/null +++ b/db/post_migrate/20230412201642_remove_clusters_applications_runners_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsRunnersFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_runners, column: :cluster_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_runners, :clusters, + column: :cluster_id, on_delete: :cascade, name: 'fk_rails_22388594e9' + end +end diff --git a/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb b/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb new file mode 100644 index 00000000000..63474ebec36 --- /dev/null +++ b/db/post_migrate/20230412203234_remove_clusters_applications_jupyter_oauth_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveClustersApplicationsJupyterOauthFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:clusters_applications_jupyter, column: :oauth_application_id) + end + end + + def down + add_concurrent_foreign_key :clusters_applications_jupyter, :oauth_applications, + column: :oauth_application_id, on_delete: :nullify, name: 'fk_rails_331f0aff78' + end +end diff --git a/db/post_migrate/20230412204143_remove_serverless_domain_cluster_pages_fk.rb b/db/post_migrate/20230412204143_remove_serverless_domain_cluster_pages_fk.rb new file mode 100644 index 00000000000..8f66714d03b --- /dev/null +++ b/db/post_migrate/20230412204143_remove_serverless_domain_cluster_pages_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveServerlessDomainClusterPagesFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:serverless_domain_cluster, column: :pages_domain_id) + end + end + + def down + add_concurrent_foreign_key :serverless_domain_cluster, :pages_domains, + column: :pages_domain_id, on_delete: :cascade, name: 'fk_rails_c09009dee1' + end +end diff --git a/db/post_migrate/20230412204201_remove_serverless_domain_cluster_knative_fk.rb b/db/post_migrate/20230412204201_remove_serverless_domain_cluster_knative_fk.rb new file mode 100644 index 00000000000..1ac60de59d0 --- /dev/null +++ b/db/post_migrate/20230412204201_remove_serverless_domain_cluster_knative_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveServerlessDomainClusterKnativeFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:serverless_domain_cluster, column: :clusters_applications_knative_id) + end + end + + def down + add_concurrent_foreign_key :serverless_domain_cluster, :clusters_applications_knative, + column: :clusters_applications_knative_id, on_delete: :cascade, name: 'fk_rails_e59e868733' + end +end diff --git a/db/post_migrate/20230412204224_remove_serverless_domain_cluster_creator_fk.rb b/db/post_migrate/20230412204224_remove_serverless_domain_cluster_creator_fk.rb new file mode 100644 index 00000000000..8d0b62c9f6e --- /dev/null +++ b/db/post_migrate/20230412204224_remove_serverless_domain_cluster_creator_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveServerlessDomainClusterCreatorFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:serverless_domain_cluster, column: :creator_id) + end + end + + def down + add_concurrent_foreign_key :serverless_domain_cluster, :users, + column: :creator_id, on_delete: :nullify, name: 'fk_rails_fbdba67eb1' + end +end diff --git a/db/post_migrate/20230412214119_finalize_encrypt_ci_trigger_token.rb b/db/post_migrate/20230412214119_finalize_encrypt_ci_trigger_token.rb new file mode 100644 index 00000000000..e3e6dc43e0d --- /dev/null +++ b/db/post_migrate/20230412214119_finalize_encrypt_ci_trigger_token.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class FinalizeEncryptCiTriggerToken < Gitlab::Database::Migration[2.1] + MIGRATION = 'EncryptCiTriggerToken' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :ci_triggers, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230413012807_remove_index_sync_index_on_merge_requests_on_state_id_and_merge_status.rb b/db/post_migrate/20230413012807_remove_index_sync_index_on_merge_requests_on_state_id_and_merge_status.rb new file mode 100644 index 00000000000..664657015a7 --- /dev/null +++ b/db/post_migrate/20230413012807_remove_index_sync_index_on_merge_requests_on_state_id_and_merge_status.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexSyncIndexOnMergeRequestsOnStateIdAndMergeStatus < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :merge_requests, name: 'idx_merge_requests_on_state_id_and_merge_status' + end + + def down + add_concurrent_index :merge_requests, [:state_id, :merge_status], + where: "((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text))", + name: 'idx_merge_requests_on_state_id_and_merge_status' + end +end diff --git a/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb b/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb new file mode 100644 index 00000000000..cb29b47a64d --- /dev/null +++ b/db/post_migrate/20230413041917_swap_issue_user_mentions_note_id_to_bigint_for_gitlab_dot_com_2.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +class SwapIssueUserMentionsNoteIdToBigintForGitlabDotCom2 < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'issue_user_mentions' + + def up + return unless should_run? + return if columns_alredy_swapped? + + swap + end + + def down + return unless should_run? + return unless columns_alredy_swapped? + + swap + + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_issue_user_mentions_on_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_issue_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade, + validate: false + end + + def swap + # This will replace the existing index_issue_user_mentions_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_issue_user_mentions_on_note_id_convert_to_bigint', + where: 'note_id_convert_to_bigint IS NOT NULL' + + # This will replace the existing issue_user_mentions_on_issue_id_and_note_id_index + add_concurrent_index TABLE_NAME, [:issue_id, :note_id_convert_to_bigint], unique: true, + name: 'tmp_issue_user_mentions_on_issue_id_and_note_id_index' + + # This will replace the existing issue_user_mentions_on_issue_id_index + add_concurrent_index TABLE_NAME, :issue_id, unique: true, + name: 'tmp_issue_user_mentions_on_issue_id_index', + where: 'note_id_convert_to_bigint IS NULL' + + # This will replace the existing fk_rails_3861d9fefa + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_issue_user_mentions_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS index_issue_user_mentions_on_note_id' + rename_index TABLE_NAME, 'index_issue_user_mentions_on_note_id_convert_to_bigint', + 'index_issue_user_mentions_on_note_id' + + execute 'DROP INDEX IF EXISTS issue_user_mentions_on_issue_id_and_note_id_index' + rename_index TABLE_NAME, 'tmp_issue_user_mentions_on_issue_id_and_note_id_index', + 'issue_user_mentions_on_issue_id_and_note_id_index' + + execute 'DROP INDEX IF EXISTS issue_user_mentions_on_issue_id_index' + rename_index TABLE_NAME, 'tmp_issue_user_mentions_on_issue_id_index', + 'issue_user_mentions_on_issue_id_index' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_rails_3861d9fefa" + rename_constraint(TABLE_NAME, 'fk_issue_user_mentions_note_id_convert_to_bigint', 'fk_rails_3861d9fefa') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end + + def columns_alredy_swapped? + table_columns = columns(TABLE_NAME) + note_id = table_columns.find { |c| c.name == 'note_id' } + note_id_convert_to_bigint = table_columns.find { |c| c.name == 'note_id_convert_to_bigint' } + + note_id_convert_to_bigint.sql_type == 'integer' && note_id.sql_type == 'bigint' + end +end diff --git a/db/post_migrate/20230413041918_add_unique_index_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230413041918_add_unique_index_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..b8ee6285a33 --- /dev/null +++ b/db/post_migrate/20230413041918_add_unique_index_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddUniqueIndexSystemNoteMetadataNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :system_note_metadata + INDEX_NAME = :index_system_note_metadata_on_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing index_system_note_metadata_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_system_note_metadata_on_note_id_convert_to_bigint' + end + + def down + return unless should_run? + + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230413041919_add_fk_on_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230413041919_add_fk_on_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..59ea8ca3c7f --- /dev/null +++ b/db/post_migrate/20230413041919_add_fk_on_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +class AddFkOnSystemNoteMetadataNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :system_note_metadata + TARGET_TABLE_NAME = :notes + FK_NAME = :fk_system_note_metadata_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing fk_d83a918cb1 + # when we swap the integer and bigint columns + add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME, + column: :note_id_convert_to_bigint, + name: FK_NAME, + on_delete: :cascade, + reverse_lock_order: true, + validate: false + end + + def down + return unless should_run? + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230413041920_async_validate_fk_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230413041920_async_validate_fk_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..bba0f09dd78 --- /dev/null +++ b/db/post_migrate/20230413041920_async_validate_fk_system_note_metadata_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AsyncValidateFkSystemNoteMetadataNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :system_note_metadata + COLUMN = :note_id_convert_to_bigint + FK_NAME = :fk_system_note_metadata_note_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230414075119_add_namespaces_by_top_level_namespace_index.rb b/db/post_migrate/20230414075119_add_namespaces_by_top_level_namespace_index.rb new file mode 100644 index 00000000000..fda776f3bc5 --- /dev/null +++ b/db/post_migrate/20230414075119_add_namespaces_by_top_level_namespace_index.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddNamespacesByTopLevelNamespaceIndex < Gitlab::Database::Migration[2.1] + def up + # no-op: re-implemented in AddNamespacesByTopLevelNamespaceIndexV2 + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230414140202_add_issues_incident_type_temp_index_async_dot_com.rb b/db/post_migrate/20230414140202_add_issues_incident_type_temp_index_async_dot_com.rb new file mode 100644 index 00000000000..9caa6f16669 --- /dev/null +++ b/db/post_migrate/20230414140202_add_issues_incident_type_temp_index_async_dot_com.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIssuesIncidentTypeTempIndexAsyncDotCom < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id_only_incidents' + INCIDENT_ENUM_VALUE = 1 + + # TODO: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117728 + def up + prepare_async_index :issues, [:issue_type, :id], name: INDEX_NAME, where: "issue_type = #{INCIDENT_ENUM_VALUE}" + end + + def down + unprepare_async_index :issues, [:issue_type, :id], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb b/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb new file mode 100644 index 00000000000..7c89e454c0c --- /dev/null +++ b/db/post_migrate/20230414150202_add_issues_incident_type_temp_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIssuesIncidentTypeTempIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_index_issues_on_issue_type_and_id_only_incidents' + INCIDENT_ENUM_VALUE = 1 + + def up + add_concurrent_index :issues, [:issue_type, :id], name: INDEX_NAME, where: "issue_type = #{INCIDENT_ENUM_VALUE}" + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end diff --git a/db/post_migrate/20230414200202_reschedule_incident_work_item_type_id_backfill.rb b/db/post_migrate/20230414200202_reschedule_incident_work_item_type_id_backfill.rb new file mode 100644 index 00000000000..0563ed93d15 --- /dev/null +++ b/db/post_migrate/20230414200202_reschedule_incident_work_item_type_id_backfill.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +class RescheduleIncidentWorkItemTypeIdBackfill < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillWorkItemTypeIdForIssues' + BATCH_SIZE = 10_000 + MAX_BATCH_SIZE = 30_000 + SUB_BATCH_SIZE = 50 + INTERVAL = 2.minutes + INCIDENT_ENUM_TYPE = 1 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class MigrationWorkItemType < MigrationRecord + self.table_name = 'work_item_types' + end + + def up + incident_work_item_type = MigrationWorkItemType.find_by(namespace_id: nil, base_type: INCIDENT_ENUM_TYPE) + + if incident_work_item_type.blank? + say( + 'Incident work item type not found. Make sure the work_item_types table is populated' \ + 'before running this migration' + ) + return + end + + delete_batched_background_migration(MIGRATION, :issues, :id, [INCIDENT_ENUM_TYPE, incident_work_item_type.id]) + + queue_batched_background_migration( + MIGRATION, + :issues, + :id, + INCIDENT_ENUM_TYPE, + incident_work_item_type.id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + # no-op + # no point on reverting this migration since UP is destructive + # (it will delete the originally scheduled job) + end +end diff --git a/db/post_migrate/20230418154454_change_code_suggestions_default_in_namespace_settings.rb b/db/post_migrate/20230418154454_change_code_suggestions_default_in_namespace_settings.rb new file mode 100644 index 00000000000..77e81a7c01b --- /dev/null +++ b/db/post_migrate/20230418154454_change_code_suggestions_default_in_namespace_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class ChangeCodeSuggestionsDefaultInNamespaceSettings < Gitlab::Database::Migration[2.1] + def change + change_column_default :namespace_settings, :code_suggestions, from: false, to: true + end +end diff --git a/db/post_migrate/20230418164957_queue_update_code_suggestions_for_namespace_settings.rb b/db/post_migrate/20230418164957_queue_update_code_suggestions_for_namespace_settings.rb new file mode 100644 index 00000000000..205219e4e2b --- /dev/null +++ b/db/post_migrate/20230418164957_queue_update_code_suggestions_for_namespace_settings.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class QueueUpdateCodeSuggestionsForNamespaceSettings < Gitlab::Database::Migration[2.1] + def up + # no-op due to not running anywhere yet and business decision to revert the decision + # see: https://gitlab.com/gitlab-org/gitlab/-/issues/408104 + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230419010332_ensure_todos_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230419010332_ensure_todos_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..d03fb0100e4 --- /dev/null +++ b/db/post_migrate/20230419010332_ensure_todos_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureTodosBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'todos', + column_name: 'id', + job_arguments: [['note_id'], ['note_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230419010551_add_index_todos_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230419010551_add_index_todos_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..4ac5eeb5a14 --- /dev/null +++ b/db/post_migrate/20230419010551_add_index_todos_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddIndexTodosNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = :todos + INDEX_NAME = :index_todos_on_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing index_todos_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, name: INDEX_NAME + end + + def down + return unless should_run? + + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230419012426_add_fk_on_todos_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230419012426_add_fk_on_todos_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..0cbab6f93da --- /dev/null +++ b/db/post_migrate/20230419012426_add_fk_on_todos_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +class AddFkOnTodosNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :todos + TARGET_TABLE_NAME = :notes + FK_NAME = :fk_todos_note_id_convert_to_bigint + + def up + return unless should_run? + + # This will replace the existing fk_91d1f47b13 + # when we swap the integer and bigint columns + add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME, + column: :note_id_convert_to_bigint, + name: FK_NAME, + on_delete: :cascade, + reverse_lock_order: true, + validate: false + end + + def down + return unless should_run? + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230419012621_async_validate_fk_todos_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230419012621_async_validate_fk_todos_note_id_convert_to_bigint_for_gitlab_com.rb new file mode 100644 index 00000000000..f7bef55ba01 --- /dev/null +++ b/db/post_migrate/20230419012621_async_validate_fk_todos_note_id_convert_to_bigint_for_gitlab_com.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AsyncValidateFkTodosNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = :todos + COLUMN = :note_id_convert_to_bigint + FK_NAME = :fk_todos_note_id_convert_to_bigint + + def up + return unless should_run? + + prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230419094535_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_self_hosts.rb b/db/post_migrate/20230419094535_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_self_hosts.rb new file mode 100644 index 00000000000..decfdf0a3ca --- /dev/null +++ b/db/post_migrate/20230419094535_ensure_merge_request_metrics_id_bigint_backfill_is_finished_for_self_hosts.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class EnsureMergeRequestMetricsIdBigintBackfillIsFinishedForSelfHosts < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + TABLE_NAME = 'merge_request_metrics' + + 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']] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230419094939_swap_merge_request_metrics_id_to_bigint_for_self_hosts.rb b/db/post_migrate/20230419094939_swap_merge_request_metrics_id_to_bigint_for_self_hosts.rb new file mode 100644 index 00000000000..d249ffb9c1b --- /dev/null +++ b/db/post_migrate/20230419094939_swap_merge_request_metrics_id_to_bigint_for_self_hosts.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +class SwapMergeRequestMetricsIdToBigintForSelfHosts < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'merge_request_metrics' + TMP_INDEX_NAME = 'tmp_index_mr_metrics_on_target_project_id_merged_at_nulls_last' + INDEX_NAME = 'index_mr_metrics_on_target_project_id_merged_at_nulls_last' + CONSTRAINT_NAME = 'merge_request_metrics_pkey' + + def up + return if should_skip? + return if temporary_column_already_dropped? + return if columns_alredy_swapped? + + swap + end + + def down + return if should_skip? + return if temporary_column_already_dropped? + return unless columns_alredy_swapped? + + swap + end + + private + + def swap + add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, + name: 'index_merge_request_metrics_on_id_convert_to_bigint' + add_concurrent_index TABLE_NAME, 'target_project_id, merged_at DESC NULLS LAST, id_convert_to_bigint DESC', + name: TMP_INDEX_NAME + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_convert_to_bigint TO id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_tmp TO id_convert_to_bigint" + + 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 of the columns, and change ownership of the sequence to the new id + execute "ALTER SEQUENCE merge_request_metrics_id_seq OWNED BY #{TABLE_NAME}.id" + change_column_default TABLE_NAME, :id, -> { "nextval('merge_request_metrics_id_seq'::regclass)" } + change_column_default TABLE_NAME, :id_convert_to_bigint, 0 + + # Swap PK constraint + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS #{CONSTRAINT_NAME}" + rename_index TABLE_NAME, 'index_merge_request_metrics_on_id_convert_to_bigint', CONSTRAINT_NAME + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{CONSTRAINT_NAME} PRIMARY KEY USING INDEX #{CONSTRAINT_NAME}" + + # Rename the rest of the indexes (we already hold an exclusive lock, so no need to use DROP INDEX CONCURRENTLY) + execute "DROP INDEX IF EXISTS #{INDEX_NAME}" + rename_index TABLE_NAME, TMP_INDEX_NAME, INDEX_NAME + end + end + + def should_skip? + com_or_dev_or_test_but_not_jh? + end + + def columns_alredy_swapped? + table_columns = columns(TABLE_NAME) + column_id = table_columns.find { |c| c.name == 'id' } + column_id_convert_to_bigint = table_columns.find { |c| c.name == 'id_convert_to_bigint' } + + column_id.sql_type == 'bigint' && column_id_convert_to_bigint.sql_type == 'integer' + end + + def temporary_column_already_dropped? + table_columns = columns(TABLE_NAME) + + !table_columns.find { |c| c.name == 'id_convert_to_bigint' } + end +end diff --git a/db/post_migrate/20230419121943_add_namespaces_by_top_level_namespace_index_v2.rb b/db/post_migrate/20230419121943_add_namespaces_by_top_level_namespace_index_v2.rb new file mode 100644 index 00000000000..5433313407d --- /dev/null +++ b/db/post_migrate/20230419121943_add_namespaces_by_top_level_namespace_index_v2.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddNamespacesByTopLevelNamespaceIndexV2 < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_namespaces_namespaces_by_top_level_namespace' + + def up + unprepare_async_index_by_name :namespaces, INDEX_NAME + prepare_async_index :namespaces, '(traversal_ids[1]), type, id', name: INDEX_NAME + end + + def down + unprepare_async_index_by_name :namespaces, INDEX_NAME + end +end diff --git a/db/post_migrate/20230419164438_change_code_suggestions_default_false_in_namespace_settings.rb b/db/post_migrate/20230419164438_change_code_suggestions_default_false_in_namespace_settings.rb new file mode 100644 index 00000000000..51042995af0 --- /dev/null +++ b/db/post_migrate/20230419164438_change_code_suggestions_default_false_in_namespace_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class ChangeCodeSuggestionsDefaultFalseInNamespaceSettings < Gitlab::Database::Migration[2.1] + def change + change_column_default :namespace_settings, :code_suggestions, from: true, to: false + end +end diff --git a/db/post_migrate/20230420002547_swap_todos_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230420002547_swap_todos_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..f01ea5c1da2 --- /dev/null +++ b/db/post_migrate/20230420002547_swap_todos_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +class SwapTodosNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'todos' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, + name: 'index_todos_on_note_id_convert_to_bigint' + + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_todos_note_id_convert_to_bigint', + on_delete: :cascade, validate: false + end + + def swap + # This will replace the existing index_todos_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, + name: 'index_todos_on_note_id_convert_to_bigint' + + # This will replace the existing fk_91d1f47b13 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_todos_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS index_todos_on_note_id' + rename_index TABLE_NAME, 'index_todos_on_note_id_convert_to_bigint', + 'index_todos_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_91d1f47b13" + rename_constraint(TABLE_NAME, 'fk_todos_note_id_convert_to_bigint', 'fk_91d1f47b13') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230420005610_ensure_award_emoji_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230420005610_ensure_award_emoji_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..cfad789036e --- /dev/null +++ b/db/post_migrate/20230420005610_ensure_award_emoji_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureAwardEmojiBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'award_emoji', + column_name: 'id', + job_arguments: [['awardable_id'], ['awardable_id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230420005930_swap_award_emoji_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230420005930_swap_award_emoji_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..f49805fd527 --- /dev/null +++ b/db/post_migrate/20230420005930_swap_award_emoji_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +class SwapAwardEmojiNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'award_emoji' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + end + + def swap + # This will replace the existing idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id + add_concurrent_index TABLE_NAME, [:user_id, :name, :awardable_type, :awardable_id_convert_to_bigint], + name: 'tmp_award_emoji_on_user_emoji_name_awardable_type_awardable_id' + + # This will replace the existing index_award_emoji_on_awardable_type_and_awardable_id + add_concurrent_index TABLE_NAME, [:awardable_type, :awardable_id_convert_to_bigint], + name: 'tmp_index_award_emoji_on_awardable_type_and_awardable_id' + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN awardable_id TO awardable_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN awardable_id_convert_to_bigint TO awardable_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN awardable_id_tmp TO awardable_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:awardable_id, :awardable_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute 'DROP INDEX IF EXISTS idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id' + rename_index TABLE_NAME, 'tmp_award_emoji_on_user_emoji_name_awardable_type_awardable_id', + 'idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id' + + execute 'DROP INDEX IF EXISTS index_award_emoji_on_awardable_type_and_awardable_id' + rename_index TABLE_NAME, 'tmp_index_award_emoji_on_awardable_type_and_awardable_id', + 'index_award_emoji_on_awardable_type_and_awardable_id' + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230420041344_backfill_ci_pipelines_for_bigint_conversion.rb b/db/post_migrate/20230420041344_backfill_ci_pipelines_for_bigint_conversion.rb new file mode 100644 index 00000000000..7e9d900eeca --- /dev/null +++ b/db/post_migrate/20230420041344_backfill_ci_pipelines_for_bigint_conversion.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class BackfillCiPipelinesForBigintConversion < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + TABLE = :ci_pipelines + COLUMNS = %i[id] + + def up + backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 250) + end + + def down + revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end +end diff --git a/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb b/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb new file mode 100644 index 00000000000..aa03310eb0a --- /dev/null +++ b/db/post_migrate/20230420065656_finalize_fix_incoherent_packages_size_on_project_statistics.rb @@ -0,0 +1,25 @@ +# 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 FinalizeFixIncoherentPackagesSizeOnProjectStatistics < Gitlab::Database::Migration[2.1] + MIGRATION = 'FixIncoherentPackagesSizeOnProjectStatistics' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :project_statistics, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb b/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb new file mode 100644 index 00000000000..8279cff7afb --- /dev/null +++ b/db/post_migrate/20230420070009_drop_tmp_idx_package_files_on_non_zero_size.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropTmpIdxPackageFilesOnNonZeroSize < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_idx_package_files_on_non_zero_size' + + def up + remove_concurrent_index :packages_package_files, %i[package_id size], name: INDEX_NAME + end + + def down + add_concurrent_index :packages_package_files, %i[package_id size], where: 'size IS NOT NULL', name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb b/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb new file mode 100644 index 00000000000..f9fe6d4a16c --- /dev/null +++ b/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateNamespacesByTopLevelNamespaceIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_namespaces_namespaces_by_top_level_namespace' + + def up + add_concurrent_index :namespaces, '(traversal_ids[1]), type, id', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :namespaces, INDEX_NAME + end +end diff --git a/db/post_migrate/20230420144418_drop_index_security_scans_on_pipeline_id.rb b/db/post_migrate/20230420144418_drop_index_security_scans_on_pipeline_id.rb new file mode 100644 index 00000000000..5d379a8a582 --- /dev/null +++ b/db/post_migrate/20230420144418_drop_index_security_scans_on_pipeline_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexSecurityScansOnPipelineId < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_security_scans_on_pipeline_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index :security_scans, :pipeline_id, name: INDEX_NAME + end + + def down + add_concurrent_index :security_scans, :pipeline_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230422013640_swap_system_note_metadata_note_id_to_bigint_for_gitlab_dot_com.rb b/db/post_migrate/20230422013640_swap_system_note_metadata_note_id_to_bigint_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..4113bae22e1 --- /dev/null +++ b/db/post_migrate/20230422013640_swap_system_note_metadata_note_id_to_bigint_for_gitlab_dot_com.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +class SwapSystemNoteMetadataNoteIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + + TABLE_NAME = 'system_note_metadata' + + def up + return unless should_run? + + swap + end + + def down + return unless should_run? + + swap + + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_system_note_metadata_on_note_id_convert_to_bigint' + + add_concurrent_foreign_key TABLE_NAME, :notes, + column: :note_id_convert_to_bigint, + name: :fk_system_note_metadata_note_id_convert_to_bigint, + on_delete: :cascade, + validate: false + end + + def swap + # This will replace the existing index_system_note_metadata_on_note_id + add_concurrent_index TABLE_NAME, :note_id_convert_to_bigint, unique: true, + name: 'index_system_note_metadata_on_note_id_convert_to_bigint' + + # This will replace the existing fk_d83a918cb1 + add_concurrent_foreign_key TABLE_NAME, :notes, column: :note_id_convert_to_bigint, + name: 'fk_system_note_metadata_note_id_convert_to_bigint', + on_delete: :cascade + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE notes, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id TO note_id_tmp" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_convert_to_bigint TO note_id" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN note_id_tmp TO note_id_convert_to_bigint" + + function_name = Gitlab::Database::UnidirectionalCopyTrigger + .on_table(TABLE_NAME, connection: connection) + .name(:note_id, :note_id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + # Swap defaults + change_column_default TABLE_NAME, :note_id, nil + change_column_default TABLE_NAME, :note_id_convert_to_bigint, 0 + + execute 'DROP INDEX IF EXISTS index_system_note_metadata_on_note_id' + rename_index TABLE_NAME, 'index_system_note_metadata_on_note_id_convert_to_bigint', + 'index_system_note_metadata_on_note_id' + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT IF EXISTS fk_d83a918cb1" + rename_constraint(TABLE_NAME, 'fk_system_note_metadata_note_id_convert_to_bigint', 'fk_d83a918cb1') + end + end + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb b/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb new file mode 100644 index 00000000000..d5bdd33a952 --- /dev/null +++ b/db/post_migrate/20230425114355_remove_application_settings_clickhouse_connection_string.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveApplicationSettingsClickhouseConnectionString < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + remove_column :application_settings, :clickhouse_connection_string + end + + def down + unless column_exists?(:application_settings, :clickhouse_connection_string) + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + add_column :application_settings, :clickhouse_connection_string, :text + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + end + + add_text_limit :application_settings, :clickhouse_connection_string, 1024 + end +end diff --git a/db/post_migrate/20230425521418_drop_merge_request_mentions_temp_index.rb b/db/post_migrate/20230425521418_drop_merge_request_mentions_temp_index.rb new file mode 100644 index 00000000000..a13c994d954 --- /dev/null +++ b/db/post_migrate/20230425521418_drop_merge_request_mentions_temp_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropMergeRequestMentionsTempIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'merge_request_mentions_temp_index' + INDEX_CONDITION = "description like '%@%' OR title like '%@%'" + + disable_ddl_transaction! + + def up + remove_concurrent_index(:merge_requests, :id, where: INDEX_CONDITION, name: INDEX_NAME) + end + + def down + add_concurrent_index(:merge_requests, :id, where: INDEX_CONDITION, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20230427065942_backfill_ci_pipeline_variables_for_bigint_conversion.rb b/db/post_migrate/20230427065942_backfill_ci_pipeline_variables_for_bigint_conversion.rb new file mode 100644 index 00000000000..c73c29bbbad --- /dev/null +++ b/db/post_migrate/20230427065942_backfill_ci_pipeline_variables_for_bigint_conversion.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class BackfillCiPipelineVariablesForBigintConversion < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + TABLE = :ci_pipeline_variables + COLUMNS = %i[id] + + 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/20230427190005_drop_foreign_keys_from_cycle_analytics_unused_tables.rb b/db/post_migrate/20230427190005_drop_foreign_keys_from_cycle_analytics_unused_tables.rb new file mode 100644 index 00000000000..a0a6679f136 --- /dev/null +++ b/db/post_migrate/20230427190005_drop_foreign_keys_from_cycle_analytics_unused_tables.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +class DropForeignKeysFromCycleAnalyticsUnusedTables < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key :analytics_cycle_analytics_project_stages, column: :stage_event_hash_id + remove_foreign_key :analytics_cycle_analytics_project_stages, column: :project_id + remove_foreign_key :analytics_cycle_analytics_project_stages, column: :start_event_label_id + remove_foreign_key :analytics_cycle_analytics_project_stages, column: :end_event_label_id + remove_foreign_key :analytics_cycle_analytics_project_stages, column: :project_value_stream_id + + remove_foreign_key :analytics_cycle_analytics_project_value_streams, column: :project_id + end + end + + def down + add_concurrent_foreign_key(:analytics_cycle_analytics_project_stages, + :analytics_cycle_analytics_stage_event_hashes, + name: "fk_c3339bdfc9", + column: :stage_event_hash_id, + target_column: :id, + on_delete: :cascade + ) + + add_concurrent_foreign_key(:analytics_cycle_analytics_project_stages, + :labels, + name: "fk_rails_1722574860", + column: :start_event_label_id, + target_column: :id, + on_delete: :cascade + ) + + add_concurrent_foreign_key(:analytics_cycle_analytics_project_stages, + :projects, + name: "fk_rails_3829e49b66", + column: :project_id, + target_column: :id, + on_delete: :cascade + ) + + add_concurrent_foreign_key(:analytics_cycle_analytics_project_stages, + :labels, + name: "fk_rails_3ec9fd7912", + column: :end_event_label_id, + target_column: :id, + on_delete: :cascade + ) + + add_concurrent_foreign_key(:analytics_cycle_analytics_project_stages, + :analytics_cycle_analytics_project_value_streams, + name: "fk_rails_796a7dbc9c", + column: :project_value_stream_id, + target_column: :id, + on_delete: :cascade + ) + + add_concurrent_foreign_key(:analytics_cycle_analytics_project_value_streams, + :projects, + name: "fk_rails_669f4ba293", + column: :project_id, + target_column: :id, + on_delete: :cascade + ) + end +end diff --git a/db/post_migrate/20230427194552_drop_cycle_analytics_unused_tables.rb b/db/post_migrate/20230427194552_drop_cycle_analytics_unused_tables.rb new file mode 100644 index 00000000000..7c10238a1bc --- /dev/null +++ b/db/post_migrate/20230427194552_drop_cycle_analytics_unused_tables.rb @@ -0,0 +1,83 @@ +# 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 DropCycleAnalyticsUnusedTables < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + drop_table :analytics_cycle_analytics_project_stages + drop_table :analytics_cycle_analytics_project_value_streams + end + + def down + create_analytics_cycle_analytics_project_value_streams_table + create_analytics_cycle_analytics_project_stages_table + end + + def create_analytics_cycle_analytics_project_value_streams_table + index_name = 'index_analytics_ca_project_value_streams_on_project_id_and_name' + + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + # rubocop:disable Migration/AddLimitToTextColumns + create_table :analytics_cycle_analytics_project_value_streams do |t| + t.timestamps_with_timezone + t.references(:project, + null: false, + index: false, + foreign_key: { to_table: :projects, on_delete: :cascade } + ) + t.text :name, null: false + t.index [:project_id, :name], unique: true, name: index_name + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + # rubocop:enable Migration/AddLimitToTextColumns + + add_text_limit :analytics_cycle_analytics_project_value_streams, :name, 100 + end + + def create_analytics_cycle_analytics_project_stages_table + index_prefix = 'index_analytics_ca_project_stages_' + + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + create_table :analytics_cycle_analytics_project_stages do |t| + t.timestamps_with_timezone + t.integer :relative_position + t.integer :start_event_identifier, null: false + t.integer :end_event_identifier, null: false + t.references(:project, null: false, + foreign_key: { to_table: :projects, on_delete: :cascade }, + index: { name: "#{index_prefix}on_project_id" } + ) + t.references(:start_event_label, + foreign_key: { to_table: :labels, on_delete: :cascade }, + index: { name: "#{index_prefix}on_start_event_label_id" } + ) + t.references(:end_event_label, + foreign_key: { to_table: :labels, on_delete: :cascade }, + index: { name: "#{index_prefix}on_end_event_label_id" } + ) + t.boolean :hidden, default: false, null: false + t.boolean :custom, default: true, null: false + t.string :name, null: false, limit: 255 # rubocop: disable Migration/PreventStrings + t.references(:project_value_stream, null: false, + foreign_key: { to_table: :analytics_cycle_analytics_project_value_streams, on_delete: :cascade }, + index: { name: "#{index_prefix}on_value_stream_id" } + ) + t.references(:stage_event_hash, + foreign_key: { to_table: :analytics_cycle_analytics_stage_event_hashes, on_delete: :cascade }, + index: { name: 'index_project_stages_on_stage_event_hash_id' } + ) + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + + add_check_constraint :analytics_cycle_analytics_project_stages, 'stage_event_hash_id IS NOT NULL', + 'check_8f6019de1e' + + add_index :analytics_cycle_analytics_project_stages, [:project_id, :name], unique: true, + name: "#{index_prefix}on_project_id_and_name" + add_index :analytics_cycle_analytics_project_stages, [:relative_position], + name: "#{index_prefix}on_relative_position" + end +end diff --git a/db/post_migrate/20230428065426_prepare_index_to_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb b/db/post_migrate/20230428065426_prepare_index_to_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb new file mode 100644 index 00000000000..bff52308271 --- /dev/null +++ b/db/post_migrate/20230428065426_prepare_index_to_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class PrepareIndexToSystemNoteMetadataOnIdForRelateAndUnrelateActions < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_index_for_backfilling_resource_link_events' + CLAUSE = "action='relate_to_parent' OR action='unrelate_from_parent'" + + disable_ddl_transaction! + + def up + return if index_exists?(:system_note_metadata, :id, name: INDEX_NAME) + + # Temporary index to be removed https://gitlab.com/gitlab-org/gitlab/-/issues/408797 + # Sync index to be created in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119019 + prepare_async_index :system_note_metadata, :id, where: CLAUSE, name: INDEX_NAME + end + + def down + unprepare_async_index_by_name :system_note_metadata, INDEX_NAME + end +end diff --git a/db/post_migrate/20230428085332_remove_shimo_zentao_integration_records.rb b/db/post_migrate/20230428085332_remove_shimo_zentao_integration_records.rb new file mode 100644 index 00000000000..079f1527e01 --- /dev/null +++ b/db/post_migrate/20230428085332_remove_shimo_zentao_integration_records.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveShimoZentaoIntegrationRecords < Gitlab::Database::Migration[2.1] + TYPES = %w[Integrations::Shimo Integrations::Zentao] + BATCH_SIZE = 100 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + return if Gitlab.jh? + + define_batchable_model(:integrations) + .where(type_new: TYPES) + .each_batch(of: BATCH_SIZE) { |relation, _index| relation.delete_all } + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230501090213_convert_ci_builds_to_list_partitioning.rb b/db/post_migrate/20230501090213_convert_ci_builds_to_list_partitioning.rb new file mode 100644 index 00000000000..2361ee1b97e --- /dev/null +++ b/db/post_migrate/20230501090213_convert_ci_builds_to_list_partitioning.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ConvertCiBuildsToListPartitioning < Gitlab::Database::Migration[2.1] + def up + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/13818 + end + + def down + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/13818 + end +end diff --git a/db/post_migrate/20230501094322_prepare_removal_partial_index_deployments_for_project_id_and_tag.rb b/db/post_migrate/20230501094322_prepare_removal_partial_index_deployments_for_project_id_and_tag.rb new file mode 100644 index 00000000000..bbdfb89bb80 --- /dev/null +++ b/db/post_migrate/20230501094322_prepare_removal_partial_index_deployments_for_project_id_and_tag.rb @@ -0,0 +1,17 @@ +# 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 PrepareRemovalPartialIndexDeploymentsForProjectIdAndTag < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402516 + def up + prepare_async_index_removal :deployments, :project_id, name: INDEX_NAME + end + + def down + unprepare_async_index :deployments, :project_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230501165244_remove_software_license_policies_without_scan_result_policy_id.rb b/db/post_migrate/20230501165244_remove_software_license_policies_without_scan_result_policy_id.rb new file mode 100644 index 00000000000..0e3b15a933c --- /dev/null +++ b/db/post_migrate/20230501165244_remove_software_license_policies_without_scan_result_policy_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveSoftwareLicensePoliciesWithoutScanResultPolicyId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + BATCH_SIZE = 1000 + + def up + each_batch_range('software_license_policies', + scope: ->(table) { table.where(scan_result_policy_id: nil) }, + of: BATCH_SIZE) do |min, max| + execute("DELETE FROM software_license_policies WHERE id BETWEEN #{min} AND #{max}") + end + end + + def down + # NO-OP + end +end diff --git a/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb b/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb new file mode 100644 index 00000000000..8949e37dcc3 --- /dev/null +++ b/db/post_migrate/20230501180958_drop_clusters_applications_cert_managers.rb @@ -0,0 +1,27 @@ +# 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 DropClustersApplicationsCertManagers < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_cert_managers + end + + # Based on init migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L680-L689 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_cert_managers", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "status", null: false + t.string "version", null: false + t.string "email", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.text "status_reason" + t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb b/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb new file mode 100644 index 00000000000..864e0e74b97 --- /dev/null +++ b/db/post_migrate/20230502014227_drop_partial_index_deployments_for_project_id_and_tag.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropPartialIndexDeploymentsForProjectIdAndTag < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :deployments, name: INDEX_NAME + end + + def down + # This is based on the following `CREATE INDEX` command in db/init_structure.sql: + # CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments + # USING btree (project_id) WHERE (tag IS TRUE); + add_concurrent_index :deployments, :project_id, name: INDEX_NAME, where: 'tag IS TRUE' + end +end diff --git a/db/post_migrate/20230502102832_schedule_index_to_members_on_source_and_type_and_access_level.rb b/db/post_migrate/20230502102832_schedule_index_to_members_on_source_and_type_and_access_level.rb new file mode 100644 index 00000000000..ce3f0fb8c76 --- /dev/null +++ b/db/post_migrate/20230502102832_schedule_index_to_members_on_source_and_type_and_access_level.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ScheduleIndexToMembersOnSourceAndTypeAndAccessLevel < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_members_on_source_and_type_and_access_level' + + def up + prepare_async_index :members, %i[source_id source_type type access_level], name: INDEX_NAME + end + + def down + unprepare_async_index :members, %i[source_id source_type type access_level], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230502120021_schedule_index_to_project_authorizations_on_project_user_access_level.rb b/db/post_migrate/20230502120021_schedule_index_to_project_authorizations_on_project_user_access_level.rb new file mode 100644 index 00000000000..06ff40cddde --- /dev/null +++ b/db/post_migrate/20230502120021_schedule_index_to_project_authorizations_on_project_user_access_level.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ScheduleIndexToProjectAuthorizationsOnProjectUserAccessLevel < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_project_authorizations_on_project_user_access_level' + + disable_ddl_transaction! + + def up + prepare_async_index :project_authorizations, %i[project_id user_id access_level], unique: true, name: INDEX_NAME + end + + def down + unprepare_async_index :project_authorizations, %i[project_id user_id access_level], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb new file mode 100644 index 00000000000..8d80bae0a52 --- /dev/null +++ b/db/post_migrate/20230502134532_drop_clusters_applications_cilium.rb @@ -0,0 +1,23 @@ +# 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 DropClustersApplicationsCilium < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_cilium + end + + # Based on original migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20200615234047_create_clusters_applications_cilium.rb + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table :clusters_applications_cilium do |t| + t.references :cluster, null: false, index: { unique: true } + t.timestamps_with_timezone null: false + t.integer :status, null: false + t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb b/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb new file mode 100644 index 00000000000..c35cfc8fd96 --- /dev/null +++ b/db/post_migrate/20230502182754_drop_clusters_applications_crossplane.rb @@ -0,0 +1,26 @@ +# 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 DropClustersApplicationsCrossplane < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_crossplane + end + + # Based on original migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/8b1637296b286a5c46e0d8fdf6da42a43a7c9986/db/migrate/20191017191341_create_clusters_applications_crossplane.rb + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table :clusters_applications_crossplane, id: :integer do |t| + t.timestamps_with_timezone null: false + t.references :cluster, null: false, index: false + t.integer :status, null: false + t.string :version, null: false, limit: 255 + t.string :stack, null: false, limit: 255 + t.text :status_reason + t.index :cluster_id, unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb b/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb new file mode 100644 index 00000000000..21df851229c --- /dev/null +++ b/db/post_migrate/20230502193525_drop_clusters_applications_helm.rb @@ -0,0 +1,31 @@ +# 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 DropClustersApplicationsHelm < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_helm + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L691-L702 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + # rubocop:disable Migration/Datetime + def down + create_table "clusters_applications_helm", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "status", null: false + t.string "version", null: false + t.text "status_reason" + t.text "encrypted_ca_key" + t.text "encrypted_ca_key_iv" + t.text "ca_cert" + t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + # rubocop:enable Migration/Datetime +end diff --git a/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb new file mode 100644 index 00000000000..a349346f91b --- /dev/null +++ b/db/post_migrate/20230502201251_drop_clusters_applications_ingress.rb @@ -0,0 +1,32 @@ +# 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 DropClustersApplicationsIngress < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_ingress + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L704-L715 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + # rubocop:disable Migration/Datetime + def down + create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "status", null: false + t.integer "ingress_type", null: false + t.string "version", null: false + t.string "cluster_ip" + t.text "status_reason" + t.string "external_ip" + t.string "external_hostname" + t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + # rubocop:enable Migration/Datetime +end diff --git a/db/post_migrate/20230503032750_remove_redundant_index_from_container_repositories.rb b/db/post_migrate/20230503032750_remove_redundant_index_from_container_repositories.rb new file mode 100644 index 00000000000..a538dc054bb --- /dev/null +++ b/db/post_migrate/20230503032750_remove_redundant_index_from_container_repositories.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveRedundantIndexFromContainerRepositories < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_container_repositories_on_project_id' + + def up + remove_concurrent_index_by_name :container_repositories, INDEX_NAME + end + + def down + add_concurrent_index :container_repositories, :project_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb b/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb new file mode 100644 index 00000000000..3c2a0cc3ee8 --- /dev/null +++ b/db/post_migrate/20230503115918_drop_clusters_applications_jupyter.rb @@ -0,0 +1,29 @@ +# 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 DropClustersApplicationsJupyter < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_jupyter + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L717-L728 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_jupyter", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "oauth_application_id" + t.integer "status", null: false + t.string "version", null: false + t.string "hostname" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.text "status_reason" + t.index ["cluster_id"], name: "index_clusters_applications_jupyter_on_cluster_id", unique: true + t.index ["oauth_application_id"], name: "index_clusters_applications_jupyter_on_oauth_application_id" + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb b/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb new file mode 100644 index 00000000000..c94b9bba64b --- /dev/null +++ b/db/post_migrate/20230503152349_drop_clusters_applications_knative.rb @@ -0,0 +1,29 @@ +# 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 DropClustersApplicationsKnative < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_knative + end + + # Based on init migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L730-L740 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_knative", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.integer "status", null: false + t.string "version", null: false + t.string "hostname" + t.text "status_reason" + t.string "external_hostname" + t.string "external_ip" + t.index ["cluster_id"], name: "index_clusters_applications_knative_on_cluster_id", unique: true + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb new file mode 100644 index 00000000000..6391c1ee5ae --- /dev/null +++ b/db/post_migrate/20230503173101_drop_clusters_applications_prometheus.rb @@ -0,0 +1,30 @@ +# 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 DropClustersApplicationsPrometheus < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_prometheus + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L742-L750 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_prometheus", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "status", null: false + t.string "version", null: false + t.text "status_reason" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true + t.datetime_with_timezone "last_update_started_at" + t.string "encrypted_alert_manager_token" + t.string "encrypted_alert_manager_token_iv" + t.boolean "healthy" + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb b/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb new file mode 100644 index 00000000000..813cb23f56a --- /dev/null +++ b/db/post_migrate/20230503175406_drop_clusters_applications_runners.rb @@ -0,0 +1,29 @@ +# 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 DropClustersApplicationsRunners < Gitlab::Database::Migration[2.1] + def up + drop_table :clusters_applications_runners + end + + # Based on init schema: + # https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L752-L763 + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table "clusters_applications_runners", id: :serial, force: :cascade do |t| + t.integer "cluster_id", null: false + t.integer "runner_id" + t.integer "status", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.string "version", null: false + t.text "status_reason" + t.boolean "privileged", default: true, null: false + t.index ["cluster_id"], name: "index_clusters_applications_runners_on_cluster_id", unique: true + t.index ["runner_id"], name: "index_clusters_applications_runners_on_runner_id" + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb b/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb new file mode 100644 index 00000000000..94d3a2faf3b --- /dev/null +++ b/db/post_migrate/20230503181808_drop_serverless_domain_cluster.rb @@ -0,0 +1,33 @@ +# 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 DropServerlessDomainCluster < Gitlab::Database::Migration[2.1] + def up + drop_table :serverless_domain_cluster + end + + # Based on original migration: + # https://gitlab.com/gitlab-org/gitlab/-/blob/5f7bd5b1455d87e2f1a2d1ae2c1147d51e97aa55/db/migrate/20191127030005_create_serverless_domain_cluster.rb + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + def down + create_table :serverless_domain_cluster, id: false, primary_key: :uuid do |t| + t.string :uuid, null: false, limit: 14, primary_key: true + t.bigint :pages_domain_id, null: false + t.bigint :clusters_applications_knative_id, null: false + t.bigint :creator_id + t.datetime_with_timezone :created_at, null: false + t.datetime_with_timezone :updated_at, null: false + t.text :encrypted_key + t.string :encrypted_key_iv, limit: 255 + t.text :certificate + t.index :clusters_applications_knative_id, + unique: true, + name: 'idx_serverless_domain_cluster_on_clusters_applications_knative' + t.index :pages_domain_id, name: 'index_serverless_domain_cluster_on_pages_domain_id' + t.index :creator_id, name: 'index_serverless_domain_cluster_on_creator_id' + end + end + # rubocop:enable Migration/SchemaAdditionMethodsNoPost +end diff --git a/db/post_migrate/20230504010535_ensure_notes_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230504010535_ensure_notes_bigint_backfill_is_finished_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..b9d3dc55661 --- /dev/null +++ b/db/post_migrate/20230504010535_ensure_notes_bigint_backfill_is_finished_for_gitlab_dot_com.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class EnsureNotesBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + return unless should_run? + + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: 'notes', + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down + # no-op + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230508034422_notes_bigint_create_indexes_async_for_gitlab_dot_com.rb b/db/post_migrate/20230508034422_notes_bigint_create_indexes_async_for_gitlab_dot_com.rb new file mode 100644 index 00000000000..b8e8c995713 --- /dev/null +++ b/db/post_migrate/20230508034422_notes_bigint_create_indexes_async_for_gitlab_dot_com.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +class NotesBigintCreateIndexesAsyncForGitlabDotCom < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + TABLE_NAME = 'notes' + PK_INDEX_NAME = 'index_notes_on_id_convert_to_bigint' + + SECONDARY_INDEXES = [ + { + name: :index_notes_on_author_id_created_at_id_convert_to_bigint, + columns: [:author_id, :created_at, :id_convert_to_bigint], + options: {} + }, + { + name: :index_notes_on_id_convert_to_bigint_where_confidential, + columns: [:id_convert_to_bigint], + options: { where: 'confidential = true' } + }, + { + name: :index_notes_on_id_convert_to_bigint_where_internal, + columns: [:id_convert_to_bigint], + options: { where: 'internal = true' } + }, + { + name: :index_notes_on_project_id_id_convert_to_bigint_system_false, + columns: [:project_id, :id_convert_to_bigint], + options: { where: 'NOT system' } + }, + { + name: :note_mentions_temp_index_convert_to_bigint, + columns: [:id_convert_to_bigint, :noteable_type], + options: { where: "note ~~ '%@%'::text" } + } + ] + + # Indexes will be created synchronously in + # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119705 + def up + return unless should_run? + + prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME + + SECONDARY_INDEXES.each do |index| + prepare_async_index TABLE_NAME, index[:columns], **index[:options].merge(name: index[:name]) + end + end + + def down + return unless should_run? + + SECONDARY_INDEXES.each do |index| + unprepare_async_index TABLE_NAME, index[:columns], name: index[:name] + end + + unprepare_async_index TABLE_NAME, :id_convert_to_bigint, name: PK_INDEX_NAME + end + + private + + def should_run? + com_or_dev_or_test_but_not_jh? + end +end diff --git a/db/post_migrate/20230508093910_create_package_manager_name_index.rb b/db/post_migrate/20230508093910_create_package_manager_name_index.rb new file mode 100644 index 00000000000..e15f253a417 --- /dev/null +++ b/db/post_migrate/20230508093910_create_package_manager_name_index.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class CreatePackageManagerNameIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_sbom_sources_package_manager_name' + + def up + return if index_exists_by_name?(:sbom_sources, INDEX_NAME) + + disable_statement_timeout do + execute <<~SQL + CREATE INDEX CONCURRENTLY #{INDEX_NAME} + ON sbom_sources + USING BTREE ((source->'package_manager'->>'name')) + SQL + end + end + + def down + remove_concurrent_index_by_name :sbom_sources, INDEX_NAME + end +end diff --git a/db/post_migrate/20230508150219_reschedule_evidences_handling_unicode.rb b/db/post_migrate/20230508150219_reschedule_evidences_handling_unicode.rb new file mode 100644 index 00000000000..804db553f6f --- /dev/null +++ b/db/post_migrate/20230508150219_reschedule_evidences_handling_unicode.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# rubocop:disable BackgroundMigration/MissingDictionaryFile + +class RescheduleEvidencesHandlingUnicode < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'MigrateEvidencesForVulnerabilityFindings' + DELAY_INTERVAL = 2.minutes + SUB_BATCH_SIZE = 250 + BATCH_SIZE = 4000 + MAX_BATCH_SIZE = 8000 + + def up + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + + queue_batched_background_migration( + MIGRATION, + :vulnerability_occurrences, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) + end +end +# rubocop:enable BackgroundMigration/MissingDictionaryFile diff --git a/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb b/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb new file mode 100644 index 00000000000..9644a555756 --- /dev/null +++ b/db/post_migrate/20230508175057_backfill_corrected_secure_files_expirations.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class BackfillCorrectedSecureFilesExpirations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + BATCH_SIZE = 1000 + + def up + each_batch_range('ci_secure_files', of: BATCH_SIZE) do |min, max| + sql = <<-SQL + SELECT id + FROM ci_secure_files + WHERE name ILIKE any (array['%.cer', '%.p12']) + AND ci_secure_files.id BETWEEN #{min} AND #{max} + SQL + + rows = execute(sql) + + rows.each do |row| + ::Ci::ParseSecureFileMetadataWorker.perform_async(row["id"]) + end + end + end + + def down; end +end diff --git a/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb b/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb new file mode 100644 index 00000000000..a7dd1bda9db --- /dev/null +++ b/db/post_migrate/20230510062503_queue_cleanup_personal_access_tokens_with_nil_expires_at.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class QueueCleanupPersonalAccessTokensWithNilExpiresAt < Gitlab::Database::Migration[2.1] + MIGRATION = "CleanupPersonalAccessTokensWithNilExpiresAt" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 50_000 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :personal_access_tokens, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, []) + end +end diff --git a/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb b/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb new file mode 100644 index 00000000000..fa4fab5b8df --- /dev/null +++ b/db/post_migrate/20230510130050_remove_ci_triggers_ref_column.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveCiTriggersRefColumn < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + remove_column :ci_triggers, :ref + end + + def down + # rubocop:disable Migration/SchemaAdditionMethodsNoPost + add_column :ci_triggers, :ref, :string, if_not_exists: true + # rubocop:enable Migration/SchemaAdditionMethodsNoPost + end +end diff --git a/db/post_migrate/20230512023321_prepare_audit_events_group_index.rb b/db/post_migrate/20230512023321_prepare_audit_events_group_index.rb new file mode 100644 index 00000000000..c3b27d6a909 --- /dev/null +++ b/db/post_migrate/20230512023321_prepare_audit_events_group_index.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +class PrepareAuditEventsGroupIndex < Gitlab::Database::Migration[2.1] + include Gitlab::Database::PartitioningMigrationHelpers + + TABLE_NAME = :audit_events + COLUMN_NAMES = [:entity_id, :entity_type, :created_at, :id] + INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type_and_created_at' + + disable_ddl_transaction! + + def up + # Since audit_events 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. + # TODO: Issue for future migration https://gitlab.com/gitlab-org/gitlab/-/issues/411129 + each_partition(TABLE_NAME) do |partition, partition_index_name| + prepare_async_index( + partition.identifier, + COLUMN_NAMES, + name: partition_index_name + ) + end + end + + def down + each_partition(TABLE_NAME) 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/schema_migrations/20210826171758 b/db/schema_migrations/20210826171758 deleted file mode 100644 index a0bb0f5cfc6..00000000000 --- a/db/schema_migrations/20210826171758 +++ /dev/null @@ -1 +0,0 @@ -96a8a87cc075b7a2bf3919d0c891fdfedb2a9b7bab6460b82bfb43a3f8abe3cf
\ No newline at end of file diff --git a/db/schema_migrations/20210826193907 b/db/schema_migrations/20210826193907 deleted file mode 100644 index 417333d7212..00000000000 --- a/db/schema_migrations/20210826193907 +++ /dev/null @@ -1 +0,0 @@ -b7916e025131f11da97ab89a01b32d1dbacf94bb96dc84877ba18404c8b0b2ba
\ No newline at end of file diff --git a/db/schema_migrations/20210830085837 b/db/schema_migrations/20210830085837 deleted file mode 100644 index 590ff1fe13b..00000000000 --- a/db/schema_migrations/20210830085837 +++ /dev/null @@ -1 +0,0 @@ -cf1a51194961500cb63d848afb1d5ebbf2ef77f54d60957e92c9dd6a667913ea
\ No newline at end of file diff --git a/db/schema_migrations/20210830104800 b/db/schema_migrations/20210830104800 deleted file mode 100644 index ca1aa9180e2..00000000000 --- a/db/schema_migrations/20210830104800 +++ /dev/null @@ -1 +0,0 @@ -84a68304f95ae04b85625c214b28a251014582fb142390ff3df8ea6d6f0947e1
\ No newline at end of file diff --git a/db/schema_migrations/20210830140524 b/db/schema_migrations/20210830140524 deleted file mode 100644 index ed07d932278..00000000000 --- a/db/schema_migrations/20210830140524 +++ /dev/null @@ -1 +0,0 @@ -54f7c66eed745b62d0b53a407a96721f90392ab7f800db9c8a2607f22974ef3c
\ No newline at end of file diff --git a/db/schema_migrations/20210830154358 b/db/schema_migrations/20210830154358 deleted file mode 100644 index 7486c54c4c5..00000000000 --- a/db/schema_migrations/20210830154358 +++ /dev/null @@ -1 +0,0 @@ -04a44d0e261b26cc7f39b81a4c59ea8e4903d6d7bf73c2004b426204db4491bc
\ No newline at end of file diff --git a/db/schema_migrations/20210831123008 b/db/schema_migrations/20210831123008 deleted file mode 100644 index 35a14b2b10b..00000000000 --- a/db/schema_migrations/20210831123008 +++ /dev/null @@ -1 +0,0 @@ -36572ad3a4a8a7511512ff45e2a68252950ce852af1b5a28c6b4e4491f97be07
\ No newline at end of file diff --git a/db/schema_migrations/20210831134840 b/db/schema_migrations/20210831134840 deleted file mode 100644 index d05a375f8fd..00000000000 --- a/db/schema_migrations/20210831134840 +++ /dev/null @@ -1 +0,0 @@ -6cad93bd4c086a60164c3cb5c42737194c4b7b20c1ea9f4c6d998b7c3a8918b5
\ No newline at end of file diff --git a/db/schema_migrations/20210831135249 b/db/schema_migrations/20210831135249 deleted file mode 100644 index a08cfa6d8d9..00000000000 --- a/db/schema_migrations/20210831135249 +++ /dev/null @@ -1 +0,0 @@ -78b14e92c91e7ccb11b7b37e89e8e55749cf109b0fa5ce06e4e396a2ac743f1c
\ No newline at end of file diff --git a/db/schema_migrations/20210831203408 b/db/schema_migrations/20210831203408 deleted file mode 100644 index 6ab3f810e57..00000000000 --- a/db/schema_migrations/20210831203408 +++ /dev/null @@ -1 +0,0 @@ -50a06a2a57ed26c25af53d3d7f6f5ef73efde8a23a36c5f825af56b4d0c4c3f6
\ No newline at end of file diff --git a/db/schema_migrations/20210901044202 b/db/schema_migrations/20210901044202 deleted file mode 100644 index 8601b0d20a2..00000000000 --- a/db/schema_migrations/20210901044202 +++ /dev/null @@ -1 +0,0 @@ -1f070444e77eb56ba612f60ed4a0d90b8a44c4af419a09c873f3bf663c78af72
\ No newline at end of file diff --git a/db/schema_migrations/20210901044237 b/db/schema_migrations/20210901044237 deleted file mode 100644 index 25418c94441..00000000000 --- a/db/schema_migrations/20210901044237 +++ /dev/null @@ -1 +0,0 @@ -0d8caaa078914ed2bd43b383ee2efe50093947d65862c2f4dd8dc960cad0a43e
\ No newline at end of file diff --git a/db/schema_migrations/20210901065504 b/db/schema_migrations/20210901065504 deleted file mode 100644 index f62e6ce1272..00000000000 --- a/db/schema_migrations/20210901065504 +++ /dev/null @@ -1 +0,0 @@ -9724a5fc1703418f9b1ea1d5375fc3b01834b30e5ff16c60537db5cb00bc210a
\ No newline at end of file diff --git a/db/schema_migrations/20210901153324 b/db/schema_migrations/20210901153324 deleted file mode 100644 index a08982bad39..00000000000 --- a/db/schema_migrations/20210901153324 +++ /dev/null @@ -1 +0,0 @@ -34287b86616026b94374856991c793ad869c52badddc09be923984002c6214bd
\ No newline at end of file diff --git a/db/schema_migrations/20210901184511 b/db/schema_migrations/20210901184511 deleted file mode 100644 index 45a3b3b8c18..00000000000 --- a/db/schema_migrations/20210901184511 +++ /dev/null @@ -1 +0,0 @@ -40780a28f881d4e80bdb6b023f22804c4da735223323c8cf03cfcdcaf5337fe6
\ No newline at end of file diff --git a/db/schema_migrations/20210902144144 b/db/schema_migrations/20210902144144 deleted file mode 100644 index 330569f1beb..00000000000 --- a/db/schema_migrations/20210902144144 +++ /dev/null @@ -1 +0,0 @@ -c99df310082dd6f5faff3cfd90dfca88af26d840889910ebac0e73ba483a09b2
\ No newline at end of file diff --git a/db/schema_migrations/20210902171406 b/db/schema_migrations/20210902171406 deleted file mode 100644 index 89635e256ea..00000000000 --- a/db/schema_migrations/20210902171406 +++ /dev/null @@ -1 +0,0 @@ -d7be9a34d626e507add67f407a6fa0b45f16b244e8ebeeb071debc538fa25b49
\ No newline at end of file diff --git a/db/schema_migrations/20210902171808 b/db/schema_migrations/20210902171808 deleted file mode 100644 index 1398c2db4b6..00000000000 --- a/db/schema_migrations/20210902171808 +++ /dev/null @@ -1 +0,0 @@ -09b482e4716a2b0808ad83770222baed8e863a8f94f85f77ed2d557eaa348df4
\ No newline at end of file diff --git a/db/schema_migrations/20210902184334 b/db/schema_migrations/20210902184334 deleted file mode 100644 index f35699b357e..00000000000 --- a/db/schema_migrations/20210902184334 +++ /dev/null @@ -1 +0,0 @@ -508b8d4608d28b2a12cf429262c3dd336e130013a41e51ff6c95027ece1540e5
\ No newline at end of file diff --git a/db/schema_migrations/20210903054158 b/db/schema_migrations/20210903054158 deleted file mode 100644 index 8810481ab85..00000000000 --- a/db/schema_migrations/20210903054158 +++ /dev/null @@ -1 +0,0 @@ -113d6bb813a89646d48c8ba6a86fc8e73f741d5c345f603bfe33939fb90f9428
\ No newline at end of file diff --git a/db/schema_migrations/20210906100021 b/db/schema_migrations/20210906100021 deleted file mode 100644 index 9ae19276eab..00000000000 --- a/db/schema_migrations/20210906100021 +++ /dev/null @@ -1 +0,0 @@ -74f6800c968f80e18aa000df42fd23086404fdd7a863237e453541b7eeb4eb7f
\ No newline at end of file diff --git a/db/schema_migrations/20210906100316 b/db/schema_migrations/20210906100316 deleted file mode 100644 index 4ce17059b07..00000000000 --- a/db/schema_migrations/20210906100316 +++ /dev/null @@ -1 +0,0 @@ -b7329d4ff7ee651b56cb86c7091e0d933c4f43a77125323fb6c283eedcb737c2
\ No newline at end of file diff --git a/db/schema_migrations/20210906130643 b/db/schema_migrations/20210906130643 deleted file mode 100644 index 150e594026d..00000000000 --- a/db/schema_migrations/20210906130643 +++ /dev/null @@ -1 +0,0 @@ -c707c0879e439de95f24f8fe2084388276a46c5e0ee30e4134a43e22ca19b4ec
\ No newline at end of file diff --git a/db/schema_migrations/20210907013944 b/db/schema_migrations/20210907013944 deleted file mode 100644 index 97cf6ef7b2f..00000000000 --- a/db/schema_migrations/20210907013944 +++ /dev/null @@ -1 +0,0 @@ -1a449d347248cacae48d10340c5682abe6de57d2991712f4e0a39c921892e0c5
\ No newline at end of file diff --git a/db/schema_migrations/20210907021940 b/db/schema_migrations/20210907021940 deleted file mode 100644 index c6392fca8de..00000000000 --- a/db/schema_migrations/20210907021940 +++ /dev/null @@ -1 +0,0 @@ -53d1dee0bbe106eeaad3eda6e8012475cf4b59d30f78020c8d2ecf3499ff7e0f
\ No newline at end of file diff --git a/db/schema_migrations/20210907033745 b/db/schema_migrations/20210907033745 deleted file mode 100644 index 23d1c138824..00000000000 --- a/db/schema_migrations/20210907033745 +++ /dev/null @@ -1 +0,0 @@ -d02cc8e136f1d761a34c7c585a3fe2b8c3bc3bca67e0e45f950248a5fad36a24
\ No newline at end of file diff --git a/db/schema_migrations/20210907041000 b/db/schema_migrations/20210907041000 deleted file mode 100644 index 9b7b3d4b14c..00000000000 --- a/db/schema_migrations/20210907041000 +++ /dev/null @@ -1 +0,0 @@ -23d4d2d037cd70c5b810824a837b45f016a3be5d112938123c1da08416f667cd
\ No newline at end of file diff --git a/db/schema_migrations/20210907182337 b/db/schema_migrations/20210907182337 deleted file mode 100644 index cc3d32067c2..00000000000 --- a/db/schema_migrations/20210907182337 +++ /dev/null @@ -1 +0,0 @@ -ad564a1fda815473b09f1eda469e67cdd8f532b9b481f7e8ae3ddb8f2df6ee40
\ No newline at end of file diff --git a/db/schema_migrations/20210907182359 b/db/schema_migrations/20210907182359 deleted file mode 100644 index 41e72e9dfec..00000000000 --- a/db/schema_migrations/20210907182359 +++ /dev/null @@ -1 +0,0 @@ -da57784c8c7f8bcb3c8c61089b5a695efdb31b209cb1616af68240380c734669
\ No newline at end of file diff --git a/db/schema_migrations/20210907211557 b/db/schema_migrations/20210907211557 deleted file mode 100644 index e89552729ba..00000000000 --- a/db/schema_migrations/20210907211557 +++ /dev/null @@ -1 +0,0 @@ -387dcbda7c3b32050298d8a679361a17916a66d0ab686211f0d1a0dc708c4a74
\ No newline at end of file diff --git a/db/schema_migrations/20210908060951 b/db/schema_migrations/20210908060951 deleted file mode 100644 index cd4ed794cc5..00000000000 --- a/db/schema_migrations/20210908060951 +++ /dev/null @@ -1 +0,0 @@ -716fad7f9005a40d0c6a3acb8e348c7e9459a6a619fc0bf085f231f328f19fd1
\ No newline at end of file diff --git a/db/schema_migrations/20210908061132 b/db/schema_migrations/20210908061132 deleted file mode 100644 index a5b7e482228..00000000000 --- a/db/schema_migrations/20210908061132 +++ /dev/null @@ -1 +0,0 @@ -f9e14410f22c94d0500102bb0fd0a3a6bd27343b74810b852ceb1349a04be72d
\ No newline at end of file diff --git a/db/schema_migrations/20210908100810 b/db/schema_migrations/20210908100810 deleted file mode 100644 index a8c9023a1cc..00000000000 --- a/db/schema_migrations/20210908100810 +++ /dev/null @@ -1 +0,0 @@ -06e45cf159cf1182b34e83f893bcff65e4722dded2bf4cbcf61fafd652158823
\ No newline at end of file diff --git a/db/schema_migrations/20210908132335 b/db/schema_migrations/20210908132335 deleted file mode 100644 index 864d6ccc942..00000000000 --- a/db/schema_migrations/20210908132335 +++ /dev/null @@ -1 +0,0 @@ -399e35197111c257786a2bdf5dac990a26f48d2cc8493de642dcfa47ddececd2
\ No newline at end of file diff --git a/db/schema_migrations/20210908140437 b/db/schema_migrations/20210908140437 deleted file mode 100644 index fec99dfe6fd..00000000000 --- a/db/schema_migrations/20210908140437 +++ /dev/null @@ -1 +0,0 @@ -a8dc6d1fecf7b26182dd89f4dae088fb315774ff4720c282f608bd0c45c75a41
\ No newline at end of file diff --git a/db/schema_migrations/20210908185736 b/db/schema_migrations/20210908185736 deleted file mode 100644 index 826ec2b44e8..00000000000 --- a/db/schema_migrations/20210908185736 +++ /dev/null @@ -1 +0,0 @@ -4e9a585d33caed70c3e003e4f0127158ab9c98c790f8131012f052c2bd9cd1f0
\ No newline at end of file diff --git a/db/schema_migrations/20210908185754 b/db/schema_migrations/20210908185754 deleted file mode 100644 index 53b9efc22d4..00000000000 --- a/db/schema_migrations/20210908185754 +++ /dev/null @@ -1 +0,0 @@ -fc70f26e1d691773728e8e2251b23fe39247fc233996c2161143c660a92fe141
\ No newline at end of file diff --git a/db/schema_migrations/20210908195506 b/db/schema_migrations/20210908195506 deleted file mode 100644 index 8680c7639d0..00000000000 --- a/db/schema_migrations/20210908195506 +++ /dev/null @@ -1 +0,0 @@ -1ad794ac96f6297203046562c2ec422fbb4d1818a65266bb92179096040f7d82
\ No newline at end of file diff --git a/db/schema_migrations/20210909104800 b/db/schema_migrations/20210909104800 deleted file mode 100644 index 70ad28d72b8..00000000000 --- a/db/schema_migrations/20210909104800 +++ /dev/null @@ -1 +0,0 @@ -834825de758314db01a3daa2d2b943c11751553705c4dd078f2087b9ec6ff7f7
\ No newline at end of file diff --git a/db/schema_migrations/20210909152027 b/db/schema_migrations/20210909152027 deleted file mode 100644 index 39db0c43aa6..00000000000 --- a/db/schema_migrations/20210909152027 +++ /dev/null @@ -1 +0,0 @@ -abed3f9a6c188890d3dcd21f73a09347f8ccec0f6cc448220fadba5cbda17281
\ No newline at end of file diff --git a/db/schema_migrations/20210909184349 b/db/schema_migrations/20210909184349 deleted file mode 100644 index 5997ddc46cf..00000000000 --- a/db/schema_migrations/20210909184349 +++ /dev/null @@ -1 +0,0 @@ -6be3a6f8f748d8f02e2d42cd1a5103ec8bd5c17097d9e440b152685fc8d6ff83
\ No newline at end of file diff --git a/db/schema_migrations/20210910014741 b/db/schema_migrations/20210910014741 deleted file mode 100644 index b0f32fcabf3..00000000000 --- a/db/schema_migrations/20210910014741 +++ /dev/null @@ -1 +0,0 @@ -e6342d440d398980470f4dd018c5df56d0b5d4df11caa7ba5dd2e92578dbf678
\ No newline at end of file diff --git a/db/schema_migrations/20210910015047 b/db/schema_migrations/20210910015047 deleted file mode 100644 index 3f76060a9bb..00000000000 --- a/db/schema_migrations/20210910015047 +++ /dev/null @@ -1 +0,0 @@ -d0b2ee97781a5d3c671b855fb6be844431a73584be47ba35d83c7e8cfec69bcb
\ No newline at end of file diff --git a/db/schema_migrations/20210910141043 b/db/schema_migrations/20210910141043 deleted file mode 100644 index ccb687b8bda..00000000000 --- a/db/schema_migrations/20210910141043 +++ /dev/null @@ -1 +0,0 @@ -3885d2fca4166e71610cd957f1c5a703118cbb5ba47a8d494eb4e017fe499a7d
\ No newline at end of file diff --git a/db/schema_migrations/20210910192921 b/db/schema_migrations/20210910192921 deleted file mode 100644 index d593bca14ac..00000000000 --- a/db/schema_migrations/20210910192921 +++ /dev/null @@ -1 +0,0 @@ -48b5f8e614117ac5f1e7af4ab85a8835c3b3b34103154565dd7ef6f541dd3c37
\ No newline at end of file diff --git a/db/schema_migrations/20210910194952 b/db/schema_migrations/20210910194952 deleted file mode 100644 index 2af73174c34..00000000000 --- a/db/schema_migrations/20210910194952 +++ /dev/null @@ -1 +0,0 @@ -b805a0d3143f968343694ec864b38ba4991931131e8a5082dcd719420328a3ef
\ No newline at end of file diff --git a/db/schema_migrations/20210912034903 b/db/schema_migrations/20210912034903 deleted file mode 100644 index 8003a5b110c..00000000000 --- a/db/schema_migrations/20210912034903 +++ /dev/null @@ -1 +0,0 @@ -76bfbf3f12fed895c3cfb891080b5a452d1204c83ce96736048f857b33458ad1
\ No newline at end of file diff --git a/db/schema_migrations/20210913010411 b/db/schema_migrations/20210913010411 deleted file mode 100644 index 8ae59414604..00000000000 --- a/db/schema_migrations/20210913010411 +++ /dev/null @@ -1 +0,0 @@ -71d51d1ac74f5c559bf41b23e5677af7228ba824da835afbe0f2299695912c19
\ No newline at end of file diff --git a/db/schema_migrations/20210913010432 b/db/schema_migrations/20210913010432 deleted file mode 100644 index db2f53a8d06..00000000000 --- a/db/schema_migrations/20210913010432 +++ /dev/null @@ -1 +0,0 @@ -172e77890657dd82c6ce770c286894731f6ef7fbcffb4b4fc97e0a41d132b8e8
\ No newline at end of file diff --git a/db/schema_migrations/20210913122457 b/db/schema_migrations/20210913122457 deleted file mode 100644 index e8f322c64c8..00000000000 --- a/db/schema_migrations/20210913122457 +++ /dev/null @@ -1 +0,0 @@ -031fb794e4fa3d54098596defd9de6fb1e507e01bd8f02462c0079e7e59c3416
\ No newline at end of file diff --git a/db/schema_migrations/20210913224558 b/db/schema_migrations/20210913224558 deleted file mode 100644 index f2fb4eaeb71..00000000000 --- a/db/schema_migrations/20210913224558 +++ /dev/null @@ -1 +0,0 @@ -377af41414793d7e52ffbb1fd60f2f19c58cd63bb0e85192983b5bfe98515ae8
\ No newline at end of file diff --git a/db/schema_migrations/20210914094840 b/db/schema_migrations/20210914094840 deleted file mode 100644 index 51d46c05ae6..00000000000 --- a/db/schema_migrations/20210914094840 +++ /dev/null @@ -1 +0,0 @@ -994de4d18202a420a7184cabe787f6e3f872900147df0cd848731483e6d87566
\ No newline at end of file diff --git a/db/schema_migrations/20210914095310 b/db/schema_migrations/20210914095310 deleted file mode 100644 index fee7e0b9719..00000000000 --- a/db/schema_migrations/20210914095310 +++ /dev/null @@ -1 +0,0 @@ -6fcf3ff9867df68f5e9603ae0311b29bec33aa5c5b826786b094ab0960ebcd90
\ No newline at end of file diff --git a/db/schema_migrations/20210914145810 b/db/schema_migrations/20210914145810 deleted file mode 100644 index 1c2cdc8cbf2..00000000000 --- a/db/schema_migrations/20210914145810 +++ /dev/null @@ -1 +0,0 @@ -a30acb6d2a3772be29dfefc7d8cda2f2df94002556fa5de85483b7fca245be86
\ No newline at end of file diff --git a/db/schema_migrations/20210914172202 b/db/schema_migrations/20210914172202 deleted file mode 100644 index 2f7531b98aa..00000000000 --- a/db/schema_migrations/20210914172202 +++ /dev/null @@ -1 +0,0 @@ -2ab67d4cc17d0fdf01b5861a46d6ec51d1e76e7e88209b0964a884edd22cc63d
\ No newline at end of file diff --git a/db/schema_migrations/20210915000453 b/db/schema_migrations/20210915000453 deleted file mode 100644 index 611af2b1310..00000000000 --- a/db/schema_migrations/20210915000453 +++ /dev/null @@ -1 +0,0 @@ -ffb4e066420e1492550255e5866df6dc9f83d3d6cec9033284c4c3194d53b827
\ No newline at end of file diff --git a/db/schema_migrations/20210915001242 b/db/schema_migrations/20210915001242 deleted file mode 100644 index 7aa9b5c5787..00000000000 --- a/db/schema_migrations/20210915001242 +++ /dev/null @@ -1 +0,0 @@ -fc8f86f794d77902fd86acaec6046b65821ff685f841d28158dc05fb55773c16
\ No newline at end of file diff --git a/db/schema_migrations/20210915022415 b/db/schema_migrations/20210915022415 deleted file mode 100644 index ab3ca284269..00000000000 --- a/db/schema_migrations/20210915022415 +++ /dev/null @@ -1 +0,0 @@ -ecb73d9a0be0cf04a8b405f1225d1a5de2fcdbb4c277fd5549f72a7a21596cdc
\ No newline at end of file diff --git a/db/schema_migrations/20210915070423 b/db/schema_migrations/20210915070423 deleted file mode 100644 index 772226db1dd..00000000000 --- a/db/schema_migrations/20210915070423 +++ /dev/null @@ -1 +0,0 @@ -f11b237fab6b4133c73f1d6105d85c8db1548b6d0753b2fd96f613c90a4fa3c1
\ No newline at end of file diff --git a/db/schema_migrations/20210915202900 b/db/schema_migrations/20210915202900 deleted file mode 100644 index bbe7f918f7a..00000000000 --- a/db/schema_migrations/20210915202900 +++ /dev/null @@ -1 +0,0 @@ -cc8f1bea8c722dfa06fc23a3dbaaacd7f1b7c5f7b529ebfab34b7c7c38e5db79
\ No newline at end of file diff --git a/db/schema_migrations/20210916132547 b/db/schema_migrations/20210916132547 deleted file mode 100644 index 69932a531d9..00000000000 --- a/db/schema_migrations/20210916132547 +++ /dev/null @@ -1 +0,0 @@ -d0953fdbaa6cf656e298ea482b3e3f931254276cb2285cffafba3d94b0626d3f
\ No newline at end of file diff --git a/db/schema_migrations/20210917134321 b/db/schema_migrations/20210917134321 deleted file mode 100644 index 3c5c397ecbf..00000000000 --- a/db/schema_migrations/20210917134321 +++ /dev/null @@ -1 +0,0 @@ -a0ba9fb9e2f7f738926a2273f9ff644c43acb999f4d27adf192e5006582a2a0e
\ No newline at end of file diff --git a/db/schema_migrations/20210917153645 b/db/schema_migrations/20210917153645 deleted file mode 100644 index 483c6153a24..00000000000 --- a/db/schema_migrations/20210917153645 +++ /dev/null @@ -1 +0,0 @@ -fb4c7ce2ed33b3843fbaaf34ea6dbb6db52776039db62b0ab0bb880744f615d1
\ No newline at end of file diff --git a/db/schema_migrations/20210917153905 b/db/schema_migrations/20210917153905 deleted file mode 100644 index a4e424dfad3..00000000000 --- a/db/schema_migrations/20210917153905 +++ /dev/null @@ -1 +0,0 @@ -3f0ac2bbfdfe6a2c05043e02ec383bdc7787f86741d6b2df7da2cc6a7aef9ce3
\ No newline at end of file diff --git a/db/schema_migrations/20210917224419 b/db/schema_migrations/20210917224419 deleted file mode 100644 index a8b059e7b8d..00000000000 --- a/db/schema_migrations/20210917224419 +++ /dev/null @@ -1 +0,0 @@ -9204c844b22ad0d3a938ed908377c8baacdda038725a5cf105e4b11841c1ae21
\ No newline at end of file diff --git a/db/schema_migrations/20210918201050 b/db/schema_migrations/20210918201050 deleted file mode 100644 index 9c8f28bd813..00000000000 --- a/db/schema_migrations/20210918201050 +++ /dev/null @@ -1 +0,0 @@ -596fd274ca1d0b2ce8698e048fea6080c9b777c48febb35a4917a6027826908e
\ No newline at end of file diff --git a/db/schema_migrations/20210918202855 b/db/schema_migrations/20210918202855 deleted file mode 100644 index f9d48eb269f..00000000000 --- a/db/schema_migrations/20210918202855 +++ /dev/null @@ -1 +0,0 @@ -a735ae13c13f5492a5c16d3e60884b60c44d1d57f6aaacaea13f3b1bf00a8d78
\ No newline at end of file diff --git a/db/schema_migrations/20210920104446 b/db/schema_migrations/20210920104446 deleted file mode 100644 index 4687dca7d3c..00000000000 --- a/db/schema_migrations/20210920104446 +++ /dev/null @@ -1 +0,0 @@ -e7e9b13874081a7df42d07ccc9a54fb81973210d1c175cd995300f6339d57495
\ No newline at end of file diff --git a/db/schema_migrations/20210920232025 b/db/schema_migrations/20210920232025 deleted file mode 100644 index 1c5b248981f..00000000000 --- a/db/schema_migrations/20210920232025 +++ /dev/null @@ -1 +0,0 @@ -12dfb473067fc836cd435474405c3ca978d159a13e975f7663fe22c078731fd1
\ No newline at end of file diff --git a/db/schema_migrations/20210921032008 b/db/schema_migrations/20210921032008 deleted file mode 100644 index 058a4366e4a..00000000000 --- a/db/schema_migrations/20210921032008 +++ /dev/null @@ -1 +0,0 @@ -262127539fc16715a56e2cf7426f0f8d24922e26847a01a0a15552d71cd148f8
\ No newline at end of file diff --git a/db/schema_migrations/20210921062820 b/db/schema_migrations/20210921062820 deleted file mode 100644 index 0f83c4cb322..00000000000 --- a/db/schema_migrations/20210921062820 +++ /dev/null @@ -1 +0,0 @@ -ae98a673b649faf8644990de328470579e121544d4fc417562cc64a7687550ca
\ No newline at end of file diff --git a/db/schema_migrations/20210921063924 b/db/schema_migrations/20210921063924 deleted file mode 100644 index ed849aa174c..00000000000 --- a/db/schema_migrations/20210921063924 +++ /dev/null @@ -1 +0,0 @@ -4430d4e0d688c85768201ab09056d60151fdc949b4b5f4ebc5397a99b9ec5f83
\ No newline at end of file diff --git a/db/schema_migrations/20210921191010 b/db/schema_migrations/20210921191010 deleted file mode 100644 index c01a8f41437..00000000000 --- a/db/schema_migrations/20210921191010 +++ /dev/null @@ -1 +0,0 @@ -8fa4dbfc075036ca379f153e97b7afd2b7600d129f7fb5294dcf4574be9dd7d1
\ No newline at end of file diff --git a/db/schema_migrations/20210922021816 b/db/schema_migrations/20210922021816 deleted file mode 100644 index 8286647353d..00000000000 --- a/db/schema_migrations/20210922021816 +++ /dev/null @@ -1 +0,0 @@ -1d18e061cb5bcdaa7d3fcea93e58d65a6f2c8b557fe53ba461b6cfa570f565be
\ No newline at end of file diff --git a/db/schema_migrations/20210922025631 b/db/schema_migrations/20210922025631 deleted file mode 100644 index 217c1d9da25..00000000000 --- a/db/schema_migrations/20210922025631 +++ /dev/null @@ -1 +0,0 @@ -43b02083323765888f019386138e8fbaa3182d74bd5e8790d6fae6ea6f0a2104
\ No newline at end of file diff --git a/db/schema_migrations/20210922082019 b/db/schema_migrations/20210922082019 deleted file mode 100644 index c987f19e595..00000000000 --- a/db/schema_migrations/20210922082019 +++ /dev/null @@ -1 +0,0 @@ -011b714ee5d4389a5a172ae687eea3a814915fb39a5e5eae38b6ee423a903eaf
\ No newline at end of file diff --git a/db/schema_migrations/20210922084115 b/db/schema_migrations/20210922084115 deleted file mode 100644 index 7870576c40e..00000000000 --- a/db/schema_migrations/20210922084115 +++ /dev/null @@ -1 +0,0 @@ -6401de932d87b684c8a00254231312f8633c66a8ea96670b2761442c771d3d7f
\ No newline at end of file diff --git a/db/schema_migrations/20210922091402 b/db/schema_migrations/20210922091402 deleted file mode 100644 index cb8e307e928..00000000000 --- a/db/schema_migrations/20210922091402 +++ /dev/null @@ -1 +0,0 @@ -4f3a1dbf39f1955122f94616952bfe04836c43e97268035b2daec3bc16e55e66
\ No newline at end of file diff --git a/db/schema_migrations/20210922172056 b/db/schema_migrations/20210922172056 deleted file mode 100644 index 834280df2a8..00000000000 --- a/db/schema_migrations/20210922172056 +++ /dev/null @@ -1 +0,0 @@ -c50ccd9986188356776c2d19c5544a6da6e31b5bb1b16ed259455604cb6fd862
\ No newline at end of file diff --git a/db/schema_migrations/20210922172156 b/db/schema_migrations/20210922172156 deleted file mode 100644 index 06852710217..00000000000 --- a/db/schema_migrations/20210922172156 +++ /dev/null @@ -1 +0,0 @@ -083b18b8e687ae8ff9d93ee77c6d4fc2916a2f1b77acf44132f216236b0ff06c
\ No newline at end of file diff --git a/db/schema_migrations/20210922215740 b/db/schema_migrations/20210922215740 deleted file mode 100644 index b7fdf9b4dfe..00000000000 --- a/db/schema_migrations/20210922215740 +++ /dev/null @@ -1 +0,0 @@ -7b343a5e1fd2600585d8fe4ef7585f91fb4c72da329b6f9474384f7217381d12
\ No newline at end of file diff --git a/db/schema_migrations/20210922220104 b/db/schema_migrations/20210922220104 deleted file mode 100644 index 0cacca67f8f..00000000000 --- a/db/schema_migrations/20210922220104 +++ /dev/null @@ -1 +0,0 @@ -ced8a8373bdbf07b2be23701f243f3a9f338776eeaec0a6c4e5cc0e68572a16e
\ No newline at end of file diff --git a/db/schema_migrations/20210923042323 b/db/schema_migrations/20210923042323 deleted file mode 100644 index 944cb833939..00000000000 --- a/db/schema_migrations/20210923042323 +++ /dev/null @@ -1 +0,0 @@ -7b08303dae62fe9b9b5081221a6aa4bd6b687e0206e78e4b8a6f5964bc42b344
\ No newline at end of file diff --git a/db/schema_migrations/20210923042324 b/db/schema_migrations/20210923042324 deleted file mode 100644 index 445a6db0351..00000000000 --- a/db/schema_migrations/20210923042324 +++ /dev/null @@ -1 +0,0 @@ -52785c2791be5c17517335496e7cabd99fba1a82e82d8c783703bd68f8b40163
\ No newline at end of file diff --git a/db/schema_migrations/20210923042325 b/db/schema_migrations/20210923042325 deleted file mode 100644 index a89582ef187..00000000000 --- a/db/schema_migrations/20210923042325 +++ /dev/null @@ -1 +0,0 @@ -f253f2bd5643f8cf72f020e5ba5237506833dee84aa98828166d8ad1570f925f
\ No newline at end of file diff --git a/db/schema_migrations/20210923133143 b/db/schema_migrations/20210923133143 deleted file mode 100644 index c0e7bb485fb..00000000000 --- a/db/schema_migrations/20210923133143 +++ /dev/null @@ -1 +0,0 @@ -d2736a06009d6232d832a03d6842a81b1de2ce79b901331a0e09ac40fc51a463
\ No newline at end of file diff --git a/db/schema_migrations/20210923135909 b/db/schema_migrations/20210923135909 deleted file mode 100644 index b7b1ecc6bf2..00000000000 --- a/db/schema_migrations/20210923135909 +++ /dev/null @@ -1 +0,0 @@ -2afb8292fcdf9a56c11d9404275ffecfde4b2a474e733e3e19f4db62c628aa6c
\ No newline at end of file diff --git a/db/schema_migrations/20210923151641 b/db/schema_migrations/20210923151641 deleted file mode 100644 index bd38d8c6a28..00000000000 --- a/db/schema_migrations/20210923151641 +++ /dev/null @@ -1 +0,0 @@ -30c135ab62a57208160dd0949d6615f42af39117e25769d70a9658de5417b7e4
\ No newline at end of file diff --git a/db/schema_migrations/20210923192648 b/db/schema_migrations/20210923192648 deleted file mode 100644 index 5514ec65903..00000000000 --- a/db/schema_migrations/20210923192648 +++ /dev/null @@ -1 +0,0 @@ -d9cb520f198893019b24c970ba409471e3d98581eb62f746320fc6e81a16af08
\ No newline at end of file diff --git a/db/schema_migrations/20210923192649 b/db/schema_migrations/20210923192649 deleted file mode 100644 index e91955f09fe..00000000000 --- a/db/schema_migrations/20210923192649 +++ /dev/null @@ -1 +0,0 @@ -12fb550e936ede5a8e83ab06f2fc535201e7a276295a2103564412ded32958f8
\ No newline at end of file diff --git a/db/schema_migrations/20210927153807 b/db/schema_migrations/20210927153807 deleted file mode 100644 index c6a675e380b..00000000000 --- a/db/schema_migrations/20210927153807 +++ /dev/null @@ -1 +0,0 @@ -8e54f43a955023e422bf40476f468fbdf04f06e806b08fddf35208c65607fec3
\ No newline at end of file diff --git a/db/schema_migrations/20210928155022 b/db/schema_migrations/20210928155022 deleted file mode 100644 index d953746413a..00000000000 --- a/db/schema_migrations/20210928155022 +++ /dev/null @@ -1 +0,0 @@ -41ea0971cd62ba43bf98c1901169e7bb8fcebe68025d947f26b0ccf6806c976e
\ No newline at end of file diff --git a/db/schema_migrations/20210928171122 b/db/schema_migrations/20210928171122 deleted file mode 100644 index ccddd09345b..00000000000 --- a/db/schema_migrations/20210928171122 +++ /dev/null @@ -1 +0,0 @@ -f257ff9896e2d90ced39c2c010df1d4b74badae046651a190585c9c47342d119
\ No newline at end of file diff --git a/db/schema_migrations/20210929025600 b/db/schema_migrations/20210929025600 deleted file mode 100644 index fb00216afac..00000000000 --- a/db/schema_migrations/20210929025600 +++ /dev/null @@ -1 +0,0 @@ -c757a7e17433b8ddf15ae6304286fe3da69f820966455e7fbed7282286f5eb67
\ No newline at end of file diff --git a/db/schema_migrations/20210929030834 b/db/schema_migrations/20210929030834 deleted file mode 100644 index a3dc19d0440..00000000000 --- a/db/schema_migrations/20210929030834 +++ /dev/null @@ -1 +0,0 @@ -b5302b3a2384bd7d0e639f00941efb490c3121a9332f1e73be620ab0f6f3e771
\ No newline at end of file diff --git a/db/schema_migrations/20210929031049 b/db/schema_migrations/20210929031049 deleted file mode 100644 index 19ba54b465a..00000000000 --- a/db/schema_migrations/20210929031049 +++ /dev/null @@ -1 +0,0 @@ -d3f588e4edded61f36acbf25fba39be17a2ac16f37e9114f2c5c257c47dc1308
\ No newline at end of file diff --git a/db/schema_migrations/20210929032555 b/db/schema_migrations/20210929032555 deleted file mode 100644 index 779e6a63fe2..00000000000 --- a/db/schema_migrations/20210929032555 +++ /dev/null @@ -1 +0,0 @@ -08593002910759482c58f9b31f251d589ab32b540d9614a2c677df11d32f7f26
\ No newline at end of file diff --git a/db/schema_migrations/20210929115340 b/db/schema_migrations/20210929115340 deleted file mode 100644 index 2f6bf226e09..00000000000 --- a/db/schema_migrations/20210929115340 +++ /dev/null @@ -1 +0,0 @@ -0de2844fdec43eca860648bdb1a5b184bcc0f79b51086b16d8ef398f32cfd5de
\ No newline at end of file diff --git a/db/schema_migrations/20210929121516 b/db/schema_migrations/20210929121516 deleted file mode 100644 index c42d39c9c34..00000000000 --- a/db/schema_migrations/20210929121516 +++ /dev/null @@ -1 +0,0 @@ -432dc1f1e0280a79e4a6af56c2f2cb40c99edbc09e254b82b7f48c7c9217372b
\ No newline at end of file diff --git a/db/schema_migrations/20210929144453 b/db/schema_migrations/20210929144453 deleted file mode 100644 index 753ea50c272..00000000000 --- a/db/schema_migrations/20210929144453 +++ /dev/null @@ -1 +0,0 @@ -0f808c27d19e6a38d4aa31f2dd820fe226681af84e05c4af47213409b2043e5a
\ No newline at end of file diff --git a/db/schema_migrations/20210930081208 b/db/schema_migrations/20210930081208 deleted file mode 100644 index a0c1d701717..00000000000 --- a/db/schema_migrations/20210930081208 +++ /dev/null @@ -1 +0,0 @@ -4b2c1b8e80f481d2dbbcfcb61c0a3d3081cbe4081fdd710040a028d72bd5d0e4
\ No newline at end of file diff --git a/db/schema_migrations/20210930211936 b/db/schema_migrations/20210930211936 deleted file mode 100644 index 4538ddf180d..00000000000 --- a/db/schema_migrations/20210930211936 +++ /dev/null @@ -1 +0,0 @@ -3aaf2a4fa834331768e2acc10f67b8d456e70aca9784787e40b55dade7b6f64c
\ No newline at end of file diff --git a/db/schema_migrations/20211001001222 b/db/schema_migrations/20211001001222 deleted file mode 100644 index 2b0ebb346a9..00000000000 --- a/db/schema_migrations/20211001001222 +++ /dev/null @@ -1 +0,0 @@ -23be5444bb11f731e98edc9b6aad814d02fd0f3f6be9abdea9060898cc2b95f1
\ No newline at end of file diff --git a/db/schema_migrations/20211004062942 b/db/schema_migrations/20211004062942 deleted file mode 100644 index 6ad1af289f7..00000000000 --- a/db/schema_migrations/20211004062942 +++ /dev/null @@ -1 +0,0 @@ -95dcfdc6c03705b0db5e96d669051edf335b5d6501243f70588f9b73478116a6
\ No newline at end of file diff --git a/db/schema_migrations/20211004075629 b/db/schema_migrations/20211004075629 deleted file mode 100644 index d55f7370798..00000000000 --- a/db/schema_migrations/20211004075629 +++ /dev/null @@ -1 +0,0 @@ -e035616201329b7610e8c3a647bc01c52ce722790ea7bb88d4a38bc0feb4737e
\ No newline at end of file diff --git a/db/schema_migrations/20211004081911 b/db/schema_migrations/20211004081911 deleted file mode 100644 index c849cb776d8..00000000000 --- a/db/schema_migrations/20211004081911 +++ /dev/null @@ -1 +0,0 @@ -cc53e8c85fdb00c0772987516e0c23f5349cc6dc1e21b4124eb50efdaa6a4fcd
\ No newline at end of file diff --git a/db/schema_migrations/20211004110500 b/db/schema_migrations/20211004110500 deleted file mode 100644 index e22ed05de83..00000000000 --- a/db/schema_migrations/20211004110500 +++ /dev/null @@ -1 +0,0 @@ -1b0b562aefb724afe24b8640a22013cea6fddd0e594d6723f6819f69804ba9f7
\ No newline at end of file diff --git a/db/schema_migrations/20211004110927 b/db/schema_migrations/20211004110927 deleted file mode 100644 index aa70a4aa0d8..00000000000 --- a/db/schema_migrations/20211004110927 +++ /dev/null @@ -1 +0,0 @@ -50c937f979c83f6937364d92bf65ed42ef963f2d241eadcee6355c1b256c3ec9
\ No newline at end of file diff --git a/db/schema_migrations/20211004122540 b/db/schema_migrations/20211004122540 deleted file mode 100644 index 1c7fc785b29..00000000000 --- a/db/schema_migrations/20211004122540 +++ /dev/null @@ -1 +0,0 @@ -72358f01061f5296e21647d5da9bbb6a33e94055c9c9aded6088cfb9126564b2
\ No newline at end of file diff --git a/db/schema_migrations/20211004151202 b/db/schema_migrations/20211004151202 deleted file mode 100644 index f21ef531938..00000000000 --- a/db/schema_migrations/20211004151202 +++ /dev/null @@ -1 +0,0 @@ -88f8e8391a480450a3d76d98f089e1e2287048007d0ecdcbd0799c9cc021481f
\ No newline at end of file diff --git a/db/schema_migrations/20211005010101 b/db/schema_migrations/20211005010101 deleted file mode 100644 index 9789f36adea..00000000000 --- a/db/schema_migrations/20211005010101 +++ /dev/null @@ -1 +0,0 @@ -40e15593d9ee0fb5a59d1576c6da5a1eece265730f7ae15c5c81c2c5343b362c
\ No newline at end of file diff --git a/db/schema_migrations/20211005063519 b/db/schema_migrations/20211005063519 deleted file mode 100644 index d3450d4282a..00000000000 --- a/db/schema_migrations/20211005063519 +++ /dev/null @@ -1 +0,0 @@ -e45163c2d0d691fb5deab86d024c4edb8e3cd350271418e1ff132c31e2ca90a3
\ No newline at end of file diff --git a/db/schema_migrations/20211005063616 b/db/schema_migrations/20211005063616 deleted file mode 100644 index 030dfc12a68..00000000000 --- a/db/schema_migrations/20211005063616 +++ /dev/null @@ -1 +0,0 @@ -20d35e9baae343bccbb67a25eacd7fdb4b32fd4cedd95e6f8f7a2933470350fb
\ No newline at end of file diff --git a/db/schema_migrations/20211005063723 b/db/schema_migrations/20211005063723 deleted file mode 100644 index b4d8c7a3f6e..00000000000 --- a/db/schema_migrations/20211005063723 +++ /dev/null @@ -1 +0,0 @@ -4659ab6d971b03d9b44dda72fe1b571c5050fd6892cb4f16f2ca1ced0905c1ce
\ No newline at end of file diff --git a/db/schema_migrations/20211005083015 b/db/schema_migrations/20211005083015 deleted file mode 100644 index 0e5a20b824f..00000000000 --- a/db/schema_migrations/20211005083015 +++ /dev/null @@ -1 +0,0 @@ -37016ec5e5ab1bd8d2bd8020f98277b3ad9f450b833ce3ebde70aebce5130a26
\ No newline at end of file diff --git a/db/schema_migrations/20211005092428 b/db/schema_migrations/20211005092428 deleted file mode 100644 index 0ac1a5f6ee6..00000000000 --- a/db/schema_migrations/20211005092428 +++ /dev/null @@ -1 +0,0 @@ -43abb71ecc1f1b4e699af1258934884a06e4e4eb1445ec3cc7a2c6668f42f14a
\ No newline at end of file diff --git a/db/schema_migrations/20211005093558 b/db/schema_migrations/20211005093558 deleted file mode 100644 index 943f905b497..00000000000 --- a/db/schema_migrations/20211005093558 +++ /dev/null @@ -1 +0,0 @@ -16638e14f1920b2e615dcb14965b7ef2a16ead099e7f8b1cdad6dd75d6d45107
\ No newline at end of file diff --git a/db/schema_migrations/20211005100112 b/db/schema_migrations/20211005100112 deleted file mode 100644 index 1f7a92ca316..00000000000 --- a/db/schema_migrations/20211005100112 +++ /dev/null @@ -1 +0,0 @@ -196cd1cf84babb12e92830bf2b7a0315499fdb976f825d4913a506e744b4fd53
\ No newline at end of file diff --git a/db/schema_migrations/20211005112404 b/db/schema_migrations/20211005112404 deleted file mode 100644 index 80ce0534de8..00000000000 --- a/db/schema_migrations/20211005112404 +++ /dev/null @@ -1 +0,0 @@ -f4fe6c4a2860dd35f767d98d5025326142cab7fc9c12b5efb1541e2604791691
\ No newline at end of file diff --git a/db/schema_migrations/20211005112645 b/db/schema_migrations/20211005112645 deleted file mode 100644 index e17b00586e5..00000000000 --- a/db/schema_migrations/20211005112645 +++ /dev/null @@ -1 +0,0 @@ -59e5de7766dc55e820ec714fbb61b5db61a73959f1e877e66caf668f93d0d633
\ No newline at end of file diff --git a/db/schema_migrations/20211005194425 b/db/schema_migrations/20211005194425 deleted file mode 100644 index cd3710a6492..00000000000 --- a/db/schema_migrations/20211005194425 +++ /dev/null @@ -1 +0,0 @@ -6647e94d315c76629f9726e26bafd124fb2fed361568d65315e7c7557f8d9ecf
\ No newline at end of file diff --git a/db/schema_migrations/20211006060254 b/db/schema_migrations/20211006060254 deleted file mode 100644 index 2891170a092..00000000000 --- a/db/schema_migrations/20211006060254 +++ /dev/null @@ -1 +0,0 @@ -0d6ec7c1d96f32c645ddc051d8e3b3bd0ad759c52c8938888287b1c6b57d27a3
\ No newline at end of file diff --git a/db/schema_migrations/20211006060436 b/db/schema_migrations/20211006060436 deleted file mode 100644 index e2374c092c7..00000000000 --- a/db/schema_migrations/20211006060436 +++ /dev/null @@ -1 +0,0 @@ -918852db691546e4e93a933789968115ac98b5757d480ed1e09118508e6024d5
\ No newline at end of file diff --git a/db/schema_migrations/20211006103122 b/db/schema_migrations/20211006103122 deleted file mode 100644 index 4d2347702de..00000000000 --- a/db/schema_migrations/20211006103122 +++ /dev/null @@ -1 +0,0 @@ -1e29e4712d81aacf1178996c2dd9e82593be5a2311273800d91640d8eccd38ed
\ No newline at end of file diff --git a/db/schema_migrations/20211006122010 b/db/schema_migrations/20211006122010 deleted file mode 100644 index 6758ab4978a..00000000000 --- a/db/schema_migrations/20211006122010 +++ /dev/null @@ -1 +0,0 @@ -19efbbf7aab5837e33ff72d87e101a76da7eeb1d60c05ffc0ceddad1d0cbc69c
\ No newline at end of file diff --git a/db/schema_migrations/20211006145004 b/db/schema_migrations/20211006145004 deleted file mode 100644 index 6a99396d34a..00000000000 --- a/db/schema_migrations/20211006145004 +++ /dev/null @@ -1 +0,0 @@ -9fca672eaa0b82a37c211de35a4961b81fb163d290004907be7bf641327c65b1
\ No newline at end of file diff --git a/db/schema_migrations/20211006174114 b/db/schema_migrations/20211006174114 deleted file mode 100644 index 1d015b78676..00000000000 --- a/db/schema_migrations/20211006174114 +++ /dev/null @@ -1 +0,0 @@ -15d1bc08a87241b4217278ce8214f41d1d3c0cc4c26a3e659f395a602d139758
\ No newline at end of file diff --git a/db/schema_migrations/20211007090229 b/db/schema_migrations/20211007090229 deleted file mode 100644 index 9302c958709..00000000000 --- a/db/schema_migrations/20211007090229 +++ /dev/null @@ -1 +0,0 @@ -9d87052305a552ce380e81a33c690496c44e332eb86869ea6882f5cd4856ab93
\ No newline at end of file diff --git a/db/schema_migrations/20211007093340 b/db/schema_migrations/20211007093340 deleted file mode 100644 index 9b11d742548..00000000000 --- a/db/schema_migrations/20211007093340 +++ /dev/null @@ -1 +0,0 @@ -fbb3092caba901ddd5a740bb67a91d1c8a4c458651afaf02704399844acbd2b8
\ No newline at end of file diff --git a/db/schema_migrations/20211007113136 b/db/schema_migrations/20211007113136 deleted file mode 100644 index dc245a3723b..00000000000 --- a/db/schema_migrations/20211007113136 +++ /dev/null @@ -1 +0,0 @@ -7abcc243cd02a4eba77ea39cbb1b1f2de74d85e55055def9ae02c4fdeaba3d9a
\ No newline at end of file diff --git a/db/schema_migrations/20211007155221 b/db/schema_migrations/20211007155221 deleted file mode 100644 index 662668fe983..00000000000 --- a/db/schema_migrations/20211007155221 +++ /dev/null @@ -1 +0,0 @@ -115427979cd7ecfc14bf4f663a9afd5abc6d481d08fafc13ca7e6a8cac9ba20c
\ No newline at end of file diff --git a/db/schema_migrations/20211008043855 b/db/schema_migrations/20211008043855 deleted file mode 100644 index 0abc8393efa..00000000000 --- a/db/schema_migrations/20211008043855 +++ /dev/null @@ -1 +0,0 @@ -166ae24ae4856488c81a71c650dca038c8cd7cb2221545e84431e118da097688
\ No newline at end of file diff --git a/db/schema_migrations/20211008181451 b/db/schema_migrations/20211008181451 deleted file mode 100644 index 1687056609f..00000000000 --- a/db/schema_migrations/20211008181451 +++ /dev/null @@ -1 +0,0 @@ -b4104ebb3d99100ed5b6831174af563ea7cda46428007e30219198b910313b05
\ No newline at end of file diff --git a/db/schema_migrations/20211008182954 b/db/schema_migrations/20211008182954 deleted file mode 100644 index e530f090840..00000000000 --- a/db/schema_migrations/20211008182954 +++ /dev/null @@ -1 +0,0 @@ -d16b96a960e03e50135802885f5b8c44168d2413f3db1f53ac15389a33dddc61
\ No newline at end of file diff --git a/db/schema_migrations/20211008193137 b/db/schema_migrations/20211008193137 deleted file mode 100644 index 57d2f8cfbc8..00000000000 --- a/db/schema_migrations/20211008193137 +++ /dev/null @@ -1 +0,0 @@ -97efc3bb2039b66dac98135d93baefc780a62571bd80aa39d7458f37ce92905b
\ No newline at end of file diff --git a/db/schema_migrations/20211011004242 b/db/schema_migrations/20211011004242 deleted file mode 100644 index f25581cae75..00000000000 --- a/db/schema_migrations/20211011004242 +++ /dev/null @@ -1 +0,0 @@ -88bb0ca64281134fd97be474a1bb2be3ee60e59f10b9e144776a3282bba5a4c5
\ No newline at end of file diff --git a/db/schema_migrations/20211011104843 b/db/schema_migrations/20211011104843 deleted file mode 100644 index 78789b94ece..00000000000 --- a/db/schema_migrations/20211011104843 +++ /dev/null @@ -1 +0,0 @@ -e2812344b16cd51c544235bae8a365713ab7e34652c2c05511a7fe9d84c05fb1
\ No newline at end of file diff --git a/db/schema_migrations/20211011140930 b/db/schema_migrations/20211011140930 deleted file mode 100644 index 6347ee5d51d..00000000000 --- a/db/schema_migrations/20211011140930 +++ /dev/null @@ -1 +0,0 @@ -cdae819e8de3b5ad721014376bfd9af97a45e953e2d345daf62784f986a5eb31
\ No newline at end of file diff --git a/db/schema_migrations/20211011140931 b/db/schema_migrations/20211011140931 deleted file mode 100644 index c959d97074e..00000000000 --- a/db/schema_migrations/20211011140931 +++ /dev/null @@ -1 +0,0 @@ -7e51eb4443fd74da9bef4d9c1c3cc40376c311abbc05ca7871f725fada79b48a
\ No newline at end of file diff --git a/db/schema_migrations/20211011140932 b/db/schema_migrations/20211011140932 deleted file mode 100644 index af0e000b9f3..00000000000 --- a/db/schema_migrations/20211011140932 +++ /dev/null @@ -1 +0,0 @@ -0209db1e7be48bcbf0e52b451d37da0ef2ecadd567cdfa47907fc5032c258a27
\ No newline at end of file diff --git a/db/schema_migrations/20211011141239 b/db/schema_migrations/20211011141239 deleted file mode 100644 index f215f234a7e..00000000000 --- a/db/schema_migrations/20211011141239 +++ /dev/null @@ -1 +0,0 @@ -bc0ae055b331801fbe020c12a66e4e6ae790780121bfd66fd161093c94c7a84a
\ No newline at end of file diff --git a/db/schema_migrations/20211011141242 b/db/schema_migrations/20211011141242 deleted file mode 100644 index 01d082a4bc8..00000000000 --- a/db/schema_migrations/20211011141242 +++ /dev/null @@ -1 +0,0 @@ -9fd4977cdb57df827fe1a01f55a305d832ee4240d40af9396e093e3b4dbd1e33
\ No newline at end of file diff --git a/db/schema_migrations/20211011141243 b/db/schema_migrations/20211011141243 deleted file mode 100644 index cb2df22b8d7..00000000000 --- a/db/schema_migrations/20211011141243 +++ /dev/null @@ -1 +0,0 @@ -b3ce6aa41c70cdcf8637a94c3d4d4e97730899221530f5507c4581aaf2fc3a6c
\ No newline at end of file diff --git a/db/schema_migrations/20211011152701 b/db/schema_migrations/20211011152701 deleted file mode 100644 index fcd6f8ad953..00000000000 --- a/db/schema_migrations/20211011152701 +++ /dev/null @@ -1 +0,0 @@ -5701681a1006584149c88da520f780b186ca32ba1facb8b952252c6d426b6c0d
\ No newline at end of file diff --git a/db/schema_migrations/20211012015903 b/db/schema_migrations/20211012015903 deleted file mode 100644 index bfa36780370..00000000000 --- a/db/schema_migrations/20211012015903 +++ /dev/null @@ -1 +0,0 @@ -4c3a55f7891dab4ee1ae019d97cf9d40e7bba81d87a544d6aa23a7f57e6d0f70
\ No newline at end of file diff --git a/db/schema_migrations/20211012051221 b/db/schema_migrations/20211012051221 deleted file mode 100644 index 0dc5e9331e1..00000000000 --- a/db/schema_migrations/20211012051221 +++ /dev/null @@ -1 +0,0 @@ -52b2a6d78fa649078167e842061ab7c04e3c41c0fc4a092a0a6123dad202fb0e
\ No newline at end of file diff --git a/db/schema_migrations/20211012091822 b/db/schema_migrations/20211012091822 deleted file mode 100644 index 09c198571af..00000000000 --- a/db/schema_migrations/20211012091822 +++ /dev/null @@ -1 +0,0 @@ -3482e5c12f1603cb67d24aee14f003345ef2a5c350c7dccafdea6554db04c4cc
\ No newline at end of file diff --git a/db/schema_migrations/20211012134316 b/db/schema_migrations/20211012134316 deleted file mode 100644 index 72e01841ddf..00000000000 --- a/db/schema_migrations/20211012134316 +++ /dev/null @@ -1 +0,0 @@ -0f2578f0266154ad2790cc808233c71566b3a3ea87c40909feba9ccc5872927c
\ No newline at end of file diff --git a/db/schema_migrations/20211012143815 b/db/schema_migrations/20211012143815 deleted file mode 100644 index 6e6a5493e99..00000000000 --- a/db/schema_migrations/20211012143815 +++ /dev/null @@ -1 +0,0 @@ -2685a534728ab1a50acb49a7a5ac7d9285fdc36ec3610b93a4219e6687c22b06
\ No newline at end of file diff --git a/db/schema_migrations/20211012155931 b/db/schema_migrations/20211012155931 deleted file mode 100644 index 1974e553fb7..00000000000 --- a/db/schema_migrations/20211012155931 +++ /dev/null @@ -1 +0,0 @@ -0a9317419b856ba2abf3cad07c43ccfc79abfcd5efd02c464ee76f4debe362c8
\ No newline at end of file diff --git a/db/schema_migrations/20211013014228 b/db/schema_migrations/20211013014228 deleted file mode 100644 index 5a833b7ee14..00000000000 --- a/db/schema_migrations/20211013014228 +++ /dev/null @@ -1 +0,0 @@ -5316cfddc074ae5a320ba763dd9481b46ba47d30eefa28d6bb5caa9368027598
\ No newline at end of file diff --git a/db/schema_migrations/20211013080714 b/db/schema_migrations/20211013080714 deleted file mode 100644 index 3579bdf3c78..00000000000 --- a/db/schema_migrations/20211013080714 +++ /dev/null @@ -1 +0,0 @@ -5c5adaf0f6f053c7e737051fbccf61d1fc36e20360a82d5fca142883d3e3bfdd
\ No newline at end of file diff --git a/db/schema_migrations/20211013080715 b/db/schema_migrations/20211013080715 deleted file mode 100644 index ff2d473c946..00000000000 --- a/db/schema_migrations/20211013080715 +++ /dev/null @@ -1 +0,0 @@ -06d6458f7b85b3e729c3c8a8ae29c29f7c5504ea330ae3a3bcf1e0074ed66cf6
\ No newline at end of file diff --git a/db/schema_migrations/20211013080716 b/db/schema_migrations/20211013080716 deleted file mode 100644 index d2131eb811a..00000000000 --- a/db/schema_migrations/20211013080716 +++ /dev/null @@ -1 +0,0 @@ -a5928cef69626ad5e972e8cb7a570ca83201cdfe7ec4f2401f2aa14c34b9cfb8
\ No newline at end of file diff --git a/db/schema_migrations/20211013125341 b/db/schema_migrations/20211013125341 deleted file mode 100644 index 6177dfa56bc..00000000000 --- a/db/schema_migrations/20211013125341 +++ /dev/null @@ -1 +0,0 @@ -933c37a1a44869588b6586d34dec6bc8d731c81b6e5889ce588d535c011b9340
\ No newline at end of file diff --git a/db/schema_migrations/20211013192749 b/db/schema_migrations/20211013192749 deleted file mode 100644 index 54f05dc3fd6..00000000000 --- a/db/schema_migrations/20211013192749 +++ /dev/null @@ -1 +0,0 @@ -eeda27c42a80d23851bb58b00cee79feeffbe9ae1fef76b3034f92c8610a8aaf
\ No newline at end of file diff --git a/db/schema_migrations/20211015021114 b/db/schema_migrations/20211015021114 deleted file mode 100644 index 1acbe9eded3..00000000000 --- a/db/schema_migrations/20211015021114 +++ /dev/null @@ -1 +0,0 @@ -687fa7d06a8d74b561d2b392e706fb209dbb1c0c8a483ad066820d29f7df059b
\ No newline at end of file diff --git a/db/schema_migrations/20211015024135 b/db/schema_migrations/20211015024135 deleted file mode 100644 index 9f40fe5b71c..00000000000 --- a/db/schema_migrations/20211015024135 +++ /dev/null @@ -1 +0,0 @@ -d3cafd6eb712ba3f11aa0e2bddc15bf312230e52d53ba8b7ae6c8d3cfd4aabcc
\ No newline at end of file diff --git a/db/schema_migrations/20211018101034 b/db/schema_migrations/20211018101034 deleted file mode 100644 index 57b1cc1e3c2..00000000000 --- a/db/schema_migrations/20211018101034 +++ /dev/null @@ -1 +0,0 @@ -1cadc3a932d5b62cfeafcd4090eddc37b44997dbbd0b34da1c7c87a5774bb683
\ No newline at end of file diff --git a/db/schema_migrations/20211018101552 b/db/schema_migrations/20211018101552 deleted file mode 100644 index 3814122d9a3..00000000000 --- a/db/schema_migrations/20211018101552 +++ /dev/null @@ -1 +0,0 @@ -9a62f0ec43ab295619d82494090c38539cb16408c8971bdde86bb8d02546f558
\ No newline at end of file diff --git a/db/schema_migrations/20211018101852 b/db/schema_migrations/20211018101852 deleted file mode 100644 index 5288e753211..00000000000 --- a/db/schema_migrations/20211018101852 +++ /dev/null @@ -1 +0,0 @@ -30e9632877d3ad33528be0f56962c0ab57f5eee3889183d9638cbaea903a3d82
\ No newline at end of file diff --git a/db/schema_migrations/20211018102252 b/db/schema_migrations/20211018102252 deleted file mode 100644 index 7d8b2c19da1..00000000000 --- a/db/schema_migrations/20211018102252 +++ /dev/null @@ -1 +0,0 @@ -14bb815cbdad2db56dafb7eaaff893de96116a1a9e8d6c5ed95f4bef9b9717fc
\ No newline at end of file diff --git a/db/schema_migrations/20211018123316 b/db/schema_migrations/20211018123316 deleted file mode 100644 index 37bf0b261f1..00000000000 --- a/db/schema_migrations/20211018123316 +++ /dev/null @@ -1 +0,0 @@ -fcee17f25ad3a8b6fb56c23b72978f4a6952200264d285b9e3df4b5e7733e8f6
\ No newline at end of file diff --git a/db/schema_migrations/20211018152654 b/db/schema_migrations/20211018152654 deleted file mode 100644 index 86e9980ad10..00000000000 --- a/db/schema_migrations/20211018152654 +++ /dev/null @@ -1 +0,0 @@ -fd7b6eb9439c00334f613e3e4977e44054930c1343e5df32bbe82c64acd6ca7b
\ No newline at end of file diff --git a/db/schema_migrations/20211018161447 b/db/schema_migrations/20211018161447 deleted file mode 100644 index e10f5b06d9a..00000000000 --- a/db/schema_migrations/20211018161447 +++ /dev/null @@ -1 +0,0 @@ -168b383c4a85de35ade8a26e442ca49a40342ba05fb23fab4f0444814d976f65
\ No newline at end of file diff --git a/db/schema_migrations/20211019153615 b/db/schema_migrations/20211019153615 deleted file mode 100644 index 7c1c7d7775f..00000000000 --- a/db/schema_migrations/20211019153615 +++ /dev/null @@ -1 +0,0 @@ -713efc9673bc6cda8eff4e433c3c85f0cc4b8b8ca7b5cc4308e57a6d0b0040a0
\ No newline at end of file diff --git a/db/schema_migrations/20211020030948 b/db/schema_migrations/20211020030948 deleted file mode 100644 index 1964b852444..00000000000 --- a/db/schema_migrations/20211020030948 +++ /dev/null @@ -1 +0,0 @@ -97e8b2ce324594581ec0af65840a0dde8271b1b2712e22059f5c26b30d7d5cac
\ No newline at end of file diff --git a/db/schema_migrations/20211020095357 b/db/schema_migrations/20211020095357 deleted file mode 100644 index 7fcb8fa6866..00000000000 --- a/db/schema_migrations/20211020095357 +++ /dev/null @@ -1 +0,0 @@ -a62ac8920223469c6e4c5a7f67ce9eec972189c98a8c542b377afe4ab28ee25a
\ No newline at end of file diff --git a/db/schema_migrations/20211021115409 b/db/schema_migrations/20211021115409 deleted file mode 100644 index bcbed298377..00000000000 --- a/db/schema_migrations/20211021115409 +++ /dev/null @@ -1 +0,0 @@ -93960203e6703716f9c513dca340e17041a33792f9233dc4b7e35d1e19614191
\ No newline at end of file diff --git a/db/schema_migrations/20211021124715 b/db/schema_migrations/20211021124715 deleted file mode 100644 index 2d03c608bac..00000000000 --- a/db/schema_migrations/20211021124715 +++ /dev/null @@ -1 +0,0 @@ -406af18458c7f5ee8a4fa3860ed5fb87c358363926fed2830be8e8a55578822b
\ No newline at end of file diff --git a/db/schema_migrations/20211021125908 b/db/schema_migrations/20211021125908 deleted file mode 100644 index 9cb92e1eabe..00000000000 --- a/db/schema_migrations/20211021125908 +++ /dev/null @@ -1 +0,0 @@ -d6fbe3efc3e45b750d82e277e30b7b0048b960d9f9f5b4f7c6a7a1ed869e76b5
\ No newline at end of file diff --git a/db/schema_migrations/20211021131217 b/db/schema_migrations/20211021131217 deleted file mode 100644 index 70b45512900..00000000000 --- a/db/schema_migrations/20211021131217 +++ /dev/null @@ -1 +0,0 @@ -87834e00821eb1ed8489c1d772dc3ac743bcf84669e78c04c7988f6f761970b8
\ No newline at end of file diff --git a/db/schema_migrations/20211021134458 b/db/schema_migrations/20211021134458 deleted file mode 100644 index dc168e12229..00000000000 --- a/db/schema_migrations/20211021134458 +++ /dev/null @@ -1 +0,0 @@ -1baa8db0d42a8d99e48b61930f5c42d1af5f86555488419b6551e1dbf417d3ad
\ No newline at end of file diff --git a/db/schema_migrations/20211021140426 b/db/schema_migrations/20211021140426 deleted file mode 100644 index c32db84a138..00000000000 --- a/db/schema_migrations/20211021140426 +++ /dev/null @@ -1 +0,0 @@ -bc7974917509bfbda47375299009295bc5a55970b92443dd5d7134075b161279
\ No newline at end of file diff --git a/db/schema_migrations/20211021141930 b/db/schema_migrations/20211021141930 deleted file mode 100644 index 294e1c80aea..00000000000 --- a/db/schema_migrations/20211021141930 +++ /dev/null @@ -1 +0,0 @@ -483e4cbe2a0be2afbda511f2298e3715abaca29afafeeae26449fc862f49a08f
\ No newline at end of file diff --git a/db/schema_migrations/20211022112202 b/db/schema_migrations/20211022112202 deleted file mode 100644 index 6ef610f80bc..00000000000 --- a/db/schema_migrations/20211022112202 +++ /dev/null @@ -1 +0,0 @@ -b5fbbfe186b3eeeb88bfd901ac426fc52355b71b67c5f5b42373008c19c35bee
\ No newline at end of file diff --git a/db/schema_migrations/20211022113000 b/db/schema_migrations/20211022113000 deleted file mode 100644 index 85044f34206..00000000000 --- a/db/schema_migrations/20211022113000 +++ /dev/null @@ -1 +0,0 @@ -ded528d0485951403f1c5af804f40b1c0a7c71a0dc67f24fadbc357a45fb1a19
\ No newline at end of file diff --git a/db/schema_migrations/20211022160154 b/db/schema_migrations/20211022160154 deleted file mode 100644 index 2a76379bc66..00000000000 --- a/db/schema_migrations/20211022160154 +++ /dev/null @@ -1 +0,0 @@ -c474870a626c909da772a1c9f459f369d50658ce8f585a35e7cc3c7ef64af657
\ No newline at end of file diff --git a/db/schema_migrations/20211022214523 b/db/schema_migrations/20211022214523 deleted file mode 100644 index b47f13696b0..00000000000 --- a/db/schema_migrations/20211022214523 +++ /dev/null @@ -1 +0,0 @@ -b372da05f40fa67680b6a28ddf9bed3dc4b95795c144bf4367e4826b5cd64d6b
\ No newline at end of file diff --git a/db/schema_migrations/20211023102243 b/db/schema_migrations/20211023102243 deleted file mode 100644 index ec507da6b47..00000000000 --- a/db/schema_migrations/20211023102243 +++ /dev/null @@ -1 +0,0 @@ -f5039be0bd028dab4f2623fe9997a95d50bd9020ffd8b92074418024cda39b6a
\ No newline at end of file diff --git a/db/schema_migrations/20211025103744 b/db/schema_migrations/20211025103744 deleted file mode 100644 index 29c49c81606..00000000000 --- a/db/schema_migrations/20211025103744 +++ /dev/null @@ -1 +0,0 @@ -56f86f2a20509f2052d0eab918a6d2bbb679d785cf5349916ba695aa92f0609f
\ No newline at end of file diff --git a/db/schema_migrations/20211025103758 b/db/schema_migrations/20211025103758 deleted file mode 100644 index 902973a42d9..00000000000 --- a/db/schema_migrations/20211025103758 +++ /dev/null @@ -1 +0,0 @@ -1722382c5141157497f48b209c0fa60c5959fa16c53d09fb6e8e6b2cb6e6ab9b
\ No newline at end of file diff --git a/db/schema_migrations/20211026070408 b/db/schema_migrations/20211026070408 deleted file mode 100644 index e48db972388..00000000000 --- a/db/schema_migrations/20211026070408 +++ /dev/null @@ -1 +0,0 @@ -630899d5a7f833ce0533ae553de89e70bd03fad9b438fd367e3a568261b08b00
\ No newline at end of file diff --git a/db/schema_migrations/20211026124336 b/db/schema_migrations/20211026124336 deleted file mode 100644 index dc6663e81a8..00000000000 --- a/db/schema_migrations/20211026124336 +++ /dev/null @@ -1 +0,0 @@ -a6807d2c17c4efdc759f39101856d7a082ae4d531ca3ced525de10e3de808b9d
\ No newline at end of file diff --git a/db/schema_migrations/20211026143238 b/db/schema_migrations/20211026143238 deleted file mode 100644 index 9f0e7f76cd9..00000000000 --- a/db/schema_migrations/20211026143238 +++ /dev/null @@ -1 +0,0 @@ -6b1377dd7e9b78a35c2f5635d2d11f5fe254aa772576510b41fcf1e03ad56c87
\ No newline at end of file diff --git a/db/schema_migrations/20211027043206 b/db/schema_migrations/20211027043206 deleted file mode 100644 index 7387484a118..00000000000 --- a/db/schema_migrations/20211027043206 +++ /dev/null @@ -1 +0,0 @@ -543feeedace6596d63207738829dcd62249a9f048a08928fbe4131ec69058322
\ No newline at end of file diff --git a/db/schema_migrations/20211027043229 b/db/schema_migrations/20211027043229 deleted file mode 100644 index 75c99cb5491..00000000000 --- a/db/schema_migrations/20211027043229 +++ /dev/null @@ -1 +0,0 @@ -2bceb12bdb90052cc8c1aedbd52c11cb8125471e1b59de3d75ef476fc64851c9
\ No newline at end of file diff --git a/db/schema_migrations/20211027064021 b/db/schema_migrations/20211027064021 deleted file mode 100644 index 3bd57b30583..00000000000 --- a/db/schema_migrations/20211027064021 +++ /dev/null @@ -1 +0,0 @@ -f1b218eaddb9bcc5e4d854a6b43fc5e122b38dc989225327a1c4a899f41e5ac6
\ No newline at end of file diff --git a/db/schema_migrations/20211027064156 b/db/schema_migrations/20211027064156 deleted file mode 100644 index 880b7a00694..00000000000 --- a/db/schema_migrations/20211027064156 +++ /dev/null @@ -1 +0,0 @@ -3d7b72684102836d7a7efcab7590b3d14bc63eb3e1bfbc7a95fb5eb5c6a906af
\ No newline at end of file diff --git a/db/schema_migrations/20211027112901 b/db/schema_migrations/20211027112901 deleted file mode 100644 index 0e4cb808f00..00000000000 --- a/db/schema_migrations/20211027112901 +++ /dev/null @@ -1 +0,0 @@ -83c1d699e5de98007ef815b5f9dfbc9a644c6289bf86832af1d5b8a6d3d83659
\ No newline at end of file diff --git a/db/schema_migrations/20211027203950 b/db/schema_migrations/20211027203950 deleted file mode 100644 index 4e4265a34c9..00000000000 --- a/db/schema_migrations/20211027203950 +++ /dev/null @@ -1 +0,0 @@ -38643fbd719e7d65e5e79eeb279a5732cee5c28774a300859a2bace13d882ee2
\ No newline at end of file diff --git a/db/schema_migrations/20211027204011 b/db/schema_migrations/20211027204011 deleted file mode 100644 index 7c1e07a87c0..00000000000 --- a/db/schema_migrations/20211027204011 +++ /dev/null @@ -1 +0,0 @@ -8542de6f3bf260b4e7596ed497ff8ed4204c81519d8f19e64ac86cd5532e7a61
\ No newline at end of file diff --git a/db/schema_migrations/20211028085926 b/db/schema_migrations/20211028085926 deleted file mode 100644 index c1e8d928fa0..00000000000 --- a/db/schema_migrations/20211028085926 +++ /dev/null @@ -1 +0,0 @@ -ed6939c1e89f78290c312bf005cb33bd1a5ee778e8d9be3ae2eb04cc25416b92
\ No newline at end of file diff --git a/db/schema_migrations/20211028100303 b/db/schema_migrations/20211028100303 deleted file mode 100644 index 472b2ce78ef..00000000000 --- a/db/schema_migrations/20211028100303 +++ /dev/null @@ -1 +0,0 @@ -bb28267d020cbc26614e4635c803af0168ab5606f3aadc40e1c0e0bc6d988254
\ No newline at end of file diff --git a/db/schema_migrations/20211028100843 b/db/schema_migrations/20211028100843 deleted file mode 100644 index 4be06f29039..00000000000 --- a/db/schema_migrations/20211028100843 +++ /dev/null @@ -1 +0,0 @@ -27578f62b5cde4fdbfe79eb717404a5cef62b8c17170525428dbf81e6b394ce9
\ No newline at end of file diff --git a/db/schema_migrations/20211028123412 b/db/schema_migrations/20211028123412 deleted file mode 100644 index d32c7c95d8f..00000000000 --- a/db/schema_migrations/20211028123412 +++ /dev/null @@ -1 +0,0 @@ -d7655fb2a01e389f59990b395ed7ef683b21a3371b7e68d3eb29def85eea1888
\ No newline at end of file diff --git a/db/schema_migrations/20211028132247 b/db/schema_migrations/20211028132247 deleted file mode 100644 index ab8fa3b55eb..00000000000 --- a/db/schema_migrations/20211028132247 +++ /dev/null @@ -1 +0,0 @@ -50a5c8af2cde1ae79d627f70d3b266488f76f76b481aefca8516db5360cfa843
\ No newline at end of file diff --git a/db/schema_migrations/20211028155449 b/db/schema_migrations/20211028155449 deleted file mode 100644 index 00b1c4e14dd..00000000000 --- a/db/schema_migrations/20211028155449 +++ /dev/null @@ -1 +0,0 @@ -385c540b1f80c31a5ba009ae3507d2b855a737389bcb75c07a8872f26f8a9b44
\ No newline at end of file diff --git a/db/schema_migrations/20211028212259 b/db/schema_migrations/20211028212259 deleted file mode 100644 index 777c5546592..00000000000 --- a/db/schema_migrations/20211028212259 +++ /dev/null @@ -1 +0,0 @@ -56af9791c8625d99e9a53690135086afccdbe8f58a5c236d6805b0883fb971b0
\ No newline at end of file diff --git a/db/schema_migrations/20211029102822 b/db/schema_migrations/20211029102822 deleted file mode 100644 index 72198f302b3..00000000000 --- a/db/schema_migrations/20211029102822 +++ /dev/null @@ -1 +0,0 @@ -e1f9d87287048010e9816fd5b4a9a2d30b64d2ad150226852f6679b950031914
\ No newline at end of file diff --git a/db/schema_migrations/20211031152417 b/db/schema_migrations/20211031152417 deleted file mode 100644 index 429c7dc0d8c..00000000000 --- a/db/schema_migrations/20211031152417 +++ /dev/null @@ -1 +0,0 @@ -f46a0dd662a80d38a4e8d3e6c4db05e61563a959b75d30a4c3724ae6afc2647f
\ No newline at end of file diff --git a/db/schema_migrations/20211031154919 b/db/schema_migrations/20211031154919 deleted file mode 100644 index 29cf7cc1580..00000000000 --- a/db/schema_migrations/20211031154919 +++ /dev/null @@ -1 +0,0 @@ -08399bfbf62533c00dfe3ca3434f6be292ec768f053d3b1fde41d2d68de32fe7
\ No newline at end of file diff --git a/db/schema_migrations/20211101132310 b/db/schema_migrations/20211101132310 deleted file mode 100644 index 08a95d2747e..00000000000 --- a/db/schema_migrations/20211101132310 +++ /dev/null @@ -1 +0,0 @@ -3e02605ce307d0ce37c3830e6909e7cfe5632408a757adf59209a70da92c0bc6
\ No newline at end of file diff --git a/db/schema_migrations/20211101165656 b/db/schema_migrations/20211101165656 deleted file mode 100644 index 6886ce7b564..00000000000 --- a/db/schema_migrations/20211101165656 +++ /dev/null @@ -1 +0,0 @@ -853e68aa974f49b7ab9f60acc0191da47598db115748e96752145c3cea89a986
\ No newline at end of file diff --git a/db/schema_migrations/20211101222614 b/db/schema_migrations/20211101222614 deleted file mode 100644 index 619ca607a75..00000000000 --- a/db/schema_migrations/20211101222614 +++ /dev/null @@ -1 +0,0 @@ -a579b14aff1d186d89173e383442f2ffbd69b1baed3f9a4c758fbb001b445139
\ No newline at end of file diff --git a/db/schema_migrations/20211102103127 b/db/schema_migrations/20211102103127 deleted file mode 100644 index 2ce33ad085a..00000000000 --- a/db/schema_migrations/20211102103127 +++ /dev/null @@ -1 +0,0 @@ -450028c90cb92f5ce3f8239eb56364b83ed025839aaf305b7ceb4fda077681b1
\ No newline at end of file diff --git a/db/schema_migrations/20211102114802 b/db/schema_migrations/20211102114802 deleted file mode 100644 index 35d3a25f3cb..00000000000 --- a/db/schema_migrations/20211102114802 +++ /dev/null @@ -1 +0,0 @@ -a3f9fcac354cccfdfc42b8f5baab651cb65ca60e4474ce937ab25b552bfe483c
\ No newline at end of file diff --git a/db/schema_migrations/20211103062728 b/db/schema_migrations/20211103062728 deleted file mode 100644 index 45bb2fcda65..00000000000 --- a/db/schema_migrations/20211103062728 +++ /dev/null @@ -1 +0,0 @@ -a22322122144f28306b3b38dbe50b3465ad623c389f8bfe6fa97a0f71b1c7c21
\ No newline at end of file diff --git a/db/schema_migrations/20211103141403 b/db/schema_migrations/20211103141403 deleted file mode 100644 index 357a24ae4bb..00000000000 --- a/db/schema_migrations/20211103141403 +++ /dev/null @@ -1 +0,0 @@ -d16d62b2984586540a99aa5fc67de6459a4cd473089ddbae8d45e8783863d78d
\ No newline at end of file diff --git a/db/schema_migrations/20211103162025 b/db/schema_migrations/20211103162025 deleted file mode 100644 index e6cb01358d4..00000000000 --- a/db/schema_migrations/20211103162025 +++ /dev/null @@ -1 +0,0 @@ -2ed9198926eb0579fccd4a8b1866f10ba4f42683d676e0664db3fadefe0bed39
\ No newline at end of file diff --git a/db/schema_migrations/20211103184303 b/db/schema_migrations/20211103184303 deleted file mode 100644 index f488474ce82..00000000000 --- a/db/schema_migrations/20211103184303 +++ /dev/null @@ -1 +0,0 @@ -fdec8e2d58c5b857a997d7fa3536969df8c05b8c455811cbec984834e031f2cb
\ No newline at end of file diff --git a/db/schema_migrations/20211104012209 b/db/schema_migrations/20211104012209 deleted file mode 100644 index 8a81fbdf9b8..00000000000 --- a/db/schema_migrations/20211104012209 +++ /dev/null @@ -1 +0,0 @@ -e7cf08543f911b5f95f08d4aa6063e05b026e463e71a65b6b8200191de1b02a1
\ No newline at end of file diff --git a/db/schema_migrations/20211104044453 b/db/schema_migrations/20211104044453 deleted file mode 100644 index 7d39c0e48e8..00000000000 --- a/db/schema_migrations/20211104044453 +++ /dev/null @@ -1 +0,0 @@ -fc5a60c27ca89b122d798abe8f55a0951fece712c885555df0d2f37b565d6f94
\ No newline at end of file diff --git a/db/schema_migrations/20211104165220 b/db/schema_migrations/20211104165220 deleted file mode 100644 index abfa37a45a4..00000000000 --- a/db/schema_migrations/20211104165220 +++ /dev/null @@ -1 +0,0 @@ -52625ff0a6117724cc1d7c6417ef95fe8dbcbb394486bb4734e28d3b41d23fd2
\ No newline at end of file diff --git a/db/schema_migrations/20211105010101 b/db/schema_migrations/20211105010101 deleted file mode 100644 index a7f79387e9f..00000000000 --- a/db/schema_migrations/20211105010101 +++ /dev/null @@ -1 +0,0 @@ -26c534cdae8630e3f28ad2b61a1049aaab5c5b7a1b761f0961831b621e148ed3
\ No newline at end of file diff --git a/db/schema_migrations/20211105125756 b/db/schema_migrations/20211105125756 deleted file mode 100644 index 842187d9ae2..00000000000 --- a/db/schema_migrations/20211105125756 +++ /dev/null @@ -1 +0,0 @@ -13cf3d164d541df48b6d14d7cc1953113476ba8ea5975d7d0c5f84098e2e0e61
\ No newline at end of file diff --git a/db/schema_migrations/20211105125813 b/db/schema_migrations/20211105125813 deleted file mode 100644 index 449c3d95d6a..00000000000 --- a/db/schema_migrations/20211105125813 +++ /dev/null @@ -1 +0,0 @@ -a48f62bed7e4c4a0e69acd3b340065317aff71602e696970276a4e443f1dcabf
\ No newline at end of file diff --git a/db/schema_migrations/20211105135157 b/db/schema_migrations/20211105135157 deleted file mode 100644 index 694509bfafd..00000000000 --- a/db/schema_migrations/20211105135157 +++ /dev/null @@ -1 +0,0 @@ -20f10ae28d439de1d07357ab7e977dae88feaaedb16770820350a9bf8242817f
\ No newline at end of file diff --git a/db/schema_migrations/20211105160316 b/db/schema_migrations/20211105160316 deleted file mode 100644 index 493dfb4afbd..00000000000 --- a/db/schema_migrations/20211105160316 +++ /dev/null @@ -1 +0,0 @@ -afb9552a4104b10b25d65a9fec478c5c28a31ec31402400554db4288033bacb6
\ No newline at end of file diff --git a/db/schema_migrations/20211105161404 b/db/schema_migrations/20211105161404 deleted file mode 100644 index 98b4bcdacfb..00000000000 --- a/db/schema_migrations/20211105161404 +++ /dev/null @@ -1 +0,0 @@ -911cc21de320d0d5716ce80ebca56433b793c2072cb62da783605c99bb9aada9
\ No newline at end of file diff --git a/db/schema_migrations/20211108154510 b/db/schema_migrations/20211108154510 deleted file mode 100644 index c978d671d29..00000000000 --- a/db/schema_migrations/20211108154510 +++ /dev/null @@ -1 +0,0 @@ -024c123bf06b796341a22e54f4c34b967d84aeb9b2006acf5cfef96a6161c13d
\ No newline at end of file diff --git a/db/schema_migrations/20211108154841 b/db/schema_migrations/20211108154841 deleted file mode 100644 index c602a1b6c24..00000000000 --- a/db/schema_migrations/20211108154841 +++ /dev/null @@ -1 +0,0 @@ -03842b87c4118f0e2aba1597ff08a6830b1dd5442a455e4bc9774b93b36a09b5
\ No newline at end of file diff --git a/db/schema_migrations/20211108203248 b/db/schema_migrations/20211108203248 deleted file mode 100644 index 4f8c570b627..00000000000 --- a/db/schema_migrations/20211108203248 +++ /dev/null @@ -1 +0,0 @@ -a2556a3d8b21e59caa6cbf7f83d621fef391904d0c13c77c0e5da713a580b4c9
\ No newline at end of file diff --git a/db/schema_migrations/20211108204736 b/db/schema_migrations/20211108204736 deleted file mode 100644 index 6d37b1b1184..00000000000 --- a/db/schema_migrations/20211108204736 +++ /dev/null @@ -1 +0,0 @@ -9e01b1817e4c578f5be7d7378dc12a8535c2bbbff5ecbc77f5a7cfdb148927f5
\ No newline at end of file diff --git a/db/schema_migrations/20211108211434 b/db/schema_migrations/20211108211434 deleted file mode 100644 index 17a90668900..00000000000 --- a/db/schema_migrations/20211108211434 +++ /dev/null @@ -1 +0,0 @@ -06cbecc52e62a48664ae486181047d8ca4d71a7991ba36bdca4bfa44257627f3
\ No newline at end of file diff --git a/db/schema_migrations/20211109100050 b/db/schema_migrations/20211109100050 deleted file mode 100644 index 94f9612277f..00000000000 --- a/db/schema_migrations/20211109100050 +++ /dev/null @@ -1 +0,0 @@ -86aa6ad1759a00c2cc5cb6dc2e381aead2910a24f0e37933a5e72af56d08101a
\ No newline at end of file diff --git a/db/schema_migrations/20211109101010 b/db/schema_migrations/20211109101010 deleted file mode 100644 index ea24f5e7e37..00000000000 --- a/db/schema_migrations/20211109101010 +++ /dev/null @@ -1 +0,0 @@ -30eb98b8fdb24bc5de357b0ec14a6b92d520db025c82bd7b9448f71542c7d7e3
\ No newline at end of file diff --git a/db/schema_migrations/20211109112454 b/db/schema_migrations/20211109112454 deleted file mode 100644 index 6fdb1e344b9..00000000000 --- a/db/schema_migrations/20211109112454 +++ /dev/null @@ -1 +0,0 @@ -1bc48cdae55eea5a5963edd3a138d7d6859afa6caafe0b793c553fdfabe9f488
\ No newline at end of file diff --git a/db/schema_migrations/20211110010101 b/db/schema_migrations/20211110010101 deleted file mode 100644 index bedcfdb2b3b..00000000000 --- a/db/schema_migrations/20211110010101 +++ /dev/null @@ -1 +0,0 @@ -63495b9f9ca2d4fa121b75eea36f2923942a6e11f27bef2c51414e00ccd48973
\ No newline at end of file diff --git a/db/schema_migrations/20211110014701 b/db/schema_migrations/20211110014701 deleted file mode 100644 index fe3721eb055..00000000000 --- a/db/schema_migrations/20211110014701 +++ /dev/null @@ -1 +0,0 @@ -1c5f65a25c9cf81a50bd9ffa2e74e2621cff04e58a2f90b19c66741ebb459d3e
\ No newline at end of file diff --git a/db/schema_migrations/20211110015252 b/db/schema_migrations/20211110015252 deleted file mode 100644 index 06a6a5b0ad7..00000000000 --- a/db/schema_migrations/20211110015252 +++ /dev/null @@ -1 +0,0 @@ -4038c269ce9c47ca9327fb1b81bb588e9065f0821f291d17c7965d7f8fe1f275
\ No newline at end of file diff --git a/db/schema_migrations/20211110092710 b/db/schema_migrations/20211110092710 deleted file mode 100644 index 691194456d4..00000000000 --- a/db/schema_migrations/20211110092710 +++ /dev/null @@ -1 +0,0 @@ -f6312d56d2ac77537383c8671d73ad202fed9bb8eddba4bdb24d19dbe821cdf3
\ No newline at end of file diff --git a/db/schema_migrations/20211110100050 b/db/schema_migrations/20211110100050 deleted file mode 100644 index eed0afbac1c..00000000000 --- a/db/schema_migrations/20211110100050 +++ /dev/null @@ -1 +0,0 @@ -54b83ba1f8e8aa8a23f230664bcd6cc068a2df2d669e395713f0805d0f054f9c
\ No newline at end of file diff --git a/db/schema_migrations/20211110143306 b/db/schema_migrations/20211110143306 deleted file mode 100644 index e1618c07f75..00000000000 --- a/db/schema_migrations/20211110143306 +++ /dev/null @@ -1 +0,0 @@ -7724e5a2c52be99b1b40c449f25abdc23f279f5b0bdaebcfd897c39d295fda41
\ No newline at end of file diff --git a/db/schema_migrations/20211110151320 b/db/schema_migrations/20211110151320 deleted file mode 100644 index 91f780811c3..00000000000 --- a/db/schema_migrations/20211110151320 +++ /dev/null @@ -1 +0,0 @@ -dab6123f19fb44a1566a8de9c760dedec5548dd64e472a180e7748cd7c93eea9
\ No newline at end of file diff --git a/db/schema_migrations/20211110151350 b/db/schema_migrations/20211110151350 deleted file mode 100644 index 98d590c26e9..00000000000 --- a/db/schema_migrations/20211110151350 +++ /dev/null @@ -1 +0,0 @@ -f5e69502e582c5f30ba686f8b668d8f0ce5cf8078b0833d2eda67f5ed97ac074
\ No newline at end of file diff --git a/db/schema_migrations/20211111112425 b/db/schema_migrations/20211111112425 deleted file mode 100644 index 5201a7d3156..00000000000 --- a/db/schema_migrations/20211111112425 +++ /dev/null @@ -1 +0,0 @@ -0ab93a0bfd52d6c13203a0b183b2fcb9d6770334e5b1bd00a28fb623b65c428d
\ No newline at end of file diff --git a/db/schema_migrations/20211111112639 b/db/schema_migrations/20211111112639 deleted file mode 100644 index e05cba2db8a..00000000000 --- a/db/schema_migrations/20211111112639 +++ /dev/null @@ -1 +0,0 @@ -870100261e3704522d390885b8ff13ebbcb093aa508d79b90f9738f6a0fffd10
\ No newline at end of file diff --git a/db/schema_migrations/20211111112713 b/db/schema_migrations/20211111112713 deleted file mode 100644 index 368378c28b8..00000000000 --- a/db/schema_migrations/20211111112713 +++ /dev/null @@ -1 +0,0 @@ -0cc2f19a8e31d9418ffd4fa1307f5210f0f2d781b957d417f06e19aca0b53985
\ No newline at end of file diff --git a/db/schema_migrations/20211111164025 b/db/schema_migrations/20211111164025 deleted file mode 100644 index 409cc160b9e..00000000000 --- a/db/schema_migrations/20211111164025 +++ /dev/null @@ -1 +0,0 @@ -d78fe687517e14ff67dc76eff63391e33b73d29446d2a0445595175c7cd6806a
\ No newline at end of file diff --git a/db/schema_migrations/20211111164047 b/db/schema_migrations/20211111164047 deleted file mode 100644 index 30e0875cf73..00000000000 --- a/db/schema_migrations/20211111164047 +++ /dev/null @@ -1 +0,0 @@ -c8ed7f8c0f818156dba9c25be848da97d4eb6dbf0aa9c48f87e940f3ca0967d9
\ No newline at end of file diff --git a/db/schema_migrations/20211112073413 b/db/schema_migrations/20211112073413 deleted file mode 100644 index 11551bb5819..00000000000 --- a/db/schema_migrations/20211112073413 +++ /dev/null @@ -1 +0,0 @@ -8960c0a2b7e621e466fde3bde6a252119008579c058046a16d57a6f6bff42008
\ No newline at end of file diff --git a/db/schema_migrations/20211112113300 b/db/schema_migrations/20211112113300 deleted file mode 100644 index 8074c437751..00000000000 --- a/db/schema_migrations/20211112113300 +++ /dev/null @@ -1 +0,0 @@ -be11c0b1c7b9c99c28d44c164742815da57bfc4a32afd54df9135e3ce6edeff9
\ No newline at end of file diff --git a/db/schema_migrations/20211112155416 b/db/schema_migrations/20211112155416 deleted file mode 100644 index 91037c578a7..00000000000 --- a/db/schema_migrations/20211112155416 +++ /dev/null @@ -1 +0,0 @@ -0c5627518093f6261679940402cbd756a91bf4617a37eecdbbc82dc57856dcec
\ No newline at end of file diff --git a/db/schema_migrations/20211115132613 b/db/schema_migrations/20211115132613 deleted file mode 100644 index be6f19bdc70..00000000000 --- a/db/schema_migrations/20211115132613 +++ /dev/null @@ -1 +0,0 @@ -a9cc7d1fc3317958ecda959b62b42f93b2609c4e784566f9696fef51c5ebdf3b
\ No newline at end of file diff --git a/db/schema_migrations/20211115142803 b/db/schema_migrations/20211115142803 deleted file mode 100644 index 0e9022f7c0e..00000000000 --- a/db/schema_migrations/20211115142803 +++ /dev/null @@ -1 +0,0 @@ -52fd12693481ae7e08eb084ef679434592538d99117c1906f30ca6a36b12a212
\ No newline at end of file diff --git a/db/schema_migrations/20211115142847 b/db/schema_migrations/20211115142847 deleted file mode 100644 index 049efcf8bcf..00000000000 --- a/db/schema_migrations/20211115142847 +++ /dev/null @@ -1 +0,0 @@ -cded37f94d578a503e5b389e6483ec68666983f71395c13b4f0011db04e807c3
\ No newline at end of file diff --git a/db/schema_migrations/20211115142911 b/db/schema_migrations/20211115142911 deleted file mode 100644 index 43bae5192c5..00000000000 --- a/db/schema_migrations/20211115142911 +++ /dev/null @@ -1 +0,0 @@ -63141e62fc21cf0a4b47355ecd3814c1f0cc829b7f4851d833f95369206c8919
\ No newline at end of file diff --git a/db/schema_migrations/20211115145107 b/db/schema_migrations/20211115145107 deleted file mode 100644 index 25270a5c587..00000000000 --- a/db/schema_migrations/20211115145107 +++ /dev/null @@ -1 +0,0 @@ -2b6bc8067402744b79eee06022cf3c91ba7ffd519df83aae4067600a6bbf43ad
\ No newline at end of file diff --git a/db/schema_migrations/20211115151704 b/db/schema_migrations/20211115151704 deleted file mode 100644 index 03093ade126..00000000000 --- a/db/schema_migrations/20211115151704 +++ /dev/null @@ -1 +0,0 @@ -3db18116febc760bcfeab597e0508d5b2835d0135068d79073770d343aa4b09c
\ No newline at end of file diff --git a/db/schema_migrations/20211115154103 b/db/schema_migrations/20211115154103 deleted file mode 100644 index 2b721bc7b39..00000000000 --- a/db/schema_migrations/20211115154103 +++ /dev/null @@ -1 +0,0 @@ -ad65e6deb885397dc91f33dc117a50e9a1b6d60f4caed8c5b77d474ec0340995
\ No newline at end of file diff --git a/db/schema_migrations/20211116091751 b/db/schema_migrations/20211116091751 deleted file mode 100644 index 8b13b53e437..00000000000 --- a/db/schema_migrations/20211116091751 +++ /dev/null @@ -1 +0,0 @@ -d71889bba2150265e9482be0b5ee89f43168d4a35b47469a36873d65f00df878
\ No newline at end of file diff --git a/db/schema_migrations/20211116093739 b/db/schema_migrations/20211116093739 deleted file mode 100644 index b0ded3f2a0f..00000000000 --- a/db/schema_migrations/20211116093739 +++ /dev/null @@ -1 +0,0 @@ -39d1988fe409944877df24e9859b171eab13c4a4703c8e85a2bff33318fb61fc
\ No newline at end of file diff --git a/db/schema_migrations/20211116111644 b/db/schema_migrations/20211116111644 deleted file mode 100644 index c2bc9dbee0d..00000000000 --- a/db/schema_migrations/20211116111644 +++ /dev/null @@ -1 +0,0 @@ -664c7fa75d3283b6e984fcca4ffcefab6dba24a78e4cc24ac86f791ab4495def
\ No newline at end of file diff --git a/db/schema_migrations/20211117084814 b/db/schema_migrations/20211117084814 deleted file mode 100644 index d24eb0a0c04..00000000000 --- a/db/schema_migrations/20211117084814 +++ /dev/null @@ -1 +0,0 @@ -d6b0ca9d1e88e9e531ee0da5c82723309d746b6d83ea5dfb8326d3cc718a31b6
\ No newline at end of file diff --git a/db/schema_migrations/20211117174209 b/db/schema_migrations/20211117174209 deleted file mode 100644 index f5e8cd180c2..00000000000 --- a/db/schema_migrations/20211117174209 +++ /dev/null @@ -1 +0,0 @@ -c7c29b136fbe00271807fcd3133baf7a6e9ded40989fc274e941fc99f2c19e4d
\ No newline at end of file diff --git a/db/schema_migrations/20211118100959 b/db/schema_migrations/20211118100959 deleted file mode 100644 index e3c42353b8d..00000000000 --- a/db/schema_migrations/20211118100959 +++ /dev/null @@ -1 +0,0 @@ -8b1bb9758150151518f16307d3f145431000b7edf946fd44e54cf7301087b002
\ No newline at end of file diff --git a/db/schema_migrations/20211118103439 b/db/schema_migrations/20211118103439 deleted file mode 100644 index 5b5891c3b16..00000000000 --- a/db/schema_migrations/20211118103439 +++ /dev/null @@ -1 +0,0 @@ -721f1ada9fe5a3d7e5da3750a43d5021a85a26e8adc4d649e7f0fff8cdf68344
\ No newline at end of file diff --git a/db/schema_migrations/20211118114228 b/db/schema_migrations/20211118114228 deleted file mode 100644 index 82c7984750d..00000000000 --- a/db/schema_migrations/20211118114228 +++ /dev/null @@ -1 +0,0 @@ -7686fd3e33b25b811aba459aba514cde8e88102277edb3be7e12378cb7e8de85
\ No newline at end of file diff --git a/db/schema_migrations/20211118124537 b/db/schema_migrations/20211118124537 deleted file mode 100644 index 537c3aa88fa..00000000000 --- a/db/schema_migrations/20211118124537 +++ /dev/null @@ -1 +0,0 @@ -d9a0886d95cd54add9e63475a2f1ca0601304bb64ffe6e6d9e62cb8997d5fe40
\ No newline at end of file diff --git a/db/schema_migrations/20211118124628 b/db/schema_migrations/20211118124628 deleted file mode 100644 index e6364327ca4..00000000000 --- a/db/schema_migrations/20211118124628 +++ /dev/null @@ -1 +0,0 @@ -f25ee0df287f1c44740be143831537bf262d09d7068ceca1c516ee964bc3aa24
\ No newline at end of file diff --git a/db/schema_migrations/20211118124650 b/db/schema_migrations/20211118124650 deleted file mode 100644 index 739cfeb80b3..00000000000 --- a/db/schema_migrations/20211118124650 +++ /dev/null @@ -1 +0,0 @@ -e032fd334d175d803b943c6328048705e81bd70af6ac226a032281304840f1cd
\ No newline at end of file diff --git a/db/schema_migrations/20211118130836 b/db/schema_migrations/20211118130836 deleted file mode 100644 index df16d8c5c5e..00000000000 --- a/db/schema_migrations/20211118130836 +++ /dev/null @@ -1 +0,0 @@ -2630b21c7134ac539a18798f2f2b99f468e171b79e30a184f7e8cdaccd11d465
\ No newline at end of file diff --git a/db/schema_migrations/20211118194239 b/db/schema_migrations/20211118194239 deleted file mode 100644 index ce3c1eb83d1..00000000000 --- a/db/schema_migrations/20211118194239 +++ /dev/null @@ -1 +0,0 @@ -04a4b10085bae2006ac78600b3cc410d130f9ac6944103c7bd85f71e060d4a67
\ No newline at end of file diff --git a/db/schema_migrations/20211119085015 b/db/schema_migrations/20211119085015 deleted file mode 100644 index 874bd158e7c..00000000000 --- a/db/schema_migrations/20211119085015 +++ /dev/null @@ -1 +0,0 @@ -88b289d724f98f75e0340cde4c6e2bc3cb55df2a979934fb2bc544d22e4c032d
\ No newline at end of file diff --git a/db/schema_migrations/20211119085036 b/db/schema_migrations/20211119085036 deleted file mode 100644 index f9d1eeffbcb..00000000000 --- a/db/schema_migrations/20211119085036 +++ /dev/null @@ -1 +0,0 @@ -2b2c28e0370ae1bb84bee5ff769c9b313902d1f1afc50fa54e23a1627b1121f3
\ No newline at end of file diff --git a/db/schema_migrations/20211119111006 b/db/schema_migrations/20211119111006 deleted file mode 100644 index ebb8e460452..00000000000 --- a/db/schema_migrations/20211119111006 +++ /dev/null @@ -1 +0,0 @@ -d618c28360f7716807e9727566019e269963d85164cf2f306ec9692d3b037802
\ No newline at end of file diff --git a/db/schema_migrations/20211119154221 b/db/schema_migrations/20211119154221 deleted file mode 100644 index c8b6005b48b..00000000000 --- a/db/schema_migrations/20211119154221 +++ /dev/null @@ -1 +0,0 @@ -020e17ffd6851fb861a17c1b120ca7cdfa300434d4a9ec923a4edcaa7f951b31
\ No newline at end of file diff --git a/db/schema_migrations/20211119170805 b/db/schema_migrations/20211119170805 deleted file mode 100644 index fffb02d4285..00000000000 --- a/db/schema_migrations/20211119170805 +++ /dev/null @@ -1 +0,0 @@ -adb95bc78104382fb1d3af2c2775b4b5bd23394b4260c3a97667b4bd7917e0da
\ No newline at end of file diff --git a/db/schema_migrations/20211119194024 b/db/schema_migrations/20211119194024 deleted file mode 100644 index 0d90b09e732..00000000000 --- a/db/schema_migrations/20211119194024 +++ /dev/null @@ -1 +0,0 @@ -ac2e376ad32f0e2fd45d8695f13a0b46c2d5964b881f79e3a30a51ac85d4359b
\ No newline at end of file diff --git a/db/schema_migrations/20211119195201 b/db/schema_migrations/20211119195201 deleted file mode 100644 index dd7f7b83d8d..00000000000 --- a/db/schema_migrations/20211119195201 +++ /dev/null @@ -1 +0,0 @@ -caaf92f12bf0ed144d99f629c9e5d64fd45832a90bbd743e40febcdc4802cd59
\ No newline at end of file diff --git a/db/schema_migrations/20211122033501 b/db/schema_migrations/20211122033501 deleted file mode 100644 index 08673370b57..00000000000 --- a/db/schema_migrations/20211122033501 +++ /dev/null @@ -1 +0,0 @@ -e010b4c12ae8203d9ea8a4c2035be5e7165aba0030f4d5fd0b0f978f84748707
\ No newline at end of file diff --git a/db/schema_migrations/20211122103051 b/db/schema_migrations/20211122103051 deleted file mode 100644 index eacca224329..00000000000 --- a/db/schema_migrations/20211122103051 +++ /dev/null @@ -1 +0,0 @@ -674a44e70291d6ed04318a5f6b639d216f2c26c43d15cb00e59b06cc6f6cc401
\ No newline at end of file diff --git a/db/schema_migrations/20211122193948 b/db/schema_migrations/20211122193948 deleted file mode 100644 index 94dbab4cd73..00000000000 --- a/db/schema_migrations/20211122193948 +++ /dev/null @@ -1 +0,0 @@ -12203afb7b66a12946d971dd601d2ce91e1408fcdf36d9d8b2fadcf09d7c1e56
\ No newline at end of file diff --git a/db/schema_migrations/20211122215001 b/db/schema_migrations/20211122215001 deleted file mode 100644 index be0fd652eb7..00000000000 --- a/db/schema_migrations/20211122215001 +++ /dev/null @@ -1 +0,0 @@ -fc29e10717357f7dd57940042d69a6c43a0d17fdf3c951917a76eae8c1d93ba3
\ No newline at end of file diff --git a/db/schema_migrations/20211123135255 b/db/schema_migrations/20211123135255 deleted file mode 100644 index e151abb0e33..00000000000 --- a/db/schema_migrations/20211123135255 +++ /dev/null @@ -1 +0,0 @@ -cf6b9bb5711b6a097e399e79fdabe01a237581d99de7fed3c2b69c65ffd23a06
\ No newline at end of file diff --git a/db/schema_migrations/20211123161906 b/db/schema_migrations/20211123161906 deleted file mode 100644 index 1370811b3af..00000000000 --- a/db/schema_migrations/20211123161906 +++ /dev/null @@ -1 +0,0 @@ -46767d804bde08ad4a076f20436652f980eb935a79b2ad30b4735b956be69a7a
\ No newline at end of file diff --git a/db/schema_migrations/20211123181236 b/db/schema_migrations/20211123181236 deleted file mode 100644 index 25f00af5d72..00000000000 --- a/db/schema_migrations/20211123181236 +++ /dev/null @@ -1 +0,0 @@ -ac21109099642d5934c16b3f0130736a587c4f20143552545c2b524062ff71e0
\ No newline at end of file diff --git a/db/schema_migrations/20211123182614 b/db/schema_migrations/20211123182614 deleted file mode 100644 index 8b67ec7cd26..00000000000 --- a/db/schema_migrations/20211123182614 +++ /dev/null @@ -1 +0,0 @@ -9a3ba69a1df02059b240393cc381c4a5ba9db0f116818aa9f3d4f1009f055b09
\ No newline at end of file diff --git a/db/schema_migrations/20211124095704 b/db/schema_migrations/20211124095704 deleted file mode 100644 index db18301ecd9..00000000000 --- a/db/schema_migrations/20211124095704 +++ /dev/null @@ -1 +0,0 @@ -1f5ed9e7af3f56d0e11d1a2bb78a7430ce05af49c8102d1c75c8ff84ae4e1c6d
\ No newline at end of file diff --git a/db/schema_migrations/20211124132319 b/db/schema_migrations/20211124132319 deleted file mode 100644 index 1809d13a553..00000000000 --- a/db/schema_migrations/20211124132319 +++ /dev/null @@ -1 +0,0 @@ -cdb85c8633687338a11ebce0603f82f5cab00e7c58f923d30b68a877b94e2db2
\ No newline at end of file diff --git a/db/schema_migrations/20211124132705 b/db/schema_migrations/20211124132705 deleted file mode 100644 index 12e3f08365b..00000000000 --- a/db/schema_migrations/20211124132705 +++ /dev/null @@ -1 +0,0 @@ -4eacad00017890c71f3354d80061fae7af40499256475cdf035bdf41b916e5f3
\ No newline at end of file diff --git a/db/schema_migrations/20211125120444 b/db/schema_migrations/20211125120444 deleted file mode 100644 index 8dca57e74ef..00000000000 --- a/db/schema_migrations/20211125120444 +++ /dev/null @@ -1 +0,0 @@ -19062282d022e5d93cd525cff44c67f1fbc5557f1201e523a57725dc0b6ecd70
\ No newline at end of file diff --git a/db/schema_migrations/20211126042235 b/db/schema_migrations/20211126042235 deleted file mode 100644 index 8c34dd173a9..00000000000 --- a/db/schema_migrations/20211126042235 +++ /dev/null @@ -1 +0,0 @@ -c6992d23fc43c26861accf7c516603802c95367460ad688d1a420a60a33833f1
\ No newline at end of file diff --git a/db/schema_migrations/20211126113029 b/db/schema_migrations/20211126113029 deleted file mode 100644 index aaf1a421982..00000000000 --- a/db/schema_migrations/20211126113029 +++ /dev/null @@ -1 +0,0 @@ -96abde258e6527a2b09bb60e1cc0cb90802c8a7e43a2132e9956536390a8aab8
\ No newline at end of file diff --git a/db/schema_migrations/20211126115449 b/db/schema_migrations/20211126115449 deleted file mode 100644 index 693dfb46149..00000000000 --- a/db/schema_migrations/20211126115449 +++ /dev/null @@ -1 +0,0 @@ -2e6e432ecf7b2c885905fd4df6b57fa99b324f56cb0850d9fc792b4a9b363423
\ No newline at end of file diff --git a/db/schema_migrations/20211126142200 b/db/schema_migrations/20211126142200 deleted file mode 100644 index 136addef509..00000000000 --- a/db/schema_migrations/20211126142200 +++ /dev/null @@ -1 +0,0 @@ -a00ce6a11c7671b6d2efe47e3859afaec72c437fdf5383b990ee09cf14081c9b
\ No newline at end of file diff --git a/db/schema_migrations/20211126142354 b/db/schema_migrations/20211126142354 deleted file mode 100644 index fc84b266263..00000000000 --- a/db/schema_migrations/20211126142354 +++ /dev/null @@ -1 +0,0 @@ -31d5fa3caff916a485f26b6834e37037455068cdcf502802196bf1d663716f49
\ No newline at end of file diff --git a/db/schema_migrations/20211126204445 b/db/schema_migrations/20211126204445 deleted file mode 100644 index b130d90b8ec..00000000000 --- a/db/schema_migrations/20211126204445 +++ /dev/null @@ -1 +0,0 @@ -e31592bbeb6ba6175f19cfceaafb37672633028dd021052542909999b46eac38
\ No newline at end of file diff --git a/db/schema_migrations/20211129151155 b/db/schema_migrations/20211129151155 deleted file mode 100644 index 4aa3e56bae6..00000000000 --- a/db/schema_migrations/20211129151155 +++ /dev/null @@ -1 +0,0 @@ -c1ba97f01fca6330628090010abb54220c0d057514386c6bb867c1b6f13f252c
\ No newline at end of file diff --git a/db/schema_migrations/20211129151832 b/db/schema_migrations/20211129151832 deleted file mode 100644 index fdfc464d136..00000000000 --- a/db/schema_migrations/20211129151832 +++ /dev/null @@ -1 +0,0 @@ -c6d257f635049f88cd6efba903c9384a0a1af23b3c8fe6fa7f0842dcdf9f7e39
\ No newline at end of file diff --git a/db/schema_migrations/20211130151724 b/db/schema_migrations/20211130151724 deleted file mode 100644 index 090d49ca482..00000000000 --- a/db/schema_migrations/20211130151724 +++ /dev/null @@ -1 +0,0 @@ -f9bd521c92558ba9ad3cfa3fd6ff1a647847c0fc767e1e4f45b43422542d5cc7
\ No newline at end of file diff --git a/db/schema_migrations/20211130165043 b/db/schema_migrations/20211130165043 deleted file mode 100644 index 3d4f7b52a69..00000000000 --- a/db/schema_migrations/20211130165043 +++ /dev/null @@ -1 +0,0 @@ -2eece823b66fec7f5a9a5c24b93d354a47939a7cdd915349a433b7bbec6abc22
\ No newline at end of file diff --git a/db/schema_migrations/20211130201100 b/db/schema_migrations/20211130201100 deleted file mode 100644 index 80c2d68671b..00000000000 --- a/db/schema_migrations/20211130201100 +++ /dev/null @@ -1 +0,0 @@ -cc0146769929c9fbb0b7b6788826d2e188c8664a14e1015563ba4f9e65397c4e
\ No newline at end of file diff --git a/db/schema_migrations/20211130201101 b/db/schema_migrations/20211130201101 deleted file mode 100644 index ef1178c10c5..00000000000 --- a/db/schema_migrations/20211130201101 +++ /dev/null @@ -1 +0,0 @@ -b0215ac45031593ca98de4f8858d21f1c29af03742a422bffd83598e39a6871c
\ No newline at end of file diff --git a/db/schema_migrations/20211130205719 b/db/schema_migrations/20211130205719 deleted file mode 100644 index aae23faabc9..00000000000 --- a/db/schema_migrations/20211130205719 +++ /dev/null @@ -1 +0,0 @@ -567a80916756adcca93bdbe82d69a923e539aac74146e714b58a1b023134d2c9
\ No newline at end of file diff --git a/db/schema_migrations/20211201061733 b/db/schema_migrations/20211201061733 deleted file mode 100644 index 722e7dd828c..00000000000 --- a/db/schema_migrations/20211201061733 +++ /dev/null @@ -1 +0,0 @@ -c5282e48f31c0896a3ce21fe238eb602dc006b0bfe62aa4f12ee39bbd620c76c
\ No newline at end of file diff --git a/db/schema_migrations/20211201101541 b/db/schema_migrations/20211201101541 deleted file mode 100644 index 52f43ddcd2f..00000000000 --- a/db/schema_migrations/20211201101541 +++ /dev/null @@ -1 +0,0 @@ -277cfcd1002e32c6cd664d6c0b6a7cbdf2ed7e5242e46dbddc4f99b0e8422361
\ No newline at end of file diff --git a/db/schema_migrations/20211201143042 b/db/schema_migrations/20211201143042 deleted file mode 100644 index a5f0c8be842..00000000000 --- a/db/schema_migrations/20211201143042 +++ /dev/null @@ -1 +0,0 @@ -0d27ca1250d10b8915fa4523707044f9a8c2372110537f5639a1811aeb0858b8
\ No newline at end of file diff --git a/db/schema_migrations/20221021082255 b/db/schema_migrations/20221021082255 deleted file mode 100644 index afb266271d4..00000000000 --- a/db/schema_migrations/20221021082255 +++ /dev/null @@ -1 +0,0 @@ -10caa548bccc134775ed14f85eae2b2063e83afe4a932982c353ecf1549a557d
\ No newline at end of file diff --git a/db/schema_migrations/20221021082256 b/db/schema_migrations/20221021082256 new file mode 100644 index 00000000000..0074889957f --- /dev/null +++ b/db/schema_migrations/20221021082256 @@ -0,0 +1 @@ +48c2eca5f5feea194eadc9d259f83e54fecbc7be1d219647d0b09ce4e5410eb4
\ No newline at end of file diff --git a/db/schema_migrations/20221021082257 b/db/schema_migrations/20221021082257 new file mode 100644 index 00000000000..43ca84c0427 --- /dev/null +++ b/db/schema_migrations/20221021082257 @@ -0,0 +1 @@ +1f3bf844501eee018b9594b447e55fac6c4628a22a9070cd95f37398067b03d6
\ No newline at end of file diff --git a/db/schema_migrations/20221021082312 b/db/schema_migrations/20221021082312 deleted file mode 100644 index 26007002f54..00000000000 --- a/db/schema_migrations/20221021082312 +++ /dev/null @@ -1 +0,0 @@ -86d979a179c504508fd2e9c1a62e935884297054b13b78a4c1460679d75f5b96
\ No newline at end of file diff --git a/db/schema_migrations/20221021082313 b/db/schema_migrations/20221021082313 new file mode 100644 index 00000000000..5c70993f0b4 --- /dev/null +++ b/db/schema_migrations/20221021082313 @@ -0,0 +1 @@ +9383e4f5ec51cf2971c98b4575546099c551b2a9f328f081c57866dc91838896
\ No newline at end of file diff --git a/db/schema_migrations/20221021082314 b/db/schema_migrations/20221021082314 new file mode 100644 index 00000000000..c35ab7664ef --- /dev/null +++ b/db/schema_migrations/20221021082314 @@ -0,0 +1 @@ +2711e477b81213c7221001a9c75dde169a5b8f2cc2a05534dcdae16ace9231a9
\ No newline at end of file diff --git a/db/schema_migrations/20221225010101 b/db/schema_migrations/20221225010101 new file mode 100644 index 00000000000..62d2d001438 --- /dev/null +++ b/db/schema_migrations/20221225010101 @@ -0,0 +1 @@ +94810a223f2d37a673d690ba326577068c18d6353021a78a8f820cf8a95c756c
\ No newline at end of file diff --git a/db/schema_migrations/20221225010102 b/db/schema_migrations/20221225010102 new file mode 100644 index 00000000000..8aacd082afc --- /dev/null +++ b/db/schema_migrations/20221225010102 @@ -0,0 +1 @@ +74a3b48267b16dcd9d3374b01604a0ae7f55dd35e681e3bf6bf5386ea4f6bdc3
\ No newline at end of file diff --git a/db/schema_migrations/20221225010103 b/db/schema_migrations/20221225010103 new file mode 100644 index 00000000000..99590b1246f --- /dev/null +++ b/db/schema_migrations/20221225010103 @@ -0,0 +1 @@ +bfa7df29a9f021b67db23127c6382161b131b77738f7a29dac5b64bc7431fd88
\ No newline at end of file diff --git a/db/schema_migrations/20221225010104 b/db/schema_migrations/20221225010104 new file mode 100644 index 00000000000..abbf974cda0 --- /dev/null +++ b/db/schema_migrations/20221225010104 @@ -0,0 +1 @@ +b2b2a169bb1d8581eec2706d03314d0675dcdf05b23b2787292b18ac1dfe7847
\ No newline at end of file diff --git a/db/schema_migrations/20221225010105 b/db/schema_migrations/20221225010105 new file mode 100644 index 00000000000..9f101f1aff3 --- /dev/null +++ b/db/schema_migrations/20221225010105 @@ -0,0 +1 @@ +241ed02cdd479f06a5a4a817b2d27bfa970997167fbd67ddae1da8359830a2ea
\ No newline at end of file diff --git a/db/schema_migrations/20221225010106 b/db/schema_migrations/20221225010106 new file mode 100644 index 00000000000..1499a3257eb --- /dev/null +++ b/db/schema_migrations/20221225010106 @@ -0,0 +1 @@ +08e0fd85bca9eff63f0fc5d1e34cca628ee191decddebcb90aaf98ce18f97147
\ No newline at end of file diff --git a/db/schema_migrations/20221229172604 b/db/schema_migrations/20221229172604 new file mode 100644 index 00000000000..2cbbc50ea10 --- /dev/null +++ b/db/schema_migrations/20221229172604 @@ -0,0 +1 @@ +8af1f290454aad1e131626a8dab575dfef11ae73581e57b7d7cb1b431fd06737
\ No newline at end of file diff --git a/db/schema_migrations/20230113164245 b/db/schema_migrations/20230113164245 new file mode 100644 index 00000000000..2c8b04d4387 --- /dev/null +++ b/db/schema_migrations/20230113164245 @@ -0,0 +1 @@ +eb2dfc21c5645e1f8aec9118a380c270525ce261a86ce13f89de891a8c4fa3a9
\ No newline at end of file diff --git a/db/schema_migrations/20230113201308 b/db/schema_migrations/20230113201308 new file mode 100644 index 00000000000..df391813488 --- /dev/null +++ b/db/schema_migrations/20230113201308 @@ -0,0 +1 @@ +775842b84022cf30d685060ea956c1e52722587f2be517d44ae44ca57f954538
\ No newline at end of file diff --git a/db/schema_migrations/20230118135145 b/db/schema_migrations/20230118135145 new file mode 100644 index 00000000000..15c566a4058 --- /dev/null +++ b/db/schema_migrations/20230118135145 @@ -0,0 +1 @@ +d6fdfc530a49b230aa041d4629a0484462abacb824f6bbf23d9740068e3ca781
\ No newline at end of file diff --git a/db/schema_migrations/20230118144623 b/db/schema_migrations/20230118144623 new file mode 100644 index 00000000000..82c15116c45 --- /dev/null +++ b/db/schema_migrations/20230118144623 @@ -0,0 +1 @@ +3ceeeeabb4ebae0f38e446c044fe6e6d929661b8689b461bed87660afd2e223b
\ No newline at end of file diff --git a/db/schema_migrations/20230125195503 b/db/schema_migrations/20230125195503 new file mode 100644 index 00000000000..ee8f7d47e16 --- /dev/null +++ b/db/schema_migrations/20230125195503 @@ -0,0 +1 @@ +6321659d8f71127368dffd0bec122d4c32835da364a32cd6f276c641a70d10ff
\ No newline at end of file diff --git a/db/schema_migrations/20230126101907 b/db/schema_migrations/20230126101907 new file mode 100644 index 00000000000..e7006b46b1a --- /dev/null +++ b/db/schema_migrations/20230126101907 @@ -0,0 +1 @@ +f6fccc22b53fdc590d5af1b5924275b43334820b66d4f488b3ef6f6d70b4e415
\ No newline at end of file diff --git a/db/schema_migrations/20230127024835 b/db/schema_migrations/20230127024835 new file mode 100644 index 00000000000..93b1460fd31 --- /dev/null +++ b/db/schema_migrations/20230127024835 @@ -0,0 +1 @@ +7599c99edcb87dad69c8721de9179f32f99236fad928a07734f3c66f174b8546
\ No newline at end of file diff --git a/db/schema_migrations/20230127030015 b/db/schema_migrations/20230127030015 new file mode 100644 index 00000000000..411b65dcf17 --- /dev/null +++ b/db/schema_migrations/20230127030015 @@ -0,0 +1 @@ +c957902ecdc96e1ae22d514f932c22bc04e07fd3e11dfd1bdbd45b077b6ee017
\ No newline at end of file diff --git a/db/schema_migrations/20230130182412 b/db/schema_migrations/20230130182412 new file mode 100644 index 00000000000..5d053b89d5e --- /dev/null +++ b/db/schema_migrations/20230130182412 @@ -0,0 +1 @@ +a5deb047ed3e0611ef10ce35d8f745f6d93d064a989488801c22d838d92ef780
\ No newline at end of file diff --git a/db/schema_migrations/20230131184319 b/db/schema_migrations/20230131184319 new file mode 100644 index 00000000000..3028f92b316 --- /dev/null +++ b/db/schema_migrations/20230131184319 @@ -0,0 +1 @@ +06a6005ecc7de9b6db9912b246aa27c30b308f47f23f1258043b7a7c636962b6
\ No newline at end of file diff --git a/db/schema_migrations/20230201165656 b/db/schema_migrations/20230201165656 new file mode 100644 index 00000000000..8e401067403 --- /dev/null +++ b/db/schema_migrations/20230201165656 @@ -0,0 +1 @@ +1f4e6f2b9e4461bb7dc663acedd08b2618f70e62ee8ae0a89bd9ccf11813f3b5
\ No newline at end of file diff --git a/db/schema_migrations/20230202094723 b/db/schema_migrations/20230202094723 new file mode 100644 index 00000000000..6d18a0b1cf9 --- /dev/null +++ b/db/schema_migrations/20230202094723 @@ -0,0 +1 @@ +54e3ad80c034d87621c266befc0a6d77b56927bb9afc71375767dcb647bb1aa9
\ No newline at end of file diff --git a/db/schema_migrations/20230202135758 b/db/schema_migrations/20230202135758 new file mode 100644 index 00000000000..2afb3886ade --- /dev/null +++ b/db/schema_migrations/20230202135758 @@ -0,0 +1 @@ +877ea1462505cfc9986353e5fb5f8cfc68a7557140bdc162bcfbd7a68c266f97
\ No newline at end of file diff --git a/db/schema_migrations/20230202211434 b/db/schema_migrations/20230202211434 new file mode 100644 index 00000000000..8389c248548 --- /dev/null +++ b/db/schema_migrations/20230202211434 @@ -0,0 +1 @@ +be43b7dd3fffd70b9d1ee5a7c1950c938674f2bf1dfb23d0a709a46be2005b8c
\ No newline at end of file diff --git a/db/schema_migrations/20230207002330 b/db/schema_migrations/20230207002330 new file mode 100644 index 00000000000..db78201d180 --- /dev/null +++ b/db/schema_migrations/20230207002330 @@ -0,0 +1 @@ +a1603460eec138b911b3535e66d7a064ff4f2cb6216aabfcf5f39e013db05445
\ No newline at end of file diff --git a/db/schema_migrations/20230208125736 b/db/schema_migrations/20230208125736 new file mode 100644 index 00000000000..bad75a7ffbe --- /dev/null +++ b/db/schema_migrations/20230208125736 @@ -0,0 +1 @@ +ce2100af8a397f9d2acfcdb9d8e4fefd82c42cecc78b1e762812738622bf76a9
\ No newline at end of file diff --git a/db/schema_migrations/20230209222452 b/db/schema_migrations/20230209222452 new file mode 100644 index 00000000000..74d791246e7 --- /dev/null +++ b/db/schema_migrations/20230209222452 @@ -0,0 +1 @@ +2d08ac0d8375a495212a55be1655cc70405bc722b152e3fa80c4609b3fb4c29c
\ No newline at end of file diff --git a/db/schema_migrations/20230210152109 b/db/schema_migrations/20230210152109 new file mode 100644 index 00000000000..cc158d38529 --- /dev/null +++ b/db/schema_migrations/20230210152109 @@ -0,0 +1 @@ +ed74efe6b6c5428f5d1be55d1ea4d11dfb23623d092483d0d474e82312379335
\ No newline at end of file diff --git a/db/schema_migrations/20230210153420 b/db/schema_migrations/20230210153420 new file mode 100644 index 00000000000..8ace16a1e67 --- /dev/null +++ b/db/schema_migrations/20230210153420 @@ -0,0 +1 @@ +07d3ef18df7faefc3b86d14b37b7254ab3301392053bbe322622be8a74a56f94
\ No newline at end of file diff --git a/db/schema_migrations/20230210155715 b/db/schema_migrations/20230210155715 new file mode 100644 index 00000000000..68ff0072b83 --- /dev/null +++ b/db/schema_migrations/20230210155715 @@ -0,0 +1 @@ +7d0b2686ec505eb7b08df119cbb8a3c1cf033d708050de474d627df68e72c3b4
\ No newline at end of file diff --git a/db/schema_migrations/20230210160037 b/db/schema_migrations/20230210160037 new file mode 100644 index 00000000000..f9a1697411b --- /dev/null +++ b/db/schema_migrations/20230210160037 @@ -0,0 +1 @@ +db0d359d329b7578c676ee137380b53d84c77c5699adb76243eb25eceda7e7e5
\ No newline at end of file diff --git a/db/schema_migrations/20230210160351 b/db/schema_migrations/20230210160351 new file mode 100644 index 00000000000..534b07f4371 --- /dev/null +++ b/db/schema_migrations/20230210160351 @@ -0,0 +1 @@ +0504365806c9692fff3e9aa32e371a3ddacaf8a26549929e45e271dac60992ac
\ No newline at end of file diff --git a/db/schema_migrations/20230210161002 b/db/schema_migrations/20230210161002 new file mode 100644 index 00000000000..4ba016dc519 --- /dev/null +++ b/db/schema_migrations/20230210161002 @@ -0,0 +1 @@ +9d300a27b9c5f3e1b157d5b741c605d9a8d80a886a0a574a5946addfc0ef4998
\ No newline at end of file diff --git a/db/schema_migrations/20230210171012 b/db/schema_migrations/20230210171012 new file mode 100644 index 00000000000..e026a7fffa9 --- /dev/null +++ b/db/schema_migrations/20230210171012 @@ -0,0 +1 @@ +f769362c0836821687c46f824e13b30ef7c8686eebf62da8f3e8a7d3c66c0f01
\ No newline at end of file diff --git a/db/schema_migrations/20230213103019 b/db/schema_migrations/20230213103019 new file mode 100644 index 00000000000..e28052b7f58 --- /dev/null +++ b/db/schema_migrations/20230213103019 @@ -0,0 +1 @@ +23979065610c4f361a639cdcf81e7ce491d111ed3752bd11081f9645b31e21f6
\ No newline at end of file diff --git a/db/schema_migrations/20230213213559 b/db/schema_migrations/20230213213559 new file mode 100644 index 00000000000..cfe68dc78e4 --- /dev/null +++ b/db/schema_migrations/20230213213559 @@ -0,0 +1 @@ +bd11c9514186437d2929b32f034256ee2442cf839b0bc6e64490ecff9978d017
\ No newline at end of file diff --git a/db/schema_migrations/20230214181633 b/db/schema_migrations/20230214181633 new file mode 100644 index 00000000000..76d4cf10b5c --- /dev/null +++ b/db/schema_migrations/20230214181633 @@ -0,0 +1 @@ +a8c815d1d85a6690755623b53e15e5fb73f7e6be6a24ead3532f21d21c1de20f
\ No newline at end of file diff --git a/db/schema_migrations/20230215074223 b/db/schema_migrations/20230215074223 new file mode 100644 index 00000000000..db68438eaae --- /dev/null +++ b/db/schema_migrations/20230215074223 @@ -0,0 +1 @@ +c63c7e4cdb985d4607f442c9728a5b2699d6112054c03571cc47684af435c249
\ No newline at end of file diff --git a/db/schema_migrations/20230215124011 b/db/schema_migrations/20230215124011 new file mode 100644 index 00000000000..88911b9faaf --- /dev/null +++ b/db/schema_migrations/20230215124011 @@ -0,0 +1 @@ +e8449ee3c54eb3ec1c4f2e302e7fceda950a16eb2bf57b0cd77ed955ad314eee
\ No newline at end of file diff --git a/db/schema_migrations/20230215131026 b/db/schema_migrations/20230215131026 new file mode 100644 index 00000000000..3bec8e04f4f --- /dev/null +++ b/db/schema_migrations/20230215131026 @@ -0,0 +1 @@ +095cc516f50dcb11e01ccda962a9776fddcec439520cef795f6c8715b5941aba
\ No newline at end of file diff --git a/db/schema_migrations/20230215180605 b/db/schema_migrations/20230215180605 new file mode 100644 index 00000000000..a3b222de10f --- /dev/null +++ b/db/schema_migrations/20230215180605 @@ -0,0 +1 @@ +879bee488f4089527de02ebfd6c9d6f6de7ab24d87361e29f998d86b62ca7461
\ No newline at end of file diff --git a/db/schema_migrations/20230215213349 b/db/schema_migrations/20230215213349 new file mode 100644 index 00000000000..0512fd3c7ea --- /dev/null +++ b/db/schema_migrations/20230215213349 @@ -0,0 +1 @@ +9b8521de286e8c363497c7854c530c7fcaf5aecb193a89addf7e15704ae271f9
\ No newline at end of file diff --git a/db/schema_migrations/20230216040505 b/db/schema_migrations/20230216040505 new file mode 100644 index 00000000000..d3cc858827f --- /dev/null +++ b/db/schema_migrations/20230216040505 @@ -0,0 +1 @@ +c6a905e29792b88f87810d267a4472886e0a1a22fe9531e3d7998abbd1035552
\ No newline at end of file diff --git a/db/schema_migrations/20230216060333 b/db/schema_migrations/20230216060333 new file mode 100644 index 00000000000..5f9fa26b1f0 --- /dev/null +++ b/db/schema_migrations/20230216060333 @@ -0,0 +1 @@ +c06d80c04bd661805f066412d750a651a0ead053cfff0e3314c03b3846a3f36d
\ No newline at end of file diff --git a/db/schema_migrations/20230216071312 b/db/schema_migrations/20230216071312 new file mode 100644 index 00000000000..2e92ecc19e6 --- /dev/null +++ b/db/schema_migrations/20230216071312 @@ -0,0 +1 @@ +204503fcf9e5da7255677a9a82f11e860410048efc1ed75cc7ba97b3cdd273c3
\ No newline at end of file diff --git a/db/schema_migrations/20230216142836 b/db/schema_migrations/20230216142836 new file mode 100644 index 00000000000..7f7d8230327 --- /dev/null +++ b/db/schema_migrations/20230216142836 @@ -0,0 +1 @@ +8b8b1a55b2f82b4dc0dcbb2b618dbc4dabdcb21d091cd98f19c68cc6fb4fa493
\ No newline at end of file diff --git a/db/schema_migrations/20230216144719 b/db/schema_migrations/20230216144719 new file mode 100644 index 00000000000..01ad731d72f --- /dev/null +++ b/db/schema_migrations/20230216144719 @@ -0,0 +1 @@ +cc74cddc9851a56cc98df1947ea1ea539358e9959b5c8f79aa1cea44979760b2
\ No newline at end of file diff --git a/db/schema_migrations/20230216152912 b/db/schema_migrations/20230216152912 new file mode 100644 index 00000000000..e9f1dfb9db3 --- /dev/null +++ b/db/schema_migrations/20230216152912 @@ -0,0 +1 @@ +66b74e0442763b2a05ec411344d8ca97b7d3d2e8cef9d2e04baba246b1c025a2
\ No newline at end of file diff --git a/db/schema_migrations/20230216171309 b/db/schema_migrations/20230216171309 new file mode 100644 index 00000000000..1e25ca0d3b1 --- /dev/null +++ b/db/schema_migrations/20230216171309 @@ -0,0 +1 @@ +ee00d6aba8a310c236dd16749228a42589657d060bbf1785c4358bf886fd59cc
\ No newline at end of file diff --git a/db/schema_migrations/20230216191507 b/db/schema_migrations/20230216191507 new file mode 100644 index 00000000000..7bc18f2fe42 --- /dev/null +++ b/db/schema_migrations/20230216191507 @@ -0,0 +1 @@ +71a2a98341e2ee32e0ee9706854378e2b6bbda8af1ac7f325b770cf5ff67738f
\ No newline at end of file diff --git a/db/schema_migrations/20230216222956 b/db/schema_migrations/20230216222956 new file mode 100644 index 00000000000..a93e0602cd6 --- /dev/null +++ b/db/schema_migrations/20230216222956 @@ -0,0 +1 @@ +6ebeadf8259911352813166646645320c3a238a68c1e8a4a97baa51b2bd182dd
\ No newline at end of file diff --git a/db/schema_migrations/20230216232404 b/db/schema_migrations/20230216232404 new file mode 100644 index 00000000000..e2fd3d7ae1f --- /dev/null +++ b/db/schema_migrations/20230216232404 @@ -0,0 +1 @@ +df059ad89887390a792f292b7062a2f04d901a049c2acea7b8ddaff677b8c9d5
\ No newline at end of file diff --git a/db/schema_migrations/20230216233937 b/db/schema_migrations/20230216233937 new file mode 100644 index 00000000000..d3c85c7c981 --- /dev/null +++ b/db/schema_migrations/20230216233937 @@ -0,0 +1 @@ +5088eccec1327f61cb80c5fca4f7e7710534179c2d6bf820f7021dfd079d51a5
\ No newline at end of file diff --git a/db/schema_migrations/20230217065736 b/db/schema_migrations/20230217065736 new file mode 100644 index 00000000000..a355b107c40 --- /dev/null +++ b/db/schema_migrations/20230217065736 @@ -0,0 +1 @@ +c772f3d2b46d48bfae68f2b420d38851ecea3105029e5154a58bed29359393f2
\ No newline at end of file diff --git a/db/schema_migrations/20230217144421 b/db/schema_migrations/20230217144421 new file mode 100644 index 00000000000..1ab17fcfa99 --- /dev/null +++ b/db/schema_migrations/20230217144421 @@ -0,0 +1 @@ +9a2ecdf9c37b13ebe5666ebadf2f27d4f52a0615337faaef221ff4fc6ae08cc4
\ No newline at end of file diff --git a/db/schema_migrations/20230217232554 b/db/schema_migrations/20230217232554 new file mode 100644 index 00000000000..501e10db401 --- /dev/null +++ b/db/schema_migrations/20230217232554 @@ -0,0 +1 @@ +56880a7008d06e9a30337cca7affbe4cdb796b8ef1ccc8b3fc8503af172281cb
\ No newline at end of file diff --git a/db/schema_migrations/20230218145930 b/db/schema_migrations/20230218145930 new file mode 100644 index 00000000000..17e1cb01703 --- /dev/null +++ b/db/schema_migrations/20230218145930 @@ -0,0 +1 @@ +63c47c7a879d54b4773f672ce8b771b3d416d44740b4a56c2cc05d4486daffab
\ No newline at end of file diff --git a/db/schema_migrations/20230218145940 b/db/schema_migrations/20230218145940 new file mode 100644 index 00000000000..0017b48bd5c --- /dev/null +++ b/db/schema_migrations/20230218145940 @@ -0,0 +1 @@ +3e3fcc5b0f186e722dbd2fe7b89cd1d32c59830bc66e7efb3fe1513f9fa2ba03
\ No newline at end of file diff --git a/db/schema_migrations/20230218152729 b/db/schema_migrations/20230218152729 new file mode 100644 index 00000000000..f78be055435 --- /dev/null +++ b/db/schema_migrations/20230218152729 @@ -0,0 +1 @@ +ac404c1dd1b2a38b8d02563b4b9306076f35120448d78b130c0421364c11822c
\ No newline at end of file diff --git a/db/schema_migrations/20230218152730 b/db/schema_migrations/20230218152730 new file mode 100644 index 00000000000..55fb6069403 --- /dev/null +++ b/db/schema_migrations/20230218152730 @@ -0,0 +1 @@ +f85595c6176426369f8558ba3dadf6ee2a5efa17f2d304dc8397862fc7d52545
\ No newline at end of file diff --git a/db/schema_migrations/20230219191034 b/db/schema_migrations/20230219191034 new file mode 100644 index 00000000000..911869229b3 --- /dev/null +++ b/db/schema_migrations/20230219191034 @@ -0,0 +1 @@ +f3be6612c3669066d9a805bf56cae7b3f9a1b6bdaee1bdb3e3f9a596ed3cecef
\ No newline at end of file diff --git a/db/schema_migrations/20230220035034 b/db/schema_migrations/20230220035034 new file mode 100644 index 00000000000..4cb8be66d8f --- /dev/null +++ b/db/schema_migrations/20230220035034 @@ -0,0 +1 @@ +f5636e464b16bfc201a3f3a21269c6d8686d2bc829aa80491bea120fd10e138a
\ No newline at end of file diff --git a/db/schema_migrations/20230220102212 b/db/schema_migrations/20230220102212 new file mode 100644 index 00000000000..a4432c7b517 --- /dev/null +++ b/db/schema_migrations/20230220102212 @@ -0,0 +1 @@ +7df50689f7e9311ee8e5bd2513f4361be0fceef3962344d2d16bf511132c7a33
\ No newline at end of file diff --git a/db/schema_migrations/20230220112930 b/db/schema_migrations/20230220112930 new file mode 100644 index 00000000000..0852b3fe5f7 --- /dev/null +++ b/db/schema_migrations/20230220112930 @@ -0,0 +1 @@ +b58d0cf5df91d7abc4ba7ef4a1257f03aa6e9849624d43728ca0e008c5710e7c
\ No newline at end of file diff --git a/db/schema_migrations/20230220132409 b/db/schema_migrations/20230220132409 new file mode 100644 index 00000000000..417675aaf27 --- /dev/null +++ b/db/schema_migrations/20230220132409 @@ -0,0 +1 @@ +b2aee06140d97dd9cd5d694b5d8538db92279aeba9e0e64375052ff455246647
\ No newline at end of file diff --git a/db/schema_migrations/20230220132410 b/db/schema_migrations/20230220132410 new file mode 100644 index 00000000000..39ee3040802 --- /dev/null +++ b/db/schema_migrations/20230220132410 @@ -0,0 +1 @@ +42814e8ab1b2ebb197f877736f8c9dddf5b9416c22f9c800c7a9d33cde164dd6
\ No newline at end of file diff --git a/db/schema_migrations/20230220134145 b/db/schema_migrations/20230220134145 new file mode 100644 index 00000000000..91238639d78 --- /dev/null +++ b/db/schema_migrations/20230220134145 @@ -0,0 +1 @@ +d20d4bd35b5e4132515c731e7df802c0fd6f3e88d4bee2d3b9fe42af4307977c
\ No newline at end of file diff --git a/db/schema_migrations/20230220134146 b/db/schema_migrations/20230220134146 new file mode 100644 index 00000000000..3d0745d3f22 --- /dev/null +++ b/db/schema_migrations/20230220134146 @@ -0,0 +1 @@ +7fe8e5e2e9019ccb29f29df161f7b7c45aa2576188b326e60f758dd2d5f56a47
\ No newline at end of file diff --git a/db/schema_migrations/20230220163141 b/db/schema_migrations/20230220163141 new file mode 100644 index 00000000000..ac2e348448d --- /dev/null +++ b/db/schema_migrations/20230220163141 @@ -0,0 +1 @@ +5f0c9945aaf1f34cb9c79b6c3634f4fd44ac538469b3f97147be67a6f16c0c75
\ No newline at end of file diff --git a/db/schema_migrations/20230220165240 b/db/schema_migrations/20230220165240 new file mode 100644 index 00000000000..14cd3554464 --- /dev/null +++ b/db/schema_migrations/20230220165240 @@ -0,0 +1 @@ +754b55e9465719edb5058c97cacf1f369347e15c7e6d7fa30dcbe5abd8addcae
\ No newline at end of file diff --git a/db/schema_migrations/20230221010522 b/db/schema_migrations/20230221010522 new file mode 100644 index 00000000000..57727695f5e --- /dev/null +++ b/db/schema_migrations/20230221010522 @@ -0,0 +1 @@ +474f2b46179134270dc65c2b32ef9acfb01edb976f5efefe9ab49352d3fc390f
\ No newline at end of file diff --git a/db/schema_migrations/20230221011750 b/db/schema_migrations/20230221011750 new file mode 100644 index 00000000000..9f43d53a1b2 --- /dev/null +++ b/db/schema_migrations/20230221011750 @@ -0,0 +1 @@ +cca7c1c232fa56e85bb0fc120a5920f3cb75d0fea2657ed2e81a4fe69349134a
\ No newline at end of file diff --git a/db/schema_migrations/20230221093533 b/db/schema_migrations/20230221093533 new file mode 100644 index 00000000000..1d9ac2c72b4 --- /dev/null +++ b/db/schema_migrations/20230221093533 @@ -0,0 +1 @@ +6a3453275435ebad3269b81f10bc75bf3aeb92f8c9a6769743acf2af78a1dc69
\ No newline at end of file diff --git a/db/schema_migrations/20230221093535 b/db/schema_migrations/20230221093535 new file mode 100644 index 00000000000..8d0ee370552 --- /dev/null +++ b/db/schema_migrations/20230221093535 @@ -0,0 +1 @@ +bc81ea0af8e135285170ac9d8c4adfda7e35b548f8c3b9c065788b21e8f63e85
\ No newline at end of file diff --git a/db/schema_migrations/20230221093536 b/db/schema_migrations/20230221093536 new file mode 100644 index 00000000000..92420dc9466 --- /dev/null +++ b/db/schema_migrations/20230221093536 @@ -0,0 +1 @@ +5fb6adb018288e955f7227a2793f133893d54e4205803350b060457fdc2f20aa
\ No newline at end of file diff --git a/db/schema_migrations/20230221110256 b/db/schema_migrations/20230221110256 new file mode 100644 index 00000000000..2448c317588 --- /dev/null +++ b/db/schema_migrations/20230221110256 @@ -0,0 +1 @@ +661fdc00029ab9bae8b4da6a8d92f172db89087aecc13f3ad65b2b3e8ad501d3
\ No newline at end of file diff --git a/db/schema_migrations/20230221125148 b/db/schema_migrations/20230221125148 new file mode 100644 index 00000000000..35ec9b066bc --- /dev/null +++ b/db/schema_migrations/20230221125148 @@ -0,0 +1 @@ +f64a3cb1963dde07eaaae9d331ebf1e5e52050435b38f9b6727a53f04808b723
\ No newline at end of file diff --git a/db/schema_migrations/20230221162222 b/db/schema_migrations/20230221162222 new file mode 100644 index 00000000000..be6d9c407b1 --- /dev/null +++ b/db/schema_migrations/20230221162222 @@ -0,0 +1 @@ +f0fd872c7999879be5d433881e20855cc8e2418625374fc095cc74172b9f08c5
\ No newline at end of file diff --git a/db/schema_migrations/20230221214519 b/db/schema_migrations/20230221214519 new file mode 100644 index 00000000000..aa630e64644 --- /dev/null +++ b/db/schema_migrations/20230221214519 @@ -0,0 +1 @@ +b8eccb700af0593b94e26e0fbe8b4c680b9bae47ced111422dc400159a3f6b12
\ No newline at end of file diff --git a/db/schema_migrations/20230222035805 b/db/schema_migrations/20230222035805 new file mode 100644 index 00000000000..a0dadf5c43a --- /dev/null +++ b/db/schema_migrations/20230222035805 @@ -0,0 +1 @@ +ffc433ce994ab67af36dfeddd19a29d8c35379f30c9a95c8bb2d0f3c7774e612
\ No newline at end of file diff --git a/db/schema_migrations/20230222055510 b/db/schema_migrations/20230222055510 new file mode 100644 index 00000000000..5abc44779d9 --- /dev/null +++ b/db/schema_migrations/20230222055510 @@ -0,0 +1 @@ +ff8b8d5448460302449025fc79cec95d0d3ae2eb335e9f786031d39caacf631a
\ No newline at end of file diff --git a/db/schema_migrations/20230222101420 b/db/schema_migrations/20230222101420 new file mode 100644 index 00000000000..f0cd65454ac --- /dev/null +++ b/db/schema_migrations/20230222101420 @@ -0,0 +1 @@ +74413d13062dd7a48d07f9839b4a22db3f7358cffda403a036dfa1686fb693c8
\ No newline at end of file diff --git a/db/schema_migrations/20230222102421 b/db/schema_migrations/20230222102421 new file mode 100644 index 00000000000..2b186e0e34a --- /dev/null +++ b/db/schema_migrations/20230222102421 @@ -0,0 +1 @@ +52ca4df8ee309791bb7fc4078a1298555b962137f1d07585e361b008d591164c
\ No newline at end of file diff --git a/db/schema_migrations/20230222153048 b/db/schema_migrations/20230222153048 new file mode 100644 index 00000000000..66347d3252f --- /dev/null +++ b/db/schema_migrations/20230222153048 @@ -0,0 +1 @@ +ff11462b7e827b0ae66f54b131fa0d4099a6e7cc768fc9b400ee36346d1773fa
\ No newline at end of file diff --git a/db/schema_migrations/20230222161226 b/db/schema_migrations/20230222161226 new file mode 100644 index 00000000000..229d4defec3 --- /dev/null +++ b/db/schema_migrations/20230222161226 @@ -0,0 +1 @@ +d51c92a4b2bb6e5d0bb3f8665f1bc6608cd2a89deb517c1f1dde3d8f0d003f79
\ No newline at end of file diff --git a/db/schema_migrations/20230222161954 b/db/schema_migrations/20230222161954 new file mode 100644 index 00000000000..1a1d84830cc --- /dev/null +++ b/db/schema_migrations/20230222161954 @@ -0,0 +1 @@ +3466379b2b26b1c77cc80b29ecdd601b9d77c94f724e210d0663cdb0ab37798e
\ No newline at end of file diff --git a/db/schema_migrations/20230222193845 b/db/schema_migrations/20230222193845 new file mode 100644 index 00000000000..eaf26ae70f1 --- /dev/null +++ b/db/schema_migrations/20230222193845 @@ -0,0 +1 @@ +b70150d44ca3f029fe987831a880017be9e8cd8f7833e6d4d3bb68929130b614
\ No newline at end of file diff --git a/db/schema_migrations/20230223014251 b/db/schema_migrations/20230223014251 new file mode 100644 index 00000000000..7613e540112 --- /dev/null +++ b/db/schema_migrations/20230223014251 @@ -0,0 +1 @@ +1d43fc6bfb88caf86d02b83c944c143bc87142a49f3fe1ec4c54e29c960060c5
\ No newline at end of file diff --git a/db/schema_migrations/20230223065753 b/db/schema_migrations/20230223065753 new file mode 100644 index 00000000000..c1b7927515f --- /dev/null +++ b/db/schema_migrations/20230223065753 @@ -0,0 +1 @@ +789d72eef2573834bef2a2d20070000b580eba069c45f97fdec18a4d5af99605
\ No newline at end of file diff --git a/db/schema_migrations/20230223082752 b/db/schema_migrations/20230223082752 new file mode 100644 index 00000000000..83789c7ffe8 --- /dev/null +++ b/db/schema_migrations/20230223082752 @@ -0,0 +1 @@ +53f1003eeb8f961b37d90c73a71f75683077b9bcd0e495395033998530a363bd
\ No newline at end of file diff --git a/db/schema_migrations/20230223093704 b/db/schema_migrations/20230223093704 new file mode 100644 index 00000000000..bd35f5c493e --- /dev/null +++ b/db/schema_migrations/20230223093704 @@ -0,0 +1 @@ +39a17836884a6c07ff3f9df6e7328473f1dc2ac2d407f615821d29958f9b1808
\ No newline at end of file diff --git a/db/schema_migrations/20230224085743 b/db/schema_migrations/20230224085743 new file mode 100644 index 00000000000..bda82e5e10c --- /dev/null +++ b/db/schema_migrations/20230224085743 @@ -0,0 +1 @@ +e6deb8645468ab4e90487211b14d5432b26fb4c06635b333776c1ac175187444
\ No newline at end of file diff --git a/db/schema_migrations/20230224130315 b/db/schema_migrations/20230224130315 new file mode 100644 index 00000000000..44960762a62 --- /dev/null +++ b/db/schema_migrations/20230224130315 @@ -0,0 +1 @@ +e54ddd26174440b453482d4c3d2dd8aa8cacbb2697162d9f976ed52a0d55f1a0
\ No newline at end of file diff --git a/db/schema_migrations/20230224144233 b/db/schema_migrations/20230224144233 new file mode 100644 index 00000000000..ce588827227 --- /dev/null +++ b/db/schema_migrations/20230224144233 @@ -0,0 +1 @@ +ec6c176dc707bcaa39747fb23add886c711e075b22823174bc9f0ebee2ec224e
\ No newline at end of file diff --git a/db/schema_migrations/20230224161346 b/db/schema_migrations/20230224161346 new file mode 100644 index 00000000000..1c939bdafaf --- /dev/null +++ b/db/schema_migrations/20230224161346 @@ -0,0 +1 @@ +191d7be803e9e3a2a5292bbcd562c34a67c07b73da2c429ac2f115b28d04f00c
\ No newline at end of file diff --git a/db/schema_migrations/20230227123949 b/db/schema_migrations/20230227123949 new file mode 100644 index 00000000000..ab216ad946c --- /dev/null +++ b/db/schema_migrations/20230227123949 @@ -0,0 +1 @@ +cf72b9c6cd86bf0fbb0599f16bfcfd360567a8cdf30275ba59c1aeaba8317f2a
\ No newline at end of file diff --git a/db/schema_migrations/20230227123950 b/db/schema_migrations/20230227123950 new file mode 100644 index 00000000000..e2b8672fb3f --- /dev/null +++ b/db/schema_migrations/20230227123950 @@ -0,0 +1 @@ +d7f195e2cb4ab9f7f4637ba7667605eea02e66ea417b4ae496a1acae9931be84
\ No newline at end of file diff --git a/db/schema_migrations/20230227151608 b/db/schema_migrations/20230227151608 new file mode 100644 index 00000000000..333d71b1789 --- /dev/null +++ b/db/schema_migrations/20230227151608 @@ -0,0 +1 @@ +b43ebf61392e2857bd38f783f1ae46c4adce76a94dd8e7aa64fc02f234991229
\ No newline at end of file diff --git a/db/schema_migrations/20230227151609 b/db/schema_migrations/20230227151609 new file mode 100644 index 00000000000..ec320e3c256 --- /dev/null +++ b/db/schema_migrations/20230227151609 @@ -0,0 +1 @@ +c2ac227a2e1a51423b043db9e992a519c096af8a309d3c1074fbd8bd744b4e3b
\ No newline at end of file diff --git a/db/schema_migrations/20230227153231 b/db/schema_migrations/20230227153231 new file mode 100644 index 00000000000..18e685b52b0 --- /dev/null +++ b/db/schema_migrations/20230227153231 @@ -0,0 +1 @@ +a4ae1dd4a14b977302c61d0731e9d350fbdc089a909ca3151fb4b9699b0efbb8
\ No newline at end of file diff --git a/db/schema_migrations/20230227153232 b/db/schema_migrations/20230227153232 new file mode 100644 index 00000000000..c605a0f5754 --- /dev/null +++ b/db/schema_migrations/20230227153232 @@ -0,0 +1 @@ +a9082aa6b8cb86be9534fe41db5790b6cca876e6fcc284daf8e5b3163b92bd06
\ No newline at end of file diff --git a/db/schema_migrations/20230228021910 b/db/schema_migrations/20230228021910 new file mode 100644 index 00000000000..813f8efc809 --- /dev/null +++ b/db/schema_migrations/20230228021910 @@ -0,0 +1 @@ +2be11b13b0776de4185232030374e16f0e6fdb5e21cfb6e546f2b8e5c6126547
\ No newline at end of file diff --git a/db/schema_migrations/20230228023014 b/db/schema_migrations/20230228023014 new file mode 100644 index 00000000000..39348c9471f --- /dev/null +++ b/db/schema_migrations/20230228023014 @@ -0,0 +1 @@ +68de7109072a6c6769d59100e5d17f2c35027cedfa365e8506951d985283f36b
\ No newline at end of file diff --git a/db/schema_migrations/20230228092612 b/db/schema_migrations/20230228092612 new file mode 100644 index 00000000000..ad52eedb797 --- /dev/null +++ b/db/schema_migrations/20230228092612 @@ -0,0 +1 @@ +79c17f4dfb9a208057562c8a9898fda4c1fa8819a3b7a1e594037fd8263aba6f
\ No newline at end of file diff --git a/db/schema_migrations/20230228133011 b/db/schema_migrations/20230228133011 new file mode 100644 index 00000000000..cd0c683fbcf --- /dev/null +++ b/db/schema_migrations/20230228133011 @@ -0,0 +1 @@ +ab33a8ef7080890c31a51c6f2455399ccb17a43595c305d15b2b884b28803860
\ No newline at end of file diff --git a/db/schema_migrations/20230228135034 b/db/schema_migrations/20230228135034 new file mode 100644 index 00000000000..13f007f7989 --- /dev/null +++ b/db/schema_migrations/20230228135034 @@ -0,0 +1 @@ +3a704331dd2b45c202a42e188ee3ef9a0721b5798d218f5d3300fc18632201b6
\ No newline at end of file diff --git a/db/schema_migrations/20230228142350 b/db/schema_migrations/20230228142350 new file mode 100644 index 00000000000..cd783d44b2a --- /dev/null +++ b/db/schema_migrations/20230228142350 @@ -0,0 +1 @@ +ae4c6d6d477f073981f9f4e431bcb93289cfb54569a3dc982434a2e805c7801b
\ No newline at end of file diff --git a/db/schema_migrations/20230228183644 b/db/schema_migrations/20230228183644 new file mode 100644 index 00000000000..5c6b755de76 --- /dev/null +++ b/db/schema_migrations/20230228183644 @@ -0,0 +1 @@ +19a23286a0efab51ecad88ce224f1a9991796acce47c845530fdf1e65af9b3ad
\ No newline at end of file diff --git a/db/schema_migrations/20230228212427 b/db/schema_migrations/20230228212427 new file mode 100644 index 00000000000..1bad198ce7c --- /dev/null +++ b/db/schema_migrations/20230228212427 @@ -0,0 +1 @@ +78b4d88f861f65ece401f6207a12e4edd16e686ca15180eb9526014bf575084e
\ No newline at end of file diff --git a/db/schema_migrations/20230228212905 b/db/schema_migrations/20230228212905 new file mode 100644 index 00000000000..2465e5ce9a9 --- /dev/null +++ b/db/schema_migrations/20230228212905 @@ -0,0 +1 @@ +63e7999f522a2fc4f220062b5424d711e985a3b78fc2aee3d7afcfe2f3514d73
\ No newline at end of file diff --git a/db/schema_migrations/20230301020246 b/db/schema_migrations/20230301020246 new file mode 100644 index 00000000000..678aa0c10ee --- /dev/null +++ b/db/schema_migrations/20230301020246 @@ -0,0 +1 @@ +750ba0f9e60a72a8f8b2901d55d3fc763fe24ac2e8b6422b833d529230ec3a7f
\ No newline at end of file diff --git a/db/schema_migrations/20230301020356 b/db/schema_migrations/20230301020356 new file mode 100644 index 00000000000..d9feebb01c6 --- /dev/null +++ b/db/schema_migrations/20230301020356 @@ -0,0 +1 @@ +8a2a061050e8c2209e70498c6d1ebc68f557643565bbf93852ab6599ff819aa7
\ No newline at end of file diff --git a/db/schema_migrations/20230301065107 b/db/schema_migrations/20230301065107 new file mode 100644 index 00000000000..495cefad9d2 --- /dev/null +++ b/db/schema_migrations/20230301065107 @@ -0,0 +1 @@ +7e464616bdef6e225fdd31db84c4c32e223dffb81e13f1d6a5c85c2cd0a16144
\ No newline at end of file diff --git a/db/schema_migrations/20230302090155 b/db/schema_migrations/20230302090155 new file mode 100644 index 00000000000..af86ce4635d --- /dev/null +++ b/db/schema_migrations/20230302090155 @@ -0,0 +1 @@ +52b9428336c506a0bf698ea03215dd2b279b9e7d2ca56936df094aaad7934f96
\ No newline at end of file diff --git a/db/schema_migrations/20230302123258 b/db/schema_migrations/20230302123258 new file mode 100644 index 00000000000..b4fe3ae9f34 --- /dev/null +++ b/db/schema_migrations/20230302123258 @@ -0,0 +1 @@ +ecb6f601d4f47e7c4974e097c0e87ff37f96fad93b2ab02439bfa44a7eb481cd
\ No newline at end of file diff --git a/db/schema_migrations/20230302123259 b/db/schema_migrations/20230302123259 new file mode 100644 index 00000000000..6ef93fc8c73 --- /dev/null +++ b/db/schema_migrations/20230302123259 @@ -0,0 +1 @@ +671fe2bcc6b45d7f312144d6c1ceb7c5e085dbc1ab1069c5a340849a08437d72
\ No newline at end of file diff --git a/db/schema_migrations/20230302123301 b/db/schema_migrations/20230302123301 new file mode 100644 index 00000000000..d9af7fe9b69 --- /dev/null +++ b/db/schema_migrations/20230302123301 @@ -0,0 +1 @@ +ca0e0d645cfd5f672d286e8977fc94d4c92579801cb4a781c495465cbc581a33
\ No newline at end of file diff --git a/db/schema_migrations/20230302163339 b/db/schema_migrations/20230302163339 new file mode 100644 index 00000000000..25c611e57a6 --- /dev/null +++ b/db/schema_migrations/20230302163339 @@ -0,0 +1 @@ +5cb36884c6422f9cf2db27c7922a8835b1db6d15e629066ca825c93df7437afa
\ No newline at end of file diff --git a/db/schema_migrations/20230302185739 b/db/schema_migrations/20230302185739 new file mode 100644 index 00000000000..a9f2426e7d9 --- /dev/null +++ b/db/schema_migrations/20230302185739 @@ -0,0 +1 @@ +92b302a4fec802bb418f8a844f70c678af70cc9607331533392ce4b6e830e8d7
\ No newline at end of file diff --git a/db/schema_migrations/20230303105806 b/db/schema_migrations/20230303105806 new file mode 100644 index 00000000000..46bf8fb2b2b --- /dev/null +++ b/db/schema_migrations/20230303105806 @@ -0,0 +1 @@ +5f2176abfc462e65c9ef2b9b28c9feb60cac868aa491d4d4207a8904deb60f18
\ No newline at end of file diff --git a/db/schema_migrations/20230303120531 b/db/schema_migrations/20230303120531 new file mode 100644 index 00000000000..5c042677e67 --- /dev/null +++ b/db/schema_migrations/20230303120531 @@ -0,0 +1 @@ +6af890fe88f25be54d18cf3b3caa14830a3d627e7ff256d7a4ae03f9f1c7170c
\ No newline at end of file diff --git a/db/schema_migrations/20230303144424 b/db/schema_migrations/20230303144424 new file mode 100644 index 00000000000..f0684710508 --- /dev/null +++ b/db/schema_migrations/20230303144424 @@ -0,0 +1 @@ +c8ea35db8903fb627b3ed68b9d9a1e78c34ab40a5aed6fe19e329d13e371f652
\ No newline at end of file diff --git a/db/schema_migrations/20230303154314 b/db/schema_migrations/20230303154314 new file mode 100644 index 00000000000..30a33a6efba --- /dev/null +++ b/db/schema_migrations/20230303154314 @@ -0,0 +1 @@ +c18a674b6df4baf6d81177df2eb4497dc73979ff71142a9ecda71ec515a588b4
\ No newline at end of file diff --git a/db/schema_migrations/20230303232426 b/db/schema_migrations/20230303232426 new file mode 100644 index 00000000000..30472765a0a --- /dev/null +++ b/db/schema_migrations/20230303232426 @@ -0,0 +1 @@ +75efa2b134ee1e5af77d483483b6065c5bc6c840ed0eede237035b028d065234
\ No newline at end of file diff --git a/db/schema_migrations/20230304184416 b/db/schema_migrations/20230304184416 new file mode 100644 index 00000000000..908fcd3bbc7 --- /dev/null +++ b/db/schema_migrations/20230304184416 @@ -0,0 +1 @@ +c6c361ae0fea1ac200e0b4a6683bc9ff853ffb1f890f0555fe921ce72d2453f5
\ No newline at end of file diff --git a/db/schema_migrations/20230306071456 b/db/schema_migrations/20230306071456 new file mode 100644 index 00000000000..b4ac086f125 --- /dev/null +++ b/db/schema_migrations/20230306071456 @@ -0,0 +1 @@ +7f431d6dd4f9dc237623c18465995fa59c9902187f433375baa03194f7a6b88f
\ No newline at end of file diff --git a/db/schema_migrations/20230306072532 b/db/schema_migrations/20230306072532 new file mode 100644 index 00000000000..f1604aa84a7 --- /dev/null +++ b/db/schema_migrations/20230306072532 @@ -0,0 +1 @@ +f6613d1fd3b99fa0e8ea059c6d53e8d226ce3fd8c07e44a024b065d8d110876f
\ No newline at end of file diff --git a/db/schema_migrations/20230306082852 b/db/schema_migrations/20230306082852 new file mode 100644 index 00000000000..bbbe7cb27ef --- /dev/null +++ b/db/schema_migrations/20230306082852 @@ -0,0 +1 @@ +580efa96f235c47de1bcea172544e51e8207dd0a81bd888567b30ce02e453f7d
\ No newline at end of file diff --git a/db/schema_migrations/20230306143322 b/db/schema_migrations/20230306143322 new file mode 100644 index 00000000000..d1b5080398c --- /dev/null +++ b/db/schema_migrations/20230306143322 @@ -0,0 +1 @@ +0f6c5bfbad3779c6d20984fb29e5494cf4c46d7992e1fa3f8a705913aa0f3b92
\ No newline at end of file diff --git a/db/schema_migrations/20230306145230 b/db/schema_migrations/20230306145230 new file mode 100644 index 00000000000..d0fa5e5634b --- /dev/null +++ b/db/schema_migrations/20230306145230 @@ -0,0 +1 @@ +ca28b1355e5cc8c1e77c85a4d5e6a40b66767a8588068eb7e1528ba0e575f5da
\ No newline at end of file diff --git a/db/schema_migrations/20230306195007 b/db/schema_migrations/20230306195007 new file mode 100644 index 00000000000..bb28fbc5586 --- /dev/null +++ b/db/schema_migrations/20230306195007 @@ -0,0 +1 @@ +f799b921663f3de04e0b8f5017305e186c4e418392256adf33f2408ea6d8d2ca
\ No newline at end of file diff --git a/db/schema_migrations/20230307000000 b/db/schema_migrations/20230307000000 new file mode 100644 index 00000000000..273a5553777 --- /dev/null +++ b/db/schema_migrations/20230307000000 @@ -0,0 +1 @@ +192e21a20619e8940d1b5db69eeac1a7c1bfe32d821b671096be4eef4b4214f1
\ No newline at end of file diff --git a/db/schema_migrations/20230307085644 b/db/schema_migrations/20230307085644 new file mode 100644 index 00000000000..7176a19a788 --- /dev/null +++ b/db/schema_migrations/20230307085644 @@ -0,0 +1 @@ +2b918f516a004d3b3f1b310ad9421a29a9675a7670f6a653ba73209f8e7f0f41
\ No newline at end of file diff --git a/db/schema_migrations/20230307091216 b/db/schema_migrations/20230307091216 new file mode 100644 index 00000000000..4727747daa7 --- /dev/null +++ b/db/schema_migrations/20230307091216 @@ -0,0 +1 @@ +0c13f0053959e1c3e66f0c87d55d4a9190b36d61f67bb1b3ec32f73fa699c961
\ No newline at end of file diff --git a/db/schema_migrations/20230307122838 b/db/schema_migrations/20230307122838 new file mode 100644 index 00000000000..adf5d84a474 --- /dev/null +++ b/db/schema_migrations/20230307122838 @@ -0,0 +1 @@ +5b147e92d42b7ec317106d905a3af4d1aee983bce8538c26a619ad32ad06c42e
\ No newline at end of file diff --git a/db/schema_migrations/20230307132729 b/db/schema_migrations/20230307132729 new file mode 100644 index 00000000000..fa72b900120 --- /dev/null +++ b/db/schema_migrations/20230307132729 @@ -0,0 +1 @@ +868959621d514ba49747cbfc2181fed3598e388c471043b5329e3c7562039b15
\ No newline at end of file diff --git a/db/schema_migrations/20230307160251 b/db/schema_migrations/20230307160251 new file mode 100644 index 00000000000..7265c801b46 --- /dev/null +++ b/db/schema_migrations/20230307160251 @@ -0,0 +1 @@ +a7cf83ea7e94cc3d6a581cd89aab8274e86f5c195f1537395d72b275b96bd31c
\ No newline at end of file diff --git a/db/schema_migrations/20230307212637 b/db/schema_migrations/20230307212637 new file mode 100644 index 00000000000..40ccae95b4b --- /dev/null +++ b/db/schema_migrations/20230307212637 @@ -0,0 +1 @@ +7fb5c19271b7216bff37791edc542b8b7cc4826f1812f596d205248eb6a637df
\ No newline at end of file diff --git a/db/schema_migrations/20230307233631 b/db/schema_migrations/20230307233631 new file mode 100644 index 00000000000..c05d21f2113 --- /dev/null +++ b/db/schema_migrations/20230307233631 @@ -0,0 +1 @@ +be9ce74f455171c265135ffc105d5c69a660cdad7f71656615b3d8caf5831b32
\ No newline at end of file diff --git a/db/schema_migrations/20230308154243 b/db/schema_migrations/20230308154243 new file mode 100644 index 00000000000..f1b8c267def --- /dev/null +++ b/db/schema_migrations/20230308154243 @@ -0,0 +1 @@ +28cc38e11e11d6f1c27cfb7ee83ef90b391c0b3035b601df7fef4057fbc75b24
\ No newline at end of file diff --git a/db/schema_migrations/20230308154244 b/db/schema_migrations/20230308154244 new file mode 100644 index 00000000000..53e4fcc6042 --- /dev/null +++ b/db/schema_migrations/20230308154244 @@ -0,0 +1 @@ +2270ab1d9be7bf6b8d0f936e4460fbae51ac988bb01af1e05fce5f2bb4ef7905
\ No newline at end of file diff --git a/db/schema_migrations/20230308154245 b/db/schema_migrations/20230308154245 new file mode 100644 index 00000000000..d0b03b98aef --- /dev/null +++ b/db/schema_migrations/20230308154245 @@ -0,0 +1 @@ +86cace53be2253af85100880ff38ae8685c4c21e96b85eddc4f1111417d5115a
\ No newline at end of file diff --git a/db/schema_migrations/20230308163018 b/db/schema_migrations/20230308163018 new file mode 100644 index 00000000000..19815455ef3 --- /dev/null +++ b/db/schema_migrations/20230308163018 @@ -0,0 +1 @@ +f9132e8d1d39307fc4f9ef17c6e044bab636d17ae7a7e5207f26ab3e38441638
\ No newline at end of file diff --git a/db/schema_migrations/20230309000957 b/db/schema_migrations/20230309000957 new file mode 100644 index 00000000000..679d37f153b --- /dev/null +++ b/db/schema_migrations/20230309000957 @@ -0,0 +1 @@ +902e921099ed27cc1c8fd36eac192879ff6c68e4aa7ef4a0764381c0a01fd76e
\ No newline at end of file diff --git a/db/schema_migrations/20230309010000 b/db/schema_migrations/20230309010000 new file mode 100644 index 00000000000..9415a4b9f11 --- /dev/null +++ b/db/schema_migrations/20230309010000 @@ -0,0 +1 @@ +de7622f865cc6216902d1f9964a645d74777e60072efa399683cd6a9c347d27b
\ No newline at end of file diff --git a/db/schema_migrations/20230309010931 b/db/schema_migrations/20230309010931 new file mode 100644 index 00000000000..c7ac631a427 --- /dev/null +++ b/db/schema_migrations/20230309010931 @@ -0,0 +1 @@ +1976ef23f13343f1ae85b9c9c612dc43e4f4696c9cfad1f36a54e9368ded4f20
\ No newline at end of file diff --git a/db/schema_migrations/20230309020422 b/db/schema_migrations/20230309020422 new file mode 100644 index 00000000000..b43cc93836f --- /dev/null +++ b/db/schema_migrations/20230309020422 @@ -0,0 +1 @@ +51ff7181e6ae2ed88e2d2d91d3f29a53c0342c3461ea55be1bf202a85709f6c6
\ No newline at end of file diff --git a/db/schema_migrations/20230309071242 b/db/schema_migrations/20230309071242 new file mode 100644 index 00000000000..dd29a8006b1 --- /dev/null +++ b/db/schema_migrations/20230309071242 @@ -0,0 +1 @@ +094eb5044e841050288c7362cc58c1b63ce4a349fe49a4c5ebee6b83a05feb56
\ No newline at end of file diff --git a/db/schema_migrations/20230309085547 b/db/schema_migrations/20230309085547 new file mode 100644 index 00000000000..5795b411016 --- /dev/null +++ b/db/schema_migrations/20230309085547 @@ -0,0 +1 @@ +48fadefd7b9ba4383a2e69715e21f5f19d10cc524174a463299b49ae736e6d2f
\ No newline at end of file diff --git a/db/schema_migrations/20230309103016 b/db/schema_migrations/20230309103016 new file mode 100644 index 00000000000..fae5bcc5a72 --- /dev/null +++ b/db/schema_migrations/20230309103016 @@ -0,0 +1 @@ +e02ad3e7cfb386560e2e4d71332f1ced4a1827941b78012d974d9abcfea368d9
\ No newline at end of file diff --git a/db/schema_migrations/20230310111859 b/db/schema_migrations/20230310111859 new file mode 100644 index 00000000000..0bc9268a311 --- /dev/null +++ b/db/schema_migrations/20230310111859 @@ -0,0 +1 @@ +d1accdc2bbe9aa5266df98a893176fba94148f9754d2c0b2de04e9d8d66d8eba
\ No newline at end of file diff --git a/db/schema_migrations/20230310213308 b/db/schema_migrations/20230310213308 new file mode 100644 index 00000000000..807a1141109 --- /dev/null +++ b/db/schema_migrations/20230310213308 @@ -0,0 +1 @@ +e6bd8bddb33ee72a183da7381bc599b98db03fdf3de6bc20860fe3b119d5a6a2
\ No newline at end of file diff --git a/db/schema_migrations/20230313012226 b/db/schema_migrations/20230313012226 new file mode 100644 index 00000000000..e7d7a6a1b7b --- /dev/null +++ b/db/schema_migrations/20230313012226 @@ -0,0 +1 @@ +7c9f554950c0b2b2adc6d31d6cc42335dfd00965c61b2b24489e0099ad227a5c
\ No newline at end of file diff --git a/db/schema_migrations/20230313012609 b/db/schema_migrations/20230313012609 new file mode 100644 index 00000000000..f7b0e375a3c --- /dev/null +++ b/db/schema_migrations/20230313012609 @@ -0,0 +1 @@ +c3098250c8ade855d84fec852dac81bab891e6e844404814ddff99711136d9eb
\ No newline at end of file diff --git a/db/schema_migrations/20230313014038 b/db/schema_migrations/20230313014038 new file mode 100644 index 00000000000..81f6366c52b --- /dev/null +++ b/db/schema_migrations/20230313014038 @@ -0,0 +1 @@ +6dde6a29aefd3811f9c5bd144b24f33046e1762e13f18ad069d6d53a2448df49
\ No newline at end of file diff --git a/db/schema_migrations/20230313031351 b/db/schema_migrations/20230313031351 new file mode 100644 index 00000000000..37a57006cae --- /dev/null +++ b/db/schema_migrations/20230313031351 @@ -0,0 +1 @@ +44dc97ac36a6edcd0c0dba76f6b60204b72c005da7bd793af4ac7832d949bd0b
\ No newline at end of file diff --git a/db/schema_migrations/20230313031629 b/db/schema_migrations/20230313031629 new file mode 100644 index 00000000000..c7a27b58cff --- /dev/null +++ b/db/schema_migrations/20230313031629 @@ -0,0 +1 @@ +86ffe1f3b8048cf01b96f66683fa68f889051c8633c6b803ffdb03aa0a8d2864
\ No newline at end of file diff --git a/db/schema_migrations/20230313054226 b/db/schema_migrations/20230313054226 new file mode 100644 index 00000000000..7b174fe3570 --- /dev/null +++ b/db/schema_migrations/20230313054226 @@ -0,0 +1 @@ +15c56632eafda4ab511368001a7bbfdf9f346049ab19a9df3ad2c96adc12f1a0
\ No newline at end of file diff --git a/db/schema_migrations/20230313092109 b/db/schema_migrations/20230313092109 new file mode 100644 index 00000000000..ae1f7510260 --- /dev/null +++ b/db/schema_migrations/20230313092109 @@ -0,0 +1 @@ +16d406344be453ddbea50fea870c3426289bc3cf0476da6415e789a523af01e1
\ No newline at end of file diff --git a/db/schema_migrations/20230313100920 b/db/schema_migrations/20230313100920 new file mode 100644 index 00000000000..bb04d2a9f72 --- /dev/null +++ b/db/schema_migrations/20230313100920 @@ -0,0 +1 @@ +e2940977e8dfc2873751ae2c4b971b2d12cf79eb644c563b901f20d2e0c51649
\ No newline at end of file diff --git a/db/schema_migrations/20230313133001 b/db/schema_migrations/20230313133001 new file mode 100644 index 00000000000..724003e3448 --- /dev/null +++ b/db/schema_migrations/20230313133001 @@ -0,0 +1 @@ +96220e0bd8ebc4ed6ad5478d1bc8e08760e8d301667fad3cdbd9dce689a32d87
\ No newline at end of file diff --git a/db/schema_migrations/20230313142631 b/db/schema_migrations/20230313142631 new file mode 100644 index 00000000000..cb035d87009 --- /dev/null +++ b/db/schema_migrations/20230313142631 @@ -0,0 +1 @@ +94cdd10692a9e7668e5d2cc71c02a5038d9e0de1c5fcb794681c9b9f5abedf2d
\ No newline at end of file diff --git a/db/schema_migrations/20230313143033 b/db/schema_migrations/20230313143033 new file mode 100644 index 00000000000..81e9dd384b9 --- /dev/null +++ b/db/schema_migrations/20230313143033 @@ -0,0 +1 @@ +6a2ae2db3b61652bdf29a1e851d4120fb31eb21edaa2ffa6ef44415dfea928c5
\ No newline at end of file diff --git a/db/schema_migrations/20230313150531 b/db/schema_migrations/20230313150531 new file mode 100644 index 00000000000..94625561f6b --- /dev/null +++ b/db/schema_migrations/20230313150531 @@ -0,0 +1 @@ +e2f19bbc322127e439fffc4c1e2718288538aa6cb2d50a5248f12470b1c9491e
\ No newline at end of file diff --git a/db/schema_migrations/20230313181536 b/db/schema_migrations/20230313181536 new file mode 100644 index 00000000000..4131e34c725 --- /dev/null +++ b/db/schema_migrations/20230313181536 @@ -0,0 +1 @@ +d8a040d40d19bb75c8e5fc8bb867ea6354ceda22c9dfe5724a4231a4b005e373
\ No newline at end of file diff --git a/db/schema_migrations/20230313184306 b/db/schema_migrations/20230313184306 new file mode 100644 index 00000000000..733217f705c --- /dev/null +++ b/db/schema_migrations/20230313184306 @@ -0,0 +1 @@ +457c9325bb8af653b179cb04a3332746b1caf0854b555f71fe8ceb4e323e8b20
\ No newline at end of file diff --git a/db/schema_migrations/20230313185145 b/db/schema_migrations/20230313185145 new file mode 100644 index 00000000000..6eb3908d1da --- /dev/null +++ b/db/schema_migrations/20230313185145 @@ -0,0 +1 @@ +a5a630c2dbd94af837bff0056ee472360646306ca1c00e66fc3f68669006cf50
\ No newline at end of file diff --git a/db/schema_migrations/20230314094210 b/db/schema_migrations/20230314094210 new file mode 100644 index 00000000000..ee40a11c6f0 --- /dev/null +++ b/db/schema_migrations/20230314094210 @@ -0,0 +1 @@ +533c4aec923bdc54c3f3a0656ae47d77e2224be2329a547c5a569e3ff5cedd54
\ No newline at end of file diff --git a/db/schema_migrations/20230314144640 b/db/schema_migrations/20230314144640 new file mode 100644 index 00000000000..66dececa044 --- /dev/null +++ b/db/schema_migrations/20230314144640 @@ -0,0 +1 @@ +143b8fca03dd42fcf7ee9af733901e16df2bbc3ce29e76e8e442536a17186fdf
\ No newline at end of file diff --git a/db/schema_migrations/20230314210657 b/db/schema_migrations/20230314210657 new file mode 100644 index 00000000000..04be3b6f1eb --- /dev/null +++ b/db/schema_migrations/20230314210657 @@ -0,0 +1 @@ +6cbf7f5127f7b174156098b870a22b8426bca34589565cb6d79db3018c74f732
\ No newline at end of file diff --git a/db/schema_migrations/20230315053635 b/db/schema_migrations/20230315053635 new file mode 100644 index 00000000000..751f52c2ccd --- /dev/null +++ b/db/schema_migrations/20230315053635 @@ -0,0 +1 @@ +aedea3dd398210eb2d98a3ecefe3b02b518bce53d63d75160796eb0414574087
\ No newline at end of file diff --git a/db/schema_migrations/20230315084704 b/db/schema_migrations/20230315084704 new file mode 100644 index 00000000000..a41414de7b1 --- /dev/null +++ b/db/schema_migrations/20230315084704 @@ -0,0 +1 @@ +b0091fc76ead45dab7a0cd4d2b0a65858703cb18a98cca7715b88bceac8c2ed0
\ No newline at end of file diff --git a/db/schema_migrations/20230315161408 b/db/schema_migrations/20230315161408 new file mode 100644 index 00000000000..8f8e116de10 --- /dev/null +++ b/db/schema_migrations/20230315161408 @@ -0,0 +1 @@ +edd3d506ad848f854fa9614df3b88619704c1cd834f5c2b7bb7bde20d76888bc
\ No newline at end of file diff --git a/db/schema_migrations/20230316014650 b/db/schema_migrations/20230316014650 new file mode 100644 index 00000000000..590de1b6748 --- /dev/null +++ b/db/schema_migrations/20230316014650 @@ -0,0 +1 @@ +f2263525d0e7569eb2ca639b83a7fa5704aba32268570191aee0fd421010d122
\ No newline at end of file diff --git a/db/schema_migrations/20230316014651 b/db/schema_migrations/20230316014651 new file mode 100644 index 00000000000..70d7cbcef00 --- /dev/null +++ b/db/schema_migrations/20230316014651 @@ -0,0 +1 @@ +f139b8097744ab3fabdf343bfb5e6a7a8426227b54238c4926b0446dd621ef64
\ No newline at end of file diff --git a/db/schema_migrations/20230316073726 b/db/schema_migrations/20230316073726 new file mode 100644 index 00000000000..13f7b1a5477 --- /dev/null +++ b/db/schema_migrations/20230316073726 @@ -0,0 +1 @@ +d045bd70fc1fc8a317aba9162bcc5a55f3be3cbd6f31438b4fb3951cd171e454
\ No newline at end of file diff --git a/db/schema_migrations/20230316093433 b/db/schema_migrations/20230316093433 new file mode 100644 index 00000000000..eaf1434bb2b --- /dev/null +++ b/db/schema_migrations/20230316093433 @@ -0,0 +1 @@ +5e3c28caac0cc43d28c7f279ad001234ec6f81e2522c087fc303a6e3355b5a33
\ No newline at end of file diff --git a/db/schema_migrations/20230316095948 b/db/schema_migrations/20230316095948 new file mode 100644 index 00000000000..c2c829f1d20 --- /dev/null +++ b/db/schema_migrations/20230316095948 @@ -0,0 +1 @@ +4db14f0a961e98597fd2f4fc75e05309bfbda3b8cf83c1296c937be24207595e
\ No newline at end of file diff --git a/db/schema_migrations/20230316114426 b/db/schema_migrations/20230316114426 new file mode 100644 index 00000000000..1fde829db4a --- /dev/null +++ b/db/schema_migrations/20230316114426 @@ -0,0 +1 @@ +65380616067b8dc968e5d200092ebbb58e6c8bc8967ac9ed84282c450aefe016
\ No newline at end of file diff --git a/db/schema_migrations/20230316164917 b/db/schema_migrations/20230316164917 new file mode 100644 index 00000000000..935639439d8 --- /dev/null +++ b/db/schema_migrations/20230316164917 @@ -0,0 +1 @@ +d9a660e9415a0ab3f128609d72b2da19982d1ef6a8441dd2f627427890d0d3be
\ No newline at end of file diff --git a/db/schema_migrations/20230316185746 b/db/schema_migrations/20230316185746 new file mode 100644 index 00000000000..1b23d93736b --- /dev/null +++ b/db/schema_migrations/20230316185746 @@ -0,0 +1 @@ +6aa9022f0e945d66fd62a49e1d392a8fb5e55bd96804b1eb50bfff135a7954b6
\ No newline at end of file diff --git a/db/schema_migrations/20230317004428 b/db/schema_migrations/20230317004428 new file mode 100644 index 00000000000..a6bbc2d0d2b --- /dev/null +++ b/db/schema_migrations/20230317004428 @@ -0,0 +1 @@ +d3189deaf413a7e96b3e65cab06037dd7fa577bd977549ac5aca168b12d9d1ff
\ No newline at end of file diff --git a/db/schema_migrations/20230317075852 b/db/schema_migrations/20230317075852 new file mode 100644 index 00000000000..7506d9c5414 --- /dev/null +++ b/db/schema_migrations/20230317075852 @@ -0,0 +1 @@ +5b9e269f3354b1f054a3e3d8f9a011ea2c1a19c72a4cecdfb8a3e6e80ab83ab3
\ No newline at end of file diff --git a/db/schema_migrations/20230317080000 b/db/schema_migrations/20230317080000 new file mode 100644 index 00000000000..33b3252a977 --- /dev/null +++ b/db/schema_migrations/20230317080000 @@ -0,0 +1 @@ +a33f941480ce270532dca961cf72ce31c5c2d732b1c1ab361c95bac6e278a443
\ No newline at end of file diff --git a/db/schema_migrations/20230317080137 b/db/schema_migrations/20230317080137 new file mode 100644 index 00000000000..90914f8a533 --- /dev/null +++ b/db/schema_migrations/20230317080137 @@ -0,0 +1 @@ +238730785306bb43677be1e86ae3cca210d651eb5397a7fbf90a12a7ec252614
\ No newline at end of file diff --git a/db/schema_migrations/20230317151841 b/db/schema_migrations/20230317151841 new file mode 100644 index 00000000000..69085045c8a --- /dev/null +++ b/db/schema_migrations/20230317151841 @@ -0,0 +1 @@ +95bcf074127993a57bc6aaf04b64717a2c49d7886838ab0e7194807475fcdee1
\ No newline at end of file diff --git a/db/schema_migrations/20230317162059 b/db/schema_migrations/20230317162059 new file mode 100644 index 00000000000..9adcabb9aeb --- /dev/null +++ b/db/schema_migrations/20230317162059 @@ -0,0 +1 @@ +86f8982c21b25cfc1914304b0083075226e0f8182b66a766a4f354b1b5fc8f7d
\ No newline at end of file diff --git a/db/schema_migrations/20230317195228 b/db/schema_migrations/20230317195228 new file mode 100644 index 00000000000..ba9f36ae31d --- /dev/null +++ b/db/schema_migrations/20230317195228 @@ -0,0 +1 @@ +cc3bc6913ae957318f1a41b00cf6b8c3b6b445b6a16c460e8744e94618416bf6
\ No newline at end of file diff --git a/db/schema_migrations/20230319105436 b/db/schema_migrations/20230319105436 new file mode 100644 index 00000000000..47338a038b1 --- /dev/null +++ b/db/schema_migrations/20230319105436 @@ -0,0 +1 @@ +198cf0597e4a513c6c47b9cd576765d40f564838d5c54e33216fd7a5d25220ae
\ No newline at end of file diff --git a/db/schema_migrations/20230320110802 b/db/schema_migrations/20230320110802 new file mode 100644 index 00000000000..f9185745e24 --- /dev/null +++ b/db/schema_migrations/20230320110802 @@ -0,0 +1 @@ +b45db7a4404bbab731138f5db6031241945969a210f1c3b6fce323938ec8980d
\ No newline at end of file diff --git a/db/schema_migrations/20230320155635 b/db/schema_migrations/20230320155635 new file mode 100644 index 00000000000..91ade579ffb --- /dev/null +++ b/db/schema_migrations/20230320155635 @@ -0,0 +1 @@ +58d91bbad9896429a0b8d383a1d5ef47a7b017c65af7834c01091fbccb7f5221
\ No newline at end of file diff --git a/db/schema_migrations/20230321003252 b/db/schema_migrations/20230321003252 new file mode 100644 index 00000000000..85515872922 --- /dev/null +++ b/db/schema_migrations/20230321003252 @@ -0,0 +1 @@ +82c5c661c3fad14a0466e5669b59dca92084b8c77500d8ae3b97b34029277c94
\ No newline at end of file diff --git a/db/schema_migrations/20230321011529 b/db/schema_migrations/20230321011529 new file mode 100644 index 00000000000..2491b3b23db --- /dev/null +++ b/db/schema_migrations/20230321011529 @@ -0,0 +1 @@ +726d3232acecf6408a7f25876ac9104d5a003fbaeeb8ab666d473b8cf379cc75
\ No newline at end of file diff --git a/db/schema_migrations/20230321011903 b/db/schema_migrations/20230321011903 new file mode 100644 index 00000000000..a02b643406c --- /dev/null +++ b/db/schema_migrations/20230321011903 @@ -0,0 +1 @@ +ddb687f5e1b2593dc1c68c2c22ff12a276861c67faf4f775431e17b17380688d
\ No newline at end of file diff --git a/db/schema_migrations/20230321024333 b/db/schema_migrations/20230321024333 new file mode 100644 index 00000000000..52cd037f28e --- /dev/null +++ b/db/schema_migrations/20230321024333 @@ -0,0 +1 @@ +16d266b15451c20c4512b3ee2673af997301b7a92b4eacb4db74e025231c9f43
\ No newline at end of file diff --git a/db/schema_migrations/20230321024903 b/db/schema_migrations/20230321024903 new file mode 100644 index 00000000000..fd2651c7afa --- /dev/null +++ b/db/schema_migrations/20230321024903 @@ -0,0 +1 @@ +b07b58c96f5f61e63619edc645384c15341feb217a521cdf8d90f37bc261addb
\ No newline at end of file diff --git a/db/schema_migrations/20230321085011 b/db/schema_migrations/20230321085011 new file mode 100644 index 00000000000..c35be85e583 --- /dev/null +++ b/db/schema_migrations/20230321085011 @@ -0,0 +1 @@ +fc277fb3f02c01f57355cf6381a9883e6f67c339303242ea34c5a1b567b227d0
\ No newline at end of file diff --git a/db/schema_migrations/20230321095759 b/db/schema_migrations/20230321095759 new file mode 100644 index 00000000000..0f51a5001b8 --- /dev/null +++ b/db/schema_migrations/20230321095759 @@ -0,0 +1 @@ +f2b7e2856672f294a7686a61d3b953b8341b21b31a60a2f62419e878c3244d64
\ No newline at end of file diff --git a/db/schema_migrations/20230321113956 b/db/schema_migrations/20230321113956 new file mode 100644 index 00000000000..a3e81a95610 --- /dev/null +++ b/db/schema_migrations/20230321113956 @@ -0,0 +1 @@ +5f7d370de2adf12d836c6408dc3166b8a2691fc84e353fab8933a276568af62e
\ No newline at end of file diff --git a/db/schema_migrations/20230321124837 b/db/schema_migrations/20230321124837 new file mode 100644 index 00000000000..934f467c5e0 --- /dev/null +++ b/db/schema_migrations/20230321124837 @@ -0,0 +1 @@ +17c78ffb8298207d36866e51974fb09432d9ccbbf5f3b401c4335392849f75c3
\ No newline at end of file diff --git a/db/schema_migrations/20230321153035 b/db/schema_migrations/20230321153035 new file mode 100644 index 00000000000..5c4894a9113 --- /dev/null +++ b/db/schema_migrations/20230321153035 @@ -0,0 +1 @@ +5aa29a59aad33fe1ee81c44402c7fb2bb149fcb46c0d0afd5494b4788ea8840c
\ No newline at end of file diff --git a/db/schema_migrations/20230321153304 b/db/schema_migrations/20230321153304 new file mode 100644 index 00000000000..64cb0f2e2dc --- /dev/null +++ b/db/schema_migrations/20230321153304 @@ -0,0 +1 @@ +367ed961312905ce5a2f543d997c5210904648354698292ec735cee874995f9b
\ No newline at end of file diff --git a/db/schema_migrations/20230321153337 b/db/schema_migrations/20230321153337 new file mode 100644 index 00000000000..0e388c06534 --- /dev/null +++ b/db/schema_migrations/20230321153337 @@ -0,0 +1 @@ +642ee9d1d663316b50205d3925d91e05c2cb674ea929cc8316442257b61f2fb4
\ No newline at end of file diff --git a/db/schema_migrations/20230321161218 b/db/schema_migrations/20230321161218 new file mode 100644 index 00000000000..57365b47898 --- /dev/null +++ b/db/schema_migrations/20230321161218 @@ -0,0 +1 @@ +efbe3f66fecfb275f8b4276cedc2210a141f4c63cc10242daafb445b352a4b70
\ No newline at end of file diff --git a/db/schema_migrations/20230321161441 b/db/schema_migrations/20230321161441 new file mode 100644 index 00000000000..fe0b5fbeee4 --- /dev/null +++ b/db/schema_migrations/20230321161441 @@ -0,0 +1 @@ +7e3a9281e624341301d937d2422f0ff2d71367bfb42bf45ddcde7216e84ecb93
\ No newline at end of file diff --git a/db/schema_migrations/20230321162810 b/db/schema_migrations/20230321162810 new file mode 100644 index 00000000000..ef81f6f1549 --- /dev/null +++ b/db/schema_migrations/20230321162810 @@ -0,0 +1 @@ +f393893085e2a7faf43668589ce707dc27c61f8ea0dc8a3632503a39de673134
\ No newline at end of file diff --git a/db/schema_migrations/20230321162902 b/db/schema_migrations/20230321162902 new file mode 100644 index 00000000000..54e447494d3 --- /dev/null +++ b/db/schema_migrations/20230321162902 @@ -0,0 +1 @@ +2d00140af48ff5137f2c8df0b03fdebbc08abd0d448b967fdc1fb8781ab0841f
\ No newline at end of file diff --git a/db/schema_migrations/20230321163051 b/db/schema_migrations/20230321163051 new file mode 100644 index 00000000000..a4d26398090 --- /dev/null +++ b/db/schema_migrations/20230321163051 @@ -0,0 +1 @@ +e172b6f87e3f06e3c2a7f64b0d7d9eae797802a4dd77b86a989ab4eb6ec5e626
\ No newline at end of file diff --git a/db/schema_migrations/20230321163547 b/db/schema_migrations/20230321163547 new file mode 100644 index 00000000000..81260ee6b14 --- /dev/null +++ b/db/schema_migrations/20230321163547 @@ -0,0 +1 @@ +c2e2ac63f992c409f575de544f86e046ebdcfd19ff55bf75616205266034caed
\ No newline at end of file diff --git a/db/schema_migrations/20230321163947 b/db/schema_migrations/20230321163947 new file mode 100644 index 00000000000..7fe48192693 --- /dev/null +++ b/db/schema_migrations/20230321163947 @@ -0,0 +1 @@ +f70305536912db6a726b2e371970a322f9b8f2a3efb5570860e57b4196c85d3d
\ No newline at end of file diff --git a/db/schema_migrations/20230321170734 b/db/schema_migrations/20230321170734 new file mode 100644 index 00000000000..b6653465894 --- /dev/null +++ b/db/schema_migrations/20230321170734 @@ -0,0 +1 @@ +e60dc9b8f28fdbbc84ed808edc98fb8d640ec5a53b21363a59f375a0a3fe5bfd
\ No newline at end of file diff --git a/db/schema_migrations/20230321170803 b/db/schema_migrations/20230321170803 new file mode 100644 index 00000000000..85d557d7681 --- /dev/null +++ b/db/schema_migrations/20230321170803 @@ -0,0 +1 @@ +c08a4f0873dfbc3ce2d6c1cc9224b2427ec41de482da85768f7cf08409ec8a54
\ No newline at end of file diff --git a/db/schema_migrations/20230321170823 b/db/schema_migrations/20230321170823 new file mode 100644 index 00000000000..86dfe823473 --- /dev/null +++ b/db/schema_migrations/20230321170823 @@ -0,0 +1 @@ +5517993d733b91c924c06ac616902108d7d709045296e3c2e44de5e8ed78e10f
\ No newline at end of file diff --git a/db/schema_migrations/20230322011220 b/db/schema_migrations/20230322011220 new file mode 100644 index 00000000000..8e8b8325f30 --- /dev/null +++ b/db/schema_migrations/20230322011220 @@ -0,0 +1 @@ +5e70b9a4dd74523e8cc44b22d2ebb5dcc326fcfb52bacdd63090b5abe8b36732
\ No newline at end of file diff --git a/db/schema_migrations/20230322012209 b/db/schema_migrations/20230322012209 new file mode 100644 index 00000000000..e3686af447d --- /dev/null +++ b/db/schema_migrations/20230322012209 @@ -0,0 +1 @@ +b00bad4559b3f7a959771b08f03b2d6cd4eadb2862dc8840065885cd87d09a77
\ No newline at end of file diff --git a/db/schema_migrations/20230322023442 b/db/schema_migrations/20230322023442 new file mode 100644 index 00000000000..59de5395302 --- /dev/null +++ b/db/schema_migrations/20230322023442 @@ -0,0 +1 @@ +41d619c9e22fb91b3cf4f04482b48a66d027dda0c705423c4a9a84de991ea42d
\ No newline at end of file diff --git a/db/schema_migrations/20230322085041 b/db/schema_migrations/20230322085041 new file mode 100644 index 00000000000..6ffba798585 --- /dev/null +++ b/db/schema_migrations/20230322085041 @@ -0,0 +1 @@ +17a8493fb1da422753efbd3bfb0d02574470eb6bf06f8302a9b360d02aa5e55d
\ No newline at end of file diff --git a/db/schema_migrations/20230322085852 b/db/schema_migrations/20230322085852 new file mode 100644 index 00000000000..bb4f7d6c082 --- /dev/null +++ b/db/schema_migrations/20230322085852 @@ -0,0 +1 @@ +3d729e32b57bee6013f05361f37ea9e33453bea2b21085d4d56b3c2fe4d5f071
\ No newline at end of file diff --git a/db/schema_migrations/20230322145403 b/db/schema_migrations/20230322145403 new file mode 100644 index 00000000000..d2db5495d7b --- /dev/null +++ b/db/schema_migrations/20230322145403 @@ -0,0 +1 @@ +7ec944ccdd85380bba7d17fbd9dbf37bea918d0ac7fbe03142f4a4c6561a77a9
\ No newline at end of file diff --git a/db/schema_migrations/20230322151605 b/db/schema_migrations/20230322151605 new file mode 100644 index 00000000000..cb47c2629a8 --- /dev/null +++ b/db/schema_migrations/20230322151605 @@ -0,0 +1 @@ +5300b4b70078fe3dadbdf42e7884dee84794c0de5b32c26b6ec46622b2a433c4
\ No newline at end of file diff --git a/db/schema_migrations/20230322151635 b/db/schema_migrations/20230322151635 new file mode 100644 index 00000000000..1f9bb48020a --- /dev/null +++ b/db/schema_migrations/20230322151635 @@ -0,0 +1 @@ +d0b729d78f4ca8269fef71e11ddd600e3cbd53ceb302200ae13e0362a0278101
\ No newline at end of file diff --git a/db/schema_migrations/20230322162512 b/db/schema_migrations/20230322162512 new file mode 100644 index 00000000000..a6e64bb2a6e --- /dev/null +++ b/db/schema_migrations/20230322162512 @@ -0,0 +1 @@ +3443d7c52cc4db5fc8f10e22406a39b8724f968bb936b0792895e13a3b3db710
\ No newline at end of file diff --git a/db/schema_migrations/20230322164031 b/db/schema_migrations/20230322164031 new file mode 100644 index 00000000000..57478bae5b3 --- /dev/null +++ b/db/schema_migrations/20230322164031 @@ -0,0 +1 @@ +4610b001f48cc89d79a769231d73f7fe579ffe8753a276e32ddd4cc15ad5bf25
\ No newline at end of file diff --git a/db/schema_migrations/20230322203927 b/db/schema_migrations/20230322203927 new file mode 100644 index 00000000000..5484ff427e4 --- /dev/null +++ b/db/schema_migrations/20230322203927 @@ -0,0 +1 @@ +b91efba4aad15d32dc227620239a330246748c73d6afed946c3fd1baaa125932
\ No newline at end of file diff --git a/db/schema_migrations/20230323005730 b/db/schema_migrations/20230323005730 new file mode 100644 index 00000000000..52e64f71e51 --- /dev/null +++ b/db/schema_migrations/20230323005730 @@ -0,0 +1 @@ +38395557e91452474bbebcbaa7e728ce83277757d38e72cec41392e3437d40ba
\ No newline at end of file diff --git a/db/schema_migrations/20230323010111 b/db/schema_migrations/20230323010111 new file mode 100644 index 00000000000..896d7f5488b --- /dev/null +++ b/db/schema_migrations/20230323010111 @@ -0,0 +1 @@ +89f6e9276f2b5518315e70c9d91371ca6ae291e7dace64934f49c9793ce8d51f
\ No newline at end of file diff --git a/db/schema_migrations/20230323013251 b/db/schema_migrations/20230323013251 new file mode 100644 index 00000000000..67c69c00346 --- /dev/null +++ b/db/schema_migrations/20230323013251 @@ -0,0 +1 @@ +504a374319d8da45286d609e7ef1a06b154436e0ed7c44ccbce4ad98ef9f6c00
\ No newline at end of file diff --git a/db/schema_migrations/20230323021618 b/db/schema_migrations/20230323021618 new file mode 100644 index 00000000000..49e2c251987 --- /dev/null +++ b/db/schema_migrations/20230323021618 @@ -0,0 +1 @@ +4eed46d4a2ae17425076dbb60b5669317d8edb7252246dddf914411f0a267897
\ No newline at end of file diff --git a/db/schema_migrations/20230323101138 b/db/schema_migrations/20230323101138 new file mode 100644 index 00000000000..2c464eda729 --- /dev/null +++ b/db/schema_migrations/20230323101138 @@ -0,0 +1 @@ +3d03a0af6421f0b2a0f26b7a7d385dcabb12565cb0b3f6d23454d8588395a59a
\ No newline at end of file diff --git a/db/schema_migrations/20230323120601 b/db/schema_migrations/20230323120601 new file mode 100644 index 00000000000..1b4d275a1d0 --- /dev/null +++ b/db/schema_migrations/20230323120601 @@ -0,0 +1 @@ +6ff846d6485dfccfef23e48fcbdf1f2ad8672371e6865bb436e39c7578ec357b
\ No newline at end of file diff --git a/db/schema_migrations/20230323131521 b/db/schema_migrations/20230323131521 new file mode 100644 index 00000000000..3b449099282 --- /dev/null +++ b/db/schema_migrations/20230323131521 @@ -0,0 +1 @@ +93b27125fa1bb07cb32509fed9e7a4e6842655e683fe35cddce8f1b6e6728130
\ No newline at end of file diff --git a/db/schema_migrations/20230323140745 b/db/schema_migrations/20230323140745 new file mode 100644 index 00000000000..ba80e2d22c4 --- /dev/null +++ b/db/schema_migrations/20230323140745 @@ -0,0 +1 @@ +14e93b01f5d959b995aca2b27de0bf2926eacbc5fe3ca010a038101100a99551
\ No newline at end of file diff --git a/db/schema_migrations/20230323140746 b/db/schema_migrations/20230323140746 new file mode 100644 index 00000000000..dead7210281 --- /dev/null +++ b/db/schema_migrations/20230323140746 @@ -0,0 +1 @@ +e8348ca24375ba452cf96abf6a48a9aa06197d4298043e9514e4becd30dfb2a1
\ No newline at end of file diff --git a/db/schema_migrations/20230323153042 b/db/schema_migrations/20230323153042 new file mode 100644 index 00000000000..4ac316d2f16 --- /dev/null +++ b/db/schema_migrations/20230323153042 @@ -0,0 +1 @@ +df9cd2f72ada861f94a7957513982c50276fbe8bf29f82f29bbc306cf9075d9b
\ No newline at end of file diff --git a/db/schema_migrations/20230323153328 b/db/schema_migrations/20230323153328 new file mode 100644 index 00000000000..48b96e73f74 --- /dev/null +++ b/db/schema_migrations/20230323153328 @@ -0,0 +1 @@ +5c572b7d9ee5f457c5bdd49fea89143eefd40680c571942b68e370857cf3af0e
\ No newline at end of file diff --git a/db/schema_migrations/20230323153433 b/db/schema_migrations/20230323153433 new file mode 100644 index 00000000000..f125d87f08c --- /dev/null +++ b/db/schema_migrations/20230323153433 @@ -0,0 +1 @@ +9a513d1ac05a263b7057fbdcc3640d9269263dcb620ee7eea79888a0afec136c
\ No newline at end of file diff --git a/db/schema_migrations/20230323191750 b/db/schema_migrations/20230323191750 new file mode 100644 index 00000000000..7aace5fdc8e --- /dev/null +++ b/db/schema_migrations/20230323191750 @@ -0,0 +1 @@ +b8285d96d0e769f6ec6cf0b7a7e9a88dff978029b252b915ca9caff5a364912d
\ No newline at end of file diff --git a/db/schema_migrations/20230327074932 b/db/schema_migrations/20230327074932 new file mode 100644 index 00000000000..7093e3aa4bf --- /dev/null +++ b/db/schema_migrations/20230327074932 @@ -0,0 +1 @@ +48f6ba4288122f400a0a2ef53a679cf6b4e9dc3052ec64e959066f6e30b3cd3a
\ No newline at end of file diff --git a/db/schema_migrations/20230327103401 b/db/schema_migrations/20230327103401 new file mode 100644 index 00000000000..4dc9095594a --- /dev/null +++ b/db/schema_migrations/20230327103401 @@ -0,0 +1 @@ +c5c1627079f081d241031e0ffb205b3088e83e97514e692d3093ab012d727365
\ No newline at end of file diff --git a/db/schema_migrations/20230327123333 b/db/schema_migrations/20230327123333 new file mode 100644 index 00000000000..2789700b74d --- /dev/null +++ b/db/schema_migrations/20230327123333 @@ -0,0 +1 @@ +3009fe920b44aed313dd4371ab06861a74333e515349f07e361a655339fc17d2
\ No newline at end of file diff --git a/db/schema_migrations/20230327125705 b/db/schema_migrations/20230327125705 new file mode 100644 index 00000000000..5b193987b11 --- /dev/null +++ b/db/schema_migrations/20230327125705 @@ -0,0 +1 @@ +dd965c40fa107f487bda00d71dfdf40aabd013dd2cb05a4d9621cb1aa87d8060
\ No newline at end of file diff --git a/db/schema_migrations/20230327144152 b/db/schema_migrations/20230327144152 new file mode 100644 index 00000000000..ab770780c35 --- /dev/null +++ b/db/schema_migrations/20230327144152 @@ -0,0 +1 @@ +4ac5ad2dca9500804976e6555d68958ae11c4ee7a7e694f44f2745cee7de041f
\ No newline at end of file diff --git a/db/schema_migrations/20230328020316 b/db/schema_migrations/20230328020316 new file mode 100644 index 00000000000..01eda556b86 --- /dev/null +++ b/db/schema_migrations/20230328020316 @@ -0,0 +1 @@ +8b5c31f035ede013e589d310fb477a9776b3e3f9554170638bb3b7a299721545
\ No newline at end of file diff --git a/db/schema_migrations/20230328023535 b/db/schema_migrations/20230328023535 new file mode 100644 index 00000000000..87c5946deef --- /dev/null +++ b/db/schema_migrations/20230328023535 @@ -0,0 +1 @@ +fde72911a0871ab14bdb167840a470bd62fd81120fec580d26a13b0c8b6f0b33
\ No newline at end of file diff --git a/db/schema_migrations/20230328023554 b/db/schema_migrations/20230328023554 new file mode 100644 index 00000000000..11706b84656 --- /dev/null +++ b/db/schema_migrations/20230328023554 @@ -0,0 +1 @@ +c75b19d2a3434ddecbfc6079d61e70e31d180842d8ad3615ee9ccacc24cd0039
\ No newline at end of file diff --git a/db/schema_migrations/20230328030101 b/db/schema_migrations/20230328030101 new file mode 100644 index 00000000000..0b50a16a514 --- /dev/null +++ b/db/schema_migrations/20230328030101 @@ -0,0 +1 @@ +eb05e37733efa95de5067d328a8e3dbe2fe696c95658bad5362893c04c8b89b6
\ No newline at end of file diff --git a/db/schema_migrations/20230328031720 b/db/schema_migrations/20230328031720 new file mode 100644 index 00000000000..59bc07f91d7 --- /dev/null +++ b/db/schema_migrations/20230328031720 @@ -0,0 +1 @@ +279d189e3bae27bee234672b3529c65ab3b1ef0e8eb55c5a79ffc7e38b749a7e
\ No newline at end of file diff --git a/db/schema_migrations/20230328031838 b/db/schema_migrations/20230328031838 new file mode 100644 index 00000000000..1bf0d7de92a --- /dev/null +++ b/db/schema_migrations/20230328031838 @@ -0,0 +1 @@ +0f12d260dace3738f4fb7b7f31fc430ba19ca36649810fad0b086cfec3b77054
\ No newline at end of file diff --git a/db/schema_migrations/20230328100534 b/db/schema_migrations/20230328100534 new file mode 100644 index 00000000000..7bdf4ba65ab --- /dev/null +++ b/db/schema_migrations/20230328100534 @@ -0,0 +1 @@ +f74849f237902c24b996b27c552a95b8a3c080f98c03fcefdf8a7c76638396dc
\ No newline at end of file diff --git a/db/schema_migrations/20230328111013 b/db/schema_migrations/20230328111013 new file mode 100644 index 00000000000..18b085e1df1 --- /dev/null +++ b/db/schema_migrations/20230328111013 @@ -0,0 +1 @@ +6acd119e30d05fc794998cd4a80416cb91e11021659eb62ac93590175039a6cf
\ No newline at end of file diff --git a/db/schema_migrations/20230328151756 b/db/schema_migrations/20230328151756 new file mode 100644 index 00000000000..306a6a4b4ea --- /dev/null +++ b/db/schema_migrations/20230328151756 @@ -0,0 +1 @@ +3678d61d47421ba81190688ade76916cf7d40c3611ad84f41a3b979092269e73
\ No newline at end of file diff --git a/db/schema_migrations/20230328165313 b/db/schema_migrations/20230328165313 new file mode 100644 index 00000000000..a9ddacf5e48 --- /dev/null +++ b/db/schema_migrations/20230328165313 @@ -0,0 +1 @@ +ea52a177f82cc872b1f38490ff17bf166a885a4df7cf2c6c99dc7b1cccd14d33
\ No newline at end of file diff --git a/db/schema_migrations/20230328184031 b/db/schema_migrations/20230328184031 new file mode 100644 index 00000000000..2a099b60ba1 --- /dev/null +++ b/db/schema_migrations/20230328184031 @@ -0,0 +1 @@ +04dcd7983b02b2c97d64be9c55a1bdf921c39e5c5026ce086e8cc06932fd8344
\ No newline at end of file diff --git a/db/schema_migrations/20230329032129 b/db/schema_migrations/20230329032129 new file mode 100644 index 00000000000..3aec19e9d99 --- /dev/null +++ b/db/schema_migrations/20230329032129 @@ -0,0 +1 @@ +89a256c209e4c402d3162c7c967b7515870e80801e637a372fb9ee670d8e535e
\ No newline at end of file diff --git a/db/schema_migrations/20230329085754 b/db/schema_migrations/20230329085754 new file mode 100644 index 00000000000..fd2687b225f --- /dev/null +++ b/db/schema_migrations/20230329085754 @@ -0,0 +1 @@ +52c5c662dc46313dece9ed9228af5ea2734f0fc4872ba0f6a762e77437b9564e
\ No newline at end of file diff --git a/db/schema_migrations/20230329091107 b/db/schema_migrations/20230329091107 new file mode 100644 index 00000000000..658d90e662f --- /dev/null +++ b/db/schema_migrations/20230329091107 @@ -0,0 +1 @@ +4ca98e9c93245a8fc1f4124d00d47d73d12b961affde1d53b7262ffc93582d83
\ No newline at end of file diff --git a/db/schema_migrations/20230329091300 b/db/schema_migrations/20230329091300 new file mode 100644 index 00000000000..4a4be644126 --- /dev/null +++ b/db/schema_migrations/20230329091300 @@ -0,0 +1 @@ +a85e3139d843295e666867129575818f61983a8b16eaa73f9b470e394d9c5476
\ No newline at end of file diff --git a/db/schema_migrations/20230329100222 b/db/schema_migrations/20230329100222 new file mode 100644 index 00000000000..5ca5919dadd --- /dev/null +++ b/db/schema_migrations/20230329100222 @@ -0,0 +1 @@ +70c83ed052082e1f37bd46c5abcb0b1b101ea08b719a68d8f39cb7545da97e61
\ No newline at end of file diff --git a/db/schema_migrations/20230329152410 b/db/schema_migrations/20230329152410 new file mode 100644 index 00000000000..4f322c1db97 --- /dev/null +++ b/db/schema_migrations/20230329152410 @@ -0,0 +1 @@ +e9197bef3594074f543df534372f25a19b07be76f661b699496d9f12f9930fe1
\ No newline at end of file diff --git a/db/schema_migrations/20230329163232 b/db/schema_migrations/20230329163232 new file mode 100644 index 00000000000..dac25f62898 --- /dev/null +++ b/db/schema_migrations/20230329163232 @@ -0,0 +1 @@ +317e690eec5e3f3aa5a43610b848eb1ee9e5502b9480804ff363e45e66daac50
\ No newline at end of file diff --git a/db/schema_migrations/20230329194244 b/db/schema_migrations/20230329194244 new file mode 100644 index 00000000000..58b50705305 --- /dev/null +++ b/db/schema_migrations/20230329194244 @@ -0,0 +1 @@ +9e9f4b2ed1a56fb3dd780cd22f82eab741639bb972c524984741d4f8cd799e5c
\ No newline at end of file diff --git a/db/schema_migrations/20230330080731 b/db/schema_migrations/20230330080731 new file mode 100644 index 00000000000..18a8e9dba88 --- /dev/null +++ b/db/schema_migrations/20230330080731 @@ -0,0 +1 @@ +5bc014685295ca8af21450de34e39fb54e6cef2fc53943cce84ea24370a9955f
\ No newline at end of file diff --git a/db/schema_migrations/20230330101438 b/db/schema_migrations/20230330101438 new file mode 100644 index 00000000000..0e479e7b28f --- /dev/null +++ b/db/schema_migrations/20230330101438 @@ -0,0 +1 @@ +ff2658630f5877b94536653994d211344210e10c0d3ef19d6052ca606bf8ea56
\ No newline at end of file diff --git a/db/schema_migrations/20230330101439 b/db/schema_migrations/20230330101439 new file mode 100644 index 00000000000..64ccb9de3ee --- /dev/null +++ b/db/schema_migrations/20230330101439 @@ -0,0 +1 @@ +b388e3de152fda4ec4590fad5ffd503df85e474e807232e2afdacd51a4eebef9
\ No newline at end of file diff --git a/db/schema_migrations/20230330101440 b/db/schema_migrations/20230330101440 new file mode 100644 index 00000000000..470fc0189d2 --- /dev/null +++ b/db/schema_migrations/20230330101440 @@ -0,0 +1 @@ +f20a1df2650018debf7b84f90c0459e4fac7120c90aa23f184bbb5a96ab6e62c
\ No newline at end of file diff --git a/db/schema_migrations/20230330101441 b/db/schema_migrations/20230330101441 new file mode 100644 index 00000000000..fb69231b91a --- /dev/null +++ b/db/schema_migrations/20230330101441 @@ -0,0 +1 @@ +29c035a58df131daff23434a57999f04fbafde5a661e35bdc8556238c5822b5c
\ No newline at end of file diff --git a/db/schema_migrations/20230330101442 b/db/schema_migrations/20230330101442 new file mode 100644 index 00000000000..ba0def5c784 --- /dev/null +++ b/db/schema_migrations/20230330101442 @@ -0,0 +1 @@ +f2037e8c082b2355c7b004bc2f006f99f738c48e277b0013872c77d1347a0d14
\ No newline at end of file diff --git a/db/schema_migrations/20230330101443 b/db/schema_migrations/20230330101443 new file mode 100644 index 00000000000..4c0c0bc4b0a --- /dev/null +++ b/db/schema_migrations/20230330101443 @@ -0,0 +1 @@ +75bbf5ead4cec9bd425d056c9bbdc0e090721caa74c143533a30afedf90047ca
\ No newline at end of file diff --git a/db/schema_migrations/20230330103104 b/db/schema_migrations/20230330103104 new file mode 100644 index 00000000000..804fb366310 --- /dev/null +++ b/db/schema_migrations/20230330103104 @@ -0,0 +1 @@ +e52fa4a4736346c3c03e9386be1f25cf8a2cf006c63432181afcf27473dce90a
\ No newline at end of file diff --git a/db/schema_migrations/20230330215636 b/db/schema_migrations/20230330215636 new file mode 100644 index 00000000000..21d09d15906 --- /dev/null +++ b/db/schema_migrations/20230330215636 @@ -0,0 +1 @@ +46f78841bf6d0ff3b852eeb2f6690ec9fa20a460566a8c23f8530f0e4ec60ed8
\ No newline at end of file diff --git a/db/schema_migrations/20230331142006 b/db/schema_migrations/20230331142006 new file mode 100644 index 00000000000..be84e6af217 --- /dev/null +++ b/db/schema_migrations/20230331142006 @@ -0,0 +1 @@ +73b3a7fa20bb22756e9e16f489c0743920c3342c6fc5a70cffafad84016873ab
\ No newline at end of file diff --git a/db/schema_migrations/20230403023440 b/db/schema_migrations/20230403023440 new file mode 100644 index 00000000000..2705965c70c --- /dev/null +++ b/db/schema_migrations/20230403023440 @@ -0,0 +1 @@ +0cd1bcb2a2a02c09e7fd9271f815522adc1c20a1b39953349cfe2fff4541ed66
\ No newline at end of file diff --git a/db/schema_migrations/20230403023441 b/db/schema_migrations/20230403023441 new file mode 100644 index 00000000000..6e259200d0e --- /dev/null +++ b/db/schema_migrations/20230403023441 @@ -0,0 +1 @@ +e9684618df40260a7bae8b3dc217f3dd662e1cbc5db8b8a6d0334716e034c77b
\ No newline at end of file diff --git a/db/schema_migrations/20230403023828 b/db/schema_migrations/20230403023828 new file mode 100644 index 00000000000..60cc18c8eec --- /dev/null +++ b/db/schema_migrations/20230403023828 @@ -0,0 +1 @@ +1056fb290b3f5acf11dca0848258494d42c075dc7dc18ca89873d6237fc7104b
\ No newline at end of file diff --git a/db/schema_migrations/20230403041642 b/db/schema_migrations/20230403041642 new file mode 100644 index 00000000000..2e066ad05d8 --- /dev/null +++ b/db/schema_migrations/20230403041642 @@ -0,0 +1 @@ +695a7fb24cc41bf991f54df7250b7c72c4e22c6eefc6327b58bb658dcc072740
\ No newline at end of file diff --git a/db/schema_migrations/20230403041917 b/db/schema_migrations/20230403041917 new file mode 100644 index 00000000000..bc3e2d3b2e2 --- /dev/null +++ b/db/schema_migrations/20230403041917 @@ -0,0 +1 @@ +3387abc29b2c499b8c1fafa8543f504d02cbca189b38f26a3776786416fa5820
\ No newline at end of file diff --git a/db/schema_migrations/20230403085957 b/db/schema_migrations/20230403085957 new file mode 100644 index 00000000000..6789a0a83a5 --- /dev/null +++ b/db/schema_migrations/20230403085957 @@ -0,0 +1 @@ +731cdc55c22cfcfc6f23e59a7c051385a66259bb10f4b7dd22da21ee228357d2
\ No newline at end of file diff --git a/db/schema_migrations/20230403085958 b/db/schema_migrations/20230403085958 new file mode 100644 index 00000000000..882be7fa1cd --- /dev/null +++ b/db/schema_migrations/20230403085958 @@ -0,0 +1 @@ +54e1499b13e6bbfb7c08e491caacae93ee21c1e939e41ffcf7ab83c6f50463ce
\ No newline at end of file diff --git a/db/schema_migrations/20230403093349 b/db/schema_migrations/20230403093349 new file mode 100644 index 00000000000..3dcdbd50bcd --- /dev/null +++ b/db/schema_migrations/20230403093349 @@ -0,0 +1 @@ +041dd0c558a77b965a9aa66e80eb30ad6e925779db4f69f3a8cf5f6293d25aa2
\ No newline at end of file diff --git a/db/schema_migrations/20230403113620 b/db/schema_migrations/20230403113620 new file mode 100644 index 00000000000..bbecdc62886 --- /dev/null +++ b/db/schema_migrations/20230403113620 @@ -0,0 +1 @@ +52b7d165f3fcbfd16af2c2054693af4ce7d97ca51ac1c8900d357bec4401cd14
\ No newline at end of file diff --git a/db/schema_migrations/20230403145705 b/db/schema_migrations/20230403145705 new file mode 100644 index 00000000000..80e6357e3e4 --- /dev/null +++ b/db/schema_migrations/20230403145705 @@ -0,0 +1 @@ +856d50399914b6df0c07d328723197a57806c0883157cbfe67f0c578708a1bde
\ No newline at end of file diff --git a/db/schema_migrations/20230403164454 b/db/schema_migrations/20230403164454 new file mode 100644 index 00000000000..0283a3b1612 --- /dev/null +++ b/db/schema_migrations/20230403164454 @@ -0,0 +1 @@ +ff04f9ef9bb479b85223e361b96c921e25b436a86a0041627b595c3635848a5b
\ No newline at end of file diff --git a/db/schema_migrations/20230403190527 b/db/schema_migrations/20230403190527 new file mode 100644 index 00000000000..290c9c39333 --- /dev/null +++ b/db/schema_migrations/20230403190527 @@ -0,0 +1 @@ +0715accd97005c76bcb1e975bf00fd5fd4f34375a5d5a4131d107f13b1cd6be0
\ No newline at end of file diff --git a/db/schema_migrations/20230403221928 b/db/schema_migrations/20230403221928 new file mode 100644 index 00000000000..42fd52b4415 --- /dev/null +++ b/db/schema_migrations/20230403221928 @@ -0,0 +1 @@ +458b23ebbf780535b3eec467bad2edbf3bcca3804569d892572c6e6fac2f2019
\ No newline at end of file diff --git a/db/schema_migrations/20230403231455 b/db/schema_migrations/20230403231455 new file mode 100644 index 00000000000..5d9c1f5a620 --- /dev/null +++ b/db/schema_migrations/20230403231455 @@ -0,0 +1 @@ +39167c767e9cbf437f7c58ee42dbc1524a3963b7eb5a9c8421f6c218611d1291
\ No newline at end of file diff --git a/db/schema_migrations/20230403231841 b/db/schema_migrations/20230403231841 new file mode 100644 index 00000000000..f02d68ba424 --- /dev/null +++ b/db/schema_migrations/20230403231841 @@ -0,0 +1 @@ +86bcc78ab4b5681cd31f6ca1ae43cb3c3ec5d17392a1eaceee9520cfa684d36d
\ No newline at end of file diff --git a/db/schema_migrations/20230403232121 b/db/schema_migrations/20230403232121 new file mode 100644 index 00000000000..519a8dc0bb2 --- /dev/null +++ b/db/schema_migrations/20230403232121 @@ -0,0 +1 @@ +59297e1b83298ee3d02a70384355cd572229e5b5ab20ebea6dd9ffff0b9e243b
\ No newline at end of file diff --git a/db/schema_migrations/20230404023648 b/db/schema_migrations/20230404023648 new file mode 100644 index 00000000000..c9ac5581cf3 --- /dev/null +++ b/db/schema_migrations/20230404023648 @@ -0,0 +1 @@ +ef9f641608397a12e6b5384667194a8b3e5b929c76c365105f47fd00c5c7f219
\ No newline at end of file diff --git a/db/schema_migrations/20230404023915 b/db/schema_migrations/20230404023915 new file mode 100644 index 00000000000..99d7f3ec63c --- /dev/null +++ b/db/schema_migrations/20230404023915 @@ -0,0 +1 @@ +20bfe6e7faf02d4b20babf0f80d51bfd3618f3fd1faf512af948f1976d8c5838
\ No newline at end of file diff --git a/db/schema_migrations/20230404030757 b/db/schema_migrations/20230404030757 new file mode 100644 index 00000000000..989df2048b0 --- /dev/null +++ b/db/schema_migrations/20230404030757 @@ -0,0 +1 @@ +3968fc8d21184f48f85209546fe515d0b4a407ad0837ef052ccbbbe15d0f9163
\ No newline at end of file diff --git a/db/schema_migrations/20230404031041 b/db/schema_migrations/20230404031041 new file mode 100644 index 00000000000..24b24fb6dc9 --- /dev/null +++ b/db/schema_migrations/20230404031041 @@ -0,0 +1 @@ +a3e306b8ebe149c319788311f4f81386c9362d081babca8bcd7c850ae1cbc183
\ No newline at end of file diff --git a/db/schema_migrations/20230404044338 b/db/schema_migrations/20230404044338 new file mode 100644 index 00000000000..caa04406a17 --- /dev/null +++ b/db/schema_migrations/20230404044338 @@ -0,0 +1 @@ +42d91918d6669bb02501657aeac062114ce6ce907baf690ab346e788c57a3324
\ No newline at end of file diff --git a/db/schema_migrations/20230404050414 b/db/schema_migrations/20230404050414 new file mode 100644 index 00000000000..eed37e4fbed --- /dev/null +++ b/db/schema_migrations/20230404050414 @@ -0,0 +1 @@ +919044fa4eca645e32496135af44cd01b5299413cea4dcd243a37ec144806e2f
\ No newline at end of file diff --git a/db/schema_migrations/20230404061832 b/db/schema_migrations/20230404061832 new file mode 100644 index 00000000000..14cdca25567 --- /dev/null +++ b/db/schema_migrations/20230404061832 @@ -0,0 +1 @@ +51e141580bfb02dbe9ab215bd9283c01598353cb3f59fbe52ab0ab26a7974b49
\ No newline at end of file diff --git a/db/schema_migrations/20230404111427 b/db/schema_migrations/20230404111427 new file mode 100644 index 00000000000..3133f52cc5d --- /dev/null +++ b/db/schema_migrations/20230404111427 @@ -0,0 +1 @@ +571bcfb6ce5d85254cf0fc759278fbbb31d7f9967587efe2531bb0e56435b464
\ No newline at end of file diff --git a/db/schema_migrations/20230404132544 b/db/schema_migrations/20230404132544 new file mode 100644 index 00000000000..ed8abfc31ec --- /dev/null +++ b/db/schema_migrations/20230404132544 @@ -0,0 +1 @@ +c2547b24345eb71c4b23d03a2b90150e0cb0fc89adaa92696fe72e038b71a6dd
\ No newline at end of file diff --git a/db/schema_migrations/20230404160131 b/db/schema_migrations/20230404160131 new file mode 100644 index 00000000000..089788a185f --- /dev/null +++ b/db/schema_migrations/20230404160131 @@ -0,0 +1 @@ +d49adae338b04deee154fd2fcb9bebf4f746eb5e7d1d39402a617ca511a06bfe
\ No newline at end of file diff --git a/db/schema_migrations/20230404194907 b/db/schema_migrations/20230404194907 new file mode 100644 index 00000000000..76b16536f8d --- /dev/null +++ b/db/schema_migrations/20230404194907 @@ -0,0 +1 @@ +7dccec7b92a1ea97acad03086c8d7c05ee06d1afdb88ffe34d6e83b1ffe61ad3
\ No newline at end of file diff --git a/db/schema_migrations/20230404194908 b/db/schema_migrations/20230404194908 new file mode 100644 index 00000000000..c9324dbc016 --- /dev/null +++ b/db/schema_migrations/20230404194908 @@ -0,0 +1 @@ +de2093c0fe297431a5a8275f482bcbf75d2672421b08942da0dcdaf6a26e1d8f
\ No newline at end of file diff --git a/db/schema_migrations/20230405071033 b/db/schema_migrations/20230405071033 new file mode 100644 index 00000000000..1412634cfa2 --- /dev/null +++ b/db/schema_migrations/20230405071033 @@ -0,0 +1 @@ +b5ea5ce5590dfa2d9e989293f641964b2093eebeb606fe9b7a977441c555e9c1
\ No newline at end of file diff --git a/db/schema_migrations/20230405072302 b/db/schema_migrations/20230405072302 new file mode 100644 index 00000000000..cfa7bf7f175 --- /dev/null +++ b/db/schema_migrations/20230405072302 @@ -0,0 +1 @@ +d93a103c002a536d11f75256f20e2b8708ec760286f65d89ab5abe446fe629d4
\ No newline at end of file diff --git a/db/schema_migrations/20230405094230 b/db/schema_migrations/20230405094230 new file mode 100644 index 00000000000..2af4c0d876f --- /dev/null +++ b/db/schema_migrations/20230405094230 @@ -0,0 +1 @@ +6b9ded39763a59b0047e256b9283084b4f05dbca46de85e7c8bb6c7d44d96d23
\ No newline at end of file diff --git a/db/schema_migrations/20230405102815 b/db/schema_migrations/20230405102815 new file mode 100644 index 00000000000..a5c8f90fe6b --- /dev/null +++ b/db/schema_migrations/20230405102815 @@ -0,0 +1 @@ +60ae9405a4d4f4c41abc0b6b29c557701ae10957622297d093c70fade32e2863
\ No newline at end of file diff --git a/db/schema_migrations/20230405132104 b/db/schema_migrations/20230405132104 new file mode 100644 index 00000000000..e8d9bd7ded7 --- /dev/null +++ b/db/schema_migrations/20230405132104 @@ -0,0 +1 @@ +eae464c7583b909d975c379d196b7ae5301580f7195907a476ca1a146d8cb6b1
\ No newline at end of file diff --git a/db/schema_migrations/20230405132855 b/db/schema_migrations/20230405132855 new file mode 100644 index 00000000000..209578a8ed4 --- /dev/null +++ b/db/schema_migrations/20230405132855 @@ -0,0 +1 @@ +a7928284883d79b1204bb39a2a2d34b173771ce6dc484cefdb1c7ec3e9e9477a
\ No newline at end of file diff --git a/db/schema_migrations/20230405200858 b/db/schema_migrations/20230405200858 new file mode 100644 index 00000000000..185155ed4d8 --- /dev/null +++ b/db/schema_migrations/20230405200858 @@ -0,0 +1 @@ +640e7ea2a9b2e90eff427680e5a6e2a2def9b7832a48b7b877f3aa75d8810fd3
\ No newline at end of file diff --git a/db/schema_migrations/20230406040908 b/db/schema_migrations/20230406040908 new file mode 100644 index 00000000000..e5ca15fe7e6 --- /dev/null +++ b/db/schema_migrations/20230406040908 @@ -0,0 +1 @@ +33c9561c8f21f756095ff7396b78bf78bd7f41e18e508c89b759d367d5e920ba
\ No newline at end of file diff --git a/db/schema_migrations/20230406041555 b/db/schema_migrations/20230406041555 new file mode 100644 index 00000000000..cede3b1d25e --- /dev/null +++ b/db/schema_migrations/20230406041555 @@ -0,0 +1 @@ +75a2776017e8d2c015021ca056c09d2b5f7776f6443c59d1bd164519575c05ba
\ No newline at end of file diff --git a/db/schema_migrations/20230406041629 b/db/schema_migrations/20230406041629 new file mode 100644 index 00000000000..0d77ae52a24 --- /dev/null +++ b/db/schema_migrations/20230406041629 @@ -0,0 +1 @@ +e1726eb5b20b230f4b37ef56e0f3dd512bdcea3e67a9ba5a1725363bb17b79e6
\ No newline at end of file diff --git a/db/schema_migrations/20230406042906 b/db/schema_migrations/20230406042906 new file mode 100644 index 00000000000..a32d144741b --- /dev/null +++ b/db/schema_migrations/20230406042906 @@ -0,0 +1 @@ +b6608c1bd719c6fcfe701b11737ebfa7a8db8da795a0037d08bb7adc0c9b40e2
\ No newline at end of file diff --git a/db/schema_migrations/20230406043900 b/db/schema_migrations/20230406043900 new file mode 100644 index 00000000000..e41be929522 --- /dev/null +++ b/db/schema_migrations/20230406043900 @@ -0,0 +1 @@ +83c9ff25c312bd1c11e9be4fc8da12f89ec72174a0b303513899ee2fcd18e4d3
\ No newline at end of file diff --git a/db/schema_migrations/20230406060452 b/db/schema_migrations/20230406060452 new file mode 100644 index 00000000000..ee6e212a27b --- /dev/null +++ b/db/schema_migrations/20230406060452 @@ -0,0 +1 @@ +95bad3e986fc44b20460c3e88b5195be1aa461e4a1e7d8427e9f731bca090f5c
\ No newline at end of file diff --git a/db/schema_migrations/20230406073847 b/db/schema_migrations/20230406073847 new file mode 100644 index 00000000000..8c854a9350c --- /dev/null +++ b/db/schema_migrations/20230406073847 @@ -0,0 +1 @@ +58b22a8ed1ea4f21b8a3b42ffdf4853c111d8c462ffbd97d5f7080e2c0587473
\ No newline at end of file diff --git a/db/schema_migrations/20230406093640 b/db/schema_migrations/20230406093640 new file mode 100644 index 00000000000..3bc9003b2fa --- /dev/null +++ b/db/schema_migrations/20230406093640 @@ -0,0 +1 @@ +a49416e1b59ffb29bf2015c96e6bdf92428036862102fbbfa63284cc1da53c82
\ No newline at end of file diff --git a/db/schema_migrations/20230406095544 b/db/schema_migrations/20230406095544 new file mode 100644 index 00000000000..56e891d65db --- /dev/null +++ b/db/schema_migrations/20230406095544 @@ -0,0 +1 @@ +3774f65f475364f3748502b035bdb3d18db0588a0f3ed45ca19cc5492ce754df
\ No newline at end of file diff --git a/db/schema_migrations/20230406121544 b/db/schema_migrations/20230406121544 new file mode 100644 index 00000000000..3039b8b297f --- /dev/null +++ b/db/schema_migrations/20230406121544 @@ -0,0 +1 @@ +62541ed3a4cd0d62c227c29403d9685bec1779226a00c9c96c13352eed10f1b4
\ No newline at end of file diff --git a/db/schema_migrations/20230406134436 b/db/schema_migrations/20230406134436 new file mode 100644 index 00000000000..17d51bba6ce --- /dev/null +++ b/db/schema_migrations/20230406134436 @@ -0,0 +1 @@ +3b7a512959c9d109ee4b454693ebfafed624869c82fa64d92b3f780165e91feb
\ No newline at end of file diff --git a/db/schema_migrations/20230406150254 b/db/schema_migrations/20230406150254 new file mode 100644 index 00000000000..3e3463a76f9 --- /dev/null +++ b/db/schema_migrations/20230406150254 @@ -0,0 +1 @@ +2b8aea677f295a0ab8f5ca9fbe7162156a06de89bd30ab5b252eb4460bcc7a2e
\ No newline at end of file diff --git a/db/schema_migrations/20230406150354 b/db/schema_migrations/20230406150354 new file mode 100644 index 00000000000..484af1e53ad --- /dev/null +++ b/db/schema_migrations/20230406150354 @@ -0,0 +1 @@ +2f1ef88ab1731b20821a86a74006ed0856d3c7baa5e197f72410aedb15cb2894
\ No newline at end of file diff --git a/db/schema_migrations/20230406150454 b/db/schema_migrations/20230406150454 new file mode 100644 index 00000000000..f7237bd5ef2 --- /dev/null +++ b/db/schema_migrations/20230406150454 @@ -0,0 +1 @@ +9966f807ce21016777a87d437355241cd8e5cacf2ccd143258ef0446e6f26e93
\ No newline at end of file diff --git a/db/schema_migrations/20230407164616 b/db/schema_migrations/20230407164616 new file mode 100644 index 00000000000..94a275ef9c2 --- /dev/null +++ b/db/schema_migrations/20230407164616 @@ -0,0 +1 @@ +ffc795945693f4856bd10224788ceb8305227ec296223c450af75a26a11f4811
\ No newline at end of file diff --git a/db/schema_migrations/20230410092450 b/db/schema_migrations/20230410092450 new file mode 100644 index 00000000000..1b7b88026f5 --- /dev/null +++ b/db/schema_migrations/20230410092450 @@ -0,0 +1 @@ +3a2c45579f8f566a2224afcab84b9f403e49379603e164f141a4dc89b5f4b512
\ No newline at end of file diff --git a/db/schema_migrations/20230410111251 b/db/schema_migrations/20230410111251 new file mode 100644 index 00000000000..37a559a91e7 --- /dev/null +++ b/db/schema_migrations/20230410111251 @@ -0,0 +1 @@ +4955274e8f504af6e06432bd195e64eb6c520118a50f7da19af2fcf5872459cf
\ No newline at end of file diff --git a/db/schema_migrations/20230410123709 b/db/schema_migrations/20230410123709 new file mode 100644 index 00000000000..2cf17b397dd --- /dev/null +++ b/db/schema_migrations/20230410123709 @@ -0,0 +1 @@ +d1e5678ea93b5b8f5d76b0332e79934badbaa84546754b66916bb2816cfaf307
\ No newline at end of file diff --git a/db/schema_migrations/20230411011959 b/db/schema_migrations/20230411011959 new file mode 100644 index 00000000000..830774fc029 --- /dev/null +++ b/db/schema_migrations/20230411011959 @@ -0,0 +1 @@ +31e8f1f8d65ea821efb158bd59657776de54ecbd5e10d3a64c5afe37706c5388
\ No newline at end of file diff --git a/db/schema_migrations/20230411153310 b/db/schema_migrations/20230411153310 new file mode 100644 index 00000000000..14f317ccf08 --- /dev/null +++ b/db/schema_migrations/20230411153310 @@ -0,0 +1 @@ +f4472433ac5b74296409a04790d64ed56551358c98428ebb2e5f15d2f3e2db31
\ No newline at end of file diff --git a/db/schema_migrations/20230411171001 b/db/schema_migrations/20230411171001 new file mode 100644 index 00000000000..59b8c273f19 --- /dev/null +++ b/db/schema_migrations/20230411171001 @@ -0,0 +1 @@ +7182fb09394b77f01346e68b104a5a8814f48fd63e763207f1b983faae10d805
\ No newline at end of file diff --git a/db/schema_migrations/20230411205121 b/db/schema_migrations/20230411205121 new file mode 100644 index 00000000000..b90bda11c27 --- /dev/null +++ b/db/schema_migrations/20230411205121 @@ -0,0 +1 @@ +cb1766c3c3b6604353dfcb774b8b4f3fe65dac10d15312785855153769ac6fe0
\ No newline at end of file diff --git a/db/schema_migrations/20230412013251 b/db/schema_migrations/20230412013251 new file mode 100644 index 00000000000..82f226a482d --- /dev/null +++ b/db/schema_migrations/20230412013251 @@ -0,0 +1 @@ +d81ed136179bbc28a6b8048de34674ced7c0ffa891a0045b108f891979bbc46c
\ No newline at end of file diff --git a/db/schema_migrations/20230412073614 b/db/schema_migrations/20230412073614 new file mode 100644 index 00000000000..bb6ac60b051 --- /dev/null +++ b/db/schema_migrations/20230412073614 @@ -0,0 +1 @@ +984ebbfc7a8f6ba62715da2fe5ff46ab4030eb17baff69e82f56d1596c6f2e31
\ No newline at end of file diff --git a/db/schema_migrations/20230412080242 b/db/schema_migrations/20230412080242 new file mode 100644 index 00000000000..a19a1b31b40 --- /dev/null +++ b/db/schema_migrations/20230412080242 @@ -0,0 +1 @@ +fabf026dac1c69b291895dcc047bb03baf31376f72d289d798d537da1b4ac53a
\ No newline at end of file diff --git a/db/schema_migrations/20230412104514 b/db/schema_migrations/20230412104514 new file mode 100644 index 00000000000..50c4a36e790 --- /dev/null +++ b/db/schema_migrations/20230412104514 @@ -0,0 +1 @@ +5a1245d37e10d03320a3cd8afda34226e54c6f6641c3abedfcb1333ea6ed69a0
\ No newline at end of file diff --git a/db/schema_migrations/20230412141541 b/db/schema_migrations/20230412141541 new file mode 100644 index 00000000000..5ad6e38d98b --- /dev/null +++ b/db/schema_migrations/20230412141541 @@ -0,0 +1 @@ +777065413e8eb5605037885fb1a38c74b1f464733afb2718380f081edb9ab8a8
\ No newline at end of file diff --git a/db/schema_migrations/20230412151659 b/db/schema_migrations/20230412151659 new file mode 100644 index 00000000000..96c304452d8 --- /dev/null +++ b/db/schema_migrations/20230412151659 @@ -0,0 +1 @@ +dccf257ed6a503983fe54f8e06d37e4a64906e1dc9f7e970fdfab77f13eebedb
\ No newline at end of file diff --git a/db/schema_migrations/20230412152538 b/db/schema_migrations/20230412152538 new file mode 100644 index 00000000000..74f27a94bb5 --- /dev/null +++ b/db/schema_migrations/20230412152538 @@ -0,0 +1 @@ +82f54822df6794347ba83f4c1a78540b7eb47c2deb059de143cd9a5b77f47f1f
\ No newline at end of file diff --git a/db/schema_migrations/20230412185837 b/db/schema_migrations/20230412185837 new file mode 100644 index 00000000000..d4c425e68fa --- /dev/null +++ b/db/schema_migrations/20230412185837 @@ -0,0 +1 @@ +f9c342816a6c656b1c13b8e9d0a771c1ee6a9847c03a76577c662f9cf238ad03
\ No newline at end of file diff --git a/db/schema_migrations/20230412185920 b/db/schema_migrations/20230412185920 new file mode 100644 index 00000000000..4609cd6d2bf --- /dev/null +++ b/db/schema_migrations/20230412185920 @@ -0,0 +1 @@ +772e42722b07397934795164c2587e44ed4c0552d5c07eb8d867e66ee6795c65
\ No newline at end of file diff --git a/db/schema_migrations/20230412201517 b/db/schema_migrations/20230412201517 new file mode 100644 index 00000000000..8ecf8e9b941 --- /dev/null +++ b/db/schema_migrations/20230412201517 @@ -0,0 +1 @@ +4719d78fb3b9b2ec197edfbc4e0f7d4e79b1ecb4e71e1c01a2f7c966e2d0aef1
\ No newline at end of file diff --git a/db/schema_migrations/20230412201528 b/db/schema_migrations/20230412201528 new file mode 100644 index 00000000000..23631545870 --- /dev/null +++ b/db/schema_migrations/20230412201528 @@ -0,0 +1 @@ +f98482c919a5a5ffc6284b4fe81d39d4ae46afc2c0bacb7e726425ee6f187bd7
\ No newline at end of file diff --git a/db/schema_migrations/20230412201539 b/db/schema_migrations/20230412201539 new file mode 100644 index 00000000000..d1f9056904c --- /dev/null +++ b/db/schema_migrations/20230412201539 @@ -0,0 +1 @@ +8c05ce2cfd9d56e89035a74b4f86c4a96e00e804a4ab6710e9f8b5f878f49356
\ No newline at end of file diff --git a/db/schema_migrations/20230412201549 b/db/schema_migrations/20230412201549 new file mode 100644 index 00000000000..84b0b0ebca5 --- /dev/null +++ b/db/schema_migrations/20230412201549 @@ -0,0 +1 @@ +099cdc51e234b92894828e9f736ce557ae5102bf7b7b56014c31d4cf8ee97f37
\ No newline at end of file diff --git a/db/schema_migrations/20230412201600 b/db/schema_migrations/20230412201600 new file mode 100644 index 00000000000..990a49c26a4 --- /dev/null +++ b/db/schema_migrations/20230412201600 @@ -0,0 +1 @@ +271b199deb4ce20c30fa5fb0b07d5dea8819f79a8bf9dac0eba3121ae980d614
\ No newline at end of file diff --git a/db/schema_migrations/20230412201611 b/db/schema_migrations/20230412201611 new file mode 100644 index 00000000000..1fd41d259be --- /dev/null +++ b/db/schema_migrations/20230412201611 @@ -0,0 +1 @@ +2ed349b5aee1df4644e16df2fecc247108585ea7c49989ed2c0812be48d5be1c
\ No newline at end of file diff --git a/db/schema_migrations/20230412201621 b/db/schema_migrations/20230412201621 new file mode 100644 index 00000000000..accd8b36021 --- /dev/null +++ b/db/schema_migrations/20230412201621 @@ -0,0 +1 @@ +857a60f6916c045790dca8621c69601dbfb07f7524b8cdb6df6ac8a34ee1782b
\ No newline at end of file diff --git a/db/schema_migrations/20230412201632 b/db/schema_migrations/20230412201632 new file mode 100644 index 00000000000..1d72fb6b1aa --- /dev/null +++ b/db/schema_migrations/20230412201632 @@ -0,0 +1 @@ +2c20678f0e73f75706eb3e3b3115b38f3c313ccb77f2fdb7bd5ebc971c8093ef
\ No newline at end of file diff --git a/db/schema_migrations/20230412201642 b/db/schema_migrations/20230412201642 new file mode 100644 index 00000000000..743d67ab0e3 --- /dev/null +++ b/db/schema_migrations/20230412201642 @@ -0,0 +1 @@ +c4b1137f6d3a111c230ad7f6d0d29c64d919daa6a8628e945152d12c15c421fb
\ No newline at end of file diff --git a/db/schema_migrations/20230412203234 b/db/schema_migrations/20230412203234 new file mode 100644 index 00000000000..8ab84c8424f --- /dev/null +++ b/db/schema_migrations/20230412203234 @@ -0,0 +1 @@ +4e5758e3112cad9b5a243b0123c365869b3d7a0de4800d0e0672ae82f71b8053
\ No newline at end of file diff --git a/db/schema_migrations/20230412204143 b/db/schema_migrations/20230412204143 new file mode 100644 index 00000000000..b59f406ebbe --- /dev/null +++ b/db/schema_migrations/20230412204143 @@ -0,0 +1 @@ +12acd41d0550fcf363d3db4a093b64465d59004cbb07bfa0da073f0d7c4acf52
\ No newline at end of file diff --git a/db/schema_migrations/20230412204201 b/db/schema_migrations/20230412204201 new file mode 100644 index 00000000000..12f879042ac --- /dev/null +++ b/db/schema_migrations/20230412204201 @@ -0,0 +1 @@ +f9466af9e29ae09542c1bd64cae923ed34f079d405a35704e55d01456eb6a519
\ No newline at end of file diff --git a/db/schema_migrations/20230412204224 b/db/schema_migrations/20230412204224 new file mode 100644 index 00000000000..026b02e1cbd --- /dev/null +++ b/db/schema_migrations/20230412204224 @@ -0,0 +1 @@ +e2e596b67adcca6ccf0b714aafdadaffded1d11c1fc043aa13d9499552c37433
\ No newline at end of file diff --git a/db/schema_migrations/20230412214119 b/db/schema_migrations/20230412214119 new file mode 100644 index 00000000000..80a8f21a960 --- /dev/null +++ b/db/schema_migrations/20230412214119 @@ -0,0 +1 @@ +aac6aa036a97fa8331983085d8afad2dd870c80a687f6c0ed09476e438e15e76
\ No newline at end of file diff --git a/db/schema_migrations/20230413012807 b/db/schema_migrations/20230413012807 new file mode 100644 index 00000000000..bfb25c1bc63 --- /dev/null +++ b/db/schema_migrations/20230413012807 @@ -0,0 +1 @@ +7bf75dca15fcf1a73a9d201968ab85eb18983d1921a5bf7d0661083137de40c9
\ No newline at end of file diff --git a/db/schema_migrations/20230413041917 b/db/schema_migrations/20230413041917 new file mode 100644 index 00000000000..f4c1f05a565 --- /dev/null +++ b/db/schema_migrations/20230413041917 @@ -0,0 +1 @@ +c359118e94c992bd19d8f0bd10f702bc117c944663a1f84f3d678bada242c09d
\ No newline at end of file diff --git a/db/schema_migrations/20230413041918 b/db/schema_migrations/20230413041918 new file mode 100644 index 00000000000..373b9cfa66a --- /dev/null +++ b/db/schema_migrations/20230413041918 @@ -0,0 +1 @@ +86b631d6511154139835d508b4f694c604b0d6c12d553d107e4c206f034b8453
\ No newline at end of file diff --git a/db/schema_migrations/20230413041919 b/db/schema_migrations/20230413041919 new file mode 100644 index 00000000000..6376268aaab --- /dev/null +++ b/db/schema_migrations/20230413041919 @@ -0,0 +1 @@ +8e05119e15d3a547db7844697ae5cbfc4760a4f329320acc8519a3ba9271ff29
\ No newline at end of file diff --git a/db/schema_migrations/20230413041920 b/db/schema_migrations/20230413041920 new file mode 100644 index 00000000000..c2f9dd23919 --- /dev/null +++ b/db/schema_migrations/20230413041920 @@ -0,0 +1 @@ +aebd6315b218f36b524d856dee5ce82d838693f689124b181fa6242dda1f80fc
\ No newline at end of file diff --git a/db/schema_migrations/20230413080906 b/db/schema_migrations/20230413080906 new file mode 100644 index 00000000000..20037d0f314 --- /dev/null +++ b/db/schema_migrations/20230413080906 @@ -0,0 +1 @@ +44c6a5d0a7e3083dd5bf0afcfeff9cbd1061a3bb444504d11c44c38adeb75123
\ No newline at end of file diff --git a/db/schema_migrations/20230413080918 b/db/schema_migrations/20230413080918 new file mode 100644 index 00000000000..866d0a817bc --- /dev/null +++ b/db/schema_migrations/20230413080918 @@ -0,0 +1 @@ +38e2f3cf25cc09d9f396de1fa0d299bde55daeb59c98d886df02db1d337a452f
\ No newline at end of file diff --git a/db/schema_migrations/20230413153140 b/db/schema_migrations/20230413153140 new file mode 100644 index 00000000000..97af4a6962f --- /dev/null +++ b/db/schema_migrations/20230413153140 @@ -0,0 +1 @@ +e78e74c9c068235ede55859b56bea671d9da5c3e74ac315e1b9391b6eef2649b
\ No newline at end of file diff --git a/db/schema_migrations/20230414075119 b/db/schema_migrations/20230414075119 new file mode 100644 index 00000000000..9c062a74af0 --- /dev/null +++ b/db/schema_migrations/20230414075119 @@ -0,0 +1 @@ +be2246a2d36d87793007f1a0cf3eddface8de605eee40a93ba3985d26e6b924b
\ No newline at end of file diff --git a/db/schema_migrations/20230414140202 b/db/schema_migrations/20230414140202 new file mode 100644 index 00000000000..6e50edaa549 --- /dev/null +++ b/db/schema_migrations/20230414140202 @@ -0,0 +1 @@ +253faa0063e11decde1c0aacc1c15cbf3035e533934a6cd1d3da46e5a4a4eae4
\ No newline at end of file diff --git a/db/schema_migrations/20230414150202 b/db/schema_migrations/20230414150202 new file mode 100644 index 00000000000..43065106a98 --- /dev/null +++ b/db/schema_migrations/20230414150202 @@ -0,0 +1 @@ +827358117f7eb0d16f99350186bff641ecf88f37b1cd46551173e3eef76cb474
\ No newline at end of file diff --git a/db/schema_migrations/20230414190012 b/db/schema_migrations/20230414190012 new file mode 100644 index 00000000000..5973075344e --- /dev/null +++ b/db/schema_migrations/20230414190012 @@ -0,0 +1 @@ +0202a3aa13d7d9c47fdd33f9029900ed5a81b37efccceee532565d2b31499e61
\ No newline at end of file diff --git a/db/schema_migrations/20230414200202 b/db/schema_migrations/20230414200202 new file mode 100644 index 00000000000..7a68c986f94 --- /dev/null +++ b/db/schema_migrations/20230414200202 @@ -0,0 +1 @@ +1e7e465343930dd14d3fa98aeababa836db03e70de81f0bc97bbab46409d2712
\ No newline at end of file diff --git a/db/schema_migrations/20230414230535 b/db/schema_migrations/20230414230535 new file mode 100644 index 00000000000..388c5343f4b --- /dev/null +++ b/db/schema_migrations/20230414230535 @@ -0,0 +1 @@ +36c538abaeb4239d5cc0424ebe2ac2f01c427d4acdfaf849f181d066f658899e
\ No newline at end of file diff --git a/db/schema_migrations/20230417145900 b/db/schema_migrations/20230417145900 new file mode 100644 index 00000000000..ef7b1361f37 --- /dev/null +++ b/db/schema_migrations/20230417145900 @@ -0,0 +1 @@ +18b05ed9e90eeee98f7e9f00cbe18f510bec13f78cf17dc4f7d78c53d024d8cb
\ No newline at end of file diff --git a/db/schema_migrations/20230418154454 b/db/schema_migrations/20230418154454 new file mode 100644 index 00000000000..5607349f86f --- /dev/null +++ b/db/schema_migrations/20230418154454 @@ -0,0 +1 @@ +bd0a4ebd07f8d3f5741840bb60073f54a37ee23498266c65725f15d576b3f748
\ No newline at end of file diff --git a/db/schema_migrations/20230418164957 b/db/schema_migrations/20230418164957 new file mode 100644 index 00000000000..e7fa549aba4 --- /dev/null +++ b/db/schema_migrations/20230418164957 @@ -0,0 +1 @@ +80eb5db3db246ff6b2b857252cee05049cc0f7c09d0487175cfa90eeaf93f20c
\ No newline at end of file diff --git a/db/schema_migrations/20230418183540 b/db/schema_migrations/20230418183540 new file mode 100644 index 00000000000..dc40376098b --- /dev/null +++ b/db/schema_migrations/20230418183540 @@ -0,0 +1 @@ +febd4b1827b82705c737b8f0567a8d337d11735f97c3f43b8360bd8fccaae3e4
\ No newline at end of file diff --git a/db/schema_migrations/20230418215853 b/db/schema_migrations/20230418215853 new file mode 100644 index 00000000000..dec4ae4650e --- /dev/null +++ b/db/schema_migrations/20230418215853 @@ -0,0 +1 @@ +84a104a3d1004e8a4695f309d2154ca3b74f865c02a111fd2f6d352daad065ff
\ No newline at end of file diff --git a/db/schema_migrations/20230419010332 b/db/schema_migrations/20230419010332 new file mode 100644 index 00000000000..ab1fdc39079 --- /dev/null +++ b/db/schema_migrations/20230419010332 @@ -0,0 +1 @@ +440922ff7763edaa21e1ceaa435929f5c181d25bfd712f9f4b67792cc59d58d6
\ No newline at end of file diff --git a/db/schema_migrations/20230419010551 b/db/schema_migrations/20230419010551 new file mode 100644 index 00000000000..e3bca4b4efa --- /dev/null +++ b/db/schema_migrations/20230419010551 @@ -0,0 +1 @@ +2bf372259e17947046aa63889975a4051395785dfa27092e55f1e3541984fa74
\ No newline at end of file diff --git a/db/schema_migrations/20230419012426 b/db/schema_migrations/20230419012426 new file mode 100644 index 00000000000..335247d13c2 --- /dev/null +++ b/db/schema_migrations/20230419012426 @@ -0,0 +1 @@ +108adc46f0e9e05912325e8fbd7d32d35d80257e55c370d782640c06c7737030
\ No newline at end of file diff --git a/db/schema_migrations/20230419012621 b/db/schema_migrations/20230419012621 new file mode 100644 index 00000000000..de5f54ac3c1 --- /dev/null +++ b/db/schema_migrations/20230419012621 @@ -0,0 +1 @@ +0a8b81bdb20958c543322578cb0955a212319d272338f3064ee8d5a493282c24
\ No newline at end of file diff --git a/db/schema_migrations/20230419094535 b/db/schema_migrations/20230419094535 new file mode 100644 index 00000000000..7df3afa8a17 --- /dev/null +++ b/db/schema_migrations/20230419094535 @@ -0,0 +1 @@ +09e9e754b83635abe717fa686b13488f965ae9678f74e0a47e802941d3501d5a
\ No newline at end of file diff --git a/db/schema_migrations/20230419094939 b/db/schema_migrations/20230419094939 new file mode 100644 index 00000000000..643e94129a2 --- /dev/null +++ b/db/schema_migrations/20230419094939 @@ -0,0 +1 @@ +a0e01b39610c5c307e34a5215ce4aa47a24fc0f5cff62ebef13172ef6761198b
\ No newline at end of file diff --git a/db/schema_migrations/20230419105225 b/db/schema_migrations/20230419105225 new file mode 100644 index 00000000000..96eaf04f7be --- /dev/null +++ b/db/schema_migrations/20230419105225 @@ -0,0 +1 @@ +c8e606b6e85bee317017cb15bd9d4249378b4d2b9225fb493e85086063f0f23d
\ No newline at end of file diff --git a/db/schema_migrations/20230419121943 b/db/schema_migrations/20230419121943 new file mode 100644 index 00000000000..255098a5411 --- /dev/null +++ b/db/schema_migrations/20230419121943 @@ -0,0 +1 @@ +101dac198ed6204b5b74f809765d2a7f1907907fdfcfbe579989b8fcf61610c0
\ No newline at end of file diff --git a/db/schema_migrations/20230419130952 b/db/schema_migrations/20230419130952 new file mode 100644 index 00000000000..fe1a371aad9 --- /dev/null +++ b/db/schema_migrations/20230419130952 @@ -0,0 +1 @@ +1172667d682c57cae72696030f3e5f58a57f5c71244190785a02c07e065173c6
\ No newline at end of file diff --git a/db/schema_migrations/20230419164438 b/db/schema_migrations/20230419164438 new file mode 100644 index 00000000000..56881cd904a --- /dev/null +++ b/db/schema_migrations/20230419164438 @@ -0,0 +1 @@ +859bc13b517efd3020d6192486e94fd9430387872fb01df77e43551c2a691fe6
\ No newline at end of file diff --git a/db/schema_migrations/20230419192748 b/db/schema_migrations/20230419192748 new file mode 100644 index 00000000000..4cf603ce39c --- /dev/null +++ b/db/schema_migrations/20230419192748 @@ -0,0 +1 @@ +732417f422b8f73df9e7a56ce7690ba8cc6a87b5e773fa356a0a50ed72dcace2
\ No newline at end of file diff --git a/db/schema_migrations/20230419193807 b/db/schema_migrations/20230419193807 new file mode 100644 index 00000000000..180d5b0d147 --- /dev/null +++ b/db/schema_migrations/20230419193807 @@ -0,0 +1 @@ +26904715659fd8d5bf3bf912781c9ae1cb61e8c990b46f12228aabdeb4f26ce7
\ No newline at end of file diff --git a/db/schema_migrations/20230420002547 b/db/schema_migrations/20230420002547 new file mode 100644 index 00000000000..3631fb2e72d --- /dev/null +++ b/db/schema_migrations/20230420002547 @@ -0,0 +1 @@ +a2f9f863a50f908e67e35f2b3f73ba7b228ed74ea0efe67425bd9c266c94a84c
\ No newline at end of file diff --git a/db/schema_migrations/20230420005610 b/db/schema_migrations/20230420005610 new file mode 100644 index 00000000000..c78a155b95e --- /dev/null +++ b/db/schema_migrations/20230420005610 @@ -0,0 +1 @@ +0600ca21c065ed0ec4a9bf8904fce64b7901d5f3960ebd1d7e50833d6024d71f
\ No newline at end of file diff --git a/db/schema_migrations/20230420005930 b/db/schema_migrations/20230420005930 new file mode 100644 index 00000000000..ec88e4ad94a --- /dev/null +++ b/db/schema_migrations/20230420005930 @@ -0,0 +1 @@ +bfb2f8193f033172d8cbc7edd046d5921fb2c3a5992b00b451f495ad90c60325
\ No newline at end of file diff --git a/db/schema_migrations/20230420012220 b/db/schema_migrations/20230420012220 new file mode 100644 index 00000000000..56a78b90585 --- /dev/null +++ b/db/schema_migrations/20230420012220 @@ -0,0 +1 @@ +c6897ef9e8c57b2b0dc8c94c0b2b9311996528b8f88bbf9b6a955de5d5c5120f
\ No newline at end of file diff --git a/db/schema_migrations/20230420040912 b/db/schema_migrations/20230420040912 new file mode 100644 index 00000000000..ceda1cc651d --- /dev/null +++ b/db/schema_migrations/20230420040912 @@ -0,0 +1 @@ +5c83e4c7cb2a022b94b2ea6dd33d1fdb771e69b106c2643c21d454cd7c9c6caf
\ No newline at end of file diff --git a/db/schema_migrations/20230420041344 b/db/schema_migrations/20230420041344 new file mode 100644 index 00000000000..d172aa22c81 --- /dev/null +++ b/db/schema_migrations/20230420041344 @@ -0,0 +1 @@ +4097ee7ac8f0e017fee16b63d186fb1d132128c5f12e948c197933a9cd5e4e20
\ No newline at end of file diff --git a/db/schema_migrations/20230420065656 b/db/schema_migrations/20230420065656 new file mode 100644 index 00000000000..dd89c9e19e3 --- /dev/null +++ b/db/schema_migrations/20230420065656 @@ -0,0 +1 @@ +e29be6311d828a76c594cf350d5212fac9913362dd3e9b96fda6f74c50edfcdb
\ No newline at end of file diff --git a/db/schema_migrations/20230420070009 b/db/schema_migrations/20230420070009 new file mode 100644 index 00000000000..7dfad0f6dee --- /dev/null +++ b/db/schema_migrations/20230420070009 @@ -0,0 +1 @@ +74b9c628c09856c3285452be85a853103e7b7860d1e33df664bdcae927f690d1
\ No newline at end of file diff --git a/db/schema_migrations/20230420115733 b/db/schema_migrations/20230420115733 new file mode 100644 index 00000000000..cac0ef60f61 --- /dev/null +++ b/db/schema_migrations/20230420115733 @@ -0,0 +1 @@ +d59b8bdea46ede31ff3d66d5aa18f4efb3afc216b13392b27214d7b609695da8
\ No newline at end of file diff --git a/db/schema_migrations/20230420120431 b/db/schema_migrations/20230420120431 new file mode 100644 index 00000000000..d3c041ba0e3 --- /dev/null +++ b/db/schema_migrations/20230420120431 @@ -0,0 +1 @@ +33961f47238c49d09b748df67c89f9069db10e90e598ea1c0da3dd99bc6dc427
\ No newline at end of file diff --git a/db/schema_migrations/20230420131608 b/db/schema_migrations/20230420131608 new file mode 100644 index 00000000000..0219d0a5960 --- /dev/null +++ b/db/schema_migrations/20230420131608 @@ -0,0 +1 @@ +91967e2d402dba78ae04cdfe27b0ad68e582b8daf23dd252ee8087f82ad3f39f
\ No newline at end of file diff --git a/db/schema_migrations/20230420132910 b/db/schema_migrations/20230420132910 new file mode 100644 index 00000000000..8b2e9e1f127 --- /dev/null +++ b/db/schema_migrations/20230420132910 @@ -0,0 +1 @@ +41063f964b7dfe641b0123e8c73277fca518ebf833d5301465df5b584ba73042
\ No newline at end of file diff --git a/db/schema_migrations/20230420144418 b/db/schema_migrations/20230420144418 new file mode 100644 index 00000000000..77795e4c831 --- /dev/null +++ b/db/schema_migrations/20230420144418 @@ -0,0 +1 @@ +a9dd9e623e54ddf68711f5c22f0480f39b5b433a87d0d3232bad02530d80e8af
\ No newline at end of file diff --git a/db/schema_migrations/20230421035557 b/db/schema_migrations/20230421035557 new file mode 100644 index 00000000000..5e4f51509be --- /dev/null +++ b/db/schema_migrations/20230421035557 @@ -0,0 +1 @@ +d685a5657a16728099225cb8f1545e09b317dc1608521d5df1272160cce46ddc
\ No newline at end of file diff --git a/db/schema_migrations/20230421081907 b/db/schema_migrations/20230421081907 new file mode 100644 index 00000000000..19e2fb92fb1 --- /dev/null +++ b/db/schema_migrations/20230421081907 @@ -0,0 +1 @@ +4291223fe8e407a9273db25c92e951bd1996382285d6ba9ce41f311d87ebfffa
\ No newline at end of file diff --git a/db/schema_migrations/20230421124302 b/db/schema_migrations/20230421124302 new file mode 100644 index 00000000000..0cbe24b1e6d --- /dev/null +++ b/db/schema_migrations/20230421124302 @@ -0,0 +1 @@ +3d8630d52fa7998ffd4775d0e070e778c8317416b241fd6a5149188ca7d2ff35
\ No newline at end of file diff --git a/db/schema_migrations/20230421165020 b/db/schema_migrations/20230421165020 new file mode 100644 index 00000000000..a1121e3f83d --- /dev/null +++ b/db/schema_migrations/20230421165020 @@ -0,0 +1 @@ +1e33e8da1f2f10f976e19bcf234f7ac5bdcc0eed7d60288ead2eaf87dfd678c9
\ No newline at end of file diff --git a/db/schema_migrations/20230422013640 b/db/schema_migrations/20230422013640 new file mode 100644 index 00000000000..7a26cccb409 --- /dev/null +++ b/db/schema_migrations/20230422013640 @@ -0,0 +1 @@ +4bc5d5e45c6624f0931a45e2515219bd0a89a16eb55e87763366954dec214e46
\ No newline at end of file diff --git a/db/schema_migrations/20230424094117 b/db/schema_migrations/20230424094117 new file mode 100644 index 00000000000..3e0002ddd6b --- /dev/null +++ b/db/schema_migrations/20230424094117 @@ -0,0 +1 @@ +e69855d9b788edb799158a839917e5320461891be3a0bd1799e46827e36bdaab
\ No newline at end of file diff --git a/db/schema_migrations/20230424122236 b/db/schema_migrations/20230424122236 new file mode 100644 index 00000000000..122f038a27e --- /dev/null +++ b/db/schema_migrations/20230424122236 @@ -0,0 +1 @@ +4939508a43fee149f5d424cdd0e8487f81aa8b7e4c09b74ad78787177686f8fe
\ No newline at end of file diff --git a/db/schema_migrations/20230424131551 b/db/schema_migrations/20230424131551 new file mode 100644 index 00000000000..c3a97cd5eea --- /dev/null +++ b/db/schema_migrations/20230424131551 @@ -0,0 +1 @@ +e6c9d240ceb8ec7f86485cee6b92a5cea2707bf94f8d4264c5bafd7fb812173b
\ No newline at end of file diff --git a/db/schema_migrations/20230424155321 b/db/schema_migrations/20230424155321 new file mode 100644 index 00000000000..0d8b21d4a4b --- /dev/null +++ b/db/schema_migrations/20230424155321 @@ -0,0 +1 @@ +0a043de128c0a756f9f6028fb255b775ca854fb15222d04de7d7a99299b6b099
\ No newline at end of file diff --git a/db/schema_migrations/20230424194721 b/db/schema_migrations/20230424194721 new file mode 100644 index 00000000000..da92827dfd6 --- /dev/null +++ b/db/schema_migrations/20230424194721 @@ -0,0 +1 @@ +c400976f894b3d451bbf1a58e57f376cd86916680bb10623217b851a593cd4ea
\ No newline at end of file diff --git a/db/schema_migrations/20230425101542 b/db/schema_migrations/20230425101542 new file mode 100644 index 00000000000..9f98cee6b3e --- /dev/null +++ b/db/schema_migrations/20230425101542 @@ -0,0 +1 @@ +ddc00d954a8398cc7c7206fc866418c55f6066abc229e8d26892cf316ae4a219
\ No newline at end of file diff --git a/db/schema_migrations/20230425114355 b/db/schema_migrations/20230425114355 new file mode 100644 index 00000000000..79290404d4f --- /dev/null +++ b/db/schema_migrations/20230425114355 @@ -0,0 +1 @@ +09de9c1e164024589169853cf4ddadb95bd69dd08f5e84a836579deead2c599c
\ No newline at end of file diff --git a/db/schema_migrations/20230425173111 b/db/schema_migrations/20230425173111 new file mode 100644 index 00000000000..d1b86236552 --- /dev/null +++ b/db/schema_migrations/20230425173111 @@ -0,0 +1 @@ +b1f6b1bbfdc4f2f5df1b360fdfbeffc99ca024d65a55c2a2d2fcebe1fdc90cfb
\ No newline at end of file diff --git a/db/schema_migrations/20230425521418 b/db/schema_migrations/20230425521418 new file mode 100644 index 00000000000..52d053b6b23 --- /dev/null +++ b/db/schema_migrations/20230425521418 @@ -0,0 +1 @@ +251e091be6b704a3bcb43d2c9a0b4123dd2ba2f9166161c1fdbe7e7ab3edc57f
\ No newline at end of file diff --git a/db/schema_migrations/20230426102200 b/db/schema_migrations/20230426102200 new file mode 100644 index 00000000000..c0f31f015e1 --- /dev/null +++ b/db/schema_migrations/20230426102200 @@ -0,0 +1 @@ +81b99d212b01381866430868137e2e6a4abcb525a2be59849b2f3edd62d595b2
\ No newline at end of file diff --git a/db/schema_migrations/20230426161259 b/db/schema_migrations/20230426161259 new file mode 100644 index 00000000000..15cf2ef65f4 --- /dev/null +++ b/db/schema_migrations/20230426161259 @@ -0,0 +1 @@ +176d8f13dc7743305a0637248aeb128e65d223d546a330869102c9d3c1714541
\ No newline at end of file diff --git a/db/schema_migrations/20230426161341 b/db/schema_migrations/20230426161341 new file mode 100644 index 00000000000..07b903c06e9 --- /dev/null +++ b/db/schema_migrations/20230426161341 @@ -0,0 +1 @@ +9c9634937e59a27f4f3e48da2d4dc6964dee50d1b043cc9d668ec5934e7b6fff
\ No newline at end of file diff --git a/db/schema_migrations/20230427065641 b/db/schema_migrations/20230427065641 new file mode 100644 index 00000000000..4a202ea0bc7 --- /dev/null +++ b/db/schema_migrations/20230427065641 @@ -0,0 +1 @@ +69f768f9b0eed0f81e206b819f403b3d3b9b2f16d415fcfbb4d9eafc920b55d6
\ No newline at end of file diff --git a/db/schema_migrations/20230427065942 b/db/schema_migrations/20230427065942 new file mode 100644 index 00000000000..6bb8571c4f4 --- /dev/null +++ b/db/schema_migrations/20230427065942 @@ -0,0 +1 @@ +88617cc027cd260d56db9d2c44724e4ffba0b01604cb1c444ee9af2e36919cc8
\ No newline at end of file diff --git a/db/schema_migrations/20230427094534 b/db/schema_migrations/20230427094534 new file mode 100644 index 00000000000..344a7f476bc --- /dev/null +++ b/db/schema_migrations/20230427094534 @@ -0,0 +1 @@ +53c1bc1774ad4d570538e5486640e9d5beef87baf0301ba89ddfca019745ac2e
\ No newline at end of file diff --git a/db/schema_migrations/20230427190005 b/db/schema_migrations/20230427190005 new file mode 100644 index 00000000000..514c2c9071d --- /dev/null +++ b/db/schema_migrations/20230427190005 @@ -0,0 +1 @@ +b704051dd0fd69f22a1f33739fd8d969acd0c56e4b56c8711daf10a735bc2027
\ No newline at end of file diff --git a/db/schema_migrations/20230427194552 b/db/schema_migrations/20230427194552 new file mode 100644 index 00000000000..10d4b9e687e --- /dev/null +++ b/db/schema_migrations/20230427194552 @@ -0,0 +1 @@ +e0b4dc1848c0d4c5880366861b9806f98747d5bcddc270c14c7757c4d5398819
\ No newline at end of file diff --git a/db/schema_migrations/20230428065426 b/db/schema_migrations/20230428065426 new file mode 100644 index 00000000000..b8f0198a807 --- /dev/null +++ b/db/schema_migrations/20230428065426 @@ -0,0 +1 @@ +09efd0a8f9ffc13961dc55313883553e545235184435483ccf8f91986f3ead79
\ No newline at end of file diff --git a/db/schema_migrations/20230428085332 b/db/schema_migrations/20230428085332 new file mode 100644 index 00000000000..8ad6c10ada2 --- /dev/null +++ b/db/schema_migrations/20230428085332 @@ -0,0 +1 @@ +9e822fbc2c7ce8044d0b38c5f1a9056431792e83fc9ed83056444c094e16c484
\ No newline at end of file diff --git a/db/schema_migrations/20230428101217 b/db/schema_migrations/20230428101217 new file mode 100644 index 00000000000..9e22a997a41 --- /dev/null +++ b/db/schema_migrations/20230428101217 @@ -0,0 +1 @@ +600258b230518791e57a8a9934d573dcc4734275c346b1dbcff6931d1d549574
\ No newline at end of file diff --git a/db/schema_migrations/20230428134334 b/db/schema_migrations/20230428134334 new file mode 100644 index 00000000000..96e5841736f --- /dev/null +++ b/db/schema_migrations/20230428134334 @@ -0,0 +1 @@ +43d27869d87ec93da96fbc9ea23f50b7588d5f491b1d5c53beeed7a529003e09
\ No newline at end of file diff --git a/db/schema_migrations/20230501090213 b/db/schema_migrations/20230501090213 new file mode 100644 index 00000000000..64147bd9018 --- /dev/null +++ b/db/schema_migrations/20230501090213 @@ -0,0 +1 @@ +99b301394b83a9260da47d2bb56356f2421fcb7d8cf0600f56af13f5f57ab127
\ No newline at end of file diff --git a/db/schema_migrations/20230501094322 b/db/schema_migrations/20230501094322 new file mode 100644 index 00000000000..4369f8e90d5 --- /dev/null +++ b/db/schema_migrations/20230501094322 @@ -0,0 +1 @@ +083992ccf9c36826383d36d6b72b3188d48892191179e2fcd9b434e49f86bc9d
\ No newline at end of file diff --git a/db/schema_migrations/20230501111636 b/db/schema_migrations/20230501111636 new file mode 100644 index 00000000000..77570c78964 --- /dev/null +++ b/db/schema_migrations/20230501111636 @@ -0,0 +1 @@ +1ba16001c05873a7fbda732d0d34b1d42d8c05d883f2f48b37305c31b955b103
\ No newline at end of file diff --git a/db/schema_migrations/20230501163253 b/db/schema_migrations/20230501163253 new file mode 100644 index 00000000000..e0f178a65a7 --- /dev/null +++ b/db/schema_migrations/20230501163253 @@ -0,0 +1 @@ +e13f88c8de95d10e1150b07e6d112aaa9221e0a866fce3f92883cec9ee026acd
\ No newline at end of file diff --git a/db/schema_migrations/20230501165244 b/db/schema_migrations/20230501165244 new file mode 100644 index 00000000000..df068bbd3fd --- /dev/null +++ b/db/schema_migrations/20230501165244 @@ -0,0 +1 @@ +8d1f891b30ff45432ae9dff5d97d6d241dd98c168f4b5fe6db6637bf93dd18e3
\ No newline at end of file diff --git a/db/schema_migrations/20230501180958 b/db/schema_migrations/20230501180958 new file mode 100644 index 00000000000..f7d05a866c6 --- /dev/null +++ b/db/schema_migrations/20230501180958 @@ -0,0 +1 @@ +cf1a6d7a46b0166fea848ed823c0cfcfaeeff66ccbc3f85207a949fbc9eb7660
\ No newline at end of file diff --git a/db/schema_migrations/20230502014227 b/db/schema_migrations/20230502014227 new file mode 100644 index 00000000000..a5ed25b30de --- /dev/null +++ b/db/schema_migrations/20230502014227 @@ -0,0 +1 @@ +d1948970874f890d178db6b1df9053bf5bb45d701c8c295e1e8e3d7d6b4d175d
\ No newline at end of file diff --git a/db/schema_migrations/20230502083003 b/db/schema_migrations/20230502083003 new file mode 100644 index 00000000000..6bc23ce73ca --- /dev/null +++ b/db/schema_migrations/20230502083003 @@ -0,0 +1 @@ +fabae67014e7d212e2537185c2cd21a0660398d8e423a3b4744773eb67047b57
\ No newline at end of file diff --git a/db/schema_migrations/20230502102832 b/db/schema_migrations/20230502102832 new file mode 100644 index 00000000000..f82a528e5e3 --- /dev/null +++ b/db/schema_migrations/20230502102832 @@ -0,0 +1 @@ +7543d5128ef49f1c169e30db24015cd1deae271ed20be29d34e67e6cc4ece372
\ No newline at end of file diff --git a/db/schema_migrations/20230502120021 b/db/schema_migrations/20230502120021 new file mode 100644 index 00000000000..13d84b077b1 --- /dev/null +++ b/db/schema_migrations/20230502120021 @@ -0,0 +1 @@ +9602256dc3cea8f0fce716ba341e364ac51e592ff6f71e51c230be2896bcfd49
\ No newline at end of file diff --git a/db/schema_migrations/20230502134532 b/db/schema_migrations/20230502134532 new file mode 100644 index 00000000000..3fddcce3f7f --- /dev/null +++ b/db/schema_migrations/20230502134532 @@ -0,0 +1 @@ +6ba72f7fa8d90e6cf5f880b950c52e3643eb6d72672e66df71d0879957704a07
\ No newline at end of file diff --git a/db/schema_migrations/20230502182754 b/db/schema_migrations/20230502182754 new file mode 100644 index 00000000000..22361f8dfd7 --- /dev/null +++ b/db/schema_migrations/20230502182754 @@ -0,0 +1 @@ +95333c4b6b7169a457c425369b2e4ce22cb2a355af5adc218d3b743ffba4b9b5
\ No newline at end of file diff --git a/db/schema_migrations/20230502193525 b/db/schema_migrations/20230502193525 new file mode 100644 index 00000000000..a6b4bae1888 --- /dev/null +++ b/db/schema_migrations/20230502193525 @@ -0,0 +1 @@ +cf43d34ef75776417d3f0ef73e79fb71735d3ce8323082a63c9f7feb1a95ba06
\ No newline at end of file diff --git a/db/schema_migrations/20230502201251 b/db/schema_migrations/20230502201251 new file mode 100644 index 00000000000..7acaa004549 --- /dev/null +++ b/db/schema_migrations/20230502201251 @@ -0,0 +1 @@ +55c34b57a1cfdc706c7e8ab53cb964011b81fce313404d0da91a9d0495ee1fd8
\ No newline at end of file diff --git a/db/schema_migrations/20230503032750 b/db/schema_migrations/20230503032750 new file mode 100644 index 00000000000..fd4a7dff047 --- /dev/null +++ b/db/schema_migrations/20230503032750 @@ -0,0 +1 @@ +1d8dc513156e6fcdfdd8670eb92c67fc261135527398310a089b8d6c5d70c213
\ No newline at end of file diff --git a/db/schema_migrations/20230503100753 b/db/schema_migrations/20230503100753 new file mode 100644 index 00000000000..9dfc04b52ae --- /dev/null +++ b/db/schema_migrations/20230503100753 @@ -0,0 +1 @@ +2db1e083151334d1f53d3da97c66a5f9995997a1e9556bb7acd54122b6f765f6
\ No newline at end of file diff --git a/db/schema_migrations/20230503115918 b/db/schema_migrations/20230503115918 new file mode 100644 index 00000000000..328d5e5b255 --- /dev/null +++ b/db/schema_migrations/20230503115918 @@ -0,0 +1 @@ +e5368a0d203bdf66e8808b2c1555ba4321a41755af09ec899e28f1ea8d6e02a7
\ No newline at end of file diff --git a/db/schema_migrations/20230503152349 b/db/schema_migrations/20230503152349 new file mode 100644 index 00000000000..b53f7e1da28 --- /dev/null +++ b/db/schema_migrations/20230503152349 @@ -0,0 +1 @@ +1cda8d54c964870fd0660dc864e39ef31c0a91994a275b7478d615141670b693
\ No newline at end of file diff --git a/db/schema_migrations/20230503173101 b/db/schema_migrations/20230503173101 new file mode 100644 index 00000000000..9f327e25050 --- /dev/null +++ b/db/schema_migrations/20230503173101 @@ -0,0 +1 @@ +d30a71027d3b43e5545772d42bd68b9f7b8699787aaab7f35cd1a58603288cda
\ No newline at end of file diff --git a/db/schema_migrations/20230503175406 b/db/schema_migrations/20230503175406 new file mode 100644 index 00000000000..3519271d627 --- /dev/null +++ b/db/schema_migrations/20230503175406 @@ -0,0 +1 @@ +f239e2946d97b25d7f365d0cdf439be300f4b1bbc39e089abc8e8342a32679ed
\ No newline at end of file diff --git a/db/schema_migrations/20230503181808 b/db/schema_migrations/20230503181808 new file mode 100644 index 00000000000..e6d4423bc86 --- /dev/null +++ b/db/schema_migrations/20230503181808 @@ -0,0 +1 @@ +59423550699ab55d8bd2439c423c113d6f66d2cfcea2e606ffad92e00ae555de
\ No newline at end of file diff --git a/db/schema_migrations/20230503191056 b/db/schema_migrations/20230503191056 new file mode 100644 index 00000000000..d274119287c --- /dev/null +++ b/db/schema_migrations/20230503191056 @@ -0,0 +1 @@ +0421519d9d454666fd00f3d8e6c2c48e889239a6975a52de7aefe19f48ea994f
\ No newline at end of file diff --git a/db/schema_migrations/20230504010535 b/db/schema_migrations/20230504010535 new file mode 100644 index 00000000000..77617d38e85 --- /dev/null +++ b/db/schema_migrations/20230504010535 @@ -0,0 +1 @@ +68d1cbddace4f53fe437d234f9a9eac2264c88ef4a34353abc11bbbbdccc63c3
\ No newline at end of file diff --git a/db/schema_migrations/20230504084524 b/db/schema_migrations/20230504084524 new file mode 100644 index 00000000000..00d15c6398c --- /dev/null +++ b/db/schema_migrations/20230504084524 @@ -0,0 +1 @@ +f9022593be2e4304e2a0bc34410284ba3543211d2e3faa6fa7b7ba8cd703ffb4
\ No newline at end of file diff --git a/db/schema_migrations/20230504112809 b/db/schema_migrations/20230504112809 new file mode 100644 index 00000000000..cdf2abc6d7b --- /dev/null +++ b/db/schema_migrations/20230504112809 @@ -0,0 +1 @@ +73e02a60ed38365748c54399ccdd7ccfdfaac901682e84c1f52b113b30f682e6
\ No newline at end of file diff --git a/db/schema_migrations/20230505122015 b/db/schema_migrations/20230505122015 new file mode 100644 index 00000000000..d08efd284c0 --- /dev/null +++ b/db/schema_migrations/20230505122015 @@ -0,0 +1 @@ +703e964d90c3758f26ca852b6ca4b62319a1fe30e41cd4cf87f128aef5bf0360
\ No newline at end of file diff --git a/db/schema_migrations/20230507192028 b/db/schema_migrations/20230507192028 new file mode 100644 index 00000000000..f6e1ec5c167 --- /dev/null +++ b/db/schema_migrations/20230507192028 @@ -0,0 +1 @@ +f248bac33290d490c88e79445a7600cb120761e3a8ee73e9e6ceb46d934399f2
\ No newline at end of file diff --git a/db/schema_migrations/20230508034422 b/db/schema_migrations/20230508034422 new file mode 100644 index 00000000000..e4bce1f0681 --- /dev/null +++ b/db/schema_migrations/20230508034422 @@ -0,0 +1 @@ +22359f0d7c7f08f2293a0302c36854e78cd6fdf51a555ed36303f56bfc6ee914
\ No newline at end of file diff --git a/db/schema_migrations/20230508074515 b/db/schema_migrations/20230508074515 new file mode 100644 index 00000000000..f62368fbba6 --- /dev/null +++ b/db/schema_migrations/20230508074515 @@ -0,0 +1 @@ +7f3a70214dc73e754311019b208284cd2784ca4331458a98ec109e50598e7900
\ No newline at end of file diff --git a/db/schema_migrations/20230508093910 b/db/schema_migrations/20230508093910 new file mode 100644 index 00000000000..d9b056e68f9 --- /dev/null +++ b/db/schema_migrations/20230508093910 @@ -0,0 +1 @@ +1e0b966332d5094050ea779ba6efefaa5c0c2a7d9f2ec05a1fa8a049bd6fcd84
\ No newline at end of file diff --git a/db/schema_migrations/20230508150219 b/db/schema_migrations/20230508150219 new file mode 100644 index 00000000000..79146f5188a --- /dev/null +++ b/db/schema_migrations/20230508150219 @@ -0,0 +1 @@ +02095a4b6238d84d569162ea6ad90d1f02975234a40174e4ca5a9d80524de57c
\ No newline at end of file diff --git a/db/schema_migrations/20230508175057 b/db/schema_migrations/20230508175057 new file mode 100644 index 00000000000..959c02b49c8 --- /dev/null +++ b/db/schema_migrations/20230508175057 @@ -0,0 +1 @@ +eaec908173fb60b88867e14c73c6ba7d6079742bae7ead59fa021d6d57e622da
\ No newline at end of file diff --git a/db/schema_migrations/20230509072635 b/db/schema_migrations/20230509072635 new file mode 100644 index 00000000000..9eec8162720 --- /dev/null +++ b/db/schema_migrations/20230509072635 @@ -0,0 +1 @@ +1e5bbc3b9d8c244a78e98c60c1f24c3295738334125b8d2b566d97742aee5a97
\ No newline at end of file diff --git a/db/schema_migrations/20230509085428 b/db/schema_migrations/20230509085428 new file mode 100644 index 00000000000..cf7214ceadc --- /dev/null +++ b/db/schema_migrations/20230509085428 @@ -0,0 +1 @@ +6179fe3d8c419c58e028fc1fe5d554678976229eff88f087beec174cb669d4ce
\ No newline at end of file diff --git a/db/schema_migrations/20230509115525 b/db/schema_migrations/20230509115525 new file mode 100644 index 00000000000..e3c0ada40cd --- /dev/null +++ b/db/schema_migrations/20230509115525 @@ -0,0 +1 @@ +92b70129d19796653569fb730be43ea6eed7dacbce224e1323124fdf03b0a0b0
\ No newline at end of file diff --git a/db/schema_migrations/20230509131736 b/db/schema_migrations/20230509131736 new file mode 100644 index 00000000000..593c9495eb2 --- /dev/null +++ b/db/schema_migrations/20230509131736 @@ -0,0 +1 @@ +f9545a27756e5ca05220ffebcf89e8268e0231cbd8c7af0a89d13c70f5a070ec
\ No newline at end of file diff --git a/db/schema_migrations/20230509144234 b/db/schema_migrations/20230509144234 new file mode 100644 index 00000000000..0116d971e38 --- /dev/null +++ b/db/schema_migrations/20230509144234 @@ -0,0 +1 @@ +8c6d6a8d77dac3291f8af00e61c5ce0124c0742d0009f84b0d5bab7b43024bbe
\ No newline at end of file diff --git a/db/schema_migrations/20230510062503 b/db/schema_migrations/20230510062503 new file mode 100644 index 00000000000..f6be2a73392 --- /dev/null +++ b/db/schema_migrations/20230510062503 @@ -0,0 +1 @@ +2bd476bf0389b70aa5736ff69023993d37d54c4d333e3a91de9e57370935d6ec
\ No newline at end of file diff --git a/db/schema_migrations/20230510130050 b/db/schema_migrations/20230510130050 new file mode 100644 index 00000000000..3f5f91eb7be --- /dev/null +++ b/db/schema_migrations/20230510130050 @@ -0,0 +1 @@ +0b487a9ef3407ae8e3f9e2a9b0e7ac2a125048b4ea91ec1bd2ef46ce0508620b
\ No newline at end of file diff --git a/db/schema_migrations/20230512023321 b/db/schema_migrations/20230512023321 new file mode 100644 index 00000000000..ad6c781e164 --- /dev/null +++ b/db/schema_migrations/20230512023321 @@ -0,0 +1 @@ +f2461838b62f7449f6b436c259724cb14b1ad5cd29cbff6f9e80e8b9e6f38984
\ No newline at end of file diff --git a/db/schema_migrations/20230515111314 b/db/schema_migrations/20230515111314 new file mode 100644 index 00000000000..d2d7d2c94c4 --- /dev/null +++ b/db/schema_migrations/20230515111314 @@ -0,0 +1 @@ +2a011d12459e0c21832df777569a12f4f2bbdaa5f57da7dc3823147f948d7772
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index c277291e823..8dea1331b6e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -68,6 +68,7 @@ DECLARE resolved_on_default_branch boolean; present_on_default_branch boolean; namespace_id bigint; + has_issues boolean; BEGIN IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN RETURN NULL; @@ -82,7 +83,7 @@ BEGIN INTO severity, state, report_type, resolved_on_default_branch, present_on_default_branch FROM - vulnerabilities + vulnerabilities WHERE vulnerabilities.id = NEW.vulnerability_id; @@ -99,8 +100,13 @@ BEGIN WHERE projects.id = NEW.project_id; - INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id) - VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint)) + SELECT + EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.vulnerability_id) + INTO + has_issues; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) + VALUES (NEW.vulnerability_id, namespace_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id', CAST(NEW.location->'kubernetes_resource'->>'agent_id' AS bigint), has_issues) ON CONFLICT(vulnerability_id) DO NOTHING; RETURN NULL; END @@ -127,6 +133,7 @@ DECLARE cluster_agent_id text; casted_cluster_agent_id bigint; namespace_id bigint; + has_issues boolean; BEGIN SELECT v_o.scanner_id, v_o.uuid, v_o.location->>'image', v_o.location->'kubernetes_resource'->>'agent_id', CAST(v_o.location->'kubernetes_resource'->>'agent_id' AS bigint), projects.namespace_id @@ -139,8 +146,13 @@ BEGIN v_o.vulnerability_id = NEW.id LIMIT 1; - INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id) - VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id) + SELECT + EXISTS (SELECT 1 FROM vulnerability_issue_links WHERE vulnerability_issue_links.vulnerability_id = NEW.id) + INTO + has_issues; + + INSERT INTO vulnerability_reads (vulnerability_id, namespace_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) + VALUES (NEW.id, namespace_id, NEW.project_id, scanner_id, NEW.report_type, NEW.severity, NEW.state, NEW.resolved_on_default_branch, uuid::uuid, location_image, cluster_agent_id, casted_cluster_agent_id, has_issues) ON CONFLICT(vulnerability_id) DO NOTHING; RETURN NULL; END @@ -225,7 +237,7 @@ RETURN NULL; END $$; -CREATE FUNCTION trigger_080e73845bfd() RETURNS trigger +CREATE FUNCTION trigger_023e82d8e257() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN @@ -234,16 +246,16 @@ BEGIN END; $$; -CREATE FUNCTION trigger_0e214b8a14f2() RETURNS trigger +CREATE FUNCTION trigger_080e73845bfd() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."note_id_convert_to_bigint" := NEW."note_id"; + NEW."id_convert_to_bigint" := NEW."id"; RETURN NEW; END; $$; -CREATE FUNCTION trigger_17c3a95ee58a() RETURNS trigger +CREATE FUNCTION trigger_0e214b8a14f2() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN @@ -252,20 +264,20 @@ BEGIN END; $$; -CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger +CREATE FUNCTION trigger_17c3a95ee58a() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."uuid_convert_string_to_uuid" := NEW."uuid"; + NEW."note_id_convert_to_bigint" := NEW."note_id"; RETURN NEW; END; $$; -CREATE FUNCTION trigger_3207b8d0d6f3() RETURNS trigger +CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."id_convert_to_bigint" := NEW."id"; + NEW."uuid_convert_string_to_uuid" := NEW."uuid"; RETURN NEW; END; $$; @@ -306,7 +318,16 @@ BEGIN END; $$; -CREATE FUNCTION trigger_7f4fcd5aa322() RETURNS trigger +CREATE FUNCTION trigger_909cf0a06094() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."awardable_id_convert_to_bigint" := NEW."awardable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_b2d852e1e2cb() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN @@ -351,11 +372,11 @@ BEGIN END; $$; -CREATE FUNCTION trigger_c7107f30d69d() RETURNS trigger +CREATE FUNCTION trigger_cd1aeb22b34a() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."id_convert_to_bigint" := NEW."id"; + NEW."target_id_convert_to_bigint" := NEW."target_id"; RETURN NEW; END; $$; @@ -543,6 +564,13 @@ CREATE TABLE batched_background_migration_job_transition_logs ( ) PARTITION BY RANGE (created_at); +CREATE TABLE p_ci_runner_machine_builds ( + partition_id bigint NOT NULL, + build_id bigint NOT NULL, + runner_machine_id bigint NOT NULL +) +PARTITION BY LIST (partition_id); + CREATE TABLE incident_management_pending_alert_escalations ( id bigint NOT NULL, rule_id bigint NOT NULL, @@ -593,6 +621,15 @@ CREATE TABLE security_findings ( ) PARTITION BY LIST (partition_number); +CREATE TABLE value_stream_dashboard_counts ( + id bigint NOT NULL, + namespace_id bigint NOT NULL, + count bigint NOT NULL, + recorded_at timestamp with time zone NOT NULL, + metric smallint NOT NULL +) +PARTITION BY RANGE (recorded_at); + CREATE TABLE verification_codes ( created_at timestamp with time zone DEFAULT now() NOT NULL, visitor_id_code text NOT NULL, @@ -10721,6 +10758,26 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_63 ( ); ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63 FOR VALUES WITH (modulus 64, remainder 63); +CREATE TABLE abuse_report_events ( + id bigint NOT NULL, + abuse_report_id bigint NOT NULL, + user_id bigint, + created_at timestamp with time zone NOT NULL, + action smallint DEFAULT 1 NOT NULL, + reason smallint, + comment text, + CONSTRAINT check_bb4cd85618 CHECK ((char_length(comment) <= 1024)) +); + +CREATE SEQUENCE abuse_report_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE abuse_report_events_id_seq OWNED BY abuse_report_events.id; + CREATE TABLE abuse_reports ( id integer NOT NULL, reporter_id integer, @@ -10733,7 +10790,11 @@ CREATE TABLE abuse_reports ( category smallint DEFAULT 1 NOT NULL, reported_from_url text DEFAULT ''::text NOT NULL, links_to_spam text[] DEFAULT '{}'::text[] NOT NULL, + status smallint DEFAULT 1 NOT NULL, + resolved_at timestamp with time zone, + screenshot text, CONSTRAINT abuse_reports_links_to_spam_length_check CHECK ((cardinality(links_to_spam) <= 20)), + CONSTRAINT check_4b0a5120e0 CHECK ((char_length(screenshot) <= 255)), CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512)) ); @@ -10746,6 +10807,26 @@ CREATE SEQUENCE abuse_reports_id_seq ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id; +CREATE TABLE abuse_trust_scores ( + id bigint NOT NULL, + user_id bigint, + score double precision NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + source smallint NOT NULL, + correlation_id_value text, + CONSTRAINT check_77ca9551db CHECK ((char_length(correlation_id_value) <= 32)) +); + +CREATE SEQUENCE abuse_trust_scores_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE abuse_trust_scores_id_seq OWNED BY abuse_trust_scores.id; + CREATE TABLE achievements ( id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -10754,7 +10835,6 @@ CREATE TABLE achievements ( name text NOT NULL, avatar text, description text, - revokeable boolean DEFAULT false NOT NULL, CONSTRAINT check_5171b03f22 CHECK ((char_length(name) <= 255)), CONSTRAINT check_a7a7b84a80 CHECK ((char_length(description) <= 1024)), CONSTRAINT check_e174e93a9e CHECK ((char_length(avatar) <= 255)) @@ -10825,31 +10905,37 @@ CREATE SEQUENCE agent_project_authorizations_id_seq ALTER SEQUENCE agent_project_authorizations_id_seq OWNED BY agent_project_authorizations.id; -CREATE TABLE airflow_dags ( +CREATE TABLE agent_user_access_group_authorizations ( + id bigint NOT NULL, + group_id bigint NOT NULL, + agent_id bigint NOT NULL, + config jsonb NOT NULL +); + +CREATE SEQUENCE agent_user_access_group_authorizations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE agent_user_access_group_authorizations_id_seq OWNED BY agent_user_access_group_authorizations.id; + +CREATE TABLE agent_user_access_project_authorizations ( 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)) + agent_id bigint NOT NULL, + config jsonb NOT NULL ); -CREATE SEQUENCE airflow_dags_id_seq +CREATE SEQUENCE agent_user_access_project_authorizations_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; +ALTER SEQUENCE agent_user_access_project_authorizations_id_seq OWNED BY agent_user_access_project_authorizations.id; CREATE TABLE alert_management_alert_assignees ( id bigint NOT NULL, @@ -11065,51 +11151,6 @@ CREATE SEQUENCE analytics_cycle_analytics_group_value_streams_id_seq ALTER SEQUENCE analytics_cycle_analytics_group_value_streams_id_seq OWNED BY analytics_cycle_analytics_group_value_streams.id; -CREATE TABLE analytics_cycle_analytics_project_stages ( - id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - relative_position integer, - start_event_identifier integer NOT NULL, - end_event_identifier integer NOT NULL, - project_id bigint NOT NULL, - start_event_label_id bigint, - end_event_label_id bigint, - 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, - 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 - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE analytics_cycle_analytics_project_stages_id_seq OWNED BY analytics_cycle_analytics_project_stages.id; - -CREATE TABLE analytics_cycle_analytics_project_value_streams ( - id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - project_id bigint NOT NULL, - name text NOT NULL, - CONSTRAINT check_9b1970a898 CHECK ((char_length(name) <= 100)) -); - -CREATE SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -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 @@ -11317,7 +11358,6 @@ CREATE TABLE application_settings ( metrics_packet_size integer DEFAULT 1, disabled_oauth_sign_in_sources text, health_check_access_token character varying, - send_user_confirmation_email boolean DEFAULT false, container_registry_token_expire_delay integer DEFAULT 5, after_sign_up_text text, user_default_external boolean DEFAULT false NOT NULL, @@ -11709,7 +11749,6 @@ CREATE TABLE application_settings ( encrypted_cube_api_key_iv bytea, jitsu_host text, jitsu_project_xid text, - clickhouse_connection_string text, jitsu_administrator_email text, encrypted_jitsu_administrator_password bytea, encrypted_jitsu_administrator_password_iv bytea, @@ -11741,6 +11780,7 @@ CREATE TABLE application_settings ( 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, + default_syntax_highlighting_theme integer DEFAULT 1 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, @@ -11751,6 +11791,46 @@ CREATE TABLE application_settings ( 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, + projects_api_rate_limit_unauthenticated integer DEFAULT 400 NOT NULL, + deny_all_requests_except_allowed boolean DEFAULT false NOT NULL, + product_analytics_data_collector_host text, + lock_memberships_to_saml boolean DEFAULT false NOT NULL, + gitlab_dedicated_instance boolean DEFAULT false NOT NULL, + update_runner_versions_enabled boolean DEFAULT true NOT NULL, + database_apdex_settings jsonb, + encrypted_openai_api_key bytea, + encrypted_openai_api_key_iv bytea, + database_max_running_batched_background_migrations integer DEFAULT 2 NOT NULL, + encrypted_product_analytics_configurator_connection_string bytea, + encrypted_product_analytics_configurator_connection_string_iv bytea, + silent_mode_enabled boolean DEFAULT false NOT NULL, + package_metadata_purl_types smallint[] DEFAULT '{}'::smallint[], + ci_max_includes integer DEFAULT 150 NOT NULL, + encrypted_tofa_credentials bytea, + encrypted_tofa_credentials_iv bytea, + encrypted_tofa_host bytea, + encrypted_tofa_host_iv bytea, + encrypted_tofa_url bytea, + encrypted_tofa_url_iv bytea, + encrypted_tofa_response_json_keys bytea, + encrypted_tofa_response_json_keys_iv bytea, + encrypted_tofa_request_json_keys bytea, + encrypted_tofa_request_json_keys_iv bytea, + encrypted_tofa_request_payload bytea, + encrypted_tofa_request_payload_iv bytea, + encrypted_tofa_client_library_class bytea, + encrypted_tofa_client_library_class_iv bytea, + encrypted_tofa_client_library_args bytea, + encrypted_tofa_client_library_args_iv bytea, + encrypted_tofa_client_library_create_credentials_method bytea, + encrypted_tofa_client_library_create_credentials_method_iv bytea, + encrypted_tofa_client_library_fetch_access_token_method bytea, + encrypted_tofa_client_library_fetch_access_token_method_iv bytea, + encrypted_tofa_access_token_expires_in bytea, + encrypted_tofa_access_token_expires_in_iv bytea, + remember_me_enabled boolean DEFAULT true NOT NULL, + encrypted_anthropic_api_key bytea, + encrypted_anthropic_api_key_iv bytea, 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)), @@ -11781,6 +11861,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_5bcba483c4 CHECK ((char_length(sentry_environment) <= 255)), CONSTRAINT check_718b4458ae CHECK ((char_length(personal_access_token_prefix) <= 20)), CONSTRAINT check_7227fad848 CHECK ((char_length(rate_limiting_response_text) <= 255)), + CONSTRAINT check_72c984b2a5 CHECK ((char_length(product_analytics_data_collector_host) <= 255)), CONSTRAINT check_734cc9407a CHECK ((char_length(globally_allowed_ips) <= 255)), CONSTRAINT check_7ccfe2764a CHECK ((char_length(arkose_labs_namespace) <= 255)), CONSTRAINT check_85a39b68ff CHECK ((char_length(encrypted_ci_jwt_signing_key_iv) <= 255)), @@ -11791,7 +11872,6 @@ CREATE TABLE application_settings ( 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)), CONSTRAINT check_dea8792229 CHECK ((char_length(jitsu_host) <= 255)), CONSTRAINT check_e2692d7523 CHECK ((char_length(default_preferred_language) <= 32)), @@ -12114,6 +12194,30 @@ CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq ALTER SEQUENCE audit_events_external_audit_event_destinations_id_seq OWNED BY audit_events_external_audit_event_destinations.id; +CREATE TABLE audit_events_google_cloud_logging_configurations ( + 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, + google_project_id_name text NOT NULL, + client_email text NOT NULL, + log_id_name text DEFAULT 'audit_events'::text, + encrypted_private_key bytea NOT NULL, + encrypted_private_key_iv bytea NOT NULL, + CONSTRAINT check_0ef835c61e CHECK ((char_length(client_email) <= 254)), + CONSTRAINT check_55783c7c19 CHECK ((char_length(google_project_id_name) <= 30)), + CONSTRAINT check_898a76b005 CHECK ((char_length(log_id_name) <= 511)) +); + +CREATE SEQUENCE audit_events_google_cloud_logging_configurations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_google_cloud_logging_configurations_id_seq OWNED BY audit_events_google_cloud_logging_configurations.id; + CREATE SEQUENCE audit_events_id_seq START WITH 1 INCREMENT BY 1 @@ -12123,6 +12227,25 @@ CREATE SEQUENCE audit_events_id_seq ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; +CREATE TABLE audit_events_instance_external_audit_event_destinations ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + destination_url text NOT NULL, + encrypted_verification_token bytea NOT NULL, + encrypted_verification_token_iv bytea NOT NULL, + CONSTRAINT check_4dc67167ce CHECK ((char_length(destination_url) <= 255)) +); + +CREATE SEQUENCE audit_events_instance_external_audit_event_destinations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_instance_external_audit_event_destinations_id_seq OWNED BY audit_events_instance_external_audit_event_destinations.id; + CREATE TABLE audit_events_streaming_event_type_filters ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -12209,10 +12332,11 @@ CREATE TABLE award_emoji ( id integer NOT NULL, name character varying, user_id integer, - awardable_id integer, + awardable_id_convert_to_bigint integer, awardable_type character varying, created_at timestamp without time zone, - updated_at timestamp without time zone + updated_at timestamp without time zone, + awardable_id bigint ); CREATE SEQUENCE award_emoji_id_seq @@ -12522,6 +12646,7 @@ CREATE TABLE boards_epic_boards ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, name text DEFAULT 'Development'::text NOT NULL, + display_colors boolean DEFAULT true NOT NULL, CONSTRAINT check_bcbbffe601 CHECK ((char_length(name) <= 255)) ); @@ -12626,6 +12751,28 @@ CREATE SEQUENCE broadcast_messages_id_seq ALTER SEQUENCE broadcast_messages_id_seq OWNED BY broadcast_messages.id; +CREATE TABLE bulk_import_batch_trackers ( + id bigint NOT NULL, + tracker_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + batch_number integer DEFAULT 0 NOT NULL, + fetched_objects_count integer DEFAULT 0 NOT NULL, + imported_objects_count integer DEFAULT 0 NOT NULL, + error text, + CONSTRAINT check_3d6963a51f CHECK ((char_length(error) <= 255)) +); + +CREATE SEQUENCE bulk_import_batch_trackers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_batch_trackers_id_seq OWNED BY bulk_import_batch_trackers.id; + CREATE TABLE bulk_import_configurations ( id bigint NOT NULL, bulk_import_id integer NOT NULL, @@ -12662,6 +12809,7 @@ CREATE TABLE bulk_import_entities ( updated_at timestamp with time zone NOT NULL, source_xid integer, migrate_projects boolean DEFAULT true NOT NULL, + has_failures boolean DEFAULT false, CONSTRAINT check_13f279f7da CHECK ((char_length(source_full_path) <= 255)), CONSTRAINT check_715d725ea2 CHECK ((char_length(destination_name) <= 255)), CONSTRAINT check_796a4d9cc6 CHECK ((char_length(jid) <= 255)), @@ -12677,11 +12825,33 @@ CREATE SEQUENCE bulk_import_entities_id_seq ALTER SEQUENCE bulk_import_entities_id_seq OWNED BY bulk_import_entities.id; +CREATE TABLE bulk_import_export_batches ( + id bigint NOT NULL, + export_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + batch_number integer DEFAULT 0 NOT NULL, + objects_count integer DEFAULT 0 NOT NULL, + error text, + CONSTRAINT check_046dc60dfe CHECK ((char_length(error) <= 255)) +); + +CREATE SEQUENCE bulk_import_export_batches_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_export_batches_id_seq OWNED BY bulk_import_export_batches.id; + CREATE TABLE bulk_import_export_uploads ( id bigint NOT NULL, export_id bigint NOT NULL, updated_at timestamp with time zone NOT NULL, export_file text, + batch_id bigint, CONSTRAINT check_5add76239d CHECK ((char_length(export_file) <= 255)) ); @@ -12704,6 +12874,9 @@ CREATE TABLE bulk_import_exports ( relation text NOT NULL, jid text, error text, + batched boolean DEFAULT false NOT NULL, + batches_count integer DEFAULT 0 NOT NULL, + total_objects_count integer DEFAULT 0 NOT NULL, CONSTRAINT check_24cb010672 CHECK ((char_length(relation) <= 255)), CONSTRAINT check_8f0f357334 CHECK ((char_length(error) <= 255)), CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255)) @@ -12754,6 +12927,7 @@ CREATE TABLE bulk_import_trackers ( status smallint DEFAULT 0 NOT NULL, created_at timestamp with time zone, updated_at timestamp with time zone, + batched boolean DEFAULT false, 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)), @@ -12778,6 +12952,7 @@ CREATE TABLE bulk_imports ( updated_at timestamp with time zone NOT NULL, source_version text, source_enterprise boolean DEFAULT true NOT NULL, + has_failures boolean DEFAULT false, CONSTRAINT check_ea4e58775a CHECK ((char_length(source_version) <= 63)) ); @@ -12790,6 +12965,21 @@ CREATE SEQUENCE bulk_imports_id_seq ALTER SEQUENCE bulk_imports_id_seq OWNED BY bulk_imports.id; +CREATE TABLE catalog_resources ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE catalog_resources_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE catalog_resources_id_seq OWNED BY catalog_resources.id; + CREATE TABLE chat_names ( id integer NOT NULL, user_id integer NOT NULL, @@ -12831,13 +13021,12 @@ CREATE SEQUENCE chat_teams_id_seq ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id; CREATE TABLE ci_build_needs ( - id integer NOT NULL, name text NOT NULL, artifacts boolean DEFAULT true NOT NULL, optional boolean DEFAULT false NOT NULL, build_id bigint NOT NULL, partition_id bigint DEFAULT 100 NOT NULL, - id_convert_to_bigint bigint DEFAULT 0 NOT NULL + id bigint NOT NULL ); CREATE SEQUENCE ci_build_needs_id_seq @@ -12952,8 +13141,9 @@ CREATE TABLE ci_builds ( scheduling_type smallint, id bigint NOT NULL, stage_id bigint, - partition_id bigint DEFAULT 100 NOT NULL, - CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL)) + partition_id bigint NOT NULL, + CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL)), + CONSTRAINT partitioning_constraint CHECK ((partition_id = 100)) ); CREATE SEQUENCE ci_builds_id_seq @@ -12980,9 +13170,8 @@ CREATE TABLE p_ci_builds_metadata ( id bigint NOT NULL, runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL, id_tokens jsonb DEFAULT '{}'::jsonb NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, - debug_trace_enabled boolean DEFAULT false NOT NULL, - runner_machine_id bigint + partition_id bigint NOT NULL, + debug_trace_enabled boolean DEFAULT false NOT NULL ) PARTITION BY LIST (partition_id); @@ -13010,9 +13199,8 @@ CREATE TABLE ci_builds_metadata ( id bigint DEFAULT nextval('ci_builds_metadata_id_seq'::regclass) NOT NULL, runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL, id_tokens jsonb DEFAULT '{}'::jsonb NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, - debug_trace_enabled boolean DEFAULT false NOT NULL, - runner_machine_id bigint + partition_id bigint NOT NULL, + debug_trace_enabled boolean DEFAULT false NOT NULL ); ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100'); @@ -13034,6 +13222,15 @@ CREATE SEQUENCE ci_builds_runner_session_id_seq ALTER SEQUENCE ci_builds_runner_session_id_seq OWNED BY ci_builds_runner_session.id; +CREATE TABLE ci_cost_settings ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + runner_id bigint NOT NULL, + standard_factor double precision DEFAULT 1.0 NOT NULL, + os_contribution_factor double precision DEFAULT 0.008 NOT NULL, + os_plan_factor double precision DEFAULT 0.5 NOT NULL +); + CREATE TABLE ci_daily_build_group_report_results ( id bigint NOT NULL, date date NOT NULL, @@ -13073,6 +13270,28 @@ CREATE SEQUENCE ci_deleted_objects_id_seq ALTER SEQUENCE ci_deleted_objects_id_seq OWNED BY ci_deleted_objects.id; +CREATE TABLE ci_editor_ai_conversation_messages ( + id bigint NOT NULL, + user_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, + role text NOT NULL, + content text, + async_errors text[] DEFAULT '{}'::text[] NOT NULL, + CONSTRAINT check_10b793171f CHECK ((char_length(role) <= 100)), + CONSTRAINT check_c83d789632 CHECK ((char_length(content) <= 16384)) +); + +CREATE SEQUENCE ci_editor_ai_conversation_messages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_editor_ai_conversation_messages_id_seq OWNED BY ci_editor_ai_conversation_messages.id; + CREATE TABLE ci_freeze_periods ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -13171,7 +13390,9 @@ CREATE TABLE ci_job_artifacts ( locked smallint DEFAULT 2, partition_id bigint DEFAULT 100 NOT NULL, accessibility smallint DEFAULT 0 NOT NULL, - CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)) + file_final_path text, + CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)), + CONSTRAINT check_9f04410cf4 CHECK ((char_length(file_final_path) <= 1024)) ); CREATE SEQUENCE ci_job_artifacts_id_seq @@ -13446,7 +13667,8 @@ CREATE TABLE ci_pipeline_variables ( pipeline_id integer NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, partition_id bigint DEFAULT 100 NOT NULL, - raw boolean DEFAULT false NOT NULL + raw boolean DEFAULT false NOT NULL, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_pipeline_variables_id_seq @@ -13489,6 +13711,7 @@ CREATE TABLE ci_pipelines ( ci_ref_id bigint, locked smallint DEFAULT 1 NOT NULL, partition_id bigint DEFAULT 100 NOT NULL, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_d7e99a025e CHECK ((lock_version IS NOT NULL)) ); @@ -13701,7 +13924,7 @@ CREATE TABLE ci_runners ( maximum_timeout integer, runner_type smallint NOT NULL, token_encrypted character varying, - public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL, + public_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, config jsonb DEFAULT '{}'::jsonb NOT NULL, executor_type smallint, @@ -13888,7 +14111,6 @@ CREATE TABLE ci_triggers ( project_id integer, owner_id integer NOT NULL, description character varying, - ref character varying, encrypted_token bytea, encrypted_token_iv bytea ); @@ -14161,196 +14383,6 @@ CREATE TABLE clusters ( helm_major_version integer DEFAULT 3 NOT NULL ); -CREATE TABLE clusters_applications_cert_managers ( - id integer NOT NULL, - cluster_id integer NOT NULL, - status integer NOT NULL, - version character varying NOT NULL, - email character varying NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_cert_managers_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_cert_managers_id_seq OWNED BY clusters_applications_cert_managers.id; - -CREATE TABLE clusters_applications_cilium ( - id bigint NOT NULL, - cluster_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status integer NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_cilium_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_cilium_id_seq OWNED BY clusters_applications_cilium.id; - -CREATE TABLE clusters_applications_crossplane ( - id integer NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - cluster_id bigint NOT NULL, - status integer NOT NULL, - version character varying(255) NOT NULL, - stack character varying(255) NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_crossplane_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_crossplane_id_seq OWNED BY clusters_applications_crossplane.id; - -CREATE TABLE clusters_applications_helm ( - id integer NOT NULL, - cluster_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - status integer NOT NULL, - version character varying NOT NULL, - status_reason text, - encrypted_ca_key text, - encrypted_ca_key_iv text, - ca_cert text -); - -CREATE SEQUENCE clusters_applications_helm_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_helm_id_seq OWNED BY clusters_applications_helm.id; - -CREATE TABLE clusters_applications_ingress ( - id integer NOT NULL, - cluster_id integer NOT NULL, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - status integer NOT NULL, - ingress_type integer NOT NULL, - version character varying NOT NULL, - cluster_ip character varying, - status_reason text, - external_ip character varying, - external_hostname character varying -); - -CREATE SEQUENCE clusters_applications_ingress_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_ingress_id_seq OWNED BY clusters_applications_ingress.id; - -CREATE TABLE clusters_applications_jupyter ( - id integer NOT NULL, - cluster_id integer NOT NULL, - oauth_application_id integer, - status integer NOT NULL, - version character varying NOT NULL, - hostname character varying, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status_reason text -); - -CREATE SEQUENCE clusters_applications_jupyter_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_jupyter_id_seq OWNED BY clusters_applications_jupyter.id; - -CREATE TABLE clusters_applications_knative ( - id integer NOT NULL, - cluster_id integer NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status integer NOT NULL, - version character varying NOT NULL, - hostname character varying, - status_reason text, - external_ip character varying, - external_hostname character varying -); - -CREATE SEQUENCE clusters_applications_knative_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_knative_id_seq OWNED BY clusters_applications_knative.id; - -CREATE TABLE clusters_applications_prometheus ( - id integer NOT NULL, - cluster_id integer NOT NULL, - status integer NOT NULL, - version character varying NOT NULL, - status_reason text, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - last_update_started_at timestamp with time zone, - encrypted_alert_manager_token character varying, - encrypted_alert_manager_token_iv character varying, - healthy boolean -); - -CREATE SEQUENCE clusters_applications_prometheus_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_prometheus_id_seq OWNED BY clusters_applications_prometheus.id; - -CREATE TABLE clusters_applications_runners ( - id integer NOT NULL, - cluster_id integer NOT NULL, - runner_id integer, - status integer NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - version character varying NOT NULL, - status_reason text, - privileged boolean DEFAULT true NOT NULL -); - -CREATE SEQUENCE clusters_applications_runners_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE clusters_applications_runners_id_seq OWNED BY clusters_applications_runners.id; - CREATE SEQUENCE clusters_id_seq START WITH 1 INCREMENT BY 1 @@ -14395,12 +14427,12 @@ ALTER SEQUENCE clusters_kubernetes_namespaces_id_seq OWNED BY clusters_kubernete CREATE TABLE commit_user_mentions ( id bigint NOT NULL, - note_id integer NOT NULL, + note_id_convert_to_bigint integer DEFAULT 0 NOT NULL, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], commit_id character varying NOT NULL, - note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + note_id bigint NOT NULL ); CREATE SEQUENCE commit_user_mentions_id_seq @@ -14450,6 +14482,14 @@ CREATE TABLE container_expiration_policies ( CONSTRAINT container_expiration_policies_name_regex_keep CHECK ((char_length(name_regex_keep) <= 255)) ); +CREATE TABLE container_registry_data_repair_details ( + missing_count integer DEFAULT 0, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL +); + CREATE TABLE container_repositories ( id integer NOT NULL, project_id integer NOT NULL, @@ -14488,6 +14528,18 @@ CREATE SEQUENCE container_repositories_id_seq ALTER SEQUENCE container_repositories_id_seq OWNED BY container_repositories.id; +CREATE TABLE container_repository_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + container_repository_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint DEFAULT 0 NOT NULL, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_c96417dbc5 CHECK ((char_length(verification_failure) <= 255)) +); + CREATE TABLE content_blocked_states ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -14671,6 +14723,7 @@ CREATE TABLE dast_pre_scan_verification_steps ( updated_at timestamp with time zone NOT NULL, name text, verification_errors text[] DEFAULT '{}'::text[] NOT NULL, + check_type smallint DEFAULT 0 NOT NULL, CONSTRAINT check_cd216b95e4 CHECK ((char_length(name) <= 255)) ); @@ -15218,7 +15271,11 @@ CREATE TABLE design_management_designs ( filename character varying NOT NULL, relative_position integer, iid integer, + cached_markdown_version integer, + description text, + description_html text, CONSTRAINT check_07155e2715 CHECK ((char_length((filename)::text) <= 255)), + CONSTRAINT check_aaf9fa6ae5 CHECK ((char_length(description) <= 1000000)), CONSTRAINT check_cfb92df01a CHECK ((iid IS NOT NULL)) ); @@ -15248,6 +15305,34 @@ CREATE SEQUENCE design_management_designs_versions_id_seq ALTER SEQUENCE design_management_designs_versions_id_seq OWNED BY design_management_designs_versions.id; +CREATE TABLE design_management_repositories ( + 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 +); + +CREATE SEQUENCE design_management_repositories_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE design_management_repositories_id_seq OWNED BY design_management_repositories.id; + +CREATE TABLE design_management_repository_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + design_management_repository_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint DEFAULT 0 NOT NULL, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_bf1387c28b CHECK ((char_length(verification_failure) <= 255)) +); + CREATE TABLE design_management_versions ( id bigint NOT NULL, sha bytea NOT NULL, @@ -15268,11 +15353,11 @@ ALTER SEQUENCE design_management_versions_id_seq OWNED BY design_management_vers CREATE TABLE design_user_mentions ( id bigint NOT NULL, design_id integer NOT NULL, - note_id integer NOT NULL, + note_id_convert_to_bigint integer DEFAULT 0 NOT NULL, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + note_id bigint NOT NULL ); CREATE SEQUENCE design_user_mentions_id_seq @@ -15386,6 +15471,25 @@ CREATE SEQUENCE dora_daily_metrics_id_seq ALTER SEQUENCE dora_daily_metrics_id_seq OWNED BY dora_daily_metrics.id; +CREATE TABLE dora_performance_scores ( + id bigint NOT NULL, + project_id bigint NOT NULL, + date date NOT NULL, + deployment_frequency smallint, + lead_time_for_changes smallint, + time_to_restore_service smallint, + change_failure_rate smallint +); + +CREATE SEQUENCE dora_performance_scores_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dora_performance_scores_id_seq OWNED BY dora_performance_scores.id; + CREATE TABLE draft_notes ( id bigint NOT NULL, merge_request_id integer NOT NULL, @@ -15599,11 +15703,11 @@ ALTER SEQUENCE epic_metrics_id_seq OWNED BY epic_metrics.id; CREATE TABLE epic_user_mentions ( id bigint NOT NULL, epic_id integer NOT NULL, - note_id integer, + note_id_convert_to_bigint integer, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE epic_user_mentions_id_seq @@ -15749,6 +15853,7 @@ CREATE TABLE events ( group_id bigint, fingerprint bytea, id bigint NOT NULL, + target_id_convert_to_bigint bigint, CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128)) ); @@ -16663,7 +16768,8 @@ CREATE TABLE import_failures ( exception_message character varying(255), retry_count integer, group_id integer, - source character varying(128) + source character varying(128), + external_identifiers jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE import_failures_id_seq @@ -17110,6 +17216,23 @@ CREATE TABLE issue_assignees ( issue_id integer NOT NULL ); +CREATE TABLE issue_assignment_events ( + id bigint NOT NULL, + user_id bigint, + issue_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + action smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE issue_assignment_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_assignment_events_id_seq OWNED BY issue_assignment_events.id; + CREATE TABLE issue_customer_relations_contacts ( id bigint NOT NULL, issue_id bigint NOT NULL, @@ -17224,11 +17347,11 @@ ALTER SEQUENCE issue_tracker_data_id_seq OWNED BY issue_tracker_data.id; CREATE TABLE issue_user_mentions ( id bigint NOT NULL, issue_id integer NOT NULL, - note_id integer, + note_id_convert_to_bigint integer, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE issue_user_mentions_id_seq @@ -17420,9 +17543,14 @@ CREATE TABLE jira_tracker_data ( vulnerabilities_enabled boolean DEFAULT false NOT NULL, jira_issue_transition_automatic boolean DEFAULT false NOT NULL, integration_id integer, + jira_issue_prefix text, + jira_issue_regex text, + jira_auth_type smallint DEFAULT 0 NOT NULL, CONSTRAINT check_0bf84b76e9 CHECK ((char_length(vulnerabilities_issuetype) <= 255)), CONSTRAINT check_0fbd71d9f2 CHECK ((integration_id IS NOT NULL)), - CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255)) + CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255)), + CONSTRAINT check_4cc5bbc801 CHECK ((char_length(jira_issue_prefix) <= 255)), + CONSTRAINT check_9863a0a5fd CHECK ((char_length(jira_issue_regex) <= 255)) ); CREATE SEQUENCE jira_tracker_data_id_seq @@ -17693,8 +17821,8 @@ CREATE TABLE member_roles ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, base_access_level integer NOT NULL, - download_code boolean DEFAULT false, - read_code boolean DEFAULT false + read_code boolean DEFAULT false, + read_vulnerability boolean DEFAULT false NOT NULL ); CREATE SEQUENCE member_roles_id_seq @@ -17774,6 +17902,23 @@ CREATE SEQUENCE merge_request_assignees_id_seq ALTER SEQUENCE merge_request_assignees_id_seq OWNED BY merge_request_assignees.id; +CREATE TABLE merge_request_assignment_events ( + id bigint NOT NULL, + user_id bigint, + merge_request_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + action smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE merge_request_assignment_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_assignment_events_id_seq OWNED BY merge_request_assignment_events.id; + CREATE TABLE merge_request_blocks ( id bigint NOT NULL, blocking_merge_request_id integer NOT NULL, @@ -17918,6 +18063,26 @@ CREATE TABLE merge_request_diff_files ( external_diff_size integer ); +CREATE TABLE merge_request_diff_llm_summaries ( + id bigint NOT NULL, + user_id bigint, + merge_request_diff_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + provider smallint NOT NULL, + content text NOT NULL, + CONSTRAINT check_93955f22ad CHECK ((char_length(content) <= 2056)) +); + +CREATE SEQUENCE merge_request_diff_llm_summaries_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_diff_llm_summaries_id_seq OWNED BY merge_request_diff_llm_summaries.id; + CREATE TABLE merge_request_diffs ( id integer NOT NULL, state character varying, @@ -17948,7 +18113,6 @@ CREATE SEQUENCE merge_request_diffs_id_seq ALTER SEQUENCE merge_request_diffs_id_seq OWNED BY merge_request_diffs.id; CREATE TABLE merge_request_metrics ( - id integer NOT NULL, merge_request_id integer NOT NULL, latest_build_started_at timestamp without time zone, latest_build_finished_at timestamp without time zone, @@ -17971,7 +18135,8 @@ CREATE TABLE merge_request_metrics ( added_lines integer, removed_lines integer, target_project_id integer, - id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + id bigint NOT NULL, + first_contribution boolean DEFAULT false NOT NULL, CONSTRAINT check_e03d0900bf CHECK ((target_project_id IS NOT NULL)) ); @@ -18021,11 +18186,11 @@ ALTER SEQUENCE merge_request_reviewers_id_seq OWNED BY merge_request_reviewers.i CREATE TABLE merge_request_user_mentions ( id bigint NOT NULL, merge_request_id integer NOT NULL, - note_id integer, + note_id_convert_to_bigint integer, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE merge_request_user_mentions_id_seq @@ -18212,7 +18377,8 @@ CREATE TABLE milestones ( description_html text, start_date date, cached_markdown_version integer, - group_id integer + group_id integer, + lock_version integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE milestones_id_seq @@ -18290,14 +18456,19 @@ CREATE TABLE ml_candidates ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - iid uuid NOT NULL, experiment_id bigint NOT NULL, user_id bigint, start_time bigint, end_time bigint, status smallint DEFAULT 0 NOT NULL, name text, - CONSTRAINT check_25e6c65051 CHECK ((char_length(name) <= 255)) + package_id bigint, + eid uuid, + project_id bigint, + internal_id bigint, + ci_build_id bigint, + CONSTRAINT check_25e6c65051 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_cd160587d4 CHECK ((eid IS NOT NULL)) ); CREATE SEQUENCE ml_candidates_id_seq @@ -18426,6 +18597,18 @@ CREATE TABLE namespace_details ( next_over_limit_check_at timestamp with time zone ); +CREATE TABLE namespace_ldap_settings ( + namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + sync_last_start_at timestamp with time zone, + sync_last_update_at timestamp with time zone, + sync_last_successful_at timestamp with time zone, + sync_status smallint DEFAULT 0 NOT NULL, + sync_error text, + CONSTRAINT check_51a03d26b6 CHECK ((char_length(sync_error) <= 255)) +); + CREATE TABLE namespace_limits ( additional_purchased_storage_size bigint DEFAULT 0 NOT NULL, additional_purchased_storage_ends_on date, @@ -18463,7 +18646,11 @@ CREATE TABLE namespace_root_storage_statistics ( uploads_size bigint DEFAULT 0 NOT NULL, dependency_proxy_size bigint DEFAULT 0 NOT NULL, notification_level smallint DEFAULT 100 NOT NULL, - container_registry_size bigint DEFAULT 0 NOT NULL + container_registry_size bigint DEFAULT 0 NOT NULL, + registry_size_estimated boolean DEFAULT false NOT NULL, + public_forks_storage_size bigint DEFAULT 0 NOT NULL, + internal_forks_storage_size bigint DEFAULT 0 NOT NULL, + private_forks_storage_size bigint DEFAULT 0 NOT NULL ); CREATE TABLE namespace_settings ( @@ -18499,6 +18686,9 @@ CREATE TABLE namespace_settings ( 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, + code_suggestions boolean DEFAULT false NOT NULL, + experiment_features_enabled boolean DEFAULT false NOT NULL, + third_party_ai_features_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)) @@ -18617,7 +18807,7 @@ ALTER SEQUENCE namespaces_sync_events_id_seq OWNED BY namespaces_sync_events.id; CREATE TABLE note_diff_files ( id integer NOT NULL, - diff_note_id integer NOT NULL, + diff_note_id_convert_to_bigint integer DEFAULT 0 NOT NULL, diff text NOT NULL, new_file boolean NOT NULL, renamed_file boolean NOT NULL, @@ -18626,7 +18816,7 @@ CREATE TABLE note_diff_files ( b_mode character varying NOT NULL, new_path text NOT NULL, old_path text NOT NULL, - diff_note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + diff_note_id bigint NOT NULL ); CREATE SEQUENCE note_diff_files_id_seq @@ -18638,6 +18828,23 @@ CREATE SEQUENCE note_diff_files_id_seq ALTER SEQUENCE note_diff_files_id_seq OWNED BY note_diff_files.id; +CREATE TABLE note_metadata ( + note_id bigint NOT NULL, + email_participant text, + created_at timestamp with time zone, + updated_at timestamp with time zone, + CONSTRAINT check_40aa5ff1c6 CHECK ((char_length(email_participant) <= 255)) +); + +CREATE SEQUENCE note_metadata_note_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE note_metadata_note_id_seq OWNED BY note_metadata.note_id; + CREATE TABLE notes ( id integer NOT NULL, note text, @@ -18753,7 +18960,8 @@ CREATE TABLE oauth_access_tokens ( expires_in integer DEFAULT 7200, revoked_at timestamp without time zone, created_at timestamp without time zone NOT NULL, - scopes character varying + scopes character varying, + CONSTRAINT check_70f294ef54 CHECK ((expires_in IS NOT NULL)) ); CREATE SEQUENCE oauth_access_tokens_id_seq @@ -18980,6 +19188,23 @@ CREATE SEQUENCE operations_user_lists_id_seq ALTER SEQUENCE operations_user_lists_id_seq OWNED BY operations_user_lists.id; +CREATE TABLE organizations ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + name text DEFAULT ''::text NOT NULL, + CONSTRAINT check_d130d769e0 CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE organizations_id_seq + START WITH 1000 + INCREMENT BY 1 + MINVALUE 1000 + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE organizations_id_seq OWNED BY organizations.id; + CREATE TABLE packages_build_infos ( id bigint NOT NULL, package_id integer NOT NULL, @@ -19111,7 +19336,7 @@ CREATE TABLE packages_debian_group_component_files ( compression_type smallint, file_store smallint DEFAULT 1 NOT NULL, file text NOT NULL, - file_md5 bytea NOT NULL, + file_md5 bytea, file_sha256 bytea NOT NULL, CONSTRAINT check_839e1685bc CHECK ((char_length(file) <= 255)) ); @@ -19236,7 +19461,7 @@ CREATE TABLE packages_debian_project_component_files ( compression_type smallint, file_store smallint DEFAULT 1 NOT NULL, file text NOT NULL, - file_md5 bytea NOT NULL, + file_md5 bytea, file_sha256 bytea NOT NULL, CONSTRAINT check_e5af03fa2d CHECK ((char_length(file) <= 255)) ); @@ -19378,25 +19603,6 @@ CREATE SEQUENCE packages_dependency_links_id_seq ALTER SEQUENCE packages_dependency_links_id_seq OWNED BY packages_dependency_links.id; -CREATE TABLE packages_events ( - id bigint NOT NULL, - event_type smallint NOT NULL, - event_scope smallint NOT NULL, - originator_type smallint NOT NULL, - originator bigint, - created_at timestamp with time zone NOT NULL, - package_id bigint -); - -CREATE SEQUENCE packages_events_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE packages_events_id_seq OWNED BY packages_events.id; - CREATE TABLE packages_helm_file_metadata ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, @@ -19432,6 +19638,30 @@ CREATE TABLE packages_npm_metadata ( CONSTRAINT chk_rails_e5cbc301ae CHECK ((char_length((package_json)::text) < 20000)) ); +CREATE TABLE packages_npm_metadata_caches ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + last_downloaded_at timestamp with time zone, + project_id bigint, + file_store integer DEFAULT 1, + size integer NOT NULL, + file text NOT NULL, + package_name text NOT NULL, + object_storage_key text NOT NULL, + CONSTRAINT check_57aa07a4b2 CHECK ((char_length(file) <= 255)), + CONSTRAINT check_f97c15aa60 CHECK ((char_length(object_storage_key) <= 255)) +); + +CREATE SEQUENCE packages_npm_metadata_caches_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_npm_metadata_caches_id_seq OWNED BY packages_npm_metadata_caches.id; + CREATE TABLE packages_nuget_dependency_link_metadata ( dependency_link_id bigint NOT NULL, target_framework text NOT NULL, @@ -19668,7 +19898,9 @@ CREATE TABLE pages_deployments ( file_count integer NOT NULL, file_sha256 bytea NOT NULL, size bigint, + root_directory text DEFAULT 'public'::text, CONSTRAINT check_5f9132a958 CHECK ((size IS NOT NULL)), + CONSTRAINT check_7e938c810a CHECK ((char_length(root_directory) <= 255)), CONSTRAINT check_f0fe8032dd CHECK ((char_length(file) <= 255)) ); @@ -19860,7 +20092,9 @@ CREATE TABLE plan_limits ( enforcement_limit integer DEFAULT 0 NOT NULL, notification_limit integer DEFAULT 0 NOT NULL, dashboard_limit_enabled_at timestamp with time zone, - web_hook_calls integer DEFAULT 0 NOT NULL + web_hook_calls integer DEFAULT 0 NOT NULL, + project_access_token_limit integer DEFAULT 0 NOT NULL, + google_cloud_logging_configurations integer DEFAULT 5 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -19889,12 +20123,72 @@ CREATE SEQUENCE plans_id_seq ALTER SEQUENCE plans_id_seq OWNED BY plans.id; +CREATE TABLE pm_advisories ( + id bigint NOT NULL, + advisory_xid text NOT NULL, + published_date date NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + source_xid smallint NOT NULL, + title text, + description text, + cvss_v2 text, + cvss_v3 text, + urls text[] DEFAULT '{}'::text[], + identifiers jsonb NOT NULL, + CONSTRAINT check_152def3868 CHECK ((char_length(cvss_v2) <= 128)), + CONSTRAINT check_19cbd06439 CHECK ((char_length(advisory_xid) <= 36)), + CONSTRAINT check_bed97fa77a CHECK ((char_length(cvss_v3) <= 128)), + CONSTRAINT check_e4bfd3ffbf CHECK ((char_length(title) <= 256)), + CONSTRAINT check_fee880f7aa CHECK ((char_length(description) <= 8192)), + CONSTRAINT chk_rails_e73af9de76 CHECK ((cardinality(urls) <= 10)) +); + +CREATE SEQUENCE pm_advisories_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pm_advisories_id_seq OWNED BY pm_advisories.id; + +CREATE TABLE pm_affected_packages ( + id bigint NOT NULL, + pm_advisory_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + purl_type smallint NOT NULL, + package_name text NOT NULL, + distro_version text, + solution text, + affected_range text NOT NULL, + fixed_versions text[] DEFAULT '{}'::text[], + overridden_advisory_fields jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT check_5dd528a2be CHECK ((char_length(package_name) <= 256)), + CONSTRAINT check_80dea16c7b CHECK ((char_length(affected_range) <= 512)), + CONSTRAINT check_d1d4646298 CHECK ((char_length(solution) <= 2048)), + CONSTRAINT check_ec4c8efb5e CHECK ((char_length(distro_version) <= 256)), + CONSTRAINT chk_rails_a0f80d74e0 CHECK ((cardinality(fixed_versions) <= 10)) +); + +CREATE SEQUENCE pm_affected_packages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pm_affected_packages_id_seq OWNED BY pm_affected_packages.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 + chunk smallint NOT NULL, + data_type smallint DEFAULT 1 NOT NULL, + version_format smallint DEFAULT 1 NOT NULL ); CREATE TABLE pm_licenses ( @@ -19955,6 +20249,7 @@ CREATE TABLE pm_packages ( name text NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, + licenses jsonb, CONSTRAINT check_3a3aedb8ba CHECK ((char_length(name) <= 255)) ); @@ -19992,6 +20287,7 @@ CREATE TABLE postgres_async_foreign_key_validations ( table_name text NOT NULL, last_error text, attempts integer DEFAULT 0 NOT NULL, + constraint_type smallint 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)) @@ -20072,8 +20368,10 @@ CREATE VIEW postgres_foreign_keys AS 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 + (pg_constraint.coninhcount > 0) AS is_inherited, + pg_constraint.convalidated AS is_valid, + partitioned_parent_oids.parent_oid + 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))) @@ -20084,6 +20382,12 @@ CREATE VIEW postgres_foreign_keys AS CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx) AS array_agg FROM (unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx) JOIN pg_attribute ON (((pg_attribute.attnum = confkey.attnum) AND (pg_attribute.attrelid = referenced_table.oid))))) referenced_cols(referenced_columns)) + LEFT JOIN LATERAL ( SELECT pg_depend.refobjid AS parent_oid + FROM pg_depend + WHERE ((pg_depend.objid = pg_constraint.oid) AND (pg_depend.deptype = 'P'::"char") AND (pg_depend.refobjid IN ( SELECT pg_constraint_1.oid + FROM pg_constraint pg_constraint_1 + WHERE (pg_constraint_1.contype = 'f'::"char")))) + LIMIT 1) partitioned_parent_oids(parent_oid) ON (true)) WHERE (pg_constraint.contype = 'f'::"char"); CREATE VIEW postgres_index_bloat_estimates AS @@ -20846,16 +21150,57 @@ CREATE TABLE project_settings ( emails_enabled boolean DEFAULT true NOT NULL, pages_unique_domain_enabled boolean DEFAULT false NOT NULL, pages_unique_domain text, + runner_registration_enabled boolean DEFAULT true, + product_analytics_instrumentation_key text, + jitsu_host text, + jitsu_project_xid text, + jitsu_administrator_email text, + encrypted_jitsu_administrator_password bytea, + encrypted_jitsu_administrator_password_iv bytea, + product_analytics_data_collector_host text, + encrypted_product_analytics_clickhouse_connection_string bytea, + encrypted_product_analytics_clickhouse_connection_string_iv bytea, + cube_api_base_url text, + encrypted_cube_api_key bytea, + encrypted_cube_api_key_iv bytea, 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)), + CONSTRAINT check_4b142e71f3 CHECK ((char_length(product_analytics_data_collector_host) <= 255)), CONSTRAINT check_67292e4b99 CHECK ((char_length(mirror_branch_regex) <= 255)), + CONSTRAINT check_acb7fad2f9 CHECK ((char_length(product_analytics_instrumentation_key) <= 255)), CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)), CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)), - CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)) + CONSTRAINT check_ea15225016 CHECK ((char_length(jitsu_project_xid) <= 255)), + CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)), + CONSTRAINT check_f4499c0fa4 CHECK ((char_length(jitsu_host) <= 255)), + CONSTRAINT check_f5495015f5 CHECK ((char_length(jitsu_administrator_email) <= 255)), + CONSTRAINT check_f9df7bcee2 CHECK ((char_length(cube_api_base_url) <= 512)) +); + +CREATE TABLE project_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_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint DEFAULT 0 NOT NULL, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_0d5a9e7bde CHECK ((char_length(verification_failure) <= 255)) ); +CREATE SEQUENCE project_states_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_states_id_seq OWNED BY project_states.id; + CREATE TABLE project_statistics ( id integer NOT NULL, project_id integer NOT NULL, @@ -21215,7 +21560,8 @@ CREATE TABLE protected_environment_deploy_access_levels ( protected_environment_id integer NOT NULL, user_id integer, group_id integer, - group_inheritance_type smallint DEFAULT 0 NOT NULL + group_inheritance_type smallint DEFAULT 0 NOT NULL, + CONSTRAINT check_deploy_access_levels_user_group_access_level_any_not_null CHECK ((num_nonnulls(user_id, group_id, access_level) = 1)) ); CREATE SEQUENCE protected_environment_deploy_access_levels_id_seq @@ -21429,6 +21775,25 @@ CREATE SEQUENCE releases_id_seq ALTER SEQUENCE releases_id_seq OWNED BY releases.id; +CREATE TABLE remote_development_agent_configs ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_agent_id bigint NOT NULL, + enabled boolean NOT NULL, + dns_zone text NOT NULL, + CONSTRAINT check_9f5cd54d1c CHECK ((char_length(dns_zone) <= 256)) +); + +CREATE SEQUENCE remote_development_agent_configs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE remote_development_agent_configs_id_seq OWNED BY remote_development_agent_configs.id; + CREATE TABLE remote_mirrors ( id integer NOT NULL, project_id integer, @@ -21571,6 +21936,25 @@ CREATE SEQUENCE resource_label_events_id_seq ALTER SEQUENCE resource_label_events_id_seq OWNED BY resource_label_events.id; +CREATE TABLE resource_link_events ( + id bigint NOT NULL, + action smallint NOT NULL, + user_id bigint NOT NULL, + issue_id bigint NOT NULL, + child_work_item_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + system_note_metadata_id bigint +); + +CREATE SEQUENCE resource_link_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE resource_link_events_id_seq OWNED BY resource_link_events.id; + CREATE TABLE resource_milestone_events ( id bigint NOT NULL, user_id bigint, @@ -21832,7 +22216,8 @@ CREATE TABLE scan_result_policies ( updated_at timestamp with time zone NOT NULL, orchestration_policy_idx smallint NOT NULL, license_states text[] DEFAULT '{}'::text[], - match_on_inclusion boolean + match_on_inclusion boolean, + role_approvers integer[] DEFAULT '{}'::integer[] ); CREATE SEQUENCE scan_result_policies_id_seq @@ -21844,6 +22229,28 @@ CREATE SEQUENCE scan_result_policies_id_seq ALTER SEQUENCE scan_result_policies_id_seq OWNED BY scan_result_policies.id; +CREATE TABLE schema_inconsistencies ( + id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + object_name text NOT NULL, + table_name text NOT NULL, + valitador_name text NOT NULL, + CONSTRAINT check_120b6c86d0 CHECK ((char_length(valitador_name) <= 63)), + CONSTRAINT check_a0411f31fd CHECK ((char_length(object_name) <= 63)), + CONSTRAINT check_d96408dfd2 CHECK ((char_length(table_name) <= 63)) +); + +CREATE SEQUENCE schema_inconsistencies_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE schema_inconsistencies_id_seq OWNED BY schema_inconsistencies.id; + CREATE TABLE schema_migrations ( version character varying NOT NULL, finished_at timestamp with time zone DEFAULT now() @@ -21885,6 +22292,49 @@ CREATE SEQUENCE scim_oauth_access_tokens_id_seq ALTER SEQUENCE scim_oauth_access_tokens_id_seq OWNED BY scim_oauth_access_tokens.id; +CREATE TABLE search_indices ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + bucket_number integer, + path text NOT NULL, + type text NOT NULL, + number_of_shards integer DEFAULT 2 NOT NULL, + number_of_replicas integer DEFAULT 1 NOT NULL, + CONSTRAINT check_75c11e6d37 CHECK ((char_length(type) <= 255)), + CONSTRAINT check_ab47e7ff85 CHECK ((char_length(path) <= 255)) +); + +CREATE SEQUENCE search_indices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE search_indices_id_seq OWNED BY search_indices.id; + +CREATE TABLE search_namespace_index_assignments ( + id bigint NOT NULL, + namespace_id bigint, + search_index_id bigint NOT NULL, + namespace_id_non_nullable bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id_hashed integer NOT NULL, + index_type text NOT NULL, + CONSTRAINT check_64cf4e670a CHECK ((char_length(index_type) <= 255)) +); + +CREATE SEQUENCE search_namespace_index_assignments_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE search_namespace_index_assignments_id_seq OWNED BY search_namespace_index_assignments.id; + CREATE SEQUENCE security_findings_id_seq START WITH 1 INCREMENT BY 1 @@ -21902,6 +22352,7 @@ CREATE TABLE security_orchestration_policy_configurations ( updated_at timestamp with time zone NOT NULL, configured_at timestamp with time zone, namespace_id bigint, + bot_user_id integer, CONSTRAINT cop_configs_project_or_namespace_existence CHECK (((project_id IS NULL) <> (namespace_id IS NULL))) ); @@ -22026,7 +22477,6 @@ CREATE SEQUENCE self_managed_prometheus_alert_events_id_seq ALTER SEQUENCE self_managed_prometheus_alert_events_id_seq OWNED BY self_managed_prometheus_alert_events.id; CREATE TABLE sent_notifications ( - id integer NOT NULL, project_id integer, noteable_id integer, noteable_type character varying, @@ -22037,7 +22487,7 @@ CREATE TABLE sent_notifications ( note_type character varying, "position" text, in_reply_to_discussion_id character varying, - id_convert_to_bigint bigint DEFAULT 0 NOT NULL + id bigint NOT NULL ); CREATE SEQUENCE sent_notifications_id_seq @@ -22064,16 +22514,29 @@ CREATE SEQUENCE sentry_issues_id_seq ALTER SEQUENCE sentry_issues_id_seq OWNED BY sentry_issues.id; -CREATE TABLE serverless_domain_cluster ( - uuid character varying(14) NOT NULL, - pages_domain_id bigint NOT NULL, - clusters_applications_knative_id bigint NOT NULL, - creator_id bigint, +CREATE TABLE service_desk_custom_email_credentials ( + project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - encrypted_key text, - encrypted_key_iv character varying(255), - certificate text + smtp_port integer, + smtp_address text, + encrypted_smtp_username bytea, + encrypted_smtp_username_iv bytea, + encrypted_smtp_password bytea, + encrypted_smtp_password_iv bytea, + CONSTRAINT check_6dd11e956a CHECK ((char_length(smtp_address) <= 255)) +); + +CREATE TABLE service_desk_custom_email_verifications ( + project_id bigint NOT NULL, + triggerer_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + triggered_at timestamp with time zone, + state smallint DEFAULT 0 NOT NULL, + error smallint, + encrypted_token bytea, + encrypted_token_iv bytea ); CREATE TABLE service_desk_settings ( @@ -22224,11 +22687,11 @@ CREATE TABLE snippet_statistics ( CREATE TABLE snippet_user_mentions ( id bigint NOT NULL, snippet_id integer NOT NULL, - note_id integer, + note_id_convert_to_bigint integer, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE snippet_user_mentions_id_seq @@ -22457,7 +22920,7 @@ ALTER SEQUENCE subscriptions_id_seq OWNED BY subscriptions.id; CREATE TABLE suggestions ( id bigint NOT NULL, - note_id integer NOT NULL, + note_id_convert_to_bigint integer DEFAULT 0 NOT NULL, relative_order smallint NOT NULL, applied boolean DEFAULT false NOT NULL, commit_id character varying, @@ -22466,7 +22929,7 @@ CREATE TABLE suggestions ( lines_above integer DEFAULT 0 NOT NULL, lines_below integer DEFAULT 0 NOT NULL, outdated boolean DEFAULT false NOT NULL, - note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + note_id bigint NOT NULL ); CREATE SEQUENCE suggestions_id_seq @@ -22480,13 +22943,13 @@ ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id; CREATE TABLE system_note_metadata ( id integer NOT NULL, - note_id integer NOT NULL, + note_id_convert_to_bigint integer DEFAULT 0 NOT NULL, commit_count integer, action character varying, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, description_version_id bigint, - note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + note_id bigint NOT NULL ); CREATE SEQUENCE system_note_metadata_id_seq @@ -22594,7 +23057,8 @@ CREATE TABLE terraform_states ( uuid character varying(32) NOT NULL, name character varying(255) NOT NULL, versioning_enabled boolean DEFAULT true NOT NULL, - deleted_at timestamp with time zone + deleted_at timestamp with time zone, + activerecord_lock_version integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE terraform_states_id_seq @@ -22639,10 +23103,10 @@ CREATE TABLE timelogs ( issue_id integer, merge_request_id integer, spent_at timestamp without time zone DEFAULT now(), - note_id integer, + note_id_convert_to_bigint integer, project_id integer, summary text, - note_id_convert_to_bigint bigint, + note_id bigint, CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255)) ); @@ -22666,11 +23130,11 @@ CREATE TABLE todos ( state character varying NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, - note_id integer, + note_id_convert_to_bigint integer, commit_id character varying, group_id integer, resolved_by_action smallint, - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE todos_id_seq @@ -22944,6 +23408,7 @@ CREATE TABLE user_details ( password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL, onboarding_step_url text, discord text DEFAULT ''::text NOT NULL, + provisioned_by_group_at timestamp with time zone, 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)), @@ -23088,6 +23553,11 @@ CREATE TABLE user_preferences ( markdown_automatic_lists boolean DEFAULT true NOT NULL, use_legacy_web_ide boolean DEFAULT false NOT NULL, use_new_navigation boolean, + achievements_enabled boolean DEFAULT true NOT NULL, + pinned_nav_items jsonb DEFAULT '{}'::jsonb NOT NULL, + pass_user_identities_to_ci_jwt boolean DEFAULT false NOT NULL, + enabled_following boolean DEFAULT true NOT NULL, + visibility_pipeline_id_type smallint DEFAULT 0 NOT NULL, CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)), CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7)) ); @@ -23231,7 +23701,7 @@ CREATE TABLE users ( last_name character varying(255), static_object_token character varying(255), role smallint, - user_type smallint, + user_type smallint DEFAULT 0, static_object_token_encrypted text, otp_secret_expires_at timestamp with time zone, onboarding_in_progress boolean DEFAULT false NOT NULL, @@ -23298,7 +23768,8 @@ CREATE TABLE users_statistics ( with_highest_role_owner integer DEFAULT 0 NOT NULL, bots integer DEFAULT 0 NOT NULL, blocked integer DEFAULT 0 NOT NULL, - with_highest_role_minimal_access integer DEFAULT 0 NOT NULL + with_highest_role_minimal_access integer DEFAULT 0 NOT NULL, + with_highest_role_guest_with_custom_role integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE users_statistics_id_seq @@ -23310,6 +23781,21 @@ CREATE SEQUENCE users_statistics_id_seq ALTER SEQUENCE users_statistics_id_seq OWNED BY users_statistics.id; +CREATE TABLE value_stream_dashboard_aggregations ( + namespace_id bigint NOT NULL, + last_run_at timestamp with time zone, + enabled boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE value_stream_dashboard_counts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE value_stream_dashboard_counts_id_seq OWNED BY value_stream_dashboard_counts.id; + CREATE TABLE vulnerabilities ( id bigint NOT NULL, milestone_id bigint, @@ -23799,7 +24285,7 @@ CREATE TABLE vulnerability_state_transitions ( author_id bigint, comment text, dismissal_reason smallint, - CONSTRAINT check_d1ca8ec043 CHECK ((from_state <> to_state)), + state_changed_at_pipeline_id bigint, CONSTRAINT check_fe2eb6a0f3 CHECK ((char_length(comment) <= 50000)) ); @@ -23840,11 +24326,11 @@ ALTER SEQUENCE vulnerability_statistics_id_seq OWNED BY vulnerability_statistics CREATE TABLE vulnerability_user_mentions ( id bigint NOT NULL, vulnerability_id bigint NOT NULL, - note_id integer, + note_id_convert_to_bigint integer, mentioned_users_ids integer[], mentioned_projects_ids integer[], mentioned_groups_ids integer[], - note_id_convert_to_bigint bigint + note_id bigint ); CREATE SEQUENCE vulnerability_user_mentions_id_seq @@ -24030,7 +24516,10 @@ CREATE TABLE work_item_progresses ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, issue_id bigint NOT NULL, - progress smallint DEFAULT 0 NOT NULL + progress smallint DEFAULT 0 NOT NULL, + start_value double precision DEFAULT 0.0 NOT NULL, + end_value double precision DEFAULT 100.0 NOT NULL, + current_value double precision DEFAULT 0.0 NOT NULL ); CREATE TABLE work_item_types ( @@ -24076,6 +24565,49 @@ CREATE SEQUENCE work_item_widget_definitions_id_seq ALTER SEQUENCE work_item_widget_definitions_id_seq OWNED BY work_item_widget_definitions.id; +CREATE TABLE workspaces ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id bigint NOT NULL, + project_id bigint NOT NULL, + cluster_agent_id bigint NOT NULL, + desired_state_updated_at timestamp with time zone NOT NULL, + responded_to_agent_at timestamp with time zone, + max_hours_before_termination smallint NOT NULL, + name text NOT NULL, + namespace text NOT NULL, + desired_state text NOT NULL, + actual_state text NOT NULL, + editor text NOT NULL, + devfile_ref text NOT NULL, + devfile_path text NOT NULL, + devfile text, + processed_devfile text, + url text NOT NULL, + deployment_resource_version text, + CONSTRAINT check_15543fb0fa CHECK ((char_length(name) <= 64)), + CONSTRAINT check_157d5f955c CHECK ((char_length(namespace) <= 64)), + CONSTRAINT check_2b401b0034 CHECK ((char_length(deployment_resource_version) <= 64)), + CONSTRAINT check_77d1a2ff50 CHECK ((char_length(processed_devfile) <= 65535)), + CONSTRAINT check_8e363ee3ad CHECK ((char_length(devfile_ref) <= 256)), + CONSTRAINT check_8e4db5ffc2 CHECK ((char_length(actual_state) <= 32)), + CONSTRAINT check_9e42558c35 CHECK ((char_length(url) <= 1024)), + CONSTRAINT check_b70eddcbc1 CHECK ((char_length(desired_state) <= 32)), + CONSTRAINT check_d7ed376e49 CHECK ((char_length(editor) <= 256)), + CONSTRAINT check_dc58d56169 CHECK ((char_length(devfile_path) <= 2048)), + CONSTRAINT check_eb32879a3d CHECK ((char_length(devfile) <= 65535)) +); + +CREATE SEQUENCE workspaces_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE workspaces_id_seq OWNED BY workspaces.id; + CREATE TABLE x509_certificates ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -24213,8 +24745,12 @@ CREATE SEQUENCE zoom_meetings_id_seq ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id; +ALTER TABLE ONLY abuse_report_events ALTER COLUMN id SET DEFAULT nextval('abuse_report_events_id_seq'::regclass); + ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass); +ALTER TABLE ONLY abuse_trust_scores ALTER COLUMN id SET DEFAULT nextval('abuse_trust_scores_id_seq'::regclass); + ALTER TABLE ONLY achievements ALTER COLUMN id SET DEFAULT nextval('achievements_id_seq'::regclass); ALTER TABLE ONLY agent_activity_events ALTER COLUMN id SET DEFAULT nextval('agent_activity_events_id_seq'::regclass); @@ -24223,7 +24759,9 @@ 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 agent_user_access_group_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_user_access_group_authorizations_id_seq'::regclass); + +ALTER TABLE ONLY agent_user_access_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_user_access_project_authorizations_id_seq'::regclass); ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass); @@ -24241,10 +24779,6 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER COLUMN id SET DEFA ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_group_value_streams_id_seq'::regclass); -ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_stages_id_seq'::regclass); - -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_dashboards_pointers ALTER COLUMN id SET DEFAULT nextval('analytics_dashboards_pointers_id_seq'::regclass); @@ -24289,6 +24823,10 @@ ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_ 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 audit_events_google_cloud_logging_configurations ALTER COLUMN id SET DEFAULT nextval('audit_events_google_cloud_logging_configurations_id_seq'::regclass); + +ALTER TABLE ONLY audit_events_instance_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_instance_external_audit_event_destinations_id_seq'::regclass); + ALTER TABLE ONLY audit_events_streaming_event_type_filters ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_event_type_filters_id_seq'::regclass); ALTER TABLE ONLY audit_events_streaming_headers ALTER COLUMN id SET DEFAULT nextval('audit_events_streaming_headers_id_seq'::regclass); @@ -24337,10 +24875,14 @@ ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextva ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass); +ALTER TABLE ONLY bulk_import_batch_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_batch_trackers_id_seq'::regclass); + ALTER TABLE ONLY bulk_import_configurations ALTER COLUMN id SET DEFAULT nextval('bulk_import_configurations_id_seq'::regclass); ALTER TABLE ONLY bulk_import_entities ALTER COLUMN id SET DEFAULT nextval('bulk_import_entities_id_seq'::regclass); +ALTER TABLE ONLY bulk_import_export_batches ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_batches_id_seq'::regclass); + ALTER TABLE ONLY bulk_import_export_uploads ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_uploads_id_seq'::regclass); ALTER TABLE ONLY bulk_import_exports ALTER COLUMN id SET DEFAULT nextval('bulk_import_exports_id_seq'::regclass); @@ -24351,6 +24893,8 @@ ALTER TABLE ONLY bulk_import_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_ ALTER TABLE ONLY bulk_imports ALTER COLUMN id SET DEFAULT nextval('bulk_imports_id_seq'::regclass); +ALTER TABLE ONLY catalog_resources ALTER COLUMN id SET DEFAULT nextval('catalog_resources_id_seq'::regclass); + ALTER TABLE ONLY chat_names ALTER COLUMN id SET DEFAULT nextval('chat_names_id_seq'::regclass); ALTER TABLE ONLY chat_teams ALTER COLUMN id SET DEFAULT nextval('chat_teams_id_seq'::regclass); @@ -24369,6 +24913,8 @@ ALTER TABLE ONLY ci_daily_build_group_report_results ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY ci_deleted_objects ALTER COLUMN id SET DEFAULT nextval('ci_deleted_objects_id_seq'::regclass); +ALTER TABLE ONLY ci_editor_ai_conversation_messages ALTER COLUMN id SET DEFAULT nextval('ci_editor_ai_conversation_messages_id_seq'::regclass); + ALTER TABLE ONLY ci_freeze_periods ALTER COLUMN id SET DEFAULT nextval('ci_freeze_periods_id_seq'::regclass); ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_group_variables_id_seq'::regclass); @@ -24467,24 +25013,6 @@ ALTER TABLE ONLY cluster_providers_gcp ALTER COLUMN id SET DEFAULT nextval('clus ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass); -ALTER TABLE ONLY clusters_applications_cert_managers ALTER COLUMN id SET DEFAULT nextval('clusters_applications_cert_managers_id_seq'::regclass); - -ALTER TABLE ONLY clusters_applications_cilium ALTER COLUMN id SET DEFAULT nextval('clusters_applications_cilium_id_seq'::regclass); - -ALTER TABLE ONLY clusters_applications_crossplane ALTER COLUMN id SET DEFAULT nextval('clusters_applications_crossplane_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); - -ALTER TABLE ONLY clusters_applications_jupyter ALTER COLUMN id SET DEFAULT nextval('clusters_applications_jupyter_id_seq'::regclass); - -ALTER TABLE ONLY clusters_applications_knative ALTER COLUMN id SET DEFAULT nextval('clusters_applications_knative_id_seq'::regclass); - -ALTER TABLE ONLY clusters_applications_prometheus ALTER COLUMN id SET DEFAULT nextval('clusters_applications_prometheus_id_seq'::regclass); - -ALTER TABLE ONLY clusters_applications_runners ALTER COLUMN id SET DEFAULT nextval('clusters_applications_runners_id_seq'::regclass); - ALTER TABLE ONLY clusters_kubernetes_namespaces ALTER COLUMN id SET DEFAULT nextval('clusters_kubernetes_namespaces_id_seq'::regclass); ALTER TABLE ONLY commit_user_mentions ALTER COLUMN id SET DEFAULT nextval('commit_user_mentions_id_seq'::regclass); @@ -24553,6 +25081,8 @@ ALTER TABLE ONLY design_management_designs ALTER COLUMN id SET DEFAULT nextval(' ALTER TABLE ONLY design_management_designs_versions ALTER COLUMN id SET DEFAULT nextval('design_management_designs_versions_id_seq'::regclass); +ALTER TABLE ONLY design_management_repositories ALTER COLUMN id SET DEFAULT nextval('design_management_repositories_id_seq'::regclass); + ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval('design_management_versions_id_seq'::regclass); ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass); @@ -24567,6 +25097,8 @@ ALTER TABLE ONLY dora_configurations ALTER COLUMN id SET DEFAULT nextval('dora_c ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass); +ALTER TABLE ONLY dora_performance_scores ALTER COLUMN id SET DEFAULT nextval('dora_performance_scores_id_seq'::regclass); + ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass); ALTER TABLE ONLY elastic_index_settings ALTER COLUMN id SET DEFAULT nextval('elastic_index_settings_id_seq'::regclass); @@ -24727,6 +25259,8 @@ ALTER TABLE ONLY issuable_severities ALTER COLUMN id SET DEFAULT nextval('issuab ALTER TABLE ONLY issuable_slas ALTER COLUMN id SET DEFAULT nextval('issuable_slas_id_seq'::regclass); +ALTER TABLE ONLY issue_assignment_events ALTER COLUMN id SET DEFAULT nextval('issue_assignment_events_id_seq'::regclass); + ALTER TABLE ONLY issue_customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('issue_customer_relations_contacts_id_seq'::regclass); ALTER TABLE ONLY issue_email_participants ALTER COLUMN id SET DEFAULT nextval('issue_email_participants_id_seq'::regclass); @@ -24787,6 +25321,8 @@ ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::r ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass); +ALTER TABLE ONLY merge_request_assignment_events ALTER COLUMN id SET DEFAULT nextval('merge_request_assignment_events_id_seq'::regclass); + ALTER TABLE ONLY merge_request_blocks ALTER COLUMN id SET DEFAULT nextval('merge_request_blocks_id_seq'::regclass); ALTER TABLE ONLY merge_request_cleanup_schedules ALTER COLUMN merge_request_id SET DEFAULT nextval('merge_request_cleanup_schedules_merge_request_id_seq'::regclass); @@ -24797,6 +25333,8 @@ ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nex ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass); +ALTER TABLE ONLY merge_request_diff_llm_summaries ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_llm_summaries_id_seq'::regclass); + ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merge_request_metrics_id_seq'::regclass); @@ -24849,6 +25387,8 @@ ALTER TABLE ONLY namespaces_sync_events ALTER COLUMN id SET DEFAULT nextval('nam ALTER TABLE ONLY note_diff_files ALTER COLUMN id SET DEFAULT nextval('note_diff_files_id_seq'::regclass); +ALTER TABLE ONLY note_metadata ALTER COLUMN note_id SET DEFAULT nextval('note_metadata_note_id_seq'::regclass); + ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); ALTER TABLE ONLY notification_settings ALTER COLUMN id SET DEFAULT nextval('notification_settings_id_seq'::regclass); @@ -24879,6 +25419,8 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY operations_user_lists ALTER COLUMN id SET DEFAULT nextval('operations_user_lists_id_seq'::regclass); +ALTER TABLE ONLY organizations ALTER COLUMN id SET DEFAULT nextval('organizations_id_seq'::regclass); + ALTER TABLE ONLY p_ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass); ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass); @@ -24915,10 +25457,10 @@ ALTER TABLE ONLY packages_dependencies ALTER COLUMN id SET DEFAULT nextval('pack ALTER TABLE ONLY packages_dependency_links ALTER COLUMN id SET DEFAULT nextval('packages_dependency_links_id_seq'::regclass); -ALTER TABLE ONLY packages_events ALTER COLUMN id SET DEFAULT nextval('packages_events_id_seq'::regclass); - ALTER TABLE ONLY packages_maven_metadata ALTER COLUMN id SET DEFAULT nextval('packages_maven_metadata_id_seq'::regclass); +ALTER TABLE ONLY packages_npm_metadata_caches ALTER COLUMN id SET DEFAULT nextval('packages_npm_metadata_caches_id_seq'::regclass); + ALTER TABLE ONLY packages_package_file_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_package_file_build_infos_id_seq'::regclass); ALTER TABLE ONLY packages_package_files ALTER COLUMN id SET DEFAULT nextval('packages_package_files_id_seq'::regclass); @@ -24945,6 +25487,10 @@ ALTER TABLE ONLY plan_limits ALTER COLUMN id SET DEFAULT nextval('plan_limits_id ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regclass); +ALTER TABLE ONLY pm_advisories ALTER COLUMN id SET DEFAULT nextval('pm_advisories_id_seq'::regclass); + +ALTER TABLE ONLY pm_affected_packages ALTER COLUMN id SET DEFAULT nextval('pm_affected_packages_id_seq'::regclass); + 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); @@ -25011,6 +25557,8 @@ ALTER TABLE ONLY project_repository_storage_moves ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY project_security_settings ALTER COLUMN project_id SET DEFAULT nextval('project_security_settings_project_id_seq'::regclass); +ALTER TABLE ONLY project_states ALTER COLUMN id SET DEFAULT nextval('project_states_id_seq'::regclass); + 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); @@ -25057,6 +25605,8 @@ ALTER TABLE ONLY release_links ALTER COLUMN id SET DEFAULT nextval('release_link ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass); +ALTER TABLE ONLY remote_development_agent_configs ALTER COLUMN id SET DEFAULT nextval('remote_development_agent_configs_id_seq'::regclass); + ALTER TABLE ONLY remote_mirrors ALTER COLUMN id SET DEFAULT nextval('remote_mirrors_id_seq'::regclass); ALTER TABLE ONLY required_code_owners_sections ALTER COLUMN id SET DEFAULT nextval('required_code_owners_sections_id_seq'::regclass); @@ -25069,6 +25619,8 @@ ALTER TABLE ONLY resource_iteration_events ALTER COLUMN id SET DEFAULT nextval(' ALTER TABLE ONLY resource_label_events ALTER COLUMN id SET DEFAULT nextval('resource_label_events_id_seq'::regclass); +ALTER TABLE ONLY resource_link_events ALTER COLUMN id SET DEFAULT nextval('resource_link_events_id_seq'::regclass); + ALTER TABLE ONLY resource_milestone_events ALTER COLUMN id SET DEFAULT nextval('resource_milestone_events_id_seq'::regclass); ALTER TABLE ONLY resource_state_events ALTER COLUMN id SET DEFAULT nextval('resource_state_events_id_seq'::regclass); @@ -25097,10 +25649,16 @@ ALTER TABLE ONLY sbom_vulnerable_component_versions ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass); +ALTER TABLE ONLY schema_inconsistencies ALTER COLUMN id SET DEFAULT nextval('schema_inconsistencies_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); +ALTER TABLE ONLY search_indices ALTER COLUMN id SET DEFAULT nextval('search_indices_id_seq'::regclass); + +ALTER TABLE ONLY search_namespace_index_assignments ALTER COLUMN id SET DEFAULT nextval('search_namespace_index_assignments_id_seq'::regclass); + ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security_findings_id_seq'::regclass); ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass); @@ -25221,6 +25779,8 @@ ALTER TABLE ONLY users_star_projects ALTER COLUMN id SET DEFAULT nextval('users_ ALTER TABLE ONLY users_statistics ALTER COLUMN id SET DEFAULT nextval('users_statistics_id_seq'::regclass); +ALTER TABLE ONLY value_stream_dashboard_counts ALTER COLUMN id SET DEFAULT nextval('value_stream_dashboard_counts_id_seq'::regclass); + ALTER TABLE ONLY vulnerabilities ALTER COLUMN id SET DEFAULT nextval('vulnerabilities_id_seq'::regclass); ALTER TABLE ONLY vulnerability_advisories ALTER COLUMN id SET DEFAULT nextval('vulnerability_advisories_id_seq'::regclass); @@ -25287,6 +25847,8 @@ ALTER TABLE ONLY work_item_types ALTER COLUMN id SET DEFAULT nextval('work_item_ ALTER TABLE ONLY work_item_widget_definitions ALTER COLUMN id SET DEFAULT nextval('work_item_widget_definitions_id_seq'::regclass); +ALTER TABLE ONLY workspaces ALTER COLUMN id SET DEFAULT nextval('workspaces_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); @@ -25889,9 +26451,15 @@ ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_ ALTER TABLE ONLY gitlab_partitions_static.product_analytics_events_experimental_63 ADD CONSTRAINT product_analytics_events_experimental_63_pkey PRIMARY KEY (id, project_id); +ALTER TABLE ONLY abuse_report_events + ADD CONSTRAINT abuse_report_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY abuse_reports ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id); +ALTER TABLE ONLY abuse_trust_scores + ADD CONSTRAINT abuse_trust_scores_pkey PRIMARY KEY (id); + ALTER TABLE ONLY achievements ADD CONSTRAINT achievements_pkey PRIMARY KEY (id); @@ -25904,8 +26472,11 @@ 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 agent_user_access_group_authorizations + ADD CONSTRAINT agent_user_access_group_authorizations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY agent_user_access_project_authorizations + ADD CONSTRAINT agent_user_access_project_authorizations_pkey PRIMARY KEY (id); ALTER TABLE ONLY alert_management_alert_assignees ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id); @@ -25934,12 +26505,6 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ADD CONSTRAINT analytics_cycle_analytics_group_value_streams_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_cycle_analytics_project_stages - ADD CONSTRAINT analytics_cycle_analytics_project_stages_pkey PRIMARY KEY (id); - -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); @@ -26012,6 +26577,12 @@ ALTER TABLE ONLY atlassian_identities ALTER TABLE ONLY audit_events_external_audit_event_destinations ADD CONSTRAINT audit_events_external_audit_event_destinations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY audit_events_google_cloud_logging_configurations + ADD CONSTRAINT audit_events_google_cloud_logging_configurations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY audit_events_instance_external_audit_event_destinations + ADD CONSTRAINT audit_events_instance_external_audit_event_destinations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY audit_events ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); @@ -26093,12 +26664,18 @@ ALTER TABLE ONLY boards ALTER TABLE ONLY broadcast_messages ADD CONSTRAINT broadcast_messages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY bulk_import_batch_trackers + ADD CONSTRAINT bulk_import_batch_trackers_pkey PRIMARY KEY (id); + ALTER TABLE ONLY bulk_import_configurations ADD CONSTRAINT bulk_import_configurations_pkey PRIMARY KEY (id); ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT bulk_import_entities_pkey PRIMARY KEY (id); +ALTER TABLE ONLY bulk_import_export_batches + ADD CONSTRAINT bulk_import_export_batches_pkey PRIMARY KEY (id); + ALTER TABLE ONLY bulk_import_export_uploads ADD CONSTRAINT bulk_import_export_uploads_pkey PRIMARY KEY (id); @@ -26114,6 +26691,9 @@ ALTER TABLE ONLY bulk_import_trackers ALTER TABLE ONLY bulk_imports ADD CONSTRAINT bulk_imports_pkey PRIMARY KEY (id); +ALTER TABLE ONLY catalog_resources + ADD CONSTRAINT catalog_resources_pkey PRIMARY KEY (id); + ALTER TABLE ONLY chat_names ADD CONSTRAINT chat_names_pkey PRIMARY KEY (id); @@ -26123,9 +26703,6 @@ 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; @@ -26163,17 +26740,23 @@ ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id, partition_id); ALTER TABLE ONLY ci_builds - ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id); + ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id, partition_id); ALTER TABLE ONLY ci_builds_runner_session ADD CONSTRAINT ci_builds_runner_session_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_cost_settings + ADD CONSTRAINT ci_cost_settings_pkey PRIMARY KEY (runner_id); + ALTER TABLE ONLY ci_daily_build_group_report_results ADD CONSTRAINT ci_daily_build_group_report_results_pkey PRIMARY KEY (id); ALTER TABLE ONLY ci_deleted_objects ADD CONSTRAINT ci_deleted_objects_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_editor_ai_conversation_messages + ADD CONSTRAINT ci_editor_ai_conversation_messages_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_freeze_periods ADD CONSTRAINT ci_freeze_periods_pkey PRIMARY KEY (id); @@ -26330,33 +26913,6 @@ ALTER TABLE ONLY cluster_providers_aws ALTER TABLE ONLY cluster_providers_gcp ADD CONSTRAINT cluster_providers_gcp_pkey PRIMARY KEY (id); -ALTER TABLE ONLY clusters_applications_cert_managers - ADD CONSTRAINT clusters_applications_cert_managers_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_cilium - ADD CONSTRAINT clusters_applications_cilium_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_crossplane - ADD CONSTRAINT clusters_applications_crossplane_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_helm - ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_ingress - ADD CONSTRAINT clusters_applications_ingress_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_jupyter - ADD CONSTRAINT clusters_applications_jupyter_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_knative - ADD CONSTRAINT clusters_applications_knative_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_prometheus - ADD CONSTRAINT clusters_applications_prometheus_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY clusters_applications_runners - ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); - ALTER TABLE ONLY clusters_integration_prometheus ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id); @@ -26375,9 +26931,15 @@ ALTER TABLE ONLY compliance_management_frameworks ALTER TABLE ONLY container_expiration_policies ADD CONSTRAINT container_expiration_policies_pkey PRIMARY KEY (project_id); +ALTER TABLE ONLY container_registry_data_repair_details + ADD CONSTRAINT container_registry_data_repair_details_pkey PRIMARY KEY (project_id); + ALTER TABLE ONLY container_repositories ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id); +ALTER TABLE ONLY container_repository_states + ADD CONSTRAINT container_repository_states_pkey PRIMARY KEY (container_repository_id); + ALTER TABLE ONLY content_blocked_states ADD CONSTRAINT content_blocked_states_pkey PRIMARY KEY (id); @@ -26495,6 +27057,12 @@ ALTER TABLE ONLY design_management_designs ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT design_management_designs_versions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY design_management_repositories + ADD CONSTRAINT design_management_repositories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY design_management_repository_states + ADD CONSTRAINT design_management_repository_states_pkey PRIMARY KEY (design_management_repository_id); + ALTER TABLE ONLY design_management_versions ADD CONSTRAINT design_management_versions_pkey PRIMARY KEY (id); @@ -26516,6 +27084,9 @@ ALTER TABLE ONLY dora_configurations ALTER TABLE ONLY dora_daily_metrics ADD CONSTRAINT dora_daily_metrics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dora_performance_scores + ADD CONSTRAINT dora_performance_scores_pkey PRIMARY KEY (id); + ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); @@ -26783,6 +27354,9 @@ ALTER TABLE ONLY issuable_slas ALTER TABLE ONLY issue_assignees ADD CONSTRAINT issue_assignees_pkey PRIMARY KEY (issue_id, user_id); +ALTER TABLE ONLY issue_assignment_events + ADD CONSTRAINT issue_assignment_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY issue_customer_relations_contacts ADD CONSTRAINT issue_customer_relations_contacts_pkey PRIMARY KEY (id); @@ -26882,6 +27456,9 @@ ALTER TABLE ONLY members ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT merge_request_assignees_pkey PRIMARY KEY (id); +ALTER TABLE ONLY merge_request_assignment_events + ADD CONSTRAINT merge_request_assignment_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_blocks ADD CONSTRAINT merge_request_blocks_pkey PRIMARY KEY (id); @@ -26906,6 +27483,9 @@ ALTER TABLE ONLY merge_request_diff_details ALTER TABLE ONLY merge_request_diff_files ADD CONSTRAINT merge_request_diff_files_pkey PRIMARY KEY (merge_request_diff_id, relative_order); +ALTER TABLE ONLY merge_request_diff_llm_summaries + ADD CONSTRAINT merge_request_diff_llm_summaries_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_diffs ADD CONSTRAINT merge_request_diffs_pkey PRIMARY KEY (id); @@ -26981,6 +27561,9 @@ ALTER TABLE ONLY namespace_commit_emails ALTER TABLE ONLY namespace_details ADD CONSTRAINT namespace_details_pkey PRIMARY KEY (namespace_id); +ALTER TABLE ONLY namespace_ldap_settings + ADD CONSTRAINT namespace_ldap_settings_pkey PRIMARY KEY (namespace_id); + ALTER TABLE ONLY namespace_limits ADD CONSTRAINT namespace_limits_pkey PRIMARY KEY (namespace_id); @@ -27008,6 +27591,9 @@ ALTER TABLE ONLY namespaces_sync_events ALTER TABLE ONLY note_diff_files ADD CONSTRAINT note_diff_files_pkey PRIMARY KEY (id); +ALTER TABLE ONLY note_metadata + ADD CONSTRAINT note_metadata_pkey PRIMARY KEY (note_id); + ALTER TABLE ONLY notes ADD CONSTRAINT notes_pkey PRIMARY KEY (id); @@ -27053,6 +27639,12 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY operations_user_lists ADD CONSTRAINT operations_user_lists_pkey PRIMARY KEY (id); +ALTER TABLE ONLY organizations + ADD CONSTRAINT organizations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY p_ci_runner_machine_builds + ADD CONSTRAINT p_ci_runner_machine_builds_pkey PRIMARY KEY (build_id, partition_id); + ALTER TABLE ONLY packages_build_infos ADD CONSTRAINT packages_build_infos_pkey PRIMARY KEY (id); @@ -27113,15 +27705,15 @@ ALTER TABLE ONLY packages_dependencies ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT packages_dependency_links_pkey PRIMARY KEY (id); -ALTER TABLE ONLY packages_events - ADD CONSTRAINT packages_events_pkey PRIMARY KEY (id); - ALTER TABLE ONLY packages_helm_file_metadata ADD CONSTRAINT packages_helm_file_metadata_pkey PRIMARY KEY (package_file_id); ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_npm_metadata_caches + ADD CONSTRAINT packages_npm_metadata_caches_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_npm_metadata ADD CONSTRAINT packages_npm_metadata_pkey PRIMARY KEY (package_id); @@ -27179,8 +27771,14 @@ ALTER TABLE ONLY plan_limits ALTER TABLE ONLY plans ADD CONSTRAINT plans_pkey PRIMARY KEY (id); +ALTER TABLE ONLY pm_advisories + ADD CONSTRAINT pm_advisories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY pm_affected_packages + ADD CONSTRAINT pm_affected_packages_pkey PRIMARY KEY (id); + ALTER TABLE ONLY pm_checkpoints - ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (purl_type); + ADD CONSTRAINT pm_checkpoints_pkey PRIMARY KEY (purl_type, data_type, version_format); ALTER TABLE ONLY pm_licenses ADD CONSTRAINT pm_licenses_pkey PRIMARY KEY (id); @@ -27302,6 +27900,9 @@ ALTER TABLE ONLY project_security_settings ALTER TABLE ONLY project_settings ADD CONSTRAINT project_settings_pkey PRIMARY KEY (project_id); +ALTER TABLE ONLY project_states + ADD CONSTRAINT project_states_pkey PRIMARY KEY (id); + ALTER TABLE ONLY project_statistics ADD CONSTRAINT project_statistics_pkey PRIMARY KEY (id); @@ -27380,6 +27981,9 @@ ALTER TABLE releases ALTER TABLE ONLY releases ADD CONSTRAINT releases_pkey PRIMARY KEY (id); +ALTER TABLE ONLY remote_development_agent_configs + ADD CONSTRAINT remote_development_agent_configs_pkey PRIMARY KEY (id); + ALTER TABLE ONLY remote_mirrors ADD CONSTRAINT remote_mirrors_pkey PRIMARY KEY (id); @@ -27401,6 +28005,9 @@ ALTER TABLE ONLY resource_iteration_events ALTER TABLE ONLY resource_label_events ADD CONSTRAINT resource_label_events_pkey PRIMARY KEY (id); +ALTER TABLE ONLY resource_link_events + ADD CONSTRAINT resource_link_events_pkey PRIMARY KEY (id); + ALTER TABLE ONLY resource_milestone_events ADD CONSTRAINT resource_milestone_events_pkey PRIMARY KEY (id); @@ -27443,6 +28050,9 @@ ALTER TABLE ONLY sbom_vulnerable_component_versions ALTER TABLE ONLY scan_result_policies ADD CONSTRAINT scan_result_policies_pkey PRIMARY KEY (id); +ALTER TABLE ONLY schema_inconsistencies + ADD CONSTRAINT schema_inconsistencies_pkey PRIMARY KEY (id); + ALTER TABLE ONLY schema_migrations ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); @@ -27452,6 +28062,12 @@ ALTER TABLE ONLY scim_identities ALTER TABLE ONLY scim_oauth_access_tokens ADD CONSTRAINT scim_oauth_access_tokens_pkey PRIMARY KEY (id); +ALTER TABLE ONLY search_indices + ADD CONSTRAINT search_indices_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY search_namespace_index_assignments + ADD CONSTRAINT search_namespace_index_assignments_pkey PRIMARY KEY (id); + ALTER TABLE ONLY security_findings ADD CONSTRAINT security_findings_pkey PRIMARY KEY (id, partition_number); @@ -27482,8 +28098,11 @@ ALTER TABLE ONLY sentry_issues ALTER TABLE ONLY sprints ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED; -ALTER TABLE ONLY serverless_domain_cluster - ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid); +ALTER TABLE ONLY service_desk_custom_email_credentials + ADD CONSTRAINT service_desk_custom_email_credentials_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY service_desk_custom_email_verifications + ADD CONSTRAINT service_desk_custom_email_verifications_pkey PRIMARY KEY (project_id); ALTER TABLE ONLY service_desk_settings ADD CONSTRAINT service_desk_settings_pkey PRIMARY KEY (project_id); @@ -27665,6 +28284,12 @@ ALTER TABLE ONLY users_star_projects ALTER TABLE ONLY users_statistics ADD CONSTRAINT users_statistics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY value_stream_dashboard_aggregations + ADD CONSTRAINT value_stream_dashboard_aggregations_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY value_stream_dashboard_counts + ADD CONSTRAINT value_stream_dashboard_counts_pkey PRIMARY KEY (namespace_id, metric, recorded_at, count, id); + ALTER TABLE ONLY verification_codes ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); @@ -27770,6 +28395,9 @@ ALTER TABLE ONLY work_item_types ALTER TABLE ONLY work_item_widget_definitions ADD CONSTRAINT work_item_widget_definitions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY workspaces + ADD CONSTRAINT workspaces_pkey PRIMARY KEY (id); + ALTER TABLE ONLY x509_certificates ADD CONSTRAINT x509_certificates_pkey PRIMARY KEY (id); @@ -28721,6 +29349,8 @@ CREATE UNIQUE INDEX any_approver_project_rule_type_unique_index ON approval_proj CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id); +CREATE INDEX bulk_import_export_uploads_batch_id ON bulk_import_export_uploads USING btree (batch_id); + CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation); CREATE INDEX ca_aggregations_last_consistency_check_updated_at ON analytics_cycle_analytics_aggregations USING btree (last_consistency_check_updated_at NULLS FIRST) WHERE (enabled IS TRUE); @@ -28763,16 +29393,32 @@ CREATE UNIQUE INDEX finding_link_url_idx ON vulnerability_finding_links USING bt CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id); +CREATE UNIQUE INDEX i_affected_packages_unique_for_upsert ON pm_affected_packages USING btree (pm_advisory_id, purl_type, package_name, distro_version); + CREATE INDEX i_batched_background_migration_job_transition_logs_on_job_id ON ONLY batched_background_migration_job_transition_logs USING btree (batched_background_migration_job_id); +CREATE UNIQUE INDEX i_bulk_import_export_batches_id_batch_number ON bulk_import_export_batches USING btree (export_id, batch_number); + +CREATE UNIQUE INDEX i_bulk_import_trackers_id_batch_number ON bulk_import_batch_trackers USING btree (tracker_id, batch_number); + CREATE INDEX i_compliance_frameworks_on_id_and_created_at ON compliance_management_frameworks USING btree (id, created_at, pipeline_configuration_full_path); +CREATE INDEX i_compliance_violations_on_project_id_merged_at_and_id ON merge_requests_compliance_violations USING btree (target_project_id, merged_at, id); + +CREATE INDEX i_compliance_violations_on_project_id_reason_and_id ON merge_requests_compliance_violations USING btree (target_project_id, reason, id); + +CREATE INDEX i_compliance_violations_on_project_id_severity_and_id ON merge_requests_compliance_violations USING btree (target_project_id, severity_level DESC, id DESC); + +CREATE INDEX i_compliance_violations_on_project_id_title_and_id ON merge_requests_compliance_violations USING btree (target_project_id, title, id); + 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 INDEX i_pkgs_deb_file_meta_on_updated_at_package_file_id_when_unknown ON packages_debian_file_metadata USING btree (updated_at, package_file_id) WHERE (file_type = 1); + 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); @@ -28781,12 +29427,18 @@ CREATE UNIQUE INDEX i_pm_package_versions_on_package_id_and_version ON pm_packag CREATE UNIQUE INDEX i_pm_packages_purl_type_and_name ON pm_packages USING btree (purl_type, name); +CREATE INDEX i_users_on_last_activity_for_active_human_service_migration ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = 4))); + 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_approval_merge_request_rules_on_scan_result_policy_id ON approval_merge_request_rules USING btree (scan_result_policy_id); + CREATE INDEX idx_approval_merge_request_rules_on_sec_orchestration_config_id ON approval_merge_request_rules USING btree (security_orchestration_policy_configuration_id); +CREATE INDEX idx_approval_project_rules_on_scan_result_policy_id ON approval_project_rules USING btree (scan_result_policy_id); + CREATE INDEX idx_approval_project_rules_on_sec_orchestration_config_id ON approval_project_rules USING btree (security_orchestration_policy_configuration_id); CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); @@ -28863,8 +29515,6 @@ CREATE INDEX idx_merge_requests_on_merged_state ON merge_requests USING btree (i CREATE INDEX idx_merge_requests_on_source_project_and_branch_state_opened ON merge_requests USING btree (source_project_id, source_branch) WHERE (state_id = 1); -CREATE INDEX idx_merge_requests_on_state_id_and_merge_status ON merge_requests USING btree (state_id, merge_status) WHERE ((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text)); - CREATE INDEX idx_merge_requests_on_target_project_id_and_iid_opened ON merge_requests USING btree (target_project_id, iid) WHERE (state_id = 1); CREATE INDEX idx_merge_requests_on_target_project_id_and_locked_state ON merge_requests USING btree (target_project_id) WHERE (state_id = 4); @@ -28949,8 +29599,6 @@ CREATE UNIQUE INDEX idx_security_scans_on_build_and_scan_type ON security_scans CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan_type); -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); @@ -28977,10 +29625,28 @@ CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_issue_ CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_link_type ON vulnerability_issue_links USING btree (vulnerability_id, link_type) WHERE (link_type = 2); +CREATE INDEX idx_vulnerability_reads_project_id_scanner_id_vulnerability_id ON vulnerability_reads USING btree (project_id, scanner_id, vulnerability_id); + CREATE UNIQUE INDEX idx_work_item_types_on_namespace_id_and_name_null_namespace ON work_item_types USING btree (btrim(lower(name)), ((namespace_id IS NULL))) WHERE (namespace_id IS NULL); +CREATE INDEX index_abuse_report_events_on_abuse_report_id ON abuse_report_events USING btree (abuse_report_id); + +CREATE INDEX index_abuse_report_events_on_user_id ON abuse_report_events USING btree (user_id); + +CREATE INDEX index_abuse_reports_on_status_and_created_at ON abuse_reports USING btree (status, created_at); + +CREATE INDEX index_abuse_reports_on_status_and_id ON abuse_reports USING btree (status, id); + +CREATE INDEX index_abuse_reports_on_status_and_updated_at ON abuse_reports USING btree (status, updated_at); + +CREATE INDEX index_abuse_reports_on_status_category_and_id ON abuse_reports USING btree (status, category, id); + +CREATE INDEX index_abuse_reports_on_status_reporter_id_and_id ON abuse_reports USING btree (status, reporter_id, id); + CREATE INDEX index_abuse_reports_on_user_id ON abuse_reports USING btree (user_id); +CREATE INDEX index_abuse_trust_scores_on_user_id_and_source_and_created_at ON abuse_trust_scores USING btree (user_id, source, created_at); + CREATE UNIQUE INDEX "index_achievements_on_namespace_id_LOWER_name" ON achievements USING btree (namespace_id, lower(name)); CREATE INDEX index_agent_activity_events_on_agent_id_and_recorded_at_and_id ON agent_activity_events USING btree (agent_id, recorded_at, id); @@ -29001,7 +29667,13 @@ 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 UNIQUE INDEX index_agent_user_access_on_agent_id_and_group_id ON agent_user_access_group_authorizations USING btree (agent_id, group_id); + +CREATE UNIQUE INDEX index_agent_user_access_on_agent_id_and_project_id ON agent_user_access_project_authorizations USING btree (agent_id, project_id); + +CREATE INDEX index_agent_user_access_on_group_id ON agent_user_access_group_authorizations USING btree (group_id); + +CREATE INDEX index_agent_user_access_on_project_id ON agent_user_access_project_authorizations USING btree (project_id); CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assignees USING btree (alert_id); @@ -29041,20 +29713,6 @@ CREATE INDEX index_analytics_ca_group_stages_on_value_stream_id ON analytics_cyc CREATE UNIQUE INDEX index_analytics_ca_group_value_streams_on_group_id_and_name ON analytics_cycle_analytics_group_value_streams USING btree (group_id, name); -CREATE INDEX index_analytics_ca_project_stages_on_end_event_label_id ON analytics_cycle_analytics_project_stages USING btree (end_event_label_id); - -CREATE INDEX index_analytics_ca_project_stages_on_project_id ON analytics_cycle_analytics_project_stages USING btree (project_id); - -CREATE UNIQUE INDEX index_analytics_ca_project_stages_on_project_id_and_name ON analytics_cycle_analytics_project_stages USING btree (project_id, name); - -CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON analytics_cycle_analytics_project_stages USING btree (relative_position); - -CREATE INDEX index_analytics_ca_project_stages_on_start_event_label_id ON analytics_cycle_analytics_project_stages USING btree (start_event_label_id); - -CREATE INDEX index_analytics_ca_project_stages_on_value_stream_id ON analytics_cycle_analytics_project_stages USING btree (project_value_stream_id); - -CREATE UNIQUE INDEX index_analytics_ca_project_value_streams_on_project_id_and_name ON analytics_cycle_analytics_project_value_streams USING btree (project_id, name); - CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); CREATE UNIQUE INDEX index_analytics_dashboards_pointers_on_namespace_id ON analytics_dashboards_pointers USING btree (namespace_id); @@ -29149,10 +29807,6 @@ CREATE UNIQUE INDEX index_aws_roles_on_role_external_id ON aws_roles USING btree 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); @@ -29253,6 +29907,8 @@ CREATE INDEX index_broadcast_messages_on_namespace_id ON broadcast_messages USIN CREATE INDEX index_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids); +CREATE INDEX index_bulk_import_batch_trackers_on_tracker_id ON bulk_import_batch_trackers USING btree (tracker_id); + 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_and_status ON bulk_import_entities USING btree (bulk_import_id, status); @@ -29263,6 +29919,8 @@ CREATE INDEX index_bulk_import_entities_on_parent_id ON bulk_import_entities USI CREATE INDEX index_bulk_import_entities_on_project_id ON bulk_import_entities USING btree (project_id); +CREATE INDEX index_bulk_import_export_batches_on_export_id ON bulk_import_export_batches USING btree (export_id); + CREATE INDEX index_bulk_import_export_uploads_on_export_id ON bulk_import_export_uploads USING btree (export_id); CREATE INDEX index_bulk_import_failures_on_bulk_import_entity_id ON bulk_import_failures USING btree (bulk_import_entity_id); @@ -29271,6 +29929,8 @@ CREATE INDEX index_bulk_import_failures_on_correlation_id_value ON bulk_import_f CREATE INDEX index_bulk_imports_on_user_id ON bulk_imports USING btree (user_id); +CREATE UNIQUE INDEX index_catalog_resources_on_project_id ON catalog_resources USING btree (project_id); + CREATE INDEX index_chat_names_on_team_id_and_chat_id ON chat_names USING btree (team_id, chat_id); CREATE INDEX index_chat_names_on_user_id ON chat_names USING btree (user_id); @@ -29307,10 +29967,6 @@ CREATE UNIQUE INDEX p_ci_builds_metadata_build_id_partition_id_idx ON ONLY p_ci_ CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id_partition_id_unique ON ci_builds_metadata USING btree (build_id, partition_id); -CREATE UNIQUE INDEX p_ci_builds_metadata_id_partition_id_idx ON ONLY p_ci_builds_metadata USING btree (id, partition_id); - -CREATE UNIQUE INDEX index_ci_builds_metadata_on_id_partition_id_unique ON ci_builds_metadata USING btree (id, partition_id); - CREATE INDEX p_ci_builds_metadata_project_id_idx ON ONLY p_ci_builds_metadata USING btree (project_id); CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id); @@ -29327,8 +29983,6 @@ CREATE INDEX index_ci_builds_on_commit_id_and_type_and_ref ON ci_builds USING bt CREATE INDEX index_ci_builds_on_commit_id_artifacts_expired_at_and_id ON ci_builds USING btree (commit_id, artifacts_expire_at, id) WHERE (((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('dependency_scanning'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text]))); -CREATE UNIQUE INDEX index_ci_builds_on_id_partition_id_unique ON ci_builds USING btree (id, partition_id); - CREATE INDEX index_ci_builds_on_project_id_and_id ON ci_builds USING btree (project_id, id); CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING btree (project_id, name, ref) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = 'success'::text) AND ((retried = false) OR (retried IS NULL))); @@ -29341,8 +29995,6 @@ 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_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted 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); @@ -29367,6 +30019,12 @@ CREATE INDEX index_ci_daily_build_group_report_results_on_project_and_date ON ci CREATE INDEX index_ci_deleted_objects_on_pick_up_at ON ci_deleted_objects USING btree (pick_up_at); +CREATE INDEX index_ci_editor_ai_messages_created_at ON ci_editor_ai_conversation_messages USING btree (created_at); + +CREATE INDEX index_ci_editor_ai_messages_on_user_project_and_created_at ON ci_editor_ai_conversation_messages USING btree (user_id, project_id, created_at); + +CREATE INDEX index_ci_editor_ai_messages_project_id ON ci_editor_ai_conversation_messages USING btree (project_id); + CREATE INDEX index_ci_freeze_periods_on_project_id ON ci_freeze_periods USING btree (project_id); CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment ON ci_group_variables USING btree (group_id, key, environment_scope); @@ -29375,14 +30033,14 @@ CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables CREATE INDEX index_ci_job_artifact_states_on_job_artifact_id ON ci_job_artifact_states USING btree (job_artifact_id); +CREATE INDEX index_ci_job_artifacts_expire_at_unlocked_non_trace ON ci_job_artifacts USING btree (expire_at) WHERE ((locked = 0) AND (file_type <> 3) AND (expire_at IS NOT NULL)); + CREATE INDEX index_ci_job_artifacts_for_terraform_reports ON ci_job_artifacts USING btree (project_id, id) WHERE (file_type = 18); CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts USING btree (id) WHERE (file_type = 18); CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts USING btree (expire_at, job_id); -CREATE INDEX index_ci_job_artifacts_on_expire_at_for_removal ON ci_job_artifacts USING btree (expire_at) WHERE ((locked = 0) AND (expire_at IS NOT NULL)); - 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])); @@ -29529,6 +30187,8 @@ CREATE INDEX index_ci_resources_on_partition_id_build_id ON ci_resources USING b 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_machine_builds_on_runner_machine_id ON ONLY p_ci_runner_machine_builds USING btree (runner_machine_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); @@ -29679,28 +30339,6 @@ CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp U CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id); -CREATE UNIQUE INDEX index_clusters_applications_cert_managers_on_cluster_id ON clusters_applications_cert_managers USING btree (cluster_id); - -CREATE UNIQUE INDEX index_clusters_applications_cilium_on_cluster_id ON clusters_applications_cilium USING btree (cluster_id); - -CREATE UNIQUE INDEX index_clusters_applications_crossplane_on_cluster_id ON clusters_applications_crossplane 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 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); - -CREATE UNIQUE INDEX index_clusters_applications_knative_on_cluster_id ON clusters_applications_knative USING btree (cluster_id); - -CREATE UNIQUE INDEX index_clusters_applications_prometheus_on_cluster_id ON clusters_applications_prometheus USING btree (cluster_id); - -CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON clusters_applications_runners USING btree (cluster_id); - -CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); - CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id); CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id); @@ -29725,12 +30363,12 @@ CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_c CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled); +CREATE INDEX index_container_registry_data_repair_details_on_status ON container_registry_data_repair_details USING btree (status); + CREATE INDEX index_container_repositories_on_greatest_completed_at ON container_repositories USING btree (GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at, migration_skipped_at)) WHERE (migration_state = ANY (ARRAY['import_done'::text, 'pre_import_done'::text, 'import_aborted'::text, 'import_skipped'::text])); CREATE INDEX index_container_repositories_on_migration_state_import_done_at ON container_repositories USING btree (migration_state, migration_import_done_at); -CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id); - CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repositories USING btree (project_id, id); CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON container_repositories USING btree (project_id, name); @@ -29739,6 +30377,14 @@ CREATE INDEX index_container_repositories_on_status_and_id ON container_reposito CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops); +CREATE INDEX index_container_repository_states_failed_verification ON container_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_container_repository_states_needs_verification ON container_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_container_repository_states_on_verification_state ON container_repository_states USING btree (verification_state); + +CREATE INDEX index_container_repository_states_pending_verification ON container_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE UNIQUE INDEX index_content_blocked_states_on_container_id_commit_sha_path ON content_blocked_states USING btree (container_identifier, commit_sha, path); CREATE UNIQUE INDEX index_coverage_fuzzing_corpuses_on_package_id ON coverage_fuzzing_corpuses USING btree (package_id); @@ -29929,6 +30575,16 @@ CREATE INDEX index_design_management_designs_versions_on_event ON design_managem CREATE INDEX index_design_management_designs_versions_on_version_id ON design_management_designs_versions USING btree (version_id); +CREATE UNIQUE INDEX index_design_management_repositories_on_project_id ON design_management_repositories USING btree (project_id); + +CREATE INDEX index_design_management_repository_states_failed_verification ON design_management_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_design_management_repository_states_needs_verification ON design_management_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_design_management_repository_states_on_verification_state ON design_management_repository_states USING btree (verification_state); + +CREATE INDEX index_design_management_repository_states_pending_verification ON design_management_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_design_management_versions_on_author_id ON design_management_versions USING btree (author_id) WHERE (author_id IS NOT NULL); CREATE INDEX index_design_management_versions_on_issue_id ON design_management_versions USING btree (issue_id); @@ -29945,6 +30601,8 @@ CREATE UNIQUE INDEX index_dora_configurations_on_project_id ON dora_configuratio CREATE UNIQUE INDEX index_dora_daily_metrics_on_environment_id_and_date ON dora_daily_metrics USING btree (environment_id, date); +CREATE UNIQUE INDEX index_dora_performance_scores_on_project_id_and_date ON dora_performance_scores USING btree (project_id, date); + CREATE INDEX index_draft_notes_on_author_id ON draft_notes USING btree (author_id); CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (discussion_id); @@ -30067,8 +30725,6 @@ CREATE INDEX index_events_for_group_activity ON events USING btree (group_id, ta CREATE INDEX index_events_for_project_activity ON events USING btree (project_id, target_type, action, id); -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); CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events USING btree (author_id, created_at) WHERE ((target_type)::text = 'MergeRequest'::text); @@ -30105,6 +30761,8 @@ CREATE UNIQUE INDEX index_feature_gates_on_feature_key_and_key_and_value ON feat CREATE UNIQUE INDEX index_features_on_key ON features USING btree (key); +CREATE INDEX index_for_security_scans_scan_type ON security_scans USING btree (scan_type, project_id, pipeline_id) WHERE (status = 1); + CREATE INDEX index_for_status_per_branch_per_project ON merge_trains USING btree (target_project_id, target_branch, status); CREATE INDEX index_fork_network_members_on_fork_network_id ON fork_network_members USING btree (fork_network_id); @@ -30115,6 +30773,8 @@ CREATE UNIQUE INDEX index_fork_network_members_on_project_id ON fork_network_mem CREATE UNIQUE INDEX index_fork_networks_on_root_project_id ON fork_networks USING btree (root_project_id); +CREATE INDEX index_fuc_over_limit_notified_at ON namespace_details USING btree (free_user_cap_over_limit_notified_at); + CREATE INDEX index_geo_event_log_on_cache_invalidation_event_id ON geo_event_log USING btree (cache_invalidation_event_id) WHERE (cache_invalidation_event_id IS NOT NULL); CREATE INDEX index_geo_event_log_on_geo_event_id ON geo_event_log USING btree (geo_event_id) WHERE (geo_event_id IS NOT NULL); @@ -30239,6 +30899,8 @@ CREATE UNIQUE INDEX index_group_deploy_tokens_on_group_and_deploy_token_ids ON g CREATE UNIQUE INDEX index_group_group_links_on_shared_group_and_shared_with_group ON group_group_links USING btree (shared_group_id, shared_with_group_id); +CREATE INDEX index_group_group_links_on_shared_with_group_and_group_access ON group_group_links USING btree (shared_with_group_id, group_access); + CREATE INDEX index_group_group_links_on_shared_with_group_and_shared_group ON group_group_links USING btree (shared_with_group_id, shared_group_id); CREATE INDEX index_group_import_states_on_group_id ON group_import_states USING btree (group_id); @@ -30299,6 +30961,8 @@ CREATE INDEX index_import_export_uploads_on_updated_at ON import_export_uploads CREATE INDEX index_import_failures_on_correlation_id_value ON import_failures USING btree (correlation_id_value); +CREATE INDEX index_import_failures_on_external_identifiers ON import_failures USING btree (external_identifiers) WHERE (external_identifiers <> '{}'::jsonb); + CREATE INDEX index_import_failures_on_group_id_not_null ON import_failures USING btree (group_id) WHERE (group_id IS NOT NULL); CREATE INDEX index_import_failures_on_project_id_and_correlation_id_value ON import_failures USING btree (project_id, correlation_id_value) WHERE (retry_count = 0); @@ -30383,6 +31047,8 @@ CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree CREATE INDEX index_issue_assignees_on_user_id_and_issue_id ON issue_assignees USING btree (user_id, issue_id); +CREATE INDEX index_issue_assignment_events_on_user_id ON issue_assignment_events USING btree (user_id); + CREATE UNIQUE INDEX index_issue_crm_contacts_on_issue_id_and_contact_id ON issue_customer_relations_contacts USING btree (issue_id, contact_id); CREATE INDEX index_issue_customer_relations_contacts_on_contact_id ON issue_customer_relations_contacts USING btree (contact_id); @@ -30537,6 +31203,8 @@ CREATE INDEX index_lfs_object_states_on_verification_state ON lfs_object_states CREATE INDEX index_lfs_object_states_pending_verification ON lfs_object_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); +CREATE INDEX index_lfs_objects_on_file ON lfs_objects USING btree (file); + CREATE INDEX index_lfs_objects_on_file_store ON lfs_objects USING btree (file_store); CREATE UNIQUE INDEX index_lfs_objects_on_oid ON lfs_objects USING btree (oid); @@ -30613,6 +31281,8 @@ CREATE UNIQUE INDEX index_merge_request_assignees_on_merge_request_id_and_user_i CREATE INDEX index_merge_request_assignees_on_user_id ON merge_request_assignees USING btree (user_id); +CREATE INDEX index_merge_request_assignment_events_on_user_id ON merge_request_assignment_events USING btree (user_id); + CREATE INDEX index_merge_request_blocks_on_blocked_merge_request_id ON merge_request_blocks USING btree (blocked_merge_request_id); CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON merge_request_cleanup_schedules USING btree (merge_request_id); @@ -30633,8 +31303,14 @@ CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_req CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); +CREATE INDEX index_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id); + +CREATE INDEX index_merge_request_diff_llm_summaries_on_user_id ON merge_request_diff_llm_summaries USING btree (user_id); + CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL))); +CREATE INDEX index_merge_request_diffs_on_external_diff ON merge_request_diffs USING btree (external_diff); + CREATE INDEX index_merge_request_diffs_on_external_diff_store ON merge_request_diffs USING btree (external_diff_store); CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON merge_request_diffs USING btree (merge_request_id, id); @@ -30707,8 +31383,6 @@ CREATE UNIQUE INDEX index_merge_requests_on_target_project_id_and_iid ON merge_r CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON merge_requests USING btree (target_project_id, iid, state_id); -CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text); - CREATE INDEX index_merge_requests_on_target_project_id_and_source_branch ON merge_requests USING btree (target_project_id, source_branch); CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON merge_requests USING btree (target_project_id, squash_commit_sha); @@ -30717,8 +31391,6 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merg 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_trigram ON merge_requests USING gin (title gin_trgm_ops) WITH (fastupdate='false'); CREATE INDEX index_merge_requests_on_tp_id_and_merge_commit_sha_and_id ON merge_requests USING btree (target_project_id, merge_commit_sha, id); @@ -30769,7 +31441,15 @@ CREATE INDEX index_ml_candidate_params_on_candidate_id ON ml_candidate_params US CREATE UNIQUE INDEX index_ml_candidate_params_on_candidate_id_on_name ON ml_candidate_params USING btree (candidate_id, name); -CREATE UNIQUE INDEX index_ml_candidates_on_experiment_id_and_iid ON ml_candidates USING btree (experiment_id, iid); +CREATE INDEX index_ml_candidates_on_ci_build_id ON ml_candidates USING btree (ci_build_id); + +CREATE UNIQUE INDEX index_ml_candidates_on_experiment_id_and_eid ON ml_candidates USING btree (experiment_id, eid); + +CREATE INDEX index_ml_candidates_on_package_id ON ml_candidates USING btree (package_id); + +CREATE INDEX index_ml_candidates_on_project_id ON ml_candidates USING btree (project_id); + +CREATE INDEX index_ml_candidates_on_project_id_on_internal_id ON ml_candidates USING btree (project_id, internal_id); CREATE INDEX index_ml_candidates_on_user_id ON ml_candidates USING btree (user_id); @@ -30853,16 +31533,20 @@ CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id CREATE INDEX index_namespaces_on_type_and_visibility_and_parent_id ON namespaces USING btree (id) WHERE (((type)::text = 'Group'::text) AND (parent_id IS NULL) AND (visibility_level <> 20)); -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_on_updated_at ON namespaces USING btree (updated_at); -CREATE INDEX index_namespaces_storage_limit_exclusions_on_namespace_id ON namespaces_storage_limit_exclusions USING btree (namespace_id); +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_sync_events_on_namespace_id ON namespaces_sync_events USING btree (namespace_id); +CREATE INDEX index_next_over_limit_check_at_asc_order ON namespace_details USING btree (next_over_limit_check_at NULLS FIRST); + 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)); CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id); +CREATE INDEX index_note_metadata_on_note_id ON note_metadata USING btree (note_id); + CREATE INDEX index_notes_for_cherry_picked_merge_requests ON notes USING btree (project_id, commit_id) WHERE ((noteable_type)::text = 'MergeRequest'::text); CREATE INDEX index_notes_on_author_id_and_created_at_and_id ON notes USING btree (author_id, created_at, id); @@ -30891,8 +31575,14 @@ CREATE INDEX index_notification_settings_on_source_and_level_and_user ON notific CREATE UNIQUE INDEX index_notifications_on_user_id_and_source_id_and_source_type ON notification_settings USING btree (user_id, source_id, source_type); +CREATE UNIQUE INDEX index_npm_metadata_caches_on_package_name_project_id_unique ON packages_npm_metadata_caches USING btree (package_name, project_id) WHERE (project_id IS NOT NULL); + +CREATE INDEX index_ns_root_stor_stats_on_registry_size_estimated ON namespace_root_storage_statistics USING btree (registry_size_estimated); + CREATE UNIQUE INDEX index_ns_user_callouts_feature ON user_namespace_callouts USING btree (user_id, feature_name, namespace_id); +CREATE INDEX index_oauth_access_grants_on_application_id ON oauth_access_grants USING btree (application_id); + CREATE INDEX index_oauth_access_grants_on_resource_owner_id ON oauth_access_grants USING btree (resource_owner_id, application_id, created_at); CREATE UNIQUE INDEX index_oauth_access_grants_on_token ON oauth_access_grants USING btree (token); @@ -30923,6 +31613,8 @@ CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USI CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at); +CREATE INDEX index_on_issue_assignment_events_issue_id_action_created_at_id ON issue_assignment_events USING btree (issue_id, action, created_at, id); + CREATE INDEX index_on_issues_closed_incidents_by_project_id_and_closed_at ON issues USING btree (project_id, closed_at) WHERE ((issue_type = 1) AND (state_id = 2)); CREATE INDEX index_on_issues_health_status_asc_order ON issues USING btree (project_id, health_status, id DESC, state_id, issue_type); @@ -30937,10 +31629,14 @@ CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING bt COMMENT ON INDEX index_on_merge_requests_for_latest_diffs IS 'Index used to efficiently obtain the oldest merge request for a commit SHA'; +CREATE INDEX index_on_mr_assignment_events_mr_id_action_created_at_id ON merge_request_assignment_events USING btree (merge_request_id, action, created_at, id); + CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((name)::text)); CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text)); +CREATE INDEX index_on_namespaces_namespaces_by_top_level_namespace ON namespaces USING btree ((traversal_ids[1]), type, id); + CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_escalation_rules USING btree (oncall_schedule_id); 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)); @@ -30953,6 +31649,8 @@ CREATE INDEX index_on_projects_path ON projects USING btree (path); CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); +CREATE INDEX index_on_sbom_sources_package_manager_name ON sbom_sources USING btree ((((source -> 'package_manager'::text) ->> 'name'::text))); + CREATE INDEX index_on_todos_user_project_target_and_state ON todos USING btree (user_id, project_id, target_type, target_id, id) WHERE ((state)::text = 'pending'::text); CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); @@ -30961,6 +31659,8 @@ CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text)); +CREATE INDEX index_on_value_stream_dashboard_aggregations_last_run_at_id ON value_stream_dashboard_aggregations USING btree (last_run_at, namespace_id) WHERE (enabled IS TRUE); + CREATE INDEX index_onboarding_progresses_for_create_track ON onboarding_progresses USING btree (created_at) WHERE (git_write_at IS NULL); CREATE INDEX index_onboarding_progresses_for_team_track ON onboarding_progresses USING btree (GREATEST(git_write_at, pipeline_created_at, trial_started_at)) WHERE ((git_write_at IS NOT NULL) AND (pipeline_created_at IS NOT NULL) AND (trial_started_at IS NOT NULL) AND (user_added_at IS NULL)); @@ -30995,6 +31695,8 @@ CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name), id); +CREATE INDEX index_p_ci_runner_machine_builds_on_runner_machine_id ON ONLY p_ci_runner_machine_builds USING btree (runner_machine_id); + CREATE INDEX index_packages_build_infos_on_pipeline_id ON packages_build_infos USING btree (pipeline_id); CREATE INDEX index_packages_build_infos_package_id_pipeline_id_id ON packages_build_infos USING btree (package_id, pipeline_id, id); @@ -31027,8 +31729,6 @@ CREATE UNIQUE INDEX index_packages_dependencies_on_name_and_version_pattern ON p CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_dependency_links USING btree (dependency_id); -CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree (package_id); - CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel); CREATE INDEX index_packages_helm_file_metadata_on_pf_id_and_channel ON packages_helm_file_metadata USING btree (package_file_id, channel); @@ -31037,6 +31737,10 @@ CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_ma CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path); +CREATE UNIQUE INDEX index_packages_npm_metadata_caches_on_object_storage_key ON packages_npm_metadata_caches USING btree (object_storage_key); + +CREATE INDEX index_packages_npm_metadata_caches_on_project_id ON packages_npm_metadata_caches USING btree (project_id); + CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_nuget_dependency_link_metadata USING btree (dependency_link_id); CREATE INDEX index_packages_on_available_pypi_packages ON packages_packages USING btree (project_id, id) WHERE ((status = ANY (ARRAY[0, 1])) AND (package_type = 5) AND (version IS NOT NULL)); @@ -31045,10 +31749,14 @@ CREATE INDEX index_packages_package_file_build_infos_on_package_file_id ON packa CREATE INDEX index_packages_package_file_build_infos_on_pipeline_id ON packages_package_file_build_infos USING btree (pipeline_id); +CREATE INDEX index_packages_package_files_on_file_name ON packages_package_files USING gin (file_name gin_trgm_ops); + CREATE INDEX index_packages_package_files_on_file_store ON packages_package_files USING btree (file_store); CREATE INDEX index_packages_package_files_on_id_for_cleanup ON packages_package_files USING btree (id) WHERE (status = 1); +CREATE INDEX index_packages_package_files_on_package_id_and_created_at_desc ON packages_package_files USING btree (package_id, created_at DESC); + CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON packages_package_files USING btree (package_id, file_name); CREATE INDEX index_packages_package_files_on_package_id_id ON packages_package_files USING btree (package_id, id); @@ -31153,6 +31861,10 @@ CREATE UNIQUE INDEX index_plan_limits_on_plan_id ON plan_limits USING btree (pla CREATE UNIQUE INDEX index_plans_on_name ON plans USING btree (name); +CREATE UNIQUE INDEX index_pm_advisories_on_advisory_xid_and_source_xid ON pm_advisories USING btree (advisory_xid, source_xid); + +CREATE INDEX index_pm_affected_packages_on_pm_advisory_id ON pm_affected_packages USING btree (pm_advisory_id); + CREATE INDEX index_pm_package_version_licenses_on_pm_license_id ON pm_package_version_licenses USING btree (pm_license_id); CREATE INDEX index_pm_package_version_licenses_on_pm_package_version_id ON pm_package_version_licenses USING btree (pm_package_version_id); @@ -31165,8 +31877,6 @@ 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); @@ -31273,7 +31983,15 @@ 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_states_failed_verification ON project_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_project_states_needs_verification ON project_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE UNIQUE INDEX index_project_states_on_project_id ON project_states USING btree (project_id); + +CREATE INDEX index_project_states_on_verification_state ON project_states USING btree (verification_state); + +CREATE INDEX index_project_states_pending_verification ON project_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); CREATE INDEX index_project_statistics_on_namespace_id ON project_statistics USING btree (namespace_id); @@ -31493,6 +32211,8 @@ CREATE UNIQUE INDEX index_releases_on_project_tag_unique ON releases USING btree CREATE INDEX index_releases_on_released_at ON releases USING btree (released_at); +CREATE INDEX index_remote_development_agent_configs_on_cluster_agent_id ON remote_development_agent_configs USING btree (cluster_agent_id); + CREATE INDEX index_remote_mirrors_on_last_successful_update_at ON remote_mirrors USING btree (last_successful_update_at); CREATE INDEX index_remote_mirrors_on_project_id ON remote_mirrors USING btree (project_id); @@ -31545,6 +32265,12 @@ CREATE INDEX index_resource_label_events_on_merge_request_id_label_id_action ON CREATE INDEX index_resource_label_events_on_user_id ON resource_label_events USING btree (user_id); +CREATE INDEX index_resource_link_events_on_child_work_item_id ON resource_link_events USING btree (child_work_item_id); + +CREATE INDEX index_resource_link_events_on_issue_id ON resource_link_events USING btree (issue_id); + +CREATE INDEX index_resource_link_events_on_user_id ON resource_link_events USING btree (user_id); + CREATE INDEX index_resource_milestone_events_created_at ON resource_milestone_events USING btree (created_at); CREATE INDEX index_resource_milestone_events_on_issue_id ON resource_milestone_events USING btree (issue_id); @@ -31611,6 +32337,8 @@ CREATE INDEX index_sbom_occurrences_on_pipeline_id ON sbom_occurrences USING btr CREATE INDEX index_sbom_occurrences_on_project_id ON sbom_occurrences USING btree (project_id); +CREATE INDEX index_sbom_occurrences_on_project_id_and_id ON sbom_occurrences USING btree (project_id, id); + CREATE INDEX index_sbom_occurrences_on_source_id ON sbom_occurrences USING btree (source_id); CREATE UNIQUE INDEX index_sbom_occurrences_on_uuid ON sbom_occurrences USING btree (uuid); @@ -31619,6 +32347,8 @@ CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources CREATE INDEX index_scan_result_policies_on_policy_configuration_id ON scan_result_policies USING btree (security_orchestration_policy_configuration_id); +CREATE INDEX index_schema_inconsistencies_on_issue_id ON schema_inconsistencies USING btree (issue_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); @@ -31627,10 +32357,26 @@ CREATE UNIQUE INDEX index_scim_identities_on_user_id_and_group_id ON scim_identi CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypted ON scim_oauth_access_tokens USING btree (group_id, token_encrypted); +CREATE UNIQUE INDEX index_search_indices_on_id_and_type ON search_indices USING btree (id, type); + +CREATE UNIQUE INDEX index_search_indices_on_type_and_bucket_number ON search_indices USING btree (type, bucket_number); + +CREATE UNIQUE INDEX index_search_indices_on_type_and_path ON search_indices USING btree (type, path); + +CREATE INDEX index_search_namespace_index_assignments_on_namespace_id ON search_namespace_index_assignments USING btree (namespace_id); + +CREATE INDEX index_search_namespace_index_assignments_on_search_index_id ON search_namespace_index_assignments USING btree (search_index_id); + +CREATE UNIQUE INDEX index_search_namespace_index_assignments_uniqueness_index_type ON search_namespace_index_assignments USING btree (namespace_id, index_type); + +CREATE UNIQUE INDEX index_search_namespace_index_assignments_uniqueness_on_index_id ON search_namespace_index_assignments USING btree (namespace_id, search_index_id); + CREATE INDEX index_secure_ci_builds_on_user_id_name_created_at ON ci_builds USING btree (user_id, name, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text, ('secret_detection'::character varying)::text]))); CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)); +CREATE INDEX index_security_policy_configurations_on_bot_user_id ON security_orchestration_policy_configurations USING btree (bot_user_id) WHERE (bot_user_id IS NOT NULL); + CREATE INDEX index_security_scans_for_non_purged_records ON security_scans USING btree (created_at, id) WHERE (status <> 6); CREATE INDEX index_security_scans_on_created_at ON security_scans USING btree (created_at); @@ -31641,7 +32387,7 @@ CREATE INDEX index_security_scans_on_length_of_errors ON security_scans USING bt CREATE INDEX index_security_scans_on_length_of_warnings ON security_scans USING btree (pipeline_id, jsonb_array_length(COALESCE((info -> 'warnings'::text), '[]'::jsonb))); -CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree (pipeline_id); +CREATE INDEX index_security_scans_on_pipeline_id_and_scan_type ON security_scans USING btree (pipeline_id, scan_type); CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id); @@ -31663,9 +32409,7 @@ CREATE UNIQUE INDEX index_sentry_issues_on_issue_id ON sentry_issues USING btree CREATE INDEX index_sentry_issues_on_sentry_issue_identifier ON sentry_issues USING btree (sentry_issue_identifier); -CREATE INDEX index_serverless_domain_cluster_on_creator_id ON serverless_domain_cluster USING btree (creator_id); - -CREATE INDEX index_serverless_domain_cluster_on_pages_domain_id ON serverless_domain_cluster USING btree (pages_domain_id); +CREATE INDEX index_service_desk_custom_email_verifications_on_triggerer_id ON service_desk_custom_email_verifications USING btree (triggerer_id); 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); @@ -31955,6 +32699,10 @@ COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index'; CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id); +CREATE INDEX index_user_details_on_user_id_for_enterprise_users_with_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NOT NULL)); + +CREATE INDEX index_user_details_on_user_id_for_enterprise_users_without_date ON user_details USING btree (user_id) WHERE ((provisioned_by_group_id IS NOT NULL) AND (provisioned_by_group_at IS NULL)); + 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); @@ -31979,7 +32727,7 @@ CREATE INDEX index_user_statuses_on_user_id ON user_statuses USING btree (user_i CREATE UNIQUE INDEX index_user_synced_attributes_metadata_on_user_id ON user_synced_attributes_metadata USING btree (user_id); -CREATE INDEX index_users_for_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[6, 4]))) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[4, 5])))); +CREATE INDEX index_users_for_active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[6, 4, 13]))) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[4, 5])))); CREATE INDEX index_users_on_accepted_term_id ON users USING btree (accepted_term_id); @@ -32023,6 +32771,8 @@ CREATE INDEX index_users_on_unconfirmed_email ON users USING btree (unconfirmed_ CREATE UNIQUE INDEX index_users_on_unlock_token ON users USING btree (unlock_token); +CREATE INDEX index_users_on_updated_at ON users USING btree (updated_at); + CREATE INDEX index_users_on_user_type_and_id ON users USING btree (user_type, id); CREATE INDEX index_users_on_username ON users USING btree (username); @@ -32117,6 +32867,8 @@ CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON vulnerability_feedba CREATE INDEX index_vulnerability_finding_signatures_on_finding_id ON vulnerability_finding_signatures USING btree (finding_id); +CREATE INDEX index_vulnerability_finding_signatures_on_signature_sha ON vulnerability_finding_signatures USING btree (signature_sha); + CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vulnerability_findings_remediations USING btree (vulnerability_remediation_id); CREATE UNIQUE INDEX index_vulnerability_findings_remediations_on_unique_keys ON vulnerability_findings_remediations USING btree (vulnerability_occurrence_id, vulnerability_remediation_id); @@ -32145,6 +32897,8 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); +CREATE INDEX index_vulnerability_occurrences_for_override_uuids_logic ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint); + CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7])); CREATE INDEX index_vulnerability_occurrences_on_location_k8s_agent_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'agent_id'::text))) WHERE (report_type = 7); @@ -32187,6 +32941,8 @@ CREATE INDEX index_vulnerability_state_transitions_id_and_vulnerability_id ON vu CREATE INDEX index_vulnerability_state_transitions_on_author_id ON vulnerability_state_transitions USING btree (author_id); +CREATE INDEX index_vulnerability_state_transitions_on_pipeline_id ON vulnerability_state_transitions USING btree (state_changed_at_pipeline_id); + CREATE INDEX index_vulnerability_statistics_on_latest_pipeline_id ON vulnerability_statistics USING btree (latest_pipeline_id); CREATE INDEX index_vulnerability_statistics_on_letter_grade ON vulnerability_statistics USING btree (letter_grade); @@ -32203,6 +32959,8 @@ 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_web_hook_id_and_created_at ON ONLY web_hook_logs USING btree (web_hook_id, created_at); + CREATE INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ON ONLY web_hook_logs USING btree (created_at, web_hook_id); CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id); @@ -32255,6 +33013,14 @@ CREATE UNIQUE INDEX index_work_item_widget_definitions_on_namespace_type_and_nam 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_workspaces_on_cluster_agent_id ON workspaces USING btree (cluster_agent_id); + +CREATE UNIQUE INDEX index_workspaces_on_name ON workspaces USING btree (name); + +CREATE INDEX index_workspaces_on_project_id ON workspaces USING btree (project_id); + +CREATE INDEX index_workspaces_on_user_id ON workspaces USING btree (user_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); @@ -32295,14 +33061,14 @@ CREATE UNIQUE INDEX issue_user_mentions_on_issue_id_index ON issue_user_mentions CREATE UNIQUE INDEX kubernetes_namespaces_cluster_and_namespace ON clusters_kubernetes_namespaces USING btree (cluster_id, namespace); -CREATE INDEX merge_request_mentions_temp_index ON merge_requests USING btree (id) WHERE ((description ~~ '%@%'::text) OR ((title)::text ~~ '%@%'::text)); - CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_and_note_id_index ON merge_request_user_mentions USING btree (merge_request_id, note_id); CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_index ON merge_request_user_mentions USING btree (merge_request_id) WHERE (note_id IS NULL); CREATE INDEX merge_requests_state_id_temp_index ON merge_requests USING btree (id) WHERE (state_id = ANY (ARRAY[2, 3])); +CREATE INDEX migrate_index_users_for_active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = ANY (ARRAY[0, 6, 4, 13]))) AND ((user_type IS NULL) OR (user_type = 0) OR (user_type = ANY (ARRAY[0, 4, 5])))); + CREATE INDEX note_mentions_temp_index ON notes USING btree (id, noteable_type) WHERE (note ~~ '%@%'::text); CREATE UNIQUE INDEX one_canonical_wiki_page_slug_per_metadata ON wiki_page_slugs USING btree (wiki_page_meta_id) WHERE (canonical = true); @@ -32323,8 +33089,6 @@ CREATE INDEX partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs ON ci_b CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON deployments USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); -CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments USING btree (project_id) WHERE (tag IS TRUE); - CREATE INDEX partial_index_slack_integrations_with_bot_user_id ON slack_integrations USING btree (id) WHERE (bot_user_id IS NOT NULL); CREATE UNIQUE INDEX partial_index_sop_configs_on_namespace_id ON security_orchestration_policy_configurations USING btree (namespace_id) WHERE (namespace_id IS NOT NULL); @@ -32369,7 +33133,7 @@ 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_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); CREATE INDEX tmp_index_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)); @@ -32385,6 +33149,8 @@ CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (memb CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text)); +CREATE INDEX tmp_index_issues_on_issue_type_and_id_only_incidents ON issues USING btree (issue_type, id) WHERE (issue_type = 1); + CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); @@ -32395,6 +33161,8 @@ CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0); +CREATE INDEX tmp_index_vulnerability_dismissal_info ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL))); + CREATE INDEX tmp_index_vulnerability_overlong_title_html ON vulnerabilities USING btree (id) WHERE (length(title_html) > 800); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); @@ -32415,12 +33183,24 @@ 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_google_cloud_logging_configurations_on_namespace_id ON audit_events_google_cloud_logging_configurations USING btree (namespace_id, google_project_id_name, log_id_name); + +CREATE UNIQUE INDEX unique_idx_namespaces_storage_limit_exclusions_on_namespace_id ON namespaces_storage_limit_exclusions USING btree (namespace_id); + 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_index_on_system_note_metadata_id ON resource_link_events USING btree (system_note_metadata_id); + CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); +CREATE UNIQUE INDEX unique_organizations_on_name_lower ON organizations USING btree (lower(name)); + +CREATE UNIQUE INDEX unique_packages_project_id_and_name_and_version_when_debian ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 9) AND (status <> 4)); + +CREATE UNIQUE INDEX unique_postgres_async_fk_validations_name_and_table_name ON postgres_async_foreign_key_validations USING btree (name, table_name); + CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id); CREATE UNIQUE INDEX unique_streaming_event_type_filters_destination_id ON audit_events_streaming_event_type_filters USING btree (external_audit_event_destination_id, audit_event_type); @@ -33717,16 +34497,12 @@ 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; ALTER INDEX p_ci_builds_metadata_build_id_partition_id_idx ATTACH PARTITION index_ci_builds_metadata_on_build_id_partition_id_unique; -ALTER INDEX p_ci_builds_metadata_id_partition_id_idx ATTACH PARTITION index_ci_builds_metadata_on_id_partition_id_unique; - ALTER INDEX p_ci_builds_metadata_project_id_idx ATTACH PARTITION index_ci_builds_metadata_on_project_id; CREATE TRIGGER chat_names_loose_fk_trigger AFTER DELETE ON chat_names REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); @@ -33735,6 +34511,8 @@ CREATE TRIGGER ci_builds_loose_fk_trigger AFTER DELETE ON ci_builds REFERENCING CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); +CREATE TRIGGER ci_runner_machines_loose_fk_trigger AFTER DELETE ON ci_runner_machines REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); + CREATE TRIGGER ci_runners_loose_fk_trigger AFTER DELETE ON ci_runners REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER clusters_loose_fk_trigger AFTER DELETE ON clusters REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); @@ -33747,6 +34525,12 @@ 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 push_rules_loose_fk_trigger AFTER DELETE ON push_rules REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); + +CREATE TRIGGER tags_loose_fk_trigger AFTER DELETE ON tags REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); + +CREATE TRIGGER trigger_023e82d8e257 BEFORE INSERT OR UPDATE ON ci_pipeline_variables FOR EACH ROW EXECUTE FUNCTION trigger_023e82d8e257(); + 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(); @@ -33755,8 +34539,6 @@ CREATE TRIGGER trigger_17c3a95ee58a BEFORE INSERT OR UPDATE ON commit_user_menti 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(); @@ -33765,7 +34547,9 @@ CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metad 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_909cf0a06094 BEFORE INSERT OR UPDATE ON award_emoji FOR EACH ROW EXECUTE FUNCTION trigger_909cf0a06094(); + +CREATE TRIGGER trigger_b2d852e1e2cb BEFORE INSERT OR UPDATE ON ci_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_b2d852e1e2cb(); CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc(); @@ -33775,7 +34559,7 @@ CREATE TRIGGER trigger_c2051020aa8b BEFORE INSERT OR UPDATE ON issue_user_mentio 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_cd1aeb22b34a BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_cd1aeb22b34a(); CREATE TRIGGER trigger_dca935e3a712 BEFORE INSERT OR UPDATE ON todos FOR EACH ROW EXECUTE FUNCTION trigger_dca935e3a712(); @@ -33834,6 +34618,12 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY environments ADD CONSTRAINT fk_01a033a308 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE SET NULL; +ALTER TABLE ONLY security_orchestration_policy_configurations + ADD CONSTRAINT fk_0247484b90 FOREIGN KEY (bot_user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY agent_user_access_project_authorizations + ADD CONSTRAINT fk_0250c0ad51 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; + ALTER TABLE ONLY incident_management_escalation_rules ADD CONSTRAINT fk_0314ee86eb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -33843,6 +34633,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 projects + ADD CONSTRAINT fk_03ec10b0d3 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY analytics_dashboards_pointers ADD CONSTRAINT fk_05d96922bd FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33855,6 +34648,12 @@ ALTER TABLE ONLY merge_requests ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_0894651f08 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_assignment_events + ADD CONSTRAINT fk_08f7602bfd FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY remote_development_agent_configs + ADD CONSTRAINT fk_0a3c0ada56 FOREIGN KEY (cluster_agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_sites ADD CONSTRAINT fk_0a57f2271b FOREIGN KEY (dast_site_validation_id) REFERENCES dast_site_validations(id) ON DELETE SET NULL; @@ -33891,9 +34690,6 @@ ALTER TABLE ONLY vulnerabilities ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_131d289c65 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; -ALTER TABLE ONLY webauthn_registrations - ADD CONSTRAINT fk_13e04d719a FOREIGN KEY (u2f_registration_id) REFERENCES u2f_registrations(id) ON DELETE CASCADE; - ALTER TABLE ONLY sbom_occurrences ADD CONSTRAINT fk_157506c0e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33912,6 +34708,9 @@ ALTER TABLE ONLY incident_management_timeline_events ALTER TABLE ONLY project_features ADD CONSTRAINT fk_18513d9b92 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY abuse_report_events + ADD CONSTRAINT fk_18c774c06b FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_190998ef09 FOREIGN KEY (external_pull_request_id) REFERENCES external_pull_requests(id) ON DELETE SET NULL; @@ -33975,12 +34774,21 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY user_namespace_callouts ADD CONSTRAINT fk_27a69fd1bd FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY project_group_links + ADD CONSTRAINT fk_28a1244b01 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY merge_requests_compliance_violations ADD CONSTRAINT fk_290ec1ab02 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; ALTER TABLE ONLY coverage_fuzzing_corpuses ADD CONSTRAINT fk_29f6f15f82 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY resource_link_events + ADD CONSTRAINT fk_2a039c40f4 FOREIGN KEY (system_note_metadata_id) REFERENCES system_note_metadata(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ml_candidates + ADD CONSTRAINT fk_2a0421d824 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY agent_group_authorizations ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34062,6 +34870,9 @@ ALTER TABLE ONLY zoekt_indexed_namespaces ALTER TABLE ONLY epics ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT fk_3cbf0b9a2e FOREIGN KEY (batch_id) REFERENCES bulk_import_export_batches(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_3d34ab2e06 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE SET NULL; @@ -34071,6 +34882,9 @@ ALTER TABLE ONLY protected_environment_approval_rules ALTER TABLE ONLY ci_pipeline_schedule_variables ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_diff_llm_summaries + ADD CONSTRAINT fk_42551b9fea FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY namespace_bans ADD CONSTRAINT fk_4275fbb1d7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34116,8 +34930,8 @@ ALTER TABLE ONLY alert_management_alerts ALTER TABLE ONLY path_locks ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_prometheus - ADD CONSTRAINT fk_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_user_access_group_authorizations + ADD CONSTRAINT fk_53fd98ccbf FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY terraform_states ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -34236,6 +35050,9 @@ ALTER TABLE ONLY vulnerabilities ALTER TABLE ONLY oauth_openid_requests ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE; +ALTER TABLE ONLY agent_user_access_project_authorizations + ADD CONSTRAINT fk_78034b05d8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY users ADD CONSTRAINT fk_789cd90b35 FOREIGN KEY (accepted_term_id) REFERENCES application_setting_terms(id) ON DELETE CASCADE; @@ -34257,9 +35074,6 @@ ALTER TABLE ONLY vulnerabilities ALTER TABLE ONLY issue_customer_relations_contacts ADD CONSTRAINT fk_7b92f835bb FOREIGN KEY (contact_id) REFERENCES customer_relations_contacts(id) ON DELETE CASCADE; -ALTER TABLE ONLY broadcast_messages - ADD CONSTRAINT fk_7bf2ec43da FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -34356,6 +35170,9 @@ ALTER TABLE ONLY boards_epic_list_user_preferences ALTER TABLE ONLY issues ADD CONSTRAINT fk_96b1dd429c FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY agent_user_access_group_authorizations + ADD CONSTRAINT fk_97ce8e8284 FOREIGN KEY (agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrences ADD CONSTRAINT fk_97ffe77653 FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE SET NULL; @@ -34398,6 +35215,9 @@ ALTER TABLE ONLY deployment_merge_requests ALTER TABLE ONLY issues ADD CONSTRAINT fk_a194299be1 FOREIGN KEY (moved_to_id) REFERENCES issues(id) ON DELETE SET NULL; +ALTER TABLE ONLY ml_candidates + ADD CONSTRAINT fk_a1d5f1bc45 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE SET NULL; + ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_a2141b1522 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; @@ -34443,6 +35263,9 @@ ALTER TABLE ONLY merge_requests ALTER TABLE ONLY ml_experiments ADD CONSTRAINT fk_ad89c59858 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_npm_metadata_caches + ADD CONSTRAINT fk_ada23b1d30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -34503,15 +35326,24 @@ ALTER TABLE ONLY deployments ALTER TABLE ONLY routes ADD CONSTRAINT fk_bb2e5b8968 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE p_ci_runner_machine_builds + ADD CONSTRAINT fk_bb490f12fe_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ALTER TABLE ONLY namespace_bans ADD CONSTRAINT fk_bcc024eef2 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY gitlab_subscriptions ADD CONSTRAINT fk_bd0c4019c3 FOREIGN KEY (hosted_plan_id) REFERENCES plans(id) ON DELETE CASCADE; +ALTER TABLE ONLY resource_link_events + ADD CONSTRAINT fk_bd4ae15ce4 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY metrics_users_starred_dashboards ADD CONSTRAINT fk_bd6ae32fac FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY workspaces + ADD CONSTRAINT fk_bdb0b31131 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_compliance_framework_settings ADD CONSTRAINT fk_be413374a9 FOREIGN KEY (framework_id) REFERENCES compliance_management_frameworks(id) ON DELETE CASCADE; @@ -34519,10 +35351,7 @@ ALTER TABLE ONLY snippets ADD CONSTRAINT fk_be41fd4bb7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; 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; + 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; ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -34536,9 +35365,6 @@ ALTER TABLE ONLY packages_packages ALTER TABLE ONLY sbom_occurrences ADD CONSTRAINT fk_c2a5562923 FOREIGN KEY (source_id) REFERENCES sbom_sources(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 user_group_callouts ADD CONSTRAINT fk_c366e12ec3 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34590,6 +35416,9 @@ ALTER TABLE ONLY todos ALTER TABLE ONLY dast_site_profiles_pipelines ADD CONSTRAINT fk_cf05cf8fe1 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; +ALTER TABLE ONLY issue_assignment_events + ADD CONSTRAINT fk_cfd2073177 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_cff7185ad2 FOREIGN KEY (reset_checksum_event_id) REFERENCES geo_reset_checksum_events(id) ON DELETE CASCADE; @@ -34659,6 +35488,9 @@ ALTER TABLE ONLY web_hooks ALTER TABLE ONLY security_scans ADD CONSTRAINT fk_dbc89265b9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY workspaces + ADD CONSTRAINT fk_dc7c316be1 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; @@ -34678,7 +35510,7 @@ ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE p_ci_builds_metadata - ADD CONSTRAINT fk_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY gitlab_subscriptions ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34704,6 +35536,9 @@ ALTER TABLE ONLY fork_networks ALTER TABLE ONLY integrations ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_diff_llm_summaries + ADD CONSTRAINT fk_e98931c3cb FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE; + ALTER TABLE ONLY pages_domains ADD CONSTRAINT fk_ea2f6dfc6f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34761,6 +35596,9 @@ ALTER TABLE ONLY user_project_callouts 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 workspaces + ADD CONSTRAINT fk_f78aeddc77 FOREIGN KEY (cluster_agent_id) REFERENCES cluster_agents(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; @@ -34779,6 +35617,9 @@ ALTER TABLE ONLY system_note_metadata ALTER TABLE ONLY vulnerability_remediations ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY abuse_report_events + ADD CONSTRAINT fk_fdd4d610e0 FOREIGN KEY (abuse_report_id) REFERENCES abuse_reports(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_import_data ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34788,6 +35629,12 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_geo_event_log_on_geo_event_id FOREIGN KEY (geo_event_id) REFERENCES geo_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_candidate_metrics + ADD CONSTRAINT fk_ml_candidate_metrics_on_candidate_id FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ml_candidate_params + ADD CONSTRAINT fk_ml_candidate_params_on_candidate_id FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; + ALTER TABLE ONLY path_locks ADD CONSTRAINT fk_path_locks_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34833,6 +35680,12 @@ ALTER TABLE ONLY ip_restrictions ALTER TABLE ONLY terraform_state_versions ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE; +ALTER TABLE ONLY search_namespace_index_assignments + ADD CONSTRAINT fk_rails_06f9b905d3 FOREIGN KEY (namespace_id) REFERENCES namespaces(id); + +ALTER TABLE ONLY issue_assignment_events + ADD CONSTRAINT fk_rails_07683f8e80 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY work_item_hierarchy_restrictions ADD CONSTRAINT fk_rails_08cd7fef58 FOREIGN KEY (child_type_id) REFERENCES work_item_types(id) ON DELETE CASCADE; @@ -34860,6 +35713,12 @@ ALTER TABLE ONLY audit_events_external_audit_event_destinations ALTER TABLE ONLY operations_user_lists ADD CONSTRAINT fk_rails_0c716e079b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY resource_link_events + ADD CONSTRAINT fk_rails_0cea73eba5 FOREIGN KEY (child_work_item_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY audit_events_google_cloud_logging_configurations + ADD CONSTRAINT fk_rails_0eb52fc617 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_node_statuses ADD CONSTRAINT fk_rails_0ecc699c2a FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE; @@ -34902,6 +35761,9 @@ ALTER TABLE ONLY gpg_signatures ALTER TABLE ONLY project_authorizations ADD CONSTRAINT fk_rails_11e7aa3ed9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY pm_affected_packages + ADD CONSTRAINT fk_rails_1279c1b9a1 FOREIGN KEY (pm_advisory_id) REFERENCES pm_advisories(id) ON DELETE CASCADE; + ALTER TABLE ONLY description_versions ADD CONSTRAINT fk_rails_12b144011c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -34920,6 +35782,9 @@ 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 service_desk_custom_email_verifications + ADD CONSTRAINT fk_rails_14dcaf4c92 FOREIGN KEY (triggerer_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY namespaces_storage_limit_exclusions ADD CONSTRAINT fk_rails_14e8f7b0e0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34927,26 +35792,20 @@ 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; + ADD CONSTRAINT fk_rails_16cb1ff064_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE 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 catalog_resources + ADD CONSTRAINT fk_rails_16f09e5c44 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY project_deploy_tokens ADD CONSTRAINT fk_rails_170e03cbaf FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_cycle_analytics_project_stages - ADD CONSTRAINT fk_rails_1722574860 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; - ALTER TABLE ONLY security_orchestration_policy_rule_schedules ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; ALTER TABLE ONLY incident_management_escalation_rules ADD CONSTRAINT fk_rails_17dbea07a6 FOREIGN KEY (policy_id) REFERENCES incident_management_escalation_policies(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_jupyter - ADD CONSTRAINT fk_rails_17df21c98c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY cluster_providers_aws ADD CONSTRAINT fk_rails_18983d9ea4 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -35022,9 +35881,6 @@ ALTER TABLE ONLY user_statuses ALTER TABLE ONLY users_ops_dashboard_projects ADD CONSTRAINT fk_rails_220a0562db FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_runners - ADD CONSTRAINT fk_rails_22388594e9 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY service_desk_settings ADD CONSTRAINT fk_rails_223a296a85 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -35073,6 +35929,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 design_management_repositories + ADD CONSTRAINT fk_rails_2938d8dd8d FOREIGN KEY (project_id) REFERENCES projects(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; @@ -35115,6 +35974,9 @@ ALTER TABLE ONLY issuable_severities ALTER TABLE ONLY saml_providers ADD CONSTRAINT fk_rails_306d459be7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_batch_trackers + ADD CONSTRAINT fk_rails_307efb9f32 FOREIGN KEY (tracker_id) REFERENCES bulk_import_trackers(id) ON DELETE CASCADE; + ALTER TABLE ONLY pm_package_version_licenses ADD CONSTRAINT fk_rails_30ddb7f837 FOREIGN KEY (pm_package_version_id) REFERENCES pm_package_versions(id) ON DELETE CASCADE; @@ -35133,9 +35995,6 @@ ALTER TABLE ONLY zoom_meetings ALTER TABLE ONLY container_repositories ADD CONSTRAINT fk_rails_32f7bf5aad FOREIGN KEY (project_id) REFERENCES projects(id); -ALTER TABLE ONLY clusters_applications_jupyter - ADD CONSTRAINT fk_rails_331f0aff78 FOREIGN KEY (oauth_application_id) REFERENCES oauth_applications(id) ON DELETE SET NULL; - ALTER TABLE ONLY alert_management_alert_metric_images ADD CONSTRAINT fk_rails_338e55b408 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE; @@ -35166,9 +36025,6 @@ ALTER TABLE ONLY merge_request_reviewers ALTER TABLE ONLY group_merge_request_approval_settings ADD CONSTRAINT fk_rails_37b6b4cdba FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_cycle_analytics_project_stages - ADD CONSTRAINT fk_rails_3829e49b66 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY packages_debian_project_distribution_keys ADD CONSTRAINT fk_rails_3834a11264 FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; @@ -35194,10 +36050,7 @@ ALTER TABLE ONLY chat_teams ADD CONSTRAINT fk_rails_3b543909cb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; 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; + ADD CONSTRAINT fk_rails_3cf221d4ed_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY cluster_groups ADD CONSTRAINT fk_rails_3d28377556 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -35208,15 +36061,9 @@ ALTER TABLE ONLY note_diff_files ALTER TABLE ONLY snippet_user_mentions ADD CONSTRAINT fk_rails_3e00189191 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_helm - ADD CONSTRAINT fk_rails_3e2b1c06bc FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY epic_user_mentions ADD CONSTRAINT fk_rails_3eaf4d88cc FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_cycle_analytics_project_stages - ADD CONSTRAINT fk_rails_3ec9fd7912 FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; - ALTER TABLE ONLY issuable_resource_links ADD CONSTRAINT fk_rails_3f0ec6b1cf FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -35247,6 +36094,9 @@ ALTER TABLE ONLY batched_background_migration_jobs ALTER TABLE ONLY operations_strategies_user_lists ADD CONSTRAINT fk_rails_43241e8d29 FOREIGN KEY (strategy_id) REFERENCES operations_strategies(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_assignment_events + ADD CONSTRAINT fk_rails_4378a2e8d7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY lfs_file_locks ADD CONSTRAINT fk_rails_43df7a0412 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -35262,6 +36112,9 @@ ALTER TABLE ONLY packages_dependency_links ALTER TABLE ONLY project_auto_devops ADD CONSTRAINT fk_rails_45436b12b2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dora_performance_scores + ADD CONSTRAINT fk_rails_455f9acc65 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests_closing_issues ADD CONSTRAINT fk_rails_458eda8667 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -35358,9 +36211,6 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER TABLE ONLY geo_node_namespace_links ADD CONSTRAINT fk_rails_546bf08d3e FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_knative - ADD CONSTRAINT fk_rails_54fc91e0a0 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY issuable_metric_images ADD CONSTRAINT fk_rails_56417a5a7f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -35379,9 +36229,6 @@ ALTER TABLE ONLY incident_management_timeline_event_tag_links ALTER TABLE ONLY packages_debian_project_architectures ADD CONSTRAINT fk_rails_5808663adf FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_cilium - ADD CONSTRAINT fk_rails_59dc12eea6 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_5a22f40223 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -35454,6 +36301,9 @@ ALTER TABLE ONLY sbom_component_versions ALTER TABLE ONLY status_page_published_incidents ADD CONSTRAINT fk_rails_61e5493940 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY container_repository_states + ADD CONSTRAINT fk_rails_63436c99ce FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; + ALTER TABLE ONLY deployment_clusters ADD CONSTRAINT fk_rails_6359a164df FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE; @@ -35505,9 +36355,6 @@ ALTER TABLE ONLY namespace_admin_notes ALTER TABLE ONLY ci_runner_machines ADD CONSTRAINT fk_rails_666b61f04f FOREIGN KEY (runner_id) REFERENCES ci_runners(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; - ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_675d38c03b FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; @@ -35523,6 +36370,9 @@ ALTER TABLE ONLY geo_hashed_storage_migrated_events ALTER TABLE ONLY plan_limits ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_cost_settings + ADD CONSTRAINT fk_rails_6a70651f75 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; + 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; @@ -35560,9 +36410,6 @@ ALTER TABLE ONLY project_custom_attributes ADD CONSTRAINT fk_rails_719c3dccc5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; 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 @@ -35592,9 +36439,6 @@ ALTER TABLE ONLY group_crm_settings ALTER TABLE ONLY pm_package_version_licenses ADD CONSTRAINT fk_rails_7520ea026d FOREIGN KEY (pm_license_id) REFERENCES pm_licenses(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_ingress - ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY incident_management_timeline_event_tag_links ADD CONSTRAINT fk_rails_753b8b6ee3 FOREIGN KEY (timeline_event_tag_id) REFERENCES incident_management_timeline_event_tags(id) ON DELETE CASCADE; @@ -35628,9 +36472,6 @@ ALTER TABLE ONLY packages_debian_group_distribution_keys ALTER TABLE ONLY terraform_states ADD CONSTRAINT fk_rails_78f54ca485 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -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 software_license_policies ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE; @@ -35661,6 +36502,9 @@ ALTER TABLE ONLY approval_merge_request_rules_users ALTER TABLE ONLY required_code_owners_sections ADD CONSTRAINT fk_rails_817708cf2d FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; +ALTER TABLE ONLY namespace_ldap_settings + ADD CONSTRAINT fk_rails_82cd0ad4bb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_enabled_grants ADD CONSTRAINT fk_rails_8336ce35af FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -35676,6 +36520,9 @@ ALTER TABLE ONLY zentao_tracker_data ALTER TABLE ONLY boards_epic_user_preferences ADD CONSTRAINT fk_rails_851fe1510a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY value_stream_dashboard_aggregations + ADD CONSTRAINT fk_rails_859b4f86f3 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY deployment_merge_requests ADD CONSTRAINT fk_rails_86a6d8bf12 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -35685,9 +36532,6 @@ ALTER TABLE ONLY analytics_language_trend_repository_languages ALTER TABLE ONLY merge_request_diff_details ADD CONSTRAINT fk_rails_86f4d24ecd FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_crossplane - ADD CONSTRAINT fk_rails_87186702df FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY packages_package_file_build_infos ADD CONSTRAINT fk_rails_871ca3ae21 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; @@ -35697,6 +36541,9 @@ ALTER TABLE ONLY boards_epic_boards ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT fk_rails_8767676b7a FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; +ALTER TABLE ONLY service_desk_custom_email_credentials + ADD CONSTRAINT fk_rails_878b562d12 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY software_license_policies ADD CONSTRAINT fk_rails_87b2247ce5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -35853,9 +36700,6 @@ ALTER TABLE ONLY badges ALTER TABLE ONLY vulnerability_finding_signatures ADD CONSTRAINT fk_rails_9e0baf9dcd FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; -ALTER TABLE ONLY clusters_applications_cert_managers - ADD CONSTRAINT fk_rails_9e4f2cb4b2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; - ALTER TABLE ONLY timelog_categories ADD CONSTRAINT fk_rails_9f27b821a8 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -35913,6 +36757,9 @@ ALTER TABLE ONLY user_preferences ALTER TABLE ONLY sentry_issues ADD CONSTRAINT fk_rails_a6a9612965 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY project_states + ADD CONSTRAINT fk_rails_a6e5821877 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_permission_export_uploads ADD CONSTRAINT fk_rails_a7130085e3 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -35965,10 +36812,7 @@ 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 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; + ADD CONSTRAINT fk_rails_aebc78111f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE 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; @@ -36015,6 +36859,9 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER TABLE ONLY namespace_aggregation_schedules ADD CONSTRAINT fk_rails_b565c8d16c FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY container_registry_data_repair_details + ADD CONSTRAINT fk_rails_b70d8111d9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE batched_background_migration_job_transition_logs ADD CONSTRAINT fk_rails_b7523a175b FOREIGN KEY (batched_background_migration_job_id) REFERENCES batched_background_migration_jobs(id) ON DELETE CASCADE; @@ -36024,6 +36871,9 @@ ALTER TABLE ONLY approval_project_rules_protected_branches ALTER TABLE ONLY packages_composer_cache_files ADD CONSTRAINT fk_rails_b82cea43a0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY abuse_trust_scores + ADD CONSTRAINT fk_rails_b903079eb4 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY dora_configurations ADD CONSTRAINT fk_rails_b9b8d90ddb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36057,6 +36907,9 @@ ALTER TABLE ONLY elasticsearch_indexed_namespaces ALTER TABLE ONLY vulnerability_occurrence_identifiers ADD CONSTRAINT fk_rails_be2e49e1d0 FOREIGN KEY (identifier_id) REFERENCES vulnerability_identifiers(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_export_batches + ADD CONSTRAINT fk_rails_be479792f6 FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE; + ALTER TABLE ONLY alert_management_http_integrations ADD CONSTRAINT fk_rails_bec49f52cc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36075,9 +36928,6 @@ ALTER TABLE ONLY design_management_designs ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT fk_rails_c02928bc18 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY serverless_domain_cluster - ADD CONSTRAINT fk_rails_c09009dee1 FOREIGN KEY (pages_domain_id) REFERENCES pages_domains(id) ON DELETE CASCADE; - ALTER TABLE ONLY slack_integrations_scopes ADD CONSTRAINT fk_rails_c0e018a6fe FOREIGN KEY (slack_api_scope_id) REFERENCES slack_api_scopes(id) ON DELETE CASCADE; @@ -36118,13 +36968,7 @@ ALTER TABLE ONLY boards_epic_board_recent_visits ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; 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; + ADD CONSTRAINT fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY project_settings ADD CONSTRAINT fk_rails_c6df6e6328 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36156,9 +37000,6 @@ 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; @@ -36207,6 +37048,9 @@ ALTER TABLE ONLY requirements_management_test_reports ALTER TABLE ONLY pool_repositories ADD CONSTRAINT fk_rails_d2711daad4 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY design_management_repository_states + ADD CONSTRAINT fk_rails_d2a258cc5a FOREIGN KEY (design_management_repository_id) REFERENCES design_management_repositories(id) ON DELETE CASCADE; + ALTER TABLE ONLY web_hooks ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36222,24 +37066,24 @@ ALTER TABLE ONLY alert_management_alert_assignees ALTER TABLE ONLY geo_hashed_storage_attachments_events ADD CONSTRAINT fk_rails_d496b088e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ml_candidate_params - ADD CONSTRAINT fk_rails_d4a51d1185 FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id); - ALTER TABLE ONLY packages_rpm_repository_files ADD CONSTRAINT fk_rails_d545cfaed2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY packages_rpm_metadata ADD CONSTRAINT fk_rails_d79f02264b FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY note_metadata + ADD CONSTRAINT fk_rails_d853224d37 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT fk_rails_d9fec24b9d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; 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 resource_link_events + ADD CONSTRAINT fk_rails_da5dd8a56f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_da617096ce FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -36264,6 +37108,9 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER TABLE ONLY incident_management_timeline_event_tags ADD CONSTRAINT fk_rails_dd5c91484e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY schema_inconsistencies + ADD CONSTRAINT fk_rails_dd7d763602 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_callouts ADD CONSTRAINT fk_rails_ddfdd80f3d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -36276,6 +37123,9 @@ ALTER TABLE ONLY dast_scanner_profiles_tags ALTER TABLE ONLY vulnerability_feedback ADD CONSTRAINT fk_rails_debd54e456 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY service_desk_custom_email_verifications + ADD CONSTRAINT fk_rails_debe4c4acc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_debian_project_distributions ADD CONSTRAINT fk_rails_df44271a30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE RESTRICT; @@ -36315,9 +37165,6 @@ ALTER TABLE ONLY vulnerability_occurrence_identifiers 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; - ALTER TABLE ONLY incident_management_escalation_policies ADD CONSTRAINT fk_rails_e5b513daa7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36399,9 +37246,6 @@ ALTER TABLE ONLY project_relation_exports ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_ef916d14fa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ml_candidate_metrics - ADD CONSTRAINT fk_rails_efb613a25a FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id); - ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_rails_efccadc4ec FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36474,23 +37318,14 @@ 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; ALTER TABLE ONLY board_project_recent_visits ADD CONSTRAINT fk_rails_fb6fc419cb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY serverless_domain_cluster - ADD CONSTRAINT fk_rails_fbdba67eb1 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; - -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; + ADD CONSTRAINT fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY packages_nuget_metadata ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -36510,6 +37345,9 @@ ALTER TABLE ONLY resource_label_events ALTER TABLE ONLY pages_deployment_states ADD CONSTRAINT fk_rails_ff6ca551a4 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE CASCADE; +ALTER TABLE ONLY search_namespace_index_assignments + ADD CONSTRAINT fk_search_index_id_and_type FOREIGN KEY (search_index_id, index_type) REFERENCES search_indices(id, type) ON DELETE CASCADE; + ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT fk_security_policy_configurations_management_project_id FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE CASCADE; |