-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
SOHELAHMED7/yii2-app-api
#3Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfesthelp wantedExtra attention is neededExtra attention is needed
Description
Faker Controller should be able to detect relations and set the foreign key values accordingly.
Inside this for loop:
Check for model relations (yii2-openapi could add a list of known relations to the Faker class for this) and add relations to existing models selecting the existing foreign keys.
e.g.
$model->user_id = $faker->randomElement(User::find()->select('id')->column());
The perfect implementation would event sort models by relation dependencies before generating fake data.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershacktoberfesthelp wantedExtra attention is neededExtra attention is needed