summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-28 22:33:09 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-28 22:33:09 +0200
commitfd6d12d355e5fb5596168b91affe71eb059c0e99 (patch)
treebc984831db2c7d3a1bb2d55fb2cbd231c708029d /lib/Travelynx/Command
parentcc1a620041ec946ae130055c56f0d35c760c7468 (diff)
Handle inconsistent data when calculating monthly/yearly stats
Closes #11
Diffstat (limited to 'lib/Travelynx/Command')
-rw-r--r--lib/Travelynx/Command/database.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index b5e8cf5..bd22512 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -330,6 +330,19 @@ my @migrations = (
}
$db->update( 'schema_version', { version => 4 } );
},
+
+ # v4 -> v5
+ # Handle inconsistent data (overlapping journeys) in statistics. Introduces
+ # the "inconsistencies" stats key -> rebuild all stats.
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ truncate journey_stats;
+ update schema_version set version = 5;
+ }
+ );
+ },
);
sub setup_db {