The LoopBack relation generator creates a new model relation in the LoopBack application.

$ cd <loopback-app-dir>
$ slc loopback:relation

Then slc will prompt you for:

  • Name of the model to create the relationship from.
  • Relation type (HasMany, BelongsTo, HasAndBelongsToMany, or HasOne).
  • Name of the model to create a relationship with.
  • Name for the relation (property name).

  • Custom foreign key (optional)

  • Whether a "through" model is required.  Repy "Y" to create a HasManyThrough relations

    • Name of the "through" model, if appropriate.