From 78b2d995ef32b60cfbde086953c5069e327e08a5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 21 Apr 2019 15:46:19 +0200 Subject: Ignore stations without coordinates in distance calculation Reported by @marudor --- lib/Travelynx/Command/database.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/Travelynx') diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm index b8131eb..7a9aed3 100644 --- a/lib/Travelynx/Command/database.pm +++ b/lib/Travelynx/Command/database.pm @@ -123,6 +123,20 @@ my @migrations = ( } ); }, + + # v2 -> v3 + # A bug in the journey distance calculation caused excessive distances to be + # reported for routes covering stations without GPS coordinates. Ensure + # all caches are rebuilt. + sub { + my ($dbh) = @_; + return $dbh->do( + qq{ + delete from journey_stats; + update schema_version set version = 3; + } + ); + }, ); sub setup_db { -- cgit v1.2.3