Pivot table or not?


I now have the choice of using a pivot table or simply have an array of id’s in a field.

It’s just a bunch of ids i’d like to check if a product is attached to a category and i wonder if its okay to use array or if i must use a pivot table?


Hey @peter! :wave:

I personally always prefer to have a pivot table when both data are dynamics. Sometimes I use an array when it’s static data that refers to internal data (like a status).


Thank you @romain.lanz,

Yes i was looking for the easiest way but another brilliant mind @liam-potter convinced med to “do it right” so i went with a pivot and it’s working great :slight_smile:


Definitely pivot table – and if you need more, pivot model

Otherwise, if you just shove ids into a field, there’s really no (good) way to do a join query, and thus it becomes much more difficult to see wtf is going on if you’re just directly examining data in the DB.