Data subtype/supertype relations

Is there a way to create subtype/supertype relations in the database?

My app has a type Player and a type Team. I am building workflows that would operate identically on both types, so it would be helpful to define a type “Entity” so that anything that is a Player or a Team is also an Entity. That way, I can define the operations globally. Is there a way to define this supertype?

1 Like

Hi, you could create a new datatype called Entity.
Each entity has a field called player that is type player(that links to its player)
Each entity also has a field called Team, type team.

This way you could e.g. do
Make changes to a list of things: Entities.
and in one step edit all those where team is empty and in another all where player is empty.
Same with API workflows.

Or what kind of operations were you thinking of?

Hi, I have the same question, and if there’s a better way of implementing this? Basically, instead of just two subtypes, I have a potentially unknown number of subtypes (with tables to be created in the future). The solution here suggests creating a column for each, which seems wasteful.