add constraints for member-user and member-property
This commit is contained in:
parent
59a8067c09
commit
7c1aeddad4
6 changed files with 537 additions and 0 deletions
|
|
@ -12,6 +12,12 @@ defmodule Mv.Accounts.User do
|
|||
postgres do
|
||||
table "users"
|
||||
repo Mv.Repo
|
||||
|
||||
references do
|
||||
# When a member is deleted, set the user's member_id to NULL
|
||||
# This allows users to continue existing even if their linked member is removed
|
||||
reference :member, on_delete: :nilify
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue