We have a table that can have many of a polymorphic association (Benchmark Target -> Benchmark Filters (polymorphic w. Location, Brand, Post Type etc)).
The issue we are seeing is that the id's between the associations are being tangled as it can't decipher if for example if id 160 belongs to Locations or Brand or PostType or all 3.
Is there a way to force the filters to be paired with a type as well?
I think it's on the way in the form of having constants in joins. Not sure when though.
Personally, I'd just make life easy with views rather than using the base tables.
Good to know there’s a solution on the way.
Could you expand on the ‘views’ part a little more. I’m not sure I entirely understand what you mean.
In each row, you're identifying the type.
You create a view for each type with the where clause in the view limiting it to just the single type.
Then you can join them as you like without worrying about a 2nd join.
I don't use base tables for anything in Metabase preferring to just add an abstraction layer using views. It's much more flexible and much easier to control the security. I'm thinking of changing to a separate schema holding the BI views so that I don't even need to hide the tables as they're not available.