Turn on maintenance right before migrations

Fixes #12 and #13.