db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 361 forks source link

Can't toggle DDL Transactions selectively for individual migrations #819

Open tiagonbotelho opened 1 year ago

tiagonbotelho commented 1 year ago

I'm submitting a...

Current behavior

At the moment we seem to need to use a --non-transactional flag in order to be able to disable DDL transactions from running on a migration. However, it seems that if we only want to do this for a specific migration and not the entire suite, that currently isn't possible.

Expected behavior

Similar to Rails ActiveRecord disable_ddl_transaction! it should be possible to disable the DDL transaction from a specific migration without affecting the entire suite

Environment


db-migrate version: 0.11.3
plugins with versions: `db-migrate-pg` 1.2.2            
wzrdtales commented 1 year ago

yes correct, this is not currently possible. The only ugly work around is issuing a stop to the transaction at the beginning and begin a new at the end of your migration.

tiagonbotelho commented 1 year ago

@wzrdtales thank you for your response, do you happen to know if this would be something that could ever be prioritised to make its way into the package by any chance? 😊

wzrdtales commented 1 year ago

PRs are always welcome if you want to give it a shot :)

This feature request in general would probably not be prioritised very soon. The only other alternative would be a payed feature request, should that be business critical to you/your company.