It seems you have to manually run rake db:migrate.
Use request.host rather than ENV['URL'] which doesn't actually work.