diff --git a/README.md b/README.md index 7dc23457..bf00f730 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This is the app running on https://api.travis-ci.org/ ### Database setup -NB detail for how `rake` sets up the database can be found in the `Rakefile`. In the `namespace :db` block you will see the database name is configured according to the RAILS_ENV. If you are using a different configuration you will have to make your own adjustments. +NB detail for how `rake` sets up the database can be found in the `Rakefile`. In the `namespace :db` block you will see the database name is configured using the environment variable RAILS_ENV. If you are using a different configuration you will have to make your own adjustments. 1. `bundle exec rake db:create` 2. for testing 'RAILS_ENV=test bundle exec rake db:create --trace' diff --git a/Rakefile b/Rakefile index f1cee930..5d4cd585 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ namespace :db do env = ENV["RAILS_ENV"] + fail "Cannot run rake db:create in production." if env == 'production' desc "Create and migrate the #{env} database" task :create do sh "createdb travis_#{env}" rescue nil