delete player/tribe history and daily player/tribe stats records that are older than 180 days or when a player hasn't logged in for 14 days after the deletion
This commit is contained in:
parent
a7be1449fa
commit
88a8db8575
|
@ -24,7 +24,7 @@ func (h *vacuumServerDBWorker) vacuum() error {
|
|||
defer tx.Close()
|
||||
|
||||
withNonExistentPlayers := h.db.Model(&models.Player{}).Column("id").Where("exists = false and NOW() - deleted_at > '14 days'")
|
||||
withNonExistentTribes := h.db.Model(&models.Tribe{}).Column("id").Where("exists = false and NOW() - deleted_at > '14 days'")
|
||||
withNonExistentTribes := h.db.Model(&models.Tribe{}).Column("id").Where("exists = false and NOW() - deleted_at > '1 days'")
|
||||
|
||||
_, err = tx.Model(&models.PlayerHistory{}).
|
||||
With("players", withNonExistentPlayers).
|
||||
|
|
Reference in New Issue
Block a user