DEV Community

Khalil Gharbaoui
Khalil Gharbaoui

Posted on

Answer: A migration to add unique constraint to a combination of columns

For completeness sake, and to avoid confusion here are 3 ways of doing the same thing:
Adding a named unique constraint to a combination of columns in Rails 5.2+

Let's say we have Locations table that belongs to an advertiser and has column reference_code and you only want 1 reference…

Top comments (0)