Migration

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 <table name> 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.

···

--
Posted via 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 :stuck_out_tongue: and you'll want to look into
rename_table at

···

On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar Surabhi <mailtorajuit@gmail.com>wrote:

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 <table name> 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.
--
Posted via http://www.ruby-forum.com/\.

On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar Surabhi

<snip>

ActiveRecord::Migration

This might be quite a bit more accessible:

HTH
Robert

···

On Fri, Mar 19, 2010 at 6:59 AM, Josh Cheek <josh.cheek@gmail.com> 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 :slight_smile:

···

On Fri, Mar 19, 2010 at 5:10 AM, Robert Dober <robert.dober@gmail.com>wrote:

On Fri, Mar 19, 2010 at 6:59 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
> On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar Surabhi
<snip>
> ActiveRecord::Migration
>

This might be quite a bit more accessible:
Active Record Migrations — Ruby on Rails Guides
HTH
Robert

--
Learning without thought is labor lost; thought without learning is
perilous.”
--- Confucius