fixed user delete error by correcting foreign key constraint; updated liveview modals to use component directly & removed deprecated @socket parameters

This commit is contained in:
Adam Piontek 2022-08-14 12:49:25 -04:00
parent 68d60c120d
commit dceef941c7
8 changed files with 80 additions and 45 deletions

View file

@ -0,0 +1,19 @@
defmodule Shift73k.Repo.Migrations.FixShiftsUserIdReference do
use Ecto.Migration
def up do
execute("ALTER TABLE shifts DROP CONSTRAINT shifts_user_id_fkey")
alter table(:shifts) do
modify :user_id, references(:users, on_delete: :delete_all, type: :binary_id)
end
end
def down do
execute("ALTER TABLE shifts DROP CONSTRAINT shifts_user_id_fkey")
alter table(:shifts) do
modify :user_id, references(:users, on_delete: :nothing, type: :binary_id)
end
end
end