Skip to content

Commit 5949dc0

Browse files
authored
update tasks_remaining column in challenge table (#1131)
1 parent 60fbbd8 commit 5949dc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/org/maproulette/framework/repository/ChallengeRepository.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,12 @@ class ChallengeRepository @Inject() (override val db: Database) extends Reposito
173173
SQL(
174174
s"""
175175
|UPDATE challenges
176-
|SET completion_percentage = new_completion_percentage
176+
|SET completion_percentage = new_completion_percentage, tasks_remaining = new_tasks_remaining
177177
|FROM (
178178
| SELECT
179179
| challenges.id AS challenge_id,
180-
| completed_task_counts.completed_tasks * 100 / total_task_counts.total_tasks AS new_completion_percentage
180+
| completed_task_counts.completed_tasks * 100 / total_task_counts.total_tasks AS new_completion_percentage,
181+
| total_task_counts.total_tasks - completed_task_counts.completed_tasks AS new_tasks_remaining
181182
| FROM
182183
| challenges
183184
| JOIN (

0 commit comments

Comments
 (0)