summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/database.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx/Command/database.pm')
-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 {