Table of Contents
GloballyInstall CLI globally with
$ npm install -g sequelize-cli-typescript
Now you can run CLI using following command anywhere
LocallyInstall CLI locally to your
$ npm install --save sequelize-cli-typescript
You should be able to run CLI with
Differences from Sequelize-Cli (non-TypeScript)With sequelize-cli, the ``
With sequelize-cli-typescript, ``
model:generate`` produces TypeScript files in the same two folders (or again, as specified in your .sequelizerc file). But before you can run ``
db:migrate`` you must compile your migrations. (The step of compiling your migrations is left to you.)
You could compile your migrations along with your other code, or as part of a separate script. After you have compiled your migrations, then you can run ``
migrations-path`` setting, sequelize-cli-typescript has two: ``
migrations-compiled-path``, which default to /migrations and /migrations/compiled respectively.
Sequelize CLI [Node: 6.11.2, CLI: 3.0.0, ORM: 4.8.0] Commands: db:migrate Run pending migrations db:migrate:schema:timestamps:add Update migration table to have timestamps db:migrate:status List the status of all migrations db:migrate:undo Reverts a migration db:migrate:undo:all Revert all migrations ran db:seed Run specified seeder db:seed:undo Deletes data from the database db:seed:all Run every seeder db:seed:undo:all Deletes data from the database db:create Create database specified by configuration db:drop Drop database specified by configuration init Initializes project init:config Initializes configuration init:migrations Initializes migrations init:models Initializes models init:seeders Initializes seeders migration:generate Generates a new migration file [aliases: migration:create] model:generate Generates a model and its migration [aliases: model:create] seed:generate Generates a new seed file [aliases: seed:create] Options: --version Show version number [boolean] --help Show help [boolean]
ContributingSequelize CLI is always looking for contributions. You can help us with fixing bugs, reporting bugs or improving documentation.
Please read contributing documentation
Sequelize SupportCLI v3 fully supports Sequelize v3. Support for Sequelize v4 is still experimental.
Full support for Sequelize v4 is coming soon with Sequelize CLI v4