A guard on the row a foreign key references, keyed by the foreign key
property.
The target wrapper says the condition applies to the referenced entity's
row, not to the foreign key's own value. It is offered on a foreign key
declared with its target type, ForeignKey<Target> or
NullableForeignKey<Target>, that does not back a BelongsTo relationship: a
join table's foreign keys, the child side of a one-way HasMany, and a
standalone foreign key.
A guard on the row a foreign key references, keyed by the foreign key property.
The
targetwrapper says the condition applies to the referenced entity's row, not to the foreign key's own value. It is offered on a foreign key declared with its target type,ForeignKey<Target>orNullableForeignKey<Target>, that does not back a BelongsTo relationship: a join table's foreign keys, the child side of a one-way HasMany, and a standalone foreign key.A bare
ForeignKeypresents UntypedForeignKeyTargetError instead, and a foreign key backing a BelongsTo presents BelongsToForeignKeyTargetError. A key holds either a condition on its own value or atargetguard, never both.Example