Create table for tracking zoekt repository assignments.

We should create an assignments table that can track which nodes a zoekt repository is assigned to. While we are creating this table, we can consider a bit of denormalization to reduce the amount of search time joins.

Questions this table should answer:

  • For every replica, which index should a repository be assigned?
  • For a given project id, what are the zoekt nodes?
# zoekt_repository_index_assignments
zoekt_repo_id (nullable)
zoekt_index_id (nullable)
zoekt_node_id (nullable)
project_id NOT NULL (cascade deleted)
replica_id NOT NULL (unique on project_id, replica_id)
Edited by 🤖 GitLab Bot 🤖