Capistrano and the custom maintenance page

Randuin posted a comment on my previous Lighting fast, zero-downtime deployments with git, capistrano, nginx and Unicorn post asking how I handle database migrations. This is a good question. Database migrations, especially with large datasets, take a long time to run. They also lock your database tables which may cause all kinds of trouble. There’s a quite an easy solution for this, offered to us by Capistrano. Unfortunately it will cause downtime for your site while the migration is running.