I am trying to update the deleted_at column in assoc which is has_many, but i am getting error
(Postgrex.Error) ERROR 23502 (not_null_violation) null value in column “uuid” violates not-null constraint
i think its trying to create an assoc but i want to update all assoc
def get_assoc(uuid) do
cr =
Response
|> Repo.get_by(uuid: uuid)
|> Repo.preload(:favorites)
cr
|> Ecto.Changeset.change()
|> Ecto.Changeset.put_assoc(:favorites, [%Favorite{deleted_at: DateTime.utc_now()} | cr.favorites])
|> Repo.update!()
{:ok, cr}
end