isn't it t.add_column :new_names, :stirng

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

On 9 April 2010 22:44, Ichiro Saga <[email protected]> wrote:

> Hi, there.  I got an error when I ran the migration to add a filed to
> database.  In the migration file,
>
> def self.up
>  change_table :contents do |t|
>    t.add_string :new_names
>  end
> end
>
> def self.down
>  change_table :contents do |t|
>    t.remove_column :new_names
>  end
> endisn't it a
>
> The error is:
>
> ==  AddMoreFieldsToContents: migrating
> ========================================
> -- change_table(:contents)
> rake aborted!
> An error has occurred, this and all later migrations canceled:
>
> undefined method `add_string' for
> #<ActiveRecord::ConnectionAdapters::Table:0x2b
> b9b74>
>
>
> If I used add_column method, everything ran fine.  I am running Rails
> 2.3.4. Any thoughts on the undefined method error?
> Thanks in advance.
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to