Reputation: 490163
I just came across a requirement of labeling a user as 1 of 3 different roles. Normally I have used an id, but the roles don't really relate to each other at all.
I had a look at the set datatype, and I added the 3 different options.
Will the database internally just store the index of the set, e.g. if the set is set('a', 'b', 'c')
and I choose a
, will it store a
or the index 0
?
I haven't seen this datatype used before when looking at other people's databases. Is it bad practice? Is using an id (perhaps role_id
which maps to a table roles
) a better idea?
Thanks
Upvotes: 2
Views: 592