mandate published on notes
[akkoma] / lib / pleroma / user_relationship.ex
index 6dfdd2860b1a08429c883ee59e6ef491770391b7..2f77697d4db18b4e1b6ae9b78177f7286e4fbe6f 100644 (file)
@@ -1,5 +1,5 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.UserRelationship do
@@ -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