Knex Migration & Seeds


Sun Sep 12 2021 03:30:15 GMT+0000 (UTC)

Saved by @huilt1232

yarn knex migrate:make create-XXX
yarn knex migrate:latest 
yarn knex migrate:rollback
yarn knex migrate:down migration_name.js

yarn knex  seed:make -x ts create-teachers-and-students
yarn knex seed:run
knex seed:run --specific=seed-filename.js

init [options]                          Create a fresh knexfile.
migrate:make [options] <name>           Create a named migration file.
migrate:latest [options]                Run all migrations that have not yet been run.
migrate:up                              Run the next migration that has not yet been run.
migrate:rollback [options]              Rollback the last batch of migrations performed.
migrate:down                            Undo the last migration performed.
migrate:currentVersion                  View the current version for the migration.
seed:make [options] <name>              Create a named seed file.
seed:run [options]