add proper :on_delete behavior

This commit is contained in:
2021-09-12 19:06:26 -04:00
committed by oliviasculley
parent 732a4fcbb2
commit bd6c05f619
5 changed files with 13 additions and 9 deletions

View File

@ -17,10 +17,11 @@ defmodule Cannery.Repo.Migrations.CreateUsersAuthTables do
create table(:users_tokens, primary_key: false) do
add :id, :binary_id, primary_key: true
add :user_id, references(:users, type: :binary_id, on_delete: :delete_all), null: false
add :token, :binary, null: false
add :context, :string, null: false
add :sent_to, :string
add :user_id, references(:users, type: :binary_id, on_delete: :delete_all), null: false
timestamps(updated_at: false)
end