sequqlize-cli db:seed:all is working fine, but how to seed only one file? Tried to db:seed:[name-that-i-gave-with-create-command] and db:seed:[full-path-to-seed-file.js] but it doesnt work. It outputs nothing. Docs say sequelize db:seed Run specified seeder But how to do that?
It has a useful command called seed:create , which will generate 2 files for you: a seed . Running this command will result in a file in your seeders directory with code that looks like this: 'use strict'; module. exports = { up: function (queryInterface, Sequelize) { /* Add altering commands here.
To run a specific seed indicate --seed <seed_file_nams.js>
:
sequelize db:seed --seed my_seeder_file.js
We can launch a specific seeder via npx sequelize-cli with the following command :
npx sequelize-cli db:seed --seed my-seeder-file.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With