cli icon indicating copy to clipboard operation
cli copied to clipboard

How to run seeders that were not imported yet?

Open alex700 opened this issue 5 years ago • 0 comments

I have following sequelize directories structure in my NodeJS application:

database/ ├── migrations/ ├── models/ ├── seeders/

All the scheme migrations are stored in the database/migrations/ directory. I run it as npx sequelize-cli db:migrate each time after schema update.

Then I migrate all the data for prepared schema.

Currently I do it with npx sequelize-cli db:seed --seed filename command to perform particular seeder. I can't migrate them all the same way as schema with no parameters. All the time I have to specify file name. I case I run npx sequelize-cli db:seed:all it causes an error because some of seeders have been migrated previously. This is inconveniently for CI/CD that knows nothing about already migrated seeders.

How can I run seeders that haven't been migrated before without specifying seeder file?

alex700 avatar Jun 05 '20 01:06 alex700