dbmigrate icon indicating copy to clipboard operation
dbmigrate copied to clipboard

Use savepoints to allow rerun failed scripts

Open technic opened this issue 6 years ago • 2 comments

When migration script contains a mistake, then part of commands get executed. The second attempt will rerun script from the beginning, which results in executing the commands for the second time. This behavior is wrong.

technic avatar Mar 25 '19 00:03 technic

I guess we could wrap the SQL execution in transactions. People can already add it in the SQL file themselves but that does get repetitive and error prone.

I'll take a PR for it!

Keats avatar Mar 25 '19 09:03 Keats

I can do it for sqlite, but I don't want to test it with other backends :)

technic avatar Mar 25 '19 09:03 technic