diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-08-31 09:18:49 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-08-31 09:18:49 +0200 |
commit | 8c160f68540d4450db97c2dd6dcda05a67189d9f (patch) | |
tree | e330d58b16eacaff6f48f974c7e37098522747dd /lib | |
parent | 628a5c705b94f0cd2cad952082d278fc5e765a0e (diff) |
Fix wagon order and direction display1.8.9
This was broken by a database migration introduced in
commit f6d56d3134f6045726cb1d4ed8700382575bb686
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travelynx/Command/database.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm index 8df573f..4b23692 100644 --- a/lib/Travelynx/Command/database.pm +++ b/lib/Travelynx/Command/database.pm @@ -780,6 +780,35 @@ my @migrations = ( } ); }, + + # v17 -> v18 + sub { + my ($db) = @_; + $db->query( + qq{ + create or replace view in_transit_str as select + user_id, + train_type, train_line, train_no, train_id, + extract(epoch from checkin_time) as checkin_ts, + extract(epoch from sched_departure) as sched_dep_ts, + extract(epoch from real_departure) as real_dep_ts, + dep_stations.ds100 as dep_ds100, + dep_stations.name as dep_name, + extract(epoch from checkout_time) as checkout_ts, + extract(epoch from sched_arrival) as sched_arr_ts, + extract(epoch from real_arrival) as real_arr_ts, + arr_stations.ds100 as arr_ds100, + arr_stations.name as arr_name, + cancelled, route, messages, user_data, + dep_platform, arr_platform, data + from in_transit + join stations as dep_stations on dep_stations.id = checkin_station_id + left join stations as arr_stations on arr_stations.id = checkout_station_id + ; + update schema_version set version = 18; + } + ); + }, ); sub setup_db { |