You should call create_table rather than create.table, I think.
David
On 29/03/06, Robert <REvans@bioevans.com> wrote:> Hi all. I keep having the following error when I invoke the rake
> db:migrate command for Rails 1.1 (Ruby 1.8.2 -- Windows 2000)
>
> ** Invoke db:migrate (first_time)
> ** Invoke environment (first_time)
> ** Execute environment
> ** Execute db:migrate
> == Realtorex: migrating
> ======================================================> -- create()
> rake aborted!
> undefined method `create'' for
> #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0x3472828>
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in
> `send''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:271:in
> `method_missing''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:269:in
> `say_with_time''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:255:in
> `measure''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:255:in
> `say_with_time''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:269:in
> `method_missing''
> ./db/migrate//001_realtorex.rb:3:in `real_up''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
> `send''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
> `migrate''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
> `measure''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:209:in
> `migrate''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:331:in
> `migrate''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:326:in
> `each''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:326:in
> `migrate''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:293:in
> `up''
>
d:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.0/lib/active_record/migration.rb:284:in
> `migrate''
> d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:4
> d:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.0/lib/tasks/databases.rake:3:in
> `call''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in
`execute''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in
`each''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:232:in
`execute''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:202:in
`invoke''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in
> `synchronize''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:195:in
`invoke''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in
`run''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in
`each''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/lib/rake.rb:1719:in
`run''
> d:/ruby/lib/ruby/gems/1.8/gems/rake-0.7.0/bin/rake:7
> d:/ruby/bin/rake:18:in `load''
>
> -----------------------------------------
> My migration file is the following:
>
> class Realtorex < ActiveRecord::Migration
> def self.up
> create.table "pages", :force => true do |t|
> t.column "id", :integer
> t.column "name", :string
> t.column "title", :string
> t.column "body", :text
> t.column "body_html", :text
> t.column "user_id", :integer
> t.column "updated_at", :datetime
> t.column "created_at", :datetime
> end
>
> create.table "users", :force => true do |t|
> t.column "id", :integer
> t.column "login", :string
> t.column "name", :string
> t.column "hashed_password", :string
> t.column "email", :string
> end
>
> create.table "products", :force => true do |t|
> t.column "id", :integer
> t.column "title", :string
> t.column "description", :text
> t.column "price", :decimal
> t.column "availability", :datetime
> end
>
> create.table "line_items", :force => true do |t|
> t.column "id", :integer
> t.column "product_id", :integer
> t.column "order_id", :integer
> t.column "quantity", :integer
> t.column "price", :decimal
> end
>
> create.table "orders", :force => true do |t|
> t.column "id", :integer
> t.column "name", :string
> t.column "email", :string
> t.column "address", :string
> t.column "city", :string
> t.column "state", :string
> t.column "zipcode", :string
> t.column "pay_type", :decimal
> t.column "fulfilled_at", :datetime
> end
> end
>
> def self.down
> drop_table :pages
> drop_table :users
> drop_table :line_items
> drop_table :orders
> end
> end
>
>
> Any clues?
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>