Qual è la differenza tra rake db:create
e rake db:create:all
?
Entrambi sono ugualmente utilizzati per creare un database per un'applicazione Rails.
Le informazioni più esaustive sul rake per Rails che ho trovato sono a tutorialpoint ma mancano i comandi sopra.rake db: create vs rake db: crea: tutti
5
A
risposta
8
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
2
Uno crea il DB per l'ambiente corrente.
Uno crea il DB per tutti gli ambienti.
2
Se si esegue rake -T | grep db
, si vedrà:
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)