2 years ago

Arbitrary Data Points

Posted 2 years ago by elliotk


I have a posts table containing blog posts. I'd like to add some new functionality for example post status (draft / in review / published) and visibility (everyone / logged in users / admin users). I was just going to add 2 columns to my post table, and use integer to identify the current value (eg 0 draft / 1 in review / 2 published).

However, I am wondering, should I create a new table for status and a new table for visibility so that I can have these options stored in the database with also a description of each one and perhaps some other data points?

Should I create a model for this eg PostStatus and PostVisibility or is that overkill?

Any thoughts on handling arbitrary data would be helpful.


Please sign in or create an account to participate in this conversation.