Hiya!
I’m modelling a Directus collection calledcustomersas a join table between:
• directus_users
• accounts
Each row represents “this user is a customer of this account”. What I need in the customer collection is:
• account- required
• user- required
• a user can be a customer of many accounts
• an account can have many customers
• but the (account, user) pair must be unique
I initially marked both fields as unique, but that was wrong because it prevents:
• multiple customers on one account
• one user being a customer of multiple accounts
What I actually need is a composite unique constraint/index onaccount + user
My question:
• can this be created fully through Directus schema/data-model tools
• or does it currently require adding the constraint at the database level?
If it is supported in Directus:
• where in the UI is that configured?
If not:
• what is the recommended Directus-friendly approach for this kind of join-table uniqueness?
I’m trying to keep all schema management inside Directus rather than applying manual Postgres constraints where possible.
Thanks in advance for you thoughts!
Dave

Thank you sir. that is what I need. I just really hoped that directus would handle that without having to manage the database separately. I thought that was the point of directus.
– David_O