Because of the problem you mentioned which leads to the number of phases to remain fixed, I would simply recommend you to simply keep track of the current day and phase of the user stored separately, instead of trying to compute it from the Logs table everytime. For instance in
The simplest solution is just adding these fields to the Users table.:
user_id = 1, current_day = 30, current_phase = 3, other_stats...
Besides, thatThat makes things easier than the process you described. Just and you just need to update those values whenever neededthere's a phase change. Other than that, it seems okay to me. Also...
Do you think the stats etc must be separated to another table so there will be a history of stat increases?
If the only way that users can increase their stats is through activities, then you alreadyalready have a history of stat changes in the Logs table. Just keep the total current stats on the Users table for ease of use.