Check for db/migrate directory before running rake db:migrate

When using Rails without a database, there is no db/migrate directory and running `rake db:migrate`
generates an error.

This patch adds a check in the `before_restart.rb` template to avoid this error.