Closed MartinBucko closed 6 years ago
Seeding a realistic set of tables would require seeding foreign keys. This is the main impediment to including a seeder.
I am not aware of a seeder repo which has that capability. Do you have an alternative or thoughts on this?
@eddyystop Its possible to use callback in seeder options. There are called after record was created. This is way how to deal with foreign keys. Check the callback example in configuration docs: https://github.com/thosakwe/feathers-seeder#configuration
Actually use of callbacks is little bit tricky and there is also problem of unpredictable execution order of more seeders. executing order of service array #9
Thanks for this info. I am looking in an alternative direction.
generate fakes
has been introduced (beta) in f+/cli v0.5.1 using generator v0.3.1. https://generator.feathers-plus.com/get-started/#generate-fakes
Idea
It will be cool to have build in template generator for service data seeder build in. :) https://github.com/thosakwe/feathers-seeder
Steps to reproduce
New services generated seed feature.
Expected behavior
First install dependencies:
It should configure app with seed config in app.js:
It should have (in root probably) seeder.js script:
It should generate script service/users.seed.js (example only):
Actual behavior
(No seeder support.) But we have already great tools in our hands. Sure my examples are quick and dirty. It should be optimised.
Thank You :)