Add snippet_repository sharding associations
What does this MR do and why?
Add snippet_repository sharding associations
A snippet repository can use either an organization or a project for sharding.
- add associations to both sides
- add before validation hook to make sure the id gets assigned. Snippets have their own validations and multi column constraints about having to have an organization_id or a project_id so we should be OK to assume those exist
- validation that exactly 1 of those ids is set.
There is a follow up MR that will set it at the database level: !206093 (merged)
Comment about verification that the data in production has already been backfilled to make this safe: #550705 (comment 2761415059)
Related to #550705 (closed)
Edited by Hunter Stewart