diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-16 13:42:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-16 13:42:19 +0300 |
commit | 84d1bd786125c1c14a3ba5f63e38a4cc736a9027 (patch) | |
tree | f550fa965f507077e20dbb6d61a8269a99ef7107 /db | |
parent | 3a105e36e689f7b75482236712f1a47fd5a76814 (diff) |
Add latest changes from gitlab-org/gitlab@16-8-stable-eev16.8.0-rc42
Diffstat (limited to 'db')
305 files changed, 4541 insertions, 259 deletions
diff --git a/db/click_house/migrate/main/20240102161100_modify_ci_finished_builds_created_at_default_to_zero.rb b/db/click_house/migrate/main/20240102161100_modify_ci_finished_builds_created_at_default_to_zero.rb new file mode 100644 index 00000000000..abbc0d8191d --- /dev/null +++ b/db/click_house/migrate/main/20240102161100_modify_ci_finished_builds_created_at_default_to_zero.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ModifyCiFinishedBuildsCreatedAtDefaultToZero < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN created_at DEFAULT 0 + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN created_at DEFAULT now() + SQL + end +end diff --git a/db/click_house/migrate/main/20240102161101_modify_ci_finished_builds_queued_at_default_to_zero.rb b/db/click_house/migrate/main/20240102161101_modify_ci_finished_builds_queued_at_default_to_zero.rb new file mode 100644 index 00000000000..90a3dcf74c3 --- /dev/null +++ b/db/click_house/migrate/main/20240102161101_modify_ci_finished_builds_queued_at_default_to_zero.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ModifyCiFinishedBuildsQueuedAtDefaultToZero < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN queued_at DEFAULT 0 + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN queued_at DEFAULT now() + SQL + end +end diff --git a/db/click_house/migrate/main/20240102161102_modify_ci_finished_builds_started_at_default_to_zero.rb b/db/click_house/migrate/main/20240102161102_modify_ci_finished_builds_started_at_default_to_zero.rb new file mode 100644 index 00000000000..e4fae74748b --- /dev/null +++ b/db/click_house/migrate/main/20240102161102_modify_ci_finished_builds_started_at_default_to_zero.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ModifyCiFinishedBuildsStartedAtDefaultToZero < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN started_at DEFAULT 0 + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds MODIFY COLUMN started_at DEFAULT COALESCE(finished_at, 0) + SQL + end +end diff --git a/db/click_house/migrate/main/20240102161103_modify_ci_finished_builds_duration_calculation.rb b/db/click_house/migrate/main/20240102161103_modify_ci_finished_builds_duration_calculation.rb new file mode 100644 index 00000000000..5a40e36fea3 --- /dev/null +++ b/db/click_house/migrate/main/20240102161103_modify_ci_finished_builds_duration_calculation.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ModifyCiFinishedBuildsDurationCalculation < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + MODIFY COLUMN duration Int64 MATERIALIZED if(started_at > 0 AND finished_at > started_at, age('ms', started_at, finished_at), 0) + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + MODIFY COLUMN duration Int64 MATERIALIZED age('ms', started_at, finished_at) + SQL + end +end diff --git a/db/click_house/migrate/main/20240102161104_modify_ci_finished_builds_queueing_duration_calculation.rb b/db/click_house/migrate/main/20240102161104_modify_ci_finished_builds_queueing_duration_calculation.rb new file mode 100644 index 00000000000..e53f56dee14 --- /dev/null +++ b/db/click_house/migrate/main/20240102161104_modify_ci_finished_builds_queueing_duration_calculation.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ModifyCiFinishedBuildsQueueingDurationCalculation < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + MODIFY COLUMN queueing_duration Int64 MATERIALIZED if(queued_at > 0 AND started_at > queued_at, age('ms', queued_at, started_at), 0) + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + MODIFY COLUMN queueing_duration Int64 MATERIALIZED age('ms', queued_at, started_at) + SQL + end +end diff --git a/db/click_house/migrate/main/20240104092900_add_root_namespace_id_to_ci_finished_builds.rb b/db/click_house/migrate/main/20240104092900_add_root_namespace_id_to_ci_finished_builds.rb new file mode 100644 index 00000000000..ac711e0e2aa --- /dev/null +++ b/db/click_house/migrate/main/20240104092900_add_root_namespace_id_to_ci_finished_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddRootNamespaceIdToCiFinishedBuilds < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + ADD COLUMN IF NOT EXISTS root_namespace_id UInt64 DEFAULT 0 + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + DROP COLUMN IF EXISTS root_namespace_id + SQL + end +end diff --git a/db/click_house/migrate/main/20240104092901_add_name_to_ci_finished_builds.rb b/db/click_house/migrate/main/20240104092901_add_name_to_ci_finished_builds.rb new file mode 100644 index 00000000000..30900736325 --- /dev/null +++ b/db/click_house/migrate/main/20240104092901_add_name_to_ci_finished_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddNameToCiFinishedBuilds < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + ADD COLUMN IF NOT EXISTS name String DEFAULT '' + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + DROP COLUMN IF EXISTS name + SQL + end +end diff --git a/db/click_house/migrate/main/20240104092902_add_stage_to_ci_finished_builds.rb b/db/click_house/migrate/main/20240104092902_add_stage_to_ci_finished_builds.rb new file mode 100644 index 00000000000..aeeac653847 --- /dev/null +++ b/db/click_house/migrate/main/20240104092902_add_stage_to_ci_finished_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddStageToCiFinishedBuilds < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + ADD COLUMN IF NOT EXISTS stage String DEFAULT '' + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + DROP COLUMN IF EXISTS stage + SQL + end +end diff --git a/db/click_house/migrate/main/20240104092903_add_date_to_ci_finished_builds.rb b/db/click_house/migrate/main/20240104092903_add_date_to_ci_finished_builds.rb new file mode 100644 index 00000000000..35b6eb77f0a --- /dev/null +++ b/db/click_house/migrate/main/20240104092903_add_date_to_ci_finished_builds.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddDateToCiFinishedBuilds < ClickHouse::Migration + def up + execute <<~SQL + ALTER TABLE ci_finished_builds + ADD COLUMN IF NOT EXISTS date Date32 MATERIALIZED toStartOfMonth(finished_at) + SQL + end + + def down + execute <<~SQL + ALTER TABLE ci_finished_builds + DROP COLUMN IF EXISTS date + SQL + end +end diff --git a/db/docs/achievements.yml b/db/docs/achievements.yml index 6f471929aea..c0aed4b81f2 100644 --- a/db/docs/achievements.yml +++ b/db/docs/achievements.yml @@ -7,4 +7,8 @@ feature_categories: description: Achievements which can be created by namespaces to award them to users introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105871 milestone: '15.7' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +sharding_key: + namespace_id: namespaces +allow_cross_joins: + - gitlab_main_clusterwide # TODO: Exists just for example in specs diff --git a/db/docs/activity_pub_releases_subscriptions.yml b/db/docs/activity_pub_releases_subscriptions.yml index 6075847c780..9b4c574b4e7 100644 --- a/db/docs/activity_pub_releases_subscriptions.yml +++ b/db/docs/activity_pub_releases_subscriptions.yml @@ -11,3 +11,5 @@ milestone: '16.6' gitlab_schema: gitlab_main_cell sharding_key: project_id: projects +allow_cross_transactions: + - gitlab_main_clusterwide # TODO: Exists just for example in specs diff --git a/db/docs/agent_group_authorizations.yml b/db/docs/agent_group_authorizations.yml index f0d45dbdc3d..506f27778c4 100644 --- a/db/docs/agent_group_authorizations.yml +++ b/db/docs/agent_group_authorizations.yml @@ -7,4 +7,8 @@ feature_categories: description: Configuration for a group that is authorized to use a particular cluster agent introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68023 milestone: '14.3' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +sharding_key: + group_id: namespaces +allow_cross_foreign_keys: + - gitlab_main_clusterwide # TODO: Exists just for example in specs diff --git a/db/docs/agent_project_authorizations.yml b/db/docs/agent_project_authorizations.yml index 77c26571c28..144598b8109 100644 --- a/db/docs/agent_project_authorizations.yml +++ b/db/docs/agent_project_authorizations.yml @@ -4,7 +4,16 @@ classes: - Clusters::Agents::Authorizations::CiAccess::ProjectAuthorization feature_categories: - deployment_management -description: Configuration for a project that is authorized to use a particular cluster agent +description: Configuration for a project that is authorized to use a particular cluster + agent introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67295 milestone: '14.3' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +allow_cross_joins: +- gitlab_main_clusterwide +allow_cross_transactions: +- gitlab_main_clusterwide +allow_cross_foreign_keys: +- gitlab_main_clusterwide +sharding_key: + project_id: projects diff --git a/db/docs/agent_user_access_group_authorizations.yml b/db/docs/agent_user_access_group_authorizations.yml index cd4df56d5a0..d6982789cff 100644 --- a/db/docs/agent_user_access_group_authorizations.yml +++ b/db/docs/agent_user_access_group_authorizations.yml @@ -4,7 +4,16 @@ classes: - Clusters::Agents::Authorizations::UserAccess::GroupAuthorization feature_categories: - deployment_management -description: Configuration for a group that is authorized to use a particular cluster agent through user_access keyword +description: Configuration for a group that is authorized to use a particular cluster + agent through user_access keyword introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116901 milestone: '15.11' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +allow_cross_joins: +- gitlab_main_clusterwide +allow_cross_transactions: +- gitlab_main_clusterwide +allow_cross_foreign_keys: +- gitlab_main_clusterwide +sharding_key: + group_id: namespaces diff --git a/db/docs/ai_agent_versions.yml b/db/docs/ai_agent_versions.yml new file mode 100644 index 00000000000..91f0d476d3a --- /dev/null +++ b/db/docs/ai_agent_versions.yml @@ -0,0 +1,12 @@ +--- +table_name: ai_agent_versions +classes: +- Ai::AgentVersion +feature_categories: +- mlops +description: A version of an AI Agent +introduced_by_url: +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + project_id: projects diff --git a/db/docs/ai_agents.yml b/db/docs/ai_agents.yml new file mode 100644 index 00000000000..da3e960d0f1 --- /dev/null +++ b/db/docs/ai_agents.yml @@ -0,0 +1,12 @@ +--- +table_name: ai_agents +classes: +- Ai::Agent +feature_categories: +- mlops +description: An AI agent definition +introduced_by_url: +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + project_id: projects diff --git a/db/docs/batched_background_migrations/backfill_branch_protection_namespace_setting.yml b/db/docs/batched_background_migrations/backfill_branch_protection_namespace_setting.yml index 9a596cb056e..88e012d8d08 100644 --- a/db/docs/batched_background_migrations/backfill_branch_protection_namespace_setting.yml +++ b/db/docs/batched_background_migrations/backfill_branch_protection_namespace_setting.yml @@ -6,4 +6,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136181 milestone: '16.7' queued_migration_version: 20231107092912 finalize_after: '2024-01-23' -finalized_by: # version of the migration that ensured this bbm +finalized_by: 20240104155616 diff --git a/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml b/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml new file mode 100644 index 00000000000..5f4ac80ff65 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: BackfillIssueSearchDataNamespaceId +description: Backfills issue_search_data.namespace_id from issues.namespace_id. This will be used for repartitioning the table. +feature_category: team_planning +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128010 +milestone: '16.8' +queued_migration_version: 20240105144908 +finalize_after: '2024-02-22' diff --git a/db/docs/batched_background_migrations/backfill_merge_request_diffs_project_id.yml b/db/docs/batched_background_migrations/backfill_merge_request_diffs_project_id.yml index 54d38942659..62373abcd41 100644 --- a/db/docs/batched_background_migrations/backfill_merge_request_diffs_project_id.yml +++ b/db/docs/batched_background_migrations/backfill_merge_request_diffs_project_id.yml @@ -6,4 +6,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136800 milestone: '16.7' queued_migration_version: 20231114043522 finalize_after: '2024-04-01' -finalized_by: # version of the migration that ensured this bbm +finalized_by: 20231213080216 diff --git a/db/docs/batched_background_migrations/backfill_owasp_top_ten_of_vulnerability_reads.yml b/db/docs/batched_background_migrations/backfill_owasp_top_ten_of_vulnerability_reads.yml new file mode 100644 index 00000000000..16c505faf1f --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_owasp_top_ten_of_vulnerability_reads.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: BackfillOwaspTopTenOfVulnerabilityReads +description: Backfills owasp_top_10 column for vulnerability_reads table. +feature_category: vulnerability_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139544 +milestone: '16.8' +queued_migration_version: 20231214111617 +finalize_after: '2024-1-10' diff --git a/db/docs/batched_background_migrations/backfill_packages_tags_project_id.yml b/db/docs/batched_background_migrations/backfill_packages_tags_project_id.yml index 777ca064c0d..be6dff0fcf4 100644 --- a/db/docs/batched_background_migrations/backfill_packages_tags_project_id.yml +++ b/db/docs/batched_background_migrations/backfill_packages_tags_project_id.yml @@ -6,4 +6,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135451 milestone: '16.6' queued_migration_version: 20231030071209 finalize_after: '2023-12-23' -finalized_by: # version of the migration that ensured this bbm +finalized_by: 20231114015857 diff --git a/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_artifact.yml b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_artifact.yml new file mode 100644 index 00000000000..18a4ac13db1 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_artifact.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: BackfillPartitionIdCiPipelineArtifact +description: Fixes incorrect values for ci_pipeline_artifacts being in the wrong partition +feature_category: continuous_integration +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141345 +milestone: '16.8' +queued_migration_version: 20240109090354 +finalize_after: '2024-01-22' +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_chat_data.yml b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_chat_data.yml new file mode 100644 index 00000000000..5864ef96ca3 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_chat_data.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: BackfillPartitionIdCiPipelineChatData +description: Fixes incorrect values for ci pipeline chat data being in the wrong partition +feature_category: continuous_integration +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139515 +milestone: '16.8' +queued_migration_version: 20231218092401 +finalize_after: '2023-12-23' +finalized_by: 20240104101601 diff --git a/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_config.yml b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_config.yml new file mode 100644 index 00000000000..e51bef28419 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_config.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: BackfillPartitionIdCiPipelineConfig +description: Fixes incorrect values for ci_pipelines_config being in the wrong partition +feature_category: continuous_integration +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141461 +milestone: '16.8' +queued_migration_version: 20240110090352 +finalize_after: '2024-01-22' +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_metadata.yml b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_metadata.yml new file mode 100644 index 00000000000..a56fcfd4cca --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_partition_id_ci_pipeline_metadata.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: BackfillPartitionIdCiPipelineMetadata +description: Fixes incorrect values for ci_pipeline_metadata being in the wrong partition +feature_category: continuous_integration +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/141078 +milestone: '16.8' +queued_migration_version: 20240108082419 +finalize_after: '2024-01-15' +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/backfill_user_preferences_with_defaults.yml b/db/docs/batched_background_migrations/backfill_user_preferences_with_defaults.yml index b95527cc32c..30043317d4c 100644 --- a/db/docs/batched_background_migrations/backfill_user_preferences_with_defaults.yml +++ b/db/docs/batched_background_migrations/backfill_user_preferences_with_defaults.yml @@ -4,3 +4,4 @@ description: Backfills the user_preferences table columns with their default val feature_category: user_profile introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125774 milestone: '16.4' +finalized_by: '20231219075929' diff --git a/db/docs/batched_background_migrations/backfill_users_with_defaults.yml b/db/docs/batched_background_migrations/backfill_users_with_defaults.yml index 6faa1fbf655..a288dc410a3 100644 --- a/db/docs/batched_background_migrations/backfill_users_with_defaults.yml +++ b/db/docs/batched_background_migrations/backfill_users_with_defaults.yml @@ -4,3 +4,4 @@ description: Backfills the users table columns with their default values feature_category: user_profile introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/125881 milestone: '16.4' +finalized_by: '20231219075928' diff --git a/db/docs/batched_background_migrations/backfill_vs_code_settings_uuid.yml b/db/docs/batched_background_migrations/backfill_vs_code_settings_uuid.yml index 022752a06a7..2ea945c17b5 100644 --- a/db/docs/batched_background_migrations/backfill_vs_code_settings_uuid.yml +++ b/db/docs/batched_background_migrations/backfill_vs_code_settings_uuid.yml @@ -5,5 +5,5 @@ feature_category: web_ide introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138355 milestone: '16.7' queued_migration_version: 20231130140901 -finalize_after: '2023-12-17' +finalize_after: '2024-01-31' finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/backfill_vs_code_settings_version.yml b/db/docs/batched_background_migrations/backfill_vs_code_settings_version.yml new file mode 100644 index 00000000000..0cb3a493823 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_vs_code_settings_version.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: BackfillVsCodeSettingsVersion +description: Backfills the version column of existing vs_code_settings records +feature_category: web_ide +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140091 +milestone: '16.8' +queued_migration_version: 20231212135235 +finalize_after: '2024-01-31' +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/drop_vulnerabilities_without_finding_id.yml b/db/docs/batched_background_migrations/drop_vulnerabilities_without_finding_id.yml new file mode 100644 index 00000000000..37e7fae2ea6 --- /dev/null +++ b/db/docs/batched_background_migrations/drop_vulnerabilities_without_finding_id.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: DropVulnerabilitiesWithoutFindingId +description: Remove Vulnerabilities without associated finding_id +feature_category: vulnerability_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140532 +milestone: '16.8' +queued_migration_version: 20231221223259 +finalize_after: '2024-01-22' +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/batched_background_migrations/update_workspaces_config_version.yml b/db/docs/batched_background_migrations/update_workspaces_config_version.yml index ead063ebed6..4ccddd5017a 100644 --- a/db/docs/batched_background_migrations/update_workspaces_config_version.yml +++ b/db/docs/batched_background_migrations/update_workspaces_config_version.yml @@ -3,3 +3,6 @@ description: Update config_version to 2 and force_include_all_resources to true feature_category: remote_development introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131402 milestone: '16.5' +queued_migration_version: 20230910120000 +finalize_after: "2023-11-15" +finalized_by: 20231215151348 diff --git a/db/docs/batched_background_migrations/update_workspaces_config_version3.yml b/db/docs/batched_background_migrations/update_workspaces_config_version3.yml new file mode 100644 index 00000000000..253feea0469 --- /dev/null +++ b/db/docs/batched_background_migrations/update_workspaces_config_version3.yml @@ -0,0 +1,9 @@ +--- +migration_job_name: UpdateWorkspacesConfigVersion3 +description: Update config_version to 3 and force_include_all_resources to true for existing workspaces +feature_category: remote_development +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140972 +milestone: '16.8' +queued_migration_version: 20240104085448 +finalize_after: "2024-02-15" +finalized_by: # version of the migration that finalized this BBM diff --git a/db/docs/cloud_connector_access.yml b/db/docs/cloud_connector_access.yml new file mode 100644 index 00000000000..5b0d5046ec0 --- /dev/null +++ b/db/docs/cloud_connector_access.yml @@ -0,0 +1,8 @@ +--- +table_name: cloud_connector_access +feature_categories: + - cloud_connector +description: Information about Cloud Connector features +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140456 +milestone: '16.8' +gitlab_schema: gitlab_main_clusterwide diff --git a/db/docs/compliance_management_frameworks.yml b/db/docs/compliance_management_frameworks.yml index 9a75e43a938..40697a5a28b 100644 --- a/db/docs/compliance_management_frameworks.yml +++ b/db/docs/compliance_management_frameworks.yml @@ -7,4 +7,12 @@ feature_categories: description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44098 milestone: '13.5' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +allow_cross_joins: +- gitlab_main_clusterwide +allow_cross_transactions: +- gitlab_main_clusterwide +allow_cross_foreign_keys: +- gitlab_main_clusterwide +sharding_key: + namespace_id: namespaces diff --git a/db/docs/ci_editor_ai_conversation_messages.yml b/db/docs/deleted_tables/ci_editor_ai_conversation_messages.yml index de4ca6490a6..e37b9bfc75c 100644 --- a/db/docs/ci_editor_ai_conversation_messages.yml +++ b/db/docs/deleted_tables/ci_editor_ai_conversation_messages.yml @@ -9,3 +9,5 @@ description: Represents an ai message for a user and project for the pipeline ed introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119840 milestone: '16.0' gitlab_schema: gitlab_ci +removed_in_milestone: '16.8' +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139626 diff --git a/db/docs/in_product_marketing_emails.yml b/db/docs/deleted_tables/in_product_marketing_emails.yml index 8021f4a2634..e36a4546ff4 100644 --- a/db/docs/in_product_marketing_emails.yml +++ b/db/docs/deleted_tables/in_product_marketing_emails.yml @@ -7,4 +7,6 @@ feature_categories: description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55840 milestone: '13.10' +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138835 +removed_in_milestone: '16.8' gitlab_schema: gitlab_main diff --git a/db/docs/external_status_checks.yml b/db/docs/external_status_checks.yml index 5f7ea9b5314..c8263d921bf 100644 --- a/db/docs/external_status_checks.yml +++ b/db/docs/external_status_checks.yml @@ -7,4 +7,12 @@ feature_categories: description: Stores project's external status checks introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62186 milestone: '14.0' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +allow_cross_joins: +- gitlab_main_clusterwide +allow_cross_transactions: +- gitlab_main_clusterwide +allow_cross_foreign_keys: +- gitlab_main_clusterwide +sharding_key: + project_id: projects diff --git a/db/docs/integrations.yml b/db/docs/integrations.yml index c087d49968a..037dea949d0 100644 --- a/db/docs/integrations.yml +++ b/db/docs/integrations.yml @@ -20,6 +20,7 @@ classes: - Integrations::Confluence - Integrations::CustomIssueTracker - Integrations::Datadog +- Integrations::DiffblueCover - Integrations::Discord - Integrations::DroneCi - Integrations::EmailsOnPush diff --git a/db/docs/ml_model_version_metadata.yml b/db/docs/ml_model_version_metadata.yml new file mode 100644 index 00000000000..fbc8cc972dd --- /dev/null +++ b/db/docs/ml_model_version_metadata.yml @@ -0,0 +1,13 @@ +--- +table_name: ml_model_version_metadata +classes: +- Ml::ModelVersionMetadata +feature_categories: +- mlops +gitlab_schema: gitlab_main_cell +description: A Model Version Metadata record holds extra information about the model + version +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139975/ +milestone: 16.8 +sharding_key: + project_id: projects
\ No newline at end of file diff --git a/db/docs/namespace_descendants.yml b/db/docs/namespace_descendants.yml new file mode 100644 index 00000000000..995441b8147 --- /dev/null +++ b/db/docs/namespace_descendants.yml @@ -0,0 +1,12 @@ +--- +table_name: namespace_descendants +classes: +- Namespaces::Descendants +feature_categories: +- groups_and_projects +description: Storing de-normalized descendant ids for Namespace records +introduced_by_url: +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + namespace_id: namespaces diff --git a/db/docs/organization_users.yml b/db/docs/organization_users.yml index 6a1ccb7210b..82c91f16957 100644 --- a/db/docs/organization_users.yml +++ b/db/docs/organization_users.yml @@ -7,4 +7,4 @@ feature_categories: description: User who has joined an organization introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123804 milestone: '16.2' -gitlab_schema: gitlab_main_clusterwide +gitlab_schema: gitlab_main_cell diff --git a/db/docs/project_compliance_framework_settings.yml b/db/docs/project_compliance_framework_settings.yml index ab68259e87e..3a9d82dfb27 100644 --- a/db/docs/project_compliance_framework_settings.yml +++ b/db/docs/project_compliance_framework_settings.yml @@ -7,4 +7,12 @@ feature_categories: description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28182 milestone: '13.0' -gitlab_schema: gitlab_main +gitlab_schema: gitlab_main_cell +allow_cross_joins: +- gitlab_main_clusterwide +allow_cross_transactions: +- gitlab_main_clusterwide +allow_cross_foreign_keys: +- gitlab_main_clusterwide +sharding_key: + project_id: projects diff --git a/db/docs/project_compliance_standards_adherence.yml b/db/docs/project_compliance_standards_adherence.yml index 78fbf8a8a46..0eae8b3fbb6 100644 --- a/db/docs/project_compliance_standards_adherence.yml +++ b/db/docs/project_compliance_standards_adherence.yml @@ -1,10 +1,12 @@ --- table_name: project_compliance_standards_adherence classes: - - Projects::ComplianceStandards::Adherence +- Projects::ComplianceStandards::Adherence feature_categories: - compliance_management description: Stores the details about projects and their adherence to compliance standards introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122293 milestone: '16.1' gitlab_schema: gitlab_main_cell +sharding_key: + project_id: projects diff --git a/db/docs/sbom_source_packages.yml b/db/docs/sbom_source_packages.yml new file mode 100644 index 00000000000..2c0df1df88e --- /dev/null +++ b/db/docs/sbom_source_packages.yml @@ -0,0 +1,10 @@ +--- +table_name: sbom_source_packages +classes: +- Sbom::SourcePackage +feature_categories: +- dependency_management +description: Tracks Source Package of an SBOM Occurrence +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140539 +milestone: '16.8' +gitlab_schema: gitlab_main diff --git a/db/docs/work_item_colors.yml b/db/docs/work_item_colors.yml new file mode 100644 index 00000000000..f0908e92181 --- /dev/null +++ b/db/docs/work_item_colors.yml @@ -0,0 +1,12 @@ +--- +table_name: work_item_colors +classes: +- WorkItems::Color +feature_categories: +- team_planning +description: The color of a Work Item. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140331 +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + namespace_id: namespaces diff --git a/db/docs/zoekt_enabled_namespaces.yml b/db/docs/zoekt_enabled_namespaces.yml new file mode 100644 index 00000000000..c6997154bc2 --- /dev/null +++ b/db/docs/zoekt_enabled_namespaces.yml @@ -0,0 +1,12 @@ +--- +table_name: zoekt_enabled_namespaces +classes: + - Search::Zoekt::EnabledNamespace +feature_categories: + - global_search +description: Represents a root namespace that has zoekt enabled +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138992 +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + root_namespace_id: namespaces diff --git a/db/docs/zoekt_indices.yml b/db/docs/zoekt_indices.yml new file mode 100644 index 00000000000..7cc5baa0a5c --- /dev/null +++ b/db/docs/zoekt_indices.yml @@ -0,0 +1,12 @@ +--- +table_name: zoekt_indices +classes: + - Search::Zoekt::Index +feature_categories: + - global_search +description: Represents a zoekt index for a root namespace +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138992 +milestone: '16.8' +gitlab_schema: gitlab_main_cell +sharding_key: + namespace_id: namespaces diff --git a/db/migrate/20231116201338_add_require_admin_two_factor_authentication_to_application_settings.rb b/db/migrate/20231116201338_add_require_admin_two_factor_authentication_to_application_settings.rb new file mode 100644 index 00000000000..9f6c4feff34 --- /dev/null +++ b/db/migrate/20231116201338_add_require_admin_two_factor_authentication_to_application_settings.rb @@ -0,0 +1,12 @@ +# 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 AddRequireAdminTwoFactorAuthenticationToApplicationSettings < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def change + add_column :application_settings, :require_admin_two_factor_authentication, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20231219120134_add_token_to_chat_names.rb b/db/migrate/20231123160255_add_token_to_chat_names.rb index af8550b9020..af8550b9020 100644 --- a/db/migrate/20231219120134_add_token_to_chat_names.rb +++ b/db/migrate/20231123160255_add_token_to_chat_names.rb diff --git a/db/migrate/20231124022520_add_sms_sent_at_and_sms_send_count_to_phone_number_validations.rb b/db/migrate/20231124022520_add_sms_sent_at_and_sms_send_count_to_phone_number_validations.rb new file mode 100644 index 00000000000..40508d8da6e --- /dev/null +++ b/db/migrate/20231124022520_add_sms_sent_at_and_sms_send_count_to_phone_number_validations.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddSmsSentAtAndSmsSendCountToPhoneNumberValidations < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def up + add_column :user_phone_number_validations, :sms_sent_at, :datetime_with_timezone, null: true + add_column :user_phone_number_validations, :sms_send_count, :smallint, default: 0, null: false + end + + def down + remove_column :user_phone_number_validations, :sms_sent_at, if_exists: true + remove_column :user_phone_number_validations, :sms_send_count, if_exists: true + end +end diff --git a/db/migrate/20231129173649_add_terraform_module_duplicates_allowed_to_namespace_package_settings.rb b/db/migrate/20231129173649_add_terraform_module_duplicates_allowed_to_namespace_package_settings.rb new file mode 100644 index 00000000000..ea465de5873 --- /dev/null +++ b/db/migrate/20231129173649_add_terraform_module_duplicates_allowed_to_namespace_package_settings.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class AddTerraformModuleDuplicatesAllowedToNamespacePackageSettings < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + def up + with_lock_retries do + add_column(:namespace_package_settings, + :terraform_module_duplicates_allowed, + :boolean, + null: false, + default: false, + if_not_exists: true + ) + + add_column(:namespace_package_settings, + :terraform_module_duplicate_exception_regex, + :text, + null: false, + default: '', + if_not_exists: true + ) + end + + add_text_limit(:namespace_package_settings, :terraform_module_duplicate_exception_regex, 255) + end + + def down + with_lock_retries do + remove_column(:namespace_package_settings, :terraform_module_duplicates_allowed, if_exists: true) + remove_column(:namespace_package_settings, :terraform_module_duplicate_exception_regex, if_exists: true) + end + end +end diff --git a/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb b/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb new file mode 100644 index 00000000000..0b305843bd5 --- /dev/null +++ b/db/migrate/20231130124606_add_project_id_name_version_id_index_to_installable_terraform_modules.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddProjectIdNameVersionIdIndexToInstallableTerraformModules < Gitlab::Database::Migration[2.2] + milestone '16.7' + disable_ddl_transaction! + + INDEX_NAME = 'idx_pkgs_on_project_id_name_version_on_installable_terraform' + PACKAGE_TYPE_TERRAFORM_MODULE = 12 + INSTALLABLE_CONDITION = 'status IN (0, 1)' + + def up + add_concurrent_index( + :packages_packages, + %i[project_id name version id], + name: INDEX_NAME, + where: "package_type = #{PACKAGE_TYPE_TERRAFORM_MODULE} AND #{INSTALLABLE_CONDITION}" + ) + end + + def down + remove_concurrent_index_by_name(:packages_packages, INDEX_NAME) + end +end diff --git a/db/migrate/20231205165049_add_slug_to_topics.rb b/db/migrate/20231205165049_add_slug_to_topics.rb new file mode 100644 index 00000000000..dedd871473d --- /dev/null +++ b/db/migrate/20231205165049_add_slug_to_topics.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddSlugToTopics < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + add_column :topics, :slug, :text, if_not_exists: true + end + + add_text_limit :topics, :slug, 255 + end + + def down + with_lock_retries do + remove_column :topics, :slug, if_exists: true + end + end +end diff --git a/db/migrate/20231206165856_create_zoekt_enabled_namespaces.rb b/db/migrate/20231206165856_create_zoekt_enabled_namespaces.rb new file mode 100644 index 00000000000..a2a328706f1 --- /dev/null +++ b/db/migrate/20231206165856_create_zoekt_enabled_namespaces.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateZoektEnabledNamespaces < Gitlab::Database::Migration[2.2] + milestone '16.8' + + UNIQUE_ROOT_NAMESPACE_ID_INDEX_NAME = 'unique_zoekt_enabled_namespaces_on_root_namespace_id' + SEARCH_INDEX_NAME = 'index_zoekt_enabled_namespaces_on_search' + + def change + create_table :zoekt_enabled_namespaces do |t| + t.bigint :root_namespace_id, null: false + t.timestamps_with_timezone null: false + t.boolean :search, null: false, default: true + + t.index :root_namespace_id, unique: true, name: UNIQUE_ROOT_NAMESPACE_ID_INDEX_NAME, using: :btree + end + end +end diff --git a/db/migrate/20231206184344_create_zoekt_enabled_namespaces_namespace_foreign_key.rb b/db/migrate/20231206184344_create_zoekt_enabled_namespaces_namespace_foreign_key.rb new file mode 100644 index 00000000000..93e3cd5433a --- /dev/null +++ b/db/migrate/20231206184344_create_zoekt_enabled_namespaces_namespace_foreign_key.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateZoektEnabledNamespacesNamespaceForeignKey < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + def up + add_concurrent_foreign_key :zoekt_enabled_namespaces, :namespaces, column: :root_namespace_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :zoekt_enabled_namespaces, column: :root_namespace_id + end + end +end diff --git a/db/migrate/20231206190206_create_zoekt_indices.rb b/db/migrate/20231206190206_create_zoekt_indices.rb new file mode 100644 index 00000000000..05549f7c152 --- /dev/null +++ b/db/migrate/20231206190206_create_zoekt_indices.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class CreateZoektIndices < Gitlab::Database::Migration[2.2] + milestone '16.8' + + ZOEKT_NODE_ID_INDEX_NAME = 'index_zoekt_indices_on_zoekt_node_id' + STATE_INDEX_NAME = 'index_zoekt_indices_on_state' + ZOEKT_ENABLED_NAMESPACE_ID_AND_NODE_ID_INDEX_NAME = 'u_zoekt_indices_zoekt_enabled_namespace_id_and_zoekt_node_id' + + def change + create_table :zoekt_indices do |t| + t.bigint :zoekt_enabled_namespace_id, null: true + t.bigint :zoekt_node_id, null: false + t.bigint :namespace_id, null: false + t.timestamps_with_timezone null: false + t.integer :state, null: false, default: 0, limit: 2 + + t.index :state, name: STATE_INDEX_NAME, using: :btree + t.index :zoekt_node_id, name: ZOEKT_NODE_ID_INDEX_NAME, using: :btree + t.index [:zoekt_enabled_namespace_id, :zoekt_node_id], + name: ZOEKT_ENABLED_NAMESPACE_ID_AND_NODE_ID_INDEX_NAME, unique: true, using: :btree + end + end +end diff --git a/db/migrate/20231206191102_create_zoekt_indices_zoekt_node_foreign_key.rb b/db/migrate/20231206191102_create_zoekt_indices_zoekt_node_foreign_key.rb new file mode 100644 index 00000000000..389e52e37a6 --- /dev/null +++ b/db/migrate/20231206191102_create_zoekt_indices_zoekt_node_foreign_key.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateZoektIndicesZoektNodeForeignKey < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + def up + add_concurrent_foreign_key :zoekt_indices, :zoekt_nodes, column: :zoekt_node_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :zoekt_indices, column: :zoekt_node_id + end + end +end diff --git a/db/migrate/20231206212252_create_zoekt_indices_zoekt_enabled_namespace_foreign_key.rb b/db/migrate/20231206212252_create_zoekt_indices_zoekt_enabled_namespace_foreign_key.rb new file mode 100644 index 00000000000..c36849cec0a --- /dev/null +++ b/db/migrate/20231206212252_create_zoekt_indices_zoekt_enabled_namespace_foreign_key.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateZoektIndicesZoektEnabledNamespaceForeignKey < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + def up + add_concurrent_foreign_key :zoekt_indices, :zoekt_enabled_namespaces, + column: :zoekt_enabled_namespace_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key :zoekt_indices, column: :zoekt_enabled_namespace_id + end + end +end diff --git a/db/migrate/20231212090606_add_partition_id_to_pipeline_chat_data.rb b/db/migrate/20231212090606_add_partition_id_to_pipeline_chat_data.rb new file mode 100644 index 00000000000..bf3c87f9816 --- /dev/null +++ b/db/migrate/20231212090606_add_partition_id_to_pipeline_chat_data.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddPartitionIdToPipelineChatData < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column(:ci_pipeline_chat_data, :partition_id, :bigint, default: 100, null: false) + end +end diff --git a/db/migrate/20231212154022_add_release_published_at_to_release.rb b/db/migrate/20231212154022_add_release_published_at_to_release.rb new file mode 100644 index 00000000000..8ecb51a8cf1 --- /dev/null +++ b/db/migrate/20231212154022_add_release_published_at_to_release.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddReleasePublishedAtToRelease < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column :releases, :release_published_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20231213065249_deprecate_ci_editor_ai_conversation_related_workers.rb b/db/migrate/20231213065249_deprecate_ci_editor_ai_conversation_related_workers.rb new file mode 100644 index 00000000000..f0dd4775eb1 --- /dev/null +++ b/db/migrate/20231213065249_deprecate_ci_editor_ai_conversation_related_workers.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class DeprecateCiEditorAiConversationRelatedWorkers < Gitlab::Database::Migration[2.2] + DEPRECATED_JOB_CLASSES = %w[ + Ci::LLM::GenerateConfigWorker + OpenAi::ClearConversationsWorker + ] + + disable_ddl_transaction! + + milestone '16.8' + + def up + sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) + end + + def down + # This migration removes any instances of deprecated workers and cannot be undone. + end +end diff --git a/db/migrate/20231213170159_add_remove_project_to_member_roles.rb b/db/migrate/20231213170159_add_remove_project_to_member_roles.rb new file mode 100644 index 00000000000..d13777c1df1 --- /dev/null +++ b/db/migrate/20231213170159_add_remove_project_to_member_roles.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRemoveProjectToMemberRoles < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column :member_roles, :remove_project, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20231214095546_add_issue_id_to_epics.rb b/db/migrate/20231214095546_add_issue_id_to_epics.rb new file mode 100644 index 00000000000..0db34041726 --- /dev/null +++ b/db/migrate/20231214095546_add_issue_id_to_epics.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIssueIdToEpics < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_unique_epics_on_issue_id' + + disable_ddl_transaction! + milestone '16.7' + + def up + add_column :epics, :issue_id, :int, if_not_exists: true + add_concurrent_index :epics, :issue_id, unique: true, name: INDEX_NAME + add_concurrent_foreign_key(:epics, :issues, column: :issue_id, validate: true) + end + + def down + remove_column :epics, :issue_id, if_exists: true + end +end diff --git a/db/migrate/20231214222351_drop_index_users_forbidden_state.rb b/db/migrate/20231214222351_drop_index_users_forbidden_state.rb new file mode 100644 index 00000000000..aa51702c93e --- /dev/null +++ b/db/migrate/20231214222351_drop_index_users_forbidden_state.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropIndexUsersForbiddenState < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + INDEX_NAME = :users_forbidden_state_idx + TABLE_NAME = :users + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index TABLE_NAME, :id, + name: INDEX_NAME, + where: "confirmed_at IS NOT NULL AND (state <> ALL (ARRAY['blocked', 'banned', 'ldap_blocked']))" + end +end diff --git a/db/migrate/20231215101640_add_cascading_toggle_security_policies_policy_scope_setting.rb b/db/migrate/20231215101640_add_cascading_toggle_security_policies_policy_scope_setting.rb new file mode 100644 index 00000000000..9ef0c70173b --- /dev/null +++ b/db/migrate/20231215101640_add_cascading_toggle_security_policies_policy_scope_setting.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddCascadingToggleSecurityPoliciesPolicyScopeSetting < Gitlab::Database::Migration[2.2] + milestone '16.7' + + include Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings + + enable_lock_retries! + + def up + add_cascading_namespace_setting :toggle_security_policies_policy_scope, :boolean, default: false, null: false + end + + def down + remove_cascading_namespace_setting :toggle_security_policies_policy_scope + end +end diff --git a/db/migrate/20231215192706_create_ml_model_version_metadata.rb b/db/migrate/20231215192706_create_ml_model_version_metadata.rb new file mode 100644 index 00000000000..a4c0b08a2ee --- /dev/null +++ b/db/migrate/20231215192706_create_ml_model_version_metadata.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class CreateMlModelVersionMetadata < Gitlab::Database::Migration[2.2] + ML_MODEL_VERSION_METADATA_NAME_INDEX_NAME = "unique_index_ml_model_version_metadata_name" + milestone '16.8' + + def change + create_table :ml_model_version_metadata do |t| + t.timestamps_with_timezone null: false + t.references :project, foreign_key: { on_delete: :cascade }, index: true, null: false + t.references :model_version, + foreign_key: { to_table: :ml_model_versions, on_delete: :cascade }, + index: false, + null: false + t.text :name, limit: 255, null: false + t.text :value, limit: 5000, null: false + + t.index [:model_version_id, :name], unique: true, name: ML_MODEL_VERSION_METADATA_NAME_INDEX_NAME + end + end +end diff --git a/db/migrate/20231216190018_add_index_topics_on_slug.rb b/db/migrate/20231216190018_add_index_topics_on_slug.rb new file mode 100644 index 00000000000..f83d733c008 --- /dev/null +++ b/db/migrate/20231216190018_add_index_topics_on_slug.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexTopicsOnSlug < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + INDEX_NAME = 'index_topics_on_slug' + + def up + add_concurrent_index :topics, :slug, unique: true, where: 'slug IS NOT NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :topics, name: INDEX_NAME + end +end diff --git a/db/migrate/20231218172621_add_manage_group_access_tokens_to_member_roles.rb b/db/migrate/20231218172621_add_manage_group_access_tokens_to_member_roles.rb new file mode 100644 index 00000000000..58f9f94a880 --- /dev/null +++ b/db/migrate/20231218172621_add_manage_group_access_tokens_to_member_roles.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddManageGroupAccessTokensToMemberRoles < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column :member_roles, :manage_group_access_tokens, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20231219091924_initialize_conversion_of_geo_event_id_from_int_to_bigint.rb b/db/migrate/20231219091924_initialize_conversion_of_geo_event_id_from_int_to_bigint.rb new file mode 100644 index 00000000000..10d67394435 --- /dev/null +++ b/db/migrate/20231219091924_initialize_conversion_of_geo_event_id_from_int_to_bigint.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class InitializeConversionOfGeoEventIdFromIntToBigint < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + TABLE = :geo_event_log + COLUMNS = %i[geo_event_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/20231220094609_add_release_published_at_index_to_release.rb b/db/migrate/20231220094609_add_release_published_at_index_to_release.rb new file mode 100644 index 00000000000..bc5891ad198 --- /dev/null +++ b/db/migrate/20231220094609_add_release_published_at_index_to_release.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddReleasePublishedAtIndexToRelease < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + def up + add_concurrent_index :releases, :release_published_at, name: 'releases_published_at_index' + end + + def down + remove_concurrent_index :releases, :release_published_at, name: 'releases_published_at_index' + end +end diff --git a/db/migrate/20231220113459_add_work_item_color.rb b/db/migrate/20231220113459_add_work_item_color.rb new file mode 100644 index 00000000000..127f93f41ea --- /dev/null +++ b/db/migrate/20231220113459_add_work_item_color.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddWorkItemColor < Gitlab::Database::Migration[2.2] + enable_lock_retries! + milestone '16.8' + + def up + create_table :work_item_colors, id: false do |t| + t.timestamps_with_timezone null: false + t.references :issue, primary_key: true, index: false, default: nil, + foreign_key: { on_delete: :cascade, to_table: :issues } + t.bigint :namespace_id, null: false + t.text :color, null: false, limit: 7 + end + end + + def down + drop_table :work_item_colors + end +end diff --git a/db/migrate/20231221033539_create_sbom_source_packages_table.rb b/db/migrate/20231221033539_create_sbom_source_packages_table.rb new file mode 100644 index 00000000000..6e2389baf8e --- /dev/null +++ b/db/migrate/20231221033539_create_sbom_source_packages_table.rb @@ -0,0 +1,42 @@ +# 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 CreateSbomSourcePackagesTable < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + SBOM_SOURCE_PACKAGES_INDEX_NAME = 'idx_sbom_source_packages_on_name_and_purl_type' + SBOM_OCCURRENCES_SOURCE_PACKAGE_ID_AND_ID_INDEX_NAME = 'index_sbom_source_packages_on_source_package_id_and_id' + + def up + with_lock_retries do + add_column :sbom_occurrences, :source_package_id, :bigint, if_not_exists: true + end + + create_table :sbom_source_packages, if_not_exists: true do |t| + t.text :name, null: false, limit: 255 + t.integer :purl_type, limit: 2, null: false + t.index [:name, :purl_type], unique: true, name: SBOM_SOURCE_PACKAGES_INDEX_NAME + end + + add_concurrent_index :sbom_occurrences, [:source_package_id, :id], + name: SBOM_OCCURRENCES_SOURCE_PACKAGE_ID_AND_ID_INDEX_NAME + + add_concurrent_foreign_key :sbom_occurrences, :sbom_source_packages, + column: :source_package_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key_if_exists( + :sbom_occurrences, + column: :source_package_id, + on_delete: :cascade + ) + remove_column :sbom_occurrences, :source_package_id, if_exists: true + drop_table :sbom_source_packages, if_exists: true + end + end +end diff --git a/db/migrate/20231221113948_create_cloud_connector_access.rb b/db/migrate/20231221113948_create_cloud_connector_access.rb new file mode 100644 index 00000000000..0b3950fc51d --- /dev/null +++ b/db/migrate/20231221113948_create_cloud_connector_access.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class CreateCloudConnectorAccess < Gitlab::Database::Migration[2.2] + enable_lock_retries! + milestone '16.8' + + def change + create_table :cloud_connector_access do |t| + t.timestamps_with_timezone null: false + t.jsonb :data, null: false + end + end +end diff --git a/db/migrate/20231221171135_create_namespace_descendants_table.rb b/db/migrate/20231221171135_create_namespace_descendants_table.rb new file mode 100644 index 00000000000..5201b132582 --- /dev/null +++ b/db/migrate/20231221171135_create_namespace_descendants_table.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +class CreateNamespaceDescendantsTable < Gitlab::Database::Migration[2.2] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + milestone '16.8' + + def up + execute <<~SQL + CREATE TABLE namespace_descendants ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] NOT NULL DEFAULT ARRAY[]::bigint[], + all_project_ids bigint[] NOT NULL DEFAULT ARRAY[]::bigint[], + traversal_ids bigint[] NOT NULL DEFAULT ARRAY[]::bigint[], + outdated_at timestamp with time zone, + calculated_at timestamp with time zone, + PRIMARY KEY(namespace_id) + ) + PARTITION BY HASH (namespace_id); + SQL + + execute <<~SQL + CREATE INDEX + index_on_namespace_descendants_outdated + ON namespace_descendants (namespace_id) + WHERE outdated_at IS NOT NULL + SQL + + create_hash_partitions(:namespace_descendants, 32) + end + + def down + drop_table :namespace_descendants + end +end diff --git a/db/migrate/20231222071942_add_description_to_ci_instance_variables.rb b/db/migrate/20231222071942_add_description_to_ci_instance_variables.rb new file mode 100644 index 00000000000..e71f27411eb --- /dev/null +++ b/db/migrate/20231222071942_add_description_to_ci_instance_variables.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddDescriptionToCiInstanceVariables < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns -- text limit is added in 20231222072237_add_text_limit_to_ci_instance_variables_description.rb migration + def change + add_column(:ci_instance_variables, :description, :text) + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20231226052618_add_work_item_colors_foreign_keys.rb b/db/migrate/20231226052618_add_work_item_colors_foreign_keys.rb new file mode 100644 index 00000000000..4fa0806a28a --- /dev/null +++ b/db/migrate/20231226052618_add_work_item_colors_foreign_keys.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddWorkItemColorsForeignKeys < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + TABLE = :work_item_colors + + def up + add_concurrent_index TABLE, :namespace_id, name: "wi_colors_namespace_id_index" + add_concurrent_foreign_key TABLE, :namespaces, column: :namespace_id, on_delete: :nullify + end + + def down + remove_concurrent_index_by_name TABLE, name: "wi_colors_namespace_id_index" + remove_foreign_key_if_exists TABLE, :namespaces, column: :namespace_id + end +end diff --git a/db/migrate/20231227090634_deprecate_summarize_merge_request_worker.rb b/db/migrate/20231227090634_deprecate_summarize_merge_request_worker.rb new file mode 100644 index 00000000000..b201028762c --- /dev/null +++ b/db/migrate/20231227090634_deprecate_summarize_merge_request_worker.rb @@ -0,0 +1,21 @@ +# 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 DeprecateSummarizeMergeRequestWorker < Gitlab::Database::Migration[2.2] + DEPRECATED_JOB_CLASSES = %w[ + MergeRequests::Llm::SummarizeMergeRequestWorker + ] + + milestone '16.8' + disable_ddl_transaction! + + def up + sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) + end + + def down + # This migration removes any instances of deprecated workers and cannot be undone. + end +end diff --git a/db/migrate/20231227103059_replace_fk_on_epics_issue_id.rb b/db/migrate/20231227103059_replace_fk_on_epics_issue_id.rb new file mode 100644 index 00000000000..e5dd4e868f0 --- /dev/null +++ b/db/migrate/20231227103059_replace_fk_on_epics_issue_id.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ReplaceFkOnEpicsIssueId < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + FK_NAME = :fk_epics_issue_id_with_on_delete_nullify + + def up + # This will replace the existing fk_893ee302e5 + add_concurrent_foreign_key(:epics, :issues, column: :issue_id, on_delete: :nullify, validate: false, name: FK_NAME) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(:epics, column: :issue_id, on_delete: :nullify, name: FK_NAME) + end + end +end diff --git a/db/migrate/20231227104408_validate_fk_epics_issue_id_with_on_delete_nullify.rb b/db/migrate/20231227104408_validate_fk_epics_issue_id_with_on_delete_nullify.rb new file mode 100644 index 00000000000..9f7601a704b --- /dev/null +++ b/db/migrate/20231227104408_validate_fk_epics_issue_id_with_on_delete_nullify.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ValidateFkEpicsIssueIdWithOnDeleteNullify < Gitlab::Database::Migration[2.2] + milestone '16.8' + + FK_NAME = :fk_epics_issue_id_with_on_delete_nullify + + # foreign key added in db/migrate/20231227103059_replace_fk_on_epics_issue_id.rb + def up + validate_foreign_key(:epics, :issue_id, name: FK_NAME) + end + + def down + # no-op + end +end diff --git a/db/migrate/20231227104711_remove_fk_epics_issue_id.rb b/db/migrate/20231227104711_remove_fk_epics_issue_id.rb new file mode 100644 index 00000000000..29752e8741c --- /dev/null +++ b/db/migrate/20231227104711_remove_fk_epics_issue_id.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveFkEpicsIssueId < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + FK_NAME = :fk_893ee302e5 + + # new foreign key added in db/migrate/20231227103059_replace_fk_on_epics_issue_id.rb + # and validated in db/migrate/20231227104408_validate_fk_epics_issue_id_with_on_delete_nullify.rb + def up + with_lock_retries do + remove_foreign_key_if_exists(:epics, column: :issue_id, on_delete: :cascade, name: FK_NAME) + end + end + + def down + add_concurrent_foreign_key(:epics, :issues, column: :issue_id, on_delete: :cascade, validate: false, name: FK_NAME) + end +end diff --git a/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb b/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb new file mode 100644 index 00000000000..f52c1abcd49 --- /dev/null +++ b/db/migrate/20231229112819_add_finished_at_index_for_p_ci_finished_build_ch_sync_events.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddFinishedAtIndexForPCiFinishedBuildChSyncEvents < Gitlab::Database::Migration[2.2] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + milestone '16.8' + + INDEX_NAME = :index_p_ci_finished_build_ch_sync_events_finished_at + TABLE_NAME = :p_ci_finished_build_ch_sync_events + COLUMNS = [:partition, :build_finished_at] + + def up + add_concurrent_partitioned_index(TABLE_NAME, COLUMNS, name: INDEX_NAME) + end + + def down + remove_concurrent_partitioned_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/migrate/20240101031938_add_admin_terraform_state_to_member_roles.rb b/db/migrate/20240101031938_add_admin_terraform_state_to_member_roles.rb new file mode 100644 index 00000000000..89222664d01 --- /dev/null +++ b/db/migrate/20240101031938_add_admin_terraform_state_to_member_roles.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddAdminTerraformStateToMemberRoles < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column :member_roles, :admin_terraform_state, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20240102184844_add_access_level_to_organization_users.rb b/db/migrate/20240102184844_add_access_level_to_organization_users.rb new file mode 100644 index 00000000000..8e37d056e56 --- /dev/null +++ b/db/migrate/20240102184844_add_access_level_to_organization_users.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddAccessLevelToOrganizationUsers < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def change + add_column :organization_users, :access_level, :integer, default: 10, limit: 2, null: false + end +end diff --git a/db/migrate/20240103200822_replace_fk_on_approval_merge_request_rules_scan_result_policy_id.rb b/db/migrate/20240103200822_replace_fk_on_approval_merge_request_rules_scan_result_policy_id.rb new file mode 100644 index 00000000000..431183e7212 --- /dev/null +++ b/db/migrate/20240103200822_replace_fk_on_approval_merge_request_rules_scan_result_policy_id.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ReplaceFkOnApprovalMergeRequestRulesScanResultPolicyId < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + NEW_CONSTRAINT_NAME = 'fk_approval_merge_request_rules_on_scan_result_policy_id' + + def up + add_concurrent_foreign_key( + :approval_merge_request_rules, + :scan_result_policies, + column: :scan_result_policy_id, + on_delete: :nullify, + validate: false, + name: NEW_CONSTRAINT_NAME) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(:approval_merge_request_rules, + column: :scan_result_policy_id, + on_delete: :nullify, + name: NEW_CONSTRAINT_NAME) + end + end +end diff --git a/db/migrate/20240103202629_validate_fk_on_approval_merge_request_rules_scan_result_policy_id.rb b/db/migrate/20240103202629_validate_fk_on_approval_merge_request_rules_scan_result_policy_id.rb new file mode 100644 index 00000000000..fee02ce91de --- /dev/null +++ b/db/migrate/20240103202629_validate_fk_on_approval_merge_request_rules_scan_result_policy_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ValidateFkOnApprovalMergeRequestRulesScanResultPolicyId < Gitlab::Database::Migration[2.2] + milestone '16.8' + + NEW_CONSTRAINT_NAME = 'fk_approval_merge_request_rules_on_scan_result_policy_id' + + # foreign key added in db/migrate/20240103200822_replace_fk_on_approval_merge_request_rules_scan_result_policy_id.rb + def up + validate_foreign_key(:approval_merge_request_rules, :scan_result_policy_id, name: NEW_CONSTRAINT_NAME) + end + + def down + # no-op + end +end diff --git a/db/migrate/20240103203314_remove_old_fk_on_approval_merge_request_rules_scan_result_policy_id.rb b/db/migrate/20240103203314_remove_old_fk_on_approval_merge_request_rules_scan_result_policy_id.rb new file mode 100644 index 00000000000..7758b230242 --- /dev/null +++ b/db/migrate/20240103203314_remove_old_fk_on_approval_merge_request_rules_scan_result_policy_id.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RemoveOldFkOnApprovalMergeRequestRulesScanResultPolicyId < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + OLD_CONSTRAINT_NAME = 'fk_f726c79756' + + # new foreign key added in + # db/migrate/20240103200822_replace_fk_on_approval_merge_request_rules_scan_result_policy_id.rb + # and validated in db/migrate/20240103202629_validate_fk_on_approval_merge_request_rules_scan_result_policy_id.rb + def up + remove_foreign_key_if_exists( + :approval_merge_request_rules, + column: :scan_result_policy_id, + on_delete: :cascade, + name: OLD_CONSTRAINT_NAME) + end + + def down + add_concurrent_foreign_key( + :approval_merge_request_rules, + :scan_result_policies, + column: :scan_result_policy_id, + on_delete: :cascade, + validate: false, + name: OLD_CONSTRAINT_NAME) + end +end diff --git a/db/migrate/20240104124057_add_category_to_timelogs.rb b/db/migrate/20240104124057_add_category_to_timelogs.rb new file mode 100644 index 00000000000..adda5fef873 --- /dev/null +++ b/db/migrate/20240104124057_add_category_to_timelogs.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddCategoryToTimelogs < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + add_column :timelogs, :timelog_category_id, :bigint + add_concurrent_index(:timelogs, :timelog_category_id) + add_concurrent_foreign_key( + :timelogs, + :timelog_categories, + column: :timelog_category_id, + on_delete: :nullify + ) + end + + def down + remove_column :timelogs, :timelog_category_id + end +end diff --git a/db/migrate/20240104150106_add_partition_id_to_pipeline_metadata.rb b/db/migrate/20240104150106_add_partition_id_to_pipeline_metadata.rb new file mode 100644 index 00000000000..cdada059306 --- /dev/null +++ b/db/migrate/20240104150106_add_partition_id_to_pipeline_metadata.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddPartitionIdToPipelineMetadata < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column(:ci_pipeline_metadata, :partition_id, :bigint, default: 100, null: false) + end +end diff --git a/db/migrate/20240104191736_migrate_zoekt_indexed_namespaces_to_zoekt_enabled_namespaces.rb b/db/migrate/20240104191736_migrate_zoekt_indexed_namespaces_to_zoekt_enabled_namespaces.rb new file mode 100644 index 00000000000..3c3ef67e322 --- /dev/null +++ b/db/migrate/20240104191736_migrate_zoekt_indexed_namespaces_to_zoekt_enabled_namespaces.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class MigrateZoektIndexedNamespacesToZoektEnabledNamespaces < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + milestone '16.8' + + INSERTED_COLUMNS = %w[ + root_namespace_id + search + created_at + updated_at + ].join(',') + + def up + connection.execute(<<~SQL) + INSERT INTO zoekt_enabled_namespaces (#{INSERTED_COLUMNS}) + (SELECT DISTINCT ON (namespace_id) namespace_id, search, created_at, updated_at + FROM zoekt_indexed_namespaces ORDER BY namespace_id, search) + SQL + end + + def down + connection.execute(<<~SQL) + DELETE FROM zoekt_enabled_namespaces + SQL + end +end diff --git a/db/migrate/20240104191802_migrate_zoekt_indexed_namespaces_to_zoekt_indices.rb b/db/migrate/20240104191802_migrate_zoekt_indexed_namespaces_to_zoekt_indices.rb new file mode 100644 index 00000000000..5461ad5094b --- /dev/null +++ b/db/migrate/20240104191802_migrate_zoekt_indexed_namespaces_to_zoekt_indices.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +class MigrateZoektIndexedNamespacesToZoektIndices < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + milestone '16.8' + + INSERTED_COLUMNS = %w[ + zoekt_enabled_namespace_id + namespace_id + zoekt_node_id + state + created_at + updated_at + ].join(',') + + STATE_READY = 10 + + def up + connection.execute(<<~SQL) + WITH indexed_namespaces AS ( + (SELECT DISTINCT ON (namespace_id) namespace_id, search, zoekt_node_id + FROM zoekt_indexed_namespaces ORDER BY namespace_id, search) + ) + + INSERT INTO zoekt_indices (#{INSERTED_COLUMNS}) + SELECT + zoekt_enabled_namespaces.id, + indexed_namespaces.namespace_id, + indexed_namespaces.zoekt_node_id, + #{STATE_READY}, + NOW(), + NOW() + FROM zoekt_enabled_namespaces + JOIN indexed_namespaces ON indexed_namespaces.namespace_id = zoekt_enabled_namespaces.root_namespace_id + SQL + end + + def down + connection.execute(<<~SQL) + DELETE FROM zoekt_indices + SQL + end +end diff --git a/db/migrate/20240105000000_rename_workspace_url_domain_to_dns_zone.rb b/db/migrate/20240105000000_rename_workspace_url_domain_to_dns_zone.rb new file mode 100644 index 00000000000..72e7ea566a8 --- /dev/null +++ b/db/migrate/20240105000000_rename_workspace_url_domain_to_dns_zone.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RenameWorkspaceUrlDomainToDnsZone < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + def up + rename_column_concurrently :workspaces, :url_domain, :dns_zone + end + + def down + undo_rename_column_concurrently :workspaces, :url_domain, :dns_zone + end +end diff --git a/db/migrate/20240107084243_add_previous_weight_to_resource_weight_events.rb b/db/migrate/20240107084243_add_previous_weight_to_resource_weight_events.rb new file mode 100644 index 00000000000..913f96933af --- /dev/null +++ b/db/migrate/20240107084243_add_previous_weight_to_resource_weight_events.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddPreviousWeightToResourceWeightEvents < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def change + add_column :resource_weight_events, :previous_weight, :integer + end +end diff --git a/db/migrate/20240108121335_copy_internal_ids_for_epics_and_issues_usage_on_groups.rb b/db/migrate/20240108121335_copy_internal_ids_for_epics_and_issues_usage_on_groups.rb new file mode 100644 index 00000000000..205f7b88026 --- /dev/null +++ b/db/migrate/20240108121335_copy_internal_ids_for_epics_and_issues_usage_on_groups.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +class CopyInternalIdsForEpicsAndIssuesUsageOnGroups < Gitlab::Database::Migration[2.2] + include Gitlab::Database::SchemaHelpers + + milestone '16.8' + disable_ddl_transaction! + + TRIGGER_ON_INSERT = 'trigger_copy_usage_on_internal_ids_on_insert' + TRIGGER_ON_UPDATE = 'trigger_copy_usage_on_internal_ids_on_update' + INSERT_OR_UPDATE_FUNCTION_NAME = 'insert_or_update_internal_ids_usage' + + def up + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}() + RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + namespace_type varchar; + copy_usage smallint; + BEGIN + IF (NEW.usage = 0) THEN + copy_usage = 4; + + -- we only care about group level internal_ids so we check namespace type here + namespace_type = (SELECT type FROM namespaces WHERE id = NEW.namespace_id); + IF (namespace_type <> 'Group') THEN + RETURN NULL; + END IF; + ELSIF (NEW.usage = 4) THEN + copy_usage = 0; + ELSE + RETURN NULL; + END IF; + + -- if value is the same there is nothing to update + IF (OLD.last_value = NEW.last_value AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN + RETURN NULL; + END IF; + + INSERT INTO internal_ids (usage, last_value, namespace_id) + VALUES (copy_usage, NEW.last_value, NEW.namespace_id) + ON CONFLICT (usage, namespace_id) WHERE namespace_id IS NOT NULL + DO UPDATE SET last_value = NEW.last_value; + + RETURN NULL; + END + $$ + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_INSERT} + AFTER INSERT ON internal_ids + FOR EACH ROW + WHEN (((NEW.usage = 0) OR (NEW.usage = 4)) AND NEW.namespace_id IS NOT NULL) + EXECUTE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}(); + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_UPDATE} + AFTER UPDATE ON internal_ids + FOR EACH ROW + WHEN (((NEW.usage = 0) OR (NEW.usage = 4)) AND NEW.namespace_id IS NOT NULL) + EXECUTE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}(); + SQL + end + + def down + drop_trigger(:internal_ids, TRIGGER_ON_INSERT) + drop_trigger(:internal_ids, TRIGGER_ON_UPDATE) + drop_function(INSERT_OR_UPDATE_FUNCTION_NAME) + end +end diff --git a/db/migrate/20240108123023_create_ai_agents_table.rb b/db/migrate/20240108123023_create_ai_agents_table.rb new file mode 100644 index 00000000000..87d43af3a30 --- /dev/null +++ b/db/migrate/20240108123023_create_ai_agents_table.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateAiAgentsTable < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def change + create_table :ai_agents do |t| + t.timestamps_with_timezone null: false + # Queries by project_id are covered by the project_id, name index + # because project_id is the leftmost column. + t.references :project, foreign_key: { on_delete: :cascade }, index: false, null: false + + t.text :name, limit: 255, null: false + + t.index [:project_id, :name], unique: true + end + end +end diff --git a/db/migrate/20240108123115_create_ai_agent_versions_table.rb b/db/migrate/20240108123115_create_ai_agent_versions_table.rb new file mode 100644 index 00000000000..bfb09ec03e8 --- /dev/null +++ b/db/migrate/20240108123115_create_ai_agent_versions_table.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateAiAgentVersionsTable < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def change + create_table :ai_agent_versions do |t| + t.timestamps_with_timezone null: false + t.references :project, foreign_key: { on_delete: :cascade }, index: true, null: false + + t.bigint :agent_id, null: false # fk cascade + + t.text :prompt, limit: 5000, null: false + t.text :model, limit: 255, null: false + + t.index :agent_id + end + end +end diff --git a/db/migrate/20240108123509_add_fk_on_ai_agent_versions_to_ai_agents.rb b/db/migrate/20240108123509_add_fk_on_ai_agent_versions_to_ai_agents.rb new file mode 100644 index 00000000000..cf7c49c2db4 --- /dev/null +++ b/db/migrate/20240108123509_add_fk_on_ai_agent_versions_to_ai_agents.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddFkOnAiAgentVersionsToAiAgents < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key(:ai_agent_versions, :ai_agents, column: :agent_id, on_delete: :cascade) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(:ai_agent_versions, column: :agent_id, on_delete: :cascade) + end + end +end diff --git a/db/migrate/20240109082354_add_partition_id_to_pipeline_artifact.rb b/db/migrate/20240109082354_add_partition_id_to_pipeline_artifact.rb new file mode 100644 index 00000000000..8a922aed648 --- /dev/null +++ b/db/migrate/20240109082354_add_partition_id_to_pipeline_artifact.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddPartitionIdToPipelineArtifact < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column(:ci_pipeline_artifacts, :partition_id, :bigint, default: 100, null: false) + end +end diff --git a/db/migrate/20240109145839_add_partition_id_to_pipeline_config.rb b/db/migrate/20240109145839_add_partition_id_to_pipeline_config.rb new file mode 100644 index 00000000000..e4f661a5e31 --- /dev/null +++ b/db/migrate/20240109145839_add_partition_id_to_pipeline_config.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddPartitionIdToPipelineConfig < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + def change + add_column(:ci_pipelines_config, :partition_id, :bigint, default: 100, null: false) + end +end diff --git a/db/migrate/20240110085226_add_rate_limits_to_application_settings.rb b/db/migrate/20240110085226_add_rate_limits_to_application_settings.rb new file mode 100644 index 00000000000..2560977f979 --- /dev/null +++ b/db/migrate/20240110085226_add_rate_limits_to_application_settings.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddRateLimitsToApplicationSettings < Gitlab::Database::Migration[2.2] + milestone '16.9' + enable_lock_retries! + + def change + add_column :application_settings, :rate_limits, :jsonb, default: {}, null: false + end +end diff --git a/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb b/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb new file mode 100644 index 00000000000..4cf3d9c1721 --- /dev/null +++ b/db/migrate/20240111134328_routing_table_prepare_async_constraint_for_pipeline_variables.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class RoutingTablePrepareAsyncConstraintForPipelineVariables < Gitlab::Database::Migration[2.2] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + milestone '16.8' + + disable_ddl_transaction! + + TABLE_NAME = :ci_pipeline_variables + PARENT_TABLE_NAME = :p_ci_pipeline_variables + FIRST_PARTITION = [100, 101] + PARTITION_COLUMN = :partition_id + + def up + prepare_constraint_for_list_partitioning( + table_name: TABLE_NAME, + partitioning_column: PARTITION_COLUMN, + parent_table_name: PARENT_TABLE_NAME, + initial_partitioning_value: FIRST_PARTITION, + async: true + ) + end + + def down + revert_preparing_constraint_for_list_partitioning( + table_name: TABLE_NAME, + partitioning_column: PARTITION_COLUMN, + parent_table_name: PARENT_TABLE_NAME, + initial_partitioning_value: FIRST_PARTITION + ) + end +end diff --git a/db/migrate/20240115115029_add_rate_limits_hash_constraint_to_application_settings.rb b/db/migrate/20240115115029_add_rate_limits_hash_constraint_to_application_settings.rb new file mode 100644 index 00000000000..14ab736b5d2 --- /dev/null +++ b/db/migrate/20240115115029_add_rate_limits_hash_constraint_to_application_settings.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddRateLimitsHashConstraintToApplicationSettings < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.9' + + CONSTRAINT_NAME = 'check_application_settings_rate_limits_is_hash' + + def up + add_check_constraint( + :application_settings, + "(jsonb_typeof(rate_limits) = 'object')", + CONSTRAINT_NAME + ) + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20231204042048_finalize_system_note_metadata_bigint_conversion.rb b/db/post_migrate/20231204042048_finalize_system_note_metadata_bigint_conversion.rb new file mode 100644 index 00000000000..cd6550d6bad --- /dev/null +++ b/db/post_migrate/20231204042048_finalize_system_note_metadata_bigint_conversion.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class FinalizeSystemNoteMetadataBigintConversion < Gitlab::Database::Migration[2.2] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + milestone '16.8' + + TABLE_NAME = :system_note_metadata + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb b/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb new file mode 100644 index 00000000000..d006e0f3121 --- /dev/null +++ b/db/post_migrate/20231204095802_change_i_code_review_create_mr_keys_from_redis_hll_to_redis.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ChangeICodeReviewCreateMrKeysFromRedisHllToRedis < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def up + # no-op + # + # Removed due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17321 + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231205200847_rollback_user_foreign_key_from_in_product_marketing_emails.rb b/db/post_migrate/20231205200847_rollback_user_foreign_key_from_in_product_marketing_emails.rb new file mode 100644 index 00000000000..fe4509204db --- /dev/null +++ b/db/post_migrate/20231205200847_rollback_user_foreign_key_from_in_product_marketing_emails.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 RollbackUserForeignKeyFromInProductMarketingEmails < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists :in_product_marketing_emails, :users, name: 'fk_35c9101b63' + end + end + + def down + add_concurrent_foreign_key :in_product_marketing_emails, :users, column: :user_id, name: 'fk_35c9101b63', + on_delete: :cascade + end +end diff --git a/db/post_migrate/20231205200925_drop_in_product_marketing_emails.rb b/db/post_migrate/20231205200925_drop_in_product_marketing_emails.rb new file mode 100644 index 00000000000..5a121793333 --- /dev/null +++ b/db/post_migrate/20231205200925_drop_in_product_marketing_emails.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropInProductMarketingEmails < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def up + drop_table :in_product_marketing_emails + end + + def down + 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 + + add_index :in_product_marketing_emails, :user_id + add_index :in_product_marketing_emails, %i[user_id track series], unique: true, + name: 'index_in_product_marketing_emails_on_user_track_series' + add_index :in_product_marketing_emails, %i[track series id cta_clicked_at], + name: 'index_in_product_marketing_emails_on_track_series_id_clicked' + end +end diff --git a/db/post_migrate/20231207145335_cleanup_group_level_work_items.rb b/db/post_migrate/20231207145335_cleanup_group_level_work_items.rb new file mode 100644 index 00000000000..d52f0518f44 --- /dev/null +++ b/db/post_migrate/20231207145335_cleanup_group_level_work_items.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +class CleanupGroupLevelWorkItems < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + BATCH_SIZE = 100 + + class MigrationIssue < MigrationRecord + self.table_name = :issues + + include EachBatch + end + + class MigrationNote < MigrationRecord + self.table_name = :notes + + include EachBatch + end + + class MigrationLabelLink < MigrationRecord + self.table_name = :label_links + + include EachBatch + end + + class MigrationTodo < MigrationRecord + self.table_name = :todos + + include EachBatch + end + + def up + MigrationIssue.where(project_id: nil).each_batch(of: BATCH_SIZE) do |batch| + logger.info("deleting #{batch.size} issues at group level: #{batch.pluck(:id)}") + + # cleaning up notes for the batch of issues + MigrationNote.where(noteable_type: 'Issue', noteable_id: batch).each_batch(of: BATCH_SIZE) do |note_batch| + logger.info("deleting #{note_batch.size} notes for issues at group level: #{note_batch.pluck(:id)}") + note_batch.delete_all + end + + # cleaning up label links for the batch of issues + MigrationLabelLink.where(target_type: 'Issue', target_id: batch).each_batch(of: BATCH_SIZE) do |label_link_batch| + logger.info( + "deleting #{label_link_batch.size} label links for issues at group level: #{label_link_batch.pluck(:id)}" + ) + label_link_batch.delete_all + end + + # cleaning up todos for the batch of issues + MigrationTodo.where(target_type: 'Issue', target_id: batch).each_batch(of: BATCH_SIZE) do |todo_batch| + logger.info("deleting #{todo_batch.size} todos for issues at group level: #{todo_batch.pluck(:id)}") + todo_batch.delete_all + end + + batch.delete_all + end + end + + def down + # no-op + end + + private + + def logger + @logger ||= Gitlab::BackgroundMigration::Logger.build + end +end diff --git a/db/post_migrate/20231207155340_prepare_iid_namespace_unique_index_in_issues.rb b/db/post_migrate/20231207155340_prepare_iid_namespace_unique_index_in_issues.rb new file mode 100644 index 00000000000..a0149a79f83 --- /dev/null +++ b/db/post_migrate/20231207155340_prepare_iid_namespace_unique_index_in_issues.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class PrepareIidNamespaceUniqueIndexInIssues < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_issues_on_namespace_id_iid_unique' + + milestone '16.8' + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/435856 + def up + prepare_async_index :issues, [:namespace_id, :iid], unique: true, name: INDEX_NAME + end + + def down + unprepare_async_index :issues, [:namespace_id, :iid], unique: true, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231207211418_add_iid_namespace_unique_index_to_issues.rb b/db/post_migrate/20231207211418_add_iid_namespace_unique_index_to_issues.rb new file mode 100644 index 00000000000..4c2439f33ea --- /dev/null +++ b/db/post_migrate/20231207211418_add_iid_namespace_unique_index_to_issues.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIidNamespaceUniqueIndexToIssues < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_issues_on_namespace_id_iid_unique' + + disable_ddl_transaction! + + milestone '16.8' + + def up + add_concurrent_index :issues, [:namespace_id, :iid], name: INDEX_NAME, unique: true + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end diff --git a/db/post_migrate/20231207221418_drop_namespace_id_index_on_issues.rb b/db/post_migrate/20231207221418_drop_namespace_id_index_on_issues.rb new file mode 100644 index 00000000000..38df861de00 --- /dev/null +++ b/db/post_migrate/20231207221418_drop_namespace_id_index_on_issues.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropNamespaceIdIndexOnIssues < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_issues_on_namespace_id' + + disable_ddl_transaction! + + milestone '16.8' + + def up + remove_concurrent_index_by_name :issues, INDEX_NAME + end + + def down + add_concurrent_index :issues, :namespace_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231211154654_add_work_items_rolledup_dates_widget.rb b/db/post_migrate/20231211154654_add_work_items_rolledup_dates_widget.rb new file mode 100644 index 00000000000..b45967920fe --- /dev/null +++ b/db/post_migrate/20231211154654_add_work_items_rolledup_dates_widget.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +class AddWorkItemsRolledupDatesWidget < Gitlab::Database::Migration[2.2] + milestone '16.8' + + class WorkItemType < MigrationRecord + self.table_name = 'work_item_types' + end + + class WidgetDefinition < MigrationRecord + self.table_name = 'work_item_widget_definitions' + end + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + WIDGET_NAME = 'Rolledup dates' + WIDGET_ENUM_VALUE = 19 + WORK_ITEM_TYPES = ['Epic'].freeze + + def up + widgets = WORK_ITEM_TYPES.each_with_object([]) do |type_name, result| + type = WorkItemType.find_by_name_and_namespace_id(type_name, nil) + + unless type + Gitlab::AppLogger.warn("type #{type_name} is missing, not adding widget") + + next + end + + result << { + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + } + end + + return if widgets.empty? + + WidgetDefinition.upsert_all( + widgets, + unique_by: :index_work_item_widget_definitions_on_default_witype_and_name + ) + end + + def down + WidgetDefinition.where(name: WIDGET_NAME).delete_all + end +end diff --git a/db/post_migrate/20231212135235_queue_backfill_vs_code_settings_version.rb b/db/post_migrate/20231212135235_queue_backfill_vs_code_settings_version.rb new file mode 100644 index 00000000000..db2704c3c33 --- /dev/null +++ b/db/post_migrate/20231212135235_queue_backfill_vs_code_settings_version.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class QueueBackfillVsCodeSettingsVersion < Gitlab::Database::Migration[2.2] + milestone '16.7' + + MIGRATION = "BackfillVsCodeSettingsVersion" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vs_code_settings, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vs_code_settings, :id, []) + end +end diff --git a/db/post_migrate/20231213014658_remove_plain_text_credit_card_columns.rb b/db/post_migrate/20231213014658_remove_plain_text_credit_card_columns.rb new file mode 100644 index 00000000000..c1ecf63012d --- /dev/null +++ b/db/post_migrate/20231213014658_remove_plain_text_credit_card_columns.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +class RemovePlainTextCreditCardColumns < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + FULL_MATCH_INDEX_NAME = 'index_user_credit_card_validations_meta_data_full_match_lower' + FULL_MATCH_FIELDS = 'lower(holder_name), expiration_date, last_digits, credit_card_validated_at' + + PARTIAL_MATCH_INDEX_NAME = 'index_user_credit_card_validations_meta_data_partial_match' + PARTIAL_MATCH_FIELDS = 'expiration_date, last_digits, network, credit_card_validated_at' + + def up + with_lock_retries do + remove_column :user_credit_card_validations, :holder_name, if_exists: true + remove_column :user_credit_card_validations, :network, if_exists: true + remove_column :user_credit_card_validations, :expiration_date, if_exists: true + remove_column :user_credit_card_validations, :last_digits, if_exists: true + end + end + + def down + add_column :user_credit_card_validations, :holder_name, :text, if_not_exists: true + add_column :user_credit_card_validations, :network, :text, if_not_exists: true + add_column :user_credit_card_validations, :expiration_date, :date, if_not_exists: true + add_column :user_credit_card_validations, :last_digits, :integer, limit: 2, if_not_exists: true + + add_text_limit :user_credit_card_validations, :holder_name, 50 + add_text_limit :user_credit_card_validations, :network, 32 + add_check_constraint :user_credit_card_validations, 'last_digits BETWEEN 0 AND 9999', + 'credit_card_last_digits_range' + + add_concurrent_index :user_credit_card_validations, FULL_MATCH_FIELDS, name: FULL_MATCH_INDEX_NAME + add_concurrent_index :user_credit_card_validations, PARTIAL_MATCH_FIELDS, name: PARTIAL_MATCH_INDEX_NAME + end +end diff --git a/db/post_migrate/20231213064314_remove_ci_editor_ai_conversation_messages_table.rb b/db/post_migrate/20231213064314_remove_ci_editor_ai_conversation_messages_table.rb new file mode 100644 index 00000000000..b108805a22d --- /dev/null +++ b/db/post_migrate/20231213064314_remove_ci_editor_ai_conversation_messages_table.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class RemoveCiEditorAiConversationMessagesTable < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def up + drop_table :ci_editor_ai_conversation_messages, if_exists: true + end + + def down + create_table :ci_editor_ai_conversation_messages do |t| + t.bigint :user_id, + null: false + t.bigint :project_id, + null: false + t.timestamps_with_timezone null: false + t.text :role, limit: 100, + null: false + t.text :content, limit: 16384, + null: true + t.text :async_errors, array: true, null: false, default: [] + + t.index [:user_id, :project_id, :created_at], + name: :index_ci_editor_ai_messages_on_user_project_and_created_at + + t.index :project_id, + name: :index_ci_editor_ai_messages_project_id + + t.index :created_at, + name: :index_ci_editor_ai_messages_created_at + end + end +end diff --git a/db/post_migrate/20231213080216_finalize_merge_request_diffs_project_id_backfill.rb b/db/post_migrate/20231213080216_finalize_merge_request_diffs_project_id_backfill.rb new file mode 100644 index 00000000000..cb83b00b2a2 --- /dev/null +++ b/db/post_migrate/20231213080216_finalize_merge_request_diffs_project_id_backfill.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeMergeRequestDiffsProjectIdBackfill < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillMergeRequestDiffsProjectId', + table_name: :merge_request_diffs, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/post_migrate/20231213080238_validate_merge_request_diffs_project_id_null_constraint.rb b/db/post_migrate/20231213080238_validate_merge_request_diffs_project_id_null_constraint.rb new file mode 100644 index 00000000000..6e2d591bd96 --- /dev/null +++ b/db/post_migrate/20231213080238_validate_merge_request_diffs_project_id_null_constraint.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ValidateMergeRequestDiffsProjectIdNullConstraint < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def up + validate_not_null_constraint :merge_request_diffs, :project_id + end + + def down; end +end diff --git a/db/post_migrate/20231214111617_queue_backfill_owasp_top_ten_of_vulnerability_reads.rb b/db/post_migrate/20231214111617_queue_backfill_owasp_top_ten_of_vulnerability_reads.rb new file mode 100644 index 00000000000..e8b13212df8 --- /dev/null +++ b/db/post_migrate/20231214111617_queue_backfill_owasp_top_ten_of_vulnerability_reads.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class QueueBackfillOwaspTopTenOfVulnerabilityReads < Gitlab::Database::Migration[2.2] + milestone '16.8' + + MIGRATION = "BackfillOwaspTopTenOfVulnerabilityReads" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 10000 + SUB_BATCH_SIZE = 50 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerability_reads, + :vulnerability_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, []) + end +end diff --git a/db/post_migrate/20231215130625_schedule_index_to_events_author_group_action_target_type_created_at.rb b/db/post_migrate/20231215130625_schedule_index_to_events_author_group_action_target_type_created_at.rb new file mode 100644 index 00000000000..063aff58176 --- /dev/null +++ b/db/post_migrate/20231215130625_schedule_index_to_events_author_group_action_target_type_created_at.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ScheduleIndexToEventsAuthorGroupActionTargetTypeCreatedAt < Gitlab::Database::Migration[2.2] + milestone '16.8' + + INDEX_NAME = 'index_events_author_id_group_id_action_target_type_created_at' + COLUMNS = [:author_id, :group_id, :action, :target_type, :created_at] + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/435524 + def up + prepare_async_index :events, COLUMNS, name: INDEX_NAME + end + + def down + unprepare_async_index :events, COLUMNS, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb b/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb new file mode 100644 index 00000000000..c76bc15d778 --- /dev/null +++ b/db/post_migrate/20231215151348_finalize_workspaces_config_version_2_migration.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class FinalizeWorkspacesConfigVersion2Migration < Gitlab::Database::Migration[2.2] + milestone '16.8' + MIGRATION = 'UpdateWorkspacesConfigVersion' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :workspaces, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231217053910_remove_due_date_sourcing_milestone_id_column_from_vulnerabilities.rb b/db/post_migrate/20231217053910_remove_due_date_sourcing_milestone_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..5cd41dff0ef --- /dev/null +++ b/db/post_migrate/20231217053910_remove_due_date_sourcing_milestone_id_column_from_vulnerabilities.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class RemoveDueDateSourcingMilestoneIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :due_date_sourcing_milestone_id + end + end + + def down + unless column_exists?(:vulnerabilities, :due_date_sourcing_milestone_id) + add_column :vulnerabilities, :due_date_sourcing_milestone_id, :bigint + end + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :due_date_sourcing_milestone_id) + add_concurrent_foreign_key(:vulnerabilities, :milestones, column: :due_date_sourcing_milestone_id, + on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231218074237_add_index_to_ci_job_artifact_states.rb b/db/post_migrate/20231218074237_add_index_to_ci_job_artifact_states.rb new file mode 100644 index 00000000000..bd0a46f14ba --- /dev/null +++ b/db/post_migrate/20231218074237_add_index_to_ci_job_artifact_states.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexToCiJobArtifactStates < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + INDEX_NAME = :index_ci_job_artifact_states_on_job_artifact_id_partition_id + TABLE_NAME = :ci_job_artifact_states + + def up + add_concurrent_index(TABLE_NAME, [:job_artifact_id, :partition_id], name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20231218074508_add_index_to_ci_build_trace_metadata.rb b/db/post_migrate/20231218074508_add_index_to_ci_build_trace_metadata.rb new file mode 100644 index 00000000000..574c71034fe --- /dev/null +++ b/db/post_migrate/20231218074508_add_index_to_ci_build_trace_metadata.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexToCiBuildTraceMetadata < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + INDEX_NAME = :index_ci_build_trace_metadata_on_trace_artifact_id_partition_id + TABLE_NAME = :ci_build_trace_metadata + + def up + add_concurrent_index(TABLE_NAME, [:trace_artifact_id, :partition_id], name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20231218092401_queue_backfill_partition_id_ci_pipeline_chat_data.rb b/db/post_migrate/20231218092401_queue_backfill_partition_id_ci_pipeline_chat_data.rb new file mode 100644 index 00000000000..ffa8d0dbd21 --- /dev/null +++ b/db/post_migrate/20231218092401_queue_backfill_partition_id_ci_pipeline_chat_data.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillPartitionIdCiPipelineChatData < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + MIGRATION = 'BackfillPartitionIdCiPipelineChatData' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipeline_chat_data, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipeline_chat_data, :id, []) + end +end diff --git a/db/post_migrate/20231218121131_remove_start_date_sourcing_milestone_id_column_from_vulnerabilities.rb b/db/post_migrate/20231218121131_remove_start_date_sourcing_milestone_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..1ca04e5aed1 --- /dev/null +++ b/db/post_migrate/20231218121131_remove_start_date_sourcing_milestone_id_column_from_vulnerabilities.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class RemoveStartDateSourcingMilestoneIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :start_date_sourcing_milestone_id + end + end + + def down + unless column_exists?(:vulnerabilities, :start_date_sourcing_milestone_id) + add_column :vulnerabilities, :start_date_sourcing_milestone_id, :bigint + end + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :start_date_sourcing_milestone_id) + add_concurrent_foreign_key(:vulnerabilities, :milestones, column: :start_date_sourcing_milestone_id, + on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231219044006_drop_note_mentions_temp_index.rb b/db/post_migrate/20231219044006_drop_note_mentions_temp_index.rb new file mode 100644 index 00000000000..948530d4c02 --- /dev/null +++ b/db/post_migrate/20231219044006_drop_note_mentions_temp_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropNoteMentionsTempIndex < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + INDEX_NAME = 'note_mentions_temp_index' + + def up + remove_concurrent_index_by_name :notes, INDEX_NAME + end + + def down + add_concurrent_index :notes, [:id, :noteable_type], where: "note ~~ '%@%'::text", name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231219075928_finalize_backfill_users_with_defaults.rb b/db/post_migrate/20231219075928_finalize_backfill_users_with_defaults.rb new file mode 100644 index 00000000000..373ea1faaa9 --- /dev/null +++ b/db/post_migrate/20231219075928_finalize_backfill_users_with_defaults.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeBackfillUsersWithDefaults < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = "BackfillUsersWithDefaults" + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: 'users', + column_name: 'id', + job_arguments: [] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231219075929_finalize_backfill_user_preferences_with_defaults.rb b/db/post_migrate/20231219075929_finalize_backfill_user_preferences_with_defaults.rb new file mode 100644 index 00000000000..fb10385ad20 --- /dev/null +++ b/db/post_migrate/20231219075929_finalize_backfill_user_preferences_with_defaults.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeBackfillUserPreferencesWithDefaults < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = "BackfillUserPreferencesWithDefaults" + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: 'user_preferences', + column_name: 'id', + job_arguments: [] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231219083804_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id.rb b/db/post_migrate/20231219083804_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id.rb new file mode 100644 index 00000000000..bb7749b8ab5 --- /dev/null +++ b/db/post_migrate/20231219083804_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +class AddFkToCiBuildTraceMetadataOnPartitionIdAndTraceArtifactId < Gitlab::Database::Migration[2.2] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + milestone '16.8' + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_build_trace_metadata + TARGET_TABLE_NAME = :ci_job_artifacts + COLUMN = :trace_artifact_id + TARGET_COLUMN = :id + FK_NAME = :fk_21d25cac1a_p + PARTITION_COLUMN = :partition_id + + def up + return unless should_run? + + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: false, + reverse_lock_order: true, + on_update: :cascade, + on_delete: :cascade, + name: FK_NAME + ) + + prepare_async_foreign_key_validation(SOURCE_TABLE_NAME, name: FK_NAME) + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation(SOURCE_TABLE_NAME, name: FK_NAME) + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + can_execute_on?(TARGET_TABLE_NAME) + end +end diff --git a/db/post_migrate/20231219084159_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id.rb b/db/post_migrate/20231219084159_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id.rb new file mode 100644 index 00000000000..d72f10b012f --- /dev/null +++ b/db/post_migrate/20231219084159_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +class AddFkToCiJobArtifactStatesOnPartitionIdAndJobArtifactId < Gitlab::Database::Migration[2.2] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + milestone '16.8' + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_job_artifact_states + TARGET_TABLE_NAME = :ci_job_artifacts + COLUMN = :job_artifact_id + TARGET_COLUMN = :id + FK_NAME = :fk_rails_80a9cba3b2_p + PARTITION_COLUMN = :partition_id + + def up + return unless should_run? + + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: false, + reverse_lock_order: true, + on_update: :cascade, + on_delete: :cascade, + name: FK_NAME + ) + + prepare_async_foreign_key_validation(SOURCE_TABLE_NAME, name: FK_NAME) + end + + def down + return unless should_run? + + unprepare_async_foreign_key_validation(SOURCE_TABLE_NAME, name: FK_NAME) + + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + private + + def should_run? + can_execute_on?(TARGET_TABLE_NAME) + end +end diff --git a/db/post_migrate/20231219092400_backfill_geo_event_log_for_bigint_conversion.rb b/db/post_migrate/20231219092400_backfill_geo_event_log_for_bigint_conversion.rb new file mode 100644 index 00000000000..b5203ff9051 --- /dev/null +++ b/db/post_migrate/20231219092400_backfill_geo_event_log_for_bigint_conversion.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class BackfillGeoEventLogForBigintConversion < Gitlab::Database::Migration[2.2] + restrict_gitlab_migration gitlab_schema: :gitlab_main + milestone '16.8' + + TABLE = :geo_event_log + COLUMNS = %i[geo_event_id] + + def up + backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 200) + end + + def down + revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end +end diff --git a/db/post_migrate/20231219125907_remove_updated_by_id_column_from_vulnerabilities.rb b/db/post_migrate/20231219125907_remove_updated_by_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..ecac9b55f4c --- /dev/null +++ b/db/post_migrate/20231219125907_remove_updated_by_id_column_from_vulnerabilities.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveUpdatedByIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :updated_by_id + end + end + + def down + add_column :vulnerabilities, :updated_by_id, :bigint unless column_exists?(:vulnerabilities, :updated_by_id) + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :updated_by_id) + add_concurrent_foreign_key(:vulnerabilities, :users, column: :updated_by_id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231219132423_remove_epic_id_column_from_vulnerabilities.rb b/db/post_migrate/20231219132423_remove_epic_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..fa6379a409a --- /dev/null +++ b/db/post_migrate/20231219132423_remove_epic_id_column_from_vulnerabilities.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveEpicIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :epic_id + end + end + + def down + add_column :vulnerabilities, :epic_id, :bigint unless column_exists?(:vulnerabilities, :epic_id) + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :epic_id) + add_concurrent_foreign_key(:vulnerabilities, :epics, column: :epic_id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231220115201_add_color_work_item_widget.rb b/db/post_migrate/20231220115201_add_color_work_item_widget.rb new file mode 100644 index 00000000000..eb410cb8b0b --- /dev/null +++ b/db/post_migrate/20231220115201_add_color_work_item_widget.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class AddColorWorkItemWidget < Gitlab::Database::Migration[2.2] + milestone '16.8' + + class WorkItemType < MigrationRecord + self.table_name = 'work_item_types' + end + + class WidgetDefinition < MigrationRecord + self.table_name = 'work_item_widget_definitions' + end + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + WIDGET_NAME = 'Color' + WIDGET_ENUM_VALUE = 18 + WORK_ITEM_TYPE = 'Epic' + + def up + type = WorkItemType.find_by_name_and_namespace_id(WORK_ITEM_TYPE, nil) + + unless type + Gitlab::AppLogger.warn("type #{WORK_ITEM_TYPE} is missing, not adding widget") + return + end + + widget = { + work_item_type_id: type.id, + name: WIDGET_NAME, + widget_type: WIDGET_ENUM_VALUE + } + + WidgetDefinition.upsert_all( + [widget], + unique_by: :index_work_item_widget_definitions_on_default_witype_and_name + ) + end + + def down + WidgetDefinition.where(name: WIDGET_NAME).delete_all + end +end diff --git a/db/post_migrate/20231220130725_remove_last_edited_at_column_from_vulnerabilities.rb b/db/post_migrate/20231220130725_remove_last_edited_at_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..e3e963ee0c0 --- /dev/null +++ b/db/post_migrate/20231220130725_remove_last_edited_at_column_from_vulnerabilities.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveLastEditedAtColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + milestone '16.8' + + enable_lock_retries! + + def up + remove_column :vulnerabilities, :last_edited_at + end + + def down + add_column :vulnerabilities, :last_edited_at, :datetime_with_timezone + end +end diff --git a/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb b/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb new file mode 100644 index 00000000000..75bf5d3ead9 --- /dev/null +++ b/db/post_migrate/20231220150143_remove_organizations_organization_users_organization_id_fk.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveOrganizationsOrganizationUsersOrganizationIdFk < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + FOREIGN_KEY_NAME = "fk_8471abad75" + + def up + with_lock_retries do + remove_foreign_key_if_exists(:organization_users, :organizations, + name: FOREIGN_KEY_NAME, reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:organization_users, :organizations, + name: FOREIGN_KEY_NAME, column: :organization_id, + target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb b/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb new file mode 100644 index 00000000000..365d6b0fc77 --- /dev/null +++ b/db/post_migrate/20231220150210_remove_users_organization_users_user_id_fk.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveUsersOrganizationUsersUserIdFk < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + FOREIGN_KEY_NAME = "fk_8d9b20725d" + + def up + with_lock_retries do + remove_foreign_key_if_exists(:organization_users, :users, + name: FOREIGN_KEY_NAME, reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:organization_users, :users, + name: FOREIGN_KEY_NAME, column: :user_id, + target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20231221000703_async_validate_merge_request_diffs_project_id_foreign_key.rb b/db/post_migrate/20231221000703_async_validate_merge_request_diffs_project_id_foreign_key.rb new file mode 100644 index 00000000000..64adf7d3523 --- /dev/null +++ b/db/post_migrate/20231221000703_async_validate_merge_request_diffs_project_id_foreign_key.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AsyncValidateMergeRequestDiffsProjectIdForeignKey < Gitlab::Database::Migration[2.2] + milestone '16.8' + + def up + prepare_async_foreign_key_validation :merge_request_diffs, :project_id + end + + def down + unprepare_async_foreign_key_validation :merge_request_diffs, :project_id + end +end diff --git a/db/post_migrate/20231221223259_queue_drop_vulnerabilities_without_finding_id.rb b/db/post_migrate/20231221223259_queue_drop_vulnerabilities_without_finding_id.rb new file mode 100644 index 00000000000..25aa2912767 --- /dev/null +++ b/db/post_migrate/20231221223259_queue_drop_vulnerabilities_without_finding_id.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class QueueDropVulnerabilitiesWithoutFindingId < Gitlab::Database::Migration[2.2] + milestone '16.8' + + MIGRATION = "DropVulnerabilitiesWithoutFindingId" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + job_interval: DELAY_INTERVAL, + batch_size: 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/20231222051050_add_search_vector_index_to_catalog_resources.rb b/db/post_migrate/20231222051050_add_search_vector_index_to_catalog_resources.rb new file mode 100644 index 00000000000..036aadbe10f --- /dev/null +++ b/db/post_migrate/20231222051050_add_search_vector_index_to_catalog_resources.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddSearchVectorIndexToCatalogResources < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + INDEX_NAME = 'index_catalog_resources_on_search_vector_triagram' + + def up + disable_statement_timeout do + execute <<-SQL + CREATE INDEX CONCURRENTLY IF NOT EXISTS #{INDEX_NAME} ON catalog_resources + USING GIN (search_vector); + SQL + end + end + + def down + remove_concurrent_index_by_name :catalog_resources, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231222072237_add_text_limit_to_ci_instance_variables_description.rb b/db/post_migrate/20231222072237_add_text_limit_to_ci_instance_variables_description.rb new file mode 100644 index 00000000000..6ad13a591e4 --- /dev/null +++ b/db/post_migrate/20231222072237_add_text_limit_to_ci_instance_variables_description.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddTextLimitToCiInstanceVariablesDescription < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + TABLE_NAME = :ci_instance_variables + COLUMN_NAME = :description + + def up + add_text_limit(TABLE_NAME, COLUMN_NAME, 255) + end + + def down + remove_text_limit(TABLE_NAME, COLUMN_NAME) + end +end diff --git a/db/post_migrate/20231222114515_remove_tmp_index_members_on_state.rb b/db/post_migrate/20231222114515_remove_tmp_index_members_on_state.rb new file mode 100644 index 00000000000..88a52160fef --- /dev/null +++ b/db/post_migrate/20231222114515_remove_tmp_index_members_on_state.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveTmpIndexMembersOnState < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + INDEX_NAME = 'tmp_index_members_on_state' + + def up + remove_concurrent_index_by_name :members, INDEX_NAME + end + + def down + add_concurrent_index :members, :state, name: INDEX_NAME, where: 'state = 2' + end +end diff --git a/db/post_migrate/20231224083824_remove_last_edited_by_id_column_from_vulnerabilities.rb b/db/post_migrate/20231224083824_remove_last_edited_by_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..3df182db156 --- /dev/null +++ b/db/post_migrate/20231224083824_remove_last_edited_by_id_column_from_vulnerabilities.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveLastEditedByIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :last_edited_by_id + end + end + + def down + add_column :vulnerabilities, :last_edited_by_id, :bigint unless column_exists?(:vulnerabilities, :last_edited_by_id) + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :last_edited_by_id) + add_concurrent_foreign_key(:vulnerabilities, :users, column: :last_edited_by_id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231225070431_async_validate_finding_id_on_vulnerabilities.rb b/db/post_migrate/20231225070431_async_validate_finding_id_on_vulnerabilities.rb new file mode 100644 index 00000000000..dfab0d6eab0 --- /dev/null +++ b/db/post_migrate/20231225070431_async_validate_finding_id_on_vulnerabilities.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AsyncValidateFindingIdOnVulnerabilities < Gitlab::Database::Migration[2.2] + # obtained by running `\d vulnerabilities` on https://console.postgres.ai + FK_NAME = :fk_4e64972902 + + milestone '16.8' + + # TODO: FK to be validated synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/425409 + def up + prepare_async_foreign_key_validation :vulnerabilities, :finding_id, name: FK_NAME + end + + def down + unprepare_async_foreign_key_validation :vulnerabilities, :finding_id, name: FK_NAME + end +end diff --git a/db/post_migrate/20231225133628_remove_due_date_column_from_vulnerabilities.rb b/db/post_migrate/20231225133628_remove_due_date_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..2f77a5a82f4 --- /dev/null +++ b/db/post_migrate/20231225133628_remove_due_date_column_from_vulnerabilities.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveDueDateColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + milestone '16.8' + + enable_lock_retries! + + def up + remove_column :vulnerabilities, :due_date + end + + def down + add_column :vulnerabilities, :due_date, :date + end +end diff --git a/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb b/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb new file mode 100644 index 00000000000..6569e624c78 --- /dev/null +++ b/db/post_migrate/20231228043653_rename_old_index_to_new_index_in_catalog_resources.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RenameOldIndexToNewIndexInCatalogResources < Gitlab::Database::Migration[2.2] + milestone '16.8' + + enable_lock_retries! + + OLD_INDEX_NAME = 'index_catalog_resources_on_search_vector_triagram' + NEW_INDEX_NAME = 'index_catalog_resources_on_search_vector' + + def change + rename_index :catalog_resources, OLD_INDEX_NAME, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20240101133628_remove_start_date_column_from_vulnerabilities.rb b/db/post_migrate/20240101133628_remove_start_date_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..747ff35377b --- /dev/null +++ b/db/post_migrate/20240101133628_remove_start_date_column_from_vulnerabilities.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveStartDateColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + milestone '16.8' + + enable_lock_retries! + + def up + remove_column :vulnerabilities, :start_date + end + + def down + add_column :vulnerabilities, :start_date, :date + end +end diff --git a/db/post_migrate/20240102065444_remove_milestone_id_column_from_vulnerabilities.rb b/db/post_migrate/20240102065444_remove_milestone_id_column_from_vulnerabilities.rb new file mode 100644 index 00000000000..f74c15a97fb --- /dev/null +++ b/db/post_migrate/20240102065444_remove_milestone_id_column_from_vulnerabilities.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveMilestoneIdColumnFromVulnerabilities < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + def up + with_lock_retries do + remove_column :vulnerabilities, :milestone_id + end + end + + def down + add_column :vulnerabilities, :milestone_id, :bigint unless column_exists?(:vulnerabilities, :milestone_id) + + # Add back index and constraint that were dropped in `up` + add_concurrent_index(:vulnerabilities, :milestone_id) + add_concurrent_foreign_key(:vulnerabilities, :milestones, column: :milestone_id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20240102101409_validate_finding_id_on_vulnerabilities.rb b/db/post_migrate/20240102101409_validate_finding_id_on_vulnerabilities.rb new file mode 100644 index 00000000000..deed2462f93 --- /dev/null +++ b/db/post_migrate/20240102101409_validate_finding_id_on_vulnerabilities.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ValidateFindingIdOnVulnerabilities < Gitlab::Database::Migration[2.2] + # obtained by running `\d vulnerabilities` on https://console.postgres.ai + FK_NAME = :fk_4e64972902 + + milestone '16.8' + + # validated asynchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131979 + def up + validate_foreign_key :vulnerabilities, :finding_id, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + # https://docs.gitlab.com/ee/development/database/add_foreign_key_to_existing_column.html#add-a-migration-to-validate-the-fk-synchronously + end +end diff --git a/db/post_migrate/20240104085448_queue_update_workspaces_config_version3.rb b/db/post_migrate/20240104085448_queue_update_workspaces_config_version3.rb new file mode 100644 index 00000000000..574b6cdb4c2 --- /dev/null +++ b/db/post_migrate/20240104085448_queue_update_workspaces_config_version3.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class QueueUpdateWorkspacesConfigVersion3 < Gitlab::Database::Migration[2.2] + milestone '16.8' + + MIGRATION = "UpdateWorkspacesConfigVersion3" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :workspaces, + :config_version, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :workspaces, :config_version, []) + end +end diff --git a/db/post_migrate/20240104091627_validate_foreign_key_ci_build_trace_metadata.rb b/db/post_migrate/20240104091627_validate_foreign_key_ci_build_trace_metadata.rb new file mode 100644 index 00000000000..16e97bd5e6a --- /dev/null +++ b/db/post_migrate/20240104091627_validate_foreign_key_ci_build_trace_metadata.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class ValidateForeignKeyCiBuildTraceMetadata < Gitlab::Database::Migration[2.2] + milestone '16.8' + + # We first need to introduce this FK for self-managed + def up + # no-op + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20240104091858_validate_foreign_key_ci_job_artifact_state.rb b/db/post_migrate/20240104091858_validate_foreign_key_ci_job_artifact_state.rb new file mode 100644 index 00000000000..bd705fd07a5 --- /dev/null +++ b/db/post_migrate/20240104091858_validate_foreign_key_ci_job_artifact_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class ValidateForeignKeyCiJobArtifactState < Gitlab::Database::Migration[2.2] + milestone '16.8' + + # We first need to introduce this FK for self-managed + def up + # no-op + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20240104101601_finalize_backfill_partition_id_ci_pipeline_chat_data.rb b/db/post_migrate/20240104101601_finalize_backfill_partition_id_ci_pipeline_chat_data.rb new file mode 100644 index 00000000000..45da0e9c12a --- /dev/null +++ b/db/post_migrate/20240104101601_finalize_backfill_partition_id_ci_pipeline_chat_data.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class FinalizeBackfillPartitionIdCiPipelineChatData < Gitlab::Database::Migration[2.2] + milestone '16.8' + MIGRATION = 'BackfillPartitionIdCiPipelineChatData' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :ci_pipeline_chat_data, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20240104145320_remove_partition_id_default_value_for_ci_pipeline_chat_data.rb b/db/post_migrate/20240104145320_remove_partition_id_default_value_for_ci_pipeline_chat_data.rb new file mode 100644 index 00000000000..3aedf6e66a1 --- /dev/null +++ b/db/post_migrate/20240104145320_remove_partition_id_default_value_for_ci_pipeline_chat_data.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemovePartitionIdDefaultValueForCiPipelineChatData < Gitlab::Database::Migration[2.2] + milestone '16.8' + enable_lock_retries! + + TABLE_NAME = :ci_pipeline_chat_data + COLUM_NAME = :partition_id + + def change + change_column_default(TABLE_NAME, COLUM_NAME, from: 100, to: nil) + end +end diff --git a/db/post_migrate/20240104155616_finalize_backfill_default_branch_protection_namespace_settings.rb b/db/post_migrate/20240104155616_finalize_backfill_default_branch_protection_namespace_settings.rb new file mode 100644 index 00000000000..b4a23028f21 --- /dev/null +++ b/db/post_migrate/20240104155616_finalize_backfill_default_branch_protection_namespace_settings.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class FinalizeBackfillDefaultBranchProtectionNamespaceSettings < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'BackfillBranchProtectionNamespaceSetting' + + milestone '16.8' + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :namespace_settings, + column_name: :namespace_id, + job_arguments: [], + finalize: true + ) + end + + def down + # noop + end +end diff --git a/db/post_migrate/20240104223119_add_index_owasp_top_10_with_project_id_on_vulnerability_reads.rb b/db/post_migrate/20240104223119_add_index_owasp_top_10_with_project_id_on_vulnerability_reads.rb new file mode 100644 index 00000000000..99a2dccc8f5 --- /dev/null +++ b/db/post_migrate/20240104223119_add_index_owasp_top_10_with_project_id_on_vulnerability_reads.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOwaspTop10WithProjectIdOnVulnerabilityReads < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + + milestone '16.8' + + INDEX_NAME = 'index_vuln_reads_on_project_id_owasp_top_10' + + def up + add_concurrent_index :vulnerability_reads, [:project_id, :owasp_top_10], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME + end +end diff --git a/db/post_migrate/20240105000001_cleanup_workspaces_url_domain_to_dns_zone_rename.rb b/db/post_migrate/20240105000001_cleanup_workspaces_url_domain_to_dns_zone_rename.rb new file mode 100644 index 00000000000..d37d0c9a5af --- /dev/null +++ b/db/post_migrate/20240105000001_cleanup_workspaces_url_domain_to_dns_zone_rename.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanupWorkspacesUrlDomainToDnsZoneRename < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + def up + cleanup_concurrent_column_rename :workspaces, :url_domain, :dns_zone + end + + def down + undo_cleanup_concurrent_column_rename :workspaces, :url_domain, :dns_zone + end +end diff --git a/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb b/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb new file mode 100644 index 00000000000..b7271fa5f51 --- /dev/null +++ b/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +class DisableFastupdateOnIssueSearchData < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + NUM_PARTITIONS = 64 + + def up + each_index_name do |index_name| + with_lock_retries do + execute <<~SQL + ALTER INDEX #{index_name} SET ( fastupdate = false ) ; + SQL + end + end + end + + def down + each_index_name do |index_name| + with_lock_retries do + execute <<~SQL + ALTER INDEX #{index_name} RESET ( fastupdate ) ; + SQL + end + end + end + + private + + def each_index_name + NUM_PARTITIONS.times do |partition| + yield "gitlab_partitions_static.issue_search_data_#{format('%02d', partition)}_search_vector_idx" + end + end +end diff --git a/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb b/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb new file mode 100644 index 00000000000..f12041e613f --- /dev/null +++ b/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class QueueBackfillIssueSearchDataNamespaceId < Gitlab::Database::Migration[2.2] + milestone '16.8' + + MIGRATION = "BackfillIssueSearchDataNamespaceId" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 1_000 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :issues, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :issues, :id, []) + end +end diff --git a/db/post_migrate/20240107154747_sent_notifications_self_install_finalize_bbm.rb b/db/post_migrate/20240107154747_sent_notifications_self_install_finalize_bbm.rb new file mode 100644 index 00000000000..78efdf36d64 --- /dev/null +++ b/db/post_migrate/20240107154747_sent_notifications_self_install_finalize_bbm.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class SentNotificationsSelfInstallFinalizeBbm < Gitlab::Database::Migration[2.2] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + milestone '16.8' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + TABLE_NAME = 'sent_notifications' + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: TABLE_NAME, + column_name: 'id', + job_arguments: [['id'], ['id_convert_to_bigint']] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20240107154805_sent_notifications_self_install_id_swap.rb b/db/post_migrate/20240107154805_sent_notifications_self_install_id_swap.rb new file mode 100644 index 00000000000..c6e31ca568e --- /dev/null +++ b/db/post_migrate/20240107154805_sent_notifications_self_install_id_swap.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +class SentNotificationsSelfInstallIdSwap < Gitlab::Database::Migration[2.2] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + milestone '16.8' + + disable_ddl_transaction! + + TABLE_NAME = :sent_notifications + COLUMN_NAME = :id_convert_to_bigint + INDEX_NAME = :index_sent_notifications_on_id_convert_to_bigint + + def up + return if com_or_dev_or_test_but_not_jh? + return if temp_column_removed?(TABLE_NAME, :id) + return if columns_swapped?(TABLE_NAME, :id) + + swap + end + + def down + return if com_or_dev_or_test_but_not_jh? + return if temp_column_removed?(TABLE_NAME, :id) + return unless columns_swapped?(TABLE_NAME, :id) + + swap + end + + def swap + add_concurrent_index TABLE_NAME, COLUMN_NAME, unique: true, name: INDEX_NAME + + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Swap Columns + temp_name = quote_column_name(:id_tmp) + id_name = quote_column_name(:id) + id_convert_to_bigint_name = quote_column_name(COLUMN_NAME) + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_name} TO #{temp_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{id_convert_to_bigint_name} TO #{id_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{id_convert_to_bigint_name}" + + # Reset trigger + function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table(TABLE_NAME, connection: connection) + .name(:id, :id_convert_to_bigint) + execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" + + execute "ALTER SEQUENCE #{TABLE_NAME}_id_seq OWNED BY #{TABLE_NAME}.id" + change_column_default TABLE_NAME, :id, -> { "nextval('#{TABLE_NAME}_id_seq'::regclass)" } + change_column_default TABLE_NAME, :id_convert_to_bigint, 0 + + execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT #{TABLE_NAME}_pkey CASCADE" + rename_index TABLE_NAME, INDEX_NAME, "#{TABLE_NAME}_pkey" + execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{TABLE_NAME}_pkey PRIMARY KEY USING INDEX #{TABLE_NAME}_pkey" + end + end +end diff --git a/db/post_migrate/20240108072319_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id2.rb b/db/post_migrate/20240108072319_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id2.rb new file mode 100644 index 00000000000..23219a9d90a --- /dev/null +++ b/db/post_migrate/20240108072319_add_fk_to_ci_build_trace_metadata_on_partition_id_and_trace_artifact_id2.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +class AddFkToCiBuildTraceMetadataOnPartitionIdAndTraceArtifactId2 < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_build_trace_metadata + TARGET_TABLE_NAME = :ci_job_artifacts + COLUMN = :trace_artifact_id + TARGET_COLUMN = :id + FK_NAME = :fk_21d25cac1a_p + PARTITION_COLUMN = :partition_id + + def up + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: true, + reverse_lock_order: true, + on_update: :cascade, + on_delete: :cascade, + name: FK_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end +end diff --git a/db/post_migrate/20240108072546_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id2.rb b/db/post_migrate/20240108072546_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id2.rb new file mode 100644 index 00000000000..9b74f7019b9 --- /dev/null +++ b/db/post_migrate/20240108072546_add_fk_to_ci_job_artifact_states_on_partition_id_and_job_artifact_id2.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +class AddFkToCiJobArtifactStatesOnPartitionIdAndJobArtifactId2 < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_job_artifact_states + TARGET_TABLE_NAME = :ci_job_artifacts + COLUMN = :job_artifact_id + TARGET_COLUMN = :id + FK_NAME = :fk_rails_80a9cba3b2_p + PARTITION_COLUMN = :partition_id + + def up + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: [PARTITION_COLUMN, COLUMN], + target_column: [PARTITION_COLUMN, TARGET_COLUMN], + validate: true, + reverse_lock_order: true, + on_update: :cascade, + on_delete: :cascade, + name: FK_NAME + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end +end diff --git a/db/post_migrate/20240108082419_queue_backfill_partition_id_ci_pipeline_metadata.rb b/db/post_migrate/20240108082419_queue_backfill_partition_id_ci_pipeline_metadata.rb new file mode 100644 index 00000000000..6bcaf376a05 --- /dev/null +++ b/db/post_migrate/20240108082419_queue_backfill_partition_id_ci_pipeline_metadata.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillPartitionIdCiPipelineMetadata < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + MIGRATION = 'BackfillPartitionIdCiPipelineMetadata' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 250 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipeline_metadata, + :pipeline_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipeline_metadata, :pipeline_id, []) + end +end diff --git a/db/post_migrate/20240108125135_remove_internal_ids_triggers.rb b/db/post_migrate/20240108125135_remove_internal_ids_triggers.rb new file mode 100644 index 00000000000..861aad2b288 --- /dev/null +++ b/db/post_migrate/20240108125135_remove_internal_ids_triggers.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +class RemoveInternalIdsTriggers < Gitlab::Database::Migration[2.2] + include Gitlab::Database::SchemaHelpers + + milestone '16.8' + disable_ddl_transaction! + + TRIGGER_ON_INSERT = 'trigger_copy_usage_on_internal_ids_on_insert' + TRIGGER_ON_UPDATE = 'trigger_copy_usage_on_internal_ids_on_update' + INSERT_OR_UPDATE_FUNCTION_NAME = 'insert_or_update_internal_ids_usage' + + def up + drop_trigger(:internal_ids, TRIGGER_ON_INSERT) + drop_trigger(:internal_ids, TRIGGER_ON_UPDATE) + drop_function(INSERT_OR_UPDATE_FUNCTION_NAME) + end + + def down + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}() + RETURNS trigger + LANGUAGE plpgsql + AS $$ + DECLARE + namespace_type varchar; + copy_usage smallint; + BEGIN + IF (NEW.usage = 0) THEN + copy_usage = 4; + + -- we only care about group level internal_ids so we check namespace type here + namespace_type = (SELECT type FROM namespaces WHERE id = NEW.namespace_id); + IF (namespace_type <> 'Group') THEN + RETURN NULL; + END IF; + ELSIF (NEW.usage = 4) THEN + copy_usage = 0; + ELSE + RETURN NULL; + END IF; + + -- if value is the same there is nothing to update + IF (OLD.last_value = NEW.last_value AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN + RETURN NULL; + END IF; + + INSERT INTO internal_ids (usage, last_value, namespace_id) + VALUES (copy_usage, NEW.last_value, NEW.namespace_id) + ON CONFLICT (usage, namespace_id) WHERE namespace_id IS NOT NULL + DO UPDATE SET last_value = NEW.last_value; + + RETURN NULL; + END + $$ + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_INSERT} + AFTER INSERT ON internal_ids + FOR EACH ROW + WHEN (((NEW.usage = 0) OR (NEW.usage = 4)) AND NEW.namespace_id IS NOT NULL) + EXECUTE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}(); + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_UPDATE} + AFTER UPDATE ON internal_ids + FOR EACH ROW + WHEN (((NEW.usage = 0) OR (NEW.usage = 4)) AND NEW.namespace_id IS NOT NULL) + EXECUTE FUNCTION #{INSERT_OR_UPDATE_FUNCTION_NAME}(); + SQL + end +end diff --git a/db/post_migrate/20240108125335_add_temporary_index_internal_ids_on_id_and_usage.rb b/db/post_migrate/20240108125335_add_temporary_index_internal_ids_on_id_and_usage.rb new file mode 100644 index 00000000000..798a42d2a1d --- /dev/null +++ b/db/post_migrate/20240108125335_add_temporary_index_internal_ids_on_id_and_usage.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddTemporaryIndexInternalIdsOnIdAndUsage < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + INDEX_NAME = "tmp_index_internal_ids_on_id_and_usage" + EPICS_USAGE = 4 # see Enums::InternalId#usage_resources[:epics] + + def up + add_concurrent_index :internal_ids, :id, name: INDEX_NAME, where: "usage = #{EPICS_USAGE}" + end + + def down + remove_concurrent_index_by_name :internal_ids, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20240108181808_remove_package_registry_duplicated_indexes.rb b/db/post_migrate/20240108181808_remove_package_registry_duplicated_indexes.rb new file mode 100644 index 00000000000..96380b94d50 --- /dev/null +++ b/db/post_migrate/20240108181808_remove_package_registry_duplicated_indexes.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class RemovePackageRegistryDuplicatedIndexes < Gitlab::Database::Migration[2.2] + disable_ddl_transaction! + milestone '16.8' + + DUPLICATED_INDEXES = [ + { + name: :index_packages_debian_group_distributions_on_group_id, + table: :packages_debian_group_distributions, + column: :group_id + }, + { + name: :index_packages_debian_project_distributions_on_project_id, + table: :packages_debian_project_distributions, + column: :project_id + }, + { + name: :index_packages_tags_on_package_id, + table: :packages_tags, + column: :package_id + } + ] + + def up + DUPLICATED_INDEXES.each do |index| + remove_concurrent_index_by_name(index[:table], index[:name]) + end + end + + def down + DUPLICATED_INDEXES.each do |index| + add_concurrent_index(index[:table], index[:column], name: index[:name]) + end + end +end diff --git a/db/post_migrate/20240108185335_backfill_internal_ids_with_issues_usage_for_epics.rb b/db/post_migrate/20240108185335_backfill_internal_ids_with_issues_usage_for_epics.rb new file mode 100644 index 00000000000..4131f403212 --- /dev/null +++ b/db/post_migrate/20240108185335_backfill_internal_ids_with_issues_usage_for_epics.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +class BackfillInternalIdsWithIssuesUsageForEpics < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + BATCH_SIZE = 500 + ISSUES_USAGE = 0 # see Enums::InternalId#usage_resources[:issues] + EPICS_USAGE = 4 # see Enums::InternalId#usage_resources[:epics] + + def up + internal_id_model = define_batchable_model('internal_ids') + epic_model = define_batchable_model('epics') + + internal_id_model.where(usage: EPICS_USAGE).each_batch(of: BATCH_SIZE) do |relation| + # Creates a corresponding `usage: :issues` record for every `epics` usage. + # On conflict it means the record was already created when a new epic was created with the newly issues usage. + # In which case to make sure we have the value copied over from epics record. + connection.execute( + <<~SQL + INSERT INTO internal_ids (usage, last_value, namespace_id) + SELECT #{ISSUES_USAGE}, last_value, namespace_id + FROM internal_ids + WHERE internal_ids.id IN(#{relation.select(:id).to_sql}) + ON CONFLICT (usage, namespace_id) WHERE namespace_id IS NOT NULL + DO UPDATE SET last_value = GREATEST(EXCLUDED.last_value, internal_ids.last_value) + RETURNING id; + SQL + ) + + relation.delete_all + end + + # there are a couple records in epics table that reference namespaces without a corresponding entry + # in internal_ids, for whatever reason, so this statement addresses that. + epic_model.distinct_each_batch(column: :group_id, of: BATCH_SIZE) do |relation| + connection.execute( + <<~SQL + INSERT INTO internal_ids (usage, last_value, namespace_id) + SELECT #{ISSUES_USAGE}, max(iid) as last_value, group_id + FROM epics + WHERE group_id IN(#{relation.to_sql}) + GROUP BY group_id + ON CONFLICT (usage, namespace_id) WHERE namespace_id IS NOT NULL + DO NOTHING + RETURNING id; + SQL + ) + end + end + + def down + # noop + end +end diff --git a/db/post_migrate/20240108215335_remove_internal_ids_tmp_index.rb b/db/post_migrate/20240108215335_remove_internal_ids_tmp_index.rb new file mode 100644 index 00000000000..e6ed936afc3 --- /dev/null +++ b/db/post_migrate/20240108215335_remove_internal_ids_tmp_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveInternalIdsTmpIndex < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + INDEX_NAME = "tmp_index_internal_ids_on_id_and_usage" + EPICS_USAGE = 4 # see Enums::InternalId#usage_resources[:epics] + + def up + remove_concurrent_index_by_name :internal_ids, name: INDEX_NAME + end + + def down + add_concurrent_index :internal_ids, :id, name: INDEX_NAME, where: "usage = #{EPICS_USAGE}" + end +end diff --git a/db/post_migrate/20240109025151_create_index_on_id_convert_to_bigint_for_system_note_metadata_async.rb b/db/post_migrate/20240109025151_create_index_on_id_convert_to_bigint_for_system_note_metadata_async.rb new file mode 100644 index 00000000000..281704a1620 --- /dev/null +++ b/db/post_migrate/20240109025151_create_index_on_id_convert_to_bigint_for_system_note_metadata_async.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateIndexOnIdConvertToBigintForSystemNoteMetadataAsync < Gitlab::Database::Migration[2.2] + milestone '16.8' + + TABLE_NAME = :system_note_metadata + INDEX_NAME = 'index_system_note_metadata_pkey_on_id_convert_to_bigint' + + def up + prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME + end + + def down + unprepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb b/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb new file mode 100644 index 00000000000..30959a299fb --- /dev/null +++ b/db/post_migrate/20240109090354_queue_backfill_partition_id_ci_pipeline_artifact.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillPartitionIdCiPipelineArtifact < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + MIGRATION = 'BackfillPartitionIdCiPipelineArtifact' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipeline_artifacts, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipeline_artifacts, :id, []) + end +end diff --git a/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb b/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb new file mode 100644 index 00000000000..123d665f625 --- /dev/null +++ b/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexProjectIdComponentVersionIdIdOnSbomOccurrences < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_sbom_occurr_on_project_id_and_component_version_id_and_id' + + disable_ddl_transaction! + milestone '16.8' + + def up + add_concurrent_index :sbom_occurrences, [:project_id, :component_version_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_occurrence, INDEX_NAME + end +end diff --git a/db/post_migrate/20240110090352_queue_backfill_partition_id_ci_pipeline_config.rb b/db/post_migrate/20240110090352_queue_backfill_partition_id_ci_pipeline_config.rb new file mode 100644 index 00000000000..d5ae025b385 --- /dev/null +++ b/db/post_migrate/20240110090352_queue_backfill_partition_id_ci_pipeline_config.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueBackfillPartitionIdCiPipelineConfig < Gitlab::Database::Migration[2.2] + milestone '16.8' + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + MIGRATION = 'BackfillPartitionIdCiPipelineConfig' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipelines_config, + :pipeline_id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipelines_config, :pipeline_id, []) + end +end diff --git a/db/post_migrate/20240110093654_schedule_index_removal_ci_build_trace_metadata.rb b/db/post_migrate/20240110093654_schedule_index_removal_ci_build_trace_metadata.rb new file mode 100644 index 00000000000..8f2faa32c81 --- /dev/null +++ b/db/post_migrate/20240110093654_schedule_index_removal_ci_build_trace_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ScheduleIndexRemovalCiBuildTraceMetadata < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + INDEX_NAME = :index_ci_build_trace_metadata_on_trace_artifact_id + TABLE_NAME = :ci_build_trace_metadata + COLUMN_NAME = :trace_artifact_id + + def up + prepare_async_index_removal(TABLE_NAME, COLUMN_NAME, name: INDEX_NAME) + end + + def down + unprepare_async_index(TABLE_NAME, COLUMN_NAME, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20240110094002_drop_index_from_ci_job_artifact_state.rb b/db/post_migrate/20240110094002_drop_index_from_ci_job_artifact_state.rb new file mode 100644 index 00000000000..0b92c73ad55 --- /dev/null +++ b/db/post_migrate/20240110094002_drop_index_from_ci_job_artifact_state.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropIndexFromCiJobArtifactState < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + INDEX_NAME = :index_ci_job_artifact_states_on_job_artifact_id + TABLE_NAME = :ci_job_artifact_states + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, :job_artifact_id, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20240110094510_remove_fk_from_ci_job_artifact_state.rb b/db/post_migrate/20240110094510_remove_fk_from_ci_job_artifact_state.rb new file mode 100644 index 00000000000..bbe1f39e3ed --- /dev/null +++ b/db/post_migrate/20240110094510_remove_fk_from_ci_job_artifact_state.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class RemoveFkFromCiJobArtifactState < Gitlab::Database::Migration[2.2] + milestone '16.8' + disable_ddl_transaction! + + SOURCE_TABLE_NAME = :ci_job_artifact_states + TARGET_TABLE_NAME = :ci_job_artifacts + COLUMN = :job_artifact_id + TARGET_COLUMN = :id + FK_NAME = :fk_rails_80a9cba3b2 + + def up + with_lock_retries do + remove_foreign_key_if_exists( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + name: FK_NAME, + reverse_lock_order: true + ) + end + end + + def down + add_concurrent_foreign_key( + SOURCE_TABLE_NAME, + TARGET_TABLE_NAME, + column: COLUMN, + target_column: TARGET_COLUMN, + validate: true, + reverse_lock_order: true, + on_delete: :cascade, + name: FK_NAME + ) + end +end diff --git a/db/post_migrate/20240110132029_re_remove_requirements_ignored_columns.rb b/db/post_migrate/20240110132029_re_remove_requirements_ignored_columns.rb new file mode 100644 index 00000000000..e6d85761a14 --- /dev/null +++ b/db/post_migrate/20240110132029_re_remove_requirements_ignored_columns.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +class ReRemoveRequirementsIgnoredColumns < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + CONSTRAINT_NAME = 'check_785ae25b9d' + NAME_INDEX = 'index_requirements_on_title_trigram' + FOREIGN_KEY = 'fk_rails_33fed8aa4e' + + def up + remove_column(:requirements, :created_at, if_exists: true) + remove_column(:requirements, :updated_at, if_exists: true) + remove_column(:requirements, :cached_markdown_version, if_exists: true) + remove_column(:requirements, :state, if_exists: true) + remove_column(:requirements, :title, if_exists: true) + remove_column(:requirements, :title_html, if_exists: true) + remove_column(:requirements, :description, if_exists: true) + remove_column(:requirements, :description_html, if_exists: true) + with_lock_retries do + remove_column(:requirements, :author_id, if_exists: true) + end + end + + def down + add_column(:requirements, :created_at, :datetime_with_timezone, if_not_exists: true) + add_column(:requirements, :updated_at, :datetime_with_timezone, if_not_exists: true) + add_column(:requirements, :author_id, :integer, if_not_exists: true) + add_column(:requirements, :cached_markdown_version, :integer, if_not_exists: true) + add_column(:requirements, :state, :smallint, default: 1, if_not_exists: true) + add_column(:requirements, :title, :string, limit: 255, if_not_exists: true) + add_column(:requirements, :title_html, :text, if_not_exists: true) + add_column(:requirements, :description, :text, if_not_exists: true) + add_column(:requirements, :description_html, :text, if_not_exists: true) + + add_check_constraint(:requirements, "char_length(description) <= 10000", CONSTRAINT_NAME) + + add_concurrent_foreign_key(:requirements, :users, column: :author_id, name: FOREIGN_KEY, on_delete: :nullify) + + add_concurrent_index(:requirements, :created_at) + add_concurrent_index(:requirements, :updated_at) + add_concurrent_index(:requirements, :author_id) + add_concurrent_index(:requirements, :state) + add_concurrent_index(:requirements, :title, name: NAME_INDEX, using: :gin, opclass: { name: :gin_trgm_ops }) + end +end diff --git a/db/schema_migrations/20231116201338 b/db/schema_migrations/20231116201338 new file mode 100644 index 00000000000..7266a7a36bc --- /dev/null +++ b/db/schema_migrations/20231116201338 @@ -0,0 +1 @@ +bb86e8dd465b6bfa394c16e27a7ebc16b63545f9b7675e57399ac159d4b53711
\ No newline at end of file diff --git a/db/schema_migrations/20231123160255 b/db/schema_migrations/20231123160255 new file mode 100644 index 00000000000..f158c3d99f1 --- /dev/null +++ b/db/schema_migrations/20231123160255 @@ -0,0 +1 @@ +05dab8240da25338ef7b7f06414f53eac6c584b39158bb80e22f635c216b8276
\ No newline at end of file diff --git a/db/schema_migrations/20231124022520 b/db/schema_migrations/20231124022520 new file mode 100644 index 00000000000..408c6f976f8 --- /dev/null +++ b/db/schema_migrations/20231124022520 @@ -0,0 +1 @@ +bfa32c41d867fa4de24ac0a81d1f99f14e868b2c5bd453f799e1a3b3eebd1d51
\ No newline at end of file diff --git a/db/schema_migrations/20231129173649 b/db/schema_migrations/20231129173649 new file mode 100644 index 00000000000..a70b975dab6 --- /dev/null +++ b/db/schema_migrations/20231129173649 @@ -0,0 +1 @@ +a18e718e99c23ae6db929929a905af0db72e3a3734d3c33e12ec2cdb44467f6d
\ No newline at end of file diff --git a/db/schema_migrations/20231130124606 b/db/schema_migrations/20231130124606 new file mode 100644 index 00000000000..ed5744a8c7e --- /dev/null +++ b/db/schema_migrations/20231130124606 @@ -0,0 +1 @@ +70f8264aa0996e3020fd068beba148f51170224126d1aa91740bd32bd59a196d
\ No newline at end of file diff --git a/db/schema_migrations/20231204042048 b/db/schema_migrations/20231204042048 new file mode 100644 index 00000000000..6e0e069539c --- /dev/null +++ b/db/schema_migrations/20231204042048 @@ -0,0 +1 @@ +ca81769223a50ac334a06e150a2454800292a0affa65e3b55f6925c0c1bc7947
\ No newline at end of file diff --git a/db/schema_migrations/20231204095802 b/db/schema_migrations/20231204095802 new file mode 100644 index 00000000000..eee6ff01a86 --- /dev/null +++ b/db/schema_migrations/20231204095802 @@ -0,0 +1 @@ +c2fc8e11eb2ac22bd4f37dcabd9468ddfce6285a9b796560c8ce9a21fa0047e1
\ No newline at end of file diff --git a/db/schema_migrations/20231205165049 b/db/schema_migrations/20231205165049 new file mode 100644 index 00000000000..31d9412d92e --- /dev/null +++ b/db/schema_migrations/20231205165049 @@ -0,0 +1 @@ +0ee24818863477396cd51f071d113ebc35f8e9a90f90a5d5e7237032c5f55bd3
\ No newline at end of file diff --git a/db/schema_migrations/20231205200847 b/db/schema_migrations/20231205200847 new file mode 100644 index 00000000000..ee54e218e09 --- /dev/null +++ b/db/schema_migrations/20231205200847 @@ -0,0 +1 @@ +cac5543864045ad7e9ad386aebcf7f29ee5c6351fcadd81f4c7b5d29b2fad16b
\ No newline at end of file diff --git a/db/schema_migrations/20231205200925 b/db/schema_migrations/20231205200925 new file mode 100644 index 00000000000..92cee99ca02 --- /dev/null +++ b/db/schema_migrations/20231205200925 @@ -0,0 +1 @@ +9318699a34d585059d68a62cfe74e5f5d9a8669d0f1acb2b0c9d98545c7a3a26
\ No newline at end of file diff --git a/db/schema_migrations/20231206165856 b/db/schema_migrations/20231206165856 new file mode 100644 index 00000000000..174770d92b2 --- /dev/null +++ b/db/schema_migrations/20231206165856 @@ -0,0 +1 @@ +6c0b55a2c7709d78cc83c97efe0586ecb3731bf3e7af23cd237595c7d55b961c
\ No newline at end of file diff --git a/db/schema_migrations/20231206184344 b/db/schema_migrations/20231206184344 new file mode 100644 index 00000000000..54e5c113e2d --- /dev/null +++ b/db/schema_migrations/20231206184344 @@ -0,0 +1 @@ +775bee3e66f08e7479bc6f40db9ba909a116f97b4672b9d02d5f9d200bc8bbfe
\ No newline at end of file diff --git a/db/schema_migrations/20231206190206 b/db/schema_migrations/20231206190206 new file mode 100644 index 00000000000..bb6fcca4c89 --- /dev/null +++ b/db/schema_migrations/20231206190206 @@ -0,0 +1 @@ +2a211a4b94ab1006f680214be38103148eb1edaa1e67a7c3aa6b87679e70d994
\ No newline at end of file diff --git a/db/schema_migrations/20231206191102 b/db/schema_migrations/20231206191102 new file mode 100644 index 00000000000..2021bd5ecc7 --- /dev/null +++ b/db/schema_migrations/20231206191102 @@ -0,0 +1 @@ +10f234cbc5db115cf70a2201d3be32edde85612aa3e7b725817b3e757fe3d8f0
\ No newline at end of file diff --git a/db/schema_migrations/20231206212252 b/db/schema_migrations/20231206212252 new file mode 100644 index 00000000000..fbced800bc4 --- /dev/null +++ b/db/schema_migrations/20231206212252 @@ -0,0 +1 @@ +de8026484bae86f2dedab6b734a1c1cfcc2f7b804268416cdbbaa44d88f7d908
\ No newline at end of file diff --git a/db/schema_migrations/20231207145335 b/db/schema_migrations/20231207145335 new file mode 100644 index 00000000000..0918b3e1c99 --- /dev/null +++ b/db/schema_migrations/20231207145335 @@ -0,0 +1 @@ +94f37e35b90378cfa2cc26aa5114495bfb1f407ace69e5104b354110f797e15d
\ No newline at end of file diff --git a/db/schema_migrations/20231207155340 b/db/schema_migrations/20231207155340 new file mode 100644 index 00000000000..dc9528f0fe4 --- /dev/null +++ b/db/schema_migrations/20231207155340 @@ -0,0 +1 @@ +0e9bec42c0fcff647bf36fb61fc6fbb4c850da8346c404d2d48b4054f559b213
\ No newline at end of file diff --git a/db/schema_migrations/20231207211418 b/db/schema_migrations/20231207211418 new file mode 100644 index 00000000000..c55f398e3db --- /dev/null +++ b/db/schema_migrations/20231207211418 @@ -0,0 +1 @@ +462ea250743580c161179a935d70b5d0a6a22e953a83787cd5f80d3d2646cc42
\ No newline at end of file diff --git a/db/schema_migrations/20231207221418 b/db/schema_migrations/20231207221418 new file mode 100644 index 00000000000..91fe8e080cf --- /dev/null +++ b/db/schema_migrations/20231207221418 @@ -0,0 +1 @@ +902369f8c734deb3ea351df48542d274ff9dc627fceaefdaa55ae646465b24f1
\ No newline at end of file diff --git a/db/schema_migrations/20231211154654 b/db/schema_migrations/20231211154654 new file mode 100644 index 00000000000..24f56f52ed1 --- /dev/null +++ b/db/schema_migrations/20231211154654 @@ -0,0 +1 @@ +7c587bfbe8349640c9766d41a3c287bd27d8bc03d7a3f17d9a47c49f31bed2d8
\ No newline at end of file diff --git a/db/schema_migrations/20231212090606 b/db/schema_migrations/20231212090606 new file mode 100644 index 00000000000..7160749c318 --- /dev/null +++ b/db/schema_migrations/20231212090606 @@ -0,0 +1 @@ +86f8e4e111f42d4b8def51c30dc6ca7be035766b30abd2c0c3f2323b4e501cf7
\ No newline at end of file diff --git a/db/schema_migrations/20231212135235 b/db/schema_migrations/20231212135235 new file mode 100644 index 00000000000..7f72cbe25f4 --- /dev/null +++ b/db/schema_migrations/20231212135235 @@ -0,0 +1 @@ +de10b5c89c8aac8590f76cba73bdd05af18669c998036ab7ac82231c2feb58f8
\ No newline at end of file diff --git a/db/schema_migrations/20231212154022 b/db/schema_migrations/20231212154022 new file mode 100644 index 00000000000..9f9967d0326 --- /dev/null +++ b/db/schema_migrations/20231212154022 @@ -0,0 +1 @@ +c005eb8901f1ebb85dedb044d627396f591bd760a0315dc3f45171def0f972e5
\ No newline at end of file diff --git a/db/schema_migrations/20231213014658 b/db/schema_migrations/20231213014658 new file mode 100644 index 00000000000..436e6309b69 --- /dev/null +++ b/db/schema_migrations/20231213014658 @@ -0,0 +1 @@ +3f75e086b1a029efce67a3cd24cc02d482aad29417d697fbb4ef3a42da83c066
\ No newline at end of file diff --git a/db/schema_migrations/20231213064314 b/db/schema_migrations/20231213064314 new file mode 100644 index 00000000000..ca689b6efe9 --- /dev/null +++ b/db/schema_migrations/20231213064314 @@ -0,0 +1 @@ +800e0153034af8cffab47cce9362092ec76ba6aa59645b55ecf754bbbdba69d2
\ No newline at end of file diff --git a/db/schema_migrations/20231213065249 b/db/schema_migrations/20231213065249 new file mode 100644 index 00000000000..86109e19921 --- /dev/null +++ b/db/schema_migrations/20231213065249 @@ -0,0 +1 @@ +dece1580b6d5b6663b557761b69a8333f83f3f06c38be377299aeacc5ca8e163
\ No newline at end of file diff --git a/db/schema_migrations/20231213080216 b/db/schema_migrations/20231213080216 new file mode 100644 index 00000000000..aec23e96841 --- /dev/null +++ b/db/schema_migrations/20231213080216 @@ -0,0 +1 @@ +d4a3655d2c825bc51f9e5c78003222277e11c24f8aaa311225dc232867adf387
\ No newline at end of file diff --git a/db/schema_migrations/20231213080238 b/db/schema_migrations/20231213080238 new file mode 100644 index 00000000000..c16eee40c3d --- /dev/null +++ b/db/schema_migrations/20231213080238 @@ -0,0 +1 @@ +58f4a6bf530cc90a4bda4200111461c30daf0b458d9236b963ecccf2884cdf9d
\ No newline at end of file diff --git a/db/schema_migrations/20231213170159 b/db/schema_migrations/20231213170159 new file mode 100644 index 00000000000..ff5e6e29a3c --- /dev/null +++ b/db/schema_migrations/20231213170159 @@ -0,0 +1 @@ +f73fde4e3e54fa88d8dba9ec3a98b7dfb8332aaf7a76de73baf899292ed751b1
\ No newline at end of file diff --git a/db/schema_migrations/20231214095546 b/db/schema_migrations/20231214095546 new file mode 100644 index 00000000000..e7287b85dce --- /dev/null +++ b/db/schema_migrations/20231214095546 @@ -0,0 +1 @@ +ac880932fcf6f15b89335f5ecfe25c2e05b82b1dac5b404e611e8d876f5a7180
\ No newline at end of file diff --git a/db/schema_migrations/20231214111617 b/db/schema_migrations/20231214111617 new file mode 100644 index 00000000000..42c574c3f8b --- /dev/null +++ b/db/schema_migrations/20231214111617 @@ -0,0 +1 @@ +4acc75ab443f518a7340cea213f5803dee10c39f48d07b8a2e284f71d4c1eedd
\ No newline at end of file diff --git a/db/schema_migrations/20231214222351 b/db/schema_migrations/20231214222351 new file mode 100644 index 00000000000..ba699f1b541 --- /dev/null +++ b/db/schema_migrations/20231214222351 @@ -0,0 +1 @@ +ccfa73743ce6ebc37f661f9286912a3c635a068ff374d0bb1859f74609b84674
\ No newline at end of file diff --git a/db/schema_migrations/20231215101640 b/db/schema_migrations/20231215101640 new file mode 100644 index 00000000000..13c883c9e3d --- /dev/null +++ b/db/schema_migrations/20231215101640 @@ -0,0 +1 @@ +7bdc5d7aa9f9228aac355e51b1461b7d07083e8e5481ccf3e59c5ec48c9230ab
\ No newline at end of file diff --git a/db/schema_migrations/20231215130625 b/db/schema_migrations/20231215130625 new file mode 100644 index 00000000000..80126c160b4 --- /dev/null +++ b/db/schema_migrations/20231215130625 @@ -0,0 +1 @@ +5e0f9bdd92804b45a1ff020e1f8b3efbe317025ee681f25594859c3e93903b16
\ No newline at end of file diff --git a/db/schema_migrations/20231215151348 b/db/schema_migrations/20231215151348 new file mode 100644 index 00000000000..1c37bec18da --- /dev/null +++ b/db/schema_migrations/20231215151348 @@ -0,0 +1 @@ +281fde69710c20f9ae845136a4bfdbce1a8396f3d3d17018f7ffce1bf230b888
\ No newline at end of file diff --git a/db/schema_migrations/20231215192706 b/db/schema_migrations/20231215192706 new file mode 100644 index 00000000000..6652ecc5c74 --- /dev/null +++ b/db/schema_migrations/20231215192706 @@ -0,0 +1 @@ +5939e773b49ddd5e0610efa9a0215881187db968bd75521d2a6ac28fa7b40c0e
\ No newline at end of file diff --git a/db/schema_migrations/20231216190018 b/db/schema_migrations/20231216190018 new file mode 100644 index 00000000000..e94fc46ebeb --- /dev/null +++ b/db/schema_migrations/20231216190018 @@ -0,0 +1 @@ +aedec8e22474291e722e18fdc79fc10a1d4569db2e2760a4aebd21119d2c0fd4
\ No newline at end of file diff --git a/db/schema_migrations/20231217053910 b/db/schema_migrations/20231217053910 new file mode 100644 index 00000000000..ce8d6436f44 --- /dev/null +++ b/db/schema_migrations/20231217053910 @@ -0,0 +1 @@ +bf5f9ca0584e043c39ca57a9664241900c35cda921c94e0df2728b435137a066
\ No newline at end of file diff --git a/db/schema_migrations/20231218074237 b/db/schema_migrations/20231218074237 new file mode 100644 index 00000000000..1e3b78d7eab --- /dev/null +++ b/db/schema_migrations/20231218074237 @@ -0,0 +1 @@ +ed7563aea9a1d9496813a07b88597592b1c11793ff4673727855d09be07c93b1
\ No newline at end of file diff --git a/db/schema_migrations/20231218074508 b/db/schema_migrations/20231218074508 new file mode 100644 index 00000000000..d3ec5b303f5 --- /dev/null +++ b/db/schema_migrations/20231218074508 @@ -0,0 +1 @@ +0f97f218bdb2172c8abcb1a89e647bb0946867ab169d44d2736d24ed93e09322
\ No newline at end of file diff --git a/db/schema_migrations/20231218092401 b/db/schema_migrations/20231218092401 new file mode 100644 index 00000000000..4d57c53e98d --- /dev/null +++ b/db/schema_migrations/20231218092401 @@ -0,0 +1 @@ +8e62da6b0dfd415c462df2bd6ae62826dcfe440eb71e4fc9ad1cb216084f1141
\ No newline at end of file diff --git a/db/schema_migrations/20231218121131 b/db/schema_migrations/20231218121131 new file mode 100644 index 00000000000..3d262967705 --- /dev/null +++ b/db/schema_migrations/20231218121131 @@ -0,0 +1 @@ +39fe9d82ebdfb8cb16d4ccb3704d0866aba63ff1bfe4087c6ce44f3c98afd0a0
\ No newline at end of file diff --git a/db/schema_migrations/20231218172621 b/db/schema_migrations/20231218172621 new file mode 100644 index 00000000000..c5fff4c0072 --- /dev/null +++ b/db/schema_migrations/20231218172621 @@ -0,0 +1 @@ +9a5a5ecda3186fb4ef642ff56d5e3125bfe888e1a903bfdb8cfcef6827c41df6
\ No newline at end of file diff --git a/db/schema_migrations/20231219044006 b/db/schema_migrations/20231219044006 new file mode 100644 index 00000000000..87c1c9fb980 --- /dev/null +++ b/db/schema_migrations/20231219044006 @@ -0,0 +1 @@ +d48e67240f21ae70e7bae4d1c28fd2070b82e6415539da302248897847678915
\ No newline at end of file diff --git a/db/schema_migrations/20231219075928 b/db/schema_migrations/20231219075928 new file mode 100644 index 00000000000..757bf662643 --- /dev/null +++ b/db/schema_migrations/20231219075928 @@ -0,0 +1 @@ +0d77fa753395582bb945114b4eaab0526b1cb13ee7b950f15f54321f3bac5429
\ No newline at end of file diff --git a/db/schema_migrations/20231219075929 b/db/schema_migrations/20231219075929 new file mode 100644 index 00000000000..60873b5661b --- /dev/null +++ b/db/schema_migrations/20231219075929 @@ -0,0 +1 @@ +874081aece1c10b0bd12ddfe0c51eef8426dc60d79f008b803126a357029baa5
\ No newline at end of file diff --git a/db/schema_migrations/20231219083804 b/db/schema_migrations/20231219083804 new file mode 100644 index 00000000000..16affe35253 --- /dev/null +++ b/db/schema_migrations/20231219083804 @@ -0,0 +1 @@ +2350d314c570dc9c3264376293b81fa41c3340fce2a4e5e1ea149bc205b408e7
\ No newline at end of file diff --git a/db/schema_migrations/20231219084159 b/db/schema_migrations/20231219084159 new file mode 100644 index 00000000000..04466847fdf --- /dev/null +++ b/db/schema_migrations/20231219084159 @@ -0,0 +1 @@ +e724aa0b32b88a291d2683612ba480977b7270a7c0552d677e7fc13ea829a669
\ No newline at end of file diff --git a/db/schema_migrations/20231219091924 b/db/schema_migrations/20231219091924 new file mode 100644 index 00000000000..8d40c0bee5d --- /dev/null +++ b/db/schema_migrations/20231219091924 @@ -0,0 +1 @@ +504031e71241bfe0b9ac4fac44c0ec590001f955bb217b00698ef99d604deafd
\ No newline at end of file diff --git a/db/schema_migrations/20231219092400 b/db/schema_migrations/20231219092400 new file mode 100644 index 00000000000..c0ceeea9e7c --- /dev/null +++ b/db/schema_migrations/20231219092400 @@ -0,0 +1 @@ +dc5f49083a0a26e15a32b67112ddcddef5f655a55a7691bf4807ad9cb99e7ea9
\ No newline at end of file diff --git a/db/schema_migrations/20231219120134 b/db/schema_migrations/20231219120134 deleted file mode 100644 index 3114ed90125..00000000000 --- a/db/schema_migrations/20231219120134 +++ /dev/null @@ -1 +0,0 @@ -2d70891e636bdd68f5a3827e57cb3013cdcd92e9e2f3556ca9bbd04f2099b182
\ No newline at end of file diff --git a/db/schema_migrations/20231219125907 b/db/schema_migrations/20231219125907 new file mode 100644 index 00000000000..e1b21ac65de --- /dev/null +++ b/db/schema_migrations/20231219125907 @@ -0,0 +1 @@ +91251dddd4dd52f79f48560f6fe81cb52bb30103c1a1441d772c771e853a7f06
\ No newline at end of file diff --git a/db/schema_migrations/20231219132423 b/db/schema_migrations/20231219132423 new file mode 100644 index 00000000000..82fb1923c91 --- /dev/null +++ b/db/schema_migrations/20231219132423 @@ -0,0 +1 @@ +ed2b44c085d02dfb5e361f3f33dd62b9b5fed0e3ae570ff79936feadad66561a
\ No newline at end of file diff --git a/db/schema_migrations/20231220094609 b/db/schema_migrations/20231220094609 new file mode 100644 index 00000000000..30ece81d4a0 --- /dev/null +++ b/db/schema_migrations/20231220094609 @@ -0,0 +1 @@ +aab891f39866b4933cadd8295ecaa1c9f8a256cda832b734dfb1911580187bf3
\ No newline at end of file diff --git a/db/schema_migrations/20231220113459 b/db/schema_migrations/20231220113459 new file mode 100644 index 00000000000..8fcdc421c90 --- /dev/null +++ b/db/schema_migrations/20231220113459 @@ -0,0 +1 @@ +c43fa7c8d3fc0bca232dd7ff9c44e6c9f0972732ce42f5ff5de41fda2039bf9d
\ No newline at end of file diff --git a/db/schema_migrations/20231220115201 b/db/schema_migrations/20231220115201 new file mode 100644 index 00000000000..7e9b465886a --- /dev/null +++ b/db/schema_migrations/20231220115201 @@ -0,0 +1 @@ +f2807c3b967b165f064a3ef398e44d6de630b33ac34506d08908dbce7f47721b
\ No newline at end of file diff --git a/db/schema_migrations/20231220130725 b/db/schema_migrations/20231220130725 new file mode 100644 index 00000000000..85a0fbfc47d --- /dev/null +++ b/db/schema_migrations/20231220130725 @@ -0,0 +1 @@ +a331c4c68080c60637b361b1778d840c367e1fe3dd1d588476a8a00fb5001389
\ No newline at end of file diff --git a/db/schema_migrations/20231220150143 b/db/schema_migrations/20231220150143 new file mode 100644 index 00000000000..0299e34678b --- /dev/null +++ b/db/schema_migrations/20231220150143 @@ -0,0 +1 @@ +616c478d4960da8fe2127bc10ac986e7e274188ba44b3f1c74f846bef73c7e40
\ No newline at end of file diff --git a/db/schema_migrations/20231220150210 b/db/schema_migrations/20231220150210 new file mode 100644 index 00000000000..1e8a7ebe876 --- /dev/null +++ b/db/schema_migrations/20231220150210 @@ -0,0 +1 @@ +f367b751ecccd877dd24b859669aaf66fbee85962e857ae6a20e4762e4f40348
\ No newline at end of file diff --git a/db/schema_migrations/20231221000703 b/db/schema_migrations/20231221000703 new file mode 100644 index 00000000000..09d015f235d --- /dev/null +++ b/db/schema_migrations/20231221000703 @@ -0,0 +1 @@ +77f61a80bf0129e5561f7452ae216aa76d96ee61b516a1882eb065cde63fd9d2
\ No newline at end of file diff --git a/db/schema_migrations/20231221033539 b/db/schema_migrations/20231221033539 new file mode 100644 index 00000000000..6056121cac1 --- /dev/null +++ b/db/schema_migrations/20231221033539 @@ -0,0 +1 @@ +4493149bdc2db628180768717ebea209665e2311c6ce08269a6985ac643017c2
\ No newline at end of file diff --git a/db/schema_migrations/20231221113948 b/db/schema_migrations/20231221113948 new file mode 100644 index 00000000000..e5ec2807cc2 --- /dev/null +++ b/db/schema_migrations/20231221113948 @@ -0,0 +1 @@ +1403f5bcc26c0f8b76f27b77305fc4089c87cf06362c3c9919a71dd3efcee492
\ No newline at end of file diff --git a/db/schema_migrations/20231221171135 b/db/schema_migrations/20231221171135 new file mode 100644 index 00000000000..9fe93b8301a --- /dev/null +++ b/db/schema_migrations/20231221171135 @@ -0,0 +1 @@ +b03eee7eff8f7402f3c590b6ae2010c6c278aaa433db52d444a60357bbd8b582
\ No newline at end of file diff --git a/db/schema_migrations/20231221223259 b/db/schema_migrations/20231221223259 new file mode 100644 index 00000000000..bad7426d672 --- /dev/null +++ b/db/schema_migrations/20231221223259 @@ -0,0 +1 @@ +8486c7e03ce00647f110c03d912728dd140911179da871af0ae8bf521b22dccb
\ No newline at end of file diff --git a/db/schema_migrations/20231222051050 b/db/schema_migrations/20231222051050 new file mode 100644 index 00000000000..9b94b45c2fd --- /dev/null +++ b/db/schema_migrations/20231222051050 @@ -0,0 +1 @@ +b99645404537df761bcb4deb8c4f9745c6b54eec3a27b346ccc2a1a44c46f93d
\ No newline at end of file diff --git a/db/schema_migrations/20231222071942 b/db/schema_migrations/20231222071942 new file mode 100644 index 00000000000..cc33e2239e2 --- /dev/null +++ b/db/schema_migrations/20231222071942 @@ -0,0 +1 @@ +187b2c6e79e0f9e4636923f646ef9b5b5c609cb1797dac6265a1aa12e2a46f31
\ No newline at end of file diff --git a/db/schema_migrations/20231222072237 b/db/schema_migrations/20231222072237 new file mode 100644 index 00000000000..4c71203247b --- /dev/null +++ b/db/schema_migrations/20231222072237 @@ -0,0 +1 @@ +c92fb56354f4471103cb34f0a49294961a221dde5ecea72b0f132fdd1c813095
\ No newline at end of file diff --git a/db/schema_migrations/20231222114515 b/db/schema_migrations/20231222114515 new file mode 100644 index 00000000000..d125ae37515 --- /dev/null +++ b/db/schema_migrations/20231222114515 @@ -0,0 +1 @@ +aef5aa17951e254ad86fcfd59ade64fd98be484094fc5c25a6a941649f66ebc3
\ No newline at end of file diff --git a/db/schema_migrations/20231224083824 b/db/schema_migrations/20231224083824 new file mode 100644 index 00000000000..bd514723679 --- /dev/null +++ b/db/schema_migrations/20231224083824 @@ -0,0 +1 @@ +d8cfd6b59da7a32b86aedaf1f6780774f7b70bc6a8cf675d91a63c4cc6dd94ea
\ No newline at end of file diff --git a/db/schema_migrations/20231225070431 b/db/schema_migrations/20231225070431 new file mode 100644 index 00000000000..7cbc466473b --- /dev/null +++ b/db/schema_migrations/20231225070431 @@ -0,0 +1 @@ +1298d9dd3c6b909a3129b5375477b466b7970347cf65d0654bf3076f87658fd0
\ No newline at end of file diff --git a/db/schema_migrations/20231225133628 b/db/schema_migrations/20231225133628 new file mode 100644 index 00000000000..9206474b258 --- /dev/null +++ b/db/schema_migrations/20231225133628 @@ -0,0 +1 @@ +6d00c9672b913437f6e4afaef24c32b46d189e34502659dc3f92b1b6b13cff2a
\ No newline at end of file diff --git a/db/schema_migrations/20231226052618 b/db/schema_migrations/20231226052618 new file mode 100644 index 00000000000..17ec0a0a14c --- /dev/null +++ b/db/schema_migrations/20231226052618 @@ -0,0 +1 @@ +0e9e483ca16b138808a027ca82ee985945a95bb053ce94ee1a7ad05bf51757de
\ No newline at end of file diff --git a/db/schema_migrations/20231227090634 b/db/schema_migrations/20231227090634 new file mode 100644 index 00000000000..aa1ca5b8daf --- /dev/null +++ b/db/schema_migrations/20231227090634 @@ -0,0 +1 @@ +7cb103ff2494501217565a4a33280ecb3be0d5e3c02c18d4d7f754c694ac4c6b
\ No newline at end of file diff --git a/db/schema_migrations/20231227103059 b/db/schema_migrations/20231227103059 new file mode 100644 index 00000000000..50f5df69ad5 --- /dev/null +++ b/db/schema_migrations/20231227103059 @@ -0,0 +1 @@ +d9f963d252141e1fe5bab5dd8f6b67964253788771d45bf343459014864919b5
\ No newline at end of file diff --git a/db/schema_migrations/20231227104408 b/db/schema_migrations/20231227104408 new file mode 100644 index 00000000000..1ac79ac87b1 --- /dev/null +++ b/db/schema_migrations/20231227104408 @@ -0,0 +1 @@ +ffeb813c94ff0fdefae162e32f56083125248e8b3f34535f9f4252dcb09b1412
\ No newline at end of file diff --git a/db/schema_migrations/20231227104711 b/db/schema_migrations/20231227104711 new file mode 100644 index 00000000000..006bb2e1865 --- /dev/null +++ b/db/schema_migrations/20231227104711 @@ -0,0 +1 @@ +22e7c4fe8821e07a6ec5c48c32007849faa673eee203689dd51753bf38004077
\ No newline at end of file diff --git a/db/schema_migrations/20231228043653 b/db/schema_migrations/20231228043653 new file mode 100644 index 00000000000..1b5983ef534 --- /dev/null +++ b/db/schema_migrations/20231228043653 @@ -0,0 +1 @@ +a2b8c055b7ac4d4f4a3a6927061b268ab6f45e17df4363b65e01041274fed09f
\ No newline at end of file diff --git a/db/schema_migrations/20231229112819 b/db/schema_migrations/20231229112819 new file mode 100644 index 00000000000..5b183bf6ac7 --- /dev/null +++ b/db/schema_migrations/20231229112819 @@ -0,0 +1 @@ +8afd047b9b3b3f71aad56617592f3657b0da6bae22bf20ff58d9d2cc84c90c14
\ No newline at end of file diff --git a/db/schema_migrations/20240101031938 b/db/schema_migrations/20240101031938 new file mode 100644 index 00000000000..5b9395a568f --- /dev/null +++ b/db/schema_migrations/20240101031938 @@ -0,0 +1 @@ +d0cb92dc098f069e02d457f7c497dc24f544f6a27a8426dcd3446ad16bd9cc44
\ No newline at end of file diff --git a/db/schema_migrations/20240101133628 b/db/schema_migrations/20240101133628 new file mode 100644 index 00000000000..129206c5564 --- /dev/null +++ b/db/schema_migrations/20240101133628 @@ -0,0 +1 @@ +61b8bed56b1aa5fbce448cc8b90ec863801fbffb0a81f857ce512052f47ba1cb
\ No newline at end of file diff --git a/db/schema_migrations/20240102065444 b/db/schema_migrations/20240102065444 new file mode 100644 index 00000000000..5f5db30dc4e --- /dev/null +++ b/db/schema_migrations/20240102065444 @@ -0,0 +1 @@ +e3fce3184c7e9c3e84e73caeaee94ab14dafc46c046e8477d5762b3d41a11a02
\ No newline at end of file diff --git a/db/schema_migrations/20240102101409 b/db/schema_migrations/20240102101409 new file mode 100644 index 00000000000..b125c4f6cb8 --- /dev/null +++ b/db/schema_migrations/20240102101409 @@ -0,0 +1 @@ +6b9244a1ef9a87f192548bde7346e1b6b18d036ca14dcbde04046842d461dc36
\ No newline at end of file diff --git a/db/schema_migrations/20240102184844 b/db/schema_migrations/20240102184844 new file mode 100644 index 00000000000..8b8a099bc2d --- /dev/null +++ b/db/schema_migrations/20240102184844 @@ -0,0 +1 @@ +6afdff39b79900760124493eaa5a7ab8c15f81e77f024338352eeff731479e34
\ No newline at end of file diff --git a/db/schema_migrations/20240103200822 b/db/schema_migrations/20240103200822 new file mode 100644 index 00000000000..896e75a009b --- /dev/null +++ b/db/schema_migrations/20240103200822 @@ -0,0 +1 @@ +7b4f74933360df0a49d44f0738922b0929b62f23aa60a36a5ae24c88a2857638
\ No newline at end of file diff --git a/db/schema_migrations/20240103202629 b/db/schema_migrations/20240103202629 new file mode 100644 index 00000000000..c2151c9fcd5 --- /dev/null +++ b/db/schema_migrations/20240103202629 @@ -0,0 +1 @@ +f5c40748ac911a2ee151a36b1a15d8080c4948e0439d25b791db2bb0ae57f7d9
\ No newline at end of file diff --git a/db/schema_migrations/20240103203314 b/db/schema_migrations/20240103203314 new file mode 100644 index 00000000000..ebb3382d1a9 --- /dev/null +++ b/db/schema_migrations/20240103203314 @@ -0,0 +1 @@ +9a638b98580e144b7a3e7ad6fc0833531ff63fbd94476310604f1581c8625200
\ No newline at end of file diff --git a/db/schema_migrations/20240104085448 b/db/schema_migrations/20240104085448 new file mode 100644 index 00000000000..a73b6a090a3 --- /dev/null +++ b/db/schema_migrations/20240104085448 @@ -0,0 +1 @@ +57e5c890ac0ebb837a5894b09717322c2053694cc4a91270508a652f091e457c
\ No newline at end of file diff --git a/db/schema_migrations/20240104091627 b/db/schema_migrations/20240104091627 new file mode 100644 index 00000000000..c0a036c1ca1 --- /dev/null +++ b/db/schema_migrations/20240104091627 @@ -0,0 +1 @@ +90614e8c6d73455b96dc7c4652b529ffa844d704fe8e7729e97b4ac557edb423
\ No newline at end of file diff --git a/db/schema_migrations/20240104091858 b/db/schema_migrations/20240104091858 new file mode 100644 index 00000000000..157773a26b5 --- /dev/null +++ b/db/schema_migrations/20240104091858 @@ -0,0 +1 @@ +991849159d57b5bd6d0d0d671f766c715b23a8e04c3130e56e2b6a05a27f49d6
\ No newline at end of file diff --git a/db/schema_migrations/20240104101601 b/db/schema_migrations/20240104101601 new file mode 100644 index 00000000000..06c9bee807e --- /dev/null +++ b/db/schema_migrations/20240104101601 @@ -0,0 +1 @@ +729cc1d2d73610b8e1a8efec30635dded7c85ece9afdc40e24ed60ddd82c4068
\ No newline at end of file diff --git a/db/schema_migrations/20240104124057 b/db/schema_migrations/20240104124057 new file mode 100644 index 00000000000..88084f82ad8 --- /dev/null +++ b/db/schema_migrations/20240104124057 @@ -0,0 +1 @@ +ce45b0df0c8c6a511e28710155d219631bda8cacadbec05d4a9ef20816d45690
\ No newline at end of file diff --git a/db/schema_migrations/20240104145320 b/db/schema_migrations/20240104145320 new file mode 100644 index 00000000000..a905ae8adc5 --- /dev/null +++ b/db/schema_migrations/20240104145320 @@ -0,0 +1 @@ +5770b4f7e65affa2769423c1cd9cdbbe5a8c8f0fa465be4d9a017c54ca56c804
\ No newline at end of file diff --git a/db/schema_migrations/20240104150106 b/db/schema_migrations/20240104150106 new file mode 100644 index 00000000000..d2e7dbf0590 --- /dev/null +++ b/db/schema_migrations/20240104150106 @@ -0,0 +1 @@ +e6829ae7a671ff2c13c78721c9304bcbaa7738aea01d8e83aeac79d0da2d2a47
\ No newline at end of file diff --git a/db/schema_migrations/20240104155616 b/db/schema_migrations/20240104155616 new file mode 100644 index 00000000000..b30a2a3aba4 --- /dev/null +++ b/db/schema_migrations/20240104155616 @@ -0,0 +1 @@ +167d6118d2c7ccd83662af4304e543163043a962c66d67d338d3852ba36b53a8
\ No newline at end of file diff --git a/db/schema_migrations/20240104191736 b/db/schema_migrations/20240104191736 new file mode 100644 index 00000000000..8072f3c5bfa --- /dev/null +++ b/db/schema_migrations/20240104191736 @@ -0,0 +1 @@ +92f7eddc8ba255987adc42e1140b47256c62235762f431ba8047561f120004dc
\ No newline at end of file diff --git a/db/schema_migrations/20240104191802 b/db/schema_migrations/20240104191802 new file mode 100644 index 00000000000..36ad8605992 --- /dev/null +++ b/db/schema_migrations/20240104191802 @@ -0,0 +1 @@ +eb3a7d14833470fe74420874ed883428d54a4d1a24a7f131f2049bf2f7efa929
\ No newline at end of file diff --git a/db/schema_migrations/20240104223119 b/db/schema_migrations/20240104223119 new file mode 100644 index 00000000000..af271c3ce80 --- /dev/null +++ b/db/schema_migrations/20240104223119 @@ -0,0 +1 @@ +835c483008b589033f825535c381b963d5c20b2aa00f849376e05b69864f68ff
\ No newline at end of file diff --git a/db/schema_migrations/20240105000000 b/db/schema_migrations/20240105000000 new file mode 100644 index 00000000000..5d7b53970b7 --- /dev/null +++ b/db/schema_migrations/20240105000000 @@ -0,0 +1 @@ +5fd81c2408e7e4ae564b719702b69e7645fb84822e77d2aee9eb284a68daf1dd
\ No newline at end of file diff --git a/db/schema_migrations/20240105000001 b/db/schema_migrations/20240105000001 new file mode 100644 index 00000000000..45bc8d78c16 --- /dev/null +++ b/db/schema_migrations/20240105000001 @@ -0,0 +1 @@ +7a53aa32b606bb1ae2b2816fe50d2ef57eb899fefc7dfd1ad558da36898a3155
\ No newline at end of file diff --git a/db/schema_migrations/20240105120320 b/db/schema_migrations/20240105120320 new file mode 100644 index 00000000000..0c06c3ce42a --- /dev/null +++ b/db/schema_migrations/20240105120320 @@ -0,0 +1 @@ +f56668c85ef90efb1c4ef4e959ed23803670c164c557baa0bc3dc1241d55f002
\ No newline at end of file diff --git a/db/schema_migrations/20240105144908 b/db/schema_migrations/20240105144908 new file mode 100644 index 00000000000..5183b5b9aac --- /dev/null +++ b/db/schema_migrations/20240105144908 @@ -0,0 +1 @@ +a86ea4736f6f0357c78535111468a273e61b742d5b5b3ddc09fe5177e1bc77c8
\ No newline at end of file diff --git a/db/schema_migrations/20240107084243 b/db/schema_migrations/20240107084243 new file mode 100644 index 00000000000..3f7ad20dab7 --- /dev/null +++ b/db/schema_migrations/20240107084243 @@ -0,0 +1 @@ +b6c62664a45db815b8e2a924255214269b70e6af2bb0c909eee774f1d33c6397
\ No newline at end of file diff --git a/db/schema_migrations/20240107154747 b/db/schema_migrations/20240107154747 new file mode 100644 index 00000000000..303b6bd9e73 --- /dev/null +++ b/db/schema_migrations/20240107154747 @@ -0,0 +1 @@ +066ff822fdc28dc62946b40c0b954d351c9bc55e83d5993bd2b35c4cecfe61f6
\ No newline at end of file diff --git a/db/schema_migrations/20240107154805 b/db/schema_migrations/20240107154805 new file mode 100644 index 00000000000..11470faaa54 --- /dev/null +++ b/db/schema_migrations/20240107154805 @@ -0,0 +1 @@ +bae4fbcf7cc5217663a630deed0adc509f3386921a84fffa06adef603a9bf378
\ No newline at end of file diff --git a/db/schema_migrations/20240108072319 b/db/schema_migrations/20240108072319 new file mode 100644 index 00000000000..8f82a6baf77 --- /dev/null +++ b/db/schema_migrations/20240108072319 @@ -0,0 +1 @@ +67af5f06d58f67d7ce0f27c8fd5eb0856772b98443a59cd077b076494fed6634
\ No newline at end of file diff --git a/db/schema_migrations/20240108072546 b/db/schema_migrations/20240108072546 new file mode 100644 index 00000000000..997e37dba92 --- /dev/null +++ b/db/schema_migrations/20240108072546 @@ -0,0 +1 @@ +981e263b0c9715324d86ed29534465ebcf2d37c8bb9e5dc0d93b9abf11f264d4
\ No newline at end of file diff --git a/db/schema_migrations/20240108082419 b/db/schema_migrations/20240108082419 new file mode 100644 index 00000000000..8286b90e678 --- /dev/null +++ b/db/schema_migrations/20240108082419 @@ -0,0 +1 @@ +273a951feb99c6064529c3a4403210ec0ff4a0be41867b7b90809b89fd767f5d
\ No newline at end of file diff --git a/db/schema_migrations/20240108121335 b/db/schema_migrations/20240108121335 new file mode 100644 index 00000000000..a8a63cc44c9 --- /dev/null +++ b/db/schema_migrations/20240108121335 @@ -0,0 +1 @@ +42975addff21ed60838f893a447055317aa08aad7b792205385dc4e06c7c523a
\ No newline at end of file diff --git a/db/schema_migrations/20240108123023 b/db/schema_migrations/20240108123023 new file mode 100644 index 00000000000..3121a9de1ea --- /dev/null +++ b/db/schema_migrations/20240108123023 @@ -0,0 +1 @@ +14f34f294f2f88e3382c21e26752873766480f8dd313bb4f7e796cb2c01a2f2d
\ No newline at end of file diff --git a/db/schema_migrations/20240108123115 b/db/schema_migrations/20240108123115 new file mode 100644 index 00000000000..10aaf05b98e --- /dev/null +++ b/db/schema_migrations/20240108123115 @@ -0,0 +1 @@ +9fbdcc42735c36b490b35bba4db635c1d92497b844ee2685be6849581f18d92d
\ No newline at end of file diff --git a/db/schema_migrations/20240108123509 b/db/schema_migrations/20240108123509 new file mode 100644 index 00000000000..1327c9c7a7c --- /dev/null +++ b/db/schema_migrations/20240108123509 @@ -0,0 +1 @@ +df7e3487d37067b55d0894e15774a48d94ea581ee463de2dece8a3ef6584a7a5
\ No newline at end of file diff --git a/db/schema_migrations/20240108125135 b/db/schema_migrations/20240108125135 new file mode 100644 index 00000000000..c69a67409ee --- /dev/null +++ b/db/schema_migrations/20240108125135 @@ -0,0 +1 @@ +31083622ee26968a55a6cf84608e2f13ada6a142a8bd302b5f39bbd6facb911a
\ No newline at end of file diff --git a/db/schema_migrations/20240108125335 b/db/schema_migrations/20240108125335 new file mode 100644 index 00000000000..194113c1076 --- /dev/null +++ b/db/schema_migrations/20240108125335 @@ -0,0 +1 @@ +37a95779658d4c814f64f6f6b1909b79fa3b55f90d93581fa09a2f5d7a600c99
\ No newline at end of file diff --git a/db/schema_migrations/20240108181808 b/db/schema_migrations/20240108181808 new file mode 100644 index 00000000000..542a576fdf1 --- /dev/null +++ b/db/schema_migrations/20240108181808 @@ -0,0 +1 @@ +688603d4b31b17d1eeb133e293876aae77ab68b80f656fb9b902ca38d4c7beed
\ No newline at end of file diff --git a/db/schema_migrations/20240108185335 b/db/schema_migrations/20240108185335 new file mode 100644 index 00000000000..824b9fc59a4 --- /dev/null +++ b/db/schema_migrations/20240108185335 @@ -0,0 +1 @@ +522d57a8594965ee9756ec4f0fe6f66515348a4b99606607b781ffd177982427
\ No newline at end of file diff --git a/db/schema_migrations/20240108215335 b/db/schema_migrations/20240108215335 new file mode 100644 index 00000000000..8f9df917d12 --- /dev/null +++ b/db/schema_migrations/20240108215335 @@ -0,0 +1 @@ +57d6347cfbd9169fe7a104b493632492dc1bb32729a761354feed79a886eecf6
\ No newline at end of file diff --git a/db/schema_migrations/20240109025151 b/db/schema_migrations/20240109025151 new file mode 100644 index 00000000000..d6d47f823e2 --- /dev/null +++ b/db/schema_migrations/20240109025151 @@ -0,0 +1 @@ +b40f751b4b06dd94de38e3fa260e07e56359828ca1ae1799ca4d65bd873fa8af
\ No newline at end of file diff --git a/db/schema_migrations/20240109082354 b/db/schema_migrations/20240109082354 new file mode 100644 index 00000000000..37ffffb7267 --- /dev/null +++ b/db/schema_migrations/20240109082354 @@ -0,0 +1 @@ +b264b391bc50ede33db98df9e1e54a074c850e2e4af0c5bd380ce1f32646c95b
\ No newline at end of file diff --git a/db/schema_migrations/20240109090354 b/db/schema_migrations/20240109090354 new file mode 100644 index 00000000000..26f68dd746a --- /dev/null +++ b/db/schema_migrations/20240109090354 @@ -0,0 +1 @@ +7420ebb45a2ef0f82527b7427ec741bf8807efb966c317a9fedfda5c04fb4947
\ No newline at end of file diff --git a/db/schema_migrations/20240109145839 b/db/schema_migrations/20240109145839 new file mode 100644 index 00000000000..0657c41254a --- /dev/null +++ b/db/schema_migrations/20240109145839 @@ -0,0 +1 @@ +6b33ceb05ab45bd0a13cd6706a9cf006f756574a08152ab6de87ff840f56b95d
\ No newline at end of file diff --git a/db/schema_migrations/20240109165047 b/db/schema_migrations/20240109165047 new file mode 100644 index 00000000000..245a4a009aa --- /dev/null +++ b/db/schema_migrations/20240109165047 @@ -0,0 +1 @@ +026e113720d6920cefc0ad6b894930ce486abe043568d6dde1d047b679dd8b44
\ No newline at end of file diff --git a/db/schema_migrations/20240110085226 b/db/schema_migrations/20240110085226 new file mode 100644 index 00000000000..35e3cc7237a --- /dev/null +++ b/db/schema_migrations/20240110085226 @@ -0,0 +1 @@ +9c9eb37365dae73fb68000d18675a280e063711eaed8f96f64724bff20326957
\ No newline at end of file diff --git a/db/schema_migrations/20240110090352 b/db/schema_migrations/20240110090352 new file mode 100644 index 00000000000..836d868f513 --- /dev/null +++ b/db/schema_migrations/20240110090352 @@ -0,0 +1 @@ +cc4ea0747894b9e896c888c9c7ba8bbae2aea8aa55041ac4b8a0be18b5b38908
\ No newline at end of file diff --git a/db/schema_migrations/20240110093654 b/db/schema_migrations/20240110093654 new file mode 100644 index 00000000000..1c5f4a1208d --- /dev/null +++ b/db/schema_migrations/20240110093654 @@ -0,0 +1 @@ +41964f40e257d2d7fb0427f7f2911ea0857d67f51e9a1f4ed26d36d42394dd19
\ No newline at end of file diff --git a/db/schema_migrations/20240110094002 b/db/schema_migrations/20240110094002 new file mode 100644 index 00000000000..5b6fcb1080a --- /dev/null +++ b/db/schema_migrations/20240110094002 @@ -0,0 +1 @@ +ec56796b8c3514380e716259119e7def5a958e7bfade25c69e3c99ffd52a265f
\ No newline at end of file diff --git a/db/schema_migrations/20240110094510 b/db/schema_migrations/20240110094510 new file mode 100644 index 00000000000..e533dc38912 --- /dev/null +++ b/db/schema_migrations/20240110094510 @@ -0,0 +1 @@ +6ed6cfa3e8b8b8fdbfacadcdff55dda07365f113d4f84e33c6bab878352cda11
\ No newline at end of file diff --git a/db/schema_migrations/20240110132029 b/db/schema_migrations/20240110132029 new file mode 100644 index 00000000000..e707c5a4112 --- /dev/null +++ b/db/schema_migrations/20240110132029 @@ -0,0 +1 @@ +ac490ec281f23857fa6300678404895b20fbc60d9bc6ed22c46189df371f90d6
\ No newline at end of file diff --git a/db/schema_migrations/20240111134328 b/db/schema_migrations/20240111134328 new file mode 100644 index 00000000000..268782c5acc --- /dev/null +++ b/db/schema_migrations/20240111134328 @@ -0,0 +1 @@ +0fc191808377dfe56ece157bc9d44899ce8635260e894972f2d058822707b080
\ No newline at end of file diff --git a/db/schema_migrations/20240115115029 b/db/schema_migrations/20240115115029 new file mode 100644 index 00000000000..e1bac290b9c --- /dev/null +++ b/db/schema_migrations/20240115115029 @@ -0,0 +1 @@ +3ee5c98adb3daf33f58732e29ab7537d3cf2309bf0eaf15f503482d135a7fcd8
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index ac62920288a..7d07dfd2287 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -577,6 +577,15 @@ BEGIN END; $$; +CREATE FUNCTION trigger_ff16c1fd43ea() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."geo_event_id_convert_to_bigint" := NEW."geo_event_id"; + RETURN NEW; +END; +$$; + CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -2517,6 +2526,304 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_63 ( namespace_id bigint ); +CREATE TABLE namespace_descendants ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +) +PARTITION BY HASH (namespace_id); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_00 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_01 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_02 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_03 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_04 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_05 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_06 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_07 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_08 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_09 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_10 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_11 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_12 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_13 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_14 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_15 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_16 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_17 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_18 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_19 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_20 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_21 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_22 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_23 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_24 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_25 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_26 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_27 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_28 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_29 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_30 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + +CREATE TABLE gitlab_partitions_static.namespace_descendants_31 ( + namespace_id bigint NOT NULL, + self_and_descendant_group_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + all_project_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + traversal_ids bigint[] DEFAULT ARRAY[]::bigint[] NOT NULL, + outdated_at timestamp with time zone, + calculated_at timestamp with time zone +); + CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, project_id integer NOT NULL, @@ -11370,6 +11677,45 @@ CREATE SEQUENCE agent_user_access_project_authorizations_id_seq ALTER SEQUENCE agent_user_access_project_authorizations_id_seq OWNED BY agent_user_access_project_authorizations.id; +CREATE TABLE ai_agent_versions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + agent_id bigint NOT NULL, + prompt text NOT NULL, + model text NOT NULL, + CONSTRAINT check_8cda7448e9 CHECK ((char_length(model) <= 255)), + CONSTRAINT check_d7a4fc9834 CHECK ((char_length(prompt) <= 5000)) +); + +CREATE SEQUENCE ai_agent_versions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ai_agent_versions_id_seq OWNED BY ai_agent_versions.id; + +CREATE TABLE ai_agents ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_67934c8e85 CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE ai_agents_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ai_agents_id_seq OWNED BY ai_agents.id; + CREATE TABLE alert_management_alert_assignees ( id bigint NOT NULL, user_id bigint NOT NULL, @@ -11776,6 +12122,7 @@ CREATE TABLE application_settings ( session_expire_delay integer DEFAULT 10080 NOT NULL, import_sources text, help_page_text text, + require_admin_two_factor_authentication boolean DEFAULT false NOT NULL, shared_runners_enabled boolean DEFAULT true NOT NULL, max_artifacts_size integer DEFAULT 100 NOT NULL, runners_registration_token character varying, @@ -12284,6 +12631,9 @@ CREATE TABLE application_settings ( encrypted_arkose_labs_data_exchange_key_iv bytea, toggle_security_policy_custom_ci boolean DEFAULT false NOT NULL, lock_toggle_security_policy_custom_ci boolean DEFAULT false NOT NULL, + toggle_security_policies_policy_scope boolean DEFAULT false NOT NULL, + lock_toggle_security_policies_policy_scope boolean DEFAULT false NOT NULL, + rate_limits jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_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)), @@ -12334,6 +12684,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_ae53cf7f82 CHECK ((char_length(vertex_ai_host) <= 255)), CONSTRAINT check_app_settings_namespace_storage_forks_cost_factor_range CHECK (((namespace_storage_forks_cost_factor >= (0)::double precision) AND (namespace_storage_forks_cost_factor <= (1)::double precision))), CONSTRAINT check_app_settings_sentry_clientside_traces_sample_rate_range CHECK (((sentry_clientside_traces_sample_rate >= (0)::double precision) AND (sentry_clientside_traces_sample_rate <= (1)::double precision))), + CONSTRAINT check_application_settings_rate_limits_is_hash CHECK ((jsonb_typeof(rate_limits) = 'object'::text)), CONSTRAINT check_b8c74ea5b3 CHECK ((char_length(deactivation_email_additional_text) <= 1000)), CONSTRAINT check_cdfbd99405 CHECK ((char_length(security_txt_content) <= 2048)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), @@ -13979,28 +14330,6 @@ CREATE SEQUENCE ci_deleted_objects_id_seq ALTER SEQUENCE ci_deleted_objects_id_seq OWNED BY ci_deleted_objects.id; -CREATE TABLE ci_editor_ai_conversation_messages ( - id bigint NOT NULL, - user_id bigint NOT NULL, - project_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - role text NOT NULL, - content text, - async_errors text[] DEFAULT '{}'::text[] NOT NULL, - CONSTRAINT check_10b793171f CHECK ((char_length(role) <= 100)), - CONSTRAINT check_c83d789632 CHECK ((char_length(content) <= 16384)) -); - -CREATE SEQUENCE ci_editor_ai_conversation_messages_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE ci_editor_ai_conversation_messages_id_seq OWNED BY ci_editor_ai_conversation_messages.id; - CREATE TABLE ci_freeze_periods ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -14058,9 +14387,11 @@ CREATE TABLE ci_instance_variables ( encrypted_value text, encrypted_value_iv text, raw boolean DEFAULT false NOT NULL, + description text, CONSTRAINT check_07a45a5bcb CHECK ((char_length(encrypted_value_iv) <= 255)), CONSTRAINT check_5aede12208 CHECK ((char_length(key) <= 255)), - CONSTRAINT check_956afd70f1 CHECK ((char_length(encrypted_value) <= 13579)) + CONSTRAINT check_956afd70f1 CHECK ((char_length(encrypted_value) <= 13579)), + CONSTRAINT check_a0a9762afa CHECK ((char_length(description) <= 255)) ); CREATE SEQUENCE ci_instance_variables_id_seq @@ -14268,6 +14599,7 @@ CREATE TABLE ci_pipeline_artifacts ( verification_checksum bytea, verification_failure text, locked smallint DEFAULT 2, + partition_id bigint DEFAULT 100 NOT NULL, CONSTRAINT check_191b5850ec CHECK ((char_length(file) <= 255)), CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)), CONSTRAINT ci_pipeline_artifacts_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) @@ -14286,7 +14618,8 @@ CREATE TABLE ci_pipeline_chat_data ( id bigint NOT NULL, chat_name_id integer NOT NULL, response_url text NOT NULL, - pipeline_id bigint NOT NULL + pipeline_id bigint NOT NULL, + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_pipeline_chat_data_id_seq @@ -14321,6 +14654,7 @@ CREATE TABLE ci_pipeline_metadata ( name text, auto_cancel_on_new_commit smallint DEFAULT 0 NOT NULL, auto_cancel_on_job_failure smallint DEFAULT 0 NOT NULL, + partition_id bigint DEFAULT 100 NOT NULL, CONSTRAINT check_9d3665463c CHECK ((char_length(name) <= 255)) ); @@ -14429,7 +14763,8 @@ CREATE TABLE ci_pipelines ( CREATE TABLE ci_pipelines_config ( pipeline_id bigint NOT NULL, - content text NOT NULL + content text NOT NULL, + partition_id bigint DEFAULT 100 NOT NULL ); CREATE SEQUENCE ci_pipelines_id_seq @@ -14899,6 +15234,22 @@ CREATE SEQUENCE ci_variables_id_seq ALTER SEQUENCE ci_variables_id_seq OWNED BY ci_variables.id; +CREATE TABLE cloud_connector_access ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + data jsonb NOT NULL +); + +CREATE SEQUENCE cloud_connector_access_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cloud_connector_access_id_seq OWNED BY cloud_connector_access.id; + CREATE TABLE cluster_agent_tokens ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -16534,6 +16885,7 @@ CREATE TABLE epics ( total_closed_issue_weight integer DEFAULT 0 NOT NULL, total_opened_issue_count integer DEFAULT 0 NOT NULL, total_closed_issue_count integer DEFAULT 0 NOT NULL, + issue_id integer, CONSTRAINT check_ca608c40b3 CHECK ((char_length(color) <= 7)), CONSTRAINT check_fcfb4a93ff CHECK ((lock_version IS NOT NULL)) ); @@ -16844,7 +17196,8 @@ CREATE TABLE geo_event_log ( hashed_storage_attachments_event_id bigint, reset_checksum_event_id bigint, cache_invalidation_event_id bigint, - geo_event_id integer + geo_event_id integer, + geo_event_id_convert_to_bigint bigint ); CREATE SEQUENCE geo_event_log_id_seq @@ -17591,27 +17944,6 @@ 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, - series smallint, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - CONSTRAINT check_c9bb978e4b CHECK ((track IS NOT NULL)), - CONSTRAINT check_ee6c42a107 CHECK ((series IS 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, @@ -18662,6 +18994,9 @@ CREATE TABLE member_roles ( admin_group_member boolean DEFAULT false NOT NULL, manage_project_access_tokens boolean DEFAULT false NOT NULL, archive_project boolean DEFAULT false NOT NULL, + manage_group_access_tokens boolean DEFAULT false NOT NULL, + remove_project boolean DEFAULT false NOT NULL, + admin_terraform_state boolean DEFAULT false NOT NULL, CONSTRAINT check_4364846f58 CHECK ((char_length(description) <= 255)), CONSTRAINT check_9907916995 CHECK ((char_length(name) <= 255)) ); @@ -18928,6 +19263,7 @@ CREATE TABLE merge_request_diffs ( diff_type smallint DEFAULT 1 NOT NULL, patch_id_sha bytea, project_id bigint, + CONSTRAINT check_11c5f029ad CHECK ((project_id IS NOT NULL)), CONSTRAINT check_93ee616ac9 CHECK ((external_diff_store IS NOT NULL)) ); @@ -19394,6 +19730,27 @@ CREATE SEQUENCE ml_model_metadata_id_seq ALTER SEQUENCE ml_model_metadata_id_seq OWNED BY ml_model_metadata.id; +CREATE TABLE ml_model_version_metadata ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + model_version_id bigint NOT NULL, + name text NOT NULL, + value text NOT NULL, + CONSTRAINT check_09a0e5cb5b CHECK ((char_length(name) <= 255)), + CONSTRAINT check_21c444e039 CHECK ((char_length(value) <= 5000)) +); + +CREATE SEQUENCE ml_model_version_metadata_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ml_model_version_metadata_id_seq OWNED BY ml_model_version_metadata.id; + CREATE TABLE ml_model_versions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -19545,9 +19902,12 @@ CREATE TABLE namespace_package_settings ( nuget_duplicates_allowed boolean DEFAULT true NOT NULL, nuget_duplicate_exception_regex text DEFAULT ''::text NOT NULL, nuget_symbol_server_enabled boolean DEFAULT false NOT NULL, + terraform_module_duplicates_allowed boolean DEFAULT false NOT NULL, + terraform_module_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)), - CONSTRAINT check_eedcf85c48 CHECK ((char_length(nuget_duplicate_exception_regex) <= 255)) + CONSTRAINT check_eedcf85c48 CHECK ((char_length(nuget_duplicate_exception_regex) <= 255)), + CONSTRAINT check_f10503f1ad CHECK ((char_length(terraform_module_duplicate_exception_regex) <= 255)) ); CREATE TABLE namespace_root_storage_statistics ( @@ -19614,6 +19974,8 @@ CREATE TABLE namespace_settings ( enforce_ssh_certificates boolean DEFAULT false NOT NULL, toggle_security_policy_custom_ci boolean, lock_toggle_security_policy_custom_ci boolean DEFAULT false NOT NULL, + toggle_security_policies_policy_scope boolean, + lock_toggle_security_policies_policy_scope boolean DEFAULT false NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_alertlist_size CHECK ((cardinality(unique_project_download_limit_alertlist) <= 100)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) @@ -20088,7 +20450,8 @@ CREATE TABLE organization_users ( organization_id bigint NOT NULL, user_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL + updated_at timestamp with time zone NOT NULL, + access_level smallint DEFAULT 10 NOT NULL ); CREATE SEQUENCE organization_users_id_seq @@ -22756,7 +23119,8 @@ CREATE TABLE releases ( author_id integer, name character varying, sha character varying, - released_at timestamp with time zone NOT NULL + released_at timestamp with time zone NOT NULL, + release_published_at timestamp with time zone ); CREATE SEQUENCE releases_id_seq @@ -22851,19 +23215,9 @@ ALTER SEQUENCE required_code_owners_sections_id_seq OWNED BY required_code_owner CREATE TABLE requirements ( id bigint NOT NULL, - created_at timestamp with time zone, - updated_at timestamp with time zone, project_id integer NOT NULL, - author_id integer, iid integer NOT NULL, - cached_markdown_version integer, - state smallint DEFAULT 1, - title character varying(255), - title_html text, - description text, - description_html text, issue_id bigint, - CONSTRAINT check_785ae25b9d CHECK ((char_length(description) <= 10000)), CONSTRAINT check_requirement_issue_not_null CHECK ((issue_id IS NOT NULL)) ); @@ -23006,7 +23360,8 @@ CREATE TABLE resource_weight_events ( user_id bigint, issue_id bigint NOT NULL, weight integer, - created_at timestamp with time zone NOT NULL + created_at timestamp with time zone NOT NULL, + previous_weight integer ); CREATE SEQUENCE resource_weight_events_id_seq @@ -23178,6 +23533,7 @@ CREATE TABLE sbom_occurrences ( vulnerabilities jsonb DEFAULT '[]'::jsonb, highest_severity smallint, vulnerability_count integer DEFAULT 0 NOT NULL, + source_package_id bigint, CONSTRAINT check_3f2d2c7ffc CHECK ((char_length(package_manager) <= 255)), CONSTRAINT check_9b29021fa8 CHECK ((char_length(component_name) <= 255)), CONSTRAINT check_bd1367d4c1 CHECK ((char_length(input_file_path) <= 255)) @@ -23209,6 +23565,22 @@ CREATE SEQUENCE sbom_occurrences_vulnerabilities_id_seq ALTER SEQUENCE sbom_occurrences_vulnerabilities_id_seq OWNED BY sbom_occurrences_vulnerabilities.id; +CREATE TABLE sbom_source_packages ( + id bigint NOT NULL, + name text NOT NULL, + purl_type smallint NOT NULL, + CONSTRAINT check_8fba79abed CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE sbom_source_packages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE sbom_source_packages_id_seq OWNED BY sbom_source_packages.id; + CREATE TABLE sbom_sources ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -24264,6 +24636,7 @@ CREATE TABLE timelogs ( project_id integer, summary text, note_id bigint, + timelog_category_id bigint, CONSTRAINT check_271d321699 CHECK ((char_length(summary) <= 255)) ); @@ -24328,6 +24701,8 @@ CREATE TABLE topics ( total_projects_count bigint DEFAULT 0 NOT NULL, non_private_projects_count bigint DEFAULT 0 NOT NULL, title text, + slug text, + CONSTRAINT check_0eda72aeb0 CHECK ((char_length(slug) <= 255)), CONSTRAINT check_223b50f9be CHECK ((char_length(title) <= 255)), CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)), CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)), @@ -24497,20 +24872,13 @@ 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, - expiration_date date, - last_digits smallint, - holder_name text, - network text, last_digits_hash text, holder_name_hash text, expiration_date_hash text, network_hash text, - CONSTRAINT check_1765e2b30f CHECK ((char_length(network) <= 32)), - CONSTRAINT check_3eea080c91 CHECK (((last_digits >= 0) AND (last_digits <= 9999))), CONSTRAINT check_7721e1961a CHECK ((char_length(network_hash) <= 44)), CONSTRAINT check_83f1e2ace3 CHECK ((char_length(expiration_date_hash) <= 44)), CONSTRAINT check_aca7c2607c CHECK ((char_length(holder_name_hash) <= 44)), - CONSTRAINT check_cc0c8dc0fe CHECK ((char_length(holder_name) <= 50)), CONSTRAINT check_f5c35b1a6e CHECK ((char_length(last_digits_hash) <= 44)) ); @@ -24666,6 +25034,8 @@ CREATE TABLE user_phone_number_validations ( country text NOT NULL, phone_number text NOT NULL, telesign_reference_xid text, + sms_sent_at timestamp with time zone, + sms_send_count smallint DEFAULT 0 NOT NULL, CONSTRAINT check_193736da9f CHECK ((char_length(country) <= 3)), CONSTRAINT check_d2f31fc815 CHECK ((char_length(phone_number) <= 12)), CONSTRAINT check_d7af4d3eb5 CHECK ((char_length(telesign_reference_xid) <= 255)) @@ -24890,23 +25260,14 @@ ALTER SEQUENCE vs_code_settings_id_seq OWNED BY vs_code_settings.id; CREATE TABLE vulnerabilities ( id bigint NOT NULL, - milestone_id bigint, - epic_id bigint, project_id bigint NOT NULL, author_id bigint NOT NULL, - updated_by_id bigint, - last_edited_by_id bigint, - start_date date, - due_date date, - last_edited_at timestamp with time zone, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, title character varying(255) NOT NULL, title_html text, description text, description_html text, - start_date_sourcing_milestone_id bigint, - due_date_sourcing_milestone_id bigint, state smallint DEFAULT 1 NOT NULL, severity smallint NOT NULL, severity_overridden boolean DEFAULT false, @@ -25534,6 +25895,15 @@ CREATE SEQUENCE wiki_repository_states_id_seq ALTER SEQUENCE wiki_repository_states_id_seq OWNED BY wiki_repository_states.id; +CREATE TABLE work_item_colors ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + issue_id bigint NOT NULL, + namespace_id bigint NOT NULL, + color text NOT NULL, + CONSTRAINT check_485e19ad7b CHECK ((char_length(color) <= 7)) +); + CREATE TABLE work_item_dates_sources ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, @@ -25702,12 +26072,12 @@ CREATE TABLE workspaces ( config_version integer DEFAULT 1 NOT NULL, force_include_all_resources boolean DEFAULT true NOT NULL, url_prefix text, - url_domain text, url_query_string text, - CONSTRAINT check_03c5d442fd CHECK ((char_length(url_domain) <= 256)), + dns_zone text, CONSTRAINT check_15543fb0fa CHECK ((char_length(name) <= 64)), CONSTRAINT check_157d5f955c CHECK ((char_length(namespace) <= 64)), CONSTRAINT check_2b401b0034 CHECK ((char_length(deployment_resource_version) <= 64)), + CONSTRAINT check_67c4c93554 CHECK ((char_length(dns_zone) <= 256)), CONSTRAINT check_77d1a2ff50 CHECK ((char_length(processed_devfile) <= 65535)), CONSTRAINT check_8a0ab61b6b CHECK ((char_length(url_query_string) <= 256)), CONSTRAINT check_8e363ee3ad CHECK ((char_length(devfile_ref) <= 256)), @@ -25832,6 +26202,23 @@ CREATE SEQUENCE zentao_tracker_data_id_seq ALTER SEQUENCE zentao_tracker_data_id_seq OWNED BY zentao_tracker_data.id; +CREATE TABLE zoekt_enabled_namespaces ( + id bigint NOT NULL, + root_namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + search boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE zoekt_enabled_namespaces_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE zoekt_enabled_namespaces_id_seq OWNED BY zoekt_enabled_namespaces.id; + CREATE TABLE zoekt_indexed_namespaces ( id bigint NOT NULL, zoekt_shard_id bigint, @@ -25851,6 +26238,25 @@ CREATE SEQUENCE zoekt_indexed_namespaces_id_seq ALTER SEQUENCE zoekt_indexed_namespaces_id_seq OWNED BY zoekt_indexed_namespaces.id; +CREATE TABLE zoekt_indices ( + id bigint NOT NULL, + zoekt_enabled_namespace_id bigint, + zoekt_node_id bigint NOT NULL, + namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + state smallint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE zoekt_indices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE zoekt_indices_id_seq OWNED BY zoekt_indices.id; + CREATE TABLE zoekt_nodes ( id bigint NOT NULL, uuid uuid NOT NULL, @@ -26174,6 +26580,70 @@ ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.iss ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63); +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_00 FOR VALUES WITH (modulus 32, remainder 0); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_01 FOR VALUES WITH (modulus 32, remainder 1); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_02 FOR VALUES WITH (modulus 32, remainder 2); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_03 FOR VALUES WITH (modulus 32, remainder 3); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_04 FOR VALUES WITH (modulus 32, remainder 4); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_05 FOR VALUES WITH (modulus 32, remainder 5); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_06 FOR VALUES WITH (modulus 32, remainder 6); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_07 FOR VALUES WITH (modulus 32, remainder 7); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_08 FOR VALUES WITH (modulus 32, remainder 8); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_09 FOR VALUES WITH (modulus 32, remainder 9); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_10 FOR VALUES WITH (modulus 32, remainder 10); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_11 FOR VALUES WITH (modulus 32, remainder 11); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_12 FOR VALUES WITH (modulus 32, remainder 12); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_13 FOR VALUES WITH (modulus 32, remainder 13); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_14 FOR VALUES WITH (modulus 32, remainder 14); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_15 FOR VALUES WITH (modulus 32, remainder 15); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_16 FOR VALUES WITH (modulus 32, remainder 16); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_17 FOR VALUES WITH (modulus 32, remainder 17); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_18 FOR VALUES WITH (modulus 32, remainder 18); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_19 FOR VALUES WITH (modulus 32, remainder 19); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_20 FOR VALUES WITH (modulus 32, remainder 20); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_21 FOR VALUES WITH (modulus 32, remainder 21); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_22 FOR VALUES WITH (modulus 32, remainder 22); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_23 FOR VALUES WITH (modulus 32, remainder 23); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_24 FOR VALUES WITH (modulus 32, remainder 24); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_25 FOR VALUES WITH (modulus 32, remainder 25); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_26 FOR VALUES WITH (modulus 32, remainder 26); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_27 FOR VALUES WITH (modulus 32, remainder 27); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_28 FOR VALUES WITH (modulus 32, remainder 28); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_29 FOR VALUES WITH (modulus 32, remainder 29); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_30 FOR VALUES WITH (modulus 32, remainder 30); + +ALTER TABLE ONLY namespace_descendants ATTACH PARTITION gitlab_partitions_static.namespace_descendants_31 FOR VALUES WITH (modulus 32, remainder 31); + ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_00 FOR VALUES WITH (modulus 64, remainder 0); ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_01 FOR VALUES WITH (modulus 64, remainder 1); @@ -26332,6 +26802,10 @@ ALTER TABLE ONLY agent_user_access_group_authorizations ALTER COLUMN id SET DEFA ALTER TABLE ONLY agent_user_access_project_authorizations ALTER COLUMN id SET DEFAULT nextval('agent_user_access_project_authorizations_id_seq'::regclass); +ALTER TABLE ONLY ai_agent_versions ALTER COLUMN id SET DEFAULT nextval('ai_agent_versions_id_seq'::regclass); + +ALTER TABLE ONLY ai_agents ALTER COLUMN id SET DEFAULT nextval('ai_agents_id_seq'::regclass); + ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass); ALTER TABLE ONLY alert_management_alert_metric_images ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_metric_images_id_seq'::regclass); @@ -26504,8 +26978,6 @@ ALTER TABLE ONLY ci_daily_build_group_report_results ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY ci_deleted_objects ALTER COLUMN id SET DEFAULT nextval('ci_deleted_objects_id_seq'::regclass); -ALTER TABLE ONLY ci_editor_ai_conversation_messages ALTER COLUMN id SET DEFAULT nextval('ci_editor_ai_conversation_messages_id_seq'::regclass); - ALTER TABLE ONLY ci_freeze_periods ALTER COLUMN id SET DEFAULT nextval('ci_freeze_periods_id_seq'::regclass); ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_group_variables_id_seq'::regclass); @@ -26586,6 +27058,8 @@ ALTER TABLE ONLY ci_unit_tests ALTER COLUMN id SET DEFAULT nextval('ci_unit_test ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass); +ALTER TABLE ONLY cloud_connector_access ALTER COLUMN id SET DEFAULT nextval('cloud_connector_access_id_seq'::regclass); + ALTER TABLE ONLY cluster_agent_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_agent_tokens_id_seq'::regclass); ALTER TABLE ONLY cluster_agents ALTER COLUMN id SET DEFAULT nextval('cluster_agents_id_seq'::regclass); @@ -26816,8 +27290,6 @@ 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); @@ -26976,6 +27448,8 @@ ALTER TABLE ONLY ml_experiments ALTER COLUMN id SET DEFAULT nextval('ml_experime ALTER TABLE ONLY ml_model_metadata ALTER COLUMN id SET DEFAULT nextval('ml_model_metadata_id_seq'::regclass); +ALTER TABLE ONLY ml_model_version_metadata ALTER COLUMN id SET DEFAULT nextval('ml_model_version_metadata_id_seq'::regclass); + ALTER TABLE ONLY ml_model_versions ALTER COLUMN id SET DEFAULT nextval('ml_model_versions_id_seq'::regclass); ALTER TABLE ONLY ml_models ALTER COLUMN id SET DEFAULT nextval('ml_models_id_seq'::regclass); @@ -27272,6 +27746,8 @@ ALTER TABLE ONLY sbom_occurrences ALTER COLUMN id SET DEFAULT nextval('sbom_occu ALTER TABLE ONLY sbom_occurrences_vulnerabilities ALTER COLUMN id SET DEFAULT nextval('sbom_occurrences_vulnerabilities_id_seq'::regclass); +ALTER TABLE ONLY sbom_source_packages ALTER COLUMN id SET DEFAULT nextval('sbom_source_packages_id_seq'::regclass); + ALTER TABLE ONLY sbom_sources ALTER COLUMN id SET DEFAULT nextval('sbom_sources_id_seq'::regclass); ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass); @@ -27502,8 +27978,12 @@ ALTER TABLE ONLY xray_reports ALTER COLUMN id SET DEFAULT nextval('xray_reports_ ALTER TABLE ONLY zentao_tracker_data ALTER COLUMN id SET DEFAULT nextval('zentao_tracker_data_id_seq'::regclass); +ALTER TABLE ONLY zoekt_enabled_namespaces ALTER COLUMN id SET DEFAULT nextval('zoekt_enabled_namespaces_id_seq'::regclass); + ALTER TABLE ONLY zoekt_indexed_namespaces ALTER COLUMN id SET DEFAULT nextval('zoekt_indexed_namespaces_id_seq'::regclass); +ALTER TABLE ONLY zoekt_indices ALTER COLUMN id SET DEFAULT nextval('zoekt_indices_id_seq'::regclass); + ALTER TABLE ONLY zoekt_nodes ALTER COLUMN id SET DEFAULT nextval('zoekt_nodes_id_seq'::regclass); ALTER TABLE ONLY zoekt_shards ALTER COLUMN id SET DEFAULT nextval('zoekt_shards_id_seq'::regclass); @@ -27903,6 +28383,105 @@ ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62 ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_63 ADD CONSTRAINT issue_search_data_63_pkey PRIMARY KEY (project_id, issue_id); +ALTER TABLE ONLY namespace_descendants + ADD CONSTRAINT namespace_descendants_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_00 + ADD CONSTRAINT namespace_descendants_00_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_01 + ADD CONSTRAINT namespace_descendants_01_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_02 + ADD CONSTRAINT namespace_descendants_02_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_03 + ADD CONSTRAINT namespace_descendants_03_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_04 + ADD CONSTRAINT namespace_descendants_04_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_05 + ADD CONSTRAINT namespace_descendants_05_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_06 + ADD CONSTRAINT namespace_descendants_06_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_07 + ADD CONSTRAINT namespace_descendants_07_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_08 + ADD CONSTRAINT namespace_descendants_08_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_09 + ADD CONSTRAINT namespace_descendants_09_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_10 + ADD CONSTRAINT namespace_descendants_10_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_11 + ADD CONSTRAINT namespace_descendants_11_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_12 + ADD CONSTRAINT namespace_descendants_12_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_13 + ADD CONSTRAINT namespace_descendants_13_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_14 + ADD CONSTRAINT namespace_descendants_14_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_15 + ADD CONSTRAINT namespace_descendants_15_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_16 + ADD CONSTRAINT namespace_descendants_16_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_17 + ADD CONSTRAINT namespace_descendants_17_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_18 + ADD CONSTRAINT namespace_descendants_18_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_19 + ADD CONSTRAINT namespace_descendants_19_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_20 + ADD CONSTRAINT namespace_descendants_20_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_21 + ADD CONSTRAINT namespace_descendants_21_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_22 + ADD CONSTRAINT namespace_descendants_22_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_23 + ADD CONSTRAINT namespace_descendants_23_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_24 + ADD CONSTRAINT namespace_descendants_24_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_25 + ADD CONSTRAINT namespace_descendants_25_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_26 + ADD CONSTRAINT namespace_descendants_26_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_27 + ADD CONSTRAINT namespace_descendants_27_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_28 + ADD CONSTRAINT namespace_descendants_28_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_29 + ADD CONSTRAINT namespace_descendants_29_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_30 + ADD CONSTRAINT namespace_descendants_30_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY gitlab_partitions_static.namespace_descendants_31 + ADD CONSTRAINT namespace_descendants_31_pkey PRIMARY KEY (namespace_id); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -28137,6 +28716,12 @@ ALTER TABLE ONLY agent_user_access_group_authorizations ALTER TABLE ONLY agent_user_access_project_authorizations ADD CONSTRAINT agent_user_access_project_authorizations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ai_agent_versions + ADD CONSTRAINT ai_agent_versions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ai_agents + ADD CONSTRAINT ai_agents_pkey PRIMARY KEY (id); + ALTER TABLE ONLY alert_management_alert_assignees ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id); @@ -28398,9 +28983,6 @@ ALTER TABLE ONLY chat_names ALTER TABLE ONLY chat_teams ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id); -ALTER TABLE merge_request_diffs - ADD CONSTRAINT check_11c5f029ad CHECK ((project_id IS NOT NULL)) NOT VALID; - ALTER TABLE workspaces ADD CONSTRAINT check_2a89035b04 CHECK ((personal_access_token_id IS NOT NULL)) NOT VALID; @@ -28464,9 +29046,6 @@ ALTER TABLE ONLY ci_daily_build_group_report_results ALTER TABLE ONLY ci_deleted_objects ADD CONSTRAINT ci_deleted_objects_pkey PRIMARY KEY (id); -ALTER TABLE ONLY ci_editor_ai_conversation_messages - ADD CONSTRAINT ci_editor_ai_conversation_messages_pkey PRIMARY KEY (id); - ALTER TABLE ONLY ci_freeze_periods ADD CONSTRAINT ci_freeze_periods_pkey PRIMARY KEY (id); @@ -28599,6 +29178,9 @@ ALTER TABLE ONLY ci_unit_tests ALTER TABLE ONLY ci_variables ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id); +ALTER TABLE ONLY cloud_connector_access + ADD CONSTRAINT cloud_connector_access_pkey PRIMARY KEY (id); + ALTER TABLE ONLY cluster_agent_tokens ADD CONSTRAINT cluster_agent_tokens_pkey PRIMARY KEY (id); @@ -29016,9 +29598,6 @@ 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 &&); @@ -29283,6 +29862,9 @@ ALTER TABLE ONLY ml_experiments ALTER TABLE ONLY ml_model_metadata ADD CONSTRAINT ml_model_metadata_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ml_model_version_metadata + ADD CONSTRAINT ml_model_version_metadata_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ml_model_versions ADD CONSTRAINT ml_model_versions_pkey PRIMARY KEY (id); @@ -29532,6 +30114,9 @@ ALTER TABLE ONLY pages_domain_acme_orders ALTER TABLE ONLY pages_domains ADD CONSTRAINT pages_domains_pkey PRIMARY KEY (id); +ALTER TABLE ci_pipeline_variables + ADD CONSTRAINT partitioning_constraint CHECK ((partition_id = ANY (ARRAY[(100)::bigint, (101)::bigint]))) NOT VALID; + ALTER TABLE ONLY path_locks ADD CONSTRAINT path_locks_pkey PRIMARY KEY (id); @@ -29820,6 +30405,9 @@ ALTER TABLE ONLY sbom_occurrences ALTER TABLE ONLY sbom_occurrences_vulnerabilities ADD CONSTRAINT sbom_occurrences_vulnerabilities_pkey PRIMARY KEY (id); +ALTER TABLE ONLY sbom_source_packages + ADD CONSTRAINT sbom_source_packages_pkey PRIMARY KEY (id); + ALTER TABLE ONLY sbom_sources ADD CONSTRAINT sbom_sources_pkey PRIMARY KEY (id); @@ -30174,6 +30762,9 @@ ALTER TABLE ONLY wiki_page_slugs ALTER TABLE ONLY wiki_repository_states ADD CONSTRAINT wiki_repository_states_pkey PRIMARY KEY (id); +ALTER TABLE ONLY work_item_colors + ADD CONSTRAINT work_item_colors_pkey PRIMARY KEY (issue_id); + ALTER TABLE ONLY work_item_dates_sources ADD CONSTRAINT work_item_dates_sources_pkey PRIMARY KEY (issue_id); @@ -30216,9 +30807,15 @@ ALTER TABLE ONLY xray_reports ALTER TABLE ONLY zentao_tracker_data ADD CONSTRAINT zentao_tracker_data_pkey PRIMARY KEY (id); +ALTER TABLE ONLY zoekt_enabled_namespaces + ADD CONSTRAINT zoekt_enabled_namespaces_pkey PRIMARY KEY (id); + ALTER TABLE ONLY zoekt_indexed_namespaces ADD CONSTRAINT zoekt_indexed_namespaces_pkey PRIMARY KEY (id); +ALTER TABLE ONLY zoekt_indices + ADD CONSTRAINT zoekt_indices_pkey PRIMARY KEY (id); + ALTER TABLE ONLY zoekt_nodes ADD CONSTRAINT zoekt_nodes_pkey PRIMARY KEY (id); @@ -31024,259 +31621,325 @@ CREATE INDEX issue_search_data_00_issue_id_idx ON gitlab_partitions_static.issue CREATE INDEX index_issue_search_data_on_search_vector ON ONLY issue_search_data USING gin (search_vector); -CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector); +CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_01_issue_id_idx ON gitlab_partitions_static.issue_search_data_01 USING btree (issue_id); -CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector); +CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_02_issue_id_idx ON gitlab_partitions_static.issue_search_data_02 USING btree (issue_id); -CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector); +CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_03_issue_id_idx ON gitlab_partitions_static.issue_search_data_03 USING btree (issue_id); -CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector); +CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_04_issue_id_idx ON gitlab_partitions_static.issue_search_data_04 USING btree (issue_id); -CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector); +CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_05_issue_id_idx ON gitlab_partitions_static.issue_search_data_05 USING btree (issue_id); -CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector); +CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_06_issue_id_idx ON gitlab_partitions_static.issue_search_data_06 USING btree (issue_id); -CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector); +CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_07_issue_id_idx ON gitlab_partitions_static.issue_search_data_07 USING btree (issue_id); -CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector); +CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_08_issue_id_idx ON gitlab_partitions_static.issue_search_data_08 USING btree (issue_id); -CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector); +CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_09_issue_id_idx ON gitlab_partitions_static.issue_search_data_09 USING btree (issue_id); -CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector); +CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_10_issue_id_idx ON gitlab_partitions_static.issue_search_data_10 USING btree (issue_id); -CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector); +CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_11_issue_id_idx ON gitlab_partitions_static.issue_search_data_11 USING btree (issue_id); -CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector); +CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_12_issue_id_idx ON gitlab_partitions_static.issue_search_data_12 USING btree (issue_id); -CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector); +CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_13_issue_id_idx ON gitlab_partitions_static.issue_search_data_13 USING btree (issue_id); -CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector); +CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_14_issue_id_idx ON gitlab_partitions_static.issue_search_data_14 USING btree (issue_id); -CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector); +CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_15_issue_id_idx ON gitlab_partitions_static.issue_search_data_15 USING btree (issue_id); -CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector); +CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_16_issue_id_idx ON gitlab_partitions_static.issue_search_data_16 USING btree (issue_id); -CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector); +CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_17_issue_id_idx ON gitlab_partitions_static.issue_search_data_17 USING btree (issue_id); -CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector); +CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_18_issue_id_idx ON gitlab_partitions_static.issue_search_data_18 USING btree (issue_id); -CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector); +CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_19_issue_id_idx ON gitlab_partitions_static.issue_search_data_19 USING btree (issue_id); -CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector); +CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_20_issue_id_idx ON gitlab_partitions_static.issue_search_data_20 USING btree (issue_id); -CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector); +CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_21_issue_id_idx ON gitlab_partitions_static.issue_search_data_21 USING btree (issue_id); -CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector); +CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_22_issue_id_idx ON gitlab_partitions_static.issue_search_data_22 USING btree (issue_id); -CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector); +CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_23_issue_id_idx ON gitlab_partitions_static.issue_search_data_23 USING btree (issue_id); -CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector); +CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_24_issue_id_idx ON gitlab_partitions_static.issue_search_data_24 USING btree (issue_id); -CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector); +CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_25_issue_id_idx ON gitlab_partitions_static.issue_search_data_25 USING btree (issue_id); -CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector); +CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_26_issue_id_idx ON gitlab_partitions_static.issue_search_data_26 USING btree (issue_id); -CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector); +CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_27_issue_id_idx ON gitlab_partitions_static.issue_search_data_27 USING btree (issue_id); -CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector); +CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_28_issue_id_idx ON gitlab_partitions_static.issue_search_data_28 USING btree (issue_id); -CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector); +CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_29_issue_id_idx ON gitlab_partitions_static.issue_search_data_29 USING btree (issue_id); -CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector); +CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_30_issue_id_idx ON gitlab_partitions_static.issue_search_data_30 USING btree (issue_id); -CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector); +CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_31_issue_id_idx ON gitlab_partitions_static.issue_search_data_31 USING btree (issue_id); -CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector); +CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_32_issue_id_idx ON gitlab_partitions_static.issue_search_data_32 USING btree (issue_id); -CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector); +CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_33_issue_id_idx ON gitlab_partitions_static.issue_search_data_33 USING btree (issue_id); -CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector); +CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_34_issue_id_idx ON gitlab_partitions_static.issue_search_data_34 USING btree (issue_id); -CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector); +CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_35_issue_id_idx ON gitlab_partitions_static.issue_search_data_35 USING btree (issue_id); -CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector); +CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_36_issue_id_idx ON gitlab_partitions_static.issue_search_data_36 USING btree (issue_id); -CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector); +CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_37_issue_id_idx ON gitlab_partitions_static.issue_search_data_37 USING btree (issue_id); -CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector); +CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_38_issue_id_idx ON gitlab_partitions_static.issue_search_data_38 USING btree (issue_id); -CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector); +CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_39_issue_id_idx ON gitlab_partitions_static.issue_search_data_39 USING btree (issue_id); -CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector); +CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_40_issue_id_idx ON gitlab_partitions_static.issue_search_data_40 USING btree (issue_id); -CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector); +CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_41_issue_id_idx ON gitlab_partitions_static.issue_search_data_41 USING btree (issue_id); -CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector); +CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_42_issue_id_idx ON gitlab_partitions_static.issue_search_data_42 USING btree (issue_id); -CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector); +CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_43_issue_id_idx ON gitlab_partitions_static.issue_search_data_43 USING btree (issue_id); -CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector); +CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_44_issue_id_idx ON gitlab_partitions_static.issue_search_data_44 USING btree (issue_id); -CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector); +CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_45_issue_id_idx ON gitlab_partitions_static.issue_search_data_45 USING btree (issue_id); -CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector); +CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_46_issue_id_idx ON gitlab_partitions_static.issue_search_data_46 USING btree (issue_id); -CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector); +CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_47_issue_id_idx ON gitlab_partitions_static.issue_search_data_47 USING btree (issue_id); -CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector); +CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_48_issue_id_idx ON gitlab_partitions_static.issue_search_data_48 USING btree (issue_id); -CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector); +CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_49_issue_id_idx ON gitlab_partitions_static.issue_search_data_49 USING btree (issue_id); -CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector); +CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_50_issue_id_idx ON gitlab_partitions_static.issue_search_data_50 USING btree (issue_id); -CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector); +CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_51_issue_id_idx ON gitlab_partitions_static.issue_search_data_51 USING btree (issue_id); -CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector); +CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_52_issue_id_idx ON gitlab_partitions_static.issue_search_data_52 USING btree (issue_id); -CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector); +CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_53_issue_id_idx ON gitlab_partitions_static.issue_search_data_53 USING btree (issue_id); -CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector); +CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_54_issue_id_idx ON gitlab_partitions_static.issue_search_data_54 USING btree (issue_id); -CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector); +CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_55_issue_id_idx ON gitlab_partitions_static.issue_search_data_55 USING btree (issue_id); -CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector); +CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_56_issue_id_idx ON gitlab_partitions_static.issue_search_data_56 USING btree (issue_id); -CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector); +CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_57_issue_id_idx ON gitlab_partitions_static.issue_search_data_57 USING btree (issue_id); -CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector); +CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_58_issue_id_idx ON gitlab_partitions_static.issue_search_data_58 USING btree (issue_id); -CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector); +CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_59_issue_id_idx ON gitlab_partitions_static.issue_search_data_59 USING btree (issue_id); -CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector); +CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_60_issue_id_idx ON gitlab_partitions_static.issue_search_data_60 USING btree (issue_id); -CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector); +CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_61_issue_id_idx ON gitlab_partitions_static.issue_search_data_61 USING btree (issue_id); -CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector); +CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_62_issue_id_idx ON gitlab_partitions_static.issue_search_data_62 USING btree (issue_id); -CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector); +CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_63_issue_id_idx ON gitlab_partitions_static.issue_search_data_63 USING btree (issue_id); -CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector); +CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector) WITH (fastupdate='false'); + +CREATE INDEX index_on_namespace_descendants_outdated ON ONLY namespace_descendants USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_00_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_00 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_01_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_01 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_02_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_02 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_03_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_03 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_04_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_04 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_05_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_05 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_06_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_06 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_07_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_07 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_08_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_08 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_09_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_09 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_10_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_10 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_11_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_11 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_12_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_12 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_13_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_13 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_14_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_14 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_15_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_15 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_16_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_16 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_17_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_17 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_18_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_18 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_19_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_19 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_20_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_20 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_21_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_21 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_22_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_22 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_23_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_23 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_24_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_24 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_25_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_25 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_26_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_26 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_27_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_27 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_28_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_28 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_29_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_29 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_30_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_30 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); + +CREATE INDEX namespace_descendants_31_namespace_id_idx ON gitlab_partitions_static.namespace_descendants_31 USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); CREATE INDEX index_product_analytics_events_experimental_project_and_time ON ONLY product_analytics_events_experimental USING btree (project_id, collector_tstamp); @@ -31678,6 +32341,8 @@ CREATE INDEX idx_pkgs_installable_package_files_on_package_id_id_file_name ON pa CREATE INDEX idx_pkgs_npm_metadata_caches_on_id_and_project_id_and_status ON packages_npm_metadata_caches USING btree (id) WHERE ((project_id IS NULL) AND (status = 0)); +CREATE INDEX idx_pkgs_on_project_id_name_version_on_installable_terraform ON packages_packages USING btree (project_id, name, version, id) WHERE ((package_type = 12) AND (status = ANY (ARRAY[0, 1]))); + CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_cloud_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_cloud_last_sync_at, project_id) WHERE (jira_dvcs_cloud_last_sync_at IS NOT NULL); CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_server_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_server_last_sync_at, project_id) WHERE (jira_dvcs_server_last_sync_at IS NOT NULL); @@ -31714,6 +32379,8 @@ CREATE INDEX idx_repository_states_outdated_checksums ON project_repository_stat CREATE INDEX idx_sbom_occurrences_on_project_id_and_source_id ON sbom_occurrences USING btree (project_id, source_id); +CREATE UNIQUE INDEX idx_sbom_source_packages_on_name_and_purl_type ON sbom_source_packages USING btree (name, purl_type); + CREATE UNIQUE INDEX idx_security_scans_on_build_and_scan_type ON security_scans USING btree (build_id, scan_type); CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan_type); @@ -31822,6 +32489,12 @@ CREATE INDEX index_agent_user_access_on_group_id ON agent_user_access_group_auth CREATE INDEX index_agent_user_access_on_project_id ON agent_user_access_project_authorizations USING btree (project_id); +CREATE INDEX index_ai_agent_versions_on_agent_id ON ai_agent_versions USING btree (agent_id); + +CREATE INDEX index_ai_agent_versions_on_project_id ON ai_agent_versions USING btree (project_id); + +CREATE UNIQUE INDEX index_ai_agents_on_project_id_and_name ON ai_agents USING btree (project_id, name); + CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assignees USING btree (alert_id); CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id); @@ -32096,6 +32769,8 @@ CREATE INDEX index_catalog_resource_versions_on_resource_id_and_released_at ON c CREATE UNIQUE INDEX index_catalog_resources_on_project_id ON catalog_resources USING btree (project_id); +CREATE INDEX index_catalog_resources_on_search_vector ON catalog_resources USING gin (search_vector); + CREATE INDEX index_catalog_resources_on_state ON catalog_resources USING btree (state); CREATE INDEX index_chat_names_on_team_id_and_chat_id ON chat_names USING btree (team_id, chat_id); @@ -32122,6 +32797,8 @@ CREATE UNIQUE INDEX index_ci_build_trace_metadata_on_partition_id_build_id ON ci CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id); +CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id_partition_id ON ci_build_trace_metadata USING btree (trace_artifact_id, partition_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); CREATE INDEX index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts ON ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE); @@ -32222,12 +32899,6 @@ CREATE INDEX index_ci_daily_build_group_report_results_on_project_and_date ON ci CREATE INDEX index_ci_deleted_objects_on_pick_up_at ON ci_deleted_objects USING btree (pick_up_at); -CREATE INDEX index_ci_editor_ai_messages_created_at ON ci_editor_ai_conversation_messages USING btree (created_at); - -CREATE INDEX index_ci_editor_ai_messages_on_user_project_and_created_at ON ci_editor_ai_conversation_messages USING btree (user_id, project_id, created_at); - -CREATE INDEX index_ci_editor_ai_messages_project_id ON ci_editor_ai_conversation_messages USING btree (project_id); - CREATE INDEX index_ci_finished_build_ch_sync_events_for_partitioned_query ON ONLY p_ci_finished_build_ch_sync_events USING btree (((build_id % (100)::bigint)), build_id) WHERE (processed = false); CREATE INDEX index_ci_freeze_periods_on_project_id ON ci_freeze_periods USING btree (project_id); @@ -32236,7 +32907,7 @@ CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key); -CREATE INDEX index_ci_job_artifact_states_on_job_artifact_id ON ci_job_artifact_states USING btree (job_artifact_id); +CREATE INDEX index_ci_job_artifact_states_on_job_artifact_id_partition_id ON ci_job_artifact_states USING btree (job_artifact_id, partition_id); CREATE INDEX index_ci_job_artifacts_expire_at_unlocked_non_trace ON ci_job_artifacts USING btree (expire_at) WHERE ((locked = 0) AND (file_type <> 3) AND (expire_at IS NOT NULL)); @@ -33196,12 +33867,6 @@ CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON pro CREATE INDEX index_imported_projects_on_import_type_id ON projects USING btree (import_type, id) WHERE (import_type IS NOT NULL); -CREATE INDEX index_in_product_marketing_emails_on_track_series_id_clicked ON in_product_marketing_emails USING btree (track, series, id, cta_clicked_at); - -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); @@ -33314,7 +33979,7 @@ CREATE INDEX index_issues_on_milestone_id ON issues USING btree (milestone_id); CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHERE (moved_to_id IS NOT NULL); -CREATE INDEX index_issues_on_namespace_id ON issues USING btree (namespace_id); +CREATE UNIQUE INDEX index_issues_on_namespace_id_iid_unique ON issues USING btree (namespace_id, iid); CREATE INDEX index_issues_on_project_health_status_asc_work_item_type ON issues USING btree (project_id, health_status, id DESC, state_id, work_item_type_id); @@ -33684,6 +34349,8 @@ CREATE UNIQUE INDEX index_ml_experiments_on_project_id_and_name ON ml_experiment CREATE INDEX index_ml_experiments_on_user_id ON ml_experiments USING btree (user_id); +CREATE INDEX index_ml_model_version_metadata_on_project_id ON ml_model_version_metadata USING btree (project_id); + CREATE INDEX index_ml_model_versions_on_package_id ON ml_model_versions USING btree (package_id); CREATE INDEX index_ml_model_versions_on_project_id ON ml_model_versions USING btree (project_id); @@ -33920,6 +34587,8 @@ CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_rel CREATE INDEX index_p_catalog_resource_sync_events_on_id_where_pending ON ONLY p_catalog_resource_sync_events USING btree (id) WHERE (status = 1); +CREATE INDEX index_p_ci_finished_build_ch_sync_events_finished_at ON ONLY p_ci_finished_build_ch_sync_events USING btree (partition, build_finished_at); + CREATE UNIQUE INDEX index_p_ci_job_annotations_on_partition_id_job_id_name ON ONLY p_ci_job_annotations USING btree (partition_id, job_id, name); CREATE INDEX index_p_ci_runner_machine_builds_on_runner_machine_id ON ONLY p_ci_runner_machine_builds USING btree (runner_machine_id); @@ -33942,14 +34611,10 @@ CREATE INDEX index_packages_debian_group_component_files_on_component_id ON pack CREATE INDEX index_packages_debian_group_distributions_on_creator_id ON packages_debian_group_distributions USING btree (creator_id); -CREATE INDEX index_packages_debian_group_distributions_on_group_id ON packages_debian_group_distributions USING btree (group_id); - CREATE INDEX index_packages_debian_project_component_files_on_component_id ON packages_debian_project_component_files USING btree (component_id); CREATE INDEX index_packages_debian_project_distributions_on_creator_id ON packages_debian_project_distributions USING btree (creator_id); -CREATE INDEX index_packages_debian_project_distributions_on_project_id ON packages_debian_project_distributions USING btree (project_id); - CREATE INDEX index_packages_debian_publications_on_distribution_id ON packages_debian_publications USING btree (distribution_id); CREATE UNIQUE INDEX index_packages_debian_publications_on_package_id ON packages_debian_publications USING btree (package_id); @@ -34026,8 +34691,6 @@ CREATE INDEX index_packages_rpm_metadata_on_package_id ON packages_rpm_metadata CREATE INDEX index_packages_rpm_repository_files_on_project_id_and_file_name ON packages_rpm_repository_files USING btree (project_id, file_name); -CREATE INDEX index_packages_tags_on_package_id ON packages_tags USING btree (package_id); - CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags USING btree (package_id, updated_at DESC); CREATE INDEX index_packages_tags_on_project_id ON packages_tags USING btree (project_id); @@ -34468,22 +35131,12 @@ CREATE INDEX index_requirements_management_test_reports_on_build_id ON requireme CREATE INDEX index_requirements_management_test_reports_on_issue_id ON requirements_management_test_reports USING btree (issue_id); -CREATE INDEX index_requirements_on_author_id ON requirements USING btree (author_id); - -CREATE INDEX index_requirements_on_created_at ON requirements USING btree (created_at); - CREATE UNIQUE INDEX index_requirements_on_issue_id ON requirements USING btree (issue_id); CREATE INDEX index_requirements_on_project_id ON requirements USING btree (project_id); CREATE UNIQUE INDEX index_requirements_on_project_id_and_iid ON requirements USING btree (project_id, iid) WHERE (project_id IS NOT NULL); -CREATE INDEX index_requirements_on_state ON requirements USING btree (state); - -CREATE INDEX index_requirements_on_title_trigram ON requirements USING gin (title gin_trgm_ops); - -CREATE INDEX index_requirements_on_updated_at ON requirements USING btree (updated_at); - CREATE INDEX index_requirements_project_id_user_id_id_and_target_type ON todos USING btree (project_id, user_id, id, target_type); CREATE INDEX index_requirements_user_id_and_target_type ON todos USING btree (user_id, target_type); @@ -34576,6 +35229,8 @@ CREATE UNIQUE INDEX index_sbom_component_versions_on_component_id_and_version ON CREATE UNIQUE INDEX index_sbom_components_on_component_type_name_and_purl_type ON sbom_components USING btree (name, purl_type, component_type); +CREATE INDEX index_sbom_occurr_on_project_id_and_component_version_id_and_id ON sbom_occurrences USING btree (project_id, component_version_id, id); + CREATE INDEX index_sbom_occurrences_for_input_file_path_search ON sbom_occurrences USING btree (project_id, component_id, input_file_path); CREATE INDEX index_sbom_occurrences_on_component_id_and_id ON sbom_occurrences USING btree (component_id, id); @@ -34602,6 +35257,8 @@ CREATE UNIQUE INDEX index_sbom_occurrences_on_uuid ON sbom_occurrences USING btr CREATE INDEX index_sbom_occurrences_vulnerabilities_on_vulnerability_id ON sbom_occurrences_vulnerabilities USING btree (vulnerability_id); +CREATE INDEX index_sbom_source_packages_on_source_package_id_and_id ON sbom_occurrences USING btree (source_package_id, id); + CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources USING btree (source_type, source); CREATE UNIQUE INDEX index_scan_result_policies_on_position_in_configuration ON scan_result_policies USING btree (security_orchestration_policy_configuration_id, project_id, orchestration_policy_idx, rule_idx); @@ -34862,6 +35519,8 @@ CREATE INDEX index_timelogs_on_project_id_and_spent_at ON timelogs USING btree ( CREATE INDEX index_timelogs_on_spent_at ON timelogs USING btree (spent_at) WHERE (spent_at IS NOT NULL); +CREATE INDEX index_timelogs_on_timelog_category_id ON timelogs USING btree (timelog_category_id); + CREATE INDEX index_timelogs_on_user_id ON timelogs USING btree (user_id); CREATE INDEX index_todos_on_author_id ON todos USING btree (author_id); @@ -34894,6 +35553,8 @@ CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name); CREATE INDEX index_topics_on_name_trigram ON topics USING gin (name gin_trgm_ops); +CREATE UNIQUE INDEX index_topics_on_slug ON topics USING btree (slug) WHERE (slug IS NOT NULL); + CREATE INDEX index_topics_total_projects_count ON topics USING btree (total_projects_count DESC, id); CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects USING btree (project_id); @@ -34910,6 +35571,8 @@ CREATE UNIQUE INDEX index_uniq_projects_on_runners_token_encrypted ON projects U CREATE UNIQUE INDEX index_unique_ci_runner_projects_on_runner_id_and_project_id ON ci_runner_projects USING btree (runner_id, project_id); +CREATE UNIQUE INDEX index_unique_epics_on_issue_id ON epics USING btree (issue_id); + CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id); CREATE UNIQUE INDEX index_unique_project_authorizations_on_unique_project_user ON project_authorizations USING btree (project_id, user_id) WHERE is_unique; @@ -34960,10 +35623,6 @@ CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id ON user_canonical_ema CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id_and_canonical_email ON user_canonical_emails USING btree (user_id, canonical_email); -CREATE INDEX index_user_credit_card_validations_meta_data_full_match_lower ON user_credit_card_validations USING btree (lower(holder_name), expiration_date, last_digits, credit_card_validated_at); - -CREATE INDEX index_user_credit_card_validations_meta_data_partial_match ON user_credit_card_validations USING btree (expiration_date, last_digits, network, credit_card_validated_at); - CREATE INDEX index_user_custom_attributes_on_key_and_value ON user_custom_attributes USING btree (key, value); CREATE UNIQUE INDEX index_user_custom_attributes_on_user_id_and_key ON user_custom_attributes USING btree (user_id, key); @@ -35082,6 +35741,8 @@ CREATE INDEX index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null ON vul 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_owasp_top_10 ON vulnerability_reads USING btree (project_id, owasp_top_10); + CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC); CREATE INDEX index_vulnerabilities_common_finder_query_on_default_branch ON vulnerabilities USING btree (project_id, state, report_type, present_on_default_branch, severity, id); @@ -35094,26 +35755,14 @@ CREATE INDEX index_vulnerabilities_on_detected_at_and_id ON vulnerabilities USIN CREATE INDEX index_vulnerabilities_on_dismissed_by_id ON vulnerabilities USING btree (dismissed_by_id); -CREATE INDEX index_vulnerabilities_on_due_date_sourcing_milestone_id ON vulnerabilities USING btree (due_date_sourcing_milestone_id); - -CREATE INDEX index_vulnerabilities_on_epic_id ON vulnerabilities USING btree (epic_id); - CREATE INDEX index_vulnerabilities_on_finding_id ON vulnerabilities USING btree (finding_id); -CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING btree (last_edited_by_id); - -CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id); - CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id); CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity); CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id); -CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON vulnerabilities USING btree (start_date_sourcing_milestone_id); - -CREATE INDEX index_vulnerabilities_on_updated_by_id ON vulnerabilities USING btree (updated_by_id); - CREATE INDEX index_vulnerabilities_project_id_and_id_on_default_branch ON vulnerabilities USING btree (project_id, id) WHERE (present_on_default_branch IS TRUE); CREATE INDEX index_vulnerabilities_project_id_state_severity_default_branch ON vulnerabilities USING btree (project_id, state, severity, present_on_default_branch); @@ -35328,6 +35977,10 @@ CREATE INDEX index_zentao_tracker_data_on_integration_id ON zentao_tracker_data CREATE INDEX index_zoekt_indexed_namespaces_on_namespace_id ON zoekt_indexed_namespaces USING btree (namespace_id); +CREATE INDEX index_zoekt_indices_on_state ON zoekt_indices USING btree (state); + +CREATE INDEX index_zoekt_indices_on_zoekt_node_id ON zoekt_indices USING btree (zoekt_node_id); + CREATE UNIQUE INDEX index_zoekt_node_and_namespace ON zoekt_indexed_namespaces USING btree (zoekt_node_id, namespace_id); CREATE INDEX index_zoekt_nodes_on_last_seen_at ON zoekt_nodes USING btree (last_seen_at); @@ -35364,8 +36017,6 @@ CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_and_note_id_index ON me CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_index ON merge_request_user_mentions USING btree (merge_request_id) WHERE (note_id IS NULL); -CREATE INDEX note_mentions_temp_index ON notes USING btree (id, noteable_type) WHERE (note ~~ '%@%'::text); - CREATE UNIQUE INDEX one_canonical_wiki_page_slug_per_metadata ON wiki_page_slugs USING btree (wiki_page_meta_id) WHERE (canonical = true); CREATE INDEX p_ci_builds_scheduled_at_idx ON ONLY p_ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text)); @@ -35398,6 +36049,8 @@ CREATE INDEX partial_index_user_id_app_id_created_at_token_not_revoked ON oauth_ CREATE UNIQUE INDEX pm_checkpoints_path_components ON pm_checkpoints USING btree (purl_type, data_type, version_format); +CREATE INDEX releases_published_at_index ON releases USING btree (release_published_at); + CREATE INDEX scan_finding_approval_mr_rule_index_id ON approval_merge_request_rules USING btree (id) WHERE (report_type = 4); CREATE INDEX scan_finding_approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id) WHERE (report_type = 4); @@ -35452,8 +36105,6 @@ CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (memb CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text)); -CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); - 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); @@ -35468,6 +36119,8 @@ CREATE INDEX tmp_index_vulnerability_overlong_title_html ON vulnerabilities USIN CREATE UNIQUE INDEX u_project_compliance_standards_adherence_for_reporting ON project_compliance_standards_adherence USING btree (project_id, check_name, standard); +CREATE UNIQUE INDEX u_zoekt_indices_zoekt_enabled_namespace_id_and_zoekt_node_id ON zoekt_indices USING btree (zoekt_enabled_namespace_id, zoekt_node_id); + CREATE UNIQUE INDEX uniq_google_cloud_logging_configuration_namespace_id_and_name ON audit_events_google_cloud_logging_configurations USING btree (namespace_id, name); CREATE UNIQUE INDEX uniq_idx_packages_packages_on_project_id_name_version_ml_model ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 14); @@ -35520,6 +36173,8 @@ CREATE UNIQUE INDEX unique_index_for_project_pages_unique_domain ON project_sett CREATE UNIQUE INDEX unique_index_ml_model_metadata_name ON ml_model_metadata USING btree (model_id, name); +CREATE UNIQUE INDEX unique_index_ml_model_version_metadata_name ON ml_model_version_metadata USING btree (model_version_id, name); + CREATE UNIQUE INDEX unique_index_on_system_note_metadata_id ON resource_link_events USING btree (system_note_metadata_id); CREATE UNIQUE INDEX unique_index_sysaccess_ms_access_tokens_on_sysaccess_ms_app_id ON system_access_microsoft_graph_access_tokens USING btree (system_access_microsoft_application_id); @@ -35558,14 +36213,16 @@ CREATE UNIQUE INDEX unique_user_id_and_setting_type ON vs_code_settings USING bt CREATE UNIQUE INDEX unique_vuln_merge_request_link_vuln_id_and_mr_id ON vulnerability_merge_request_links USING btree (vulnerability_id, merge_request_id); +CREATE UNIQUE INDEX unique_zoekt_enabled_namespaces_on_root_namespace_id ON zoekt_enabled_namespaces USING btree (root_namespace_id); + CREATE UNIQUE INDEX unique_zoekt_shards_uuid ON zoekt_shards USING btree (uuid); CREATE INDEX user_follow_users_followee_id_idx ON user_follow_users USING btree (followee_id); -CREATE INDEX users_forbidden_state_idx ON users USING btree (id) WHERE ((confirmed_at IS NOT NULL) AND ((state)::text <> ALL (ARRAY['blocked'::text, 'banned'::text, 'ldap_blocked'::text]))); - CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id); +CREATE INDEX wi_colors_namespace_id_index ON work_item_colors USING btree (namespace_id); + CREATE INDEX wi_datessources_due_date_sourcing_milestone_id_index ON work_item_dates_sources USING btree (due_date_sourcing_milestone_id); CREATE INDEX wi_datessources_due_date_sourcing_work_item_id_index ON work_item_dates_sources USING btree (due_date_sourcing_work_item_id); @@ -36858,6 +37515,134 @@ ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.iss ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_search_vector_idx; +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_00_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_00_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_01_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_01_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_02_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_02_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_03_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_03_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_04_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_04_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_05_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_05_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_06_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_06_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_07_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_07_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_08_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_08_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_09_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_09_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_10_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_10_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_11_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_11_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_12_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_12_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_13_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_13_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_14_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_14_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_15_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_15_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_16_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_16_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_17_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_17_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_18_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_18_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_19_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_19_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_20_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_20_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_21_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_21_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_22_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_22_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_23_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_23_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_24_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_24_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_25_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_25_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_26_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_26_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_27_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_27_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_28_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_28_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_29_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_29_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_30_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_30_pkey; + +ALTER INDEX index_on_namespace_descendants_outdated ATTACH PARTITION gitlab_partitions_static.namespace_descendants_31_namespace_id_idx; + +ALTER INDEX namespace_descendants_pkey ATTACH PARTITION gitlab_partitions_static.namespace_descendants_31_pkey; + ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10; ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11; @@ -37216,6 +38001,8 @@ CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE O CREATE TRIGGER trigger_eaec934fe6b2 BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_eaec934fe6b2(); +CREATE TRIGGER trigger_ff16c1fd43ea BEFORE INSERT OR UPDATE ON geo_event_log FOR EACH ROW EXECUTE FUNCTION trigger_ff16c1fd43ea(); + CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); CREATE TRIGGER trigger_has_external_issue_tracker_on_insert AFTER INSERT ON integrations FOR EACH ROW WHEN ((((new.category)::text = 'issue_tracker'::text) AND (new.active = true) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -37337,12 +38124,6 @@ ALTER TABLE ONLY project_pages_metadata ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_1302949740 FOREIGN KEY (last_edited_by_id) REFERENCES users(id) ON DELETE SET NULL; - -ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_131d289c65 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; - ALTER TABLE ONLY approval_group_rules ADD CONSTRAINT fk_1485c451e3 FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE; @@ -37385,12 +38166,12 @@ ALTER TABLE ONLY project_statistics ALTER TABLE ONLY agent_project_authorizations ADD CONSTRAINT fk_1d30bb4987 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL; - ALTER TABLE ONLY boards ADD CONSTRAINT fk_1e9a074a35 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY zoekt_enabled_namespaces + ADD CONSTRAINT fk_1effa65b25 FOREIGN KEY (root_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -37406,6 +38187,9 @@ ALTER TABLE ONLY namespace_settings ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT fk_21d25cac1a FOREIGN KEY (trace_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_trace_metadata + ADD CONSTRAINT fk_21d25cac1a_p FOREIGN KEY (partition_id, trace_artifact_id) REFERENCES ci_job_artifacts(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ALTER TABLE ONLY users_star_projects ADD CONSTRAINT fk_22cd27ddfc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -37499,9 +38283,6 @@ ALTER TABLE ONLY project_topics ALTER TABLE ONLY saml_providers ADD CONSTRAINT fk_351dde3a84 FOREIGN KEY (member_role_id) REFERENCES member_roles(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; @@ -37590,7 +38371,7 @@ ALTER TABLE ONLY namespace_commit_emails ADD CONSTRAINT fk_4d6ba63ba5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_4e64972902 FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_4e64972902 FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; ALTER TABLE ONLY ml_model_versions ADD CONSTRAINT fk_4e8b59e7a8 FOREIGN KEY (model_id) REFERENCES ml_models(id) ON DELETE CASCADE; @@ -37706,6 +38487,9 @@ ALTER TABLE p_ci_builds ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY ai_agent_versions + ADD CONSTRAINT fk_6c2f682587 FOREIGN KEY (agent_id) REFERENCES ai_agents(id) ON DELETE CASCADE; + ALTER TABLE ONLY ml_models ADD CONSTRAINT fk_6c95e61a6e FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -37787,18 +38571,12 @@ ALTER TABLE ONLY protected_branches ALTER TABLE ONLY scan_result_policies ADD CONSTRAINT fk_7aa24439f1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY catalog_resource_versions ADD CONSTRAINT fk_7ad8849db4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY issue_customer_relations_contacts ADD CONSTRAINT fk_7b92f835bb FOREIGN KEY (contact_id) REFERENCES customer_relations_contacts(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerabilities - ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; - ALTER TABLE ONLY ssh_signatures ADD CONSTRAINT fk_7d2f93996c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -37823,9 +38601,6 @@ 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 organization_users - ADD CONSTRAINT fk_8471abad75 FOREIGN KEY (organization_id) REFERENCES organizations(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; @@ -37850,9 +38625,6 @@ ALTER TABLE p_ci_builds ALTER TABLE ONLY approval_group_rules_users ADD CONSTRAINT fk_888a0df3b7 FOREIGN KEY (user_id) REFERENCES users(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; - ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT fk_88c725229f FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -37877,9 +38649,6 @@ ALTER TABLE ONLY work_item_dates_sources ALTER TABLE ONLY bulk_import_exports ADD CONSTRAINT fk_8c6f33cebe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY organization_users - ADD CONSTRAINT fk_8d9b20725d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - ALTER TABLE ONLY releases ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -38030,9 +38799,18 @@ ALTER TABLE ONLY dast_profile_schedules ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE; +ALTER TABLE ONLY approval_merge_request_rules + ADD CONSTRAINT fk_approval_merge_request_rules_on_scan_result_policy_id FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE SET NULL; + ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_b01280dae4 FOREIGN KEY (forked_from_project_id) REFERENCES projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY work_item_colors + ADD CONSTRAINT fk_b15b0912d0 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL; + +ALTER TABLE ONLY sbom_occurrences + ADD CONSTRAINT fk_b1b65d8d17 FOREIGN KEY (source_package_id) REFERENCES sbom_source_packages(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_b1de915a15 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -38114,6 +38892,9 @@ ALTER TABLE ONLY ci_sources_pipelines ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY zoekt_indices + ADD CONSTRAINT fk_bf205d4773 FOREIGN KEY (zoekt_enabled_namespace_id) REFERENCES zoekt_enabled_namespaces(id) ON DELETE SET NULL; + ALTER TABLE ONLY design_management_versions ADD CONSTRAINT fk_c1440b4896 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -38354,6 +39135,9 @@ ALTER TABLE ONLY approval_group_rules_groups ALTER TABLE ONLY emails ADD CONSTRAINT fk_emails_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_epics_issue_id_with_on_delete_nullify FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE SET NULL; + ALTER TABLE ONLY clusters ADD CONSTRAINT fk_f05c5e5a42 FOREIGN KEY (management_project_id) REFERENCES projects(id) ON DELETE SET NULL; @@ -38366,12 +39150,18 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY abuse_reports ADD CONSTRAINT fk_f10de8b524 FOREIGN KEY (resolved_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_f12ef8db70 FOREIGN KEY (timelog_category_id) REFERENCES timelog_categories(id) ON DELETE SET NULL; + ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(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; +ALTER TABLE ONLY zoekt_indices + ADD CONSTRAINT fk_f34800a202 FOREIGN KEY (zoekt_node_id) REFERENCES zoekt_nodes(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; @@ -38390,9 +39180,6 @@ ALTER TABLE ONLY boards_epic_list_user_preferences ALTER TABLE ONLY user_project_callouts ADD CONSTRAINT fk_f62dd11a33 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY approval_merge_request_rules - ADD CONSTRAINT fk_f726c79756 FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE; - ALTER TABLE ONLY workspaces ADD CONSTRAINT fk_f78aeddc77 FOREIGN KEY (cluster_agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; @@ -38684,6 +39471,9 @@ ALTER TABLE ONLY work_item_types ALTER TABLE ONLY user_statuses ADD CONSTRAINT fk_rails_2178592333 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY ai_agent_versions + ADD CONSTRAINT fk_rails_2205f8ca20 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY users_ops_dashboard_projects ADD CONSTRAINT fk_rails_220a0562db FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -38771,6 +39561,9 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER TABLE ONLY error_tracking_error_events ADD CONSTRAINT fk_rails_2c096c0076 FOREIGN KEY (error_id) REFERENCES error_tracking_errors(id) ON DELETE CASCADE; +ALTER TABLE ONLY work_item_colors + ADD CONSTRAINT fk_rails_2c2032206e FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY onboarding_progresses ADD CONSTRAINT fk_rails_2ccfd420cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -38804,15 +39597,15 @@ ALTER TABLE ONLY zoom_meetings ALTER TABLE ONLY container_repositories ADD CONSTRAINT fk_rails_32f7bf5aad FOREIGN KEY (project_id) REFERENCES projects(id); +ALTER TABLE ONLY ai_agents + ADD CONSTRAINT fk_rails_3328b05449 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY alert_management_alert_metric_images ADD CONSTRAINT fk_rails_338e55b408 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE; ALTER TABLE ONLY suggestions ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; -ALTER TABLE ONLY requirements - ADD CONSTRAINT fk_rails_33fed8aa4e FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY metrics_dashboard_annotations ADD CONSTRAINT fk_rails_345ab51043 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -39074,6 +39867,9 @@ ALTER TABLE ONLY approval_merge_request_rules_groups ALTER TABLE ONLY namespace_limits ADD CONSTRAINT fk_rails_5b3f2bc334 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_model_version_metadata + ADD CONSTRAINT fk_rails_5b67cc9107 FOREIGN KEY (model_version_id) REFERENCES ml_model_versions(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_environment_deploy_access_levels ADD CONSTRAINT fk_rails_5b9f6970fe FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -39218,6 +40014,9 @@ ALTER TABLE ONLY ml_experiment_metadata ALTER TABLE ONLY error_tracking_errors ADD CONSTRAINT fk_rails_6b41f837ba FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_model_version_metadata + ADD CONSTRAINT fk_rails_6b8fcb2af1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; @@ -39336,7 +40135,7 @@ ALTER TABLE ONLY dependency_proxy_manifest_states ADD CONSTRAINT fk_rails_806cf07a3c FOREIGN KEY (dependency_proxy_manifest_id) REFERENCES dependency_proxy_manifests(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_job_artifact_states - ADD CONSTRAINT fk_rails_80a9cba3b2 FOREIGN KEY (job_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_80a9cba3b2_p FOREIGN KEY (partition_id, job_artifact_id) REFERENCES ci_job_artifacts(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY approval_merge_request_rules_users ADD CONSTRAINT fk_rails_80e6801803 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; |