Jaka jest różnica między rake db:create
i rake db:create:all
?
Oba są w równym stopniu używane w celu utworzenia bazy danych dla aplikacji Rails.
Najbardziej wyczerpujące informacje na temat prowizji dla Railsów można znaleźć pod numerem tutorialpoint, ale brakuje powyższych poleceń.rake db: create vs rake db: create: wszystko
5
A
Odpowiedz
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
Jedna tworzy DB dla bieżącego środowiska.
Jeden tworzy DB dla wszystkich środowiskach.
2
Jeśli prowadzisz rake -T | grep db
, widać:
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)