Ensure unique index for LFS objects with repository_type
We already have a uniqueness validation on the LfsObjectsProject model for (project_id, lfs_object_id, repository_type), but we were missing a database-level unique index. This index enforces data integrity at the database level and allows safe usage of ApplicationRecord#safe_find_or_create_by. The index lfs_objects_projects_on_project_id_lfs_object_id_with_repo_type was already created asynchronously in a prior post-deployment migration. https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179613 This commit ensures that it is properly created synchronously for all installations, updating the schema definition accordingly.
显示
加载中
想要评论请 注册 或 登录