简体   繁体   中英

Sequelize migration order of execution

I can't seem to find the answer to this anywhere. I understand how Sequelize migrations and seeder work, but I have not found anywhere that states if they execute in some particular order. So if I start with a database, make a bunch of migrations, and then decide to initialize a brand new database from the original start point, will it execute the migrations in the exact same order.

I am using sequelize-cli to create migrations, so the file name does begin with a timestamp.

For anyone that sees this in the future, it executes in the default sort order of the folder. So when you use the CLI to create a migration and it appends the timestamp, it guarantees that it will execute in the order they were created

Hope this helps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM