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
feat: Run specific seed file (closes #801) #3335
Conversation
test/integration/seed/index.js
Outdated
return knex.seed | ||
.run({ directory: 'test/integration/seed/test' }) | ||
.then(([data]) => { | ||
expect(path.basename(data[0])).to.equal('seed1.js'); | ||
expect(path.basename(data[1])).to.equal('seed2.js'); | ||
}); | ||
}); | ||
|
||
it('should run specific seed file in the configured seed directory', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async-await is preferable for new tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Could you please also create documentation pr in knex documentation repo? |
I've added the additional "sections" in the documentation, but when run dev / build and serving the docs, I don't see the additions even though I do see the additions in the source code of the html. Any help? |
Ok, managed to fix the issue, apparently there is Added: knex/documentation#213 |
Thank you! |
This features allows to run a specific seed file.
It adds an additional cli property
--specific=filename.js
which points to some seed file in the seed directory.usage:
npx knex seed:run --specific=seed-filename.js