You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A composite key, in the context of relational databases, is a combination of two or more columns in a table that can be used to uniquely identify each row in the table. Uniqueness is only guaranteed when the columns are combined; when taken individually the columns do not guarantee uniqueness. (Src)
Frappe currently supports only single column unique key constraints
The current possibility for composite key implementations are hacky:
Programatically handle this. I think this breaks the uniformity of where crucial parts of the schema are defined and just spreads it around.
Add an extra column C in your doctype that combines column A + column B (composite key) and add a uniqueness constraint on column C. This adds redundancy.
One challenge is the UI for this:
I could visualise moving the uniqueness configuration outside the Fields table altogether
Perhaps another table that supports specifiying 1 or more columns that form the constraints
The Fields table could then have some basic visual indicator of which rows are unique or part of a uniqueness constraint
The text was updated successfully, but these errors were encountered:
One challenge is the UI for this:
The text was updated successfully, but these errors were encountered: