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

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.

On Thu, Mar 18, 2010 at 10:57 PM, Rajkumar S.
[email protected]wrote:

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
http://api.rubyonrails.org/classes/ActiveRecord/Migration.html

On Fri, Mar 19, 2010 at 6:59 AM, Josh C. [email protected]
wrote:

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

http://api.rubyonrails.org/classes/ActiveRecord/Migration.html

This might be quite a bit more accessible:
http://guides.rubyonrails.org/migrations.html
HTH
Robert

On Fri, Mar 19, 2010 at 5:10 AM, Robert D.
[email protected]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:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs