From 9209cb292ec92e3b09ec5658542fcff367657bcd Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 22 Jul 2023 18:03:46 +0200 Subject: [PATCH] database: stations: make 'ds100' column optional. HAFAS stations do not necessarily have ds100 codes --- lib/Travelynx/Command/database.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm index a47f2ce..10732ec 100644 --- a/lib/Travelynx/Command/database.pm +++ b/lib/Travelynx/Command/database.pm @@ -1803,6 +1803,18 @@ my @migrations = ( } ); }, + + # v44 -> v45 + # prepare for HAFAS support: many HAFAS stations do not have DS100 codes + sub { + my ($db) = @_; + $db->query( + qq{ + alter table stations alter column ds100 drop not null; + update schema_version set version = 45; + } + ); + }, ); # TODO add 'hafas' column to in_transit (and maybe journeys? undo/redo needs something to work with...)