Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 9cb2e4f

Browse files
committed
fix(patch): social migrate upsert error
1 parent d573647 commit 9cb2e4f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/helper/patchs/accounts_social_migrater.exs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ defmodule Helper.Patch.SocialMigrater do
88
def insert_social_records(id, map) when map_size(map) == 0, do: IO.puts("pass robot user")
99

1010
def insert_social_records(id, attrs) do
11-
IO.inspect(id, label: "user id")
12-
IO.inspect(attrs, label: "attrs ")
13-
14-
Social |> ORM.upsert_by([user_id: id], attrs)
11+
attrs = Map.merge(%{user_id: user.id}, attrs)
12+
Social |> ORM.upsert_by([user_id: id], attrs) |> IO.inspect(label: "result")
1513
end
1614
end
1715

0 commit comments

Comments
 (0)