knex.schema.table('potatoes', (table) => table.string('name'))
const promise1 = knex.schema.renameTable('tomatoes', 'potatoes’);
const promise2 = knex.schema.table('potatoes', (table) => table.string('name’));
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...
I've gone back to the drawing board, and I've updated my post accordingly with a better solution using reduce. I've also used your demo above as an example and credited you in my article (please let me know if that is not OK, and I will take it down).
let finalResult = promises.reduce((current, next) => current.then(next), Promise.resolve());
The beauty of this one-liner is that it works with any promise-like object: you don't need to use BlueBird, you don't even need to use a uniform promise implementation, it'll work with anything that follows the Promises/A+ spec.
In my case, there is a bit less code, but I really do appreciate how your implementation is not Bluebird-dependent.
So instead of promises you could create an array of arrow functions and with promise.each execute one after the other.