Forum: Ruby on Rails Database Migration error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Doel S. (Guest)
on 2009-03-27 09:42
This is my first post to the forum,
when I try to run a migration that has a t.column, I get this:

rake aborted!
undefined method `column' for
#<ActiveRecord::ConnectionAdapters::TableDefinition:0x487c194>
Colin L. (Guest)
on 2009-03-27 13:17
(Received via mailing list)
Can you supply some more code please, assuming it is not hundreds of
lines
then show us the migration .rb contents.

2009/3/27 Doel S. <removed_email_address@domain.invalid>
Conrad T. (Guest)
on 2009-03-27 13:39
(Received via mailing list)
On Fri, Mar 27, 2009 at 4:15 AM, Colin L. <removed_email_address@domain.invalid>
wrote:

>> undefined method `column' for
>> #<ActiveRecord::ConnectionAdapters::TableDefinition:0x487c194>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>>
>>
Which version of Rails are you using?

-Conrad
Doel S. (Guest)
on 2009-03-31 16:03
Colin L. wrote:
> Can you supply some more code please, assuming it is not hundreds of
> lines
> then show us the migration .rb contents.
>
> 2009/3/27 Doel S. <removed_email_address@domain.invalid>

I got it fixed by changing t.column to t.<datatype> in my model.rb file
Doel S. (Guest)
on 2009-03-31 16:03
Conrad T. wrote:
> On Fri, Mar 27, 2009 at 4:15 AM, Colin L. <removed_email_address@domain.invalid>
> wrote:
>
>>> undefined method `column' for
>>> #<ActiveRecord::ConnectionAdapters::TableDefinition:0x487c194>
>>> --
>>> Posted via http://www.ruby-forum.com/.
>>>
>>>
>>>
> Which version of Rails are you using?
>
> -Conrad

Rails 2.0.2
Ar C. (Guest)
on 2009-03-31 17:36
Doel S. wrote:
> I got it fixed by changing t.column to t.<datatype> in my model.rb file

You might have been mixing syntaxes:

t.column :first_name, :string

or

t.string :first_name

will work
This topic is locked and can not be replied to.