Skip to main content
deleted 22 characters in body
Source Link
David Gouveia
  • 25k
  • 5
  • 89
  • 127

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.

Because of the problem you mentioned which leads to the number of phases to remain fixed, I would simply recommend you keep 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 Users table.

user_id = 1, current_day = 30, current_phase = 3

Besides, that makes things easier than the process you described. Just update those values whenever needed. Other than that, 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 already a history of stat changes in the Logs table. Just keep the total current stats on the Users table for ease of use.

Because of the problem you mentioned I would recommend you to simply keep track of the current day and phase of the user separately, instead of trying to compute it from the Logs table everytime.

The simplest solution is just adding these fields to the Users table:

user_id = 1, current_day = 30, current_phase = 3, other_stats...

That makes things easier than the process you described and you just need to update those values whenever there'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 already have a history of stat changes in the Logs table. Just keep the total current stats on the Users table for ease of use.

Source Link
David Gouveia
  • 25k
  • 5
  • 89
  • 127

Because of the problem you mentioned which leads to the number of phases to remain fixed, I would simply recommend you keep 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 Users table.

user_id = 1, current_day = 30, current_phase = 3

Besides, that makes things easier than the process you described. Just update those values whenever needed. Other than that, 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 already a history of stat changes in the Logs table. Just keep the total current stats on the Users table for ease of use.