summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/database.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-09-24 18:53:04 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-09-24 18:53:04 +0200
commite54130ad6ea805cc04db17a3f614cb4bd25ca3f0 (patch)
tree4ffe1b52cc44a2c75c1614d5c36c244d06716609 /lib/Travelynx/Command/database.pm
parent1c7779e94ef6859348570b9c1b5f2f8a27e32c1f (diff)
optionally show local transit connections as well
Diffstat (limited to 'lib/Travelynx/Command/database.pm')
-rw-r--r--lib/Travelynx/Command/database.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index d580c05..33612c3 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1083,6 +1083,29 @@ my @migrations = (
}
);
},
+
+ # v25 -> v26
+ # travelynx 1.24 adds local transit connections and needs to know targets
+ # for that to work, as local transit does not support checkins yet.
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ create table localtransit (
+ user_id integer not null references users (id) primary key,
+ data jsonb
+ );
+ create view user_transit as select
+ id,
+ use_history,
+ localtransit.data as data
+ from users
+ left join localtransit on localtransit.user_id = id
+ ;
+ update schema_version set version = 26;
+ }
+ );
+ },
);
sub setup_db {