Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ul> <li><strong>db:migrate</strong> runs (single) migrations that have not run yet.</li> <li><strong>db:create</strong> creates the database</li> <li><strong>db:drop</strong> deletes the database</li> <li><p><strong>db:schema:load</strong> creates tables and columns within the (existing) database following schema.rb</p></li> <li><p><strong>db:setup</strong> does db:create, db:schema:load, db:seed</p></li> <li><strong>db:reset</strong> does db:drop, db:setup</li> </ul> <p>Typically, you would use db:migrate after having made changes to the schema via new migration files (this makes sense only if there is already data in the database). db:schema:load is used when you setup a new instance of your app.</p> <p>I hope that helps.</p> <hr> <p>UPDATE for rails 3.2.12:</p> <p>I just checked the source and the dependencies are like this now:</p> <ul> <li><strong>db:create</strong> creates the database for the current env</li> <li><strong>db:create:all</strong> creates the databases for all envs</li> <li><strong>db:drop</strong> drops the database for the current env</li> <li><strong>db:drop:all</strong> drops the databases for all envs</li> <li><strong>db:migrate</strong> runs migrations for the current env that have not run yet</li> <li><strong>db:migrate:up</strong> runs one specific migration</li> <li><strong>db:migrate:down</strong> rolls back one specific migration</li> <li><strong>db:migrate:status</strong> shows current migration status</li> <li><strong>db:rollback</strong> rolls back the last migration</li> <li><strong>db:forward</strong> advances the current schema version to the next one</li> <li><strong>db:seed</strong> (only) runs the db/seed.rb file</li> <li><strong>db:schema:load</strong> loads the schema into the current env's database</li> <li><p><strong>db:schema:dump</strong> dumps the current env's schema (and seems to create the db as well)</p></li> <li><p><strong>db:setup</strong> runs db:schema:load, db:seed</p></li> <li><strong>db:reset</strong> runs db:drop db:setup</li> <li><strong>db:migrate:redo</strong> runs (db:migrate:down db:migrate:up) or (db:rollback db:migrate) depending on the specified migration</li> <li><strong>db:migrate:reset</strong> runs db:drop db:create db:migrate</li> </ul> <p>For further information please have a look at <a href="https://github.com/rails/rails/blob/v3.2.12/activerecord/lib/active_record/railties/databases.rake">https://github.com/rails/rails/blob/v3.2.12/activerecord/lib/active_record/railties/databases.rake</a> (for Rails 3.2.x) and <a href="https://github.com/rails/rails/blob/v4.0.5/activerecord/lib/active_record/railties/databases.rake">https://github.com/rails/rails/blob/v4.0.5/activerecord/lib/active_record/railties/databases.rake</a> (for Rails 4.0.x)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload