1 | # sequelize/cli [![npm version](https://badge.fury.io/js/sequelize-cli.svg)](https://npmjs.com/package/sequelize-cli) [![CI](https://github.com/sequelize/cli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sequelize/cli/actions/workflows/ci.yml)
|
2 |
|
3 | The [Sequelize](https://sequelize.org) Command Line Interface (CLI)
|
4 |
|
5 | ## Table of Contents
|
6 |
|
7 | - [Installation](#installation)
|
8 | - [Contributing](#contributing)
|
9 | - [Documentation](#documentation)
|
10 |
|
11 | ## Installation
|
12 |
|
13 | Make sure you have [Sequelize](https://sequelize.org) installed. Then install the Sequelize CLI to be used in your project with
|
14 |
|
15 | ```bash
|
16 | npm install --save-dev sequelize-cli
|
17 | ```
|
18 |
|
19 | And then you should be able to run the CLI with
|
20 |
|
21 | ```bash
|
22 | npx sequelize --help
|
23 | ```
|
24 |
|
25 | ### Usage
|
26 |
|
27 | ```bash
|
28 | Sequelize CLI [Node: 10.21.0, CLI: 6.0.0, ORM: 6.1.0]
|
29 |
|
30 | sequelize <command>
|
31 |
|
32 | Commands:
|
33 | sequelize db:migrate Run pending migrations
|
34 | sequelize db:migrate:schema:timestamps:add Update migration table to have timestamps
|
35 | sequelize db:migrate:status List the status of all migrations
|
36 | sequelize db:migrate:undo Reverts a migration
|
37 | sequelize db:migrate:undo:all Revert all migrations ran
|
38 | sequelize db:seed Run specified seeder
|
39 | sequelize db:seed:undo Deletes data from the database
|
40 | sequelize db:seed:all Run every seeder
|
41 | sequelize db:seed:undo:all Deletes data from the database
|
42 | sequelize db:create Create database specified by configuration
|
43 | sequelize db:drop Drop database specified by configuration
|
44 | sequelize init Initializes project
|
45 | sequelize init:config Initializes configuration
|
46 | sequelize init:migrations Initializes migrations
|
47 | sequelize init:models Initializes models
|
48 | sequelize init:seeders Initializes seeders
|
49 | sequelize migration:generate Generates a new migration file [aliases: migration:create]
|
50 | sequelize model:generate Generates a model and its migration [aliases: model:create]
|
51 | sequelize seed:generate Generates a new seed file [aliases: seed:create]
|
52 |
|
53 | Options:
|
54 | --version Show version number [boolean]
|
55 | --help Show help [boolean]
|
56 |
|
57 | Please specify a command
|
58 | ```
|
59 |
|
60 | ## Contributing
|
61 |
|
62 | All contributions are accepted as a PR.
|
63 |
|
64 | - You can file issues by submitting a PR (with test) as a test case.
|
65 | - Implement new feature by submitting a PR
|
66 | - Improve documentation by submitting PR to [Sequelize](https://github.com/sequelize/sequelize)
|
67 |
|
68 | Please read the [contributing guidelines](CONTRIBUTING.md).
|
69 |
|
70 | ## Documentation
|
71 |
|
72 | - [Migrations Documentation](https://sequelize.org/master/manual/migrations.html)
|
73 | - [CLI Options](docs/README.md)
|
74 | - [Frequently Asked Questions](docs/FAQ.md)
|