knex-migrate
knex-migrate copied to clipboard
Document differences from knex's implementation
I just spent waaaaay too long discovering that knex migrate:latest
runs multiple migrations in one transaction, while knex-migrate up
will run each migration in a single transaction. This library also seems to ignore exports.config.transaction
. Are there other small differences like this? Could we add a section to the README documenting them?
Yes, do you want to write this section?
I could write up the two I mentioned. Do you know of any others?
When I implemented this library this seemed to be the most offending difference, but this is just how https://github.com/sequelize/umzug works. Personally I think this is better choice because each migration should be independent so it shouldn't matter if you run multiple migrations in transaction or not, and wrapping each migration in transaction makes it more probable for all migrations to pass. Maybe I'm missing something though.
As for disabling transactions this is missing feature that can be implemented, it seems that umzug passes whole migration as this
argument: https://github.com/sequelize/umzug/blob/master/src/migration.js#L115 this could be used here to conditionally apply transaction: https://github.com/sheerun/knex-migrate/blob/master/src/index.js#L111-L117
You could mention this comment when mentioning that there's no support for disabling transactions. For near future I won't have time to implement it.