Scope workspace name uniqueness constraint to project_id
Summary
As part of the Organizations Feature Parity self-assessment (Q1.3), index_workspaces_on_name enforces workspace name uniqueness globally with no project_id or organization_id scope. In a Cells environment, organizations on the same cell are prevented from reusing workspace names across org boundaries.
What needs to change
- Replace
index_workspaces_on_namewith one scoped toproject_id(the table's sharding key) - Update
WorkspaceNameGeneratorso its collision check is also scoped toproject_id— currently it checksRemoteDevelopment::Workspace.by_names(workspace_name).exists?globally rather than per-project. Seeee/lib/remote_development/workspace_operations/create/workspace_name_generator.rb#L25
References
Edited by 🤖 GitLab Bot 🤖