Pivot table or not?


#1

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?


#2

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).


#3

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:


#4

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.