Feature request: Multi-column unique constraint
See original GitHub issueCurrently Hasura allows having multiple single field unique constraints like this:
However there is not an option to define multi-column unique constraints.
for instance:
ALTER TABLE someTable
ADD UNIQUE (col1, col2)
Are there any plans to support this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to place a unique constraint for multiple columns ...
Under the table's Attributes tab, you can select any row and double click on the Unique column to assign that row as a...
Read more >Why unique index AND unique constraint (multi columns)?
A unique constraint has to be backed up by an index; though that doesn't have to be unique itself. It's normal to have...
Read more >Example: Adding a Multicolumn Unnamed UNIQUE Constraint
Add an unnamed uniqueness constraint to the columns named column_3 and column_4: ALTER TABLE table_1 ADD UNIQUE (column_3, column_4);
Read more >Unique constraints on multiple columns - CUBA.Platform - Jmix
How do I create unique constraints or indexes on multiple columns? I tried to add manually as follows: But it got reset back...
Read more >5 Examples of a UNIQUE Constraint in a Relational Database
Without deferrable constraints, inserting a row with priority 3 in a table containing 5 rows would require us to re-number the order 5...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
#506 #2148
Delivered in https://github.com/hasura/graphql-engine/releases/tag/v1.0.0-beta.1 about 10 min before this issue was opened
😄
@rmonteroarkus Multi column unique constraints can be created in the console from the Create table and Modify table pages. Are you looking for something else?