# Migrations from different Rails versions

**URL:** <https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204>\
**Category:** Rails\
**Created:** [August 6, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204 "2008-08-06T20:24:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [August 6, 2008, 8:24pm UTC](https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204/1 "2008-08-06T20:24:47Z")

</div>

I started my project with Rails 2.0 and created two migrations (wich I  
applied with rake db:migrate as usual). So I have these two files  
under db/migrate:

001\_create\_ads.rb  
002\_rename\_description\_column.rb

Last week I updated my Rails version to 2.1.0 and created a new  
migration file (notice the change in nomenclature):

20080806173923\_ads\_size.rb

Now when I run rake db:migrate I get an error telling me that the Ads  
table already exists, like it’s running my first migration class, but  
I only want to update the data base to the last migration. Am I doing  
something wrong or is this caused by the change in nomenclature or the  
update to a new Rails version?

Thanks.

---

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [August 7, 2008, 11:39am UTC](https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204/2 "2008-08-07T11:39:59Z")

</div>

2008/8/6 Abel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 20080806173923\_ads\_size.rb
> 
> Now when I run rake db:migrate I get an error telling me that the Ads  
> table already exists, like it’s running my first migration class, but  
> I only want to update the data base to the last migration. Am I doing  
> something wrong or is this caused by the change in nomenclature or the  
> update to a new Rails version?

Personally I haven’t updated yet.

Here is information about the new migrations:  
[http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning](http://ryandaigle.com/articles/2008/4/2/what-s-new-in-edge-rails-utc-based-migration-versioning)

One solution is to use the old numbering scheme:  
Add this to environment.rb:

config.active\_record.timestamped\_migrations = false

Then manually rename the newly named migrations to match  
the old scheme and eventually set the version in the schema\_info  
table.

HTH,  
Stefan

---

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [August 7, 2008, 10:56am UTC](https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204/3 "2008-08-07T10:56:03Z")

</div>

Bump.  
I can’t believe none else is having this same problem.

---

<div class="post-metadata">

**Author:** ![Abel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/2acd7d/32.png) [@Abel](https://www.ruby-forum.com/u/Abel)\
**Post date:** [August 7, 2008, 12:56pm UTC](https://www.ruby-forum.com/t/migrations-from-different-rails-versions/145204/4 "2008-08-07T12:56:08Z")

</div>

Turning timestamped migrations off doesn’t work for me (I get an  
error). The only workaround I’ve found so far is executing the  
migration individually, but I’m afraid that could be a problem in  
deployment and in the long term.

People don’t seem to love this new feature though from the comments at  
that page :S

Thanks anyway, Stefan.

On Aug 7, 11:39 am, “Stefan L.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
