Coming from rails, I was used to using the on_delete: :restrict option in migrations for foreign keys.
Is there a similar way to do this in Ecto? I could only see :nothing, :delete_all and : nilify_all.
Does this need to be done at the application level instead?
:nothing option - no action is taken, so the error from the foreign key bubbles up.
That makes sense now I think about it! Thanks @michalmuskala
For posterity, this
:restrict option now exists. Docs ATOW: https://hexdocs.pm/ecto_sql/Ecto.Migration.html#references/2