adding relations to groups and categories tables