MySQL columns for time tracker app
I'm doing a personal time tracker web app. I'm going ha开发者_StackOverflow社区ve a start, pause and finished buttons on the page to update/create rows in a database. It's built in PHP.
I have: id, user_id, project, notes, created, updated.
I'm wondering what is the best methods to allow people to pause and resume their tasks to get a total time for one task (with all pauses minussed).
What column types and attributes should i set on the columns and what is my best method of updating said columns?
I have created such an app also, in a distant past, in C#. Seems like everybody needs one and the employer does not provide it :-)
On topic, please consider just breaking the task when somebody pauses a task. So actually end the task in the backend. When resuming the task, just start a new task in the backend. On rollup, collect adjacent tasks with same task_id as a single task. Doing this, you might want to apply restrictions on the task duration; split up over day boundaries, have a max time between tasks to call it one task etc. This way you are very flexible dealing with your task Smart on the backend, while your front end is actually based on a simplified model.
精彩评论