Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7837737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:49:28+00:00 2026-06-02T14:49:28+00:00

The difference between rake db:migrate and rake db:reset is pretty clear to me. The

  • 0

The difference between rake db:migrate and rake db:reset is pretty clear to me. The thing which I don’t understand is how rake db:schema:load is different from the former two.

Just to be sure that I am on the same page:

  • rake db:migrate – Runs the migrations which haven’t been run yet.
  • rake db:reset – Clears the database (presumably does a rake db:drop + rake db:create + rake db:migrate) and runs migration on a fresh database.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:49:30+00:00Added an answer on June 2, 2026 at 2:49 pm
    • db:migrate runs (single) migrations that have not run yet.

    • db:create creates the database

    • db:drop deletes the database

    • db:schema:load creates tables and columns within the existing database following schema.rb. This will delete existing data.

    • db:setup does db:create, db:schema:load, db:seed

    • db:reset does db:drop, db:setup

    • db:migrate:reset does db:drop, db:create, db:migrate

    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.


    For rails 3.2.12:

    I just checked the source and the dependencies are like this now:

    • db:create creates the database for the current env

    • db:create:all creates the databases for all envs

    • db:drop drops the database for the current env

    • db:drop:all drops the databases for all envs

    • db:migrate runs migrations for the current env that have not run yet

    • db:migrate:up runs one specific migration

    • db:migrate:down rolls back one specific migration

    • db:migrate:status shows current migration status

    • db:rollback rolls back the last migration

    • db:forward advances the current schema version to the next one

    • db:seed (only) runs the db/seed.rb file

    • db:schema:load loads the schema into the current env’s database

    • db:schema:dump dumps the current env’s schema (and seems to create the db as well)

    • db:setup runs db:create db:schema:load db:seed

    • db:reset runs db:drop db:setup

    • db:migrate:redo runs (db:migrate:down db:migrate:up) or (db:rollback db:migrate) depending on the specified migration

    • db:migrate:reset runs db:drop db:create db:migrate

    For further information please have a look at https://github.com/rails/rails/blob/v3.2.12/activerecord/lib/active_record/railties/databases.rake (for Rails 3.2.x) and https://github.com/rails/rails/blob/v4.0.5/activerecord/lib/active_record/railties/databases.rake (for Rails 4.0.x)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand the difference between a Mock and a Stub. But different types of
What's the difference between the cucumber command and the rake cucumber command? Is there
difference between Linux kernel and UNIX kernel(such as FreeBSD) from programmer's point of view.
I understand the difference between runtime and compile-time and how to differentiate between the
What's the main difference between: rake gems:install rake gems:unpack I had a problem with
I understand the structural difference between a JAR and a WAR file, as is
Related: Difference between CouchDB and Couchbase It is not clear if the clients and
Possible Duplicate: Difference Between Equals and == in which cases equals() works exactly like
The difference between Chr and Char when used in converting types is that one
What is main difference between INSERT INTO table VALUES .. and INSERT INTO table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.