summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/database.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-07-18 15:47:45 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2023-07-18 15:47:45 +0200
commitfef9ebe0b20623c4e21cf720ea379338e6ef978e (patch)
tree549094779c7f73e62b2179ac443efb8ac10cf3e5 /lib/Travelynx/Command/database.pm
parentc81d471728888794c012a74fbb2c85b235dcfc09 (diff)
followee list: show if accounts are following back1.33.3
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 022614b..a47f2ce 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1780,6 +1780,29 @@ my @migrations = (
}
);
},
+
+ # v43 -> v44
+ # show inverse relation in followees as well
+ sub {
+ my ($db) = @_;
+ $db->query(
+ qq{
+ drop view followees;
+ create view followees as select
+ relations.subject_id as self_id,
+ users.id as id,
+ users.name as name,
+ r2.predicate as inverse_predicate
+ from relations
+ join users on relations.object_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 = 44;
+ }
+ );
+ },
);
# TODO add 'hafas' column to in_transit (and maybe journeys? undo/redo needs something to work with...)