summaryrefslogtreecommitdiff
path: root/lib/Travelynx
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx')
-rw-r--r--lib/Travelynx/Command/database.pm18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index e561373..c52a0a9 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -558,7 +558,7 @@ my @migrations = (
add column messages_new jsonb;
}
);
- my $res = $db->select( 'journeys', [ 'id', 'messages', 'route' ] );
+ my $res = $db->select( 'journeys', [ 'id', 'messages', 'route' ] );
my $json = JSON->new;
for my $journey ( $res->hashes->each ) {
@@ -689,6 +689,22 @@ my @migrations = (
}
);
},
+
+ # v15 -> v16
+ # Beeline distance calculation now also works when departure or arrival
+ # station do not have geo-coordinates (by resorting to the first/last
+ # station in the route which does have geo-coordinates). Previously,
+ # beeline distances were reported as zero in this case. Clear caches
+ # to recalculate total distances per year / month.
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ truncate journey_stats;
+ update schema_version set version = 16;
+ }
+ );
+ },
);
sub setup_db {