How can I modify the on_delete behaviour of a fk reference in a migration

For anyone coming here via Google, something like this:

alter table("comments") do
  modify :post_id, references(:posts, on_delete: :delete_all),
    from: references(:posts, on_delete: :nothing)
end

Now works as per example here in docs. Not sure exactly when this changed but hopefully saves someone some time. Tested with Ecto 3.10.3