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:
parent
68d60c120d
commit
dceef941c7
8 changed files with 80 additions and 45 deletions
priv/repo/migrations
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue