Hello guys, first post here.
Was wondering if this is an expected behaviour as i couldn’t find anything on the docs.
I have an schema like
schema "foo" do
field :name, :string
field :uuid, Ecto.UUID, autogenerated: true
end
When creating an upsert function:
def upsert_foo(attrs \\ %{}) do
%Foo{}
|> Foo.changeset(attrs)
|> Repo.insert(
on_conflict: {:replace_all_except, [:id, :uuid]},
conflict_target: [:uuid]
)
end
Now for some reason, the uuid every time i try to update a Foo object, his uuid is being replaced. How can this be avoided