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
+59-63Lines changed: 59 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,15 +255,18 @@ export class UserService {
255
255
256
256
## Seeding
257
257
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.
258
+
Isn't it exhausting to create some sample data for your database, well this time is over!
259
+
260
+
How does it work? Just create a factory for your entities (models) and a seed script.
260
261
261
262
### 1. Create a factory for your entity
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
+
For all 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 and return it. Those factory files should be in the `src/database/factories` folder and suffixed with `Factory` like `src/database/factories/UserFactory.ts`.
265
+
266
+
Settings can be used to pass some static value into the factory.
0 commit comments