Custom emoji should only be created a root group level
During the implementation of !133958 (closed) we noticed it's possible to create custom emoji at child groups, which is not how we designed it.
In the discussion we saw there are currently 42 custom emoji which belong to a namespace that's not the root group:
gitlabhq_production=> select count(*) from custom_emoji inner join namespaces on custom_emoji.namespace_id = namespaces.id where namespaces.parent_id is not null;
count
-------
42
(1 row)
We should disallow creation of custom emoji on non-root groups. And then clean up the existing non-root custom emoji.
Questions
Q. What about groups that are a root group and have custom emoji, but get moved into another group?
A. Ideally we should delete custom emoji when this move happens, but this might be quite annoying. We could also just keep them, but ignore them, so they re-appear when the group is made a root group again. Alternatively moving the custom emoji to the parent group seems like a too complicated solution.