Model Relations
Define the relations between this model and others.
By clicking on the Add Relation button you can start generating a new relation.
Selecting one of the existing relations, its details will be shown and you will be able to edit the selected relation.
Relation Details
Define the relations between this model and others.
To define a new relation first select the relation type.
Optionally you can decide if the relation should be added to the model's Api resource, the name to assign to it (default is the name of the target model table name) and when it should be added - only if the relation is loaded on the model (When Loaded) or Always.
Next you need to specify the target model should be put in relation with the selected one.
After selecting the target model, Hatthi wil complete the rest of the relation for you, trying to automatically select the eligible fields (foreign and primary keys) for the relation and define the inverse relation, as the constraints of the current relation.
If there is only one eligible field , you will have no option to edit it, otherwise you will be able to select wich field to use for the relation.
Finally you can chose the name of the relation and if it's going to be eager loaded or not.
Define the behavior of the used field when the related one is updated (ON UPDATE) and deleted (ON DELETE).
The last row describes the inverse relation, which is editable only in the Many to Many relations and works the same way as defiining the main relation. The name of the inverse relation is always editable.
To save the newly added/modified relation, click on the save button ().