fix flaky test_user_relationship_test.exs:81
[akkoma] / lib / pleroma / user_relationship.ex
index a467e9b65ad23c6366286387028341af4a59bd53..2f77697d4db18b4e1b6ae9b78177f7286e4fbe6f 100644 (file)
@@ -67,8 +67,9 @@ defmodule Pleroma.UserRelationship do
       target_id: target.id
     })
     |> Repo.insert(
-      on_conflict: {:replace_all_except, [:id]},
-      conflict_target: [:source_id, :relationship_type, :target_id]
+      on_conflict: {:replace_all_except, [:id, :inserted_at]},
+      conflict_target: [:source_id, :relationship_type, :target_id],
+      returning: true
     )
   end