Rake db: create vs rake db: create: all

What is the difference between rake db:create and rake db:create:all ?
Both are equally used to create the database for the Rails application.
The most comprehensive rake information for Rails that I can find is in the tutorialpoint , but the commands above are missing.

+5
source share
3 answers
 rake db:create:all creates all the databases for the application (which are defined in database.yml) rake db:create creates the database for the current RAILS_ENV environment. If RAILS_ENV is not specified it defaults to the development and test databases. 

FYI: http://jacopretorius.net/2014/02/all-rails-db-rake-tasks-and-what-they-do.html

+8
source

One creates a database for the current environment.

One creates a database for all environments.

+2
source

If you run rake -T | grep db rake -T | grep db , you will see:

 rake db:create # Creates the database from DATABASE_URL or config/database.yml for the current RAILS_ENV # (use db:create:all to create all databases in the config) 
+2
source

Source: https://habr.com/ru/post/1243877/


All Articles