update README.md, set tribe_id = 0 when flagging a player as deleted

This commit is contained in:
Dawid Wysokiński 2020-12-23 17:46:05 +01:00
parent 31ba00a004
commit a95c40399c
2 changed files with 2 additions and 1 deletions

View File

@ -5,7 +5,7 @@ Features:
- Adds automatically new TribalWars servers.
- Fetches TribalWars servers data (players, tribes, ODA, ODD, ODS, OD, conquers, configs).
- Saves daily player/tribe stats, player/tribe history, tribe changes, player name changes, server stats.
- Vacuums the database daily from old player/tribe stats, player/tribe history.
- Cleans the database from old player/tribe stats, player/tribe history.
## Development

View File

@ -279,6 +279,7 @@ func (h *updateServerDataWorker) update() error {
if _, err := tx.Model(&models.Player{}).
Where("NOT (player.id = ANY (?))", pg.Array(ids)).
Set("exists = false").
Set("tribe_id = 0").
Update(); err != nil && err != pg.ErrNoRows {
return errors.Wrap(err, "couldnt update nonexistent players")
}