I have a question about designing my db and when it could be useful to create a new table. Let's say I have a hasMany relation and I want to get the rows of a specific column key with groupBy. Till now not a problem, but what is if I want to display the groupBy as 1 result in my view. To be more clear 3 rows with different paths to images and I want to display those 3 objects as one result in my view. Or is it better to create a new table with those paths and retrieve them if needed? Because its unhandy to group the result every time I need them in view?
The grouping only makes sense most of the time to that by a certain state, number, or date. In your case, it sounds that your object can have one or many paths. So it would make sense to make this a separate table that stores the paths for that specific object.
Another solution might be using a JSON column with multiple paths in there, but that depends on what you're doing with them.