Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Commit

Permalink
Overwrite Factory type for foreign keys
Browse files Browse the repository at this point in the history
  • Loading branch information
martindilling authored Jun 11, 2019
1 parent 5e2bfab commit c464576
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/resources/js/fileFactories/Laravel/pipes/FactoryPipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ export default class FactoryPipe extends ModelPipe {
carry[key] = { default: "DATATYPE_NOT_IMPLEMENTED_YET"}
return carry
}, {})

}

/* The seeds assumes related models are available with ID in range [1,10] */
if (attribute.foreign) {
return "random_int(1, 10)";
}

if (!(attribute.dataType in typeMap)) return "BAD_DATATYPE";
Expand Down

0 comments on commit c464576

Please sign in to comment.