summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-06-04 22:59:22 +0200
committerDerf Null <derf@finalrewind.org>2023-06-04 22:59:22 +0200
commitbdc05e0b8e01ab8b9fdcd121ee4bbc2657c76b49 (patch)
treecac84b7fbacf6bb889779e6a8dfccd4aa2ab96af /lib/Travelynx/Command
parenta7f17fd9bff65898c0be1e877a3da24d155c2394 (diff)
fix missing join condition in followers view
Diffstat (limited to 'lib/Travelynx/Command')
-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 a54af43..481aab6 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1566,6 +1566,29 @@ my @migrations = (
}
);
},
+
+ # v38 -> v39
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ drop view followers;
+ create view followers as select
+ relations.object_id as self_id,
+ users.id as id,
+ users.name as name,
+ users.accept_follows as accept_follows,
+ r2.predicate as inverse_predicate
+ from relations
+ join users on relations.subject_id = users.id
+ left join relations as r2
+ on relations.subject_id = r2.object_id
+ and relations.object_id = r2.subject_id
+ where relations.predicate = 1;
+ update schema_version set version = 39;
+ }
+ );
+ },
);
# TODO add 'hafas' column to in_transit (and maybe journeys? undo/redo needs something to work with...)