最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin2浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论