Run only the next migration file

Can I only run the next migration file using the sequelize-cli file?

I am browsing through the docs and the cli help section, and this does not seem to be such a feature.

For example, when I run the command sequelize db:migrate:status, I have the following:

Loaded configuration file "config/config.js".
Using environment "development".
up   20170301090141-create-something.js
up   20170301133113-create-else.js
up   20170301133821-Update-some-stuff.js
up   20170301135339-create-some-model.js
up   20170307152706-update-some-stuff-two.js
down 20170316142544-create-an-index.js
down 20170421112638-do-some-refactor.js

I would like to run only 20170316142544-create-an-index.js.

Of course, I can delete all the relevant files. Then I add each migration one by one, performing “all” migrations between them. But it seems so barbaric.

+8
source share
2 answers

The fact is that Sequelize performs only those migrations that have not yet been completed, which means waiting.

, sequelize: migrate, , .

+2

, , .

, , , . . , , ,

20190717191628-create-team.js
20190717191909-create-player.js 
          **for**
20190717191909-create-team.js
20190717191628-create-player.js 

db: migrate.

0

Source: https://habr.com/ru/post/1675532/


All Articles