Given an array of functions that return promises, run them one after another (each starting only when the previous finished) using reduce, collecting all results.
applied 001_users
applied 002_orders
applied 003_indexes
3 migrations applied in order
The array holds functions, not promises, so nothing starts early. Each reduce step chains the next migration onto the previous promise – order is guaranteed even though the first one is slowest.
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!
We use Google Analytics cookies to see how LearnFrenzy is used and make it better, and Google AdSense to keep it free.
No analytics or ad cookies are set until you accept. Privacy Policy
·
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!