When you actually look at the code, and how you're executing the functions, it makes sense that Promise.all doesn't magically make your promises run in serial.
Promise.all([
knex.schema.renameTable('tomatoes', 'potatoes'),
knex.schema.table('potatoes', (table) => table.string('name'))
]);
Promise.all doesn't execute the functions - you're doing that yourself. The argument you're passing to Promise.all is just an array of already kicked-off promises. Consider it rewritten as: const promise1 = knex.schema.renameTable('tomatoes', 'potatoes’);
const promise2 = knex.schema.table('potatoes', (table) => table.string('name’));
Promise.all([promise1, promise2]);
Promise.all is just create a new Promise for you that is resolved when the promises you pass in are all resolved.In fact, looking at the 'solution' to this (Promise.series), it still suffers from the same problem. See this demo of it still not working https://tonicdev.com/56da37cb0ba4470d00919c26/56da37cb0ba447...