@cpxproject/seeders-adonisjs
v1.0.4
Published
Run your seeders like migrations: once, safely, and tracked.
Maintainers
Readme
@cpxproject/seeders-adonisjs
Run your database seeders like migrations in AdonisJS v6 and v7. Once, safely, and tracked.
Features
- One-time execution: Just like migrations, seeders are tracked in a database table.
- Environment safe: Avoid running the same seeder twice by mistake.
- Status tracking: Easily see which seeders have been executed.
Installation
npm install @cpxproject/seeders-adonisjsAfter installation, configure the package:
node ace configure @cpxproject/seeders-adonisjsThen, run the install command to create the tracking table:
node ace cpx-seeder:install
node ace migration:runUsage
Create a new seeder
node ace make:cpx-seeder user_role_seederThis will create a new file in database/cpx_seeders.
Run pending seeders
node ace cpx-seeder:runCheck status
node ace cpx-seeder:statusFresh start (truncate tables and re-run all seeders)
node ace cpx-seeder:fresh --forceLicense
MIT
