diff --git a/misuzu.php b/misuzu.php index 87c0d9bf..1a54c38d 100644 --- a/misuzu.php +++ b/misuzu.php @@ -75,6 +75,24 @@ if (PHP_SAPI === 'cli') { AND `ur`.`user_id` = u.`user_id` ) '); + + // Deletes expired sessions + Database::exec(' + DELETE FROM `msz_sessions` + WHERE `expires_on` < NOW() + '); + + // Cleans up the login history table + Database::exec(' + DELETE FROM `msz_login_attempts` + WHERE `created_at` < NOW() - INTERVAL 1 YEAR + '); + + // Cleans up the audit log table + Database::exec(' + DELETE FROM `msz_audit_log` + WHERE `log_created` < NOW() - INTERVAL 1 YEAR + '); break; case 'migrate':