I would like to make sure that there be only one record associating the same two records of my many-to-many association. My intuition is that it would not be possible to create a duplicate many-to-many record in the UI but I fear that through microflow, direct injection or api, it might happen. Is there a native default functionality to consider that the primary key of “implicit” many-to-many associations is always the conjunction of the two parents ids? If not, is there a way to impose this check wihout having to manually recreate the mtm association with an intermediary table? Thanks, Patrick
asked
Patrick Prasquier
1 answers
0
Mendix is already setting unique constraints on database level to ensure that there are no duplicates.
You can see it if you run your application locally on a postgresql database. Mendix is creating a table for each association. You will notice that there is a uniqueness constraint on a many to many association table.