add constraints for member-user and member-property

This commit is contained in:
Moritz 2025-10-16 15:12:30 +02:00
parent 59a8067c09
commit 7c1aeddad4
Signed by: moritz
GPG key ID: 1020A035E5DD0824
6 changed files with 537 additions and 0 deletions

View file

@ -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 """