johanclasson / vso-agent-tasks

Build and Release Tasks for Visual Studio Online and Team Foundation Server
MIT License
20 stars 16 forks source link

UpdateDatabaseWithDbUp - Support/Option for Transactions? #2

Closed sumo300 closed 7 years ago

sumo300 commented 7 years ago

Feature Request: Transaction support and an option to turn them on/off.

http://dbup.readthedocs.io/en/latest/more-info/transactions/

johanclasson commented 7 years ago

Just to be clear. The task use the Transaction per script strategy right now.

I interpret that this feature request is about adding a dropdown where one can select one of the transaction strategies:

But you're right on. This is definitely something that we'd want.

DbUp defaults to No transactions, but I think that Transaction per script should be the default choice. What do you think ?

sumo300 commented 7 years ago

DbUp defaults to No transactions, but I think that Transaction per script should be the default choice. What do you think ?

I think that's a good approach. The expectation from the task perspective would be that at the very least each script has its own transaction. We have a need for the other option of being able to have a single transaction for all scripts. We currently have a batch based method of doing this, but requires modifications to the actual SQL that gets executed so that DDL scripts that don't support transactions are still part of the transaction (e.g. use sp_executesql to execute an ALTER STORED PROCEDURE). What our approach doesn't have is the simple migration tracking.

In the end, if we get the Redgate tools is to use their DB change tracking. However, I've always liked the simplicity of migrations like this. It allows me to deploy a completely nuked and paved environment and still get a functioning app without doing anything outside the act of deploying it.

johanclasson commented 7 years ago

Ok, thanks for your input.