Fix migrations bug?

Might be more of a question than a PR, but shouldn't this lock release after rerun?