mark ap_id unique_constraint
authorrinpatch <rinpatch@sdf.org>
Tue, 19 Feb 2019 10:52:15 +0000 (13:52 +0300)
committerrinpatch <rinpatch@sdf.org>
Tue, 19 Feb 2019 10:52:15 +0000 (13:52 +0300)
lib/pleroma/user.ex

index 29d2b3d896d20a64e78907df1e847889bbd17651..c2ca58fb9c5bcbfc03e16dd75df92aba1e2cac61 100644 (file)
@@ -237,6 +237,7 @@ defmodule Pleroma.User do
       changeset
       |> put_change(:password_hash, hashed)
       |> put_change(:ap_id, ap_id)
+      |> unique_constraint(:ap_id)
       |> put_change(:following, [followers])
       |> put_change(:follower_address, followers)
     else