Modify foreign key in Ecto
I have this original migration that have already been run and sent upstream: create table(:videos) do add :url, :string add :title, :string add :description, :text add :user_id, references(:users, on_delete: :nothing) timestamps end create index(:videos, [:user_id]) Now i wish to change the foreign key on user_id to cascade deletions, so that when a user is deleted all of his associated videos will also be deleted. I have tried the following migration: alter table(:videos) do modify :user_id, references(:users, on_delete: :delete_all) end But this raises an error: (Postgrex.Error) ERROR