Some information about “rake”

Introducing rake terminal command line.

  1. Why do we use “rake db:migrate”?
$ rake db:migrate

Because after we use it, the database’s column will be same. Then we can develop the project by different devices.

2. Why do we use “rake db:migrate:status”?

$ rake db:migrate:status

We use this command line to check database’s status. Which files are already migration, and which are not.

3. If we meet database crash, we can use:

$ rake db:drop
$ rake db:create
$ rake db:migrate

The above command line can remove all database which are already migration, create database, then execute migration.

4. If we want to execute migration and seed.rb on same time:

$ rake db:reset

5. If we just want to execute seed.rb

$ rake db:seed

The most important thing is we use “rails” to replace “rake” after Rails 5!