File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1621,14 +1621,16 @@ defmodule Ecto.Repo do
16211621 Deletes a struct using its primary key.
16221622
16231623 If the struct has no primary key, `Ecto.NoPrimaryKeyFieldError`
1624- will be raised. If the struct has been removed from db prior to
1625- call, `Ecto.StaleEntryError` will be raised. If more than one
1626- database operation is required, they're automatically wrapped
1627- in a transaction.
1624+ will be raised. If the struct has been removed prior to the call,
1625+ `Ecto.StaleEntryError` will be raised. If more than one database
1626+ operation is required, they're automatically wrapped in a transaction.
16281627
16291628 It returns `{:ok, struct}` if the struct has been successfully
16301629 deleted or `{:error, changeset}` if there was a validation
1631- or a known constraint error.
1630+ or a known constraint error. By default, constraint errors will
1631+ raise the `Ecto.ConstraintError` exception, unless a changeset is
1632+ given as the first argument with the relevant constraints declared
1633+ in it (see `Ecto.Changeset`).
16321634
16331635 ## Options
16341636
You can’t perform that action at this time.
0 commit comments