We write about Ruby on Rails, React.js, React Native, remote work, open source, engineering and design.
In Rails 6.1, Rails will skip modifications to the test database
SKIP_TEST_DATABASE is set to
1 2> bundle exec rake db:create 3Created database 'app_name_development' 4Created database 'app_name_test' 5
1 2> SKIP_TEST_DATABASE=true bundle exec rake db:create 3Created database 'app_name_development' 4
As we can see in the first example, both a
development and a
test database were created, which is unexpected when directly invoking
One obvious solution to this problem is to force the
development environment to only create a
However this solution will break
bin/setup as mentioned in this commit.
Hence the need for an environment variable to skip
test database creation.
Check out the pull request for more details.