how do i use MySql ENUM type? (and is it right for a news feed)
- by Haroldo
I'm creating a table called news_feed, this will log all the actions a user performs.
Lets say I want to store
user1234 deleted article412 at midday
I then need a table like so
timestamp | user_id | subject_type | subject_id | method
.
there would be 5 potential methods to log,
methods = add/edit/delete/update/report
and lets say 2 possible subject_type
subjects = article/comment
I know i could make my own key where 0=add, 1=delete etc etc but this would make my queries cumbersome to use/write as i'd need to keep consulting the key. Is there a MySql type which can read lots of identially values quickly? is this ENUM? how do i use it?!!