Loading lib/Travelynx/Command/database.pm +23 −0 Original line number Diff line number Diff line Loading @@ -3843,6 +3843,29 @@ qq{select distinct checkout_station_id from in_transit where backend_id = 0;} } ); }, # v74 -> v75 # Include external IDs in dumpstops output sub { my ($db) = @_; $db->query( qq{ create view stations_export as select stations.name as name, stations.eva as eva, lat, lon, backends.name as backend, dbris, efa, iris, hafas, motis, stations_external_ids.external_id as external_id from stations left join backends on source = backends.id left join stations_external_ids on stations.eva = stations_external_ids.eva and stations.source = stations_external_ids.backend_id; update schema_version set version = 75; } ); }, ); sub sync_dbdb { Loading lib/Travelynx/Command/dumpstops.pm +6 −2 Original line number Diff line number Diff line Loading @@ -24,13 +24,17 @@ sub run { or die("open($filename): $!\n"); my $csv = Text::CSV->new( { eol => "\r\n" } ); $csv->combine(qw(name eva lat lon backend is_dbris is_efa is_iris is_hafas is_motis)); $csv->combine( qw(name id extId lat lon backend dbris efa iris hafas motis)); print $fh $csv->string; my $iter = $self->app->stations->get_db_iterator; while ( my $row = $iter->hash ) { $csv->combine( @{$row}{qw{name eva lat lon backend is_dbris is_efa is_iris is_hafas is_motis}} ); @{$row}{ qw{name eva external_id lat lon backend dbris efa iris hafas motis} } ); print $fh $csv->string; } close($fh); Loading lib/Travelynx/Model/Stations.pm +3 −2 Original line number Diff line number Diff line Loading @@ -374,9 +374,10 @@ sub add_meta { } sub get_db_iterator { my ($self) = @_; my ( $self, %opt ) = @_; my $table = $opt{table} // 'stations_export'; return $self->{pg}->db->select( 'stations_str', '*' ); return $self->{pg}->db->select( $table, '*' ); } sub get_meta { Loading Loading
lib/Travelynx/Command/database.pm +23 −0 Original line number Diff line number Diff line Loading @@ -3843,6 +3843,29 @@ qq{select distinct checkout_station_id from in_transit where backend_id = 0;} } ); }, # v74 -> v75 # Include external IDs in dumpstops output sub { my ($db) = @_; $db->query( qq{ create view stations_export as select stations.name as name, stations.eva as eva, lat, lon, backends.name as backend, dbris, efa, iris, hafas, motis, stations_external_ids.external_id as external_id from stations left join backends on source = backends.id left join stations_external_ids on stations.eva = stations_external_ids.eva and stations.source = stations_external_ids.backend_id; update schema_version set version = 75; } ); }, ); sub sync_dbdb { Loading
lib/Travelynx/Command/dumpstops.pm +6 −2 Original line number Diff line number Diff line Loading @@ -24,13 +24,17 @@ sub run { or die("open($filename): $!\n"); my $csv = Text::CSV->new( { eol => "\r\n" } ); $csv->combine(qw(name eva lat lon backend is_dbris is_efa is_iris is_hafas is_motis)); $csv->combine( qw(name id extId lat lon backend dbris efa iris hafas motis)); print $fh $csv->string; my $iter = $self->app->stations->get_db_iterator; while ( my $row = $iter->hash ) { $csv->combine( @{$row}{qw{name eva lat lon backend is_dbris is_efa is_iris is_hafas is_motis}} ); @{$row}{ qw{name eva external_id lat lon backend dbris efa iris hafas motis} } ); print $fh $csv->string; } close($fh); Loading
lib/Travelynx/Model/Stations.pm +3 −2 Original line number Diff line number Diff line Loading @@ -374,9 +374,10 @@ sub add_meta { } sub get_db_iterator { my ($self) = @_; my ( $self, %opt ) = @_; my $table = $opt{table} // 'stations_export'; return $self->{pg}->db->select( 'stations_str', '*' ); return $self->{pg}->db->select( $table, '*' ); } sub get_meta { Loading