Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
travelynx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
travelynx
Commits
7e9f6bdf
Unverified
Commit
7e9f6bdf
authored
8 months ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
dumpstops: provide backend name and type rather than just opaque IDs
parent
1bb348ad
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/Travelynx/Command/database.pm
+22
-0
22 additions, 0 deletions
lib/Travelynx/Command/database.pm
lib/Travelynx/Command/dumpstops.pm
+3
-2
3 additions, 2 deletions
lib/Travelynx/Command/dumpstops.pm
lib/Travelynx/Model/Stations.pm
+1
-1
1 addition, 1 deletion
lib/Travelynx/Model/Stations.pm
with
26 additions
and
3 deletions
lib/Travelynx/Command/database.pm
+
22
−
0
View file @
7e9f6bdf
...
...
@@ -2600,6 +2600,28 @@ qq{select distinct checkout_station_id from in_transit where backend_id = 0;}
say
'
If the migration fails due to a deadlock, re-run it after stopping all background workers
';
},
# v55 -> v56
# include backend data in dumpstops command
sub
{
my
(
$db
)
=
@_
;
$db
->
query
(
qq{
create view stations_str as
select stations.name as name,
eva, lat, lon,
backends.name as backend,
iris as is_iris,
hafas as is_hafas,
efa as is_efa,
ris as is_ris
from stations
left join backends
on source = backends.id;
update schema_version set version = 56;
}
);
},
);
sub
sync_stations
{
...
...
This diff is collapsed.
Click to expand it.
lib/Travelynx/Command/dumpstops.pm
+
3
−
2
View file @
7e9f6bdf
...
...
@@ -24,12 +24,13 @@ sub run {
or
die
("
open(
$filename
): $!
\n
");
my
$csv
=
Text::
CSV
->
new
(
{
eol
=>
"
\r\n
"
}
);
$csv
->
combine
(
qw(name eva lat lon
source archived
)
);
$csv
->
combine
(
qw(name eva lat lon
backend is_iris is_hafas
)
);
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 source archived}
}
);
$csv
->
combine
(
@
{
$row
}{
qw{name eva lat lon backend is_iris is_hafas}
}
);
print
$fh
$csv
->
string
;
}
close
(
$fh
);
...
...
This diff is collapsed.
Click to expand it.
lib/Travelynx/Model/Stations.pm
+
1
−
1
View file @
7e9f6bdf
...
...
@@ -164,7 +164,7 @@ sub add_meta {
sub
get_db_iterator
{
my
(
$self
)
=
@_
;
return
$self
->
{
pg
}
->
db
->
select
(
'
stations
',
'
*
'
);
return
$self
->
{
pg
}
->
db
->
select
(
'
stations
_str
',
'
*
'
);
}
sub
get_meta
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment