Skip to content
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

Seeds now support multiple seed directories, with a sorting option. #3357

Conversation

candyapplecorn
Copy link

This pull request enables Knex's seed feature to:

  • Create seeds in specified subdirectories.
  • Run seeds from multiple subdirectories, with a sorting option.

Link to documentation branch's pull request: knex/documentation#220

@candyapplecorn candyapplecorn force-pushed the feature/add-multiple-seed-directory-support branch from 2b3adda to b18f12c Compare July 16, 2019 17:50
@candyapplecorn
Copy link
Author

Closed because actual manual testing revealed this code to not work. Thought the jake cli tests would take care of that for me but nope, there's more to it.

@@ -15,6 +15,75 @@ const KNEX = path.normalize(__dirname + '/../../../bin/cli.js');
const taskList = [];
/* * * TESTS * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

test(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that for new tests cli-testlab tests would be preferable (and easier to write) than using jake directly. See test/cli/migrate-make.spec.js for an example.

Also async/await is preferred over using promise chains.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kibertoad Thanks for the tips. I will use cli-testlab instead. Also, yeah, I definitely didn't want to be using promise chains and Bluebird. I just figured the rest of the codebase was using it, so I should too. So, cool! async await valhalla awaits me

@@ -0,0 +1 @@
exports.seed = (knex, Promise) => {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise is not passed to seeds anymore, I think

@kibertoad
Copy link
Collaborator

Released in 0.21.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants