# Migration

**URL:** <https://www.ruby-forum.com/t/migration/185392>\
**Category:** Ruby\
**Created:** [March 19, 2010, 5:57am UTC](https://www.ruby-forum.com/t/migration/185392 "2010-03-19T05:57:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 19, 2010, 5:57am UTC](https://www.ruby-forum.com/t/migration/185392/1 "2010-03-19T05:57:01Z")

</div>

Hi all,

I have migrated with some tables in my application. After some days i  
need to add few more tables to database. The initial tables in database  
have some data. when i try to migrate the database for second time with  
rake db:migrate it is saying the alredy table exist

 and  
rake is aborted. i dont want to loose the old data and i want to add new  
tables to alredy exiested database

how to do this. Please help me.

Regards,  
Rajkumar.

---

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 19, 2010, 7:00am UTC](https://www.ruby-forum.com/t/migration/185392/2 "2010-03-19T07:00:05Z")

</div>

On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> ## Regards, Rajkumar.
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Hi, this is the Ruby Mailing List / Forum, I think you probably want  
Ruby on  
Rails.

A first thought, though, since it sounds like you are talking about  
ActiveRecord, would be that you must have named your tables something  
you  
already have in the db. Check to see if this is the case by looking at  
your  
db/schema.rb file, maybe you already implemented it and forgot. If this  
is  
the case, then you should have another migration which already adds this  
table, you might look and see what you did there to figure out why you  
are  
confused. If it isn’t the case, then you probably need to use more  
creativity when naming your tables 😛 and you’ll want to look into  
rename\_table at

> **[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.

---

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 19, 2010, 12:11pm UTC](https://www.ruby-forum.com/t/migration/185392/3 "2010-03-19T12:11:29Z")

</div>

On Fri, Mar 19, 2010 at 6:59 AM, Josh C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar S.  
>   
> [ActiveRecord::Migration](http://api.rubyonrails.org/classes/ActiveRecord/Migration.html)

This might be quite a bit more accessible:

> **[Active Record Migrations — Ruby on Rails Guides](https://edgeguides.rubyonrails.org/active_record_migrations.html)**
>
> Active Record MigrationsMigrations are a feature of Active Record that allows you to evolve your database schema over time. Rather than write schema modifications in pure SQL, migrations allow you to use a Ruby DSL to describe changes to your...

HTH  
Robert

---

<div class="post-metadata">

**Author:** ![mailtorajuit](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed8c4c/32.png) [@mailtorajuit](https://www.ruby-forum.com/u/mailtorajuit)\
**Post date:** [March 19, 2010, 2:31pm UTC](https://www.ruby-forum.com/t/migration/185392/4 "2010-03-19T14:31:59Z")

</div>

On Fri, Mar 19, 2010 at 5:10 AM, Robert D.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> –  
> Learning without thought is labor lost; thought without learning is  
> perilous.â€  
> — Confucius

They are, I was going to link to both, but the guides don’t talk about  
renaming tables 🙂
