question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: Multi-column unique constraint

See original GitHub issue

Currently Hasura allows having multiple single field unique constraints like this: Multiple unique constraints

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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
dimitar-nikovskicommented, Mar 31, 2020

#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

😄

1reaction
rikinskcommented, Mar 31, 2020

@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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found