summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-08-22 09:10:54 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-08-22 09:10:54 +0200
commit6ca55f83b12e01b0f465ba53e16da74b44600cab (patch)
treeeaf04a3f0851c654fdbc3f6075df5491383be716 /lib
parent6c343f2f68d7754bbd0396cd6328470736031a8e (diff)
Database: create index on real_departure to speed up latest journey queries
Diffstat (limited to 'lib')
-rw-r--r--lib/Travelynx/Command/database.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index e875a27..c6880d0 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1903,9 +1903,19 @@ my @migrations = (
}
);
},
-);
-# TODO add 'hafas' column to in_transit (and maybe journeys? undo/redo needs something to work with...)
+ # v48 -> v49
+ # create indexes for common queries
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ create index uid_real_departure_idx on journeys (user_id, real_departure);
+ update schema_version set version = 49;
+ }
+ );
+ },
+);
sub sync_stations {
my ( $db, $iris_version ) = @_;