defmodule ParticipateApi.Repo.Migrations.AccountBelongsToParticipant do
  use Ecto.Migration

  def change do
    alter table(:accounts) do
      add :participant_id, :integer
    end
  end
end

defmodule ParticipateApi.Repo.Migrations.AccountBelongsToParticipant do
  use Ecto.Migration

  def change do
    alter table(:accounts) do
      add :participant_id, references(:participants, on_delete: :delete_all)
    end
  end
end

Change migration adding participant_id to accounts, so accounts are deleted on participant deletion
Change migration adding participant_id to accounts, so accounts are deleted on participant deletion

participateapp/api,oliverbarnes/participate-new-api,oliverbarnes/participate-api