diff options
author | Lain Soykaf <lain@lain.com> | 2024-05-28 17:04:43 +0400 |
---|---|---|
committer | Lain Soykaf <lain@lain.com> | 2024-05-28 18:26:30 +0400 |
commit | a041879eaaa7ca8ca421a89e303f58b5b68bc6da (patch) | |
tree | 9a61a1c90e7ff08d83871854222d7ab41ea697c7 /test | |
parent | cc42b50c5bbbeee066d3d26907eebb488ec6aa3d (diff) | |
download | pleroma-a041879eaaa7ca8ca421a89e303f58b5b68bc6da.tar.gz pleroma-a041879eaaa7ca8ca421a89e303f58b5b68bc6da.zip |
Linting
Diffstat (limited to 'test')
-rw-r--r-- | test/mix/tasks/pleroma/database_test.exs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/test/mix/tasks/pleroma/database_test.exs b/test/mix/tasks/pleroma/database_test.exs index 01fd97e2d..5f5ab5195 100644 --- a/test/mix/tasks/pleroma/database_test.exs +++ b/test/mix/tasks/pleroma/database_test.exs @@ -352,12 +352,17 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do end test "We don't have unexpected tables which may contain objects that are referenced by activities" do - # We can delete orphaned activities. For that we look for the objects they reference in the 'objects', 'activities', and 'users' table. - # If someone adds another table with objects (idk, maybe with separate relations, or collections or w/e), then we need to make sure we - # add logic for that in the 'prune_objects' task so that we don't wrongly delete their corresponding activities. + # We can delete orphaned activities. For that we look for the objects + # they reference in the 'objects', 'activities', and 'users' table. + # If someone adds another table with objects (idk, maybe with separate + # relations, or collections or w/e), then we need to make sure we + # add logic for that in the 'prune_objects' task so that we don't + # wrongly delete their corresponding activities. # So when someone adds (or removes) a table, this test will fail. - # Either the table contains objects which can be referenced from the activities table - # => in that case the prune_objects job should be adapted so we don't delete activities who still have the referenced object. + # Either the table contains objects which can be referenced from the + # activities table + # => in that case the prune_objects job should be adapted so we don't + # delete activities who still have the referenced object. # Or it doesn't contain objects which can be referenced from the activities table # => in that case you can add/remove the table to/from this (sorted) list. @@ -463,7 +468,8 @@ defmodule Mix.Tasks.Pleroma.DatabaseTest do }) |> Repo.insert() - # The remote activities without existing reference, and only the remote activities without existing reference, are deleted + # The remote activities without existing reference, + # and only the remote activities without existing reference, are deleted # if, and only if, we provide the --prune-orphaned-activities option assert length(Repo.all(Activity)) == 5 Mix.Tasks.Pleroma.Database.run(["prune_objects"]) |