Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Transaction strategy not configurable per script #207
I have an issue where I want to run most scripts inside dbup's per script transaction strategy but some SQL statements simply cannot be run inside a transaction such as CREATE FULLTEXT and ALTER DATABASE,
I tried injecting my own ITransactionStrategy but can't seem to set this due to class access and how the library was written, I also looked into dynamically altering the "TransactionMode" to no success. what I really want is a per script setting/rule that says "No Transaction" which can pass along, are there any ideas?
So far my solution to achieve this will be to create 2 upgrade engines one with per script transactions and one with no transactions and run each engine but this will not ensure a single sequential path of updates.
I think the only solution is to let the scripts deal with the transaction themselves and set DbUp's transaction mode to no transaction.
Otherwise what would the API look like? Also, if you set a script to no transaction and also said to put a transaction around everything, would you throw when trying to build the engine?
Happy to get a PR if you can come up with a nice way to add this in.