UPDATE player_war_logs AS total
SET total.regions_captured = (
SELECT SUM(war.regions_captured)
FROM player_war_logs AS war
WHERE war.user_id = total.user_id AND war.relation_id IS NOT NULL
)
WHERE total.relation_id IS NULL;
UPDATE village_war_logs AS total
SET total.regions_captured = (
SELECT SUM(war.regions_captured)
FROM village_war_logs AS war
WHERE war.village_id = total.village_id AND war.relation_id IS NOT NULL
)
WHERE total.relation_id IS NULL;
Queries to fix region capture count on prod:
PvP Win: 100 Battle, 10 Objective (from Defense)
Patrol Win: 25 Battle, 30 Objective (from Defense)
Region Capture: 1500 Objective
Village Capture: 500 Objective
Reinforce:
Infiltrate:
Raid:
Loot: