Add Constraints To Mapper #476

indrajitr opened this Issue Apr 16, 2010 · 1 comment


None yet
2 participants

indrajitr commented Apr 16, 2010

from the mailing-list
"You could have a a Constraint trait, which has some method to get the
relevant SQL, as well as an optional function to define the constraint
There would be classes that implement that-Eg: UniqueConstraint,
CheckConstraint, (to be able to do something like CHECK (column > 0)),
NotNullConstraint, PrimaryKeyConstraint, ForeignKeyConstraint (the
last two are already implemented in Mapper in a different Mapper)

Then each Mapped field would have a List[Constraint] of constraints.
In the Schemifier, ensureConstraints would then iterate over each
field (as it does now) and then construct the ALTER TABLE syntax.
The user would of course be able to define their own Application/
Database-specific constraints easily as well. "


This comment has been minimized.

Show comment Hide comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment