Search code examples
scalasqueryl

How to unique Indexes in combination of columns in Squeryl


How can i define unique constraints in combination of columns in squeryl schema?

A  |  B  
2     1  allow
2     3  allow
3     1  allow
2     1  don't allow same with row one

Solution

  • Have you tried this?

    on(authors)(s => declare(      
       columns(s.firstName, s.lastName) are(unique) 
    ))
    

    http://squeryl.org/schema-definition.html