ltss
ltss copied to clipboard
DB might end up in an undefined state since there is no rollback on errors in the migration code
A more general approach would likely be to wrap the entire set of upgrade changes to the db in a a BEGIN/COMMIT block, with a ROLLBACK in case of errors, so a robust way would be to autocommit=False for all sql, plus some code to handle the commit. Out of scope for this PR though.
That should (in theory) prevent the db from getting into an undefined state.
Originally posted by @antoonhuiskens in https://github.com/freol35241/ltss/issues/112#issuecomment-1649358473