-
Notifications
You must be signed in to change notification settings - Fork 11
Improve documentation for default seeder #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, documentation is something that i have to improve on this library. Unfortunately, I don't have enough time to do, at least by the moment. Sorry if you spent too many time trying to make that work, will be great to know what was the problem and add it to docs |
No problem, it's my misunderstanding! In the next days I'll try to open a PR, I'm glad to help :) |
Just for information: Problem
// ./path/to/seeder/RootSeeder.ts
export default class RootSeeder extends Seeder { // <-- note the keyword "default"
async run(connection: Connection): Promise<void> {
// ...
}
}
{
...
"seeders": ["./path/to/seeders/*.ts"],
"defaultSeeder": "RootSeeder"
...
} Error
Expected behaviorIt finds the seeder SolutionsSolution 1(Recommended, in my opinion) Remove the // ./path/to/seeder/RootSeeder.ts
export class RootSeeder extends Seeder { // <-- "default" removed
async run(connection: Connection): Promise<void> {
// ...
}
} Solution 2Update the {
...
"seeders": ["./path/to/seeders/*.ts"],
"defaultSeeder": "default"
...
} Please note that in this case, if you export more than one default seeder only the latest loaded will be executed. |
Mmm I will check this on this week or weekend, don't have too much time. Thanks for your work! |
Sorry about the delay, just merge the PR I will work on this next week, need to improve that functionality |
Hi! Thank you for the awesome work you do maintaining this library.
Please consider to mention in documentation that seeder classes should be exported without default export if the
defaultSeeder
configuration is set to the name of the seeder as you show in examples ("RootSeeder").I just wasted one hour figuring out why my default seeder was not found. Maybe the solution was trivial, but not for me :)
Hope this may help other peoples.
Thank you.
The text was updated successfully, but these errors were encountered: