Handle similar naming between project and its sibling namespaces under same parent namespace
Currently we do not allow 2 child groups to have the same name within a group but we do allow a project to have the same name as any of the child groups if using a different path. E.g.
So now when we introduce a ProjectNamespace
linked to the Project
we need to allow cases where a project may have the same name as one of the groups within its parent namespace, but not more than one.
We can do this by dropping the existing UNIQUE index on name, parent_id
columns in namespaces
table by first adding an UNIQUE index across name, parent_id, type
columns. This will maintain existing unique constraint why still allowing to transition a Project
with same name as a sibling Group
to a ProjectNamespace
.
However that does bring the question of what happens when we will migrate off Project
we will end-up with some child groups having the same name(not the same path as that is validated as being unique across its full path name).