admin管理员组

文章数量:1334162

I've run help mand on sequelize and saw that there are two different mands with the same description:

$ sequelize help:migration:create

Sequelize [Node: 6.9.5, CLI: 2.5.1, ORM: 3.8.0, mysql: 2.5.0]

Loaded configuration file "config\config.json".
Using environment "development".
COMMANDS
    sequelize migration:create   -- Generates a new migration file.
    sequelize migration:generate -- Generates a new migration file.

Is there any difference between them?

I've run help mand on sequelize and saw that there are two different mands with the same description:

$ sequelize help:migration:create

Sequelize [Node: 6.9.5, CLI: 2.5.1, ORM: 3.8.0, mysql: 2.5.0]

Loaded configuration file "config\config.json".
Using environment "development".
COMMANDS
    sequelize migration:create   -- Generates a new migration file.
    sequelize migration:generate -- Generates a new migration file.

Is there any difference between them?

Share Improve this question asked Feb 23, 2017 at 7:52 Max YankovMax Yankov 13.3k15 gold badges72 silver badges143 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 9

No difference: migration:generate is alias for migration:create

https://github./sequelize/cli/blob/master/lib/tasks/migration.js#L20

There is a small difference between create and generate:

  1. Create: This will create migration files that will have empty up and down query objects, in which you can write down your queries to update the database.
  2. Generate: This will generate the migrations with up and down queries by observing your database changes. You can see more of migration on the official sites.

本文标签: