You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-47Lines changed: 31 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -256,14 +256,15 @@ export class UserService {
256
256
## Seeding
257
257
258
258
Isn't exhausting to create some sample data into your fresh migrated database, well this time is over!
259
-
How does it work? Just, create a factory for your entities and a seeds script.
259
+
How does it work? Just, create a factory for your entities and a seed script.
260
260
261
261
### 1. Create a factory for your entity
262
262
263
263
For all the entities we want to seed, we need to define a factory. To do so we give you the awesome [faker](https://github.com/marak/Faker.js/) library as a parameter into your factory. Then create your "fake" entity as you would normally do and return it. Those factory files should be in the `src/database/factories` folder and suffixed with `Factory`. Example `src/database/factories/UserFactory.ts`.
264
+
Settings can be used to pass some static value into the factory.
0 commit comments