# Rake db:migrate - doing nothing to the database

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855>\
**Category:** Rails\
**Created:** [February 16, 2007, 8:30pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855 "2007-02-16T20:30:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 8:30pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855/1 "2007-02-16T20:30:41Z")

</div>

when I do the rake db:migrate, with a migration file that is supposed to  
add 3 records to the database, it ends up doing nothing to the database  
at all. here is what happens when I type in: “rake db:migrate --trace”

(in C:/InstantRails/rails\_apps/work/depot)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
\*\* Invoke db:schema:dump (first\_time)  
\*\* Invoke environment  
\*\* Execute db:schema:dump

And then it’s back to the command prompt. Any suggestions as to why it  
is doing nothing?

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 8:56pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855/2 "2007-02-16T20:56:36Z")

</div>

Alright, I made a new migration file, with the same code, and it works  
now. So my new question is this:

If I make a migration file, and then do a rake db:migrate, and then I  
want to change one of the migration files, how can I do that?

It seems that once I’ve done the rake db:migrate, it does not recognize  
any changes to the migration files that are there.

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855/3 "2007-02-16T21:05:04Z")

</div>

In that case, your database was already at the highest schema. When you  
added a new migration, db:migrate saw a migration with a higher version  
number and processed it (Migrate creates a schema\_info table in your  
DB).  
Read up on migrations here:

> **[ActiveRecord::Migration](https://api.rubyonrails.org/classes/ActiveRecord/Migration.html)**
>
> Active Record Migrations Migrations can manage the evolution of a schema used by several physical databases.

Jason

---

<div class="post-metadata">

**Author:** ![jpigford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@jpigford](https://www.ruby-forum.com/u/jpigford)\
**Post date:** [February 16, 2007, 10:15pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-doing-nothing-to-the-database/85855/4 "2007-02-16T22:15:14Z")

</div>

yeah you can either

1. change migrations, then migrate ‘down’ then up
2. add a new migration that changes the schema (better – you can  
rename tables, etc.)

On Feb 16, 12:56 pm, “Josh P.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
