a table?
like this:
id | fk_id | time_up | time_down
or like this
id | fk_id | time | action(up/down)
First is harder to save second time (down): db have to search for related record (one of thousands? millions?) and update it. Second is harder to use (select both times for one event). All of them are vulnerable to data noize (when you get only one record of both, duplicated record, down-before-up etc). Thus you need an unique event key.
Обсуждают сегодня