knex
SQL query builder for JavaScript
Subcommands
Name | Description |
---|---|
init | Create a fresh knexfile |
migrate:make | Create a named migration file |
migrate:latest | Run all migrations that have not yet been run |
migrate:up | Run the next or the specified migration that has not yet been run |
migrate:rollback | Rollback the last batch of migrations performed |
migrate:down | Undo the last or the specified migration that was already run |
migrate:currentVersion | View the current version for the migration |
migrate:list|migrate:status | List all migrations files with status |
migrate:unlock | Forcibly unlocks the migrations lock table |
seed:make | Create a named seed file |
seed:run | Run seed files |
help | Display help for command |
Options
Name | Description |
---|---|
--version <arg> | Output the version number |
--debug <arg> | Run with debugging |
--knexfile <arg> | Specify the knexfile path |
--knexpath <arg> | Specify the path to knex instance |
--cwd <arg> | Specify the working directory |
--client <arg> | Set DB client without a knexfile |
--connection <arg> | Set DB connection without a knexfile |
--migrations-directory <arg> | Set migrations directory without a knexfile |
--migrations-table-name <arg> | Set migrations table name without a knexfile |
--env <environment> | Environment, default: process.env.NODE_ENV || development |
--esm <arg> | Enable ESM interop |
--specific <arg> | Specify one seed file to execute |
--timestamp-filename-prefix <arg> | Enable a timestamp prefix on name of generated seed files |
--help <arg> | Display help for command |