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
|
|
@ -42,4 +42,10 @@ defmodule Mv.Membership.Property do
|
|||
calculations do
|
||||
calculate :value_to_string, :string, expr(value[:value] <> "")
|
||||
end
|
||||
|
||||
# Ensure a member can only have one property per property type
|
||||
# For example: A member can have only one "email" property, one "phone" property, etc.
|
||||
identities do
|
||||
identity :unique_property_per_member, [:member_id, :property_type_id]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue