In Node projects, in general I don't recommend using knex.js for data access, but their migrations facility is great.
By default it runs all of your DDL within a transaction, but in some cases where you can't run in a transaction (like adding a value to an enum type) it makes it easy to disable it: https://knexjs.org/#Migrations-API-transactions