Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 430
aray12 Avatar asked Oct 30 '15 05:10

aray12


1 Answers

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

like image 177
aray12 Avatar answered Oct 21 '22 05:10

aray12