javascript - What's the difference between "migration:create" and "migration:generate&quo

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

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742339769a4425385.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信