Skip to content
Snippets Groups Projects
Verified Commit 7b2766de authored by Kerri Miller's avatar Kerri Miller Committed by GitLab
Browse files

Add sharding key declaration

It appears that this table already includes `project_id`, which we can
use as a sharding key and tick this off the list.
parent f8f1b3af
No related branches found
No related tags found
1 merge request!146565Add sharding key declaration
......@@ -11,3 +11,5 @@ description: a temporary table to store the orphaned notes records that have bee
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/146023
milestone: "16.10"
gitlab_schema: gitlab_main_cell
sharding_key:
project_id: projects
......@@ -21,15 +21,16 @@
let(:allowed_to_be_missing_not_null) do
[
*tables_with_alternative_not_null_constraint,
'internal_ids.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/451900
'internal_ids.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/451900
'labels.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/434356
'labels.group_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/434356
'member_roles.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/444161
'pages_domains.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/442178,
'remote_mirrors.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/444643
'path_locks.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/444643
'remote_mirrors.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/444643
'subscription_add_on_purchases.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/444338
'internal_ids.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/451900
'internal_ids.namespace_id' # https://gitlab.com/gitlab-org/gitlab/-/issues/451900
'temp_notes_backup.project_id' # https://gitlab.com/gitlab-org/gitlab/-/issues/443667'
]
end
......@@ -50,20 +51,21 @@
# 2. It does not yet have a foreign key as the index is still being backfilled
let(:allowed_to_be_missing_foreign_key) do
[
'ci_namespace_monthly_usages.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/321400
'ci_job_artifacts.project_id',
'ci_namespace_monthly_usages.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/321400
'ci_builds_metadata.project_id',
'geo_repository_deleted_events.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/439935
'namespace_descendants.namespace_id',
'p_batched_git_ref_updates_deletions.project_id',
'p_catalog_resource_sync_events.project_id',
'project_data_transfers.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/439201
'search_namespace_index_assignments.namespace_id_non_nullable',
'temp_notes_backup.project_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/443667'
'value_stream_dashboard_counts.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/439555
'zoekt_indices.namespace_id',
'zoekt_repositories.project_identifier',
'zoekt_tasks.project_identifier',
'ci_namespace_monthly_usages.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/321400
'ci_job_artifacts.project_id',
'ci_namespace_monthly_usages.namespace_id', # https://gitlab.com/gitlab-org/gitlab/-/issues/321400
'ci_builds_metadata.project_id',
'search_namespace_index_assignments.namespace_id_non_nullable'
'zoekt_tasks.project_identifier'
]
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment