diff options
Diffstat (limited to 'db')
889 files changed, 4569 insertions, 7024 deletions
diff --git a/db/docs/achievements.yml b/db/docs/achievements.yml index 20f9d1616b3..04d17defa06 100644 --- a/db/docs/achievements.yml +++ b/db/docs/achievements.yml @@ -1,7 +1,7 @@ --- table_name: achievements classes: -- Achievements::Achivement +- Achievements::Achievement feature_categories: - users description: Achievements which can be created by namespaces to award them to users diff --git a/db/docs/analytics_cycle_analytics_group_stages.yml b/db/docs/analytics_cycle_analytics_group_stages.yml index 5dbb3eba2c0..12c7668632d 100644 --- a/db/docs/analytics_cycle_analytics_group_stages.yml +++ b/db/docs/analytics_cycle_analytics_group_stages.yml @@ -1,7 +1,7 @@ --- table_name: analytics_cycle_analytics_group_stages classes: -- Analytics::CycleAnalytics::GroupStage +- Analytics::CycleAnalytics::Stage feature_categories: - value_stream_management description: TODO diff --git a/db/docs/analytics_cycle_analytics_group_value_streams.yml b/db/docs/analytics_cycle_analytics_group_value_streams.yml index e29d07c5a72..1f8603ab294 100644 --- a/db/docs/analytics_cycle_analytics_group_value_streams.yml +++ b/db/docs/analytics_cycle_analytics_group_value_streams.yml @@ -1,7 +1,7 @@ --- table_name: analytics_cycle_analytics_group_value_streams classes: -- Analytics::CycleAnalytics::GroupValueStream +- Analytics::CycleAnalytics::ValueStream feature_categories: - value_stream_management description: Store group level Value Stream objects. diff --git a/db/docs/analytics_dashboards_pointers.yml b/db/docs/analytics_dashboards_pointers.yml new file mode 100644 index 00000000000..b554911d3ad --- /dev/null +++ b/db/docs/analytics_dashboards_pointers.yml @@ -0,0 +1,10 @@ +--- +table_name: analytics_dashboards_pointers +classes: +- Analytics::DashboardsPointer +feature_categories: + - devops_reports +description: Stores project link with configuration files for Analytics Dashboards group feature. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107673 +milestone: '15.8' +gitlab_schema: gitlab_main diff --git a/db/docs/approval_merge_request_rules_approved_approvers.yml b/db/docs/approval_merge_request_rules_approved_approvers.yml index 4a453da4162..8d2d74ffcc5 100644 --- a/db/docs/approval_merge_request_rules_approved_approvers.yml +++ b/db/docs/approval_merge_request_rules_approved_approvers.yml @@ -2,7 +2,7 @@ table_name: approval_merge_request_rules_approved_approvers classes: [] feature_categories: -- code_review +- code_review_workflow description: Join table for approved approvers and ApprovalMergeRequestRule introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/8497 milestone: '11.7' diff --git a/db/docs/approver_groups.yml b/db/docs/approver_groups.yml index fd892ed3f4c..b69c110e3cc 100644 --- a/db/docs/approver_groups.yml +++ b/db/docs/approver_groups.yml @@ -3,7 +3,7 @@ table_name: approver_groups classes: - ApproverGroup feature_categories: -- code_review +- code_review_workflow - source_code_management description: Group approvers of given merge request introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/743 diff --git a/db/docs/approvers.yml b/db/docs/approvers.yml index ac15bbb8767..ea700bfb634 100644 --- a/db/docs/approvers.yml +++ b/db/docs/approvers.yml @@ -3,7 +3,7 @@ table_name: approvers classes: - Approver feature_categories: -- code_review +- code_review_workflow - source_code_management description: Approvers of given merge request introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/3cc78d89984d9c9df8372c52b7bba38e6226f9f2 diff --git a/db/docs/chat_names.yml b/db/docs/chat_names.yml index fd1efaf91d7..a2a1d9e5240 100644 --- a/db/docs/chat_names.yml +++ b/db/docs/chat_names.yml @@ -4,7 +4,7 @@ classes: - ChatName feature_categories: - integrations -- chatops +- continuous_integration description: Stores mappings from external chat accounts to GitLab users. introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7450 milestone: '8.14' diff --git a/db/docs/chat_teams.yml b/db/docs/chat_teams.yml index d50e596279a..84584e0d68e 100644 --- a/db/docs/chat_teams.yml +++ b/db/docs/chat_teams.yml @@ -4,7 +4,7 @@ classes: - ChatTeam feature_categories: - integrations -- chatops +- continuous_integration description: Stores mappings from external chat teams to GitLab groups. introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/8746 milestone: '9.0' diff --git a/db/docs/ci_job_artifacts.yml b/db/docs/ci_job_artifacts.yml index bff81fa5ae9..92c43eaf04f 100644 --- a/db/docs/ci_job_artifacts.yml +++ b/db/docs/ci_job_artifacts.yml @@ -2,7 +2,6 @@ table_name: ci_job_artifacts classes: - Ci::JobArtifact -- Gitlab::Ci::JobArtifact feature_categories: - build_artifacts description: Stores artifacts produced by a build. diff --git a/db/docs/ci_minutes_additional_packs.yml b/db/docs/ci_minutes_additional_packs.yml index 2be58f2cdde..be4b0a19621 100644 --- a/db/docs/ci_minutes_additional_packs.yml +++ b/db/docs/ci_minutes_additional_packs.yml @@ -3,7 +3,7 @@ table_name: ci_minutes_additional_packs classes: - Ci::Minutes::AdditionalPack feature_categories: -- utilization +- purchase description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62393 milestone: '14.0' diff --git a/db/docs/ci_namespace_mirrors.yml b/db/docs/ci_namespace_mirrors.yml index dd6b8eab821..1566f043a0e 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: -- sharding +- pods 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_chat_data.yml b/db/docs/ci_pipeline_chat_data.yml index eeef86bd4dd..91f29a88648 100644 --- a/db/docs/ci_pipeline_chat_data.yml +++ b/db/docs/ci_pipeline_chat_data.yml @@ -3,7 +3,7 @@ table_name: ci_pipeline_chat_data classes: - Ci::PipelineChatData feature_categories: -- chatops +- continuous_integration description: Stores information about a CI pipeline created via chatops introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4466 milestone: '10.6' diff --git a/db/docs/ci_project_mirrors.yml b/db/docs/ci_project_mirrors.yml index d6619880b20..8e332a10194 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: -- sharding +- pods 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 new file mode 100644 index 00000000000..17cb700d96b --- /dev/null +++ b/db/docs/ci_runner_machines.yml @@ -0,0 +1,10 @@ +--- +table_name: ci_runner_machines +classes: +- Ci::RunnerMachine +feature_categories: +- runner_fleet +description: Information about host machines 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/clusters_applications_cilium.yml b/db/docs/clusters_applications_cilium.yml index 8744ee73633..b28d674cef0 100644 --- a/db/docs/clusters_applications_cilium.yml +++ b/db/docs/clusters_applications_cilium.yml @@ -3,7 +3,7 @@ table_name: clusters_applications_cilium classes: - Clusters::Applications::Cilium feature_categories: -- container_network_security +- 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' diff --git a/db/docs/dast_pre_scan_verifications.yml b/db/docs/dast_pre_scan_verifications.yml index 45d39335264..cc537aa87d6 100644 --- a/db/docs/dast_pre_scan_verifications.yml +++ b/db/docs/dast_pre_scan_verifications.yml @@ -1,7 +1,7 @@ --- table_name: dast_pre_scan_verifications classes: -- Dast::PreScanVerifications +- Dast::PreScanVerification feature_categories: - dynamic_application_security_testing description: Verification status for DAST Profiles diff --git a/db/docs/dependency_list_exports.yml b/db/docs/dependency_list_exports.yml index 14d222edb06..1597f17c80c 100644 --- a/db/docs/dependency_list_exports.yml +++ b/db/docs/dependency_list_exports.yml @@ -1,5 +1,7 @@ --- table_name: dependency_list_exports +classes: +- Dependencies::DependencyListExport feature_categories: - dependency_management description: Dependency list exported data diff --git a/db/docs/dingtalk_tracker_data.yml b/db/docs/dingtalk_tracker_data.yml index 6994bd805a7..cd9e8f86602 100644 --- a/db/docs/dingtalk_tracker_data.yml +++ b/db/docs/dingtalk_tracker_data.yml @@ -1,7 +1,6 @@ --- table_name: dingtalk_tracker_data -classes: -- Integrations::DingtalkTrackerData +classes: [] feature_categories: - integrations description: Data related to the Dingtalk integration (JiHu-specific, see https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/417). diff --git a/db/docs/draft_notes.yml b/db/docs/draft_notes.yml index 047241a7976..30e0bc96e22 100644 --- a/db/docs/draft_notes.yml +++ b/db/docs/draft_notes.yml @@ -3,7 +3,7 @@ table_name: draft_notes classes: - DraftNote feature_categories: -- code_review +- code_review_workflow - source_code_management description: Notes created during the review of an MR that are not yet published introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4213 diff --git a/db/docs/elastic_group_index_statuses.yml b/db/docs/elastic_group_index_statuses.yml new file mode 100644 index 00000000000..a9b0081474c --- /dev/null +++ b/db/docs/elastic_group_index_statuses.yml @@ -0,0 +1,10 @@ +--- +table_name: elastic_group_index_statuses +classes: +- Elastic::GroupIndexStatus +feature_categories: +- global_search +description: Table for tracking Advanced Search indexing statuses for groups +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107579 +milestone: '15.8' +gitlab_schema: gitlab_main diff --git a/db/docs/elastic_reindexing_slices.yml b/db/docs/elastic_reindexing_slices.yml index b547c96a35d..84e42b16d57 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: -- memory +- application_performance 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 78d8e2e58f7..17e2e116fdd 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: -- memory +- application_performance description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/9861 milestone: '11.10' diff --git a/db/docs/geo_container_repository_updated_events.yml b/db/docs/geo_container_repository_updated_events.yml deleted file mode 100644 index a07758da54e..00000000000 --- a/db/docs/geo_container_repository_updated_events.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -table_name: geo_container_repository_updated_events -classes: -- Geo::ContainerRepositoryUpdatedEvent -feature_categories: -- geo_replication -description: Geo event for when a container repository (image, tag, registry) gets updated, belongs to geo_event_log. -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/1902d9cc74a1dc2c87fdbb39a6cdbb67092cbb5a -milestone: '12.2' -gitlab_schema: gitlab_main diff --git a/db/docs/ghost_user_migrations.yml b/db/docs/ghost_user_migrations.yml index d90eca9f153..245e6735cd6 100644 --- a/db/docs/ghost_user_migrations.yml +++ b/db/docs/ghost_user_migrations.yml @@ -1,7 +1,7 @@ --- table_name: ghost_user_migrations classes: -- GhostUserMigration +- Users::GhostUserMigration feature_categories: - users description: Users records awaiting for their associated records to be migrated to ghost user diff --git a/db/docs/historical_data.yml b/db/docs/historical_data.yml index 020cc33b25d..a7af9e04c14 100644 --- a/db/docs/historical_data.yml +++ b/db/docs/historical_data.yml @@ -3,8 +3,8 @@ table_name: historical_data classes: - HistoricalData feature_categories: -- utilization +- sm_provisioning description: TODO -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/85c04a8aa654d1b7f898e55a113e50521bacaaf2 +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/integrations.yml b/db/docs/integrations.yml index 52d719e19da..5bb4f448541 100644 --- a/db/docs/integrations.yml +++ b/db/docs/integrations.yml @@ -2,6 +2,7 @@ table_name: integrations classes: - Integration +- Integrations::AppleAppStore - Integrations::Asana - Integrations::Assembla - Integrations::Bamboo @@ -9,7 +10,9 @@ classes: - Integrations::BaseCi - Integrations::BaseIssueTracker - Integrations::BaseMonitoring +- Integrations::BaseSlackNotification - Integrations::BaseSlashCommands +- Integrations::BaseThirdPartyWiki - Integrations::Bugzilla - Integrations::Buildkite - Integrations::Campfire diff --git a/db/docs/lfs_file_locks.yml b/db/docs/lfs_file_locks.yml index c366c43d6d7..07850aedddb 100644 --- a/db/docs/lfs_file_locks.yml +++ b/db/docs/lfs_file_locks.yml @@ -3,7 +3,7 @@ table_name: lfs_file_locks classes: - LfsFileLock feature_categories: -- git_lfs +- source_code_management description: File locks for LFS objects introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4091 milestone: '10.5' diff --git a/db/docs/lfs_object_states.yml b/db/docs/lfs_object_states.yml index 02334202bdc..a0a6d4345fb 100644 --- a/db/docs/lfs_object_states.yml +++ b/db/docs/lfs_object_states.yml @@ -3,7 +3,7 @@ table_name: lfs_object_states classes: - Geo::LfsObjectState feature_categories: -- git_lfs +- source_code_management description: Geo verification states for LFS objects introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63981 milestone: '14.6' diff --git a/db/docs/lfs_objects.yml b/db/docs/lfs_objects.yml index 490bc1af0d9..431aace668f 100644 --- a/db/docs/lfs_objects.yml +++ b/db/docs/lfs_objects.yml @@ -3,7 +3,7 @@ table_name: lfs_objects classes: - LfsObject feature_categories: -- git_lfs +- source_code_management description: LFS files introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/1727 milestone: '8.2' diff --git a/db/docs/lfs_objects_projects.yml b/db/docs/lfs_objects_projects.yml index 7158e702312..e00132824be 100644 --- a/db/docs/lfs_objects_projects.yml +++ b/db/docs/lfs_objects_projects.yml @@ -3,7 +3,6 @@ table_name: lfs_objects_projects classes: - LfsObjectsProject feature_categories: -- git_lfs - source_code_management description: Join table relating lfs_objects and projects introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/1727 diff --git a/db/docs/loose_foreign_keys_deleted_records.yml b/db/docs/loose_foreign_keys_deleted_records.yml index aeaf241ef4a..8ce8d4e52b3 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: -- sharding +- pods 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_assignees.yml b/db/docs/merge_request_assignees.yml index 38f476ead90..12ca2eb513f 100644 --- a/db/docs/merge_request_assignees.yml +++ b/db/docs/merge_request_assignees.yml @@ -3,7 +3,7 @@ table_name: merge_request_assignees classes: - MergeRequestAssignee feature_categories: -- code_review +- code_review_workflow description: Store allocated assignees for merge requests introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/26496 milestone: '11.10' diff --git a/db/docs/merge_request_cleanup_schedules.yml b/db/docs/merge_request_cleanup_schedules.yml index e25c88c99a7..ba7c4e218f0 100644 --- a/db/docs/merge_request_cleanup_schedules.yml +++ b/db/docs/merge_request_cleanup_schedules.yml @@ -3,7 +3,7 @@ table_name: merge_request_cleanup_schedules classes: - MergeRequest::CleanupSchedule feature_categories: -- code_review +- code_review_workflow description: Store refs cleanup schedules for merge requests introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46758 milestone: '13.6' diff --git a/db/docs/merge_request_context_commit_diff_files.yml b/db/docs/merge_request_context_commit_diff_files.yml index 6b64ea87555..ab92c3e69a2 100644 --- a/db/docs/merge_request_context_commit_diff_files.yml +++ b/db/docs/merge_request_context_commit_diff_files.yml @@ -3,7 +3,7 @@ table_name: merge_request_context_commit_diff_files classes: - MergeRequestContextCommitDiffFile feature_categories: -- code_review +- code_review_workflow description: Stores diffs data for merge request context commits introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23701 milestone: '12.8' diff --git a/db/docs/merge_request_context_commits.yml b/db/docs/merge_request_context_commits.yml index 1c8fc45776f..a16d1177d9d 100644 --- a/db/docs/merge_request_context_commits.yml +++ b/db/docs/merge_request_context_commits.yml @@ -3,7 +3,7 @@ table_name: merge_request_context_commits classes: - MergeRequestContextCommit feature_categories: -- code_review +- code_review_workflow description: Store context commit related data for merge requests introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23701 milestone: '12.8' diff --git a/db/docs/merge_request_diff_commit_users.yml b/db/docs/merge_request_diff_commit_users.yml index 1e6e78b37e3..59b5a73ca32 100644 --- a/db/docs/merge_request_diff_commit_users.yml +++ b/db/docs/merge_request_diff_commit_users.yml @@ -3,7 +3,7 @@ table_name: merge_request_diff_commit_users classes: - MergeRequest::DiffCommitUser feature_categories: -- code_review +- code_review_workflow description: Store commit user information for merge request diffs introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63669 milestone: '14.1' diff --git a/db/docs/merge_request_diff_commits.yml b/db/docs/merge_request_diff_commits.yml index 1b2f910c88a..c489f1b3ecb 100644 --- a/db/docs/merge_request_diff_commits.yml +++ b/db/docs/merge_request_diff_commits.yml @@ -3,7 +3,7 @@ table_name: merge_request_diff_commits classes: - MergeRequestDiffCommit feature_categories: -- code_review +- code_review_workflow description: Store commit related information within a merge request diff introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12527 milestone: '9.4' diff --git a/db/docs/merge_request_diff_files.yml b/db/docs/merge_request_diff_files.yml index 5bb625231f8..cefd7faa923 100644 --- a/db/docs/merge_request_diff_files.yml +++ b/db/docs/merge_request_diff_files.yml @@ -3,7 +3,7 @@ table_name: merge_request_diff_files classes: - MergeRequestDiffFile feature_categories: -- code_review +- code_review_workflow description: Store file related information within a merge request diff introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12047 milestone: '9.4' diff --git a/db/docs/merge_request_diffs.yml b/db/docs/merge_request_diffs.yml index d1044ebffe8..3abd8d80d4b 100644 --- a/db/docs/merge_request_diffs.yml +++ b/db/docs/merge_request_diffs.yml @@ -3,7 +3,7 @@ table_name: merge_request_diffs classes: - MergeRequestDiff feature_categories: -- code_review +- code_review_workflow description: Store information about the changes made within a git push for a merge request introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/c983e8eb3d9cac01090b8657735544f71f891576 milestone: '6.6' diff --git a/db/docs/merge_request_metrics.yml b/db/docs/merge_request_metrics.yml index 31267b6bf97..250f900246b 100644 --- a/db/docs/merge_request_metrics.yml +++ b/db/docs/merge_request_metrics.yml @@ -4,7 +4,7 @@ classes: - MergeRequest::Metrics feature_categories: - value_stream_management -- code_review +- code_review_workflow description: Store various metrics for merge requests. introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5986 milestone: '8.12' diff --git a/db/docs/merge_request_predictions.yml b/db/docs/merge_request_predictions.yml index 60680a73583..9d1ef61c66a 100644 --- a/db/docs/merge_request_predictions.yml +++ b/db/docs/merge_request_predictions.yml @@ -1,7 +1,7 @@ --- table_name: merge_request_predictions classes: -- MergeRequest::Prediction +- MergeRequest::Predictions feature_categories: - workflow_automation description: Includes machine learning model predictions diff --git a/db/docs/merge_request_reviewers.yml b/db/docs/merge_request_reviewers.yml index b8afea0d217..0de14b578de 100644 --- a/db/docs/merge_request_reviewers.yml +++ b/db/docs/merge_request_reviewers.yml @@ -3,7 +3,7 @@ table_name: merge_request_reviewers classes: - MergeRequestReviewer feature_categories: -- code_review +- code_review_workflow description: Store allocated reviewers for merge requests introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40358 milestone: '13.4' diff --git a/db/docs/merge_requests.yml b/db/docs/merge_requests.yml index 8e849a242b4..bd08875eafe 100644 --- a/db/docs/merge_requests.yml +++ b/db/docs/merge_requests.yml @@ -3,7 +3,7 @@ table_name: merge_requests classes: - MergeRequest feature_categories: -- code_review +- code_review_workflow description: This is the main table that stores information about project merge requests. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/6d460aa2d6b3959593c168eed181516036525393 milestone: "<6.0" diff --git a/db/docs/merge_requests_closing_issues.yml b/db/docs/merge_requests_closing_issues.yml index 9ad45df375a..479a81d8c67 100644 --- a/db/docs/merge_requests_closing_issues.yml +++ b/db/docs/merge_requests_closing_issues.yml @@ -3,7 +3,7 @@ table_name: merge_requests_closing_issues classes: - MergeRequestsClosingIssues feature_categories: -- code_review +- code_review_workflow description: Store the events of merge request closing any issues introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/5986 milestone: '8.12' diff --git a/db/docs/ml_candidate_metadata.yml b/db/docs/ml_candidate_metadata.yml index 485544f0f59..96396a6485e 100644 --- a/db/docs/ml_candidate_metadata.yml +++ b/db/docs/ml_candidate_metadata.yml @@ -4,7 +4,6 @@ classes: - Ml::CandidateMetadata feature_categories: - mlops - - incubation gitlab_schema: gitlab_main description: A Candidate Metadata record holds extra information about the candidate introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104267 diff --git a/db/docs/ml_candidate_metrics.yml b/db/docs/ml_candidate_metrics.yml index 24489973dd5..4b6087c977e 100644 --- a/db/docs/ml_candidate_metrics.yml +++ b/db/docs/ml_candidate_metrics.yml @@ -4,7 +4,6 @@ classes: - Ml::CandidateMetric feature_categories: - mlops - - incubation description: Metrics recorded for a Machine Learning model candidate introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168 milestone: '15.4' diff --git a/db/docs/ml_candidate_params.yml b/db/docs/ml_candidate_params.yml index 25372de7c7f..334ba7420e8 100644 --- a/db/docs/ml_candidate_params.yml +++ b/db/docs/ml_candidate_params.yml @@ -1,10 +1,9 @@ --- table_name: ml_candidate_params classes: - - Ml::CandidateParams +- Ml::CandidateParam feature_categories: - - mlops - - incubation +- mlops description: Configuration parameters recorded for a Machine Learning model candidate introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168 milestone: '15.4' diff --git a/db/docs/ml_candidates.yml b/db/docs/ml_candidates.yml index c057eb45675..a79729e1548 100644 --- a/db/docs/ml_candidates.yml +++ b/db/docs/ml_candidates.yml @@ -4,7 +4,6 @@ classes: - Ml::Candidate feature_categories: - mlops - - incubation description: A Model Candidate is a record of the results on training a model on some configuration introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168 milestone: '15.4' diff --git a/db/docs/ml_experiment_metadata.yml b/db/docs/ml_experiment_metadata.yml index a77781cb601..812a33fe176 100644 --- a/db/docs/ml_experiment_metadata.yml +++ b/db/docs/ml_experiment_metadata.yml @@ -4,7 +4,6 @@ classes: - Ml::ExperimentMetadata feature_categories: - mlops - - incubation gitlab_schema: gitlab_main description: An Experiment Metadata record holds extra information about the experiment introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/104267 diff --git a/db/docs/ml_experiments.yml b/db/docs/ml_experiments.yml index bada30749d3..efae3c53119 100644 --- a/db/docs/ml_experiments.yml +++ b/db/docs/ml_experiments.yml @@ -4,7 +4,6 @@ classes: - Ml::Experiment feature_categories: - mlops - - incubation description: A Machine Learning Experiments groups many Model Candidates introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95168 milestone: '15.4' diff --git a/db/docs/namespace_aggregation_schedules.yml b/db/docs/namespace_aggregation_schedules.yml index c961c33f2ee..56ac5ee3ed6 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: -- utilization +- subscription_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_bans.yml b/db/docs/namespace_bans.yml index af68cf0b48b..dbb1c012bda 100644 --- a/db/docs/namespace_bans.yml +++ b/db/docs/namespace_bans.yml @@ -1,10 +1,10 @@ --- table_name: namespace_bans classes: - - NamespaceBan +- Namespaces::NamespaceBan feature_categories: - - instance_resiliency +- instance_resiliency description: Contains users banned from namespaces introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91271 -milestone: "15.2" +milestone: '15.2' gitlab_schema: gitlab_main diff --git a/db/docs/namespace_details.yml b/db/docs/namespace_details.yml index d256085bf00..35e57d7c686 100644 --- a/db/docs/namespace_details.yml +++ b/db/docs/namespace_details.yml @@ -1,7 +1,7 @@ --- table_name: namespace_details classes: -- NamespaceDetail +- Namespace::Detail feature_categories: - subgroups description: Used to store details for namespaces diff --git a/db/docs/namespace_limits.yml b/db/docs/namespace_limits.yml index 8601d163d9d..bcc687de858 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: -- utilization +- subscription_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 2a3e19ab108..ac2207d7698 100644 --- a/db/docs/namespace_root_storage_statistics.yml +++ b/db/docs/namespace_root_storage_statistics.yml @@ -3,7 +3,7 @@ table_name: namespace_root_storage_statistics classes: - Namespace::RootStorageStatistics feature_categories: -- utilization +- application_instrumentation description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/bde41ee866d0fe0b1bb5ece1130fb6e24d95ad17 milestone: '12.1' diff --git a/db/docs/namespace_statistics.yml b/db/docs/namespace_statistics.yml index fd7dcb4b62e..e84d5d563f8 100644 --- a/db/docs/namespace_statistics.yml +++ b/db/docs/namespace_statistics.yml @@ -3,7 +3,7 @@ table_name: namespace_statistics classes: - NamespaceStatistics feature_categories: -- utilization +- application_instrumentation description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/48d8bdca0493056a717cd7d9fee2e8b51d6b0502 milestone: '9.0' diff --git a/db/docs/namespaces_sync_events.yml b/db/docs/namespaces_sync_events.yml index f143ac29804..f089ca85789 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: -- sharding +- pods 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_diff_files.yml b/db/docs/note_diff_files.yml index 5e78644fe52..38f7ce9a30f 100644 --- a/db/docs/note_diff_files.yml +++ b/db/docs/note_diff_files.yml @@ -3,7 +3,7 @@ table_name: note_diff_files classes: - NoteDiffFile feature_categories: -- code_review +- code_review_workflow description: Persisted truncated note diffs introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/18991 milestone: '11.0' diff --git a/db/docs/notes.yml b/db/docs/notes.yml index a6bc81f093f..a8dac9ccbd3 100644 --- a/db/docs/notes.yml +++ b/db/docs/notes.yml @@ -12,10 +12,10 @@ classes: - SyntheticNote - WeightNote feature_categories: -- code_review +- code_review_workflow - portfolio_management - service_desk -- snippets +- source_code_management - team_planning description: The object at the core of comments, discussions and system notes shown on issues, MRs and epics introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9ba1224867665844b117fa037e1465bb706b3685 diff --git a/db/docs/operations_feature_flags.yml b/db/docs/operations_feature_flags.yml index 9207ab20b3a..25c3f0bfe95 100644 --- a/db/docs/operations_feature_flags.yml +++ b/db/docs/operations_feature_flags.yml @@ -3,7 +3,7 @@ table_name: operations_feature_flags classes: - Operations::FeatureFlag feature_categories: -- release +- feature_flags description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/7433 milestone: '11.4' diff --git a/db/docs/packages_rpm_repository_files.yml b/db/docs/packages_rpm_repository_files.yml index 7044b58e22a..4e62774e3c8 100644 --- a/db/docs/packages_rpm_repository_files.yml +++ b/db/docs/packages_rpm_repository_files.yml @@ -1,7 +1,7 @@ --- table_name: packages_rpm_repository_files classes: -- Packages::RPM::RepositoryFile +- Packages::Rpm::RepositoryFile feature_categories: - package_registry description: Package registry file links and file metadata for RPM packages diff --git a/db/docs/project_statistics.yml b/db/docs/project_statistics.yml index a3afb678877..9bc6175b45f 100644 --- a/db/docs/project_statistics.yml +++ b/db/docs/project_statistics.yml @@ -3,7 +3,7 @@ table_name: project_statistics classes: - ProjectStatistics feature_categories: -- utilization +- application_instrumentation description: Records statistics about the usage of various product features introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7754 milestone: '8.16' diff --git a/db/docs/project_wiki_repository_states.yml b/db/docs/project_wiki_repository_states.yml index c12e904b339..e6faeadf8a6 100644 --- a/db/docs/project_wiki_repository_states.yml +++ b/db/docs/project_wiki_repository_states.yml @@ -1,7 +1,7 @@ --- table_name: project_wiki_repository_states classes: -- ProjectWikiRepositoryState +- Geo::ProjectWikiRepositoryState feature_categories: - geo_replication description: Separate table for project wikis containing Geo verification metadata. diff --git a/db/docs/projects_sync_events.yml b/db/docs/projects_sync_events.yml index 7e03e5abe63..70e325d1c0a 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: -- sharding +- pods 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/reviews.yml b/db/docs/reviews.yml index 81253d0c3c1..b5d8985c7d0 100644 --- a/db/docs/reviews.yml +++ b/db/docs/reviews.yml @@ -3,7 +3,7 @@ table_name: reviews classes: - Review feature_categories: -- code_review +- code_review_workflow description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/8442 milestone: '11.6' diff --git a/db/docs/security_orchestration_policy_configurations.yml b/db/docs/security_orchestration_policy_configurations.yml index 7d23d30de82..c015de47123 100644 --- a/db/docs/security_orchestration_policy_configurations.yml +++ b/db/docs/security_orchestration_policy_configurations.yml @@ -3,7 +3,7 @@ table_name: security_orchestration_policy_configurations classes: - Security::OrchestrationPolicyConfiguration feature_categories: -- security_orchestration +- security_policy_management description: | Relates a Project/Namespace and Security Orchestration Policy Project, where Security Policies are stored in the repository as a YAML file. diff --git a/db/docs/security_orchestration_policy_rule_schedules.yml b/db/docs/security_orchestration_policy_rule_schedules.yml index 8d1067d8f58..bcb81544f43 100644 --- a/db/docs/security_orchestration_policy_rule_schedules.yml +++ b/db/docs/security_orchestration_policy_rule_schedules.yml @@ -3,7 +3,7 @@ table_name: security_orchestration_policy_rule_schedules classes: - Security::OrchestrationPolicyRuleSchedule feature_categories: -- security_orchestration +- security_policy_management description: | Security policies scheduled to run based on cadence defined in the policy introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59842 diff --git a/db/docs/slack_api_scopes.yml b/db/docs/slack_api_scopes.yml index 467880dccf5..184c5bbebd4 100644 --- a/db/docs/slack_api_scopes.yml +++ b/db/docs/slack_api_scopes.yml @@ -1,7 +1,7 @@ --- table_name: slack_api_scopes classes: -- Integrations::KnownSlackApiScope +- Integrations::SlackWorkspace::ApiScope feature_categories: - integrations description: Data related to the Slack application integration. diff --git a/db/docs/slack_integrations_scopes.yml b/db/docs/slack_integrations_scopes.yml index b09c1b4a51e..773bf9dd57d 100644 --- a/db/docs/slack_integrations_scopes.yml +++ b/db/docs/slack_integrations_scopes.yml @@ -1,7 +1,7 @@ --- table_name: slack_integrations_scopes classes: -- Integrations::SlackIntegrationsKnownApiScope +- Integrations::SlackWorkspace::IntegrationApiScope feature_categories: - integrations description: Data related to the Slack application integration. diff --git a/db/docs/snippet_repositories.yml b/db/docs/snippet_repositories.yml index f33c3828c46..e2fd54f7c58 100644 --- a/db/docs/snippet_repositories.yml +++ b/db/docs/snippet_repositories.yml @@ -3,7 +3,7 @@ table_name: snippet_repositories classes: - SnippetRepository feature_categories: -- snippets +- source_code_management description: Stores repository information used to version control snippets. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23796 milestone: '12.8' diff --git a/db/docs/snippet_statistics.yml b/db/docs/snippet_statistics.yml index 74a0d29bedc..ad816a6e2e0 100644 --- a/db/docs/snippet_statistics.yml +++ b/db/docs/snippet_statistics.yml @@ -3,7 +3,7 @@ table_name: snippet_statistics classes: - SnippetStatistics feature_categories: -- snippets +- source_code_management description: Stores the repository size, commit count, and file count regarding the snippet repository. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35026 milestone: '13.2' diff --git a/db/docs/snippet_user_mentions.yml b/db/docs/snippet_user_mentions.yml index 8f141bd0263..099d027d145 100644 --- a/db/docs/snippet_user_mentions.yml +++ b/db/docs/snippet_user_mentions.yml @@ -3,7 +3,7 @@ table_name: snippet_user_mentions classes: - SnippetUserMention feature_categories: -- snippets +- source_code_management description: For storing mentioned users, groups, projects referenced in a snippet description. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19009 milestone: '12.6' diff --git a/db/docs/snippets.yml b/db/docs/snippets.yml index 4d92b59c924..1a1719552a1 100644 --- a/db/docs/snippets.yml +++ b/db/docs/snippets.yml @@ -5,7 +5,7 @@ classes: - ProjectSnippet - Snippet feature_categories: -- snippets +- source_code_management description: GitLab snippets allow you to store and share bits of code and text with other users. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/9265de3d25715aeafd38a4ef41596dca058dc18c milestone: "1.0.1" diff --git a/db/docs/suggestions.yml b/db/docs/suggestions.yml index 7667a693b32..7d8ee3ca4d9 100644 --- a/db/docs/suggestions.yml +++ b/db/docs/suggestions.yml @@ -3,7 +3,7 @@ table_name: suggestions classes: - Suggestion feature_categories: -- code_review +- code_review_workflow description: Storing code suggestions within notes introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/8656 milestone: '11.6' diff --git a/db/docs/timelog_categories.yml b/db/docs/timelog_categories.yml index 8448e3dd59f..a8874837a35 100644 --- a/db/docs/timelog_categories.yml +++ b/db/docs/timelog_categories.yml @@ -1,7 +1,7 @@ --- table_name: timelog_categories classes: -- TimelogCategory +- TimeTracking::TimelogCategory feature_categories: - team_planning description: Categories that can be associated to a timelog to categorize them diff --git a/db/docs/uploads.yml b/db/docs/uploads.yml index b22f8b1d1ad..88f3bd68946 100644 --- a/db/docs/uploads.yml +++ b/db/docs/uploads.yml @@ -3,12 +3,12 @@ table_name: uploads classes: - Upload feature_categories: -- code_review +- code_review_workflow - design_management - importers - portfolio_management - projects -- snippets +- source_code_management - team_planning description: For tracking blob metadata. Single table inheritance is used to relate this table to many other tables. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/4c622b71fd284058deee483bf0009f8179b792bc diff --git a/db/docs/user_achievements.yml b/db/docs/user_achievements.yml new file mode 100644 index 00000000000..e60631de630 --- /dev/null +++ b/db/docs/user_achievements.yml @@ -0,0 +1,10 @@ +--- +table_name: user_achievements +classes: +- Achievements::UserAchievement +feature_categories: +- users +description: Achievements awarded to and revoked from users +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107027 +milestone: '15.8' +gitlab_schema: gitlab_main diff --git a/db/docs/user_highest_roles.yml b/db/docs/user_highest_roles.yml index 8713aff5f3f..cc12e3080ff 100644 --- a/db/docs/user_highest_roles.yml +++ b/db/docs/user_highest_roles.yml @@ -3,8 +3,8 @@ table_name: user_highest_roles classes: - UserHighestRole feature_categories: -- utilization -description: TODO +- authentication_and_authorization +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' gitlab_schema: gitlab_main diff --git a/db/docs/user_namespace_callouts.yml b/db/docs/user_namespace_callouts.yml index 3f057e21aee..7ffc2e0c209 100644 --- a/db/docs/user_namespace_callouts.yml +++ b/db/docs/user_namespace_callouts.yml @@ -1,10 +1,9 @@ --- table_name: user_namespace_callouts -classes: -- Users::NamespaceCallout +classes: [] feature_categories: - navigation description: Contains records of which users have dismissed a callout, grouped by namespace. introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91092 milestone: '15.2' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main
\ No newline at end of file diff --git a/db/docs/users_statistics.yml b/db/docs/users_statistics.yml index 9110ee6063d..5fdbc60616f 100644 --- a/db/docs/users_statistics.yml +++ b/db/docs/users_statistics.yml @@ -3,7 +3,7 @@ table_name: users_statistics classes: - UsersStatistics feature_categories: -- utilization +- application_instrumentation description: User statistics introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26261 milestone: '12.9' diff --git a/db/docs/views/postgres_partitioned_tables.yml b/db/docs/views/postgres_partitioned_tables.yml index ddec7550e80..c23b582072e 100644 --- a/db/docs/views/postgres_partitioned_tables.yml +++ b/db/docs/views/postgres_partitioned_tables.yml @@ -2,7 +2,7 @@ view_name: postgres_partitioned_tables description: TODO classes: -- Gitlab::Database::PostgresPartitionedTables +- Gitlab::Database::PostgresPartitionedTable feature_categories: - database introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45591 diff --git a/db/docs/vulnerability_remediations.yml b/db/docs/vulnerability_remediations.yml index d522a2147c0..e2de83561d1 100644 --- a/db/docs/vulnerability_remediations.yml +++ b/db/docs/vulnerability_remediations.yml @@ -1,6 +1,7 @@ --- table_name: vulnerability_remediations classes: +- Security::Ingestion::Tasks::IngestRemediations::RemediationBulkInsertProxy - Vulnerabilities::Remediation feature_categories: - vulnerability_management diff --git a/db/docs/vulnerability_state_transitions.yml b/db/docs/vulnerability_state_transitions.yml index 0f168f7a0ee..1a669b1527d 100644 --- a/db/docs/vulnerability_state_transitions.yml +++ b/db/docs/vulnerability_state_transitions.yml @@ -1,9 +1,9 @@ --- table_name: vulnerability_state_transitions classes: - - Vulnerabilities::VulnerabilityStateTransition +- Vulnerabilities::StateTransition feature_categories: - - vulnerability_management +- vulnerability_management description: Stores state transitions of a Vulnerability introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87957 milestone: '15.1' diff --git a/db/docs/work_item_parent_links.yml b/db/docs/work_item_parent_links.yml index 3966154a17e..ca933345fc1 100644 --- a/db/docs/work_item_parent_links.yml +++ b/db/docs/work_item_parent_links.yml @@ -1,7 +1,6 @@ --- table_name: work_item_parent_links classes: -- WorkItem - WorkItems::ParentLink feature_categories: - team_planning diff --git a/db/fixtures/development/03_project.rb b/db/fixtures/development/03_project.rb index ae9a17b637c..d1928a9ad82 100644 --- a/db/fixtures/development/03_project.rb +++ b/db/fixtures/development/03_project.rb @@ -4,6 +4,7 @@ class Gitlab::Seeder::Projects include ActionView::Helpers::NumberHelper PROJECT_URLS = %w[ + https://gitlab.com/gitlab-com/support/toolbox/gitlab-smoke-tests.git https://gitlab.com/gitlab-org/gitlab-test.git https://gitlab.com/gitlab-org/gitlab-shell.git https://gitlab.com/gnuwget/wget2.git diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index 4f6bfc5c82a..fa890531861 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -50,6 +50,17 @@ class Gitlab::Seeder::CycleAnalytics end def seed! + unless project.repository_exists? + 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 + + return + end + create_developers! create_issues! @@ -169,6 +180,7 @@ class Gitlab::Seeder::CycleAnalytics ) project = FactoryBot.create( :project, + :repository, name: "Value Stream Management Project #{suffix}", path: "vsmp-#{suffix}", creator: admin, diff --git a/db/fixtures/development/33_triage_ops.rb b/db/fixtures/development/33_triage_ops.rb index 14832ee4af9..f2266e49efc 100644 --- a/db/fixtures/development/33_triage_ops.rb +++ b/db/fixtures/development/33_triage_ops.rb @@ -7,7 +7,7 @@ class Gitlab::Seeder::TriageOps WEBHOOK_URL = 'http://0.0.0.0:$PORT$' WEBHOOK_TOKEN = "triage-ops-webhook-token" - WORK_TYPE_LABELS = %w( + WORK_TYPE_LABELS = <<~LABELS.split("\n") bug::availability bug::mobile bug::performance @@ -25,9 +25,9 @@ class Gitlab::Seeder::TriageOps type::bug type::feature type::maintenance - ) + LABELS - WORKFLOW_LABELS = %w( + WORKFLOW_LABELS = <<~LABELS.split("\n") workflow::blocked workflow::design workflow::in dev @@ -41,7 +41,39 @@ class Gitlab::Seeder::TriageOps workflow::refinement workflow::validation backlog workflow::verification - ) + LABELS + + OTHER_LABELS = <<~LABELS.split("\n") + ep::contributor tooling + ep::meta + ep::metrics + ep::pipeline + ep::review-apps + ep::triage + master-broken::caching + master-broken::ci-config + master-broken::dependency-upgrade + master-broken::flaky-test + master-broken::fork-repo-test-gap + master-broken::infrastructure + master-broken::need-merge-train + master-broken::pipeline-skipped-before-merge + master-broken::test-selection-gap + master-broken::undetermined + pipeline:expedite + pipeline:expedite-master-fixing + pipeline:mr-approved + pipeline:run-all-jest + pipeline:run-all-rspec + pipeline:run-as-if-foss + pipeline:run-as-if-jh + pipeline:run-flaky-tests + pipeline:run-praefect-with-db + pipeline:run-review-app + pipeline:run-single-db + pipeline:skip-undercoverage + pipeline:update-cache + LABELS def seed! puts "Updating settings to allow web hooks to localhost" @@ -75,6 +107,10 @@ class Gitlab::Seeder::TriageOps puts "Ensuring workflow type labels" ensure_labels_for(WORKFLOW_LABELS, 'gitlab-com') ensure_labels_for(WORKFLOW_LABELS, 'gitlab-org') + + puts "Ensuring other labels" + ensure_labels_for(OTHER_LABELS, 'gitlab-com') + ensure_labels_for(OTHER_LABELS, 'gitlab-org') end end end diff --git a/db/fixtures/development/35_emails.rb b/db/fixtures/development/35_emails.rb new file mode 100644 index 00000000000..a743c326015 --- /dev/null +++ b/db/fixtures/development/35_emails.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +class Gitlab::Seeder::Emails + attr_reader :user, :group_namespace_ids, :project_namespace_ids + + def initialize(user, group_namespace_ids, project_namespace_ids) + @user = user + @group_namespace_ids = group_namespace_ids.sample(3) + @project_namespace_ids = project_namespace_ids.sample(3) + end + + def seed! + company_email = "#{user.username}-work@example.com" + personal_email = "#{user.username}-home@example.com" + oss_email = "#{user.username}-oss@example.com" + unverified_email = "#{user.username}-unverified@example.com" + + Email.create!( + user_id: user.id, + email: unverified_email + ) + + [company_email, personal_email, oss_email].each_with_index do |email, index| + email_id = Email.create!( + user_id: user.id, + email: email, + confirmed_at: DateTime.current + ).id + Users::NamespaceCommitEmail.create!( + user_id: user.id, + namespace_id: group_namespace_ids[index], + email_id: email_id + ) + Users::NamespaceCommitEmail.create!( + user_id: user.id, + namespace_id: project_namespace_ids[index], + email_id: email_id + ) + print '.' + end + end +end + +Gitlab::Seeder.quiet do + puts "\nGenerating email data" + + group_namespace_ids = Group.not_mass_generated.where('parent_id IS NULL').pluck(:id) + project_namespace_ids = Project.all.pluck(:project_namespace_id) + + User.first(3).each do |user| + Gitlab::Seeder::Emails.new(user, group_namespace_ids, project_namespace_ids).seed! + rescue => e + warn "\nError seeding e-mails: #{e}" + end +end diff --git a/db/init_structure.sql b/db/init_structure.sql index 913b495b6fd..00f06078426 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -41,58 +41,534 @@ RETURN NULL; END $$; -CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger +CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN IF (TG_OP = 'DELETE') THEN - DELETE FROM audit_events_archived where id = OLD.id; + DELETE FROM web_hook_logs_archived where id = OLD.id; ELSIF (TG_OP = 'UPDATE') THEN - UPDATE audit_events_archived - SET author_id = NEW.author_id, - entity_id = NEW.entity_id, - entity_type = NEW.entity_type, - details = NEW.details, + UPDATE web_hook_logs_archived + SET web_hook_id = NEW.web_hook_id, + trigger = NEW.trigger, + url = NEW.url, + request_headers = NEW.request_headers, + request_data = NEW.request_data, + response_headers = NEW.response_headers, + response_body = NEW.response_body, + response_status = NEW.response_status, + execution_duration = NEW.execution_duration, + internal_error_message = NEW.internal_error_message, created_at = NEW.created_at, - ip_address = NEW.ip_address, - author_name = NEW.author_name, - target_details = NEW.target_details, - entity_path = NEW.entity_path, - target_type = NEW.target_type, - target_id = NEW.target_id - WHERE audit_events_archived.id = NEW.id; + updated_at = NEW.updated_at + WHERE web_hook_logs_archived.id = NEW.id; ELSIF (TG_OP = 'INSERT') THEN - INSERT INTO audit_events_archived (id, - author_id, - entity_id, - entity_type, - details, + INSERT INTO web_hook_logs_archived (id, + web_hook_id, + trigger, + url, + request_headers, + request_data, + response_headers, + response_body, + response_status, + execution_duration, + internal_error_message, created_at, - ip_address, - author_name, - target_details, - entity_path, - target_type, - target_id) + updated_at) VALUES (NEW.id, - NEW.author_id, - NEW.entity_id, - NEW.entity_type, - NEW.details, + NEW.web_hook_id, + NEW.trigger, + NEW.url, + NEW.request_headers, + NEW.request_data, + NEW.response_headers, + NEW.response_body, + NEW.response_status, + NEW.execution_duration, + NEW.internal_error_message, NEW.created_at, - NEW.ip_address, - NEW.author_name, - NEW.target_details, - NEW.entity_path, - NEW.target_type, - NEW.target_id); + NEW.updated_at); END IF; RETURN NULL; END $$; -COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration: table sync for audit_events table'; +COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table'; + +CREATE FUNCTION trigger_07c94931164e() RETURNS trigger + LANGUAGE plpgsql + AS $$ +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_51ab7cef8934() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_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 + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."deployable_id_convert_to_bigint" := NEW."deployable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8485e97c00e3() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."source_job_id_convert_to_bigint" := NEW."source_job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +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; +$$; + +CREATE FUNCTION trigger_be1804f21693() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."job_id_convert_to_bigint" := NEW."job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_f1ca8ec18d78() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."job_artifact_id_convert_to_bigint" := NEW."job_artifact_id"; + RETURN NEW; +END; +$$; + +CREATE TABLE audit_events ( + id bigint NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_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)) +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE audit_events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; + +CREATE TABLE gitlab_partitions_dynamic.audit_events_000000 ( + 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_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202212 ( + 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_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202301 ( + 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_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202302 ( + 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_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202303 ( + 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_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202304 ( + 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_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 ( + 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_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 ( + 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_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); + +CREATE TABLE web_hook_logs ( + id bigint 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 +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE web_hook_logs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_000000 ( + 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_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, + 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_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202301 ( + 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_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202302 ( + 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_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202303 ( + 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_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202304 ( + 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_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 ( + 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_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 ( + 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_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, @@ -8938,7 +9414,8 @@ CREATE TABLE analytics_cycle_analytics_project_stages ( end_event_label_id bigint, hidden boolean DEFAULT false NOT NULL, custom boolean DEFAULT true NOT NULL, - name character varying(255) NOT NULL + name character varying(255) NOT NULL, + project_value_stream_id bigint NOT NULL ); CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq @@ -8950,33 +9427,31 @@ CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq ALTER SEQUENCE analytics_cycle_analytics_project_stages_id_seq OWNED BY analytics_cycle_analytics_project_stages.id; -CREATE TABLE analytics_devops_adoption_segment_selections ( +CREATE TABLE analytics_cycle_analytics_project_value_streams ( id bigint NOT NULL, - segment_id bigint NOT NULL, - group_id bigint, - project_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - CONSTRAINT segment_selection_project_id_or_group_id_required CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))) + project_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_9b1970a898 CHECK ((char_length(name) <= 100)) ); -CREATE SEQUENCE analytics_devops_adoption_segment_selections_id_seq +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_devops_adoption_segment_selections_id_seq OWNED BY analytics_devops_adoption_segment_selections.id; +ALTER SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq OWNED BY analytics_cycle_analytics_project_value_streams.id; CREATE TABLE analytics_devops_adoption_segments ( id bigint NOT NULL, - name text, last_recorded_at timestamp with time zone, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, namespace_id integer, - CONSTRAINT check_4be7a006fd CHECK ((char_length(name) <= 255)) + display_namespace_id integer ); CREATE SEQUENCE analytics_devops_adoption_segments_id_seq @@ -8990,7 +9465,7 @@ 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 NOT NULL, + segment_id bigint, recorded_at timestamp with time zone NOT NULL, issue_opened boolean NOT NULL, merge_request_opened boolean NOT NULL, @@ -8999,7 +9474,11 @@ CREATE TABLE analytics_devops_adoption_snapshots ( pipeline_succeeded boolean NOT NULL, deploy_succeeded boolean NOT NULL, security_scan_succeeded boolean NOT NULL, - end_time timestamp with time zone NOT NULL + end_time timestamp with time zone NOT NULL, + total_projects_count integer, + code_owners_used_count integer, + namespace_id integer, + CONSTRAINT check_3f472de131 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq @@ -9011,31 +9490,31 @@ CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq ALTER SEQUENCE analytics_devops_adoption_snapshots_id_seq OWNED BY analytics_devops_adoption_snapshots.id; -CREATE TABLE analytics_instance_statistics_measurements ( +CREATE TABLE analytics_language_trend_repository_languages ( + file_count integer DEFAULT 0 NOT NULL, + programming_language_id bigint NOT NULL, + project_id bigint NOT NULL, + loc integer DEFAULT 0 NOT NULL, + bytes integer DEFAULT 0 NOT NULL, + percentage smallint DEFAULT 0 NOT NULL, + snapshot_date date NOT NULL +); + +CREATE TABLE analytics_usage_trends_measurements ( id bigint NOT NULL, count bigint NOT NULL, recorded_at timestamp with time zone NOT NULL, identifier smallint NOT NULL ); -CREATE SEQUENCE analytics_instance_statistics_measurements_id_seq +CREATE SEQUENCE analytics_usage_trends_measurements_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE analytics_instance_statistics_measurements_id_seq OWNED BY analytics_instance_statistics_measurements.id; - -CREATE TABLE analytics_language_trend_repository_languages ( - file_count integer DEFAULT 0 NOT NULL, - programming_language_id bigint NOT NULL, - project_id bigint NOT NULL, - loc integer DEFAULT 0 NOT NULL, - bytes integer DEFAULT 0 NOT NULL, - percentage smallint DEFAULT 0 NOT NULL, - snapshot_date date NOT NULL -); +ALTER SEQUENCE analytics_usage_trends_measurements_id_seq OWNED BY analytics_usage_trends_measurements.id; CREATE TABLE appearances ( id integer NOT NULL, @@ -9377,13 +9856,38 @@ CREATE TABLE application_settings ( invisible_captcha_enabled boolean DEFAULT false NOT NULL, rate_limiting_response_text text, keep_latest_artifact boolean DEFAULT true NOT NULL, - enforce_ssh_key_expiration boolean DEFAULT false NOT NULL, + enforce_ssh_key_expiration boolean DEFAULT true NOT NULL, git_two_factor_session_expiry integer DEFAULT 15 NOT NULL, notes_create_limit integer DEFAULT 300 NOT NULL, notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, asset_proxy_whitelist text, + delayed_project_removal boolean DEFAULT false NOT NULL, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + admin_mode boolean DEFAULT false NOT NULL, + throttle_unauthenticated_packages_api_requests_per_period integer DEFAULT 800 NOT NULL, + throttle_unauthenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_authenticated_packages_api_requests_per_period integer DEFAULT 1000 NOT NULL, + throttle_authenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_unauthenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + valid_runner_registrars character varying[] DEFAULT '{project,group}'::character varying[], + whats_new_variant smallint DEFAULT 0, + external_pipeline_validation_service_timeout integer, + encrypted_external_pipeline_validation_service_token text, + encrypted_external_pipeline_validation_service_token_iv text, + external_pipeline_validation_service_url text, + deactivate_dormant_users boolean DEFAULT false NOT NULL, + encrypted_spam_check_api_key bytea, + encrypted_spam_check_api_key_iv bytea, + elasticsearch_username text, + encrypted_elasticsearch_password bytea, + encrypted_elasticsearch_password_iv bytea, + floc_enabled boolean DEFAULT false NOT NULL, + diff_max_lines integer DEFAULT 50000 NOT NULL, + diff_max_files integer DEFAULT 1000 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), + CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), @@ -9398,6 +9902,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_b4f67a6296 CHECK ((allow_local_requests_from_web_hooks_and_services IS NOT NULL)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)), + CONSTRAINT check_e5024c8801 CHECK ((char_length(elasticsearch_username) <= 255)), CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255)), CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)) ); @@ -9631,53 +10136,6 @@ CREATE SEQUENCE atlassian_identities_user_id_seq ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id; -CREATE TABLE audit_events ( - id bigint NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - ip_address inet, - author_name text, - target_details text, - entity_path text, - created_at timestamp without time zone NOT NULL, - target_type text, - target_id bigint, - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)) -) -PARTITION BY RANGE (created_at); - -CREATE TABLE audit_events_archived ( - id integer NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - created_at timestamp without time zone, - ip_address inet, - author_name text, - target_details text, - entity_path text, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_82294106dd CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) -); - -CREATE SEQUENCE audit_events_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; - CREATE TABLE authentication_events ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -9782,7 +10240,9 @@ CREATE TABLE batched_background_migration_jobs ( batch_size integer NOT NULL, sub_batch_size integer NOT NULL, status smallint DEFAULT 0 NOT NULL, - attempts smallint DEFAULT 0 NOT NULL + attempts smallint DEFAULT 0 NOT NULL, + metrics jsonb DEFAULT '{}'::jsonb NOT NULL, + pause_ms integer DEFAULT 100 NOT NULL ); CREATE SEQUENCE batched_background_migration_jobs_id_seq @@ -9805,10 +10265,12 @@ CREATE TABLE batched_background_migrations ( "interval" smallint NOT NULL, status smallint DEFAULT 0 NOT NULL, job_class_name text NOT NULL, - batch_class_name text DEFAULT 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy'::text NOT NULL, + batch_class_name text DEFAULT 'PrimaryKeyBatchingStrategy'::text NOT NULL, table_name text NOT NULL, column_name text NOT NULL, job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL, + total_tuple_count bigint, + pause_ms integer DEFAULT 100 NOT NULL, CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)), CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)), CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)), @@ -9961,6 +10423,24 @@ CREATE SEQUENCE boards_epic_board_positions_id_seq ALTER SEQUENCE boards_epic_board_positions_id_seq OWNED BY boards_epic_board_positions.id; +CREATE TABLE boards_epic_board_recent_visits ( + id bigint NOT NULL, + user_id bigint NOT NULL, + epic_board_id bigint NOT NULL, + group_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE boards_epic_board_recent_visits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_board_recent_visits_id_seq OWNED BY boards_epic_board_recent_visits.id; + CREATE TABLE boards_epic_boards ( id bigint NOT NULL, hide_backlog_list boolean DEFAULT false NOT NULL, @@ -10121,6 +10601,47 @@ 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_uploads ( + id bigint NOT NULL, + export_id bigint NOT NULL, + updated_at timestamp with time zone NOT NULL, + export_file text, + CONSTRAINT check_5add76239d CHECK ((char_length(export_file) <= 255)) +); + +CREATE SEQUENCE bulk_import_export_uploads_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_export_uploads_id_seq OWNED BY bulk_import_export_uploads.id; + +CREATE TABLE bulk_import_exports ( + id bigint NOT NULL, + group_id bigint, + project_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + relation text NOT NULL, + jid text, + error text, + CONSTRAINT check_24cb010672 CHECK ((char_length(relation) <= 255)), + CONSTRAINT check_8f0f357334 CHECK ((char_length(error) <= 255)), + CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255)) +); + +CREATE SEQUENCE bulk_import_exports_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_exports_id_seq OWNED BY bulk_import_exports.id; + CREATE TABLE bulk_import_failures ( id bigint NOT NULL, bulk_import_entity_id bigint NOT NULL, @@ -10152,8 +10673,12 @@ CREATE TABLE bulk_import_trackers ( relation text NOT NULL, next_page text, has_next_page boolean DEFAULT false NOT NULL, + jid text, + stage smallint DEFAULT 0 NOT NULL, + status smallint DEFAULT 0 NOT NULL, 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)), CONSTRAINT check_next_page_requirement CHECK (((has_next_page IS FALSE) OR (next_page IS NOT NULL))) ); @@ -10231,7 +10756,8 @@ CREATE TABLE ci_build_needs ( build_id integer NOT NULL, name text NOT NULL, artifacts boolean DEFAULT true NOT NULL, - optional boolean DEFAULT false NOT NULL + optional boolean DEFAULT false NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_needs_id_seq @@ -10286,7 +10812,8 @@ CREATE TABLE ci_build_trace_chunks ( data_store integer NOT NULL, raw_data bytea, checksum bytea, - lock_version integer DEFAULT 0 NOT NULL + lock_version integer DEFAULT 0 NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_trace_chunks_id_seq @@ -10321,7 +10848,8 @@ CREATE TABLE ci_build_trace_sections ( byte_start bigint NOT NULL, byte_end bigint NOT NULL, build_id integer NOT NULL, - section_name_id integer NOT NULL + section_name_id integer NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE ci_builds ( @@ -10369,7 +10897,9 @@ CREATE TABLE ci_builds ( processed boolean, resource_group_id bigint, waiting_for_resource_at timestamp with time zone, - scheduling_type smallint + scheduling_type smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + stage_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_builds_id_seq @@ -10394,7 +10924,8 @@ CREATE TABLE ci_builds_metadata ( has_exposed_artifacts boolean, environment_auto_stop_in character varying(255), expanded_environment_name character varying(255), - secrets jsonb DEFAULT '{}'::jsonb NOT NULL + secrets jsonb DEFAULT '{}'::jsonb NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -10412,7 +10943,8 @@ CREATE TABLE ci_builds_runner_session ( build_id integer NOT NULL, url character varying NOT NULL, certificate character varying, - "authorization" character varying + "authorization" character varying, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_runner_session_id_seq @@ -10498,7 +11030,8 @@ CREATE TABLE ci_group_variables ( updated_at timestamp with time zone NOT NULL, masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - environment_scope text DEFAULT '*'::text NOT NULL + environment_scope text DEFAULT '*'::text NOT NULL, + CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)) ); CREATE SEQUENCE ci_group_variables_id_seq @@ -10547,6 +11080,8 @@ CREATE TABLE ci_job_artifacts ( file_sha256 bytea, file_format smallint, file_location smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + job_id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)) ); @@ -10560,6 +11095,23 @@ CREATE SEQUENCE ci_job_artifacts_id_seq ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY ci_job_artifacts.id; +CREATE TABLE ci_job_token_project_scope_links ( + id bigint NOT NULL, + source_project_id bigint NOT NULL, + target_project_id bigint NOT NULL, + added_by_id bigint, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE ci_job_token_project_scope_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_token_project_scope_links_id_seq OWNED BY ci_job_token_project_scope_links.id; + CREATE TABLE ci_job_variables ( id bigint NOT NULL, key character varying NOT NULL, @@ -10579,6 +11131,26 @@ CREATE SEQUENCE ci_job_variables_id_seq ALTER SEQUENCE ci_job_variables_id_seq OWNED BY ci_job_variables.id; +CREATE TABLE ci_minutes_additional_packs ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id bigint NOT NULL, + expires_at date, + number_of_minutes integer NOT NULL, + purchase_xid text, + CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32)) +); + +CREATE SEQUENCE ci_minutes_additional_packs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_minutes_additional_packs_id_seq OWNED BY ci_minutes_additional_packs.id; + CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -10597,6 +11169,22 @@ CREATE SEQUENCE ci_namespace_monthly_usages_id_seq ALTER SEQUENCE ci_namespace_monthly_usages_id_seq OWNED BY ci_namespace_monthly_usages.id; +CREATE TABLE ci_pending_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL +); + +CREATE SEQUENCE ci_pending_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pending_builds_id_seq OWNED BY ci_pending_builds.id; + CREATE TABLE ci_pipeline_artifacts ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -10609,8 +11197,16 @@ CREATE TABLE ci_pipeline_artifacts ( file_format smallint NOT NULL, file text, expire_at timestamp with time zone, + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, CONSTRAINT check_191b5850ec CHECK ((char_length(file) <= 255)), - CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)) + CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)), + CONSTRAINT ci_pipeline_artifacts_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); CREATE SEQUENCE ci_pipeline_artifacts_id_seq @@ -10920,7 +11516,8 @@ CREATE TABLE ci_runners ( runner_type smallint NOT NULL, token_encrypted character varying, public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL, - private_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 ); CREATE SEQUENCE ci_runners_id_seq @@ -10933,13 +11530,32 @@ CREATE SEQUENCE ci_runners_id_seq ALTER SEQUENCE ci_runners_id_seq OWNED BY ci_runners.id; +CREATE TABLE ci_running_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + runner_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + runner_type smallint NOT NULL +); + +CREATE SEQUENCE ci_running_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id; + CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, pipeline_id integer, source_project_id integer, source_job_id integer, - source_pipeline_id integer + source_pipeline_id integer, + source_job_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_sources_pipelines_id_seq @@ -11076,6 +11692,42 @@ CREATE SEQUENCE ci_triggers_id_seq ALTER SEQUENCE ci_triggers_id_seq OWNED BY ci_triggers.id; +CREATE TABLE ci_unit_test_failures ( + id bigint NOT NULL, + failed_at timestamp with time zone NOT NULL, + unit_test_id bigint NOT NULL, + build_id bigint NOT NULL +); + +CREATE SEQUENCE ci_unit_test_failures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_test_failures_id_seq OWNED BY ci_unit_test_failures.id; + +CREATE TABLE ci_unit_tests ( + id bigint NOT NULL, + project_id bigint NOT NULL, + key_hash text NOT NULL, + name text NOT NULL, + suite_name text NOT NULL, + CONSTRAINT check_248fae1a3b CHECK ((char_length(name) <= 255)), + CONSTRAINT check_b288215ffe CHECK ((char_length(key_hash) <= 64)), + CONSTRAINT check_c2d57b3c49 CHECK ((char_length(suite_name) <= 255)) +); + +CREATE SEQUENCE ci_unit_tests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_tests_id_seq OWNED BY ci_unit_tests.id; + CREATE TABLE ci_variables ( id integer NOT NULL, key character varying NOT NULL, @@ -11109,6 +11761,8 @@ CREATE TABLE cluster_agent_tokens ( created_by_user_id bigint, description text, name text, + last_used_at timestamp with time zone, + CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)), CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)), CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)), CONSTRAINT check_c60daed227 CHECK ((char_length(token_encrypted) <= 255)) @@ -11535,6 +12189,24 @@ CREATE SEQUENCE clusters_id_seq ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; +CREATE TABLE clusters_integration_elasticstack ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + chart_version text, + CONSTRAINT check_f8d671ce04 CHECK ((char_length(chart_version) <= 10)) +); + +CREATE TABLE clusters_integration_prometheus ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + encrypted_alert_manager_token text, + encrypted_alert_manager_token_iv text +); + CREATE TABLE clusters_kubernetes_namespaces ( id bigint NOT NULL, cluster_id integer NOT NULL, @@ -11747,6 +12419,13 @@ CREATE SEQUENCE dast_profiles_id_seq ALTER SEQUENCE dast_profiles_id_seq OWNED BY dast_profiles.id; +CREATE TABLE dast_profiles_pipelines ( + dast_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Profiles and CI Pipelines"}'; + CREATE TABLE dast_scanner_profiles ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -11770,6 +12449,31 @@ CREATE SEQUENCE dast_scanner_profiles_id_seq ALTER SEQUENCE dast_scanner_profiles_id_seq OWNED BY dast_scanner_profiles.id; +CREATE TABLE dast_site_profile_secret_variables ( + id bigint NOT NULL, + dast_site_profile_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL, + key text NOT NULL, + encrypted_value bytea NOT NULL, + encrypted_value_iv bytea NOT NULL, + CONSTRAINT check_236213f179 CHECK ((length(encrypted_value) <= 13352)), + CONSTRAINT check_8cbef204b2 CHECK ((char_length(key) <= 255)), + CONSTRAINT check_b49080abbf CHECK ((length(encrypted_value_iv) <= 17)) +); + +COMMENT ON TABLE dast_site_profile_secret_variables IS '{"owner":"group::dynamic analysis","description":"Secret variables used in DAST on-demand scans"}'; + +CREATE SEQUENCE dast_site_profile_secret_variables_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dast_site_profile_secret_variables_id_seq OWNED BY dast_site_profile_secret_variables.id; + CREATE TABLE dast_site_profiles ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11777,7 +12481,18 @@ CREATE TABLE dast_site_profiles ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, name text NOT NULL, - CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)) + excluded_urls text[] DEFAULT '{}'::text[] NOT NULL, + auth_enabled boolean DEFAULT false NOT NULL, + auth_url text, + auth_username_field text, + auth_password_field text, + auth_username text, + target_type smallint DEFAULT 0 NOT NULL, + CONSTRAINT check_5203110fee CHECK ((char_length(auth_username_field) <= 255)), + CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_c329dffdba CHECK ((char_length(auth_password_field) <= 255)), + CONSTRAINT check_d446f7047b CHECK ((char_length(auth_url) <= 1024)), + CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255)) ); CREATE SEQUENCE dast_site_profiles_id_seq @@ -11789,6 +12504,13 @@ CREATE SEQUENCE dast_site_profiles_id_seq ALTER SEQUENCE dast_site_profiles_id_seq OWNED BY dast_site_profiles.id; +CREATE TABLE dast_site_profiles_pipelines ( + dast_site_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_site_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Site Profiles and CI Pipelines"}'; + CREATE TABLE dast_site_tokens ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11995,7 +12717,8 @@ CREATE TABLE deployments ( on_stop character varying, finished_at timestamp with time zone, status smallint NOT NULL, - cluster_id integer + cluster_id integer, + deployable_id_convert_to_bigint bigint ); CREATE SEQUENCE deployments_id_seq @@ -12165,13 +12888,53 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_index_settings ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + number_of_replicas smallint DEFAULT 1 NOT NULL, + number_of_shards smallint DEFAULT 5 NOT NULL, + alias_name text NOT NULL, + CONSTRAINT check_c30005c325 CHECK ((char_length(alias_name) <= 255)) +); + +CREATE SEQUENCE elastic_index_settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_index_settings_id_seq OWNED BY elastic_index_settings.id; + +CREATE TABLE elastic_reindexing_slices ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + elastic_reindexing_subtask_id bigint NOT NULL, + elastic_slice smallint DEFAULT 0 NOT NULL, + elastic_max_slice smallint DEFAULT 0 NOT NULL, + retry_attempt smallint DEFAULT 0 NOT NULL, + elastic_task text, + CONSTRAINT check_ca30e1396e CHECK ((char_length(elastic_task) <= 255)) +); + +CREATE SEQUENCE elastic_reindexing_slices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_reindexing_slices_id_seq OWNED BY elastic_reindexing_slices.id; + CREATE TABLE elastic_reindexing_subtasks ( id bigint NOT NULL, elastic_reindexing_task_id bigint NOT NULL, alias_name text NOT NULL, index_name_from text NOT NULL, index_name_to text NOT NULL, - elastic_task text NOT NULL, + elastic_task text, documents_count_target integer, documents_count integer, created_at timestamp with time zone NOT NULL, @@ -12204,6 +12967,8 @@ CREATE TABLE elastic_reindexing_tasks ( error_message text, documents_count_target integer, delete_original_index_at timestamp with time zone, + max_slices_running smallint DEFAULT 60 NOT NULL, + slice_multiplier smallint DEFAULT 2 NOT NULL, CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)), CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)), CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)), @@ -12387,6 +13152,7 @@ CREATE TABLE events ( target_type character varying, group_id bigint, fingerprint bytea, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128)) ); @@ -12422,14 +13188,14 @@ CREATE TABLE experiment_subjects ( id bigint NOT NULL, experiment_id bigint NOT NULL, user_id bigint, - group_id bigint, project_id bigint, variant smallint DEFAULT 0 NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, converted_at timestamp with time zone, context jsonb DEFAULT '{}'::jsonb NOT NULL, - CONSTRAINT chk_has_one_subject CHECK ((num_nonnulls(user_id, group_id, project_id) = 1)) + namespace_id bigint, + CONSTRAINT check_f6411bc4b5 CHECK ((num_nonnulls(user_id, namespace_id, project_id) = 1)) ); CREATE SEQUENCE experiment_subjects_id_seq @@ -12719,7 +13485,8 @@ ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_sto CREATE TABLE geo_job_artifact_deleted_events ( id bigint NOT NULL, job_artifact_id integer NOT NULL, - file_path character varying NOT NULL + file_path character varying NOT NULL, + job_artifact_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq @@ -13006,7 +13773,8 @@ CREATE TABLE gitlab_subscription_histories ( gitlab_subscription_id bigint NOT NULL, created_at timestamp with time zone, trial_starts_on date, - auto_renew boolean + auto_renew boolean, + trial_extension_type smallint ); CREATE SEQUENCE gitlab_subscription_histories_id_seq @@ -13033,7 +13801,9 @@ CREATE TABLE gitlab_subscriptions ( trial_starts_on date, auto_renew boolean, seats_in_use integer DEFAULT 0 NOT NULL, - seats_owed integer DEFAULT 0 NOT NULL + seats_owed integer DEFAULT 0 NOT NULL, + trial_extension_type smallint, + CONSTRAINT check_77fea3f0e7 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE gitlab_subscriptions_id_seq @@ -13255,7 +14025,11 @@ CREATE TABLE group_merge_request_approval_settings ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, group_id bigint NOT NULL, - allow_author_approval boolean DEFAULT false NOT NULL + allow_author_approval boolean DEFAULT false NOT NULL, + allow_committer_approval boolean DEFAULT false NOT NULL, + allow_overrides_to_approver_list_per_merge_request boolean DEFAULT false NOT NULL, + retain_approvals_on_push boolean DEFAULT false NOT NULL, + require_password_to_approve boolean DEFAULT false NOT NULL ); CREATE TABLE group_repository_storage_moves ( @@ -13333,7 +14107,9 @@ CREATE TABLE import_export_uploads ( project_id integer, import_file text, export_file text, - group_id bigint + group_id bigint, + remote_import_url text, + CONSTRAINT check_58f0d37481 CHECK ((char_length(remote_import_url) <= 512)) ); CREATE SEQUENCE import_export_uploads_id_seq @@ -13369,6 +14145,60 @@ CREATE SEQUENCE import_failures_id_seq ALTER SEQUENCE import_failures_id_seq OWNED BY import_failures.id; +CREATE TABLE in_product_marketing_emails ( + id bigint NOT NULL, + user_id bigint NOT NULL, + cta_clicked_at timestamp with time zone, + track smallint NOT NULL, + series smallint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE in_product_marketing_emails_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE in_product_marketing_emails_id_seq OWNED BY in_product_marketing_emails.id; + +CREATE TABLE incident_management_escalation_policies ( + id bigint NOT NULL, + project_id bigint NOT NULL, + name text NOT NULL, + description text, + CONSTRAINT check_510b2a5258 CHECK ((char_length(description) <= 160)), + CONSTRAINT check_9a26365850 CHECK ((char_length(name) <= 72)) +); + +CREATE SEQUENCE incident_management_escalation_policies_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_policies_id_seq OWNED BY incident_management_escalation_policies.id; + +CREATE TABLE incident_management_escalation_rules ( + id bigint NOT NULL, + policy_id bigint NOT NULL, + oncall_schedule_id bigint NOT NULL, + status smallint NOT NULL, + elapsed_time_seconds integer NOT NULL +); + +CREATE SEQUENCE incident_management_escalation_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_rules_id_seq OWNED BY incident_management_escalation_rules.id; + CREATE TABLE incident_management_oncall_participants ( id bigint NOT NULL, oncall_rotation_id bigint NOT NULL, @@ -13747,6 +14577,9 @@ CREATE TABLE iterations_cadences ( active boolean DEFAULT true NOT NULL, automatic boolean DEFAULT true NOT NULL, title text NOT NULL, + roll_over boolean DEFAULT false NOT NULL, + description text, + CONSTRAINT check_5c5d2b44bd CHECK ((char_length(description) <= 5000)), CONSTRAINT check_fedff82d3b CHECK ((char_length(title) <= 255)) ); @@ -13764,7 +14597,9 @@ CREATE TABLE jira_connect_installations ( client_key character varying, encrypted_shared_secret character varying, encrypted_shared_secret_iv character varying, - base_url character varying + base_url character varying, + instance_url text, + CONSTRAINT check_4c6abed669 CHECK ((char_length(instance_url) <= 255)) ); CREATE SEQUENCE jira_connect_installations_id_seq @@ -13842,14 +14677,6 @@ CREATE TABLE jira_tracker_data ( deployment_type smallint DEFAULT 0 NOT NULL, vulnerabilities_issuetype text, vulnerabilities_enabled boolean DEFAULT false NOT NULL, - encrypted_proxy_address text, - encrypted_proxy_address_iv text, - encrypted_proxy_port text, - encrypted_proxy_port_iv text, - encrypted_proxy_username text, - encrypted_proxy_username_iv text, - encrypted_proxy_password text, - encrypted_proxy_password_iv text, jira_issue_transition_automatic boolean DEFAULT false NOT NULL, CONSTRAINT check_0bf84b76e9 CHECK ((char_length(vulnerabilities_issuetype) <= 255)), CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255)) @@ -13876,7 +14703,9 @@ CREATE TABLE keys ( public boolean DEFAULT false NOT NULL, last_used_at timestamp without time zone, fingerprint_sha256 bytea, - expires_at timestamp with time zone + expires_at timestamp with time zone, + expiry_notification_delivered_at timestamp with time zone, + before_expiry_notification_delivered_at timestamp with time zone ); CREATE SEQUENCE keys_id_seq @@ -14035,7 +14864,8 @@ CREATE TABLE licenses ( id integer NOT NULL, data text NOT NULL, created_at timestamp without time zone, - updated_at timestamp without time zone + updated_at timestamp without time zone, + cloud boolean DEFAULT false ); CREATE SEQUENCE licenses_id_seq @@ -14213,6 +15043,24 @@ CREATE SEQUENCE merge_request_context_commits_id_seq ALTER SEQUENCE merge_request_context_commits_id_seq OWNED BY merge_request_context_commits.id; +CREATE TABLE merge_request_diff_commit_users ( + id bigint NOT NULL, + name text, + email text, + CONSTRAINT check_147358fc42 CHECK ((char_length(name) <= 512)), + CONSTRAINT check_f5fa206cf7 CHECK ((char_length(email) <= 512)), + CONSTRAINT merge_request_diff_commit_users_name_or_email_existence CHECK (((COALESCE(name, ''::text) <> ''::text) OR (COALESCE(email, ''::text) <> ''::text))) +); + +CREATE SEQUENCE merge_request_diff_commit_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_diff_commit_users_id_seq OWNED BY merge_request_diff_commit_users.id; + CREATE TABLE merge_request_diff_commits ( authored_date timestamp with time zone, committed_date timestamp with time zone, @@ -14224,7 +15072,9 @@ CREATE TABLE merge_request_diff_commits ( committer_name text, committer_email text, message text, - trailers jsonb DEFAULT '{}'::jsonb NOT NULL + trailers jsonb DEFAULT '{}'::jsonb NOT NULL, + commit_author_id bigint, + committer_id bigint ); CREATE TABLE merge_request_diff_details ( @@ -14234,6 +15084,8 @@ CREATE TABLE merge_request_diff_details ( verification_retry_count smallint, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT check_81429e3622 CHECK ((char_length(verification_failure) <= 255)) ); @@ -14406,7 +15258,8 @@ CREATE TABLE merge_requests ( rebase_jid character varying, squash_commit_sha bytea, sprint_id bigint, - merge_ref_sha bytea + merge_ref_sha bytea, + draft boolean DEFAULT false NOT NULL ); CREATE TABLE merge_requests_closing_issues ( @@ -14574,6 +15427,9 @@ CREATE TABLE namespace_package_settings ( namespace_id bigint NOT NULL, maven_duplicates_allowed boolean DEFAULT true NOT NULL, maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + generic_duplicates_allowed boolean DEFAULT true NOT NULL, + generic_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + CONSTRAINT check_31340211b1 CHECK ((char_length(generic_duplicate_exception_regex) <= 255)), CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255)) ); @@ -14609,7 +15465,10 @@ CREATE TABLE namespace_settings ( allow_mfa_for_subgroups boolean DEFAULT true NOT NULL, default_branch_name text, repository_read_only boolean DEFAULT false NOT NULL, - delayed_project_removal boolean DEFAULT false NOT NULL, + delayed_project_removal boolean, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + resource_access_token_creation_allowed boolean DEFAULT true NOT NULL, + prevent_sharing_groups_outside_hierarchy boolean DEFAULT false NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)) ); @@ -14743,7 +15602,8 @@ CREATE TABLE notes ( change_position text, resolved_by_push boolean, review_id bigint, - confidential boolean + confidential boolean, + last_edited_at timestamp with time zone ); CREATE SEQUENCE notes_id_seq @@ -15230,6 +16090,30 @@ CREATE SEQUENCE packages_debian_group_components_id_seq ALTER SEQUENCE packages_debian_group_components_id_seq OWNED BY packages_debian_group_components.id; +CREATE TABLE packages_debian_group_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_bc95dc3fbe CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_f708183491 CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_group_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_group_distribution_keys_id_seq OWNED BY packages_debian_group_distribution_keys.id; + CREATE TABLE packages_debian_group_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15332,6 +16216,30 @@ CREATE SEQUENCE packages_debian_project_components_id_seq ALTER SEQUENCE packages_debian_project_components_id_seq OWNED BY packages_debian_project_components.id; +CREATE TABLE packages_debian_project_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_9e8a5eef0a CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_d188f6547f CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_project_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_project_distribution_keys_id_seq OWNED BY packages_debian_project_distribution_keys.id; + CREATE TABLE packages_debian_project_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15438,6 +16346,15 @@ CREATE SEQUENCE packages_events_id_seq 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, + package_file_id bigint NOT NULL, + channel text NOT NULL, + metadata jsonb, + CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63)) +); + CREATE TABLE packages_maven_metadata ( id bigint NOT NULL, package_id bigint NOT NULL, @@ -15817,7 +16734,13 @@ CREATE TABLE plan_limits ( daily_invites integer DEFAULT 0 NOT NULL, ci_pipeline_deployments integer DEFAULT 500 NOT NULL, pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL, - rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL + rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL, + terraform_module_max_file_size bigint DEFAULT 1073741824 NOT NULL, + helm_max_file_size bigint DEFAULT 5242880 NOT NULL, + ci_registered_group_runners integer DEFAULT 1000 NOT NULL, + ci_registered_project_runners integer DEFAULT 1000 NOT NULL, + web_hook_calls integer DEFAULT 0 NOT NULL, + ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -16469,7 +17392,8 @@ CREATE TABLE project_settings ( has_confluence boolean DEFAULT false NOT NULL, cve_id_request_enabled boolean DEFAULT true NOT NULL, has_vulnerabilities boolean DEFAULT false NOT NULL, - prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL + prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL, + mr_default_target_self boolean DEFAULT false NOT NULL ); CREATE TABLE project_statistics ( @@ -16574,7 +17498,7 @@ CREATE TABLE projects ( disable_overriding_approvers_per_merge_request boolean, external_webhook_token character varying, issues_template text, - merge_requests_author_approval boolean, + merge_requests_author_approval boolean DEFAULT false, merge_requests_disable_committers_approval boolean, merge_requests_template text, mirror_last_successful_update_at timestamp without time zone, @@ -16782,10 +17706,12 @@ ALTER SEQUENCE protected_environment_deploy_access_levels_id_seq OWNED BY protec CREATE TABLE protected_environments ( id integer NOT NULL, - project_id integer NOT NULL, + project_id integer, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - name character varying NOT NULL + name character varying NOT NULL, + group_id bigint, + CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))) ); CREATE SEQUENCE protected_environments_id_seq @@ -16845,7 +17771,8 @@ CREATE TABLE push_event_payloads ( commit_to bytea, ref text, commit_title character varying(70), - ref_count integer + ref_count integer, + event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE push_rules ( @@ -17228,7 +18155,8 @@ CREATE TABLE saml_providers ( enforced_sso boolean DEFAULT false NOT NULL, enforced_group_managed_accounts boolean DEFAULT false NOT NULL, prohibited_outer_forks boolean DEFAULT true NOT NULL, - default_membership_role smallint DEFAULT 10 NOT NULL + default_membership_role smallint DEFAULT 10 NOT NULL, + git_check_enforced boolean DEFAULT false NOT NULL ); CREATE SEQUENCE saml_providers_id_seq @@ -17305,7 +18233,8 @@ CREATE TABLE security_orchestration_policy_configurations ( project_id bigint NOT NULL, security_policy_management_project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL + updated_at timestamp with time zone NOT NULL, + configured_at timestamp with time zone ); COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}'; @@ -17319,12 +18248,36 @@ CREATE SEQUENCE security_orchestration_policy_configurations_id_seq ALTER SEQUENCE security_orchestration_policy_configurations_id_seq OWNED BY security_orchestration_policy_configurations.id; +CREATE TABLE security_orchestration_policy_rule_schedules ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + next_run_at timestamp with time zone, + security_orchestration_policy_configuration_id bigint NOT NULL, + user_id bigint NOT NULL, + policy_index integer NOT NULL, + cron text NOT NULL, + CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255)) +); + +COMMENT ON TABLE security_orchestration_policy_rule_schedules IS '{"owner":"group::container security","description":"Schedules used to store relationship between project and security policy repository"}'; + +CREATE SEQUENCE security_orchestration_policy_rule_schedules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE security_orchestration_policy_rule_schedules_id_seq OWNED BY security_orchestration_policy_rule_schedules.id; + CREATE TABLE security_scans ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, build_id bigint NOT NULL, - scan_type smallint NOT NULL + scan_type smallint NOT NULL, + info jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE security_scans_id_seq @@ -17516,6 +18469,8 @@ CREATE TABLE snippet_repositories ( verified_at timestamp with time zone, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT snippet_repositories_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17687,6 +18642,22 @@ CREATE SEQUENCE sprints_id_seq ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id; +CREATE TABLE status_check_responses ( + id bigint NOT NULL, + merge_request_id bigint NOT NULL, + external_approval_rule_id bigint NOT NULL, + sha bytea NOT NULL +); + +CREATE SEQUENCE status_check_responses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE status_check_responses_id_seq OWNED BY status_check_responses.id; + CREATE TABLE status_page_published_incidents ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -17797,7 +18768,9 @@ CREATE TABLE taggings ( tagger_id integer, tagger_type character varying, context character varying, - created_at timestamp without time zone + created_at timestamp without time zone, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + taggable_id_convert_to_bigint bigint ); CREATE SEQUENCE taggings_id_seq @@ -17860,6 +18833,8 @@ CREATE TABLE terraform_state_versions ( verification_checksum bytea, verification_failure text, ci_build_id bigint, + verification_started_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, CONSTRAINT check_0824bb7bbd CHECK ((char_length(file) <= 255)), CONSTRAINT tf_state_versions_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17906,7 +18881,8 @@ CREATE TABLE timelogs ( issue_id integer, merge_request_id integer, spent_at timestamp with time zone, - note_id integer + note_id integer, + project_id integer ); CREATE SEQUENCE timelogs_id_seq @@ -17999,6 +18975,24 @@ CREATE SEQUENCE u2f_registrations_id_seq ALTER SEQUENCE u2f_registrations_id_seq OWNED BY u2f_registrations.id; +CREATE TABLE upcoming_reconciliations ( + id bigint NOT NULL, + namespace_id bigint, + next_reconciliation_date date NOT NULL, + display_alert_from date NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE upcoming_reconciliations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id; + CREATE TABLE uploads ( id integer NOT NULL, size bigint NOT NULL, @@ -18079,6 +19073,11 @@ CREATE SEQUENCE user_canonical_emails_id_seq 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 +); + CREATE TABLE user_custom_attributes ( id integer NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18512,23 +19511,87 @@ CREATE SEQUENCE vulnerability_feedback_id_seq ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id; -CREATE TABLE vulnerability_finding_fingerprints ( +CREATE TABLE vulnerability_finding_evidence_headers ( id bigint NOT NULL, - finding_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - algorithm_type smallint NOT NULL, - fingerprint_sha256 bytea NOT NULL + vulnerability_finding_evidence_request_id bigint, + vulnerability_finding_evidence_response_id bigint, + name text NOT NULL, + value text NOT NULL, + CONSTRAINT check_01d21e8d92 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_3f9011f903 CHECK ((char_length(value) <= 8192)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_headers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_headers_id_seq OWNED BY vulnerability_finding_evidence_headers.id; + +CREATE TABLE vulnerability_finding_evidence_requests ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + method text, + url text, + body text, + CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)), + CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)), + CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_requests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_requests_id_seq OWNED BY vulnerability_finding_evidence_requests.id; + +CREATE TABLE vulnerability_finding_evidence_responses ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + status_code integer, + reason_phrase text, + body text, + CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)), + CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048)) ); -CREATE SEQUENCE vulnerability_finding_fingerprints_id_seq +CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE vulnerability_finding_fingerprints_id_seq OWNED BY vulnerability_finding_fingerprints.id; +ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id; + +CREATE TABLE vulnerability_finding_evidences ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_occurrence_id bigint NOT NULL, + summary text, + CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) +); + +CREATE SEQUENCE vulnerability_finding_evidences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidences_id_seq OWNED BY vulnerability_finding_evidences.id; CREATE TABLE vulnerability_finding_links ( id bigint NOT NULL, @@ -18550,6 +19613,24 @@ CREATE SEQUENCE vulnerability_finding_links_id_seq ALTER SEQUENCE vulnerability_finding_links_id_seq OWNED BY vulnerability_finding_links.id; +CREATE TABLE vulnerability_finding_signatures ( + id bigint NOT NULL, + finding_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + algorithm_type smallint NOT NULL, + signature_sha bytea NOT NULL +); + +CREATE SEQUENCE vulnerability_finding_signatures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_signatures_id_seq OWNED BY vulnerability_finding_signatures.id; + CREATE TABLE vulnerability_findings_remediations ( id bigint NOT NULL, vulnerability_occurrence_id bigint, @@ -18758,7 +19839,8 @@ CREATE TABLE vulnerability_statistics ( low integer DEFAULT 0 NOT NULL, unknown integer DEFAULT 0 NOT NULL, info integer DEFAULT 0 NOT NULL, - letter_grade smallint NOT NULL + letter_grade smallint NOT NULL, + latest_pipeline_id bigint ); CREATE SEQUENCE vulnerability_statistics_id_seq @@ -18788,7 +19870,7 @@ CREATE SEQUENCE vulnerability_user_mentions_id_seq ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id; -CREATE TABLE web_hook_logs ( +CREATE TABLE web_hook_logs_archived ( id integer NOT NULL, web_hook_id integer NOT NULL, trigger character varying, @@ -18804,16 +19886,6 @@ CREATE TABLE web_hook_logs ( updated_at timestamp without time zone NOT NULL ); -CREATE SEQUENCE web_hook_logs_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; - CREATE TABLE web_hooks ( id integer NOT NULL, project_id integer, @@ -18843,7 +19915,10 @@ CREATE TABLE web_hooks ( feature_flag_events boolean DEFAULT false NOT NULL, releases_events boolean DEFAULT false NOT NULL, member_events boolean DEFAULT false NOT NULL, - subgroup_events boolean DEFAULT false NOT NULL + subgroup_events boolean DEFAULT false NOT NULL, + recent_failures smallint DEFAULT 0 NOT NULL, + backoff_count smallint DEFAULT 0 NOT NULL, + disabled_until timestamp with time zone ); CREATE SEQUENCE web_hooks_id_seq @@ -19011,13 +20086,13 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER COLUMN id S 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_devops_adoption_segment_selections ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segment_selections_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_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass); -ALTER TABLE ONLY analytics_instance_statistics_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_instance_statistics_measurements_id_seq'::regclass); +ALTER TABLE ONLY analytics_usage_trends_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_usage_trends_measurements_id_seq'::regclass); ALTER TABLE ONLY appearances ALTER COLUMN id SET DEFAULT nextval('appearances_id_seq'::regclass); @@ -19079,6 +20154,8 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER COLUMN id SET DEFAULT nextval('b ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_positions_id_seq'::regclass); +ALTER TABLE ONLY boards_epic_board_recent_visits ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_recent_visits_id_seq'::regclass); + ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass); ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass); @@ -19093,6 +20170,10 @@ ALTER TABLE ONLY bulk_import_configurations ALTER COLUMN id SET DEFAULT nextval( ALTER TABLE ONLY bulk_import_entities ALTER COLUMN id SET DEFAULT nextval('bulk_import_entities_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); + ALTER TABLE ONLY bulk_import_failures ALTER COLUMN id SET DEFAULT nextval('bulk_import_failures_id_seq'::regclass); ALTER TABLE ONLY bulk_import_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_trackers_id_seq'::regclass); @@ -19131,10 +20212,16 @@ ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_i 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); + ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_variables_id_seq'::regclass); +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_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); + ALTER TABLE ONLY ci_pipeline_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_artifacts_id_seq'::regclass); ALTER TABLE ONLY ci_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass); @@ -19167,6 +20254,8 @@ ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runn ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_seq'::regclass); +ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass); + ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass); ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass); @@ -19183,6 +20272,10 @@ ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_tri ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass); +ALTER TABLE ONLY ci_unit_test_failures ALTER COLUMN id SET DEFAULT nextval('ci_unit_test_failures_id_seq'::regclass); + +ALTER TABLE ONLY ci_unit_tests ALTER COLUMN id SET DEFAULT nextval('ci_unit_tests_id_seq'::regclass); + ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass); ALTER TABLE ONLY cluster_agent_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_agent_tokens_id_seq'::regclass); @@ -19241,6 +20334,8 @@ ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profile ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass); +ALTER TABLE ONLY dast_site_profile_secret_variables ALTER COLUMN id SET DEFAULT nextval('dast_site_profile_secret_variables_id_seq'::regclass); + ALTER TABLE ONLY dast_site_profiles ALTER COLUMN id SET DEFAULT nextval('dast_site_profiles_id_seq'::regclass); ALTER TABLE ONLY dast_site_tokens ALTER COLUMN id SET DEFAULT nextval('dast_site_tokens_id_seq'::regclass); @@ -19277,6 +20372,10 @@ ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_da 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); + +ALTER TABLE ONLY elastic_reindexing_slices ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_slices_id_seq'::regclass); + ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass); ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass); @@ -19387,6 +20486,12 @@ ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('impo ALTER TABLE ONLY import_failures ALTER COLUMN id SET DEFAULT nextval('import_failures_id_seq'::regclass); +ALTER TABLE ONLY in_product_marketing_emails ALTER COLUMN id SET DEFAULT nextval('in_product_marketing_emails_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_policies_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass); + ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass); ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass); @@ -19463,6 +20568,8 @@ ALTER TABLE ONLY merge_request_cleanup_schedules ALTER COLUMN merge_request_id S ALTER TABLE ONLY merge_request_context_commits ALTER COLUMN id SET DEFAULT nextval('merge_request_context_commits_id_seq'::regclass); +ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_commit_users_id_seq'::regclass); + 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_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); @@ -19543,6 +20650,8 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER COLUMN id SET DEFAU ALTER TABLE ONLY packages_debian_group_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_group_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass); @@ -19551,6 +20660,8 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER COLUMN id SET DEF ALTER TABLE ONLY packages_debian_project_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_project_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_publications ALTER COLUMN id SET DEFAULT nextval('packages_debian_publications_id_seq'::regclass); @@ -19699,6 +20810,8 @@ ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_rule_schedules_id_seq'::regclass); + ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass); ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass); @@ -19729,6 +20842,8 @@ ALTER TABLE ONLY spam_logs ALTER COLUMN id SET DEFAULT nextval('spam_logs_id_seq ALTER TABLE ONLY sprints ALTER COLUMN id SET DEFAULT nextval('sprints_id_seq'::regclass); +ALTER TABLE ONLY status_check_responses ALTER COLUMN id SET DEFAULT nextval('status_check_responses_id_seq'::regclass); + ALTER TABLE ONLY status_page_published_incidents ALTER COLUMN id SET DEFAULT nextval('status_page_published_incidents_id_seq'::regclass); ALTER TABLE ONLY status_page_settings ALTER COLUMN project_id SET DEFAULT nextval('status_page_settings_project_id_seq'::regclass); @@ -19759,6 +20874,8 @@ ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass); +ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_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); @@ -19795,10 +20912,18 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass); -ALTER TABLE ONLY vulnerability_finding_fingerprints ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_fingerprints_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass); ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_signatures_id_seq'::regclass); + ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass); ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass); @@ -19839,6 +20964,60 @@ ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_ ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass); +ALTER TABLE ONLY audit_events + ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_000000 + ADD CONSTRAINT audit_events_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202212 + ADD CONSTRAINT audit_events_202212_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202301 + ADD CONSTRAINT audit_events_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202302 + ADD CONSTRAINT audit_events_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202303 + ADD CONSTRAINT audit_events_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202304 + ADD CONSTRAINT audit_events_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305 + ADD CONSTRAINT audit_events_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306 + ADD CONSTRAINT audit_events_202306_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_000000 + ADD CONSTRAINT web_hook_logs_000000_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); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202301 + ADD CONSTRAINT web_hook_logs_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202302 + ADD CONSTRAINT web_hook_logs_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202303 + ADD CONSTRAINT web_hook_logs_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202304 + ADD CONSTRAINT web_hook_logs_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305 + ADD CONSTRAINT web_hook_logs_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306 + ADD CONSTRAINT web_hook_logs_202306_pkey PRIMARY KEY (id, created_at); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -20061,8 +21240,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT analytics_cycle_analytics_project_stages_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT analytics_devops_adoption_segment_selections_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_devops_adoption_segments ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id); @@ -20070,12 +21249,12 @@ ALTER TABLE ONLY analytics_devops_adoption_segments ALTER TABLE ONLY analytics_devops_adoption_snapshots ADD CONSTRAINT analytics_devops_adoption_snapshots_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_instance_statistics_measurements - ADD CONSTRAINT analytics_instance_statistics_measurements_pkey PRIMARY KEY (id); - ALTER TABLE ONLY analytics_language_trend_repository_languages ADD CONSTRAINT analytics_language_trend_repository_languages_pkey PRIMARY KEY (programming_language_id, project_id, snapshot_date); +ALTER TABLE ONLY analytics_usage_trends_measurements + ADD CONSTRAINT analytics_usage_trends_measurements_pkey PRIMARY KEY (id); + ALTER TABLE ONLY appearances ADD CONSTRAINT appearances_pkey PRIMARY KEY (id); @@ -20124,12 +21303,6 @@ ALTER TABLE ONLY approvers ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id); -ALTER TABLE ONLY audit_events_archived - ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY audit_events - ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); - ALTER TABLE ONLY authentication_events ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id); @@ -20172,6 +21345,9 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER TABLE ONLY boards_epic_board_positions ADD CONSTRAINT boards_epic_board_positions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT boards_epic_board_recent_visits_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); @@ -20196,6 +21372,12 @@ ALTER TABLE ONLY bulk_import_configurations ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT bulk_import_entities_pkey PRIMARY KEY (id); +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT bulk_import_export_uploads_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT bulk_import_exports_pkey PRIMARY KEY (id); + ALTER TABLE ONLY bulk_import_failures ADD CONSTRAINT bulk_import_failures_pkey PRIMARY KEY (id); @@ -20268,12 +21450,21 @@ ALTER TABLE ONLY ci_instance_variables ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT ci_job_token_project_scope_links_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_job_variables ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_namespace_monthly_usages ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT ci_pending_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT ci_pipeline_artifacts_pkey PRIMARY KEY (id); @@ -20322,6 +21513,9 @@ ALTER TABLE ONLY ci_runner_projects ALTER TABLE ONLY ci_runners ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); @@ -20346,6 +21540,12 @@ ALTER TABLE ONLY ci_trigger_requests ALTER TABLE ONLY ci_triggers ADD CONSTRAINT ci_triggers_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT ci_unit_test_failures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT ci_unit_tests_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_variables ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id); @@ -20403,6 +21603,12 @@ ALTER TABLE ONLY clusters_applications_prometheus ALTER TABLE ONLY clusters_applications_runners ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT clusters_integration_elasticstack_pkey PRIMARY KEY (cluster_id); + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id); + ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT clusters_kubernetes_namespaces_pkey PRIMARY KEY (id); @@ -20430,12 +21636,21 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY custom_emoji ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id); ALTER TABLE ONLY dast_scanner_profiles ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT dast_site_profiles_pipelines_pkey PRIMARY KEY (dast_site_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_site_profiles ADD CONSTRAINT dast_site_profiles_pkey PRIMARY KEY (id); @@ -20496,6 +21711,12 @@ ALTER TABLE ONLY dora_daily_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_index_settings + ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT elastic_reindexing_slices_pkey PRIMARY KEY (id); + ALTER TABLE ONLY elastic_reindexing_subtasks ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id); @@ -20676,9 +21897,18 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY import_failures ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id); +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT in_product_marketing_emails_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_shifts ADD CONSTRAINT inc_mgmnt_no_overlapping_oncall_shifts EXCLUDE USING gist (rotation_id WITH =, tstzrange(starts_at, ends_at, '[)'::text) WITH &&); +ALTER TABLE ONLY incident_management_escalation_policies + ADD CONSTRAINT incident_management_escalation_policies_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_participants ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id); @@ -20811,6 +22041,9 @@ ALTER TABLE ONLY merge_request_context_commit_diff_files ALTER TABLE ONLY merge_request_context_commits ADD CONSTRAINT merge_request_context_commits_pkey PRIMARY KEY (id); +ALTER TABLE ONLY merge_request_diff_commit_users + ADD CONSTRAINT merge_request_diff_commit_users_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_diff_commits ADD CONSTRAINT merge_request_diff_commits_pkey PRIMARY KEY (merge_request_diff_id, relative_order); @@ -20955,6 +22188,9 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER TABLE ONLY packages_debian_group_components ADD CONSTRAINT packages_debian_group_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_group_distribution_keys + ADD CONSTRAINT packages_debian_group_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_group_distributions ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id); @@ -20967,6 +22203,9 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER TABLE ONLY packages_debian_project_components ADD CONSTRAINT packages_debian_project_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_project_distribution_keys + ADD CONSTRAINT packages_debian_project_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_project_distributions ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id); @@ -20982,6 +22221,9 @@ ALTER TABLE ONLY packages_dependency_links 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); @@ -21231,6 +22473,9 @@ ALTER TABLE ONLY security_findings ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT security_orchestration_policy_configurations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT security_orchestration_policy_rule_schedules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY security_scans ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id); @@ -21288,6 +22533,9 @@ ALTER TABLE ONLY spam_logs ALTER TABLE ONLY sprints ADD CONSTRAINT sprints_pkey PRIMARY KEY (id); +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT status_check_responses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY status_page_published_incidents ADD CONSTRAINT status_page_published_incidents_pkey PRIMARY KEY (id); @@ -21333,6 +22581,9 @@ ALTER TABLE ONLY trending_projects ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT u2f_registrations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY upcoming_reconciliations + ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); @@ -21345,6 +22596,9 @@ ALTER TABLE ONLY user_callouts ALTER TABLE ONLY user_canonical_emails ADD CONSTRAINT user_canonical_emails_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT user_credit_card_validations_pkey PRIMARY KEY (user_id); + ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT user_custom_attributes_pkey PRIMARY KEY (id); @@ -21399,12 +22653,24 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY vulnerability_feedback ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id); -ALTER TABLE ONLY vulnerability_finding_fingerprints - ADD CONSTRAINT vulnerability_finding_fingerprints_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT vulnerability_finding_evidence_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidences + ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id); ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT vulnerability_finding_links_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_signatures + ADD CONSTRAINT vulnerability_finding_signatures_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerability_findings_remediations ADD CONSTRAINT vulnerability_findings_remediations_pkey PRIMARY KEY (id); @@ -21438,8 +22704,8 @@ ALTER TABLE ONLY vulnerability_statistics ALTER TABLE ONLY vulnerability_user_mentions ADD CONSTRAINT vulnerability_user_mentions_pkey PRIMARY KEY (id); -ALTER TABLE ONLY web_hook_logs - ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY web_hook_logs_archived + ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id); ALTER TABLE ONLY web_hooks ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id); @@ -21465,6 +22731,78 @@ ALTER TABLE ONLY x509_issuers ALTER TABLE ONLY zoom_meetings ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id); +CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); + +CREATE INDEX audit_events_000000_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (created_at, author_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); + +CREATE INDEX audit_events_000000_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202212_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202212_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202301_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202301_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202302_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202302_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202303_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202303_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202304_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202304_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202305_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202305_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202306_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202306_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX 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); + +CREATE INDEX index_719c6187cb ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (web_hook_id); + +CREATE INDEX index_80bf138a51 ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (web_hook_id); + +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_962081978f ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (created_at, web_hook_id); + +CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (created_at, web_hook_id); + +CREATE INDEX index_fdb8d5eeea ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (created_at, web_hook_id); + +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); + +CREATE INDEX web_hook_logs_202303_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202303_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202304_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202304_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202305_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202305_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id); + CREATE INDEX 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); @@ -21597,10 +22935,6 @@ CREATE INDEX product_analytics_events_experi_project_id_collector_tstamp_idx ON CREATE INDEX active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) OR (user_type <> ALL ('{2,6,1,3,7,8}'::smallint[])))); -CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); - -CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); - CREATE INDEX analytics_index_events_on_created_at_and_author_id ON events USING btree (created_at, author_id); CREATE INDEX analytics_repository_languages_on_project_id ON analytics_language_trend_repository_languages USING btree (project_id); @@ -21629,22 +22963,44 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL); +CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id); + +CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id); + +CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidences_on_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id); + CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id); -CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE UNIQUE INDEX i_ci_job_token_project_scope_links_on_source_and_target_project ON ci_job_token_project_scope_links USING btree (source_project_id, target_project_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); +CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); + +CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id); CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1); +CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_expiration_policies USING btree (project_id, next_run_at) WHERE (enabled = true); + CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON container_expiration_policies USING btree (project_id, next_run_at, enabled); CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, expiration_policy_started_at); CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace); +CREATE INDEX idx_devops_adoption_segments_namespace_end_time ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time); + +CREATE INDEX idx_devops_adoption_segments_namespace_recorded_at ON analytics_devops_adoption_snapshots USING btree (namespace_id, recorded_at); + +CREATE UNIQUE INDEX idx_devops_adoption_segments_namespaces_pair ON analytics_devops_adoption_segments USING btree (display_namespace_id, namespace_id); + CREATE INDEX idx_eaprpb_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (external_approval_rule_id); +CREATE INDEX idx_elastic_reindexing_slices_on_elastic_reindexing_subtask_id ON elastic_reindexing_slices USING btree (elastic_reindexing_subtask_id); + CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_merge_requests USING btree (environment_id, merge_request_id); CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id); @@ -21655,6 +23011,8 @@ 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_updated_at_and_id_and_state_id ON issues USING btree (project_id, updated_at, id, state_id); @@ -21665,6 +23023,8 @@ CREATE INDEX idx_jira_connect_subscriptions_on_installation_id ON jira_connect_s CREATE UNIQUE INDEX idx_jira_connect_subscriptions_on_installation_id_namespace_id ON jira_connect_subscriptions USING btree (jira_connect_installation_id, namespace_id); +CREATE INDEX idx_keys_expires_at_and_before_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), before_expiry_notification_delivered_at) WHERE (before_expiry_notification_delivered_at IS NULL); + CREATE INDEX idx_members_created_at_user_id_invite_token ON members USING btree (created_at) WHERE ((invite_token IS NOT NULL) AND (user_id IS NULL)); CREATE INDEX idx_merge_requests_on_id_and_merge_jid ON merge_requests USING btree (id, merge_jid) WHERE ((merge_jid IS NOT NULL) AND (state_id = 4)); @@ -21683,6 +23043,8 @@ CREATE UNIQUE INDEX idx_metrics_users_starred_dashboard_on_user_project_dashboar CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_commit_diff_files USING btree (merge_request_context_commit_id, sha); +CREATE INDEX idx_mrs_on_target_id_and_created_at_and_state_id ON merge_requests USING btree (target_project_id, state_id, created_at, id); + CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name); CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url); @@ -21697,9 +23059,9 @@ CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON p CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); -CREATE INDEX idx_pkgs_deb_grp_architectures_on_distribution_id ON packages_debian_group_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id); -CREATE INDEX idx_pkgs_deb_proj_architectures_on_distribution_id ON packages_debian_project_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_project_distribution_keys_on_distribution_id ON packages_debian_project_distribution_keys USING btree (distribution_id); CREATE UNIQUE INDEX idx_pkgs_dep_links_on_pkg_id_dependency_id_dependency_type ON packages_dependency_links USING btree (package_id, dependency_id, dependency_type); @@ -21735,9 +23097,9 @@ CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id); -CREATE UNIQUE INDEX idx_vuln_fingerprints_on_occurrences_id_and_fingerprint ON vulnerability_finding_fingerprints USING btree (finding_id, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha); -CREATE UNIQUE INDEX idx_vuln_fingerprints_uniqueness ON vulnerability_finding_fingerprints USING btree (finding_id, algorithm_type, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha); CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue ON vulnerability_external_issue_links USING btree (vulnerability_id, external_type, external_project_key, external_issue_key); @@ -21795,9 +23157,11 @@ CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON analytics 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_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); +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_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_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 INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); @@ -21875,8 +23239,6 @@ CREATE INDEX index_authentication_events_on_user_id ON authentication_events USI CREATE INDEX index_award_emoji_on_awardable_type_and_awardable_id ON award_emoji USING btree (awardable_type, awardable_id); -CREATE INDEX index_award_emoji_on_user_id_and_name ON award_emoji USING btree (user_id, name); - CREATE UNIQUE INDEX index_aws_roles_on_role_external_id ON aws_roles USING btree (role_external_id); CREATE UNIQUE INDEX index_aws_roles_on_user_id ON aws_roles USING btree (user_id); @@ -21893,6 +23255,8 @@ CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id); CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id); +CREATE INDEX index_batched_jobs_on_batched_migration_id_and_status ON batched_background_migration_jobs USING btree (batched_background_migration_id, status); + CREATE INDEX index_batched_migrations_on_job_table_and_column_name ON batched_background_migrations USING btree (job_class_name, table_name, column_name); CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id); @@ -21935,6 +23299,12 @@ CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_p CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON boards_epic_board_positions USING btree (epic_board_id, epic_id, relative_position); +CREATE INDEX index_boards_epic_board_recent_visits_on_epic_board_id ON boards_epic_board_recent_visits USING btree (epic_board_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_group_id ON boards_epic_board_recent_visits USING btree (group_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_user_id ON boards_epic_board_recent_visits USING btree (user_id); + CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id); CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id); @@ -21973,6 +23343,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_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); CREATE INDEX index_bulk_import_failures_on_correlation_id_value ON bulk_import_failures USING btree (correlation_id_value); @@ -22049,6 +23421,10 @@ CREATE INDEX index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build ON c CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_builds USING btree (project_id, status) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text]))); +CREATE INDEX index_ci_builds_runner_id_pending_covering ON ci_builds USING btree (runner_id, id) INCLUDE (project_id) WHERE (((status)::text = 'pending'::text) AND ((type)::text = 'Ci::Build'::text)); + +CREATE INDEX index_ci_builds_runner_id_running ON ci_builds USING btree (runner_id) WHERE (((status)::text = 'running'::text) AND ((type)::text = 'Ci::Build'::text)); + CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id); CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id); @@ -22079,12 +23455,26 @@ CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btre CREATE INDEX index_ci_job_artifacts_on_project_id_for_security_reports ON ci_job_artifacts USING btree (project_id) WHERE (file_type = ANY (ARRAY[5, 6, 7, 8])); +CREATE INDEX index_ci_job_token_project_scope_links_on_added_by_id ON ci_job_token_project_scope_links USING btree (added_by_id); + +CREATE INDEX index_ci_job_token_project_scope_links_on_target_project_id ON ci_job_token_project_scope_links USING btree (target_project_id); + CREATE INDEX index_ci_job_variables_on_job_id ON ci_job_variables USING btree (job_id); CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables USING btree (key, job_id); +CREATE INDEX index_ci_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_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date); +CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USING btree (build_id); + +CREATE INDEX index_ci_pending_builds_on_project_id ON ci_pending_builds USING btree (project_id); + +CREATE INDEX index_ci_pipeline_artifacts_failed_verification ON ci_pipeline_artifacts USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_ci_pipeline_artifacts_needs_verification ON ci_pipeline_artifacts USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_ci_pipeline_artifacts_on_expire_at ON ci_pipeline_artifacts USING btree (expire_at); CREATE INDEX index_ci_pipeline_artifacts_on_pipeline_id ON ci_pipeline_artifacts USING btree (pipeline_id); @@ -22093,6 +23483,10 @@ CREATE UNIQUE INDEX index_ci_pipeline_artifacts_on_pipeline_id_and_file_type ON CREATE INDEX index_ci_pipeline_artifacts_on_project_id ON ci_pipeline_artifacts USING btree (project_id); +CREATE INDEX index_ci_pipeline_artifacts_pending_verification ON ci_pipeline_artifacts USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_ci_pipeline_artifacts_verification_state ON ci_pipeline_artifacts USING btree (verification_state); + CREATE INDEX index_ci_pipeline_chat_data_on_chat_name_id ON ci_pipeline_chat_data USING btree (chat_name_id); CREATE UNIQUE INDEX index_ci_pipeline_chat_data_on_pipeline_id ON ci_pipeline_chat_data USING btree (pipeline_id); @@ -22105,6 +23499,8 @@ CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipelin CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); +CREATE INDEX index_ci_pipeline_schedules_on_owner_id_and_id_and_active ON ci_pipeline_schedules USING btree (owner_id, id) WHERE (active = true); + CREATE INDEX index_ci_pipeline_schedules_on_project_id ON ci_pipeline_schedules USING btree (project_id); CREATE UNIQUE INDEX index_ci_pipeline_variables_on_pipeline_id_and_key ON ci_pipeline_variables USING btree (pipeline_id, key); @@ -22149,6 +23545,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_config_source ON c CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipelines USING btree (user_id, created_at, source); +CREATE 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 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); @@ -22167,7 +23565,15 @@ CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id); -CREATE INDEX index_ci_runners_on_contacted_at ON ci_runners USING btree (contacted_at); +CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC); + +CREATE INDEX index_ci_runners_on_contacted_at_desc_and_id_desc ON ci_runners USING btree (contacted_at DESC, id DESC); + +CREATE INDEX index_ci_runners_on_created_at_and_id_desc ON ci_runners USING btree (created_at, id DESC); + +CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC); + +CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops); CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked); @@ -22177,6 +23583,12 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token); CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted); +CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id); + +CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id); + +CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id); + CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id); CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id); @@ -22193,6 +23605,8 @@ CREATE UNIQUE INDEX index_ci_sources_projects_on_source_project_id_and_pipeline_ CREATE INDEX index_ci_stages_on_pipeline_id ON ci_stages USING btree (pipeline_id); +CREATE INDEX index_ci_stages_on_pipeline_id_and_id ON ci_stages USING btree (pipeline_id, id) WHERE (status = ANY (ARRAY[0, 1, 2, 8, 9, 10])); + CREATE UNIQUE INDEX index_ci_stages_on_pipeline_id_and_name ON ci_stages USING btree (pipeline_id, name); CREATE INDEX index_ci_stages_on_pipeline_id_and_position ON ci_stages USING btree (pipeline_id, "position"); @@ -22215,11 +23629,15 @@ CREATE INDEX index_ci_triggers_on_owner_id ON ci_triggers USING btree (owner_id) CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project_id); +CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); + +CREATE UNIQUE INDEX index_ci_unit_tests_on_project_id_and_key_hash ON ci_unit_tests USING btree (project_id, key_hash); + CREATE INDEX index_ci_variables_on_key ON ci_variables USING btree (key); CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_scope ON ci_variables USING btree (project_id, key, environment_scope); -CREATE INDEX index_cluster_agent_tokens_on_agent_id ON cluster_agent_tokens USING btree (agent_id); +CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST); CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id); @@ -22323,12 +23741,16 @@ CREATE INDEX index_dast_profiles_on_dast_site_profile_id ON dast_profiles USING CREATE UNIQUE INDEX index_dast_profiles_on_project_id_and_name ON dast_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_profiles_pipelines_on_ci_pipeline_id ON dast_profiles_pipelines USING btree (ci_pipeline_id); + CREATE UNIQUE INDEX index_dast_scanner_profiles_on_project_id_and_name ON dast_scanner_profiles USING btree (project_id, name); CREATE INDEX index_dast_site_profiles_on_dast_site_id ON dast_site_profiles USING btree (dast_site_id); CREATE UNIQUE INDEX index_dast_site_profiles_on_project_id_and_name ON dast_site_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_site_profiles_pipelines_on_ci_pipeline_id ON dast_site_profiles_pipelines USING btree (ci_pipeline_id); + CREATE INDEX index_dast_site_tokens_on_project_id ON dast_site_tokens USING btree (project_id); CREATE INDEX index_dast_site_validations_on_dast_site_token_id ON dast_site_validations USING btree (dast_site_token_id); @@ -22371,12 +23793,18 @@ 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_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); + CREATE INDEX index_deployments_on_environment_status_sha ON deployments USING btree (environment_id, status, sha); CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments USING btree (id, status, created_at); CREATE INDEX index_deployments_on_id_where_cluster_id_present ON deployments USING btree (id) WHERE (cluster_id IS NOT NULL); +CREATE INDEX index_deployments_on_project_and_environment_and_updated_at_id ON deployments USING btree (project_id, environment_id, updated_at, id); + CREATE INDEX index_deployments_on_project_and_finished ON deployments USING btree (project_id, finished_at) WHERE (status = 2); CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC); @@ -22433,6 +23861,8 @@ CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (disc CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id); +CREATE UNIQUE INDEX index_elastic_index_settings_on_alias_name ON elastic_index_settings USING btree (alias_name); + CREATE INDEX index_elastic_reindexing_subtasks_on_elastic_reindexing_task_id ON elastic_reindexing_subtasks USING btree (elastic_reindexing_task_id); CREATE UNIQUE INDEX index_elastic_reindexing_tasks_on_in_progress ON elastic_reindexing_tasks USING btree (in_progress) WHERE in_progress; @@ -22455,12 +23885,16 @@ CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments US CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); +CREATE INDEX index_environments_on_project_id_and_tier ON environments USING btree (project_id, tier) WHERE (tier IS NOT NULL); + CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type); CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text)); CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id); +CREATE UNIQUE INDEX index_epic_board_recent_visits_on_user_group_and_board ON boards_epic_board_recent_visits USING btree (user_id, group_id, epic_board_id); + CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); @@ -22485,8 +23919,6 @@ CREATE INDEX index_epics_on_due_date_sourcing_milestone_id ON epics USING btree CREATE INDEX index_epics_on_end_date ON epics USING btree (end_date); -CREATE INDEX index_epics_on_group_id ON epics USING btree (group_id); - CREATE UNIQUE INDEX index_epics_on_group_id_and_external_key ON epics USING btree (group_id, external_key) WHERE (external_key IS NOT NULL); CREATE UNIQUE INDEX index_epics_on_group_id_and_iid ON epics USING btree (group_id, iid); @@ -22531,7 +23963,7 @@ CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id) CREATE INDEX index_experiment_subjects_on_experiment_id ON experiment_subjects USING btree (experiment_id); -CREATE INDEX index_experiment_subjects_on_group_id ON experiment_subjects USING btree (group_id); +CREATE INDEX index_experiment_subjects_on_namespace_id ON experiment_subjects USING btree (namespace_id); CREATE INDEX index_experiment_subjects_on_project_id ON experiment_subjects USING btree (project_id); @@ -22729,6 +24161,10 @@ 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_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); + CREATE INDEX index_inc_mgmnt_oncall_participants_on_oncall_user_id ON incident_management_oncall_participants USING btree (user_id); CREATE UNIQUE INDEX index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id ON incident_management_oncall_participants USING btree (user_id, oncall_rotation_id); @@ -22837,6 +24273,8 @@ 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 UNIQUE INDEX index_keys_on_fingerprint ON keys USING btree (fingerprint); CREATE INDEX index_keys_on_fingerprint_sha256 ON keys USING btree (fingerprint_sha256); @@ -22915,10 +24353,12 @@ CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at) CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type); -CREATE INDEX index_members_on_user_id ON members USING btree (user_id); +CREATE INDEX index_members_on_user_id_and_access_level_requested_at_is_null ON members USING btree (user_id, access_level) WHERE (requested_at IS NULL); CREATE INDEX index_members_on_user_id_created_at ON members USING btree (user_id, created_at) WHERE ((ldap = true) AND ((type)::text = 'GroupMember'::text) AND ((source_type)::text = 'Namespace'::text)); +CREATE INDEX index_members_on_user_id_source_id_source_type ON members USING btree (user_id, source_id, source_type); + CREATE INDEX index_merge_request_assignees_on_merge_request_id ON merge_request_assignees USING btree (merge_request_id); CREATE UNIQUE INDEX index_merge_request_assignees_on_merge_request_id_and_user_id ON merge_request_assignees USING btree (merge_request_id, user_id); @@ -22931,10 +24371,20 @@ CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id); +CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email); + CREATE INDEX index_merge_request_diff_commits_on_sha ON merge_request_diff_commits USING btree (sha); +CREATE INDEX index_merge_request_diff_details_failed_verification ON merge_request_diff_details USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_merge_request_diff_details_needs_verification ON merge_request_diff_details USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_merge_request_diff_details_on_merge_request_diff_id ON merge_request_diff_details USING btree (merge_request_diff_id); +CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_request_diff_details USING btree (verification_state); + +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_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_store ON merge_request_diffs USING btree (external_diff_store); @@ -23003,6 +24453,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON m CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text); +CREATE INDEX index_merge_requests_on_target_project_id_and_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); CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true)); @@ -23031,6 +24483,8 @@ CREATE INDEX index_metrics_dashboard_annotations_on_timespan_end ON metrics_dash CREATE INDEX index_metrics_users_starred_dashboards_on_project_id ON metrics_users_starred_dashboards USING btree (project_id); +CREATE INDEX index_migration_jobs_on_migration_id_and_finished_at ON batched_background_migration_jobs USING btree (batched_background_migration_id, finished_at); + CREATE INDEX index_milestone_releases_on_release_id ON milestone_releases USING btree (release_id); CREATE INDEX index_milestones_on_description_trigram ON milestones USING gin (description gin_trgm_ops); @@ -23045,7 +24499,7 @@ CREATE INDEX index_milestones_on_title ON milestones USING btree (title); CREATE INDEX index_milestones_on_title_trigram ON milestones USING gin (title gin_trgm_ops); -CREATE INDEX index_mirror_data_on_next_execution_and_retry_count ON project_mirror_data USING btree (next_execution_timestamp, retry_count); +CREATE INDEX index_mirror_data_non_scheduled_or_started ON project_mirror_data USING btree (next_execution_timestamp, retry_count) WHERE ((status)::text <> ALL ('{scheduled,started}'::text[])); CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id); @@ -23065,6 +24519,10 @@ CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON n CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id); +CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree (id) WHERE (parent_id IS NOT NULL); + +CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL); + 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); @@ -23097,12 +24555,16 @@ CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces US CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON namespaces USING btree (shared_runners_minutes_limit, extra_shared_runners_minutes_limit); +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_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_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); CREATE INDEX index_notes_on_commit_id ON notes USING btree (commit_id); @@ -23123,9 +24585,7 @@ CREATE INDEX index_notes_on_project_id_and_noteable_type ON notes USING btree (p CREATE INDEX index_notes_on_review_id ON notes USING btree (review_id); -CREATE INDEX index_notification_settings_on_source_id_and_source_type ON notification_settings USING btree (source_id, source_type); - -CREATE INDEX index_notification_settings_on_user_id ON notification_settings USING btree (user_id); +CREATE INDEX index_notification_settings_on_source_and_level_and_user ON notification_settings USING btree (source_id, source_type, level, user_id); 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); @@ -23149,11 +24609,9 @@ 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_id_partial_with_legacy_storage ON projects USING btree (id) WHERE ((storage_version < 2) OR (storage_version IS NULL)); - 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_instance_statistics_measurements USING btree (identifier, recorded_at); +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_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type); @@ -23165,15 +24623,17 @@ CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((na CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text)); -CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); +CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_escalation_rules USING btree (oncall_schedule_id); -CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); +CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL)); -CREATE UNIQUE INDEX index_on_segment_selections_group_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (group_id, segment_id); +CREATE UNIQUE INDEX index_on_policy_schedule_status_elapsed_time_escalation_rules ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds); -CREATE UNIQUE INDEX index_on_segment_selections_project_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (project_id, segment_id); +CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON incident_management_escalation_policies USING btree (project_id, name); -CREATE INDEX index_on_segment_selections_segment_id ON analytics_devops_adoption_segment_selections USING btree (segment_id); +CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); + +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); @@ -23251,8 +24711,12 @@ CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_depend 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_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); + CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_nuget_dependency_link_metadata USING btree (dependency_link_id); CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 7); @@ -23291,6 +24755,8 @@ CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags U 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); + CREATE INDEX index_pages_deployments_on_project_id ON pages_deployments USING btree (project_id); CREATE INDEX index_pages_domain_acme_orders_on_challenge_token ON pages_domain_acme_orders USING btree (challenge_token); @@ -23579,6 +25045,8 @@ CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON pro CREATE INDEX index_protected_environment_deploy_access_levels_on_user_id ON protected_environment_deploy_access_levels USING btree (user_id); +CREATE UNIQUE INDEX index_protected_environments_on_group_id_and_name ON protected_environments USING btree (group_id, name) WHERE (group_id IS NOT NULL); + CREATE INDEX index_protected_environments_on_project_id ON protected_environments USING btree (project_id); CREATE UNIQUE INDEX index_protected_environments_on_project_id_and_name ON protected_environments USING btree (project_id, name); @@ -23755,6 +25223,8 @@ CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id); +CREATE INDEX index_services_on_project_and_type_where_inherit_null ON services USING btree (project_id, type) WHERE (inherit_from_id IS NULL); + CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type); CREATE INDEX index_services_on_template ON services USING btree (template); @@ -23771,6 +25241,8 @@ CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name); +CREATE UNIQUE INDEX index_site_profile_secret_variables_on_site_profile_id_and_key ON dast_site_profile_secret_variables USING btree (dast_site_profile_id, key); + CREATE INDEX index_slack_integrations_on_service_id ON slack_integrations USING btree (service_id); CREATE UNIQUE INDEX index_slack_integrations_on_team_id_and_alias ON slack_integrations USING btree (team_id, alias); @@ -23781,10 +25253,18 @@ CREATE INDEX index_smartcard_identities_on_user_id ON smartcard_identities USING CREATE INDEX index_snippet_on_id_and_project_id ON snippets USING btree (id, project_id); +CREATE INDEX index_snippet_repositories_failed_verification ON snippet_repositories USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_snippet_repositories_needs_verification ON snippet_repositories USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE UNIQUE INDEX index_snippet_repositories_on_disk_path ON snippet_repositories USING btree (disk_path); CREATE INDEX index_snippet_repositories_on_shard_id ON snippet_repositories USING btree (shard_id); +CREATE INDEX index_snippet_repositories_pending_verification ON snippet_repositories USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_snippet_repositories_verification_state ON snippet_repositories USING btree (verification_state); + CREATE INDEX index_snippet_repository_storage_moves_on_snippet_id ON snippet_repository_storage_moves USING btree (snippet_id); CREATE UNIQUE INDEX index_snippet_user_mentions_on_note_id ON snippet_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); @@ -23821,7 +25301,13 @@ CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id); -CREATE UNIQUE INDEX index_sop_configs_on_security_policy_management_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id); +CREATE INDEX index_sop_configurations_project_id_policy_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id, project_id); + +CREATE INDEX index_sop_schedules_on_sop_configuration_id ON security_orchestration_policy_rule_schedules USING btree (security_orchestration_policy_configuration_id); + +CREATE INDEX index_sop_schedules_on_user_id ON security_orchestration_policy_rule_schedules USING btree (user_id); + +CREATE INDEX index_spam_logs_on_user_id ON spam_logs USING btree (user_id); CREATE INDEX index_sprints_iterations_cadence_id ON sprints USING btree (iterations_cadence_id); @@ -23831,7 +25317,7 @@ CREATE INDEX index_sprints_on_due_date ON sprints USING btree (due_date); CREATE INDEX index_sprints_on_group_id ON sprints USING btree (group_id); -CREATE UNIQUE INDEX index_sprints_on_group_id_and_title ON sprints USING btree (group_id, title) WHERE (group_id IS NOT NULL); +CREATE UNIQUE INDEX index_sprints_on_iterations_cadence_id_and_title ON sprints USING btree (iterations_cadence_id, title); CREATE UNIQUE INDEX index_sprints_on_project_id_and_iid ON sprints USING btree (project_id, iid); @@ -23841,6 +25327,10 @@ CREATE INDEX index_sprints_on_title ON sprints USING btree (title); CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm_ops); +CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id); + +CREATE INDEX index_status_check_responses_on_merge_request_id ON status_check_responses USING btree (merge_request_id); + CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_page_published_incidents USING btree (issue_id); CREATE INDEX index_status_page_settings_on_project_id ON status_page_settings USING btree (project_id); @@ -23873,12 +25363,20 @@ CREATE INDEX index_term_agreements_on_term_id ON term_agreements USING btree (te CREATE INDEX index_term_agreements_on_user_id ON term_agreements USING btree (user_id); +CREATE INDEX index_terraform_state_versions_failed_verification ON terraform_state_versions USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_terraform_state_versions_needs_verification ON terraform_state_versions USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_terraform_state_versions_on_ci_build_id ON terraform_state_versions USING btree (ci_build_id); CREATE INDEX index_terraform_state_versions_on_created_by_user_id ON terraform_state_versions USING btree (created_by_user_id); CREATE UNIQUE INDEX index_terraform_state_versions_on_state_id_and_version ON terraform_state_versions USING btree (terraform_state_id, version); +CREATE INDEX index_terraform_state_versions_on_verification_state ON terraform_state_versions USING btree (verification_state); + +CREATE INDEX index_terraform_state_versions_pending_verification ON terraform_state_versions USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_terraform_states_on_file_store ON terraform_states USING btree (file_store); CREATE INDEX index_terraform_states_on_locked_by_user_id ON terraform_states USING btree (locked_by_user_id); @@ -23895,6 +25393,8 @@ CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_r CREATE INDEX index_timelogs_on_note_id ON timelogs USING btree (note_id); +CREATE INDEX index_timelogs_on_project_id_and_spent_at ON timelogs USING btree (project_id, spent_at); + CREATE INDEX index_timelogs_on_spent_at ON timelogs USING btree (spent_at) WHERE (spent_at IS NOT NULL); CREATE INDEX index_timelogs_on_user_id ON timelogs USING btree (user_id); @@ -23931,6 +25431,12 @@ CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id); +CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC); + +CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id); + +CREATE UNIQUE INDEX index_upcoming_reconciliations_on_namespace_id ON upcoming_reconciliations USING btree (namespace_id); + CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum); CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type); @@ -23991,6 +25497,8 @@ 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_incoming_email_token ON users USING btree (incoming_email_token); CREATE INDEX index_users_on_managing_group_id ON users USING btree (managing_group_id); @@ -24025,6 +25533,8 @@ CREATE INDEX index_users_ops_dashboard_projects_on_project_id ON users_ops_dashb CREATE UNIQUE INDEX index_users_ops_dashboard_projects_on_user_id_and_project_id ON users_ops_dashboard_projects USING btree (user_id, project_id); +CREATE INDEX index_users_require_two_factor_authentication_from_group_false ON users USING btree (require_two_factor_authentication_from_group) WHERE (require_two_factor_authentication_from_group = false); + CREATE INDEX index_users_security_dashboard_projects_on_user_id ON users_security_dashboard_projects USING btree (user_id); CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USING btree (project_id); @@ -24083,7 +25593,7 @@ CREATE INDEX index_vulnerability_feedback_on_merge_request_id ON vulnerability_f CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON vulnerability_feedback USING btree (pipeline_id); -CREATE INDEX index_vulnerability_finding_fingerprints_on_finding_id ON vulnerability_finding_fingerprints USING btree (finding_id); +CREATE INDEX index_vulnerability_finding_signatures_on_finding_id ON vulnerability_finding_signatures USING btree (finding_id); CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vulnerability_findings_remediations USING btree (vulnerability_remediation_id); @@ -24101,6 +25611,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON 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_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); @@ -24119,6 +25631,8 @@ CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_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); CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulnerability_statistics USING btree (project_id); @@ -24129,14 +25643,16 @@ CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerabili CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id); -CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs USING btree (created_at, web_hook_id); +CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id); -CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs USING btree (web_hook_id); +CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id); CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHERE ((type)::text = 'GroupHook'::text); CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id); +CREATE INDEX index_web_hooks_on_project_id_recent_failures ON web_hooks USING btree (project_id, recent_failures); + CREATE INDEX index_web_hooks_on_service_id ON web_hooks USING btree (service_id); CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type); @@ -24203,6 +25719,10 @@ CREATE INDEX packages_packages_needs_verification ON packages_package_files USIN CREATE INDEX packages_packages_pending_verification ON packages_package_files USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_group_id_and_relation ON bulk_import_exports USING btree (group_id, relation) WHERE (group_id IS NOT NULL); + +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_project_id_and_relation ON bulk_import_exports USING btree (project_id, relation) WHERE (project_id IS NOT NULL); + CREATE INDEX partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs ON ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text)); CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON deployments USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); @@ -24215,8 +25735,6 @@ CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_me CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type); -CREATE INDEX temporary_index_vulnerabilities_on_id ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL))); - CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); @@ -24257,6 +25775,102 @@ 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); +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_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_202212_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_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_202301_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_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_202302_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_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_202303_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_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_202304_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_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_202305_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_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_202306_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_pkey; + +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 web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301_pkey; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_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_202303_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_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_202304_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_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_202305_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_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_202306_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_web_hook_id_idx; + ALTER INDEX index_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; @@ -24513,7 +26127,33 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey; -CREATE TRIGGER table_sync_trigger_ee39a25f9d AFTER INSERT OR DELETE OR UPDATE ON audit_events FOR EACH ROW EXECUTE FUNCTION table_sync_function_2be879775d(); +CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db(); + +CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e(); + +CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957(); + +CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2(); + +CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934(); + +CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10(); + +CREATE TRIGGER trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482(); + +CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3(); + +CREATE TRIGGER trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b(); + +CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6(); + +CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3(); + +CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693(); + +CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002(); + +CREATE TRIGGER trigger_f1ca8ec18d78 BEFORE INSERT OR UPDATE ON geo_job_artifact_deleted_events FOR EACH ROW EXECUTE FUNCTION trigger_f1ca8ec18d78(); CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -24566,9 +26206,15 @@ ALTER TABLE ONLY notification_settings ALTER TABLE ONLY lists ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT fk_0f09856e1f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_pages_metadata ADD CONSTRAINT fk_0fd5b22688 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE SET NULL; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_116e7e7369 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24596,6 +26242,9 @@ ALTER TABLE ONLY project_features ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_190998ef09 FOREIGN KEY (external_pull_request_id) REFERENCES external_pull_requests(id) ON DELETE SET NULL; +ALTER TABLE ONLY analytics_devops_adoption_segments + ADD CONSTRAINT fk_190a24754d FOREIGN KEY (display_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_details ADD CONSTRAINT fk_190e4fcc88 FOREIGN KEY (provisioned_by_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -24647,6 +26296,9 @@ ALTER TABLE ONLY notes ALTER TABLE ONLY members ADD CONSTRAINT fk_2e88fb7ce9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT fk_2eb33f7a78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_30f2a831f4 FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE; @@ -24656,15 +26308,15 @@ ALTER TABLE ONLY approvals ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_requests - ADD CONSTRAINT fk_3308fe130c FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; - ALTER TABLE ONLY ci_group_variables ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL; +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT fk_35c9101b63 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24674,11 +26326,14 @@ 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 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 issues - ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY epics ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24713,6 +26368,12 @@ 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 dast_site_profiles_pipelines + ADD CONSTRAINT fk_53849b0ad5 FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(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; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_56067dcb44 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24794,9 +26455,15 @@ ALTER TABLE ONLY users ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_78a6492f68 FOREIGN KEY (repository_updated_event_id) REFERENCES geo_repository_updated_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_devops_adoption_snapshots + ADD CONSTRAINT fk_78c9eac821 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT fk_7a8fabf0a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_branches ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24810,7 +26477,7 @@ ALTER TABLE ONLY labels ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY merge_requests - ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_7f28d925f3 FOREIGN KEY (merged_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24827,6 +26494,9 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY push_rules ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY experiment_subjects + ADD CONSTRAINT fk_842649f2f5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_diffs ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -24842,9 +26512,6 @@ ALTER TABLE ONLY packages_package_files ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_87f4cefcda FOREIGN KEY (upstream_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; -ALTER TABLE ONLY experiment_subjects - ADD CONSTRAINT fk_88489af1b1 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_88b4d546ef FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24857,8 +26524,8 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_8a3072ccb3 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; -ALTER TABLE ONLY timelogs - ADD CONSTRAINT fk_8d058cd571 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT fk_8c6f33cebe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY releases ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24911,6 +26578,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 protected_environments + ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24944,6 +26614,12 @@ ALTER TABLE ONLY bulk_import_entities ALTER TABLE ONLY users ADD CONSTRAINT fk_a4b8fefe3e FOREIGN KEY (managing_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT fk_a56e02279c FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE RESTRICT NOT VALID; + +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_a60cad829d FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25034,6 +26710,9 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_c49c83dd77 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_c4b1c1f66e FOREIGN KEY (repository_deleted_event_id) REFERENCES geo_repository_deleted_events(id) ON DELETE CASCADE; @@ -25049,12 +26728,18 @@ ALTER TABLE ONLY external_approval_rules_protected_branches ALTER TABLE ONLY external_approval_rules_protected_branches ADD CONSTRAINT fk_ca2ffb55e6 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_cc206a8c13 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY experiment_subjects ADD CONSTRAINT fk_ccc28f8ceb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY todos ADD CONSTRAINT fk_ccf0373936 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +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 geo_event_log ADD CONSTRAINT fk_cff7185ad2 FOREIGN KEY (reset_checksum_event_id) REFERENCES geo_reset_checksum_events(id) ON DELETE CASCADE; @@ -25071,7 +26756,7 @@ ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE ONLY web_hooks - ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -25106,9 +26791,6 @@ ALTER TABLE ONLY dependency_proxy_blobs ALTER TABLE ONLY epics ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_ded7fe0344 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY issues ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL; @@ -25148,6 +26830,9 @@ ALTER TABLE ONLY sprints ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY vulnerability_statistics + ADD CONSTRAINT fk_e8b13c928f FOREIGN KEY (latest_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + ALTER TABLE ONLY ci_triggers ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE; @@ -25178,9 +26863,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY epics ADD CONSTRAINT fk_f081aa4489 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_f1472b95f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25190,6 +26872,9 @@ ALTER TABLE ONLY jira_connect_subscriptions ALTER TABLE ONLY ci_pipeline_variables ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_f3953d86c6 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_f4d25ba00c FOREIGN KEY (version_id) REFERENCES design_management_versions(id) ON DELETE CASCADE; @@ -25271,9 +26956,6 @@ ALTER TABLE ONLY ip_restrictions ALTER TABLE ONLY terraform_state_versions ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_rails_053f00a9da FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_build_report_results ADD CONSTRAINT fk_rails_056d298d48 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25379,6 +27061,12 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages 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; + +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; @@ -25457,6 +27145,9 @@ ALTER TABLE ONLY service_desk_settings ALTER TABLE ONLY saml_group_links ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT fk_rails_2390a09723 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE; @@ -25466,6 +27157,9 @@ ALTER TABLE ONLY group_custom_attributes ALTER TABLE ONLY incident_management_oncall_rotations ADD CONSTRAINT fk_rails_256e0bc604 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; +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; @@ -25484,6 +27178,9 @@ ALTER TABLE ONLY lfs_file_locks ALTER TABLE ONLY project_alerting_settings ADD CONSTRAINT fk_rails_27a84b407d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT fk_rails_27ebc03cbf FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_validations ADD CONSTRAINT fk_rails_285c617324 FOREIGN KEY (dast_site_token_id) REFERENCES dast_site_tokens(id) ON DELETE CASCADE; @@ -25562,6 +27259,9 @@ ALTER TABLE ONLY metrics_dashboard_annotations ALTER TABLE ONLY wiki_page_slugs ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY board_labels ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -25577,6 +27277,9 @@ ALTER TABLE ONLY group_merge_request_approval_settings 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; + ALTER TABLE ONLY issue_user_mentions ADD CONSTRAINT fk_rails_3861d9fefa FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -25658,6 +27361,9 @@ ALTER TABLE ONLY remote_mirrors ALTER TABLE ONLY lfs_file_locks ADD CONSTRAINT fk_rails_43df7a0412 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT fk_rails_43e2897950 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT fk_rails_443443ce6f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -25685,9 +27391,18 @@ ALTER TABLE ONLY vulnerability_feedback ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_rails_480669c3b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY upcoming_reconciliations + ADD CONSTRAINT fk_rails_497b4938ac FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT fk_rails_4a70390ca6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_4b2ee3290b FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_rails_4b8c694a6c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -25760,9 +27475,6 @@ ALTER TABLE ONLY clusters_applications_knative ALTER TABLE ONLY clusters_applications_prometheus ADD CONSTRAINT fk_rails_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY terraform_states - ADD CONSTRAINT fk_rails_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id); - ALTER TABLE ONLY issuable_metric_images ADD CONSTRAINT fk_rails_56417a5a7f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -25817,6 +27529,9 @@ ALTER TABLE ONLY vulnerability_scanners ALTER TABLE ONLY reviews ADD CONSTRAINT fk_rails_5ca11d8c31 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_5ca491d360 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; + ALTER TABLE ONLY epic_issues ADD CONSTRAINT fk_rails_5d942936b4 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -25886,9 +27601,12 @@ ALTER TABLE ONLY operations_feature_flags_clients ALTER TABLE ONLY namespace_admin_notes ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY web_hook_logs +ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams + ADD CONSTRAINT fk_rails_669f4ba293 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_675d38c03b FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; @@ -25898,9 +27616,15 @@ ALTER TABLE ONLY vulnerability_findings_remediations ALTER TABLE ONLY resource_iteration_events ADD CONSTRAINT fk_rails_6830c13ac1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_683b8e000c FOREIGN KEY (vulnerability_finding_evidence_response_id) REFERENCES vulnerability_finding_evidence_responses(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_hashed_storage_migrated_events ADD CONSTRAINT fk_rails_687ed7d7c5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_6904b38465 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY plan_limits ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE; @@ -25934,6 +27658,9 @@ ALTER TABLE ONLY project_custom_attributes ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_rails_722ceba4f7 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 security_findings ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; @@ -25943,6 +27670,9 @@ ALTER TABLE ONLY dast_scanner_profiles ALTER TABLE ONLY vulnerability_historical_statistics ADD CONSTRAINT fk_rails_72b73ed023 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY slack_integrations ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; @@ -25985,12 +27715,18 @@ ALTER TABLE ONLY packages_debian_publications ALTER TABLE ONLY boards_epic_user_preferences ADD CONSTRAINT fk_rails_76c4e9732d FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_group_distribution_keys + ADD CONSTRAINT fk_rails_779438f163 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_subscriptions_projects ADD CONSTRAINT fk_rails_7871f9a97b FOREIGN KEY (upstream_project_id) REFERENCES projects(id) ON DELETE CASCADE; 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; @@ -26132,6 +27868,9 @@ ALTER TABLE ONLY packages_rubygems_metadata ALTER TABLE ONLY packages_pypi_metadata ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_96c2c18642 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT fk_rails_96ef1c00d3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -26174,6 +27913,9 @@ ALTER TABLE ONLY analytics_language_trend_repository_languages ALTER TABLE ONLY badges ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +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; @@ -26183,6 +27925,9 @@ ALTER TABLE ONLY resource_milestone_events ALTER TABLE ONLY namespace_root_storage_statistics ADD CONSTRAINT fk_rails_a0702c430b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT fk_rails_a17d86aeb9 FOREIGN KEY (elastic_reindexing_subtask_id) REFERENCES elastic_reindexing_subtasks(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_aliases ADD CONSTRAINT fk_rails_a1804f74a7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26201,6 +27946,9 @@ ALTER TABLE ONLY fork_network_members ALTER TABLE ONLY operations_feature_flag_scopes ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_helm_file_metadata + ADD CONSTRAINT fk_rails_a559865345 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_projects ADD CONSTRAINT fk_rails_a5a958bca1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -26291,6 +28039,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY merge_trains ADD CONSTRAINT fk_rails_b374b5225d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT fk_rails_b3c9c17bd4 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; + ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_rails_b53e481273 FOREIGN KEY (custom_project_templates_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -26315,6 +28066,9 @@ ALTER TABLE ONLY approval_project_rules_users ALTER TABLE ONLY lists ADD CONSTRAINT fk_rails_baed5f39b7 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; +ALTER TABLE web_hook_logs + ADD CONSTRAINT fk_rails_bb3355782d FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_findings ADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE; @@ -26378,6 +28132,9 @@ ALTER TABLE ONLY pages_deployments ALTER TABLE ONLY merge_request_user_mentions ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +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; @@ -26420,6 +28177,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT fk_rails_cbdfde27ce FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT fk_rails_cc5ba8f658 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -26429,6 +28189,9 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY issue_tracker_data ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY resource_milestone_events ADD CONSTRAINT fk_rails_cedf8cce4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26456,6 +28219,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 web_hooks + ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_group_links ADD CONSTRAINT fk_rails_d3a0488427 FOREIGN KEY (shared_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -26471,6 +28237,9 @@ ALTER TABLE ONLY geo_hashed_storage_attachments_events 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 jira_imports ADD CONSTRAINT fk_rails_da617096ce FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26480,6 +28249,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY board_user_preferences ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_dc1d0801e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_pipelines ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; @@ -26504,6 +28276,12 @@ ALTER TABLE ONLY incident_management_oncall_shifts ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_dfb37c880d FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT fk_rails_e0e0c4e4b1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -26516,12 +28294,21 @@ ALTER TABLE ONLY cluster_platforms_kubernetes ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT fk_rails_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidences + ADD CONSTRAINT fk_rails_e3205a0c65 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT fk_rails_e44472034c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_identifiers ADD CONSTRAINT fk_rails_e4ef6d027c FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; ALTER TABLE ONLY 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; + ALTER TABLE ONLY vulnerability_external_issue_links ADD CONSTRAINT fk_rails_e5ba7f7b13 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26543,6 +28330,9 @@ ALTER TABLE ONLY draft_notes ALTER TABLE ONLY namespace_package_settings ADD CONSTRAINT fk_rails_e773444769 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_e77911cf03 FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_tokens ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26597,6 +28387,9 @@ ALTER TABLE ONLY label_priorities ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_rails_efccadc4ec FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT fk_rails_efe1d9b133 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26654,9 +28447,6 @@ ALTER TABLE ONLY merge_trains ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerability_finding_fingerprints - ADD CONSTRAINT fk_rails_fa411253b2 FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; - ALTER TABLE ONLY requirements_management_test_reports ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES requirements(id) ON DELETE CASCADE; @@ -26696,12 +28486,18 @@ ALTER TABLE ONLY ci_builds_metadata ALTER TABLE ONLY services ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; + ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_issues_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_merge_requests_merge_request_id FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_timelogs_note_id FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE SET NULL; + ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; diff --git a/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb b/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb deleted file mode 100644 index 167b8d2c509..00000000000 --- a/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExcludedUrlsAndRequestHeadersToDastSiteProfiles < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210311022012_add_text_limits_to_dast_site_profiles - def change - add_column :dast_site_profiles, :excluded_urls, :text, array: true, default: [], null: false - add_column :dast_site_profiles, :auth_enabled, :boolean, default: false, null: false - add_column :dast_site_profiles, :auth_url, :text - add_column :dast_site_profiles, :auth_username_field, :text - add_column :dast_site_profiles, :auth_password_field, :text - add_column :dast_site_profiles, :auth_username, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb b/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb deleted file mode 100644 index e10e9a912cc..00000000000 --- a/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDeployedDeploymentIdIndexToProjectPagesMetadata < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_on_pages_metadata_not_migrated' - - def up - add_concurrent_index :project_pages_metadata, :project_id, where: "deployed = TRUE AND pages_deployment_id is NULL", name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :project_pages_metadata, INDEX_NAME - end -end diff --git a/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb b/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb deleted file mode 100644 index 5d2594f2b9e..00000000000 --- a/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexForSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_sop_configs_on_security_policy_management_project_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:security_orchestration_policy_configurations, INDEX_NAME) - end - - def down - add_concurrent_index(:security_orchestration_policy_configurations, :security_policy_management_project_id, name: INDEX_NAME) - end -end diff --git a/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb b/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb deleted file mode 100644 index 4750e2bdb79..00000000000 --- a/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX = 'index_sop_configurations_project_id_policy_project_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :security_orchestration_policy_configurations, [:security_policy_management_project_id, :project_id], name: INDEX - end - - def down - remove_concurrent_index_by_name :security_orchestration_policy_configurations, INDEX - end -end diff --git a/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb b/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb deleted file mode 100644 index 0f431fbeda5..00000000000 --- a/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class RenameVulnFingerprintsIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - FINGERPRINT_IDX = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint - FINGERPRINT_IDX_RENAMED = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint_sha256 - UNIQ_IDX = :idx_vuln_fingerprints_uniqueness - UNIQ_IDX_RENAMED = :idx_vuln_fingerprints_uniqueness_fingerprint_sha256 - - disable_ddl_transaction! - - def up - # These `unless` checks are necessary for re-running the migrations multiple times - unless index_exists_by_name?(:vulnerability_finding_fingerprints, FINGERPRINT_IDX_RENAMED) - rename_index :vulnerability_finding_fingerprints, FINGERPRINT_IDX, FINGERPRINT_IDX_RENAMED - end - - unless index_exists_by_name?(:vulnerability_finding_fingerprints, UNIQ_IDX_RENAMED) - rename_index :vulnerability_finding_fingerprints, UNIQ_IDX, UNIQ_IDX_RENAMED - end - end - - def down - unless index_exists_by_name?(:vulnerability_finding_fingerprints, FINGERPRINT_IDX) - rename_index :vulnerability_finding_fingerprints, FINGERPRINT_IDX_RENAMED, FINGERPRINT_IDX - end - - unless index_exists_by_name?(:vulnerability_finding_fingerprints, UNIQ_IDX) - rename_index :vulnerability_finding_fingerprints, UNIQ_IDX_RENAMED, UNIQ_IDX - end - end -end diff --git a/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb b/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb deleted file mode 100644 index b6f4da202fa..00000000000 --- a/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddLastEditedAtAndLastEditedByIdToNotes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_column :notes, :last_edited_at, :datetime_with_timezone - end - end - - def down - with_lock_retries do - remove_column :notes, :last_edited_at - end - end -end diff --git a/db/migrate/20210303091651_add_index_to_environments_tier.rb b/db/migrate/20210303091651_add_index_to_environments_tier.rb deleted file mode 100644 index 0ec876945d9..00000000000 --- a/db/migrate/20210303091651_add_index_to_environments_tier.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToEnvironmentsTier < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_environments_on_project_id_and_tier' - - DOWNTIME = false - - def up - add_concurrent_index :environments, [:project_id, :tier], where: 'tier IS NOT NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index :environments, :state, name: INDEX_NAME - end -end diff --git a/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb b/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb deleted file mode 100644 index 1ae5b36d2f2..00000000000 --- a/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForSucceededDeployments < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_deployments_on_environment_id_status_and_finished_at' - - disable_ddl_transaction! - - def up - add_concurrent_index(:deployments, %i[environment_id status finished_at], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:deployments, INDEX_NAME) - end -end diff --git a/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb b/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb deleted file mode 100644 index 5fc8970b8f9..00000000000 --- a/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintToClusterTokenName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # This will add the `NOT NULL` constraint WITHOUT validating it - add_not_null_constraint :cluster_agent_tokens, :name, validate: false - end - - def down - remove_not_null_constraint :cluster_agent_tokens, :name - end -end diff --git a/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb b/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb deleted file mode 100644 index a2d3d6daf09..00000000000 --- a/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddConcurrentFieldsToBulkImportsTrackers < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # rubocop:disable Rails/NotNullColumn - def up - add_column :bulk_import_trackers, :jid, :text - add_column :bulk_import_trackers, :stage, :smallint, default: 0, null: false - add_column :bulk_import_trackers, :status, :smallint, default: 0, null: false - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Rails/NotNullColumn - - def down - remove_column :bulk_import_trackers, :jid, :text - remove_column :bulk_import_trackers, :stage, :smallint - remove_column :bulk_import_trackers, :status, :smallint - end -end diff --git a/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb b/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb deleted file mode 100644 index 7686dd0343b..00000000000 --- a/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitsToBulkImportsTrackersJidAndPipelineName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :bulk_import_trackers, :jid, 255 - end - - def down - remove_text_limit :bulk_import_trackers, :jid - end -end diff --git a/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb b/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb deleted file mode 100644 index aa4a4e9c928..00000000000 --- a/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class UpdateTerraformStatesLockedByUserIdForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - OLD_FOREIGN_KEY = 'fk_rails_558901b030' - NEW_FOREIGN_KEY = 'fk_558901b030' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :terraform_states, :users, - column: :locked_by_user_id, on_delete: :nullify, name: NEW_FOREIGN_KEY - - with_lock_retries do - remove_foreign_key :terraform_states, :users, name: OLD_FOREIGN_KEY - end - end - - def down - add_concurrent_foreign_key :terraform_states, :users, - column: :locked_by_user_id, on_delete: nil, name: OLD_FOREIGN_KEY - - with_lock_retries do - remove_foreign_key :terraform_states, :users, name: NEW_FOREIGN_KEY - end - end -end diff --git a/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb b/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb deleted file mode 100644 index f5fa073b954..00000000000 --- a/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToGroupCiVariablesEnvironmentScope < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :ci_group_variables, :environment_scope, 255 - end - - def down - remove_text_limit :ci_group_variables, :environment_scope - end -end diff --git a/db/migrate/20210305031822_create_dast_site_profile_variables.rb b/db/migrate/20210305031822_create_dast_site_profile_variables.rb deleted file mode 100644 index 4b8fc982d86..00000000000 --- a/db/migrate/20210305031822_create_dast_site_profile_variables.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class CreateDastSiteProfileVariables < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Secret variables used in DAST on-demand scans' } - - encrypted_value_constraint_name = check_constraint_name(:dast_site_profile_secret_variables, 'encrypted_value', 'max_length') - encrypted_value_iv_constraint_name = check_constraint_name(:dast_site_profile_secret_variables, 'encrypted_value_iv', 'max_length') - - create_table_with_constraints :dast_site_profile_secret_variables, comment: Gitlab::Json.dump(table_comment) do |t| - t.references :dast_site_profile, null: false, foreign_key: { on_delete: :cascade }, index: false - - t.timestamps_with_timezone - - t.integer :variable_type, null: false, default: 1, limit: 2 - - t.text :key, null: false - t.binary :encrypted_value, null: false - t.binary :encrypted_value_iv, null: false, unique: true - - t.index [:dast_site_profile_id, :key], unique: true, name: :index_site_profile_secret_variables_on_site_profile_id_and_key - - t.text_limit :key, 255 - - # This does not currently have first-class support via create_table_with_constraints - t.check_constraint encrypted_value_constraint_name, 'length(encrypted_value) <= 13352' - t.check_constraint encrypted_value_iv_constraint_name, 'length(encrypted_value_iv) <= 17' - end - end - - def down - drop_table :dast_site_profile_secret_variables - end -end diff --git a/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb b/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb deleted file mode 100644 index d2342a66549..00000000000 --- a/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddTerraformModuleMaxFileSizeToPlanLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :plan_limits, :terraform_module_max_file_size, :bigint, default: 1.gigabyte, null: false - end -end diff --git a/db/migrate/20210305180331_create_ci_unit_tests.rb b/db/migrate/20210305180331_create_ci_unit_tests.rb deleted file mode 100644 index 970834a025b..00000000000 --- a/db/migrate/20210305180331_create_ci_unit_tests.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class CreateCiUnitTests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - unless table_exists?(:ci_unit_tests) - create_table :ci_unit_tests do |t| - t.bigint :project_id, null: false - t.text :key_hash, null: false - t.text :name, null: false - t.text :suite_name, null: false - - t.index [:project_id, :key_hash], unique: true - # NOTE: FK for projects will be added on a separate migration as per guidelines - end - end - - add_text_limit :ci_unit_tests, :key_hash, 64 - add_text_limit :ci_unit_tests, :name, 255 - add_text_limit :ci_unit_tests, :suite_name, 255 - end - - def down - drop_table :ci_unit_tests - end -end diff --git a/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb b/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb deleted file mode 100644 index 5e750d78a24..00000000000 --- a/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddProjectsFkToCiUnitTests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_unit_tests, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :ci_unit_tests, column: :project_id - end - end -end diff --git a/db/migrate/20210305182855_create_ci_unit_test_failures.rb b/db/migrate/20210305182855_create_ci_unit_test_failures.rb deleted file mode 100644 index b3f68cdba4a..00000000000 --- a/db/migrate/20210305182855_create_ci_unit_test_failures.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateCiUnitTestFailures < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - create_table :ci_unit_test_failures do |t| - t.datetime_with_timezone :failed_at, null: false - t.bigint :unit_test_id, null: false - t.bigint :build_id, null: false - - t.index [:unit_test_id, :failed_at, :build_id], name: 'index_unit_test_failures_unique_columns', unique: true, order: { failed_at: :desc } - t.index :build_id - # NOTE: Adding the index for failed_at now for later use when we do scheduled clean up - t.index :failed_at, order: { failed_at: :desc }, name: 'index_unit_test_failures_failed_at' - t.foreign_key :ci_unit_tests, column: :unit_test_id, on_delete: :cascade - # NOTE: FK for ci_builds will be added on a separate migration as per guidelines - end - end - - def down - drop_table :ci_unit_test_failures - end -end diff --git a/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb b/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb deleted file mode 100644 index 9cf75ba6059..00000000000 --- a/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiBuildsFkToCiUnitTestFailures < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_unit_test_failures, :ci_builds, column: :build_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :ci_unit_test_failures, column: :build_id - end - end -end diff --git a/db/migrate/20210306121300_partition_web_hook_logs.rb b/db/migrate/20210306121300_partition_web_hook_logs.rb deleted file mode 100644 index ff35a19648e..00000000000 --- a/db/migrate/20210306121300_partition_web_hook_logs.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class PartitionWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::PartitioningMigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - partition_table_by_date :web_hook_logs, :created_at - end - - def down - drop_partitioned_table_for :web_hook_logs - end -end diff --git a/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb b/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb deleted file mode 100644 index d701fa98259..00000000000 --- a/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddInfoColumnIntoSecurityScansTable < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :security_scans, :info, :jsonb, null: false, default: {} - end -end diff --git a/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb b/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb deleted file mode 100644 index 5b731b78117..00000000000 --- a/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class ChangeNamespaceSettingsDelayedProjectRemovalNull < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - change_column :namespace_settings, :delayed_project_removal, :boolean, null: true, default: nil - end - - def down - change_column_default :namespace_settings, :delayed_project_removal, false - change_column_null :namespace_settings, :delayed_project_removal, false, false - end -end diff --git a/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb b/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb deleted file mode 100644 index e88f3e7ea0d..00000000000 --- a/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLockDelayedProjectRemovalToNamespaceSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :namespace_settings, :lock_delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb b/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb deleted file mode 100644 index 1ccb25878e4..00000000000 --- a/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddDelayedProjectRemovalToApplicationSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb b/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb deleted file mode 100644 index c63175493de..00000000000 --- a/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLockDelayedProjectRemovalToApplicationSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :lock_delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb b/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb deleted file mode 100644 index f841c1e9bd5..00000000000 --- a/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class ChangeBatchedBackgroundMigrationsBatchClassNameDefault < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_column_default :batched_background_migrations, :batch_class_name, - from: 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy', to: 'PrimaryKeyBatchingStrategy' - end -end diff --git a/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb b/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb deleted file mode 100644 index a7b634596d2..00000000000 --- a/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddAdminModeToApplicationSetting < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :admin_mode, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb b/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb deleted file mode 100644 index 2a29ab374e5..00000000000 --- a/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLastUsedAtToClusterAgentToken < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :cluster_agent_tokens, :last_used_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb b/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb deleted file mode 100644 index 5ffcc005225..00000000000 --- a/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIdxVulnerabilityOccurrencesDedup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - TABLE = :vulnerability_occurrences - INDEX_NAME = 'index_vulnerability_occurrences_deduplication' - COLUMNS = %i[project_id report_type project_fingerprint] - - disable_ddl_transaction! - - def up - add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME - end - - def down - remove_concurrent_index TABLE, COLUMNS, name: INDEX_NAME - end -end diff --git a/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb b/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb deleted file mode 100644 index 088f400efb9..00000000000 --- a/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddSettingsToGroupMergeRequestApprovalSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:group_merge_request_approval_settings, bulk: true) do |t| - t.column :allow_committer_approval, :boolean, null: false, default: false - t.column :allow_overrides_to_approver_list_per_merge_request, :boolean, null: false, default: false - t.column :retain_approvals_on_push, :boolean, null: false, default: false - t.column :require_password_to_approve, :boolean, null: false, default: false - end - end -end diff --git a/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb b/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb deleted file mode 100644 index 7858449be14..00000000000 --- a/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitsToDastSiteProfiles < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :dast_site_profiles, :auth_url, 1024 - add_text_limit :dast_site_profiles, :auth_username_field, 255 - add_text_limit :dast_site_profiles, :auth_password_field, 255 - add_text_limit :dast_site_profiles, :auth_username, 255 - end - - def down - remove_text_limit :dast_site_profiles, :auth_username - remove_text_limit :dast_site_profiles, :auth_password_field - remove_text_limit :dast_site_profiles, :auth_username_field - remove_text_limit :dast_site_profiles, :auth_url - end -end diff --git a/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb b/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb deleted file mode 100644 index 523010a4aea..00000000000 --- a/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMetricsToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :batched_background_migration_jobs, :metrics, :jsonb, null: false, default: {} - end -end diff --git a/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb b/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb deleted file mode 100644 index f5ff0816047..00000000000 --- a/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfEventsIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - # Initialize the conversion of events.id to bigint - # Primary Key of the Events table - initialize_conversion_of_integer_to_bigint :events, :id - end - - def down - trigger_name = rename_trigger_name(:events, :id, :id_convert_to_bigint) - - remove_rename_triggers :events, trigger_name - - remove_column :events, :id_convert_to_bigint - end -end diff --git a/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb b/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb deleted file mode 100644 index 651c9ed993d..00000000000 --- a/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfPushEventPayloadsEventIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - # Foreign key that references events.id - # Also Primary key of the push_event_payloads table - initialize_conversion_of_integer_to_bigint :push_event_payloads, :event_id, primary_key: :event_id - end - - def down - trigger_name = rename_trigger_name(:push_event_payloads, :event_id, :event_id_convert_to_bigint) - - remove_rename_triggers :push_event_payloads, trigger_name - - remove_column :push_event_payloads, :event_id_convert_to_bigint - end -end diff --git a/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb b/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb deleted file mode 100644 index 111486a17ab..00000000000 --- a/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddOwnerAndIdIndexOnActiveCiPipelineSchedules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_pipeline_schedules_on_owner_id_and_id_and_active' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipeline_schedules, [:owner_id, :id], where: "active = TRUE", name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipeline_schedules, INDEX_NAME - end -end diff --git a/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb b/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb deleted file mode 100644 index 89553a53084..00000000000 --- a/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddEnforcedGitCheckToSamlProvider < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - add_column :saml_providers, :git_check_enforced, :boolean, default: false, null: false - end - - def down - remove_column :saml_providers, :git_check_enforced - end -end diff --git a/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb b/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb deleted file mode 100644 index 1de9d87cf25..00000000000 --- a/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true -class AddResourceAccessTokenCreationAllowedToNamespaceSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :namespace_settings, :resource_access_token_creation_allowed, :boolean, default: true, null: false - end - end - - def down - with_lock_retries do - remove_column :namespace_settings, :resource_access_token_creation_allowed - end - end -end diff --git a/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb b/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb deleted file mode 100644 index e2d6dff23fa..00000000000 --- a/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToSnippetRepositories < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:snippet_repositories) do |t| - t.integer :verification_state, default: 0, limit: 2, null: false - t.column :verification_started_at, :datetime_with_timezone - end - end -end diff --git a/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb b/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb deleted file mode 100644 index ebbc1126aa2..00000000000 --- a/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToSnippetRepositories < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - VERIFICATION_STATE_INDEX_NAME = "index_snippet_repositories_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_snippet_repositories_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_snippet_repositories_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_snippet_repositories_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :snippet_repositories, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :snippet_repositories, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :snippet_repositories, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :snippet_repositories, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :snippet_repositories, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb b/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb deleted file mode 100644 index 3915689e0af..00000000000 --- a/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddTrialExtensionTypeToGitlabSubscriptionHistories < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :gitlab_subscription_histories, :trial_extension_type, :smallint - end -end diff --git a/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb b/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb deleted file mode 100644 index fb0ee789277..00000000000 --- a/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddTrialExtensionTypeToGitlabSubscriptions < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :gitlab_subscriptions, :trial_extension_type, :smallint - end - end - - def down - with_lock_retries do - remove_column :gitlab_subscriptions, :trial_extension_type - end - end -end diff --git a/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb b/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb deleted file mode 100644 index 1128bf586ae..00000000000 --- a/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexCiStagesOnPipelineIdAndId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_stages_on_pipeline_id_and_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_stages, %i[pipeline_id id], where: 'status IN (0, 1, 2, 8, 9, 10)', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_stages, INDEX_NAME - end -end diff --git a/db/migrate/20210316171009_create_packages_helm_file_metadata.rb b/db/migrate/20210316171009_create_packages_helm_file_metadata.rb deleted file mode 100644 index 47a9b808e63..00000000000 --- a/db/migrate/20210316171009_create_packages_helm_file_metadata.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesHelmFileMetadata < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table_with_constraints :packages_helm_file_metadata, id: false do |t| - t.timestamps_with_timezone - t.references :package_file, primary_key: true, index: false, default: nil, null: false, foreign_key: { to_table: :packages_package_files, on_delete: :cascade }, type: :bigint - t.text :channel, null: false - t.jsonb :metadata - - t.text_limit :channel, 63 - - t.index :channel - end - end - - def down - with_lock_retries do - drop_table :packages_helm_file_metadata - end - end -end diff --git a/db/migrate/20210317035357_create_dast_profiles_pipelines.rb b/db/migrate/20210317035357_create_dast_profiles_pipelines.rb deleted file mode 100644 index f84e1237643..00000000000 --- a/db/migrate/20210317035357_create_dast_profiles_pipelines.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateDastProfilesPipelines < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Profiles and CI Pipelines' } - - create_table :dast_profiles_pipelines, primary_key: [:dast_profile_id, :ci_pipeline_id], comment: Gitlab::Json.dump(table_comment) do |t| - t.bigint :dast_profile_id, null: false - t.bigint :ci_pipeline_id, null: false - - t.index :ci_pipeline_id, unique: true, name: :index_dast_profiles_pipelines_on_ci_pipeline_id - end - end - - def down - drop_table :dast_profiles_pipelines - end -end diff --git a/db/migrate/20210317100520_create_elastic_index_settings.rb b/db/migrate/20210317100520_create_elastic_index_settings.rb deleted file mode 100644 index 61c1cbb3518..00000000000 --- a/db/migrate/20210317100520_create_elastic_index_settings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CreateElasticIndexSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table_with_constraints :elastic_index_settings do |t| - t.timestamps_with_timezone null: false - t.integer :number_of_replicas, null: false, default: 1, limit: 2 - t.integer :number_of_shards, null: false, default: 5, limit: 2 - t.text :alias_name, null: false - - t.text_limit :alias_name, 255 - t.index :alias_name, unique: true - end - end - - def down - drop_table :elastic_index_settings - end -end diff --git a/db/migrate/20210317104301_create_in_product_marketing_emails.rb b/db/migrate/20210317104301_create_in_product_marketing_emails.rb deleted file mode 100644 index b8c6b952c97..00000000000 --- a/db/migrate/20210317104301_create_in_product_marketing_emails.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class CreateInProductMarketingEmails < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - UNIQUE_INDEX_NAME = 'index_in_product_marketing_emails_on_user_track_series' - - disable_ddl_transaction! - - def up - with_lock_retries do - create_table :in_product_marketing_emails do |t| - t.bigint :user_id, null: false - t.datetime_with_timezone :cta_clicked_at - t.integer :track, null: false, limit: 2 - t.integer :series, null: false, limit: 2 - - t.timestamps_with_timezone - end - end - - add_index :in_product_marketing_emails, :user_id - add_index :in_product_marketing_emails, [:user_id, :track, :series], unique: true, name: UNIQUE_INDEX_NAME - end - - def down - with_lock_retries do - drop_table :in_product_marketing_emails - end - end -end diff --git a/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb b/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb deleted file mode 100644 index f0b4d97d2cf..00000000000 --- a/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddUserForeignKeyToInProductMarketingEmails < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :in_product_marketing_emails, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :in_product_marketing_emails, column: :user_id - end - end -end diff --git a/db/migrate/20210317123054_add_throttle_package_registry_columns.rb b/db/migrate/20210317123054_add_throttle_package_registry_columns.rb deleted file mode 100644 index 0bb731306c0..00000000000 --- a/db/migrate/20210317123054_add_throttle_package_registry_columns.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddThrottlePackageRegistryColumns < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :throttle_unauthenticated_packages_api_requests_per_period, :integer, default: 800, null: false - add_column :application_settings, :throttle_unauthenticated_packages_api_period_in_seconds, :integer, default: 15, null: false - add_column :application_settings, :throttle_authenticated_packages_api_requests_per_period, :integer, default: 1000, null: false - add_column :application_settings, :throttle_authenticated_packages_api_period_in_seconds, :integer, default: 15, null: false - add_column :application_settings, :throttle_unauthenticated_packages_api_enabled, :boolean, default: false, null: false - add_column :application_settings, :throttle_authenticated_packages_api_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb b/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb deleted file mode 100644 index 15f319b3965..00000000000 --- a/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddExpiryNotificationDeliveredToKeys < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :keys, :expiry_notification_delivered_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210317210338_add_valid_runner_registrars.rb b/db/migrate/20210317210338_add_valid_runner_registrars.rb deleted file mode 100644 index 61663836d39..00000000000 --- a/db/migrate/20210317210338_add_valid_runner_registrars.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddValidRunnerRegistrars < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :valid_runner_registrars, :string, array: true, default: %w(project group) - end -end diff --git a/db/migrate/20210318134427_delete_security_findings_without_uuid.rb b/db/migrate/20210318134427_delete_security_findings_without_uuid.rb deleted file mode 100644 index f8e0f0fb32b..00000000000 --- a/db/migrate/20210318134427_delete_security_findings_without_uuid.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class DeleteSecurityFindingsWithoutUuid < ActiveRecord::Migration[6.0] - DOWNTIME = false - - disable_ddl_transaction! - - class SecurityFinding < ActiveRecord::Base - include EachBatch - - self.table_name = 'security_findings' - - scope :without_uuid, -> { where(uuid: nil) } - end - - def up - SecurityFinding.without_uuid.each_batch(of: 10_000) do |relation| - relation.delete_all - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb b/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb deleted file mode 100644 index 9a4789b5c1a..00000000000 --- a/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddHelmMaxFileSizeToPlanLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :plan_limits, :helm_max_file_size, :bigint, default: 5.megabyte, null: false - end -end diff --git a/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb b/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb deleted file mode 100644 index 4e9b3ddd41c..00000000000 --- a/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDastProfileIdFkToDastProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_profiles_pipelines, :dast_profiles, column: :dast_profile_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_profiles_pipelines, column: :dast_profile_id - end - end -end diff --git a/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb b/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb deleted file mode 100644 index f1dce7f0cd8..00000000000 --- a/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiPipelineIdFkToDastProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_profiles_pipelines, :ci_pipelines, column: :ci_pipeline_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_profiles_pipelines, column: :ci_pipeline_id - end - end -end diff --git a/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb b/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb deleted file mode 100644 index 6387d8a6a43..00000000000 --- a/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToKeysOnExpiresAtAndExpiryNotificationUndelivered < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_keys_on_expires_at_and_expiry_notification_undelivered' - disable_ddl_transaction! - - def up - add_concurrent_index :keys, - "date(timezone('UTC', expires_at)), expiry_notification_delivered_at", - where: 'expiry_notification_delivered_at IS NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb b/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb deleted file mode 100644 index 162173f6629..00000000000 --- a/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddNamespaceTraversalIdsIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_namespaces_on_traversal_ids' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :traversal_ids, using: :gin, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/migrate/20210323125809_create_status_check_responses_table.rb b/db/migrate/20210323125809_create_status_check_responses_table.rb deleted file mode 100644 index 3fa7ff7165c..00000000000 --- a/db/migrate/20210323125809_create_status_check_responses_table.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateStatusCheckResponsesTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table :status_check_responses do |t| - t.bigint :merge_request_id, null: false - t.bigint :external_approval_rule_id, null: false - end - - add_index :status_check_responses, :merge_request_id - add_index :status_check_responses, :external_approval_rule_id - end - - def down - drop_table :status_check_responses - end -end diff --git a/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb b/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb deleted file mode 100644 index cee0b9a231e..00000000000 --- a/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestForeignKeyToStatusCheckResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :status_check_responses, :merge_requests, column: :merge_request_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :status_check_responses, column: :merge_request_id - end - end -end diff --git a/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb b/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb deleted file mode 100644 index ab28c20dbb1..00000000000 --- a/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExternalApprovalRuleForeignKeyToStatusCheckResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :status_check_responses, :external_approval_rules, column: :external_approval_rule_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :status_check_responses, column: :external_approval_rule_id - end - end -end diff --git a/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb b/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb deleted file mode 100644 index aee6d5484d5..00000000000 --- a/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class PopulateDismissalInformationForVulnerabilities < ActiveRecord::Migration[6.0] - DOWNTIME = false - BATCH_SIZE = 100 - UPDATE_QUERY = <<~SQL - UPDATE - vulnerabilities - SET - dismissed_at = COALESCE(dismissed_at, updated_at), - dismissed_by_id = COALESCE(dismissed_by_id, updated_by_id, last_edited_by_id, author_id) - WHERE - vulnerabilities.id IN (%{ids}) - SQL - - class Vulnerability < ActiveRecord::Base - include EachBatch - - self.table_name = 'vulnerabilities' - - enum state: { detected: 1, confirmed: 4, resolved: 3, dismissed: 2 } - - scope :broken, -> { dismissed.where('dismissed_at IS NULL OR dismissed_by_id IS NULL') } - end - - def up - Vulnerability.broken.each_batch(of: BATCH_SIZE) do |batch| - query = format(UPDATE_QUERY, ids: batch.select(:id).to_sql) - - connection.execute(query) - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb b/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb deleted file mode 100644 index 1ec6bc0bf2e..00000000000 --- a/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddProjectStatusDateIndexToMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = "idx_mrs_on_target_id_and_created_at_and_state_id" - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, %i[target_project_id state_id created_at id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :merge_requests, INDEX_NAME - end -end diff --git a/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb b/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb deleted file mode 100644 index 68ce5363b70..00000000000 --- a/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexMirrorDataOnRetryNextExecutionWhereStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'index_mirror_data_non_scheduled_or_started' - - disable_ddl_transaction! - - def up - add_concurrent_index :project_mirror_data, - [:next_execution_timestamp, :retry_count], - where: "(status)::text <> ALL ('{scheduled,started}'::text[])", - name: INDEX_NAME - end - - def down - remove_concurrent_index :project_mirror_data, - [:next_execution_timestamp, :retry_count], - where: "(status)::text <> ALL ('{scheduled,started}'::text[])", - name: INDEX_NAME - end -end diff --git a/db/migrate/20210324131727_migrate_elastic_index_settings.rb b/db/migrate/20210324131727_migrate_elastic_index_settings.rb deleted file mode 100644 index 4dcfc6cf952..00000000000 --- a/db/migrate/20210324131727_migrate_elastic_index_settings.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class MigrateElasticIndexSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - ALIAS_NAME = [Rails.application.class.module_parent_name.downcase, Rails.env].join('-') - - class ElasticIndexSetting < ActiveRecord::Base - end - - class ApplicationSetting < ActiveRecord::Base - end - - def up - setting = ApplicationSetting.first - number_of_replicas = setting&.elasticsearch_replicas || 1 - number_of_shards = setting&.elasticsearch_shards || 5 - - return if ElasticIndexSetting.exists?(alias_name: ALIAS_NAME) - - ElasticIndexSetting.create!( - alias_name: ALIAS_NAME, - number_of_replicas: number_of_replicas, - number_of_shards: number_of_shards - ) - end - - def down - ElasticIndexSetting.where(alias_name: ALIAS_NAME).delete_all - end -end diff --git a/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb b/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb deleted file mode 100644 index 2389f90d498..00000000000 --- a/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddNotValidForeignKeyToGroupHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_foreign_key :web_hooks, :namespaces, column: :group_id, on_delete: :cascade, validate: false - end - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :web_hooks, column: :group_id - end - end -end diff --git a/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb b/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb deleted file mode 100644 index 17dd4cad6ae..00000000000 --- a/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ValidateForeignKeyOnServiceHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - CONSTRAINT_NAME = 'fk_d47999a98a' - - def up - validate_foreign_key :web_hooks, :service_id, name: CONSTRAINT_NAME - end - - def down - # no-op - end -end diff --git a/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb b/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb deleted file mode 100644 index f6c506e59b7..00000000000 --- a/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateToCiPipelineArtifact < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:ci_pipeline_artifacts, bulk: true) do |t| - t.column :verification_started_at, :datetime_with_timezone - t.column :verification_retry_at, :datetime_with_timezone - t.column :verified_at, :datetime_with_timezone - 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 # rubocop:disable Migration/AddLimitToTextColumns - end - end -end diff --git a/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb b/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb deleted file mode 100644 index bc4dee2181f..00000000000 --- a/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationFailureLimitToCiPipelineArtifact < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - CONSTRAINT_NAME = 'ci_pipeline_artifacts_verification_failure_text_limit' - - def up - add_text_limit :ci_pipeline_artifacts, :verification_failure, 255, constraint_name: CONSTRAINT_NAME - end - - def down - remove_check_constraint(:ci_pipeline_artifacts, CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb b/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb deleted file mode 100644 index 0822aee35a4..00000000000 --- a/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToCiPipelineArtifacts < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - VERIFICATION_STATE_INDEX_NAME = "index_ci_pipeline_artifacts_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipeline_artifacts, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipeline_artifacts, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb b/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb deleted file mode 100644 index d10c9401a31..00000000000 --- a/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForProjectDeploymentsWithEnvironmentIdAndUpdatedAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at' - - def up - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb b/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb deleted file mode 100644 index 4de02a6762e..00000000000 --- a/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidences < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidences do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_occurrence, index: { name: 'finding_evidences_on_vulnerability_occurrence_id' }, null: false, foreign_key: { on_delete: :cascade } - t.text :summary - - t.text_limit :summary, 8_000_000 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidences - end - end -end diff --git a/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb b/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb deleted file mode 100644 index d351de6bd77..00000000000 --- a/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddTargetProjectAndSourceBranchIndexToMergeRequest < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_merge_requests_on_target_project_id_and_source_branch' - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, [:target_project_id, :source_branch], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :epic_issues, INDEX_NAME - end -end diff --git a/db/migrate/20210329191850_add_finding_signature_table.rb b/db/migrate/20210329191850_add_finding_signature_table.rb deleted file mode 100644 index 74a12d54a8e..00000000000 --- a/db/migrate/20210329191850_add_finding_signature_table.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class AddFindingSignatureTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - SIGNATURE_IDX = :idx_vuln_signatures_on_occurrences_id_and_signature_sha - UNIQ_IDX = :idx_vuln_signatures_uniqueness_signature_sha - - def up - with_lock_retries do - create_table :vulnerability_finding_signatures do |t| - t.references :finding, - index: true, - null: false, - foreign_key: { to_table: :vulnerability_occurrences, column: :finding_id, on_delete: :cascade } - - t.timestamps_with_timezone null: false - - t.integer :algorithm_type, null: false, limit: 2 - t.binary :signature_sha, null: false - - t.index %i[finding_id signature_sha], - name: SIGNATURE_IDX, - unique: true # only one link should exist between occurrence and the signature - - t.index %i[finding_id algorithm_type signature_sha], - name: UNIQ_IDX, - unique: true # these should be unique - end - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_signatures - end - end -end diff --git a/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb b/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb deleted file mode 100644 index ce37afdbc29..00000000000 --- a/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddCompositeIndexToAwardEmoji < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :award_emoji, %i[user_id name awardable_type awardable_id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :award_emoji, INDEX_NAME - end -end diff --git a/db/migrate/20210330015805_add_cloud_to_licenses.rb b/db/migrate/20210330015805_add_cloud_to_licenses.rb deleted file mode 100644 index d0c7112d0b0..00000000000 --- a/db/migrate/20210330015805_add_cloud_to_licenses.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddCloudToLicenses < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :licenses, :cloud, :boolean, default: false - end -end diff --git a/db/migrate/20210331000934_add_config_to_ci_runners.rb b/db/migrate/20210331000934_add_config_to_ci_runners.rb deleted file mode 100644 index e9a5fadc613..00000000000 --- a/db/migrate/20210331000934_add_config_to_ci_runners.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddConfigToCiRunners < ActiveRecord::Migration[6.0] - def change - add_column :ci_runners, :config, :jsonb, default: {}, null: false - end -end diff --git a/db/migrate/20210331125111_add_default_target_project.rb b/db/migrate/20210331125111_add_default_target_project.rb deleted file mode 100644 index 1a2c5ccca7d..00000000000 --- a/db/migrate/20210331125111_add_default_target_project.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultTargetProject < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :project_settings, :mr_default_target_self, :boolean, default: false, null: false - end - end - - def down - with_lock_retries do - remove_column :project_settings, :mr_default_target_self - end - end -end diff --git a/db/migrate/20210331145548_add_index_for_last_deployment.rb b/db/migrate/20210331145548_add_index_for_last_deployment.rb deleted file mode 100644 index a50d8ea403a..00000000000 --- a/db/migrate/20210331145548_add_index_for_last_deployment.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForLastDeployment < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_deployments_on_environment_id_status_and_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, [:environment_id, :status, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb b/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb deleted file mode 100644 index b8787eb171c..00000000000 --- a/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDeprecatedIndexFromAwardEmoji < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_award_emoji_on_user_id_and_name' - - disable_ddl_transaction! - - def up - # Index deprecated in favor of idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id - remove_concurrent_index_by_name(:award_emoji, INDEX_NAME) - end - - def down - add_concurrent_index(:award_emoji, [:user_id, :name], name: INDEX_NAME) - end -end diff --git a/db/migrate/20210401134157_add_index_to_pages_deployments.rb b/db/migrate/20210401134157_add_index_to_pages_deployments.rb deleted file mode 100644 index aef27c7c6f9..00000000000 --- a/db/migrate/20210401134157_add_index_to_pages_deployments.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPagesDeployments < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_pages_deployments_on_file_store_and_id' - - def up - add_concurrent_index :pages_deployments, [:file_store, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :pages_deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb b/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb deleted file mode 100644 index ee59e72e398..00000000000 --- a/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RemoveIndexMirrorDataOnNextExecutionAndRetryCount < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - INDEX_NAME = 'index_mirror_data_on_next_execution_and_retry_count' - - def up - remove_concurrent_index( - :project_mirror_data, - %i[next_execution_timestamp retry_count], - name: INDEX_NAME - ) - end - - def down - add_concurrent_index( - :project_mirror_data, - %i[next_execution_timestamp retry_count], - name: INDEX_NAME - ) - end -end diff --git a/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb b/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb deleted file mode 100644 index 6a2ea0e738c..00000000000 --- a/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddBeforeExpiryNotificationDeliveredToKeys < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :keys, :before_expiry_notification_delivered_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb b/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb deleted file mode 100644 index ff792d2e6e6..00000000000 --- a/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToKeysOnExpiresAtAndBeforeExpiryNotificationUndelivered < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'idx_keys_expires_at_and_before_expiry_notification_undelivered' - disable_ddl_transaction! - - def up - add_concurrent_index :keys, - "date(timezone('UTC', expires_at)), before_expiry_notification_delivered_at", - where: 'before_expiry_notification_delivered_at IS NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb b/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb deleted file mode 100644 index 073d1ee2bc5..00000000000 --- a/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesIdParentIdPartialIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_namespaces_id_parent_id_is_null' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :id, where: 'parent_id IS NULL', name: NAME - end - - def down - remove_concurrent_index :namespaces, :id, name: NAME - end -end diff --git a/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb b/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb deleted file mode 100644 index 32b5f27a577..00000000000 --- a/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTotalTupleCountToBatchedMigrations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - add_column :batched_background_migrations, :total_tuple_count, :bigint - end - - def down - remove_column :batched_background_migrations, :total_tuple_count - end -end diff --git a/db/migrate/20210407002511_add_type_to_dast_site_profile.rb b/db/migrate/20210407002511_add_type_to_dast_site_profile.rb deleted file mode 100644 index 99d9970a2a8..00000000000 --- a/db/migrate/20210407002511_add_type_to_dast_site_profile.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddTypeToDastSiteProfile < ActiveRecord::Migration[6.0] - def change - add_column :dast_site_profiles, :target_type, :integer, limit: 2, default: 0, null: false - end -end diff --git a/db/migrate/20210407111027_add_whats_new_application_setting.rb b/db/migrate/20210407111027_add_whats_new_application_setting.rb deleted file mode 100644 index 450c26e2199..00000000000 --- a/db/migrate/20210407111027_add_whats_new_application_setting.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddWhatsNewApplicationSetting < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :whats_new_variant, :integer, limit: 2, default: 0 - end -end diff --git a/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb b/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb deleted file mode 100644 index 987be4ab1f0..00000000000 --- a/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToTerraformStateVersionTable < ActiveRecord::Migration[6.0] - def change - change_table(:terraform_state_versions) do |t| - t.column :verification_started_at, :datetime_with_timezone - t.integer :verification_state, default: 0, limit: 2, null: false - end - end -end diff --git a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb deleted file mode 100644 index 2bcdf4c8982..00000000000 --- a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateIndexOnNotesForCherryPickedMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_notes_for_cherry_picked_merge_requests' - - disable_ddl_transaction! - - def up - add_concurrent_index :notes, [:project_id, :commit_id], where: "((noteable_type)::text = 'MergeRequest'::text)", name: NAME - end - - def down - remove_concurrent_index_by_name :notes, name: NAME - end -end diff --git a/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb b/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb deleted file mode 100644 index 7b7894fdcc8..00000000000 --- a/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddClustersIntegrationsPrometheus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :clusters_integration_prometheus, id: false do |t| - t.timestamps_with_timezone null: false - t.references :cluster, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.boolean :enabled, null: false, default: false - end - end - end - - def down - with_lock_retries do - drop_table :clusters_integration_prometheus - end - end -end diff --git a/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb b/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb deleted file mode 100644 index 365fa36f11b..00000000000 --- a/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class CreateSecurityOrchestrationPolicyRuleSchedule < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_PREFIX = 'index_sop_schedules_' - - disable_ddl_transaction! - - def up - table_comment = { owner: 'group::container security', description: 'Schedules used to store relationship between project and security policy repository' } - - create_table_with_constraints :security_orchestration_policy_rule_schedules, comment: Gitlab::Json.dump(table_comment) do |t| - t.timestamps_with_timezone - t.datetime_with_timezone :next_run_at, null: true - - t.references :security_orchestration_policy_configuration, null: false, foreign_key: { to_table: :security_orchestration_policy_configurations, on_delete: :cascade }, index: { name: INDEX_PREFIX + 'on_sop_configuration_id' } - t.references :user, null: false, foreign_key: { on_delete: :cascade }, index: { name: INDEX_PREFIX + 'on_user_id' } - - t.integer :policy_index, null: false - t.text :cron, null: false - - t.text_limit :cron, 255 - end - end - - def down - with_lock_retries do - drop_table :security_orchestration_policy_rule_schedules - end - end -end diff --git a/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb b/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb deleted file mode 100644 index 78b5e7d5d35..00000000000 --- a/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddInstanceUrlToJiraConnectInstallations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in db/migrate/20210216163811_add_text_limit_to_jira_connect_installations_instance_url.rb - def up - add_column :jira_connect_installations, :instance_url, :text - end - # rubocop:enable Migration/AddLimitToTextColumns - - def down - remove_column :jira_connect_installations, :instance_url - end -end diff --git a/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb b/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb deleted file mode 100644 index 22c82ccd223..00000000000 --- a/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToJiraConnectInstallationsInstanceUrl < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :jira_connect_installations, :instance_url, 255 - end - - def down - remove_text_limit :jira_connect_installations, :instance_url - end -end diff --git a/db/migrate/20210412142223_add_user_index_on_spam_logs.rb b/db/migrate/20210412142223_add_user_index_on_spam_logs.rb deleted file mode 100644 index 0a12f0f1a87..00000000000 --- a/db/migrate/20210412142223_add_user_index_on_spam_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUserIndexOnSpamLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_spam_logs_on_user_id' - - def up - add_concurrent_index :spam_logs, :user_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :spam_logs, INDEX_NAME - end -end diff --git a/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb b/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb deleted file mode 100644 index 8e21e0f5182..00000000000 --- a/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddConfiguredAtToSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :security_orchestration_policy_configurations, :configured_at, :datetime_with_timezone, null: true - end -end diff --git a/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb b/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb deleted file mode 100644 index 344f4859b47..00000000000 --- a/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddCreatedAtWebHookIdIndexToPartitionedWebHookLog < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - CREATED_AT_WEB_HOOK_ID_INDEX_NAME = 'index_web_hook_logs_part_on_created_at_and_web_hook_id' - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_index :web_hook_logs_part_0c5294f417, - [:created_at, :web_hook_id], - name: CREATED_AT_WEB_HOOK_ID_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :web_hook_logs_part_0c5294f417, CREATED_AT_WEB_HOOK_ID_INDEX_NAME - end -end diff --git a/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb b/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb deleted file mode 100644 index 300c19d3e51..00000000000 --- a/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnWebHookIdToPartitionedWebHookLog < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - WEB_HOOK_ID_INDEX_NAME = 'index_web_hook_logs_part_on_web_hook_id' - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_index :web_hook_logs_part_0c5294f417, - :web_hook_id, - name: WEB_HOOK_ID_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :web_hook_logs_part_0c5294f417, WEB_HOOK_ID_INDEX_NAME - end -end diff --git a/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb b/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb deleted file mode 100644 index ca73c85963e..00000000000 --- a/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddPauseSecondsToBatchedBackgroundMigrations < ActiveRecord::Migration[6.0] - def change - add_column :batched_background_migrations, :pause_ms, :integer, null: false, default: 100 - end -end diff --git a/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb b/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb deleted file mode 100644 index d232f9c0305..00000000000 --- a/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddPauseSecondsToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - def change - add_column :batched_background_migration_jobs, :pause_ms, :integer, null: false, default: 100 - end -end diff --git a/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb b/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb deleted file mode 100644 index 395742318e2..00000000000 --- a/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexServicesOnProjectAndTypeWhereInheritNull < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_services_on_project_and_type_where_inherit_null' - - def up - add_concurrent_index(:services, [:project_id, :type], where: 'inherit_from_id IS NULL', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:services, INDEX_NAME) - end -end diff --git a/db/migrate/20210414100914_add_bulk_import_exports_table.rb b/db/migrate/20210414100914_add_bulk_import_exports_table.rb deleted file mode 100644 index 14a7421c1e4..00000000000 --- a/db/migrate/20210414100914_add_bulk_import_exports_table.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :bulk_import_exports do |t| - t.bigint :group_id - t.bigint :project_id - t.timestamps_with_timezone null: false - t.integer :status, limit: 2, null: false, default: 0 - t.text :relation, null: false - t.text :jid, unique: true - t.text :error - - t.text_limit :relation, 255 - t.text_limit :jid, 255 - t.text_limit :error, 255 - end - end - - def down - drop_table :bulk_import_exports - end -end diff --git a/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb b/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb deleted file mode 100644 index 2f7d3713302..00000000000 --- a/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToBulkImportExportsOnProject < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :bulk_import_exports, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :bulk_import_exports, column: :project_id - end - end -end diff --git a/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb b/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb deleted file mode 100644 index b7172c6987e..00000000000 --- a/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToBulkImportExportsOnGroup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :bulk_import_exports, :namespaces, column: :group_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :bulk_import_exports, column: :group_id - end - end -end diff --git a/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb b/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb deleted file mode 100644 index 537f7727691..00000000000 --- a/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddExternalPipelineValidationToApplicationSetting < ActiveRecord::Migration[6.0] - def up - add_column :application_settings, :external_pipeline_validation_service_timeout, :integer - # rubocop:disable Migration/AddLimitToTextColumns - add_column :application_settings, :encrypted_external_pipeline_validation_service_token, :text - add_column :application_settings, :encrypted_external_pipeline_validation_service_token_iv, :text - add_column :application_settings, :external_pipeline_validation_service_url, :text - # rubocop:enable Migration/AddLimitToTextColumns - end - - def down - remove_column :application_settings, :external_pipeline_validation_service_timeout - remove_column :application_settings, :encrypted_external_pipeline_validation_service_token - remove_column :application_settings, :encrypted_external_pipeline_validation_service_token_iv - remove_column :application_settings, :external_pipeline_validation_service_url - end -end diff --git a/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb b/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb deleted file mode 100644 index 1cbd1cadf5e..00000000000 --- a/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportsTableIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - GROUP_INDEX_NAME = 'partial_index_bulk_import_exports_on_group_id_and_relation' - PROJECT_INDEX_NAME = 'partial_index_bulk_import_exports_on_project_id_and_relation' - - def up - add_concurrent_index :bulk_import_exports, - [:group_id, :relation], - unique: true, - where: 'group_id IS NOT NULL', - name: GROUP_INDEX_NAME - - add_concurrent_index :bulk_import_exports, - [:project_id, :relation], - unique: true, - where: 'project_id IS NOT NULL', - name: PROJECT_INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:bulk_import_exports, GROUP_INDEX_NAME) - remove_concurrent_index_by_name(:bulk_import_exports, PROJECT_INDEX_NAME) - end -end diff --git a/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb b/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb deleted file mode 100644 index d20e57848e9..00000000000 --- a/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportUploadsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :bulk_import_export_uploads do |t| - t.references :export, index: true, null: false, foreign_key: { to_table: :bulk_import_exports, on_delete: :cascade } - t.datetime_with_timezone :updated_at, null: false - t.text :export_file - - t.text_limit :export_file, 255 - end - end - - def down - drop_table :bulk_import_export_uploads - end -end diff --git a/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb b/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb deleted file mode 100644 index 068dceda272..00000000000 --- a/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildNeedsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - initialize_conversion_of_integer_to_bigint :ci_build_needs, :build_id - end - - def down - trigger_name = rename_trigger_name(:ci_build_needs, :build_id, :build_id_convert_to_bigint) - - remove_rename_triggers :ci_build_needs, trigger_name - - remove_column :ci_build_needs, :build_id_convert_to_bigint - end -end diff --git a/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb b/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb deleted file mode 100644 index 9c38e04a96b..00000000000 --- a/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUrlLimitToPipelineValidation < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - CONSTRAINT_NAME = 'app_settings_ext_pipeline_validation_service_url_text_limit' - - def up - add_text_limit :application_settings, :external_pipeline_validation_service_url, 255, constraint_name: CONSTRAINT_NAME - end - - def down - remove_check_constraint(:application_settings, CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb b/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb deleted file mode 100644 index f691af4d8d2..00000000000 --- a/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexEpicsOnGroupIdFromEpics < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_epics_on_group_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :epics, INDEX_NAME - end - - def down - add_concurrent_index :epics, :group_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb b/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb deleted file mode 100644 index 2fe33ff23ba..00000000000 --- a/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_requests do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_requests_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade } - t.text :method - t.text :url - - t.text_limit :method, 32 - t.text_limit :url, 2048 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_requests - end - end -end diff --git a/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb b/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb deleted file mode 100644 index c9740a48117..00000000000 --- a/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_responses do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_responses_on_finding_evidences_id' }, null: false, foreign_key: { on_delete: :cascade } - t.integer :status_code - t.text :reason_phrase - - t.text_limit :reason_phrase, 2048 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_responses - end - end -end diff --git a/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb b/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb deleted file mode 100644 index 1df56742480..00000000000 --- a/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDebianGroupArchitecturesDistributionIdIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'idx_pkgs_deb_grp_architectures_on_distribution_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index :packages_debian_group_architectures, :distribution_id, name: INDEX_NAME - end - - def down - add_concurrent_index :packages_debian_group_architectures, :distribution_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb b/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb deleted file mode 100644 index 1f918bd4dec..00000000000 --- a/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDebianProjectArchitecturesDistributionIdIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'idx_pkgs_deb_proj_architectures_on_distribution_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index :packages_debian_project_architectures, :distribution_id, name: INDEX_NAME - end - - def down - add_concurrent_index :packages_debian_project_architectures, :distribution_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb b/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb deleted file mode 100644 index 00c5329406e..00000000000 --- a/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddRemoteImportUrlToImportExportUpload < ActiveRecord::Migration[6.0] - # limit is added in 20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb - def change - add_column :import_export_uploads, :remote_import_url, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb b/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb deleted file mode 100644 index 81b4e76b8d9..00000000000 --- a/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddRemoteTextLimitToImportUrlInImportExportUpload < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :import_export_uploads, :remote_import_url, 512 - end - - def down - remove_text_limit :import_export_uploads, :remote_import_url - end -end diff --git a/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb b/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb deleted file mode 100644 index d071ac8d1d4..00000000000 --- a/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class UpdateIssuesIterationForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:issues, column: :sprint_id) - end - - add_concurrent_foreign_key(:issues, :sprints, column: :sprint_id, on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:issues, column: :sprint_id) - end - - add_concurrent_foreign_key(:issues, :sprints, column: :sprint_id, on_delete: :cascade) - end -end diff --git a/db/migrate/20210420012444_change_web_hook_events_default.rb b/db/migrate/20210420012444_change_web_hook_events_default.rb deleted file mode 100644 index b5a63a5a2a8..00000000000 --- a/db/migrate/20210420012444_change_web_hook_events_default.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ChangeWebHookEventsDefault < ActiveRecord::Migration[6.0] - def up - change_column_default :web_hooks, :push_events, true - change_column_default :web_hooks, :issues_events, false - change_column_default :web_hooks, :merge_requests_events, false - change_column_default :web_hooks, :tag_push_events, false - end - - # This is a NOP because this migration is supposed to restore the - # intended schema, not revert it. - def down - end -end diff --git a/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb b/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb deleted file mode 100644 index c1715d8ac29..00000000000 --- a/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class IndexClusterAgentTokensOnLastUsedAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - OLD_INDEX = 'index_cluster_agent_tokens_on_agent_id' - NEW_INDEX = 'index_cluster_agent_tokens_on_agent_id_and_last_used_at' - - disable_ddl_transaction! - - def up - add_concurrent_index :cluster_agent_tokens, 'agent_id, last_used_at DESC NULLS LAST', name: NEW_INDEX - remove_concurrent_index_by_name :cluster_agent_tokens, OLD_INDEX - end - - def down - add_concurrent_index :cluster_agent_tokens, :agent_id, name: OLD_INDEX - remove_concurrent_index_by_name :cluster_agent_tokens, NEW_INDEX - end -end diff --git a/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb b/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb deleted file mode 100644 index cc8f0686841..00000000000 --- a/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiJobArtifactsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_job_artifacts - COLUMNS = %i(id job_id) - TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" } - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - trigger_name = rename_trigger_name(TABLE, COLUMNS, TARGET_COLUMNS) - remove_rename_triggers TABLE, trigger_name - - TARGET_COLUMNS.each do |column| - remove_column TABLE, column - end - end -end diff --git a/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb b/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb deleted file mode 100644 index 2c0d0bee39d..00000000000 --- a/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToTerraformStateVersions < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - VERIFICATION_STATE_INDEX_NAME = "index_terraform_state_versions_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :terraform_state_versions, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :terraform_state_versions, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb b/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb deleted file mode 100644 index 2674d9e50c8..00000000000 --- a/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# This migration recreates the index that introduced in 20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb. -class RecreateIndexForProjectDeploymentsWithEnvironmentIdAndDateAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at' - NEW_INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at_id' - - def up - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at, :id], name: NEW_INDEX_NAME - remove_concurrent_index_by_name :deployments, OLD_INDEX_NAME - end - - def down - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at], name: OLD_INDEX_NAME - remove_concurrent_index_by_name :deployments, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb b/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb deleted file mode 100644 index 64786f0b20c..00000000000 --- a/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class UpdateMergeRequestsIterationForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:merge_requests, column: :sprint_id) - end - - add_concurrent_foreign_key(:merge_requests, :sprints, column: :sprint_id, on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:merge_requests, column: :sprint_id) - end - - add_concurrent_foreign_key(:merge_requests, :sprints, column: :sprint_id, on_delete: :cascade) - end -end diff --git a/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb b/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb deleted file mode 100644 index 74d197cd3b8..00000000000 --- a/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDeactivateDormantUsersToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :deactivate_dormant_users, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210421022010_add_index_for_dormant_users.rb b/db/migrate/20210421022010_add_index_for_dormant_users.rb deleted file mode 100644 index 48eff184ca0..00000000000 --- a/db/migrate/20210421022010_add_index_for_dormant_users.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForDormantUsers < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_non_internal_active' - - disable_ddl_transaction! - - def up - 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 - - def down - remove_concurrent_index_by_name :users, INDEX_NAME - end -end diff --git a/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb b/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb deleted file mode 100644 index 3d65abc5608..00000000000 --- a/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddCodeownersDevopsAdoptionSnapshot < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_snapshots, :total_projects_count, :integer - add_column :analytics_devops_adoption_snapshots, :code_owners_used_count, :integer - end -end diff --git a/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb b/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb deleted file mode 100644 index 301e75aa093..00000000000 --- a/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveElasticTaskNullConstraintFromElasticReindexingSubtasks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - ELASTIC_TASK = 'elastic_task' - - disable_ddl_transaction! - - def up - remove_not_null_constraint :elastic_reindexing_subtasks, :elastic_task - change_column_null(:elastic_reindexing_subtasks, :elastic_task, true) - end - - def down - # there may be elastic_task values which are null so we fill them with a dummy value - change_column_null(:elastic_reindexing_subtasks, :elastic_task, false, ELASTIC_TASK) - add_not_null_constraint :elastic_reindexing_subtasks, :elastic_task, validate: false - end -end diff --git a/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb b/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb deleted file mode 100644 index ea716afe84b..00000000000 --- a/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiSourcesPipelinesSourceJobIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - # Foreign key that references ci_builds.id - initialize_conversion_of_integer_to_bigint :ci_sources_pipelines, :source_job_id - end - - def down - trigger_name = rename_trigger_name(:ci_sources_pipelines, :source_job_id, :source_job_id_convert_to_bigint) - - remove_rename_triggers :ci_sources_pipelines, trigger_name - - remove_column :ci_sources_pipelines, :source_job_id_convert_to_bigint - end -end diff --git a/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb b/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb deleted file mode 100644 index bd38b5660b4..00000000000 --- a/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdNextRunAtIndexToContainerExpirationPolicies < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'idx_container_exp_policies_on_project_id_next_run_at' - - def up - add_concurrent_index :container_expiration_policies, [:project_id, :next_run_at], name: INDEX_NAME, where: 'enabled = true' - end - - def down - remove_concurrent_index :container_expiration_policies, [:project_id, :next_run_at], name: INDEX_NAME - end -end diff --git a/db/migrate/20210422181809_add_project_to_timelogs.rb b/db/migrate/20210422181809_add_project_to_timelogs.rb deleted file mode 100644 index 1f98e440d15..00000000000 --- a/db/migrate/20210422181809_add_project_to_timelogs.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddProjectToTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_column :timelogs, :project_id, :integer - end - end - - def down - with_lock_retries do - remove_column :timelogs, :project_id - end - end -end diff --git a/db/migrate/20210422195929_create_elastic_reindexing_slices.rb b/db/migrate/20210422195929_create_elastic_reindexing_slices.rb deleted file mode 100644 index a535402186c..00000000000 --- a/db/migrate/20210422195929_create_elastic_reindexing_slices.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -class CreateElasticReindexingSlices < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - class ReindexingSubtask < ActiveRecord::Base - self.table_name = 'elastic_reindexing_subtasks' - end - - class ReindexingSlice < ActiveRecord::Base - self.table_name = 'elastic_reindexing_slices' - end - - def up - unless table_exists?(:elastic_reindexing_slices) - create_table_with_constraints :elastic_reindexing_slices do |t| - t.timestamps_with_timezone null: false - t.references :elastic_reindexing_subtask, foreign_key: { on_delete: :cascade }, null: false, index: { name: 'idx_elastic_reindexing_slices_on_elastic_reindexing_subtask_id' } - t.integer :elastic_slice, null: false, limit: 2, default: 0 - t.integer :elastic_max_slice, null: false, limit: 2, default: 0 - t.integer :retry_attempt, null: false, limit: 2, default: 0 - t.text :elastic_task - - t.text_limit :elastic_task, 255 - end - end - - ReindexingSubtask.find_each do |subtask| - next if ReindexingSlice.where(elastic_reindexing_subtask_id: subtask.id).exists? - - ReindexingSlice.create( - elastic_reindexing_subtask_id: subtask.id, - elastic_task: subtask.elastic_task, - retry_attempt: 0 - ) - end - end - - def down - drop_table :elastic_reindexing_slices - end -end diff --git a/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb b/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb deleted file mode 100644 index 80b97ff5afe..00000000000 --- a/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Site Profiles and CI Pipelines' } - - create_table :dast_site_profiles_pipelines, primary_key: [:dast_site_profile_id, :ci_pipeline_id], comment: Gitlab::Json.dump(table_comment) do |t| - t.bigint :dast_site_profile_id, null: false - t.bigint :ci_pipeline_id, null: false - - t.index :ci_pipeline_id, unique: true, name: :index_dast_site_profiles_pipelines_on_ci_pipeline_id - end - end - - def down - drop_table :dast_site_profiles_pipelines - end -end diff --git a/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb b/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb deleted file mode 100644 index eb3a5168609..00000000000 --- a/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDastSiteProfileIdFkToDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_site_profiles_pipelines, :dast_site_profiles, column: :dast_site_profile_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_site_profiles_pipelines, column: :dast_site_profile_id - end - end -end diff --git a/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb b/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb deleted file mode 100644 index ed2a7ff859c..00000000000 --- a/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiPipelineIdFkToDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_site_profiles_pipelines, :ci_pipelines, column: :ci_pipeline_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_site_profiles_pipelines, column: :ci_pipeline_id - end - end -end diff --git a/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb b/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb deleted file mode 100644 index 5382e596d8c..00000000000 --- a/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddRunnerRegistrationToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column(:plan_limits, :ci_registered_group_runners, :integer, default: 1000, null: false) - add_column(:plan_limits, :ci_registered_project_runners, :integer, default: 1000, null: false) - end -end diff --git a/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb b/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb deleted file mode 100644 index 36d13dfa120..00000000000 --- a/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class InsertRunnerRegistrationPlanLimits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_or_update_plan_limit('ci_registered_group_runners', 'free', 50) - create_or_update_plan_limit('ci_registered_group_runners', 'bronze', 1000) - create_or_update_plan_limit('ci_registered_group_runners', 'silver', 1000) - create_or_update_plan_limit('ci_registered_group_runners', 'gold', 1000) - - create_or_update_plan_limit('ci_registered_project_runners', 'free', 50) - create_or_update_plan_limit('ci_registered_project_runners', 'bronze', 1000) - create_or_update_plan_limit('ci_registered_project_runners', 'silver', 1000) - create_or_update_plan_limit('ci_registered_project_runners', 'gold', 1000) - end - - def down - %w[group project].each do |scope| - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'free', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'bronze', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'silver', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'gold', 1000) - end - end -end diff --git a/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb b/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb deleted file mode 100644 index ee9e444c792..00000000000 --- a/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class ReOrderFkSourceProjectIdInMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_SOURCE_PROJECT_FK = 'fk_3308fe130c' - NEW_SOURCE_PROJECT_FK = 'fk_source_project' - - def up - add_concurrent_foreign_key :merge_requests, :projects, column: :source_project_id, on_delete: :nullify, name: NEW_SOURCE_PROJECT_FK - - remove_foreign_key_if_exists :merge_requests, column: :source_project_id, name: OLD_SOURCE_PROJECT_FK - end - - def down - add_concurrent_foreign_key :merge_requests, :projects, column: :source_project_id, on_delete: :nullify - - remove_foreign_key_if_exists :merge_requests, column: :source_project_id, name: NEW_SOURCE_PROJECT_FK - end -end diff --git a/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb b/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb deleted file mode 100644 index 47b2f81cfae..00000000000 --- a/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class SwapPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - def up - replace_with_partitioned_table :web_hook_logs - end - - def down - rollback_replace_with_partitioned_table :web_hook_logs - end -end diff --git a/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb b/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb deleted file mode 100644 index 69542e7627d..00000000000 --- a/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdFkToTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_timelogs_on_project_id_and_spent_at' - - disable_ddl_transaction! - - def up - add_concurrent_index :timelogs, [:project_id, :spent_at], name: INDEX_NAME - add_concurrent_foreign_key :timelogs, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :timelogs, column: :project_id - end - remove_concurrent_index_by_name :timelogs, INDEX_NAME - end -end diff --git a/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb b/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb deleted file mode 100644 index e2f82557387..00000000000 --- a/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds - COLUMNS = %i(id stage_id) - TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" } - - 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/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb b/db/migrate/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb deleted file mode 100644 index ec3bb0b7e45..00000000000 --- a/db/migrate/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildTraceChunksToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_build_trace_chunks - COLUMNS = %i(build_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/20210427062807_add_index_to_batched_migration_jobs_status.rb b/db/migrate/20210427062807_add_index_to_batched_migration_jobs_status.rb deleted file mode 100644 index c429094762e..00000000000 --- a/db/migrate/20210427062807_add_index_to_batched_migration_jobs_status.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToBatchedMigrationJobsStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_batched_jobs_on_batched_migration_id_and_status' - - def up - add_concurrent_index :batched_background_migration_jobs, [:batched_background_migration_id, :status], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME - end -end diff --git a/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb b/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb deleted file mode 100644 index ffa653604df..00000000000 --- a/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsRunnerSessionToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds_runner_session - COLUMNS = %i(build_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/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb b/db/migrate/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb deleted file mode 100644 index 3622dddd27f..00000000000 --- a/db/migrate/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExecutionOrderIndexToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_migration_jobs_on_migration_id_and_finished_at' - - def up - add_concurrent_index :batched_background_migration_jobs, %i(batched_background_migration_id finished_at), name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME - end -end diff --git a/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb b/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb deleted file mode 100644 index 9f411a61e5c..00000000000 --- a/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddSpamcheckApiKeyToApplicationSetting < ActiveRecord::Migration[6.0] - def up - add_column :application_settings, :encrypted_spam_check_api_key, :binary - add_column :application_settings, :encrypted_spam_check_api_key_iv, :binary - end - - def down - remove_column :application_settings, :encrypted_spam_check_api_key - remove_column :application_settings, :encrypted_spam_check_api_key_iv - end -end diff --git a/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb b/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb deleted file mode 100644 index fbae2a14d2d..00000000000 --- a/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDescriptionRollOverToIterationsCadences < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :iterations_cadences, :roll_over, :boolean, null: false, default: false - add_column :iterations_cadences, :description, :text # rubocop:disable Migration/AddLimitToTextColumns - end - end - - def down - with_lock_retries do - remove_column :iterations_cadences, :roll_over - remove_column :iterations_cadences, :description - end - end -end diff --git a/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb b/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb deleted file mode 100644 index a146f295de3..00000000000 --- a/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToIterationsCadencesDescription < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :iterations_cadences, :description, 5000 - end - - def down - remove_text_limit :iterations_cadences, :description - end -end diff --git a/db/migrate/20210428151144_update_invalid_web_hooks.rb b/db/migrate/20210428151144_update_invalid_web_hooks.rb deleted file mode 100644 index 4f45e7aaa9b..00000000000 --- a/db/migrate/20210428151144_update_invalid_web_hooks.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateInvalidWebHooks < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class WebHook < ActiveRecord::Base - include EachBatch - - self.table_name = 'web_hooks' - end - - def up - WebHook.each_batch(of: 10_000, column: :id) do |relation| - relation.where(type: 'ProjectHook') - .where.not(project_id: nil) - .where.not(group_id: nil) - .update_all(group_id: nil) - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb b/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb deleted file mode 100644 index e7020665b25..00000000000 --- a/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ValidateForeignKeyOnGroupHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - CONSTRAINT_NAME = 'fk_rails_d35697648e' - - def up - validate_foreign_key :web_hooks, :group_id, name: CONSTRAINT_NAME - end - - def down - # no-op - end -end diff --git a/db/migrate/20210429024843_add_escalation_policies.rb b/db/migrate/20210429024843_add_escalation_policies.rb deleted file mode 100644 index 63bd558acfb..00000000000 --- a/db/migrate/20210429024843_add_escalation_policies.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddEscalationPolicies < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - UNIQUE_INDEX_NAME = 'index_on_project_id_escalation_policy_name_unique' - - def up - create_table_with_constraints :incident_management_escalation_policies do |t| - t.references :project, index: false, null: false, foreign_key: { on_delete: :cascade } - t.text :name, null: false - t.text :description, null: true - - t.text_limit :name, 72 - t.text_limit :description, 160 - t.index [:project_id, :name], unique: true, name: UNIQUE_INDEX_NAME - end - end - - def down - drop_table :incident_management_escalation_policies - end -end diff --git a/db/migrate/20210429032320_add_escalation_rules.rb b/db/migrate/20210429032320_add_escalation_rules.rb deleted file mode 100644 index 2297f7511a6..00000000000 --- a/db/migrate/20210429032320_add_escalation_rules.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddEscalationRules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - RULE_SCHEDULE_INDEX_NAME = 'index_on_oncall_schedule_escalation_rule' - UNIQUENESS_INDEX_NAME = 'index_on_policy_schedule_status_elapsed_time_escalation_rules' - - def change - create_table :incident_management_escalation_rules do |t| - t.belongs_to :policy, index: false, null: false, foreign_key: { on_delete: :cascade, to_table: :incident_management_escalation_policies } - t.belongs_to :oncall_schedule, index: { name: RULE_SCHEDULE_INDEX_NAME }, null: false, foreign_key: { on_delete: :cascade, to_table: :incident_management_oncall_schedules } - t.integer :status, null: false, limit: 2 - t.integer :elapsed_time_seconds, null: false, limit: 4 - - t.index [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds], unique: true, name: UNIQUENESS_INDEX_NAME - end - end -end diff --git a/db/migrate/20210429131525_create_user_credit_card_validations.rb b/db/migrate/20210429131525_create_user_credit_card_validations.rb deleted file mode 100644 index 8548274b29a..00000000000 --- a/db/migrate/20210429131525_create_user_credit_card_validations.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateUserCreditCardValidations < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - create_table :user_credit_card_validations, id: false do |t| - t.references :user, foreign_key: { on_delete: :cascade }, index: false, primary_key: true, default: nil - t.datetime_with_timezone :credit_card_validated_at, null: false - end - end - end - - def down - with_lock_retries do - drop_table :user_credit_card_validations - end - end -end diff --git a/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb b/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb deleted file mode 100644 index 4a34c2dd307..00000000000 --- a/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddFailureTrackingToWebHooks < ActiveRecord::Migration[6.0] - def change - change_table(:web_hooks, bulk: true) do |t| - t.integer :recent_failures, null: false, limit: 2, default: 0 - t.integer :backoff_count, null: false, limit: 2, default: 0 - t.column :disabled_until, :timestamptz - end - end -end diff --git a/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb b/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb deleted file mode 100644 index 8c328eb52fc..00000000000 --- a/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddGenericPackageDuplicateSettingsToNamespacePackageSettings < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex - def change - add_column :namespace_package_settings, :generic_duplicates_allowed, :boolean, null: false, default: true - add_column :namespace_package_settings, :generic_duplicate_exception_regex, :text, null: false, default: '' - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb b/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb deleted file mode 100644 index 5d02ad3e2f5..00000000000 --- a/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToNamespacePackageSettingsGenericDuplicateExceptionRegex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :namespace_package_settings, :generic_duplicate_exception_regex, 255 - end - - def down - remove_text_limit :namespace_package_settings, :generic_duplicate_exception_regex - end -end diff --git a/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb b/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb deleted file mode 100644 index 48ab860a63b..00000000000 --- a/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddAlertManagerTokenToClustersIntegrationPrometheus < ActiveRecord::Migration[6.0] - def change - change_table :clusters_integration_prometheus do |t| - t.text :encrypted_alert_manager_token - t.text :encrypted_alert_manager_token_iv - end - end -end diff --git a/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb b/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb deleted file mode 100644 index 446ac93c75b..00000000000 --- a/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddElasticsearchUsernamePasswordToApplicationSettings < ActiveRecord::Migration[6.0] - def change - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210505124816_add_text_limit_to_elasticsearch_username - add_column :application_settings, :elasticsearch_username, :text - # rubocop:enable Migration/AddLimitToTextColumns - - add_column :application_settings, :encrypted_elasticsearch_password, :binary - add_column :application_settings, :encrypted_elasticsearch_password_iv, :binary - end -end diff --git a/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb b/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb deleted file mode 100644 index c51ae67ebee..00000000000 --- a/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildTraceSectionsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_build_trace_sections - COLUMN = :build_id - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMN, primary_key: COLUMN) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end -end diff --git a/db/migrate/20210430122951_add_snapshot_namespace_id.rb b/db/migrate/20210430122951_add_snapshot_namespace_id.rb deleted file mode 100644 index 9017bcdde53..00000000000 --- a/db/migrate/20210430122951_add_snapshot_namespace_id.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddSnapshotNamespaceId < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_snapshots, :namespace_id, :integer - end -end diff --git a/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb b/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb deleted file mode 100644 index 43be5c719fb..00000000000 --- a/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDisplayNamespaceIdToSegments < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_segments, :display_namespace_id, :integer - end -end diff --git a/db/migrate/20210430124630_add_devops_adoption_indexes.rb b/db/migrate/20210430124630_add_devops_adoption_indexes.rb deleted file mode 100644 index 4531e6b5e4c..00000000000 --- a/db/migrate/20210430124630_add_devops_adoption_indexes.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class AddDevopsAdoptionIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - SEGMENTS_INDEX_NAME = 'idx_devops_adoption_segments_namespaces_pair' - SNAPSHOT_END_TIME_INDEX_NAME = 'idx_devops_adoption_segments_namespace_end_time' - SNAPSHOT_RECORDED_AT_INDEX_NAME = 'idx_devops_adoption_segments_namespace_recorded_at' - - def up - add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :end_time], - name: SNAPSHOT_END_TIME_INDEX_NAME - add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :recorded_at], - name: SNAPSHOT_RECORDED_AT_INDEX_NAME - add_concurrent_index :analytics_devops_adoption_segments, [:display_namespace_id, :namespace_id], - unique: true, name: SEGMENTS_INDEX_NAME - - add_concurrent_foreign_key :analytics_devops_adoption_snapshots, :namespaces, column: :namespace_id - add_concurrent_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :display_namespace_id - end - - def down - remove_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :display_namespace_id - remove_foreign_key :analytics_devops_adoption_snapshots, :namespaces, column: :namespace_id - - remove_concurrent_index_by_name :analytics_devops_adoption_segments, SEGMENTS_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, SNAPSHOT_RECORDED_AT_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, SNAPSHOT_END_TIME_INDEX_NAME - end -end diff --git a/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb b/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb deleted file mode 100644 index be022c1b973..00000000000 --- a/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true -class AddSliceMultiplierAndMaxSlicesToElasticReindexingTask < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DEFAULT_MAX_TOTAL_SLICES_RUNNING = 60 - DEFAULT_SLICE_MULTIPLIER = 2 - - def change - add_column :elastic_reindexing_tasks, :max_slices_running, :integer, - limit: 2, - default: DEFAULT_MAX_TOTAL_SLICES_RUNNING, - null: false - add_column :elastic_reindexing_tasks, :slice_multiplier, :integer, - limit: 2, - default: DEFAULT_SLICE_MULTIPLIER, - null: false - end -end diff --git a/db/migrate/20210503105022_create_project_value_streams.rb b/db/migrate/20210503105022_create_project_value_streams.rb deleted file mode 100644 index 775ab03ad4b..00000000000 --- a/db/migrate/20210503105022_create_project_value_streams.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectValueStreams < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_analytics_ca_project_value_streams_on_project_id_and_name' - - def up - create_table_with_constraints :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 - t.text_limit :name, 100 - end - end - - def down - with_lock_retries do - drop_table :analytics_cycle_analytics_project_value_streams - end - end -end diff --git a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb b/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb deleted file mode 100644 index d888ab4943c..00000000000 --- a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddProjectValueStreamIdToProjectStages < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_analytics_ca_project_stages_on_value_stream_id' - - class ProjectValueStream < ActiveRecord::Base - self.table_name = 'analytics_cycle_analytics_project_stages' - - include EachBatch - end - - def up - ProjectValueStream.reset_column_information - # The table was never used, there is no user-facing code that modifies the table, it should be empty. - # Since there is no functionality present that depends on this data, it's safe to delete the rows. - ProjectValueStream.each_batch(of: 100) do |relation| - relation.delete_all - end - - transaction do - add_reference :analytics_cycle_analytics_project_stages, :project_value_stream, null: false, index: { name: INDEX_NAME }, foreign_key: { on_delete: :cascade, to_table: :analytics_cycle_analytics_project_value_streams }, type: :bigint # rubocop: disable Migration/AddReference, Rails/NotNullColumn - end - end - - def down - remove_reference :analytics_cycle_analytics_project_stages, :project_value_stream - end -end diff --git a/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb b/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb deleted file mode 100644 index cb23c9391ea..00000000000 --- a/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddWebHookCallsToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column :plan_limits, :web_hook_calls, :integer, null: false, default: 0 - end -end diff --git a/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb b/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb deleted file mode 100644 index 898a0ccd1c5..00000000000 --- a/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnWebHookProjectIdRecentFailures < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_web_hooks_on_project_id_recent_failures' - - disable_ddl_transaction! - - def up - add_concurrent_index(:web_hooks, [:project_id, :recent_failures], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:web_hooks, INDEX_NAME) - end -end diff --git a/db/migrate/20210504135823_add_floc_application_settings.rb b/db/migrate/20210504135823_add_floc_application_settings.rb deleted file mode 100644 index a5e3aad6b8c..00000000000 --- a/db/migrate/20210504135823_add_floc_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddFlocApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :floc_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb b/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb deleted file mode 100644 index 7999ea14a12..00000000000 --- a/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToMrDiffDetailsTable < ActiveRecord::Migration[6.0] - def change - change_table(:merge_request_diff_details) do |t| - t.integer :verification_state, default: 0, limit: 2, null: false - t.column :verification_started_at, :datetime_with_timezone - end - end -end diff --git a/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb b/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb deleted file mode 100644 index 79680821060..00000000000 --- a/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class CreateClustersIntegrationElasticstack < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :clusters_integration_elasticstack, id: false do |t| - t.timestamps_with_timezone null: false - t.references :cluster, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.boolean :enabled, null: false, default: false - t.text :chart_version - t.text_limit :chart_version, 10 - end - end - - def down - with_lock_retries do - drop_table :clusters_integration_elasticstack - end - end -end diff --git a/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb b/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb deleted file mode 100644 index af403faa278..00000000000 --- a/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreatePartialIndexesForPendingAndRunningBuilds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_PENDING = 'index_ci_builds_runner_id_pending' - INDEX_RUNNING = 'index_ci_builds_runner_id_running' - - def up - add_concurrent_index :ci_builds, :runner_id, where: "status = 'pending' AND type = 'Ci::Build'", name: INDEX_PENDING - add_concurrent_index :ci_builds, :runner_id, where: "status = 'running' AND type = 'Ci::Build'", name: INDEX_RUNNING - end - - def down - remove_concurrent_index_by_name :ci_builds, INDEX_PENDING - remove_concurrent_index_by_name :ci_builds, INDEX_RUNNING - end -end diff --git a/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb b/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb deleted file mode 100644 index 1e79b4e29b0..00000000000 --- a/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDebianGroupDistributionKeys < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_DISTRIBUTION = 'idx_pkgs_debian_group_distribution_keys_on_distribution_id' - - disable_ddl_transaction! - - def up - create_table_with_constraints :packages_debian_group_distribution_keys do |t| - t.timestamps_with_timezone - t.references :distribution, - foreign_key: { to_table: :packages_debian_group_distributions, on_delete: :cascade }, - index: { name: INDEX_DISTRIBUTION }, - null: false - - t.text :encrypted_private_key, null: false - t.text :encrypted_private_key_iv, null: false - t.text :encrypted_passphrase, null: false - t.text :encrypted_passphrase_iv, null: false - t.text :public_key, null: false - t.text :fingerprint, null: false - - t.text_limit :public_key, 512.kilobytes - t.text_limit :fingerprint, 255 - end - end - - def down - with_lock_retries do - drop_table :packages_debian_group_distribution_keys - end - end -end diff --git a/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb b/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb deleted file mode 100644 index f5ec01ec0d6..00000000000 --- a/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDebianProjectDistributionKeys < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_DISTRIBUTION = 'idx_pkgs_debian_project_distribution_keys_on_distribution_id' - - disable_ddl_transaction! - - def up - create_table_with_constraints :packages_debian_project_distribution_keys do |t| - t.timestamps_with_timezone - t.references :distribution, - foreign_key: { to_table: :packages_debian_project_distributions, on_delete: :cascade }, - index: { name: INDEX_DISTRIBUTION }, - null: false - - t.text :encrypted_private_key, null: false - t.text :encrypted_private_key_iv, null: false - t.text :encrypted_passphrase, null: false - t.text :encrypted_passphrase_iv, null: false - t.text :public_key, null: false - t.text :fingerprint, null: false - - t.text_limit :public_key, 512.kilobytes - t.text_limit :fingerprint, 255 - end - end - - def down - with_lock_retries do - drop_table :packages_debian_project_distribution_keys - end - end -end diff --git a/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb b/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb deleted file mode 100644 index 324b9193efb..00000000000 --- a/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToElasticsearchUsername < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :application_settings, :elasticsearch_username, 255 - end - - def down - remove_text_limit :application_settings, :elasticsearch_username - end -end diff --git a/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb b/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb deleted file mode 100644 index e85a28e3fa7..00000000000 --- a/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToMergeRequestDiffDetailsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - VERIFICATION_STATE_INDEX_NAME = "index_merge_request_diff_details_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_request_diff_details, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :merge_request_diff_details, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb b/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb deleted file mode 100644 index 0e584303e51..00000000000 --- a/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceHeaders < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_headers do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence_request, index: { name: 'finding_evidence_header_on_finding_evidence_request_id' }, null: true, foreign_key: { on_delete: :cascade } - t.references :vulnerability_finding_evidence_response, index: { name: 'finding_evidence_header_on_finding_evidence_response_id' }, null: true, foreign_key: { on_delete: :cascade } - t.text :name, null: false - t.text :value, null: false - - t.text_limit :name, 255 - t.text_limit :value, 8192 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_headers - end - end -end diff --git a/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb b/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb deleted file mode 100644 index 131edb20164..00000000000 --- a/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRemoveOnIssueCloseToLabels < ActiveRecord::Migration[6.0] - # This migration was reverted in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62056 - - def up - end - - def down - end -end diff --git a/db/migrate/20210510083845_add_sha_to_status_check_response.rb b/db/migrate/20210510083845_add_sha_to_status_check_response.rb deleted file mode 100644 index 202f5ca00c1..00000000000 --- a/db/migrate/20210510083845_add_sha_to_status_check_response.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddShaToStatusCheckResponse < ActiveRecord::Migration[6.0] - def up - execute('DELETE FROM status_check_responses') - - add_column :status_check_responses, :sha, :binary, null: false # rubocop:disable Rails/NotNullColumn - end - - def down - remove_column :status_check_responses, :sha - end -end diff --git a/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb b/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb deleted file mode 100644 index 9b0054dbd22..00000000000 --- a/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddBodyToFindingsEvidencesRequest < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210510191552_add_limit_to_findings_evidences_request_body.rb - def change - add_column :vulnerability_finding_evidence_requests, :body, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb b/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb deleted file mode 100644 index 84c8acdb10d..00000000000 --- a/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLimitToFindingsEvidencesRequestBody < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :vulnerability_finding_evidence_requests, :body, 2048 - end - - def down - remove_text_limit :vulnerability_finding_evidence_requests, :body - end -end diff --git a/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb b/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb deleted file mode 100644 index 9822276f9c4..00000000000 --- a/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddEpicBoardRecentVisitsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - unless table_exists?(:boards_epic_board_recent_visits) - create_table :boards_epic_board_recent_visits do |t| - t.references :user, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :epic_board, index: true, foreign_key: { to_table: :boards_epic_boards, on_delete: :cascade }, null: false - t.references :group, index: true, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false - t.timestamps_with_timezone null: false - end - end - end - end - - def down - with_lock_retries do - drop_table :boards_epic_board_recent_visits - end - end -end diff --git a/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb b/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb deleted file mode 100644 index 1341886c50c..00000000000 --- a/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToEpicBoardRecentVisits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_epic_board_recent_visits_on_user_group_and_board' - - disable_ddl_transaction! - - def up - add_concurrent_index :boards_epic_board_recent_visits, - [:user_id, :group_id, :epic_board_id], - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :boards_epic_board_recent_visits, INDEX_NAME - end -end diff --git a/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb b/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb deleted file mode 100644 index 4163499a553..00000000000 --- a/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToLfsObjectsProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :lfs_objects_projects, :lfs_objects, column: :lfs_object_id, on_delete: :restrict, validate: false - add_concurrent_foreign_key :lfs_objects_projects, :projects, column: :project_id, on_delete: :cascade, validate: false - end - - def down - with_lock_retries do - remove_foreign_key :lfs_objects_projects, column: :lfs_object_id - remove_foreign_key :lfs_objects_projects, column: :project_id - end - end -end diff --git a/db/migrate/20210512120122_add_pending_builds_table.rb b/db/migrate/20210512120122_add_pending_builds_table.rb deleted file mode 100644 index 38e13d43b38..00000000000 --- a/db/migrate/20210512120122_add_pending_builds_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddPendingBuildsTable < ActiveRecord::Migration[6.0] - def up - create_table :ci_pending_builds do |t| - t.references :build, index: { unique: true }, null: false, foreign_key: { to_table: :ci_builds, on_delete: :cascade } - t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } - t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } - end - end - - def down - drop_table :ci_pending_builds - end -end diff --git a/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb b/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb deleted file mode 100644 index 6884d339b9c..00000000000 --- a/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddBodyToFindingsEvidencesResponse < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210512183310_add_limit_to_findings_evidences_response_body.rb - def change - add_column :vulnerability_finding_evidence_responses, :body, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb b/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb deleted file mode 100644 index bdd15163809..00000000000 --- a/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLimitToFindingsEvidencesResponseBody < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :vulnerability_finding_evidence_responses, :body, 2048 - end - - def down - remove_text_limit :vulnerability_finding_evidence_responses, :body - end -end diff --git a/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb b/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb deleted file mode 100644 index 67e2cc0eea0..00000000000 --- a/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDraftColumnToMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :merge_requests, :draft, :boolean, default: false, null: false - end - end - - def down - with_lock_retries do - remove_column :merge_requests, :draft - end - end -end diff --git a/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb b/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb deleted file mode 100644 index a05be71a243..00000000000 --- a/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class MakeSnapshotSegmentIdOptional < ActiveRecord::Migration[6.0] - def up - change_column_null(:analytics_devops_adoption_snapshots, :segment_id, true) - end - - def down - change_column_null(:analytics_devops_adoption_snapshots, :segment_id, false) - end -end diff --git a/db/migrate/20210517144856_require_snapshot_namespace.rb b/db/migrate/20210517144856_require_snapshot_namespace.rb deleted file mode 100644 index ec25c13383f..00000000000 --- a/db/migrate/20210517144856_require_snapshot_namespace.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require Rails.root.join('db', 'post_migrate', '20210430134202_copy_adoption_snapshot_namespace.rb') - -class RequireSnapshotNamespace < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - CopyAdoptionSnapshotNamespace.new.up - - add_not_null_constraint(:analytics_devops_adoption_snapshots, :namespace_id) - end - - def down - remove_not_null_constraint(:analytics_devops_adoption_snapshots, :namespace_id) - end -end diff --git a/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb b/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb deleted file mode 100644 index 1c017a366c8..00000000000 --- a/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultValueToMergeRequestsAuthorApprovalOnProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - change_column_default :projects, :merge_requests_author_approval, false - end - end - - def down - with_lock_retries do - change_column_default :projects, :merge_requests_author_approval, nil - end - end -end diff --git a/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb b/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb deleted file mode 100644 index 7ff0276b4b5..00000000000 --- a/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsMetadataToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds_metadata - COLUMN = :build_id - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end -end diff --git a/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb b/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb deleted file mode 100644 index 2da84301a72..00000000000 --- a/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateUsersWhereTwoFactorAuthRequiredFromGroup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'UpdateUsersWhereTwoFactorAuthRequiredFromGroup' - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 10_000 - INDEX_NAME = 'index_users_require_two_factor_authentication_from_group_false' - - disable_ddl_transaction! - - class User < ActiveRecord::Base - include EachBatch - - self.table_name = 'users' - end - - def up - add_concurrent_index :users, - :require_two_factor_authentication_from_group, - where: 'require_two_factor_authentication_from_group = FALSE', - name: INDEX_NAME - - relation = User.where(require_two_factor_authentication_from_group: false) - - queue_background_migration_jobs_by_range_at_intervals( - relation, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end - - def down - remove_concurrent_index_by_name :users, INDEX_NAME - end -end diff --git a/db/migrate/20210520102039_group_protected_environments_add_column.rb b/db/migrate/20210520102039_group_protected_environments_add_column.rb deleted file mode 100644 index 642e22c5f48..00000000000 --- a/db/migrate/20210520102039_group_protected_environments_add_column.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class GroupProtectedEnvironmentsAddColumn < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - add_column :protected_environments, :group_id, :bigint - change_column_null :protected_environments, :project_id, true - end - - def down - change_column_null :protected_environments, :project_id, false - remove_column :protected_environments, :group_id - end -end diff --git a/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb b/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb deleted file mode 100644 index e154c25b082..00000000000 --- a/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfTaggingsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :taggings - COLUMNS = %i(id taggable_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/20210520133440_backfill_taggings_for_bigint_conversion.rb b/db/migrate/20210520133440_backfill_taggings_for_bigint_conversion.rb deleted file mode 100644 index 778e186eb9c..00000000000 --- a/db/migrate/20210520133440_backfill_taggings_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillTaggingsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :taggings - COLUMNS = %i(id taggable_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100 - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb b/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb deleted file mode 100644 index d255ce844e2..00000000000 --- a/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class DropDevopsAdoptionNamespaceUniqueness < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_analytics_devops_adoption_segments_on_namespace_id' - NEW_INDEX_NAME = 'idx_analytics_devops_adoption_segments_on_namespace_id' - - def up - add_concurrent_index :analytics_devops_adoption_segments, :namespace_id, name: NEW_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_segments, INDEX_NAME - end - - def down - # Clean up duplicated records - execute "DELETE FROM analytics_devops_adoption_segments WHERE id NOT IN (SELECT MIN(id) FROM analytics_devops_adoption_segments GROUP BY namespace_id)" - - add_concurrent_index :analytics_devops_adoption_segments, :namespace_id, name: INDEX_NAME, unique: true - remove_concurrent_index_by_name :analytics_devops_adoption_segments, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb b/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb deleted file mode 100644 index 70775eb3bb5..00000000000 --- a/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfDeploymentsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :deployments - COLUMNS = %i(deployable_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/20210525085325_backfill_deployments_for_bigint_conversion.rb b/db/migrate/20210525085325_backfill_deployments_for_bigint_conversion.rb deleted file mode 100644 index 0795abf19d4..00000000000 --- a/db/migrate/20210525085325_backfill_deployments_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillDeploymentsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :deployments - COLUMNS = %i(deployable_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb b/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb deleted file mode 100644 index 3e8bcf1851a..00000000000 --- a/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfGeoJobArtifactDeletedEventsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :geo_job_artifact_deleted_events - COLUMNS = %i(job_artifact_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/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb b/db/migrate/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb deleted file mode 100644 index c2845760b5c..00000000000 --- a/db/migrate/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillGeoJobArtifactDeletedEventsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :geo_job_artifact_deleted_events - COLUMNS = %i(job_artifact_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb b/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb deleted file mode 100644 index 508ad92f9e5..00000000000 --- a/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddLatestPipelineIdIntoVulnerabilityStatisticsTable < ActiveRecord::Migration[6.0] - def change - add_column :vulnerability_statistics, :latest_pipeline_id, :bigint - end -end diff --git a/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb b/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb deleted file mode 100644 index 3464268a77f..00000000000 --- a/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class CreateCiMinutesAdditionalPacks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :ci_minutes_additional_packs, if_not_exists: true do |t| - t.timestamps_with_timezone - - t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade } - t.date :expires_at, null: true - t.integer :number_of_minutes, null: false - t.text :purchase_xid, null: true - t.text_limit :purchase_xid, 32 - - t.index [:namespace_id, :purchase_xid], name: 'index_ci_minutes_additional_packs_on_namespace_id_purchase_xid' - end - end - - def down - with_lock_retries do - drop_table :ci_minutes_additional_packs - end - end -end diff --git a/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb b/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb deleted file mode 100644 index 51f234166de..00000000000 --- a/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RenameSyncSecurityReportApprovalRulesSidekiqQueue < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - sidekiq_queue_migrate 'sync_security_reports_to_report_approval_rules', to: 'ci_sync_reports_to_report_approval_rules' # rubocop:disable Migration/SidekiqQueueMigrate - end - - def down - sidekiq_queue_migrate 'ci_sync_reports_to_report_approval_rules', to: 'sync_security_reports_to_report_approval_rules' # rubocop:disable Migration/SidekiqQueueMigrate - end -end diff --git a/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb b/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb deleted file mode 100644 index dd11b1e6f11..00000000000 --- a/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToVulnerabilityStatisticsOnLatestPipelineId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_vulnerability_statistics_on_latest_pipeline_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerability_statistics, :latest_pipeline_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_statistics, INDEX_NAME - end -end diff --git a/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb b/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb deleted file mode 100644 index adcac5e2637..00000000000 --- a/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyForLatestPipelineIdToCiPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_statistics, :ci_pipelines, column: :latest_pipeline_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :vulnerability_statistics, :ci_pipelines - end - end -end diff --git a/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb b/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb deleted file mode 100644 index 074bec31160..00000000000 --- a/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddCiDailyPipelineScheduleTriggersToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column(:plan_limits, :ci_daily_pipeline_schedule_triggers, :integer, default: 0, null: false) - end -end diff --git a/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb b/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb deleted file mode 100644 index fe0969c15fb..00000000000 --- a/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class InsertCiDailyPipelineScheduleTriggersPlanLimits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - EVERY_5_MINUTES = (1.day.in_minutes / 5).to_i - EVERY_HOUR = 1.day.in_hours.to_i - - def up - return unless Gitlab.com? - - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'free', EVERY_HOUR) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'bronze', EVERY_5_MINUTES) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'silver', EVERY_5_MINUTES) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'gold', EVERY_5_MINUTES) - end - - def down - return unless Gitlab.com? - - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'free', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'bronze', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'silver', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'gold', 0) - end -end diff --git a/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb b/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb deleted file mode 100644 index 62ccdb6a4fd..00000000000 --- a/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForCadenceIterationsAutomation < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'cadence_create_iterations_automation' - - disable_ddl_transaction! - - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb b/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb deleted file mode 100644 index 5f60a7f25c2..00000000000 --- a/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RenameExperimentSubjectsGroupIdToNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers::V2 - - disable_ddl_transaction! - - def up - rename_column_concurrently :experiment_subjects, :group_id, :namespace_id - end - - def down - undo_rename_column_concurrently :experiment_subjects, :group_id, :namespace_id - end -end diff --git a/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb b/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb deleted file mode 100644 index 9c1cd94dbaa..00000000000 --- a/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDiffMaxLinesToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column(:application_settings, - :diff_max_lines, - :integer, - default: 50000, - null: false) - end -end diff --git a/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb b/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb deleted file mode 100644 index 60b1f74cfd0..00000000000 --- a/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDiffMaxFilesToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column(:application_settings, - :diff_max_files, - :integer, - default: 1000, - null: false) - end -end diff --git a/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb b/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb deleted file mode 100644 index 8fb489ac537..00000000000 --- a/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPreventSharingGroupsOutsideHierarchyToNamespaceSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :namespace_settings, :prevent_sharing_groups_outside_hierarchy, :boolean, null: false, default: false - end - end - - def down - with_lock_retries do - remove_column :namespace_settings, :prevent_sharing_groups_outside_hierarchy - end - end -end diff --git a/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb b/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb deleted file mode 100644 index aaa94b9a231..00000000000 --- a/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateCiJobTokenProjectScopeLinks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :ci_job_token_project_scope_links, if_not_exists: true do |t| - t.belongs_to :source_project, index: false, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } - t.belongs_to :target_project, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } - t.belongs_to :added_by, foreign_key: { to_table: :users, on_delete: :nullify } - t.datetime_with_timezone :created_at, null: false - - t.index [:source_project_id, :target_project_id], unique: true, name: 'i_ci_job_token_project_scope_links_on_source_and_target_project' - end - end - end - - def down - with_lock_retries do - drop_table :ci_job_token_project_scope_links, if_exists: true - end - end -end diff --git a/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb b/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb deleted file mode 100644 index 47e7e2c757d..00000000000 --- a/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ChangeIterationsTitleUniquenessIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_sprints_on_iterations_cadence_id_and_title' - OLD_INDEX_NAME = 'index_sprints_on_group_id_and_title' - - disable_ddl_transaction! - - def up - add_concurrent_index :sprints, [:iterations_cadence_id, :title], name: INDEX_NAME, unique: true - remove_concurrent_index_by_name :sprints, OLD_INDEX_NAME - end - - def down - # noop - # rollback would not work as we can have duplicate records once the unique `index_sprints_on_group_id_and_title` index is removed - end -end diff --git a/db/migrate/20210531053916_rename_instance_statistics_measurements.rb b/db/migrate/20210531053916_rename_instance_statistics_measurements.rb deleted file mode 100644 index 733ca296952..00000000000 --- a/db/migrate/20210531053916_rename_instance_statistics_measurements.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class RenameInstanceStatisticsMeasurements < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - rename_table_safely(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end - - def down - undo_rename_table_safely(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end -end diff --git a/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb b/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb deleted file mode 100644 index 8ddbb528962..00000000000 --- a/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class DefaultEnforceSshKeyExpiration < ActiveRecord::Migration[6.0] - def change - change_column_default(:application_settings, :enforce_ssh_key_expiration, from: false, to: true) - end -end diff --git a/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb b/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb deleted file mode 100644 index c164183fbf8..00000000000 --- a/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class EnableEnforceSshKeyExpiration < ActiveRecord::Migration[6.0] - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - end - - def up - ApplicationSetting.reset_column_information - - ApplicationSetting.where.not(enforce_ssh_key_expiration: true).each do |application_setting| - application_setting.update!(enforce_ssh_key_expiration: true) - end - end -end diff --git a/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb b/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb deleted file mode 100644 index 1109d814ee9..00000000000 --- a/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class GroupProtectedEnvironmentsAddIndexAndConstraint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_protected_environments_on_group_id_and_name' - - disable_ddl_transaction! - - def up - add_concurrent_index :protected_environments, [:group_id, :name], unique: true, - name: INDEX_NAME, where: 'group_id IS NOT NULL' - add_concurrent_foreign_key :protected_environments, :namespaces, column: :group_id, on_delete: :cascade - - add_check_constraint :protected_environments, - "((project_id IS NULL) != (group_id IS NULL))", - :protected_environments_project_or_group_existence - end - - def down - remove_group_protected_environments! - - remove_check_constraint :protected_environments, :protected_environments_project_or_group_existence - remove_foreign_key_if_exists :protected_environments, column: :group_id - remove_concurrent_index_by_name :protected_environments, name: INDEX_NAME - end - - private - - def remove_group_protected_environments! - execute <<-SQL - DELETE FROM protected_environments WHERE group_id IS NOT NULL - SQL - end -end diff --git a/db/migrate/20210601123341_add_running_builds_table.rb b/db/migrate/20210601123341_add_running_builds_table.rb deleted file mode 100644 index 4093619d2c3..00000000000 --- a/db/migrate/20210601123341_add_running_builds_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRunningBuildsTable < ActiveRecord::Migration[6.0] - def up - create_table :ci_running_builds do |t| - t.references :build, index: { unique: true }, null: false, foreign_key: { to_table: :ci_builds, on_delete: :cascade } - t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :runner, index: true, null: false, foreign_key: { to_table: :ci_runners, on_delete: :cascade } - t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } - t.integer :runner_type, limit: 2, null: false - end - end - - def down - drop_table :ci_running_builds - end -end diff --git a/db/migrate/20210601125410_add_runners_created_at_index.rb b/db/migrate/20210601125410_add_runners_created_at_index.rb deleted file mode 100644 index 6a6be6d8480..00000000000 --- a/db/migrate/20210601125410_add_runners_created_at_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRunnersCreatedAtIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_runners, [:created_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_created_at_and_id_desc' - add_concurrent_index :ci_runners, [:created_at, :id], order: { created_at: :desc, id: :desc }, name: 'index_ci_runners_on_created_at_desc_and_id_desc' - end - - def down - remove_concurrent_index :ci_runners, [:created_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_created_at_and_id_desc' - remove_concurrent_index :ci_runners, [:created_at, :id], order: { created_at: :desc, id: :desc }, name: 'index_ci_runners_on_created_at_desc_and_id_desc' - end -end diff --git a/db/migrate/20210601131742_update_web_hook_calls_limit.rb b/db/migrate/20210601131742_update_web_hook_calls_limit.rb deleted file mode 100644 index 6af0facd17d..00000000000 --- a/db/migrate/20210601131742_update_web_hook_calls_limit.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class UpdateWebHookCallsLimit < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - return unless Gitlab.com? - - create_or_update_plan_limit('web_hook_calls', 'free', 120) - end - - def down - return unless Gitlab.com? - - create_or_update_plan_limit('web_hook_calls', 'free', 0) - end -end diff --git a/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb b/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb deleted file mode 100644 index d9793832d8c..00000000000 --- a/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemovePartialIndexForHashedStorageMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - remove_concurrent_index :projects, :id, name: 'index_on_id_partial_with_legacy_storage' - end - - def down - add_concurrent_index :projects, :id, where: 'storage_version < 2 or storage_version IS NULL', name: 'index_on_id_partial_with_legacy_storage' - end -end diff --git a/db/migrate/20210601133459_replace_runners_contacted_at_index.rb b/db/migrate/20210601133459_replace_runners_contacted_at_index.rb deleted file mode 100644 index a0a933721f0..00000000000 --- a/db/migrate/20210601133459_replace_runners_contacted_at_index.rb +++ /dev/null @@ -1,26 +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 ReplaceRunnersContactedAtIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_ci_runners_on_contacted_at' - - def up - add_concurrent_index :ci_runners, [:contacted_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_contacted_at_and_id_desc', using: 'btree' - add_concurrent_index :ci_runners, [:contacted_at, :id], order: { contacted_at: :desc, id: :desc }, name: 'index_ci_runners_on_contacted_at_desc_and_id_desc', using: 'btree' - - remove_concurrent_index_by_name :ci_runners, OLD_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_contacted_at_and_id_desc' - remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_contacted_at_desc_and_id_desc' - - add_concurrent_index :ci_runners, :contacted_at, name: OLD_INDEX_NAME, using: 'btree' - end -end diff --git a/db/migrate/20210602122213_add_upcoming_reconciliations.rb b/db/migrate/20210602122213_add_upcoming_reconciliations.rb deleted file mode 100644 index 90d0013b357..00000000000 --- a/db/migrate/20210602122213_add_upcoming_reconciliations.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddUpcomingReconciliations < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :upcoming_reconciliations do |t| - t.references :namespace, index: { unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.date :next_reconciliation_date, null: false - t.date :display_alert_from, null: false - - t.timestamps_with_timezone - end - end - end - - def down - with_lock_retries do - drop_table :upcoming_reconciliations - end - end -end diff --git a/db/migrate/20210602122233_add_runners_description_index.rb b/db/migrate/20210602122233_add_runners_description_index.rb deleted file mode 100644 index ae779e62f0f..00000000000 --- a/db/migrate/20210602122233_add_runners_description_index.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRunnersDescriptionIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_ci_runners_on_description_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_runners, :description, name: INDEX_NAME, using: :gin, opclass: { description: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb b/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb deleted file mode 100644 index f99790e0eca..00000000000 --- a/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestDiffCommitUsers < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - create_table_with_constraints :merge_request_diff_commit_users, id: :bigint do |t| - t.text :name - t.text :email - - t.text_limit :name, 512 - t.text_limit :email, 512 - - t.index [:name, :email], unique: true - end - - # Names or Emails can be optional, so in some cases one of these may be - # null. But if both are NULL/empty, no row should exist in this table. - add_check_constraint( - :merge_request_diff_commit_users, - "(COALESCE(name, '') != '') OR (COALESCE(email, '') != '')", - :merge_request_diff_commit_users_name_or_email_existence - ) - end - - def down - drop_table :merge_request_diff_commit_users - end -end diff --git a/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb b/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb deleted file mode 100644 index 8cc86c7e73c..00000000000 --- a/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestDiffCommitUserColumns < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - def up - # NOTE: these columns are _not_ indexed, nor do they use foreign keys. - # - # This is deliberate, as creating these indexes on GitLab.com takes a _very_ - # long time. In addition, there's no real need for them either based on how - # this data is used. - # - # For more information, refer to the following: - # - # - https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5038#note_614592881 - # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63669 - add_column(:merge_request_diff_commits, :commit_author_id, :bigint) - add_column(:merge_request_diff_commits, :committer_id, :bigint) - end - - def down - remove_column(:merge_request_diff_commits, :commit_author_id) - remove_column(:merge_request_diff_commits, :committer_id) - end -end diff --git a/db/migrate/20210301200959_init_schema.rb b/db/migrate/20210602155110_init_schema.rb index df68927d79a..971a3e0e2db 100644 --- a/db/migrate/20210301200959_init_schema.rb +++ b/db/migrate/20210602155110_init_schema.rb @@ -4,10 +4,10 @@ class InitSchema < ActiveRecord::Migration[6.0] DOWNTIME = false def up - execute(IO.read("db/init_structure.sql")) + execute(File.read("db/init_structure.sql")) end def down - raise ActiveRecord::IrreversibleMigration, "The initial migration is not revertable" + raise ActiveRecord::IrreversibleMigration, "The initial migration is not able to be reverted." end end diff --git a/db/migrate/20221010191136_add_access_level_to_ci_job_artifacts.rb b/db/migrate/20221010191136_add_access_level_to_ci_job_artifacts.rb new file mode 100644 index 00000000000..d69965ed8ec --- /dev/null +++ b/db/migrate/20221010191136_add_access_level_to_ci_job_artifacts.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAccessLevelToCiJobArtifacts < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :ci_job_artifacts, :accessibility, :integer, default: 0, limit: 2, null: false + end +end diff --git a/db/migrate/20221122210711_add_columns_to_postgres_foreign_keys.rb b/db/migrate/20221122210711_add_columns_to_postgres_foreign_keys.rb new file mode 100644 index 00000000000..bef05e52a3a --- /dev/null +++ b/db/migrate/20221122210711_add_columns_to_postgres_foreign_keys.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +class AddColumnsToPostgresForeignKeys < Gitlab::Database::Migration[2.0] + def up + execute(<<~SQL) + CREATE OR REPLACE VIEW postgres_foreign_keys AS + SELECT + pg_constraint.oid AS oid, + pg_constraint.conname AS name, + constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier, + referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier, + constrained_table.relname::text AS constrained_table_name, + referenced_table.relname::text AS referenced_table_name, + constrained_cols.constrained_columns, + referenced_cols.referenced_columns, + pg_constraint.confdeltype AS on_delete_action, + pg_constraint.coninhcount > 0 as is_inherited + FROM pg_constraint + INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid + INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid + INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid + INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid + CROSS JOIN LATERAL ( + SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) -- must order here so that attributes are in correct order in array + FROM unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx) + INNER JOIN pg_attribute ON pg_attribute.attnum = conkey.attnum AND pg_attribute.attrelid = constrained_table.oid + ) constrained_cols(constrained_columns) + CROSS JOIN LATERAL ( + SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx) + FROM unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx) + INNER JOIN pg_attribute ON pg_attribute.attnum = confkey.attnum AND pg_attribute.attrelid = referenced_table.oid + ) referenced_cols(referenced_columns) + WHERE contype = 'f'; + SQL + end + + def down + execute(<<~SQL) + DROP VIEW IF EXISTS postgres_foreign_keys; + CREATE OR REPLACE VIEW postgres_foreign_keys AS + SELECT + pg_constraint.oid AS oid, + pg_constraint.conname AS name, + constrained_namespace.nspname::text || '.'::text || constrained_table.relname::text AS constrained_table_identifier, + referenced_namespace.nspname::text || '.'::text || referenced_table.relname::text AS referenced_table_identifier + FROM pg_constraint + INNER JOIN pg_class constrained_table ON constrained_table.oid = pg_constraint.conrelid + INNER JOIN pg_class referenced_table ON referenced_table.oid = pg_constraint.confrelid + INNER JOIN pg_namespace constrained_namespace ON constrained_table.relnamespace = constrained_namespace.oid + INNER JOIN pg_namespace referenced_namespace ON referenced_table.relnamespace = referenced_namespace.oid + WHERE contype = 'f'; + SQL + end +end diff --git a/db/migrate/20221204090437_add_category_to_abuse_report.rb b/db/migrate/20221204090437_add_category_to_abuse_report.rb new file mode 100644 index 00000000000..e908f3354bb --- /dev/null +++ b/db/migrate/20221204090437_add_category_to_abuse_report.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddCategoryToAbuseReport < Gitlab::Database::Migration[2.1] + def change + add_column :abuse_reports, :category, :integer, limit: 2, default: 1, null: false + end +end diff --git a/db/migrate/20221209174132_remove_sbom_occurrences_unique_index.rb b/db/migrate/20221209174132_remove_sbom_occurrences_unique_index.rb new file mode 100644 index 00000000000..1bee62b5b1f --- /dev/null +++ b/db/migrate/20221209174132_remove_sbom_occurrences_unique_index.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RemoveSbomOccurrencesUniqueIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_sbom_occurrences_on_ingestion_attributes' + ATTRIBUTES = %i[ + project_id + component_id + component_version_id + source_id + commit_sha + ].freeze + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :sbom_occurrences, name: INDEX_NAME + end + + def down + add_concurrent_index :sbom_occurrences, ATTRIBUTES, unique: true, name: INDEX_NAME + end +end diff --git a/db/migrate/20221209174157_truncate_sbom_occurrences.rb b/db/migrate/20221209174157_truncate_sbom_occurrences.rb new file mode 100644 index 00000000000..e9db6526e2d --- /dev/null +++ b/db/migrate/20221209174157_truncate_sbom_occurrences.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class TruncateSbomOccurrences < Gitlab::Database::Migration[2.1] + def up + # Because existing data in the table violates the new + # uniqueness constraints, we need to remove the non-distinct rows. + # Rather than do an expensive and error-prone batch migration + # to find and remove the duplicates, we'll just remove all records + # from the table. + # + # The `cyclonedx_sbom_ingestion` feature flag should + # be OFF in all environments to avoid having more duplicate records + # added between this migration and the one where the new unqiue index + # is added. + + # 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::Database.gitlab_schemas_for_connection(connection).include?(:gitlab_main) + + execute('TRUNCATE sbom_occurrences') + end + + def down + # no-op + end +end diff --git a/db/migrate/20221212054640_add_reported_from_to_abuse_reports.rb b/db/migrate/20221212054640_add_reported_from_to_abuse_reports.rb new file mode 100644 index 00000000000..701c0fa2e2c --- /dev/null +++ b/db/migrate/20221212054640_add_reported_from_to_abuse_reports.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddReportedFromToAbuseReports < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + unless column_exists?(:abuse_reports, :reported_from_url) + add_column :abuse_reports, :reported_from_url, :text, null: false, default: '' + end + end + + add_text_limit :abuse_reports, :reported_from_url, 512 + end + + def down + with_lock_retries do + remove_column :abuse_reports, :reported_from_url if column_exists?(:abuse_reports, :reported_from_url) + end + end +end diff --git a/db/migrate/20221212192452_add_uuid_column_to_sbom_occurrences.rb b/db/migrate/20221212192452_add_uuid_column_to_sbom_occurrences.rb new file mode 100644 index 00000000000..4b7162d66f1 --- /dev/null +++ b/db/migrate/20221212192452_add_uuid_column_to_sbom_occurrences.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddUuidColumnToSbomOccurrences < Gitlab::Database::Migration[2.1] + def change + add_column :sbom_occurrences, :uuid, :uuid, null: false # rubocop:disable Rails/NotNullColumn + end +end diff --git a/db/migrate/20221212192527_index_sbom_occurrences_on_uuid.rb b/db/migrate/20221212192527_index_sbom_occurrences_on_uuid.rb new file mode 100644 index 00000000000..7dbf6f25ab4 --- /dev/null +++ b/db/migrate/20221212192527_index_sbom_occurrences_on_uuid.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexSbomOccurrencesOnUuid < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_sbom_occurrences_on_uuid' + + disable_ddl_transaction! + + def up + add_concurrent_index :sbom_occurrences, :uuid, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_occurrences, name: INDEX_NAME + end +end diff --git a/db/migrate/20221213105028_add_sync_part_step_2_of_index_namespaces_on_path_for_top_level_non_projects.rb b/db/migrate/20221213105028_add_sync_part_step_2_of_index_namespaces_on_path_for_top_level_non_projects.rb new file mode 100644 index 00000000000..c16cf3dd940 --- /dev/null +++ b/db/migrate/20221213105028_add_sync_part_step_2_of_index_namespaces_on_path_for_top_level_non_projects.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddSyncPartStep2OfIndexNamespacesOnPathForTopLevelNonProjects < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = 'namespaces' + INDEX_NAME = 'index_namespaces_on_path_for_top_level_non_projects' + COLUMN = "lower((path)::text)" + CONDITIONS = "(parent_id IS NULL AND type::text <> 'Project'::text)" + + def up + add_concurrent_index TABLE_NAME, COLUMN, name: INDEX_NAME, where: CONDITIONS + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/migrate/20221214201256_create_user_achievements.rb b/db/migrate/20221214201256_create_user_achievements.rb new file mode 100644 index 00000000000..6e82cd255cd --- /dev/null +++ b/db/migrate/20221214201256_create_user_achievements.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class CreateUserAchievements < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + create_table :user_achievements do |t| + t.references :achievement, + null: false, + index: false, + foreign_key: { on_delete: :cascade } + t.bigint :user_id, + null: false + t.bigint :awarded_by_user_id, + null: true + t.bigint :revoked_by_user_id, + index: true, + null: true + t.timestamps_with_timezone null: false + t.datetime_with_timezone :revoked_at, null: true + t.index 'achievement_id, (revoked_by_user_id IS NULL)', + name: 'index_user_achievements_on_achievement_id_revoked_by_is_null' + t.index 'user_id, (revoked_by_user_id IS NULL)', + name: 'index_user_achievements_on_user_id_revoked_by_is_null' + t.index 'awarded_by_user_id, (revoked_by_user_id IS NULL)', + name: 'index_user_achievements_on_awarded_by_revoked_by_is_null' + end + end + + def down + drop_table :user_achievements + end +end diff --git a/db/migrate/20221214204247_user_achievements_foreign_keys.rb b/db/migrate/20221214204247_user_achievements_foreign_keys.rb new file mode 100644 index 00000000000..d65d3800dab --- /dev/null +++ b/db/migrate/20221214204247_user_achievements_foreign_keys.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class UserAchievementsForeignKeys < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :user_achievements, :users, column: :user_id, on_delete: :cascade + add_concurrent_foreign_key :user_achievements, :users, column: :awarded_by_user_id, on_delete: :nullify + add_concurrent_foreign_key :user_achievements, :users, column: :revoked_by_user_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key :user_achievements, column: :user_id + remove_foreign_key :user_achievements, column: :awarded_by_user_id + remove_foreign_key :user_achievements, column: :revoked_by_user_id + end + end +end diff --git a/db/migrate/20221215210347_partition_pm_package_metadata_tables.rb b/db/migrate/20221215210347_partition_pm_package_metadata_tables.rb new file mode 100644 index 00000000000..ebf2b8395b6 --- /dev/null +++ b/db/migrate/20221215210347_partition_pm_package_metadata_tables.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class PartitionPmPackageMetadataTables < Gitlab::Database::Migration[2.1] + def up + # no-op + # This migration was reverted as part of https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108644 + # 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/migrate/20221219103007_add_name_to_ml_candidates.rb b/db/migrate/20221219103007_add_name_to_ml_candidates.rb new file mode 100644 index 00000000000..2c56279de73 --- /dev/null +++ b/db/migrate/20221219103007_add_name_to_ml_candidates.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true +class AddNameToMlCandidates < Gitlab::Database::Migration[2.1] + def change + add_column :ml_candidates, :name, :text # rubocop:disable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20221219112528_add_text_limit_to_name_on_ml_candidates.rb b/db/migrate/20221219112528_add_text_limit_to_name_on_ml_candidates.rb new file mode 100644 index 00000000000..c8f0de3b826 --- /dev/null +++ b/db/migrate/20221219112528_add_text_limit_to_name_on_ml_candidates.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToNameOnMlCandidates < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :ml_candidates, :name, 255 + end + + def down + remove_text_limit :ml_candidates, :name + end +end diff --git a/db/migrate/20221219135535_add_user_defaults_to_private_profile_to_application_settings.rb b/db/migrate/20221219135535_add_user_defaults_to_private_profile_to_application_settings.rb new file mode 100644 index 00000000000..2770456c46f --- /dev/null +++ b/db/migrate/20221219135535_add_user_defaults_to_private_profile_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddUserDefaultsToPrivateProfileToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column(:application_settings, :user_defaults_to_private_profile, :boolean, default: false, null: false) + end +end diff --git a/db/migrate/20221221134116_create_elastic_group_index_statuses.rb b/db/migrate/20221221134116_create_elastic_group_index_statuses.rb new file mode 100644 index 00000000000..6084b7e9557 --- /dev/null +++ b/db/migrate/20221221134116_create_elastic_group_index_statuses.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateElasticGroupIndexStatuses < Gitlab::Database::Migration[2.1] + def change + create_table :elastic_group_index_statuses, id: false do |t| + t.references :namespace, + primary_key: true, + foreign_key: { on_delete: :cascade }, + index: false, + default: nil + + t.timestamps_with_timezone null: false + t.datetime_with_timezone :wiki_indexed_at + + t.binary :last_wiki_commit + end + end +end diff --git a/db/migrate/20221221171239_rename_amount_used_column.rb b/db/migrate/20221221171239_rename_amount_used_column.rb new file mode 100644 index 00000000000..f25407a85af --- /dev/null +++ b/db/migrate/20221221171239_rename_amount_used_column.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RenameAmountUsedColumn < Gitlab::Database::Migration[2.1] + TRIGGER_NAME = 'sync_projects_amount_used_columns' + def up + rename_column :ci_project_monthly_usages, :amount_used, :tmp_amount_used + rename_column :ci_project_monthly_usages, :new_amount_used, :amount_used + rename_column :ci_project_monthly_usages, :tmp_amount_used, :new_amount_used + + remove_rename_triggers(:ci_project_monthly_usages, TRIGGER_NAME) + install_rename_triggers(:ci_project_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME) + end + + def down + rename_column :ci_project_monthly_usages, :amount_used, :tmp_amount_used + rename_column :ci_project_monthly_usages, :new_amount_used, :amount_used + rename_column :ci_project_monthly_usages, :tmp_amount_used, :new_amount_used + + remove_rename_triggers(:ci_project_monthly_usages, TRIGGER_NAME) + install_rename_triggers(:ci_project_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME) + end +end diff --git a/db/migrate/20221222144954_create_analytics_dashboards_configuration_pointers.rb b/db/migrate/20221222144954_create_analytics_dashboards_configuration_pointers.rb new file mode 100644 index 00000000000..b3df3ea281b --- /dev/null +++ b/db/migrate/20221222144954_create_analytics_dashboards_configuration_pointers.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateAnalyticsDashboardsConfigurationPointers < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + create_table :analytics_dashboards_pointers do |t| + t.belongs_to :namespace, + null: false, + index: { unique: true }, + foreign_key: { to_table: :namespaces, on_delete: :cascade } + t.belongs_to :project, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } + end + end + + def down + drop_table :analytics_dashboards_pointers + end +end diff --git a/db/migrate/20221223114543_add_pwa_icon_to_appearances.rb b/db/migrate/20221223114543_add_pwa_icon_to_appearances.rb new file mode 100644 index 00000000000..9a1711be75d --- /dev/null +++ b/db/migrate/20221223114543_add_pwa_icon_to_appearances.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddPwaIconToAppearances < Gitlab::Database::Migration[2.1] + # rubocop:disable Migration/AddLimitToTextColumns + def up + add_column :appearances, :pwa_icon, :text + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :appearances, :pwa_icon + end +end diff --git a/db/migrate/20221226105323_add_registration_columns_to_ci_runners.rb b/db/migrate/20221226105323_add_registration_columns_to_ci_runners.rb new file mode 100644 index 00000000000..6788f154a5c --- /dev/null +++ b/db/migrate/20221226105323_add_registration_columns_to_ci_runners.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRegistrationColumnsToCiRunners < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :ci_runners, :registration_type, :integer, limit: 1, default: 0, null: false + add_column :ci_runners, :creator_id, :bigint, null: true + end +end diff --git a/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb b/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb new file mode 100644 index 00000000000..e163380533b --- /dev/null +++ b/db/migrate/20221226132038_index_ci_runners_on_creator_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexCiRunnersOnCreatorId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runners_on_creator_id_where_creator_id_not_null' + + def up + add_concurrent_index :ci_runners, :creator_id, where: 'creator_id IS NOT NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/migrate/20221226163203_create_ci_runner_machines.rb b/db/migrate/20221226163203_create_ci_runner_machines.rb new file mode 100644 index 00000000000..21ebeb898f4 --- /dev/null +++ b/db/migrate/20221226163203_create_ci_runner_machines.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class CreateCiRunnerMachines < Gitlab::Database::Migration[2.1] + def change + create_table :ci_runner_machines do |t| + t.belongs_to :runner, index: false, null: false, foreign_key: { to_table: :ci_runners, on_delete: :cascade } + t.integer :executor_type, limit: 2 + t.text :machine_xid, null: false, limit: 64 + t.timestamps_with_timezone null: false + t.datetime_with_timezone :contacted_at + t.text :version, limit: 2048 + t.text :revision, limit: 255 + t.text :platform, limit: 255 + t.text :architecture, limit: 255 + t.text :ip_address, limit: 1024 + + t.index [:runner_id, :machine_xid], unique: true + t.index :version + end + end +end diff --git a/db/migrate/20221227080606_add_text_limit_to_pwa_icon.rb b/db/migrate/20221227080606_add_text_limit_to_pwa_icon.rb new file mode 100644 index 00000000000..66edad4f53e --- /dev/null +++ b/db/migrate/20221227080606_add_text_limit_to_pwa_icon.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToPwaIcon < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_text_limit :appearances, :pwa_icon, 1024 + end + + def down + remove_text_limit :appearances, :pwa_icon + end +end diff --git a/db/migrate/20221227100846_add_allow_registration_token_to_application_settings.rb b/db/migrate/20221227100846_add_allow_registration_token_to_application_settings.rb new file mode 100644 index 00000000000..f6f055ef865 --- /dev/null +++ b/db/migrate/20221227100846_add_allow_registration_token_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAllowRegistrationTokenToApplicationSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :application_settings, :allow_runner_registration_token, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20221227100908_add_allow_registration_token_to_namespace_settings.rb b/db/migrate/20221227100908_add_allow_registration_token_to_namespace_settings.rb new file mode 100644 index 00000000000..46456fcfbdf --- /dev/null +++ b/db/migrate/20221227100908_add_allow_registration_token_to_namespace_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAllowRegistrationTokenToNamespaceSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :namespace_settings, :allow_runner_registration_token, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20221228063845_add_incident_events_to_integrations.rb b/db/migrate/20221228063845_add_incident_events_to_integrations.rb new file mode 100644 index 00000000000..521ffce0724 --- /dev/null +++ b/db/migrate/20221228063845_add_incident_events_to_integrations.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddIncidentEventsToIntegrations < Gitlab::Database::Migration[2.1] + def change + add_column :integrations, :incident_events, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20221228083452_remove_check_constraint_on_chat_names_on_integration.rb b/db/migrate/20221228083452_remove_check_constraint_on_chat_names_on_integration.rb new file mode 100644 index 00000000000..6a75bd1badd --- /dev/null +++ b/db/migrate/20221228083452_remove_check_constraint_on_chat_names_on_integration.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveCheckConstraintOnChatNamesOnIntegration < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'check_2b0a0d0f0f' + + disable_ddl_transaction! + + def up + remove_check_constraint(:chat_names, CONSTRAINT_NAME) + end + + def down + # noop: rollback would not work as we can have records where `integration_id` IS NULL + end +end diff --git a/db/migrate/20221228161214_rename_appearances_short_title_to_pwa_short_name.rb b/db/migrate/20221228161214_rename_appearances_short_title_to_pwa_short_name.rb new file mode 100644 index 00000000000..76dfbb56f65 --- /dev/null +++ b/db/migrate/20221228161214_rename_appearances_short_title_to_pwa_short_name.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RenameAppearancesShortTitleToPwaShortName < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + rename_column_concurrently :appearances, :short_title, :pwa_short_name + end + + def down + undo_rename_column_concurrently :appearances, :short_title, :pwa_short_name + end +end diff --git a/db/migrate/20230104150600_add_machine_id_to_builds_metadata.rb b/db/migrate/20230104150600_add_machine_id_to_builds_metadata.rb new file mode 100644 index 00000000000..838ccbff754 --- /dev/null +++ b/db/migrate/20230104150600_add_machine_id_to_builds_metadata.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddMachineIdToBuildsMetadata < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :p_ci_builds_metadata, :runner_machine_id, :bigint + end +end diff --git a/db/migrate/20230105170414_rename_amount_used_column_on_ci_namespace_monthly_usages_table.rb b/db/migrate/20230105170414_rename_amount_used_column_on_ci_namespace_monthly_usages_table.rb new file mode 100644 index 00000000000..ff59b1e5987 --- /dev/null +++ b/db/migrate/20230105170414_rename_amount_used_column_on_ci_namespace_monthly_usages_table.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class RenameAmountUsedColumnOnCiNamespaceMonthlyUsagesTable < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + TRIGGER_NAME = 'sync_namespaces_amount_used_columns' + def up + rename_column :ci_namespace_monthly_usages, :amount_used, :tmp_amount_used + rename_column :ci_namespace_monthly_usages, :new_amount_used, :amount_used + rename_column :ci_namespace_monthly_usages, :tmp_amount_used, :new_amount_used + + remove_rename_triggers(:ci_namespace_monthly_usages, TRIGGER_NAME) + install_rename_triggers(:ci_namespace_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME) + end + + def down + rename_column :ci_namespace_monthly_usages, :amount_used, :tmp_amount_used + rename_column :ci_namespace_monthly_usages, :new_amount_used, :amount_used + rename_column :ci_namespace_monthly_usages, :tmp_amount_used, :new_amount_used + + remove_rename_triggers(:ci_namespace_monthly_usages, TRIGGER_NAME) + install_rename_triggers(:ci_namespace_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME) + end +end diff --git a/db/migrate/20230106125945_add_user_to_ssh_signatures.rb b/db/migrate/20230106125945_add_user_to_ssh_signatures.rb new file mode 100644 index 00000000000..9e487287b66 --- /dev/null +++ b/db/migrate/20230106125945_add_user_to_ssh_signatures.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddUserToSshSignatures < Gitlab::Database::Migration[2.1] + def up + add_column :ssh_signatures, :user_id, :bigint, if_not_exists: true, null: true + end + + def down + remove_column :ssh_signatures, :user_id, if_exists: true + end +end diff --git a/db/migrate/20230106131659_add_fingerprint_to_ssh_signatures.rb b/db/migrate/20230106131659_add_fingerprint_to_ssh_signatures.rb new file mode 100644 index 00000000000..ba792a1ae43 --- /dev/null +++ b/db/migrate/20230106131659_add_fingerprint_to_ssh_signatures.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddFingerprintToSshSignatures < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_column :ssh_signatures, :key_fingerprint_sha256, :bytea, if_not_exists: true + end + + def down + remove_column :ssh_signatures, :key_fingerprint_sha256, :bytea, if_exists: true + end +end diff --git a/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb b/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb new file mode 100644 index 00000000000..29fee4d7b56 --- /dev/null +++ b/db/migrate/20230106142239_add_config_column_to_ci_runner_machines.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddConfigColumnToCiRunnerMachines < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :ci_runner_machines, :config, :jsonb, default: {}, null: false + end +end diff --git a/db/migrate/20230109095159_add_runner_machines_created_at_index.rb b/db/migrate/20230109095159_add_runner_machines_created_at_index.rb new file mode 100644 index 00000000000..e9ca4851497 --- /dev/null +++ b/db/migrate/20230109095159_add_runner_machines_created_at_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddRunnerMachinesCreatedAtIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runner_machines_on_created_at_and_id_desc' + + def up + add_concurrent_index :ci_runner_machines, [:created_at, :id], order: { id: :desc }, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runner_machines, INDEX_NAME + end +end diff --git a/db/migrate/20230109121313_add_runner_machines_contacted_at_index.rb b/db/migrate/20230109121313_add_runner_machines_contacted_at_index.rb new file mode 100644 index 00000000000..667a4309c51 --- /dev/null +++ b/db/migrate/20230109121313_add_runner_machines_contacted_at_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddRunnerMachinesContactedAtIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runner_machines_on_contacted_at_desc_and_id_desc' + + def up + add_concurrent_index :ci_runner_machines, [:contacted_at, :id], order: { contacted_at: :desc, id: :desc }, + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runner_machines, INDEX_NAME + end +end diff --git a/db/migrate/20230109215921_add_storage_admin_control_columns_to_plan_limits.rb b/db/migrate/20230109215921_add_storage_admin_control_columns_to_plan_limits.rb new file mode 100644 index 00000000000..cf4879e4b89 --- /dev/null +++ b/db/migrate/20230109215921_add_storage_admin_control_columns_to_plan_limits.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddStorageAdminControlColumnsToPlanLimits < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column(:plan_limits, :enforcement_limit, :integer, default: 0, null: false) + add_column(:plan_limits, :notification_limit, :integer, default: 0, null: false) + add_column(:plan_limits, :dashboard_limit_enabled_at, :datetime_with_timezone) + end +end diff --git a/db/migrate/20230110031131_add_uses_legacy_iid_to_test_reports.rb b/db/migrate/20230110031131_add_uses_legacy_iid_to_test_reports.rb new file mode 100644 index 00000000000..e327a4d43a4 --- /dev/null +++ b/db/migrate/20230110031131_add_uses_legacy_iid_to_test_reports.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddUsesLegacyIidToTestReports < Gitlab::Database::Migration[2.1] + def change + add_column :requirements_management_test_reports, :uses_legacy_iid, :boolean, null: false, default: true + end +end diff --git a/db/migrate/20230111092510_add_migrate_projects_to_bulk_import_entities.rb b/db/migrate/20230111092510_add_migrate_projects_to_bulk_import_entities.rb new file mode 100644 index 00000000000..d09a796ba5c --- /dev/null +++ b/db/migrate/20230111092510_add_migrate_projects_to_bulk_import_entities.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddMigrateProjectsToBulkImportEntities < Gitlab::Database::Migration[2.1] + def change + add_column :bulk_import_entities, :migrate_projects, :boolean, null: false, default: true + end +end diff --git a/db/migrate/20230111124512_remove_tmp_index_vulns_on_report_type.rb b/db/migrate/20230111124512_remove_tmp_index_vulns_on_report_type.rb new file mode 100644 index 00000000000..e1254d237ba --- /dev/null +++ b/db/migrate/20230111124512_remove_tmp_index_vulns_on_report_type.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +class RemoveTmpIndexVulnsOnReportType < Gitlab::Database::Migration[2.0] + # Temporary index to perform migration removing invalid vulnerabilities + INDEX_NAME = 'tmp_idx_vulnerabilities_on_id_where_report_type_7_99' + + REPORT_TYPES = { + cluster_image_scanning: 7, + custom: 99 + } + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME + end + + def down + add_concurrent_index :vulnerabilities, :id, + where: "report_type IN (#{REPORT_TYPES.values.join(', ')})", + name: INDEX_NAME + end +end diff --git a/db/migrate/20230111132621_unpartition_pm_package_metadata_tables.rb b/db/migrate/20230111132621_unpartition_pm_package_metadata_tables.rb new file mode 100644 index 00000000000..9fbd04734d3 --- /dev/null +++ b/db/migrate/20230111132621_unpartition_pm_package_metadata_tables.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +class UnpartitionPmPackageMetadataTables < Gitlab::Database::Migration[2.1] + def up + return unless Gitlab.dev_or_test_env? || Gitlab.staging? + + 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.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, + 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.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.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 + + # partitioned tables can't be restored because + # foreign keys to partitioned tables are not supported by Postgres 11 + # https://gitlab.com/gitlab-org/gitlab/-/issues/387761 + def down; end +end diff --git a/db/migrate/20230112014822_add_user_index_and_fk_to_ssh_signatures.rb b/db/migrate/20230112014822_add_user_index_and_fk_to_ssh_signatures.rb new file mode 100644 index 00000000000..31df4b98274 --- /dev/null +++ b/db/migrate/20230112014822_add_user_index_and_fk_to_ssh_signatures.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddUserIndexAndFkToSshSignatures < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ssh_signatures_on_user_id' + + def up + add_concurrent_index :ssh_signatures, :user_id, name: INDEX_NAME + add_concurrent_foreign_key :ssh_signatures, :users, column: :user_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :ssh_signatures, column: :user_id + end + + remove_concurrent_index_by_name :ssh_signatures, INDEX_NAME + end +end diff --git a/db/migrate/20230112104253_add_tmp_index_to_ci_build_runner_session.rb b/db/migrate/20230112104253_add_tmp_index_to_ci_build_runner_session.rb new file mode 100644 index 00000000000..62f202c1ee2 --- /dev/null +++ b/db/migrate/20230112104253_add_tmp_index_to_ci_build_runner_session.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTmpIndexToCiBuildRunnerSession < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :tmp_index_ci_builds_runner_session_on_partition_id_and_id + TABLE_NAME = :ci_builds_runner_session + + def up + return unless Gitlab.com? + + add_concurrent_index( + TABLE_NAME, + [:partition_id, :id], + where: 'partition_id = 101', + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/migrate/20230112104526_add_tmp_index_to_ci_pending_build.rb b/db/migrate/20230112104526_add_tmp_index_to_ci_pending_build.rb new file mode 100644 index 00000000000..3666e03a8b5 --- /dev/null +++ b/db/migrate/20230112104526_add_tmp_index_to_ci_pending_build.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTmpIndexToCiPendingBuild < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :tmp_index_ci_pending_builds_on_partition_id_and_id + TABLE_NAME = :ci_pending_builds + + def up + return unless Gitlab.com? + + add_concurrent_index( + TABLE_NAME, + [:partition_id, :id], + where: 'partition_id = 101', + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/migrate/20230112104636_add_tmp_index_to_ci_running_build.rb b/db/migrate/20230112104636_add_tmp_index_to_ci_running_build.rb new file mode 100644 index 00000000000..66c66cc1cd9 --- /dev/null +++ b/db/migrate/20230112104636_add_tmp_index_to_ci_running_build.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTmpIndexToCiRunningBuild < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :tmp_index_ci_running_builds_on_partition_id_and_id + TABLE_NAME = :ci_running_builds + + def up + return unless Gitlab.com? + + add_concurrent_index( + TABLE_NAME, + [:partition_id, :id], + where: 'partition_id = 101', + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb b/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb deleted file mode 100644 index e04f69f4206..00000000000 --- a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class BackfillNamespaceStatisticsWithWikiSize < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 500 - MIGRATION = 'PopulateNamespaceStatistics' - - disable_ddl_transaction! - - def up - return unless Gitlab.ee? - - groups = exec_query <<~SQL - SELECT group_wiki_repositories.group_id - FROM group_wiki_repositories - SQL - - groups.rows.flatten.in_groups_of(BATCH_SIZE, false).each_with_index do |group_ids, index| - migrate_in(index * DELAY_INTERVAL, MIGRATION, [group_ids, [:wiki_size]]) - end - end - - def down - # No-op - end -end diff --git a/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb b/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb deleted file mode 100644 index 87c7d373329..00000000000 --- a/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ScheduleMigratePagesToZipStorage < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'MigratePagesToZipStorage' - BATCH_SIZE = 10 - BATCH_TIME = 5.minutes - - disable_ddl_transaction! - - def up - # no-op - end -end diff --git a/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb b/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb deleted file mode 100644 index f1d2d80a0f3..00000000000 --- a/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintsToGitlabSubscriptionsNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # This will add the `NOT NULL` constraint WITHOUT validating it - add_not_null_constraint :gitlab_subscriptions, :namespace_id, validate: false - end - - def down - # Down is required as `add_not_null_constraint` is not reversible - remove_not_null_constraint :gitlab_subscriptions, :namespace_id - end -end diff --git a/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb b/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb deleted file mode 100644 index 2250d4c0c8a..00000000000 --- a/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CleanupGitlabSubscriptionsWithNullNamespaceId < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class GitlabSubscription < ActiveRecord::Base - self.table_name = 'gitlab_subscriptions' - end - - def up - # As of today, there is 0 records whose namespace_id is null on GitLab.com. - # And we expect no such records on non GitLab.com instance. - # So this post-migration cleanup script is just for extra safe. - # - # This will be fast on GitLab.com, because: - # - gitlab_subscriptions.count=5021850 - # - namespace_id is indexed, so the query is pretty fast. Try on database-lab, this uses 5.931 ms - GitlabSubscription.where(namespace_id: nil).delete_all - end - - def down - # no-op : can't go back to `NULL` without first dropping the `NOT NULL` constraint - end -end diff --git a/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb b/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb deleted file mode 100644 index 69d99704469..00000000000 --- a/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class UpdateGitlabSubscriptionsStartAtPostEoa < ActiveRecord::Migration[6.0] - UPDATE_BATCH_SIZE = 100 - - disable_ddl_transaction! - - class Plan < ActiveRecord::Base - self.table_name = 'plans' - self.inheritance_column = :_type_disabled - end - - class GitlabSubscription < ActiveRecord::Base - include EachBatch - - self.table_name = 'gitlab_subscriptions' - self.inheritance_column = :_type_disabled - - EOA_ROLLOUT_DATE = '2021-01-26' - - scope :with_plan, -> (from_plan) do - where("start_date >= ? AND hosted_plan_id = ?", EOA_ROLLOUT_DATE, from_plan.id) - end - end - - def up - return unless Gitlab.com? - - silver_plan = Plan.find_by(name: 'silver') - gold_plan = Plan.find_by(name: 'gold') - premium_plan = Plan.find_by(name: 'premium') - ultimate_plan = Plan.find_by(name: 'ultimate') - - # Silver to Premium - update_hosted_plan_for_subscription(from_plan: silver_plan, to_plan: premium_plan) - - # Gold to Ultimate - update_hosted_plan_for_subscription(from_plan: gold_plan, to_plan: ultimate_plan) - end - - def down - # no-op - end - - private - - def update_hosted_plan_for_subscription(from_plan:, to_plan:) - return unless from_plan && to_plan - - GitlabSubscription.with_plan(from_plan).each_batch(of: UPDATE_BATCH_SIZE) do |batch| - batch.update_all(hosted_plan_id: to_plan.id) - end - end -end diff --git a/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb b/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb deleted file mode 100644 index 6553036792c..00000000000 --- a/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class CleanupClusterTokensWithNullName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 1000 - - disable_ddl_transaction! - - class AgentToken < ActiveRecord::Base - include EachBatch - - self.table_name = 'cluster_agent_tokens' - end - - def up - AgentToken.each_batch(of: BATCH_SIZE) do |relation| - relation.where(name: nil).update_all("name = 'agent-token-' || id") - end - end - - def down - # no-op : can't go back to `NULL` without first dropping the `NOT NULL` constraint - end -end diff --git a/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb b/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb deleted file mode 100644 index 78574921fea..00000000000 --- a/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRemoveDuplicateVulnerabilitiesFindings2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'RemoveDuplicateVulnerabilitiesFindings' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 5_000 - - disable_ddl_transaction! - - class VulnerabilitiesFinding < ActiveRecord::Base - include ::EachBatch - self.table_name = "vulnerability_occurrences" - end - - def up - say "Scheduling #{MIGRATION} jobs" - queue_background_migration_jobs_by_range_at_intervals( - VulnerabilitiesFinding, - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb b/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb deleted file mode 100644 index 3a37d8a8510..00000000000 --- a/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - enqueue_partitioning_data_migration :web_hook_logs - end - - def down - cleanup_partitioning_data_migration :web_hook_logs - end -end diff --git a/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb b/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb deleted file mode 100644 index bcf872ded54..00000000000 --- a/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -class SetTraversalIdsForGitlabOrgGroupStaging < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless Gitlab.staging? - - # namespace ID 9970 is gitlab-org on staging. - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = cte.traversal_ids - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - AND namespaces.traversal_ids <> cte.traversal_ids - SQL - end - end - - def down - return unless Gitlab.staging? - - # namespace ID 9970 is gitlab-org on staging. - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = '{}' - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - SQL - end - end -end diff --git a/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb b/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb deleted file mode 100644 index 8cef1f1cc2b..00000000000 --- a/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -class SetTraversalIdsForGitlabOrgGroupCom < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless Gitlab.com? - - # namespace ID 9970 is gitlab-org on .com - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = cte.traversal_ids - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - AND namespaces.traversal_ids <> cte.traversal_ids - SQL - end - end - - def down - return unless Gitlab.com? - - # namespace ID 9970 is gitlab-org on .com - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = '{}' - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - SQL - end - end -end diff --git a/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb b/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb deleted file mode 100644 index 176548be6e6..00000000000 --- a/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddPartialIndexOnCiPipelinesByCancelableStatusAndUsers < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_pipelines_on_user_id_and_id_and_cancelable_status' - INDEX_FILTER_CONDITION = <<~SQL - ((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 - ] - )) - SQL - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipelines, [:user_id, :id], where: INDEX_FILTER_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME - end -end diff --git a/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb b/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb deleted file mode 100644 index 5d31cdb05e6..00000000000 --- a/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class BackfillEventsIdForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :events, :id, batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'events', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump(%w[id id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb b/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb deleted file mode 100644 index b64282fe0d3..00000000000 --- a/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class BackfillPushEventPayloadEventIdForBigintConversion < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :push_event_payloads, :event_id, primary_key: :event_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'push_event_payloads', column_name: 'event_id') - .where(job_arguments: Gitlab::Json.dump(%w[event_id event_id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb b/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb deleted file mode 100644 index c151551ae64..00000000000 --- a/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class SetIterationCadenceAutomaticToFalse < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - ActiveRecord::Base.connection.execute <<~SQL - UPDATE iterations_cadences - SET automatic = FALSE - WHERE iterations_cadences.automatic = TRUE - SQL - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb b/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb deleted file mode 100644 index b77523c3a44..00000000000 --- a/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class ValidateNotNullConstraintOnClusterTokenName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - validate_not_null_constraint :cluster_agent_tokens, :name - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb b/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb deleted file mode 100644 index 96d9f383406..00000000000 --- a/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ValidateNotNullConstraintOnGitlabSubscriptionsNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - validate_not_null_constraint :gitlab_subscriptions, :namespace_id - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb b/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb deleted file mode 100644 index 5816d02561e..00000000000 --- a/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillCleanupForPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - finalize_backfilling_partitioned_table :web_hook_logs - end - - def down - # no op - end -end diff --git a/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb b/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb deleted file mode 100644 index f3da1cc69c4..00000000000 --- a/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexFromVulnerabilitiesTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'temporary_index_vulnerabilities_on_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME - end - - def down - add_concurrent_index :vulnerabilities, :id, where: "state = 2 AND (dismissed_at IS NULL OR dismissed_by_id IS NULL)", name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210329102724_add_new_trail_plans.rb b/db/post_migrate/20210329102724_add_new_trail_plans.rb deleted file mode 100644 index 37c64bbd42d..00000000000 --- a/db/post_migrate/20210329102724_add_new_trail_plans.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -class AddNewTrailPlans < ActiveRecord::Migration[6.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? - - ultimate_trial = Plan.create!(name: 'ultimate_trial', title: 'Ultimate Trial') - premium_trial = Plan.create!(name: 'premium_trial', title: 'Premium Trial') - - create_plan_limits('gold', ultimate_trial) - create_plan_limits('silver', premium_trial) - end - - def down - return unless Gitlab.com? - - Plan.where(name: %w(ultimate_trial premium_trial)).delete_all - end -end diff --git a/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb b/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb deleted file mode 100644 index c384aa25ac4..00000000000 --- a/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class RemoveRecordsWithoutGroupFromWebhooksTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - class WebHook < ActiveRecord::Base - include EachBatch - - self.table_name = 'web_hooks' - end - - class Group < ActiveRecord::Base - self.inheritance_column = :_type_disabled - self.table_name = 'namespaces' - end - - def up - subquery = Group.select(1).where(Group.arel_table[:id].eq(WebHook.arel_table[:group_id])) - - WebHook.each_batch(of: 500, column: :id) do |relation| - relation.where(type: 'GroupHook').where.not('EXISTS (?)', subquery).delete_all - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb b/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb deleted file mode 100644 index fd77d4d7a4b..00000000000 --- a/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class DropFindingFingerprintTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - FINGERPRINT_IDX = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint_sha256 - UNIQ_IDX = :idx_vuln_fingerprints_uniqueness_fingerprint_sha256 - - def up - with_lock_retries do - drop_table :vulnerability_finding_fingerprints - end - end - - def down - with_lock_retries do - create_table :vulnerability_finding_fingerprints do |t| - t.references :finding, - index: true, - null: false, - foreign_key: { to_table: :vulnerability_occurrences, column: :finding_id, on_delete: :cascade } - - t.timestamps_with_timezone null: false - - t.integer :algorithm_type, null: false, limit: 2 - t.binary :fingerprint_sha256, null: false - - t.index %i[finding_id fingerprint_sha256], - name: FINGERPRINT_IDX, - unique: true # only one link should exist between occurrence and the fingerprint - - t.index %i[finding_id algorithm_type fingerprint_sha256], - name: UNIQ_IDX, - unique: true # these should be unique - end - end - end -end diff --git a/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb b/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb deleted file mode 100644 index 7c32fc61711..00000000000 --- a/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -class DropNonPartitionedAuditEvents < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - DOWNTIME = false - - def up - drop_nonpartitioned_archive_table(:audit_events) - end - - def down - execute(<<~SQL) - CREATE TABLE audit_events_archived ( - id integer NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - created_at timestamp without time zone, - ip_address inet, - author_name text, - entity_path text, - target_details text, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_82294106dd CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) - ); - - ALTER TABLE ONLY audit_events_archived ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); - - CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); - CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); - SQL - - with_lock_retries do - create_trigger_to_sync_tables(:audit_events, :audit_events_archived, 'id') - end - end -end diff --git a/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb b/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb deleted file mode 100644 index ee118371fb8..00000000000 --- a/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class MoveContainerRegistryEnabledToProjectFeatures2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - BATCH_SIZE = 21_000 - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include EachBatch - self.table_name = 'projects' - end - - def up - # Superceded by db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb. - - # delete_queued_jobs('MoveContainerRegistryEnabledToProjectFeature') - - # queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE, track_jobs: true) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb b/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb deleted file mode 100644 index a29babca93e..00000000000 --- a/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddSourceAndLevelIndexOnNotificationSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_WITH_SOURCE_LEVEL_USER_NAME = 'index_notification_settings_on_source_and_level_and_user' - INDEX_WITH_SOURCE_NAME = 'index_notification_settings_on_source_id_and_source_type' - INDEX_WITH_USER_NAME = 'index_notification_settings_on_user_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :notification_settings, [:source_id, :source_type, :level, :user_id], name: INDEX_WITH_SOURCE_LEVEL_USER_NAME - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_SOURCE_NAME # Above index expands this index - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_USER_NAME # It is redundant as we already have unique index on (user_id, source_id, source_type) - end - - def down - add_concurrent_index :notification_settings, [:source_id, :source_type], name: INDEX_WITH_SOURCE_NAME - add_concurrent_index :notification_settings, [:user_id], name: INDEX_WITH_USER_NAME - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_SOURCE_LEVEL_USER_NAME - end -end diff --git a/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb b/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb deleted file mode 100644 index 832ba584931..00000000000 --- a/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class RemoveNotesDeleteCascadeTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - CONSTRAINT_NAME = 'fk_timelogs_note_id' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :timelogs, :notes, column: :note_id, on_delete: :nullify, name: CONSTRAINT_NAME - - with_lock_retries do - remove_foreign_key_if_exists :timelogs, :notes, column: :note_id, on_delete: :cascade - end - end - - def down - add_concurrent_foreign_key :timelogs, :notes, column: :note_id, on_delete: :cascade - - with_lock_retries do - remove_foreign_key_if_exists :timelogs, :notes, column: :note_id, on_delete: :nullify, name: CONSTRAINT_NAME - end - end -end diff --git a/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb b/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb deleted file mode 100644 index 5fc5a5b2b6e..00000000000 --- a/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class BackfillTotalTupleCountForBatchedMigrations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration.all.each do |migration| - total_tuple_count = Gitlab::Database::PgClass.for_table(migration.table_name)&.cardinality_estimate - - migration.update(total_tuple_count: total_tuple_count) - end - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration.update_all(total_tuple_count: nil) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210407150240_confirm_support_bot_user.rb b/db/post_migrate/20210407150240_confirm_support_bot_user.rb deleted file mode 100644 index c26ae153128..00000000000 --- a/db/post_migrate/20210407150240_confirm_support_bot_user.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class ConfirmSupportBotUser < ActiveRecord::Migration[6.0] - SUPPORT_BOT_TYPE = 1 - - def up - users = Arel::Table.new(:users) - um = Arel::UpdateManager.new - um.table(users) - .where(users[:user_type].eq(SUPPORT_BOT_TYPE)) - .where(users[:confirmed_at].eq(nil)) - .set([[users[:confirmed_at], Arel::Nodes::NamedFunction.new('COALESCE', [users[:created_at], Arel::Nodes::SqlLiteral.new('NOW()')])]]) - connection.execute(um.to_sql) - end - - def down - # no op - - # The up migration allows for the possibility that the support user might - # have already been manually confirmed. It's not reversible as this data is - # subsequently lost. - end -end diff --git a/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb b/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb deleted file mode 100644 index d20eb5e4ea3..00000000000 --- a/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class IndexMembersOnUserIdSourceIdSourceType < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id_source_id_source_type' - - def up - add_concurrent_index(:members, [:user_id, :source_id, :source_type], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:members, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb b/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb deleted file mode 100644 index 3f330e44408..00000000000 --- a/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveMembersIndexOnUserId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id' - - def up - remove_concurrent_index_by_name(:members, INDEX_NAME) - end - - def down - add_concurrent_index(:members, :user_id, name: INDEX_NAME) - end -end diff --git a/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb b/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb deleted file mode 100644 index 697b9f9cbf7..00000000000 --- a/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPackagesMavenMetadataPath < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_packages_maven_metadata_on_path' - - def up - add_concurrent_index :packages_maven_metadata, :path, name: INDEX_NAME - end - - def down - remove_concurrent_index :packages_maven_metadata, :path, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb b/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb deleted file mode 100644 index 6453993bd51..00000000000 --- a/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddPartitionedWebHookLogFk < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_foreign_key :web_hook_logs_part_0c5294f417, - :web_hooks, - column: :web_hook_id, - on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :web_hook_logs_part_0c5294f417, column: :web_hook_id - end - end -end diff --git a/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb b/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb deleted file mode 100644 index 0377df7a46b..00000000000 --- a/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RescheduleArtifactExpiryBackfillAgain < ActiveRecord::Migration[6.0] - # This migration has been disabled as it was causing a regression bug for self instances - # preventing artifact deletion, see https://gitlab.com/gitlab-org/gitlab/-/issues/355955 - - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb b/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb deleted file mode 100644 index fb379d48b2a..00000000000 --- a/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class IndexMembersOnUserIdAccessLevelRequestedAtIsNull < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id_and_access_level_requested_at_is_null' - - def up - add_concurrent_index(:members, [:user_id, :access_level], where: 'requested_at IS NULL', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:members, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb b/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb deleted file mode 100644 index 8fcaeb3fb04..00000000000 --- a/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildNeedsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_build_needs, :build_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_build_needs', column_name: 'build_id') - .where(job_arguments: Gitlab::Json.dump(%w[build_id build_id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb b/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb deleted file mode 100644 index f63d7c5138b..00000000000 --- a/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class MoveContainerRegistryEnabledToProjectFeatures3 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 21_000 - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - def up - # Delete any existing jobs from the queue - delete_queued_jobs(MIGRATION) - - # Delete existing rows in background_migration_jobs table - bg_migration_job_class = define_model('background_migration_jobs') - bg_migration_job_class.where(class_name: MIGRATION).delete_all - - batchable_project_class = define_batchable_model('projects') - queue_background_migration_jobs_by_range_at_intervals(batchable_project_class, MIGRATION, 2.minutes, batch_size: BATCH_SIZE, track_jobs: true) - end - - def down - # no-op - end - - private - - def define_model(table_name) - Class.new(ActiveRecord::Base) do - self.table_name = table_name - self.inheritance_column = :_type_disabled - end - end -end diff --git a/db/post_migrate/20210420103955_remove_hipchat_service_records.rb b/db/post_migrate/20210420103955_remove_hipchat_service_records.rb deleted file mode 100644 index 5ad34cfad22..00000000000 --- a/db/post_migrate/20210420103955_remove_hipchat_service_records.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class RemoveHipchatServiceRecords < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class Service < ActiveRecord::Base - include EachBatch - - self.table_name = 'services' - end - - def up - Service.each_batch(of: 100_000, column: :id) do |relation| - relation.delete_by(type: 'HipchatService') - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb b/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb deleted file mode 100644 index 0c68834f723..00000000000 --- a/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class BackfillConversionOfCiJobArtifacts < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_job_artifacts, %i(id job_id), batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_job_artifacts', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump([%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb b/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb deleted file mode 100644 index 0f6cf970778..00000000000 --- a/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateJiraTrackerDataDeploymentTypeBasedOnUrl < ActiveRecord::Migration[6.0] - def up - # no-op (being re-run in 20220324152945_update_jira_tracker_data_deployment_type_based_on_url.rb) - # due to this migration causing this issue: https://gitlab.com/gitlab-org/gitlab/-/issues/336849 - # The migration is rescheduled in - # db/post_migrate/20220725150127_update_jira_tracker_data_deployment_type_based_on_url.rb - # Related discussion: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82103#note_862401816 - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb b/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb deleted file mode 100644 index 3c6f2385f1d..00000000000 --- a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiSourcesPipelinesSourceJobIdForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_sources_pipelines, :source_job_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_sources_pipelines', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump([%w[source_job_id], %w[source_job_id_convert_to_bigint]])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb b/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb deleted file mode 100644 index 43ab965d79c..00000000000 --- a/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RemoveProxySettingsToJiraTrackerData < ActiveRecord::Migration[6.0] - def change - remove_column :jira_tracker_data, :encrypted_proxy_address, :text - remove_column :jira_tracker_data, :encrypted_proxy_address_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_port, :text - remove_column :jira_tracker_data, :encrypted_proxy_port_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_username, :text - remove_column :jira_tracker_data, :encrypted_proxy_username_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_password, :text - remove_column :jira_tracker_data, :encrypted_proxy_password_iv, :text - end -end diff --git a/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb b/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb deleted file mode 100644 index 8199da937d3..00000000000 --- a/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDropInvalidVulnerabilities < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - MIGRATION = 'DropInvalidVulnerabilities' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 10_000 - - disable_ddl_transaction! - - def up - say "Scheduling #{MIGRATION} jobs" - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('vulnerabilities'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb b/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb deleted file mode 100644 index fd071ec9a1a..00000000000 --- a/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - TABLE = :ci_builds - COLUMNS = %i(id stage_id).freeze - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb b/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb deleted file mode 100644 index 0e85fb40a36..00000000000 --- a/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences2 < ActiveRecord::Migration[6.0] - def up - # no-op - # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb b/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb deleted file mode 100644 index 7e11d38868b..00000000000 --- a/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildTraceChunksForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_build_trace_chunks - COLUMNS = %i(build_id) - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb b/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb deleted file mode 100644 index fa0420fe426..00000000000 --- a/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsRunnerSessionForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_builds_runner_session - COLUMNS = %i(build_id) - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb b/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb deleted file mode 100644 index 13b802f7cb4..00000000000 --- a/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateTimelogsProjectId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 50_000 - DELAY_INTERVAL = 2.minutes - MIGRATION = 'UpdateTimelogsProjectId' - - disable_ddl_transaction! - - class Timelog < ActiveRecord::Base - include EachBatch - - self.table_name = 'timelogs' - self.inheritance_column = :_type_disabled - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Timelog.all, - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb b/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb deleted file mode 100644 index 50785fa94f8..00000000000 --- a/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddNewIssuesIndexForRelativePosition < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'idx_issues_on_project_id_and_rel_asc_and_id' - - def up - add_concurrent_index :issues, [:project_id, :relative_position, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:issues, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb deleted file mode 100644 index 340dceda254..00000000000 --- a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_build_trace_sections - COLUMN = :build_id - - def up - # No-op to disable the migration: - # backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100, primary_key: COLUMN - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN, primary_key: COLUMN - end -end diff --git a/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb b/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb deleted file mode 100644 index ffdd84582cb..00000000000 --- a/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveObsoleteSegmentsField < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_column :analytics_devops_adoption_segments, :name - end - end - - def down - add_column :analytics_devops_adoption_segments, :name, :text - add_text_limit :analytics_devops_adoption_segments, :name, 255 - end -end diff --git a/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb b/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb deleted file mode 100644 index d0a72ff2c43..00000000000 --- a/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CopyAdoptionSnapshotNamespace < ActiveRecord::Migration[6.0] - def up - execute <<-SQL - UPDATE analytics_devops_adoption_snapshots snapshots - SET namespace_id = segments.namespace_id - FROM analytics_devops_adoption_segments segments - WHERE snapshots.namespace_id IS NULL AND segments.id = snapshots.segment_id - SQL - end - - def down - execute 'UPDATE analytics_devops_adoption_snapshots SET namespace_id = NULL' - end -end diff --git a/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb b/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb deleted file mode 100644 index 04f454bea37..00000000000 --- a/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CopyAdoptionSegmentsNamespace < ActiveRecord::Migration[6.0] - def up - execute <<-SQL - UPDATE analytics_devops_adoption_segments SET display_namespace_id = namespace_id - WHERE display_namespace_id IS NULL - SQL - end - - def down - execute 'UPDATE analytics_devops_adoption_segments SET display_namespace_id = NULL' - end -end diff --git a/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb b/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb deleted file mode 100644 index 81fe65c1945..00000000000 --- a/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreatePartialCoveringIndexForPendingBuilds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - EXISTING_INDEX = 'index_ci_builds_runner_id_pending' - NEW_INDEX = 'index_ci_builds_runner_id_pending_covering' - - def up - disable_statement_timeout do - execute "CREATE INDEX CONCURRENTLY #{NEW_INDEX} ON ci_builds (runner_id, id) INCLUDE (project_id) WHERE status = 'pending' AND type = 'Ci::Build'" unless index_exists_by_name?(:ci_builds, NEW_INDEX) - end - - remove_concurrent_index_by_name :ci_builds, EXISTING_INDEX - end - - def down - add_concurrent_index :ci_builds, :runner_id, where: "status = 'pending' AND type = 'Ci::Build'", name: EXISTING_INDEX - - remove_concurrent_index_by_name :ci_builds, NEW_INDEX - end -end diff --git a/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb b/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb deleted file mode 100644 index 151b0f64e80..00000000000 --- a/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesIdParentIdInversePartialIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_namespaces_id_parent_id_is_not_null' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :id, where: 'parent_id IS NOT NULL', name: NAME - end - - def down - remove_concurrent_index :namespaces, :id, name: NAME - end -end diff --git a/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb b/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb deleted file mode 100644 index 5ae80c1da80..00000000000 --- a/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class ScheduleBackfillTraversalIds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - ROOTS_MIGRATION = 'BackfillNamespaceTraversalIdsRoots' - CHILDREN_MIGRATION = 'BackfillNamespaceTraversalIdsChildren' - DOWNTIME = false - BATCH_SIZE = 1_000 - SUB_BATCH_SIZE = 100 - DELAY_INTERVAL = 2.minutes - - disable_ddl_transaction! - - def up - # Personal namespaces and top-level groups - final_delay = queue_background_migration_jobs_by_range_at_intervals( - ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots::Namespace.base_query, - ROOTS_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - other_job_arguments: [SUB_BATCH_SIZE], - track_jobs: true - ) - final_delay += DELAY_INTERVAL - - # Subgroups - queue_background_migration_jobs_by_range_at_intervals( - ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren::Namespace.base_query, - CHILDREN_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - initial_delay: final_delay, - other_job_arguments: [SUB_BATCH_SIZE], - track_jobs: true - ) - end -end diff --git a/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb b/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb deleted file mode 100644 index 0d807df614c..00000000000 --- a/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryIndexForProjectTopicsToTaggings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project_and_tags' - INDEX_CONDITION = "taggable_type = 'Project' AND context = 'tags'" - - disable_ddl_transaction! - - def up - # this index is used in 20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :taggings, INDEX_NAME - end -end diff --git a/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb b/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb deleted file mode 100644 index 25d23b771d5..00000000000 --- a/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class ScheduleMigrateProjectTaggingsContextFromTagsToTopics < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 30_000 - DELAY_INTERVAL = 2.minutes - MIGRATION = 'MigrateProjectTaggingsContextFromTagsToTopics' - - disable_ddl_transaction! - - class Tagging < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'taggings' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Tagging.where(taggable_type: 'Project', context: 'tags'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - end -end diff --git a/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb b/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb deleted file mode 100644 index 09886b85571..00000000000 --- a/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDropInvalidVulnerabilities2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'DropInvalidVulnerabilities' - 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('vulnerabilities'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb b/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb deleted file mode 100644 index b43abab2a96..00000000000 --- a/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryPackageIndexForNugetDataMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_packages_on_id_where_nuget_default_temp_package' - INDEX_CONDITION = "package_type = 4 AND name = 'NuGet.Temporary.Package' AND status = 0" - - disable_ddl_transaction! - - def up - # this index is used in 20210513155546_backfill_nuget_temporary_packages_to_processing_status - add_concurrent_index :packages_packages, :id, where: INDEX_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :packages_packages, INDEX_NAME - end -end diff --git a/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb b/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb deleted file mode 100644 index 8124f94b519..00000000000 --- a/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class BackfillNugetTemporaryPackagesToProcessingStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - class Package < ActiveRecord::Base - include EachBatch - - self.table_name = 'packages_packages' - - scope :nuget_temporary_packages, -> do - # 4 is nuget package type, 0 is default status - where(package_type: 4, name: 'NuGet.Temporary.Package', status: 0) - end - end - - def up - Package.nuget_temporary_packages.each_batch(of: 100) do |batch| - # 2 is processing status - batch.update_all(status: 2) - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb b/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb deleted file mode 100644 index eb0abba5112..00000000000 --- a/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryPackageIndexForNugetDataMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_packages_on_id_where_nuget_default_temp_package' - INDEX_CONDITION = "package_type = 4 AND name = 'NuGet.Temporary.Package' AND status = 0" - - disable_ddl_transaction! - - def up - # this index was used in 20210513155546_backfill_nuget_temporary_packages_to_processing_status - remove_concurrent_index_by_name :packages_packages, INDEX_NAME - end - - def down - add_concurrent_index :packages_packages, :id, where: INDEX_CONDITION, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb b/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb deleted file mode 100644 index 665d274a0ee..00000000000 --- a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class CleanupMoveContainerRegistryEnabledToProjectFeature < ActiveRecord::Migration[6.0] - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - def up - Gitlab::BackgroundMigration.steal(MIGRATION) - - bg_migration_job_class = define_background_migration_jobs_class - bg_migration_job_class.where(class_name: MIGRATION, status: bg_migration_job_class.statuses['pending']).each do |job| - Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature.new.perform(*job.arguments) - end - - bg_migration_job_class.where(class_name: MIGRATION).delete_all - end - - def down - # no-op - end - - private - - def define_background_migration_jobs_class - Class.new(ActiveRecord::Base) do - self.table_name = 'background_migration_jobs' - self.inheritance_column = :_type_disabled - - enum status: { - pending: 0, - succeeded: 1 - } - end - end -end diff --git a/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb b/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb deleted file mode 100644 index 76e4a0a95bb..00000000000 --- a/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class ScheduleCleanupOrphanedLfsObjectsProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'CleanupOrphanedLfsObjectsProjects' - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 50_000 - - disable_ddl_transaction! - - class LfsObjectsProject < ActiveRecord::Base - self.table_name = 'lfs_objects_projects' - - include ::EachBatch - end - - def up - queue_background_migration_jobs_by_range_at_intervals(LfsObjectsProject, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end - - def down - # NOOP - end -end diff --git a/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb b/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb deleted file mode 100644 index bfd09653695..00000000000 --- a/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexForProjectTopicsToTaggings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project_and_tags' - INDEX_CONDITION = "taggable_type = 'Project' AND context = 'tags'" - - disable_ddl_transaction! - - def up - # this index was used in 20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics - remove_concurrent_index_by_name :taggings, INDEX_NAME - end - - def down - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb b/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb deleted file mode 100644 index 6d21945af00..00000000000 --- a/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class BackfillClustersIntegrationElasticStackEnabled < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - ApplicationRecord.connection.execute(<<~SQL.squish) - INSERT INTO clusters_integration_elasticstack( - cluster_id, - enabled, - chart_version, - created_at, - updated_at - ) - SELECT - cluster_id, - true, - version, - TIMEZONE('UTC', NOW()), - TIMEZONE('UTC', NOW()) - FROM clusters_applications_elastic_stacks - WHERE status IN (3, 11) - ON CONFLICT(cluster_id) DO UPDATE SET - enabled = true, - updated_at = TIMEZONE('UTC', NOW()) - SQL - end - - def down - # Irreversible - end -end diff --git a/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb b/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb deleted file mode 100644 index 8583f8541c7..00000000000 --- a/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDisableExpirationPoliciesLinkedToNoContainerImages < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 30_000 - DELAY = 2.minutes.freeze - DOWNTIME = false - MIGRATION = 'DisableExpirationPoliciesLinkedToNoContainerImages' - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('container_expiration_policies').where(enabled: true), - MIGRATION, - DELAY, - batch_size: BATCH_SIZE, - track_jobs: false, - primary_column_name: :project_id - ) - end - - def down - # this migration is irreversible - - # we can't accuretaly know which policies were previously enabled during the background migration - end -end diff --git a/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb b/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb deleted file mode 100644 index 6cd9b1173b6..00000000000 --- a/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -class BackfillClustersIntegrationPrometheusEnabled < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - ApplicationRecord.connection.execute(<<~SQL.squish) - WITH executed_at AS (VALUES (TIMEZONE('UTC', NOW()))) - INSERT INTO clusters_integration_prometheus( - cluster_id, - enabled, - encrypted_alert_manager_token, - encrypted_alert_manager_token_iv, - created_at, - updated_at - ) - SELECT - cluster_id, - true, - encrypted_alert_manager_token, - encrypted_alert_manager_token_iv, - (table executed_at), - (table executed_at) - FROM clusters_applications_prometheus - WHERE status IN ( - 3, /* installed */ - 11 /* externally installed */ - ) - ON CONFLICT(cluster_id) DO UPDATE SET - enabled = true, - encrypted_alert_manager_token = EXCLUDED.encrypted_alert_manager_token, - encrypted_alert_manager_token_iv = EXCLUDED.encrypted_alert_manager_token_iv, - updated_at = (table executed_at) - SQL - end - - def down - # Irreversible - end -end diff --git a/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb b/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb deleted file mode 100644 index 39dd78975da..00000000000 --- a/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsMetadataForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_builds_metadata - COLUMN = :build_id - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100 - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN - end -end diff --git a/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb b/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb deleted file mode 100644 index f972815cf67..00000000000 --- a/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: true - -class BackfillEscalationPoliciesForOncallSchedules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - # Creates a single new escalation policy for projects which have - # existing on-call schedules. Only one schedule is expected - # per project, but it is possible to have multiple. - # - # An escalation rule is created for each existing schedule, - # configured to immediately notify the schedule of an incoming - # alert payload unless the alert has already been acknowledged. - # For projects with multiple schedules, the name of the first saved - # schedule will be used for the policy's description. - # - # Skips projects which already have escalation policies & schedules. - # - # EX) - # For these existing records: - # Project #3 - # IncidentManagement::OncallSchedules #13 - # project_id: 3 - # name: 'Awesome Schedule' - # description: null - # IncidentManagement::OncallSchedules #14 - # project_id: 3 - # name: '2ndary sched' - # description: 'Backup on-call' - # - # These will be inserted: - # EscalationPolicy #1 - # project_id: 3 - # name: 'On-call Escalation Policy' - # description: 'Immediately notify Awesome Schedule' - # EscalationRule #1 - # policy_id: 1, - # oncall_schedule_id: 13 - # status: 1 # Acknowledged status - # elapsed_time_seconds: 0 - # EscalationRule #2 - # policy_id: 1, - # oncall_schedule_id: 14 - # status: 1 # Acknowledged status - # elapsed_time_seconds: 0 - def up - ApplicationRecord.connection.exec_query(<<~SQL.squish) - WITH new_escalation_policies AS ( - INSERT INTO incident_management_escalation_policies ( - project_id, - name, - description - ) - SELECT - DISTINCT ON (project_id) project_id, - 'On-call Escalation Policy', - CONCAT('Immediately notify ', name) - FROM incident_management_oncall_schedules - WHERE project_id NOT IN ( - SELECT DISTINCT project_id - FROM incident_management_escalation_policies - ) - ORDER BY project_id, id - RETURNING id, project_id - ) - - INSERT INTO incident_management_escalation_rules ( - policy_id, - oncall_schedule_id, - status, - elapsed_time_seconds - ) - SELECT - new_escalation_policies.id, - incident_management_oncall_schedules.id, - 1, - 0 - FROM new_escalation_policies - INNER JOIN incident_management_oncall_schedules - ON new_escalation_policies.project_id = incident_management_oncall_schedules.project_id - SQL - end - - # There is no way to distinguish between policies created - # via the backfill or as a result of a user creating a new - # on-call schedule. - def down - # no-op - end -end diff --git a/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb b/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb deleted file mode 100644 index 68bc82059bc..00000000000 --- a/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -class BackfillPkConversionForSelfManaged < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - CONVERSIONS = [ - { table: :events, columns: %i(id), sub_batch_size: 500 }, - { table: :push_event_payloads, columns: %i(event_id), sub_batch_size: 2500, primary_key: :event_id }, - { table: :ci_job_artifacts, columns: %i(id job_id), sub_batch_size: 2000 }, - { table: :ci_sources_pipelines, columns: %i(source_job_id), sub_batch_size: 100 }, - { table: :ci_build_needs, columns: %i(build_id), sub_batch_size: 1000 }, - { table: :ci_builds, columns: %i(id stage_id), sub_batch_size: 250 }, - { table: :ci_builds_runner_session, columns: %i(build_id), sub_batch_size: 5000 }, - { table: :ci_build_trace_chunks, columns: %i(build_id), sub_batch_size: 1000 } - ] - - def up - return unless should_run? - - CONVERSIONS.each do |conversion| - backfill_conversion_of_integer_to_bigint( - conversion[:table], conversion[:columns], - sub_batch_size: conversion[:sub_batch_size], primary_key: conversion.fetch(:primary_key, :id) - ) - end - end - - def down - return unless should_run? - - CONVERSIONS.each do |conversion| - revert_backfill_conversion_of_integer_to_bigint( - conversion[:table], conversion[:columns], - primary_key: conversion.fetch(:primary_key, :id) - ) - end - end - - private - - def should_run? - !Gitlab.com? - end -end diff --git a/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb b/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb deleted file mode 100644 index 59b41dd2008..00000000000 --- a/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CleanUpPendingBuildsTable < ActiveRecord::Migration[6.0] - include ::Gitlab::Database::DynamicModelHelpers - - BATCH_SIZE = 1000 - - disable_ddl_transaction! - - def up - return unless Gitlab.dev_or_test_env? || Gitlab.com? - - each_batch_range('ci_pending_builds', connection: connection, of: BATCH_SIZE) do |min, max| - execute <<~SQL - DELETE FROM ci_pending_builds - USING ci_builds - WHERE ci_builds.id = ci_pending_builds.build_id - AND ci_builds.status != 'pending' - AND ci_builds.type = 'Ci::Build' - AND ci_pending_builds.id BETWEEN #{min} AND #{max} - SQL - end - end - - def down - # noop - end -end diff --git a/db/post_migrate/20210526160133_remove_segment_selections_table.rb b/db/post_migrate/20210526160133_remove_segment_selections_table.rb deleted file mode 100644 index 02e981b40ba..00000000000 --- a/db/post_migrate/20210526160133_remove_segment_selections_table.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class RemoveSegmentSelectionsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - drop_table :analytics_devops_adoption_segment_selections - end - - def down - create_table :analytics_devops_adoption_segment_selections do |t| - t.references :segment, index: { name: 'index_on_segment_selections_segment_id' }, null: false, foreign_key: { to_table: :analytics_devops_adoption_segments, on_delete: :cascade } - t.bigint :group_id - t.bigint :project_id - t.index [:group_id, :segment_id], unique: true, name: 'index_on_segment_selections_group_id_segment_id' - t.index [:project_id, :segment_id], unique: true, name: 'index_on_segment_selections_project_id_segment_id' - - t.timestamps_with_timezone - end - add_concurrent_foreign_key(:analytics_devops_adoption_segment_selections, :projects, column: :project_id, on_delete: :cascade) - add_concurrent_foreign_key(:analytics_devops_adoption_segment_selections, :namespaces, column: :group_id, on_delete: :cascade) - add_check_constraint :analytics_devops_adoption_segment_selections, '(project_id != NULL AND group_id IS NULL) OR (group_id != NULL AND project_id IS NULL)', 'segment_selection_project_id_or_group_id_required' - end -end diff --git a/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb b/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb deleted file mode 100644 index 8ff0e306ad5..00000000000 --- a/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillDraftStatusOnMergeRequests < ActiveRecord::Migration[6.0] - # include Gitlab::Database::MigrationHelpers - - # Marking these as no-op as the original contents caused timeouts on - # staging. Removing the code here per - # #https://docs.gitlab.com/ee/development/deleting_migrations.html#how-to-disable-a-data-migration - # => - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb b/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb deleted file mode 100644 index 6dec99c8acd..00000000000 --- a/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CleanUpRenameExperimentSubjectsGroupIdToNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers::V2 - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :experiment_subjects, :group_id, :namespace_id - end - - def down - undo_cleanup_concurrent_column_rename :experiment_subjects, :group_id, :namespace_id - end -end diff --git a/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb b/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb deleted file mode 100644 index 7aac4446c0c..00000000000 --- a/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class FinalizeRenameInstanceStatisticsMeasurements < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - finalize_table_rename(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end - - def down - undo_finalize_table_rename(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end -end diff --git a/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb b/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb deleted file mode 100644 index 85302ee1d20..00000000000 --- a/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class FixTotalStageInVsa < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TOTAL_STAGE = 'Total' - - class GroupStage < ActiveRecord::Base - include EachBatch - - self.table_name = 'analytics_cycle_analytics_group_stages' - end - - def up - GroupStage.reset_column_information - - GroupStage.each_batch(of: 100) do |relation| - relation.where(name: TOTAL_STAGE, custom: false).update_all(custom: true) - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20211004120135_schedule_add_primary_email_to_emails_if_user_confirmed.rb b/db/post_migrate/20211004120135_schedule_add_primary_email_to_emails_if_user_confirmed.rb deleted file mode 100644 index d7b213b384a..00000000000 --- a/db/post_migrate/20211004120135_schedule_add_primary_email_to_emails_if_user_confirmed.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class ScheduleAddPrimaryEmailToEmailsIfUserConfirmed < Gitlab::Database::Migration[1.0] - INTERVAL = 2.minutes.to_i - BATCH_SIZE = 10_000 - MIGRATION = 'AddPrimaryEmailToEmailsIfUserConfirmed' - - disable_ddl_transaction! - - class User < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'users' - self.inheritance_column = :_type_disabled - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - User, - MIGRATION, - INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # intentionally blank - end -end diff --git a/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb b/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb deleted file mode 100644 index 14f6c751e4d..00000000000 --- a/db/post_migrate/20211206162601_cleanup_after_add_primary_email_to_emails_if_user_confirmed.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -class CleanupAfterAddPrimaryEmailToEmailsIfUserConfirmed < Gitlab::Database::Migration[1.0] - disable_ddl_transaction! - - MIGRATION_NAME = 'AddPrimaryEmailToEmailsIfUserConfirmed' - BATCH_SIZE = 10_000 - - # Stubbed class to access the User table - class User < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'users' - self.inheritance_column = :_type_disabled - - scope :confirmed, -> { where.not(confirmed_at: nil) } - - has_many :emails - end - - # Stubbed class to access the Emails table - class Email < ActiveRecord::Base - self.table_name = 'emails' - self.inheritance_column = :_type_disabled - - belongs_to :user - end - - def up - finalize_background_migration(MIGRATION_NAME) - - # Select confirmed users that do not have their primary email in the emails table, - # and create the email record. There should be none if the background migration - # completed, but in case there is any leftover, we deal with it synchronously. - not_exists_condition = 'NOT EXISTS (SELECT 1 FROM emails WHERE emails.email = users.email AND emails.user_id = users.id)' - - User.confirmed.each_batch(of: BATCH_SIZE) do |user_batch| - user_batch.select(:id, :email, :confirmed_at).where(not_exists_condition).each do |user| - current_time = Time.now.utc - - begin - Email.create( - user_id: user.id, - email: user.email, - confirmed_at: user.confirmed_at, - created_at: current_time, - updated_at: current_time - ) - rescue StandardError => error - Gitlab::AppLogger.error("Could not add primary email #{user.email} to emails for user with ID #{user.id} due to #{error}") - end - end - end - end - - def down - # Intentionally left blank - end -end diff --git a/db/post_migrate/20220826152430_remove_container_repository_deprecated_geo_fields.rb b/db/post_migrate/20220826152430_remove_container_repository_deprecated_geo_fields.rb new file mode 100644 index 00000000000..f5cb2be4ebe --- /dev/null +++ b/db/post_migrate/20220826152430_remove_container_repository_deprecated_geo_fields.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class RemoveContainerRepositoryDeprecatedGeoFields < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_column :geo_event_log, :container_repository_updated_event_id, :bigint + end + end + + def down + with_lock_retries do + unless column_exists?(:geo_event_log, :container_repository_updated_event_id) + add_column(:geo_event_log, :container_repository_updated_event_id, :bigint) + end + end + + add_concurrent_foreign_key :geo_event_log, :geo_container_repository_updated_events, + column: :container_repository_updated_event_id, + name: 'fk_6ada82d42a', + on_delete: :cascade + + add_concurrent_index :geo_event_log, + :container_repository_updated_event_id, + name: 'index_geo_event_log_on_container_repository_updated_event_id' + end +end diff --git a/db/post_migrate/20220826152432_remove_container_repository_updated_events.rb b/db/post_migrate/20220826152432_remove_container_repository_updated_events.rb new file mode 100644 index 00000000000..edce7b4e891 --- /dev/null +++ b/db/post_migrate/20220826152432_remove_container_repository_updated_events.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RemoveContainerRepositoryUpdatedEvents < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + drop_table :geo_container_repository_updated_events + end + + def down + create_table :geo_container_repository_updated_events, id: :bigserial do |t| + t.integer :container_repository_id, + null: false, + index: { name: :idx_geo_con_rep_updated_events_on_container_repository_id } + end + + add_concurrent_foreign_key :geo_container_repository_updated_events, :container_repositories, + column: :container_repository_id, + name: 'fk_212c89c706', + on_delete: :cascade + end +end diff --git a/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb b/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb new file mode 100644 index 00000000000..340d1205ef7 --- /dev/null +++ b/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class RemoveTempIndexForUserDetailsFields < Gitlab::Database::Migration[2.0] + BACKFILL_MIGRATION = 'BackfillUserDetailsFields' + INDEX_NAME = 'tmp_idx_where_user_details_fields_filled' + + disable_ddl_transaction! + + def up + finalize_background_migration BACKFILL_MIGRATION + remove_concurrent_index_by_name :users, INDEX_NAME + end + + def down + # rubocop:disable Migration/PreventIndexCreation + add_concurrent_index :users, :id, name: INDEX_NAME, where: <<~QUERY + (COALESCE(linkedin, '') IS DISTINCT FROM '') + OR (COALESCE(twitter, '') IS DISTINCT FROM '') + OR (COALESCE(skype, '') IS DISTINCT FROM '') + OR (COALESCE(website_url, '') IS DISTINCT FROM '') + OR (COALESCE(location, '') IS DISTINCT FROM '') + OR (COALESCE(organization, '') IS DISTINCT FROM '') + QUERY + # rubocop:enable Migration/PreventIndexCreation + end +end diff --git a/db/post_migrate/20221110100600_add_temp_index_on_overlong_vulnerability_html_title.rb b/db/post_migrate/20221110100600_add_temp_index_on_overlong_vulnerability_html_title.rb new file mode 100644 index 00000000000..5ff56874e11 --- /dev/null +++ b/db/post_migrate/20221110100600_add_temp_index_on_overlong_vulnerability_html_title.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddTempIndexOnOverlongVulnerabilityHtmlTitle < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'tmp_index_vulnerability_overlong_title_html' + + disable_ddl_transaction! + + def up + # Temporary index to speed up the truncation of vulnerabilities with invalid html title length + add_concurrent_index :vulnerabilities, [:id], + name: INDEX_NAME, + where: "LENGTH(title_html) > 800" + end + + def down + remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME + end +end diff --git a/db/post_migrate/20221110100602_queue_truncate_overlong_vulnerability_html_titles.rb b/db/post_migrate/20221110100602_queue_truncate_overlong_vulnerability_html_titles.rb new file mode 100644 index 00000000000..48301498c5a --- /dev/null +++ b/db/post_migrate/20221110100602_queue_truncate_overlong_vulnerability_html_titles.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class QueueTruncateOverlongVulnerabilityHtmlTitles < Gitlab::Database::Migration[2.0] + MIGRATION = 'TruncateOverlongVulnerabilityHtmlTitles' + 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: 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/20221209235939_add_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb b/db/post_migrate/20221209235939_add_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb new file mode 100644 index 00000000000..0f313f420f0 --- /dev/null +++ b/db/post_migrate/20221209235939_add_tmp_index_oauth_access_tokens_on_id_where_expires_in_null.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddTmpIndexOauthAccessTokensOnIdWhereExpiresInNull < Gitlab::Database::Migration[2.1] + TMP_INDEX = 'tmp_index_oauth_access_tokens_on_id_where_expires_in_null' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in %15.9 or later https://gitlab.com/gitlab-org/gitlab/-/issues/385343 + add_concurrent_index :oauth_access_tokens, :id, where: "expires_in IS NULL", name: TMP_INDEX + end + + def down + remove_concurrent_index_by_name :oauth_access_tokens, TMP_INDEX + end +end diff --git a/db/post_migrate/20221209235940_cleanup_o_auth_access_tokens_with_null_expires_in.rb b/db/post_migrate/20221209235940_cleanup_o_auth_access_tokens_with_null_expires_in.rb new file mode 100644 index 00000000000..8daf5bf4d93 --- /dev/null +++ b/db/post_migrate/20221209235940_cleanup_o_auth_access_tokens_with_null_expires_in.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class CleanupOAuthAccessTokensWithNullExpiresIn < Gitlab::Database::Migration[2.1] + MIGRATION = 'ReExpireOAuthTokens' + INTERVAL = 2.minutes + MAX_BATCH_SIZE = 50_000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :oauth_access_tokens, + :id, + job_interval: INTERVAL, + max_batch_size: MAX_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :oauth_access_tokens, :id, []) + end +end diff --git a/db/post_migrate/20221214095129_second_recount_epic_cache_counts.rb b/db/post_migrate/20221214095129_second_recount_epic_cache_counts.rb new file mode 100644 index 00000000000..608e27c344e --- /dev/null +++ b/db/post_migrate/20221214095129_second_recount_epic_cache_counts.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class SecondRecountEpicCacheCounts < Gitlab::Database::Migration[2.0] + MIGRATION = 'SecondRecountEpicCacheCounts' + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 200 + MAX_BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 20 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :epics, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + gitlab_schema: :gitlab_main + ) + end + + def down + delete_batched_background_migration(MIGRATION, :epics, :id, []) + end +end diff --git a/db/post_migrate/20221214105307_add_token_encrypted_partition_id_index_to_ci_build.rb b/db/post_migrate/20221214105307_add_token_encrypted_partition_id_index_to_ci_build.rb new file mode 100644 index 00000000000..4c64e9b0e70 --- /dev/null +++ b/db/post_migrate/20221214105307_add_token_encrypted_partition_id_index_to_ci_build.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddTokenEncryptedPartitionIdIndexToCiBuild < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + INDEX_NAME = :unique_ci_builds_token_encrypted_and_partition_id + COLUMNS = %i[token_encrypted partition_id].freeze + + def up + prepare_async_index( + TABLE_NAME, + COLUMNS, + where: 'token_encrypted IS NOT NULL', + unique: true, + name: INDEX_NAME + ) + end + + def down + unprepare_async_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20221215151822_schedule_backfill_releases_author_id.rb b/db/post_migrate/20221215151822_schedule_backfill_releases_author_id.rb new file mode 100644 index 00000000000..4d8343ca2dd --- /dev/null +++ b/db/post_migrate/20221215151822_schedule_backfill_releases_author_id.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +class ScheduleBackfillReleasesAuthorId < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillReleasesAuthorId' + JOB_DELAY_INTERVAL = 2.minutes + GHOST_USER_TYPE = 5 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class User < MigrationRecord + self.table_name = 'users' + end + + class Release < MigrationRecord + self.table_name = 'releases' + end + + def up + unless release_with_empty_author_exists? + say "There are no releases with empty author_id, so skipping migration #{self.class.name}" + return + end + + create_ghost_user if ghost_user_id.nil? + + queue_batched_background_migration( + MIGRATION, + :releases, + :id, + ghost_user_id, + job_interval: JOB_DELAY_INTERVAL + ) + end + + def down + delete_batched_background_migration(MIGRATION, :releases, :id, [ghost_user_id]) + end + + private + + def ghost_user_id + User.find_by(user_type: GHOST_USER_TYPE)&.id + end + + def create_ghost_user + user = User.new + user.name = 'Ghost User' + user.username = 'ghost' + user.email = 'ghost@example.com' + user.user_type = GHOST_USER_TYPE + user.projects_limit = 100000 + + user.save! + end + + def release_with_empty_author_exists? + Release.exists?(author_id: nil) + end +end diff --git a/db/post_migrate/20221216131710_add_index_to_ci_unit_test_failure.rb b/db/post_migrate/20221216131710_add_index_to_ci_unit_test_failure.rb new file mode 100644 index 00000000000..f99d2914aa4 --- /dev/null +++ b/db/post_migrate/20221216131710_add_index_to_ci_unit_test_failure.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToCiUnitTestFailure < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :index_ci_unit_test_failures_on_partition_id_build_id + TABLE_NAME = :ci_unit_test_failures + COLUMNS = [:partition_id, :build_id] + + def up + add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20221216131935_add_index_to_ci_build_pending_state.rb b/db/post_migrate/20221216131935_add_index_to_ci_build_pending_state.rb new file mode 100644 index 00000000000..4fec5e016a4 --- /dev/null +++ b/db/post_migrate/20221216131935_add_index_to_ci_build_pending_state.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToCiBuildPendingState < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :index_ci_build_pending_states_on_partition_id_build_id + TABLE_NAME = :ci_build_pending_states + COLUMNS = [:partition_id, :build_id] + + def up + add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20221216131958_add_index_to_ci_build_trace_chunk.rb b/db/post_migrate/20221216131958_add_index_to_ci_build_trace_chunk.rb new file mode 100644 index 00000000000..5577a18c144 --- /dev/null +++ b/db/post_migrate/20221216131958_add_index_to_ci_build_trace_chunk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToCiBuildTraceChunk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :index_ci_build_trace_chunks_on_partition_id_build_id + TABLE_NAME = :ci_build_trace_chunks + COLUMNS = [:partition_id, :build_id] + + def up + add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20221216144854_add_foreign_key_to_ci_unit_test_failure.rb b/db/post_migrate/20221216144854_add_foreign_key_to_ci_unit_test_failure.rb new file mode 100644 index 00000000000..e04647d7c92 --- /dev/null +++ b/db/post_migrate/20221216144854_add_foreign_key_to_ci_unit_test_failure.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddForeignKeyToCiUnitTestFailure < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_unit_test_failures + TARGET_TABLE_NAME = :ci_builds + COLUMN = :build_id + TARGET_COLUMN = :id + FK_NAME = :fk_0f09856e1f_p + PARTITION_COLUMN = :partition_id + + def up + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: false, + reverse_lock_order: true, + name: FK_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME) + end + end +end diff --git a/db/post_migrate/20221216150304_add_foreign_key_to_ci_build_pending_state.rb b/db/post_migrate/20221216150304_add_foreign_key_to_ci_build_pending_state.rb new file mode 100644 index 00000000000..ef9ecc3033f --- /dev/null +++ b/db/post_migrate/20221216150304_add_foreign_key_to_ci_build_pending_state.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddForeignKeyToCiBuildPendingState < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_build_pending_states + TARGET_TABLE_NAME = :ci_builds + COLUMN = :build_id + TARGET_COLUMN = :id + FK_NAME = :fk_rails_0bbbfeaf9d_p + PARTITION_COLUMN = :partition_id + + def up + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: false, + reverse_lock_order: true, + name: FK_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME) + end + end +end diff --git a/db/post_migrate/20221216150321_add_foreign_key_to_ci_build_trace_chunk.rb b/db/post_migrate/20221216150321_add_foreign_key_to_ci_build_trace_chunk.rb new file mode 100644 index 00000000000..dd16d3d7787 --- /dev/null +++ b/db/post_migrate/20221216150321_add_foreign_key_to_ci_build_trace_chunk.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddForeignKeyToCiBuildTraceChunk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_build_trace_chunks + TARGET_TABLE_NAME = :ci_builds + COLUMN = :build_id + TARGET_COLUMN = :id + FK_NAME = :fk_rails_1013b761f2_p + PARTITION_COLUMN = :partition_id + + def up + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: false, + reverse_lock_order: true, + name: FK_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME) + end + end +end diff --git a/db/post_migrate/20221216150919_validate_foreign_key_on_ci_unit_test_failure_partition_id_build_id.rb b/db/post_migrate/20221216150919_validate_foreign_key_on_ci_unit_test_failure_partition_id_build_id.rb new file mode 100644 index 00000000000..a886949aea7 --- /dev/null +++ b/db/post_migrate/20221216150919_validate_foreign_key_on_ci_unit_test_failure_partition_id_build_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ValidateForeignKeyOnCiUnitTestFailurePartitionIdBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_unit_test_failures + FK_NAME = :fk_0f09856e1f_p + PARTITION_COLUMN = :partition_id + COLUMN = :build_id + + def up + validate_foreign_key(TABLE_NAME, [PARTITION_COLUMN, COLUMN], name: FK_NAME) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221216151459_validate_foreign_key_on_ci_build_pending_state_partition_id_build_id.rb b/db/post_migrate/20221216151459_validate_foreign_key_on_ci_build_pending_state_partition_id_build_id.rb new file mode 100644 index 00000000000..6ea8cb213ab --- /dev/null +++ b/db/post_migrate/20221216151459_validate_foreign_key_on_ci_build_pending_state_partition_id_build_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ValidateForeignKeyOnCiBuildPendingStatePartitionIdBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_pending_states + FK_NAME = :fk_rails_0bbbfeaf9d_p + PARTITION_COLUMN = :partition_id + COLUMN = :build_id + + def up + validate_foreign_key(TABLE_NAME, [PARTITION_COLUMN, COLUMN], name: FK_NAME) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221216151649_validate_foreign_key_on_ci_build_trace_chunk_partition_id_build_id.rb b/db/post_migrate/20221216151649_validate_foreign_key_on_ci_build_trace_chunk_partition_id_build_id.rb new file mode 100644 index 00000000000..8afd7de808b --- /dev/null +++ b/db/post_migrate/20221216151649_validate_foreign_key_on_ci_build_trace_chunk_partition_id_build_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ValidateForeignKeyOnCiBuildTraceChunkPartitionIdBuildId < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_build_trace_chunks + FK_NAME = :fk_rails_1013b761f2_p + PARTITION_COLUMN = :partition_id + COLUMN = :build_id + + def up + validate_foreign_key(TABLE_NAME, [PARTITION_COLUMN, COLUMN], name: FK_NAME) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb b/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb new file mode 100644 index 00000000000..56adad1e4a5 --- /dev/null +++ b/db/post_migrate/20221216232658_index_members_on_member_namespace_id_compound.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class IndexMembersOnMemberNamespaceIdCompound < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_members_on_member_namespace_id_compound' + + disable_ddl_transaction! + + def up + prepare_async_index( + :members, + [:member_namespace_id, :type, :requested_at, :id], + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/post_migrate/20221216232659_index_members_on_member_namespace_id_compound_sync.rb b/db/post_migrate/20221216232659_index_members_on_member_namespace_id_compound_sync.rb new file mode 100644 index 00000000000..f37a1b694b4 --- /dev/null +++ b/db/post_migrate/20221216232659_index_members_on_member_namespace_id_compound_sync.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class IndexMembersOnMemberNamespaceIdCompoundSync < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_members_on_member_namespace_id_compound' + + disable_ddl_transaction! + + def up + add_concurrent_index( + :members, + [:member_namespace_id, :type, :requested_at, :id], + name: INDEX_NAME + ) + end + + def down + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/post_migrate/20221220075936_add_query_index_for_ci_pipeline_schedules.rb b/db/post_migrate/20221220075936_add_query_index_for_ci_pipeline_schedules.rb new file mode 100644 index 00000000000..4fc64f66a83 --- /dev/null +++ b/db/post_migrate/20221220075936_add_query_index_for_ci_pipeline_schedules.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddQueryIndexForCiPipelineSchedules < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipeline_schedules + INDEX_NAME = :index_ci_pipeline_schedules_on_id_and_next_run_at_and_active + COLUMNS = %i[id next_run_at].freeze + INDEX_CONDITION = 'active = TRUE' + + disable_ddl_transaction! + + def up + add_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME, where: INDEX_CONDITION) + end + + def down + remove_concurrent_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20221220131020_bump_default_partition_id_value_for_ci_tables.rb b/db/post_migrate/20221220131020_bump_default_partition_id_value_for_ci_tables.rb new file mode 100644 index 00000000000..3d06f02a6d6 --- /dev/null +++ b/db/post_migrate/20221220131020_bump_default_partition_id_value_for_ci_tables.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +class BumpDefaultPartitionIdValueForCiTables < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLES = { + ci_build_needs: [:partition_id], + ci_build_pending_states: [:partition_id], + ci_build_report_results: [:partition_id], + ci_build_trace_chunks: [:partition_id], + ci_build_trace_metadata: [:partition_id], + ci_builds: [:partition_id], + ci_builds_runner_session: [:partition_id], + ci_job_artifacts: [:partition_id], + ci_job_variables: [:partition_id], + ci_pending_builds: [:partition_id], + ci_pipeline_variables: [:partition_id], + ci_pipelines: [:partition_id], + ci_running_builds: [:partition_id], + ci_sources_pipelines: [:partition_id, :source_partition_id], + ci_stages: [:partition_id], + ci_unit_test_failures: [:partition_id], + p_ci_builds_metadata: [:partition_id] + } + + def up + change_partitions_default_value(from: 100, to: 101) + end + + def down + change_partitions_default_value(from: 101, to: 100) + end + + private + + def change_partitions_default_value(from:, to:) + return unless Gitlab.com? + + TABLES.each do |table_name, columns| + next if columns.all? { |column_name| default_value_for(table_name, column_name) == to } + + with_lock_retries do + columns.each do |column_name| # rubocop:disable Migration/WithLockRetriesDisallowedMethod + change_column_default(table_name, column_name, from: from, to: to) + end + end + end + end + + def default_value_for(table_name, column_name) + connection + .columns(table_name) + .find { |column| column.name == column_name.to_s } + .default&.to_i + end +end diff --git a/db/post_migrate/20221221110733_remove_temp_index_for_project_statistics_upload_size_migration.rb b/db/post_migrate/20221221110733_remove_temp_index_for_project_statistics_upload_size_migration.rb new file mode 100644 index 00000000000..1df6ad274f9 --- /dev/null +++ b/db/post_migrate/20221221110733_remove_temp_index_for_project_statistics_upload_size_migration.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveTempIndexForProjectStatisticsUploadSizeMigration < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'tmp_index_project_statistics_uploads_size' + TABLE_NAME = 'project_statistics' + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :project_statistics, INDEX_NAME + end + + def down + add_concurrent_index :project_statistics, [:project_id], + name: INDEX_NAME, + where: "uploads_size <> 0" + end +end diff --git a/db/post_migrate/20221221150123_update_billable_users_index.rb b/db/post_migrate/20221221150123_update_billable_users_index.rb new file mode 100644 index 00000000000..d2f55e06b0b --- /dev/null +++ b/db/post_migrate/20221221150123_update_billable_users_index.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class UpdateBillableUsersIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + NEW_INDEX = 'index_users_for_billable_users' + OLD_INDEX = 'index_users_for_active_billable' + + OLD_INDEX_CONDITION = <<~QUERY + ((state)::text = 'active'::text) AND ((user_type IS NULL) + OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) + OR (user_type <> ALL ('{1,2,3,4,5,6,7,8,9,11}'::smallint[]))) + QUERY + NEW_INDEX_CONDITION = <<~QUERY + state = 'active' AND (user_type IS NULL OR user_type IN (6, 4)) 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/20221222092958_sync_new_amount_used_with_amount_used.rb b/db/post_migrate/20221222092958_sync_new_amount_used_with_amount_used.rb new file mode 100644 index 00000000000..9d8e2ee54d6 --- /dev/null +++ b/db/post_migrate/20221222092958_sync_new_amount_used_with_amount_used.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class SyncNewAmountUsedWithAmountUsed < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + # This migration will only run on rollback, there is no need for the positive case + end + + def down + project_usages = define_batchable_model('ci_project_monthly_usages') + + project_usages.each_batch(of: 500) do |batch| + batch.where('amount_used > 0').update_all('new_amount_used = amount_used') + end + end +end diff --git a/db/post_migrate/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration.rb b/db/post_migrate/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration.rb new file mode 100644 index 00000000000..e5822d2d7a2 --- /dev/null +++ b/db/post_migrate/20221223123019_delete_queued_jobs_for_vulnerabilities_feedback_migration.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class DeleteQueuedJobsForVulnerabilitiesFeedbackMigration < Gitlab::Database::Migration[2.1] + MIGRATION = 'MigrateVulnerabilitiesFeedbackToVulnerabilitiesStateTransition' + TABLE_NAME = :vulnerability_feedback + BATCH_COLUMN = :id + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration( + MIGRATION, + TABLE_NAME, + BATCH_COLUMN, + [] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20221226153240_remove_chat_names_integration_id_foreign_key.rb b/db/post_migrate/20221226153240_remove_chat_names_integration_id_foreign_key.rb new file mode 100644 index 00000000000..51baa9c9f57 --- /dev/null +++ b/db/post_migrate/20221226153240_remove_chat_names_integration_id_foreign_key.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class RemoveChatNamesIntegrationIdForeignKey < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :chat_names + TARGET_TABLE_NAME = :integrations + COLUMN = :integration_id + TARGET_COLUMN = :id + FK_NAME = :fk_99a1348daf + + def up + with_lock_retries do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME) + end + end + + def down + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: COLUMN, + name: FK_NAME, + on_delete: :cascade + ) + end +end diff --git a/db/post_migrate/20221226154458_drop_index_on_chat_names_on_integration_id_and_team_id_and_chat_id.rb b/db/post_migrate/20221226154458_drop_index_on_chat_names_on_integration_id_and_team_id_and_chat_id.rb new file mode 100644 index 00000000000..d5aeb704983 --- /dev/null +++ b/db/post_migrate/20221226154458_drop_index_on_chat_names_on_integration_id_and_team_id_and_chat_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexOnChatNamesOnIntegrationIdAndTeamIdAndChatId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_chat_names_on_integration_id_and_team_id_and_chat_id' + + def up + remove_concurrent_index_by_name(:chat_names, INDEX_NAME) + end + + def down + add_concurrent_index(:chat_names, [:integration_id, :team_id, :chat_id], name: INDEX_NAME, unique: true) + end +end diff --git a/db/post_migrate/20221227100751_add_user_index_to_chat_names.rb b/db/post_migrate/20221227100751_add_user_index_to_chat_names.rb new file mode 100644 index 00000000000..7be671b2cbd --- /dev/null +++ b/db/post_migrate/20221227100751_add_user_index_to_chat_names.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUserIndexToChatNames < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_chat_names_on_user_id' + + def up + add_concurrent_index(:chat_names, :user_id, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(:chat_names, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20221227101436_drop_index_on_chat_names_on_user_id_and_integration_id.rb b/db/post_migrate/20221227101436_drop_index_on_chat_names_on_user_id_and_integration_id.rb new file mode 100644 index 00000000000..ab2842ea775 --- /dev/null +++ b/db/post_migrate/20221227101436_drop_index_on_chat_names_on_user_id_and_integration_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexOnChatNamesOnUserIdAndIntegrationId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_chat_names_on_user_id_and_integration_id' + + def up + remove_concurrent_index_by_name(:chat_names, INDEX_NAME) + end + + def down + add_concurrent_index(:chat_names, [:user_id, :integration_id], name: INDEX_NAME, unique: true) + end +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 new file mode 100644 index 00000000000..c111d5090e1 --- /dev/null +++ b/db/post_migrate/20221228103133_queue_backfill_admin_mode_scope_for_personal_access_tokens.rb @@ -0,0 +1,21 @@ +# 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 + + def down + delete_batched_background_migration(MIGRATION, :personal_access_tokens, :id, []) + end +end diff --git a/db/post_migrate/20221228163035_cleanup_appearances_short_title_rename.rb b/db/post_migrate/20221228163035_cleanup_appearances_short_title_rename.rb new file mode 100644 index 00000000000..300d53f227a --- /dev/null +++ b/db/post_migrate/20221228163035_cleanup_appearances_short_title_rename.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class CleanupAppearancesShortTitleRename < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + cleanup_concurrent_column_rename :appearances, :short_title, :pwa_short_name + end + + def down + undo_cleanup_concurrent_column_rename :appearances, :short_title, :pwa_short_name + end +end diff --git a/db/post_migrate/20221228210616_add_index_on_ci_runners_on_runner_type_and_id.rb b/db/post_migrate/20221228210616_add_index_on_ci_runners_on_runner_type_and_id.rb new file mode 100644 index 00000000000..62c40b78945 --- /dev/null +++ b/db/post_migrate/20221228210616_add_index_on_ci_runners_on_runner_type_and_id.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnCiRunnersOnRunnerTypeAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + OLD_INDEX_NAME = 'index_ci_runners_on_runner_type' + NEW_INDEX_NAME = 'index_ci_runners_on_runner_type_and_id' + + def up + add_concurrent_index :ci_runners, [:runner_type, :id], name: NEW_INDEX_NAME + remove_concurrent_index_by_name :ci_runners, OLD_INDEX_NAME + end + + def down + add_concurrent_index :ci_runners, :runner_type, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :ci_runners, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20230104103748_remove_new_amount_used_column.rb b/db/post_migrate/20230104103748_remove_new_amount_used_column.rb new file mode 100644 index 00000000000..0aaa7c1bd8f --- /dev/null +++ b/db/post_migrate/20230104103748_remove_new_amount_used_column.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveNewAmountUsedColumn < Gitlab::Database::Migration[2.1] + TRIGGER_NAME = 'sync_projects_amount_used_columns' + def up + remove_rename_triggers :ci_project_monthly_usages, TRIGGER_NAME + remove_column :ci_project_monthly_usages, :new_amount_used + end + + def down + return if column_exists?(:ci_project_monthly_usages, :new_amount_used) + + # rubocop:disable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables + add_column :ci_project_monthly_usages, :new_amount_used, :decimal, default: 0.0, + precision: 18, scale: 2, null: false + # rubocop:enable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables + + install_rename_triggers :ci_project_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME + end +end diff --git a/db/post_migrate/20230104150601_prepare_builds_metadata_async_idx.rb b/db/post_migrate/20230104150601_prepare_builds_metadata_async_idx.rb new file mode 100644 index 00000000000..83dfe62ad71 --- /dev/null +++ b/db/post_migrate/20230104150601_prepare_builds_metadata_async_idx.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class PrepareBuildsMetadataAsyncIdx < 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 + # Break up the logic from add_concurrent_partitioned_index so that the partition indices can be created async + # A follow-up migration will complete the index creation by creating the index on the metadata table, and + # creating the concurrent foreign key + each_partition(:p_ci_builds_metadata) do |partition, partition_index_name| + prepare_async_index(partition.identifier, :runner_machine_id, + name: partition_index_name, where: 'runner_machine_id IS NOT NULL') + end + end + + def down + each_partition(:p_ci_builds_metadata) do |partition, partition_index_name| + unprepare_async_index_by_name(partition.identifier, partition_index_name) + end + end + + private + + def each_partition(table_name) + partitioned_table = find_partitioned_table(table_name) + partitioned_table.postgres_partitions.order(:name).each do |partition| + partition_index_name = generated_index_name(partition.identifier, INDEX_NAME) + + yield partition, partition_index_name + end + end +end diff --git a/db/post_migrate/20230104220137_reindex_vuln_reads_on_default_branch_with_common_query.rb b/db/post_migrate/20230104220137_reindex_vuln_reads_on_default_branch_with_common_query.rb new file mode 100644 index 00000000000..114a1a84fa0 --- /dev/null +++ b/db/post_migrate/20230104220137_reindex_vuln_reads_on_default_branch_with_common_query.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class ReindexVulnReadsOnDefaultBranchWithCommonQuery < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_vuln_reads_common_query_on_resolved_on_default_branch' + + COLUMNS = %i[project_id state report_type vulnerability_id] + + disable_ddl_transaction! + + def up + add_concurrent_index( + :vulnerability_reads, + COLUMNS, + name: INDEX_NAME, + where: 'resolved_on_default_branch IS TRUE', + order: { vulnerability_id: :desc } + ) + end + + def down + remove_concurrent_index_by_name( + :vulnerability_reads, + INDEX_NAME + ) + end +end diff --git a/db/post_migrate/20230104224020_drop_vuln_reads_on_default_branch_index.rb b/db/post_migrate/20230104224020_drop_vuln_reads_on_default_branch_index.rb new file mode 100644 index 00000000000..acac69478a3 --- /dev/null +++ b/db/post_migrate/20230104224020_drop_vuln_reads_on_default_branch_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropVulnReadsOnDefaultBranchIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_vuln_reads_on_resolved_on_default_branch' + + COLUMNS = %i[project_id state id] + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :vulnerability_reads, name: INDEX_NAME + end + + def down + add_concurrent_index :vulnerability_reads, COLUMNS, + where: 'resolved_on_default_branch IS TRUE', + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230105172120_sync_new_amount_used_with_amount_used_on_ci_namespace_monthly_usages_table.rb b/db/post_migrate/20230105172120_sync_new_amount_used_with_amount_used_on_ci_namespace_monthly_usages_table.rb new file mode 100644 index 00000000000..4181d6a0f92 --- /dev/null +++ b/db/post_migrate/20230105172120_sync_new_amount_used_with_amount_used_on_ci_namespace_monthly_usages_table.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class SyncNewAmountUsedWithAmountUsedOnCiNamespaceMonthlyUsagesTable < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + # This migration will only run on rollback, there is no need for the positive case + end + + def down + project_usages = define_batchable_model('ci_namespace_monthly_usages') + + project_usages.each_batch(of: 500) do |batch| + batch.where('amount_used > 0').update_all('new_amount_used = amount_used') + end + end +end diff --git a/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb b/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb new file mode 100644 index 00000000000..cebda3e353e --- /dev/null +++ b/db/post_migrate/20230105180002_remove_new_amount_used_column_on_ci_namespace_monthly_usages.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RemoveNewAmountUsedColumnOnCiNamespaceMonthlyUsages < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + TRIGGER_NAME = 'sync_namespaces_amount_used_columns' + def up + remove_rename_triggers :ci_namespace_monthly_usages, TRIGGER_NAME + remove_column :ci_namespace_monthly_usages, :new_amount_used + end + + def down + return if column_exists?(:ci_namespace_monthly_usages, :new_amount_used) + + # rubocop:disable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables + add_column :ci_namespace_monthly_usages, :new_amount_used, :decimal, default: 0.0, + precision: 18, scale: 2, null: false + # rubocop:enable Migration/SchemaAdditionMethodsNoPost, Migration/AddColumnsToWideTables + + install_rename_triggers :ci_namespace_monthly_usages, :amount_used, :new_amount_used, trigger_name: TRIGGER_NAME + end +end diff --git a/db/post_migrate/20230106124332_change_keys_relation_to_ssh_signatures.rb b/db/post_migrate/20230106124332_change_keys_relation_to_ssh_signatures.rb new file mode 100644 index 00000000000..e76a3617ba3 --- /dev/null +++ b/db/post_migrate/20230106124332_change_keys_relation_to_ssh_signatures.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class ChangeKeysRelationToSshSignatures < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TARGET_COLUMN = :key_id + + def up + add_concurrent_foreign_key( + :ssh_signatures, + :keys, + column: :key_id, + name: fk_name("#{TARGET_COLUMN}_nullify"), + on_delete: :nullify + ) + + with_lock_retries do + remove_foreign_key_if_exists(:ssh_signatures, column: TARGET_COLUMN, name: fk_name(TARGET_COLUMN)) + end + end + + def down + add_concurrent_foreign_key( + :ssh_signatures, + :keys, + column: :key_id, + name: fk_name(TARGET_COLUMN), + on_delete: :cascade + ) + + with_lock_retries do + remove_foreign_key_if_exists(:ssh_signatures, column: TARGET_COLUMN, name: fk_name("#{TARGET_COLUMN}_nullify")) + end + end + + private + + def fk_name(column_name) + concurrent_foreign_key_name(:ssh_signatures, column_name) + end +end diff --git a/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb b/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb new file mode 100644 index 00000000000..c04b71835a2 --- /dev/null +++ b/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPartialIndexOnGroupPathId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :index_groups_on_path_and_id + + def up + add_concurrent_index :namespaces, [:path, :id], where: "type = 'Group'", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :namespaces, INDEX_NAME + end +end diff --git a/db/post_migrate/20230111125148_add_user_id_and_source_id_and_source_type_and_member_role_id_index_to_members.rb b/db/post_migrate/20230111125148_add_user_id_and_source_id_and_source_type_and_member_role_id_index_to_members.rb new file mode 100644 index 00000000000..82e2ea8bf29 --- /dev/null +++ b/db/post_migrate/20230111125148_add_user_id_and_source_id_and_source_type_and_member_role_id_index_to_members.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUserIdAndSourceIdAndSourceTypeAndMemberRoleIdIndexToMembers < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'idx_members_on_user_and_source_and_source_type_and_member_role' + + def up + add_concurrent_index :members, [:user_id, :source_id, :source_type, :member_role_id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :members, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230111125150_drop_user_id_and_source_id_and_source_type_index_from_members.rb b/db/post_migrate/20230111125150_drop_user_id_and_source_id_and_source_type_index_from_members.rb new file mode 100644 index 00000000000..c1c56a4073c --- /dev/null +++ b/db/post_migrate/20230111125150_drop_user_id_and_source_id_and_source_type_index_from_members.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropUserIdAndSourceIdAndSourceTypeIndexFromMembers < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_members_on_user_id_source_id_source_type' + + def up + remove_concurrent_index_by_name :members, name: INDEX_NAME + end + + def down + add_concurrent_index :members, [:user_id, :source_id, :source_type], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230112085143_add_index_environments_on_project_id_and_id.rb b/db/post_migrate/20230112085143_add_index_environments_on_project_id_and_id.rb new file mode 100644 index 00000000000..bfb85557714 --- /dev/null +++ b/db/post_migrate/20230112085143_add_index_environments_on_project_id_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexEnvironmentsOnProjectIdAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_environments_on_project_id_and_id' + + def up + add_concurrent_index :environments, %i[project_id id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :environments, INDEX_NAME + end +end diff --git a/db/post_migrate/20230113003255_remove_atlassian_refresh_token_constraint.rb b/db/post_migrate/20230113003255_remove_atlassian_refresh_token_constraint.rb new file mode 100644 index 00000000000..81c3f10c0f6 --- /dev/null +++ b/db/post_migrate/20230113003255_remove_atlassian_refresh_token_constraint.rb @@ -0,0 +1,20 @@ +# 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 RemoveAtlassianRefreshTokenConstraint < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'atlassian_identities_refresh_token_length_constraint' + + disable_ddl_transaction! + + def up + remove_check_constraint(:atlassian_identities, CONSTRAINT_NAME) + add_check_constraint :atlassian_identities, 'octet_length(encrypted_refresh_token) <= 5000', CONSTRAINT_NAME + end + + def down + remove_check_constraint(:atlassian_identities, CONSTRAINT_NAME) + add_check_constraint :atlassian_identities, 'octet_length(encrypted_refresh_token) <= 512', CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20230116083826_drop_index_on_ci_build_token_encrypted.rb b/db/post_migrate/20230116083826_drop_index_on_ci_build_token_encrypted.rb new file mode 100644 index 00000000000..429388b1742 --- /dev/null +++ b/db/post_migrate/20230116083826_drop_index_on_ci_build_token_encrypted.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropIndexOnCiBuildTokenEncrypted < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + INDEX_NAME = :index_ci_builds_on_token_encrypted_partition_id_unique + COLUMNS = %i[token_encrypted partition_id].freeze + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, where: 'token_encrypted IS NOT NULL', name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20230116090630_add_index_for_group_activity_events.rb b/db/post_migrate/20230116090630_add_index_for_group_activity_events.rb new file mode 100644 index 00000000000..a775a471f98 --- /dev/null +++ b/db/post_migrate/20230116090630_add_index_for_group_activity_events.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexForGroupActivityEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_events_for_group_activity' + + def up + add_concurrent_index :events, %i[group_id target_type action id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20230116090852_add_index_for_project_activity_events.rb b/db/post_migrate/20230116090852_add_index_for_project_activity_events.rb new file mode 100644 index 00000000000..f0d757ad885 --- /dev/null +++ b/db/post_migrate/20230116090852_add_index_for_project_activity_events.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexForProjectActivityEvents < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_events_for_project_activity' + + def up + add_concurrent_index :events, %i[project_id target_type action id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20230116090920_add_index_to_events_on_group_id_and_id.rb b/db/post_migrate/20230116090920_add_index_to_events_on_group_id_and_id.rb new file mode 100644 index 00000000000..4c2a9af7df9 --- /dev/null +++ b/db/post_migrate/20230116090920_add_index_to_events_on_group_id_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToEventsOnGroupIdAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_events_on_group_id_and_id' + + def up + add_concurrent_index :events, %i[group_id id], name: INDEX_NAME, where: 'group_id IS NOT NULL' + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20230116091626_add_index_for_events_followed_users.rb b/db/post_migrate/20230116091626_add_index_for_events_followed_users.rb new file mode 100644 index 00000000000..24358814521 --- /dev/null +++ b/db/post_migrate/20230116091626_add_index_for_events_followed_users.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexForEventsFollowedUsers < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_events_for_followed_users' + + def up + add_concurrent_index :events, %I[author_id target_type action id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20230116111252_finalize_todo_sanitization.rb b/db/post_migrate/20230116111252_finalize_todo_sanitization.rb new file mode 100644 index 00000000000..b3da479aa57 --- /dev/null +++ b/db/post_migrate/20230116111252_finalize_todo_sanitization.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeTodoSanitization < Gitlab::Database::Migration[2.1] + MIGRATION = 'SanitizeConfidentialTodos' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :notes, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230117113719_add_tmp_index_to_ci_sources_pipelines_on_partition_id.rb b/db/post_migrate/20230117113719_add_tmp_index_to_ci_sources_pipelines_on_partition_id.rb new file mode 100644 index 00000000000..28c722893bc --- /dev/null +++ b/db/post_migrate/20230117113719_add_tmp_index_to_ci_sources_pipelines_on_partition_id.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddTmpIndexToCiSourcesPipelinesOnPartitionId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = :tmp_index_ci_sources_pipelines_on_partition_id_and_id + SOURCE_INDEX_NAME = :tmp_index_ci_sources_pipelines_on_source_partition_id_and_id + TABLE_NAME = :ci_sources_pipelines + + def up + return unless Gitlab.com? + + add_concurrent_index TABLE_NAME, + [:partition_id, :id], + name: INDEX_NAME, where: 'partition_id = 101' + + add_concurrent_index TABLE_NAME, + [:source_partition_id, :id], + name: SOURCE_INDEX_NAME, + where: 'source_partition_id = 101' + end + + def down + return unless Gitlab.com? + + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + remove_concurrent_index_by_name TABLE_NAME, SOURCE_INDEX_NAME + end +end diff --git a/db/post_migrate/20230117145628_add_token_encrypted_and_partition_id_index_to_ci_build.rb b/db/post_migrate/20230117145628_add_token_encrypted_and_partition_id_index_to_ci_build.rb new file mode 100644 index 00000000000..ffcf56dd2ca --- /dev/null +++ b/db/post_migrate/20230117145628_add_token_encrypted_and_partition_id_index_to_ci_build.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddTokenEncryptedAndPartitionIdIndexToCiBuild < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds + INDEX_NAME = :unique_ci_builds_token_encrypted_and_partition_id + COLUMNS = %i[token_encrypted partition_id].freeze + + def up + add_concurrent_index(TABLE_NAME, COLUMNS, unique: true, where: 'token_encrypted IS NOT NULL', name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/schema_migrations/20210301200959 b/db/schema_migrations/20210301200959 deleted file mode 100644 index 8c5efabd76d..00000000000 --- a/db/schema_migrations/20210301200959 +++ /dev/null @@ -1 +0,0 @@ -28b90c9b7c2e4f2e2b12088f5aee85c16dfb567f89ed6a8e771f2c5d91c818d9
\ No newline at end of file diff --git a/db/schema_migrations/20210302025305 b/db/schema_migrations/20210302025305 deleted file mode 100644 index 935006818be..00000000000 --- a/db/schema_migrations/20210302025305 +++ /dev/null @@ -1 +0,0 @@ -bf47b1c4840c97459f99308d9de04644d18c301659ef5f021088911155d2c624
\ No newline at end of file diff --git a/db/schema_migrations/20210302074524 b/db/schema_migrations/20210302074524 deleted file mode 100644 index be35539d1f0..00000000000 --- a/db/schema_migrations/20210302074524 +++ /dev/null @@ -1 +0,0 @@ -251c0d811eee00f78e62f4d1e7f2893b2137fbf8121cefc4283c3217677b5447
\ No newline at end of file diff --git a/db/schema_migrations/20210302103851 b/db/schema_migrations/20210302103851 deleted file mode 100644 index cd166f974a9..00000000000 --- a/db/schema_migrations/20210302103851 +++ /dev/null @@ -1 +0,0 @@ -b2dad27276941e17248f86764196525bd91b088eed78ad7aa6ae2e5a2c9e82bd
\ No newline at end of file diff --git a/db/schema_migrations/20210302150310 b/db/schema_migrations/20210302150310 deleted file mode 100644 index 251fdb0ba8e..00000000000 --- a/db/schema_migrations/20210302150310 +++ /dev/null @@ -1 +0,0 @@ -7c562d43801c18af48dc526dc6574aebd11689b62bad864b107580d341ba64a1
\ No newline at end of file diff --git a/db/schema_migrations/20210302155904 b/db/schema_migrations/20210302155904 deleted file mode 100644 index b9f1297934c..00000000000 --- a/db/schema_migrations/20210302155904 +++ /dev/null @@ -1 +0,0 @@ -104e767518d55a7caa5ff517efe978287beb629649c681a2871ada8a677a0e13
\ No newline at end of file diff --git a/db/schema_migrations/20210302160544 b/db/schema_migrations/20210302160544 deleted file mode 100644 index fd1b67c16bf..00000000000 --- a/db/schema_migrations/20210302160544 +++ /dev/null @@ -1 +0,0 @@ -e5c589decb2bc8d3e37451bf9977a810308ee37f5f02ed96226e0be87f8b908d
\ No newline at end of file diff --git a/db/schema_migrations/20210302212623 b/db/schema_migrations/20210302212623 deleted file mode 100644 index f7e2ab33416..00000000000 --- a/db/schema_migrations/20210302212623 +++ /dev/null @@ -1 +0,0 @@ -283645d1791a8d72fa7e327799ede933d89bd69d8db2a87b7ff437a2f5d74da3
\ No newline at end of file diff --git a/db/schema_migrations/20210303053341 b/db/schema_migrations/20210303053341 deleted file mode 100644 index 115b5655f4f..00000000000 --- a/db/schema_migrations/20210303053341 +++ /dev/null @@ -1 +0,0 @@ -3bd7e839c4f93716a7e893bf9184306a1fcfd401e5b54f4393e5138e2776f5e0
\ No newline at end of file diff --git a/db/schema_migrations/20210303064112 b/db/schema_migrations/20210303064112 deleted file mode 100644 index 42164b222b7..00000000000 --- a/db/schema_migrations/20210303064112 +++ /dev/null @@ -1 +0,0 @@ -5b8f32bafe4bffd30b9235f9b6ba5774a26d5c4c9f1e987d3e840056f8abdd52
\ No newline at end of file diff --git a/db/schema_migrations/20210303064142 b/db/schema_migrations/20210303064142 deleted file mode 100644 index 9ac9716c8e7..00000000000 --- a/db/schema_migrations/20210303064142 +++ /dev/null @@ -1 +0,0 @@ -70c5b76788460bd098c3ae3f75c7b18194c7765e1462f5305feaf2400f7dd4ff
\ No newline at end of file diff --git a/db/schema_migrations/20210303091651 b/db/schema_migrations/20210303091651 deleted file mode 100644 index 35d2ca084b8..00000000000 --- a/db/schema_migrations/20210303091651 +++ /dev/null @@ -1 +0,0 @@ -e1641d84828e3d87aea626dbce6b3b2d231d08fcf1475991fe8d11714cdb0af0
\ No newline at end of file diff --git a/db/schema_migrations/20210303121224 b/db/schema_migrations/20210303121224 deleted file mode 100644 index 0c0ba7c882c..00000000000 --- a/db/schema_migrations/20210303121224 +++ /dev/null @@ -1 +0,0 @@ -cef2421a6885cb8b28d34388af6c79c4be1564dfd5fae2efcb35622d511eb8c0
\ No newline at end of file diff --git a/db/schema_migrations/20210303165201 b/db/schema_migrations/20210303165201 deleted file mode 100644 index 55181591e3f..00000000000 --- a/db/schema_migrations/20210303165201 +++ /dev/null @@ -1 +0,0 @@ -0a5d306735047101692bbdb37aa829bf70a225af6db7213a8c2eb8168f9a30e9
\ No newline at end of file diff --git a/db/schema_migrations/20210303165301 b/db/schema_migrations/20210303165301 deleted file mode 100644 index c040288a283..00000000000 --- a/db/schema_migrations/20210303165301 +++ /dev/null @@ -1 +0,0 @@ -fa82a0f6c57a527a143da56ae0d70245a7d711b5e5ff3eb959fd6b2cf5872dac
\ No newline at end of file diff --git a/db/schema_migrations/20210303165302 b/db/schema_migrations/20210303165302 deleted file mode 100644 index f140d636482..00000000000 --- a/db/schema_migrations/20210303165302 +++ /dev/null @@ -1 +0,0 @@ -1cb74abdc7134c3252425c3ceb8cd9dc4b157d64b1a2ff7928153e78b05d9121
\ No newline at end of file diff --git a/db/schema_migrations/20210303193544 b/db/schema_migrations/20210303193544 deleted file mode 100644 index ee00730b633..00000000000 --- a/db/schema_migrations/20210303193544 +++ /dev/null @@ -1 +0,0 @@ -4d88c8ff507a985d90ed13dc16eba068e440efd12e5ec72782cef2a4bc3cf9e7
\ No newline at end of file diff --git a/db/schema_migrations/20210303193605 b/db/schema_migrations/20210303193605 deleted file mode 100644 index f0460522a0e..00000000000 --- a/db/schema_migrations/20210303193605 +++ /dev/null @@ -1 +0,0 @@ -d79c7059c9d79b3e437ed649f19e587e713ba8dbd0af9f58ace4f4f522b4ac11
\ No newline at end of file diff --git a/db/schema_migrations/20210304133508 b/db/schema_migrations/20210304133508 deleted file mode 100644 index c57b04c24fb..00000000000 --- a/db/schema_migrations/20210304133508 +++ /dev/null @@ -1 +0,0 @@ -a6bf41632fc3d81d2c015d2d848f4e74468ec8cfeb2a2afb644fd92189e95e21
\ No newline at end of file diff --git a/db/schema_migrations/20210305002016 b/db/schema_migrations/20210305002016 deleted file mode 100644 index a4bc67d505a..00000000000 --- a/db/schema_migrations/20210305002016 +++ /dev/null @@ -1 +0,0 @@ -c91541048b119bcbbe9454760c6a90ddb6c4dc90e121f3ee7f4cdd6a1bde2c9e
\ No newline at end of file diff --git a/db/schema_migrations/20210305013509 b/db/schema_migrations/20210305013509 deleted file mode 100644 index 6649e76508b..00000000000 --- a/db/schema_migrations/20210305013509 +++ /dev/null @@ -1 +0,0 @@ -743344bb057d0e368c69cc3c90f72d560359d0753acf069e7423928c778a140a
\ No newline at end of file diff --git a/db/schema_migrations/20210305031822 b/db/schema_migrations/20210305031822 deleted file mode 100644 index 8c09ba8d22f..00000000000 --- a/db/schema_migrations/20210305031822 +++ /dev/null @@ -1 +0,0 @@ -d91eb442db670adef6d610a2c79259377709e5c98615ba10b85eb998715b3130
\ No newline at end of file diff --git a/db/schema_migrations/20210305145622 b/db/schema_migrations/20210305145622 deleted file mode 100644 index 4a4c89a03c8..00000000000 --- a/db/schema_migrations/20210305145622 +++ /dev/null @@ -1 +0,0 @@ -be22d5a1c61cbb8b2396a351951ffcee54fbf37dc5ef5f899576a36a14200e75
\ No newline at end of file diff --git a/db/schema_migrations/20210305180331 b/db/schema_migrations/20210305180331 deleted file mode 100644 index a7d9a6d10f3..00000000000 --- a/db/schema_migrations/20210305180331 +++ /dev/null @@ -1 +0,0 @@ -cf63d7ffd6bfb93c25c894b26424e9890b43652b4f0bfc259917a4857ff414e2
\ No newline at end of file diff --git a/db/schema_migrations/20210305182740 b/db/schema_migrations/20210305182740 deleted file mode 100644 index 3e45c9cd1d5..00000000000 --- a/db/schema_migrations/20210305182740 +++ /dev/null @@ -1 +0,0 @@ -4c1ae24594ccb85706a4c9836ed1fc8ce47d68863262e90b9109ddc1d83d121b
\ No newline at end of file diff --git a/db/schema_migrations/20210305182855 b/db/schema_migrations/20210305182855 deleted file mode 100644 index 4e42b8d3f99..00000000000 --- a/db/schema_migrations/20210305182855 +++ /dev/null @@ -1 +0,0 @@ -8f9957b7f7744e3d72bba1b2bf9bd2c9a06203091bf8f9dcafc69755db25fef0
\ No newline at end of file diff --git a/db/schema_migrations/20210305183904 b/db/schema_migrations/20210305183904 deleted file mode 100644 index 7e391fc6bc5..00000000000 --- a/db/schema_migrations/20210305183904 +++ /dev/null @@ -1 +0,0 @@ -43af4a4200ba87ebb50627d341bb324896cbe0c36896d50dd81a8a9cfb2eb426
\ No newline at end of file diff --git a/db/schema_migrations/20210306121300 b/db/schema_migrations/20210306121300 deleted file mode 100644 index f46097b1126..00000000000 --- a/db/schema_migrations/20210306121300 +++ /dev/null @@ -1 +0,0 @@ -44d53ac15c5e54c2f1c825286155dec643b82573184026caaf08288512168aef
\ No newline at end of file diff --git a/db/schema_migrations/20210306121310 b/db/schema_migrations/20210306121310 deleted file mode 100644 index 8713032f2d4..00000000000 --- a/db/schema_migrations/20210306121310 +++ /dev/null @@ -1 +0,0 @@ -90072e3dee4517061ff9e08decda7fecb9cc9b38a56345c09685e3cce48a8b66
\ No newline at end of file diff --git a/db/schema_migrations/20210308125742 b/db/schema_migrations/20210308125742 deleted file mode 100644 index 9090fa4dc5e..00000000000 --- a/db/schema_migrations/20210308125742 +++ /dev/null @@ -1 +0,0 @@ -a81f3555d0e1159569687d4967edcd2b5706cdafd5defb8dc725e295eb969861
\ No newline at end of file diff --git a/db/schema_migrations/20210308175224 b/db/schema_migrations/20210308175224 deleted file mode 100644 index c222b9101af..00000000000 --- a/db/schema_migrations/20210308175224 +++ /dev/null @@ -1 +0,0 @@ -ad6e0feff16589839714098a69673edcba50af7a62d98cd078585c5d2aada919
\ No newline at end of file diff --git a/db/schema_migrations/20210308175225 b/db/schema_migrations/20210308175225 deleted file mode 100644 index 7fb92d10f8c..00000000000 --- a/db/schema_migrations/20210308175225 +++ /dev/null @@ -1 +0,0 @@ -9263c522f0632f5b4fc0004e1fe9666bc3a44e4f70cf0d21aab5bb229f08ab5c
\ No newline at end of file diff --git a/db/schema_migrations/20210308175226 b/db/schema_migrations/20210308175226 deleted file mode 100644 index 4d126ff2b63..00000000000 --- a/db/schema_migrations/20210308175226 +++ /dev/null @@ -1 +0,0 @@ -72491b1834a1256a197e8f49c599b28b41773226db4fe70ce402903674d2f622
\ No newline at end of file diff --git a/db/schema_migrations/20210308175227 b/db/schema_migrations/20210308175227 deleted file mode 100644 index 66aaf4ca558..00000000000 --- a/db/schema_migrations/20210308175227 +++ /dev/null @@ -1 +0,0 @@ -e99b8a6242589992ae8b618cb502d16b67672856cef024c1aafe00a1e64e41b9
\ No newline at end of file diff --git a/db/schema_migrations/20210308190413 b/db/schema_migrations/20210308190413 deleted file mode 100644 index 9ddde51b57e..00000000000 --- a/db/schema_migrations/20210308190413 +++ /dev/null @@ -1 +0,0 @@ -cc131cf37f2af8f0f58c7fa6e5055e88a3b2ed413862c155b0d18383aba06058
\ No newline at end of file diff --git a/db/schema_migrations/20210309160106 b/db/schema_migrations/20210309160106 deleted file mode 100644 index d10e9176a71..00000000000 --- a/db/schema_migrations/20210309160106 +++ /dev/null @@ -1 +0,0 @@ -968ba7808c969e29f1c3b6b635bff22f986b60e56cb001737ad8aba1825fd945
\ No newline at end of file diff --git a/db/schema_migrations/20210309181019 b/db/schema_migrations/20210309181019 deleted file mode 100644 index 3055268acc8..00000000000 --- a/db/schema_migrations/20210309181019 +++ /dev/null @@ -1 +0,0 @@ -a31b85b8ab0db2ad4daa5f2c15eacae97432e75e0e0a28f10d81f6a5aa94c8e0
\ No newline at end of file diff --git a/db/schema_migrations/20210310000627 b/db/schema_migrations/20210310000627 deleted file mode 100644 index b52703908c9..00000000000 --- a/db/schema_migrations/20210310000627 +++ /dev/null @@ -1 +0,0 @@ -71cea758ecb70049468531f70c52aec021060cd48e58155de0ba118786562ac6
\ No newline at end of file diff --git a/db/schema_migrations/20210310111009 b/db/schema_migrations/20210310111009 deleted file mode 100644 index 9fa502b1226..00000000000 --- a/db/schema_migrations/20210310111009 +++ /dev/null @@ -1 +0,0 @@ -8b5a69947c44c9c1050f4989e3b373d3eb87832111d0202992c7dd992032c9d1
\ No newline at end of file diff --git a/db/schema_migrations/20210311022012 b/db/schema_migrations/20210311022012 deleted file mode 100644 index fbfe6d2cd23..00000000000 --- a/db/schema_migrations/20210311022012 +++ /dev/null @@ -1 +0,0 @@ -77d023cc7b635f5b3fc4d8c963183ca15e90f6bb747c145bd8efd1a4e47f65a0
\ No newline at end of file diff --git a/db/schema_migrations/20210311045138 b/db/schema_migrations/20210311045138 deleted file mode 100644 index 3dcf40429f9..00000000000 --- a/db/schema_migrations/20210311045138 +++ /dev/null @@ -1 +0,0 @@ -01bbe2af2bc6bdaa6bf1e2fe10557e3f9f969cc60a348f188fbfe126ea7ea97d
\ No newline at end of file diff --git a/db/schema_migrations/20210311045139 b/db/schema_migrations/20210311045139 deleted file mode 100644 index 71026c1b2af..00000000000 --- a/db/schema_migrations/20210311045139 +++ /dev/null @@ -1 +0,0 @@ -2387c8a5516aaf8bcf44c9bad45bfc9844d68d2c03330f67773ce046b21a7a6c
\ No newline at end of file diff --git a/db/schema_migrations/20210311093723 b/db/schema_migrations/20210311093723 deleted file mode 100644 index 9036880454b..00000000000 --- a/db/schema_migrations/20210311093723 +++ /dev/null @@ -1 +0,0 @@ -6af1c870e685b5a7fbc31b658959018c313713f0f35ad776f97d0a804f1c0f05
\ No newline at end of file diff --git a/db/schema_migrations/20210311120152 b/db/schema_migrations/20210311120152 deleted file mode 100644 index d5e739cdf05..00000000000 --- a/db/schema_migrations/20210311120152 +++ /dev/null @@ -1 +0,0 @@ -2ad45eaf6589600d9aadd225b55451d9213a4d858ef2717b7151062f1db225c8
\ No newline at end of file diff --git a/db/schema_migrations/20210311120153 b/db/schema_migrations/20210311120153 deleted file mode 100644 index 2d8f5b253ef..00000000000 --- a/db/schema_migrations/20210311120153 +++ /dev/null @@ -1 +0,0 @@ -3486452547ffa5da3e12837d2f184e356c90fdd1f016f85144a1ba4865825e87
\ No newline at end of file diff --git a/db/schema_migrations/20210311120154 b/db/schema_migrations/20210311120154 deleted file mode 100644 index c3007047230..00000000000 --- a/db/schema_migrations/20210311120154 +++ /dev/null @@ -1 +0,0 @@ -e169ea265b942f636b2386a432e04d9dfccdc95f04113400d44ce59e81537843
\ No newline at end of file diff --git a/db/schema_migrations/20210311120155 b/db/schema_migrations/20210311120155 deleted file mode 100644 index 2d17acdc9f4..00000000000 --- a/db/schema_migrations/20210311120155 +++ /dev/null @@ -1 +0,0 @@ -b7af086a68c530dd528c4ceaf4bca8d04951c0f234f75a09922aa392bb17a796
\ No newline at end of file diff --git a/db/schema_migrations/20210311120156 b/db/schema_migrations/20210311120156 deleted file mode 100644 index b2ac3c856af..00000000000 --- a/db/schema_migrations/20210311120156 +++ /dev/null @@ -1 +0,0 @@ -4715c46f5d76c8eb3a206ad3bbcc94a8c13d1d6a66a7824dba400b0aa49c8aa6
\ No newline at end of file diff --git a/db/schema_migrations/20210312140029 b/db/schema_migrations/20210312140029 deleted file mode 100644 index 7b4d553e244..00000000000 --- a/db/schema_migrations/20210312140029 +++ /dev/null @@ -1 +0,0 @@ -5d63a48f4a9327f683eff093d2862a0b88aa4249c94b2de9751ed6172c9b4799
\ No newline at end of file diff --git a/db/schema_migrations/20210312174321 b/db/schema_migrations/20210312174321 deleted file mode 100644 index 5126ab2675d..00000000000 --- a/db/schema_migrations/20210312174321 +++ /dev/null @@ -1 +0,0 @@ -4fa88193ae328f04465980210d9a43ce8cad978c157bda5e8ae9951538209268
\ No newline at end of file diff --git a/db/schema_migrations/20210312193532 b/db/schema_migrations/20210312193532 deleted file mode 100644 index af5cd0b163c..00000000000 --- a/db/schema_migrations/20210312193532 +++ /dev/null @@ -1 +0,0 @@ -93e92e8eca0765cb8e6e08ec90ce0143d9b31d13e4d61e1b9690dbaed5a1bb63
\ No newline at end of file diff --git a/db/schema_migrations/20210313045617 b/db/schema_migrations/20210313045617 deleted file mode 100644 index d422d0ab5d2..00000000000 --- a/db/schema_migrations/20210313045617 +++ /dev/null @@ -1 +0,0 @@ -d1e6596e9c6825e29c50523dce60fd3d0b3c067c10e210f74640ba94f7938871
\ No newline at end of file diff --git a/db/schema_migrations/20210313045845 b/db/schema_migrations/20210313045845 deleted file mode 100644 index 8e2b5605f8b..00000000000 --- a/db/schema_migrations/20210313045845 +++ /dev/null @@ -1 +0,0 @@ -bc6302444f7a0a858c821d971fc45a4ececd7b877020f8e920a244866c60b7a2
\ No newline at end of file diff --git a/db/schema_migrations/20210316094047 b/db/schema_migrations/20210316094047 deleted file mode 100644 index d5d23d1e2c2..00000000000 --- a/db/schema_migrations/20210316094047 +++ /dev/null @@ -1 +0,0 @@ -208df71aa7c2dc447ea8f63ca8cc02344a78bd739c7a0e9457c665bfb831a879
\ No newline at end of file diff --git a/db/schema_migrations/20210316094323 b/db/schema_migrations/20210316094323 deleted file mode 100644 index 9ad5baba2bd..00000000000 --- a/db/schema_migrations/20210316094323 +++ /dev/null @@ -1 +0,0 @@ -e1d83121dd3bd1a608626910a8238546816870f6f36840d96b2b4ac3415af985
\ No newline at end of file diff --git a/db/schema_migrations/20210316152500 b/db/schema_migrations/20210316152500 deleted file mode 100644 index fe2f477a9d7..00000000000 --- a/db/schema_migrations/20210316152500 +++ /dev/null @@ -1 +0,0 @@ -c2e3f8f6f283d919d99b0acf970f663fef8ca30ef277116401549014fc99ae91
\ No newline at end of file diff --git a/db/schema_migrations/20210316171009 b/db/schema_migrations/20210316171009 deleted file mode 100644 index baf2152bb17..00000000000 --- a/db/schema_migrations/20210316171009 +++ /dev/null @@ -1 +0,0 @@ -b17c853b2bc82cfa83cd82b8023eca39d875d898b99e78c81d767a73391a0b75
\ No newline at end of file diff --git a/db/schema_migrations/20210317035357 b/db/schema_migrations/20210317035357 deleted file mode 100644 index c8cc61fd9fc..00000000000 --- a/db/schema_migrations/20210317035357 +++ /dev/null @@ -1 +0,0 @@ -6fb6381e969d062f19b5269b4958306c3bf9a1b7cf06e5b0eb25beb005952d07
\ No newline at end of file diff --git a/db/schema_migrations/20210317100520 b/db/schema_migrations/20210317100520 deleted file mode 100644 index f75c67143c2..00000000000 --- a/db/schema_migrations/20210317100520 +++ /dev/null @@ -1 +0,0 @@ -54c701451c305ffdead2a9019cf07adae835c5873025caa1f32169f5ae83bf5d
\ No newline at end of file diff --git a/db/schema_migrations/20210317104032 b/db/schema_migrations/20210317104032 deleted file mode 100644 index 616397a0663..00000000000 --- a/db/schema_migrations/20210317104032 +++ /dev/null @@ -1 +0,0 @@ -c954e1f2bfdfddc98030bfa0ab28f58a41921cbb5b81e088cde12637e3ae5a8f
\ No newline at end of file diff --git a/db/schema_migrations/20210317104301 b/db/schema_migrations/20210317104301 deleted file mode 100644 index c0bd8549c6a..00000000000 --- a/db/schema_migrations/20210317104301 +++ /dev/null @@ -1 +0,0 @@ -c502a539a50ef1b8f07a8c22426a23cf974ee663fc80a99abe0d658e2a07f52b
\ No newline at end of file diff --git a/db/schema_migrations/20210317105904 b/db/schema_migrations/20210317105904 deleted file mode 100644 index 51dcb6516a0..00000000000 --- a/db/schema_migrations/20210317105904 +++ /dev/null @@ -1 +0,0 @@ -64675f43f66d90158147c62699c0d2a48dc74d017c81b30ce3847408d0dad3cb
\ No newline at end of file diff --git a/db/schema_migrations/20210317123054 b/db/schema_migrations/20210317123054 deleted file mode 100644 index 1a18d409ac7..00000000000 --- a/db/schema_migrations/20210317123054 +++ /dev/null @@ -1 +0,0 @@ -28b1e8add8ac7249be55ccd25e60c8a181d2ff036a7d69ac861bcdb5bf5e84e1
\ No newline at end of file diff --git a/db/schema_migrations/20210317155207 b/db/schema_migrations/20210317155207 deleted file mode 100644 index 3038d9cb4ab..00000000000 --- a/db/schema_migrations/20210317155207 +++ /dev/null @@ -1 +0,0 @@ -b6c30723c2be7dd0afe535272cded230db4954bfe914d5087542be2c27d0ad79
\ No newline at end of file diff --git a/db/schema_migrations/20210317192943 b/db/schema_migrations/20210317192943 deleted file mode 100644 index d03b325fa77..00000000000 --- a/db/schema_migrations/20210317192943 +++ /dev/null @@ -1 +0,0 @@ -dfb88ea7a213da1e56bef532255f01a284d7b9be9ec8a6b9dd0e95ec04d0f524
\ No newline at end of file diff --git a/db/schema_migrations/20210317210338 b/db/schema_migrations/20210317210338 deleted file mode 100644 index 15400399589..00000000000 --- a/db/schema_migrations/20210317210338 +++ /dev/null @@ -1 +0,0 @@ -e915378e1ebb78b528abfecda55cdc52a690d982e4377876b818197b3134c09a
\ No newline at end of file diff --git a/db/schema_migrations/20210318134427 b/db/schema_migrations/20210318134427 deleted file mode 100644 index 3fe6ac49550..00000000000 --- a/db/schema_migrations/20210318134427 +++ /dev/null @@ -1 +0,0 @@ -07f4619577b05ea6a62045c81de7d225841bea28c0dd8f2cdb2011c902fd3e5a
\ No newline at end of file diff --git a/db/schema_migrations/20210319071214 b/db/schema_migrations/20210319071214 deleted file mode 100644 index ee3a7613d63..00000000000 --- a/db/schema_migrations/20210319071214 +++ /dev/null @@ -1 +0,0 @@ -3f9e229fc13075c2a2d42931b163c8069089458d66bc565609b393e07460f25d
\ No newline at end of file diff --git a/db/schema_migrations/20210322063407 b/db/schema_migrations/20210322063407 deleted file mode 100644 index bea9c3f2ba0..00000000000 --- a/db/schema_migrations/20210322063407 +++ /dev/null @@ -1 +0,0 @@ -d520fe71ca271c135b9684dc7a03ede27832659459f7476787798d11460c4736
\ No newline at end of file diff --git a/db/schema_migrations/20210322063450 b/db/schema_migrations/20210322063450 deleted file mode 100644 index 7c4a1ba65bf..00000000000 --- a/db/schema_migrations/20210322063450 +++ /dev/null @@ -1 +0,0 @@ -fdf858a31e27fb2ce4071642b6e2d76082db95f6ebbec63ce627f92ddf7edfcf
\ No newline at end of file diff --git a/db/schema_migrations/20210322115438 b/db/schema_migrations/20210322115438 deleted file mode 100644 index 94db65a9a8a..00000000000 --- a/db/schema_migrations/20210322115438 +++ /dev/null @@ -1 +0,0 @@ -e177c2cc0b59eea54de10417445b391cea7dd308547077aea34054fac22b9e40
\ No newline at end of file diff --git a/db/schema_migrations/20210322182751 b/db/schema_migrations/20210322182751 deleted file mode 100644 index 615f3c7a5de..00000000000 --- a/db/schema_migrations/20210322182751 +++ /dev/null @@ -1 +0,0 @@ -79ad2de15faef8edb8752c2a9c89f1739a805af999c86db6e73482a613c4f9d1
\ No newline at end of file diff --git a/db/schema_migrations/20210323064751 b/db/schema_migrations/20210323064751 deleted file mode 100644 index 3ce610ecb0d..00000000000 --- a/db/schema_migrations/20210323064751 +++ /dev/null @@ -1 +0,0 @@ -4ef75890cf2c30954e0d1ff04c75b58cb910315ea1ed345e351edd035b681cc6
\ No newline at end of file diff --git a/db/schema_migrations/20210323125809 b/db/schema_migrations/20210323125809 deleted file mode 100644 index 353bf743ebf..00000000000 --- a/db/schema_migrations/20210323125809 +++ /dev/null @@ -1 +0,0 @@ -f8c4a3da0931ee04654050e3b172814e7ea1238bac501794e39d0d68592da8fa
\ No newline at end of file diff --git a/db/schema_migrations/20210323130831 b/db/schema_migrations/20210323130831 deleted file mode 100644 index b296b8a5bd1..00000000000 --- a/db/schema_migrations/20210323130831 +++ /dev/null @@ -1 +0,0 @@ -ca53c3d2bf58aeb803f942ce122a84d7ce587fcceb06c5800c44fd5aac1fd6ac
\ No newline at end of file diff --git a/db/schema_migrations/20210323131543 b/db/schema_migrations/20210323131543 deleted file mode 100644 index 1edba1a0f3d..00000000000 --- a/db/schema_migrations/20210323131543 +++ /dev/null @@ -1 +0,0 @@ -a4cac229cdd249feef18a39e845158952bef2f67fa2784713db47ab9a06495bd
\ No newline at end of file diff --git a/db/schema_migrations/20210323155010 b/db/schema_migrations/20210323155010 deleted file mode 100644 index 23225216b5a..00000000000 --- a/db/schema_migrations/20210323155010 +++ /dev/null @@ -1 +0,0 @@ -1143241b1a8d1554c86a8d72d43276fa15c0193e510f47d5d7c64769860c60e3
\ No newline at end of file diff --git a/db/schema_migrations/20210323182846 b/db/schema_migrations/20210323182846 deleted file mode 100644 index aa4ab4ba7fd..00000000000 --- a/db/schema_migrations/20210323182846 +++ /dev/null @@ -1 +0,0 @@ -9ee014f462ec0d2affaab146243fb991298e9b30bd57b741fba0440b1676de03
\ No newline at end of file diff --git a/db/schema_migrations/20210324112439 b/db/schema_migrations/20210324112439 deleted file mode 100644 index e0cf51c3a54..00000000000 --- a/db/schema_migrations/20210324112439 +++ /dev/null @@ -1 +0,0 @@ -7e6dd4e247ad6b610ebebcf59b4212fd0d2258c8fff008d525b891da872613e5
\ No newline at end of file diff --git a/db/schema_migrations/20210324131727 b/db/schema_migrations/20210324131727 deleted file mode 100644 index 85ea4aad1ee..00000000000 --- a/db/schema_migrations/20210324131727 +++ /dev/null @@ -1 +0,0 @@ -e0fab4d950a5be032f823160b1805c44262f9e3d233dc76cd108483a5b92896b
\ No newline at end of file diff --git a/db/schema_migrations/20210325092215 b/db/schema_migrations/20210325092215 deleted file mode 100644 index 0693c47994b..00000000000 --- a/db/schema_migrations/20210325092215 +++ /dev/null @@ -1 +0,0 @@ -ea819fd401c5566986fd495ed3b8aa0d296d6c9e3fedf2a10f34cb7fbaeedb20
\ No newline at end of file diff --git a/db/schema_migrations/20210325113129 b/db/schema_migrations/20210325113129 deleted file mode 100644 index 86c212db71b..00000000000 --- a/db/schema_migrations/20210325113129 +++ /dev/null @@ -1 +0,0 @@ -27fcdd54a21d554e44df621e409b81fe248e00851c856d315f4f64b463c7a5b7
\ No newline at end of file diff --git a/db/schema_migrations/20210325150837 b/db/schema_migrations/20210325150837 deleted file mode 100644 index 716462ad187..00000000000 --- a/db/schema_migrations/20210325150837 +++ /dev/null @@ -1 +0,0 @@ -6022464130d7a5697f52b9238837c6a6d3363fd349cbcb14052ff52de6ea2e59
\ No newline at end of file diff --git a/db/schema_migrations/20210325151758 b/db/schema_migrations/20210325151758 deleted file mode 100644 index a3d5f1b1b0a..00000000000 --- a/db/schema_migrations/20210325151758 +++ /dev/null @@ -1 +0,0 @@ -de55a114773961e6cae9ebae36ac93e60676555fe4c2973527511bb3a2eae69d
\ No newline at end of file diff --git a/db/schema_migrations/20210325152011 b/db/schema_migrations/20210325152011 deleted file mode 100644 index f685bcd7d9d..00000000000 --- a/db/schema_migrations/20210325152011 +++ /dev/null @@ -1 +0,0 @@ -379fdb3c52e55b51ebdb4a3b1e67c12f19b15e97cce22eed351e33953e389c85
\ No newline at end of file diff --git a/db/schema_migrations/20210326035553 b/db/schema_migrations/20210326035553 deleted file mode 100644 index da34de0fafe..00000000000 --- a/db/schema_migrations/20210326035553 +++ /dev/null @@ -1 +0,0 @@ -018381c15d859a777afb2b3402ca4425ce52ab35dcd4d1e930b3a9928b2a2019
\ No newline at end of file diff --git a/db/schema_migrations/20210326121537 b/db/schema_migrations/20210326121537 deleted file mode 100644 index ece53e34413..00000000000 --- a/db/schema_migrations/20210326121537 +++ /dev/null @@ -1 +0,0 @@ -ac8063901a0de1f2e6d4fd5336f54bfca0bafa9d081066124ec9d2acf47c9b47
\ No newline at end of file diff --git a/db/schema_migrations/20210326190903 b/db/schema_migrations/20210326190903 deleted file mode 100644 index fb98949b3ca..00000000000 --- a/db/schema_migrations/20210326190903 +++ /dev/null @@ -1 +0,0 @@ -d6181f8806592106305366f5e8ef508286ed447c1fce0de26f242de736b21809
\ No newline at end of file diff --git a/db/schema_migrations/20210328214434 b/db/schema_migrations/20210328214434 deleted file mode 100644 index a1d74aaa772..00000000000 --- a/db/schema_migrations/20210328214434 +++ /dev/null @@ -1 +0,0 @@ -134fba876b69fd48697975066a734becf337f53baddd986a5c708ea6dd7cbd75
\ No newline at end of file diff --git a/db/schema_migrations/20210329095548 b/db/schema_migrations/20210329095548 deleted file mode 100644 index a3f65e8e446..00000000000 --- a/db/schema_migrations/20210329095548 +++ /dev/null @@ -1 +0,0 @@ -412d0cedef5c933c7de3a70ca2365fe0cfaa4087429ca418854092b6c37904f1
\ No newline at end of file diff --git a/db/schema_migrations/20210329102724 b/db/schema_migrations/20210329102724 deleted file mode 100644 index b2fdccf2bb8..00000000000 --- a/db/schema_migrations/20210329102724 +++ /dev/null @@ -1 +0,0 @@ -b40c702ea6b2120da6fe11b213064a7a124dbc86bfb2d6785bfd2274c44f1e22
\ No newline at end of file diff --git a/db/schema_migrations/20210329191850 b/db/schema_migrations/20210329191850 deleted file mode 100644 index 9b436c7934d..00000000000 --- a/db/schema_migrations/20210329191850 +++ /dev/null @@ -1 +0,0 @@ -2a49d9f33f7dbcbef3cb5d5537db052c527d5268b37496435fe9918ddbb73095
\ No newline at end of file diff --git a/db/schema_migrations/20210329192716 b/db/schema_migrations/20210329192716 deleted file mode 100644 index 8767c215335..00000000000 --- a/db/schema_migrations/20210329192716 +++ /dev/null @@ -1 +0,0 @@ -d0f5341d76183882b68583bc012154566e99050c24a90c9b895d6863ad8f3273
\ No newline at end of file diff --git a/db/schema_migrations/20210330015805 b/db/schema_migrations/20210330015805 deleted file mode 100644 index 14102a0a2d1..00000000000 --- a/db/schema_migrations/20210330015805 +++ /dev/null @@ -1 +0,0 @@ -a435a211d7e8b9a972323769299fc6e537fdeaa127f8db6ab53031901a51ec36
\ No newline at end of file diff --git a/db/schema_migrations/20210330091751 b/db/schema_migrations/20210330091751 deleted file mode 100644 index 0536252e980..00000000000 --- a/db/schema_migrations/20210330091751 +++ /dev/null @@ -1 +0,0 @@ -3a195b9671846409cf6665b13caad9713541d9cdd95c9f246c22b7db225ab02c
\ No newline at end of file diff --git a/db/schema_migrations/20210330130420 b/db/schema_migrations/20210330130420 deleted file mode 100644 index 331738f7f0e..00000000000 --- a/db/schema_migrations/20210330130420 +++ /dev/null @@ -1 +0,0 @@ -de04d010fabd62d9dc995938b69ba178caa5e0a8476af5a78ba68c86698633d6
\ No newline at end of file diff --git a/db/schema_migrations/20210331000934 b/db/schema_migrations/20210331000934 deleted file mode 100644 index 1d55b126d60..00000000000 --- a/db/schema_migrations/20210331000934 +++ /dev/null @@ -1 +0,0 @@ -0bd47f9055aab927a4e8efb4f995f44532880926af9892af60f7d2b8dcdef4a6
\ No newline at end of file diff --git a/db/schema_migrations/20210331105335 b/db/schema_migrations/20210331105335 deleted file mode 100644 index 5d9b8d3fea8..00000000000 --- a/db/schema_migrations/20210331105335 +++ /dev/null @@ -1 +0,0 @@ -2127018617082dbad341bcee68948afe111286fdc2ea9ce8b3d00d356f3c61e0
\ No newline at end of file diff --git a/db/schema_migrations/20210331125111 b/db/schema_migrations/20210331125111 deleted file mode 100644 index 7e6429b4289..00000000000 --- a/db/schema_migrations/20210331125111 +++ /dev/null @@ -1 +0,0 @@ -8c7343dafaa036115e85f30d2d096d14279c80de99f49b969039ed3afa5acdf6
\ No newline at end of file diff --git a/db/schema_migrations/20210331145548 b/db/schema_migrations/20210331145548 deleted file mode 100644 index c903c6f35c8..00000000000 --- a/db/schema_migrations/20210331145548 +++ /dev/null @@ -1 +0,0 @@ -f27446d1950acaf45f623b2cec7733cd7ba4b82eefddfa2203acbbaf77d59e18
\ No newline at end of file diff --git a/db/schema_migrations/20210331180118 b/db/schema_migrations/20210331180118 deleted file mode 100644 index 45e62e7154d..00000000000 --- a/db/schema_migrations/20210331180118 +++ /dev/null @@ -1 +0,0 @@ -d8a17ce963801559292265dd0a997d8dbc69d2fa8b8840622490f878bf1eaa6a
\ No newline at end of file diff --git a/db/schema_migrations/20210401131948 b/db/schema_migrations/20210401131948 deleted file mode 100644 index 8b9950cd32c..00000000000 --- a/db/schema_migrations/20210401131948 +++ /dev/null @@ -1 +0,0 @@ -cbc1cd66cdbe08ac9edee14da255343acdcd8adaea6748ee82980462ae4bb88f
\ No newline at end of file diff --git a/db/schema_migrations/20210401134157 b/db/schema_migrations/20210401134157 deleted file mode 100644 index 864d11258b4..00000000000 --- a/db/schema_migrations/20210401134157 +++ /dev/null @@ -1 +0,0 @@ -02f8ed673f87cb2528022d8352a1551b3c7250986d6dc387c1bbdfbc71123272
\ No newline at end of file diff --git a/db/schema_migrations/20210401134455 b/db/schema_migrations/20210401134455 deleted file mode 100644 index 20a348695e7..00000000000 --- a/db/schema_migrations/20210401134455 +++ /dev/null @@ -1 +0,0 @@ -3420d83bf8a1f44e69960849efa25525883f17a2776ae3ce28db855cd550ca8e
\ No newline at end of file diff --git a/db/schema_migrations/20210401175134 b/db/schema_migrations/20210401175134 deleted file mode 100644 index 8b93c13bfdc..00000000000 --- a/db/schema_migrations/20210401175134 +++ /dev/null @@ -1 +0,0 @@ -07d527134f776dbed2199f1717c34b3a6c41caadcaa3c50e6e5866f2cfad31b0
\ No newline at end of file diff --git a/db/schema_migrations/20210401192808 b/db/schema_migrations/20210401192808 deleted file mode 100644 index fd005c98732..00000000000 --- a/db/schema_migrations/20210401192808 +++ /dev/null @@ -1 +0,0 @@ -1cd4799ed7df41bfb9d96a7d18faaa9cbb2dc03f2a804c2bc3c1a6bba15d6d3d
\ No newline at end of file diff --git a/db/schema_migrations/20210402005225 b/db/schema_migrations/20210402005225 deleted file mode 100644 index 767b1307ca7..00000000000 --- a/db/schema_migrations/20210402005225 +++ /dev/null @@ -1 +0,0 @@ -6c44623655732e9c2916f7a71d51f53e819a216b8936d20d28d6acf37cc94fdf
\ No newline at end of file diff --git a/db/schema_migrations/20210403022952 b/db/schema_migrations/20210403022952 deleted file mode 100644 index 581bc5f89c2..00000000000 --- a/db/schema_migrations/20210403022952 +++ /dev/null @@ -1 +0,0 @@ -c62c2e13bdad42cc1f112f9854fe8d25e1e2aa082cb28341a661c93b8587f1f8
\ No newline at end of file diff --git a/db/schema_migrations/20210406063442 b/db/schema_migrations/20210406063442 deleted file mode 100644 index 75b07b54158..00000000000 --- a/db/schema_migrations/20210406063442 +++ /dev/null @@ -1 +0,0 @@ -d29f002f88440a10674b251791fa027cb0ae1c1b0c4fd776a2078e3c94160f17
\ No newline at end of file diff --git a/db/schema_migrations/20210406140057 b/db/schema_migrations/20210406140057 deleted file mode 100644 index 924de9f2ea3..00000000000 --- a/db/schema_migrations/20210406140057 +++ /dev/null @@ -1 +0,0 @@ -b984ddc5765b6f906a3a2046005e8ad45bab360b095eee7e68c44a8ca5534679
\ No newline at end of file diff --git a/db/schema_migrations/20210406144743 b/db/schema_migrations/20210406144743 deleted file mode 100644 index 2709fa5b1c4..00000000000 --- a/db/schema_migrations/20210406144743 +++ /dev/null @@ -1 +0,0 @@ -64011f8d0bcb293bcd36125a52897901421dd18d96129f1514ea360b558f4294
\ No newline at end of file diff --git a/db/schema_migrations/20210407002511 b/db/schema_migrations/20210407002511 deleted file mode 100644 index 60a45fd29ec..00000000000 --- a/db/schema_migrations/20210407002511 +++ /dev/null @@ -1 +0,0 @@ -174d2c4dc57847060cb19405cc08fffd038c7bfbd4ad749e3e1eccf0e281230b
\ No newline at end of file diff --git a/db/schema_migrations/20210407111027 b/db/schema_migrations/20210407111027 deleted file mode 100644 index 573100cba8a..00000000000 --- a/db/schema_migrations/20210407111027 +++ /dev/null @@ -1 +0,0 @@ -0ae4e5224aeb0c0a78f3730b7c83505946d3aa40680b64fa2f89370ccefdfd45
\ No newline at end of file diff --git a/db/schema_migrations/20210407140539 b/db/schema_migrations/20210407140539 deleted file mode 100644 index 3d861cfee82..00000000000 --- a/db/schema_migrations/20210407140539 +++ /dev/null @@ -1 +0,0 @@ -9f19b44a4ef3131e6ddd9cfea0d8b1eb4499754f2200bea90b5ed41eb688f622
\ No newline at end of file diff --git a/db/schema_migrations/20210407150240 b/db/schema_migrations/20210407150240 deleted file mode 100644 index cfc187d5dd7..00000000000 --- a/db/schema_migrations/20210407150240 +++ /dev/null @@ -1 +0,0 @@ -b5f83e3870dc7c70fbde6071725aa2acb3e99f7c2ed050633c34ed35e696ba1e
\ No newline at end of file diff --git a/db/schema_migrations/20210409084242 b/db/schema_migrations/20210409084242 deleted file mode 100644 index 2d932018355..00000000000 --- a/db/schema_migrations/20210409084242 +++ /dev/null @@ -1 +0,0 @@ -6bd35117ca922fc0d9cb8cbd9b0e6d5d9216457182d5679e705c1f03eef05921
\ No newline at end of file diff --git a/db/schema_migrations/20210409185501 b/db/schema_migrations/20210409185501 deleted file mode 100644 index 9aa098eb495..00000000000 --- a/db/schema_migrations/20210409185501 +++ /dev/null @@ -1 +0,0 @@ -3655b51b9975a73f3b141f53a0e89aba5b90a030abb8f1dfec3d3bcbb08aa1ec
\ No newline at end of file diff --git a/db/schema_migrations/20210409185531 b/db/schema_migrations/20210409185531 deleted file mode 100644 index c399a2e9258..00000000000 --- a/db/schema_migrations/20210409185531 +++ /dev/null @@ -1 +0,0 @@ -1ecd19849ca362a360719c46893f793ffc52b08bd85603305e3fd4d43f3b7ef2
\ No newline at end of file diff --git a/db/schema_migrations/20210411212813 b/db/schema_migrations/20210411212813 deleted file mode 100644 index 835191bf73c..00000000000 --- a/db/schema_migrations/20210411212813 +++ /dev/null @@ -1 +0,0 @@ -47c1d8d699a18f4c52178dd5de6434f9997166e05acd70bdc40ff85a1572a797
\ No newline at end of file diff --git a/db/schema_migrations/20210412111213 b/db/schema_migrations/20210412111213 deleted file mode 100644 index 0d271af38c2..00000000000 --- a/db/schema_migrations/20210412111213 +++ /dev/null @@ -1 +0,0 @@ -c75ab8ef4d6a4ff20109e1c5d054521bd8cd79680f96f4d9e55331d69bac73d6
\ No newline at end of file diff --git a/db/schema_migrations/20210412132736 b/db/schema_migrations/20210412132736 deleted file mode 100644 index 23cadad52aa..00000000000 --- a/db/schema_migrations/20210412132736 +++ /dev/null @@ -1 +0,0 @@ -fa3287ed845c2fa24c3c65825362b4393433e273a3e94ed454ef5cc3b373d8a3
\ No newline at end of file diff --git a/db/schema_migrations/20210412132824 b/db/schema_migrations/20210412132824 deleted file mode 100644 index 3c5d9b79115..00000000000 --- a/db/schema_migrations/20210412132824 +++ /dev/null @@ -1 +0,0 @@ -cb02cb38d6f050ac49ac2c963307da4543590cc5ebd50fbc2225c519f1c96849
\ No newline at end of file diff --git a/db/schema_migrations/20210412142223 b/db/schema_migrations/20210412142223 deleted file mode 100644 index 9ddb9b7f1e4..00000000000 --- a/db/schema_migrations/20210412142223 +++ /dev/null @@ -1 +0,0 @@ -4a1435a56b8e5cddd83b844f84374bca91810bbfc5f44faf2a53fd41f93be69c
\ No newline at end of file diff --git a/db/schema_migrations/20210412172030 b/db/schema_migrations/20210412172030 deleted file mode 100644 index 50b9d2be5d5..00000000000 --- a/db/schema_migrations/20210412172030 +++ /dev/null @@ -1 +0,0 @@ -063cfa0d8a4b9d3947aaf55f0587f6a2a9521866b6e10fc307c5cc82ca3a0623
\ No newline at end of file diff --git a/db/schema_migrations/20210413092922 b/db/schema_migrations/20210413092922 deleted file mode 100644 index 08d7beaec7f..00000000000 --- a/db/schema_migrations/20210413092922 +++ /dev/null @@ -1 +0,0 @@ -2da634fa920e3989d9b8e53ddc1ba005e5bc0f4701426e3841d90a42bd2e908f
\ No newline at end of file diff --git a/db/schema_migrations/20210413121101 b/db/schema_migrations/20210413121101 deleted file mode 100644 index 0eef2adc713..00000000000 --- a/db/schema_migrations/20210413121101 +++ /dev/null @@ -1 +0,0 @@ -fe98a617ac8bacf270425c1e9b9b60aee1c3c0e47d5c915fe122cb99c1c1c822
\ No newline at end of file diff --git a/db/schema_migrations/20210413123832 b/db/schema_migrations/20210413123832 deleted file mode 100644 index 4a8af15f336..00000000000 --- a/db/schema_migrations/20210413123832 +++ /dev/null @@ -1 +0,0 @@ -d166250305c2939bea8cc1970faf50d86776d32270a80a429cce668a97280aad
\ No newline at end of file diff --git a/db/schema_migrations/20210413130011 b/db/schema_migrations/20210413130011 deleted file mode 100644 index c67e9705e7a..00000000000 --- a/db/schema_migrations/20210413130011 +++ /dev/null @@ -1 +0,0 @@ -943466b272406a95c478337de84f72388dae88a8cf88f3b389e3ade9d4ecd63d
\ No newline at end of file diff --git a/db/schema_migrations/20210413132500 b/db/schema_migrations/20210413132500 deleted file mode 100644 index 662c7e33ef0..00000000000 --- a/db/schema_migrations/20210413132500 +++ /dev/null @@ -1 +0,0 @@ -407806cc168ef9859c9a4f1bd4db7a56aee01367e784ea0767889863b9ace35d
\ No newline at end of file diff --git a/db/schema_migrations/20210413155324 b/db/schema_migrations/20210413155324 deleted file mode 100644 index ab7e4256fdb..00000000000 --- a/db/schema_migrations/20210413155324 +++ /dev/null @@ -1 +0,0 @@ -7bb8be1616a61b12392bc5ff4d716123bc605d9753744c04a23f9258bab25af6
\ No newline at end of file diff --git a/db/schema_migrations/20210414045322 b/db/schema_migrations/20210414045322 deleted file mode 100644 index f95da121569..00000000000 --- a/db/schema_migrations/20210414045322 +++ /dev/null @@ -1 +0,0 @@ -197930adaf08e3d22d54309d1cc0605bc4d6843409a38f8e0cc9ce9842ec1816
\ No newline at end of file diff --git a/db/schema_migrations/20210414095944 b/db/schema_migrations/20210414095944 deleted file mode 100644 index 67abfa19822..00000000000 --- a/db/schema_migrations/20210414095944 +++ /dev/null @@ -1 +0,0 @@ -843d9eabf8b67fe10d9eb453e887032d5b88b8594ae666bc6c6ac81e20e1ab53
\ No newline at end of file diff --git a/db/schema_migrations/20210414100914 b/db/schema_migrations/20210414100914 deleted file mode 100644 index dcbc93d9987..00000000000 --- a/db/schema_migrations/20210414100914 +++ /dev/null @@ -1 +0,0 @@ -4950567ba7071183bc008936e4bbe1391dd0100c5caa2a6821be85dc3d2423fc
\ No newline at end of file diff --git a/db/schema_migrations/20210414130017 b/db/schema_migrations/20210414130017 deleted file mode 100644 index 0eaffe4ddd1..00000000000 --- a/db/schema_migrations/20210414130017 +++ /dev/null @@ -1 +0,0 @@ -202409998a03fd29c52e3ee9546ab8ec7aa3c56173ee755e9342f1cc6a5f1f6b
\ No newline at end of file diff --git a/db/schema_migrations/20210414130526 b/db/schema_migrations/20210414130526 deleted file mode 100644 index ebba5c47f22..00000000000 --- a/db/schema_migrations/20210414130526 +++ /dev/null @@ -1 +0,0 @@ -2343decc3abb79b38bcde6aba5a8fd208842096d7fb7a4c51872f66f1a125296
\ No newline at end of file diff --git a/db/schema_migrations/20210414131600 b/db/schema_migrations/20210414131600 deleted file mode 100644 index 2ed1c9856ae..00000000000 --- a/db/schema_migrations/20210414131600 +++ /dev/null @@ -1 +0,0 @@ -199c8a540cb4a0dd30a86a81f993798afb3e7384f1176b71a780d5950a52eb5f
\ No newline at end of file diff --git a/db/schema_migrations/20210414131807 b/db/schema_migrations/20210414131807 deleted file mode 100644 index 9a7800b86f8..00000000000 --- a/db/schema_migrations/20210414131807 +++ /dev/null @@ -1 +0,0 @@ -4db08c0fecd210b329492596cf029518484d256bdb06efff233b3a38677fd6a6
\ No newline at end of file diff --git a/db/schema_migrations/20210414133310 b/db/schema_migrations/20210414133310 deleted file mode 100644 index 9a0a224e09b..00000000000 --- a/db/schema_migrations/20210414133310 +++ /dev/null @@ -1 +0,0 @@ -f306cf9553e4bd237cfdff31d5432d4ff44302a923e475c477f76d32ccb4d257
\ No newline at end of file diff --git a/db/schema_migrations/20210415074645 b/db/schema_migrations/20210415074645 deleted file mode 100644 index d996f095dce..00000000000 --- a/db/schema_migrations/20210415074645 +++ /dev/null @@ -1 +0,0 @@ -393a7f1029f05f73c26e031c8980734e13c304846c3457d581c006dc2566d94d
\ No newline at end of file diff --git a/db/schema_migrations/20210415100159 b/db/schema_migrations/20210415100159 deleted file mode 100644 index 3ee36c7de17..00000000000 --- a/db/schema_migrations/20210415100159 +++ /dev/null @@ -1 +0,0 @@ -dd6474593b6f4dd82f7f4776f558a82fa34307c45e20f13f77807f7dc96db368
\ No newline at end of file diff --git a/db/schema_migrations/20210415101228 b/db/schema_migrations/20210415101228 deleted file mode 100644 index 8edbeee69dc..00000000000 --- a/db/schema_migrations/20210415101228 +++ /dev/null @@ -1 +0,0 @@ -2ba1f8832a6ba4300796ff9f74dfa2d0ff7a648a9231db369274ad002d0e4ec8
\ No newline at end of file diff --git a/db/schema_migrations/20210415142700 b/db/schema_migrations/20210415142700 deleted file mode 100644 index 22b10173911..00000000000 --- a/db/schema_migrations/20210415142700 +++ /dev/null @@ -1 +0,0 @@ -2d6d62b036c937136dfbb11becfd3c2c705f0db1e3a38fdcefe676106168ab29
\ No newline at end of file diff --git a/db/schema_migrations/20210415155043 b/db/schema_migrations/20210415155043 deleted file mode 100644 index 490e4ba5557..00000000000 --- a/db/schema_migrations/20210415155043 +++ /dev/null @@ -1 +0,0 @@ -af66cb13eca39cc6b9970e6764d08b5b353f212d844267afb5583e888c7d2c94
\ No newline at end of file diff --git a/db/schema_migrations/20210415172516 b/db/schema_migrations/20210415172516 deleted file mode 100644 index ad129261acf..00000000000 --- a/db/schema_migrations/20210415172516 +++ /dev/null @@ -1 +0,0 @@ -06d33e4eb99e46cb6caf71916e5c93c4b7eb9fe73152841c7c41d5e157ec339e
\ No newline at end of file diff --git a/db/schema_migrations/20210416172516 b/db/schema_migrations/20210416172516 deleted file mode 100644 index 2ab991bb99c..00000000000 --- a/db/schema_migrations/20210416172516 +++ /dev/null @@ -1 +0,0 @@ -26f3978600808eae8396e0d5292bae95feca52ff3e44a019c04bd9708f27cc84
\ No newline at end of file diff --git a/db/schema_migrations/20210419090412 b/db/schema_migrations/20210419090412 deleted file mode 100644 index de75d4e5cfc..00000000000 --- a/db/schema_migrations/20210419090412 +++ /dev/null @@ -1 +0,0 @@ -da9c3d764a5750a40e0f6edd2e713efd77620ba3e684e48d47c7f855e47b2984
\ No newline at end of file diff --git a/db/schema_migrations/20210419090542 b/db/schema_migrations/20210419090542 deleted file mode 100644 index a6b265e4d17..00000000000 --- a/db/schema_migrations/20210419090542 +++ /dev/null @@ -1 +0,0 @@ -7a7b0eaa67851aa9300e4750fd05c6d2d0b49ca7077099a0208a89c74ac03a2c
\ No newline at end of file diff --git a/db/schema_migrations/20210419203017 b/db/schema_migrations/20210419203017 deleted file mode 100644 index 8421fd7c6d9..00000000000 --- a/db/schema_migrations/20210419203017 +++ /dev/null @@ -1 +0,0 @@ -1ca5f960c233be5d5a30632b8aaad9598c259154eee817f4d76e8f1bb3e95edb
\ No newline at end of file diff --git a/db/schema_migrations/20210419203018 b/db/schema_migrations/20210419203018 deleted file mode 100644 index f28ebe78fc6..00000000000 --- a/db/schema_migrations/20210419203018 +++ /dev/null @@ -1 +0,0 @@ -94404ed645a9c8a0ee462baff98cf2d0e50aecdb71bb1515fd3a82bf1a39dfda
\ No newline at end of file diff --git a/db/schema_migrations/20210419224834 b/db/schema_migrations/20210419224834 deleted file mode 100644 index 61926cfb1df..00000000000 --- a/db/schema_migrations/20210419224834 +++ /dev/null @@ -1 +0,0 @@ -145782c0cb0d24617e0e43c43f49a0f1d4033df3f303e4d4085e586c48e2408e
\ No newline at end of file diff --git a/db/schema_migrations/20210420012444 b/db/schema_migrations/20210420012444 deleted file mode 100644 index 5c098f44bc8..00000000000 --- a/db/schema_migrations/20210420012444 +++ /dev/null @@ -1 +0,0 @@ -f0bf8c79c1981ecd95c933f37ec5b0187ee6321792d96db26d863b192843c5ab
\ No newline at end of file diff --git a/db/schema_migrations/20210420012909 b/db/schema_migrations/20210420012909 deleted file mode 100644 index e4e00349df7..00000000000 --- a/db/schema_migrations/20210420012909 +++ /dev/null @@ -1 +0,0 @@ -c9e8c49bf272ef49d906431bdc11a24abe967a9d7e95976d70c48b21b48a062b
\ No newline at end of file diff --git a/db/schema_migrations/20210420103955 b/db/schema_migrations/20210420103955 deleted file mode 100644 index 001c89e1d10..00000000000 --- a/db/schema_migrations/20210420103955 +++ /dev/null @@ -1 +0,0 @@ -1ee3df66a0e7d1802196740cc1c0a899724c1f5b3dd8be4316915b354446f238
\ No newline at end of file diff --git a/db/schema_migrations/20210420120734 b/db/schema_migrations/20210420120734 deleted file mode 100644 index 124fb5b28fe..00000000000 --- a/db/schema_migrations/20210420120734 +++ /dev/null @@ -1 +0,0 @@ -5404ecd22f943671c076b0e870a487ec822cb3d594c223ad4db5b1584394ceb6
\ No newline at end of file diff --git a/db/schema_migrations/20210420121149 b/db/schema_migrations/20210420121149 deleted file mode 100644 index 1326ed9a6f6..00000000000 --- a/db/schema_migrations/20210420121149 +++ /dev/null @@ -1 +0,0 @@ -58cd21a02a395564acf9abcc39c3daafc5db90aa0b3f29133644f21bb669cdf6
\ No newline at end of file diff --git a/db/schema_migrations/20210420173030 b/db/schema_migrations/20210420173030 deleted file mode 100644 index e7e3caf8365..00000000000 --- a/db/schema_migrations/20210420173030 +++ /dev/null @@ -1 +0,0 @@ -3a223c462b10edb9eb68fc0adf42f046a45f554f35b4b4ee64a834cd7372f827
\ No newline at end of file diff --git a/db/schema_migrations/20210420210642 b/db/schema_migrations/20210420210642 deleted file mode 100644 index dd5d165df5e..00000000000 --- a/db/schema_migrations/20210420210642 +++ /dev/null @@ -1 +0,0 @@ -b7f75e3b443bfcb1aea812ad1682a31a99021f41ef4d47bdf600437db6f4f2f3
\ No newline at end of file diff --git a/db/schema_migrations/20210420221106 b/db/schema_migrations/20210420221106 deleted file mode 100644 index cfe3e6e5406..00000000000 --- a/db/schema_migrations/20210420221106 +++ /dev/null @@ -1 +0,0 @@ -62842b9e9753b7880e980b0a16335e7d00bdce8b7b42d94b1ba26828724c01dd
\ No newline at end of file diff --git a/db/schema_migrations/20210421021510 b/db/schema_migrations/20210421021510 deleted file mode 100644 index 775f083ac63..00000000000 --- a/db/schema_migrations/20210421021510 +++ /dev/null @@ -1 +0,0 @@ -6a278c90b8c97fc2255528605ee6bf4547e37ac8c4c17979483ed9db562fa021
\ No newline at end of file diff --git a/db/schema_migrations/20210421022010 b/db/schema_migrations/20210421022010 deleted file mode 100644 index 75abced628d..00000000000 --- a/db/schema_migrations/20210421022010 +++ /dev/null @@ -1 +0,0 @@ -454992d01fa140896ff2a9cea66fb855c9e659a5a7969ac9a3cb5a608de36161
\ No newline at end of file diff --git a/db/schema_migrations/20210421081724 b/db/schema_migrations/20210421081724 deleted file mode 100644 index a246cfdd428..00000000000 --- a/db/schema_migrations/20210421081724 +++ /dev/null @@ -1 +0,0 @@ -9049dc22e97261115ba935a059beb5b4f2eb810f1fdcc0881f96d4b6a501ab09
\ No newline at end of file diff --git a/db/schema_migrations/20210421163509 b/db/schema_migrations/20210421163509 deleted file mode 100644 index b31e8209bbe..00000000000 --- a/db/schema_migrations/20210421163509 +++ /dev/null @@ -1 +0,0 @@ -0f6019cc094481cafbf0c9bd42f53ae09034ea87e3f360b02f9ec03192caab9d
\ No newline at end of file diff --git a/db/schema_migrations/20210421190157 b/db/schema_migrations/20210421190157 deleted file mode 100644 index a33c8336763..00000000000 --- a/db/schema_migrations/20210421190157 +++ /dev/null @@ -1 +0,0 @@ -943e415d3cc1090286aece96c013e54e4c07a7c16d8a7be82b560b1a3e36d513
\ No newline at end of file diff --git a/db/schema_migrations/20210422022825 b/db/schema_migrations/20210422022825 deleted file mode 100644 index 4f1313658ac..00000000000 --- a/db/schema_migrations/20210422022825 +++ /dev/null @@ -1 +0,0 @@ -d0119a45e6ab08afa6ed73a248b81cae4a4de63d46fda25968444256355d208f
\ No newline at end of file diff --git a/db/schema_migrations/20210422023046 b/db/schema_migrations/20210422023046 deleted file mode 100644 index 520db7527d3..00000000000 --- a/db/schema_migrations/20210422023046 +++ /dev/null @@ -1 +0,0 @@ -e588b2e6c612e4a25615d9c5179100af20d3507e0eec8feba52bc6b45d9befea
\ No newline at end of file diff --git a/db/schema_migrations/20210422142647 b/db/schema_migrations/20210422142647 deleted file mode 100644 index f5a8b6cc29f..00000000000 --- a/db/schema_migrations/20210422142647 +++ /dev/null @@ -1 +0,0 @@ -eaefc2a0f08ce312b1ae3fb100e4a818eb3013b95c38d940371a25b605b09ca1
\ No newline at end of file diff --git a/db/schema_migrations/20210422181809 b/db/schema_migrations/20210422181809 deleted file mode 100644 index 547e44f87b3..00000000000 --- a/db/schema_migrations/20210422181809 +++ /dev/null @@ -1 +0,0 @@ -870589d3a4b4bc139ac29b0d87b0f9e777de21e854e5692c0dedd6683c83649a
\ No newline at end of file diff --git a/db/schema_migrations/20210422195929 b/db/schema_migrations/20210422195929 deleted file mode 100644 index 1078f45678d..00000000000 --- a/db/schema_migrations/20210422195929 +++ /dev/null @@ -1 +0,0 @@ -d72c4cbd4d34fcfb3aae5aa11c583509b41499aa8bd107957934ab57d1756544
\ No newline at end of file diff --git a/db/schema_migrations/20210423054022 b/db/schema_migrations/20210423054022 deleted file mode 100644 index 4717a9e99b7..00000000000 --- a/db/schema_migrations/20210423054022 +++ /dev/null @@ -1 +0,0 @@ -84f7b631c9017b286665beca42fb30e064c852d5a21c2f82a8bee6f0d5e62c25
\ No newline at end of file diff --git a/db/schema_migrations/20210423054537 b/db/schema_migrations/20210423054537 deleted file mode 100644 index a530190a32e..00000000000 --- a/db/schema_migrations/20210423054537 +++ /dev/null @@ -1 +0,0 @@ -0ea5c328f9d15d73744f8847c4b1071e2a360cd52ce0da1216ca6acc768050e5
\ No newline at end of file diff --git a/db/schema_migrations/20210423054846 b/db/schema_migrations/20210423054846 deleted file mode 100644 index 08669e2427b..00000000000 --- a/db/schema_migrations/20210423054846 +++ /dev/null @@ -1 +0,0 @@ -013106237f73a94606f962f54c740af23deac637c8e075471ba03ef5d6c1b953
\ No newline at end of file diff --git a/db/schema_migrations/20210423124223 b/db/schema_migrations/20210423124223 deleted file mode 100644 index d5b07602553..00000000000 --- a/db/schema_migrations/20210423124223 +++ /dev/null @@ -1 +0,0 @@ -6b508f1a48402aa2db3862e2e31ee4ccb851f535ed59f9b949ac1bad0ff2f0e1
\ No newline at end of file diff --git a/db/schema_migrations/20210423155059 b/db/schema_migrations/20210423155059 deleted file mode 100644 index 2ac51dcdd2b..00000000000 --- a/db/schema_migrations/20210423155059 +++ /dev/null @@ -1 +0,0 @@ -c582b7dda33492e122725001200aeb470cbf4458f247728a3b2102e325c97193
\ No newline at end of file diff --git a/db/schema_migrations/20210423160427 b/db/schema_migrations/20210423160427 deleted file mode 100644 index ecae878d8a2..00000000000 --- a/db/schema_migrations/20210423160427 +++ /dev/null @@ -1 +0,0 @@ -e8f88972826a030894f38b8959418096771bf4e88a3b90f0026aaae3977d1db1
\ No newline at end of file diff --git a/db/schema_migrations/20210423164702 b/db/schema_migrations/20210423164702 deleted file mode 100644 index 3f800be3749..00000000000 --- a/db/schema_migrations/20210423164702 +++ /dev/null @@ -1 +0,0 @@ -b5e34f7827edcdf81c66250353cddc3481e39c693f983df610b8ed20c58cb65b
\ No newline at end of file diff --git a/db/schema_migrations/20210423171304 b/db/schema_migrations/20210423171304 deleted file mode 100644 index 56db70a407c..00000000000 --- a/db/schema_migrations/20210423171304 +++ /dev/null @@ -1 +0,0 @@ -06ead319cbc56b25769ed06b6a246d705b467d34a5d09ab9282e2d83c55511ba
\ No newline at end of file diff --git a/db/schema_migrations/20210424115725 b/db/schema_migrations/20210424115725 deleted file mode 100644 index e1b7faf5276..00000000000 --- a/db/schema_migrations/20210424115725 +++ /dev/null @@ -1 +0,0 @@ -66c4c48c53131a156c0bf45982691e9017373aefae1f7b6d7053467481b3f5cf
\ No newline at end of file diff --git a/db/schema_migrations/20210424163400 b/db/schema_migrations/20210424163400 deleted file mode 100644 index ebc4b319aca..00000000000 --- a/db/schema_migrations/20210424163400 +++ /dev/null @@ -1 +0,0 @@ -808e4c1b0bb4f44afea57cce84820ef1371ae852d7cbc79ef454c04219ea956d
\ No newline at end of file diff --git a/db/schema_migrations/20210426094524 b/db/schema_migrations/20210426094524 deleted file mode 100644 index 832f2728534..00000000000 --- a/db/schema_migrations/20210426094524 +++ /dev/null @@ -1 +0,0 @@ -46de2e905a591c14ce18acf041bac6fb48ec19ad9f40fababcbf27ae02f7fa75
\ No newline at end of file diff --git a/db/schema_migrations/20210426094549 b/db/schema_migrations/20210426094549 deleted file mode 100644 index 8e3c5347a50..00000000000 --- a/db/schema_migrations/20210426094549 +++ /dev/null @@ -1 +0,0 @@ -12ad8f05a4d864d9986d6ca400a687c40b2de1acb461b134a8103f9a882921e7
\ No newline at end of file diff --git a/db/schema_migrations/20210426225417 b/db/schema_migrations/20210426225417 deleted file mode 100644 index 2ba6e666520..00000000000 --- a/db/schema_migrations/20210426225417 +++ /dev/null @@ -1 +0,0 @@ -50d370d2465fa4c0d3c2bd963d5745474ca35a43609d0e754f3fe69eb7a7179f
\ No newline at end of file diff --git a/db/schema_migrations/20210427045604 b/db/schema_migrations/20210427045604 deleted file mode 100644 index 6cb29994a87..00000000000 --- a/db/schema_migrations/20210427045604 +++ /dev/null @@ -1 +0,0 @@ -bdeb78403607d45d5eb779623d0e2aa1acf026f6aced6f1134824a35dfec7e74
\ No newline at end of file diff --git a/db/schema_migrations/20210427045711 b/db/schema_migrations/20210427045711 deleted file mode 100644 index bb713fc08d0..00000000000 --- a/db/schema_migrations/20210427045711 +++ /dev/null @@ -1 +0,0 @@ -3cd56794ac903d9598863215a34eda62c3dc96bed78bed5b8a99fc522e319b35
\ No newline at end of file diff --git a/db/schema_migrations/20210427062807 b/db/schema_migrations/20210427062807 deleted file mode 100644 index c9d82dfa931..00000000000 --- a/db/schema_migrations/20210427062807 +++ /dev/null @@ -1 +0,0 @@ -306bb2bc3bfd20a57f1ac473e32596e7b7e7b6c2ae41c3fe5a7f45c551ce9207
\ No newline at end of file diff --git a/db/schema_migrations/20210427084924 b/db/schema_migrations/20210427084924 deleted file mode 100644 index feaeeefa80b..00000000000 --- a/db/schema_migrations/20210427084924 +++ /dev/null @@ -1 +0,0 @@ -a2fcf3576de4ee5afdab8d07ffc6c2c8f96d6cc85c332f6ab69f2936bf9e58ae
\ No newline at end of file diff --git a/db/schema_migrations/20210427085020 b/db/schema_migrations/20210427085020 deleted file mode 100644 index 7f45de093b4..00000000000 --- a/db/schema_migrations/20210427085020 +++ /dev/null @@ -1 +0,0 @@ -2e30910d106dd6805f42ffc226d9008b826fa88eaec7091960e11db850b714c4
\ No newline at end of file diff --git a/db/schema_migrations/20210427094931 b/db/schema_migrations/20210427094931 deleted file mode 100644 index 830c92e9878..00000000000 --- a/db/schema_migrations/20210427094931 +++ /dev/null @@ -1 +0,0 @@ -aa0ae491a7f94d99ea0c42250434245a4f23b0084657b709b0aaad0317dfd6b1
\ No newline at end of file diff --git a/db/schema_migrations/20210427125400 b/db/schema_migrations/20210427125400 deleted file mode 100644 index 285f1efb026..00000000000 --- a/db/schema_migrations/20210427125400 +++ /dev/null @@ -1 +0,0 @@ -7632c2442c5cb9194c177df9b9106efdb433d43b34250fc434c1e1ff2f8ed8f0
\ No newline at end of file diff --git a/db/schema_migrations/20210427194958 b/db/schema_migrations/20210427194958 deleted file mode 100644 index a707b804ba9..00000000000 --- a/db/schema_migrations/20210427194958 +++ /dev/null @@ -1 +0,0 @@ -0a7bf3fe10a5eca94392a599d0736c881065a0b2c33bb383c0b91eb5ac453db9
\ No newline at end of file diff --git a/db/schema_migrations/20210427200840 b/db/schema_migrations/20210427200840 deleted file mode 100644 index 3e84d260952..00000000000 --- a/db/schema_migrations/20210427200840 +++ /dev/null @@ -1 +0,0 @@ -7e90e64df39205c79a67acc311cd58dd9b55d2b3919d58749e3253854f99a44a
\ No newline at end of file diff --git a/db/schema_migrations/20210427212034 b/db/schema_migrations/20210427212034 deleted file mode 100644 index 4954b5722a9..00000000000 --- a/db/schema_migrations/20210427212034 +++ /dev/null @@ -1 +0,0 @@ -2ffe65c4abcb8f638198943e1b74de710387438fb7c93addb05ccb3e86729934
\ No newline at end of file diff --git a/db/schema_migrations/20210428151144 b/db/schema_migrations/20210428151144 deleted file mode 100644 index 53771dd9401..00000000000 --- a/db/schema_migrations/20210428151144 +++ /dev/null @@ -1 +0,0 @@ -468373a97f7bd66197c81f01bebd27256cf96ec8fc226c5d73e579a7ecc3930d
\ No newline at end of file diff --git a/db/schema_migrations/20210428151238 b/db/schema_migrations/20210428151238 deleted file mode 100644 index 3fa6ecefc42..00000000000 --- a/db/schema_migrations/20210428151238 +++ /dev/null @@ -1 +0,0 @@ -3244023441c2afa450ad76345a494975b4a7154892298daf1ec4223d27fb7ca3
\ No newline at end of file diff --git a/db/schema_migrations/20210429024843 b/db/schema_migrations/20210429024843 deleted file mode 100644 index 2016dde93b6..00000000000 --- a/db/schema_migrations/20210429024843 +++ /dev/null @@ -1 +0,0 @@ -5307ed6d22ba2575db0734eb8949b6987e58be27a845921b4943123adc2b9f41
\ No newline at end of file diff --git a/db/schema_migrations/20210429032320 b/db/schema_migrations/20210429032320 deleted file mode 100644 index a026fb1a3c5..00000000000 --- a/db/schema_migrations/20210429032320 +++ /dev/null @@ -1 +0,0 @@ -f1a5f9a394c02544be99316d8e64464adeb4f9849875200e7e8be6fe826e5e62
\ No newline at end of file diff --git a/db/schema_migrations/20210429131525 b/db/schema_migrations/20210429131525 deleted file mode 100644 index 4ab6b84eea9..00000000000 --- a/db/schema_migrations/20210429131525 +++ /dev/null @@ -1 +0,0 @@ -68ac54fa7b4e4ef99e58c31d8f960b6f986fd679c11ead235704c7a75b4617ac
\ No newline at end of file diff --git a/db/schema_migrations/20210429143649 b/db/schema_migrations/20210429143649 deleted file mode 100644 index 6e7469ef4de..00000000000 --- a/db/schema_migrations/20210429143649 +++ /dev/null @@ -1 +0,0 @@ -949e1323d1fadd8db3b8b337f3071ab7b7a7c45b11dc40924fb64c074596a327
\ No newline at end of file diff --git a/db/schema_migrations/20210429181325 b/db/schema_migrations/20210429181325 deleted file mode 100644 index d778566a580..00000000000 --- a/db/schema_migrations/20210429181325 +++ /dev/null @@ -1 +0,0 @@ -9674f04640f897928925ff1e23ff6d3ff918627b7c2374713a31071678956614
\ No newline at end of file diff --git a/db/schema_migrations/20210429192653 b/db/schema_migrations/20210429192653 deleted file mode 100644 index 5e380380d72..00000000000 --- a/db/schema_migrations/20210429192653 +++ /dev/null @@ -1 +0,0 @@ -c2b5ad6786e1c71ccff391b03fcd0635dfd42d69484443291a692cef9f3ffda5
\ No newline at end of file diff --git a/db/schema_migrations/20210429193106 b/db/schema_migrations/20210429193106 deleted file mode 100644 index 49f1838a585..00000000000 --- a/db/schema_migrations/20210429193106 +++ /dev/null @@ -1 +0,0 @@ -e0898e4e439cde4e3b84808e7505490fe956cf17922f5c779b3384997d36cafd
\ No newline at end of file diff --git a/db/schema_migrations/20210430034712 b/db/schema_migrations/20210430034712 deleted file mode 100644 index df9fe0755cf..00000000000 --- a/db/schema_migrations/20210430034712 +++ /dev/null @@ -1 +0,0 @@ -6b7436d7712e31ca116204d37270435ccc059ca75a128750e5c39fdddfa020e3
\ No newline at end of file diff --git a/db/schema_migrations/20210430100947 b/db/schema_migrations/20210430100947 deleted file mode 100644 index 409d807ff2a..00000000000 --- a/db/schema_migrations/20210430100947 +++ /dev/null @@ -1 +0,0 @@ -c8875e02134542370cc5a792bdaefc77b66f58a33a46720f5ef562c33c5b8f41
\ No newline at end of file diff --git a/db/schema_migrations/20210430121522 b/db/schema_migrations/20210430121522 deleted file mode 100644 index 0ad04fc386a..00000000000 --- a/db/schema_migrations/20210430121522 +++ /dev/null @@ -1 +0,0 @@ -feee3b817b18ab913071c29b5c6283d91268dc62b31ee2441c1cb116bf0d77c9
\ No newline at end of file diff --git a/db/schema_migrations/20210430121542 b/db/schema_migrations/20210430121542 deleted file mode 100644 index 40ad284a6ba..00000000000 --- a/db/schema_migrations/20210430121542 +++ /dev/null @@ -1 +0,0 @@ -00ac4ff6896f65d7ad7d259d7e5a39efcbf73b189f7c2c5a472f50aa45663235
\ No newline at end of file diff --git a/db/schema_migrations/20210430122951 b/db/schema_migrations/20210430122951 deleted file mode 100644 index 43c90a10f22..00000000000 --- a/db/schema_migrations/20210430122951 +++ /dev/null @@ -1 +0,0 @@ -476dc70eae87ad3ee30e6be8c1afb4a2aec23a09b96daba2afbd9c4e2edb12b9
\ No newline at end of file diff --git a/db/schema_migrations/20210430124212 b/db/schema_migrations/20210430124212 deleted file mode 100644 index dd3e8c1f371..00000000000 --- a/db/schema_migrations/20210430124212 +++ /dev/null @@ -1 +0,0 @@ -ebdeb56647f3a7ff5620141833c90b796a9ddfed39234bcf8063ca5b3df6c1f3
\ No newline at end of file diff --git a/db/schema_migrations/20210430124630 b/db/schema_migrations/20210430124630 deleted file mode 100644 index 2366ab58ef4..00000000000 --- a/db/schema_migrations/20210430124630 +++ /dev/null @@ -1 +0,0 @@ -7f6862205e8c315da8433083fc5391f8889951f62d466e0048063322a46f9cc7
\ No newline at end of file diff --git a/db/schema_migrations/20210430130259 b/db/schema_migrations/20210430130259 deleted file mode 100644 index b8064b30f52..00000000000 --- a/db/schema_migrations/20210430130259 +++ /dev/null @@ -1 +0,0 @@ -c4a4b214f15a1a8d7f6832782d50077189281ca9a9b1b746a0a3bc3af4a47e3c
\ No newline at end of file diff --git a/db/schema_migrations/20210430134202 b/db/schema_migrations/20210430134202 deleted file mode 100644 index cb9eee98cc0..00000000000 --- a/db/schema_migrations/20210430134202 +++ /dev/null @@ -1 +0,0 @@ -77e2b8c1c6054a80122f97dda1e843149fefb7bf6694fdfa897d691d61162d81
\ No newline at end of file diff --git a/db/schema_migrations/20210430135954 b/db/schema_migrations/20210430135954 deleted file mode 100644 index 9e201905704..00000000000 --- a/db/schema_migrations/20210430135954 +++ /dev/null @@ -1 +0,0 @@ -c5fe6f74822168599ad5069bb7c793ec96a4bba99d15ad29cb161ef24291b56d
\ No newline at end of file diff --git a/db/schema_migrations/20210430154631 b/db/schema_migrations/20210430154631 deleted file mode 100644 index 6369c657d5a..00000000000 --- a/db/schema_migrations/20210430154631 +++ /dev/null @@ -1 +0,0 @@ -08f4cd1f8f7ddc336d0edee7581b0cb59e0cdc7b5f3cbeb1ccdcd7a1c52d366f
\ No newline at end of file diff --git a/db/schema_migrations/20210503105022 b/db/schema_migrations/20210503105022 deleted file mode 100644 index ada5b2db7da..00000000000 --- a/db/schema_migrations/20210503105022 +++ /dev/null @@ -1 +0,0 @@ -de8bf6c02589bf308914d43e5cd44dae91d3bbabcdaafcebdb96fba0a09b20bc
\ No newline at end of file diff --git a/db/schema_migrations/20210503105845 b/db/schema_migrations/20210503105845 deleted file mode 100644 index ff2c910491b..00000000000 --- a/db/schema_migrations/20210503105845 +++ /dev/null @@ -1 +0,0 @@ -2fdcb66e511d8322ea8fc4de66ecce859f8e91b2a9da22336281a1e784d9b4a5
\ No newline at end of file diff --git a/db/schema_migrations/20210503131747 b/db/schema_migrations/20210503131747 deleted file mode 100644 index 52771dcb5de..00000000000 --- a/db/schema_migrations/20210503131747 +++ /dev/null @@ -1 +0,0 @@ -583c350d82c4d02e910f2c16ed2ec55ccdc880c87b55bf7bd6be3e1839958732
\ No newline at end of file diff --git a/db/schema_migrations/20210504085144 b/db/schema_migrations/20210504085144 deleted file mode 100644 index 67abcd8eece..00000000000 --- a/db/schema_migrations/20210504085144 +++ /dev/null @@ -1 +0,0 @@ -3cdf8e93c4b80867a5d8e086f3f44eaeb479e875abf16187b94b3f6238faf062
\ No newline at end of file diff --git a/db/schema_migrations/20210504135823 b/db/schema_migrations/20210504135823 deleted file mode 100644 index 24c5fd50087..00000000000 --- a/db/schema_migrations/20210504135823 +++ /dev/null @@ -1 +0,0 @@ -9d1254393da80e0b1e387fba493f83f8775f0340f23c648e638a9983f965f5c9
\ No newline at end of file diff --git a/db/schema_migrations/20210504143128 b/db/schema_migrations/20210504143128 deleted file mode 100644 index 425120e633b..00000000000 --- a/db/schema_migrations/20210504143128 +++ /dev/null @@ -1 +0,0 @@ -e5b552b21c40b83b95442341838ad5951dcac7dd473194c49630d20ce6a46ae2
\ No newline at end of file diff --git a/db/schema_migrations/20210504153354 b/db/schema_migrations/20210504153354 deleted file mode 100644 index a1f9b1d6d37..00000000000 --- a/db/schema_migrations/20210504153354 +++ /dev/null @@ -1 +0,0 @@ -c4593c1638f937618ecf3ae94a409e550dce93cc190989f581fb0007e591696d
\ No newline at end of file diff --git a/db/schema_migrations/20210504164429 b/db/schema_migrations/20210504164429 deleted file mode 100644 index 2ad8695856f..00000000000 --- a/db/schema_migrations/20210504164429 +++ /dev/null @@ -1 +0,0 @@ -767cea885e6544b6958082397812357d7223b193d4b73bf09c8486dc2ec645d0
\ No newline at end of file diff --git a/db/schema_migrations/20210505070612 b/db/schema_migrations/20210505070612 deleted file mode 100644 index 454634cb74b..00000000000 --- a/db/schema_migrations/20210505070612 +++ /dev/null @@ -1 +0,0 @@ -52cc795e577a6de524cc55ce8d11f140e5d919f1164bb9983f7dd2c1ef2f0859
\ No newline at end of file diff --git a/db/schema_migrations/20210505070812 b/db/schema_migrations/20210505070812 deleted file mode 100644 index ca53caa49af..00000000000 --- a/db/schema_migrations/20210505070812 +++ /dev/null @@ -1 +0,0 @@ -7d57e1fea3652c0c04d29261d3c21b314ed443c9e61b882d22ca7f59807c312b
\ No newline at end of file diff --git a/db/schema_migrations/20210505092746 b/db/schema_migrations/20210505092746 deleted file mode 100644 index b23d8ee3538..00000000000 --- a/db/schema_migrations/20210505092746 +++ /dev/null @@ -1 +0,0 @@ -ccf7bce753adabfd7dd8a68fd49853514367f11af42879cae1b6aa28e4ebe94c
\ No newline at end of file diff --git a/db/schema_migrations/20210505124816 b/db/schema_migrations/20210505124816 deleted file mode 100644 index a5877ffee20..00000000000 --- a/db/schema_migrations/20210505124816 +++ /dev/null @@ -1 +0,0 @@ -56aa9590f4bc37d8f8c4ed869a4b095ba39925fb06ab58500eead895d19ee336
\ No newline at end of file diff --git a/db/schema_migrations/20210505170152 b/db/schema_migrations/20210505170152 deleted file mode 100644 index d51d04bc6ab..00000000000 --- a/db/schema_migrations/20210505170152 +++ /dev/null @@ -1 +0,0 @@ -9b16e17189d4db708553ce0d9dada1ce097be75433c3a8c09a6102e897e3123a
\ No newline at end of file diff --git a/db/schema_migrations/20210506064413 b/db/schema_migrations/20210506064413 deleted file mode 100644 index 72e3336d898..00000000000 --- a/db/schema_migrations/20210506064413 +++ /dev/null @@ -1 +0,0 @@ -f400225e6caa854f825422b9799e61ea557ab4bd3e4a33dc3cd3193ed3ce1db2
\ No newline at end of file diff --git a/db/schema_migrations/20210506065000 b/db/schema_migrations/20210506065000 deleted file mode 100644 index 5ffe1800cd9..00000000000 --- a/db/schema_migrations/20210506065000 +++ /dev/null @@ -1 +0,0 @@ -d286628cce50c469afe899d5ac40f20df8dceb6ee10c6cf49c64fbaeea7e4a2e
\ No newline at end of file diff --git a/db/schema_migrations/20210506150833 b/db/schema_migrations/20210506150833 deleted file mode 100644 index e63559fee8a..00000000000 --- a/db/schema_migrations/20210506150833 +++ /dev/null @@ -1 +0,0 @@ -18fdca797ea7f3a60ce5b421bec7af1ea0b0b73fbf6e1c23592acbc9d13a0a52
\ No newline at end of file diff --git a/db/schema_migrations/20210507191949 b/db/schema_migrations/20210507191949 deleted file mode 100644 index 398bcbe6638..00000000000 --- a/db/schema_migrations/20210507191949 +++ /dev/null @@ -1 +0,0 @@ -ab662ff92a4e2a7d324f0652da6f0725e1c38e387f08b89921b43816b5d35834
\ No newline at end of file diff --git a/db/schema_migrations/20210510083845 b/db/schema_migrations/20210510083845 deleted file mode 100644 index c3c67b9520e..00000000000 --- a/db/schema_migrations/20210510083845 +++ /dev/null @@ -1 +0,0 @@ -307e45d581c48b6f571fc8fa2a00dfd4360296560ee2b320540314b8f9f9e02c
\ No newline at end of file diff --git a/db/schema_migrations/20210510191551 b/db/schema_migrations/20210510191551 deleted file mode 100644 index a3a58e4b59e..00000000000 --- a/db/schema_migrations/20210510191551 +++ /dev/null @@ -1 +0,0 @@ -949038f9f66788e3289afbf210617f7947762e4bbab4c7389164cbd775302642
\ No newline at end of file diff --git a/db/schema_migrations/20210510191552 b/db/schema_migrations/20210510191552 deleted file mode 100644 index ca7fd00428d..00000000000 --- a/db/schema_migrations/20210510191552 +++ /dev/null @@ -1 +0,0 @@ -e59505ee2a3ef04c1af8a426f7ebdb83874c926cf7d7f98b56e0af8cd38988f5
\ No newline at end of file diff --git a/db/schema_migrations/20210511095657 b/db/schema_migrations/20210511095657 deleted file mode 100644 index 503ccfb459a..00000000000 --- a/db/schema_migrations/20210511095657 +++ /dev/null @@ -1 +0,0 @@ -4d11cdf876786db5e827ea1a50b70e2d5b3814fd7c0b0c083ab61adad9685364
\ No newline at end of file diff --git a/db/schema_migrations/20210511095658 b/db/schema_migrations/20210511095658 deleted file mode 100644 index d3fa692768d..00000000000 --- a/db/schema_migrations/20210511095658 +++ /dev/null @@ -1 +0,0 @@ -7387c23bbbc376e26c057179ebe2796be183462acb1fc509d451f0fede13ed93
\ No newline at end of file diff --git a/db/schema_migrations/20210511104929 b/db/schema_migrations/20210511104929 deleted file mode 100644 index af4f0ae0c01..00000000000 --- a/db/schema_migrations/20210511104929 +++ /dev/null @@ -1 +0,0 @@ -7c2a036033a3f6a3f80755c8ce4a0deab5933084974af4d87e7b97cc446fcbda
\ No newline at end of file diff --git a/db/schema_migrations/20210511104930 b/db/schema_migrations/20210511104930 deleted file mode 100644 index 9c07569e616..00000000000 --- a/db/schema_migrations/20210511104930 +++ /dev/null @@ -1 +0,0 @@ -51a8eeb8919e3f59579885b9e316ba8116566ae9b363b5dd750a65f42503c391
\ No newline at end of file diff --git a/db/schema_migrations/20210511142748 b/db/schema_migrations/20210511142748 deleted file mode 100644 index e0900a0b8ca..00000000000 --- a/db/schema_migrations/20210511142748 +++ /dev/null @@ -1 +0,0 @@ -def18f68ad71a1581452d52d331d2fd99ec9a3eb9b8e2fd111277eda498169fa
\ No newline at end of file diff --git a/db/schema_migrations/20210511165250 b/db/schema_migrations/20210511165250 deleted file mode 100644 index d68bd28d356..00000000000 --- a/db/schema_migrations/20210511165250 +++ /dev/null @@ -1 +0,0 @@ -8f746d7eb604ae31a5941840d6a078eae2e4fa59b7185bf8cc0db9c55b463c33
\ No newline at end of file diff --git a/db/schema_migrations/20210512120122 b/db/schema_migrations/20210512120122 deleted file mode 100644 index ad8640c6068..00000000000 --- a/db/schema_migrations/20210512120122 +++ /dev/null @@ -1 +0,0 @@ -1acc251417e3230c9b0a46e294cb9a6e8768f31978b8d4f439101f8de4e9269e
\ No newline at end of file diff --git a/db/schema_migrations/20210512183309 b/db/schema_migrations/20210512183309 deleted file mode 100644 index efdceb8aed5..00000000000 --- a/db/schema_migrations/20210512183309 +++ /dev/null @@ -1 +0,0 @@ -490dd9a1fe59fb1454f938763f9b8bce7a0567569ad5f7b8e29b196551d869e1
\ No newline at end of file diff --git a/db/schema_migrations/20210512183310 b/db/schema_migrations/20210512183310 deleted file mode 100644 index 7f14b53caf0..00000000000 --- a/db/schema_migrations/20210512183310 +++ /dev/null @@ -1 +0,0 @@ -d1e389755e4f5ed0075b07c5680eee5ae3557550071d14360ad3030e4c2d3ac1
\ No newline at end of file diff --git a/db/schema_migrations/20210513093418 b/db/schema_migrations/20210513093418 deleted file mode 100644 index 770d0f1ebdc..00000000000 --- a/db/schema_migrations/20210513093418 +++ /dev/null @@ -1 +0,0 @@ -f2c85121d217aa953b6ae52e32624cf4164b1f1408bcbe8ae3facafc15b037ce
\ No newline at end of file diff --git a/db/schema_migrations/20210513155447 b/db/schema_migrations/20210513155447 deleted file mode 100644 index c2fd6c22a05..00000000000 --- a/db/schema_migrations/20210513155447 +++ /dev/null @@ -1 +0,0 @@ -1f5ea8527107d4cffac535b9ae3e532a98ebd69a8711abdbe68b12fe005dfbb5
\ No newline at end of file diff --git a/db/schema_migrations/20210513155546 b/db/schema_migrations/20210513155546 deleted file mode 100644 index 97f9dc2b3c0..00000000000 --- a/db/schema_migrations/20210513155546 +++ /dev/null @@ -1 +0,0 @@ -44abbe007dae17982f923b1b15fd0534d3d3a7fd154cd9e4b5409f86030de2f7
\ No newline at end of file diff --git a/db/schema_migrations/20210513155635 b/db/schema_migrations/20210513155635 deleted file mode 100644 index 57da33a0bd2..00000000000 --- a/db/schema_migrations/20210513155635 +++ /dev/null @@ -1 +0,0 @@ -d1fccf214f2e237482fc4d9e2b5d5ea6e9241ad4ace8739e7b799555afafa215
\ No newline at end of file diff --git a/db/schema_migrations/20210513163904 b/db/schema_migrations/20210513163904 deleted file mode 100644 index dc668704311..00000000000 --- a/db/schema_migrations/20210513163904 +++ /dev/null @@ -1 +0,0 @@ -3c4905fbe29227da7a2386f73d9df30e82da48efff24a1193ba3db0ac325cfcf
\ No newline at end of file diff --git a/db/schema_migrations/20210514063252 b/db/schema_migrations/20210514063252 deleted file mode 100644 index 848265418d2..00000000000 --- a/db/schema_migrations/20210514063252 +++ /dev/null @@ -1 +0,0 @@ -7e52f9ba8470fd8c2e149fea723c9b06b92ecde2dac4db4512534b3e23952c61
\ No newline at end of file diff --git a/db/schema_migrations/20210517075444 b/db/schema_migrations/20210517075444 deleted file mode 100644 index 4b4aee8710c..00000000000 --- a/db/schema_migrations/20210517075444 +++ /dev/null @@ -1 +0,0 @@ -ec08c18ac37f2ae7298650df58345755eada20aaa5b7ed3dfd54ee5cea88ebdd
\ No newline at end of file diff --git a/db/schema_migrations/20210517130723 b/db/schema_migrations/20210517130723 deleted file mode 100644 index 04e94d1b867..00000000000 --- a/db/schema_migrations/20210517130723 +++ /dev/null @@ -1 +0,0 @@ -3bcc5ae97f3185ea33e568f42b90d1bfd31ac7c5126dab4580b64bd9b4603721
\ No newline at end of file diff --git a/db/schema_migrations/20210517144856 b/db/schema_migrations/20210517144856 deleted file mode 100644 index 14d36163797..00000000000 --- a/db/schema_migrations/20210517144856 +++ /dev/null @@ -1 +0,0 @@ -1944c983dd384029cef6e456108a1ccfdb9c991c65343d3b7f26aff51f244816
\ No newline at end of file diff --git a/db/schema_migrations/20210517221612 b/db/schema_migrations/20210517221612 deleted file mode 100644 index 4078e0b44f0..00000000000 --- a/db/schema_migrations/20210517221612 +++ /dev/null @@ -1 +0,0 @@ -69e7297ace1301bbdb63053bd30b75c326122873fbc6c5c15f9f118166111434
\ No newline at end of file diff --git a/db/schema_migrations/20210518001450 b/db/schema_migrations/20210518001450 deleted file mode 100644 index 5f3694d8b93..00000000000 --- a/db/schema_migrations/20210518001450 +++ /dev/null @@ -1 +0,0 @@ -212a2db8b1183eb4ae313eacae7d54f2bec26c5ea3f961981d34e57ca1420ad9
\ No newline at end of file diff --git a/db/schema_migrations/20210518074332 b/db/schema_migrations/20210518074332 deleted file mode 100644 index b5c7d33eec4..00000000000 --- a/db/schema_migrations/20210518074332 +++ /dev/null @@ -1 +0,0 @@ -9eb5e68b0d79863687530ff22cbe6a2bffd2e2d31237e919134b9ce77810b1a0
\ No newline at end of file diff --git a/db/schema_migrations/20210519104931 b/db/schema_migrations/20210519104931 deleted file mode 100644 index 82f84986924..00000000000 --- a/db/schema_migrations/20210519104931 +++ /dev/null @@ -1 +0,0 @@ -c31cb40b6251704c699e7fa3e7392bb9eb73fefcd5b0268e2b8fc58df9e6075e
\ No newline at end of file diff --git a/db/schema_migrations/20210519132109 b/db/schema_migrations/20210519132109 deleted file mode 100644 index 9d8537aa6b2..00000000000 --- a/db/schema_migrations/20210519132109 +++ /dev/null @@ -1 +0,0 @@ -ba464ad09f3cec0e9cf94b3041ad946e3a5a8c915ce0b9f4f95ab49cb55d305d
\ No newline at end of file diff --git a/db/schema_migrations/20210519132129 b/db/schema_migrations/20210519132129 deleted file mode 100644 index da7a8212092..00000000000 --- a/db/schema_migrations/20210519132129 +++ /dev/null @@ -1 +0,0 @@ -8041e898177bdee3b4d1ad82ec7dd3b79cb7dd740f773cd91dc4306a87a397fd
\ No newline at end of file diff --git a/db/schema_migrations/20210519154058 b/db/schema_migrations/20210519154058 deleted file mode 100644 index 9bd277e92db..00000000000 --- a/db/schema_migrations/20210519154058 +++ /dev/null @@ -1 +0,0 @@ -bdd82fc5cb2bbb322125c153c741002725853e23cd0ae0edbfd80563a4a87f2f
\ No newline at end of file diff --git a/db/schema_migrations/20210519220019 b/db/schema_migrations/20210519220019 deleted file mode 100644 index c0578586e62..00000000000 --- a/db/schema_migrations/20210519220019 +++ /dev/null @@ -1 +0,0 @@ -6c687ffd41f242dcd0ecf1ff82652aba79130d2d54016729a817dafa0bac6184
\ No newline at end of file diff --git a/db/schema_migrations/20210520012430 b/db/schema_migrations/20210520012430 deleted file mode 100644 index d92bc8d8369..00000000000 --- a/db/schema_migrations/20210520012430 +++ /dev/null @@ -1 +0,0 @@ -86b9f1c0f4288bf83e8b2d70b06b8951b7bcef0aa9324d9546471f6f094b014b
\ No newline at end of file diff --git a/db/schema_migrations/20210520102039 b/db/schema_migrations/20210520102039 deleted file mode 100644 index a850a5b07ca..00000000000 --- a/db/schema_migrations/20210520102039 +++ /dev/null @@ -1 +0,0 @@ -88d2c1507503de626dfdb3f2f0eaf0f51fad5fc2279fd147d901c5dcc7ae91eb
\ No newline at end of file diff --git a/db/schema_migrations/20210520133032 b/db/schema_migrations/20210520133032 deleted file mode 100644 index 169203e33cd..00000000000 --- a/db/schema_migrations/20210520133032 +++ /dev/null @@ -1 +0,0 @@ -eddbcd18c17f9017a2cdfb6fc0144dcfcb539d3617271722b2918bdbe48c481a
\ No newline at end of file diff --git a/db/schema_migrations/20210520133440 b/db/schema_migrations/20210520133440 deleted file mode 100644 index d5644ab8927..00000000000 --- a/db/schema_migrations/20210520133440 +++ /dev/null @@ -1 +0,0 @@ -3ee15db28406522a5fb591395dd3d4a46b10e958339dc60ded3751e23096864d
\ No newline at end of file diff --git a/db/schema_migrations/20210521073920 b/db/schema_migrations/20210521073920 deleted file mode 100644 index e0ac7ff7f31..00000000000 --- a/db/schema_migrations/20210521073920 +++ /dev/null @@ -1 +0,0 @@ -ecef2157c20804acbad9d74df27febcf935f7f36920946fac211f3ef8b419f26
\ No newline at end of file diff --git a/db/schema_migrations/20210525075724 b/db/schema_migrations/20210525075724 deleted file mode 100644 index 539138e18a9..00000000000 --- a/db/schema_migrations/20210525075724 +++ /dev/null @@ -1 +0,0 @@ -5dc1119c5efe28225bb7ac8a9ed2c4c5cfaeaff202194ed4419cfd54eaf7483d
\ No newline at end of file diff --git a/db/schema_migrations/20210525085158 b/db/schema_migrations/20210525085158 deleted file mode 100644 index c16bb8edeb9..00000000000 --- a/db/schema_migrations/20210525085158 +++ /dev/null @@ -1 +0,0 @@ -a2ce644df46a13d65eb0d01931eeb8e9f43967daadf73eed2f033b6c275ca57d
\ No newline at end of file diff --git a/db/schema_migrations/20210525085325 b/db/schema_migrations/20210525085325 deleted file mode 100644 index 38967a72899..00000000000 --- a/db/schema_migrations/20210525085325 +++ /dev/null @@ -1 +0,0 @@ -f085c9a7fc2209cf4d3797cda55c2be76b462eff456e7bf92de4545e0b988053
\ No newline at end of file diff --git a/db/schema_migrations/20210525100539 b/db/schema_migrations/20210525100539 deleted file mode 100644 index 31d93a231ed..00000000000 --- a/db/schema_migrations/20210525100539 +++ /dev/null @@ -1 +0,0 @@ -6568aa11d3652fb7ee23d2e6622a1038d891914f629438608993ff0d8b46b748
\ No newline at end of file diff --git a/db/schema_migrations/20210525100603 b/db/schema_migrations/20210525100603 deleted file mode 100644 index 645d7584d3d..00000000000 --- a/db/schema_migrations/20210525100603 +++ /dev/null @@ -1 +0,0 @@ -1a877c384c1e4e9e28a64c8c521aa72965c54d528044b076efdc75aeeb83d796
\ No newline at end of file diff --git a/db/schema_migrations/20210525184900 b/db/schema_migrations/20210525184900 deleted file mode 100644 index 5e507e7a363..00000000000 --- a/db/schema_migrations/20210525184900 +++ /dev/null @@ -1 +0,0 @@ -ae91ea7481ea21ce29b4c0697f77fd83017c36d913739ed67e5c907a48c56f69
\ No newline at end of file diff --git a/db/schema_migrations/20210526135911 b/db/schema_migrations/20210526135911 deleted file mode 100644 index be8d46e3cb0..00000000000 --- a/db/schema_migrations/20210526135911 +++ /dev/null @@ -1 +0,0 @@ -9f3edf905be3bd3c7fe0149c9b97c68783590b808a96ad08873d983e3d901419
\ No newline at end of file diff --git a/db/schema_migrations/20210526155257 b/db/schema_migrations/20210526155257 deleted file mode 100644 index ab3a611d341..00000000000 --- a/db/schema_migrations/20210526155257 +++ /dev/null @@ -1 +0,0 @@ -ec4cd687062118b30e516ed7c36677dda056f25c4d96c6ee0b503e457b5a18d4
\ No newline at end of file diff --git a/db/schema_migrations/20210526160133 b/db/schema_migrations/20210526160133 deleted file mode 100644 index c61cc233c0e..00000000000 --- a/db/schema_migrations/20210526160133 +++ /dev/null @@ -1 +0,0 @@ -ee76ee2e2515c06b09fca23a77bdfb9532fa5d80fc3d5aba44a80d123b74cfa9
\ No newline at end of file diff --git a/db/schema_migrations/20210526181820 b/db/schema_migrations/20210526181820 deleted file mode 100644 index b21e0c66d2a..00000000000 --- a/db/schema_migrations/20210526181820 +++ /dev/null @@ -1 +0,0 @@ -e72471e63dc108939473232437eda4c718382630c1173ae20023002d382e5ffa
\ No newline at end of file diff --git a/db/schema_migrations/20210526181821 b/db/schema_migrations/20210526181821 deleted file mode 100644 index 055ae0886b3..00000000000 --- a/db/schema_migrations/20210526181821 +++ /dev/null @@ -1 +0,0 @@ -3c53d85bec154ec68a23841d37317d10fa6c7c846bc5f54f5b7876081105ac7b
\ No newline at end of file diff --git a/db/schema_migrations/20210526190259 b/db/schema_migrations/20210526190259 deleted file mode 100644 index 0c7c7b88504..00000000000 --- a/db/schema_migrations/20210526190259 +++ /dev/null @@ -1 +0,0 @@ -ae2829a06f02ff3e1adc977f5e789b17d1f760e6aaa40be44586cc6a90870c4a
\ No newline at end of file diff --git a/db/schema_migrations/20210526190553 b/db/schema_migrations/20210526190553 deleted file mode 100644 index 5998df03b1c..00000000000 --- a/db/schema_migrations/20210526190553 +++ /dev/null @@ -1 +0,0 @@ -824e0930de14587f6ccaeb6b5fbec16676d243550a2dfd3a5999b67dfc16d4c8
\ No newline at end of file diff --git a/db/schema_migrations/20210526222715 b/db/schema_migrations/20210526222715 deleted file mode 100644 index 905c6a1fcb5..00000000000 --- a/db/schema_migrations/20210526222715 +++ /dev/null @@ -1 +0,0 @@ -f80787d85538cedaba34cb204c98df2d0bbbf85f438d4df8f1187d2f4d881588
\ No newline at end of file diff --git a/db/schema_migrations/20210527065005 b/db/schema_migrations/20210527065005 deleted file mode 100644 index 23df046f302..00000000000 --- a/db/schema_migrations/20210527065005 +++ /dev/null @@ -1 +0,0 @@ -983b736defaa128f7466a784d2a06de293fa6b1cee76121e533e7966d19aad73
\ No newline at end of file diff --git a/db/schema_migrations/20210527130524 b/db/schema_migrations/20210527130524 deleted file mode 100644 index 611865047ef..00000000000 --- a/db/schema_migrations/20210527130524 +++ /dev/null @@ -1 +0,0 @@ -c0d6252fc768a431513754f7d51e61c5127f5573fefb278e7e1673dcd9e1b097
\ No newline at end of file diff --git a/db/schema_migrations/20210527131039 b/db/schema_migrations/20210527131039 deleted file mode 100644 index acd89af497d..00000000000 --- a/db/schema_migrations/20210527131039 +++ /dev/null @@ -1 +0,0 @@ -c07ebd06892bacc936514798d970eb58ed08b6570049d2de07f787e93b5b3316
\ No newline at end of file diff --git a/db/schema_migrations/20210527133919 b/db/schema_migrations/20210527133919 deleted file mode 100644 index 559860de55d..00000000000 --- a/db/schema_migrations/20210527133919 +++ /dev/null @@ -1 +0,0 @@ -aaf5936c945451fa98df7c21ab34c9aa7190dcf301f536c259e5b1fe54407f36
\ No newline at end of file diff --git a/db/schema_migrations/20210527134019 b/db/schema_migrations/20210527134019 deleted file mode 100644 index de757dd355e..00000000000 --- a/db/schema_migrations/20210527134019 +++ /dev/null @@ -1 +0,0 @@ -ac4522ee51d4a4cda317b680c16be3d9ef3e1619bba80c26aefe8d5dc70f013c
\ No newline at end of file diff --git a/db/schema_migrations/20210527185542 b/db/schema_migrations/20210527185542 deleted file mode 100644 index 175fe5432e3..00000000000 --- a/db/schema_migrations/20210527185542 +++ /dev/null @@ -1 +0,0 @@ -56efe7709f07ffe198b4a2068c7e4b1ba8507a878cbc9ac3b1b30a334cbd83ca
\ No newline at end of file diff --git a/db/schema_migrations/20210527194558 b/db/schema_migrations/20210527194558 deleted file mode 100644 index 089b97aa90e..00000000000 --- a/db/schema_migrations/20210527194558 +++ /dev/null @@ -1 +0,0 @@ -8c0661a42edbdb79be283df0e88879707ef34ba3fe21b6756b21cd99ea9f05de
\ No newline at end of file diff --git a/db/schema_migrations/20210529164247 b/db/schema_migrations/20210529164247 deleted file mode 100644 index 76637590be7..00000000000 --- a/db/schema_migrations/20210529164247 +++ /dev/null @@ -1 +0,0 @@ -8aa9e00be5f2bc6076f4a42a479aff4318b9e4d3da48798117fec67df7158db4
\ No newline at end of file diff --git a/db/schema_migrations/20210531053916 b/db/schema_migrations/20210531053916 deleted file mode 100644 index d2eb05fab3d..00000000000 --- a/db/schema_migrations/20210531053916 +++ /dev/null @@ -1 +0,0 @@ -862deb2d2845aaa114ba4c56418ae6a041d3aed3ac205cff102414423b60c969
\ No newline at end of file diff --git a/db/schema_migrations/20210531054108 b/db/schema_migrations/20210531054108 deleted file mode 100644 index 4b0372e7ffc..00000000000 --- a/db/schema_migrations/20210531054108 +++ /dev/null @@ -1 +0,0 @@ -9ffb8d6b93f1e994eaa9dd4b16b9250fe007903dca3901d34bf66a81b2f3ad44
\ No newline at end of file diff --git a/db/schema_migrations/20210531070452 b/db/schema_migrations/20210531070452 deleted file mode 100644 index 51a023a544c..00000000000 --- a/db/schema_migrations/20210531070452 +++ /dev/null @@ -1 +0,0 @@ -e569b99998d9c670af17ec747e37726671601ba06fa97da83373649adb3aab31
\ No newline at end of file diff --git a/db/schema_migrations/20210531071107 b/db/schema_migrations/20210531071107 deleted file mode 100644 index f855e0990e1..00000000000 --- a/db/schema_migrations/20210531071107 +++ /dev/null @@ -1 +0,0 @@ -38dcfcd162a3b49a9b16b45b2f9818275807bf419880729b5c552bccb0d4dc9e
\ No newline at end of file diff --git a/db/schema_migrations/20210601073400 b/db/schema_migrations/20210601073400 deleted file mode 100644 index eb4eed721fe..00000000000 --- a/db/schema_migrations/20210601073400 +++ /dev/null @@ -1 +0,0 @@ -668f65ea77042e5b8054681e76f583a6061aca921b685f90d155fc4121e7ff78
\ No newline at end of file diff --git a/db/schema_migrations/20210601080039 b/db/schema_migrations/20210601080039 deleted file mode 100644 index 91d517058fe..00000000000 --- a/db/schema_migrations/20210601080039 +++ /dev/null @@ -1 +0,0 @@ -2c5c0756757a181cf8bf7968de5184664004a82c093ae3fc14c5d6931a1ab44f
\ No newline at end of file diff --git a/db/schema_migrations/20210601123341 b/db/schema_migrations/20210601123341 deleted file mode 100644 index 7fd9943c89e..00000000000 --- a/db/schema_migrations/20210601123341 +++ /dev/null @@ -1 +0,0 @@ -d4a0098c30cd1acea008fa5f1cfb4c23d5b5b894eab2b72f5004acc5233f2576
\ No newline at end of file diff --git a/db/schema_migrations/20210601125410 b/db/schema_migrations/20210601125410 deleted file mode 100644 index 241a60e966a..00000000000 --- a/db/schema_migrations/20210601125410 +++ /dev/null @@ -1 +0,0 @@ -fc500e4dd555a6baad91ad3c9fb8a2f8541e1613dd64afdbdd28b19447a28caf
\ No newline at end of file diff --git a/db/schema_migrations/20210601131742 b/db/schema_migrations/20210601131742 deleted file mode 100644 index 59869b190e5..00000000000 --- a/db/schema_migrations/20210601131742 +++ /dev/null @@ -1 +0,0 @@ -63cd83e097a24b39a399918422950caacb6aed8d05d0d8b7bcf66f9155a0d04e
\ No newline at end of file diff --git a/db/schema_migrations/20210601132134 b/db/schema_migrations/20210601132134 deleted file mode 100644 index 3fa9505de2f..00000000000 --- a/db/schema_migrations/20210601132134 +++ /dev/null @@ -1 +0,0 @@ -966299fecd160b594f0837f19cc01b38fc365fa749982f9245c296d912e3eb2f
\ No newline at end of file diff --git a/db/schema_migrations/20210601133459 b/db/schema_migrations/20210601133459 deleted file mode 100644 index 2f40fffa40f..00000000000 --- a/db/schema_migrations/20210601133459 +++ /dev/null @@ -1 +0,0 @@ -4dcf6277439e8abe52534540100fa621fedcecb3eaf71ad5685ac0230cd2e5bb
\ No newline at end of file diff --git a/db/schema_migrations/20210602122213 b/db/schema_migrations/20210602122213 deleted file mode 100644 index 651f9789b36..00000000000 --- a/db/schema_migrations/20210602122213 +++ /dev/null @@ -1 +0,0 @@ -66e50071130c2bd64be2f52d5c5f348a91883b2e9a9f4241175d1d2ad2a74434
\ No newline at end of file diff --git a/db/schema_migrations/20210602122233 b/db/schema_migrations/20210602122233 deleted file mode 100644 index c52dbdfd858..00000000000 --- a/db/schema_migrations/20210602122233 +++ /dev/null @@ -1 +0,0 @@ -96c70de2567fc3e816c720ed6e4cef2446c0f0ee288d0959cd1298523913077f
\ No newline at end of file diff --git a/db/schema_migrations/20210602155056 b/db/schema_migrations/20210602155056 deleted file mode 100644 index 4c6f7f95874..00000000000 --- a/db/schema_migrations/20210602155056 +++ /dev/null @@ -1 +0,0 @@ -42b3090efee66f5a7a5c06d8768d1417892c5d6745f60163a09f58e6e3722761
\ No newline at end of file diff --git a/db/schema_migrations/20211004120135 b/db/schema_migrations/20211004120135 deleted file mode 100644 index e03dc56e002..00000000000 --- a/db/schema_migrations/20211004120135 +++ /dev/null @@ -1 +0,0 @@ -9cefd32c003a68752f257973a983f77215b02011b7ca792de06c0e92c2462745
\ No newline at end of file diff --git a/db/schema_migrations/20211206162601 b/db/schema_migrations/20211206162601 deleted file mode 100644 index 5e19e21507d..00000000000 --- a/db/schema_migrations/20211206162601 +++ /dev/null @@ -1 +0,0 @@ -529c7ea38bbaa0c29491c2dfdb654a4a6adba93122d9bc23d6632526ff7fdb05
\ No newline at end of file diff --git a/db/schema_migrations/20220826152430 b/db/schema_migrations/20220826152430 new file mode 100644 index 00000000000..8808d043924 --- /dev/null +++ b/db/schema_migrations/20220826152430 @@ -0,0 +1 @@ +542221bf9d79defa3ea53c6fd408caf7d0736711a51b91dadccf8d0d9743abf7
\ No newline at end of file diff --git a/db/schema_migrations/20220826152432 b/db/schema_migrations/20220826152432 new file mode 100644 index 00000000000..d474e3aa7f2 --- /dev/null +++ b/db/schema_migrations/20220826152432 @@ -0,0 +1 @@ +1822f41860f04dab2f4290d19b4d7f2fb896567b7b8f3f4d598dda36a1bc1b6a
\ No newline at end of file diff --git a/db/schema_migrations/20221010191136 b/db/schema_migrations/20221010191136 new file mode 100644 index 00000000000..00128d6ce52 --- /dev/null +++ b/db/schema_migrations/20221010191136 @@ -0,0 +1 @@ +031607378457cac9f9477e751f2ebe15173a91fec98daa4e64b1f278dce5d931
\ No newline at end of file diff --git a/db/schema_migrations/20221102231131 b/db/schema_migrations/20221102231131 new file mode 100644 index 00000000000..28e3550793a --- /dev/null +++ b/db/schema_migrations/20221102231131 @@ -0,0 +1 @@ +c58301896d1defa90c32ad3a9966daaeff73bada1272652ac8bcb2c56fff0265
\ No newline at end of file diff --git a/db/schema_migrations/20221110100600 b/db/schema_migrations/20221110100600 new file mode 100644 index 00000000000..80b1c2bbb36 --- /dev/null +++ b/db/schema_migrations/20221110100600 @@ -0,0 +1 @@ +ff748a75deac671ea4ff0ce9df901672afc5dfef794353bec9ab6e0c5d44c981
\ No newline at end of file diff --git a/db/schema_migrations/20221110100602 b/db/schema_migrations/20221110100602 new file mode 100644 index 00000000000..b25e9687eb9 --- /dev/null +++ b/db/schema_migrations/20221110100602 @@ -0,0 +1 @@ +a6234578eeaa90365894d345b74cd66d73bd630f2037e07278466cf59ca42210
\ No newline at end of file diff --git a/db/schema_migrations/20221122210711 b/db/schema_migrations/20221122210711 new file mode 100644 index 00000000000..1b6fe28ff90 --- /dev/null +++ b/db/schema_migrations/20221122210711 @@ -0,0 +1 @@ +88c1d4e154335af66aea88f8dbb4bbd9a548a13499839ce96f7bbda17c7116c3
\ No newline at end of file diff --git a/db/schema_migrations/20221204090437 b/db/schema_migrations/20221204090437 new file mode 100644 index 00000000000..3ae8d4c2067 --- /dev/null +++ b/db/schema_migrations/20221204090437 @@ -0,0 +1 @@ +16bdaabcc19086652b0543dcdc7204305a920794fdab38c042d06bb2be76dde0
\ No newline at end of file diff --git a/db/schema_migrations/20221209174132 b/db/schema_migrations/20221209174132 new file mode 100644 index 00000000000..0bc7f720b08 --- /dev/null +++ b/db/schema_migrations/20221209174132 @@ -0,0 +1 @@ +5bc41c2430a033da7aa063e5646941428bb01cbf99aafed4acc80b4f9aa2f650
\ No newline at end of file diff --git a/db/schema_migrations/20221209174157 b/db/schema_migrations/20221209174157 new file mode 100644 index 00000000000..0d0a9ed9e82 --- /dev/null +++ b/db/schema_migrations/20221209174157 @@ -0,0 +1 @@ +5a7f509173cf10ab512935db0dd65ab9ed347539a6448e2922ea603db418b1df
\ No newline at end of file diff --git a/db/schema_migrations/20221209235939 b/db/schema_migrations/20221209235939 new file mode 100644 index 00000000000..4f3e38b6783 --- /dev/null +++ b/db/schema_migrations/20221209235939 @@ -0,0 +1 @@ +1932d6cee91dac3fb3fee7bbdac1bb08c7af92d8ef9f9f32c2d6a2958fc4fdcf
\ No newline at end of file diff --git a/db/schema_migrations/20221209235940 b/db/schema_migrations/20221209235940 new file mode 100644 index 00000000000..58e8fe83906 --- /dev/null +++ b/db/schema_migrations/20221209235940 @@ -0,0 +1 @@ +fc12bfad8fb9c2aba5aea0726f8e8630c9d0f4f791988660ea183e269b2068ef
\ No newline at end of file diff --git a/db/schema_migrations/20221212054640 b/db/schema_migrations/20221212054640 new file mode 100644 index 00000000000..2df095bd898 --- /dev/null +++ b/db/schema_migrations/20221212054640 @@ -0,0 +1 @@ +18c98815e882f808ec2d5d29d605b89bd725690f0c399627eaa98f4ff7d3ef76
\ No newline at end of file diff --git a/db/schema_migrations/20221212192452 b/db/schema_migrations/20221212192452 new file mode 100644 index 00000000000..c5be1468189 --- /dev/null +++ b/db/schema_migrations/20221212192452 @@ -0,0 +1 @@ +51f9c66f46063a9ad6979f2a50b0d963d93c007b25bde2dedf941317317ef077
\ No newline at end of file diff --git a/db/schema_migrations/20221212192527 b/db/schema_migrations/20221212192527 new file mode 100644 index 00000000000..cf79bf9446f --- /dev/null +++ b/db/schema_migrations/20221212192527 @@ -0,0 +1 @@ +de8a5fae011e67ff3b8da9c73f0c19a93a2c534764d81bc72e3058627b5ab6b5
\ No newline at end of file diff --git a/db/schema_migrations/20221213105028 b/db/schema_migrations/20221213105028 new file mode 100644 index 00000000000..bb47fe92f99 --- /dev/null +++ b/db/schema_migrations/20221213105028 @@ -0,0 +1 @@ +0371c2bfd2d11ea5c78de99c79cdc59ae66bac684190333b562d1fc1e8243c94
\ No newline at end of file diff --git a/db/schema_migrations/20221214095129 b/db/schema_migrations/20221214095129 new file mode 100644 index 00000000000..45303906ba2 --- /dev/null +++ b/db/schema_migrations/20221214095129 @@ -0,0 +1 @@ +1400b1d7e9f2096a3c84bf262a457043a26e791071ea5e95862628a271bf88aa
\ No newline at end of file diff --git a/db/schema_migrations/20221214105307 b/db/schema_migrations/20221214105307 new file mode 100644 index 00000000000..d8e1f90901b --- /dev/null +++ b/db/schema_migrations/20221214105307 @@ -0,0 +1 @@ +731ff12680cd8f21b245fcb5b0772567a7534cfe17248a741dc12d4b5e2e951d
\ No newline at end of file diff --git a/db/schema_migrations/20221214201256 b/db/schema_migrations/20221214201256 new file mode 100644 index 00000000000..1b1ad048fe6 --- /dev/null +++ b/db/schema_migrations/20221214201256 @@ -0,0 +1 @@ +53cbd505d77cac0224d0dd191ae4af160a80bf589c0324eab3b2db85177b614e
\ No newline at end of file diff --git a/db/schema_migrations/20221214204247 b/db/schema_migrations/20221214204247 new file mode 100644 index 00000000000..fd20d6ea497 --- /dev/null +++ b/db/schema_migrations/20221214204247 @@ -0,0 +1 @@ +adeaf9ce3a61f1603a314a8ec8122f5e58f5b56fe75b7d32fadfc9ca6f31bf40
\ No newline at end of file diff --git a/db/schema_migrations/20221215151822 b/db/schema_migrations/20221215151822 new file mode 100644 index 00000000000..bef6ccd1711 --- /dev/null +++ b/db/schema_migrations/20221215151822 @@ -0,0 +1 @@ +6d5872c6c5e0a7bc9bd52eeac7cbbd49bbe41210dd5596078acf088ac8eec1bd
\ No newline at end of file diff --git a/db/schema_migrations/20221215210347 b/db/schema_migrations/20221215210347 new file mode 100644 index 00000000000..3d9e6ce85c0 --- /dev/null +++ b/db/schema_migrations/20221215210347 @@ -0,0 +1 @@ +37df82f093bb81ff1bc36ea9ba29f4e70bcb96274e2dcc70438ce0710dd7e9d9
\ No newline at end of file diff --git a/db/schema_migrations/20221216131710 b/db/schema_migrations/20221216131710 new file mode 100644 index 00000000000..723eda5194c --- /dev/null +++ b/db/schema_migrations/20221216131710 @@ -0,0 +1 @@ +88ec0ad09f04b5c95cc75afdcee64d488abfbf6cf86ab0b7215623a227865432
\ No newline at end of file diff --git a/db/schema_migrations/20221216131935 b/db/schema_migrations/20221216131935 new file mode 100644 index 00000000000..9dcb4412aec --- /dev/null +++ b/db/schema_migrations/20221216131935 @@ -0,0 +1 @@ +fe479c2d3784ede41207beff4fad21004f74ade8f8c08f6a9b154429ceef6395
\ No newline at end of file diff --git a/db/schema_migrations/20221216131958 b/db/schema_migrations/20221216131958 new file mode 100644 index 00000000000..4c773777ff3 --- /dev/null +++ b/db/schema_migrations/20221216131958 @@ -0,0 +1 @@ +0a012ad57aa6833f41e8927573aeff716ce36724ed6c1ecca8fc0d77186b4c88
\ No newline at end of file diff --git a/db/schema_migrations/20221216144854 b/db/schema_migrations/20221216144854 new file mode 100644 index 00000000000..6deba7583f2 --- /dev/null +++ b/db/schema_migrations/20221216144854 @@ -0,0 +1 @@ +6a5cae1c59bf32796feee4d7adf113d36a0aea1e0324eb082a848870edaf98c7
\ No newline at end of file diff --git a/db/schema_migrations/20221216150304 b/db/schema_migrations/20221216150304 new file mode 100644 index 00000000000..16fa7b669e6 --- /dev/null +++ b/db/schema_migrations/20221216150304 @@ -0,0 +1 @@ +74d618f1cf30125936386257bb3bef793afefffc0b7f45f854c2f0632bae56e7
\ No newline at end of file diff --git a/db/schema_migrations/20221216150321 b/db/schema_migrations/20221216150321 new file mode 100644 index 00000000000..e6690af1e15 --- /dev/null +++ b/db/schema_migrations/20221216150321 @@ -0,0 +1 @@ +501fe17068407fa590ba7f85acf0073ee701d37ad9f9d84ecbeaa8c282fd2957
\ No newline at end of file diff --git a/db/schema_migrations/20221216150919 b/db/schema_migrations/20221216150919 new file mode 100644 index 00000000000..e2056eb9b55 --- /dev/null +++ b/db/schema_migrations/20221216150919 @@ -0,0 +1 @@ +1dda2456e1b2a8ddd5e45d3115219ef9d35a9a11a7d498d1ff394b687d7c9761
\ No newline at end of file diff --git a/db/schema_migrations/20221216151459 b/db/schema_migrations/20221216151459 new file mode 100644 index 00000000000..d590076786d --- /dev/null +++ b/db/schema_migrations/20221216151459 @@ -0,0 +1 @@ +3f4e9fdd522498b79512e37f022d73e4f0495d0c6419c783d574a630d07d31c4
\ No newline at end of file diff --git a/db/schema_migrations/20221216151649 b/db/schema_migrations/20221216151649 new file mode 100644 index 00000000000..84d5b3b36b3 --- /dev/null +++ b/db/schema_migrations/20221216151649 @@ -0,0 +1 @@ +28d64bca23a251a185241c1f735a663a8da116a5e6dd44451ce94ea2b1945f7d
\ No newline at end of file diff --git a/db/schema_migrations/20221216232658 b/db/schema_migrations/20221216232658 new file mode 100644 index 00000000000..18a3e5e18f2 --- /dev/null +++ b/db/schema_migrations/20221216232658 @@ -0,0 +1 @@ +8e9bb800a2eab9f5d5a3b4f3835b6c4f21ec861a5808a13bef8d496773a7799c
\ No newline at end of file diff --git a/db/schema_migrations/20221216232659 b/db/schema_migrations/20221216232659 new file mode 100644 index 00000000000..0fe1f405539 --- /dev/null +++ b/db/schema_migrations/20221216232659 @@ -0,0 +1 @@ +520b29da3912ee69336cb00d3a2da6736a6871b2e27ecbb830f1b3dafe1a8120
\ No newline at end of file diff --git a/db/schema_migrations/20221219103007 b/db/schema_migrations/20221219103007 new file mode 100644 index 00000000000..91fbb67c344 --- /dev/null +++ b/db/schema_migrations/20221219103007 @@ -0,0 +1 @@ +6fdebbcb5bc3e21cfa932ff9db7037b4d07042bf2cd79e6a8991c36741b88c06
\ No newline at end of file diff --git a/db/schema_migrations/20221219112528 b/db/schema_migrations/20221219112528 new file mode 100644 index 00000000000..d446e0e565b --- /dev/null +++ b/db/schema_migrations/20221219112528 @@ -0,0 +1 @@ +3efcc5d139bfad08294f8a131fd4e259fe26cef50a422c17ed9aac75e8867f92
\ No newline at end of file diff --git a/db/schema_migrations/20221219135535 b/db/schema_migrations/20221219135535 new file mode 100644 index 00000000000..8d46309bc59 --- /dev/null +++ b/db/schema_migrations/20221219135535 @@ -0,0 +1 @@ +7e9b0184762992556f6c97353f76a45851476ba30667e8afc4946c2aed6d762d
\ No newline at end of file diff --git a/db/schema_migrations/20221220075936 b/db/schema_migrations/20221220075936 new file mode 100644 index 00000000000..194046d51e2 --- /dev/null +++ b/db/schema_migrations/20221220075936 @@ -0,0 +1 @@ +43f0493091c58f1573613d5672a999bf07994ced2b7172a7aef9148f4d8b8dbe
\ No newline at end of file diff --git a/db/schema_migrations/20221220131020 b/db/schema_migrations/20221220131020 new file mode 100644 index 00000000000..36c041b1a33 --- /dev/null +++ b/db/schema_migrations/20221220131020 @@ -0,0 +1 @@ +8adf517eb859b5c945f70fbdeb911d398cf0a25c75b39b5991280390b70d1adf
\ No newline at end of file diff --git a/db/schema_migrations/20221221110733 b/db/schema_migrations/20221221110733 new file mode 100644 index 00000000000..6900431db9b --- /dev/null +++ b/db/schema_migrations/20221221110733 @@ -0,0 +1 @@ +db73b1dca175b51bfb9a5fd20806f746cc9d80d37d1eed7c2958a6dfd1445796
\ No newline at end of file diff --git a/db/schema_migrations/20221221134116 b/db/schema_migrations/20221221134116 new file mode 100644 index 00000000000..f25d868d150 --- /dev/null +++ b/db/schema_migrations/20221221134116 @@ -0,0 +1 @@ +b528d26acaf408f6d787542626bc8d86520b1058dde20596f7da63c1e5b87aee
\ No newline at end of file diff --git a/db/schema_migrations/20221221150123 b/db/schema_migrations/20221221150123 new file mode 100644 index 00000000000..318d01c9980 --- /dev/null +++ b/db/schema_migrations/20221221150123 @@ -0,0 +1 @@ +a842c4aae88386fc5fdeb7f08c0a2ba14780b651801e7dae28c974af58aa946c
\ No newline at end of file diff --git a/db/schema_migrations/20221221171239 b/db/schema_migrations/20221221171239 new file mode 100644 index 00000000000..41e529467fe --- /dev/null +++ b/db/schema_migrations/20221221171239 @@ -0,0 +1 @@ +58a1e0ebf310f443b268491b5fa5e88ed392390aa028bed57c0292b270a3ec2d
\ No newline at end of file diff --git a/db/schema_migrations/20221222092958 b/db/schema_migrations/20221222092958 new file mode 100644 index 00000000000..eabf9eedc5f --- /dev/null +++ b/db/schema_migrations/20221222092958 @@ -0,0 +1 @@ +689029c5d5ec374f12827d47602096d7bdaab0c1a6c378f45382cd612d3ba002
\ No newline at end of file diff --git a/db/schema_migrations/20221222144954 b/db/schema_migrations/20221222144954 new file mode 100644 index 00000000000..90632cfe36d --- /dev/null +++ b/db/schema_migrations/20221222144954 @@ -0,0 +1 @@ +423156b02a67da496da851c2bdc0b57c68af608eb0dc0ef9b96108b2610161ad
\ No newline at end of file diff --git a/db/schema_migrations/20221223114543 b/db/schema_migrations/20221223114543 new file mode 100644 index 00000000000..0a36ef8a481 --- /dev/null +++ b/db/schema_migrations/20221223114543 @@ -0,0 +1 @@ +09ecb70b517dd6a4116288bf10a399786a59ae0adfe9d6f9b600913c74347248
\ No newline at end of file diff --git a/db/schema_migrations/20221223123019 b/db/schema_migrations/20221223123019 new file mode 100644 index 00000000000..d6bf765ccad --- /dev/null +++ b/db/schema_migrations/20221223123019 @@ -0,0 +1 @@ +ecfd0d17f89aef734239365a79a48b0f8122326030a717a0114db5063bacc58f
\ No newline at end of file diff --git a/db/schema_migrations/20221226105323 b/db/schema_migrations/20221226105323 new file mode 100644 index 00000000000..f8b82870f5f --- /dev/null +++ b/db/schema_migrations/20221226105323 @@ -0,0 +1 @@ +29ebddfcf7508f259eb4de595e194995b255a1a80d79aaa6d261323d8d273021
\ No newline at end of file diff --git a/db/schema_migrations/20210415144538 b/db/schema_migrations/20221226132038 index 6b8e0d78b65..31a40e6d5f2 100644 --- a/db/schema_migrations/20210415144538 +++ b/db/schema_migrations/20221226132038 @@ -1 +1 @@ -d237690af576fb5a85d984416dcca1936a140a10a9b6c968d3ff57419568fb8f
\ No newline at end of file +395dd3ad54b7854a12d9bf2faf575ee4d7842a75f0f16db40d26523e4e2ea21f
\ No newline at end of file diff --git a/db/schema_migrations/20221226153240 b/db/schema_migrations/20221226153240 new file mode 100644 index 00000000000..3f2eb6afe64 --- /dev/null +++ b/db/schema_migrations/20221226153240 @@ -0,0 +1 @@ +0ed51d0f733ec6c94cc951e1e0b56c2095bf685dfa55d55cca63554e97ef509e
\ No newline at end of file diff --git a/db/schema_migrations/20221226154458 b/db/schema_migrations/20221226154458 new file mode 100644 index 00000000000..8aefafb2fc9 --- /dev/null +++ b/db/schema_migrations/20221226154458 @@ -0,0 +1 @@ +55910df54a9f6260145aac231af36dfbb5018899eebccfc7f80b51b9d48a7c67
\ No newline at end of file diff --git a/db/schema_migrations/20221226163203 b/db/schema_migrations/20221226163203 new file mode 100644 index 00000000000..d9f0948a430 --- /dev/null +++ b/db/schema_migrations/20221226163203 @@ -0,0 +1 @@ +4aa2fe3493785432e633c546593968a4084866560d0d68786e5d10bb202e1a5a
\ No newline at end of file diff --git a/db/schema_migrations/20221227080606 b/db/schema_migrations/20221227080606 new file mode 100644 index 00000000000..fbb13af3578 --- /dev/null +++ b/db/schema_migrations/20221227080606 @@ -0,0 +1 @@ +3dc372c96fad7f47f03b3bf5799af9fd19b2f9c9822116d28057227708abeeb2
\ No newline at end of file diff --git a/db/schema_migrations/20221227100751 b/db/schema_migrations/20221227100751 new file mode 100644 index 00000000000..62606a7b6d5 --- /dev/null +++ b/db/schema_migrations/20221227100751 @@ -0,0 +1 @@ +cc745f68d3719de09f5c0943711a013e84dcd229faaa59f5157e4f1bbcc6d736
\ No newline at end of file diff --git a/db/schema_migrations/20221227100846 b/db/schema_migrations/20221227100846 new file mode 100644 index 00000000000..0bb424a14b5 --- /dev/null +++ b/db/schema_migrations/20221227100846 @@ -0,0 +1 @@ +19837d832303866eabb7cd27e16926e4e0ae49437b70882bea87421415835c9a
\ No newline at end of file diff --git a/db/schema_migrations/20221227100908 b/db/schema_migrations/20221227100908 new file mode 100644 index 00000000000..aedc24344c1 --- /dev/null +++ b/db/schema_migrations/20221227100908 @@ -0,0 +1 @@ +a10a39aaa4184b5f082bfbb17b22cb84c3538f896438f89a366fe92658f5ca41
\ No newline at end of file diff --git a/db/schema_migrations/20221227101436 b/db/schema_migrations/20221227101436 new file mode 100644 index 00000000000..04b8bd3a2e1 --- /dev/null +++ b/db/schema_migrations/20221227101436 @@ -0,0 +1 @@ +06a999af8600837d5cb29efdcb56a14eb456d89ea00b6f8974a57a34f4c4008d
\ No newline at end of file diff --git a/db/schema_migrations/20221228063845 b/db/schema_migrations/20221228063845 new file mode 100644 index 00000000000..7f5b90b29fd --- /dev/null +++ b/db/schema_migrations/20221228063845 @@ -0,0 +1 @@ +48d1456517b233b38d1af9517206db3bd24b1f858912d488f5583e5122f624b7
\ No newline at end of file diff --git a/db/schema_migrations/20221228083452 b/db/schema_migrations/20221228083452 new file mode 100644 index 00000000000..6be5bb4eb6c --- /dev/null +++ b/db/schema_migrations/20221228083452 @@ -0,0 +1 @@ +44e854a2afa7bebeb1e220ec1dee2f204173be59e403ba8a70ba3d22675be7a9
\ No newline at end of file diff --git a/db/schema_migrations/20221228103133 b/db/schema_migrations/20221228103133 new file mode 100644 index 00000000000..757c1d9169d --- /dev/null +++ b/db/schema_migrations/20221228103133 @@ -0,0 +1 @@ +59e19291b3f8bb08dd63c1b1993af8f75e06d56ca776c3e8711adcc8c5c26e86
\ No newline at end of file diff --git a/db/schema_migrations/20221228161214 b/db/schema_migrations/20221228161214 new file mode 100644 index 00000000000..7ed6d761a67 --- /dev/null +++ b/db/schema_migrations/20221228161214 @@ -0,0 +1 @@ +2e22336f0f4f99dc91198bc0634816309ac49375900eed662ab7a41ddce34984
\ No newline at end of file diff --git a/db/schema_migrations/20221228163035 b/db/schema_migrations/20221228163035 new file mode 100644 index 00000000000..477f157a415 --- /dev/null +++ b/db/schema_migrations/20221228163035 @@ -0,0 +1 @@ +18c91662404c12f9bcdda60fbf80a13ec36dcd881e47b31d4f0c7a0f20c1f225
\ No newline at end of file diff --git a/db/schema_migrations/20221228210616 b/db/schema_migrations/20221228210616 new file mode 100644 index 00000000000..69ff81fe265 --- /dev/null +++ b/db/schema_migrations/20221228210616 @@ -0,0 +1 @@ +a248f26495d2fab454538f8dd1c43e73ef4078f1822a900fce97b8c7f6df74c6
\ No newline at end of file diff --git a/db/schema_migrations/20230104103748 b/db/schema_migrations/20230104103748 new file mode 100644 index 00000000000..e948ea381c4 --- /dev/null +++ b/db/schema_migrations/20230104103748 @@ -0,0 +1 @@ +7e6fb82580d45777ca0e656c589dc0eed5a7d090fc38096b395a10967acd08f4
\ No newline at end of file diff --git a/db/schema_migrations/20230104150600 b/db/schema_migrations/20230104150600 new file mode 100644 index 00000000000..0a295f686f8 --- /dev/null +++ b/db/schema_migrations/20230104150600 @@ -0,0 +1 @@ +728bc4489b37ec92f11a759ab682cb17b4658827c547474dca4c4e84f26e099f
\ No newline at end of file diff --git a/db/schema_migrations/20230104150601 b/db/schema_migrations/20230104150601 new file mode 100644 index 00000000000..638ac83aeaf --- /dev/null +++ b/db/schema_migrations/20230104150601 @@ -0,0 +1 @@ +ebccade2de9ef09aab8679a67f1487324a2f3c080f80ef0524c3178fc328f326
\ No newline at end of file diff --git a/db/schema_migrations/20230104220137 b/db/schema_migrations/20230104220137 new file mode 100644 index 00000000000..cc31da81328 --- /dev/null +++ b/db/schema_migrations/20230104220137 @@ -0,0 +1 @@ +49d5ccd1521885a759d3ca6da59479aad17a90640b157cfe6bd6a22328ec30d9
\ No newline at end of file diff --git a/db/schema_migrations/20230104224020 b/db/schema_migrations/20230104224020 new file mode 100644 index 00000000000..ca4f1ac5552 --- /dev/null +++ b/db/schema_migrations/20230104224020 @@ -0,0 +1 @@ +8fe5279720306a5f91f973d1ee7c62838b60ab5cb11162237d50fbc32c7567bd
\ No newline at end of file diff --git a/db/schema_migrations/20230105170414 b/db/schema_migrations/20230105170414 new file mode 100644 index 00000000000..6892cba20ac --- /dev/null +++ b/db/schema_migrations/20230105170414 @@ -0,0 +1 @@ +14de51f7ba812f5a4159e18f2f537ea91e21c1f5fc6c297417409c815c2ac0be
\ No newline at end of file diff --git a/db/schema_migrations/20230105172120 b/db/schema_migrations/20230105172120 new file mode 100644 index 00000000000..d849fb97d65 --- /dev/null +++ b/db/schema_migrations/20230105172120 @@ -0,0 +1 @@ +b3c4386dd49156991f2c9efe2516f96540d0bad81965a7be56f319a4dbe13580
\ No newline at end of file diff --git a/db/schema_migrations/20230105180002 b/db/schema_migrations/20230105180002 new file mode 100644 index 00000000000..94ce14f4739 --- /dev/null +++ b/db/schema_migrations/20230105180002 @@ -0,0 +1 @@ +3dcf0ced36dc29ebb3e79bbe137e7e0ca76e74d30bebaec5971e91eb858ae145
\ No newline at end of file diff --git a/db/schema_migrations/20230106124332 b/db/schema_migrations/20230106124332 new file mode 100644 index 00000000000..ebd5e9d8f24 --- /dev/null +++ b/db/schema_migrations/20230106124332 @@ -0,0 +1 @@ +7cd938dc6063a51abca80760b6c17f33e64fc73012c56ebbb8ffe4a18defa961
\ No newline at end of file diff --git a/db/schema_migrations/20230106125945 b/db/schema_migrations/20230106125945 new file mode 100644 index 00000000000..0a7df366e57 --- /dev/null +++ b/db/schema_migrations/20230106125945 @@ -0,0 +1 @@ +6b100c6dca62cbb73103b1e82e78d499eaa9a32b2a04109e5e8c79c5ec5b7927
\ No newline at end of file diff --git a/db/schema_migrations/20230106131659 b/db/schema_migrations/20230106131659 new file mode 100644 index 00000000000..46753b2ccc5 --- /dev/null +++ b/db/schema_migrations/20230106131659 @@ -0,0 +1 @@ +1d111bb8f2eee2fa06070a383170ac0e8c0bfb7135d0b0d4e77bd98fc8458960
\ No newline at end of file diff --git a/db/schema_migrations/20230106142239 b/db/schema_migrations/20230106142239 new file mode 100644 index 00000000000..9db0af20dfa --- /dev/null +++ b/db/schema_migrations/20230106142239 @@ -0,0 +1 @@ +17a39b088e164f5642ad5ac34ef03a3c358c0694f6c2313036dd883f07ecc245
\ No newline at end of file diff --git a/db/schema_migrations/20230109095159 b/db/schema_migrations/20230109095159 new file mode 100644 index 00000000000..2e34a34538c --- /dev/null +++ b/db/schema_migrations/20230109095159 @@ -0,0 +1 @@ +dc0e429b5147b43c12e683b46f2d45cc2e52a66a94cac92a1c55d43ceb9dc0b3
\ No newline at end of file diff --git a/db/schema_migrations/20230109121313 b/db/schema_migrations/20230109121313 new file mode 100644 index 00000000000..485f829f7cc --- /dev/null +++ b/db/schema_migrations/20230109121313 @@ -0,0 +1 @@ +3f2dca9f653c9fe29edde1b29889caf47d17792660b4ab496f4c77cc1f512bf2
\ No newline at end of file diff --git a/db/schema_migrations/20230109215921 b/db/schema_migrations/20230109215921 new file mode 100644 index 00000000000..596b02f9f5f --- /dev/null +++ b/db/schema_migrations/20230109215921 @@ -0,0 +1 @@ +509d522cb5e0fc461228d9102f942e4d5a0c0e4df3fad98bb2988250a9436172
\ No newline at end of file diff --git a/db/schema_migrations/20230110031131 b/db/schema_migrations/20230110031131 new file mode 100644 index 00000000000..b9765ed25ea --- /dev/null +++ b/db/schema_migrations/20230110031131 @@ -0,0 +1 @@ +ae6f1f8a86b4b333349e8631f83372ff509f0844530d7438ba9cf78a49aa2e7d
\ No newline at end of file diff --git a/db/schema_migrations/20230110172751 b/db/schema_migrations/20230110172751 new file mode 100644 index 00000000000..aabd27bcd3d --- /dev/null +++ b/db/schema_migrations/20230110172751 @@ -0,0 +1 @@ +0f3165c67b8b97901561614dfa54a50650c042df9b69ad0f2cc9ae793799a653
\ No newline at end of file diff --git a/db/schema_migrations/20230111092510 b/db/schema_migrations/20230111092510 new file mode 100644 index 00000000000..b84ab421d2d --- /dev/null +++ b/db/schema_migrations/20230111092510 @@ -0,0 +1 @@ +d80ba166cee17bce1ac7825d9acdc9eeaf78aca5df276cfe2c3b2b076112dd1e
\ No newline at end of file diff --git a/db/schema_migrations/20230111124512 b/db/schema_migrations/20230111124512 new file mode 100644 index 00000000000..405823e2861 --- /dev/null +++ b/db/schema_migrations/20230111124512 @@ -0,0 +1 @@ +914b596569910281ff0973119d042e0a2f7e4d16e649d7b412681c3d7eaa1854
\ No newline at end of file diff --git a/db/schema_migrations/20230111125148 b/db/schema_migrations/20230111125148 new file mode 100644 index 00000000000..d152198f42c --- /dev/null +++ b/db/schema_migrations/20230111125148 @@ -0,0 +1 @@ +3df52ce2b3bfb29884d73cb69aa317ccca8f13c06a4e5cc6622347c52b599c50
\ No newline at end of file diff --git a/db/schema_migrations/20230111125150 b/db/schema_migrations/20230111125150 new file mode 100644 index 00000000000..21009223bc2 --- /dev/null +++ b/db/schema_migrations/20230111125150 @@ -0,0 +1 @@ +414c3da79aa6ae6b6a609b7dae715c0121f62d84a76400b745c0b8eaf27433e0
\ No newline at end of file diff --git a/db/schema_migrations/20230111132621 b/db/schema_migrations/20230111132621 new file mode 100644 index 00000000000..c259e47ca6d --- /dev/null +++ b/db/schema_migrations/20230111132621 @@ -0,0 +1 @@ +d058410f8fd26f5a4d8b18b949ee1c8202b4b2eaa8c5589a81f14107f15cd9fd
\ No newline at end of file diff --git a/db/schema_migrations/20230112014822 b/db/schema_migrations/20230112014822 new file mode 100644 index 00000000000..84e276b6334 --- /dev/null +++ b/db/schema_migrations/20230112014822 @@ -0,0 +1 @@ +2501bf572453b7d77759dfd0677e9f0a0ae35c6095a3df6fa841a4b698602186
\ No newline at end of file diff --git a/db/schema_migrations/20230112085143 b/db/schema_migrations/20230112085143 new file mode 100644 index 00000000000..94f871c7ad8 --- /dev/null +++ b/db/schema_migrations/20230112085143 @@ -0,0 +1 @@ +42bceeb42c208e733d3e7d88c89b9e85e0fb4947f5f8d3828586417fe8ed9ec6
\ No newline at end of file diff --git a/db/schema_migrations/20230112104253 b/db/schema_migrations/20230112104253 new file mode 100644 index 00000000000..dd1f7237448 --- /dev/null +++ b/db/schema_migrations/20230112104253 @@ -0,0 +1 @@ +e15e005b840e8d6037548d2abec3ddbae9698ce29e41ac63b134cfc57361d311
\ No newline at end of file diff --git a/db/schema_migrations/20230112104526 b/db/schema_migrations/20230112104526 new file mode 100644 index 00000000000..6f7dc070f72 --- /dev/null +++ b/db/schema_migrations/20230112104526 @@ -0,0 +1 @@ +7824b001286975b284a1cc9dafd58e8959d9f9560a283b139551542bea82b128
\ No newline at end of file diff --git a/db/schema_migrations/20230112104636 b/db/schema_migrations/20230112104636 new file mode 100644 index 00000000000..ed9fbf67d97 --- /dev/null +++ b/db/schema_migrations/20230112104636 @@ -0,0 +1 @@ +ec9497e49f2b1289c144abf50aeb288fdbdf9543cf87bb874054bf6bb51c645f
\ No newline at end of file diff --git a/db/schema_migrations/20230113003255 b/db/schema_migrations/20230113003255 new file mode 100644 index 00000000000..21c60171eb8 --- /dev/null +++ b/db/schema_migrations/20230113003255 @@ -0,0 +1 @@ +b10da671ade6a312cdd41f9800c301642c81da8e04fcaa3ea322ef9923d18933
\ No newline at end of file diff --git a/db/schema_migrations/20230116083826 b/db/schema_migrations/20230116083826 new file mode 100644 index 00000000000..599661ce5bf --- /dev/null +++ b/db/schema_migrations/20230116083826 @@ -0,0 +1 @@ +505406e54c5351b1f6dee8a393e5fbfeb23240f007434724f6d096b64ba5cbcf
\ No newline at end of file diff --git a/db/schema_migrations/20230116090630 b/db/schema_migrations/20230116090630 new file mode 100644 index 00000000000..85667e15379 --- /dev/null +++ b/db/schema_migrations/20230116090630 @@ -0,0 +1 @@ +44d8f6ad5cf6c62ddf8c2ce2580b9d3edcf7ce25a87a580acf3bef0e9db42317
\ No newline at end of file diff --git a/db/schema_migrations/20230116090852 b/db/schema_migrations/20230116090852 new file mode 100644 index 00000000000..8f4fc0e17c1 --- /dev/null +++ b/db/schema_migrations/20230116090852 @@ -0,0 +1 @@ +01a0c8d8e168068dd127d9763705736ace4420d69cae30be54d2a62bce40e855
\ No newline at end of file diff --git a/db/schema_migrations/20230116090920 b/db/schema_migrations/20230116090920 new file mode 100644 index 00000000000..89b5ca6744c --- /dev/null +++ b/db/schema_migrations/20230116090920 @@ -0,0 +1 @@ +828d17a6ea6658e6f8b8638564e4bb08fd224b19245349b19903396f86c4e276
\ No newline at end of file diff --git a/db/schema_migrations/20230116091626 b/db/schema_migrations/20230116091626 new file mode 100644 index 00000000000..93b2c333c5b --- /dev/null +++ b/db/schema_migrations/20230116091626 @@ -0,0 +1 @@ +5087e055f633fba07d4aa1f50c2172d5da71c1d1d34426d291e99ac30f077667
\ No newline at end of file diff --git a/db/schema_migrations/20230116111252 b/db/schema_migrations/20230116111252 new file mode 100644 index 00000000000..bee6cdeb031 --- /dev/null +++ b/db/schema_migrations/20230116111252 @@ -0,0 +1 @@ +a849b6e387cf0fb2dffd67674062d0b283853ad582546d49c782b9120f075383
\ No newline at end of file diff --git a/db/schema_migrations/20230117113719 b/db/schema_migrations/20230117113719 new file mode 100644 index 00000000000..abdccc39a80 --- /dev/null +++ b/db/schema_migrations/20230117113719 @@ -0,0 +1 @@ +d0aac8e7bdb605eec1f3d60aa06db81e36d0069b79a15a89f4a076889dd68edc
\ No newline at end of file diff --git a/db/schema_migrations/20230117145628 b/db/schema_migrations/20230117145628 new file mode 100644 index 00000000000..62411cc9be8 --- /dev/null +++ b/db/schema_migrations/20230117145628 @@ -0,0 +1 @@ +9e6ebddf8723cd07222099bba07c97a8747abe9ea21f07c7ee7875e769cde4a4
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 72d9c94be49..ec8f3362c40 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -225,24 +225,6 @@ RETURN NULL; END $$; -CREATE FUNCTION sync_namespaces_amount_used_columns() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."new_amount_used" := NEW."amount_used"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION sync_projects_amount_used_columns() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."new_amount_used" := NEW."amount_used"; - RETURN NEW; -END; -$$; - CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -10602,7 +10584,10 @@ CREATE TABLE abuse_reports ( created_at timestamp without time zone, updated_at timestamp without time zone, message_html text, - cached_markdown_version integer + cached_markdown_version integer, + category smallint DEFAULT 1 NOT NULL, + reported_from_url text DEFAULT ''::text NOT NULL, + CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512)) ); CREATE SEQUENCE abuse_reports_id_seq @@ -10966,6 +10951,21 @@ CREATE SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY analytics_cycle_analytics_stage_event_hashes.id; +CREATE TABLE analytics_dashboards_pointers ( + id bigint NOT NULL, + namespace_id bigint NOT NULL, + project_id bigint NOT NULL +); + +CREATE SEQUENCE analytics_dashboards_pointers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_dashboards_pointers_id_seq OWNED BY analytics_dashboards_pointers.id; + CREATE TABLE analytics_devops_adoption_segments ( id bigint NOT NULL, last_recorded_at timestamp with time zone, @@ -11063,9 +11063,11 @@ CREATE TABLE appearances ( email_header_and_footer_enabled boolean DEFAULT false NOT NULL, profile_image_guidelines text, profile_image_guidelines_html text, - short_title text, + pwa_short_name text, + pwa_icon text, CONSTRAINT appearances_profile_image_guidelines CHECK ((char_length(profile_image_guidelines) <= 4096)), - CONSTRAINT check_fdf3064682 CHECK ((char_length(short_title) <= 255)) + CONSTRAINT check_5c3fd63577 CHECK ((char_length(pwa_short_name) <= 255)), + CONSTRAINT check_5e5b7ac344 CHECK ((char_length(pwa_icon) <= 1024)) ); CREATE SEQUENCE appearances_id_seq @@ -11557,6 +11559,8 @@ CREATE TABLE application_settings ( disable_personal_access_tokens boolean DEFAULT false NOT NULL, max_terraform_state_size_bytes integer DEFAULT 0 NOT NULL, bulk_import_enabled boolean DEFAULT false NOT NULL, + allow_runner_registration_token boolean DEFAULT true NOT NULL, + user_defaults_to_private_profile boolean DEFAULT false NOT NULL, 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)), @@ -11881,7 +11885,7 @@ CREATE TABLE atlassian_identities ( encrypted_refresh_token bytea, encrypted_refresh_token_iv bytea, CONSTRAINT atlassian_identities_refresh_token_iv_length_constraint CHECK ((octet_length(encrypted_refresh_token_iv) <= 12)), - CONSTRAINT atlassian_identities_refresh_token_length_constraint CHECK ((octet_length(encrypted_refresh_token) <= 512)), + CONSTRAINT atlassian_identities_refresh_token_length_constraint CHECK ((octet_length(encrypted_refresh_token) <= 5000)), CONSTRAINT atlassian_identities_token_iv_length_constraint CHECK ((octet_length(encrypted_token_iv) <= 12)), CONSTRAINT atlassian_identities_token_length_constraint CHECK ((octet_length(encrypted_token) <= 2048)), CONSTRAINT check_32f5779763 CHECK ((char_length(extern_uid) <= 255)) @@ -12440,6 +12444,7 @@ CREATE TABLE bulk_import_entities ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, source_xid integer, + migrate_projects boolean DEFAULT true NOT NULL, 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)), @@ -12576,8 +12581,7 @@ CREATE TABLE chat_names ( last_used_at timestamp without time zone, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, - integration_id integer, - CONSTRAINT check_2b0a0d0f0f CHECK ((integration_id IS NOT NULL)) + integration_id integer ); CREATE SEQUENCE chat_names_id_seq @@ -12757,7 +12761,8 @@ CREATE TABLE p_ci_builds_metadata ( 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 + debug_trace_enabled boolean DEFAULT false NOT NULL, + runner_machine_id bigint ) PARTITION BY LIST (partition_id); @@ -12786,7 +12791,8 @@ CREATE TABLE ci_builds_metadata ( 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 + debug_trace_enabled boolean DEFAULT false NOT NULL, + runner_machine_id bigint ); ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100'); @@ -12945,6 +12951,7 @@ CREATE TABLE ci_job_artifacts ( locked smallint DEFAULT 2, original_filename text, partition_id bigint DEFAULT 100 NOT NULL, + accessibility smallint DEFAULT 0 NOT NULL, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)), CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512)) ); @@ -13036,11 +13043,10 @@ CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, date date 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, - new_amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, + amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -13319,10 +13325,9 @@ 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, - new_amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, + amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -13388,6 +13393,37 @@ CREATE SEQUENCE ci_resources_id_seq ALTER SEQUENCE ci_resources_id_seq OWNED BY ci_resources.id; +CREATE TABLE ci_runner_machines ( + id bigint NOT NULL, + runner_id bigint NOT NULL, + executor_type smallint, + machine_xid text NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + contacted_at timestamp with time zone, + version text, + revision text, + platform text, + architecture text, + ip_address text, + config jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT check_1537c1f66f CHECK ((char_length(platform) <= 255)), + CONSTRAINT check_6f45a91da7 CHECK ((char_length(version) <= 2048)), + CONSTRAINT check_84ed5d8703 CHECK ((char_length(machine_xid) <= 64)), + CONSTRAINT check_9b521b3105 CHECK ((char_length(architecture) <= 255)), + CONSTRAINT check_afb8efc1a2 CHECK ((char_length(revision) <= 255)), + CONSTRAINT check_f214590856 CHECK ((char_length(ip_address) <= 1024)) +); + +CREATE SEQUENCE ci_runner_machines_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_runner_machines_id_seq OWNED BY ci_runner_machines.id; + CREATE TABLE ci_runner_namespaces ( id integer NOT NULL, runner_id integer, @@ -13453,6 +13489,8 @@ CREATE TABLE ci_runners ( maintainer_note text, token_expires_at timestamp with time zone, allowed_plans text[] DEFAULT '{}'::text[] NOT NULL, + registration_type smallint DEFAULT 0 NOT NULL, + creator_id bigint, CONSTRAINT check_ce275cee06 CHECK ((char_length(maintainer_note) <= 1024)) ); @@ -15134,6 +15172,14 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_group_index_statuses ( + namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + wiki_indexed_at timestamp with time zone, + last_wiki_commit bytea +); + CREATE TABLE elastic_index_settings ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15667,20 +15713,6 @@ CREATE SEQUENCE geo_cache_invalidation_events_id_seq ALTER SEQUENCE geo_cache_invalidation_events_id_seq OWNED BY geo_cache_invalidation_events.id; -CREATE TABLE geo_container_repository_updated_events ( - id bigint NOT NULL, - container_repository_id integer NOT NULL -); - -CREATE SEQUENCE geo_container_repository_updated_events_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE geo_container_repository_updated_events_id_seq OWNED BY geo_container_repository_updated_events.id; - CREATE TABLE geo_event_log ( id bigint NOT NULL, created_at timestamp without time zone NOT NULL, @@ -15693,7 +15725,6 @@ CREATE TABLE geo_event_log ( hashed_storage_attachments_event_id bigint, reset_checksum_event_id bigint, cache_invalidation_event_id bigint, - container_repository_updated_event_id bigint, geo_event_id integer ); @@ -16714,6 +16745,7 @@ CREATE TABLE integrations ( archive_trace_events boolean DEFAULT false NOT NULL, encrypted_properties bytea, encrypted_properties_iv bytea, + incident_events boolean DEFAULT false NOT NULL, CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255)) ); @@ -18016,7 +18048,9 @@ CREATE TABLE ml_candidates ( user_id bigint, start_time bigint, end_time bigint, - status smallint DEFAULT 0 NOT NULL + status smallint DEFAULT 0 NOT NULL, + name text, + CONSTRAINT check_25e6c65051 CHECK ((char_length(name) <= 255)) ); CREATE SEQUENCE ml_candidates_id_seq @@ -18214,6 +18248,7 @@ CREATE TABLE namespace_settings ( only_allow_merge_if_all_discussions_are_resolved boolean DEFAULT false NOT NULL, default_compliance_framework_id bigint, runner_registration_enabled boolean DEFAULT true, + allow_runner_registration_token boolean DEFAULT true NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) ); @@ -19551,7 +19586,10 @@ CREATE TABLE plan_limits ( ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL, rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL, ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL, - pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL + pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL, + enforcement_limit integer DEFAULT 0 NOT NULL, + notification_limit integer DEFAULT 0 NOT NULL, + dashboard_limit_enabled_at timestamp with time zone ); CREATE SEQUENCE plan_limits_id_seq @@ -19705,12 +19743,24 @@ CREATE VIEW postgres_foreign_keys AS SELECT pg_constraint.oid, pg_constraint.conname AS name, (((constrained_namespace.nspname)::text || '.'::text) || (constrained_table.relname)::text) AS constrained_table_identifier, - (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier - FROM ((((pg_constraint + (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier, + (constrained_table.relname)::text AS constrained_table_name, + (referenced_table.relname)::text AS referenced_table_name, + constrained_cols.constrained_columns, + referenced_cols.referenced_columns, + pg_constraint.confdeltype AS on_delete_action, + (pg_constraint.coninhcount > 0) AS is_inherited + FROM ((((((pg_constraint JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid))) JOIN pg_class referenced_table ON ((referenced_table.oid = pg_constraint.confrelid))) JOIN pg_namespace constrained_namespace ON ((constrained_table.relnamespace = constrained_namespace.oid))) JOIN pg_namespace referenced_namespace ON ((referenced_table.relnamespace = referenced_namespace.oid))) + CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) AS array_agg + FROM (unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx) + 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) 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)) WHERE (pg_constraint.contype = 'f'::"char"); CREATE VIEW postgres_index_bloat_estimates AS @@ -21115,7 +21165,8 @@ CREATE TABLE requirements_management_test_reports ( author_id bigint, state smallint NOT NULL, build_id bigint, - issue_id bigint + issue_id bigint, + uses_legacy_iid boolean DEFAULT true NOT NULL ); CREATE SEQUENCE requirements_management_test_reports_id_seq @@ -21376,7 +21427,8 @@ CREATE TABLE sbom_occurrences ( pipeline_id bigint, source_id bigint, commit_sha bytea NOT NULL, - component_id bigint NOT NULL + component_id bigint NOT NULL, + uuid uuid NOT NULL ); CREATE SEQUENCE sbom_occurrences_id_seq @@ -21929,7 +21981,9 @@ CREATE TABLE ssh_signatures ( project_id bigint NOT NULL, key_id bigint, verification_status smallint DEFAULT 0 NOT NULL, - commit_sha bytea NOT NULL + commit_sha bytea NOT NULL, + user_id bigint, + key_fingerprint_sha256 bytea ); CREATE SEQUENCE ssh_signatures_id_seq @@ -22380,6 +22434,26 @@ CREATE SEQUENCE uploads_id_seq ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; +CREATE TABLE user_achievements ( + id bigint NOT NULL, + achievement_id bigint NOT NULL, + user_id bigint NOT NULL, + awarded_by_user_id bigint, + revoked_by_user_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + revoked_at timestamp with time zone +); + +CREATE SEQUENCE user_achievements_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_achievements_id_seq OWNED BY user_achievements.id; + CREATE TABLE user_agent_details ( id integer NOT NULL, user_agent character varying NOT NULL, @@ -23710,6 +23784,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id 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); + ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass); @@ -23876,6 +23952,8 @@ ALTER TABLE ONLY ci_resource_groups ALTER COLUMN id SET DEFAULT nextval('ci_reso ALTER TABLE ONLY ci_resources ALTER COLUMN id SET DEFAULT nextval('ci_resources_id_seq'::regclass); +ALTER TABLE ONLY ci_runner_machines ALTER COLUMN id SET DEFAULT nextval('ci_runner_machines_id_seq'::regclass); + ALTER TABLE ONLY ci_runner_namespaces ALTER COLUMN id SET DEFAULT nextval('ci_runner_namespaces_id_seq'::regclass); ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runner_projects_id_seq'::regclass); @@ -24074,8 +24152,6 @@ ALTER TABLE ONLY fork_networks ALTER COLUMN id SET DEFAULT nextval('fork_network ALTER TABLE ONLY geo_cache_invalidation_events ALTER COLUMN id SET DEFAULT nextval('geo_cache_invalidation_events_id_seq'::regclass); -ALTER TABLE ONLY geo_container_repository_updated_events ALTER COLUMN id SET DEFAULT nextval('geo_container_repository_updated_events_id_seq'::regclass); - ALTER TABLE ONLY geo_event_log ALTER COLUMN id SET DEFAULT nextval('geo_event_log_id_seq'::regclass); ALTER TABLE ONLY geo_events ALTER COLUMN id SET DEFAULT nextval('geo_events_id_seq'::regclass); @@ -24634,6 +24710,8 @@ ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('uploa ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); +ALTER TABLE ONLY user_achievements ALTER COLUMN id SET DEFAULT nextval('user_achievements_id_seq'::regclass); + ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass); ALTER TABLE ONLY user_callouts ALTER COLUMN id SET DEFAULT nextval('user_callouts_id_seq'::regclass); @@ -25377,6 +25455,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT analytics_dashboards_pointers_pkey PRIMARY KEY (id); + ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id); @@ -25677,6 +25758,9 @@ ALTER TABLE ONLY ci_resource_groups ALTER TABLE ONLY ci_resources ADD CONSTRAINT ci_resources_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_runner_machines + ADD CONSTRAINT ci_runner_machines_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT ci_runner_namespaces_pkey PRIMARY KEY (id); @@ -25935,6 +26019,9 @@ ALTER TABLE ONLY dora_daily_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_group_index_statuses + ADD CONSTRAINT elastic_group_index_statuses_pkey PRIMARY KEY (namespace_id); + ALTER TABLE ONLY elastic_index_settings ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id); @@ -26016,9 +26103,6 @@ ALTER TABLE ONLY fork_networks ALTER TABLE ONLY geo_cache_invalidation_events ADD CONSTRAINT geo_cache_invalidation_events_pkey PRIMARY KEY (id); -ALTER TABLE ONLY geo_container_repository_updated_events - ADD CONSTRAINT geo_container_repository_updated_events_pkey PRIMARY KEY (id); - ALTER TABLE ONLY geo_event_log ADD CONSTRAINT geo_event_log_pkey PRIMARY KEY (id); @@ -26997,6 +27081,9 @@ ALTER TABLE ONLY upload_states ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT user_achievements_pkey PRIMARY KEY (id); + ALTER TABLE ONLY user_agent_details ADD CONSTRAINT user_agent_details_pkey PRIMARY KEY (id); @@ -28209,8 +28296,6 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_me CREATE UNIQUE INDEX idx_external_audit_event_destination_id_key_uniq ON audit_events_streaming_headers USING btree (key, external_audit_event_destination_id); -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_conan_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id) WHERE ((package_type = 3) AND (status = ANY (ARRAY[0, 1]))); CREATE INDEX idx_installable_helm_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id); @@ -28237,6 +28322,8 @@ CREATE INDEX idx_keys_expires_at_and_before_expiry_notification_undelivered ON k CREATE INDEX idx_members_created_at_user_id_invite_token ON members USING btree (created_at) WHERE ((invite_token IS NOT NULL) AND (user_id IS NULL)); +CREATE INDEX idx_members_on_user_and_source_and_source_type_and_member_role ON members USING btree (user_id, source_id, source_type, member_role_id); + CREATE INDEX idx_merge_requests_on_id_and_merge_jid ON merge_requests USING btree (id, merge_jid) WHERE ((merge_jid IS NOT NULL) AND (state_id = 4)); CREATE INDEX idx_merge_requests_on_merged_state ON merge_requests USING btree (id) WHERE (state_id = 3); @@ -28429,6 +28516,10 @@ CREATE UNIQUE INDEX index_analytics_ca_project_value_streams_on_project_id_and_n 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); + +CREATE INDEX index_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id); + CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); CREATE INDEX index_application_settings_on_file_template_project_id ON application_settings USING btree (file_template_project_id); @@ -28631,11 +28722,9 @@ 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_chat_names_on_integration_id_and_team_id_and_chat_id ON chat_names USING btree (integration_id, team_id, chat_id); - CREATE INDEX index_chat_names_on_team_id_and_chat_id ON chat_names USING btree (team_id, chat_id); -CREATE UNIQUE INDEX index_chat_names_on_user_id_and_integration_id ON chat_names USING btree (user_id, integration_id); +CREATE INDEX index_chat_names_on_user_id ON chat_names USING btree (user_id); CREATE UNIQUE INDEX index_chat_teams_on_namespace_id ON chat_teams USING btree (namespace_id); @@ -28643,10 +28732,14 @@ CREATE UNIQUE INDEX index_ci_build_needs_on_build_id_and_name ON ci_build_needs CREATE UNIQUE INDEX index_ci_build_pending_states_on_build_id ON ci_build_pending_states USING btree (build_id); +CREATE INDEX index_ci_build_pending_states_on_partition_id_build_id ON ci_build_pending_states USING btree (partition_id, build_id); + CREATE INDEX index_ci_build_report_results_on_project_id ON ci_build_report_results USING btree (project_id); CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON ci_build_trace_chunks USING btree (build_id, chunk_index); +CREATE INDEX index_ci_build_trace_chunks_on_partition_id_build_id ON ci_build_trace_chunks USING btree (partition_id, build_id); + CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id); CREATE INDEX p_ci_builds_metadata_build_id_idx ON ONLY p_ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE); @@ -28803,6 +28896,8 @@ CREATE INDEX index_ci_pipeline_metadata_on_project_id ON ci_pipeline_metadata US CREATE UNIQUE INDEX index_ci_pipeline_schedule_variables_on_schedule_id_and_key ON ci_pipeline_schedule_variables USING btree (pipeline_schedule_id, key); +CREATE INDEX index_ci_pipeline_schedules_on_id_and_next_run_at_and_active ON ci_pipeline_schedules USING btree (id, next_run_at) WHERE (active = true); + CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipeline_schedules USING btree (next_run_at, active); CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); @@ -28871,6 +28966,14 @@ CREATE INDEX index_ci_resources_on_build_id ON ci_resources USING btree (build_i CREATE UNIQUE INDEX index_ci_resources_on_resource_group_id_and_build_id ON ci_resources USING btree (resource_group_id, build_id); +CREATE INDEX index_ci_runner_machines_on_contacted_at_desc_and_id_desc ON ci_runner_machines USING btree (contacted_at DESC, id DESC); + +CREATE INDEX index_ci_runner_machines_on_created_at_and_id_desc ON ci_runner_machines USING btree (created_at, id DESC); + +CREATE UNIQUE INDEX index_ci_runner_machines_on_runner_id_and_machine_xid ON ci_runner_machines USING btree (runner_id, machine_xid); + +CREATE INDEX index_ci_runner_machines_on_version ON ci_runner_machines USING btree (version); + CREATE INDEX index_ci_runner_namespaces_on_namespace_id ON ci_runner_namespaces USING btree (namespace_id); CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON ci_runner_namespaces USING btree (runner_id, namespace_id); @@ -28893,11 +28996,13 @@ CREATE INDEX index_ci_runners_on_created_at_and_id_where_inactive ON ci_runners CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC); +CREATE INDEX index_ci_runners_on_creator_id_where_creator_id_not_null ON ci_runners USING btree (creator_id) WHERE (creator_id IS NOT NULL); + CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops); CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked); -CREATE INDEX index_ci_runners_on_runner_type ON ci_runners USING btree (runner_type); +CREATE INDEX index_ci_runners_on_runner_type_and_id ON ci_runners USING btree (runner_type, id); CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USING btree (token_expires_at, id DESC); @@ -28963,6 +29068,8 @@ CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); +CREATE INDEX index_ci_unit_test_failures_on_partition_id_build_id ON ci_unit_test_failures USING btree (partition_id, build_id); + CREATE UNIQUE INDEX index_ci_unit_tests_on_project_id_and_key_hash ON ci_unit_tests USING btree (project_id, key_hash); CREATE INDEX index_ci_variables_on_key ON ci_variables USING btree (key); @@ -29299,6 +29406,8 @@ CREATE INDEX index_environments_on_merge_request_id ON environments USING btree CREATE INDEX index_environments_on_name_varchar_pattern_ops ON environments USING btree (name varchar_pattern_ops); +CREATE INDEX index_environments_on_project_id_and_id ON environments USING btree (project_id, id); + CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments USING btree (project_id, name); CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); @@ -29383,6 +29492,12 @@ CREATE INDEX index_et_errors_on_project_id_and_status_last_seen_at_id_desc ON er CREATE INDEX index_events_author_id_project_id_action_target_type_created_at ON events USING btree (author_id, project_id, action, target_type, created_at); +CREATE INDEX index_events_for_followed_users ON events USING btree (author_id, target_type, action, id); + +CREATE INDEX index_events_for_group_activity ON events USING btree (group_id, target_type, action, id) WHERE (group_id IS NOT NULL); + +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); @@ -29393,6 +29508,8 @@ CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_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_and_id ON events USING btree (group_id, id) WHERE (group_id IS NOT NULL); + 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); @@ -29431,8 +29548,6 @@ CREATE UNIQUE INDEX index_fork_networks_on_root_project_id ON fork_networks USIN 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_container_repository_updated_event_id ON geo_event_log USING btree (container_repository_updated_event_id); - 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); CREATE INDEX index_geo_event_log_on_hashed_storage_attachments_event_id ON geo_event_log USING btree (hashed_storage_attachments_event_id) WHERE (hashed_storage_attachments_event_id IS NOT NULL); @@ -29575,6 +29690,8 @@ CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositorie CREATE INDEX index_groups_on_parent_id_id ON namespaces USING btree (parent_id, id) WHERE ((type)::text = 'Group'::text); +CREATE INDEX index_groups_on_path_and_id ON namespaces USING btree (path, id) WHERE ((type)::text = 'Group'::text); + CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at); CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active; @@ -29905,6 +30022,8 @@ CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member_namespace_id); +CREATE INDEX index_members_on_member_namespace_id_compound ON members USING btree (member_namespace_id, type, requested_at, id); + CREATE INDEX index_members_on_member_role_id ON members USING btree (member_role_id); CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at); @@ -29917,8 +30036,6 @@ CREATE INDEX index_members_on_user_id_and_access_level_requested_at_is_null ON m CREATE INDEX index_members_on_user_id_created_at ON members USING btree (user_id, created_at) WHERE ((ldap = true) AND ((type)::text = 'GroupMember'::text) AND ((source_type)::text = 'Namespace'::text)); -CREATE INDEX index_members_on_user_id_source_id_source_type ON members USING btree (user_id, source_id, source_type); - CREATE INDEX index_merge_request_assignees_on_merge_request_id ON merge_request_assignees USING btree (merge_request_id); CREATE UNIQUE INDEX index_merge_request_assignees_on_merge_request_id_and_user_id ON merge_request_assignees USING btree (merge_request_id, user_id); @@ -30141,6 +30258,8 @@ CREATE UNIQUE INDEX index_namespaces_on_parent_id_and_id ON namespaces USING btr CREATE INDEX index_namespaces_on_path ON namespaces USING btree (path); +CREATE INDEX index_namespaces_on_path_for_top_level_non_projects ON namespaces USING btree (lower((path)::text)) WHERE ((parent_id IS NULL) AND ((type)::text <> 'Project'::text)); + CREATE INDEX index_namespaces_on_path_trigram ON namespaces USING gin (path gin_trgm_ops); CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON namespaces USING btree (push_rule_id); @@ -30907,14 +31026,14 @@ CREATE INDEX index_sbom_occurrences_on_component_id ON sbom_occurrences USING bt CREATE INDEX index_sbom_occurrences_on_component_version_id ON sbom_occurrences USING btree (component_version_id); -CREATE UNIQUE INDEX index_sbom_occurrences_on_ingestion_attributes ON sbom_occurrences USING btree (project_id, component_id, component_version_id, source_id, commit_sha); - CREATE INDEX index_sbom_occurrences_on_pipeline_id ON sbom_occurrences USING btree (pipeline_id); CREATE INDEX index_sbom_occurrences_on_project_id ON sbom_occurrences USING btree (project_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); + CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources USING btree (source_type, source); CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); @@ -31061,6 +31180,8 @@ CREATE INDEX index_ssh_signatures_on_key_id ON ssh_signatures USING btree (key_i CREATE INDEX index_ssh_signatures_on_project_id ON ssh_signatures USING btree (project_id); +CREATE INDEX index_ssh_signatures_on_user_id ON ssh_signatures USING btree (user_id); + CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id); CREATE INDEX index_status_check_responses_on_external_status_check_id ON status_check_responses USING btree (external_status_check_id); @@ -31213,6 +31334,14 @@ CREATE INDEX index_uploads_on_store ON uploads USING btree (store); CREATE INDEX index_uploads_on_uploader_and_path ON uploads USING btree (uploader, path); +CREATE INDEX index_user_achievements_on_achievement_id_revoked_by_is_null ON user_achievements USING btree (achievement_id, ((revoked_by_user_id IS NULL))); + +CREATE INDEX index_user_achievements_on_awarded_by_revoked_by_is_null ON user_achievements USING btree (awarded_by_user_id, ((revoked_by_user_id IS NULL))); + +CREATE INDEX index_user_achievements_on_revoked_by_user_id ON user_achievements USING btree (revoked_by_user_id); + +CREATE INDEX index_user_achievements_on_user_id_revoked_by_is_null ON user_achievements USING btree (user_id, ((revoked_by_user_id IS NULL))); + CREATE INDEX index_user_agent_details_on_subject_id_and_subject_type ON user_agent_details USING btree (subject_id, subject_type); CREATE INDEX index_user_callouts_on_user_id ON user_callouts USING btree (user_id); @@ -31267,7 +31396,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_active_billable ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) OR (user_type <> ALL ('{1,2,3,4,5,6,7,8,9,11}'::smallint[])))); +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_on_accepted_term_id ON users USING btree (accepted_term_id); @@ -31337,14 +31466,14 @@ COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu- 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_common_query_on_resolved_on_default_branch ON vulnerability_reads USING btree (project_id, state, report_type, vulnerability_id DESC) WHERE (resolved_on_default_branch IS TRUE); + CREATE INDEX index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null ON vulnerability_reads USING btree (casted_cluster_agent_id) WHERE (casted_cluster_agent_id IS NOT NULL); CREATE INDEX index_vuln_reads_on_namespace_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (namespace_id, state, severity, vulnerability_id DESC); 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_vuln_reads_on_resolved_on_default_branch ON vulnerability_reads USING btree (project_id, state, id) WHERE (resolved_on_default_branch IS TRUE); - CREATE INDEX index_vulnerabilities_common_finder_query_on_default_branch ON vulnerabilities USING btree (project_id, state, report_type, present_on_default_branch, severity, id); CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); @@ -31633,10 +31762,6 @@ 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_vulnerabilities_on_id_where_report_type_7_99 ON vulnerabilities USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); - -CREATE INDEX tmp_idx_where_user_details_fields_filled ON users USING btree (id) WHERE (((COALESCE(linkedin, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(twitter, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(skype, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(website_url, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(location, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(organization, ''::character varying))::text IS DISTINCT FROM ''::text)); - CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL)); CREATE INDEX tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace ON ci_job_artifacts USING btree (id) WHERE (((date_part('day'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision])) AND (date_part('minute'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(0)::double precision, (30)::double precision, (45)::double precision])) AND (date_part('second'::text, timezone('UTC'::text, expire_at)) = (0)::double precision)) OR (file_type = 3)); @@ -31655,11 +31780,13 @@ CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (st 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)); +CREATE INDEX tmp_index_oauth_access_tokens_on_id_where_expires_in_null ON oauth_access_tokens USING btree (id) WHERE (expires_in IS NULL); + CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); 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_project_statistics_uploads_size ON project_statistics USING btree (project_id) WHERE (uploads_size <> 0); +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); @@ -31677,6 +31804,8 @@ CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_codena CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_suite ON packages_debian_project_distributions USING btree (project_id, 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_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id); @@ -33003,10 +33132,6 @@ 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 sync_namespaces_amount_used_columns BEFORE INSERT OR UPDATE ON ci_namespace_monthly_usages FOR EACH ROW EXECUTE FUNCTION sync_namespaces_amount_used_columns(); - -CREATE TRIGGER sync_projects_amount_used_columns BEFORE INSERT OR UPDATE ON ci_project_monthly_usages FOR EACH ROW EXECUTE FUNCTION sync_projects_amount_used_columns(); - CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd(); 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(); @@ -33086,6 +33211,9 @@ ALTER TABLE ONLY dast_sites ALTER TABLE ONLY issue_customer_relations_contacts ADD CONSTRAINT fk_0c0037f723 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY ssh_signatures + ADD CONSTRAINT fk_0c83baaa5f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY web_hooks ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33098,6 +33226,9 @@ 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 ci_unit_test_failures + ADD CONSTRAINT fk_0f09856e1f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY deployment_approvals ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -33167,9 +33298,6 @@ ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER TABLE ONLY namespace_settings ADD CONSTRAINT fk_20cf0eb2f9 FOREIGN KEY (default_compliance_framework_id) REFERENCES compliance_management_frameworks(id) ON DELETE SET NULL; -ALTER TABLE ONLY geo_container_repository_updated_events - ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT fk_21d25cac1a FOREIGN KEY (trace_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE; @@ -33323,6 +33451,9 @@ ALTER TABLE ONLY sbom_occurrences ALTER TABLE ONLY namespace_commit_emails ADD CONSTRAINT fk_4d6ba63ba5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_4efde02858 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_reads ADD CONSTRAINT fk_4f593f6c62 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33377,6 +33508,9 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY project_access_tokens ADD CONSTRAINT fk_5f7e8450e1 FOREIGN KEY (personal_access_token_id) REFERENCES personal_access_tokens(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_60b12fcda3 FOREIGN KEY (awarded_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6149611a04 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33407,9 +33541,6 @@ ALTER TABLE ONLY project_wiki_repository_states ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; -ALTER TABLE ONLY geo_event_log - ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE; - ALTER TABLE ONLY projects ADD CONSTRAINT fk_6ca23af0a3 FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33578,9 +33709,6 @@ ALTER TABLE ONLY vulnerability_occurrences ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_98f3d044fe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY chat_names - ADD CONSTRAINT fk_99a1348daf FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE; - ALTER TABLE ONLY notes ADD CONSTRAINT fk_99e097b079 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33632,6 +33760,9 @@ ALTER TABLE ONLY lfs_objects_projects ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ssh_signatures + ADD CONSTRAINT fk_aa1efbe865 FOREIGN KEY (key_id) REFERENCES keys(id) ON DELETE SET NULL; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_aa5798e761 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33833,6 +33964,9 @@ ALTER TABLE ONLY agent_activity_events ALTER TABLE ONLY sbom_vulnerable_component_versions ADD CONSTRAINT fk_d720a1959a FOREIGN KEY (vulnerability_advisory_id) REFERENCES vulnerability_advisories(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_d7653ef780 FOREIGN KEY (revoked_by_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; @@ -33947,9 +34081,6 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ssh_signatures - ADD CONSTRAINT fk_f177ea6aa5 FOREIGN KEY (key_id) REFERENCES keys(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_pipeline_variables ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -34061,6 +34192,9 @@ ALTER TABLE ONLY related_epic_links ALTER TABLE ONLY ci_build_pending_states ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_pending_states + ADD CONSTRAINT fk_rails_0bbbfeaf9d_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY audit_events_external_audit_event_destinations ADD CONSTRAINT fk_rails_0bc80a4edc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34091,6 +34225,9 @@ ALTER TABLE ONLY merge_request_context_commits ALTER TABLE ONLY ci_build_trace_chunks ADD CONSTRAINT fk_rails_1013b761f2 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_trace_chunks + ADD CONSTRAINT fk_rails_1013b761f2_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_rails_1019162882 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34541,6 +34678,9 @@ ALTER TABLE ONLY project_repository_storage_moves ALTER TABLE ONLY ml_candidate_metadata ADD CONSTRAINT fk_rails_5117dddf22 FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; +ALTER TABLE ONLY elastic_group_index_statuses + ADD CONSTRAINT fk_rails_52b9969b12 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY bulk_import_configurations ADD CONSTRAINT fk_rails_536b96bff1 FOREIGN KEY (bulk_import_id) REFERENCES bulk_imports(id) ON DELETE CASCADE; @@ -34697,6 +34837,9 @@ ALTER TABLE ONLY operations_feature_flags_clients ALTER TABLE ONLY namespace_admin_notes ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY 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; @@ -34739,6 +34882,9 @@ ALTER TABLE ONLY users_security_dashboard_projects ALTER TABLE ONLY dast_sites ADD CONSTRAINT fk_rails_6febb6ea9c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT fk_rails_7027b7eaa9 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_builds_runner_session ADD CONSTRAINT fk_rails_70707857d3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; @@ -35291,6 +35437,9 @@ ALTER TABLE ONLY project_wiki_repositories ALTER TABLE ONLY merge_request_user_mentions ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_rails_c44f5b3b25 FOREIGN KEY (achievement_id) REFERENCES achievements(id) ON DELETE CASCADE; + ALTER TABLE ONLY related_epic_links ADD CONSTRAINT fk_rails_c464534def FOREIGN KEY (source_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -35576,6 +35725,9 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER TABLE ONLY dast_pre_scan_verifications ADD CONSTRAINT fk_rails_f08d9312a8 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT fk_rails_f0e7c640c3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; |