I think it may make sense to have scores foreign key to scouts or troops, instead of the other way around. That would enable this to work without requiring to grant anyone the ability to edit scores.
We would then use insert to add a score, instead of update, then just have a sum() function in the select query.
https://github.com/jam941/JamboreeScoreboard/blob/008cdfa4f4e7912721377e556378f7a2ddf1111c/backend/models.py#L40
I think it may make sense to have scores foreign key to scouts or troops, instead of the other way around. That would enable this to work without requiring to grant anyone the ability to edit scores.
We would then use insert to add a score, instead of update, then just have a sum() function in the select query.