# Rake db:migrate not applying changes

**URL:** <https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466>\
**Category:** Rails\
**Created:** [September 29, 2006, 1:02pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466 "2006-09-29T13:02:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ambrose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ambrose](https://www.ruby-forum.com/u/ambrose)\
**Post date:** [September 29, 2006, 1:02pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466/1 "2006-09-29T13:02:03Z")

</div>

I am new to RoR. I have started a new project and have successfully  
used migrations to create new tables.

I now want to add a column and have followed the steps outlined in  
“Agile with Rails”:

1. ruby script/generate migration add\_page\_title

2. I open the latest file in migration directory and write and save the  
following code:

* * *

class AddPageTitle \< ActiveRecord::Migration  
def self.up  
add\_column :contents, :page\_title, :string  
end

## def self.down remove\_column :contents, :page\_title end end

1. rake db:migrate

All I get is the echo back (in c:/work/fab1). The table name is  
correct.

1. the schema file that I have open says it has changed and do I want  
to reload it so I click yes but of course there is no change as the  
rake did nothing.

So I am confused as to why nothing is happening. I have also tried to  
add a new table but no luck with that either.

As a last resort I rebooted in the vain hope that it would magically  
sort itself but that hasn’t worked.

So any suggestions as to what might be going wrong or what I might be  
doing incorrectly would be gratefully received.

Cheers

Ambrose

---

<div class="post-metadata">

**Author:** ![ambrose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ambrose](https://www.ruby-forum.com/u/ambrose)\
**Post date:** [September 29, 2006, 2:08pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466/2 "2006-09-29T14:08:08Z")

</div>

On 29 September 2006 14:57, Ambrose wrote:

> So I am confused as to why nothing is happening. I have also tried to  
> add a new table but no luck with that either.
> 
> So any suggestions as to what might be going wrong or what I might be  
> doing incorrectly would be gratefully received.  
> Check schema\_info table in your DB. Ensure that version there is less  
> than the  
> number in your migration’s name.

---

<div class="post-metadata">

**Author:** ![ambrose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ambrose](https://www.ruby-forum.com/u/ambrose)\
**Post date:** [September 29, 2006, 3:04pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466/3 "2006-09-29T15:04:16Z")

</div>

Thanks Maxim

I’ve decided to just start again. I hadn’t done that much and anyway  
there was no data in the db.

Is this a common problem that I can expect to come across?

Cheers

Ambrose

---

<div class="post-metadata">

**Author:** ![ambrose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ambrose](https://www.ruby-forum.com/u/ambrose)\
**Post date:** [September 29, 2006, 4:26pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466/4 "2006-09-29T16:26:33Z")

</div>

Ambrose wrote:

> I’ve decided to just start again. I hadn’t done that much and anyway  
> there was no data in the db.
> 
> Is this a common problem that I can expect to come across?  
> I’m not sure it is YOUR problem or problem at all.

I just have such situations when I have different branches of  
application working with the same database and migrations in different  
branches having the same name (e.g. you have branch A and branch B  
where you develop different functionality and generate migrations -  
migrations will have the same number and the second one that will be  
run will not be executed).

---

<div class="post-metadata">

**Author:** ![ambrose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/8c91f0/32.png) [@ambrose](https://www.ruby-forum.com/u/ambrose)\
**Post date:** [September 29, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/rake-db-migrate-not-applying-changes/70466/5 "2006-09-29T18:27:12Z")

</div>

Thanks Maxim

My application is extremely simple as I am just learning so this was  
only my 4th migration.

Anyway - things seem to be working ok with the new application.
