Geo: Split file_registry into lfs_object_registry and upload_registry

This comes out of https://gitlab.com/gitlab-org/gitlab-ee/issues/5039.

We already extracted job_artifact_registry in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4719. Ideally we would finish the job.

The benefits are similar https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/4719#note_66231375:

  • Splitting the types into different tables makes logical sense: Uploads are different than LFS
  • Allows for potential optimization by querying for rows > ID, rather than doing a full sweep every time
  • Reduces the index sizes: no need to index on file_type
  • Ordering of columns is better due to migration, leading to better storage packing on disk
Edited by Michael Kozono