summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/maintenance.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-24 08:45:56 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-24 08:45:56 +0200
commitfd314e327d9926da00a433c8192d592334662ba5 (patch)
tree0e84ca82b396d96295cdfe42b59acbb7b2ead518 /lib/Travelynx/Command/maintenance.pm
parent14d2dd52eb11ccdaca648227e185cf06c2940e09 (diff)
maintenance, munin: Use journeys, not user_actions0.15
Diffstat (limited to 'lib/Travelynx/Command/maintenance.pm')
-rw-r--r--lib/Travelynx/Command/maintenance.pm15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Travelynx/Command/maintenance.pm b/lib/Travelynx/Command/maintenance.pm
index 0651a83..3b2462c 100644
--- a/lib/Travelynx/Command/maintenance.pm
+++ b/lib/Travelynx/Command/maintenance.pm
@@ -77,13 +77,14 @@ sub run {
for my $uid (@uids_to_delete) {
say "Deleting uid ${uid}...";
- my $tokens_res = $db->delete( 'tokens', { user_id => $uid } );
- my $stats_res = $db->delete( 'journey_stats', { user_id => $uid } );
- my $actions_res = $db->delete( 'user_actions', { user_id => $uid } );
- my $user_res = $db->delete( 'users', { id => $uid } );
-
- printf( " %d tokens, %d monthly stats, %d actions\n",
- $tokens_res->rows, $stats_res->rows, $actions_res->rows );
+ my $tokens_res = $db->delete( 'tokens', { user_id => $uid } );
+ my $stats_res = $db->delete( 'journey_stats', { user_id => $uid } );
+ my $journeys_res = $db->delete( 'journeys', { user_id => $uid } );
+ my $transit_res = $db->delete( 'in_transit', { user_id => $uid } );
+ my $user_res = $db->delete( 'users', { id => $uid } );
+
+ printf( " %d tokens, %d monthly stats, %d journeys\n",
+ $tokens_res->rows, $stats_res->rows, $journeys_res->rows );
if ( $user_res->rows != 1 ) {
printf STDERR (