Skip to content

Commit

Permalink
🐛 Update migration files to avoid crashes on cascading deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-m-morgan committed Dec 19, 2021
1 parent efa0279 commit 960a514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion priv/repo/migrations/20211210172433_create_task_lists.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule TeamThink.Repo.Migrations.CreateTaskLists do
create table(:task_lists) do
add :name, :string
add :description, :string
add :project_id, references(:projects, on_delete: :nothing)
add :project_id, references(:projects, on_delete: :delete_all)

timestamps()
end
Expand Down
2 changes: 1 addition & 1 deletion priv/repo/migrations/20211211043412_create_tasks.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule TeamThink.Repo.Migrations.CreateTasks do
add :name, :string
add :description, :string
add :status, :string
add :task_list_id, references(:task_lists, on_delete: :nothing)
add :task_list_id, references(:task_lists, on_delete: :delete_all)

timestamps()
end
Expand Down

0 comments on commit 960a514

Please sign in to comment.