Has One
Preparing your DB schema
Defining a has_one
relation is almost the same as in the previous Belongs To / Has Many article. adding unique constraint(index)
will mark your relation as has_one
instead of has_many
.
Let's define a User has_one UserProfile (one-to-one)
relation for example.
Resulting Model Relations
With the DB setup above, EzQL will generate the following Model Relation.
Last updated