How can we create a unique constraint in lift's mapper ?
Asked
Active
Viewed 331 times
1 Answers
7
You can do that by adding the following in your MetaMapper object
override def dbIndexes=UniqueIndex(<name-of-the-field>)::super.dbIndexes
comma separated list of fields can also be provided
for example - UniqueIndex(name,dob)

Channing Walton
- 3,977
- 1
- 30
- 59

vkantiya
- 1,343
- 1
- 8
- 20
-
1perhaps `super.dbIndexs` should instead be `super.dbIndexes`? – Shafique Jamal Sep 28 '14 at 01:29