summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Command/database.pm
diff options
context:
space:
mode:
authorDerf Null <derf@finalrewind.org>2023-06-04 18:21:36 +0200
committerDerf Null <derf@finalrewind.org>2023-06-04 18:21:36 +0200
commit00eb6af1bd21df42fc41195ceed0fad73bbb5f27 (patch)
treeaea171b00a79681e403292b0ad06b01e5d9a21d1 /lib/Travelynx/Command/database.pm
parent07fe4ecd1f73e7b111d4cd6f6bb8fd390b5f3151 (diff)
expose follows / social interaction in frontend
Diffstat (limited to 'lib/Travelynx/Command/database.pm')
-rw-r--r--lib/Travelynx/Command/database.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Travelynx/Command/database.pm b/lib/Travelynx/Command/database.pm
index 53168bf..3878502 100644
--- a/lib/Travelynx/Command/database.pm
+++ b/lib/Travelynx/Command/database.pm
@@ -1545,6 +1545,27 @@ my @migrations = (
}
);
},
+
+ # v37 -> v38
+ 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
+ where relations.predicate = 1;
+ update schema_version set version = 38;
+ }
+ );
+ },
);
# TODO add 'hafas' column to in_transit (and maybe journeys? undo/redo needs something to work with...)