问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/33429383/sequelize-migration-order-of-execution