Skip to content
alien edited this page Jan 6, 2015 · 3 revisions

As specified in ORM overlook you may specify column constraints using special macros. Since constraints are binded to the specific columns, first parameter to this macros is a column specification.

#Foreign keys

REFERENCES(COL(Person::cityId), COL(City::id))

#Primary keys

PRIMARY_KEY(COL(Person::id))

#Integrity checks

CHECK(COL(Person::age), COL(Person::age) < 120)

#Indices Only single column indices are supported. Non-unique (i.e. multiple rows may have the same value) indices are created with

INDEX(COL(Person::cityId))

Unique indices

UNIQUE_INDEX(COL(Person::id))
Clone this wiki locally