Closed roll closed 4 months ago
Agreed but https://datapackage.org/patterns/unique-constraints/ does not properly explain multi-column unique constraints. I guess these two schemas are equivalent (if so, is there a preferred form?):
{ "fields": [ { "name": "a", "unique": true } ] }
{ "fields": [ { "name": "a" } ], "uniqueKeys": ["a" ] }
but how about these:
{
"fields": [ { "name": "a", "unique": true }, { "name": "b", "unique": true } ],
"uniqueKeys": ["a","b"]
}
{
"fields": [ { "name": "a" }, { "name": "b" } ],
"uniqueKeys": ["a","b"]
}
Maybe require uniqueKeys
to have at least two elements?
I agree I think we need to slightly improve the definition if adding to the specs. The main decision will be clarifying behavior in case of duplication as in above
Overview
Pattern - https://datapackage.org/patterns/unique-constraints/
Although, this pattern doesn't have known implementations, settings multi-column unique values are very vital part of tabular constraints in many systems (e.g. SQL)